Skip to content

Commit

Permalink
feat(Button): add variant list to button
Browse files Browse the repository at this point in the history
  • Loading branch information
lukicenturi committed Jan 2, 2024
1 parent fd9974a commit f4e0edf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/components/buttons/button/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const meta: Meta<PropsAndLabel> = {
color: { control: 'select', options: contextColors },
variant: {
control: 'select',
options: ['default', 'outlined', 'text', 'fab'],
options: ['default', 'outlined', 'text', 'fab', 'list'],
table: { category: 'Shape' },
},
rounded: { control: 'boolean', table: { category: 'Shape' } },
Expand Down Expand Up @@ -196,6 +196,13 @@ export const ErrorOutlinedDisabled: Story = {
},
};

export const List: Story = {
args: {
label: 'List',
variant: 'list',
},
};

export const FloatingActionButton: Story = {
args: {
label: 'Floating Action Button',
Expand Down
7 changes: 6 additions & 1 deletion src/components/buttons/button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface Props<T = undefined> {
color?: ContextColorsType;
rounded?: boolean;
elevation?: number | string | null;
variant?: 'default' | 'outlined' | 'text' | 'fab';
variant?: 'default' | 'outlined' | 'text' | 'fab' | 'list';
icon?: boolean;
active?: boolean;
size?: 'sm' | 'lg';
Expand Down Expand Up @@ -89,6 +89,7 @@ const slots = useSlots();
[css._rounded]: rounded,
[css.icon]: icon,
[css.active]: active,
[css.text]: variant === 'list',
},
]"
:disabled="disabled || loading"
Expand Down Expand Up @@ -257,6 +258,10 @@ const slots = useSlots();
}
}
&.list {
@apply p-3 rounded-none w-full justify-start text-left;
}
&.icon {
@apply rounded-full px-3 py-3;
Expand Down

0 comments on commit f4e0edf

Please sign in to comment.