@polymarbot/nuxt-layer-shadcn-ui 0.1.10 → 0.2.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.
Files changed (101) hide show
  1. package/app/assets/styles/colors.css +10 -10
  2. package/app/components/ui/Accordion/index.stories.ts +60 -56
  3. package/app/components/ui/Accordion/index.vue +1 -1
  4. package/app/components/ui/AdminLayout/SidebarMenus.vue +0 -2
  5. package/app/components/ui/AdminLayout/index.stories.ts +9 -8
  6. package/app/components/ui/Alert/index.stories.ts +28 -26
  7. package/app/components/ui/Alert/index.vue +6 -6
  8. package/app/components/ui/Alert/types.ts +2 -1
  9. package/app/components/ui/AlertDialog/index.stories.ts +85 -50
  10. package/app/components/ui/AsyncDataTable/index.stories.ts +53 -36
  11. package/app/components/ui/Avatar/index.stories.ts +56 -51
  12. package/app/components/ui/Avatar/index.vue +1 -1
  13. package/app/components/ui/Avatar/types.ts +5 -2
  14. package/app/components/ui/Badge/index.stories.ts +41 -41
  15. package/app/components/ui/Badge/index.vue +1 -1
  16. package/app/components/ui/Badge/types.ts +3 -1
  17. package/app/components/ui/Breadcrumb/index.stories.ts +48 -37
  18. package/app/components/ui/Breadcrumb/index.vue +1 -1
  19. package/app/components/ui/Button/index.stories.ts +94 -90
  20. package/app/components/ui/Button/index.vue +1 -1
  21. package/app/components/ui/Button/types.ts +4 -1
  22. package/app/components/ui/ButtonGroup/index.stories.ts +61 -49
  23. package/app/components/ui/Card/index.stories.ts +55 -47
  24. package/app/components/ui/Card/index.vue +1 -1
  25. package/app/components/ui/Checkbox/index.stories.ts +69 -46
  26. package/app/components/ui/Checkbox/index.vue +1 -1
  27. package/app/components/ui/CopyButton/index.stories.ts +89 -31
  28. package/app/components/ui/DataTable/index.stories.ts +218 -168
  29. package/app/components/ui/DataTable/index.vue +1 -1
  30. package/app/components/ui/DatePicker/index.stories.ts +131 -37
  31. package/app/components/ui/DateRangePicker/index.stories.ts +107 -33
  32. package/app/components/ui/Divider/index.stories.ts +46 -24
  33. package/app/components/ui/Divider/index.vue +1 -1
  34. package/app/components/ui/Drawer/index.stories.ts +131 -81
  35. package/app/components/ui/Drawer/index.vue +1 -1
  36. package/app/components/ui/Drawer/types.ts +1 -1
  37. package/app/components/ui/Dropdown/index.stories.ts +134 -89
  38. package/app/components/ui/Dropdown/index.vue +5 -1
  39. package/app/components/ui/Dropdown/types.ts +1 -1
  40. package/app/components/ui/FormItem/index.stories.ts +87 -43
  41. package/app/components/ui/FormItem/index.vue +1 -1
  42. package/app/components/ui/Help/index.stories.ts +46 -35
  43. package/app/components/ui/Icon/index.stories.ts +41 -43
  44. package/app/components/ui/Input/index.stories.ts +95 -41
  45. package/app/components/ui/Input/index.vue +1 -1
  46. package/app/components/ui/InputCurrency/index.stories.ts +89 -49
  47. package/app/components/ui/InputNumber/index.stories.ts +93 -29
  48. package/app/components/ui/InputNumber/index.vue +1 -1
  49. package/app/components/ui/InputOtp/index.stories.ts +6 -7
  50. package/app/components/ui/InputOtp/index.vue +1 -1
  51. package/app/components/ui/InputPercent/index.stories.ts +6 -7
  52. package/app/components/ui/InputRange/index.stories.ts +6 -7
  53. package/app/components/ui/Loading/index.stories.ts +19 -19
  54. package/app/components/ui/Markdown/index.stories.ts +7 -10
  55. package/app/components/ui/Modal/index.stories.ts +135 -80
  56. package/app/components/ui/Modal/index.vue +1 -1
  57. package/app/components/ui/Modal/types.ts +1 -1
  58. package/app/components/ui/ModalContent/index.stories.ts +54 -26
  59. package/app/components/ui/ModalContent/index.vue +2 -2
  60. package/app/components/ui/PageCard/index.stories.ts +177 -67
  61. package/app/components/ui/Pagination/index.stories.ts +68 -51
  62. package/app/components/ui/Pagination/index.vue +2 -2
  63. package/app/components/ui/Popover/index.stories.ts +47 -45
  64. package/app/components/ui/Popover/index.vue +1 -1
  65. package/app/components/ui/Qrcode/index.stories.ts +42 -34
  66. package/app/components/ui/RadioCardGroup/index.stories.ts +23 -32
  67. package/app/components/ui/RadioCardGroup/index.vue +1 -1
  68. package/app/components/ui/RadioGroup/index.stories.ts +123 -0
  69. package/app/components/ui/RadioGroup/index.vue +73 -0
  70. package/app/components/ui/RadioGroup/types.ts +13 -0
  71. package/app/components/ui/ScrollArea/index.stories.ts +69 -37
  72. package/app/components/ui/ScrollArea/index.vue +1 -1
  73. package/app/components/ui/SearchSelect/index.stories.ts +104 -66
  74. package/app/components/ui/Select/index.stories.ts +152 -98
  75. package/app/components/ui/Select/index.vue +3 -3
  76. package/app/components/ui/Skeleton/index.stories.ts +27 -30
  77. package/app/components/ui/Skeleton/index.vue +1 -1
  78. package/app/components/ui/Slider/index.stories.ts +73 -31
  79. package/app/components/ui/Slider/index.vue +1 -1
  80. package/app/components/ui/Surface/index.stories.ts +47 -21
  81. package/app/components/ui/Surface/index.vue +39 -28
  82. package/app/components/ui/Surface/types.ts +2 -2
  83. package/app/components/ui/Switch/index.stories.ts +6 -7
  84. package/app/components/ui/Switch/index.vue +1 -1
  85. package/app/components/ui/Tabs/index.stories.ts +103 -61
  86. package/app/components/ui/Tabs/index.vue +1 -1
  87. package/app/components/ui/Tag/index.stories.ts +42 -25
  88. package/app/components/ui/Tag/index.vue +39 -28
  89. package/app/components/ui/Tag/types.ts +2 -2
  90. package/app/components/ui/Textarea/index.stories.ts +73 -9
  91. package/app/components/ui/Textarea/index.vue +1 -1
  92. package/app/components/ui/Toast/index.stories.ts +71 -18
  93. package/app/components/ui/Toast/index.vue +1 -1
  94. package/app/components/ui/Tooltip/index.stories.ts +45 -38
  95. package/app/components/ui/Tooltip/index.vue +1 -1
  96. package/app/components/ui/WebLink/index.stories.ts +76 -41
  97. package/app/components/ui/WebLink/index.vue +1 -1
  98. package/package.json +2 -2
  99. package/app/components/ui/Radio/index.stories.ts +0 -71
  100. package/app/components/ui/Radio/index.vue +0 -10
  101. package/app/components/ui/Radio/types.ts +0 -3
