@descope/flow-components 2.0.116 → 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 +28 -1
- package/dist/index.d.ts +76 -44
- package/dist/index.esm.js +28 -2
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -103,7 +103,8 @@ var icons = /*#__PURE__*/Object.freeze({
|
|
|
103
103
|
|
|
104
104
|
const Button = React__default.default.forwardRef(({ children, startIcon, startIconColorText, color, ...props }, ref) => {
|
|
105
105
|
const icon = React.useMemo(() => icons[startIcon]?.({ noColor: startIconColorText }), [startIcon, startIconColorText]);
|
|
106
|
-
|
|
106
|
+
const isSquare = React.useMemo(() => !!(icon && !children), [icon, children]);
|
|
107
|
+
return (React__default.default.createElement("descope-button", { ...props, mode: color, ref: ref, square: isSquare },
|
|
107
108
|
icon,
|
|
108
109
|
children));
|
|
109
110
|
});
|
|
@@ -246,6 +247,31 @@ const UploadFile = React__default.default.forwardRef((props, ref) => React__defa
|
|
|
246
247
|
|
|
247
248
|
const Recaptcha = React__default.default.forwardRef((props, ref) => React__default.default.createElement("descope-recaptcha", { ref: ref, ...props }));
|
|
248
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
|
+
|
|
249
275
|
exports.Boolean = Boolean;
|
|
250
276
|
exports.Button = Button;
|
|
251
277
|
exports.Checkbox = Checkbox;
|
|
@@ -263,6 +289,7 @@ exports.Password = Password;
|
|
|
263
289
|
exports.Phone = Phone;
|
|
264
290
|
exports.Recaptcha = Recaptcha;
|
|
265
291
|
exports.Select = Select;
|
|
292
|
+
exports.SingleSelect = SingleSelect;
|
|
266
293
|
exports.Switch = Switch;
|
|
267
294
|
exports.TOTPImage = TOTPImage;
|
|
268
295
|
exports.TOTPLink = TOTPLink;
|
package/dist/index.d.ts
CHANGED
|
@@ -44,14 +44,15 @@ declare const Switch: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "r
|
|
|
44
44
|
type BooleanType = {
|
|
45
45
|
type: 'switch' | 'checkbox';
|
|
46
46
|
};
|
|
47
|
-
type Props$
|
|
48
|
-
declare const Boolean: React.ForwardRefExoticComponent<Omit<Props$
|
|
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 {
|
|
52
52
|
interface IntrinsicElements {
|
|
53
53
|
'descope-button': React.DetailedHTMLProps<React.HTMLAttributes<HTMLButtonElement>, HTMLButtonElement> & {
|
|
54
54
|
mode: string;
|
|
55
|
+
square?: boolean;
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
58
|
}
|
|
@@ -66,17 +67,17 @@ declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes
|
|
|
66
67
|
'full-width'?: boolean;
|
|
67
68
|
}, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
68
69
|
|
|
69
|
-
type Props$
|
|
70
|
+
type Props$g = {
|
|
70
71
|
digits?: number;
|
|
71
72
|
};
|
|
72
73
|
declare global {
|
|
73
74
|
namespace JSX {
|
|
74
75
|
interface IntrinsicElements {
|
|
75
|
-
'descope-passcode': DescopeInputProps & Props$
|
|
76
|
+
'descope-passcode': DescopeInputProps & Props$g;
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
|
-
declare const Code: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$
|
|
80
|
+
declare const Code: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$g, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
80
81
|
|
|
81
82
|
type Never<T extends Record<string, any>> = {
|
|
82
83
|
[K in keyof T]: never;
|
|
@@ -92,7 +93,7 @@ type ContainerAlignment = {
|
|
|
92
93
|
'vertical-alignment'?: FlexAlignment;
|
|
93
94
|
'space-between'?: 'sm' | 'md' | 'lg';
|
|
94
95
|
};
|
|
95
|
-
type Props$
|
|
96
|
+
type Props$f = {
|
|
96
97
|
direction?: 'row' | 'column';
|
|
97
98
|
shadow?: 'md' | 'lg' | 'xl' | '2xl';
|
|
98
99
|
'border-radius'?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
@@ -108,9 +109,9 @@ declare global {
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
|
-
declare const Container: React.ForwardRefExoticComponent<(Props$
|
|
112
|
+
declare const Container: React.ForwardRefExoticComponent<(Props$f & React.HTMLAttributes<HTMLDivElement>) & React.RefAttributes<HTMLDivElement>>;
|
|
112
113
|
|
|
113
|
-
type Props$
|
|
114
|
+
type Props$e = {
|
|
114
115
|
vertical?: boolean;
|
|
115
116
|
italic?: boolean;
|
|
116
117
|
variant?: TypographyVariants;
|
|
@@ -120,11 +121,11 @@ type Props$c = {
|
|
|
120
121
|
declare global {
|
|
121
122
|
namespace JSX {
|
|
122
123
|
interface IntrinsicElements {
|
|
123
|
-
'descope-divider': React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & Omit<Props$
|
|
124
|
+
'descope-divider': React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & Omit<Props$e, 'children'>;
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
|
-
declare const Divider: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "size"> & Props$
|
|
128
|
+
declare const Divider: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "size"> & Props$e, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
128
129
|
|
|
129
130
|
declare const _default$b: ({ noColor }: {
|
|
130
131
|
noColor: any;
|
|
@@ -174,7 +175,7 @@ declare const _default: ({ noColor }: {
|
|
|
174
175
|
noColor: any;
|
|
175
176
|
}) => React.JSX.Element;
|
|
176
177
|
|
|
177
|
-
type Props$
|
|
178
|
+
type Props$d = {
|
|
178
179
|
width?: string;
|
|
179
180
|
height?: string;
|
|
180
181
|
alt?: string;
|
|
@@ -183,15 +184,15 @@ type Props$b = {
|
|
|
183
184
|
declare global {
|
|
184
185
|
namespace JSX {
|
|
185
186
|
interface IntrinsicElements {
|
|
186
|
-
'descope-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$
|
|
187
|
+
'descope-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$d;
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
|
-
declare const Image: React.ForwardRefExoticComponent<Props$
|
|
191
|
+
declare const Image: React.ForwardRefExoticComponent<Props$d & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
191
192
|
|
|
192
193
|
declare const Input: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
193
194
|
|
|
194
|
-
type Props$
|
|
195
|
+
type Props$c = {
|
|
195
196
|
href?: string | undefined;
|
|
196
197
|
italic?: boolean;
|
|
197
198
|
variant?: TypographyVariants;
|
|
@@ -203,18 +204,18 @@ type Props$a = {
|
|
|
203
204
|
declare global {
|
|
204
205
|
namespace JSX {
|
|
205
206
|
interface IntrinsicElements {
|
|
206
|
-
'descope-link': React.DetailedHTMLProps<React.HTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & Omit<Props$
|
|
207
|
+
'descope-link': React.DetailedHTMLProps<React.HTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & Omit<Props$c, 'children'>;
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
|
-
declare const Link: React.ForwardRefExoticComponent<Props$
|
|
211
|
+
declare const Link: React.ForwardRefExoticComponent<Props$c & React.RefAttributes<HTMLAnchorElement>>;
|
|
211
212
|
|
|
212
|
-
type Props$
|
|
213
|
+
type Props$b = {
|
|
213
214
|
variant?: 'linear' | 'radial';
|
|
214
215
|
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
215
216
|
color?: Mode;
|
|
216
217
|
};
|
|
217
|
-
type LoaderType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$
|
|
218
|
+
type LoaderType = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$b>;
|
|
218
219
|
declare global {
|
|
219
220
|
namespace JSX {
|
|
220
221
|
interface IntrinsicElements {
|
|
@@ -223,22 +224,22 @@ declare global {
|
|
|
223
224
|
}
|
|
224
225
|
}
|
|
225
226
|
}
|
|
226
|
-
declare const Loader: React.ForwardRefExoticComponent<Props$
|
|
227
|
+
declare const Loader: React.ForwardRefExoticComponent<Props$b & React.RefAttributes<HTMLDivElement>>;
|
|
227
228
|
|
|
228
|
-
type Props$
|
|
229
|
+
type Props$a = {
|
|
229
230
|
width?: string;
|
|
230
231
|
height?: string;
|
|
231
232
|
};
|
|
232
233
|
declare global {
|
|
233
234
|
namespace JSX {
|
|
234
235
|
interface IntrinsicElements {
|
|
235
|
-
'descope-logo': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$
|
|
236
|
+
'descope-logo': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$a>;
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
239
|
}
|
|
239
|
-
declare const Logo: React.ForwardRefExoticComponent<Props$
|
|
240
|
+
declare const Logo: React.ForwardRefExoticComponent<Props$a & React.RefAttributes<HTMLDivElement>>;
|
|
240
241
|
|
|
241
|
-
type Props$
|
|
242
|
+
type Props$9 = {
|
|
242
243
|
'password-label'?: string;
|
|
243
244
|
'password-placeholder'?: string;
|
|
244
245
|
'confirm-label'?: string;
|
|
@@ -248,11 +249,11 @@ type Props$7 = {
|
|
|
248
249
|
declare global {
|
|
249
250
|
namespace JSX {
|
|
250
251
|
interface IntrinsicElements {
|
|
251
|
-
'descope-new-password': DescopeInputProps & Props$
|
|
252
|
+
'descope-new-password': DescopeInputProps & Props$9;
|
|
252
253
|
}
|
|
253
254
|
}
|
|
254
255
|
}
|
|
255
|
-
declare const NewPassword: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$
|
|
256
|
+
declare const NewPassword: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$9, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
256
257
|
|
|
257
258
|
declare global {
|
|
258
259
|
namespace JSX {
|
|
@@ -272,16 +273,16 @@ declare global {
|
|
|
272
273
|
}
|
|
273
274
|
declare const Password: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
274
275
|
|
|
275
|
-
type Props$
|
|
276
|
+
type Props$8 = {
|
|
276
277
|
variant: 'countrySelection' | 'inputBox';
|
|
277
278
|
'default-code'?: string;
|
|
278
279
|
'phone-input-placeholder'?: string;
|
|
279
280
|
'country-input-placeholder'?: string;
|
|
280
281
|
'restrict-countries'?: string;
|
|
281
282
|
} & DescopeInputProps;
|
|
282
|
-
declare const Phone: React.ForwardRefExoticComponent<Omit<Props$
|
|
283
|
+
declare const Phone: React.ForwardRefExoticComponent<Omit<Props$8, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
283
284
|
|
|
284
|
-
type Props$
|
|
285
|
+
type Props$7 = {
|
|
285
286
|
children?: JSX.Element[];
|
|
286
287
|
};
|
|
287
288
|
declare global {
|
|
@@ -291,9 +292,9 @@ declare global {
|
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
294
|
}
|
|
294
|
-
declare const Select: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$
|
|
295
|
+
declare const Select: React.ForwardRefExoticComponent<Omit<HTMLInputAttrs & DescopeInputExtraProps & Props$7, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
295
296
|
|
|
296
|
-
type Props$
|
|
297
|
+
type Props$6 = {
|
|
297
298
|
italic?: boolean;
|
|
298
299
|
variant?: string;
|
|
299
300
|
mode?: string;
|
|
@@ -303,11 +304,11 @@ type Props$4 = {
|
|
|
303
304
|
declare global {
|
|
304
305
|
namespace JSX {
|
|
305
306
|
interface IntrinsicElements {
|
|
306
|
-
'descope-text': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$
|
|
307
|
+
'descope-text': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$6;
|
|
307
308
|
}
|
|
308
309
|
}
|
|
309
310
|
}
|
|
310
|
-
declare const Text: React.ForwardRefExoticComponent<Omit<Props$
|
|
311
|
+
declare const Text: React.ForwardRefExoticComponent<Omit<Props$6 & {
|
|
311
312
|
typography?: TypographyVariants;
|
|
312
313
|
} & Omit<React.HTMLProps<HTMLSpanElement>, "mode">, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
313
314
|
|
|
@@ -329,23 +330,23 @@ declare global {
|
|
|
329
330
|
}
|
|
330
331
|
declare const TextField: React.ForwardRefExoticComponent<Omit<DescopeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
331
332
|
|
|
332
|
-
type Props$
|
|
333
|
+
type Props$5 = {
|
|
333
334
|
width?: string;
|
|
334
335
|
height?: string;
|
|
335
336
|
};
|
|
336
337
|
declare global {
|
|
337
338
|
namespace JSX {
|
|
338
339
|
interface IntrinsicElements {
|
|
339
|
-
'descope-totp-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$
|
|
340
|
+
'descope-totp-image': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & PropsToAttrs<Props$5>;
|
|
340
341
|
}
|
|
341
342
|
}
|
|
342
343
|
}
|
|
343
|
-
declare const TOTPImage: React.ForwardRefExoticComponent<Props$
|
|
344
|
+
declare const TOTPImage: React.ForwardRefExoticComponent<Props$5 & React.RefAttributes<HTMLDivElement>>;
|
|
344
345
|
|
|
345
|
-
type Props$
|
|
346
|
-
declare const TOTPLink: React.ForwardRefExoticComponent<Omit<Props$
|
|
346
|
+
type Props$4 = Omit<React.ComponentProps<typeof Link>, 'href'>;
|
|
347
|
+
declare const TOTPLink: React.ForwardRefExoticComponent<Omit<Props$4, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
347
348
|
|
|
348
|
-
type Props$
|
|
349
|
+
type Props$3 = {
|
|
349
350
|
title?: string;
|
|
350
351
|
description?: string;
|
|
351
352
|
icon?: string;
|
|
@@ -364,13 +365,13 @@ type Props$1 = {
|
|
|
364
365
|
declare global {
|
|
365
366
|
namespace JSX {
|
|
366
367
|
interface IntrinsicElements {
|
|
367
|
-
'descope-upload-file': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$
|
|
368
|
+
'descope-upload-file': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & Props$3;
|
|
368
369
|
}
|
|
369
370
|
}
|
|
370
371
|
}
|
|
371
|
-
declare const UploadFile: React.ForwardRefExoticComponent<Props$
|
|
372
|
+
declare const UploadFile: React.ForwardRefExoticComponent<Props$3 & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
372
373
|
|
|
373
|
-
type Props = {
|
|
374
|
+
type Props$2 = {
|
|
374
375
|
disabled?: boolean;
|
|
375
376
|
'site-key'?: string;
|
|
376
377
|
enterprise?: boolean;
|
|
@@ -382,10 +383,41 @@ declare global {
|
|
|
382
383
|
}
|
|
383
384
|
namespace JSX {
|
|
384
385
|
interface IntrinsicElements {
|
|
385
|
-
'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
|
+
};
|
|
386
403
|
}
|
|
387
404
|
}
|
|
388
405
|
}
|
|
389
|
-
declare const
|
|
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>>;
|
|
390
422
|
|
|
391
|
-
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
|
@@ -97,7 +97,8 @@ var icons = /*#__PURE__*/Object.freeze({
|
|
|
97
97
|
|
|
98
98
|
const Button = React.forwardRef(({ children, startIcon, startIconColorText, color, ...props }, ref) => {
|
|
99
99
|
const icon = useMemo(() => icons[startIcon]?.({ noColor: startIconColorText }), [startIcon, startIconColorText]);
|
|
100
|
-
|
|
100
|
+
const isSquare = useMemo(() => !!(icon && !children), [icon, children]);
|
|
101
|
+
return (React.createElement("descope-button", { ...props, mode: color, ref: ref, square: isSquare },
|
|
101
102
|
icon,
|
|
102
103
|
children));
|
|
103
104
|
});
|
|
@@ -240,4 +241,29 @@ const UploadFile = React.forwardRef((props, ref) => React.createElement("descope
|
|
|
240
241
|
|
|
241
242
|
const Recaptcha = React.forwardRef((props, ref) => React.createElement("descope-recaptcha", { ref: ref, ...props }));
|
|
242
243
|
|
|
243
|
-
|
|
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.
|
|
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.
|
|
102
|
+
"@descope/web-components-ui": "1.0.180",
|
|
103
103
|
"rollup-plugin-dts": "^5.3.0"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|