Skip to content

Commit

Permalink
adds inactive param to IconButton
Browse files Browse the repository at this point in the history
  • Loading branch information
mperrotti committed Oct 12, 2023
1 parent a37d8a0 commit 3ffaa48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/components/primer/beta/icon_button.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class IconButton < Primer::Component
# @param scheme [Symbol] <%= one_of(Primer::Beta::IconButton::SCHEME_OPTIONS) %>
# @param size [Symbol] <%= one_of(Primer::Beta::Button::SIZE_OPTIONS) %>
# @param disabled [Boolean] Whether or not the button is disabled. If true, this option forces `tag:` to `:button`.
# @param inactive [Boolean] Whether the button looks visually disabled, but can still accept all the same interactions as an enabled button.
# @param type [Symbol] <%= one_of(Primer::Beta::BaseButton::TYPE_OPTIONS) %>
# @param aria-label [String] String that can be read by assistive technology. A label should be short and concise. See the accessibility section for more information.
# @param aria-description [String] String that can be read by assistive technology. A description can be longer as it is intended to provide more context and information. See the accessibility section for more information.
Expand All @@ -45,6 +46,7 @@ def initialize(icon:, scheme: DEFAULT_SCHEME, wrapper_arguments: {}, show_toolti
@system_arguments = system_arguments
@system_arguments[:id] ||= self.class.generate_id
@system_arguments[:disabled] = disabled
@system_arguments[:inactive] = inactive

@system_arguments[:classes] = class_names(
"Button",
Expand Down
3 changes: 3 additions & 0 deletions previews/primer/beta/icon_button_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class IconButtonPreview < ViewComponent::Preview
# @param size select [small, medium, large]
# @param aria_label text
# @param disabled toggle
# @param inactive toggle
# @param tag select [a, summary, button]
# @param icon [Symbol] octicon
# @param show_tooltip toggle
Expand All @@ -18,6 +19,7 @@ def playground(
id: "button-preview",
tag: :button,
disabled: false,
inactive: false,
icon: :plus,
aria_label: "Button",
show_tooltip: true
Expand All @@ -28,6 +30,7 @@ def playground(
id: id,
tag: tag,
disabled: disabled,
inactive: inactive,
icon: icon,
"aria-label": aria_label,
show_tooltip: show_tooltip
Expand Down

0 comments on commit 3ffaa48

Please sign in to comment.