@citizenplane/pimp 13.0.0 → 13.1.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/dist/pimp.es.js +4554 -4458
- package/dist/pimp.umd.js +44 -44
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CpAccordion.vue +174 -0
- package/src/components/CpAccordionGroup.vue +51 -0
- package/src/components/CpBadge.vue +2 -2
- package/src/components/CpButton.vue +4 -3
- package/src/components/CpButtonGroup.vue +30 -2
- package/src/components/CpDate.vue +3 -2
- package/src/components/CpInput.vue +2 -2
- package/src/components/CpItemActions.vue +11 -9
- package/src/components/CpPartnerBadge.vue +3 -2
- package/src/components/CpSelect.vue +2 -2
- package/src/components/CpTable.vue +2 -2
- package/src/components/CpTelInput.vue +2 -2
- package/src/components/index.ts +4 -0
- package/src/constants/Sizes.ts +1 -11
- package/src/constants/index.ts +1 -1
- package/src/stories/CpAccordion.stories.ts +282 -0
- package/src/stories/CpAccordionGroup.stories.ts +223 -0
- package/src/stories/CpBadge.stories.ts +1 -3
- package/src/stories/CpButton.stories.ts +146 -145
- package/src/stories/CpInput.stories.ts +1 -3
- package/src/stories/CpPartnerBadge.stories.ts +2 -2
- package/src/stories/CpSelect.stories.ts +3 -5
- package/src/stories/CpSelectableButton.stories.ts +3 -5
- package/src/stories/documentationStyles.ts +16 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { computed } from 'vue'
|
|
2
|
+
|
|
3
|
+
import type { Args, Meta, StoryObj } from '@storybook/vue3'
|
|
4
|
+
import type { MenuItem } from 'primevue/menuitem'
|
|
5
|
+
|
|
6
|
+
import type { CpAccordionBaseProps } from '@/components/CpAccordion.vue'
|
|
7
|
+
import CpAccordion from '@/components/CpAccordion.vue'
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
docCellStyle,
|
|
11
|
+
docLabelStyle,
|
|
12
|
+
docPageStyle,
|
|
13
|
+
docRowColumnStyle,
|
|
14
|
+
docSectionStyle,
|
|
15
|
+
docTitleStyle,
|
|
16
|
+
} from '@/stories/documentationStyles'
|
|
17
|
+
|
|
18
|
+
/** Storybook controls: component props remain a discriminated union in `CpAccordion.vue`. */
|
|
19
|
+
type CpAccordionStoryArgs = CpAccordionBaseProps & {
|
|
20
|
+
actions?: MenuItem[]
|
|
21
|
+
hideActionTrigger?: boolean
|
|
22
|
+
iconPosition?: 'leading' | 'trailing'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const defaultStoryActions: MenuItem[] = [
|
|
26
|
+
{
|
|
27
|
+
icon: 'copy',
|
|
28
|
+
label: 'Duplicate',
|
|
29
|
+
command: () => {},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
icon: 'trash-2',
|
|
33
|
+
label: 'Delete',
|
|
34
|
+
command: () => {},
|
|
35
|
+
isCritical: true,
|
|
36
|
+
},
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
const meta = {
|
|
40
|
+
title: 'CpAccordion',
|
|
41
|
+
component: CpAccordion,
|
|
42
|
+
argTypes: {
|
|
43
|
+
title: {
|
|
44
|
+
control: 'text',
|
|
45
|
+
description: 'Accordion header title',
|
|
46
|
+
},
|
|
47
|
+
defaultOpenState: {
|
|
48
|
+
control: 'boolean',
|
|
49
|
+
description: 'Initial open state when the accordion is rendered',
|
|
50
|
+
},
|
|
51
|
+
hideActionTrigger: {
|
|
52
|
+
control: 'boolean',
|
|
53
|
+
description: 'Whether to hide the action trigger',
|
|
54
|
+
},
|
|
55
|
+
iconPosition: {
|
|
56
|
+
control: 'select',
|
|
57
|
+
options: ['leading', 'trailing'],
|
|
58
|
+
description: 'Chevron icon position',
|
|
59
|
+
},
|
|
60
|
+
quickOptionsLimit: {
|
|
61
|
+
control: 'number',
|
|
62
|
+
description: 'Number of quick options to display',
|
|
63
|
+
},
|
|
64
|
+
actions: {
|
|
65
|
+
control: 'object',
|
|
66
|
+
description:
|
|
67
|
+
'MenuItem[] (leading only). Editing as JSON drops `command` functions; use Reset to restore working actions.',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
} as Meta<CpAccordionStoryArgs>
|
|
71
|
+
|
|
72
|
+
export default meta
|
|
73
|
+
type Story = StoryObj<typeof meta>
|
|
74
|
+
|
|
75
|
+
const sampleContentStyle =
|
|
76
|
+
'padding: 16px; font-size: 13px; color: #374151; background: repeating-linear-gradient(45deg, #fff9c4, #fff9c4 4px, #fffde7 4px, #fffde7 8px);'
|
|
77
|
+
const highlightedSlotStyle = 'background: #fff9c4;'
|
|
78
|
+
|
|
79
|
+
const defaultRender = (args: Args) => ({
|
|
80
|
+
components: { CpAccordion },
|
|
81
|
+
setup() {
|
|
82
|
+
const accordionArgs = computed(() => {
|
|
83
|
+
if (args.iconPosition === 'trailing') {
|
|
84
|
+
const a = args as CpAccordionStoryArgs & Args
|
|
85
|
+
return {
|
|
86
|
+
defaultOpenState: a.defaultOpenState,
|
|
87
|
+
iconPosition: 'trailing' as const,
|
|
88
|
+
quickOptionsLimit: a.quickOptionsLimit,
|
|
89
|
+
title: a.title,
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return args
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
return { accordionArgs, sampleContentStyle }
|
|
97
|
+
},
|
|
98
|
+
template: `
|
|
99
|
+
<div style="box-sizing: border-box; width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px; width: 500px;">
|
|
100
|
+
<CpAccordion v-bind="accordionArgs">
|
|
101
|
+
<div :style="sampleContentStyle" />
|
|
102
|
+
</CpAccordion>
|
|
103
|
+
</div>
|
|
104
|
+
`,
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
export const Documentation: Story = {
|
|
108
|
+
args: {
|
|
109
|
+
title: 'I have title.',
|
|
110
|
+
},
|
|
111
|
+
render: () => ({
|
|
112
|
+
components: { CpAccordion },
|
|
113
|
+
setup: () => ({
|
|
114
|
+
docPageStyle,
|
|
115
|
+
docSectionStyle,
|
|
116
|
+
docTitleStyle,
|
|
117
|
+
docRowColumnStyle,
|
|
118
|
+
docCellStyle,
|
|
119
|
+
docLabelStyle,
|
|
120
|
+
sampleContentStyle,
|
|
121
|
+
highlightedSlotStyle,
|
|
122
|
+
actions: defaultStoryActions,
|
|
123
|
+
}),
|
|
124
|
+
template: `
|
|
125
|
+
<div :style="docPageStyle">
|
|
126
|
+
<h1 style="margin: 0 0 24px 0; font-size: 28px; font-weight: 700; color: #111827;">CpAccordion</h1>
|
|
127
|
+
|
|
128
|
+
<section :style="docSectionStyle">
|
|
129
|
+
<h2 :style="docTitleStyle">Is Open</h2>
|
|
130
|
+
<div :style="docRowColumnStyle">
|
|
131
|
+
<div :style="docCellStyle">
|
|
132
|
+
<span :style="docLabelStyle">false</span>
|
|
133
|
+
<CpAccordion title="I have title." :default-open-state="false" icon-position="trailing">
|
|
134
|
+
<div :style="sampleContentStyle" />
|
|
135
|
+
</CpAccordion>
|
|
136
|
+
</div>
|
|
137
|
+
<div :style="docCellStyle">
|
|
138
|
+
<span :style="docLabelStyle">true</span>
|
|
139
|
+
<CpAccordion title="I have title." :default-open-state="true" icon-position="trailing">
|
|
140
|
+
<div :style="sampleContentStyle" />
|
|
141
|
+
</CpAccordion>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</section>
|
|
145
|
+
|
|
146
|
+
<h2 style="margin: 0 0 16px 0; font-size: 16px; font-weight: 600; color: #111827;">
|
|
147
|
+
Unpublished Base: <span style="font-weight: 700;">Accordion Header</span>
|
|
148
|
+
</h2>
|
|
149
|
+
|
|
150
|
+
<section :style="docSectionStyle">
|
|
151
|
+
<h2 :style="docTitleStyle">Style</h2>
|
|
152
|
+
<div :style="docRowColumnStyle">
|
|
153
|
+
<div :style="docCellStyle">
|
|
154
|
+
<span :style="docLabelStyle">Leading Chevron</span>
|
|
155
|
+
<CpAccordion title="DIDA TRAVEL" :default-open-state="false" icon-position="leading">
|
|
156
|
+
<div :style="sampleContentStyle" />
|
|
157
|
+
</CpAccordion>
|
|
158
|
+
</div>
|
|
159
|
+
<div :style="docCellStyle">
|
|
160
|
+
<span :style="docLabelStyle">Trailing Chevron</span>
|
|
161
|
+
<CpAccordion title="DIDA TRAVEL" :default-open-state="false" icon-position="trailing">
|
|
162
|
+
<div :style="sampleContentStyle" />
|
|
163
|
+
</CpAccordion>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</section>
|
|
167
|
+
|
|
168
|
+
<section :style="docSectionStyle">
|
|
169
|
+
<h2 :style="docTitleStyle">Actions</h2>
|
|
170
|
+
<div :style="docRowColumnStyle">
|
|
171
|
+
<div :style="docCellStyle">
|
|
172
|
+
<span :style="docLabelStyle">Default</span>
|
|
173
|
+
<CpAccordion title="DIDA TRAVEL" :default-open-state="false" icon-position="leading" :actions="actions" :quick-options-limit="3">
|
|
174
|
+
<template #trailing-slot>
|
|
175
|
+
This is a trailing slot
|
|
176
|
+
</template>
|
|
177
|
+
<div :style="sampleContentStyle" />
|
|
178
|
+
</CpAccordion>
|
|
179
|
+
</div>
|
|
180
|
+
<div :style="docCellStyle">
|
|
181
|
+
<span :style="docLabelStyle">Hover</span>
|
|
182
|
+
<CpAccordion
|
|
183
|
+
title="DIDA TRAVEL"
|
|
184
|
+
:default-open-state="false"
|
|
185
|
+
icon-position="leading"
|
|
186
|
+
style="background: var(--cp-background-primary-hover);"
|
|
187
|
+
:actions="actions"
|
|
188
|
+
:quick-options-limit="3"
|
|
189
|
+
>
|
|
190
|
+
<template #trailing-slot>
|
|
191
|
+
This is a trailing slot
|
|
192
|
+
</template>
|
|
193
|
+
<div :style="sampleContentStyle" />
|
|
194
|
+
</CpAccordion>
|
|
195
|
+
</div>
|
|
196
|
+
<div :style="docCellStyle">
|
|
197
|
+
<span :style="docLabelStyle">Hide Action Trigger</span>
|
|
198
|
+
<CpAccordion
|
|
199
|
+
title="DIDA TRAVEL"
|
|
200
|
+
:default-open-state="false"
|
|
201
|
+
icon-position="leading"
|
|
202
|
+
style="background: var(--cp-background-primary-hover);"
|
|
203
|
+
:actions="actions"
|
|
204
|
+
:quick-options-limit="3"
|
|
205
|
+
hide-action-trigger
|
|
206
|
+
>
|
|
207
|
+
<template #trailing-slot>
|
|
208
|
+
This is a trailing slot
|
|
209
|
+
</template>
|
|
210
|
+
<div :style="sampleContentStyle" />
|
|
211
|
+
</CpAccordion>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
</section>
|
|
215
|
+
|
|
216
|
+
<section :style="docSectionStyle">
|
|
217
|
+
<h2 :style="docTitleStyle">Has Leading Slot</h2>
|
|
218
|
+
<div :style="docRowColumnStyle">
|
|
219
|
+
<div :style="docCellStyle">
|
|
220
|
+
<CpAccordion title="DIDA TRAVEL" :default-open-state="false" icon-position="leading" :actions="actions" :quick-options-limit="3">
|
|
221
|
+
<template #leading-slot>
|
|
222
|
+
<span :style="highlightedSlotStyle">I have text.</span>
|
|
223
|
+
</template>
|
|
224
|
+
<div :style="sampleContentStyle" />
|
|
225
|
+
</CpAccordion>
|
|
226
|
+
</div>
|
|
227
|
+
<div :style="docCellStyle">
|
|
228
|
+
<CpAccordion title="DIDA TRAVEL" :default-open-state="false" icon-position="trailing">
|
|
229
|
+
<template #leading-slot>
|
|
230
|
+
<span :style="highlightedSlotStyle">I have text.</span>
|
|
231
|
+
</template>
|
|
232
|
+
<div :style="sampleContentStyle" />
|
|
233
|
+
</CpAccordion>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
</section>
|
|
237
|
+
|
|
238
|
+
<section :style="docSectionStyle">
|
|
239
|
+
<h2 :style="docTitleStyle">Has Trailing Slot</h2>
|
|
240
|
+
<div :style="docRowColumnStyle">
|
|
241
|
+
<div :style="docCellStyle">
|
|
242
|
+
<CpAccordion title="DIDA TRAVEL" :default-open-state="false" icon-position="leading">
|
|
243
|
+
<template #trailing-slot>
|
|
244
|
+
<span :style="highlightedSlotStyle">I have text.</span>
|
|
245
|
+
</template>
|
|
246
|
+
<div :style="sampleContentStyle" />
|
|
247
|
+
</CpAccordion>
|
|
248
|
+
</div>
|
|
249
|
+
<div :style="docCellStyle">
|
|
250
|
+
<CpAccordion title="DIDA TRAVEL" :default-open-state="false" icon-position="trailing">
|
|
251
|
+
<template #trailing-slot>
|
|
252
|
+
<span :style="highlightedSlotStyle">I have text.</span>
|
|
253
|
+
</template>
|
|
254
|
+
<div :style="sampleContentStyle" />
|
|
255
|
+
</CpAccordion>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
</section>
|
|
259
|
+
</div>
|
|
260
|
+
`,
|
|
261
|
+
}),
|
|
262
|
+
parameters: {
|
|
263
|
+
controls: { disable: true },
|
|
264
|
+
docs: {
|
|
265
|
+
source: {
|
|
266
|
+
code: null,
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export const Default: Story = {
|
|
273
|
+
args: {
|
|
274
|
+
title: 'I have title.',
|
|
275
|
+
defaultOpenState: true,
|
|
276
|
+
iconPosition: 'leading',
|
|
277
|
+
quickOptionsLimit: 2,
|
|
278
|
+
hideActionTrigger: false,
|
|
279
|
+
actions: defaultStoryActions,
|
|
280
|
+
},
|
|
281
|
+
render: defaultRender,
|
|
282
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { computed } from 'vue'
|
|
2
|
+
|
|
3
|
+
import type { Args, Meta, StoryObj } from '@storybook/vue3'
|
|
4
|
+
import type { MenuItem } from 'primevue/menuitem'
|
|
5
|
+
|
|
6
|
+
import CpAccordion from '@/components/CpAccordion.vue'
|
|
7
|
+
import CpAccordionGroup from '@/components/CpAccordionGroup.vue'
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
docCellStyle,
|
|
11
|
+
docLabelStyle,
|
|
12
|
+
docPageStyle,
|
|
13
|
+
docRowColumnStyle,
|
|
14
|
+
docSectionStyle,
|
|
15
|
+
docTitleStyle,
|
|
16
|
+
} from '@/stories/documentationStyles'
|
|
17
|
+
|
|
18
|
+
const sampleContentStyle =
|
|
19
|
+
'padding: 16px; font-size: 13px; color: #374151; background: repeating-linear-gradient(45deg, #fff9c4, #fff9c4 4px, #fffde7 4px, #fffde7 8px);'
|
|
20
|
+
|
|
21
|
+
type CpAccordionGroupStoryArgs = {
|
|
22
|
+
itemActions: MenuItem[]
|
|
23
|
+
itemDefaultOpenState: boolean
|
|
24
|
+
itemHideActionTrigger: boolean
|
|
25
|
+
itemIconPosition: 'leading' | 'trailing'
|
|
26
|
+
itemQuickOptionsLimit: number
|
|
27
|
+
itemTitle: string
|
|
28
|
+
variant: 'default' | 'minimal' | 'primary'
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const defaultItemActions: MenuItem[] = [
|
|
32
|
+
{
|
|
33
|
+
icon: 'copy',
|
|
34
|
+
label: 'Duplicate',
|
|
35
|
+
command: () => {},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
icon: 'trash-2',
|
|
39
|
+
label: 'Delete',
|
|
40
|
+
command: () => {},
|
|
41
|
+
isCritical: true,
|
|
42
|
+
},
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
const meta = {
|
|
46
|
+
title: 'CpAccordionGroup',
|
|
47
|
+
component: CpAccordionGroup,
|
|
48
|
+
argTypes: {
|
|
49
|
+
variant: {
|
|
50
|
+
control: 'select',
|
|
51
|
+
options: ['minimal', 'default', 'primary'],
|
|
52
|
+
description: 'Visual style variant for the accordion group container',
|
|
53
|
+
table: { category: 'CpAccordionGroup' },
|
|
54
|
+
},
|
|
55
|
+
itemTitle: {
|
|
56
|
+
control: 'text',
|
|
57
|
+
description: 'Title prefix for each item (suffix 1, 2, 3)',
|
|
58
|
+
table: { category: 'CpAccordion (items)' },
|
|
59
|
+
},
|
|
60
|
+
itemDefaultOpenState: {
|
|
61
|
+
control: 'boolean',
|
|
62
|
+
description: 'Initial open state for each accordion',
|
|
63
|
+
table: { category: 'CpAccordion (items)' },
|
|
64
|
+
},
|
|
65
|
+
itemIconPosition: {
|
|
66
|
+
control: 'select',
|
|
67
|
+
options: ['leading', 'trailing'],
|
|
68
|
+
description: 'Chevron position on each accordion',
|
|
69
|
+
table: { category: 'CpAccordion (items)' },
|
|
70
|
+
},
|
|
71
|
+
itemQuickOptionsLimit: {
|
|
72
|
+
control: 'number',
|
|
73
|
+
description: 'Quick options limit (leading + actions)',
|
|
74
|
+
table: { category: 'CpAccordion (items)' },
|
|
75
|
+
},
|
|
76
|
+
itemHideActionTrigger: {
|
|
77
|
+
control: 'boolean',
|
|
78
|
+
description: 'Hide action trigger when leading + actions',
|
|
79
|
+
table: { category: 'CpAccordion (items)' },
|
|
80
|
+
},
|
|
81
|
+
itemActions: {
|
|
82
|
+
control: 'object',
|
|
83
|
+
description: 'MenuItem[] for each item (leading only). JSON edit drops `command`; use Reset to restore.',
|
|
84
|
+
table: { category: 'CpAccordion (items)' },
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
} as Meta<CpAccordionGroupStoryArgs>
|
|
88
|
+
|
|
89
|
+
export default meta
|
|
90
|
+
type Story = StoryObj<typeof meta>
|
|
91
|
+
|
|
92
|
+
const defaultRender = (args: Args) => ({
|
|
93
|
+
components: { CpAccordion, CpAccordionGroup },
|
|
94
|
+
setup() {
|
|
95
|
+
const accordionBind = computed(() => {
|
|
96
|
+
if (args.itemIconPosition === 'trailing') {
|
|
97
|
+
return {
|
|
98
|
+
defaultOpenState: args.itemDefaultOpenState,
|
|
99
|
+
iconPosition: args.itemIconPosition,
|
|
100
|
+
quickOptionsLimit: args.itemQuickOptionsLimit,
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
actions: args.itemActions,
|
|
106
|
+
defaultOpenState: args.itemDefaultOpenState,
|
|
107
|
+
hideActionTrigger: args.itemHideActionTrigger,
|
|
108
|
+
iconPosition: args.itemIconPosition,
|
|
109
|
+
quickOptionsLimit: args.itemQuickOptionsLimit,
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
return { accordionBind, args, sampleContentStyle }
|
|
114
|
+
},
|
|
115
|
+
template: `
|
|
116
|
+
<div style="box-sizing: border-box; width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px; width: 500px;">
|
|
117
|
+
<CpAccordionGroup :variant="args.variant">
|
|
118
|
+
<CpAccordion
|
|
119
|
+
v-for="i in 3"
|
|
120
|
+
:key="'default-' + i"
|
|
121
|
+
v-bind="accordionBind"
|
|
122
|
+
:title="args.itemTitle + ' ' + i"
|
|
123
|
+
>
|
|
124
|
+
<div :style="sampleContentStyle" />
|
|
125
|
+
</CpAccordion>
|
|
126
|
+
</CpAccordionGroup>
|
|
127
|
+
</div>
|
|
128
|
+
`,
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
export const Documentation: Story = {
|
|
132
|
+
args: {
|
|
133
|
+
variant: 'default',
|
|
134
|
+
},
|
|
135
|
+
render: () => ({
|
|
136
|
+
components: { CpAccordion, CpAccordionGroup },
|
|
137
|
+
setup: () => ({
|
|
138
|
+
docPageStyle,
|
|
139
|
+
docSectionStyle,
|
|
140
|
+
docTitleStyle,
|
|
141
|
+
docRowColumnStyle,
|
|
142
|
+
docCellStyle,
|
|
143
|
+
docLabelStyle,
|
|
144
|
+
sampleContentStyle,
|
|
145
|
+
}),
|
|
146
|
+
template: `
|
|
147
|
+
<div :style="docPageStyle">
|
|
148
|
+
<h1 style="margin: 0 0 24px 0; font-size: 28px; font-weight: 700; color: #111827;">CpAccordionGroup</h1>
|
|
149
|
+
|
|
150
|
+
<section :style="docSectionStyle">
|
|
151
|
+
<h2 :style="docTitleStyle">Style</h2>
|
|
152
|
+
<div :style="docRowColumnStyle">
|
|
153
|
+
<div :style="docCellStyle">
|
|
154
|
+
<span :style="docLabelStyle">Minimal</span>
|
|
155
|
+
<CpAccordionGroup variant="minimal">
|
|
156
|
+
<CpAccordion key="doc-default-1" title="DIDA TRAVEL" icon-position="leading">
|
|
157
|
+
<div :style="sampleContentStyle" />
|
|
158
|
+
</CpAccordion>
|
|
159
|
+
<CpAccordion key="doc-default-2" title="DIDA TRAVEL" icon-position="leading">
|
|
160
|
+
<div :style="sampleContentStyle" />
|
|
161
|
+
</CpAccordion>
|
|
162
|
+
<CpAccordion key="doc-default-3" title="DIDA TRAVEL" icon-position="leading">
|
|
163
|
+
<div :style="sampleContentStyle" />
|
|
164
|
+
</CpAccordion>
|
|
165
|
+
</CpAccordionGroup>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<div :style="docCellStyle">
|
|
169
|
+
<span :style="docLabelStyle">Default</span>
|
|
170
|
+
<CpAccordionGroup variant="default">
|
|
171
|
+
<CpAccordion key="doc-bb-1" title="DIDA TRAVEL" icon-position="leading">
|
|
172
|
+
<div :style="sampleContentStyle" />
|
|
173
|
+
</CpAccordion>
|
|
174
|
+
<CpAccordion key="doc-bb-2" title="DIDA TRAVEL" icon-position="leading">
|
|
175
|
+
<div :style="sampleContentStyle" />
|
|
176
|
+
</CpAccordion>
|
|
177
|
+
<CpAccordion key="doc-bb-3" title="DIDA TRAVEL" icon-position="leading">
|
|
178
|
+
<div :style="sampleContentStyle" />
|
|
179
|
+
</CpAccordion>
|
|
180
|
+
</CpAccordionGroup>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div :style="docCellStyle">
|
|
184
|
+
<span :style="docLabelStyle">Primary</span>
|
|
185
|
+
<CpAccordionGroup variant="primary">
|
|
186
|
+
<CpAccordion key="doc-gb-1" title="DIDA TRAVEL" icon-position="leading">
|
|
187
|
+
<div :style="sampleContentStyle" />
|
|
188
|
+
</CpAccordion>
|
|
189
|
+
<CpAccordion key="doc-gb-2" title="DIDA TRAVEL" icon-position="leading">
|
|
190
|
+
<div :style="sampleContentStyle" />
|
|
191
|
+
</CpAccordion>
|
|
192
|
+
<CpAccordion key="doc-gb-3" title="DIDA TRAVEL" icon-position="leading">
|
|
193
|
+
<div :style="sampleContentStyle" />
|
|
194
|
+
</CpAccordion>
|
|
195
|
+
</CpAccordionGroup>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</section>
|
|
199
|
+
</div>
|
|
200
|
+
`,
|
|
201
|
+
}),
|
|
202
|
+
parameters: {
|
|
203
|
+
controls: { disable: true },
|
|
204
|
+
docs: {
|
|
205
|
+
source: {
|
|
206
|
+
code: null,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export const Default: Story = {
|
|
213
|
+
args: {
|
|
214
|
+
variant: 'default',
|
|
215
|
+
itemTitle: 'DIDA TRAVEL',
|
|
216
|
+
itemDefaultOpenState: false,
|
|
217
|
+
itemIconPosition: 'leading',
|
|
218
|
+
itemQuickOptionsLimit: 2,
|
|
219
|
+
itemHideActionTrigger: false,
|
|
220
|
+
itemActions: defaultItemActions,
|
|
221
|
+
},
|
|
222
|
+
render: defaultRender,
|
|
223
|
+
}
|
|
@@ -2,8 +2,6 @@ import type { Args, Meta, StoryObj } from '@storybook/vue3'
|
|
|
2
2
|
|
|
3
3
|
import CpBadge from '@/components/CpBadge.vue'
|
|
4
4
|
|
|
5
|
-
import { Sizes } from '@/constants'
|
|
6
|
-
|
|
7
5
|
const meta = {
|
|
8
6
|
title: 'CpBadge',
|
|
9
7
|
component: CpBadge,
|
|
@@ -63,7 +61,7 @@ const defaultRender = (args: Args) => ({
|
|
|
63
61
|
export const Default: Story = {
|
|
64
62
|
args: {
|
|
65
63
|
color: 'neutral',
|
|
66
|
-
size:
|
|
64
|
+
size: 'md',
|
|
67
65
|
isStroked: false,
|
|
68
66
|
isSquare: false,
|
|
69
67
|
isClearable: false,
|