@descope/flow-components 2.0.418 → 2.0.420
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 +29 -12
- package/dist/index.esm.js +29 -12
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -180,20 +180,37 @@ const Loader = React__default.default.forwardRef(({ variant, color, ...restProps
|
|
|
180
180
|
|
|
181
181
|
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 })));
|
|
182
182
|
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
'
|
|
186
|
-
//
|
|
187
|
-
'
|
|
188
|
-
//
|
|
189
|
-
'data-password-policy-
|
|
190
|
-
|
|
183
|
+
const defaultProps = {
|
|
184
|
+
'has-validation': false,
|
|
185
|
+
'policy-label': 'Passwords must have:',
|
|
186
|
+
// in the future, 'active-policies' can be injected in runtime
|
|
187
|
+
'active-policies': [],
|
|
188
|
+
// non-user-editable patterns
|
|
189
|
+
'data-password-policy-pattern-minlength': '^.{{{value}},}$',
|
|
190
|
+
'data-password-policy-pattern-lowercase': '[a-z]',
|
|
191
|
+
'data-password-policy-pattern-uppercase': '[A-Z]',
|
|
192
|
+
'data-password-policy-pattern-number': '\\d',
|
|
193
|
+
'data-password-policy-pattern-nonalphanumeric': '[^a-zA-Z0-9]',
|
|
194
|
+
// props to override with data from policy
|
|
195
|
+
'data-password-policy-value-minlength': '8',
|
|
196
|
+
// translatable props
|
|
197
|
+
'data-password-policy-message-minlength': 'At least {{value}} characters',
|
|
198
|
+
'data-password-policy-message-lowercase': '1 lowercase letter',
|
|
199
|
+
'data-password-policy-message-uppercase': '1 uppercase letter',
|
|
200
|
+
'data-password-policy-message-number': '1 number',
|
|
201
|
+
'data-password-policy-message-nonalphanumeric': '1 symbol',
|
|
202
|
+
'st-policy-preview-background-color': 'transparent',
|
|
203
|
+
'st-policy-preview-padding': '0'
|
|
204
|
+
};
|
|
205
|
+
const NewPassword = React__default.default.forwardRef((props, ref) => {
|
|
206
|
+
const mergedProps = { ...defaultProps, ...props };
|
|
207
|
+
const availablePolicies = mergedProps?.['active-policies']?.map((id) => ({
|
|
191
208
|
id,
|
|
192
|
-
message:
|
|
193
|
-
pattern:
|
|
194
|
-
data:
|
|
209
|
+
message: mergedProps[`data-password-policy-message-${id}`],
|
|
210
|
+
pattern: mergedProps[`data-password-policy-pattern-${id}`],
|
|
211
|
+
data: mergedProps[`data-password-policy-data-${id}`]
|
|
195
212
|
}));
|
|
196
|
-
return (React__default.default.createElement("descope-new-password", {
|
|
213
|
+
return (React__default.default.createElement("descope-new-password", { ...mergedProps, ref: ref, "available-policies": JSON.stringify(availablePolicies || []) }));
|
|
197
214
|
});
|
|
198
215
|
|
|
199
216
|
const PhoneCountrySelection = React__default.default.forwardRef((props, ref) => React__default.default.createElement("descope-phone-field", { ...props, ref: ref }));
|
package/dist/index.esm.js
CHANGED
|
@@ -175,20 +175,37 @@ const Loader = React.forwardRef(({ variant, color, ...restProps }, ref) => {
|
|
|
175
175
|
|
|
176
176
|
const Logo = React.forwardRef(({ width, height, ...props }, ref) => (React.createElement("descope-logo", { "st-width": width, "st-height": height, ref: ref, ...props })));
|
|
177
177
|
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
'
|
|
181
|
-
//
|
|
182
|
-
'
|
|
183
|
-
//
|
|
184
|
-
'data-password-policy-
|
|
185
|
-
|
|
178
|
+
const defaultProps = {
|
|
179
|
+
'has-validation': false,
|
|
180
|
+
'policy-label': 'Passwords must have:',
|
|
181
|
+
// in the future, 'active-policies' can be injected in runtime
|
|
182
|
+
'active-policies': [],
|
|
183
|
+
// non-user-editable patterns
|
|
184
|
+
'data-password-policy-pattern-minlength': '^.{{{value}},}$',
|
|
185
|
+
'data-password-policy-pattern-lowercase': '[a-z]',
|
|
186
|
+
'data-password-policy-pattern-uppercase': '[A-Z]',
|
|
187
|
+
'data-password-policy-pattern-number': '\\d',
|
|
188
|
+
'data-password-policy-pattern-nonalphanumeric': '[^a-zA-Z0-9]',
|
|
189
|
+
// props to override with data from policy
|
|
190
|
+
'data-password-policy-value-minlength': '8',
|
|
191
|
+
// translatable props
|
|
192
|
+
'data-password-policy-message-minlength': 'At least {{value}} characters',
|
|
193
|
+
'data-password-policy-message-lowercase': '1 lowercase letter',
|
|
194
|
+
'data-password-policy-message-uppercase': '1 uppercase letter',
|
|
195
|
+
'data-password-policy-message-number': '1 number',
|
|
196
|
+
'data-password-policy-message-nonalphanumeric': '1 symbol',
|
|
197
|
+
'st-policy-preview-background-color': 'transparent',
|
|
198
|
+
'st-policy-preview-padding': '0'
|
|
199
|
+
};
|
|
200
|
+
const NewPassword = React.forwardRef((props, ref) => {
|
|
201
|
+
const mergedProps = { ...defaultProps, ...props };
|
|
202
|
+
const availablePolicies = mergedProps?.['active-policies']?.map((id) => ({
|
|
186
203
|
id,
|
|
187
|
-
message:
|
|
188
|
-
pattern:
|
|
189
|
-
data:
|
|
204
|
+
message: mergedProps[`data-password-policy-message-${id}`],
|
|
205
|
+
pattern: mergedProps[`data-password-policy-pattern-${id}`],
|
|
206
|
+
data: mergedProps[`data-password-policy-data-${id}`]
|
|
190
207
|
}));
|
|
191
|
-
return (React.createElement("descope-new-password", {
|
|
208
|
+
return (React.createElement("descope-new-password", { ...mergedProps, ref: ref, "available-policies": JSON.stringify(availablePolicies || []) }));
|
|
192
209
|
});
|
|
193
210
|
|
|
194
211
|
const PhoneCountrySelection = React.forwardRef((props, ref) => React.createElement("descope-phone-field", { ...props, ref: ref }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descope/flow-components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.420",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"typescript": "^5.7.2"
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@descope/web-components-ui": "1.0.
|
|
106
|
+
"@descope/web-components-ui": "1.0.436"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
109
109
|
"react": ">= 18"
|