@descope/flow-components 2.0.228 → 2.0.230

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
@@ -352,6 +352,38 @@ const MultiSelect = React__default.default.forwardRef(({ variant, data, ...props
352
352
  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)))));
353
353
  });
354
354
 
355
+ const MappingsField = React__default.default.forwardRef(({ 'default-values': defaultValues, options, ...props }, ref) => {
356
+ const serializedDefaultValues = React.useMemo(() => {
357
+ if (!defaultValues)
358
+ return undefined;
359
+ try {
360
+ return JSON.stringify(defaultValues);
361
+ }
362
+ catch (e) {
363
+ // eslint-disable-next-line no-console
364
+ console.error('could not parse data string from attribute "default-values" -', e.message);
365
+ return '';
366
+ }
367
+ }, [defaultValues]);
368
+ const serializedOptions = React.useMemo(() => {
369
+ if (!options)
370
+ return undefined;
371
+ try {
372
+ return JSON.stringify(options);
373
+ }
374
+ catch (e) {
375
+ // eslint-disable-next-line no-console
376
+ console.error('could not parse data string from attribute "options" -', e.message);
377
+ return '';
378
+ }
379
+ }, [options]);
380
+ return (React__default.default.createElement("descope-mappings-field", { ...props, "default-values": serializedDefaultValues ?? undefined, options: serializedOptions ?? undefined, ref: ref }));
381
+ });
382
+ MappingsField.defaultProps = {
383
+ // eslint-disable-next-line react/default-props-match-prop-types
384
+ size: 'md'
385
+ };
386
+
355
387
  exports.Badge = Badge;
356
388
  exports.Boolean = Boolean;
357
389
  exports.Button = Button;
@@ -369,6 +401,7 @@ exports.Input = Input;
369
401
  exports.Link = Link;
370
402
  exports.Loader = Loader;
371
403
  exports.Logo = Logo;
404
+ exports.MappingsField = MappingsField;
372
405
  exports.Modal = Modal;
373
406
  exports.MultiSelect = MultiSelect;
374
407
  exports.NOTPImage = NOTPImage;
package/dist/index.d.ts CHANGED
@@ -49,8 +49,8 @@ declare const Switch: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "r
49
49
  type BooleanType = {
50
50
  type: 'switch' | 'checkbox';
51
51
  };
52
- type Props$p = React.ComponentProps<typeof Checkbox> & React.ComponentProps<typeof Switch> & BooleanType;
53
- declare const Boolean: React.ForwardRefExoticComponent<Omit<Props$p, "ref"> & React.RefAttributes<HTMLInputElement>>;
52
+ type Props$q = React.ComponentProps<typeof Checkbox> & React.ComponentProps<typeof Switch> & BooleanType;
53
+ declare const Boolean: React.ForwardRefExoticComponent<Omit<Props$q, "ref"> & React.RefAttributes<HTMLInputElement>>;
54
54
 