@@ -22,85 +22,195 @@ const meta = {
22
22
  disabled: false,
23
23
  variant: 'paper',
24
24
  },
25
+ render: args => ({
26
+ components: { PageCard },
27
+ setup: () => ({ args }),
28
+ template: `
29
+ <PageCard v-bind="args" class="max-w-2xl">
30
+ <p>Page card content goes here.</p>
31
+ </PageCard>
32
+ `,
33
+ }),
25
34
  } satisfies Meta<typeof PageCard>
26
35
 
27
36
  export default meta
28
37
  type Story = StoryObj<typeof meta>
29
38
 
30
- export const Default: Story = {
31
- render: args => ({
32
- components: { PageCard, Button, WebLink },
33
- setup: () => ({ args }),
39
+ export const Default: Story = {}
40
+
41
+ export const NoTitle: Story = {
42
+ render: () => ({
43
+ components: { PageCard },
34
44
  template: `
35
- <div class="space-y-10 max-w-2xl">
36
- <!-- Controlled -->
37
- <section>
38
- <h3 class="mb-4 text-lg font-medium">Controlled</h3>
39
- <PageCard v-bind="args">
40
- <p>Page card content goes here.</p>
41
- </PageCard>
42
- </section>
45
+ <PageCard class="max-w-2xl">
46
+ <p>A page card without a title — just content.</p>
47
+ </PageCard>
48
+ `,
49
+ }),
50
+ }
43
51
 
44
- <!-- With Back Button -->
45
- <section>
46
- <h3 class="mb-4 text-lg font-medium">With Back Button</h3>
47
- <PageCard title="Edit Profile" :back="{ action: () => {} }">
48
- <p>A page card with a back button in the header.</p>
49
- </PageCard>
50
- </section>
52
+ export const WithSubtitle: Story = {
53
+ render: () => ({
54
+ components: { PageCard },
55
+ template: `
56
+ <PageCard
57
+ title="Bot Details"
58
+ subtitle="View and edit your bot configuration."
59
+ class="max-w-2xl"
60
+ >
61
+ <p>Title combined with subtitle.</p>
62
+ </PageCard>
63
+ `,
64
+ }),
65
+ }
51
66
 
52
- <!-- Back + Subtitle -->
53
- <section>
54
- <h3 class="mb-4 text-lg font-medium">Back + Subtitle</h3>
55
- <PageCard title="Bot Details" subtitle="View and edit your bot configuration." :back="{ action: () => {} }">
56
- <p>Back button combined with title and subtitle.</p>
57
- </PageCard>
58
- </section>
67
+ export const WithBackButton: Story = {
68
+ render: () => ({
69
+ components: { PageCard },
70
+ template: `
71
+ <PageCard title="Edit Profile" :back="{ action: () => {} }" class="max-w-2xl">
72
+ <p>A page card with a back button in the header.</p>
73
+ </PageCard>
74
+ `,
75
+ }),
76
+ }
59
77
 
60
- <!-- With Actions -->
61
- <section>
62
- <h3 class="mb-4 text-lg font-medium">With Actions</h3>
63
- <PageCard title="API Keys">
64
- <template #actions>
65
- <Button variant="outline" size="sm">Export</Button>
66
- <Button size="sm">Create</Button>
67
- </template>
68
- <p>Action buttons rendered on the right side of the title.</p>
69
- </PageCard>
70
- </section>
78
+ export const BackWithSubtitle: Story = {
79
+ render: () => ({
80
+ components: { PageCard },
81
+ template: `
82
+ <PageCard
83
+ title="Bot Details"
84
+ subtitle="View and edit your bot configuration."
85
+ :back="{ action: () => {} }"
86
+ class="max-w-2xl"
87
+ >
88
+ <p>Back button combined with title and subtitle.</p>
89
+ </PageCard>
90
+ `,
91
+ }),
92
+ }
71
93
 
72
- <!-- Actions + Subtitle + Back -->
73
- <section>
74
- <h3 class="mb-4 text-lg font-medium">Actions + Subtitle + Back</h3>
75
- <PageCard
76
- title="Developer Settings"
77
- subtitle="Manage API keys and webhooks for your organization."
78
- :back="{ action: () => {} }"
79
- >
80
- <template #actions>
81
- <WebLink href="#" target="_blank" class="text-sm">Docs</WebLink>
82
- <WebLink href="#" target="_blank" class="text-sm">API Reference</WebLink>
83
- </template>
84
- <p>Back button, title, subtitle, and trailing action slot working together.</p>
85
- </PageCard>
86
- </section>
94
+ export const WithActions: Story = {
95
+ render: () => ({
96
+ components: { PageCard, Button },
97
+ template: `
98
+ <PageCard title="API Keys" class="max-w-2xl">
99
+ <template #actions>
100
+ <Button variant="outline" size="sm">Export</Button>
101
+ <Button size="sm">Create</Button>
102
+ </template>
103
+ <p>Action buttons rendered on the right side of the title.</p>
104
+ </PageCard>
105
+ `,
106
+ }),
107
+ }
87
108
 
88
- <!-- Card Variant -->
89
- <section>
90
- <h3 class="mb-4 text-lg font-medium">Card Variant</h3>
91
- <PageCard title="Profile" subtitle="Rounded corners and a visible border." variant="card">
92
- <p>Use variant="card" for widget-style panels; default "paper" is edge-to-edge.</p>
93
- </PageCard>
94
- </section>
109
+ export const ActionsSubtitleBack: Story = {
110
+ render: () => ({
111
+ components: { PageCard, WebLink },
112
+ template: `
113
+ <PageCard
114
+ title="Developer Settings"
115
+ subtitle="Manage API keys and webhooks for your organization."
116
+ :back="{ action: () => {} }"
117
+ class="max-w-2xl"
118
+ >
119
+ <template #actions>
120
+ <WebLink href="#" target="_blank" class="text-sm">Docs</WebLink>
121
+ <WebLink href="#" target="_blank" class="text-sm">API Reference</WebLink>
122
+ </template>
123
+ <p>Back button, title, subtitle, and trailing action slot working together.</p>
124
+ </PageCard>
125
+ `,
126
+ }),
127
+ }
128
+
129
+ export const CustomTitleSlot: Story = {
130
+ render: () => ({
131
+ components: { PageCard },
132
+ template: `
133
+ <PageCard class="max-w-2xl">
134
+ <template #title>
135
+ <span class="flex items-center gap-2">
136
+ <span class="inline-block size-2 rounded-full bg-success" />
137
+ <span>Active Workspace</span>
138
+ </span>
139
+ </template>
140
+ <template #subtitle>
141
+ <span class="text-success">All systems operational</span>
142
+ </template>
143
+ <p>Title and subtitle rendered via slots.</p>
144
+ </PageCard>
145
+ `,
146
+ }),
147
+ }
148
+
149
+ export const WithFooter: Story = {
150
+ render: () => ({
151
+ components: { PageCard, Button },
152
+ template: `
153
+ <PageCard title="Profile" class="max-w-2xl">
154
+ <p>Edit your profile information and save the changes.</p>
155
+ <template #footer>
156
+ <div class="flex w-full justify-end gap-2">
157
+ <Button variant="outline">Cancel</Button>
158
+ <Button>Save</Button>
159
+ </div>
160
+ </template>
161
+ </PageCard>
162
+ `,
163
+ }),
164
+ }
165
+
166
+ export const CardVariant: Story = {
167
+ render: () => ({
168
+ components: { PageCard },
169
+ template: `
170
+ <PageCard
171
+ title="Profile"
172
+ subtitle="Rounded corners and a visible border."
173
+ variant="card"
174
+ class="max-w-2xl"
175
+ >
176
+ <p>Use variant="card" for widget-style panels; default "paper" is edge-to-edge.</p>
177
+ </PageCard>
178
+ `,
179
+ }),
180
+ }
181
+
182
+ export const Loading: Story = {
183
+ render: () => ({
184
+ components: { PageCard },
185
+ template: `
186
+ <PageCard title="Saving…" loading class="max-w-2xl">
187
+ <p>Content is covered by a centered loading overlay while <code>loading</code> is true.</p>
188
+ </PageCard>
189
+ `,
190
+ }),
191
+ }
95
192
 
96
- <!-- No Title -->
97
- <section>
98
- <h3 class="mb-4 text-lg font-medium">No Title</h3>
99
- <PageCard>
100
- <p>A page card without a title — just content.</p>
101
- </PageCard>
102
- </section>
103
- </div>
193
+ export const NotReady: Story = {
194
+ render: () => ({
195
+ components: { PageCard },
196
+ template: `
197
+ <PageCard :ready="false" class="max-w-2xl">
198
+ <p>This content would be replaced by skeleton placeholders while data is loading.</p>
199
+ </PageCard>
200
+ `,
201
+ }),
202
+ }
203
+
204
+ export const Disabled: Story = {
205
+ render: () => ({
206
+ components: { PageCard, Button },
207
+ template: `
208
+ <PageCard title="Read-only" disabled class="max-w-2xl">
209
+ <div class="flex flex-col gap-3">
210
+ <p>When <code>disabled</code> is true, content becomes non-interactive and dimmed.</p>
211
+ <Button>Disabled action</Button>
212
+ </div>
213
+ </PageCard>
104
214
  `,
105
215
  }),
106
216
  }
@@ -1,81 +1,98 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
2
  import Pagination from './index.vue'
3
3
 
4
+ const sizes = [ 'default', 'sm' ] as const
5
+
4
6
  const meta = {
5
7
  title: 'UI/Pagination',
6
8
  component: Pagination,
7
9
  argTypes: {
10
+ page: { control: { type: 'number', min: 1 }},
11
+ total: { control: { type: 'number', min: 0 }},
12
+ pageSize: { control: { type: 'number', min: 1 }},
13
+ pageSizeOptions: { control: 'object' },
8
14
  simple: { control: 'boolean' },
9
- size: { control: 'select', options: [ 'default', 'sm' ]},
10
15
  siblingCount: { control: { type: 'number', min: 0 }},
16
+ size: { control: 'select', options: sizes },
11
17
  },
12
18
  args: {
19
+ page: 1,
20
+ total: 85,
21
+ pageSize: 10,
22
+ pageSizeOptions: [ 10, 20, 50 ],
13
23
  simple: false,
14
- size: 'default',
15
24
  siblingCount: 1,
25
+ size: 'default',
16
26
  },
27
+ render: args => ({
28
+ components: { Pagination },
29
+ setup: () => ({ args }),
30
+ template: '<Pagination v-bind="args" />',
31
+ }),
17
32
  } satisfies Meta<typeof Pagination>
18
33
 
19
34
  export default meta
20
35
  type Story = StoryObj<typeof meta>
21
36
 
22
- export const Default: Story = {
23
- render: args => ({
37
+ export const Default: Story = {}
38
+
39
+ export const Controlled: Story = {
40
+ render: () => ({
24
41
  components: { Pagination },
25
42
  setup () {
26
43
  const page = ref(1)
27
44
  const pageSize = ref(10)
28
-
29
- return { args, page, pageSize }
45
+ return { page, pageSize }
30
46
  },
31
47
  template: `
32
- <div class="space-y-10">
33
- <!-- Controlled -->
34
- <section>
35
- <h3 class="mb-4 text-lg font-medium">Controlled</h3>
36
- <Pagination
37
- v-bind="args"
38
- :page="page"
39
- :total="85"
40
- :pageSize="pageSize"
41
- :pageSizeOptions="[10, 20, 50]"
42
- @update:page="page = $event"
43
- @update:pageSize="v => { pageSize = v; page = 1 }"
44
- />
45
- <div class="mt-2 text-sm text-muted-foreground">
46
- Page: {{ page }}, Size: {{ pageSize }}
47
- </div>
48
- </section>
48
+ <div>
49
+ <Pagination
50
+ :page="page"
51
+ :total="85"
52
+ :pageSize="pageSize"
53
+ :pageSizeOptions="[10, 20, 50]"
54
+ @update:page="page = $event"
55
+ @update:pageSize="v => { pageSize = v; page = 1 }"
56
+ />
57
+ <div class="mt-2 text-sm text-muted-foreground">
58
+ Page: {{ page }}, Size: {{ pageSize }}
59
+ </div>
60
+ </div>
61
+ `,
62
+ }),
63
+ }
49
64
 
50
- <!-- Size comparison -->
51
- <section>
52
- <h3 class="mb-4 text-lg font-medium">Size</h3>
53
- <div class="space-y-4">
54
- <div>
55
- <span class="mb-2 block text-sm font-medium">default</span>
56
- <Pagination :page="3" :total="85" :pageSize="10" />
57
- </div>
58
- <div>
59
- <span class="mb-2 block text-sm font-medium">sm</span>
60
- <Pagination :page="3" :total="85" :pageSize="10" size="sm" />
61
- </div>
62
- </div>
63
- </section>
65
+ export const Sizes: Story = {
66
+ render: () => ({
67
+ components: { Pagination },
68
+ template: `
69
+ <div class="space-y-4">
70
+ <div>
71
+ <span class="mb-2 block text-sm font-medium">default</span>
72
+ <Pagination :page="3" :total="85" :pageSize="10" />
73
+ </div>
74
+ <div>
75
+ <span class="mb-2 block text-sm font-medium">sm</span>
76
+ <Pagination :page="3" :total="85" :pageSize="10" size="sm" />
77
+ </div>
78
+ </div>
79
+ `,
80
+ }),
81
+ }
64
82
 
65
- <!-- Simple mode -->
66
- <section>
67
- <h3 class="mb-4 text-lg font-medium">Simple Mode</h3>
68
- <div class="space-y-4">
69
- <div>
70
- <span class="mb-2 block text-sm font-medium">default</span>
71
- <Pagination :page="3" :total="85" :pageSize="10" simple />
72
- </div>
73
- <div>
74
- <span class="mb-2 block text-sm font-medium">sm</span>
75
- <Pagination :page="3" :total="85" :pageSize="10" simple size="sm" />
76
- </div>
77
- </div>
78
- </section>
83
+ export const Simple: Story = {
84
+ render: () => ({
85
+ components: { Pagination },
86
+ template: `
87
+ <div class="space-y-4">
88
+ <div>
89
+ <span class="mb-2 block text-sm font-medium">default</span>
90
+ <Pagination :page="3" :total="85" :pageSize="10" simple />
91
+ </div>
92
+ <div>
93
+ <span class="mb-2 block text-sm font-medium">sm</span>
94
+ <Pagination :page="3" :total="85" :pageSize="10" simple size="sm" />
95
+ </div>
79
96
  </div>
80
97
  `,
81
98
  }),
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import type { DropdownItem } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/ui/Dropdown/types'
3
- import { buttonVariants } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/button'
3
+ import { buttonVariants } from '../../shadcn/button'
4
4
  import {
5
5
  Pagination as ShadcnPagination,
6
6
  PaginationContent,
@@ -10,7 +10,7 @@ import {
10
10
  PaginationLast,
11
11
  PaginationNext,
12
12
  PaginationPrevious,
13
- } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/pagination'
13
+ } from '../../shadcn/pagination'
14
14
  import type { PaginationProps } from './types'
15
15
 
16
16
  const props = withDefaults(defineProps<PaginationProps>(), {
@@ -6,61 +6,63 @@ import Popover from './index.vue'
6
6
  const meta = {
7
7
  title: 'UI/Popover',
8
8
  component: Popover,
9
+ render: () => ({
10
+ components: { Popover, Button },
11
+ template: `
12
+ <Popover>
13
+ <template #trigger>
14
+ <Button variant="outline">Open Popover</Button>
15
+ </template>
16
+ <div class="space-y-2">
17
+ <h4 class="font-medium">Popover Content</h4>
18
+ <p class="text-sm text-muted-foreground">This is the popover body with some informational content.</p>
19
+ </div>
20
+ </Popover>
21
+ `,
22
+ }),
9
23
  } satisfies Meta<typeof Popover>
10
24
 
11
25
  export default meta
12
26
  type Story = StoryObj<typeof meta>
13
27
 
14
- export const Default: Story = {
28
+ export const Default: Story = {}
29
+
30
+ export const WithForm: Story = {
15
31
  render: () => ({
16
32
  components: { Popover, Button, Input },
33
+ template: `
34
+ <Popover>
35
+ <template #trigger>
36
+ <Button variant="outline">Edit Name</Button>
37
+ </template>
38
+ <div class="space-y-3">
39
+ <h4 class="font-medium">Update Name</h4>
40
+ <Input placeholder="Enter new name" />
41
+ <Button size="sm" class="w-full">Save</Button>
42
+ </div>
43
+ </Popover>
44
+ `,
45
+ }),
46
+ }
47
+
48
+ export const Controlled: Story = {
49
+ render: () => ({
50
+ components: { Popover, Button },
17
51
  setup () {
18
- const controlled = ref(false)
19
- return { controlled }
52
+ const open = ref(false)
53
+ return { open }
20
54
  },
21
55
  template: `
22
- <div class="space-y-10">
23
- <section>
24
- <h3 class="mb-4 text-lg font-medium">Basic</h3>
25
- <Popover>
26
- <template #trigger>
27
- <Button variant="outline">Open Popover</Button>
28
- </template>
29
- <div class="space-y-2">
30
- <h4 class="font-medium">Popover Content</h4>
31
- <p class="text-sm text-muted-foreground">This is the popover body with some informational content.</p>
32
- </div>
33
- </Popover>
34
- </section>
35
-
36
- <section>
37
- <h3 class="mb-4 text-lg font-medium">With Form</h3>
38
- <Popover>
39
- <template #trigger>
40
- <Button variant="outline">Edit Name</Button>
41
- </template>
42
- <div class="space-y-3">
43
- <h4 class="font-medium">Update Name</h4>
44
- <Input placeholder="Enter new name" />
45
- <Button size="sm" class="w-full">Save</Button>
46
- </div>
47
- </Popover>
48
- </section>
49
-
50
- <section>
51
- <h3 class="mb-4 text-lg font-medium">Controlled</h3>
52
- <div class="flex items-center gap-2">
53
- <Popover v-model:open="controlled">
54
- <template #trigger>
55
- <Button variant="outline">Controlled Popover</Button>
56
- </template>
57
- <p class="text-sm">This popover is controlled externally.</p>
58
- </Popover>
59
- <Button variant="ghost" size="sm" @click="controlled = !controlled">
60
- Toggle ({{ controlled ? 'Open' : 'Closed' }})
61
- </Button>
62
- </div>
63
- </section>
56
+ <div class="flex items-center gap-2">
57
+ <Popover v-model:open="open">
58
+ <template #trigger>
59
+ <Button variant="outline">Controlled Popover</Button>
60
+ </template>
61
+ <p class="text-sm">This popover is controlled externally.</p>
62
+ </Popover>
63
+ <Button variant="ghost" size="sm" @click="open = !open">
64
+ Toggle ({{ open ? 'Open' : 'Closed' }})
65
+ </Button>
64
66
  </div>
65
67
  `,
66
68
  }),
@@ -3,7 +3,7 @@ import {
3
3
  Popover as ShadcnPopover,
4
4
  PopoverContent,
5
5
  PopoverTrigger,
6
- } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/popover'
6
+ } from '../../shadcn/popover'
7
7
  import type { PopoverProps } from './types'
8
8
 
9
9
  const props = defineProps<PopoverProps>()
@@ -4,13 +4,29 @@ import Qrcode from './index.vue'
4
4
  const meta = {
5
5
  title: 'UI/Qrcode',
6
6
  component: Qrcode,
7
+ argTypes: {
8
+ content: { control: 'text' },
9
+ },
10
+ args: {
11
+ content: 'https://example.com',
12
+ },
13
+ render: args => ({
14
+ components: { Qrcode },
15
+ setup: () => ({ args }),
16
+ template: `
17
+ <div class="size-48">
18
+ <Qrcode v-bind="args" />
19
+ </div>
20
+ `,
21
+ }),
7
22
  } satisfies Meta<typeof Qrcode>
8
23
 
9
24
  export default meta
10
25
  type Story = StoryObj<typeof meta>
11
26
 
12
- export const Default: Story = {
13
- args: { content: 'https://example.com' },
27
+ export const Default: Story = {}
28
+
29
+ export const DynamicContent: Story = {
14
30
  render: () => ({
15
31
  components: { Qrcode },
16
32
  setup () {
@@ -18,39 +34,31 @@ export const Default: Story = {
18
34
  return { url }
19
35
  },
20
36
  template: `
21
- <div class="space-y-10">
22
- <section>
23
- <h3 class="mb-4 text-lg font-medium">Basic QR Code</h3>
24
- <div class="size-48">
25
- <Qrcode content="https://example.com" />
26
- </div>
27
- </section>
28
-
29
- <section>
30
- <h3 class="mb-4 text-lg font-medium">Dynamic Content</h3>
31
- <div class="space-y-3 max-w-sm">
32
- <input
33
- v-model="url"
34
- class="w-full rounded border border-input px-3 py-2 text-sm"
35
- placeholder="Enter URL or text"
36
- />
37
- <div class="size-48">
38
- <Qrcode :content="url" />
39
- </div>
40
- </div>
41
- </section>
37
+ <div class="space-y-3 max-w-sm">
38
+ <input
39
+ v-model="url"
40
+ class="w-full rounded border border-input px-3 py-2 text-sm"
41
+ placeholder="Enter URL or text"
42
+ />
43
+ <div class="size-48">
44
+ <Qrcode :content="url" />
45
+ </div>
46
+ </div>
47
+ `,
48
+ }),
49
+ }
42
50
 
43
- <section>
44
- <h3 class="mb-4 text-lg font-medium">Different Sizes</h3>
45
- <div class="flex items-end gap-6">
46
- <div class="size-24">
47
- <Qrcode content="https://example.com/small" />
48
- </div>
49
- <div class="size-48">
50
- <Qrcode content="https://example.com/medium" />
51
- </div>
52
- </div>
53
- </section>
51
+ export const Sizes: Story = {
52
+ render: () => ({
53
+ components: { Qrcode },
54
+ template: `
55
+ <div class="flex items-end gap-6">
56
+ <div class="size-24">
57
+ <Qrcode content="https://example.com/small" />
58
+ </div>
59
+ <div class="size-48">
60
+ <Qrcode content="https://example.com/medium" />
61
+ </div>
54
62
  </div>
55
63
  `,
56
64
  }),