@descope/web-components-ui 3.5.1 → 3.6.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.
Files changed (59) hide show
  1. package/package.json +34 -33
  2. package/stories/commonControls.js +359 -0
  3. package/stories/descope-alert.stories.js +102 -0
  4. package/stories/descope-button-multi-selection-group.stories.js +130 -0
  5. package/stories/descope-button-selection-group.stories.js +131 -0
  6. package/stories/descope-calendar.stories.js +115 -0
  7. package/stories/descope-checkbox.stories.js +74 -0
  8. package/stories/descope-code-snippet.stories.js +118 -0
  9. package/stories/descope-container.stories.js +96 -0
  10. package/stories/descope-date-field.stories.js +169 -0
  11. package/stories/descope-divider.stories.js +43 -0
  12. package/stories/descope-email-field.stories.js +109 -0
  13. package/stories/descope-grid.stories.js +218 -0
  14. package/stories/descope-hcaptcha.stories.js +29 -0
  15. package/stories/descope-hybrid-field.stories.js +151 -0
  16. package/stories/descope-loader-linear.stories.js +29 -0
  17. package/stories/descope-loader-radial.stories.js +29 -0
  18. package/stories/descope-logo.stories.js +40 -0
  19. package/stories/descope-mappings-field.stories.js +108 -0
  20. package/stories/descope-modal.stories.js +48 -0
  21. package/stories/descope-multi-select-combo-box.stories.js +183 -0
  22. package/stories/descope-new-password.stories.js +206 -0
  23. package/stories/descope-notification.stories.js +81 -0
  24. package/stories/descope-notp-image.stories.js +29 -0
  25. package/stories/descope-number-field.stories.js +83 -0
  26. package/stories/descope-passcode.stories.js +89 -0
  27. package/stories/descope-password.stories.js +89 -0
  28. package/stories/descope-phone-field.stories.js +137 -0
  29. package/stories/descope-phone-input-box-field.stories.js +128 -0
  30. package/stories/descope-policy-validation.stories.js +92 -0
  31. package/stories/descope-radio-group.stories.js +142 -0
  32. package/stories/descope-recaptcha.stories.js +38 -0
  33. package/stories/descope-saml-group-mappings.stories.js +109 -0
  34. package/stories/descope-scopes-list.stories.js +81 -0
  35. package/stories/descope-security-questions-setup.stories.js +125 -0
  36. package/stories/descope-security-questions-verify.stories.js +111 -0
  37. package/stories/descope-switch-toggle.stories.js +74 -0
  38. package/stories/descope-text-area.stories.js +77 -0
  39. package/stories/descope-text-field.stories.js +98 -0
  40. package/stories/descope-third-party-app-logo.stories.js +42 -0
  41. package/stories/descope-totp-image.stories.js +29 -0
  42. package/stories/descope-upload-file.stories.js +113 -0
  43. package/stories/descope-user-attribute.stories.js +85 -0
  44. package/stories/descope-user-auth-method.stories.js +77 -0
  45. package/stories/helpers.js +86 -0
  46. package/stories/icons/alert.svg +9 -0
  47. package/stories/icons/apple.svg +10 -0
  48. package/stories/icons/base64png.js +1 -0
  49. package/stories/icons/base64svg.js +1 -0
  50. package/stories/icons/button-icon.svg +3 -0
  51. package/stories/icons/errorMessageIconBase64.js +1 -0
  52. package/stories/icons/fulfilled-button-icon.svg +3 -0
  53. package/stories/icons/google.svg +25 -0
  54. package/stories/icons/method-icon.svg +3 -0
  55. package/stories/images/150x200.jpg +0 -0
  56. package/stories/images/800x150.jpg +0 -0
  57. package/stories/images/avatar.jpeg +0 -0
  58. package/stories/images/demo.jpg +0 -0
  59. package/stories/images/game.png +0 -0
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "3.5.1",
3
+ "version": "3.6.0",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "files": [
9
9
  "dist",
10
- "src"
10
+ "src",
11
+ "stories"
11
12
  ],
