@polymarbot/nuxt-layer-shadcn-ui 0.3.10 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/components/ui/Accordion/index.stories.ts +43 -15
- package/app/components/ui/AdminLayout/index.stories.ts +6 -14
- package/app/components/ui/Alert/index.stories.ts +32 -2
- package/app/components/ui/AlertDialog/index.stories.ts +114 -5
- package/app/components/ui/AsyncDataTable/index.stories.ts +36 -2
- package/app/components/ui/Avatar/index.stories.ts +58 -4
- package/app/components/ui/Badge/index.stories.ts +48 -3
- package/app/components/ui/Breadcrumb/index.stories.ts +8 -19
- package/app/components/ui/Button/index.stories.ts +116 -7
- package/app/components/ui/ButtonGroup/index.stories.ts +63 -4
- package/app/components/ui/Card/index.stories.ts +40 -14
- package/app/components/ui/Checkbox/index.stories.ts +53 -3
- package/app/components/ui/CopyButton/index.stories.ts +77 -5
- package/app/components/ui/DataTable/index.stories.ts +184 -11
- package/app/components/ui/DatePicker/index.stories.ts +56 -7
- package/app/components/ui/DateRangePicker/index.stories.ts +40 -5
- package/app/components/ui/Divider/index.stories.ts +18 -15
- package/app/components/ui/Drawer/index.stories.ts +115 -16
- package/app/components/ui/Drawer/index.vue +27 -12
- package/app/components/ui/Dropdown/index.stories.ts +72 -54
- package/app/components/ui/Dropdown/index.vue +5 -8
- package/app/components/ui/Dropdown/types.ts +3 -8
- package/app/components/ui/FormItem/index.stories.ts +33 -45
- package/app/components/ui/Help/index.stories.ts +34 -2
- package/app/components/ui/Icon/index.stories.ts +41 -2
- package/app/components/ui/Input/index.stories.ts +73 -14
- package/app/components/ui/InputCurrency/index.stories.ts +20 -65
- package/app/components/ui/InputNumber/index.stories.ts +31 -58
- package/app/components/ui/InputOtp/index.stories.ts +41 -9
- package/app/components/ui/InputPercent/index.stories.ts +3 -7
- package/app/components/ui/InputRange/index.stories.ts +51 -4
- package/app/components/ui/Loading/index.stories.ts +16 -1
- package/app/components/ui/Markdown/index.stories.ts +9 -0
- package/app/components/ui/Modal/index.stories.ts +133 -16
- package/app/components/ui/Modal/index.vue +27 -12
- package/app/components/ui/ModalContent/index.stories.ts +35 -11
- package/app/components/ui/PageCard/index.stories.ts +154 -56
- package/app/components/ui/Pagination/index.stories.ts +79 -18
- package/app/components/ui/Pagination/index.vue +4 -1
- package/app/components/ui/Popover/index.stories.ts +73 -3
- package/app/components/ui/Popover/index.vue +67 -4
- package/app/components/ui/Popover/types.ts +5 -2
- package/app/components/ui/Qrcode/index.stories.ts +32 -2
- package/app/components/ui/RadioCardGroup/index.stories.ts +45 -6
- package/app/components/ui/RadioGroup/index.stories.ts +64 -35
- package/app/components/ui/ScrollArea/index.stories.ts +21 -23
- package/app/components/ui/SearchSelect/index.stories.ts +73 -24
- package/app/components/ui/Select/index.stories.ts +121 -6
- package/app/components/ui/Skeleton/index.stories.ts +34 -2
- package/app/components/ui/Slider/index.stories.ts +67 -4
- package/app/components/ui/Surface/index.stories.ts +86 -5
- package/app/components/ui/Surface/index.vue +115 -2
- package/app/components/ui/Surface/types.ts +2 -0
- package/app/components/ui/Switch/index.stories.ts +46 -0
- package/app/components/ui/Tabs/index.stories.ts +61 -47
- package/app/components/ui/Tag/index.stories.ts +45 -3
- package/app/components/ui/Textarea/index.stories.ts +61 -15
- package/app/components/ui/Toast/index.stories.ts +77 -3
- package/app/components/ui/Tooltip/index.stories.ts +60 -2
- package/app/components/ui/WebLink/index.stories.ts +53 -15
- package/package.json +2 -2
|
@@ -32,6 +32,9 @@ const meta = {
|
|
|
32
32
|
iconPosition: { control: 'select', options: [ 'start', 'end' ]},
|
|
33
33
|
loading: { control: 'boolean' },
|
|
34
34
|
disabled: { control: 'boolean' },
|
|
35
|
+
href: { control: 'text' },
|
|
36
|
+
target: { control: 'text' },
|
|
37
|
+
class: { control: 'text' },
|
|
35
38
|
},
|
|
36
39
|
args: {
|
|
37
40
|
variant: 'default',
|
|
@@ -41,6 +44,9 @@ const meta = {
|
|
|
41
44
|
iconPosition: 'start',
|
|
42
45
|
loading: false,
|
|
43
46
|
disabled: false,
|
|
47
|
+
href: '',
|
|
48
|
+
target: '',
|
|
49
|
+
class: '',
|
|
44
50
|
},
|
|
45
51
|
render: args => ({
|
|
46
52
|
components: { Button },
|
|
@@ -57,7 +63,23 @@ const noControls = { controls: { disable: true }} satisfies Story['parameters']
|
|
|
57
63
|
export const Default: Story = {}
|
|
58
64
|
|
|
59
65
|
export const Variants: Story = {
|
|
60
|
-
parameters:
|
|
66
|
+
parameters: {
|
|
67
|
+
...noControls,
|
|
68
|
+
docs: {
|
|
69
|
+
source: {
|
|
70
|
+
code: `
|
|
71
|
+
<template>
|
|
72
|
+
<Button variant="default">default</Button>
|
|
73
|
+
<Button variant="destructive">destructive</Button>
|
|
74
|
+
<Button variant="outline">outline</Button>
|
|
75
|
+
<Button variant="secondary">secondary</Button>
|
|
76
|
+
<Button variant="ghost">ghost</Button>
|
|
77
|
+
<Button variant="link">link</Button>
|
|
78
|
+
</template>
|
|
79
|
+
`.trim(),
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
61
83
|
render: () => ({
|
|
62
84
|
components: { Button },
|
|
63
85
|
setup: () => ({ variants }),
|
|
@@ -70,7 +92,23 @@ export const Variants: Story = {
|
|
|
70
92
|
}
|
|
71
93
|
|
|
72
94
|
export const Sizes: Story = {
|
|
73
|
-
parameters:
|
|
95
|
+
parameters: {
|
|
96
|
+
...noControls,
|
|
97
|
+
docs: {
|
|
98
|
+
source: {
|
|
99
|
+
code: `
|
|
100
|
+
<template>
|
|
101
|
+
<Button size="sm">sm</Button>
|
|
102
|
+
<Button size="default">default</Button>
|
|
103
|
+
<Button size="lg">lg</Button>
|
|
104
|
+
<Button size="icon-sm"><Icon name="plus" /></Button>
|
|
105
|
+
<Button size="icon"><Icon name="plus" /></Button>
|
|
106
|
+
<Button size="icon-lg"><Icon name="plus" /></Button>
|
|
107
|
+
</template>
|
|
108
|
+
`.trim(),
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
74
112
|
render: () => ({
|
|
75
113
|
components: { Button, Icon },
|
|
76
114
|
setup: () => ({ sizes }),
|
|
@@ -86,7 +124,21 @@ export const Sizes: Story = {
|
|
|
86
124
|
}
|
|
87
125
|
|
|
88
126
|
export const WithIcons: Story = {
|
|
89
|
-
parameters:
|
|
127
|
+
parameters: {
|
|
128
|
+
...noControls,
|
|
129
|
+
docs: {
|
|
130
|
+
source: {
|
|
131
|
+
code: `
|
|
132
|
+
<template>
|
|
133
|
+
<Button icon="mail">Login with Email</Button>
|
|
134
|
+
<Button icon="chevron-right" iconPosition="end" variant="secondary">Next</Button>
|
|
135
|
+
<Button icon="trash-2" variant="destructive">Delete</Button>
|
|
136
|
+
<Button icon="plus" size="icon" variant="outline" />
|
|
137
|
+
</template>
|
|
138
|
+
`.trim(),
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
90
142
|
render: () => ({
|
|
91
143
|
components: { Button },
|
|
92
144
|
template: `
|
|
@@ -101,7 +153,21 @@ export const WithIcons: Story = {
|
|
|
101
153
|
}
|
|
102
154
|
|
|
103
155
|
export const Loading: Story = {
|
|
104
|
-
parameters:
|
|
156
|
+
parameters: {
|
|
157
|
+
...noControls,
|
|
158
|
+
docs: {
|
|
159
|
+
source: {
|
|
160
|
+
code: `
|
|
161
|
+
<template>
|
|
162
|
+
<Button loading icon="mail">Login with Email</Button>
|
|
163
|
+
<Button loading icon="chevron-right" iconPosition="end" variant="secondary">Next</Button>
|
|
164
|
+
<Button loading icon="trash-2" variant="destructive">Delete</Button>
|
|
165
|
+
<Button loading icon="plus" size="icon" variant="outline" />
|
|
166
|
+
</template>
|
|
167
|
+
`.trim(),
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
105
171
|
render: () => ({
|
|
106
172
|
components: { Button },
|
|
107
173
|
template: `
|
|
@@ -116,7 +182,23 @@ export const Loading: Story = {
|
|
|
116
182
|
}
|
|
117
183
|
|
|
118
184
|
export const Disabled: Story = {
|
|
119
|
-
parameters:
|
|
185
|
+
parameters: {
|
|
186
|
+
...noControls,
|
|
187
|
+
docs: {
|
|
188
|
+
source: {
|
|
189
|
+
code: `
|
|
190
|
+
<template>
|
|
191
|
+
<Button variant="default" disabled>default</Button>
|
|
192
|
+
<Button variant="destructive" disabled>destructive</Button>
|
|
193
|
+
<Button variant="outline" disabled>outline</Button>
|
|
194
|
+
<Button variant="secondary" disabled>secondary</Button>
|
|
195
|
+
<Button variant="ghost" disabled>ghost</Button>
|
|
196
|
+
<Button variant="link" disabled>link</Button>
|
|
197
|
+
</template>
|
|
198
|
+
`.trim(),
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
120
202
|
render: () => ({
|
|
121
203
|
components: { Button },
|
|
122
204
|
setup: () => ({ variants }),
|
|
@@ -129,7 +211,22 @@ export const Disabled: Story = {
|
|
|
129
211
|
}
|
|
130
212
|
|
|
131
213
|
export const Rounded: Story = {
|
|
132
|
-
parameters:
|
|
214
|
+
parameters: {
|
|
215
|
+
...noControls,
|
|
216
|
+
docs: {
|
|
217
|
+
source: {
|
|
218
|
+
code: `
|
|
219
|
+
<template>
|
|
220
|
+
<Button rounded>Rounded</Button>
|
|
221
|
+
<Button rounded variant="outline">Outline</Button>
|
|
222
|
+
<Button rounded variant="secondary">Secondary</Button>
|
|
223
|
+
<Button rounded size="icon" variant="outline" icon="plus" />
|
|
224
|
+
<Button rounded size="icon" variant="secondary" icon="sun" />
|
|
225
|
+
</template>
|
|
226
|
+
`.trim(),
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
},
|
|
133
230
|
render: () => ({
|
|
134
231
|
components: { Button },
|
|
135
232
|
template: `
|
|
@@ -145,7 +242,19 @@ export const Rounded: Story = {
|
|
|
145
242
|
}
|
|
146
243
|
|
|
147
244
|
export const LinkButtons: Story = {
|
|
148
|
-
parameters:
|
|
245
|
+
parameters: {
|
|
246
|
+
...noControls,
|
|
247
|
+
docs: {
|
|
248
|
+
source: {
|
|
249
|
+
code: `
|
|
250
|
+
<template>
|
|
251
|
+
<Button href="/dialog" variant="outline">Internal Link</Button>
|
|
252
|
+
<Button href="https://example.com" icon="external-link" iconPosition="end">External Link</Button>
|
|
253
|
+
</template>
|
|
254
|
+
`.trim(),
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
},
|
|
149
258
|
render: () => ({
|
|
150
259
|
components: { Button },
|
|
151
260
|
template: `
|
|
@@ -34,7 +34,23 @@ const noControls = { controls: { disable: true }} satisfies Story['parameters']
|
|
|
34
34
|
export const Default: Story = {}
|
|
35
35
|
|
|
36
36
|
export const WithIcons: Story = {
|
|
37
|
-
parameters:
|
|
37
|
+
parameters: {
|
|
38
|
+
...noControls,
|
|
39
|
+
docs: {
|
|
40
|
+
source: {
|
|
41
|
+
code: `
|
|
42
|
+
<template>
|
|
43
|
+
<ButtonGroup>
|
|
44
|
+
<Button variant="outline" size="icon"><Icon name="bold" /></Button>
|
|
45
|
+
<Button variant="outline" size="icon"><Icon name="italic" /></Button>
|
|
46
|
+
<Button variant="outline" size="icon"><Icon name="underline" /></Button>
|
|
47
|
+
<Button variant="outline" size="icon"><Icon name="strikethrough" /></Button>
|
|
48
|
+
</ButtonGroup>
|
|
49
|
+
</template>
|
|
50
|
+
`.trim(),
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
38
54
|
render: () => ({
|
|
39
55
|
components: { ButtonGroup, Button, Icon },
|
|
40
56
|
template: `
|
|
@@ -49,7 +65,21 @@ export const WithIcons: Story = {
|
|
|
49
65
|
}
|
|
50
66
|
|
|
51
67
|
export const InputWithButton: Story = {
|
|
52
|
-
parameters:
|
|
68
|
+
parameters: {
|
|
69
|
+
...noControls,
|
|
70
|
+
docs: {
|
|
71
|
+
source: {
|
|
72
|
+
code: `
|
|
73
|
+
<template>
|
|
74
|
+
<ButtonGroup>
|
|
75
|
+
<Input v-model="search" placeholder="Search..." />
|
|
76
|
+
<Button variant="outline"><Icon name="search" /></Button>
|
|
77
|
+
</ButtonGroup>
|
|
78
|
+
</template>
|
|
79
|
+
`.trim(),
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
53
83
|
render: () => ({
|
|
54
84
|
components: { ButtonGroup, Button, Input, Icon },
|
|
55
85
|
setup () {
|
|
@@ -66,7 +96,22 @@ export const InputWithButton: Story = {
|
|
|
66
96
|
}
|
|
67
97
|
|
|
68
98
|
export const ButtonWithInputWithButton: Story = {
|
|
69
|
-
parameters:
|
|
99
|
+
parameters: {
|
|
100
|
+
...noControls,
|
|
101
|
+
docs: {
|
|
102
|
+
source: {
|
|
103
|
+
code: `
|
|
104
|
+
<template>
|
|
105
|
+
<ButtonGroup>
|
|
106
|
+
<Button variant="outline" size="icon"><Icon name="minus" /></Button>
|
|
107
|
+
<Input class="w-20 text-center" model-value="5" />
|
|
108
|
+
<Button variant="outline" size="icon"><Icon name="plus" /></Button>
|
|
109
|
+
</ButtonGroup>
|
|
110
|
+
</template>
|
|
111
|
+
`.trim(),
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
70
115
|
render: () => ({
|
|
71
116
|
components: { ButtonGroup, Button, Input, Icon },
|
|
72
117
|
template: `
|
|
@@ -80,7 +125,21 @@ export const ButtonWithInputWithButton: Story = {
|
|
|
80
125
|
}
|
|
81
126
|
|
|
82
127
|
export const MixedVariants: Story = {
|
|
83
|
-
parameters:
|
|
128
|
+
parameters: {
|
|
129
|
+
...noControls,
|
|
130
|
+
docs: {
|
|
131
|
+
source: {
|
|
132
|
+
code: `
|
|
133
|
+
<template>
|
|
134
|
+
<ButtonGroup>
|
|
135
|
+
<Button variant="outline">Save</Button>
|
|
136
|
+
<Button>Submit</Button>
|
|
137
|
+
</ButtonGroup>
|
|
138
|
+
</template>
|
|
139
|
+
`.trim(),
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
},
|
|
84
143
|
render: () => ({
|
|
85
144
|
components: { ButtonGroup, Button },
|
|
86
145
|
template: `
|
|
@@ -29,20 +29,27 @@ const noControls = { controls: { disable: true }} satisfies Story['parameters']
|
|
|
29
29
|
|
|
30
30
|
export const Default: Story = {}
|
|
31
31
|
|
|
32
|
-
export const WithTitle: Story = {
|
|
33
|
-
parameters: noControls,
|
|
34
|
-
render: () => ({
|
|
35
|
-
components: { Card },
|
|
36
|
-
template: `
|
|
37
|
-
<Card title="Card Title" class="max-w-md">
|
|
38
|
-
<p>This card has a title prop set.</p>
|
|
39
|
-
</Card>
|
|
40
|
-
`,
|
|
41
|
-
}),
|
|
42
|
-
}
|
|
43
|
-
|
|
44
32
|
export const CustomHeader: Story = {
|
|
45
|
-
parameters:
|
|
33
|
+
parameters: {
|
|
34
|
+
...noControls,
|
|
35
|
+
docs: {
|
|
36
|
+
source: {
|
|
37
|
+
code: `
|
|
38
|
+
<template>
|
|
39
|
+
<Card class="max-w-md">
|
|
40
|
+
<template #header>
|
|
41
|
+
<div class="flex items-center justify-between">
|
|
42
|
+
<span class="text-lg font-semibold">Custom Header</span>
|
|
43
|
+
<Button variant="ghost" size="sm">Action</Button>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
<p>This card uses the header slot for a custom layout.</p>
|
|
47
|
+
</Card>
|
|
48
|
+
</template>
|
|
49
|
+
`.trim(),
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
46
53
|
render: () => ({
|
|
47
54
|
components: { Card, Button },
|
|
48
55
|
template: `
|
|
@@ -60,7 +67,26 @@ export const CustomHeader: Story = {
|
|
|
60
67
|
}
|
|
61
68
|
|
|
62
69
|
export const WithFooter: Story = {
|
|
63
|
-
parameters:
|
|
70
|
+
parameters: {
|
|
71
|
+
...noControls,
|
|
72
|
+
docs: {
|
|
73
|
+
source: {
|
|
74
|
+
code: `
|
|
75
|
+
<template>
|
|
76
|
+
<Card title="Settings" class="max-w-md">
|
|
77
|
+
<p>Update your account settings here.</p>
|
|
78
|
+
<template #footer>
|
|
79
|
+
<div class="w-full flex justify-end gap-2">
|
|
80
|
+
<Button variant="outline">Cancel</Button>
|
|
81
|
+
<Button>Save</Button>
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|
|
84
|
+
</Card>
|
|
85
|
+
</template>
|
|
86
|
+
`.trim(),
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
64
90
|
render: () => ({
|
|
65
91
|
components: { Card, Button },
|
|
66
92
|
template: `
|
|
@@ -40,7 +40,21 @@ const noControls = { controls: { disable: true }} satisfies Story['parameters']
|
|
|
40
40
|
export const Default: Story = {}
|
|
41
41
|
|
|
42
42
|
export const Checked: Story = {
|
|
43
|
-
parameters:
|
|
43
|
+
parameters: {
|
|
44
|
+
...noControls,
|
|
45
|
+
docs: {
|
|
46
|
+
source: {
|
|
47
|
+
code: `
|
|
48
|
+
<template>
|
|
49
|
+
<label class="flex items-center gap-2 cursor-pointer">
|
|
50
|
+
<Checkbox v-model="checked" />
|
|
51
|
+
<span class="text-sm">Enable notifications</span>
|
|
52
|
+
</label>
|
|
53
|
+
</template>
|
|
54
|
+
`.trim(),
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
44
58
|
render: () => ({
|
|
45
59
|
components: { Checkbox },
|
|
46
60
|
setup () {
|
|
@@ -60,7 +74,21 @@ export const Checked: Story = {
|
|
|
60
74
|
}
|
|
61
75
|
|
|
62
76
|
export const Indeterminate: Story = {
|
|
63
|
-
parameters:
|
|
77
|
+
parameters: {
|
|
78
|
+
...noControls,
|
|
79
|
+
docs: {
|
|
80
|
+
source: {
|
|
81
|
+
code: `
|
|
82
|
+
<template>
|
|
83
|
+
<label class="flex items-center gap-2 cursor-pointer">
|
|
84
|
+
<Checkbox model-value="indeterminate" />
|
|
85
|
+
<span class="text-sm">Select all items</span>
|
|
86
|
+
</label>
|
|
87
|
+
</template>
|
|
88
|
+
`.trim(),
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
64
92
|
render: () => ({
|
|
65
93
|
components: { Checkbox },
|
|
66
94
|
template: `
|
|
@@ -73,7 +101,29 @@ export const Indeterminate: Story = {
|
|
|
73
101
|
}
|
|
74
102
|
|
|
75
103
|
export const Disabled: Story = {
|
|
76
|
-
parameters:
|
|
104
|
+
parameters: {
|
|
105
|
+
...noControls,
|
|
106
|
+
docs: {
|
|
107
|
+
source: {
|
|
108
|
+
code: `
|
|
109
|
+
<template>
|
|
110
|
+
<label class="flex items-center gap-2 cursor-not-allowed opacity-50">
|
|
111
|
+
<Checkbox :model-value="false" disabled />
|
|
112
|
+
<span class="text-sm">Unchecked disabled</span>
|
|
113
|
+
</label>
|
|
114
|
+
<label class="flex items-center gap-2 cursor-not-allowed opacity-50">
|
|
115
|
+
<Checkbox :model-value="true" disabled />
|
|
116
|
+
<span class="text-sm">Checked disabled</span>
|
|
117
|
+
</label>
|
|
118
|
+
<label class="flex items-center gap-2 cursor-not-allowed opacity-50">
|
|
119
|
+
<Checkbox model-value="indeterminate" disabled />
|
|
120
|
+
<span class="text-sm">Indeterminate disabled</span>
|
|
121
|
+
</label>
|
|
122
|
+
</template>
|
|
123
|
+
`.trim(),
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
77
127
|
render: () => ({
|
|
78
128
|
components: { Checkbox },
|
|
79
129
|
template: `
|
|
@@ -42,7 +42,20 @@ const noControls = { controls: { disable: true }} satisfies Story['parameters']
|
|
|
42
42
|
export const Default: Story = {}
|
|
43
43
|
|
|
44
44
|
export const IconOnly: Story = {
|
|
45
|
-
parameters:
|
|
45
|
+
parameters: {
|
|
46
|
+
...noControls,
|
|
47
|
+
docs: {
|
|
48
|
+
source: {
|
|
49
|
+
code: `
|
|
50
|
+
<template>
|
|
51
|
+
<CopyButton copy="Hello, World!" variant="outline" />
|
|
52
|
+
<CopyButton copy="Hello, World!" variant="ghost" />
|
|
53
|
+
<CopyButton copy="Hello, World!" variant="secondary" />
|
|
54
|
+
</template>
|
|
55
|
+
`.trim(),
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
46
59
|
render: () => ({
|
|
47
60
|
components: { CopyButton },
|
|
48
61
|
template: `
|
|
@@ -56,7 +69,19 @@ export const IconOnly: Story = {
|
|
|
56
69
|
}
|
|
57
70
|
|
|
58
71
|
export const WithLabel: Story = {
|
|
59
|
-
parameters:
|
|
72
|
+
parameters: {
|
|
73
|
+
...noControls,
|
|
74
|
+
docs: {
|
|
75
|
+
source: {
|
|
76
|
+
code: `
|
|
77
|
+
<template>
|
|
78
|
+
<CopyButton copy="Hello, World!" variant="outline">Copy Text</CopyButton>
|
|
79
|
+
<CopyButton copy="123 Main St" variant="secondary">Copy Address</CopyButton>
|
|
80
|
+
</template>
|
|
81
|
+
`.trim(),
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
60
85
|
render: () => ({
|
|
61
86
|
components: { CopyButton },
|
|
62
87
|
template: `
|
|
@@ -69,7 +94,23 @@ export const WithLabel: Story = {
|
|
|
69
94
|
}
|
|
70
95
|
|
|
71
96
|
export const Variants: Story = {
|
|
72
|
-
parameters:
|
|
97
|
+
parameters: {
|
|
98
|
+
...noControls,
|
|
99
|
+
docs: {
|
|
100
|
+
source: {
|
|
101
|
+
code: `
|
|
102
|
+
<template>
|
|
103
|
+
<CopyButton copy="Hello, World!" variant="default">default</CopyButton>
|
|
104
|
+
<CopyButton copy="Hello, World!" variant="destructive">destructive</CopyButton>
|
|
105
|
+
<CopyButton copy="Hello, World!" variant="outline">outline</CopyButton>
|
|
106
|
+
<CopyButton copy="Hello, World!" variant="secondary">secondary</CopyButton>
|
|
107
|
+
<CopyButton copy="Hello, World!" variant="ghost">ghost</CopyButton>
|
|
108
|
+
<CopyButton copy="Hello, World!" variant="link">link</CopyButton>
|
|
109
|
+
</template>
|
|
110
|
+
`.trim(),
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
73
114
|
render: () => ({
|
|
74
115
|
components: { CopyButton },
|
|
75
116
|
setup: () => ({ variants }),
|
|
@@ -89,7 +130,20 @@ export const Variants: Story = {
|
|
|
89
130
|
}
|
|
90
131
|
|
|
91
132
|
export const Sizes: Story = {
|
|
92
|
-
parameters:
|
|
133
|
+
parameters: {
|
|
134
|
+
...noControls,
|
|
135
|
+
docs: {
|
|
136
|
+
source: {
|
|
137
|
+
code: `
|
|
138
|
+
<template>
|
|
139
|
+
<CopyButton copy="Hello, World!" variant="outline" size="sm">Small</CopyButton>
|
|
140
|
+
<CopyButton copy="Hello, World!" variant="outline" size="default">Default</CopyButton>
|
|
141
|
+
<CopyButton copy="Hello, World!" variant="outline" size="lg">Large</CopyButton>
|
|
142
|
+
</template>
|
|
143
|
+
`.trim(),
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
93
147
|
render: () => ({
|
|
94
148
|
components: { CopyButton },
|
|
95
149
|
template: `
|
|
@@ -103,7 +157,25 @@ export const Sizes: Story = {
|
|
|
103
157
|
}
|
|
104
158
|
|
|
105
159
|
export const CustomTooltipText: Story = {
|
|
106
|
-
parameters:
|
|
160
|
+
parameters: {
|
|
161
|
+
...noControls,
|
|
162
|
+
docs: {
|
|
163
|
+
source: {
|
|
164
|
+
code: `
|
|
165
|
+
<template>
|
|
166
|
+
<CopyButton
|
|
167
|
+
copy="secret-token-123"
|
|
168
|
+
before-copy-text="Click to copy token"
|
|
169
|
+
after-copy-text="Token copied!"
|
|
170
|
+
variant="outline"
|
|
171
|
+
>
|
|
172
|
+
Copy Token
|
|
173
|
+
</CopyButton>
|
|
174
|
+
</template>
|
|
175
|
+
`.trim(),
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
107
179
|
render: () => ({
|
|
108
180
|
components: { CopyButton },
|
|
109
181
|
template: `
|