@descope/web-components-ui 3.5.1 → 3.6.0
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/package.json +34 -33
- package/stories/commonControls.js +359 -0
- package/stories/descope-alert.stories.js +102 -0
- package/stories/descope-button-multi-selection-group.stories.js +130 -0
- package/stories/descope-button-selection-group.stories.js +131 -0
- package/stories/descope-calendar.stories.js +115 -0
- package/stories/descope-checkbox.stories.js +74 -0
- package/stories/descope-code-snippet.stories.js +118 -0
- package/stories/descope-container.stories.js +96 -0
- package/stories/descope-date-field.stories.js +169 -0
- package/stories/descope-divider.stories.js +43 -0
- package/stories/descope-email-field.stories.js +109 -0
- package/stories/descope-grid.stories.js +218 -0
- package/stories/descope-hcaptcha.stories.js +29 -0
- package/stories/descope-hybrid-field.stories.js +151 -0
- package/stories/descope-loader-linear.stories.js +29 -0
- package/stories/descope-loader-radial.stories.js +29 -0
- package/stories/descope-logo.stories.js +40 -0
- package/stories/descope-mappings-field.stories.js +108 -0
- package/stories/descope-modal.stories.js +48 -0
- package/stories/descope-multi-select-combo-box.stories.js +183 -0
- package/stories/descope-new-password.stories.js +206 -0
- package/stories/descope-notification.stories.js +81 -0
- package/stories/descope-notp-image.stories.js +29 -0
- package/stories/descope-number-field.stories.js +83 -0
- package/stories/descope-passcode.stories.js +89 -0
- package/stories/descope-password.stories.js +89 -0
- package/stories/descope-phone-field.stories.js +137 -0
- package/stories/descope-phone-input-box-field.stories.js +128 -0
- package/stories/descope-policy-validation.stories.js +92 -0
- package/stories/descope-radio-group.stories.js +142 -0
- package/stories/descope-recaptcha.stories.js +38 -0
- package/stories/descope-saml-group-mappings.stories.js +109 -0
- package/stories/descope-scopes-list.stories.js +81 -0
- package/stories/descope-security-questions-setup.stories.js +125 -0
- package/stories/descope-security-questions-verify.stories.js +111 -0
- package/stories/descope-switch-toggle.stories.js +74 -0
- package/stories/descope-text-area.stories.js +77 -0
- package/stories/descope-text-field.stories.js +98 -0
- package/stories/descope-third-party-app-logo.stories.js +42 -0
- package/stories/descope-totp-image.stories.js +29 -0
- package/stories/descope-upload-file.stories.js +113 -0
- package/stories/descope-user-attribute.stories.js +85 -0
- package/stories/descope-user-auth-method.stories.js +77 -0
- package/stories/helpers.js +86 -0
- package/stories/icons/alert.svg +9 -0
- package/stories/icons/apple.svg +10 -0
- package/stories/icons/base64png.js +1 -0
- package/stories/icons/base64svg.js +1 -0
- package/stories/icons/button-icon.svg +3 -0
- package/stories/icons/errorMessageIconBase64.js +1 -0
- package/stories/icons/fulfilled-button-icon.svg +3 -0
- package/stories/icons/google.svg +25 -0
- package/stories/icons/method-icon.svg +3 -0
- package/stories/images/150x200.jpg +0 -0
- package/stories/images/800x150.jpg +0 -0
- package/stories/images/avatar.jpeg +0 -0
- package/stories/images/demo.jpg +0 -0
- package/stories/images/game.png +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { componentName } from '../src/components/descope-new-password';
|
|
2
|
+
import { toggleDefaultErrorMessageValueMissingDecorator, withForm } from './helpers';
|
|
3
|
+
import {
|
|
4
|
+
sizeControl,
|
|
5
|
+
fullWidthControl,
|
|
6
|
+
directionControl,
|
|
7
|
+
disabledControl,
|
|
8
|
+
readOnlyControl,
|
|
9
|
+
requiredControl,
|
|
10
|
+
borderedControl,
|
|
11
|
+
errorMissingValueControl,
|
|
12
|
+
errorPatternMismatchControl,
|
|
13
|
+
errorBadInputControl,
|
|
14
|
+
minLengthControl,
|
|
15
|
+
inputLabelTypeControl,
|
|
16
|
+
errorMessageIconControl,
|
|
17
|
+
errorMessageIconAttrs,
|
|
18
|
+
defaultValueMissingControl,
|
|
19
|
+
} from './commonControls';
|
|
20
|
+
|
|
21
|
+
const policyData = [
|
|
22
|
+
{
|
|
23
|
+
id: 'minlength',
|
|
24
|
+
message: 'At least {{value}} characters',
|
|
25
|
+
pattern: '^.{{{value}},}$',
|
|
26
|
+
data: {
|
|
27
|
+
value: 8,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'passwordstrength',
|
|
32
|
+
message: 'Password strength',
|
|
33
|
+
compare: 'GTE',
|
|
34
|
+
data: {
|
|
35
|
+
expected: 1,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'lowercase',
|
|
40
|
+
message: '1 lowercase letter',
|
|
41
|
+
pattern: '[a-z]',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'uppercase',
|
|
45
|
+
message: '1 uppercase letter',
|
|
46
|
+
pattern: '[A-Z]',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'number',
|
|
50
|
+
message: '1 number',
|
|
51
|
+
pattern: '\\d',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'nonalphanumeric',
|
|
55
|
+
message: '1 symbol',
|
|
56
|
+
pattern: '[^a-zA-Z0-9]',
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
const Template = ({
|
|
61
|
+
'password-label': passwordLabel,
|
|
62
|
+
'confirm-label': confirmLabel,
|
|
63
|
+
'password-placeholder': passwordPlaceholder,
|
|
64
|
+
'confirm-placeholder': confirmPlaceholder,
|
|
65
|
+
size,
|
|
66
|
+
bordered,
|
|
67
|
+
direction,
|
|
68
|
+
required,
|
|
69
|
+
minlength,
|
|
70
|
+
'full-width': fullWidth,
|
|
71
|
+
disabled,
|
|
72
|
+
readonly,
|
|
73
|
+
'external-input': externalInput,
|
|
74
|
+
'has-confirm': hasConfirm,
|
|
75
|
+
'has-validation': hasValidation,
|
|
76
|
+
'policy-label': policyLabel,
|
|
77
|
+
'available-policies': availablePolicies,
|
|
78
|
+
'data-password-policy-value-minlength': minLengthDataAttr,
|
|
79
|
+
'data-password-policy-value-passwordstrength': passwordStrengthDataAttr,
|
|
80
|
+
'active-policies': activePolicies,
|
|
81
|
+
'data-errormessage-value-missing': customErrorMissingValue,
|
|
82
|
+
'data-errormessage-pattern-mismatch': customErrorTypeMismatch,
|
|
83
|
+
'data-errormessage-bad-input': customErrorPolicyMismatch,
|
|
84
|
+
'st-policy-preview-background-color': stPolicyPreviewBgColor,
|
|
85
|
+
'st-policy-preview-padding': stPolicyPreviewPadding,
|
|
86
|
+
'label-type': labelType,
|
|
87
|
+
'manual-visibility-toggle': manualVisibilityToggle,
|
|
88
|
+
errorMsgIcon,
|
|
89
|
+
}) =>
|
|
90
|
+
`
|
|
91
|
+
<descope-new-password
|
|
92
|
+
size="${size}"
|
|
93
|
+
bordered="${bordered}"
|
|
94
|
+
password-label="${passwordLabel || ''}"
|
|
95
|
+
password-placeholder="${passwordPlaceholder || ''}"
|
|
96
|
+
confirm-label="${confirmLabel || ''}"
|
|
97
|
+
confirm-placeholder="${confirmPlaceholder || ''}"
|
|
98
|
+
has-confirm="${hasConfirm || false}"
|
|
99
|
+
has-validation="${hasValidation || false}"
|
|
100
|
+
required="${required || false}"
|
|
101
|
+
full-width="${fullWidth || false}"
|
|
102
|
+
disabled="${disabled || false}"
|
|
103
|
+
readonly="${readonly || false}"
|
|
104
|
+
minlength="${minlength || ''}"
|
|
105
|
+
data-errormessage-value-missing="${customErrorMissingValue || ''}"
|
|
106
|
+
data-errormessage-pattern-mismatch="${customErrorTypeMismatch || ''}"
|
|
107
|
+
data-errormessage-bad-input="${customErrorPolicyMismatch || ''}"
|
|
108
|
+
data-password-policy-value-minlength="${minLengthDataAttr}"
|
|
109
|
+
data-password-policy-value-passwordstrength="${passwordStrengthDataAttr}"
|
|
110
|
+
st-host-direction="${direction ?? ''}"
|
|
111
|
+
available-policies='${JSON.stringify(availablePolicies) || ''}'
|
|
112
|
+
active-policies="${activePolicies || ''}"
|
|
113
|
+
policy-label="${policyLabel || ''}"
|
|
114
|
+
st-policy-preview-background-color="${stPolicyPreviewBgColor || ''}"
|
|
115
|
+
st-policy-preview-padding="${stPolicyPreviewPadding || ''}"
|
|
116
|
+
label-type="${labelType || ''}"
|
|
117
|
+
manual-visibility-toggle="${manualVisibilityToggle}"
|
|
118
|
+
external-input="${externalInput || false}"
|
|
119
|
+
${errorMsgIcon ? errorMessageIconAttrs : ''}
|
|
120
|
+
></descope-new-password>
|
|
121
|
+
`;
|
|
122
|
+
|
|
123
|
+
export default {
|
|
124
|
+
component: componentName,
|
|
125
|
+
title: 'descope-new-password',
|
|
126
|
+
decorators: [toggleDefaultErrorMessageValueMissingDecorator, withForm],
|
|
127
|
+
argTypes: {
|
|
128
|
+
...sizeControl,
|
|
129
|
+
...inputLabelTypeControl,
|
|
130
|
+
...fullWidthControl,
|
|
131
|
+
...disabledControl,
|
|
132
|
+
...readOnlyControl,
|
|
133
|
+
...requiredControl,
|
|
134
|
+
...borderedControl,
|
|
135
|
+
...errorMissingValueControl,
|
|
136
|
+
...errorPatternMismatchControl,
|
|
137
|
+
...errorBadInputControl,
|
|
138
|
+
...minLengthControl,
|
|
139
|
+
...directionControl,
|
|
140
|
+
...errorMessageIconControl,
|
|
141
|
+
...defaultValueMissingControl,
|
|
142
|
+
'has-confirm': {
|
|
143
|
+
name: 'Has Confirmation',
|
|
144
|
+
control: { type: 'boolean' },
|
|
145
|
+
},
|
|
146
|
+
'password-label': {
|
|
147
|
+
name: 'Password Label',
|
|
148
|
+
control: { type: 'text' },
|
|
149
|
+
},
|
|
150
|
+
'confirm-label': {
|
|
151
|
+
name: 'Confirm Label',
|
|
152
|
+
control: { type: 'text' },
|
|
153
|
+
},
|
|
154
|
+
'password-placeholder': {
|
|
155
|
+
name: 'Password Placeholder',
|
|
156
|
+
control: { type: 'text' },
|
|
157
|
+
},
|
|
158
|
+
'confirm-placeholder': {
|
|
159
|
+
name: 'Confirm Placeholder',
|
|
160
|
+
control: { type: 'text' },
|
|
161
|
+
},
|
|
162
|
+
'has-validation': {
|
|
163
|
+
name: 'Has Validation',
|
|
164
|
+
control: { type: 'boolean' },
|
|
165
|
+
},
|
|
166
|
+
'policy-label': {
|
|
167
|
+
name: 'Policy Label',
|
|
168
|
+
control: { type: 'text' },
|
|
169
|
+
},
|
|
170
|
+
'available-policies': {
|
|
171
|
+
name: 'Available Policies',
|
|
172
|
+
control: { type: 'object' },
|
|
173
|
+
},
|
|
174
|
+
'manual-visibility-toggle': {
|
|
175
|
+
name: 'Manual Visibility Toggle',
|
|
176
|
+
control: { type: 'boolean' },
|
|
177
|
+
},
|
|
178
|
+
'external-input': {
|
|
179
|
+
control: { type: 'boolean' },
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export const Default = Template.bind({});
|
|
185
|
+
|
|
186
|
+
Default.args = {
|
|
187
|
+
size: 'md',
|
|
188
|
+
bordered: true,
|
|
189
|
+
'has-validation': false,
|
|
190
|
+
'policy-label': 'Your password must have:',
|
|
191
|
+
'available-policies': policyData,
|
|
192
|
+
'active-policies': [
|
|
193
|
+
'minlength',
|
|
194
|
+
'lowercase',
|
|
195
|
+
'uppercase',
|
|
196
|
+
'number',
|
|
197
|
+
'nonalphanumeric',
|
|
198
|
+
'passwordstrength',
|
|
199
|
+
],
|
|
200
|
+
'data-password-policy-value-minlength': '8',
|
|
201
|
+
'data-password-policy-value-passwordstrength': '2',
|
|
202
|
+
'st-policy-preview-background-color': 'transparent',
|
|
203
|
+
'st-policy-preview-padding': '0',
|
|
204
|
+
'data-errormessage-value-missing': 'Please fill out this field.',
|
|
205
|
+
'data-errormessage-pattern-mismatch': 'Please match the requested format.',
|
|
206
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { componentName } from '../src/components/descope-notification';
|
|
2
|
+
import { borderedControl, sizeControl } from './commonControls';
|
|
3
|
+
|
|
4
|
+
const Template = ({ content, position, duration, mode, bordered, size }) => `
|
|
5
|
+
<style nonce="${window.DESCOPE_NONCE}">
|
|
6
|
+
#notification-root {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 400px;
|
|
9
|
+
background: pink;
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
</style>
|
|
13
|
+
<div id="notification-root">
|
|
14
|
+
<button id="add-notification">Add Notification</button>
|
|
15
|
+
</div>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
component: componentName,
|
|
20
|
+
title: 'descope-notification',
|
|
21
|
+
decorators: [
|
|
22
|
+
(story, { args }) => {
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
document.querySelector('#add-notification').addEventListener('click', (e) => {
|
|
25
|
+
const tpl = document.createElement('template');
|
|
26
|
+
tpl.innerHTML = `<descope-notification
|
|
27
|
+
opened='true'
|
|
28
|
+
mode='${args.mode}'
|
|
29
|
+
position='${args.position}'
|
|
30
|
+
duration='${args.duration}'
|
|
31
|
+
size='${args.size}'
|
|
32
|
+
bordered='${args.bordered}'
|
|
33
|
+
>
|
|
34
|
+
${args.content}
|
|
35
|
+
<button slot="close" data-id="closeNotification">close</button>
|
|
36
|
+
</descope-notification>
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
document.querySelector('#notification-root').appendChild(tpl.content.cloneNode(true));
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return story();
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
argTypes: {
|
|
47
|
+
...sizeControl,
|
|
48
|
+
...borderedControl,
|
|
49
|
+
mode: {
|
|
50
|
+
name: 'Mode',
|
|
51
|
+
options: ['success', 'error'],
|
|
52
|
+
control: { type: 'select' },
|
|
53
|
+
},
|
|
54
|
+
position: {
|
|
55
|
+
name: 'Position',
|
|
56
|
+
options: [
|
|
57
|
+
'top-stretch',
|
|
58
|
+
'top-start',
|
|
59
|
+
'top-center',
|
|
60
|
+
'top-end',
|
|
61
|
+
'middle',
|
|
62
|
+
'bottom-start',
|
|
63
|
+
'bottom-center',
|
|
64
|
+
'bottom-end',
|
|
65
|
+
'bottom-stretch',
|
|
66
|
+
],
|
|
67
|
+
control: { type: 'select' },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const Default = Template.bind({});
|
|
73
|
+
|
|
74
|
+
Default.args = {
|
|
75
|
+
position: 'bottom-start',
|
|
76
|
+
duration: 3000,
|
|
77
|
+
size: 'md',
|
|
78
|
+
bordered: false,
|
|
79
|
+
mode: 'success',
|
|
80
|
+
content: 'Action completed with status',
|
|
81
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { componentName } from '../src/components/descope-notp-image';
|
|
2
|
+
import { customHeightControl, customWidthControl } from './commonControls';
|
|
3
|
+
|
|
4
|
+
const Template = ({ 'st-width': customWidth, 'st-height': customHeight }) => `
|
|
5
|
+
<descope-notp-image
|
|
6
|
+
st-height="${customHeight || ''}"
|
|
7
|
+
st-width="${customWidth || ''}"
|
|
8
|
+
></descope-notp-image>
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
component: componentName,
|
|
13
|
+
title: 'descope-notp-image',
|
|
14
|
+
parameters: {
|
|
15
|
+
panelPosition: 'right',
|
|
16
|
+
controls: { expanded: true },
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
...customHeightControl,
|
|
20
|
+
...customWidthControl,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const Default = Template.bind({});
|
|
25
|
+
|
|
26
|
+
Default.args = {
|
|
27
|
+
'st-width': '',
|
|
28
|
+
'st-height': '',
|
|
29
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { componentName } from '../src/components/descope-number-field';
|
|
2
|
+
import { toggleDefaultErrorMessageValueMissingDecorator, withForm } from './helpers';
|
|
3
|
+
import {
|
|
4
|
+
labelControl,
|
|
5
|
+
placeholderControl,
|
|
6
|
+
sizeControl,
|
|
7
|
+
fullWidthControl,
|
|
8
|
+
directionControl,
|
|
9
|
+
disabledControl,
|
|
10
|
+
readOnlyControl,
|
|
11
|
+
requiredControl,
|
|
12
|
+
borderedControl,
|
|
13
|
+
errorMissingValueControl,
|
|
14
|
+
errorPatternMismatchControl,
|
|
15
|
+
inputLabelTypeControl,
|
|
16
|
+
errorMessageIconControl,
|
|
17
|
+
errorMessageIconAttrs,
|
|
18
|
+
defaultValueMissingControl,
|
|
19
|
+
} from './commonControls';
|
|
20
|
+
|
|
21
|
+
const Template = ({
|
|
22
|
+
label,
|
|
23
|
+
placeholder,
|
|
24
|
+
size,
|
|
25
|
+
bordered,
|
|
26
|
+
direction,
|
|
27
|
+
required,
|
|
28
|
+
disabled,
|
|
29
|
+
readonly,
|
|
30
|
+
'full-width': fullWidth,
|
|
31
|
+
'data-errormessage-value-missing': customErrorMissingValue,
|
|
32
|
+
'data-errormessage-pattern-mismatch': customErrorTypeMismatch,
|
|
33
|
+
'label-type': labelType,
|
|
34
|
+
errorMsgIcon,
|
|
35
|
+
}) =>
|
|
36
|
+
`
|
|
37
|
+
<descope-number-field
|
|
38
|
+
size="${size}"
|
|
39
|
+
bordered="${bordered}"
|
|
40
|
+
label="${label || ''}"
|
|
41
|
+
placeholder="${placeholder || ''}"
|
|
42
|
+
required="${required || false}"
|
|
43
|
+
disabled="${disabled || false}"
|
|
44
|
+
readonly="${readonly || false}"
|
|
45
|
+
full-width="${fullWidth || false}"
|
|
46
|
+
data-errormessage-value-missing="${customErrorMissingValue || ''}"
|
|
47
|
+
data-errormessage-pattern-mismatch="${customErrorTypeMismatch || ''}"
|
|
48
|
+
st-host-direction="${direction ?? ''}"
|
|
49
|
+
label-type="${labelType || ''}"
|
|
50
|
+
${errorMsgIcon ? errorMessageIconAttrs : ''}
|
|
51
|
+
></descope-number-field>
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
export default {
|
|
55
|
+
component: componentName,
|
|
56
|
+
title: 'descope-number-field',
|
|
57
|
+
decorators: [toggleDefaultErrorMessageValueMissingDecorator, withForm],
|
|
58
|
+
argTypes: {
|
|
59
|
+
...labelControl,
|
|
60
|
+
...placeholderControl,
|
|
61
|
+
...inputLabelTypeControl,
|
|
62
|
+
...sizeControl,
|
|
63
|
+
...fullWidthControl,
|
|
64
|
+
...disabledControl,
|
|
65
|
+
...readOnlyControl,
|
|
66
|
+
...requiredControl,
|
|
67
|
+
...borderedControl,
|
|
68
|
+
...errorMissingValueControl,
|
|
69
|
+
...errorPatternMismatchControl,
|
|
70
|
+
...directionControl,
|
|
71
|
+
...errorMessageIconControl,
|
|
72
|
+
...defaultValueMissingControl,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const Default = Template.bind({});
|
|
77
|
+
|
|
78
|
+
Default.args = {
|
|
79
|
+
size: 'md',
|
|
80
|
+
bordered: true,
|
|
81
|
+
'data-errormessage-value-missing': 'Please fill out this field.',
|
|
82
|
+
'data-errormessage-pattern-mismatch': 'Please match the requested format.',
|
|
83
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { componentName } from '../src/components/descope-passcode';
|
|
2
|
+
import {
|
|
3
|
+
toggleDefaultErrorMessagePatternMismatchDecorator,
|
|
4
|
+
toggleDefaultErrorMessageValueMissingDecorator,
|
|
5
|
+
withForm,
|
|
6
|
+
} from './helpers';
|
|
7
|
+
import {
|
|
8
|
+
labelControl,
|
|
9
|
+
loadingControl,
|
|
10
|
+
sizeControl,
|
|
11
|
+
fullWidthControl,
|
|
12
|
+
directionControl,
|
|
13
|
+
disabledControl,
|
|
14
|
+
readOnlyControl,
|
|
15
|
+
requiredControl,
|
|
16
|
+
borderedControl,
|
|
17
|
+
errorMissingValueControl,
|
|
18
|
+
errorPatternMismatchControl,
|
|
19
|
+
errorMessageIconControl,
|
|
20
|
+
errorMessageIconAttrs,
|
|
21
|
+
defaultValueMissingControl,
|
|
22
|
+
defaultPatternMismatchControl,
|
|
23
|
+
} from './commonControls';
|
|
24
|
+
|
|
25
|
+
const Template = ({
|
|
26
|
+
label,
|
|
27
|
+
loading,
|
|
28
|
+
size,
|
|
29
|
+
bordered,
|
|
30
|
+
direction,
|
|
31
|
+
required,
|
|
32
|
+
'full-width': fullWidth,
|
|
33
|
+
disabled,
|
|
34
|
+
readonly,
|
|
35
|
+
'data-errormessage-value-missing': customErrorMissingValue,
|
|
36
|
+
'data-errormessage-pattern-mismatch': customErrorTypeMismatch,
|
|
37
|
+
errorMsgIcon,
|
|
38
|
+
}) =>
|
|
39
|
+
`
|
|
40
|
+
<descope-passcode
|
|
41
|
+
label="${label || ''}"
|
|
42
|
+
size="${size}"
|
|
43
|
+
bordered="${bordered}"
|
|
44
|
+
required="${required || false}"
|
|
45
|
+
full-width="${fullWidth || false}"
|
|
46
|
+
disabled="${disabled || false}"
|
|
47
|
+
readonly="${readonly || false}"
|
|
48
|
+
loading="${loading || false}"
|
|
49
|
+
data-errormessage-value-missing="${customErrorMissingValue || ''}"
|
|
50
|
+
data-errormessage-pattern-mismatch="${customErrorTypeMismatch || ''}"
|
|
51
|
+
st-host-direction="${direction ?? ''}"
|
|
52
|
+
${errorMsgIcon ? errorMessageIconAttrs : ''}
|
|
53
|
+
></descope-passcode>
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
export default {
|
|
57
|
+
component: componentName,
|
|
58
|
+
title: 'descope-passcode',
|
|
59
|
+
decorators: [
|
|
60
|
+
toggleDefaultErrorMessageValueMissingDecorator,
|
|
61
|
+
toggleDefaultErrorMessagePatternMismatchDecorator,
|
|
62
|
+
withForm,
|
|
63
|
+
],
|
|
64
|
+
argTypes: {
|
|
65
|
+
...labelControl,
|
|
66
|
+
...sizeControl,
|
|
67
|
+
...fullWidthControl,
|
|
68
|
+
...disabledControl,
|
|
69
|
+
...readOnlyControl,
|
|
70
|
+
...requiredControl,
|
|
71
|
+
...loadingControl,
|
|
72
|
+
...borderedControl,
|
|
73
|
+
...errorMissingValueControl,
|
|
74
|
+
...errorPatternMismatchControl,
|
|
75
|
+
...directionControl,
|
|
76
|
+
...errorMessageIconControl,
|
|
77
|
+
...defaultValueMissingControl,
|
|
78
|
+
...defaultPatternMismatchControl,
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const Default = Template.bind({});
|
|
83
|
+
|
|
84
|
+
Default.args = {
|
|
85
|
+
size: 'md',
|
|
86
|
+
bordered: true,
|
|
87
|
+
'data-errormessage-value-missing': 'Please fill out this field.',
|
|
88
|
+
'data-errormessage-pattern-mismatch': 'Please match the requested format.',
|
|
89
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { componentName } from '../src/components/descope-password';
|
|
2
|
+
import { toggleDefaultErrorMessageValueMissingDecorator, withForm } from './helpers';
|
|
3
|
+
import {
|
|
4
|
+
labelControl,
|
|
5
|
+
placeholderControl,
|
|
6
|
+
sizeControl,
|
|
7
|
+
fullWidthControl,
|
|
8
|
+
directionControl,
|
|
9
|
+
disabledControl,
|
|
10
|
+
readOnlyControl,
|
|
11
|
+
requiredControl,
|
|
12
|
+
borderedControl,
|
|
13
|
+
errorMissingValueControl,
|
|
14
|
+
inputLabelTypeControl,
|
|
15
|
+
errorMessageIconControl,
|
|
16
|
+
errorMessageIconAttrs,
|
|
17
|
+
defaultValueMissingControl,
|
|
18
|
+
} from './commonControls';
|
|
19
|
+
|
|
20
|
+
const Template = ({
|
|
21
|
+
label,
|
|
22
|
+
placeholder,
|
|
23
|
+
size,
|
|
24
|
+
bordered,
|
|
25
|
+
direction,
|
|
26
|
+
required,
|
|
27
|
+
'full-width': fullWidth,
|
|
28
|
+
disabled,
|
|
29
|
+
readonly,
|
|
30
|
+
'external-input': externalInput,
|
|
31
|
+
'manual-visibility-toggle': manualVisibilityToggle,
|
|
32
|
+
'data-errormessage-value-missing': customErrorMissingValue,
|
|
33
|
+
'label-type': labelType,
|
|
34
|
+
errorMsgIcon,
|
|
35
|
+
}) =>
|
|
36
|
+
`
|
|
37
|
+
<descope-password
|
|
38
|
+
size="${size}"
|
|
39
|
+
bordered="${bordered}"
|
|
40
|
+
label="${label || ''}"
|
|
41
|
+
placeholder="${placeholder || ''}"
|
|
42
|
+
required="${required || false}"
|
|
43
|
+
full-width="${fullWidth || false}"
|
|
44
|
+
disabled="${disabled || false}"
|
|
45
|
+
readonly="${readonly || false}"
|
|
46
|
+
data-errormessage-value-missing="${customErrorMissingValue || ''}"
|
|
47
|
+
st-host-direction="${direction ?? ''}"
|
|
48
|
+
label-type="${labelType || ''}"
|
|
49
|
+
manual-visibility-toggle="${manualVisibilityToggle}"
|
|
50
|
+
external-input="${externalInput || false}"
|
|
51
|
+
${errorMsgIcon ? errorMessageIconAttrs : ''}
|
|
52
|
+
></descope-password>
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
export default {
|
|
56
|
+
component: componentName,
|
|
57
|
+
title: 'descope-password',
|
|
58
|
+
decorators: [toggleDefaultErrorMessageValueMissingDecorator, withForm],
|
|
59
|
+
argTypes: {
|
|
60
|
+
...labelControl,
|
|
61
|
+
...placeholderControl,
|
|
62
|
+
...inputLabelTypeControl,
|
|
63
|
+
...sizeControl,
|
|
64
|
+
...fullWidthControl,
|
|
65
|
+
...disabledControl,
|
|
66
|
+
...readOnlyControl,
|
|
67
|
+
...requiredControl,
|
|
68
|
+
...borderedControl,
|
|
69
|
+
...errorMissingValueControl,
|
|
70
|
+
...directionControl,
|
|
71
|
+
...errorMessageIconControl,
|
|
72
|
+
...defaultValueMissingControl,
|
|
73
|
+
'manual-visibility-toggle': {
|
|
74
|
+
name: 'Manual Visibility Toggle',
|
|
75
|
+
control: { type: 'boolean' },
|
|
76
|
+
},
|
|
77
|
+
'external-input': {
|
|
78
|
+
control: { type: 'boolean' },
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const Default = Template.bind({});
|
|
84
|
+
|
|
85
|
+
Default.args = {
|
|
86
|
+
size: 'md',
|
|
87
|
+
bordered: true,
|
|
88
|
+
'data-errormessage-value-missing': 'Please fill out this field.',
|
|
89
|
+
};
|