@citizenplane/pimp 10.0.7 → 10.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 +1305 -1303
- package/dist/pimp.umd.js +22 -22
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/assets/css/base.css +16 -1
- package/src/assets/css/colors.css +111 -110
- package/src/assets/css/dimensions.css +36 -35
- package/src/assets/css/easings.css +2 -1
- package/src/assets/css/shadows.css +67 -65
- package/src/assets/css/tokens.css +355 -386
- package/src/assets/css/typography.css +109 -0
- package/src/assets/main.css +1 -1
- package/src/assets/styles/helpers/_functions.scss +2 -2
- package/src/assets/styles/helpers/_mixins.scss +1 -1
- package/src/assets/styles/utilities/_index.scss +26 -5
- package/src/components/BaseInputLabel.vue +23 -21
- package/src/components/BaseSelectClearButton.vue +15 -9
- package/src/components/CpAirlineLogo.vue +1 -1
- package/src/components/CpAlert.vue +16 -16
- package/src/components/CpBadge.vue +149 -29
- package/src/components/CpButton.vue +135 -110
- package/src/components/CpButtonGroup.vue +3 -3
- package/src/components/CpCalendar.vue +32 -32
- package/src/components/CpCheckbox.vue +43 -33
- package/src/components/CpContextualMenu.vue +6 -9
- package/src/components/CpDate.vue +53 -40
- package/src/components/CpDatepicker.vue +3 -3
- package/src/components/CpDialog.vue +19 -19
- package/src/components/CpHeading.vue +23 -23
- package/src/components/CpInput.vue +71 -52
- package/src/components/CpItemActions.vue +4 -4
- package/src/components/CpLoader.vue +14 -7
- package/src/components/CpMenuItem.vue +23 -17
- package/src/components/CpMultiselect.vue +84 -58
- package/src/components/CpPartnerBadge.vue +13 -13
- package/src/components/CpRadio.vue +32 -24
- package/src/components/CpSelect.vue +43 -30
- package/src/components/CpSelectMenu.vue +39 -39
- package/src/components/CpSwitch.vue +51 -40
- package/src/components/CpTable.vue +241 -90
- package/src/components/CpTableColumnEditor.vue +18 -16
- package/src/components/CpTableEmptyState.vue +9 -9
- package/src/components/CpTabs.vue +17 -36
- package/src/components/CpTelInput.vue +76 -70
- package/src/components/CpTextarea.vue +27 -17
- package/src/components/CpToast.vue +49 -49
- package/src/components/CpTooltip.vue +6 -6
- package/src/components/CpTransitionDialog.vue +1 -1
- package/src/constants/Sizes.ts +5 -0
- package/src/constants/colors/Colors.ts +15 -5
- package/src/constants/colors/ToggleColors.ts +2 -1
- package/src/libs/CoreDatepicker.vue +21 -18
- package/src/stories/CpBadge.stories.ts +25 -17
- package/src/stories/CpButton.stories.ts +6 -5
- package/src/stories/CpCheckbox.stories.ts +4 -4
- package/src/stories/CpContextualMenu.stories.ts +3 -2
- package/src/stories/CpLoader.stories.ts +2 -2
- package/src/stories/CpMenuItem.stories.ts +104 -0
- package/src/stories/CpRadio.stories.ts +29 -2
- package/src/stories/CpSwitch.stories.ts +27 -0
- package/src/stories/CpTable.stories.ts +94 -0
- package/src/assets/css/spacing.css +0 -43
- package/src/assets/styles/helpers/_keyframes.scss +0 -48
- package/src/assets/styles/variables/_sizing.scss +0 -4
|
@@ -14,7 +14,7 @@ const meta = {
|
|
|
14
14
|
},
|
|
15
15
|
color: {
|
|
16
16
|
control: 'select',
|
|
17
|
-
options: ['
|
|
17
|
+
options: ['neutral', 'accent', 'error', 'warning', 'success', 'blue', 'yellow'],
|
|
18
18
|
description: 'The color variant of the loader',
|
|
19
19
|
},
|
|
20
20
|
},
|
|
@@ -25,6 +25,6 @@ type Story = StoryObj<typeof meta>
|
|
|
25
25
|
|
|
26
26
|
export const Default: Story = {
|
|
27
27
|
args: {
|
|
28
|
-
color: Colors.
|
|
28
|
+
color: Colors.NEUTRAL,
|
|
29
29
|
},
|
|
30
30
|
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
|
|
3
|
+
import CpMenuItem from '@/components/CpMenuItem.vue'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'CpMenuItem',
|
|
7
|
+
component: CpMenuItem,
|
|
8
|
+
argTypes: {
|
|
9
|
+
label: {
|
|
10
|
+
control: 'text',
|
|
11
|
+
description: 'Label text for the menu item',
|
|
12
|
+
},
|
|
13
|
+
icon: {
|
|
14
|
+
control: 'text',
|
|
15
|
+
description: 'Icon name',
|
|
16
|
+
},
|
|
17
|
+
isDisabled: {
|
|
18
|
+
control: 'boolean',
|
|
19
|
+
description: 'Whether the menu item is disabled',
|
|
20
|
+
},
|
|
21
|
+
isCritical: {
|
|
22
|
+
control: 'boolean',
|
|
23
|
+
description: 'Whether the menu item is critical',
|
|
24
|
+
},
|
|
25
|
+
isLoading: {
|
|
26
|
+
control: 'boolean',
|
|
27
|
+
description: 'Whether the menu item is loading',
|
|
28
|
+
},
|
|
29
|
+
isAsync: {
|
|
30
|
+
control: 'boolean',
|
|
31
|
+
description: 'Whether the command is async',
|
|
32
|
+
},
|
|
33
|
+
reverseLabel: {
|
|
34
|
+
control: 'boolean',
|
|
35
|
+
description: 'Whether to reverse icon/label order',
|
|
36
|
+
},
|
|
37
|
+
hideLabel: {
|
|
38
|
+
control: 'boolean',
|
|
39
|
+
description: 'Whether to hide the label',
|
|
40
|
+
},
|
|
41
|
+
tooltip: {
|
|
42
|
+
control: 'text',
|
|
43
|
+
description: 'Tooltip text',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
tags: ['autodocs'],
|
|
47
|
+
} satisfies Meta<typeof CpMenuItem>
|
|
48
|
+
|
|
49
|
+
export default meta
|
|
50
|
+
type Story = StoryObj<typeof meta>
|
|
51
|
+
|
|
52
|
+
export const Default: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
label: 'Edit',
|
|
55
|
+
icon: 'edit-3',
|
|
56
|
+
isDisabled: false,
|
|
57
|
+
isCritical: false,
|
|
58
|
+
isLoading: false,
|
|
59
|
+
isAsync: false,
|
|
60
|
+
reverseLabel: false,
|
|
61
|
+
hideLabel: false,
|
|
62
|
+
tooltip: '',
|
|
63
|
+
command: () => alert('Edit clicked'),
|
|
64
|
+
},
|
|
65
|
+
render: (args) => ({
|
|
66
|
+
components: { CpMenuItem },
|
|
67
|
+
setup() {
|
|
68
|
+
return { args }
|
|
69
|
+
},
|
|
70
|
+
template: `
|
|
71
|
+
<div style="width: 260px; border: 1px solid #e5e5e5; border-radius: 8px;">
|
|
72
|
+
<CpMenuItem v-bind="args" />
|
|
73
|
+
</div>
|
|
74
|
+
`,
|
|
75
|
+
}),
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const Critical: Story = {
|
|
79
|
+
args: {
|
|
80
|
+
...Default.args,
|
|
81
|
+
label: 'Delete',
|
|
82
|
+
icon: 'trash-2',
|
|
83
|
+
isCritical: true,
|
|
84
|
+
command: () => alert('Delete clicked'),
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Disabled: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
...Default.args,
|
|
91
|
+
label: 'Archive',
|
|
92
|
+
icon: 'archive',
|
|
93
|
+
isDisabled: true,
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const Loading: Story = {
|
|
98
|
+
args: {
|
|
99
|
+
...Default.args,
|
|
100
|
+
label: 'Download',
|
|
101
|
+
icon: 'download',
|
|
102
|
+
isLoading: true,
|
|
103
|
+
},
|
|
104
|
+
}
|
|
@@ -22,7 +22,7 @@ const meta = {
|
|
|
22
22
|
},
|
|
23
23
|
color: {
|
|
24
24
|
control: 'select',
|
|
25
|
-
options: ['
|
|
25
|
+
options: ['accent', 'blue'],
|
|
26
26
|
description: 'Color variant of the radio',
|
|
27
27
|
},
|
|
28
28
|
autofocus: {
|
|
@@ -46,7 +46,7 @@ export const Default: Story = {
|
|
|
46
46
|
modelValue: 'option1',
|
|
47
47
|
options: sampleOptions,
|
|
48
48
|
groupName: 'radio-group',
|
|
49
|
-
color: '
|
|
49
|
+
color: 'accent',
|
|
50
50
|
autofocus: false,
|
|
51
51
|
},
|
|
52
52
|
render: (args) => ({
|
|
@@ -114,6 +114,33 @@ export const WithDisabledOptions: Story = {
|
|
|
114
114
|
}),
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
export const CheckedDisabled: Story = {
|
|
118
|
+
args: {
|
|
119
|
+
...Default.args,
|
|
120
|
+
options: [
|
|
121
|
+
{ value: 'option1', label: 'Option 1', disabled: true },
|
|
122
|
+
{ value: 'option2', label: 'Option 2' },
|
|
123
|
+
{ value: 'option3', label: 'Option 3' },
|
|
124
|
+
],
|
|
125
|
+
modelValue: 'option1',
|
|
126
|
+
},
|
|
127
|
+
render: (args) => ({
|
|
128
|
+
components: { CpRadio },
|
|
129
|
+
setup() {
|
|
130
|
+
const value = ref(args.modelValue)
|
|
131
|
+
return { args, value }
|
|
132
|
+
},
|
|
133
|
+
template: `
|
|
134
|
+
<div style="min-width: 400px; padding: 20px;">
|
|
135
|
+
<CpRadio
|
|
136
|
+
v-model="value"
|
|
137
|
+
v-bind="args"
|
|
138
|
+
/>
|
|
139
|
+
</div>
|
|
140
|
+
`,
|
|
141
|
+
}),
|
|
142
|
+
}
|
|
143
|
+
|
|
117
144
|
export const ComplexOptions: Story = {
|
|
118
145
|
args: {
|
|
119
146
|
...Default.args,
|
|
@@ -247,3 +247,30 @@ export const SwitchGroup: Story = {
|
|
|
247
247
|
`,
|
|
248
248
|
}),
|
|
249
249
|
}
|
|
250
|
+
|
|
251
|
+
export const Sizes: Story = {
|
|
252
|
+
render: () => ({
|
|
253
|
+
components: { CpSwitch },
|
|
254
|
+
setup() {
|
|
255
|
+
const values = ref({
|
|
256
|
+
sm: false,
|
|
257
|
+
md: true,
|
|
258
|
+
lg: false,
|
|
259
|
+
})
|
|
260
|
+
return { values }
|
|
261
|
+
},
|
|
262
|
+
template: `
|
|
263
|
+
<div style="padding: 20px; display: flex; flex-direction: column; gap: 20px;">
|
|
264
|
+
<div style="transform: scale(0.8); transform-origin: left center;">
|
|
265
|
+
<CpSwitch v-model="values.sm" label="Height 16px" />
|
|
266
|
+
</div>
|
|
267
|
+
<div>
|
|
268
|
+
<CpSwitch v-model="values.md" label="Height 20px" />
|
|
269
|
+
</div>
|
|
270
|
+
<div style="transform: scale(1.2); transform-origin: left center;">
|
|
271
|
+
<CpSwitch v-model="values.lg" label="Height 24px" />
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
274
|
+
`,
|
|
275
|
+
}),
|
|
276
|
+
}
|
|
@@ -272,3 +272,97 @@ export const WithOnlyDefaultAction: Story = {
|
|
|
272
272
|
`,
|
|
273
273
|
}),
|
|
274
274
|
}
|
|
275
|
+
|
|
276
|
+
export const ScrollCue: Story = {
|
|
277
|
+
args: {
|
|
278
|
+
...Default.args,
|
|
279
|
+
columns: ['name', 'age', 'email', 'status', 'company', 'role', 'city', 'country'],
|
|
280
|
+
data: [
|
|
281
|
+
{
|
|
282
|
+
name: 'John Doe',
|
|
283
|
+
age: 30,
|
|
284
|
+
email: 'john@example.com',
|
|
285
|
+
status: 'Active',
|
|
286
|
+
company: 'CitizenPlane',
|
|
287
|
+
role: 'Analyst',
|
|
288
|
+
city: 'Paris',
|
|
289
|
+
country: 'France',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
name: 'Jane Smith',
|
|
293
|
+
age: 25,
|
|
294
|
+
email: 'jane@example.com',
|
|
295
|
+
status: 'Inactive',
|
|
296
|
+
company: 'Kiwi',
|
|
297
|
+
role: 'Manager',
|
|
298
|
+
city: 'Prague',
|
|
299
|
+
country: 'Czechia',
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
name: 'Bob Johnson',
|
|
303
|
+
age: 35,
|
|
304
|
+
email: 'bob@example.com',
|
|
305
|
+
status: 'Active',
|
|
306
|
+
company: 'Atlas',
|
|
307
|
+
role: 'Engineer',
|
|
308
|
+
city: 'Berlin',
|
|
309
|
+
country: 'Germany',
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
},
|
|
313
|
+
render: (args) => ({
|
|
314
|
+
components: { CpTable },
|
|
315
|
+
setup() {
|
|
316
|
+
return { args }
|
|
317
|
+
},
|
|
318
|
+
template: `
|
|
319
|
+
<div style="max-width: 520px; padding: 20px;">
|
|
320
|
+
<CpTable v-bind="args" />
|
|
321
|
+
</div>
|
|
322
|
+
`,
|
|
323
|
+
}),
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export const FullWidthRow: Story = {
|
|
327
|
+
args: {
|
|
328
|
+
...Default.args,
|
|
329
|
+
data: [
|
|
330
|
+
{ name: 'John Doe', age: 30, email: 'john@example.com', status: 'Active' },
|
|
331
|
+
{ fullWidth: 'Full-width row content (e.g. summary or note)' },
|
|
332
|
+
{ name: 'Jane Smith', age: 25, email: 'jane@example.com', status: 'Inactive' },
|
|
333
|
+
],
|
|
334
|
+
},
|
|
335
|
+
render: (args) => ({
|
|
336
|
+
components: { CpTable },
|
|
337
|
+
setup() {
|
|
338
|
+
return { args }
|
|
339
|
+
},
|
|
340
|
+
template: `
|
|
341
|
+
<div style="padding: 20px;">
|
|
342
|
+
<CpTable v-bind="args" />
|
|
343
|
+
</div>
|
|
344
|
+
`,
|
|
345
|
+
}),
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export const SelectedRow: Story = {
|
|
349
|
+
args: {
|
|
350
|
+
...Default.args,
|
|
351
|
+
data: [
|
|
352
|
+
{ name: 'John Doe', age: 30, email: 'john@example.com', status: 'Active' },
|
|
353
|
+
{ name: 'Jane Smith', age: 25, email: 'jane@example.com', status: 'Inactive', isSelected: true },
|
|
354
|
+
{ name: 'Bob Johnson', age: 35, email: 'bob@example.com', status: 'Active' },
|
|
355
|
+
],
|
|
356
|
+
},
|
|
357
|
+
render: (args) => ({
|
|
358
|
+
components: { CpTable },
|
|
359
|
+
setup() {
|
|
360
|
+
return { args }
|
|
361
|
+
},
|
|
362
|
+
template: `
|
|
363
|
+
<div style="padding: 20px;">
|
|
364
|
+
<CpTable v-bind="args" />
|
|
365
|
+
</div>
|
|
366
|
+
`,
|
|
367
|
+
}),
|
|
368
|
+
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--pimp-letter-spacing-xs: 0;
|
|
3
|
-
--pimp-letter-spacing-sm: 0;
|
|
4
|
-
--pimp-letter-spacing-md: 0;
|
|
5
|
-
--pimp-letter-spacing-lg: 0;
|
|
6
|
-
--pimp-letter-spacing-xl: 0;
|
|
7
|
-
--pimp-letter-spacing-2xl: 0;
|
|
8
|
-
--pimp-letter-spacing-3xl: 0;
|
|
9
|
-
--pimp-letter-spacing-4xl: 0;
|
|
10
|
-
--pimp-letter-spacing-5xl: 0;
|
|
11
|
-
--pimp-letter-spacing-6xl: 0;
|
|
12
|
-
--pimp-letter-spacing-7xl: 0;
|
|
13
|
-
--pimp-letter-spacing-8xl: 0;
|
|
14
|
-
--pimp-letter-spacing-9xl: 0;
|
|
15
|
-
|
|
16
|
-
--pimp-line-height-xs: 16;
|
|
17
|
-
--pimp-line-height-sm: 20;
|
|
18
|
-
--pimp-line-height-md: 24;
|
|
19
|
-
--pimp-line-height-lg: 28;
|
|
20
|
-
--pimp-line-height-xl: 30;
|
|
21
|
-
--pimp-line-height-2xl: 32;
|
|
22
|
-
--pimp-line-height-3xl: 36;
|
|
23
|
-
--pimp-line-height-4xl: 40;
|
|
24
|
-
--pimp-line-height-5xl: 56;
|
|
25
|
-
--pimp-line-height-6xl: 72;
|
|
26
|
-
--pimp-line-height-7xl: 80;
|
|
27
|
-
--pimp-line-height-8xl: 96;
|
|
28
|
-
--pimp-line-height-9xl: 128;
|
|
29
|
-
|
|
30
|
-
--pimp-size-xs: 12;
|
|
31
|
-
--pimp-size-sm: 14;
|
|
32
|
-
--pimp-size-md: 16;
|
|
33
|
-
--pimp-size-lg: 18;
|
|
34
|
-
--pimp-size-xl: 20;
|
|
35
|
-
--pimp-size-2xl: 24;
|
|
36
|
-
--pimp-size-3xl: 30;
|
|
37
|
-
--pimp-size-4xl: 36;
|
|
38
|
-
--pimp-size-5xl: 48;
|
|
39
|
-
--pimp-size-6xl: 60;
|
|
40
|
-
--pimp-size-7xl: 72;
|
|
41
|
-
--pimp-size-8xl: 96;
|
|
42
|
-
--pimp-size-9xl: 128;
|
|
43
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
@use '../variables/easings' as easings;
|
|
2
|
-
|
|
3
|
-
// Fade in
|
|
4
|
-
.fade-in-enter-active,
|
|
5
|
-
.fade-in-leave-active {
|
|
6
|
-
transition: all 150ms ease-in-out;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.fade-in-enter-from,
|
|
10
|
-
.fade-in-leave-to {
|
|
11
|
-
opacity: 0;
|
|
12
|
-
transform: scale(0.9);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.scale-elastic-enter-active,
|
|
16
|
-
.scale-elastic-leave-active {
|
|
17
|
-
transition:
|
|
18
|
-
opacity 300ms easings.$easing-elastic,
|
|
19
|
-
transform 200ms easings.$easing-elastic;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.scale-elastic-enter-from,
|
|
23
|
-
.scale-elastic-leave-to {
|
|
24
|
-
transform: scale(0.9);
|
|
25
|
-
opacity: 0;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// Components
|
|
29
|
-
// cp-select-menu
|
|
30
|
-
@keyframes cp-select-menu-dropdown-enter {
|
|
31
|
-
0% {
|
|
32
|
-
transform: scale(0);
|
|
33
|
-
opacity: 0;
|
|
34
|
-
}
|
|
35
|
-
100% {
|
|
36
|
-
transform: scale(1);
|
|
37
|
-
opacity: 1;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@keyframes cp-select-menu-dropdown-leave {
|
|
42
|
-
0% {
|
|
43
|
-
opacity: 1;
|
|
44
|
-
}
|
|
45
|
-
100% {
|
|
46
|
-
opacity: 0;
|
|
47
|
-
}
|
|
48
|
-
}
|