Skip to content

Commit

Permalink
fix(button): re add xl size
Browse files Browse the repository at this point in the history
  • Loading branch information
stafyniaksacha committed Apr 9, 2024
1 parent aee787f commit 3de5184
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/plugins/components/button/button.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ export const defaultConfig = {
size: '5',
},
},
xl: {
button: {
text: 'base',
height: '14',
padding: {
x: '10',
y: '4',
},
},
icon: {
size: '5',
},
},
},
rounded: {
none: 'none',
Expand Down
1 change: 1 addition & 0 deletions src/plugins/components/button/button.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Size allows you to change the size of the button.
<Story of={ButtonStories.Sm} />
<Story of={ButtonStories.Md} />
<Story of={ButtonStories.Lg} />
<Story of={ButtonStories.Xl} />
</div>

<br />
Expand Down
10 changes: 9 additions & 1 deletion src/plugins/components/button/button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const meta = {
},
size: {
control: { type: 'select' },
options: ['sm', 'md', 'lg'],
options: ['sm', 'md', 'lg', 'xl'],
defaultValue: 'md',
},
rounded: {
Expand Down Expand Up @@ -191,6 +191,14 @@ export const Lg: Story = {
rounded: 'sm',
},
}
export const Xl: Story = {
name: 'Size: xl',
args: {
size: 'xl',
label: 'Button',
rounded: 'sm',
},
}
// #endregion

// #region Variants:solid
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/components/button/button.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface ButtonProps extends Record<string, unknown> {
label?: string
loading?: boolean
badge?: boolean
size?: 'sm' | 'md' | 'lg'
size?: 'sm' | 'md' | 'lg' | 'xl'
rounded?: 'none' | 'sm' | 'md' | 'lg' | 'full'
variant?: 'solid' | 'pastel' | 'outline'
color?:
Expand Down
1 change: 1 addition & 0 deletions src/plugins/components/button/button.variants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const size = {
sm: 'nui-button-sm',
md: 'nui-button-md',
lg: 'nui-button-lg',
xl: 'nui-button-xl',
} as const satisfies ButtonVariant<'size'>

export const rounded = {
Expand Down
9 changes: 9 additions & 0 deletions src/plugins/components/button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ export default plugin(({ addComponents, theme }) => {
{},
},
},
'&.nui-button-xl': {
[`@apply h-${config.size.xl.button.height} px-${config.size.xl.button.padding.x} py-${config.size.xl.button.padding.y} text-${config.size.xl.button.text}`]:
{},

'.nui-button-icon': {
[`@apply w-${config.size.xl.icon.size} h-${config.size.xl.icon.size}`]:
{},
},
},
// #endregion

// #region Rounded
Expand Down

0 comments on commit 3de5184

Please sign in to comment.