12
13
  "license": "MIT",
13
14
  "devDependencies": {
@@ -51,10 +52,10 @@
51
52
  "webpack-cli": "^7.0.0",
52
53
  "webpack-dev-server": "^5.0.0",
53
54
  "webpack-subresource-integrity": "5.2.0-rc.1",
54
- "rollup-replace-plugin": "3.5.1",
55
- "test-drivers": "3.5.1",
56
- "webpack-extract-font-loader": "3.5.1",
57
- "webpack-replace-plugin": "3.5.1"
55
+ "rollup-replace-plugin": "3.6.0",
56
+ "webpack-extract-font-loader": "3.6.0",
57
+ "test-drivers": "3.6.0",
58
+ "webpack-replace-plugin": "3.6.0"
58
59
  },
59
60
  "dependencies": {
60
61
  "@vaadin/checkbox": "24.3.4",
@@ -78,33 +79,33 @@
78
79
  "libphonenumber-js": "^1.11.12",
79
80
  "lodash.debounce": "4.0.8",
80
81
  "lodash.merge": "4.6.2",
81
- "@descope-ui/common": "3.5.1",
82
- "@descope-ui/descope-country-subdivision-city-field": "3.5.1",
83
- "@descope-ui/descope-apps-list": "3.5.1",
84
- "@descope-ui/descope-address-field": "3.5.1",
85
- "@descope-ui/descope-autocomplete-field": "3.5.1",
86
- "@descope-ui/descope-avatar": "3.5.1",
87
- "@descope-ui/descope-badge": "3.5.1",
88
- "@descope-ui/descope-button": "3.5.1",
89
- "@descope-ui/descope-collapsible-container": "3.5.1",
90
- "@descope-ui/descope-combo-box": "3.5.1",
91
- "@descope-ui/descope-enriched-text": "3.5.1",
92
- "@descope-ui/descope-image": "3.5.1",
93
- "@descope-ui/descope-link": "3.5.1",
94
- "@descope-ui/descope-list": "3.5.1",
95
- "@descope-ui/descope-list-item": "3.5.1",
96
- "@descope-ui/descope-outbound-app-button": "3.5.1",
97
- "@descope-ui/descope-outbound-apps": "3.5.1",
98
- "@descope-ui/descope-icon": "3.5.1",
99
- "@descope-ui/descope-password-strength": "3.5.1",
100
- "@descope-ui/descope-ponyhot": "3.5.1",
101
- "@descope-ui/descope-recovery-codes": "3.5.1",
102
- "@descope-ui/descope-text": "3.5.1",
103
- "@descope-ui/descope-timer": "3.5.1",
104
- "@descope-ui/descope-timer-button": "3.5.1",
105
- "@descope-ui/descope-tooltip": "3.5.1",
106
- "@descope-ui/descope-trusted-devices": "3.5.1",
107
- "@descope-ui/descope-attachment": "3.5.1"
82
+ "@descope-ui/common": "3.6.0",
83
+ "@descope-ui/descope-address-field": "3.6.0",
84
+ "@descope-ui/descope-apps-list": "3.6.0",
85
+ "@descope-ui/descope-avatar": "3.6.0",
86
+ "@descope-ui/descope-badge": "3.6.0",
87
+ "@descope-ui/descope-button": "3.6.0",
88
+ "@descope-ui/descope-collapsible-container": "3.6.0",
89
+ "@descope-ui/descope-country-subdivision-city-field": "3.6.0",
90
+ "@descope-ui/descope-combo-box": "3.6.0",
91
+ "@descope-ui/descope-icon": "3.6.0",
92
+ "@descope-ui/descope-enriched-text": "3.6.0",
93
+ "@descope-ui/descope-list": "3.6.0",
94
+ "@descope-ui/descope-autocomplete-field": "3.6.0",
95
+ "@descope-ui/descope-link": "3.6.0",
96
+ "@descope-ui/descope-outbound-app-button": "3.6.0",
97
+ "@descope-ui/descope-outbound-apps": "3.6.0",
98
+ "@descope-ui/descope-password-strength": "3.6.0",
99
+ "@descope-ui/descope-ponyhot": "3.6.0",
100
+ "@descope-ui/descope-recovery-codes": "3.6.0",
101
+ "@descope-ui/descope-text": "3.6.0",
102
+ "@descope-ui/descope-timer": "3.6.0",
103
+ "@descope-ui/descope-timer-button": "3.6.0",
104
+ "@descope-ui/descope-tooltip": "3.6.0",
105
+ "@descope-ui/descope-list-item": "3.6.0",
106
+ "@descope-ui/descope-trusted-devices": "3.6.0",
107
+ "@descope-ui/descope-image": "3.6.0",
108
+ "@descope-ui/descope-attachment": "3.6.0"
108
109
  },
