@ouestfrance/sipa-bms-ui 8.22.1 → 8.22.3

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.
Files changed (50) hide show
  1. package/dist/components/button/BmsButton.vue.d.ts +1 -1
  2. package/dist/components/button/BmsIconButton.vue.d.ts +1 -1
  3. package/dist/components/button/UiButton.vue.d.ts +1 -1
  4. package/dist/components/layout/BmsHeaderTitle.vue.d.ts +1 -1
  5. package/dist/components/navigation/BmsBreadcrumb.vue.d.ts +1 -1
  6. package/dist/components/navigation/BmsShortLinkMenu.vue.d.ts +2 -2
  7. package/dist/components/table/BmsPagination.vue.d.ts +2 -2
  8. package/dist/plugins/router-history/router-history.composable.d.ts +1 -1
  9. package/dist/sipa-bms-ui.css +16 -16
  10. package/dist/sipa-bms-ui.es.js +3608 -3142
  11. package/dist/sipa-bms-ui.es.js.map +1 -1
  12. package/dist/sipa-bms-ui.umd.js +3608 -3142
  13. package/dist/sipa-bms-ui.umd.js.map +1 -1
  14. package/package.json +18 -18
  15. package/src/components/button/BmsButton.stories.js +142 -3
  16. package/src/components/form/BmsChip.stories.js +104 -2
  17. package/src/components/form/BmsInputCheckboxCaptionGroup.stories.js +157 -2
  18. package/src/components/form/BmsInputCheckboxGroup.stories.js +119 -2
  19. package/src/components/form/BmsInputCode.stories.js +109 -2
  20. package/src/components/form/BmsInputFile.stories.js +110 -2
  21. package/src/components/form/BmsInputRadioCaptionGroup.stories.js +138 -2
  22. package/src/components/form/BmsInputRadioGroup.stories.js +120 -2
  23. package/src/components/form/BmsInputText.stories.js +269 -1
  24. package/src/components/form/BmsMultiSelect.vue +3 -1
  25. package/src/components/form/BmsSearch.stories.js +89 -2
  26. package/src/components/form/BmsSelect.stories.js +220 -2
  27. package/src/components/form/BmsSelect.vue +5 -3
  28. package/src/components/form/BmsTag.stories.js +119 -3
  29. package/src/components/form/BmsTextArea.stories.js +146 -2
  30. package/src/components/form/RawAutocomplete.vue +3 -1
  31. package/src/components/layout/BmsForm.stories.js +216 -0
  32. package/src/components/layout/BmsHeaderTitle.stories.js +136 -1
  33. package/src/components/table/BmsTable.stories.js +247 -1
  34. package/src/documentation/button/secondaryButton.mdx +114 -3
  35. package/src/documentation/checkboxCaptionGroup.mdx +99 -0
  36. package/src/documentation/checkboxGroup.mdx +99 -0
  37. package/src/documentation/chip.mdx +85 -11
  38. package/src/documentation/inputCode.mdx +97 -0
  39. package/src/documentation/inputFile.mdx +90 -13
  40. package/src/documentation/inputText.mdx +183 -0
  41. package/src/documentation/layout/form.mdx +74 -0
  42. package/src/documentation/layout/headerTitle.mdx +124 -0
  43. package/src/documentation/layout/table.mdx +111 -0
  44. package/src/documentation/radioCaptionGroup.mdx +86 -19
  45. package/src/documentation/radioGroup.mdx +85 -18
  46. package/src/documentation/search.mdx +85 -13
  47. package/src/documentation/select.mdx +137 -16
  48. package/src/documentation/tag.mdx +91 -11
  49. package/src/documentation/textArea.mdx +126 -13
  50. package/src/documentation/fields_text.mdx +0 -31
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouestfrance/sipa-bms-ui",
3
- "version": "8.22.1",
3
+ "version": "8.22.3",
4
4
  "author": "Ouest-France BMS",
