Component: Button Migration 3: IconTextButton (#7603)

## Summary

Replace all the `IconTextButton`s with `Button`

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7603-WIP-Component-Button-Migraion-3-IconTextButton-2cd6d73d365081b7b742fa2172dc2ba8)
by [Unito](https://www.unito.io)
This commit is contained in:
Alexander Brown
2025-12-18 16:09:56 -08:00
committed by GitHub
parent 6244cf1008
commit 2c26fbb550
26 changed files with 338 additions and 754 deletions

View File

@@ -1,10 +1,20 @@
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import type {
Meta,
StoryObj,
ComponentPropsAndSlots
} from '@storybook/vue3-vite'
import Button from './Button.vue'
import { FOR_STORIES } from '@/components/ui/button/button.variants'
interface ButtonPropsAndStoryArgs extends ComponentPropsAndSlots<
typeof Button
> {
icon?: 'left' | 'right'
}
const { variants, sizes } = FOR_STORIES
const meta: Meta<typeof Button> = {
const meta: Meta<ButtonPropsAndStoryArgs> = {
title: 'Components/Button/Button',
component: Button,
tags: ['autodocs'],
@@ -22,13 +32,19 @@ const meta: Meta<typeof Button> = {
as: { defaultValue: 'button' },
asChild: { defaultValue: false },
default: {
control: { type: 'text' },
defaultValue: 'Button'
},
icon: {
control: { type: 'select' },
options: [undefined, 'left', 'right']
}
},
args: {
variant: 'secondary',
size: 'md',
default: 'Button'
default: 'Button',
icon: undefined
}
}
@@ -36,10 +52,18 @@ export default meta
type Story = StoryObj<typeof meta>
export const SingleButton: Story = {
args: {
variant: 'primary',
size: 'lg'
}
render: (args) => ({
components: { Button },
setup() {
return { args }
},
template: `
<Button v-bind="args">
<i v-if="args.icon === 'left'" class="icon-[lucide--settings]" />
{{args.default}}
<i v-if="args.icon === 'right'" class="icon-[lucide--settings]" />
</Button>`
})
}
function generateVariants() {