Skip to content

USWDS - Button: Add basic support for usa-icon in buttons #5398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update name of icon setting in storybookJS
  • Loading branch information
James Mejia committed Sep 25, 2023
commit 94cd0f41e551622c5b050618f6ce1da5c5bf6764
6 changes: 3 additions & 3 deletions packages/usa-button/src/usa-button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default {
options: ["button", "reset", "submit"],
control: { type: "radio" },
},
icon_included: {
add_icon: {
name: "Add icon",
defaultValue: false,
type: "boolean",
Expand All @@ -48,7 +48,7 @@ export default {
options: iconNames,
defaultValue: "add_circle_outline",
},
if: { arg: "icon_included" },
if: { arg: "add_icon" },
},
},
};
Expand All @@ -73,7 +73,7 @@ Big.args = BigContent;
export const Icon = Template.bind({});
Icon.args = {
...DefaultContent,
icon_included: true,
add_icon: true,
// Specifying name to preselect value in StorybookJS control.
icon_name: "add_circle_outline",
};
Expand Down
2 changes: 1 addition & 1 deletion packages/usa-button/src/usa-button.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{ additional_attributes }}
>
{{- label -}}
{% if icon_included %}{{- icon -}}{% endif %}
{% if add_icon %}{{- icon -}}{% endif %}
</button>
{% endmacro %}

Expand Down