109
110
  "overrides": {
110
111
  "@vaadin/avatar": "24.3.4",
@@ -0,0 +1,359 @@
1
+ import errorMessageIconBase64 from './icons/errorMessageIconBase64';
2
+
3
+ export const labelControl = {
4
+ label: {
5
+ name: 'Label',
6
+ control: { type: 'text' },
7
+ },
8
+ };
9
+
10
+ export const helperTextControl = {
11
+ 'helper-text': {
12
+ name: 'Helper Text',
13
+ control: { type: 'text' },
14
+ },
15
+ };
16
+
17
+ export const placeholderControl = {
18
+ placeholder: {
19
+ name: 'Placeholder',
20
+ control: { type: 'text' },
21
+ },
22
+ };
23
+
24
+ export const sizeControl = {
25
+ size: {
26
+ name: 'Size',
27
+ options: ['xs', 'sm', 'md', 'lg'],
28
+ control: { type: 'select' },
29
+ },
30
+ };
31
+
32
+ export const loadingControl = {
33
+ loading: {
34
+ name: 'Loading',
35
+ control: { type: 'boolean' },
36
+ },
37
+ };
38
+
39
+ export const fullWidthControl = {
40
+ 'full-width': {
41
+ name: 'Full Width',
42
+ control: { type: 'boolean' },
43
+ },
44
+ };
45
+
46
+ export const disabledControl = {
47
+ disabled: {
48
+ name: 'Disabled',
49
+ control: { type: 'boolean' },
50
+ },
51
+ };
52
+
53
+ export const readOnlyControl = {
54
+ readonly: {
55
+ name: 'Read Only',
56
+ control: { type: 'boolean' },
57
+ },
58
+ };
59
+
60
+ export const requiredControl = {
61
+ required: {
62
+ name: 'Required',
63
+ control: { type: 'boolean' },
64
+ },
65
+ };
66
+
67
+ export const directionControl = {
68
+ direction: {
69
+ name: 'Direction',
70
+ options: ['ltr', 'rtl'],
71
+ control: { type: 'select' },
72
+ },
73
+ };
74
+
75
+ export const borderedControl = {
76
+ bordered: {
77
+ name: 'Bordered',
78
+ control: { type: 'boolean' },
79
+ },
80
+ };
81
+
82
+ export const minLengthControl = {
83
+ minlength: {
84
+ name: 'Min. Length',
85
+ control: { type: 'number' },
86
+ },
87
+ };
88
+
89
+ export const maxLengthControl = {
90
+ maxlength: {
91
+ name: 'Max. Length',
92
+ control: { type: 'number' },
93
+ },
94
+ };
95
+
96
+ export const textContentControl = {
97
+ text: {
98
+ name: 'Content',
99
+ control: { type: 'text' },
100
+ },
101
+ };
102
+
103
+ export const modeControl = {
104
+ mode: {
105
+ name: 'Mode',
106
+ options: ['none', 'primary', 'secondary', 'success', 'error'],
107
+ control: { type: 'select' },
108
+ },
109
+ };
110
+
111
+ export const textAlignControl = {
112
+ 'text-align': {
113
+ name: 'Text Align',
114
+ options: ['left', 'center', 'right'],
115
+ control: { type: 'select' },
116
+ },
117
+ };
118
+
119
+ export const errorMissingValueControl = {
120
+ 'data-errormessage-value-missing': {
121
+ name: 'Custom Error: Mandatory',
122
+ control: { type: 'text' },
123
+ },
124
+ };
125
+
126
+ export const errorPatternMismatchControl = {
127
+ 'data-errormessage-pattern-mismatch': {
128
+ name: 'Custom Error: Pattern Mismatch',
129
+ control: { type: 'text' },
130
+ },
131
+ };
132
+
133
+ export const errorTypeMismatchControl = {
134
+ 'data-errormessage-type-mismatch': {
135
+ name: 'Custom Error: Type Mismatch',
136
+ control: { type: 'text' },
137
+ },
138
+ };
139
+
140
+ export const errorBadInputControl = {
141
+ 'data-errormessage-bad-input': {
142
+ name: 'Custom Error: Bad Input',
143
+ control: { type: 'text' },
144
+ },
145
+ };
146
+
147
+ export const errorRangeUnderflowControl = {
148
+ 'data-errormessage-range-underflow': {
149
+ name: 'Custom Error: Below minimum value',
150
+ control: { type: 'text' },
151
+ },
152
+ };
153
+
154
+ export const errorRangeOverflowControl = {
155
+ 'data-errormessage-range-overflow': {
156
+ name: 'Custom Error: Exceeds maximum value',
157
+ control: { type: 'text' },
158
+ },
159
+ };
160
+
161
+ export const fillControl = {
162
+ 'st-fill': {
163
+ name: 'Fill',
164
+ control: { type: 'color' },
165
+ },
166
+ };
167
+
168
+ export const customHeightControl = {
169
+ 'st-host-height': {
170
+ name: 'Custom Height',
171
+ control: { type: 'text' },
172
+ },
173
+ };
174
+
175
+ export const customWidthControl = {
176
+ 'st-host-width': {
177
+ name: 'Custom Width',
178
+ control: { type: 'text' },
179
+ },
180
+ };
181
+
182
+ export const checkboxValueControl = {
183
+ checked: {
184
+ name: 'Checked',
185
+ control: { type: 'boolean' },
186
+ },
187
+ };
188
+
189
+ export const buttonVariantControl = {
190
+ variant: {
191
+ name: 'Button Variant',
192
+ options: ['contained', 'outline', 'link'],
193
+ control: { type: 'select' },
194
+ },
195
+ };
196
+
197
+ export const boxShadowControl = {
198
+ shadow: {
199
+ name: 'Shadow',
200
+ options: ['sm', 'md', 'lg', 'xl', '2xl'],
201
+ control: { type: 'select' },
202
+ },
203
+ };
204
+
205
+ export const borderRadiusControl = {
206
+ 'border-radius': {
207
+ name: 'Radius',
208
+ options: ['sm', 'md', 'lg', 'xl', '2xl', '3xl'],
209
+ control: { type: 'select' },
210
+ },
211
+ };
212
+
213
+ export const imgSrcControl = {
214
+ src: {
215
+ name: 'Image Source',
216
+ control: { type: 'text' },
217
+ },
218
+ };
219
+
220
+ export const typographyVariantControl = {
221
+ variant: {
222
+ name: 'Variant',
223
+ options: ['h1', 'h2', 'h3', 'subtitle1', 'subtitle2', 'body1', 'body2'],
224
+ control: { type: 'select' },
225
+ },
226
+ };
227
+
228
+ export const overrideRenderItemControl = {
229
+ overrideRenderItem: {
230
+ name: 'Override the default item renderer function',
231
+ control: { type: 'boolean' },
232
+ },
233
+ };
234
+
235
+ export const itemsSourceControl = {
236
+ itemsSource: {
237
+ name: 'Where to take the items from',
238
+ control: {
239
+ type: 'select',
240
+ labels: {
241
+ children: 'Children',
242
+ attr: '"data" attribute',
243
+ prop: '"data" property',
244
+ },
245
+ },
246
+ options: ['children', 'attr', 'prop'],
247
+ },
248
+ };
249
+
250
+ export const minItemsSelectionControl = {
251
+ minItemsSelection: {
252
+ name: 'Min Items Selection',
253
+ control: { type: 'number' },
254
+ },
255
+ };
256
+
257
+ export const maxItemsSelectionControl = {
258
+ maxItemsSelection: {
259
+ name: 'Max Items Selection',
260
+ control: { type: 'number' },
261
+ },
262
+ };
263
+
264
+ export const labelSpacingControl = {
265
+ 'label-spacing': {
266
+ name: 'Label Spacing',
267
+ control: { type: 'range', min: 0, max: 200, step: 1 },
268
+ },
269
+ };
270
+
271
+ export const inputLabelTypeControl = {
272
+ 'label-type': {
273
+ name: 'Label Type',
274
+ control: {
275
+ type: 'select',
276
+ },
277
+ options: ['static', 'floating'],
278
+ },
279
+ };
280
+
281
+ export const inputCopyToClipboardControl = {
282
+ 'copy-to-clipboard': {
283
+ name: 'Copy to clipboard',
284
+ control: {
285
+ type: 'boolean',
286
+ },
287
+ },
288
+ };
289
+
290
+ export const errorMessageIconControl = {
291
+ errorMsgIcon: {
292
+ name: 'Error Message Icon',
293
+ control: {
294
+ type: 'boolean',
295
+ },
296
+ },
297
+ };
298
+
299
+ export const defaultValueMissingControl = {
300
+ defaultErrorMessageValueMissing: {
301
+ name: 'Default error-message: Value missing',
302
+ control: {
303
+ type: 'boolean',
304
+ },
305
+ },
306
+ };
307
+
308
+ export const defaultPatternMismatchControl = {
309
+ defaultErrorMessagePatternMismatch: {
310
+ name: 'Default error-message: Pattern mismatch',
311
+ control: {
312
+ type: 'boolean',
313
+ },
314
+ },
315
+ };
316
+
317
+ export const errorMessageIconAttrs = `
318
+ st-error-message-icon="url(${errorMessageIconBase64})"
319
+ st-error-message-icon-size="14px"
320
+ st-error-message-icon-padding="1.5em"
321
+ `;
322
+
323
+ export const tooltipPositionControl = {
324
+ tooltipPosition: {
325
+ control: { type: 'select' },
326
+ options: [
327
+ 'top',
328
+ 'top-start',
329
+ 'top-end',
330
+ 'bottom',
331
+ 'bottom-start',
332
+ 'bottom-end',
333
+ 'start',
334
+ 'start-top',
335
+ 'start-bottom',
336
+ 'end',
337
+ 'end-top',
338
+ 'end-bottom',
339
+ ],
340
+ },
341
+ };
342
+
343
+ export const obfuscatedControl = {
344
+ obfuscated: {
345
+ name: 'Toggle input obfuscation',
346
+ control: {
347
+ type: 'boolean',
348
+ },
349
+ },
350
+ };
351
+
352
+ export const valueControl = {
353
+ value: {
354
+ name: 'Input Value',
355
+ control: {
356
+ type: 'text',
357
+ },
358
+ },
359
+ };
@@ -0,0 +1,102 @@
1
+ import { componentName } from '../src/components/descope-alert';
2
+
3
+ import {
4
+ fullWidthControl,
5
+ directionControl,
6
+ borderRadiusControl,
7
+ borderedControl,
8
+ typographyVariantControl,
9
+ } from './commonControls';
10
+
11
+ import icon from './icons/alert.svg?no-inline';
12
+
13
+ const iconAttrs = `st-icon="url(${icon})"`;
14
+
15
+ const Template = ({
16
+ text,
17
+ direction,
18
+ mode,
19
+ variant,
20
+ spacing,
21
+ bordered,
22
+ 'text-align': textAlign,
23
+ 'link-target-blank': linkTargetBlank,
24
+ 'full-width': fullWidth,
25
+ 'background-color': backgroundColor,
26
+ 'border-color': borderColor,
27
+ 'border-radius': radius,
28
+ 'border-width': borderWidth,
29
+ hasIcon,
30
+ }) =>
31
+ `
32
+ <descope-alert
33
+ bordered="${bordered || false}"
34
+ full-width="${fullWidth || false}"
35
+ spacing="${spacing || ''}"
36
+ mode="${mode || ''}"
37
+ variant="${variant || ''}"
38
+ border-radius="${radius || ''}"
39
+ border-width="${borderWidth || ''}"
40
+ link-target-blank="${linkTargetBlank || false}"
41
+ text-align="${textAlign || ''}"
42
+ st-background-color="${backgroundColor || ''}"
43
+ st-border-color="${borderColor || ''}"
44
+ st-host-direction="${direction ?? ''}"
45
+ ${hasIcon ? iconAttrs : ''}
46
+ >
47
+ ${text}
48
+ </descope-alert>
49
+ `;
50
+
51
+ export default {
52
+ component: componentName,
53
+ title: 'descope-alert',
54
+ argTypes: {
55
+ ...fullWidthControl,
56
+ ...directionControl,
57
+ ...borderRadiusControl,
58
+ ...borderedControl,
59
+ ...typographyVariantControl,
60
+ mode: {
61
+ name: 'Mode',
62
+ options: ['success', 'error'],
63
+ control: { type: 'select' },
64
+ },
65
+ hasIcon: {
66
+ name: 'Has Icon',
67
+ control: { type: 'boolean' },
68
+ },
69
+ 'border-width': {
70
+ name: 'Border Width',
71
+ control: { type: 'select' },
72
+ options: ['xs', 'sm', 'md', 'lg', 'xl'],
73
+ },
74
+ 'background-color': {
75
+ name: 'Background Color',
76
+ control: { type: 'color' },
77
+ },
78
+ 'border-color': {
79
+ name: 'Border Color',
80
+ control: { type: 'color' },
81
+ },
82
+ spacing: {
83
+ name: 'Spacing',
84
+ control: { type: 'select' },
85
+ options: ['', 'xs', 'sm', 'md', 'lg', 'xl'],
86
+ },
87
+ 'text-align': {
88
+ name: 'Text Align',
89
+ control: { type: 'select' },
90
+ options: ['left', 'center', 'right'],
91
+ },
92
+ },
93
+ };
94
+
95
+ export const Default = Template.bind({});
96
+
97
+ Default.args = {
98
+ text: 'Alert text ([link](https://descope.com))',
99
+ mode: 'error',
100
+ variant: 'body1',
101
+ 'link-target-blank': true,
102
+ };
@@ -0,0 +1,130 @@
1
+ import { componentName } from '../src/components/button-selection-group-fields/descope-button-multi-selection-group';
2
+ import {
3
+ sizeControl,
4
+ labelControl,
5
+ requiredControl,
6
+ readOnlyControl,
7
+ helperTextControl,
8
+ disabledControl,
9
+ minItemsSelectionControl,
10
+ maxItemsSelectionControl,
11
+ errorMissingValueControl,
12
+ fullWidthControl,
13
+ directionControl,
14
+ overrideRenderItemControl,
15
+ itemsSourceControl,
16
+ errorMessageIconControl,
17
+ errorMessageIconAttrs,
18
+ defaultValueMissingControl,
19
+ } from './commonControls';
20
+ import { toggleDefaultErrorMessageValueMissingDecorator, withForm } from './helpers';
21
+
22
+ const altRenderItem = ({ label, value }) => `<span value="${value}">${label}</span>`;
23
+
24
+ const Template = ({
25
+ size,
26
+ label,
27
+ required,
28
+ readonly,
29
+ 'full-width': fullWidth,
30
+ direction,
31
+ disabled,
32
+ minItemsSelection,
33
+ maxItemsSelection,
34
+ 'helper-text': helperText,
35
+ 'default-values': defaultValues,
36
+ 'data-errormessage-value-missing': customErrorMissingValue,
37
+ data,
38
+ itemsSource,
39
+ errorMsgIcon,
40
+ }) => {
41
+ let serializedData;
42
+ let serializedDefaultValues;
43
+
44
+ try {
45
+ serializedData = JSON.stringify(data);
46
+ serializedDefaultValues = JSON.stringify(defaultValues);
47
+ } catch (e) {
48
+ // do nothing
49
+ }
50
+
51
+ return `
52
+ <descope-button-multi-selection-group
53
+ data='${(itemsSource === 'attr' && serializedData) || ''}'
54
+ full-width="${fullWidth || false}"
55
+ size="${size || ''}"
56
+ label="${label || ''}"
57
+ helper-text="${helperText || ''}"
58
+ default-values='${serializedDefaultValues || ''}'
59
+ required="${required || false}"
60
+ readonly="${readonly || false}"
61
+ disabled="${disabled || false}"
62
+ data-errormessage-value-missing="${customErrorMissingValue || ''}"
63
+ st-host-direction="${direction ?? ''}"
64
+ min-items-selection="${minItemsSelection || ''}"
65
+ max-items-selection="${maxItemsSelection || ''}"
66
+ ${errorMsgIcon ? errorMessageIconAttrs : ''}
67
+ >
68
+ <descope-button-selection-group-item value="1">item1</descope-button-selection-group-item>
69
+ <descope-button-selection-group-item value="2">test test test test test test test test</descope-button-selection-group-item>
70
+ <descope-button-selection-group-item value="3">item2</descope-button-selection-group-item>
71
+ <descope-button-selection-group-item value="4">another item</descope-button-selection-group-item>
72
+ </descope-button-multi-selection-group>
73
+ `;
74
+ };
75
+
76
+ export default {
77
+ component: componentName,
78
+ title: 'descope-button-multi-selection-group',
79
+ decorators: [
80
+ (story, { args }) => {
81
+ setTimeout(() => {
82
+ const ele = document.querySelector('descope-button-multi-selection-group');
83
+
84
+ if (args.itemsSource === 'prop') ele.data = args.data;
85
+ if (args.overrideRenderItem) ele.renderItem = altRenderItem;
86
+ });
87
+ return story();
88
+ },
89
+ toggleDefaultErrorMessageValueMissingDecorator,
90
+ withForm,
91
+ ],
92
+ argTypes: {
93
+ ...sizeControl,
94
+ ...labelControl,
95
+ ...readOnlyControl,
96
+ ...requiredControl,
97
+ ...helperTextControl,
98
+ ...disabledControl,
99
+ ...errorMissingValueControl,
100
+ ...fullWidthControl,
101
+ ...minItemsSelectionControl,
102
+ ...maxItemsSelectionControl,
103
+ 'default-values': {
104
+ name: 'Default Values',
105
+ control: { type: 'object' },
106
+ },
107
+ readonly: {
108
+ name: 'Read Only',
109
+ control: { type: 'boolean' },
110
+ },
111
+ ...overrideRenderItemControl,
112
+ ...itemsSourceControl,
113
+ ...directionControl,
114
+ ...errorMessageIconControl,
115
+ ...defaultValueMissingControl,
116
+ },
117
+ };
118
+
119
+ export const Default = Template.bind({});
120
+
121
+ Default.args = {
122
+ data: [
123
+ { value: 'itemId1', label: 'data item 1' },
124
+ { value: 'itemId2', label: 'data item 2' },
125
+ { value: 'itemId3', label: 'data item 3' },
126
+ { value: 'itemId4', label: 'data item 4' },
127
+ ],
128
+ itemsSource: 'children',
129
+ 'data-errormessage-value-missing': 'Please fill out this field.',
130
+ };