@descope/flow-components 2.0.197 → 2.0.199

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/index.cjs.js CHANGED
@@ -286,7 +286,59 @@ const GridTextColumn = React__default.default.forwardRef((props, ref) => React__
286
286
 
287
287
  const Badge = React__default.default.forwardRef((props, ref) => React__default.default.createElement("descope-badge", { ...props, ref: ref }));
288
288
 
289
- const Modal = React__default.default.forwardRef((props, ref) => React__default.default.createElement("descope-modal", { ...props, ref: ref }));
289
+ const Modal = React__default.default.forwardRef((props, ref) => (React__default.default.createElement("descope-modal", { ...props, ref: ref })));
290
+
291
+ const ButtonMultiSelectionGroup = React__default.default.forwardRef(({ 'default-values': defaultValues, ...props }, ref) => {
292
+ const serializedDefaultValues = React.useMemo(() => {
293
+ if (!defaultValues)
294
+ return undefined;
295
+ try {
296
+ return JSON.stringify(defaultValues);
297
+ }
298
+ catch (e) {
299
+ // eslint-disable-next-line no-console
300
+ console.error('could not parse data string from attribute "default-values" -', e.message);
301
+ return '';
302
+ }
303
+ }, [defaultValues]);
304
+ return (React__default.default.createElement("descope-button-multi-selection-group", { ...props, "default-values": serializedDefaultValues ?? undefined, ref: ref }));
305
+ });
306
+ ButtonMultiSelectionGroup.defaultProps = {
307
+ // eslint-disable-next-line react/default-props-match-prop-types
308
+ size: 'md'
309
+ };
310
+
311
+ const MultiSelectComboBox = React__default.default.forwardRef(({ 'default-values': defaultValues, ...props }, ref) => {
312
+ const serializedDefaultValues = React.useMemo(() => {
313
+ if (!defaultValues)
314
+ return undefined;
315
+ try {
316
+ return JSON.stringify(defaultValues);
317
+ }
318
+ catch (e) {
319
+ // eslint-disable-next-line no-console
320
+ console.error('could not parse data string from attribute "default-values" -', e.message);
321
+ return '';
322
+ }
323
+ }, [defaultValues]);
324
+ return (React__default.default.createElement("descope-multi-select-combo-box", { ...props, "clear-button-visible": "true", "item-label-path": "data-name", "item-value-path": "data-id", "default-values": serializedDefaultValues ?? undefined, ref: ref }));
325
+ });
326
+ MultiSelectComboBox.defaultProps = {
327
+ // eslint-disable-next-line react/default-props-match-prop-types
328
+ size: 'md',
329
+ // eslint-disable-next-line react/default-props-match-prop-types
330
+ bordered: true
331
+ };
332
+
333
+ const MultiSelect = React__default.default.forwardRef(({ variant, data, ...props }, ref) => {
334
+ if (variant === 'dynamicCombobox') {
335
+ return (React__default.default.createElement(MultiSelectComboBox, { ...props, "allow-custom-value": "true", data: "[]", ref: ref }));
336
+ }
337
+ if (variant === 'buttonSelectionGroup') {
338
+ return (React__default.default.createElement(ButtonMultiSelectionGroup, { ...props, ref: ref }, data?.map(({ label, value }) => (React__default.default.createElement("descope-button-selection-group-item", { key: value, value: value }, label)))));
339
+ }
340
+ return (React__default.default.createElement(MultiSelectComboBox, { ...props, "allow-custom-value": "false", ref: ref }, data?.map(({ label, value }) => (React__default.default.createElement("span", { "data-name": label, "data-id": value, key: value }, label)))));
341
+ });
290
342
 
291
343
  exports.Badge = Badge;
292
344
  exports.Boolean = Boolean;
@@ -306,6 +358,7 @@ exports.Link = Link;
306
358
  exports.Loader = Loader;
307
359
  exports.Logo = Logo;
308
360
  exports.Modal = Modal;
361
+ exports.MultiSelect = MultiSelect;
309
362
  exports.NewPassword = NewPassword;
310
363
  exports.NumberField = NumberField;
311
364
  exports.Password = Password;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import React from 'react';
2
3
  export * from '@descope/web-components-ui';
3
4
 
@@ -22,6 +23,10 @@ type PropsToAttrs<R extends Record<string, any>> = {
22
23
  };
23
24
  type TypographyVariants = 'h1' | 'h2' | 'h3' | 'subtitle1' | 'subtitle2' | 'body1' | 'body2';
24
25
  type Mode = 'primary' | 'secondary' | 'error' | 'success';
26
+ type MultiSelectProps = {
27
+ children?: JSX.Element[];
28
+ 'default-values'?: string[];
29
+ };
25
30
 
26
31
  declare global {
27
32
  namespace JSX {
@@ -44,8 +49,8 @@ declare const Switch: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "r
44
49
  type BooleanType = {
45
50
  type: 'switch' | 'checkbox';
46
51
  };
47
- type Props$l = React.ComponentProps<typeof Checkbox> & React.ComponentProps<typeof Switch> & BooleanType;
48
- declare const Boolean: React.ForwardRefExoticComponent<Omit<Props$l, "ref"> & React.RefAttributes<HTMLInputElement>>;
52
+ type Props$n = React.ComponentProps<typeof Checkbox> & React.ComponentProps<typeof Switch> & BooleanType;
53
+ declare const Boolean: React.ForwardRefExoticComponent<Omit<Props$n, "ref"> & React.RefAttributes<HTMLInputElement>>;
49
54
 
50
55
  declare global {
51
56
  namespace JSX {
@@ -67,17 +72,17 @@ declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes
67
72
  'full-width'?: boolean;
68
73
  }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
69
74
 
70
- type Props$k = {
75
+ type Props$m = {
71
76
  digits?: number;
72
77
  };
73
78
  declare global {
74
79
  namespace JSX {
75
80
  interface IntrinsicElements {
76
- 'descope-passcode': DescopeInputProps & Props$k;
81
+ 'descope-passcode': DescopeInputProps & Props$m;
77
82
  }
78
83
  }
79
84
  }
80
- declare const Code: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$k, "ref"> & React.RefAttributes<HTMLInputElement>>;
85
+ declare const Code: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$m, "ref"> & React.RefAttributes<HTMLInputElement>>;
81
86
 
82
87
  type Never<T extends Record<string, any>> = {
83
88
  [K in keyof T]: never;
@@ -93,7 +98,7 @@ type ContainerAlignment = {
93
98
  'vertical-alignment'?: FlexAlignment;
94
99
  'space-between'?: 'sm' | 'md' | 'lg';
95
100
  };
96
- type Props$j = {
101
+ type Props$l = {
97
102
  direction?: 'row' | 'column';
98
103
  shadow?: 'md' | 'lg' | 'xl' | '2xl';
99
104
  'border-radius'?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
@@ -109,9 +114,9 @@ declare global {
109
114
  }
110
115
  }
111
116
  }
112
- declare const Container: React.ForwardRefExoticComponent<(Props$j & React.HTMLAttributes<HTMLDivElement>) & React.RefAttributes<HTMLDivElement>>;
117
+ declare const Container: React.ForwardRefExoticComponent<(Props$l & React.HTMLAttributes<HTMLDivElement>) & React.RefAttributes<HTMLDivElement>>;
113
118
 
114
- type Props$i = {
119
+ type Props$k = {
115
120
  vertical?: boolean;
116
121
  italic?: boolean;
117
122
  variant?: TypographyVariants;
@@ -121,11 +126,11 @@ type Props$i = {
121
126
  declare global {
122
127
  namespace JSX {
123
128
  interface IntrinsicElements {
124
- 'descope-divider': React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & Omit<Props$i, 'children'>;
129
+ 'descope-divider': React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & Omit<Props$k, 'children'>;
125
130
  }
126
131
  }
127
132
  }
128
- declare const Divider: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "size"> & Props$i, "ref"> & React.RefAttributes<HTMLDivElement>>;
133
+ declare const Divider: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "size"> & Props$k, "ref"> & React.RefAttributes<HTMLDivElement>>;
129
134
 
130
135
  declare const _default$b: ({ noColor }: {
131
136
  noColor: any;
@@ -175,7 +180,7 @@ declare const _default: ({ noColor }: {
175
180
  noColor: any;
176
181
  }) => React.JSX.Element;
177
182
 
178
- type Props$h = {
183
+ type Props$j = {
179
184
  width?: string;
180
185
  height?: string;
181
186
  alt?: string;
@@ -184,15 +189,15 @@ type Props$h = {
184
189
  declare global {
185
190
  namespace JSX {
186
191
  interface IntrinsicElements {
187
- 'descope-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$h;
192
+ 'descope-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$j;
188
193
  }
189
194
  }
190
195
  }
191
- declare const Image: React.ForwardRefExoticComponent<Props$h & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
196
+ declare const Image: React.ForwardRefExoticComponent<Props$j & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
192
197
 
193
198
  declare const Input: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
194
199
 
195
- type Props$g = {
200
+ type Props$i = {
196
201
  href?: string | undefined;
197
202
  italic?: boolean;
198
203
  variant?: TypographyVariants;
@@ -204,18 +209,18 @@ type Props$g = {
204
209
  declare global {
205
210
  namespace JSX {
206
211
  interface IntrinsicElements {
207
- 'descope-link': React.DetailedHTMLProps<React.HTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & Omit<Props$g, 'children'>;
212
+ 'descope-link': React.DetailedHTMLProps<React.HTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & Omit<Props$i, 'children'>;
208
213
  }
209
214
  }
210
215
  }
211
- declare const Link: React.ForwardRefExoticComponent<Props$g & React.RefAttributes<HTMLAnchorElement>>;
216
+ declare const Link: React.ForwardRefExoticComponent<Props$i & React.RefAttributes<HTMLAnchorElement>>;
212
217
 
213
- type Props$f = {
218
+ type Props$h = {
214
219
  variant?: 'linear' | 'radial';
215
220
  size?: 'xs' | 'sm' | 'md' | 'lg';
216
221
  color?: Mode;
217
222
  };
218
- type LoaderType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$f>;
223
+ type LoaderType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$h>;
219
224
  declare global {
220
225
  namespace JSX {
221
226
  interface IntrinsicElements {
@@ -224,22 +229,22 @@ declare global {
224
229
  }
225
230
  }
226
231
  }
227
- declare const Loader: React.ForwardRefExoticComponent<Props$f & React.RefAttributes<HTMLDivElement>>;
232
+ declare const Loader: React.ForwardRefExoticComponent<Props$h & React.RefAttributes<HTMLDivElement>>;
228
233
 
229
- type Props$e = {
234
+ type Props$g = {
230
235
  width?: string;
231
236
  height?: string;
232
237
  };
233
238
  declare global {
234
239
  namespace JSX {
235
240
  interface IntrinsicElements {
236
- 'descope-logo': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$e>;
241
+ 'descope-logo': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$g>;
237
242
  }
238
243
  }
239
244
  }
240
- declare const Logo: React.ForwardRefExoticComponent<Props$e & React.RefAttributes<HTMLDivElement>>;
245
+ declare const Logo: React.ForwardRefExoticComponent<Props$g & React.RefAttributes<HTMLDivElement>>;
241
246
 
242
- type Props$d = {
247
+ type Props$f = {
243
248
  'password-label'?: string;
244
249
  'password-placeholder'?: string;
245
250
  'confirm-label'?: string;
@@ -249,11 +254,11 @@ type Props$d = {
249
254
  declare global {
250
255
  namespace JSX {
251
256
  interface IntrinsicElements {
252
- 'descope-new-password': DescopeInputProps & Props$d;
257
+ 'descope-new-password': DescopeInputProps & Props$f;
253
258
  }
254
259
  }
255
260
  }
256
- declare const NewPassword: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$d, "ref"> & React.RefAttributes<HTMLInputElement>>;
261
+ declare const NewPassword: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$f, "ref"> & React.RefAttributes<HTMLInputElement>>;
257
262
 
258
263
  declare global {
259
264
  namespace JSX {
@@ -273,16 +278,16 @@ declare global {
273
278
  }
274
279
  declare const Password: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
275
280
 
276
- type Props$c = {
281
+ type Props$e = {
277
282
  variant: 'countrySelection' | 'inputBox';
278
283
  'default-code'?: string;
279
284
  'phone-input-placeholder'?: string;
280
285
  'country-input-placeholder'?: string;
281
286
  'restrict-countries'?: string;
282
287
  } & DescopeInputProps;
283
- declare const Phone: React.ForwardRefExoticComponent<Omit<Props$c, "ref"> & React.RefAttributes<HTMLInputElement>>;
288
+ declare const Phone: React.ForwardRefExoticComponent<Omit<Props$e, "ref"> & React.RefAttributes<HTMLInputElement>>;
284
289
 
285
- type Props$b = {
290
+ type Props$d = {
286
291
  children?: JSX.Element[];
287
292
  };
288
293
  declare global {
@@ -292,9 +297,9 @@ declare global {
292
297
  }
293
298
  }
294
299
  }
295
- declare const Select: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$b, "ref"> & React.RefAttributes<HTMLInputElement>>;
300
+ declare const Select: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$d, "ref"> & React.RefAttributes<HTMLInputElement>>;
296
301
 
297
- type Props$a = {
302
+ type Props$c = {
298
303
  italic?: boolean;
299
304
  variant?: string;
300
305
  mode?: string;
@@ -304,11 +309,11 @@ type Props$a = {
304
309
  declare global {
305
310
  namespace JSX {
306
311
  interface IntrinsicElements {
307
- 'descope-text': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$a;
312
+ 'descope-text': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$c;
308
313
  }
309
314
  }
310
315
  }
311
- declare const Text: React.ForwardRefExoticComponent<Omit<Props$a & {
316
+ declare const Text: React.ForwardRefExoticComponent<Omit<Props$c & {
312
317
  typography?: TypographyVariants;
313
318
  } & Omit<React.HTMLProps<HTMLSpanElement>, "mode">, "ref"> & React.RefAttributes<HTMLElement>>;
314
319
 
@@ -330,23 +335,23 @@ declare global {
330
335
  }
331
336
  declare const TextField: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
332
337
 
333
- type Props$9 = {
338
+ type Props$b = {
334
339
  width?: string;
335
340
  height?: string;
336
341
  };
337
342
  declare global {
338
343
  namespace JSX {
339
344
  interface IntrinsicElements {
340
- 'descope-totp-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$9>;
345
+ 'descope-totp-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$b>;
341
346
  }
342
347
  }
343
348
  }
344
- declare const TOTPImage: React.ForwardRefExoticComponent<Props$9 & React.RefAttributes<HTMLDivElement>>;
349
+ declare const TOTPImage: React.ForwardRefExoticComponent<Props$b & React.RefAttributes<HTMLDivElement>>;
345
350
 
346
- type Props$8 = Omit<React.ComponentProps<typeof Link>, 'href'>;
347
- declare const TOTPLink: React.ForwardRefExoticComponent<Omit<Props$8, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
351
+ type Props$a = Omit<React.ComponentProps<typeof Link>, 'href'>;
352
+ declare const TOTPLink: React.ForwardRefExoticComponent<Omit<Props$a, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
348
353
 
349
- type Props$7 = {
354
+ type Props$9 = {
350
355
  title?: string;
351
356
  description?: string;
352
357
  icon?: string;
@@ -365,13 +370,13 @@ type Props$7 = {
365
370
  declare global {
366
371
  namespace JSX {
367
372
  interface IntrinsicElements {
368
- 'descope-upload-file': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$7;
373
+ 'descope-upload-file': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$9;
369
374
  }
370
375
  }
371
376
  }
372
- declare const UploadFile: React.ForwardRefExoticComponent<Props$7 & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
377
+ declare const UploadFile: React.ForwardRefExoticComponent<Props$9 & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
373
378
 
374
- type Props$6 = {
379
+ type Props$8 = {
375
380
  enabled?: boolean;
376
381
  'site-key'?: string;
377
382
  enterprise?: boolean;
@@ -383,20 +388,20 @@ declare global {
383
388
  }
384
389
  namespace JSX {
385
390
  interface IntrinsicElements {
386
- 'descope-recaptcha': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$6;
391
+ 'descope-recaptcha': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$8;
387
392
  }
388
393
  }
389
394
  }
390
- declare const Recaptcha: React.ForwardRefExoticComponent<Props$6 & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
395
+ declare const Recaptcha: React.ForwardRefExoticComponent<Props$8 & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
391
396
 
392
- type Props$5 = DescopeInputProps & {
397
+ type Props$7 = DescopeInputProps & {
393
398
  'default-value'?: string;
394
399
  'allow-deselect'?: boolean;
395
400
  };
396
401
  declare global {
397
402
  namespace JSX {
398
403
  interface IntrinsicElements {
399
- 'descope-button-selection-group': Props$5;
404
+ 'descope-button-selection-group': Props$7;
400
405
  'descope-button-selection-group-item': JSX.IntrinsicElements['span'] & {
401
406
  value: string;
402
407
  children: string;
@@ -411,19 +416,19 @@ declare const ButtonSelectionGroup: React.ForwardRefExoticComponent<Omit<HTMLInp
411
416
  children?: JSX.Element[];
412
417
  }, "ref"> & React.RefAttributes<HTMLInputElement>>;
413
418
 
414
- type Item = {
419
+ type Item$1 = {
415
420
  label: string;
416
421
  value: string;
417
422
  };
418
423
  type SingleSelectType = {
419
424
  variant?: 'buttonSelectionGroup' | 'combobox';
420
- data?: Item[];
425
+ data?: Item$1[];
421
426
  allowClearValue?: boolean;
422
427
  };
423
- type Props$4 = Omit<React.ComponentProps<typeof ButtonSelectionGroup>, 'allow-deselect'> & SingleSelectType;
424
- declare const SingleSelect: React.ForwardRefExoticComponent<Omit<Props$4, "ref"> & React.RefAttributes<HTMLInputElement>>;
428
+ type Props$6 = Omit<React.ComponentProps<typeof ButtonSelectionGroup>, 'allow-deselect'> & SingleSelectType;
429
+ declare const SingleSelect: React.ForwardRefExoticComponent<Omit<Props$6, "ref"> & React.RefAttributes<HTMLInputElement>>;
425
430
 
426
- type Props$3 = DescopeInputProps & {
431
+ type Props$5 = DescopeInputProps & {
427
432
  'default-value'?: string;
428
433
  'item-label-path'?: string;
429
434
  'item-value-path'?: string;
@@ -431,7 +436,7 @@ type Props$3 = DescopeInputProps & {
431
436
  declare global {
432
437
  namespace JSX {
433
438
  interface IntrinsicElements {
434
- 'descope-combobox': Props$3;
439
+ 'descope-combobox': Props$5;
435
440
  }
436
441
  }
437
442
  }
@@ -453,7 +458,7 @@ type Column = {
453
458
  resizable: boolean;
454
459
  };
455
460
  };
456
- type Props$2 = {
461
+ type Props$4 = {
457
462
  identifier: any;
458
463
  children?: JSX.Element[];
459
464
  size?: Omit<ComponentSize, 'xl'>;
@@ -469,7 +474,7 @@ declare global {
469
474
  }
470
475
  }
471
476
  }
472
- declare const Grid: React.ForwardRefExoticComponent<Props$2 & React.RefAttributes<HTMLInputElement>>;
477
+ declare const Grid: React.ForwardRefExoticComponent<Props$4 & React.RefAttributes<HTMLInputElement>>;
473
478
 
474
479
  type ColumnProps = {
475
480
  sortable?: boolean;
@@ -509,7 +514,7 @@ declare global {
509
514
  }
510
515
  declare const GridTextColumn: React.ForwardRefExoticComponent<ColumnProps & React.RefAttributes<HTMLInputElement>>;
511
516
 
512
- type Props$1 = {
517
+ type Props$3 = {
513
518
  mode?: string;
514
519
  size?: string;
515
520
  bordered?: boolean;
@@ -518,11 +523,11 @@ type Props$1 = {
518
523
  declare global {
519
524
  namespace JSX {
520
525
  interface IntrinsicElements {
521
- 'descope-badge': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$1;
526
+ 'descope-badge': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$3;
522
527
  }
523
528
  }
524
529
  }
525
- declare const Badge: React.ForwardRefExoticComponent<Props$1 & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
530
+ declare const Badge: React.ForwardRefExoticComponent<Props$3 & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
526
531
 
527
532
  declare global {
528
533
  namespace JSX {
@@ -531,9 +536,48 @@ declare global {
531
536
  }
532
537
  }
533
538
  }
534
- type Props = {
539
+ type Props$2 = {
535
540
  opened?: boolean;
536
541
  };
537
- declare const Modal: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
542
+ declare const Modal: React.ForwardRefExoticComponent<Props$2 & React.RefAttributes<HTMLDivElement>>;
543
+
544
+ type Props$1 = DescopeInputProps & {
545
+ size?: 'xs' | 'sm' | 'md' | 'lg';
546
+ 'min-items-selection'?: number;
547
+ 'max-items-selection'?: number;
548
+ };
549
+ declare global {
550
+ namespace JSX {
551
+ interface IntrinsicElements {
552
+ 'descope-button-multi-selection-group': Props$1 & {
553
+ 'default-values'?: string;
554
+ };
555
+ 'descope-button-selection-group-item': JSX.IntrinsicElements['span'] & {
556
+ value: string;
557
+ children: string;
558
+ };
559
+ }
560
+ }
561
+ }
562
+ declare const ButtonMultiSelectionGroup: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & {
563
+ size?: 'xs' | 'sm' | 'md' | 'lg';
564
+ 'min-items-selection'?: number;
565
+ 'max-items-selection'?: number;
566
+ } & MultiSelectProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
567
+
568
+ type Item = {
569
+ label: string;
570
+ value: string;
571
+ };
572
+ type MultiSelectType = {
573
+ variant?: 'buttonSelectionGroup' | 'combobox' | 'dynamicCombobox';
574
+ data?: Item[];
575
+ 'min-items-selection'?: number;
576
+ 'max-items-selection'?: number;
577
+ };
578
+ type Props = Omit<React.ComponentProps<typeof ButtonMultiSelectionGroup>, 'default-values'> & MultiSelectType & {
579
+ 'default-values'?: string[];
580
+ };
581
+ declare const MultiSelect: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
538
582
 
539
- export { Badge, Boolean, Button, Checkbox, Code, ComboBox, Container, Divider, Grid, GridCustomColumn, GridSelectionColumn, GridTextColumn, Image, Input, Link, Loader, Logo, Modal, NewPassword, NumberField, Password, Phone, Recaptcha, Select, SingleSelect, Switch, TOTPImage, TOTPLink, Text, TextField, Textarea, UploadFile, _default$b as apple, _default$2 as discord, _default$a as facebook, _default$8 as fingerprint, _default$6 as github, _default$5 as gitlab, _default$4 as google, _default$1 as linkedin, _default$3 as microsoft, _default$7 as passkey, _default$9 as slack, _default as sso };
583
+ export { Badge, Boolean, Button, Checkbox, Code, ComboBox, Container, Divider, Grid, GridCustomColumn, GridSelectionColumn, GridTextColumn, Image, Input, Link, Loader, Logo, Modal, MultiSelect, NewPassword, NumberField, Password, Phone, Recaptcha, Select, SingleSelect, Switch, TOTPImage, TOTPLink, Text, TextField, Textarea, UploadFile, _default$b as apple, _default$2 as discord, _default$a as facebook, _default$8 as fingerprint, _default$6 as github, _default$5 as gitlab, _default$4 as google, _default$1 as linkedin, _default$3 as microsoft, _default$7 as passkey, _default$9 as slack, _default as sso };
package/dist/index.esm.js CHANGED
@@ -280,6 +280,58 @@ const GridTextColumn = React.forwardRef((props, ref) => React.createElement("des
280
280
 
281
281
  const Badge = React.forwardRef((props, ref) => React.createElement("descope-badge", { ...props, ref: ref }));
282
282
 
283
- const Modal = React.forwardRef((props, ref) => React.createElement("descope-modal", { ...props, ref: ref }));
283
+ const Modal = React.forwardRef((props, ref) => (React.createElement("descope-modal", { ...props, ref: ref })));
284
284
 
285
- export { Badge, Boolean, Button, Checkbox, Code, ComboBox, Container, Divider, Grid, GridCustomColumn, GridSelectionColumn, GridTextColumn, Image, Input, Link, Loader, Logo, Modal, NewPassword, NumberField, Password, Phone, Recaptcha, Select, SingleSelect, Switch, TOTPImage, TOTPLink, Text, TextField, Textarea, UploadFile, apple, discord, facebook, fingerprint, github, gitlab, google, linkedin, microsoft, passkey, slack, sso };
285
+ const ButtonMultiSelectionGroup = React.forwardRef(({ 'default-values': defaultValues, ...props }, ref) => {
286
+ const serializedDefaultValues = useMemo(() => {
287
+ if (!defaultValues)
288
+ return undefined;
289
+ try {
290
+ return JSON.stringify(defaultValues);
291
+ }
292
+ catch (e) {
293
+ // eslint-disable-next-line no-console
294
+ console.error('could not parse data string from attribute "default-values" -', e.message);
295
+ return '';
296
+ }
297
+ }, [defaultValues]);
298
+ return (React.createElement("descope-button-multi-selection-group", { ...props, "default-values": serializedDefaultValues ?? undefined, ref: ref }));
299
+ });
300
+ ButtonMultiSelectionGroup.defaultProps = {
301
+ // eslint-disable-next-line react/default-props-match-prop-types
302
+ size: 'md'
303
+ };
304
+
305
+ const MultiSelectComboBox = React.forwardRef(({ 'default-values': defaultValues, ...props }, ref) => {
306
+ const serializedDefaultValues = useMemo(() => {
307
+ if (!defaultValues)
308
+ return undefined;
309
+ try {
310
+ return JSON.stringify(defaultValues);
311
+ }
312
+ catch (e) {
313
+ // eslint-disable-next-line no-console
314
+ console.error('could not parse data string from attribute "default-values" -', e.message);
315
+ return '';
316
+ }
317
+ }, [defaultValues]);
318
+ return (React.createElement("descope-multi-select-combo-box", { ...props, "clear-button-visible": "true", "item-label-path": "data-name", "item-value-path": "data-id", "default-values": serializedDefaultValues ?? undefined, ref: ref }));
319
+ });
320
+ MultiSelectComboBox.defaultProps = {
321
+ // eslint-disable-next-line react/default-props-match-prop-types
322
+ size: 'md',
323
+ // eslint-disable-next-line react/default-props-match-prop-types
324
+ bordered: true
325
+ };
326
+
327
+ const MultiSelect = React.forwardRef(({ variant, data, ...props }, ref) => {
328
+ if (variant === 'dynamicCombobox') {
329
+ return (React.createElement(MultiSelectComboBox, { ...props, "allow-custom-value": "true", data: "[]", ref: ref }));
330
+ }
331
+ if (variant === 'buttonSelectionGroup') {
332
+ return (React.createElement(ButtonMultiSelectionGroup, { ...props, ref: ref }, data?.map(({ label, value }) => (React.createElement("descope-button-selection-group-item", { key: value, value: value }, label)))));
333
+ }
334
+ return (React.createElement(MultiSelectComboBox, { ...props, "allow-custom-value": "false", ref: ref }, data?.map(({ label, value }) => (React.createElement("span", { "data-name": label, "data-id": value, key: value }, label)))));
335
+ });
336
+
337
+ export { Badge, Boolean, Button, Checkbox, Code, ComboBox, Container, Divider, Grid, GridCustomColumn, GridSelectionColumn, GridTextColumn, Image, Input, Link, Loader, Logo, Modal, MultiSelect, NewPassword, NumberField, Password, Phone, Recaptcha, Select, SingleSelect, Switch, TOTPImage, TOTPLink, Text, TextField, Textarea, UploadFile, apple, discord, facebook, fingerprint, github, gitlab, google, linkedin, microsoft, passkey, slack, sso };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/flow-components",
3
- "version": "2.0.197",
3
+ "version": "2.0.199",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -36,8 +36,8 @@
36
36
  ]
37
37
  },
38
38
  "devDependencies": {
39
- "@babel/core": "7.23.7",
40
- "@babel/preset-env": "7.23.8",
39
+ "@babel/core": "7.23.9",
40
+ "@babel/preset-env": "7.23.9",
41
41
  "@babel/preset-react": "7.23.3",
42
42
  "@babel/preset-typescript": "7.23.3",
43
43
  "@rollup/plugin-commonjs": "^25.0.0",
@@ -79,7 +79,7 @@
79
79
  "eslint-plugin-promise": "6.1.1",
80
80
  "eslint-plugin-react": "^7.30.1",
81
81
  "eslint-plugin-testing-library": "^6.0.0",
82
- "husky": "^8.0.1",
82
+ "husky": "^9.0.0",
83
83
  "jest": "^29.0.0",
84
84
  "jest-environment-jsdom": "29.7.0",
85
85
  "lint-staged": "^15.0.0",
@@ -100,7 +100,7 @@
100
100
  "rollup-plugin-dts": "^6.0.0"
101
101
  },
102
102
  "dependencies": {
103
- "@descope/web-components-ui": "1.0.248"
103
+ "@descope/web-components-ui": "1.0.251"
104
104
  },
105
105
  "peerDependencies": {
106
106
  "react": ">=17"