55
55
  declare global {
56
56
  namespace JSX {
@@ -72,17 +72,17 @@ declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes
72
72
  'full-width'?: boolean;
73
73
  }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
74
74
 
75
- type Props$o = {
75
+ type Props$p = {
76
76
  digits?: number;
77
77
  };
78
78
  declare global {
79
79
  namespace JSX {
80
80
  interface IntrinsicElements {
81
- 'descope-passcode': DescopeInputProps & Props$o;
81
+ 'descope-passcode': DescopeInputProps & Props$p;
82
82
  }
83
83
  }
84
84
  }
85
- declare const Code: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$o, "ref"> & React.RefAttributes<HTMLInputElement>>;
85
+ declare const Code: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$p, "ref"> & React.RefAttributes<HTMLInputElement>>;
86
86
 
87
87
  type Never<T extends Record<string, any>> = {
88
88
  [K in keyof T]: never;
@@ -98,7 +98,7 @@ type ContainerAlignment = {
98
98
  'vertical-alignment'?: FlexAlignment;
99
99
  'space-between'?: 'sm' | 'md' | 'lg';
100
100
  };
101
- type Props$n = {
101
+ type Props$o = {
102
102
  direction?: 'row' | 'column';
103
103
  shadow?: 'md' | 'lg' | 'xl' | '2xl';
104
104
  'border-radius'?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
@@ -114,9 +114,9 @@ declare global {
114
114
  }
115
115
  }
116
116
  }
117
- declare const Container: React.ForwardRefExoticComponent<(Props$n & React.HTMLAttributes<HTMLDivElement>) & React.RefAttributes<HTMLDivElement>>;
117
+ declare const Container: React.ForwardRefExoticComponent<(Props$o & React.HTMLAttributes<HTMLDivElement>) & React.RefAttributes<HTMLDivElement>>;
118
118
 
119
- type Props$m = {
119
+ type Props$n = {
120
120
  vertical?: boolean;
121
121
  italic?: boolean;
122
122
  variant?: TypographyVariants;
@@ -126,11 +126,11 @@ type Props$m = {
126
126
  declare global {
127
127
  namespace JSX {
128
128
  interface IntrinsicElements {
129
- 'descope-divider': React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & Omit<Props$m, 'children'>;
129
+ 'descope-divider': React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & Omit<Props$n, 'children'>;
130
130
  }
131
131
  }
132
132
  }
133
- declare const Divider: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "size"> & Props$m, "ref"> & React.RefAttributes<HTMLDivElement>>;
133
+ declare const Divider: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "size"> & Props$n, "ref"> & React.RefAttributes<HTMLDivElement>>;
134
134
 
135
135
  declare const _default$b: ({ noColor }: {
136
136
  noColor: any;
@@ -180,7 +180,7 @@ declare const _default: ({ noColor }: {
180
180
  noColor: any;
181
181
  }) => React.JSX.Element;
182
182
 
183
- type Props$l = {
183
+ type Props$m = {
184
184
  width?: string;
185
185
  height?: string;
186
186
  alt?: string;
@@ -189,15 +189,15 @@ type Props$l = {
189
189
  declare global {
190
190
  namespace JSX {
191
191
  interface IntrinsicElements {
192
- 'descope-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$l;
192
+ 'descope-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$m;
193
193
  }
194
194
  }
195
195
  }
196
- declare const Image: React.ForwardRefExoticComponent<Props$l & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
196
+ declare const Image: React.ForwardRefExoticComponent<Props$m & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
197
197
 
198
198
  declare const Input: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
199
199
 
200
- type Props$k = {
200
+ type Props$l = {
201
201
  href?: string | undefined;
202
202
  italic?: boolean;
203
203
  variant?: TypographyVariants;
@@ -209,18 +209,18 @@ type Props$k = {
209
209
  declare global {
210
210
  namespace JSX {
211
211
  interface IntrinsicElements {
212
- 'descope-link': React.DetailedHTMLProps<React.HTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & Omit<Props$k, 'children'>;
212
+ 'descope-link': React.DetailedHTMLProps<React.HTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & Omit<Props$l, 'children'>;
213
213
  }
214
214
  }
215
215
  }
216
- declare const Link: React.ForwardRefExoticComponent<Props$k & React.RefAttributes<HTMLAnchorElement>>;
216
+ declare const Link: React.ForwardRefExoticComponent<Props$l & React.RefAttributes<HTMLAnchorElement>>;
217
217
 
218
- type Props$j = {
218
+ type Props$k = {
219
219
  variant?: 'linear' | 'radial';
220
220
  size?: 'xs' | 'sm' | 'md' | 'lg';
221
221
  color?: Mode;
222
222
  };
223
- type LoaderType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$j>;
223
+ type LoaderType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$k>;
224
224
  declare global {
225
225
  namespace JSX {
226
226
  interface IntrinsicElements {
@@ -229,22 +229,22 @@ declare global {
229
229
  }
230
230
  }
231
231
  }
232
- declare const Loader: React.ForwardRefExoticComponent<Props$j & React.RefAttributes<HTMLDivElement>>;
232
+ declare const Loader: React.ForwardRefExoticComponent<Props$k & React.RefAttributes<HTMLDivElement>>;
233
233
 
234
- type Props$i = {
234
+ type Props$j = {
235
235
  width?: string;
236
236
  height?: string;
237
237
  };
238
238
  declare global {
239
239
  namespace JSX {
240
240
  interface IntrinsicElements {
241
- 'descope-logo': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$i>;
241
+ 'descope-logo': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$j>;
242
242
  }
243
243
  }
244
244
  }
245
- declare const Logo: React.ForwardRefExoticComponent<Props$i & React.RefAttributes<HTMLDivElement>>;
245
+ declare const Logo: React.ForwardRefExoticComponent<Props$j & React.RefAttributes<HTMLDivElement>>;
246
246
 
247
- type Props$h = {
247
+ type Props$i = {
248
248
  'password-label'?: string;
249
249
  'password-placeholder'?: string;
250
250
  'confirm-label'?: string;
@@ -254,11 +254,11 @@ type Props$h = {
254
254
  declare global {
255
255
  namespace JSX {
256
256
  interface IntrinsicElements {
257
- 'descope-new-password': DescopeInputProps & Props$h;
257
+ 'descope-new-password': DescopeInputProps & Props$i;
258
258
  }
259
259
  }
260
260
  }
261
- declare const NewPassword: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$h, "ref"> & React.RefAttributes<HTMLInputElement>>;
261
+ declare const NewPassword: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$i, "ref"> & React.RefAttributes<HTMLInputElement>>;
262
262
 
263
263
  declare global {
264
264
  namespace JSX {
@@ -278,16 +278,16 @@ declare global {
278
278
  }
279
279
  declare const Password: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
280
280
 
281
- type Props$g = {
281
+ type Props$h = {
282
282
  variant: 'countrySelection' | 'inputBox';
283
283
  'default-code'?: string;
284
284
  'phone-input-placeholder'?: string;
285
285
  'country-input-placeholder'?: string;
286
286
  'restrict-countries'?: string;
287
287
  } & DescopeInputProps;
288
- declare const Phone: React.ForwardRefExoticComponent<Omit<Props$g, "ref"> & React.RefAttributes<HTMLInputElement>>;
288
+ declare const Phone: React.ForwardRefExoticComponent<Omit<Props$h, "ref"> & React.RefAttributes<HTMLInputElement>>;
289
289
 
290
- type Props$f = {
290
+ type Props$g = {
291
291
  children?: JSX.Element[];
292
292
  data?: string | Record<string, string>[];
293
293
  };
@@ -300,9 +300,9 @@ declare global {
300
300
  }
301
301
  }
302
302
  }
303
- declare const Select: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$f, "ref"> & React.RefAttributes<HTMLInputElement>>;
303
+ declare const Select: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$g, "ref"> & React.RefAttributes<HTMLInputElement>>;
304
304
 
305
- type Props$e = {
305
+ type Props$f = {
306
306
  italic?: boolean;
307
307
  variant?: string;
308
308
  mode?: string;
@@ -312,11 +312,11 @@ type Props$e = {
312
312
  declare global {
313
313
  namespace JSX {
314
314
  interface IntrinsicElements {
315
- 'descope-text': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$e;
315
+ 'descope-text': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$f;
316
316
  }
317
317
  }
318
318
  }
319
- declare const Text: React.ForwardRefExoticComponent<Omit<Props$e & {
319
+ declare const Text: React.ForwardRefExoticComponent<Omit<Props$f & {
320
320
  typography?: TypographyVariants;
321
321
  } & Omit<React.HTMLProps<HTMLSpanElement>, "mode">, "ref"> & React.RefAttributes<HTMLElement>>;
322
322
 
@@ -338,39 +338,39 @@ declare global {
338
338
  }
339
339
  declare const TextField: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
340
340
 
341
- type Props$d = {
341
+ type Props$e = {
342
342
  width?: string;
343
343
  height?: string;
344
344
  };
345
345
  declare global {
346
346
  namespace JSX {
347
347
  interface IntrinsicElements {
348
- 'descope-totp-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$d>;
348
+ 'descope-totp-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$e>;
349
349
  }
350
350
  }
351
351
  }
352
- declare const TOTPImage: React.ForwardRefExoticComponent<Props$d & React.RefAttributes<HTMLDivElement>>;
352
+ declare const TOTPImage: React.ForwardRefExoticComponent<Props$e & React.RefAttributes<HTMLDivElement>>;
353
353
 
354
- type Props$c = Omit<React.ComponentProps<typeof Link>, 'href'>;
355
- declare const TOTPLink: React.ForwardRefExoticComponent<Omit<Props$c, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
354
+ type Props$d = Omit<React.ComponentProps<typeof Link>, 'href'>;
355
+ declare const TOTPLink: React.ForwardRefExoticComponent<Omit<Props$d, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
356
356
 
357
- type Props$b = {
357
+ type Props$c = {
358
358
  width?: string;
359
359
  height?: string;
360
360
  };
361
361
  declare global {
362
362
  namespace JSX {
363
363
  interface IntrinsicElements {
364
- 'descope-notp-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$b>;
364
+ 'descope-notp-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$c>;
365
365
  }
366
366
  }
367
367
  }
368
- declare const NOTPImage: React.ForwardRefExoticComponent<Props$b & React.RefAttributes<HTMLDivElement>>;
368
+ declare const NOTPImage: React.ForwardRefExoticComponent<Props$c & React.RefAttributes<HTMLDivElement>>;
369
369
 
370
- type Props$a = Omit<React.ComponentProps<typeof Link>, 'href'>;
371
- declare const NOTPLink: React.ForwardRefExoticComponent<Omit<Props$a, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
370
+ type Props$b = Omit<React.ComponentProps<typeof Link>, 'href'>;
371
+ declare const NOTPLink: React.ForwardRefExoticComponent<Omit<Props$b, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
372
372
 
373
- type Props$9 = {
373
+ type Props$a = {
374
374
  title?: string;
375
375
  description?: string;
376
376
  icon?: string;
@@ -389,13 +389,13 @@ type Props$9 = {
389
389
  declare global {
390
390
  namespace JSX {
391
391
  interface IntrinsicElements {
392
- 'descope-upload-file': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$9;
392
+ 'descope-upload-file': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$a;
393
393
  }
394
394
  }
395
395
  }
396
- declare const UploadFile: React.ForwardRefExoticComponent<Props$9 & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
396
+ declare const UploadFile: React.ForwardRefExoticComponent<Props$a & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
397
397
 
398
- type Props$8 = {
398
+ type Props$9 = {
399
399
  enabled?: boolean;
400
400
  'site-key'?: string;
401
401
  enterprise?: boolean;
@@ -407,20 +407,20 @@ declare global {
407
407
  }
408
408
  namespace JSX {
409
409
  interface IntrinsicElements {
410
- 'descope-recaptcha': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$8;
410
+ 'descope-recaptcha': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$9;
411
411
  }
412
412
  }
413
413
  }
414
- declare const Recaptcha: React.ForwardRefExoticComponent<Props$8 & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
414
+ declare const Recaptcha: React.ForwardRefExoticComponent<Props$9 & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
415
415
 
416
- type Props$7 = DescopeInputProps & {
416
+ type Props$8 = DescopeInputProps & {
417
417
  'default-value'?: string;
418
418
  'allow-deselect'?: boolean;
419
419
  };
420
420
  declare global {
421
421
  namespace JSX {
422
422
  interface IntrinsicElements {
423
- 'descope-button-selection-group': Props$7;
423
+ 'descope-button-selection-group': Props$8;
424
424
  'descope-button-selection-group-item': JSX.IntrinsicElements['span'] & {
425
425
  value: string;
426
426
  children: string;
@@ -435,19 +435,19 @@ declare const ButtonSelectionGroup: React.ForwardRefExoticComponent<Omit<HTMLInp
435
435
  children?: JSX.Element[];
436
436
  }, "ref"> & React.RefAttributes<HTMLInputElement>>;
437
437
 
438
- type Item$1 = {
438
+ type Item$2 = {
439
439
  label: string;
440
440
  value: string;
441
441
  };
442
442
  type SingleSelectType = {
443
443
  variant?: 'buttonSelectionGroup' | 'combobox';
444
- data?: Item$1[];
444
+ data?: Item$2[];
445
445
  allowClearValue?: boolean;
446
446
  };
447
- type Props$6 = Omit<React.ComponentProps<typeof ButtonSelectionGroup>, 'allow-deselect'> & SingleSelectType;
448
- declare const SingleSelect: React.ForwardRefExoticComponent<Omit<Props$6, "ref"> & React.RefAttributes<HTMLInputElement>>;
447
+ type Props$7 = Omit<React.ComponentProps<typeof ButtonSelectionGroup>, 'allow-deselect'> & SingleSelectType;
448
+ declare const SingleSelect: React.ForwardRefExoticComponent<Omit<Props$7, "ref"> & React.RefAttributes<HTMLInputElement>>;
449
449
 
450
- type Props$5 = DescopeInputProps & {
450
+ type Props$6 = DescopeInputProps & {
451
451
  'default-value'?: string;
452
452
  'item-label-path'?: string;
453
453
  'item-value-path'?: string;
@@ -455,7 +455,7 @@ type Props$5 = DescopeInputProps & {
455
455
  declare global {
456
456
  namespace JSX {
457
457
  interface IntrinsicElements {
458
- 'descope-combobox': Props$5;
458
+ 'descope-combobox': Props$6;
459
459
  }
460
460
  }
461
461
  }
@@ -477,7 +477,7 @@ type Column = {
477
477
  resizable: boolean;
478
478
  };
479
479
  };
480
- type Props$4 = {
480
+ type Props$5 = {
481
481
  identifier: any;
482
482
  children?: JSX.Element[];
483
483
  size?: Omit<ComponentSize, 'xl'>;
@@ -493,7 +493,7 @@ declare global {
493
493
  }
494
494
  }
495
495
  }
496
- declare const Grid: React.ForwardRefExoticComponent<Props$4 & React.RefAttributes<HTMLInputElement>>;
496
+ declare const Grid: React.ForwardRefExoticComponent<Props$5 & React.RefAttributes<HTMLInputElement>>;
497
497
 
498
498
  type ColumnProps = {
499
499
  sortable?: boolean;
@@ -533,7 +533,7 @@ declare global {
533
533
  }
534
534
  declare const GridTextColumn: React.ForwardRefExoticComponent<ColumnProps & React.RefAttributes<HTMLInputElement>>;
535
535
 
536
- type Props$3 = {
536
+ type Props$4 = {
537
537
  mode?: string;
538
538
  size?: string;
539
539
  bordered?: boolean;
@@ -542,11 +542,11 @@ type Props$3 = {
542
542
  declare global {
543
543
  namespace JSX {
544
544
  interface IntrinsicElements {
545
- 'descope-badge': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$3;
545
+ 'descope-badge': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$4;
546
546
  }
547
547
  }
548
548
  }
549
- declare const Badge: React.ForwardRefExoticComponent<Props$3 & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
549
+ declare const Badge: React.ForwardRefExoticComponent<Props$4 & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
550
550
 
551
551
  declare global {
552
552
  namespace JSX {
@@ -555,12 +555,12 @@ declare global {
555
555
  }
556
556
  }
557
557
  }
558
- type Props$2 = {
558
+ type Props$3 = {
559
559
  opened?: boolean;
560
560
  };
561
- declare const Modal: React.ForwardRefExoticComponent<Props$2 & React.RefAttributes<HTMLDivElement>>;
561
+ declare const Modal: React.ForwardRefExoticComponent<Props$3 & React.RefAttributes<HTMLDivElement>>;
562
562
 
563
- type Props$1 = DescopeInputProps & {
563
+ type Props$2 = DescopeInputProps & {
564
564
  size?: 'xs' | 'sm' | 'md' | 'lg';
565
565
  'min-items-selection'?: number;
566
566
  'max-items-selection'?: number;
@@ -568,7 +568,7 @@ type Props$1 = DescopeInputProps & {
568
568
  declare global {
569
569
  namespace JSX {
570
570
  interface IntrinsicElements {
571
- 'descope-button-multi-selection-group': Props$1 & {
571
+ 'descope-button-multi-selection-group': Props$2 & {
572
572
  'default-values'?: string;
573
573
  };
574
574
  'descope-button-selection-group-item': JSX.IntrinsicElements['span'] & {
@@ -584,19 +584,44 @@ declare const ButtonMultiSelectionGroup: React.ForwardRefExoticComponent<Omit<HT
584
584
  'max-items-selection'?: number;
585
585
  } & MultiSelectProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
586
586
 
587
- type Item = {
587
+ type Item$1 = {
588
588
  label: string;
589
589
  value: string;
590
590
  };
591
591
  type MultiSelectType = {
592
592
  variant?: 'buttonSelectionGroup' | 'combobox' | 'dynamicCombobox';
593
- data?: Item[];
593
+ data?: Item$1[];
594
594
  'min-items-selection'?: number;
595
595
  'max-items-selection'?: number;
596
596
  };
597
- type Props = Omit<React.ComponentProps<typeof ButtonMultiSelectionGroup>, 'default-values'> & MultiSelectType & {
597
+ type Props$1 = Omit<React.ComponentProps<typeof ButtonMultiSelectionGroup>, 'default-values'> & MultiSelectType & {
598
598
  'default-values'?: string[];
599
599
  };
600
- declare const MultiSelect: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
600
+ declare const MultiSelect: React.ForwardRefExoticComponent<Omit<Props$1, "ref"> & React.RefAttributes<HTMLInputElement>>;
601
+
602
+ type Item = {
603
+ label: string;
604
+ value: string;
605
+ };
606
+ type Props = Omit<DescopeInputProps, 'bordered' | 'label' | 'placeholder' | 'helper-text' | 'data-errormessage-pattern-mismatch' | 'data-errormessage-value-missing'> & {
607
+ 'label-value'?: string;
608
+ 'label-attr'?: string;
609
+ 'button-label'?: string;
610
+ separator?: string;
611
+ size?: 'xs' | 'sm' | 'md' | 'lg';
612
+ 'default-values'?: Record<string, string>[];
613
+ options?: Item[];
614
+ };
615
+ declare global {
616
+ namespace JSX {
617
+ interface IntrinsicElements {
618
+ 'descope-mappings-field': Omit<Props, 'default-values' | 'options'> & {
619
+ 'default-values'?: string;
620
+ options?: string;
621
+ };
622
+ }
623
+ }
624
+ }
625
+ declare const MappingsField: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
601
626
 
602
- export { Badge, Boolean, Button, Checkbox, Code, ComboBox, Container, Divider, Grid, GridCustomColumn, GridSelectionColumn, GridTextColumn, Image, Input, Link, Loader, Logo, Modal, MultiSelect, NOTPImage, NOTPLink, 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 };
627
+ export { Badge, Boolean, Button, Checkbox, Code, ComboBox, Container, Divider, Grid, GridCustomColumn, GridSelectionColumn, GridTextColumn, Image, Input, Link, Loader, Logo, MappingsField, Modal, MultiSelect, NOTPImage, NOTPLink, 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
@@ -346,4 +346,36 @@ const MultiSelect = React.forwardRef(({ variant, data, ...props }, ref) => {
346
346
  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)))));
347
347
  });
348
348
 
349
- export { Badge, Boolean, Button, Checkbox, Code, ComboBox, Container, Divider, Grid, GridCustomColumn, GridSelectionColumn, GridTextColumn, Image, Input, Link, Loader, Logo, Modal, MultiSelect, NOTPImage, NOTPLink, 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 };
349
+ const MappingsField = React.forwardRef(({ 'default-values': defaultValues, options, ...props }, ref) => {
350
+ const serializedDefaultValues = useMemo(() => {
351
+ if (!defaultValues)
352
+ return undefined;
353
+ try {
354
+ return JSON.stringify(defaultValues);
355
+ }
356
+ catch (e) {
357
+ // eslint-disable-next-line no-console
358
+ console.error('could not parse data string from attribute "default-values" -', e.message);
359
+ return '';
360
+ }
361
+ }, [defaultValues]);
362
+ const serializedOptions = useMemo(() => {
363
+ if (!options)
364
+ return undefined;
365
+ try {
366
+ return JSON.stringify(options);
367
+ }
368
+ catch (e) {
369
+ // eslint-disable-next-line no-console
370
+ console.error('could not parse data string from attribute "options" -', e.message);
371
+ return '';
372
+ }
373
+ }, [options]);
374
+ return (React.createElement("descope-mappings-field", { ...props, "default-values": serializedDefaultValues ?? undefined, options: serializedOptions ?? undefined, ref: ref }));
375
+ });
376
+ MappingsField.defaultProps = {
377
+ // eslint-disable-next-line react/default-props-match-prop-types
378
+ size: 'md'
379
+ };
380
+
381
+ export { Badge, Boolean, Button, Checkbox, Code, ComboBox, Container, Divider, Grid, GridCustomColumn, GridSelectionColumn, GridTextColumn, Image, Input, Link, Loader, Logo, MappingsField, Modal, MultiSelect, NOTPImage, NOTPLink, 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.228",
3
+ "version": "2.0.230",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -43,13 +43,13 @@
43
43
  "@rollup/plugin-commonjs": "^25.0.0",
44
44
  "@rollup/plugin-node-resolve": "^15.0.0",
45
45
  "@rollup/plugin-typescript": "^11.0.0",
46
- "@storybook/addon-actions": "^8.0.0",
47
- "@storybook/addon-essentials": "^8.0.0",
48
- "@storybook/addon-interactions": "^8.0.0",
49
- "@storybook/addon-links": "^8.0.0",
46
+ "@storybook/addon-actions": "^7.6.3",
47
+ "@storybook/addon-essentials": "^7.6.3",
48
+ "@storybook/addon-interactions": "^7.6.3",
49
+ "@storybook/addon-links": "^7.6.3",
50
50
  "@storybook/addon-postcss": "^2.0.0",
51
- "@storybook/react": "^8.0.0",
52
- "@storybook/react-webpack5": "^8.0.0",
51
+ "@storybook/react": "^7.6.3",
52
+ "@storybook/react-webpack5": "^7.6.3",
53
53
  "@storybook/testing-library": "^0.2.2",
54
54
  "@testing-library/jest-dom": "^6.0.0",
55
55
  "@testing-library/react": "14.2.1",
@@ -92,7 +92,7 @@
92
92
  "rollup-plugin-auto-external": "^2.0.0",
93
93
  "rollup-plugin-copy": "^3.4.0",
94
94
  "rollup-plugin-delete": "^2.0.0",
95
- "storybook": "^8.0.0",
95
+ "storybook": "^7.6.3",
96
96
  "storybook-addon-themes": "^6.1.0",
97
97
  "ts-jest": "^29.0.0",
98
98
  "ts-node": "10.9.2",
@@ -100,7 +100,7 @@
100
100
  "rollup-plugin-dts": "^6.0.0"
101
101
  },
102
102
  "dependencies": {
103
- "@descope/web-components-ui": "1.0.286"
103
+ "@descope/web-components-ui": "1.0.287"
104
104
  },
105
105
  "peerDependencies": {
106
106
  "react": ">=17"