@citizenplane/pimp 8.33.0 → 9.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 +1585 -1559
- package/dist/pimp.umd.js +18 -18
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/assets/styles/variables/_colors.scss +1 -0
- package/src/assets/styles/variables/_sizing.scss +1 -1
- package/src/components/CpButton.vue +4 -4
- package/src/components/CpDate.vue +3 -2
- package/src/components/CpInput.vue +4 -4
- package/src/components/CpMultiselect.vue +1 -0
- package/src/components/CpSwitch.vue +49 -52
- package/src/stories/CpButton.stories.ts +2 -2
- package/src/stories/CpSwitch.stories.ts +55 -13
|
@@ -101,11 +101,11 @@ export const WithIcons: Story = {
|
|
|
101
101
|
setup: () => ({ args }),
|
|
102
102
|
template: `
|
|
103
103
|
<CpButton v-bind="args">
|
|
104
|
-
<template #icon
|
|
104
|
+
<template #leading-icon>
|
|
105
105
|
<CpIcon type="arrow-left" />
|
|
106
106
|
</template>
|
|
107
107
|
Button with Icon
|
|
108
|
-
<template #icon
|
|
108
|
+
<template #trailing-icon>
|
|
109
109
|
<CpIcon type="arrow-right" />
|
|
110
110
|
</template>
|
|
111
111
|
</CpButton>
|
|
@@ -8,13 +8,14 @@ const meta = {
|
|
|
8
8
|
title: 'CpSwitch',
|
|
9
9
|
component: CpSwitch,
|
|
10
10
|
argTypes: {
|
|
11
|
-
|
|
11
|
+
autofocus: {
|
|
12
12
|
control: 'boolean',
|
|
13
|
-
description: '
|
|
13
|
+
description: 'Whether to autofocus the switch',
|
|
14
14
|
},
|
|
15
|
-
|
|
16
|
-
control: '
|
|
17
|
-
|
|
15
|
+
color: {
|
|
16
|
+
control: 'select',
|
|
17
|
+
options: ['blue', 'purple'],
|
|
18
|
+
description: 'Color variant of the switch',
|
|
18
19
|
},
|
|
19
20
|
disabled: {
|
|
20
21
|
control: 'boolean',
|
|
@@ -24,18 +25,29 @@ const meta = {
|
|
|
24
25
|
control: 'text',
|
|
25
26
|
description: 'Name attribute for the switch',
|
|
26
27
|
},
|
|
27
|
-
|
|
28
|
-
control: '
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
helper: {
|
|
29
|
+
control: 'text',
|
|
30
|
+
description: 'Helper text to display below the label',
|
|
31
|
+
},
|
|
32
|
+
isRequired: {
|
|
33
|
+
control: 'boolean',
|
|
34
|
+
description: 'Whether the switch is required',
|
|
35
|
+
},
|
|
36
|
+
label: {
|
|
37
|
+
control: 'text',
|
|
38
|
+
description: 'Label text for the switch',
|
|
39
|
+
},
|
|
40
|
+
modelValue: {
|
|
41
|
+
control: 'boolean',
|
|
42
|
+
description: 'The switch state',
|
|
31
43
|
},
|
|
32
44
|
reverseLabel: {
|
|
33
45
|
control: 'boolean',
|
|
34
46
|
description: 'Whether to show label before the switch',
|
|
35
47
|
},
|
|
36
|
-
|
|
37
|
-
control: '
|
|
38
|
-
description: '
|
|
48
|
+
tooltip: {
|
|
49
|
+
control: 'text',
|
|
50
|
+
description: 'Tooltip text to display',
|
|
39
51
|
},
|
|
40
52
|
},
|
|
41
53
|
} satisfies Meta<typeof CpSwitch>
|
|
@@ -45,11 +57,14 @@ type Story = StoryObj<typeof meta>
|
|
|
45
57
|
|
|
46
58
|
export const Default: Story = {
|
|
47
59
|
args: {
|
|
48
|
-
label: '
|
|
60
|
+
label: 'Label',
|
|
61
|
+
helper: 'This is a helper text that provides additional information',
|
|
49
62
|
disabled: false,
|
|
50
63
|
color: 'purple',
|
|
51
64
|
reverseLabel: false,
|
|
52
65
|
autofocus: false,
|
|
66
|
+
isRequired: true,
|
|
67
|
+
tooltip: 'This is a tooltip text',
|
|
53
68
|
},
|
|
54
69
|
render: (args) => ({
|
|
55
70
|
components: { CpSwitch },
|
|
@@ -83,6 +98,13 @@ export const DisabledChecked: Story = {
|
|
|
83
98
|
},
|
|
84
99
|
}
|
|
85
100
|
|
|
101
|
+
export const Required: Story = {
|
|
102
|
+
args: {
|
|
103
|
+
...Default.args,
|
|
104
|
+
isRequired: true,
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
|
|
86
108
|
export const Reversed: Story = {
|
|
87
109
|
args: {
|
|
88
110
|
...Default.args,
|
|
@@ -105,6 +127,20 @@ export const Reversed: Story = {
|
|
|
105
127
|
}),
|
|
106
128
|
}
|
|
107
129
|
|
|
130
|
+
export const WithHelper: Story = {
|
|
131
|
+
args: {
|
|
132
|
+
...Default.args,
|
|
133
|
+
helper: 'This is a helper text that provides additional information',
|
|
134
|
+
},
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export const WithTooltip: Story = {
|
|
138
|
+
args: {
|
|
139
|
+
...Default.args,
|
|
140
|
+
tooltip: 'This is a tooltip text',
|
|
141
|
+
},
|
|
142
|
+
}
|
|
143
|
+
|
|
108
144
|
export const SwitchGroup: Story = {
|
|
109
145
|
render: () => ({
|
|
110
146
|
components: { CpSwitch },
|
|
@@ -132,6 +168,12 @@ export const SwitchGroup: Story = {
|
|
|
132
168
|
v-model="switches.switch3"
|
|
133
169
|
label="Third Switch"
|
|
134
170
|
group-name="switch-group"
|
|
171
|
+
disabled
|
|
172
|
+
/>
|
|
173
|
+
<CpSwitch
|
|
174
|
+
v-model="switches.switch4"
|
|
175
|
+
label="Fourth Switch"
|
|
176
|
+
group-name="switch-group"
|
|
135
177
|
/>
|
|
136
178
|
</div>
|
|
137
179
|
`,
|