@descope/flow-components 2.0.117 → 2.0.118

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
@@ -247,6 +247,31 @@ const UploadFile = React__default.default.forwardRef((props, ref) => React__defa
247
247
 
248
248
  const Recaptcha = React__default.default.forwardRef((props, ref) => React__default.default.createElement("descope-recaptcha", { ref: ref, ...props }));
249
249
 
250
+ const ButtonSelectionGroup = React__default.default.forwardRef((props, ref) => React__default.default.createElement("descope-button-selection-group", { ...props, ref: ref }));
251
+ ButtonSelectionGroup.defaultProps = {
252
+ // eslint-disable-next-line react/default-props-match-prop-types
253
+ size: 'md'
254
+ };
255
+
256
+ const ComboBox = React__default.default.forwardRef((props, ref) => React__default.default.createElement("descope-combo-box", { ...props, ref: ref }));
257
+ ComboBox.defaultProps = {
258
+ // eslint-disable-next-line react/default-props-match-prop-types
259
+ size: 'md',
260
+ // eslint-disable-next-line react/default-props-match-prop-types
261
+ bordered: true
262
+ };
263
+
264
+ const SingleSelect = React__default.default.forwardRef(({ type, data, ...props }, ref) => {
265
+ switch (type) {
266
+ case 'button-selection-group':
267
+ return (React__default.default.createElement(ButtonSelectionGroup, { ...props, ref: ref }, data.map(({ label, value }) => (React__default.default.createElement("descope-button-selection-group-item", { value: value }, label)))));
268
+ case 'combobox':
269
+ return (React__default.default.createElement(ComboBox, { "item-label-path": "data-name", "item-value-path": "id", ...props, ref: ref }, data.map(({ label, value }) => (React__default.default.createElement("span", { "data-name": label, "data-id": value }, label)))));
270
+ default:
271
+ return null;
272
+ }
273
+ });
274
+
250
275
  exports.Boolean = Boolean;
251
276
  exports.Button = Button;
252
277
  exports.Checkbox = Checkbox;
@@ -264,6 +289,7 @@ exports.Password = Password;
264
289
  exports.Phone = Phone;
265
290
  exports.Recaptcha = Recaptcha;
266
291
  exports.Select = Select;
292
+ exports.SingleSelect = SingleSelect;
267
293
  exports.Switch = Switch;
268
294
  exports.TOTPImage = TOTPImage;
269
295
  exports.TOTPLink = TOTPLink;
package/dist/index.d.ts CHANGED
@@ -44,8 +44,8 @@ declare const Switch: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "r
44
44
  type BooleanType = {
45
45
  type: 'switch' | 'checkbox';
46
46
  };
47
- type Props$f = React.ComponentProps<typeof Checkbox> & React.ComponentProps<typeof Switch> & BooleanType;
48
- declare const Boolean: React.ForwardRefExoticComponent<Omit<Props$f, "ref"> & React.RefAttributes<HTMLInputElement>>;
47
+ type Props$h = React.ComponentProps<typeof Checkbox> & React.ComponentProps<typeof Switch> & BooleanType;
48
+ declare const Boolean: React.ForwardRefExoticComponent<Omit<Props$h, "ref"> & React.RefAttributes<HTMLInputElement>>;
49
49
 
50
50
  declare global {
51
51
  namespace JSX {
@@ -67,17 +67,17 @@ declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes
67
67
  'full-width'?: boolean;
68
68
  }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
69
69
 
70
- type Props$e = {
70
+ type Props$g = {
71
71
  digits?: number;
72
72
  };
73
73
  declare global {
74
74
  namespace JSX {
75
75
  interface IntrinsicElements {
76
- 'descope-passcode': DescopeInputProps & Props$e;
76
+ 'descope-passcode': DescopeInputProps & Props$g;
77
77
  }
78
78
  }
79
79
  }
80
- declare const Code: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$e, "ref"> & React.RefAttributes<HTMLInputElement>>;
80
+ declare const Code: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$g, "ref"> & React.RefAttributes<HTMLInputElement>>;
81
81
 
82
82
  type Never<T extends Record<string, any>> = {
83
83
  [K in keyof T]: never;
@@ -93,7 +93,7 @@ type ContainerAlignment = {
93
93
  'vertical-alignment'?: FlexAlignment;
94
94
  'space-between'?: 'sm' | 'md' | 'lg';
95
95
  };
96
- type Props$d = {
96
+ type Props$f = {
97
97
  direction?: 'row' | 'column';
98
98
  shadow?: 'md' | 'lg' | 'xl' | '2xl';
99
99
  'border-radius'?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
@@ -109,9 +109,9 @@ declare global {
109
109
  }
110
110
  }
111
111
  }
112
- declare const Container: React.ForwardRefExoticComponent<(Props$d & React.HTMLAttributes<HTMLDivElement>) & React.RefAttributes<HTMLDivElement>>;
112
+ declare const Container: React.ForwardRefExoticComponent<(Props$f & React.HTMLAttributes<HTMLDivElement>) & React.RefAttributes<HTMLDivElement>>;
113
113
 
114
- type Props$c = {
114
+ type Props$e = {
115
115
  vertical?: boolean;
116
116
  italic?: boolean;
117
117
  variant?: TypographyVariants;
@@ -121,11 +121,11 @@ type Props$c = {
121
121
  declare global {
122
122
  namespace JSX {
123
123
  interface IntrinsicElements {
124
- 'descope-divider': React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & Omit<Props$c, 'children'>;
124
+ 'descope-divider': React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & Omit<Props$e, 'children'>;
125
125
  }
126
126
  }
127
127
  }
128
- declare const Divider: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "size"> & Props$c, "ref"> & React.RefAttributes<HTMLDivElement>>;
128
+ declare const Divider: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "size"> & Props$e, "ref"> & React.RefAttributes<HTMLDivElement>>;
129
129
 
130
130
  declare const _default$b: ({ noColor }: {
131
131
  noColor: any;
@@ -175,7 +175,7 @@ declare const _default: ({ noColor }: {
175
175
  noColor: any;
176
176
  }) => React.JSX.Element;
177
177
 
178
- type Props$b = {
178
+ type Props$d = {
179
179
  width?: string;
180
180
  height?: string;
181
181
  alt?: string;
@@ -184,15 +184,15 @@ type Props$b = {
184
184
  declare global {
185
185
  namespace JSX {
186
186
  interface IntrinsicElements {
187
- 'descope-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$b;
187
+ 'descope-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$d;
188
188
  }
189
189
  }
190
190
  }
191
- declare const Image: React.ForwardRefExoticComponent<Props$b & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
191
+ declare const Image: React.ForwardRefExoticComponent<Props$d & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
192
192
 
193
193
  declare const Input: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
194
194
 
195
- type Props$a = {
195
+ type Props$c = {
196
196
  href?: string | undefined;
197
197
  italic?: boolean;
198
198
  variant?: TypographyVariants;
@@ -204,18 +204,18 @@ type Props$a = {
204
204
  declare global {
205
205
  namespace JSX {
206
206
  interface IntrinsicElements {
207
- 'descope-link': React.DetailedHTMLProps<React.HTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & Omit<Props$a, 'children'>;
207
+ 'descope-link': React.DetailedHTMLProps<React.HTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & Omit<Props$c, 'children'>;
208
208
  }
209
209
  }
210
210
  }
211
- declare const Link: React.ForwardRefExoticComponent<Props$a & React.RefAttributes<HTMLAnchorElement>>;
211
+ declare const Link: React.ForwardRefExoticComponent<Props$c & React.RefAttributes<HTMLAnchorElement>>;
212
212
 
213
- type Props$9 = {
213
+ type Props$b = {
214
214
  variant?: 'linear' | 'radial';
215
215
  size?: 'xs' | 'sm' | 'md' | 'lg';
216
216
  color?: Mode;
217
217
  };
218
- type LoaderType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$9>;
218
+ type LoaderType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$b>;
219
219
  declare global {
220
220
  namespace JSX {
221
221
  interface IntrinsicElements {
@@ -224,22 +224,22 @@ declare global {
224
224
  }
225
225
  }
226
226
  }
227
- declare const Loader: React.ForwardRefExoticComponent<Props$9 & React.RefAttributes<HTMLDivElement>>;
227
+ declare const Loader: React.ForwardRefExoticComponent<Props$b & React.RefAttributes<HTMLDivElement>>;
228
228
 
229
- type Props$8 = {
229
+ type Props$a = {
230
230
  width?: string;
231
231
  height?: string;
232
232
  };
233
233
  declare global {
234
234
  namespace JSX {
235
235
  interface IntrinsicElements {
236
- 'descope-logo': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$8>;
236
+ 'descope-logo': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$a>;
237
237
  }
238
238
  }
239
239
  }
240
- declare const Logo: React.ForwardRefExoticComponent<Props$8 & React.RefAttributes<HTMLDivElement>>;
240
+ declare const Logo: React.ForwardRefExoticComponent<Props$a & React.RefAttributes<HTMLDivElement>>;
241
241
 
242
- type Props$7 = {
242
+ type Props$9 = {
243
243
  'password-label'?: string;
244
244
  'password-placeholder'?: string;
245
245
  'confirm-label'?: string;
@@ -249,11 +249,11 @@ type Props$7 = {
249
249
  declare global {
250
250
  namespace JSX {
251
251
  interface IntrinsicElements {
252
- 'descope-new-password': DescopeInputProps & Props$7;
252
+ 'descope-new-password': DescopeInputProps & Props$9;
253
253
  }
254
254
  }
255
255
  }
256
- declare const NewPassword: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$7, "ref"> & React.RefAttributes<HTMLInputElement>>;
256
+ declare const NewPassword: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$9, "ref"> & React.RefAttributes<HTMLInputElement>>;
257
257
 
258
258
  declare global {
259
259
  namespace JSX {
@@ -273,16 +273,16 @@ declare global {
273
273
  }
274
274
  declare const Password: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
275
275
 
276
- type Props$6 = {
276
+ type Props$8 = {
277
277
  variant: 'countrySelection' | 'inputBox';
278
278
  'default-code'?: string;
279
279
  'phone-input-placeholder'?: string;
280
280
  'country-input-placeholder'?: string;
281
281
  'restrict-countries'?: string;
282
282
  } & DescopeInputProps;
283
- declare const Phone: React.ForwardRefExoticComponent<Omit<Props$6, "ref"> & React.RefAttributes<HTMLInputElement>>;
283
+ declare const Phone: React.ForwardRefExoticComponent<Omit<Props$8, "ref"> & React.RefAttributes<HTMLInputElement>>;
284
284
 
285
- type Props$5 = {
285
+ type Props$7 = {
286
286
  children?: JSX.Element[];
287
287
  };
288
288
  declare global {
@@ -292,9 +292,9 @@ declare global {
292
292
  }
293
293
  }
294
294
  }
295
- declare const Select: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$5, "ref"> & React.RefAttributes<HTMLInputElement>>;
295
+ declare const Select: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$7, "ref"> & React.RefAttributes<HTMLInputElement>>;
296
296
 
297
- type Props$4 = {
297
+ type Props$6 = {
298
298
  italic?: boolean;
299
299
  variant?: string;
300
300
  mode?: string;
@@ -304,11 +304,11 @@ type Props$4 = {
304
304
  declare global {
305
305
  namespace JSX {
306
306
  interface IntrinsicElements {
307
- 'descope-text': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$4;
307
+ 'descope-text': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$6;
308
308
  }
309
309
  }
310
310
  }
311
- declare const Text: React.ForwardRefExoticComponent<Omit<Props$4 & {
311
+ declare const Text: React.ForwardRefExoticComponent<Omit<Props$6 & {
312
312
  typography?: TypographyVariants;
313
313
  } & Omit<React.HTMLProps<HTMLSpanElement>, "mode">, "ref"> & React.RefAttributes<HTMLElement>>;
314
314
 
@@ -330,23 +330,23 @@ declare global {
330
330
  }
331
331
  declare const TextField: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
332
332
 
333
- type Props$3 = {
333
+ type Props$5 = {
334
334
  width?: string;
335
335
  height?: string;
336
336
  };
337
337
  declare global {
338
338
  namespace JSX {
339
339
  interface IntrinsicElements {
340
- 'descope-totp-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$3>;
340
+ 'descope-totp-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$5>;
341
341
  }
342
342
  }
343
343
  }
344
- declare const TOTPImage: React.ForwardRefExoticComponent<Props$3 & React.RefAttributes<HTMLDivElement>>;
344
+ declare const TOTPImage: React.ForwardRefExoticComponent<Props$5 & React.RefAttributes<HTMLDivElement>>;
345
345
 
346
- type Props$2 = Omit<React.ComponentProps<typeof Link>, 'href'>;
347
- declare const TOTPLink: React.ForwardRefExoticComponent<Omit<Props$2, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
346
+ type Props$4 = Omit<React.ComponentProps<typeof Link>, 'href'>;
347
+ declare const TOTPLink: React.ForwardRefExoticComponent<Omit<Props$4, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
348
348
 
349
- type Props$1 = {
349
+ type Props$3 = {
350
350
  title?: string;
351
351
  description?: string;
352
352
  icon?: string;
@@ -365,13 +365,13 @@ type Props$1 = {
365
365
  declare global {
366
366
  namespace JSX {
367
367
  interface IntrinsicElements {
368
- 'descope-upload-file': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$1;
368
+ 'descope-upload-file': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$3;
369
369
  }
370
370
  }
371
371
  }
372
- declare const UploadFile: React.ForwardRefExoticComponent<Props$1 & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
372
+ declare const UploadFile: React.ForwardRefExoticComponent<Props$3 & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
373
373
 
374
- type Props = {
374
+ type Props$2 = {
375
375
  disabled?: boolean;
376
376
  'site-key'?: string;
377
377
  enterprise?: boolean;
@@ -383,10 +383,41 @@ declare global {
383
383
  }
384
384
  namespace JSX {
385
385
  interface IntrinsicElements {
386
- 'descope-recaptcha': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props;
386
+ 'descope-recaptcha': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$2;
387
+ }
388
+ }
389
+ }
390
+ declare const Recaptcha: React.ForwardRefExoticComponent<Props$2 & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
391
+
392
+ type Props$1 = DescopeInputProps & {
393
+ 'default-value': string;
394
+ };
395
+ declare global {
396
+ namespace JSX {
397
+ interface IntrinsicElements {
398
+ 'descope-button-selection-group': Props$1;
399
+ 'descope-button-selection-group-item': {
400
+ value: string;
401
+ children: string;
402
+ };
387
403
  }
388
404
  }
389
405
  }
390
- declare const Recaptcha: React.ForwardRefExoticComponent<Props & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
406
+ declare const ButtonSelectionGroup: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & {
407
+ 'default-value': string;
408
+ } & {
409
+ children: JSX.Element[];
410
+ }, "ref"> & React.RefAttributes<HTMLInputElement>>;
411
+
412
+ type Item = {
413
+ label: string;
414
+ value: string;
415
+ };
416
+ type SingleSelectType = {
417
+ type: 'button-selection-group' | 'combobox';
418
+ data: Item[];
419
+ };
420
+ type Props = React.ComponentProps<typeof ButtonSelectionGroup> & SingleSelectType;
421
+ declare const SingleSelect: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
391
422
 
392
- export { Boolean, Button, Checkbox, Code, Container, Divider, Image, Input, Link, Loader, Logo, NewPassword, NumberField, Password, Phone, Recaptcha, Select, 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 };
423
+ export { Boolean, Button, Checkbox, Code, Container, Divider, Image, Input, Link, Loader, Logo, 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
@@ -241,4 +241,29 @@ const UploadFile = React.forwardRef((props, ref) => React.createElement("descope
241
241
 
242
242
  const Recaptcha = React.forwardRef((props, ref) => React.createElement("descope-recaptcha", { ref: ref, ...props }));
243
243
 
244
- export { Boolean, Button, Checkbox, Code, Container, Divider, Image, Input, Link, Loader, Logo, NewPassword, NumberField, Password, Phone, Recaptcha, Select, Switch, TOTPImage, TOTPLink, Text, TextField, Textarea, UploadFile, apple, discord, facebook, fingerprint, github, gitlab, google, linkedin, microsoft, passkey, slack, sso };
244
+ const ButtonSelectionGroup = React.forwardRef((props, ref) => React.createElement("descope-button-selection-group", { ...props, ref: ref }));
245
+ ButtonSelectionGroup.defaultProps = {
246
+ // eslint-disable-next-line react/default-props-match-prop-types
247
+ size: 'md'
248
+ };
249
+
250
+ const ComboBox = React.forwardRef((props, ref) => React.createElement("descope-combo-box", { ...props, ref: ref }));
251
+ ComboBox.defaultProps = {
252
+ // eslint-disable-next-line react/default-props-match-prop-types
253
+ size: 'md',
254
+ // eslint-disable-next-line react/default-props-match-prop-types
255
+ bordered: true
256
+ };
257
+
258
+ const SingleSelect = React.forwardRef(({ type, data, ...props }, ref) => {
259
+ switch (type) {
260
+ case 'button-selection-group':
261
+ return (React.createElement(ButtonSelectionGroup, { ...props, ref: ref }, data.map(({ label, value }) => (React.createElement("descope-button-selection-group-item", { value: value }, label)))));
262
+ case 'combobox':
263
+ return (React.createElement(ComboBox, { "item-label-path": "data-name", "item-value-path": "id", ...props, ref: ref }, data.map(({ label, value }) => (React.createElement("span", { "data-name": label, "data-id": value }, label)))));
264
+ default:
265
+ return null;
266
+ }
267
+ });
268
+
269
+ export { Boolean, Button, Checkbox, Code, Container, Divider, Image, Input, Link, Loader, Logo, 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.117",
3
+ "version": "2.0.118",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -99,7 +99,7 @@
99
99
  "typescript": "^4.5.3"
100
100
  },
101
101
  "dependencies": {
102
- "@descope/web-components-ui": "1.0.177",
102
+ "@descope/web-components-ui": "1.0.180",
103
103
  "rollup-plugin-dts": "^5.3.0"
104
104
  },
105
105
  "peerDependencies": {