5
5
  "license": "ISC",
6
6
  "scripts": {
@@ -33,15 +33,15 @@
33
33
  "@chromatic-com/storybook": "^4.1.3",
34
34
  "@codemirror/lang-html": "6.4.11",
35
35
  "@codemirror/lang-json": "6.0.2",
36
- "@commitlint/cli": "20.1.0",
37
- "@commitlint/config-conventional": "20.0.0",
36
+ "@commitlint/cli": "20.2.0",
37
+ "@commitlint/config-conventional": "20.2.0",
38
38
  "@mdx-js/react": "3.1.1",
39
- "@storybook/addon-docs": "10.1.6",
40
- "@storybook/addon-links": "10.1.6",
41
- "@storybook/vue3-vite": "10.1.6",
39
+ "@storybook/addon-docs": "10.1.10",
40
+ "@storybook/addon-links": "10.1.10",
41
+ "@storybook/vue3-vite": "10.1.10",
42
42
  "@types/lodash": "4.17.21",
43
43
  "@types/uuid": "11.0.0",
44
- "@vitejs/plugin-vue": "6.0.2",
44
+ "@vitejs/plugin-vue": "6.0.3",
45
45
  "@vue/test-utils": "2.4.6",
46
46
  "@vueuse/core": "13.9.0",
47
47
  "@vueuse/motion": "^3.0.0",
@@ -52,25 +52,25 @@
52
52
  "cors": "^2.8.5",
53
53
  "cross-env": "^10.0.0",
54
54
  "cy2": "^4.0.0",
55
- "cypress": "15.7.0",
55
+ "cypress": "15.8.1",
56
56
  "express": "^5.0.0",
57
57
  "husky": "9.1.7",
58
- "jsdom": "27.2.0",
58
+ "jsdom": "27.3.0",
59
59
  "keycloak-js": "26.1.2",
60
60
  "lint-staged": "16.2.7",
61
61
  "lodash": "4.17.21",
62
- "lucide-vue-next": "0.554.0",
62
+ "lucide-vue-next": "0.562.0",
63
63
  "msw": "^2.12.4",
64
64
  "msw-storybook-addon": "^2.0.3",
65
65
  "normalize.css": "8.0.1",
66
66
  "path": "0.12.7",
67
- "prettier": "3.6.2",
67
+ "prettier": "3.7.4",
68
68
  "remark-gfm": "^4.0.1",
69
- "sass": "1.94.2",
69
+ "sass": "1.97.1",
70
70
  "semantic-release": "25.0.2",
71
71
  "start-server-and-test": "2.1.3",
72
- "storybook": "10.1.6",
73
- "storybook-addon-pseudo-states": "10.1.6",
72
+ "storybook": "10.1.10",
73
+ "storybook-addon-pseudo-states": "10.1.10",
74
74
  "storybook-addon-tag-badges": "^3.0.2",
75
75
  "storybook-vue3-router": "^7.0.0",
76
76
  "typescript": "5.2.2",
@@ -78,14 +78,14 @@
78
78
  "vite": "^7.1.12",
79
79
  "vite-plugin-dts": "^4.1.0",
80
80
  "vite-plugin-mkcert": "1.17.9",
81
- "vite-plugin-pages": "0.33.1",
81
+ "vite-plugin-pages": "0.33.2",
82
82
  "vite-svg-loader": "5.1.0",
83
83
  "vitest": "3.2.4",
84
- "vue": "3.5.24",
84
+ "vue": "3.5.26",
85
85
  "vue-codemirror": "6.1.1",
86
86
  "vue-loader": "17.4.2",
87
- "vue-router": "4.6.3",
88
- "vue-tsc": "3.1.5"
87
+ "vue-router": "4.6.4",
88
+ "vue-tsc": "3.2.0"
89
89
  },
