@citizenplane/pimp 9.4.2 → 9.4.4
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 +772 -771
- package/dist/pimp.umd.js +16 -16
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/assets/styles/utilities/_index.scss +1 -1
- package/src/components/CpInput.vue +1 -1
- package/src/components/CpSelect.vue +76 -58
- package/src/constants/Sizes.ts +1 -0
- package/src/stories/CpSelect.stories.ts +49 -5
|
@@ -2,8 +2,11 @@ import { ref } from 'vue'
|
|
|
2
2
|
|
|
3
3
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
4
4
|
|
|
5
|
+
import CpInput from '@/components/CpInput.vue'
|
|
5
6
|
import CpSelect from '@/components/CpSelect.vue'
|
|
6
7
|
|
|
8
|
+
import { Sizes } from '@/constants'
|
|
9
|
+
|
|
7
10
|
const meta = {
|
|
8
11
|
title: 'CpSelect',
|
|
9
12
|
component: CpSelect,
|
|
@@ -44,9 +47,10 @@ const meta = {
|
|
|
44
47
|
control: 'text',
|
|
45
48
|
description: 'Error message to display',
|
|
46
49
|
},
|
|
47
|
-
|
|
48
|
-
control: '
|
|
49
|
-
|
|
50
|
+
size: {
|
|
51
|
+
control: 'select',
|
|
52
|
+
options: ['sm', 'md', 'lg'],
|
|
53
|
+
description: 'The size of the select',
|
|
50
54
|
},
|
|
51
55
|
autocomplete: {
|
|
52
56
|
control: 'text',
|
|
@@ -56,6 +60,14 @@ const meta = {
|
|
|
56
60
|
control: 'text',
|
|
57
61
|
description: 'Name attribute for the select',
|
|
58
62
|
},
|
|
63
|
+
help: {
|
|
64
|
+
control: 'text',
|
|
65
|
+
description: 'Help text to display',
|
|
66
|
+
},
|
|
67
|
+
tooltip: {
|
|
68
|
+
control: 'text',
|
|
69
|
+
description: 'Tooltip text to display',
|
|
70
|
+
},
|
|
59
71
|
},
|
|
60
72
|
} satisfies Meta<typeof CpSelect>
|
|
61
73
|
|
|
@@ -79,7 +91,7 @@ export const Default: Story = {
|
|
|
79
91
|
disabled: false,
|
|
80
92
|
isInvalid: false,
|
|
81
93
|
errorMessage: '',
|
|
82
|
-
|
|
94
|
+
size: Sizes.MD,
|
|
83
95
|
autocomplete: 'on',
|
|
84
96
|
name: 'select-field',
|
|
85
97
|
},
|
|
@@ -122,10 +134,17 @@ export const Disabled: Story = {
|
|
|
122
134
|
},
|
|
123
135
|
}
|
|
124
136
|
|
|
137
|
+
export const Small: Story = {
|
|
138
|
+
args: {
|
|
139
|
+
...Default.args,
|
|
140
|
+
size: Sizes.SM,
|
|
141
|
+
},
|
|
142
|
+
}
|
|
143
|
+
|
|
125
144
|
export const Large: Story = {
|
|
126
145
|
args: {
|
|
127
146
|
...Default.args,
|
|
128
|
-
|
|
147
|
+
size: Sizes.LG,
|
|
129
148
|
},
|
|
130
149
|
}
|
|
131
150
|
|
|
@@ -147,3 +166,28 @@ export const WithLongOptions: Story = {
|
|
|
147
166
|
],
|
|
148
167
|
},
|
|
149
168
|
}
|
|
169
|
+
|
|
170
|
+
export const NextToInput: Story = {
|
|
171
|
+
args: {
|
|
172
|
+
...Default.args,
|
|
173
|
+
hideDefaultValue: true,
|
|
174
|
+
},
|
|
175
|
+
render: (args) => ({
|
|
176
|
+
components: { CpSelect, CpInput },
|
|
177
|
+
setup() {
|
|
178
|
+
const value = ref('')
|
|
179
|
+
const textValue = ref('')
|
|
180
|
+
|
|
181
|
+
return { args, value, textValue }
|
|
182
|
+
},
|
|
183
|
+
template: `
|
|
184
|
+
<div style="display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 400px; padding: 20px;">
|
|
185
|
+
<CpSelect
|
|
186
|
+
v-model="value"
|
|
187
|
+
v-bind="args"
|
|
188
|
+
/>
|
|
189
|
+
<CpInput :size="args.size" label="Input Label" name="input-field" placeholder="Enter text here" v-model="textValue" />
|
|
190
|
+
</div>
|
|
191
|
+
`,
|
|
192
|
+
}),
|
|
193
|
+
}
|