@polymarbot/nuxt-layer-shadcn-ui 0.3.10 → 0.4.1
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
|
@@ -38,85 +38,40 @@ export const Default: Story = {}
|
|
|
38
38
|
|
|
39
39
|
export const UsdSymbol: Story = {
|
|
40
40
|
parameters: noControls,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return { value }
|
|
46
|
-
},
|
|
47
|
-
template: `
|
|
48
|
-
<div class="max-w-xs">
|
|
49
|
-
<InputCurrency v-model="value" currency="USD" />
|
|
50
|
-
<div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
|
|
51
|
-
</div>
|
|
52
|
-
`,
|
|
53
|
-
}),
|
|
41
|
+
args: {
|
|
42
|
+
currency: 'USD',
|
|
43
|
+
currencyDisplay: 'symbol',
|
|
44
|
+
},
|
|
54
45
|
}
|
|
55
46
|
|
|
56
47
|
export const EurCodeDisplay: Story = {
|
|
57
48
|
parameters: noControls,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return { value }
|
|
63
|
-
},
|
|
64
|
-
template: `
|
|
65
|
-
<div class="max-w-xs">
|
|
66
|
-
<InputCurrency v-model="value" currency="EUR" currencyDisplay="code" />
|
|
67
|
-
<div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
|
|
68
|
-
</div>
|
|
69
|
-
`,
|
|
70
|
-
}),
|
|
49
|
+
args: {
|
|
50
|
+
currency: 'EUR',
|
|
51
|
+
currencyDisplay: 'code',
|
|
52
|
+
},
|
|
71
53
|
}
|
|
72
54
|
|
|
73
55
|
export const CadSymbol: Story = {
|
|
74
56
|
parameters: noControls,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return { value }
|
|
80
|
-
},
|
|
81
|
-
template: `
|
|
82
|
-
<div class="max-w-xs">
|
|
83
|
-
<InputCurrency v-model="value" currency="CAD" currencyDisplay="symbol" />
|
|
84
|
-
<div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
|
|
85
|
-
</div>
|
|
86
|
-
`,
|
|
87
|
-
}),
|
|
57
|
+
args: {
|
|
58
|
+
currency: 'CAD',
|
|
59
|
+
currencyDisplay: 'symbol',
|
|
60
|
+
},
|
|
88
61
|
}
|
|
89
62
|
|
|
90
63
|
export const CadNarrowSymbol: Story = {
|
|
91
64
|
parameters: noControls,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return { value }
|
|
97
|
-
},
|
|
98
|
-
template: `
|
|
99
|
-
<div class="max-w-xs">
|
|
100
|
-
<InputCurrency v-model="value" currency="CAD" currencyDisplay="narrowSymbol" />
|
|
101
|
-
<div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
|
|
102
|
-
</div>
|
|
103
|
-
`,
|
|
104
|
-
}),
|
|
65
|
+
args: {
|
|
66
|
+
currency: 'CAD',
|
|
67
|
+
currencyDisplay: 'narrowSymbol',
|
|
68
|
+
},
|
|
105
69
|
}
|
|
106
70
|
|
|
107
71
|
export const JpyNameDisplay: Story = {
|
|
108
72
|
parameters: noControls,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
return { value }
|
|
114
|
-
},
|
|
115
|
-
template: `
|
|
116
|
-
<div class="max-w-xs">
|
|
117
|
-
<InputCurrency v-model="value" currencyDisplay="name" />
|
|
118
|
-
<div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
|
|
119
|
-
</div>
|
|
120
|
-
`,
|
|
121
|
-
}),
|
|
73
|
+
args: {
|
|
74
|
+
currency: 'JPY',
|
|
75
|
+
currencyDisplay: 'name',
|
|
76
|
+
},
|
|
122
77
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import EventLog from '#storybook/EventLog.vue'
|
|
2
3
|
import InputNumber from './index.vue'
|
|
3
4
|
|
|
4
5
|
const meta = {
|
|
@@ -46,82 +47,54 @@ export const Default: Story = {}
|
|
|
46
47
|
|
|
47
48
|
export const WithMinMax: Story = {
|
|
48
49
|
parameters: noControls,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return { value }
|
|
54
|
-
},
|
|
55
|
-
template: `
|
|
56
|
-
<div class="max-w-xs">
|
|
57
|
-
<InputNumber v-model="value" :min="0" :max="10" />
|
|
58
|
-
<div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
|
|
59
|
-
</div>
|
|
60
|
-
`,
|
|
61
|
-
}),
|
|
50
|
+
args: {
|
|
51
|
+
min: 0,
|
|
52
|
+
max: 10,
|
|
53
|
+
},
|
|
62
54
|
}
|
|
63
55
|
|
|
64
56
|
export const CustomStep: Story = {
|
|
65
57
|
parameters: noControls,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const value = ref(0)
|
|
70
|
-
return { value }
|
|
71
|
-
},
|
|
72
|
-
template: `
|
|
73
|
-
<div class="max-w-xs">
|
|
74
|
-
<InputNumber v-model="value" :step="5" />
|
|
75
|
-
<div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
|
|
76
|
-
</div>
|
|
77
|
-
`,
|
|
78
|
-
}),
|
|
58
|
+
args: {
|
|
59
|
+
step: 5,
|
|
60
|
+
},
|
|
79
61
|
}
|
|
80
62
|
|
|
81
63
|
export const WithoutButtons: Story = {
|
|
82
64
|
parameters: noControls,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const value = ref(0)
|
|
87
|
-
return { value }
|
|
88
|
-
},
|
|
89
|
-
template: `
|
|
90
|
-
<div class="max-w-xs">
|
|
91
|
-
<InputNumber v-model="value" :showButtons="false" />
|
|
92
|
-
</div>
|
|
93
|
-
`,
|
|
94
|
-
}),
|
|
65
|
+
args: {
|
|
66
|
+
showButtons: false,
|
|
67
|
+
},
|
|
95
68
|
}
|
|
96
69
|
|
|
97
70
|
export const Disabled: Story = {
|
|
98
71
|
parameters: noControls,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const value = ref(0)
|
|
103
|
-
return { value }
|
|
104
|
-
},
|
|
105
|
-
template: `
|
|
106
|
-
<div class="max-w-xs">
|
|
107
|
-
<InputNumber v-model="value" disabled />
|
|
108
|
-
</div>
|
|
109
|
-
`,
|
|
110
|
-
}),
|
|
72
|
+
args: {
|
|
73
|
+
disabled: true,
|
|
74
|
+
},
|
|
111
75
|
}
|
|
112
76
|
|
|
113
77
|
export const Invalid: Story = {
|
|
78
|
+
parameters: noControls,
|
|
79
|
+
args: {
|
|
80
|
+
invalid: true,
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const EventHandling: Story = {
|
|
114
85
|
parameters: noControls,
|
|
115
86
|
render: () => ({
|
|
116
|
-
components: { InputNumber },
|
|
117
|
-
setup () {
|
|
118
|
-
const value = ref(0)
|
|
119
|
-
return { value }
|
|
120
|
-
},
|
|
87
|
+
components: { InputNumber, EventLog },
|
|
88
|
+
setup: () => ({ value: ref(0) }),
|
|
121
89
|
template: `
|
|
122
|
-
<
|
|
123
|
-
<
|
|
124
|
-
|
|
90
|
+
<EventLog v-slot="{ record }">
|
|
91
|
+
<div class="max-w-xs">
|
|
92
|
+
<InputNumber
|
|
93
|
+
v-model="value"
|
|
94
|
+
@update:modelValue="(v) => record('update:modelValue', v)"
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
</EventLog>
|
|
125
98
|
`,
|
|
126
99
|
}),
|
|
127
100
|
}
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import EventLog from '#storybook/EventLog.vue'
|
|
2
3
|
import InputOtp from './index.vue'
|
|
3
4
|
|
|
4
5
|
const meta = {
|
|
5
6
|
title: 'UI/InputOtp',
|
|
6
7
|
component: InputOtp,
|
|
7
8
|
argTypes: {
|
|
8
|
-
|
|
9
|
+
modelValue: { control: 'text' },
|
|
9
10
|
length: { control: 'number' },
|
|
11
|
+
disabled: { control: 'boolean' },
|
|
10
12
|
},
|
|
11
13
|
args: {
|
|
12
|
-
|
|
14
|
+
modelValue: '',
|
|
13
15
|
length: 6,
|
|
16
|
+
disabled: false,
|
|
14
17
|
},
|
|
15
18
|
render: args => ({
|
|
16
19
|
components: { InputOtp },
|
|
17
20
|
setup () {
|
|
18
21
|
const otp = ref('')
|
|
19
|
-
|
|
20
|
-
function onComplete (value: string) {
|
|
21
|
-
completed.value = value
|
|
22
|
-
}
|
|
23
|
-
return { args, otp, completed, onComplete }
|
|
22
|
+
return { args, otp }
|
|
24
23
|
},
|
|
25
24
|
template: `
|
|
26
25
|
<div class="space-y-4">
|
|
27
|
-
<InputOtp v-model="otp" v-bind="args"
|
|
26
|
+
<InputOtp v-model="otp" v-bind="args" />
|
|
28
27
|
<div class="text-sm text-muted-foreground">Value: {{ otp }}</div>
|
|
29
|
-
<div v-if="completed" class="text-sm text-success">Completed: {{ completed }}</div>
|
|
30
28
|
</div>
|
|
31
29
|
`,
|
|
32
30
|
}),
|
|
@@ -35,4 +33,38 @@ const meta = {
|
|
|
35
33
|
export default meta
|
|
36
34
|
type Story = StoryObj<typeof meta>
|
|
37
35
|
|
|
36
|
+
const noControls = { controls: { disable: true }} satisfies Story['parameters']
|
|
37
|
+
|
|
38
38
|
export const Default: Story = {}
|
|
39
|
+
|
|
40
|
+
export const CustomLength: Story = {
|
|
41
|
+
parameters: noControls,
|
|
42
|
+
args: {
|
|
43
|
+
length: 4,
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const Disabled: Story = {
|
|
48
|
+
parameters: noControls,
|
|
49
|
+
args: {
|
|
50
|
+
disabled: true,
|
|
51
|
+
modelValue: '123456',
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const EventHandling: Story = {
|
|
56
|
+
parameters: noControls,
|
|
57
|
+
render: () => ({
|
|
58
|
+
components: { InputOtp, EventLog },
|
|
59
|
+
setup: () => ({ otp: ref('') }),
|
|
60
|
+
template: `
|
|
61
|
+
<EventLog v-slot="{ record }">
|
|
62
|
+
<InputOtp
|
|
63
|
+
v-model="otp"
|
|
64
|
+
@update:modelValue="(v) => record('update:modelValue', v)"
|
|
65
|
+
@complete="(v) => record('complete', v)"
|
|
66
|
+
/>
|
|
67
|
+
</EventLog>
|
|
68
|
+
`,
|
|
69
|
+
}),
|
|
70
|
+
}
|
|
@@ -4,12 +4,8 @@ import InputPercent from './index.vue'
|
|
|
4
4
|
const meta = {
|
|
5
5
|
title: 'UI/InputPercent',
|
|
6
6
|
component: InputPercent,
|
|
7
|
-
argTypes: {
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
args: {
|
|
11
|
-
disabled: false,
|
|
12
|
-
},
|
|
7
|
+
argTypes: {},
|
|
8
|
+
args: {},
|
|
13
9
|
render: args => ({
|
|
14
10
|
components: { InputPercent },
|
|
15
11
|
setup () {
|
|
@@ -23,7 +19,7 @@ const meta = {
|
|
|
23
19
|
</div>
|
|
24
20
|
`,
|
|
25
21
|
}),
|
|
26
|
-
} satisfies Meta
|
|
22
|
+
} satisfies Meta<typeof InputPercent>
|
|
27
23
|
|
|
28
24
|
export default meta
|
|
29
25
|
type Story = StoryObj<typeof meta>
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import EventLog from '#storybook/EventLog.vue'
|
|
2
3
|
import InputRange from './index.vue'
|
|
3
4
|
|
|
4
5
|
const meta = {
|
|
5
6
|
title: 'UI/InputRange',
|
|
6
7
|
component: InputRange,
|
|
7
8
|
argTypes: {
|
|
8
|
-
|
|
9
|
+
start: { control: 'number' },
|
|
10
|
+
end: { control: 'number' },
|
|
9
11
|
min: { control: 'number' },
|
|
10
12
|
max: { control: 'number' },
|
|
13
|
+
disabled: { control: 'boolean' },
|
|
11
14
|
},
|
|
12
15
|
args: {
|
|
13
|
-
|
|
16
|
+
start: 20,
|
|
17
|
+
end: 80,
|
|
14
18
|
min: 0,
|
|
15
19
|
max: 100,
|
|
20
|
+
disabled: false,
|
|
16
21
|
},
|
|
17
22
|
render: args => ({
|
|
18
23
|
components: { InputRange },
|
|
19
24
|
setup () {
|
|
20
|
-
const start = ref(
|
|
21
|
-
const end = ref(
|
|
25
|
+
const start = ref<number | undefined>(args.start)
|
|
26
|
+
const end = ref<number | undefined>(args.end)
|
|
22
27
|
return { args, start, end }
|
|
23
28
|
},
|
|
24
29
|
template: `
|
|
@@ -33,4 +38,46 @@ const meta = {
|
|
|
33
38
|
export default meta
|
|
34
39
|
type Story = StoryObj<typeof meta>
|
|
35
40
|
|
|
41
|
+
const noControls = { controls: { disable: true }} satisfies Story['parameters']
|
|
42
|
+
|
|
36
43
|
export const Default: Story = {}
|
|
44
|
+
|
|
45
|
+
export const CustomBounds: Story = {
|
|
46
|
+
parameters: noControls,
|
|
47
|
+
args: {
|
|
48
|
+
start: -50,
|
|
49
|
+
end: 50,
|
|
50
|
+
min: -100,
|
|
51
|
+
max: 100,
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const Disabled: Story = {
|
|
56
|
+
parameters: noControls,
|
|
57
|
+
args: {
|
|
58
|
+
disabled: true,
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const EventHandling: Story = {
|
|
63
|
+
parameters: noControls,
|
|
64
|
+
render: () => ({
|
|
65
|
+
components: { InputRange, EventLog },
|
|
66
|
+
setup: () => ({
|
|
67
|
+
start: ref<number | undefined>(20),
|
|
68
|
+
end: ref<number | undefined>(80),
|
|
69
|
+
}),
|
|
70
|
+
template: `
|
|
71
|
+
<EventLog v-slot="{ record }">
|
|
72
|
+
<div class="max-w-md">
|
|
73
|
+
<InputRange
|
|
74
|
+
v-model:start="start"
|
|
75
|
+
v-model:end="end"
|
|
76
|
+
@update:start="(v) => record('update:start', v)"
|
|
77
|
+
@update:end="(v) => record('update:end', v)"
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
</EventLog>
|
|
81
|
+
`,
|
|
82
|
+
}),
|
|
83
|
+
}
|
|
@@ -25,7 +25,22 @@ const noControls = { controls: { disable: true }} satisfies Story['parameters']
|
|
|
25
25
|
export const Default: Story = {}
|
|
26
26
|
|
|
27
27
|
export const CustomSize: Story = {
|
|
28
|
-
parameters:
|
|
28
|
+
parameters: {
|
|
29
|
+
...noControls,
|
|
30
|
+
docs: {
|
|
31
|
+
source: {
|
|
32
|
+
code: `
|
|
33
|
+
<template>
|
|
34
|
+
<div class="flex items-end gap-6">
|
|
35
|
+
<Loading class="size-6" />
|
|
36
|
+
<Loading class="size-10" />
|
|
37
|
+
<Loading class="size-16" />
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
`.trim(),
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
29
44
|
render: () => ({
|
|
30
45
|
components: { Loading },
|
|
31
46
|
template: `
|
|
@@ -46,4 +46,13 @@ console.log(greeting)</code></pre>
|
|
|
46
46
|
export default meta
|
|
47
47
|
type Story = StoryObj<typeof meta>
|
|
48
48
|
|
|
49
|
+
const noControls = { controls: { disable: true }} satisfies Story['parameters']
|
|
50
|
+
|
|
49
51
|
export const Default: Story = {}
|
|
52
|
+
|
|
53
|
+
export const HideTitle: Story = {
|
|
54
|
+
parameters: noControls,
|
|
55
|
+
args: {
|
|
56
|
+
hideTitle: true,
|
|
57
|
+
},
|
|
58
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
2
|
import type { ModalContentType } from '../ModalContent/types'
|
|
3
|
+
import EventLog from '#storybook/EventLog.vue'
|
|
3
4
|
import Button from '../Button/index.vue'
|
|
4
5
|
import Input from '../Input/index.vue'
|
|
5
6
|
import Modal from './index.vue'
|
|
@@ -67,7 +68,27 @@ const noControls = { controls: { disable: true }} satisfies Story['parameters']
|
|
|
67
68
|
export const Default: Story = {}
|
|
68
69
|
|
|
69
70
|
export const WithDescription: Story = {
|
|
70
|
-
parameters:
|
|
71
|
+
parameters: {
|
|
72
|
+
...noControls,
|
|
73
|
+
docs: {
|
|
74
|
+
source: {
|
|
75
|
+
code: `
|
|
76
|
+
<template>
|
|
77
|
+
<Modal
|
|
78
|
+
v-model:visible="visible"
|
|
79
|
+
title="Delete Project"
|
|
80
|
+
description="This will permanently remove the project and all its data. This action cannot be undone."
|
|
81
|
+
showCancel
|
|
82
|
+
confirmVariant="destructive"
|
|
83
|
+
confirmText="Delete"
|
|
84
|
+
>
|
|
85
|
+
<p>Are you sure you want to continue?</p>
|
|
86
|
+
</Modal>
|
|
87
|
+
</template>
|
|
88
|
+
`.trim(),
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
71
92
|
render: () => ({
|
|
72
93
|
components: { Modal, Button },
|
|
73
94
|
setup () {
|
|
@@ -93,7 +114,24 @@ export const WithDescription: Story = {
|
|
|
93
114
|
}
|
|
94
115
|
|
|
95
116
|
export const ScrollableContent: Story = {
|
|
96
|
-
parameters:
|
|
117
|
+
parameters: {
|
|
118
|
+
...noControls,
|
|
119
|
+
docs: {
|
|
120
|
+
source: {
|
|
121
|
+
code: `
|
|
122
|
+
<template>
|
|
123
|
+
<Modal v-model:visible="visible" title="Terms of Service" showCancel confirmText="Accept">
|
|
124
|
+
<div class="space-y-4">
|
|
125
|
+
<p v-for="i in 20" :key="i">
|
|
126
|
+
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.
|
|
127
|
+
</p>
|
|
128
|
+
</div>
|
|
129
|
+
</Modal>
|
|
130
|
+
</template>
|
|
131
|
+
`.trim(),
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
97
135
|
render: () => ({
|
|
98
136
|
components: { Modal, Button },
|
|
99
137
|
setup () {
|
|
@@ -116,7 +154,32 @@ export const ScrollableContent: Story = {
|
|
|
116
154
|
}
|
|
117
155
|
|
|
118
156
|
export const Types: Story = {
|
|
119
|
-
parameters:
|
|
157
|
+
parameters: {
|
|
158
|
+
...noControls,
|
|
159
|
+
docs: {
|
|
160
|
+
source: {
|
|
161
|
+
code: `
|
|
162
|
+
<template>
|
|
163
|
+
<Modal v-model:visible="typeInfo" title="Information" type="info" showCancel>
|
|
164
|
+
<p>Your session will expire in 5 minutes.</p>
|
|
165
|
+
</Modal>
|
|
166
|
+
<Modal v-model:visible="typeSuccess" title="Success" type="success">
|
|
167
|
+
<p>Your payment has been processed successfully.</p>
|
|
168
|
+
</Modal>
|
|
169
|
+
<Modal v-model:visible="typeHelp" title="Help" type="help" showCancel>
|
|
170
|
+
<p>Need assistance? Check our documentation or contact support.</p>
|
|
171
|
+
</Modal>
|
|
172
|
+
<Modal v-model:visible="typeWarn" title="Warning" type="warn" showCancel confirmVariant="destructive">
|
|
173
|
+
<p>This operation may affect your existing data.</p>
|
|
174
|
+
</Modal>
|
|
175
|
+
<Modal v-model:visible="typeDanger" title="Delete Account" type="danger" showCancel confirmVariant="destructive" confirmText="Delete">
|
|
176
|
+
<p>All data will be permanently removed. This action cannot be undone.</p>
|
|
177
|
+
</Modal>
|
|
178
|
+
</template>
|
|
179
|
+
`.trim(),
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
},
|
|
120
183
|
render: () => ({
|
|
121
184
|
components: { Modal, Button },
|
|
122
185
|
setup () {
|
|
@@ -156,32 +219,86 @@ export const Types: Story = {
|
|
|
156
219
|
}),
|
|
157
220
|
}
|
|
158
221
|
|
|
159
|
-
export const
|
|
160
|
-
parameters:
|
|
222
|
+
export const WithTrigger: Story = {
|
|
223
|
+
parameters: {
|
|
224
|
+
...noControls,
|
|
225
|
+
docs: {
|
|
226
|
+
source: {
|
|
227
|
+
code: `
|
|
228
|
+
<template>
|
|
229
|
+
<Modal title="Modal with Trigger">
|
|
230
|
+
<template #trigger>
|
|
231
|
+
<Button>Open Modal</Button>
|
|
232
|
+
</template>
|
|
233
|
+
<p>The trigger slot lets the consumer place the open button directly inside the Modal, without managing visible state.</p>
|
|
234
|
+
</Modal>
|
|
235
|
+
</template>
|
|
236
|
+
`.trim(),
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
},
|
|
161
240
|
render: () => ({
|
|
162
241
|
components: { Modal, Button },
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
242
|
+
template: `
|
|
243
|
+
<Modal title="Modal with Trigger">
|
|
244
|
+
<template #trigger>
|
|
245
|
+
<Button>Open Modal</Button>
|
|
246
|
+
</template>
|
|
247
|
+
<p>The trigger slot lets the consumer place the open button directly inside the Modal, without managing visible state.</p>
|
|
248
|
+
</Modal>
|
|
249
|
+
`,
|
|
250
|
+
}),
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export const EventHandling: Story = {
|
|
254
|
+
parameters: {
|
|
255
|
+
...noControls,
|
|
256
|
+
docs: {
|
|
257
|
+
source: {
|
|
258
|
+
code: `
|
|
259
|
+
<template>
|
|
260
|
+
<Modal
|
|
261
|
+
v-model:visible="visible"
|
|
262
|
+
title="Event Demo"
|
|
263
|
+
description="Each emitted event will be appended to the log below."
|
|
264
|
+
showCancel
|
|
265
|
+
confirmText="Confirm"
|
|
266
|
+
@open="onOpen"
|
|
267
|
+
@close="onClose"
|
|
268
|
+
@closed="onClosed"
|
|
269
|
+
@confirm="onConfirm"
|
|
270
|
+
@cancel="onCancel"
|
|
271
|
+
@update:visible="onVisibleUpdate"
|
|
272
|
+
>
|
|
273
|
+
<p>Click Confirm, Cancel, or the close button to see events fire.</p>
|
|
274
|
+
</Modal>
|
|
275
|
+
</template>
|
|
276
|
+
`.trim(),
|
|
277
|
+
},
|
|
166
278
|
},
|
|
279
|
+
},
|
|
280
|
+
render: () => ({
|
|
281
|
+
components: { Modal, Button, EventLog },
|
|
282
|
+
setup: () => ({ visible: ref(false) }),
|
|
167
283
|
template: `
|
|
168
|
-
<
|
|
284
|
+
<EventLog v-slot="{ record }">
|
|
169
285
|
<Button @click="visible = true">Open Modal</Button>
|
|
170
286
|
<Modal
|
|
171
287
|
v-model:visible="visible"
|
|
172
288
|
title="Event Demo"
|
|
173
|
-
description="
|
|
289
|
+
description="Each emitted event will be appended to the log below."
|
|
174
290
|
showCancel
|
|
175
291
|
confirmText="Confirm"
|
|
176
|
-
@open="()
|
|
177
|
-
@close="()
|
|
178
|
-
@closed="()
|
|
179
|
-
@confirm="()
|
|
180
|
-
@cancel="()
|
|
292
|
+
@open="record('open')"
|
|
293
|
+
@close="record('close')"
|
|
294
|
+
@closed="record('closed')"
|
|
295
|
+
@confirm="record('confirm')"
|
|
296
|
+
@cancel="record('cancel')"
|
|
297
|
+
@update:visible="(v) => record('update:visible', v)"
|
|
181
298
|
>
|
|
182
299
|
<p>Click Confirm, Cancel, or the close button to see events fire.</p>
|
|
183
300
|
</Modal>
|
|
184
|
-
</
|
|
301
|
+
</EventLog>
|
|
185
302
|
`,
|
|
186
303
|
}),
|
|
187
304
|
}
|