Skip to content

Commit

Permalink
button story
Browse files Browse the repository at this point in the history
  • Loading branch information
JesmoDev committed Aug 20, 2024
1 parent ed71686 commit 52fc4bc
Showing 1 changed file with 65 additions and 1 deletion.
66 changes: 65 additions & 1 deletion packages/uui-button/lib/uui-button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const Sizing: Story = {
render: args => {
return html`<uui-button
style="font-size: ${args['font-size']}"
${spread(args, cssProps)}></uui-button>`;
${spread(args, cssProps, ['font-size'])}></uui-button>`;
},
};

Expand All @@ -138,3 +138,67 @@ export const Loading: Story = {
state: 'waiting',
},
};

export const ContentAlign: Story = {
args: {
'--uui-button-content-align': 'left',
},
render: args => {
return html`<uui-button
style="width: 400px"
${spread(args, cssProps)}></uui-button>`;
},
};

export const SlottedContent: Story = {
render: args => {
return html`
<uui-icon-registry-essential>
<uui-button ${spread(args, cssProps)}>
<div
style="display: flex; flex-direction: column; align-items: center; gap: 3px">
<uui-icon name="settings"></uui-icon>
Settings
</div>
</uui-button>
</uui-icon-registry-essential>
`;
},
};

export const LooksAndColors: Story = {
render: args => {
const looks = [
'default',
'primary',
'secondary',
'outline',
'placeholder',
] as const;
const colors = ['default', 'positive', 'warning', 'danger'] as const;

const uppercaseFirstLetter = (str: string) =>
str.charAt(0).toUpperCase() + str.slice(1);

return html`
<h4>Looks and colors</h4>
${colors.map(
color => html`
<h5>${uppercaseFirstLetter(color)}</h5>
${looks.map(
look =>
html` <uui-button
${spread(args, cssProps, ['label', 'look', 'color'])}
look=${look}
color=${color}
label=${uppercaseFirstLetter(look)}></uui-button>`,
)}
</div>
`,
)}
`;
},
parameters: {
controls: { exclude: ['label', 'look', 'color'] },
},
};

0 comments on commit 52fc4bc

Please sign in to comment.