@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
|
@@ -1,66 +1,140 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import type { DateRangePickerValue } from './types'
|
|
2
3
|
import DateRangePicker from './index.vue'
|
|
3
4
|
|
|
4
5
|
const meta = {
|
|
5
6
|
title: 'UI/DateRangePicker',
|
|
6
7
|
component: DateRangePicker,
|
|
7
8
|
argTypes: {
|
|
9
|
+
modelValue: { control: 'object' },
|
|
8
10
|
showTime: { control: 'boolean' },
|
|
9
11
|
disabled: { control: 'boolean' },
|
|
12
|
+
readonly: { control: 'boolean' },
|
|
13
|
+
startPlaceholder: { control: 'text' },
|
|
14
|
+
endPlaceholder: { control: 'text' },
|
|
15
|
+
minDate: { control: 'date' },
|
|
16
|
+
maxDate: { control: 'date' },
|
|
10
17
|
maxSpanDays: { control: 'number' },
|
|
18
|
+
valueFormat: { control: 'text' },
|
|
19
|
+
autoApply: { control: 'boolean' },
|
|
20
|
+
class: { control: 'text' },
|
|
11
21
|
},
|
|
12
22
|
args: {
|
|
23
|
+
modelValue: { start: null, end: null },
|
|
13
24
|
showTime: false,
|
|
14
25
|
disabled: false,
|
|
26
|
+
readonly: false,
|
|
27
|
+
startPlaceholder: '',
|
|
28
|
+
endPlaceholder: '',
|
|
29
|
+
minDate: undefined,
|
|
30
|
+
maxDate: undefined,
|
|
15
31
|
maxSpanDays: undefined,
|
|
32
|
+
valueFormat: '',
|
|
33
|
+
autoApply: false,
|
|
34
|
+
class: '',
|
|
16
35
|
},
|
|
36
|
+
render: args => ({
|
|
37
|
+
components: { DateRangePicker },
|
|
38
|
+
setup () {
|
|
39
|
+
const range = ref<DateRangePickerValue>({ start: null, end: null })
|
|
40
|
+
return { args, range }
|
|
41
|
+
},
|
|
42
|
+
template: `
|
|
43
|
+
<div class="max-w-lg">
|
|
44
|
+
<DateRangePicker v-model="range" v-bind="args" />
|
|
45
|
+
<div class="mt-2 text-sm text-muted-foreground">Value: {{ range }}</div>
|
|
46
|
+
</div>
|
|
47
|
+
`,
|
|
48
|
+
}),
|
|
17
49
|
} satisfies Meta<typeof DateRangePicker>
|
|
18
50
|
|
|
19
51
|
export default meta
|
|
20
52
|
type Story = StoryObj<typeof meta>
|
|
21
53
|
|
|
22
|
-
export const Default: Story = {
|
|
23
|
-
|
|
54
|
+
export const Default: Story = {}
|
|
55
|
+
|
|
56
|
+
export const WithTime: Story = {
|
|
57
|
+
render: () => ({
|
|
58
|
+
components: { DateRangePicker },
|
|
59
|
+
setup () {
|
|
60
|
+
const withTime = ref<DateRangePickerValue>({ start: null, end: null })
|
|
61
|
+
return { withTime }
|
|
62
|
+
},
|
|
63
|
+
template: `
|
|
64
|
+
<div class="max-w-lg">
|
|
65
|
+
<DateRangePicker v-model="withTime" showTime />
|
|
66
|
+
<div class="mt-2 text-sm text-muted-foreground">Value: {{ withTime }}</div>
|
|
67
|
+
</div>
|
|
68
|
+
`,
|
|
69
|
+
}),
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const MaxSpanDays: Story = {
|
|
73
|
+
render: () => ({
|
|
24
74
|
components: { DateRangePicker },
|
|
25
75
|
setup () {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
76
|
+
const maxSpan = ref<DateRangePickerValue>({ start: null, end: null })
|
|
77
|
+
return { maxSpan }
|
|
78
|
+
},
|
|
79
|
+
template: `
|
|
80
|
+
<div class="max-w-lg">
|
|
81
|
+
<DateRangePicker v-model="maxSpan" :maxSpanDays="7" />
|
|
82
|
+
<div class="mt-2 text-sm text-muted-foreground">Value: {{ maxSpan }}</div>
|
|
83
|
+
</div>
|
|
84
|
+
`,
|
|
85
|
+
}),
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Preselected: Story = {
|
|
89
|
+
render: () => ({
|
|
90
|
+
components: { DateRangePicker },
|
|
91
|
+
setup () {
|
|
92
|
+
const preselected = ref<DateRangePickerValue>({
|
|
30
93
|
start: new Date(2025, 5, 1),
|
|
31
94
|
end: new Date(2025, 5, 15),
|
|
32
95
|
})
|
|
33
|
-
return {
|
|
96
|
+
return { preselected }
|
|
34
97
|
},
|
|
35
98
|
template: `
|
|
36
|
-
<div class="max-w-lg
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<!-- With Time -->
|
|
45
|
-
<section>
|
|
46
|
-
<h3 class="mb-4 text-lg font-medium">With Time</h3>
|
|
47
|
-
<DateRangePicker v-model="withTime" showTime />
|
|
48
|
-
<div class="mt-2 text-sm text-muted-foreground">Value: {{ withTime }}</div>
|
|
49
|
-
</section>
|
|
99
|
+
<div class="max-w-lg">
|
|
100
|
+
<DateRangePicker v-model="preselected" />
|
|
101
|
+
<div class="mt-2 text-sm text-muted-foreground">Value: {{ preselected }}</div>
|
|
102
|
+
</div>
|
|
103
|
+
`,
|
|
104
|
+
}),
|
|
105
|
+
}
|
|
50
106
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
107
|
+
export const Disabled: Story = {
|
|
108
|
+
render: () => ({
|
|
109
|
+
components: { DateRangePicker },
|
|
110
|
+
setup () {
|
|
111
|
+
const range = ref<DateRangePickerValue>({
|
|
112
|
+
start: new Date(2025, 5, 1),
|
|
113
|
+
end: new Date(2025, 5, 15),
|
|
114
|
+
})
|
|
115
|
+
return { range }
|
|
116
|
+
},
|
|
117
|
+
template: `
|
|
118
|
+
<div class="max-w-lg">
|
|
119
|
+
<DateRangePicker v-model="range" disabled />
|
|
120
|
+
</div>
|
|
121
|
+
`,
|
|
122
|
+
}),
|
|
123
|
+
}
|
|
57
124
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
125
|
+
export const Readonly: Story = {
|
|
126
|
+
render: () => ({
|
|
127
|
+
components: { DateRangePicker },
|
|
128
|
+
setup () {
|
|
129
|
+
const range = ref<DateRangePickerValue>({
|
|
130
|
+
start: new Date(2025, 5, 1),
|
|
131
|
+
end: new Date(2025, 5, 15),
|
|
132
|
+
})
|
|
133
|
+
return { range }
|
|
134
|
+
},
|
|
135
|
+
template: `
|
|
136
|
+
<div class="max-w-lg">
|
|
137
|
+
<DateRangePicker v-model="range" readonly />
|
|
64
138
|
</div>
|
|
65
139
|
`,
|
|
66
140
|
}),
|
|
@@ -1,41 +1,63 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
2
|
import Divider from './index.vue'
|
|
3
3
|
|
|
4
|
+
const types = [ 'horizontal', 'vertical' ] as const
|
|
5
|
+
|
|
4
6
|
const meta = {
|
|
5
7
|
title: 'UI/Divider',
|
|
6
8
|
component: Divider,
|
|
9
|
+
argTypes: {
|
|
10
|
+
type: { control: 'select', options: types },
|
|
11
|
+
},
|
|
12
|
+
args: {
|
|
13
|
+
type: 'horizontal',
|
|
14
|
+
},
|
|
15
|
+
render: args => ({
|
|
16
|
+
components: { Divider },
|
|
17
|
+
setup: () => ({ args }),
|
|
18
|
+
template: `
|
|
19
|
+
<div v-if="args.type === 'vertical'" class="flex h-8 items-center gap-4">
|
|
20
|
+
<span>Left</span>
|
|
21
|
+
<Divider v-bind="args" />
|
|
22
|
+
<span>Right</span>
|
|
23
|
+
</div>
|
|
24
|
+
<div v-else class="space-y-4">
|
|
25
|
+
<p>Content above</p>
|
|
26
|
+
<Divider v-bind="args" />
|
|
27
|
+
<p>Content below</p>
|
|
28
|
+
</div>
|
|
29
|
+
`,
|
|
30
|
+
}),
|
|
7
31
|
} satisfies Meta<typeof Divider>
|
|
8
32
|
|
|
9
33
|
export default meta
|
|
10
34
|
type Story = StoryObj<typeof meta>
|
|
11
35
|
|
|
12
|
-
export const Default: Story = {
|
|
13
|
-
|
|
36
|
+
export const Default: Story = {}
|
|
37
|
+
|
|
38
|
+
export const Horizontal: Story = {
|
|
39
|
+
render: () => ({
|
|
14
40
|
components: { Divider },
|
|
15
|
-
setup: () => ({ args }),
|
|
16
41
|
template: `
|
|
17
|
-
<div class="space-y-
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</div>
|
|
26
|
-
</section>
|
|
42
|
+
<div class="space-y-4">
|
|
43
|
+
<p>Content above</p>
|
|
44
|
+
<Divider />
|
|
45
|
+
<p>Content below</p>
|
|
46
|
+
</div>
|
|
47
|
+
`,
|
|
48
|
+
}),
|
|
49
|
+
}
|
|
27
50
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</section>
|
|
51
|
+
export const Vertical: Story = {
|
|
52
|
+
render: () => ({
|
|
53
|
+
components: { Divider },
|
|
54
|
+
template: `
|
|
55
|
+
<div class="flex h-8 items-center gap-4">
|
|
56
|
+
<span>Left</span>
|
|
57
|
+
<Divider type="vertical" />
|
|
58
|
+
<span>Center</span>
|
|
59
|
+
<Divider type="vertical" />
|
|
60
|
+
<span>Right</span>
|
|
39
61
|
</div>
|
|
40
62
|
`,
|
|
41
63
|
}),
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
2
|
import Button from '../Button/index.vue'
|
|
3
3
|
import Input from '../Input/index.vue'
|
|
4
|
+
import type { DrawerSide } from './types'
|
|
4
5
|
import Drawer from './index.vue'
|
|
5
6
|
|
|
7
|
+
const sides: DrawerSide[] = [ 'top', 'right', 'bottom', 'left' ]
|
|
8
|
+
|
|
6
9
|
const meta = {
|
|
7
10
|
title: 'UI/Drawer',
|
|
8
11
|
component: Drawer,
|
|
@@ -14,110 +17,157 @@ const meta = {
|
|
|
14
17
|
showClose: { control: 'boolean' },
|
|
15
18
|
hideHeader: { control: 'boolean' },
|
|
16
19
|
hideFooter: { control: 'boolean' },
|
|
17
|
-
side: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
20
|
+
side: { control: 'select', options: sides },
|
|
21
|
+
title: { control: 'text' },
|
|
22
|
+
description: { control: 'text' },
|
|
23
|
+
confirmText: { control: 'text' },
|
|
24
|
+
cancelText: { control: 'text' },
|
|
21
25
|
},
|
|
22
26
|
args: {
|
|
23
27
|
loading: false,
|
|
24
28
|
disabled: false,
|
|
25
29
|
confirmDisabled: false,
|
|
26
|
-
showCancel:
|
|
30
|
+
showCancel: true,
|
|
27
31
|
showClose: true,
|
|
28
32
|
hideHeader: false,
|
|
29
33
|
hideFooter: false,
|
|
30
34
|
side: 'right',
|
|
35
|
+
title: 'Drawer Title',
|
|
36
|
+
description: '',
|
|
37
|
+
confirmText: 'OK',
|
|
38
|
+
cancelText: 'Cancel',
|
|
31
39
|
},
|
|
32
|
-
|
|
40
|
+
render: args => ({
|
|
41
|
+
components: { Drawer, Button, Input },
|
|
42
|
+
setup () {
|
|
43
|
+
const visible = ref(false)
|
|
44
|
+
return { args, visible }
|
|
45
|
+
},
|
|
46
|
+
template: `
|
|
47
|
+
<div>
|
|
48
|
+
<Button @click="visible = true">Open Drawer</Button>
|
|
49
|
+
<Drawer v-model:visible="visible" v-bind="args">
|
|
50
|
+
<p>This is the drawer content.</p>
|
|
51
|
+
<Input class="mt-4" placeholder="Try interacting with this input" />
|
|
52
|
+
</Drawer>
|
|
53
|
+
</div>
|
|
54
|
+
`,
|
|
55
|
+
}),
|
|
56
|
+
} satisfies Meta<typeof Drawer>
|
|
33
57
|
|
|
34
58
|
export default meta
|
|
35
59
|
type Story = StoryObj<typeof meta>
|
|
36
60
|
|
|
37
|
-
export const Default: Story = {
|
|
38
|
-
|
|
61
|
+
export const Default: Story = {}
|
|
62
|
+
|
|
63
|
+
export const WithDescription: Story = {
|
|
64
|
+
render: () => ({
|
|
39
65
|
components: { Drawer, Button, Input },
|
|
40
66
|
setup () {
|
|
41
|
-
const
|
|
42
|
-
|
|
67
|
+
const visible = ref(false)
|
|
68
|
+
return { visible }
|
|
69
|
+
},
|
|
70
|
+
template: `
|
|
71
|
+
<div>
|
|
72
|
+
<Button @click="visible = true">Open Drawer</Button>
|
|
73
|
+
<Drawer
|
|
74
|
+
v-model:visible="visible"
|
|
75
|
+
title="Edit Profile"
|
|
76
|
+
description="Update your personal information. Changes will be visible to other users immediately."
|
|
77
|
+
showCancel
|
|
78
|
+
confirmText="Save"
|
|
79
|
+
>
|
|
80
|
+
<div class="space-y-3">
|
|
81
|
+
<Input placeholder="Name" />
|
|
82
|
+
<Input placeholder="Email" />
|
|
83
|
+
</div>
|
|
84
|
+
</Drawer>
|
|
85
|
+
</div>
|
|
86
|
+
`,
|
|
87
|
+
}),
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const ScrollableContent: Story = {
|
|
91
|
+
render: () => ({
|
|
92
|
+
components: { Drawer, Button },
|
|
93
|
+
setup () {
|
|
94
|
+
const visible = ref(false)
|
|
95
|
+
return { visible }
|
|
96
|
+
},
|
|
97
|
+
template: `
|
|
98
|
+
<div>
|
|
99
|
+
<Button @click="visible = true">Open Drawer</Button>
|
|
100
|
+
<Drawer 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
|
+
</Drawer>
|
|
107
|
+
</div>
|
|
108
|
+
`,
|
|
109
|
+
}),
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const Sides: Story = {
|
|
113
|
+
render: () => ({
|
|
114
|
+
components: { Drawer, Button },
|
|
115
|
+
setup () {
|
|
43
116
|
const sideTop = ref(false)
|
|
44
117
|
const sideRight = ref(false)
|
|
45
118
|
const sideBottom = ref(false)
|
|
46
119
|
const sideLeft = ref(false)
|
|
47
|
-
|
|
48
|
-
return { args, controlled, withDescription, sideTop, sideRight, sideBottom, sideLeft, scrollable }
|
|
120
|
+
return { sideTop, sideRight, sideBottom, sideLeft }
|
|
49
121
|
},
|
|
50
122
|
template: `
|
|
51
|
-
<div
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
<Button @click="
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
</
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
title="Edit Profile"
|
|
75
|
-
description="Update your personal information. Changes will be visible to other users immediately."
|
|
76
|
-
showCancel
|
|
77
|
-
confirmText="Save"
|
|
78
|
-
>
|
|
79
|
-
<div class="space-y-3">
|
|
80
|
-
<Input placeholder="Name" />
|
|
81
|
-
<Input placeholder="Email" />
|
|
82
|
-
</div>
|
|
83
|
-
</Drawer>
|
|
84
|
-
</section>
|
|
85
|
-
|
|
86
|
-
<!-- Scrollable Content -->
|
|
87
|
-
<section>
|
|
88
|
-
<h3 class="mb-4 text-lg font-medium">Scrollable Content</h3>
|
|
89
|
-
<Button @click="scrollable = true">Open Drawer</Button>
|
|
90
|
-
<Drawer v-model:visible="scrollable" title="Terms of Service" showCancel confirmText="Accept">
|
|
91
|
-
<div class="space-y-4">
|
|
92
|
-
<p v-for="i in 20" :key="i">
|
|
93
|
-
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.
|
|
94
|
-
</p>
|
|
95
|
-
</div>
|
|
96
|
-
</Drawer>
|
|
97
|
-
</section>
|
|
123
|
+
<div>
|
|
124
|
+
<div class="flex gap-2">
|
|
125
|
+
<Button variant="outline" @click="sideTop = true">Top</Button>
|
|
126
|
+
<Button variant="outline" @click="sideRight = true">Right</Button>
|
|
127
|
+
<Button variant="outline" @click="sideBottom = true">Bottom</Button>
|
|
128
|
+
<Button variant="outline" @click="sideLeft = true">Left</Button>
|
|
129
|
+
</div>
|
|
130
|
+
<Drawer v-model:visible="sideTop" side="top" title="Top Drawer">
|
|
131
|
+
<p>Slides in from the top.</p>
|
|
132
|
+
</Drawer>
|
|
133
|
+
<Drawer v-model:visible="sideRight" side="right" title="Right Drawer">
|
|
134
|
+
<p>Slides in from the right.</p>
|
|
135
|
+
</Drawer>
|
|
136
|
+
<Drawer v-model:visible="sideBottom" side="bottom" title="Bottom Drawer">
|
|
137
|
+
<p>Slides in from the bottom.</p>
|
|
138
|
+
</Drawer>
|
|
139
|
+
<Drawer v-model:visible="sideLeft" side="left" title="Left Drawer">
|
|
140
|
+
<p>Slides in from the left.</p>
|
|
141
|
+
</Drawer>
|
|
142
|
+
</div>
|
|
143
|
+
`,
|
|
144
|
+
}),
|
|
145
|
+
}
|
|
98
146
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
147
|
+
export const EventHandling: Story = {
|
|
148
|
+
render: () => ({
|
|
149
|
+
components: { Drawer, Button },
|
|
150
|
+
setup () {
|
|
151
|
+
const visible = ref(false)
|
|
152
|
+
return { visible }
|
|
153
|
+
},
|
|
154
|
+
template: `
|
|
155
|
+
<div>
|
|
156
|
+
<Button @click="visible = true">Open Drawer</Button>
|
|
157
|
+
<Drawer
|
|
158
|
+
v-model:visible="visible"
|
|
159
|
+
title="Event Demo"
|
|
160
|
+
description="Open the Actions panel to see emitted events."
|
|
161
|
+
showCancel
|
|
162
|
+
confirmText="Confirm"
|
|
163
|
+
@open="() => {}"
|
|
164
|
+
@close="() => {}"
|
|
165
|
+
@closed="() => {}"
|
|
166
|
+
@confirm="() => {}"
|
|
167
|
+
@cancel="() => {}"
|
|
168
|
+
>
|
|
169
|
+
<p>Click Confirm, Cancel, or the close button to see events fire.</p>
|
|
170
|
+
</Drawer>
|
|
121
171
|
</div>
|
|
122
172
|
`,
|
|
123
173
|
}),
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
SheetFooter,
|
|
8
8
|
SheetHeader,
|
|
9
9
|
SheetTitle,
|
|
10
|
-
} from '
|
|
10
|
+
} from '../../shadcn/sheet'
|
|
11
11
|
import type { DrawerProps } from './types'
|
|
12
12
|
|
|
13
13
|
const props = withDefaults(defineProps<DrawerProps>(), {
|