@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.
- package/app/assets/styles/colors.css +10 -10
- package/app/components/ui/Accordion/index.stories.ts +60 -56
- package/app/components/ui/Accordion/index.vue +1 -1
- package/app/components/ui/AdminLayout/SidebarMenus.vue +0 -2
- package/app/components/ui/AdminLayout/index.stories.ts +9 -8
- package/app/components/ui/Alert/index.stories.ts +28 -26
- package/app/components/ui/Alert/index.vue +6 -6
- package/app/components/ui/Alert/types.ts +2 -1
- package/app/components/ui/AlertDialog/index.stories.ts +85 -50
- package/app/components/ui/AsyncDataTable/index.stories.ts +53 -36
- package/app/components/ui/Avatar/index.stories.ts +56 -51
- package/app/components/ui/Avatar/index.vue +1 -1
- package/app/components/ui/Avatar/types.ts +5 -2
- package/app/components/ui/Badge/index.stories.ts +41 -41
- package/app/components/ui/Badge/index.vue +1 -1
- package/app/components/ui/Badge/types.ts +3 -1
- package/app/components/ui/Breadcrumb/index.stories.ts +48 -37
- package/app/components/ui/Breadcrumb/index.vue +1 -1
- package/app/components/ui/Button/index.stories.ts +94 -90
- package/app/components/ui/Button/index.vue +1 -1
- package/app/components/ui/Button/types.ts +4 -1
- package/app/components/ui/ButtonGroup/index.stories.ts +61 -49
- package/app/components/ui/Card/index.stories.ts +55 -47
- package/app/components/ui/Card/index.vue +1 -1
- package/app/components/ui/Checkbox/index.stories.ts +69 -46
- package/app/components/ui/Checkbox/index.vue +1 -1
- package/app/components/ui/CopyButton/index.stories.ts +89 -31
- package/app/components/ui/DataTable/index.stories.ts +218 -168
- package/app/components/ui/DataTable/index.vue +1 -1
- package/app/components/ui/DatePicker/index.stories.ts +131 -37
- package/app/components/ui/DateRangePicker/index.stories.ts +107 -33
- package/app/components/ui/Divider/index.stories.ts +46 -24
- package/app/components/ui/Divider/index.vue +1 -1
- package/app/components/ui/Drawer/index.stories.ts +131 -81
- package/app/components/ui/Drawer/index.vue +1 -1
- package/app/components/ui/Drawer/types.ts +1 -1
- package/app/components/ui/Dropdown/index.stories.ts +134 -89
- package/app/components/ui/Dropdown/index.vue +5 -1
- package/app/components/ui/Dropdown/types.ts +1 -1
- package/app/components/ui/FormItem/index.stories.ts +87 -43
- package/app/components/ui/FormItem/index.vue +1 -1
- package/app/components/ui/Help/index.stories.ts +46 -35
- package/app/components/ui/Icon/index.stories.ts +41 -43
- package/app/components/ui/Input/index.stories.ts +95 -41
- package/app/components/ui/Input/index.vue +1 -1
- package/app/components/ui/InputCurrency/index.stories.ts +89 -49
- package/app/components/ui/InputNumber/index.stories.ts +93 -29
- package/app/components/ui/InputNumber/index.vue +1 -1
- package/app/components/ui/InputOtp/index.stories.ts +6 -7
- package/app/components/ui/InputOtp/index.vue +1 -1
- package/app/components/ui/InputPercent/index.stories.ts +6 -7
- package/app/components/ui/InputRange/index.stories.ts +6 -7
- package/app/components/ui/Loading/index.stories.ts +19 -19
- package/app/components/ui/Markdown/index.stories.ts +7 -10
- package/app/components/ui/Modal/index.stories.ts +135 -80
- package/app/components/ui/Modal/index.vue +1 -1
- package/app/components/ui/Modal/types.ts +1 -1
- package/app/components/ui/ModalContent/index.stories.ts +54 -26
- package/app/components/ui/ModalContent/index.vue +2 -2
- package/app/components/ui/PageCard/index.stories.ts +177 -67
- package/app/components/ui/Pagination/index.stories.ts +68 -51
- package/app/components/ui/Pagination/index.vue +2 -2
- package/app/components/ui/Popover/index.stories.ts +47 -45
- package/app/components/ui/Popover/index.vue +1 -1
- package/app/components/ui/Qrcode/index.stories.ts +42 -34
- package/app/components/ui/RadioCardGroup/index.stories.ts +23 -32
- package/app/components/ui/RadioCardGroup/index.vue +1 -1
- package/app/components/ui/RadioGroup/index.stories.ts +123 -0
- package/app/components/ui/RadioGroup/index.vue +73 -0
- package/app/components/ui/RadioGroup/types.ts +13 -0
- package/app/components/ui/ScrollArea/index.stories.ts +69 -37
- package/app/components/ui/ScrollArea/index.vue +1 -1
- package/app/components/ui/SearchSelect/index.stories.ts +104 -66
- package/app/components/ui/Select/index.stories.ts +152 -98
- package/app/components/ui/Select/index.vue +3 -3
- package/app/components/ui/Skeleton/index.stories.ts +27 -30
- package/app/components/ui/Skeleton/index.vue +1 -1
- package/app/components/ui/Slider/index.stories.ts +73 -31
- package/app/components/ui/Slider/index.vue +1 -1
- package/app/components/ui/Surface/index.stories.ts +47 -21
- package/app/components/ui/Surface/index.vue +39 -28
- package/app/components/ui/Surface/types.ts +2 -2
- package/app/components/ui/Switch/index.stories.ts +6 -7
- package/app/components/ui/Switch/index.vue +1 -1
- package/app/components/ui/Tabs/index.stories.ts +103 -61
- package/app/components/ui/Tabs/index.vue +1 -1
- package/app/components/ui/Tag/index.stories.ts +42 -25
- package/app/components/ui/Tag/index.vue +39 -28
- package/app/components/ui/Tag/types.ts +2 -2
- package/app/components/ui/Textarea/index.stories.ts +73 -9
- package/app/components/ui/Textarea/index.vue +1 -1
- package/app/components/ui/Toast/index.stories.ts +71 -18
- package/app/components/ui/Toast/index.vue +1 -1
- package/app/components/ui/Tooltip/index.stories.ts +45 -38
- package/app/components/ui/Tooltip/index.vue +1 -1
- package/app/components/ui/WebLink/index.stories.ts +76 -41
- package/app/components/ui/WebLink/index.vue +1 -1
- package/package.json +2 -2
- package/app/components/ui/Radio/index.stories.ts +0 -71
- package/app/components/ui/Radio/index.vue +0 -10
- package/app/components/ui/Radio/types.ts +0 -3
|
@@ -14,12 +14,6 @@ const meta = {
|
|
|
14
14
|
min: 0,
|
|
15
15
|
max: 100,
|
|
16
16
|
},
|
|
17
|
-
} satisfies Meta<typeof InputRange>
|
|
18
|
-
|
|
19
|
-
export default meta
|
|
20
|
-
type Story = StoryObj<typeof meta>
|
|
21
|
-
|
|
22
|
-
export const Default: Story = {
|
|
23
17
|
render: args => ({
|
|
24
18
|
components: { InputRange },
|
|
25
19
|
setup () {
|
|
@@ -34,4 +28,9 @@ export const Default: Story = {
|
|
|
34
28
|
</div>
|
|
35
29
|
`,
|
|
36
30
|
}),
|
|
37
|
-
}
|
|
31
|
+
} satisfies Meta<typeof InputRange>
|
|
32
|
+
|
|
33
|
+
export default meta
|
|
34
|
+
type Story = StoryObj<typeof meta>
|
|
35
|
+
|
|
36
|
+
export const Default: Story = {}
|
|
@@ -4,32 +4,32 @@ import Loading from './index.vue'
|
|
|
4
4
|
const meta = {
|
|
5
5
|
title: 'UI/Loading',
|
|
6
6
|
component: Loading,
|
|
7
|
+
argTypes: {
|
|
8
|
+
class: { control: 'text' },
|
|
9
|
+
},
|
|
10
|
+
args: {
|
|
11
|
+
class: '',
|
|
12
|
+
},
|
|
13
|
+
render: args => ({
|
|
14
|
+
components: { Loading },
|
|
15
|
+
setup: () => ({ args }),
|
|
16
|
+
template: '<Loading :class="args.class" />',
|
|
17
|
+
}),
|
|
7
18
|
} satisfies Meta<typeof Loading>
|
|
8
19
|
|
|
9
20
|
export default meta
|
|
10
21
|
type Story = StoryObj<typeof meta>
|
|
11
22
|
|
|
12
|
-
export const Default: Story = {
|
|
13
|
-
|
|
23
|
+
export const Default: Story = {}
|
|
24
|
+
|
|
25
|
+
export const CustomSize: Story = {
|
|
26
|
+
render: () => ({
|
|
14
27
|
components: { Loading },
|
|
15
|
-
setup: () => ({ args }),
|
|
16
28
|
template: `
|
|
17
|
-
<div class="
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
<Loading />
|
|
22
|
-
</section>
|
|
23
|
-
|
|
24
|
-
<!-- Custom Size -->
|
|
25
|
-
<section>
|
|
26
|
-
<h3 class="mb-4 text-lg font-medium">Custom Size</h3>
|
|
27
|
-
<div class="flex items-end gap-6">
|
|
28
|
-
<Loading class="size-6" />
|
|
29
|
-
<Loading class="size-10" />
|
|
30
|
-
<Loading class="size-16" />
|
|
31
|
-
</div>
|
|
32
|
-
</section>
|
|
29
|
+
<div class="flex items-end gap-6">
|
|
30
|
+
<Loading class="size-6" />
|
|
31
|
+
<Loading class="size-10" />
|
|
32
|
+
<Loading class="size-16" />
|
|
33
33
|
</div>
|
|
34
34
|
`,
|
|
35
35
|
}),
|
|
@@ -10,17 +10,9 @@ const meta = {
|
|
|
10
10
|
args: {
|
|
11
11
|
hideTitle: false,
|
|
12
12
|
},
|
|
13
|
-
} satisfies Meta<typeof Markdown>
|
|
14
|
-
|
|
15
|
-
export default meta
|
|
16
|
-
type Story = StoryObj<typeof meta>
|
|
17
|
-
|
|
18
|
-
export const Default: Story = {
|
|
19
13
|
render: args => ({
|
|
20
14
|
components: { Markdown },
|
|
21
|
-
setup () {
|
|
22
|
-
return { args }
|
|
23
|
-
},
|
|
15
|
+
setup: () => ({ args }),
|
|
24
16
|
template: `
|
|
25
17
|
<Markdown v-bind="args">
|
|
26
18
|
<h1>Document Title</h1>
|
|
@@ -49,4 +41,9 @@ console.log(greeting)</code></pre>
|
|
|
49
41
|
</Markdown>
|
|
50
42
|
`,
|
|
51
43
|
}),
|
|
52
|
-
}
|
|
44
|
+
} satisfies Meta<typeof Markdown>
|
|
45
|
+
|
|
46
|
+
export default meta
|
|
47
|
+
type Story = StoryObj<typeof meta>
|
|
48
|
+
|
|
49
|
+
export const Default: Story = {}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import type { ModalContentType } from '../ModalContent/types'
|
|
2
3
|
import Button from '../Button/index.vue'
|
|
3
4
|
import Input from '../Input/index.vue'
|
|
4
5
|
import Modal from './index.vue'
|
|
5
6
|
|
|
7
|
+
const types: ModalContentType[] = [ 'default', 'success', 'info', 'help', 'warn', 'danger', 'error' ]
|
|
8
|
+
|
|
6
9
|
const meta = {
|
|
7
10
|
title: 'UI/Modal',
|
|
8
11
|
component: Modal,
|
|
@@ -15,109 +18,161 @@ const meta = {
|
|
|
15
18
|
hideHeader: { control: 'boolean' },
|
|
16
19
|
hideFooter: { control: 'boolean' },
|
|
17
20
|
alignCenter: { control: 'boolean' },
|
|
21
|
+
type: { control: 'select', options: types },
|
|
22
|
+
title: { control: 'text' },
|
|
23
|
+
description: { control: 'text' },
|
|
24
|
+
confirmText: { control: 'text' },
|
|
25
|
+
cancelText: { control: 'text' },
|
|
18
26
|
},
|
|
19
27
|
args: {
|
|
20
28
|
loading: false,
|
|
21
29
|
disabled: false,
|
|
22
30
|
confirmDisabled: false,
|
|
23
|
-
showCancel:
|
|
31
|
+
showCancel: true,
|
|
24
32
|
showClose: true,
|
|
25
33
|
hideHeader: false,
|
|
26
34
|
hideFooter: false,
|
|
27
35
|
alignCenter: false,
|
|
36
|
+
type: 'default',
|
|
37
|
+
title: 'Modal Title',
|
|
38
|
+
description: '',
|
|
39
|
+
confirmText: 'OK',
|
|
40
|
+
cancelText: 'Cancel',
|
|
28
41
|
},
|
|
29
|
-
|
|
42
|
+
render: args => ({
|
|
43
|
+
components: { Modal, Button, Input },
|
|
44
|
+
setup () {
|
|
45
|
+
const visible = ref(false)
|
|
46
|
+
return { args, visible }
|
|
47
|
+
},
|
|
48
|
+
template: `
|
|
49
|
+
<div>
|
|
50
|
+
<Button @click="visible = true">Open Modal</Button>
|
|
51
|
+
<Modal v-model:visible="visible" v-bind="args">
|
|
52
|
+
<p>This is the modal content.</p>
|
|
53
|
+
<Input class="mt-4" placeholder="Try interacting with this input" />
|
|
54
|
+
</Modal>
|
|
55
|
+
</div>
|
|
56
|
+
`,
|
|
57
|
+
}),
|
|
58
|
+
} satisfies Meta<typeof Modal>
|
|
30
59
|
|
|
31
60
|
export default meta
|
|
32
61
|
type Story = StoryObj<typeof meta>
|
|
33
62
|
|
|
34
|
-
export const Default: Story = {
|
|
35
|
-
|
|
36
|
-
|
|
63
|
+
export const Default: Story = {}
|
|
64
|
+
|
|
65
|
+
export const WithDescription: Story = {
|
|
66
|
+
render: () => ({
|
|
67
|
+
components: { Modal, Button },
|
|
68
|
+
setup () {
|
|
69
|
+
const visible = ref(false)
|
|
70
|
+
return { visible }
|
|
71
|
+
},
|
|
72
|
+
template: `
|
|
73
|
+
<div>
|
|
74
|
+
<Button @click="visible = true">Open Modal</Button>
|
|
75
|
+
<Modal
|
|
76
|
+
v-model:visible="visible"
|
|
77
|
+
title="Delete Project"
|
|
78
|
+
description="This will permanently remove the project and all its data. This action cannot be undone."
|
|
79
|
+
showCancel
|
|
80
|
+
confirmVariant="destructive"
|
|
81
|
+
confirmText="Delete"
|
|
82
|
+
>
|
|
83
|
+
<p>Are you sure you want to continue?</p>
|
|
84
|
+
</Modal>
|
|
85
|
+
</div>
|
|
86
|
+
`,
|
|
87
|
+
}),
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const ScrollableContent: Story = {
|
|
91
|
+
render: () => ({
|
|
92
|
+
components: { Modal, Button },
|
|
93
|
+
setup () {
|
|
94
|
+
const visible = ref(false)
|
|
95
|
+
return { visible }
|
|
96
|
+
},
|
|
97
|
+
template: `
|
|
98
|
+
<div>
|
|
99
|
+
<Button @click="visible = true">Open Modal</Button>
|
|
100
|
+
<Modal v-model:visible="visible" title="Terms of Service" showCancel confirmText="Accept">
|
|
101
|
+
<div class="space-y-4">
|
|
102
|
+
<p v-for="i in 20" :key="i">
|
|
103
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.
|
|
104
|
+
</p>
|
|
105
|
+
</div>
|
|
106
|
+
</Modal>
|
|
107
|
+
</div>
|
|
108
|
+
`,
|
|
109
|
+
}),
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const Types: Story = {
|
|
113
|
+
render: () => ({
|
|
114
|
+
components: { Modal, Button },
|
|
37
115
|
setup () {
|
|
38
|
-
const controlled = ref(false)
|
|
39
|
-
const withDescription = ref(false)
|
|
40
116
|
const typeInfo = ref(false)
|
|
41
117
|
const typeSuccess = ref(false)
|
|
42
118
|
const typeHelp = ref(false)
|
|
43
119
|
const typeWarn = ref(false)
|
|
44
120
|
const typeDanger = ref(false)
|
|
45
|
-
|
|
46
|
-
return { args, controlled, withDescription, typeInfo, typeSuccess, typeHelp, typeWarn, typeDanger, scrollable }
|
|
121
|
+
return { typeInfo, typeSuccess, typeHelp, typeWarn, typeDanger }
|
|
47
122
|
},
|
|
48
123
|
template: `
|
|
49
|
-
<div
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
<Button @click="
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
confirmText="Delete"
|
|
77
|
-
>
|
|
78
|
-
<p>Are you sure you want to continue?</p>
|
|
79
|
-
</Modal>
|
|
80
|
-
</section>
|
|
81
|
-
|
|
82
|
-
<!-- Scrollable Content -->
|
|
83
|
-
<section>
|
|
84
|
-
<h3 class="mb-4 text-lg font-medium">Scrollable Content</h3>
|
|
85
|
-
<Button @click="scrollable = true">Open Modal</Button>
|
|
86
|
-
<Modal v-model:visible="scrollable" title="Terms of Service" showCancel confirmText="Accept">
|
|
87
|
-
<div class="space-y-4">
|
|
88
|
-
<p v-for="i in 20" :key="i">
|
|
89
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.
|
|
90
|
-
</p>
|
|
91
|
-
</div>
|
|
92
|
-
</Modal>
|
|
93
|
-
</section>
|
|
124
|
+
<div>
|
|
125
|
+
<div class="flex gap-2">
|
|
126
|
+
<Button variant="outline" @click="typeInfo = true">Info</Button>
|
|
127
|
+
<Button variant="outline" @click="typeSuccess = true">Success</Button>
|
|
128
|
+
<Button variant="outline" @click="typeHelp = true">Help</Button>
|
|
129
|
+
<Button variant="outline" @click="typeWarn = true">Warn</Button>
|
|
130
|
+
<Button variant="outline" @click="typeDanger = true">Danger</Button>
|
|
131
|
+
</div>
|
|
132
|
+
<Modal v-model:visible="typeInfo" title="Information" type="info" showCancel>
|
|
133
|
+
<p>Your session will expire in 5 minutes.</p>
|
|
134
|
+
</Modal>
|
|
135
|
+
<Modal v-model:visible="typeSuccess" title="Success" type="success">
|
|
136
|
+
<p>Your payment has been processed successfully.</p>
|
|
137
|
+
</Modal>
|
|
138
|
+
<Modal v-model:visible="typeHelp" title="Help" type="help" showCancel>
|
|
139
|
+
<p>Need assistance? Check our documentation or contact support.</p>
|
|
140
|
+
</Modal>
|
|
141
|
+
<Modal v-model:visible="typeWarn" title="Warning" type="warn" showCancel confirmVariant="destructive">
|
|
142
|
+
<p>This operation may affect your existing data.</p>
|
|
143
|
+
</Modal>
|
|
144
|
+
<Modal v-model:visible="typeDanger" title="Delete Account" type="danger" showCancel confirmVariant="destructive" confirmText="Delete">
|
|
145
|
+
<p>All data will be permanently removed. This action cannot be undone.</p>
|
|
146
|
+
</Modal>
|
|
147
|
+
</div>
|
|
148
|
+
`,
|
|
149
|
+
}),
|
|
150
|
+
}
|
|
94
151
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
</Modal>
|
|
120
|
-
</section>
|
|
152
|
+
export const EventHandling: Story = {
|
|
153
|
+
render: () => ({
|
|
154
|
+
components: { Modal, Button },
|
|
155
|
+
setup () {
|
|
156
|
+
const visible = ref(false)
|
|
157
|
+
return { visible }
|
|
158
|
+
},
|
|
159
|
+
template: `
|
|
160
|
+
<div>
|
|
161
|
+
<Button @click="visible = true">Open Modal</Button>
|
|
162
|
+
<Modal
|
|
163
|
+
v-model:visible="visible"
|
|
164
|
+
title="Event Demo"
|
|
165
|
+
description="Open the Actions panel to see emitted events."
|
|
166
|
+
showCancel
|
|
167
|
+
confirmText="Confirm"
|
|
168
|
+
@open="() => {}"
|
|
169
|
+
@close="() => {}"
|
|
170
|
+
@closed="() => {}"
|
|
171
|
+
@confirm="() => {}"
|
|
172
|
+
@cancel="() => {}"
|
|
173
|
+
>
|
|
174
|
+
<p>Click Confirm, Cancel, or the close button to see events fire.</p>
|
|
175
|
+
</Modal>
|
|
121
176
|
</div>
|
|
122
177
|
`,
|
|
123
178
|
}),
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
DialogFooter,
|
|
8
8
|
DialogHeader,
|
|
9
9
|
DialogTitle,
|
|
10
|
-
} from '
|
|
10
|
+
} from '../../shadcn/dialog'
|
|
11
11
|
import type { ModalProps } from './types'
|
|
12
12
|
|
|
13
13
|
const props = withDefaults(defineProps<ModalProps>(), {
|
|
@@ -1,46 +1,74 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import type { ModalContentType } from './types'
|
|
2
3
|
import ModalContent from './index.vue'
|
|
3
4
|
|
|
5
|
+
const types: ModalContentType[] = [ 'default', 'success', 'info', 'help', 'warn', 'danger', 'error' ]
|
|
6
|
+
|
|
4
7
|
const meta = {
|
|
5
8
|
title: 'UI/ModalContent',
|
|
6
9
|
component: ModalContent,
|
|
10
|
+
argTypes: {
|
|
11
|
+
type: { control: 'select', options: types },
|
|
12
|
+
icon: { control: 'text' },
|
|
13
|
+
content: { control: 'text' },
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
type: 'default',
|
|
17
|
+
icon: '',
|
|
18
|
+
content: 'This is a message.',
|
|
19
|
+
},
|
|
20
|
+
render: args => ({
|
|
21
|
+
components: { ModalContent },
|
|
22
|
+
setup: () => ({ args }),
|
|
23
|
+
template: `
|
|
24
|
+
<div class="max-w-md">
|
|
25
|
+
<ModalContent v-bind="args" />
|
|
26
|
+
</div>
|
|
27
|
+
`,
|
|
28
|
+
}),
|
|
7
29
|
} satisfies Meta<typeof ModalContent>
|
|
8
30
|
|
|
9
31
|
export default meta
|
|
10
32
|
type Story = StoryObj<typeof meta>
|
|
11
33
|
|
|
12
|
-
export const Default: Story = {
|
|
34
|
+
export const Default: Story = {}
|
|
35
|
+
|
|
36
|
+
export const Types: Story = {
|
|
13
37
|
render: () => ({
|
|
14
38
|
components: { ModalContent },
|
|
39
|
+
setup: () => ({ types }),
|
|
15
40
|
template: `
|
|
16
41
|
<div class="space-y-4 max-w-md">
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</section>
|
|
42
|
+
<ModalContent type="default" content="This is a default message." />
|
|
43
|
+
<ModalContent type="success" content="Operation completed successfully." />
|
|
44
|
+
<ModalContent type="info" content="Your changes have been saved." />
|
|
45
|
+
<ModalContent type="help" content="Need help? Check the documentation." />
|
|
46
|
+
<ModalContent type="warn" content="This operation will affect all users." />
|
|
47
|
+
<ModalContent type="danger" content="Are you sure you want to delete this item? This action cannot be undone." />
|
|
48
|
+
<ModalContent type="error" content="An error occurred while processing your request." />
|
|
49
|
+
</div>
|
|
50
|
+
`,
|
|
51
|
+
}),
|
|
52
|
+
}
|
|
29
53
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
54
|
+
export const WithCustomIcon: Story = {
|
|
55
|
+
render: () => ({
|
|
56
|
+
components: { ModalContent },
|
|
57
|
+
template: `
|
|
58
|
+
<div class="space-y-4 max-w-md">
|
|
59
|
+
<ModalContent icon="shield-alert" content="Your session is about to expire." />
|
|
60
|
+
<ModalContent type="warn" icon="shield-alert" content="Security warning: unusual login detected." />
|
|
61
|
+
</div>
|
|
62
|
+
`,
|
|
63
|
+
}),
|
|
64
|
+
}
|
|
38
65
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
66
|
+
export const MultilineText: Story = {
|
|
67
|
+
render: () => ({
|
|
68
|
+
components: { ModalContent },
|
|
69
|
+
template: `
|
|
70
|
+
<div class="max-w-md">
|
|
71
|
+
<ModalContent type="warn" content="Warning: This operation will affect all users.\nPlease review the changes before proceeding." />
|
|
44
72
|
</div>
|
|
45
73
|
`,
|
|
46
74
|
}),
|
|
@@ -12,12 +12,12 @@ const typeIconNameMap: Partial<Record<ModalContentType, string>> = {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const typeIconClasses: Record<ModalContentType, string> = {
|
|
15
|
-
default: 'text-
|
|
15
|
+
default: 'text-secondary-foreground',
|
|
16
16
|
success: 'text-success',
|
|
17
17
|
info: 'text-info',
|
|
18
18
|
help: 'text-help',
|
|
19
19
|
warn: 'text-warn',
|
|
20
|
-
danger: 'text-
|
|
20
|
+
danger: 'text-danger',
|
|
21
21
|
error: 'text-destructive',
|
|
22
22
|
}
|
|
23
23
|
|