@descope/flow-components 2.0.236 → 2.0.238
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 +31 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.esm.js +31 -1
- package/package.json +5 -2
package/dist/index.cjs.js
CHANGED
|
@@ -224,7 +224,37 @@ const Loader = React__default.default.forwardRef(({ variant, color, ...restProps
|
|
|
224
224
|
|
|
225
225
|
const Logo = React__default.default.forwardRef(({ width, height, ...props }, ref) => (React__default.default.createElement("descope-logo", { "st-width": width, "st-height": height, ref: ref, ...props })));
|
|
226
226
|
|
|
227
|
-
const NewPassword = React__default.default.forwardRef((props, ref) =>
|
|
227
|
+
const NewPassword = React__default.default.forwardRef((props, ref) => {
|
|
228
|
+
const availablePolicies = props?.['active-policies'].map((id) => ({
|
|
229
|
+
id,
|
|
230
|
+
message: props[`data-password-policy-message-${id}`],
|
|
231
|
+
pattern: props[`data-password-policy-pattern-${id}`],
|
|
232
|
+
data: props[`data-password-policy-data-${id}`]
|
|
233
|
+
}));
|
|
234
|
+
return (React__default.default.createElement("descope-new-password", { ...props, ref: ref, "available-policies": JSON.stringify(availablePolicies || []) }));
|
|
235
|
+
});
|
|
236
|
+
NewPassword.defaultProps = {
|
|
237
|
+
'has-validation': false,
|
|
238
|
+
'policy-label': 'Passwords must have:',
|
|
239
|
+
// in the future, 'active-policies' can be injected in runtime
|
|
240
|
+
'active-policies': [],
|
|
241
|
+
// non-user-editable patterns
|
|
242
|
+
'data-password-policy-pattern-minlength': '^.{{{value}},}$',
|
|
243
|
+
'data-password-policy-pattern-lowercase': '[a-z]',
|
|
244
|
+
'data-password-policy-pattern-uppercase': '[A-Z]',
|
|
245
|
+
'data-password-policy-pattern-number': '\\d',
|
|
246
|
+
'data-password-policy-pattern-nonalphanumeric': '[^a-zA-Z0-9]',
|
|
247
|
+
// props to override with data from policy
|
|
248
|
+
'data-password-policy-value-minlength': '8',
|
|
249
|
+
// translatable props
|
|
250
|
+
'data-password-policy-message-minlength': 'At least {{value}} characters',
|
|
251
|
+
'data-password-policy-message-lowercase': '1 lowercase letter',
|
|
252
|
+
'data-password-policy-message-uppercase': '1 uppercase letter',
|
|
253
|
+
'data-password-policy-message-number': '1 number',
|
|
254
|
+
'data-password-policy-message-nonalphanumeric': '1 symbol',
|
|
255
|
+
'st-policy-preview-background-color': 'transparent',
|
|
256
|
+
'st-policy-preview-padding': '0'
|
|
257
|
+
};
|
|
228
258
|
|
|
229
259
|
const PhoneCountrySelection = React__default.default.forwardRef((props, ref) => React__default.default.createElement("descope-phone-field", { ...props, ref: ref }));
|
|
230
260
|
|
package/dist/index.d.ts
CHANGED
|
@@ -254,6 +254,22 @@ type Props$j = {
|
|
|
254
254
|
'confirm-label'?: string;
|
|
255
255
|
'confirm-placeholder'?: string;
|
|
256
256
|
'has-confirm'?: boolean;
|
|
257
|
+
'policy-label'?: string;
|
|
258
|
+
'has-validation'?: boolean;
|
|
259
|
+
'active-policies'?: string[];
|
|
260
|
+
'data-password-policy-pattern-minlength'?: string;
|
|
261
|
+
'data-password-policy-pattern-lowercase'?: string;
|
|
262
|
+
'data-password-policy-pattern-uppercase'?: string;
|
|
263
|
+
'data-password-policy-pattern-number'?: string;
|
|
264
|
+
'data-password-policy-pattern-nonalphanumeric'?: string;
|
|
265
|
+
'data-password-policy-message-minlength'?: string;
|
|
266
|
+
'data-password-policy-message-lowercase'?: string;
|
|
267
|
+
'data-password-policy-message-uppercase'?: string;
|
|
268
|
+
'data-password-policy-message-number'?: string;
|
|
269
|
+
'data-password-policy-message-nonalphanumeric'?: string;
|
|
270
|
+
'data-password-policy-value-minlength'?: string;
|
|
271
|
+
'st-policy-preview-background-color'?: string;
|
|
272
|
+
'st-policy-preview-padding'?: string;
|
|
257
273
|
};
|
|
258
274
|
declare global {
|
|
259
275
|
namespace JSX {
|
package/dist/index.esm.js
CHANGED
|
@@ -218,7 +218,37 @@ const Loader = React.forwardRef(({ variant, color, ...restProps }, ref) => {
|
|
|
218
218
|
|
|
219
219
|
const Logo = React.forwardRef(({ width, height, ...props }, ref) => (React.createElement("descope-logo", { "st-width": width, "st-height": height, ref: ref, ...props })));
|
|
220
220
|
|
|
221
|
-
const NewPassword = React.forwardRef((props, ref) =>
|
|
221
|
+
const NewPassword = React.forwardRef((props, ref) => {
|
|
222
|
+
const availablePolicies = props?.['active-policies'].map((id) => ({
|
|
223
|
+
id,
|
|
224
|
+
message: props[`data-password-policy-message-${id}`],
|
|
225
|
+
pattern: props[`data-password-policy-pattern-${id}`],
|
|
226
|
+
data: props[`data-password-policy-data-${id}`]
|
|
227
|
+
}));
|
|
228
|
+
return (React.createElement("descope-new-password", { ...props, ref: ref, "available-policies": JSON.stringify(availablePolicies || []) }));
|
|
229
|
+
});
|
|
230
|
+
NewPassword.defaultProps = {
|
|
231
|
+
'has-validation': false,
|
|
232
|
+
'policy-label': 'Passwords must have:',
|
|
233
|
+
// in the future, 'active-policies' can be injected in runtime
|
|
234
|
+
'active-policies': [],
|
|
235
|
+
// non-user-editable patterns
|
|
236
|
+
'data-password-policy-pattern-minlength': '^.{{{value}},}$',
|
|
237
|
+
'data-password-policy-pattern-lowercase': '[a-z]',
|
|
238
|
+
'data-password-policy-pattern-uppercase': '[A-Z]',
|
|
239
|
+
'data-password-policy-pattern-number': '\\d',
|
|
240
|
+
'data-password-policy-pattern-nonalphanumeric': '[^a-zA-Z0-9]',
|
|
241
|
+
// props to override with data from policy
|
|
242
|
+
'data-password-policy-value-minlength': '8',
|
|
243
|
+
// translatable props
|
|
244
|
+
'data-password-policy-message-minlength': 'At least {{value}} characters',
|
|
245
|
+
'data-password-policy-message-lowercase': '1 lowercase letter',
|
|
246
|
+
'data-password-policy-message-uppercase': '1 uppercase letter',
|
|
247
|
+
'data-password-policy-message-number': '1 number',
|
|
248
|
+
'data-password-policy-message-nonalphanumeric': '1 symbol',
|
|
249
|
+
'st-policy-preview-background-color': 'transparent',
|
|
250
|
+
'st-policy-preview-padding': '0'
|
|
251
|
+
};
|
|
222
252
|
|
|
223
253
|
const PhoneCountrySelection = React.forwardRef((props, ref) => React.createElement("descope-phone-field", { ...props, ref: ref }));
|
|
224
254
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descope/flow-components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.238",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
70
70
|
"eslint-plugin-import": "2.29.1",
|
|
71
71
|
"eslint-plugin-jest": "27.9.0",
|
|
72
|
-
"eslint-plugin-jest-dom": "5.
|
|
72
|
+
"eslint-plugin-jest-dom": "5.2.0",
|
|
73
73
|
"eslint-plugin-jest-formatting": "3.1.0",
|
|
74
74
|
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
75
75
|
"eslint-plugin-n": "16.6.2",
|
|
@@ -104,5 +104,8 @@
|
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"react": ">=17"
|
|
107
|
+
},
|
|
108
|
+
"optionalDependencies": {
|
|
109
|
+
"@rollup/rollup-linux-x64-gnu": "^4.14.2"
|
|
107
110
|
}
|
|
108
111
|
}
|