90
90
  "files": [
91
91
  "dist",
@@ -17,6 +17,9 @@ export default {
17
17
  chromatic: { disable: true },
18
18
  },
19
19
  argTypes: {
20
+ defaultSlot: {
21
+ description: 'Slot VueJS',
22
+ },
20
23
  type: {
21
24
  control: { type: 'select' },
22
25
  options: ['primary', 'secondary', 'tertiary'],
@@ -41,13 +44,22 @@ const Template = (args) => ({
41
44
  },
42
45
  template: `
43
46
  <BmsButton v-bind="args">
44
- Save
47
+ {{args.defaultSlot ?? 'Save'}}
45
48
  </BmsButton>
46
49
  `,
47
50
  });
48
51
 
49
52
  export const Playground = Template.bind({});
50
- Playground.args = {};
53
+ Playground.parameters = { chromatic: { disable: false } };
54
+ Playground.args = {
55
+ type: 'primary',
56
+ };
57
+
58
+ export const PlaygroundSecondary = Template.bind({});
59
+ PlaygroundSecondary.args = {
60
+ type: 'secondary',
61
+ defaultSlot: 'Cancel',
62
+ };
51
63
 
52
64
  // Stories for documentation examples (Do/Don't)
53
65
  export const DoSimple = Template.bind({});
@@ -124,9 +136,9 @@ export const DoOnePrimary = () => ({
124
136
  components: { BmsButton },
125
137
  template: `
126
138
  <div style="display: flex; gap: 8px;">
127
- <BmsButton type="primary">Save</BmsButton>
128
139
  <BmsButton type="secondary">Cancel</BmsButton>
129
140
  <BmsButton type="secondary">Delete</BmsButton>
141
+ <BmsButton type="primary">Save</BmsButton>
130
142
  </div>
131
143
  `,
132
144
  });
@@ -194,3 +206,130 @@ export const DoPrimaryForSave = () => ({
194
206
  </div>
195
207
  `,
196
208
  });
209
+
210
+ // Secondary button stories for documentation
211
+ export const DoSimpleSecondary = Template.bind({});
212
+ DoSimpleSecondary.args = {
213
+ type: 'secondary',
214
+ defaultSlot: 'Cancel',
215
+ };
216
+
217
+ export const DoDangerSecondary = Template.bind({});
218
+ DoDangerSecondary.args = {
219
+ type: 'secondary',
220
+ mode: 'danger',
221
+ };
222
+
223
+ export const DoSmallSecondary = Template.bind({});
224
+ DoSmallSecondary.args = {
225
+ type: 'secondary',
226
+ small: true,
227
+ };
228
+
229
+ // Do: Secondary button with icon at start
230
+ export const DoIconStartSecondary = () => ({
231
+ components: { BmsButton, ArrowLeft },
232
+ template: `
233
+ <BmsButton type="secondary">
234
+ <template #start><ArrowLeft /></template>
235
+ Back
236
+ </BmsButton>
237
+ `,
238
+ });
239
+
240
+ // Do: Secondary button with icon at end
241
+ export const DoIconEndSecondary = () => ({
242
+ components: { BmsButton, ArrowRight },
243
+ template: `
244
+ <BmsButton type="secondary">
245
+ Next
246
+ <template #end><ArrowRight /></template>
247
+ </BmsButton>
248
+ `,
249
+ });
250
+
251
+ // Do: Secondary submit button
252
+ export const DoSubmitSecondary = () => ({
253
+ components: { BmsButton },
254
+ template: `
255
+ <form>
256
+ <BmsButton type="secondary" :submit="true">Cancel form</BmsButton>
257
+ </form>
258
+ `,
259
+ });
260
+
261
+ // Don't: Long labels for secondary
262
+ export const DontLongLabelSecondary = () => ({
263
+ components: { BmsButton },
264
+ template:
265
+ '<BmsButton type="secondary">Click here to cancel your changes to the document</BmsButton>',
266
+ });
267
+
268
+ export const DoShortLabelSecondary = () => ({
269
+ components: { BmsButton },
270
+ template: '<BmsButton type="secondary">Cancel changes</BmsButton>',
271
+ });
272
+
273
+ // Don't: Secondary as primary action
274
+ export const DontSecondaryAsPrimary = () => ({
275
+ components: { BmsButton },
276
+ template: `
277
+ <div style="display: flex; gap: 8px;">
278
+ <BmsButton type="secondary">Save</BmsButton>
279
+ <BmsButton type="secondary">Confirm</BmsButton>
280
+ </div>
281
+ `,
282
+ });
283
+
284
+ export const DoSecondaryForCancel = () => ({
285
+ components: { BmsButton },
286
+ template: `
287
+ <div style="display: flex; gap: 8px;">
288
+ <BmsButton type="secondary">Cancel</BmsButton>
289
+ <BmsButton type="primary">Save</BmsButton>
290
+ </div>
291
+ `,
292
+ });
293
+
294
+ // Don't: Too many icons on secondary
295
+ export const DontTooManyIconsSecondary = () => ({
296
+ components: { BmsButton, Heart, Wand, Check, ArrowLeft },
297
+ template: `
298
+ <BmsButton type="secondary">
299
+ <template #start><Heart /><Wand /></template>
300
+ Cancel changes
301
+ <template #end><Check /><ArrowLeft /></template>
302
+ </BmsButton>
303
+ `,
304
+ });
305
+
306
+ export const DoOneIconSecondary = () => ({
307
+ components: { BmsButton, ArrowLeft },
308
+ template: `
309
+ <BmsButton type="secondary">
310
+ <template #start><ArrowLeft /></template>
311
+ Back
312
+ </BmsButton>
313
+ `,
314
+ });
315
+
316
+ // Don't: Generic labels for secondary
317
+ export const DontGenericLabelSecondary = () => ({
318
+ components: { BmsButton },
319
+ template: `
320
+ <div style="display: flex; gap: 8px;">
321
+ <BmsButton type="secondary">Click here</BmsButton>
322
+ <BmsButton type="secondary">Button</BmsButton>
323
+ </div>
324
+ `,
325
+ });
326
+
327
+ export const DoSpecificLabelSecondary = () => ({
328
+ components: { BmsButton },
329
+ template: `
330
+ <div style="display: flex; gap: 8px;">
331
+ <BmsButton type="secondary">Cancel order</BmsButton>
332
+ <BmsButton type="secondary">Go back</BmsButton>
333
+ </div>
334
+ `,
335
+ });
@@ -3,13 +3,16 @@ import BmsChip from '@/components/form/BmsChip.vue';
3
3
  import template from '@/documentation/template_field_dependency.mdx';
4
4
 
5
5
  export default {
6
+ title: 'Composants/form/Chip',
7
+ component: BmsChip,
8
+ argTypes: {
9
+ color: { options: ['grey', 'blue', 'red', 'green', 'orange'] },
10
+ },
6
11
  parameters: {
7
12
  docs: {
8
13
  page: template,
9
14
  },
10
15
  },
11
- title: 'Composants/form/Chip',
12
- component: BmsChip,
13
16
  };
14
17
 
15
18
  const Template = (args) => ({
@@ -63,3 +66,102 @@ export const Unknown = Template.bind({});
63
66
  Unknown.args = {
64
67
  color: 'Unknown',
65
68
  };
69
+
70
+ // Simple template for documentation
71
+ const SimpleTemplate = (args) => ({
72
+ setup() {
73
+ return { args };
74
+ },
75
+ components: {
76
+ BmsChip,
77
+ },
78
+ template: `
79
+ <BmsChip v-bind="args">{{ args.content || 'Content' }}</BmsChip>
80
+ `,
81
+ });
82
+
83
+ // Playground with default values for documentation
84
+ export const PlaygroundChip = SimpleTemplate.bind({});
85
+ PlaygroundChip.parameters = { chromatic: { disable: true } };
86
+ PlaygroundChip.args = {
87
+ content: 'Status',
88
+ color: 'grey',
89
+ };
90
+
91
+ // Do: Chip with clear content
92
+ export const DoWithClearContent = SimpleTemplate.bind({});
93
+ DoWithClearContent.parameters = { chromatic: { disable: true } };
94
+ DoWithClearContent.args = {
95
+ content: 'Active',
96
+ color: 'green',
97
+ };
98
+
99
+ // Do: Chip with appropriate color
100
+ export const DoWithAppropriateColor = SimpleTemplate.bind({});
101
+ DoWithAppropriateColor.parameters = { chromatic: { disable: true } };
102
+ DoWithAppropriateColor.args = {
103
+ content: 'Error',
104
+ color: 'red',
105
+ };
106
+
107
+ // Do: Chip with short content
108
+ export const DoWithShortContent = SimpleTemplate.bind({});
109
+ DoWithShortContent.parameters = { chromatic: { disable: true } };
110
+ DoWithShortContent.args = {
111
+ content: 'New',
112
+ color: 'blue',
113
+ };
114
+
115
+ // Do: Chip with status color
116
+ export const DoWithStatusColor = SimpleTemplate.bind({});
117
+ DoWithStatusColor.parameters = { chromatic: { disable: true } };
118
+ DoWithStatusColor.args = {
119
+ content: 'Pending',
120
+ color: 'orange',
121
+ };
122
+
123
+ // Don't: Chip with too long content
124
+ export const DontLongContent = SimpleTemplate.bind({});
125
+ DontLongContent.parameters = { chromatic: { disable: true } };
126
+ DontLongContent.args = {
127
+ content:
128
+ 'This is a very long chip content that should not be used because it makes the chip difficult to read and breaks the layout',
129
+ color: 'grey',
130
+ };
131
+
132
+ export const DoShortContent = SimpleTemplate.bind({});
133
+ DoShortContent.parameters = { chromatic: { disable: true } };
134
+ DoShortContent.args = {
135
+ content: 'Status',
136
+ color: 'grey',
137
+ };
138
+
139
+ // Don't: Chip with inappropriate color
140
+ export const DontInappropriateColor = SimpleTemplate.bind({});
141
+ DontInappropriateColor.parameters = { chromatic: { disable: true } };
142
+ DontInappropriateColor.args = {
143
+ content: 'Success',
144
+ color: 'red',
145
+ };
146
+
147
+ export const DoAppropriateColor = SimpleTemplate.bind({});
148
+ DoAppropriateColor.parameters = { chromatic: { disable: true } };
149
+ DoAppropriateColor.args = {
150
+ content: 'Success',
151
+ color: 'green',
152
+ };
153
+
154
+ // Don't: Chip with empty or unclear content
155
+ export const DontEmptyContent = SimpleTemplate.bind({});
156
+ DontEmptyContent.parameters = { chromatic: { disable: true } };
157
+ DontEmptyContent.args = {
158
+ content: '',
159
+ color: 'grey',
160
+ };
161
+
162
+ export const DoClearContent = SimpleTemplate.bind({});
163
+ DoClearContent.parameters = { chromatic: { disable: true } };
164
+ DoClearContent.args = {
165
+ content: 'Active',
166
+ color: 'green',
167
+ };
@@ -6,14 +6,14 @@ import { ref } from 'vue';
6
6
  import template from '@/documentation/template_field_dependency.mdx';
7
7
 
8
8
  export default {
9
+ title: 'Composants/form/InputCheckboxCaptionGroup',
10
+ component: BmsInputCheckboxCaptionGroup,
9
11
  parameters: {
10
12
  docs: {
11
13
  page: template,
12
14
  },
13
15
  },
14
16
  tags: ['with_useable_code'],
15
- title: 'Composants/form/InputCheckboxCaptionGroup',
16
- component: BmsInputCheckboxCaptionGroup,
17
17
  };
18
18
 
19
19
  const Template = (args) => ({
@@ -171,3 +171,158 @@ Errors.args = {
171
171
  label: 'This is a field label',
172
172
  errors: ['Error 1', 'Error 2'],
173
173
  };
174
+
175
+ // Simple template for documentation
176
+ const SimpleTemplate = (args) => ({
177
+ setup() {
178
+ const modelValue = ref(args.modelValue || []);
179
+ return { args, modelValue };
180
+ },
181
+ components: {
182
+ BmsInputCheckboxCaptionGroup,
183
+ },
184
+ template: `
185
+ <BmsInputCheckboxCaptionGroup v-bind="args" v-model="modelValue" />
186
+ `,
187
+ });
188
+
189
+ // Playground with default values for documentation
190
+ export const PlaygroundCheckboxCaptionGroup = SimpleTemplate.bind({});
191
+ PlaygroundCheckboxCaptionGroup.parameters = { chromatic: { disable: true } };
192
+ PlaygroundCheckboxCaptionGroup.args = {
193
+ label: 'Select features',
194
+ modelValue: [],
195
+ options: [
196
+ {
197
+ value: 'feature1',
198
+ label: 'Feature 1',
199
+ captions: ['Basic feature included'],
200
+ },
201
+ { value: 'feature2', label: 'Feature 2', captions: ['Advanced feature'] },
202
+ { value: 'feature3', label: 'Feature 3', captions: ['Premium feature'] },
203
+ ],
204
+ };
205
+
206
+ // Do: Checkbox caption group with clear labels
207
+ export const DoWithClearLabels = SimpleTemplate.bind({});
208
+ DoWithClearLabels.parameters = { chromatic: { disable: true } };
209
+ DoWithClearLabels.args = {
210
+ label: 'Notification preferences',
211
+ modelValue: [],
212
+ options: [
213
+ {
214
+ value: 'email',
215
+ label: 'Email notifications',
216
+ captions: ['Receive updates via email'],
217
+ },
218
+ {
219
+ value: 'sms',
220
+ label: 'SMS notifications',
221
+ captions: ['Receive updates via SMS'],
222
+ },
223
+ {
224
+ value: 'push',
225
+ label: 'Push notifications',
226
+ captions: ['Receive browser notifications'],
227
+ },
228
+ ],
229
+ };
230
+
231
+ // Do: Checkbox caption group with helpful captions
232
+ export const DoWithHelpfulCaptions = SimpleTemplate.bind({});
233
+ DoWithHelpfulCaptions.parameters = { chromatic: { disable: true } };
234
+ DoWithHelpfulCaptions.args = {
235
+ label: 'Subscription add-ons',
236
+ modelValue: [],
237
+ options: [
238
+ {
239
+ value: 'storage',
240
+ label: 'Extra Storage',
241
+ captions: ['+100GB storage space'],
242
+ },
243
+ {
244
+ value: 'support',
245
+ label: 'Priority Support',
246
+ captions: ['24/7 priority support'],
247
+ },
248
+ {
249
+ value: 'analytics',
250
+ label: 'Advanced Analytics',
251
+ captions: ['Detailed usage analytics'],
252
+ },
253
+ ],
254
+ };
255
+
256
+ // Do: Checkbox caption group in column layout
257
+ export const DoWithColumnLayout = SimpleTemplate.bind({});
258
+ DoWithColumnLayout.parameters = { chromatic: { disable: true } };
259
+ DoWithColumnLayout.args = {
260
+ label: 'Select services',
261
+ modelValue: [],
262
+ align: 'column',
263
+ options: [
264
+ {
265
+ value: 'service1',
266
+ label: 'Service 1',
267
+ captions: ['Description of service 1 with more details'],
268
+ },
269
+ {
270
+ value: 'service2',
271
+ label: 'Service 2',
272
+ captions: ['Description of service 2 with more details'],
273
+ },
274
+ {
275
+ value: 'service3',
276
+ label: 'Service 3',
277
+ captions: ['Description of service 3 with more details'],
278
+ },
279
+ ],
280
+ };
281
+
282
+ // Do: Checkbox caption group with error feedback
283
+ export const DoWithErrorFeedback = SimpleTemplate.bind({});
284
+ DoWithErrorFeedback.parameters = { chromatic: { disable: true } };
285
+ DoWithErrorFeedback.args = {
286
+ label: 'Select features',
287
+ modelValue: [],
288
+ errors: ['Please select at least one feature'],
289
+ options: [
290
+ { value: 'feature1', label: 'Feature 1', captions: ['Basic feature'] },
291
+ { value: 'feature2', label: 'Feature 2', captions: ['Advanced feature'] },
292
+ ],
293
+ };
294
+
295
+ // Don't: Missing labels
296
+ export const DontNoLabel = SimpleTemplate.bind({});
297
+ DontNoLabel.parameters = { chromatic: { disable: true } };
298
+ DontNoLabel.args = {
299
+ modelValue: [],
300
+ options: [
301
+ { value: 'option1', label: 'Option 1', captions: ['Description'] },
302
+ { value: 'option2', label: 'Option 2', captions: ['Description'] },
303
+ ],
304
+ };
305
+
306
+ export const DoWithLabel = SimpleTemplate.bind({});
307
+ DoWithLabel.parameters = { chromatic: { disable: true } };
308
+ DoWithLabel.args = {
309
+ label: 'Choose options',
310
+ modelValue: [],
311
+ options: [
312
+ { value: 'option1', label: 'Option 1', captions: ['Description'] },
313
+ { value: 'option2', label: 'Option 2', captions: ['Description'] },
314
+ ],
315
+ };
316
+
317
+ // Don't: No captions when needed
318
+ export const DontNoCaptions = SimpleTemplate.bind({});
319
+ DontNoCaptions.parameters = { chromatic: { disable: true } };
320
+ DontNoCaptions.args = {
321
+ label: 'Subscription add-ons',
322
+ modelValue: [],
323
+ options: [
324
+ { value: 'storage', label: 'Extra Storage' },
325
+ { value: 'support', label: 'Priority Support' },
326
+ { value: 'analytics', label: 'Advanced Analytics' },
327
+ ],
328
+ };
@@ -6,13 +6,13 @@ import { ref } from 'vue';
6
6
  import template from '@/documentation/template_field_dependency.mdx';
7
7
 
8
8
  export default {
9
+ title: 'Composants/form/InputCheckboxGroup',
10
+ component: BmsInputCheckboxGroup,
9
11
  parameters: {
10
12
  docs: {
11
13
  page: template,
12
14
  },
13
15
  },
14
- title: 'Composants/form/InputCheckboxGroup',
15
- component: BmsInputCheckboxGroup,
16
16
  };
17
17
 
18
18
  const Template = (args) => ({
@@ -92,3 +92,120 @@ Errors.args = {
92
92
  label: 'This is a field label',
93
93
  errors: ['Error 1', 'Error 2'],
94
94
  };
95
+
96
+ // Simple template for documentation
97
+ const SimpleTemplate = (args) => ({
98
+ setup() {
99
+ const modelValue = ref(args.modelValue || []);
100
+ return { args, modelValue };
101
+ },
102
+ components: {
103
+ BmsInputCheckboxGroup,
104
+ },
105
+ template: `
106
+ <BmsInputCheckboxGroup v-bind="args" v-model="modelValue" />
107
+ `,
108
+ });
109
+
110
+ // Playground with default values for documentation
111
+ export const PlaygroundCheckboxGroup = SimpleTemplate.bind({});
112
+ PlaygroundCheckboxGroup.parameters = { chromatic: { disable: true } };
113
+ PlaygroundCheckboxGroup.args = {
114
+ label: 'Select interests',
115
+ modelValue: [],
116
+ values: [
117
+ { value: 'sports', label: 'Sports' },
118
+ { value: 'music', label: 'Music' },
119
+ { value: 'travel', label: 'Travel' },
120
+ ],
121
+ };
122
+
123
+ // Do: Checkbox group with clear labels
124
+ export const DoWithClearLabels = SimpleTemplate.bind({});
125
+ DoWithClearLabels.parameters = { chromatic: { disable: true } };
126
+ DoWithClearLabels.args = {
127
+ label: 'Communication preferences',
128
+ modelValue: [],
129
+ values: [
130
+ { value: 'email', label: 'Email' },
131
+ { value: 'sms', label: 'SMS' },
132
+ { value: 'phone', label: 'Phone' },
133
+ ],
134
+ };
135
+
136
+ // Do: Checkbox group with caption
137
+ export const DoWithCaption = SimpleTemplate.bind({});
138
+ DoWithCaption.parameters = { chromatic: { disable: true } };
139
+ DoWithCaption.args = {
140
+ label: 'Select categories',
141
+ modelValue: [],
142
+ captions: ['You can select multiple categories'],
143
+ values: [
144
+ { value: 'tech', label: 'Technology' },
145
+ { value: 'design', label: 'Design' },
146
+ { value: 'business', label: 'Business' },
147
+ ],
148
+ };
149
+
150
+ // Do: Checkbox group in column layout
151
+ export const DoWithColumnLayout = SimpleTemplate.bind({});
152
+ DoWithColumnLayout.parameters = { chromatic: { disable: true } };
153
+ DoWithColumnLayout.args = {
154
+ label: 'Select permissions',
155
+ modelValue: [],
156
+ align: 'column',
157
+ captions: ['Select all permissions you want to grant'],
158
+ values: [
159
+ { value: 'read', label: 'Read access' },
160
+ { value: 'write', label: 'Write access' },
161
+ { value: 'delete', label: 'Delete access' },
162
+ { value: 'admin', label: 'Admin access' },
163
+ ],
164
+ };
165
+
166
+ // Do: Checkbox group with error feedback
167
+ export const DoWithErrorFeedback = SimpleTemplate.bind({});
168
+ DoWithErrorFeedback.parameters = { chromatic: { disable: true } };
169
+ DoWithErrorFeedback.args = {
170
+ label: 'Select interests',
171
+ modelValue: [],
172
+ errors: ['Please select at least one interest'],
173
+ values: [
174
+ { value: 'sports', label: 'Sports' },
175
+ { value: 'music', label: 'Music' },
176
+ ],
177
+ };
178
+
179
+ // Don't: Missing labels
180
+ export const DontNoLabel = SimpleTemplate.bind({});
181
+ DontNoLabel.parameters = { chromatic: { disable: true } };
182
+ DontNoLabel.args = {
183
+ modelValue: [],
184
+ values: [
185
+ { value: 'option1', label: 'Option 1' },
186
+ { value: 'option2', label: 'Option 2' },
187
+ ],
188
+ };
189
+
190
+ export const DoWithLabel = SimpleTemplate.bind({});
191
+ DoWithLabel.parameters = { chromatic: { disable: true } };
192
+ DoWithLabel.args = {
193
+ label: 'Choose options',
194
+ modelValue: [],
195
+ values: [
196
+ { value: 'option1', label: 'Option 1' },
197
+ { value: 'option2', label: 'Option 2' },
198
+ ],
199
+ };
200
+
201
+ // Don't: No error feedback
202
+ export const DontNoErrorFeedback = SimpleTemplate.bind({});
203
+ DontNoErrorFeedback.parameters = { chromatic: { disable: true } };
204
+ DontNoErrorFeedback.args = {
205
+ label: 'Select interests',
206
+ modelValue: [],
207
+ values: [
208
+ { value: 'sports', label: 'Sports' },
209
+ { value: 'music', label: 'Music' },
210
+ ],
211
+ };