@citizenplane/pimp 13.0.0 → 14.0.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 +4804 -4585
- package/dist/pimp.umd.js +44 -44
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CpAccordion.vue +163 -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 +5 -4
- package/src/components/CpInput.vue +4 -4
- package/src/components/CpItemActions.vue +11 -9
- package/src/components/CpMultiselect.vue +3 -3
- package/src/components/CpPartnerBadge.vue +3 -2
- package/src/components/CpSelect.vue +5 -5
- package/src/components/CpTable.vue +2 -2
- package/src/components/CpTelInput.vue +4 -4
- package/src/components/CpTextarea.vue +3 -3
- package/src/components/CpTransitionCounter.vue +77 -0
- package/src/components/CpTransitionListItems.vue +41 -0
- package/src/components/CpTransitionSize.vue +88 -0
- package/src/components/CpTransitionSlide.vue +44 -0
- package/src/components/CpTransitionTabContent.vue +70 -0
- package/src/components/index.ts +16 -2
- package/src/constants/Sizes.ts +1 -11
- package/src/constants/index.ts +1 -1
- package/src/stories/BaseInputLabel.stories.ts +1 -1
- package/src/stories/CpAccordion.stories.ts +282 -0
- package/src/stories/CpAccordionGroup.stories.ts +223 -0
- package/src/stories/CpAirlineLogo.stories.ts +1 -1
- package/src/stories/CpAlert.stories.ts +1 -1
- package/src/stories/CpBadge.stories.ts +2 -4
- package/src/stories/CpButton.stories.ts +147 -146
- package/src/stories/CpCheckbox.stories.ts +1 -1
- package/src/stories/CpContextualMenu.stories.ts +1 -1
- package/src/stories/CpDate.stories.ts +1 -1
- package/src/stories/CpDatepicker.stories.ts +1 -1
- package/src/stories/CpDialog.stories.ts +1 -1
- package/src/stories/CpHeading.stories.ts +1 -1
- package/src/stories/CpIcon.stories.ts +1 -1
- package/src/stories/CpInput.stories.ts +2 -4
- package/src/stories/CpItemActions.stories.ts +1 -1
- package/src/stories/CpLoader.stories.ts +1 -1
- package/src/stories/CpMenuItem.stories.ts +1 -1
- package/src/stories/CpMultiselect.stories.ts +1 -1
- package/src/stories/CpPartnerBadge.stories.ts +3 -3
- package/src/stories/CpRadio.stories.ts +1 -1
- package/src/stories/CpSelect.stories.ts +4 -6
- package/src/stories/CpSelectMenu.stories.ts +1 -1
- package/src/stories/CpSelectableButton.stories.ts +4 -6
- package/src/stories/CpSwitch.stories.ts +1 -1
- package/src/stories/CpTable.stories.ts +1 -1
- package/src/stories/CpTableEmptyState.stories.ts +1 -1
- package/src/stories/CpTabs.stories.ts +1 -1
- package/src/stories/CpTelInput.stories.ts +1 -1
- package/src/stories/CpTextarea.stories.ts +1 -1
- package/src/stories/CpToast.stories.ts +1 -1
- package/src/stories/CpTooltip.stories.ts +1 -1
- package/src/stories/CpTransitionCounter.stories.ts +66 -0
- package/src/stories/{TransitionExpand.stories.ts → CpTransitionExpand.stories.ts} +11 -11
- package/src/stories/CpTransitionListItems.stories.ts +147 -0
- package/src/stories/CpTransitionSize.stories.ts +147 -0
- package/src/stories/CpTransitionSlide.stories.ts +65 -0
- package/src/stories/CpTransitionTabContent.stories.ts +78 -0
- package/src/stories/documentationStyles.ts +16 -0
- /package/src/components/{TransitionExpand.vue → CpTransitionExpand.vue} +0 -0
|
@@ -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: 'Navigation/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,10 +2,8 @@ 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
|
-
title: 'CpBadge',
|
|
6
|
+
title: 'Visual/CpBadge',
|
|
9
7
|
component: CpBadge,
|
|
10
8
|
argTypes: {
|
|
11
9
|
color: {
|
|
@@ -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,
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
2
|
|
|
3
3
|
import { ButtonAppearances } from '@/constants/Button'
|
|
4
|
-
import { Sizes } from '@/constants/Sizes'
|
|
5
4
|
|
|
6
5
|
import CpButton from '@/components/CpButton.vue'
|
|
7
6
|
import CpIcon from '@/components/CpIcon.vue'
|
|
8
7
|
|
|
8
|
+
import {
|
|
9
|
+
docCellStyle,
|
|
10
|
+
docLabelStyle,
|
|
11
|
+
docPageStyle,
|
|
12
|
+
docRowWrapStyle,
|
|
13
|
+
docSectionStyle,
|
|
14
|
+
docTitleStyle,
|
|
15
|
+
} from '@/stories/documentationStyles'
|
|
16
|
+
|
|
9
17
|
const meta = {
|
|
10
|
-
title: 'CpButton',
|
|
18
|
+
title: 'Form/CpButton',
|
|
11
19
|
component: CpButton,
|
|
12
20
|
argTypes: {
|
|
13
21
|
appearance: {
|
|
@@ -63,14 +71,6 @@ const defaultRender = (args: (typeof CpButton)['props']) => ({
|
|
|
63
71
|
template: defaultTemplate,
|
|
64
72
|
})
|
|
65
73
|
|
|
66
|
-
const docSectionStyle =
|
|
67
|
-
'background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);'
|
|
68
|
-
const docTitleStyle =
|
|
69
|
-
'margin: 0 0 16px 0; font-size: 12px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em;'
|
|
70
|
-
const docRowStyle = 'display: flex; flex-wrap: wrap; gap: 24px 32px; align-items: flex-end;'
|
|
71
|
-
const docCellStyle = 'display: flex; flex-direction: column; gap: 8px; align-items: flex-start;'
|
|
72
|
-
const docLabelStyle = 'font-size: 12px; color: #6b7280;'
|
|
73
|
-
|
|
74
74
|
export const Documentation: Story = {
|
|
75
75
|
args: {},
|
|
76
76
|
render: () => ({
|
|
@@ -78,143 +78,144 @@ export const Documentation: Story = {
|
|
|
78
78
|
setup: () => ({}),
|
|
79
79
|
template: `
|
|
80
80
|
<div>
|
|
81
|
-
<div style="
|
|
82
|
-
<h1 style="margin: 0 0 32px 0; font-size: 28px; font-weight: 700; color: #111;">
|
|
81
|
+
<div style="${docPageStyle}">
|
|
82
|
+
<h1 style="margin: 0 0 32px 0; font-size: 28px; font-weight: 700; color: #111;">CpButton</h1>
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
84
|
+
<section style="${docSectionStyle}">
|
|
85
|
+
<h2 style="${docTitleStyle}">Size</h2>
|
|
86
|
+
<div style="${docRowWrapStyle}">
|
|
87
|
+
<div style="${docCellStyle}">
|
|
88
|
+
<span style="${docLabelStyle}">2xs</span>
|
|
89
|
+
<CpButton color="accent" size="2xs">Default button</CpButton>
|
|
90
|
+
</div>
|
|
91
|
+
<div style="${docCellStyle}">
|
|
92
|
+
<span style="${docLabelStyle}">xs</span>
|
|
93
|
+
<CpButton color="accent" size="xs">Default button</CpButton>
|
|
94
|
+
</div>
|
|
95
|
+
<div style="${docCellStyle}">
|
|
96
|
+
<span style="${docLabelStyle}">sm</span>
|
|
97
|
+
<CpButton color="accent" size="sm">Default button</CpButton>
|
|
98
|
+
</div>
|
|
99
|
+
<div style="${docCellStyle}">
|
|
100
|
+
<span style="${docLabelStyle}">md</span>
|
|
101
|
+
<CpButton color="accent" size="md">Default button</CpButton>
|
|
102
|
+
</div>
|
|
103
|
+
<div style="${docCellStyle}">
|
|
104
|
+
<span style="${docLabelStyle}">lg</span>
|
|
105
|
+
<CpButton color="accent" size="lg">Default button</CpButton>
|
|
106
|
+
</div>
|
|
106
107
|
</div>
|
|
107
|
-
</
|
|
108
|
-
</section>
|
|
108
|
+
</section>
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
110
|
+
<section style="${docSectionStyle}">
|
|
111
|
+
<h2 style="${docTitleStyle}">Color</h2>
|
|
112
|
+
<div style="${docRowWrapStyle}">
|
|
113
|
+
<div style="${docCellStyle}">
|
|
114
|
+
<span style="${docLabelStyle}">neutral</span>
|
|
115
|
+
<CpButton color="neutral">Default button</CpButton>
|
|
116
|
+
</div>
|
|
117
|
+
<div style="${docCellStyle}">
|
|
118
|
+
<span style="${docLabelStyle}">accent</span>
|
|
119
|
+
<CpButton color="accent">Default button</CpButton>
|
|
120
|
+
</div>
|
|
121
|
+
<div style="${docCellStyle}">
|
|
122
|
+
<span style="${docLabelStyle}">error</span>
|
|
123
|
+
<CpButton color="error">Default button</CpButton>
|
|
124
|
+
</div>
|
|
125
|
+
<div style="${docCellStyle}">
|
|
126
|
+
<span style="${docLabelStyle}">warning</span>
|
|
127
|
+
<CpButton color="warning">Default button</CpButton>
|
|
128
|
+
</div>
|
|
129
|
+
<div style="${docCellStyle}">
|
|
130
|
+
<span style="${docLabelStyle}">success</span>
|
|
131
|
+
<CpButton color="success">Default button</CpButton>
|
|
132
|
+
</div>
|
|
132
133
|
</div>
|
|
133
|
-
</
|
|
134
|
-
</section>
|
|
134
|
+
</section>
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
136
|
+
<section style="${docSectionStyle}">
|
|
137
|
+
<h2 style="${docTitleStyle}">State</h2>
|
|
138
|
+
<div style="${docRowWrapStyle}">
|
|
139
|
+
<div style="${docCellStyle}">
|
|
140
|
+
<span style="${docLabelStyle}">default</span>
|
|
141
|
+
<CpButton color="accent">Default button</CpButton>
|
|
142
|
+
</div>
|
|
143
|
+
<div style="${docCellStyle}">
|
|
144
|
+
<span style="${docLabelStyle}">disabled</span>
|
|
145
|
+
<CpButton color="accent" :disabled="true">Default button</CpButton>
|
|
146
|
+
</div>
|
|
146
147
|
</div>
|
|
147
|
-
</
|
|
148
|
-
</section>
|
|
148
|
+
</section>
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
150
|
+
<section style="${docSectionStyle}">
|
|
151
|
+
<h2 style="${docTitleStyle}">Squared</h2>
|
|
152
|
+
<div style="${docRowWrapStyle}">
|
|
153
|
+
<div style="${docCellStyle}">
|
|
154
|
+
<span style="${docLabelStyle}">false</span>
|
|
155
|
+
<CpButton color="accent" :is-square="false">Default button</CpButton>
|
|
156
|
+
</div>
|
|
157
|
+
<div style="${docCellStyle}">
|
|
158
|
+
<span style="${docLabelStyle}">true</span>
|
|
159
|
+
<CpButton color="accent" :is-square="true">Default button</CpButton>
|
|
160
|
+
</div>
|
|
160
161
|
</div>
|
|
161
|
-
</
|
|
162
|
-
</section>
|
|
162
|
+
</section>
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
164
|
+
<section style="${docSectionStyle}">
|
|
165
|
+
<h2 style="${docTitleStyle}">Style</h2>
|
|
166
|
+
<div style="${docRowWrapStyle}">
|
|
167
|
+
<div style="${docCellStyle}">
|
|
168
|
+
<span style="${docLabelStyle}">primary</span>
|
|
169
|
+
<CpButton color="accent">Default button</CpButton>
|
|
170
|
+
</div>
|
|
171
|
+
<div style="${docCellStyle}">
|
|
172
|
+
<span style="${docLabelStyle}">secondary</span>
|
|
173
|
+
<CpButton appearance="secondary" color="accent">Default button</CpButton>
|
|
174
|
+
</div>
|
|
175
|
+
<div style="${docCellStyle}">
|
|
176
|
+
<span style="${docLabelStyle}">tertiary</span>
|
|
177
|
+
<CpButton appearance="tertiary" color="accent">Default button</CpButton>
|
|
178
|
+
</div>
|
|
178
179
|
</div>
|
|
179
|
-
</
|
|
180
|
-
</section>
|
|
180
|
+
</section>
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
182
|
+
<section style="${docSectionStyle}">
|
|
183
|
+
<h2 style="${docTitleStyle}">Icon</h2>
|
|
184
|
+
<div style="${docRowWrapStyle}">
|
|
185
|
+
<div style="${docCellStyle}">
|
|
186
|
+
<span style="${docLabelStyle}">—</span>
|
|
187
|
+
<CpButton color="accent">Default button</CpButton>
|
|
188
|
+
</div>
|
|
189
|
+
<div style="${docCellStyle}">
|
|
190
|
+
<span style="${docLabelStyle}">leading</span>
|
|
191
|
+
<CpButton color="accent">
|
|
192
|
+
<template #leading-icon><CpIcon type="plus" /></template>
|
|
193
|
+
Default button
|
|
194
|
+
</CpButton>
|
|
195
|
+
</div>
|
|
196
|
+
<div style="${docCellStyle}">
|
|
197
|
+
<span style="${docLabelStyle}">leading + trailing</span>
|
|
198
|
+
<CpButton color="accent">
|
|
199
|
+
<template #leading-icon><CpIcon type="plus" /></template>
|
|
200
|
+
Default button
|
|
201
|
+
<template #trailing-icon><CpIcon type="plus" /></template>
|
|
202
|
+
</CpButton>
|
|
203
|
+
</div>
|
|
204
|
+
<div style="${docCellStyle}">
|
|
205
|
+
<span style="${docLabelStyle}">trailing</span>
|
|
206
|
+
<CpButton color="accent">
|
|
207
|
+
Default button
|
|
208
|
+
<template #trailing-icon><CpIcon type="plus" /></template>
|
|
209
|
+
</CpButton>
|
|
210
|
+
</div>
|
|
210
211
|
</div>
|
|
211
|
-
</
|
|
212
|
-
</section>
|
|
212
|
+
</section>
|
|
213
213
|
</div>
|
|
214
214
|
</div>
|
|
215
215
|
`,
|
|
216
216
|
}),
|
|
217
217
|
parameters: {
|
|
218
|
+
controls: { disable: true },
|
|
218
219
|
docs: {
|
|
219
220
|
source: {
|
|
220
221
|
code: null,
|
|
@@ -339,11 +340,11 @@ export const Secondary = createAppearanceVariantsStory('secondary')
|
|
|
339
340
|
export const Tertiary = createAppearanceVariantsStory('tertiary')
|
|
340
341
|
|
|
341
342
|
const withIconsSizes = [
|
|
342
|
-
{ value:
|
|
343
|
-
{ value:
|
|
344
|
-
{ value:
|
|
345
|
-
{ value:
|
|
346
|
-
{ value:
|
|
343
|
+
{ value: '2xs', label: '2xs' },
|
|
344
|
+
{ value: 'xs', label: 'xs' },
|
|
345
|
+
{ value: 'sm', label: 'sm' },
|
|
346
|
+
{ value: 'md', label: 'md' },
|
|
347
|
+
{ value: 'lg', label: 'lg' },
|
|
347
348
|
] as const
|
|
348
349
|
|
|
349
350
|
export const WithIcons: Story = {
|
|
@@ -411,11 +412,11 @@ export const Loading: Story = {
|
|
|
411
412
|
}
|
|
412
413
|
|
|
413
414
|
const iconOnlySizes = [
|
|
414
|
-
{ value:
|
|
415
|
-
{ value:
|
|
416
|
-
{ value:
|
|
417
|
-
{ value:
|
|
418
|
-
{ value:
|
|
415
|
+
{ value: '2xs', label: '2xs' },
|
|
416
|
+
{ value: 'xs', label: 'xs' },
|
|
417
|
+
{ value: 'sm', label: 'sm' },
|
|
418
|
+
{ value: 'md', label: 'md' },
|
|
419
|
+
{ value: 'lg', label: 'lg' },
|
|
419
420
|
] as const
|
|
420
421
|
|
|
421
422
|
/** Icon-only appearances (inverse excluded for this story). */
|
|
@@ -441,17 +442,17 @@ export const IconOnly: Story = {
|
|
|
441
442
|
semanticButtonColors,
|
|
442
443
|
docSectionStyle,
|
|
443
444
|
docTitleStyle,
|
|
444
|
-
|
|
445
|
+
docRowWrapStyle,
|
|
445
446
|
docCellStyle,
|
|
446
447
|
docLabelStyle,
|
|
447
448
|
}),
|
|
448
449
|
template: `
|
|
449
|
-
<div style="
|
|
450
|
+
<div style="${docPageStyle}">
|
|
450
451
|
<h1 style="margin: 0 0 32px 0; font-size: 28px; font-weight: 700; color: #111;">Icon Button</h1>
|
|
451
452
|
|
|
452
453
|
<section style="${docSectionStyle}">
|
|
453
454
|
<h2 style="${docTitleStyle}">Size</h2>
|
|
454
|
-
<div style="${
|
|
455
|
+
<div style="${docRowWrapStyle}">
|
|
455
456
|
<div
|
|
456
457
|
v-for="s in iconOnlySizes"
|
|
457
458
|
:key="s.value"
|
|
@@ -467,7 +468,7 @@ export const IconOnly: Story = {
|
|
|
467
468
|
|
|
468
469
|
<section style="${docSectionStyle}">
|
|
469
470
|
<h2 style="${docTitleStyle}">Color</h2>
|
|
470
|
-
<div style="${
|
|
471
|
+
<div style="${docRowWrapStyle}">
|
|
471
472
|
<div
|
|
472
473
|
v-for="c in semanticButtonColors"
|
|
473
474
|
:key="c.value"
|
|
@@ -483,7 +484,7 @@ export const IconOnly: Story = {
|
|
|
483
484
|
|
|
484
485
|
<section style="${docSectionStyle}">
|
|
485
486
|
<h2 style="${docTitleStyle}">Squared</h2>
|
|
486
|
-
<div style="${
|
|
487
|
+
<div style="${docRowWrapStyle}">
|
|
487
488
|
<div style="${docCellStyle}">
|
|
488
489
|
<span style="${docLabelStyle}">false</span>
|
|
489
490
|
<CpButton v-bind="args" :is-square="false">
|
|
@@ -501,7 +502,7 @@ export const IconOnly: Story = {
|
|
|
501
502
|
|
|
502
503
|
<section style="${docSectionStyle}">
|
|
503
504
|
<h2 style="${docTitleStyle}">Style</h2>
|
|
504
|
-
<div style="${
|
|
505
|
+
<div style="${docRowWrapStyle}">
|
|
505
506
|
<div
|
|
506
507
|
v-for="a in iconOnlyAppearances"
|
|
507
508
|
:key="a.value"
|