@descope/web-components-ui 3.12.1 → 3.13.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.
Files changed (93) hide show
  1. package/dist/cjs/index.cjs.js +4121 -2426
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +3165 -1468
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/6618.js +591 -0
  6. package/dist/umd/{7387.js.LICENSE.txt → 6618.js.LICENSE.txt} +6 -0
  7. package/dist/umd/6618.js.map +1 -0
  8. package/dist/umd/8350.js +2 -0
  9. package/dist/umd/8350.js.map +1 -0
  10. package/dist/umd/9265.js +2 -0
  11. package/dist/umd/9265.js.map +1 -0
  12. package/dist/umd/DescopeDev.js +1 -1
  13. package/dist/umd/DescopeDev.js.map +1 -1
  14. package/dist/umd/descope-date-field-descope-calendar-index-js.js +449 -1
  15. package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
  16. package/dist/umd/descope-date-field-index-js.js +1 -1
  17. package/dist/umd/descope-date-field-index-js.js.map +1 -1
  18. package/dist/umd/descope-email-field-index-js.js +2 -2
  19. package/dist/umd/descope-email-field-index-js.js.map +1 -1
  20. package/dist/umd/descope-hybrid-field-index-js.js +1 -1
  21. package/dist/umd/descope-hybrid-field-index-js.js.map +1 -1
  22. package/dist/umd/descope-month-day-field-picker.js +114 -0
  23. package/dist/umd/descope-month-day-field-picker.js.LICENSE.txt +11 -0
  24. package/dist/umd/descope-month-day-field-picker.js.map +1 -0
  25. package/dist/umd/descope-month-day-field.js +2 -0
  26. package/dist/umd/descope-month-day-field.js.map +1 -0
  27. package/dist/umd/descope-new-password-index-js.js +1 -1
  28. package/dist/umd/descope-new-password-index-js.js.map +1 -1
  29. package/dist/umd/descope-number-field-index-js.js +1 -1
  30. package/dist/umd/descope-number-field-index-js.js.map +1 -1
  31. package/dist/umd/descope-passcode-index-js.js +1 -1
  32. package/dist/umd/descope-passcode-index-js.js.map +1 -1
  33. package/dist/umd/descope-radio-group-index-js.js +1 -1
  34. package/dist/umd/descope-radio-group-index-js.js.map +1 -1
  35. package/dist/umd/descope-security-questions-setup-index-js.js +1 -1
  36. package/dist/umd/descope-security-questions-setup-index-js.js.map +1 -1
  37. package/dist/umd/descope-security-questions-verify-index-js.js +1 -1
  38. package/dist/umd/descope-security-questions-verify-index-js.js.map +1 -1
  39. package/dist/umd/descope-text-field.js +38 -0
  40. package/dist/umd/descope-text-field.js.map +1 -0
  41. package/dist/umd/index.js +1 -1
  42. package/dist/umd/index.js.map +1 -1
  43. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  44. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  45. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  46. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  47. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  48. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js.map +1 -1
  49. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  50. package/dist/umd/phone-fields-descope-phone-field-index-js.js.map +1 -1
  51. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
  52. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.map +1 -1
  53. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  54. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.map +1 -1
  55. package/package.json +39 -36
  56. package/src/components/descope-date-field/DateFieldClass.js +1 -1
  57. package/src/components/descope-date-field/index.js +1 -1
  58. package/src/components/descope-email-field/EmailFieldClass.js +1 -1
  59. package/src/components/descope-new-password/index.js +1 -1
  60. package/src/components/descope-number-field/NumberFieldClass.js +1 -1
  61. package/src/components/descope-passcode/PasscodeClass.js +1 -1
  62. package/src/components/descope-passcode/index.js +1 -1
  63. package/src/components/descope-radio-group/RadioGroupClass.js +1 -1
  64. package/src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js +1 -1
  65. package/src/components/descope-security-questions-setup/index.js +1 -1
  66. package/src/components/descope-security-questions-verify/SecurityQuestionsVerifyClass.js +1 -1
  67. package/src/components/descope-security-questions-verify/index.js +1 -1
  68. package/src/components/mapping-fields/descope-mappings-field/index.js +1 -1
  69. package/src/components/mapping-fields/descope-saml-group-mappings/index.js +1 -1
  70. package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +1 -1
  71. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/index.js +1 -1
  72. package/src/components/phone-fields/descope-phone-field/index.js +1 -1
  73. package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +1 -1
  74. package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/index.js +1 -1
  75. package/src/components/phone-fields/descope-phone-input-box-field/index.js +1 -1
  76. package/src/index.cjs.js +2 -2
  77. package/src/index.js +0 -1
  78. package/src/theme/components/index.js +5 -1
  79. package/stories/descope-text-field.stories.js +1 -1
  80. package/dist/umd/3685.js +0 -2
  81. package/dist/umd/3685.js.map +0 -1
  82. package/dist/umd/4518.js +0 -450
  83. package/dist/umd/4518.js.map +0 -1
  84. package/dist/umd/7387.js +0 -144
  85. package/dist/umd/7387.js.map +0 -1
  86. package/dist/umd/descope-text-field-index-js.js +0 -38
  87. package/dist/umd/descope-text-field-index-js.js.map +0 -1
  88. package/src/components/descope-text-field/TextFieldClass.js +0 -142
  89. package/src/components/descope-text-field/index.js +0 -9
  90. package/src/components/descope-text-field/textFieldMappings.js +0 -169
  91. package/src/theme/components/textField.js +0 -71
  92. /package/dist/umd/{4518.js.LICENSE.txt → descope-date-field-descope-calendar-index-js.js.LICENSE.txt} +0 -0
  93. /package/dist/umd/{descope-text-field-index-js.js.LICENSE.txt → descope-text-field.js.LICENSE.txt} +0 -0
@@ -1,142 +0,0 @@
1
- import {
2
- createStyleMixin,
3
- draggableMixin,
4
- createProxy,
5
- proxyInputMixin,
6
- componentNameValidationMixin,
7
- } from '../../mixins';
8
- import textFieldMappings from './textFieldMappings';
9
- import { compose } from '../../helpers';
10
- import { getComponentName } from '../../helpers/componentHelpers';
11
- import {
12
- inputFloatingLabelStyle,
13
- resetInputLabelPosition,
14
- resetInputOverrides,
15
- useHostExternalPadding,
16
- } from '../../helpers/themeHelpers/resetHelpers';
17
-
18
- export const componentName = getComponentName('text-field');
19
-
20
- const observedAttrs = ['type', 'label-type', 'copy-to-clipboard'];
21
-
22
- const customMixin = (superclass) =>
23
- class TextFieldClass extends superclass {
24
- static get observedAttributes() {
25
- return observedAttrs.concat(superclass.observedAttributes || []);
26
- }
27
-
28
- icon;
29
-
30
- init() {
31
- super.init?.();
32
- }
33
-
34
- renderCopyToClipboard(shouldRender) {
35
- if (!shouldRender) {
36
- this.icon?.remove();
37
- return;
38
- }
39
-
40
- const iconInitConfig = {
41
- icon: 'vaadin:copy-o',
42
- title: 'Copy',
43
- style: 'cursor: pointer',
44
- };
45
-
46
- const iconCopiedConfig = {
47
- icon: 'vaadin:check-circle-o',
48
- title: 'Copied',
49
- style: 'cursor: initial',
50
- };
51
-
52
- this.icon = Object.assign(document.createElement('vaadin-icon'), {
53
- slot: 'suffix',
54
- ...iconInitConfig,
55
- });
56
-
57
- this.baseElement.appendChild(this.icon);
58
- this.icon.addEventListener('click', () => {
59
- navigator.clipboard.writeText(this.value);
60
- Object.assign(this.icon, iconCopiedConfig);
61
-
62
- // we want the icon to go back to the initial state after 5 seconds
63
- setTimeout(() => {
64
- Object.assign(this.icon, iconInitConfig);
65
- }, 5000);
66
- });
67
- }
68
-
69
- onLabelClick() {
70
- this.focus();
71
- }
72
-
73
- attributeChangedCallback(attrName, oldVal, newVal) {
74
- super.attributeChangeCallback?.(attrName, oldVal, newVal);
75
-
76
- // Vaadin doesn't allow to change the input type attribute.
77
- // We need the ability to do that, so we're overriding their
78
- // behavior with their private API.
79
- // When receiving a `type` attribute, we use their private API
80
- // to set it on the input.
81
- if (attrName === 'type') {
82
- this.baseElement._setType(newVal);
83
- }
84
-
85
- if (oldVal !== newVal) {
86
- if (attrName === 'label-type') {
87
- if (newVal === 'floating') {
88
- this.addEventListener('click', this.onLabelClick);
89
- } else {
90
- this.removeEventListener('click', this.onLabelClick);
91
- }
92
- } else if (attrName === 'copy-to-clipboard') {
93
- this.renderCopyToClipboard(newVal === 'true');
94
- }
95
- }
96
- }
97
- };
98
-
99
- export const TextFieldClass = compose(
100
- createStyleMixin({
101
- mappings: textFieldMappings,
102
- }),
103
- draggableMixin,
104
- proxyInputMixin({ proxyProps: ['value', 'selectionStart'], useProxyTargets: true }),
105
- componentNameValidationMixin,
106
- customMixin
107
- )(
108
- createProxy({
109
- slots: ['prefix', 'suffix'],
110
- wrappedEleName: 'vaadin-text-field',
111
- style: () => `
112
- :host {
113
- display: inline-block;
114
- max-width: 100%;
115
- padding: calc(var(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${
116
- TextFieldClass.cssVarList.inputOutlineOffset
117
- }));
118
- box-sizing: border-box;
119
- }
120
- :host(:is([readonly], [disabled])) ::slotted(:is(input, textarea):placeholder-shown) {
121
- opacity: 1;
122
- }
123
-
124
- vaadin-text-field[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {
125
- opacity: 0;
126
- }
127
- vaadin-text-field[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {
128
- opacity: 0;
129
- }
130
- ${resetInputLabelPosition('vaadin-text-field')}
131
- ${useHostExternalPadding(TextFieldClass.cssVarList)}
132
- ${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}
133
- ${inputFloatingLabelStyle()}
134
-
135
- vaadin-text-field vaadin-icon {
136
- align-self: center;
137
- }
138
- `,
139
- excludeAttrsSync: ['tabindex', 'style'],
140
- componentName,
141
- })
142
- );
@@ -1,9 +0,0 @@
1
- import '@vaadin/text-field';
2
- import '@vaadin/icons';
3
- import '@vaadin/icon';
4
-
5
- import { componentName, TextFieldClass } from './TextFieldClass';
6
-
7
- customElements.define(componentName, TextFieldClass);
8
-
9
- export { TextFieldClass, componentName };
@@ -1,169 +0,0 @@
1
- const {
2
- host,
3
- label,
4
- placeholder,
5
- requiredIndicator,
6
- inputField,
7
- input,
8
- inputMask,
9
- helperText,
10
- errorMessage,
11
- disabledPlaceholder,
12
- inputDisabled,
13
- inputIcon,
14
- externalInput,
15
- externalInputDisabled,
16
- externalPlaceholder,
17
- externalDisabledPlaceholder,
18
- } = {
19
- host: { selector: () => ':host' },
20
- label: { selector: '::part(label)' },
21
- requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
22
- placeholder: [
23
- { selector: '> input:placeholder-shown' },
24
- { selector: () => ':host::slotted(input:placeholder-shown)' },
25
- ],
26
- disabledPlaceholder: { selector: '> input:disabled::placeholder' },
27
- inputField: { selector: '::part(input-field)' },
28
- input: { selector: 'input' },
29
- inputMask: { selector: '::part(input-field)::before' },
30
- inputDisabled: { selector: 'input:disabled' },
31
- helperText: { selector: '::part(helper-text)' },
32
- errorMessage: { selector: '::part(error-message)' },
33
- inputIcon: { selector: 'vaadin-icon' },
34
- externalInput: { selector: () => '::slotted(input)' },
35
- externalInputDisabled: { selector: () => '::slotted(input:disabled)' },
36
- externalPlaceholder: { selector: () => '::slotted(input:placeholder-shown)' },
37
- externalDisabledPlaceholder: { selector: () => '::slotted(input:disabled::placeholder)' },
38
- };
39
-
40
- export default {
41
- // we apply font-size also on the host so we can set its width with em
42
- fontSize: [{}, host],
43
- fontFamily: [label, inputField, helperText, errorMessage],
44
-
45
- labelFontSize: { ...label, property: 'font-size' },
46
- labelFontWeight: { ...label, property: 'font-weight' },
47
-
48
- inputValueFontWeight: [
49
- { ...input, property: 'font-weight' },
50
- { ...externalInput, property: 'font-weight' },
51
- ],
52
- inputPlaceholderFontWeight: [
53
- { selector: () => ':host input:placeholder-shown', property: 'font-weight' },
54
- { ...externalPlaceholder, property: 'font-weight' },
55
- ],
56
- helperTextFontWeight: { ...helperText, property: 'font-weight' },
57
- errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },
58
-
59
- labelTextColor: [
60
- { ...label, property: 'color' },
61
- { ...requiredIndicator, property: 'color' },
62
- { ...label, property: '-webkit-text-fill-color' },
63
- { ...requiredIndicator, property: '-webkit-text-fill-color' },
64
- ],
65
-
66
- hostWidth: { ...host, property: 'width' },
67
- hostMinWidth: { ...host, property: 'min-width' },
68
- hostDirection: { ...host, property: 'direction' },
69
- inputDirection: { ...input, property: 'direction' },
70
-
71
- inputBackgroundColor: [
72
- { ...inputField, property: 'background-color' },
73
- { ...inputMask, property: 'background-color' },
74
- ],
75
-
76
- errorMessageTextColor: { ...errorMessage, property: 'color' },
77
- errorMessageIcon: { ...errorMessage, property: 'background-image' },
78
- errorMessageIconSize: { ...errorMessage, property: 'background-size' },
79
- errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },
80
- errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },
81
- errorMessageIconPosition: { ...errorMessage, property: 'background-position' },
82
- errorMessageFontSize: { ...errorMessage, property: 'font-size' },
83
-
84
- helperTextColor: { ...helperText, property: '-webkit-text-fill-color' },
85
-
86
- inputValueTextColor: [
87
- { ...inputField, property: 'color' },
88
- { ...inputDisabled, property: '-webkit-text-fill-color' },
89
- { ...externalInputDisabled, property: '-webkit-text-fill-color' },
90
- ],
91
- inputCaretTextColor: [
92
- { ...input, property: 'caret-color' },
93
- { ...externalInput, property: 'caret-color' },
94
- ],
95
-
96
- labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
97
-
98
- inputBorderColor: { ...inputField, property: 'border-color' },
99
- inputBorderWidth: { ...inputField, property: 'border-width' },
100
- inputBorderStyle: { ...inputField, property: 'border-style' },
101
- inputBorderRadius: { ...inputField, property: 'border-radius' },
102
-
103
- inputHeight: { ...inputField, property: 'height' },
104
- inputHorizontalPadding: [
105
- { ...input, property: 'padding-left' },
106
- { ...input, property: 'padding-right' },
107
- { ...externalInput, property: 'padding-left' },
108
- { ...externalInput, property: 'padding-right' },
109
- ],
110
-
111
- inputOutlineColor: { ...inputField, property: 'outline-color' },
112
- inputOutlineStyle: { ...inputField, property: 'outline-style' },
113
- inputOutlineWidth: { ...inputField, property: 'outline-width' },
114
- inputOutlineOffset: { ...inputField, property: 'outline-offset' },
115
-
116
- textAlign: {},
117
-
118
- inputTextAlign: [
119
- { ...input, property: 'text-align' },
120
- { ...externalInput, property: 'text-align' },
121
- ],
122
-
123
- inputPlaceholderColor: [
124
- { selector: () => ':host input:placeholder-shown', property: 'color' },
125
- { ...externalPlaceholder, property: 'color' },
126
- { ...placeholder, property: 'color' },
127
- { ...disabledPlaceholder, property: '-webkit-text-fill-color' },
128
- { ...externalDisabledPlaceholder, property: '-webkit-text-fill-color' },
129
- ],
130
-
131
- labelPosition: { ...label, property: 'position' },
132
- labelTopPosition: { ...label, property: 'top' },
133
- labelHorizontalPosition: [
134
- { ...label, property: 'left' },
135
- { ...label, property: 'right' },
136
- ],
137
- inputTransformY: { ...label, property: 'transform' },
138
- inputTransition: { ...label, property: 'transition' },
139
- marginInlineStart: { ...label, property: 'margin-inline-start' },
140
- placeholderOpacity: [
141
- { selector: '> input:placeholder-shown', property: 'opacity' },
142
- { ...externalPlaceholder, property: 'opacity' },
143
- ],
144
- inputVerticalAlignment: [
145
- { ...inputField, property: 'align-items' },
146
- { ...externalInput, property: 'align-items' },
147
- ],
148
- valueInputHeight: [
149
- { ...input, property: 'height' },
150
- { ...externalInput, property: 'height' },
151
- ],
152
- valueInputMarginBottom: [
153
- { ...input, property: 'margin-bottom' },
154
- { ...externalInput, property: 'margin-bottom' },
155
- ],
156
-
157
- inputIconOffset: [
158
- { ...inputIcon, property: 'margin-right' },
159
- { ...inputIcon, property: 'margin-left' },
160
- ],
161
- inputIconSize: { ...inputIcon, property: 'font-size' },
162
- inputIconColor: { ...inputIcon, property: 'color' },
163
- inputTextSecurity: [
164
- { ...input, property: '-webkit-text-security' },
165
- { ...input, property: 'text-security' },
166
- { ...externalInput, property: '-webkit-text-security' },
167
- { ...externalInput, property: 'text-security' },
168
- ],
169
- };
@@ -1,71 +0,0 @@
1
- import globals from '../globals';
2
- import { getThemeRefs } from '../../helpers/themeHelpers';
3
- import { TextFieldClass } from '../../components/descope-text-field/TextFieldClass';
4
- import { refs } from './inputWrapper';
5
-
6
- const globalRefs = getThemeRefs(globals);
7
- const vars = TextFieldClass.cssVarList;
8
-
9
- export const textField = {
10
- [vars.hostWidth]: refs.width,
11
- [vars.hostMinWidth]: refs.minWidth,
12
- [vars.hostDirection]: refs.direction,
13
- [vars.fontSize]: refs.fontSize,
14
- [vars.fontFamily]: refs.fontFamily,
15
- [vars.labelFontSize]: refs.labelFontSize,
16
- [vars.labelFontWeight]: refs.labelFontWeight,
17
- [vars.inputValueFontWeight]: refs.inputValueFontWeight,
18
- [vars.inputPlaceholderFontWeight]: refs.inputPlaceholderFontWeight,
19
- [vars.helperTextFontWeight]: refs.helperTextFontWeight,
20
- [vars.errorMessageFontWeight]: refs.errorMessageFontWeight,
21
- [vars.labelTextColor]: refs.labelTextColor,
22
- [vars.labelRequiredIndicator]: refs.requiredIndicator,
23
- [vars.errorMessageTextColor]: refs.errorMessageTextColor,
24
- [vars.inputValueTextColor]: refs.valueTextColor,
25
- [vars.inputPlaceholderColor]: refs.placeholderTextColor,
26
- [vars.inputBorderWidth]: refs.borderWidth,
27
- [vars.inputBorderStyle]: refs.borderStyle,
28
- [vars.inputBorderColor]: refs.borderColor,
29
- [vars.inputBorderRadius]: refs.borderRadius,
30
- [vars.inputOutlineWidth]: refs.outlineWidth,
31
- [vars.inputOutlineStyle]: refs.outlineStyle,
32
- [vars.inputOutlineColor]: refs.outlineColor,
33
- [vars.inputOutlineOffset]: refs.outlineOffset,
34
- [vars.inputBackgroundColor]: refs.backgroundColor,
35
- [vars.inputHeight]: refs.inputHeight,
36
- [vars.inputHorizontalPadding]: refs.horizontalPadding,
37
- [vars.helperTextColor]: refs.helperTextColor,
38
- [vars.textAlign]: refs.textAlign,
39
- textAlign: {
40
- right: { [vars.inputTextAlign]: 'right' },
41
- left: { [vars.inputTextAlign]: 'left' },
42
- center: { [vars.inputTextAlign]: 'center' },
43
- },
44
- [vars.labelPosition]: refs.labelPosition,
45
- [vars.labelTopPosition]: refs.labelTopPosition,
46
- [vars.labelHorizontalPosition]: refs.labelHorizontalPosition,
47
- [vars.inputTransformY]: refs.inputTransformY,
48
- [vars.inputTransition]: refs.inputTransition,
49
- [vars.marginInlineStart]: refs.marginInlineStart,
50
- [vars.placeholderOpacity]: refs.placeholderOpacity,
51
- [vars.inputVerticalAlignment]: refs.inputVerticalAlignment,
52
- [vars.valueInputHeight]: refs.valueInputHeight,
53
- [vars.valueInputMarginBottom]: refs.valueInputMarginBottom,
54
- [vars.inputIconOffset]: globalRefs.spacing.md,
55
- [vars.inputIconSize]: refs.inputIconSize,
56
- [vars.inputIconColor]: refs.placeholderTextColor,
57
-
58
- // error message icon
59
- [vars.errorMessageIcon]: refs.errorMessageIcon,
60
- [vars.errorMessageIconSize]: refs.errorMessageIconSize,
61
- [vars.errorMessageIconPadding]: refs.errorMessageIconPadding,
62
- [vars.errorMessageIconRepeat]: refs.errorMessageIconRepeat,
63
- [vars.errorMessageIconPosition]: refs.errorMessageIconPosition,
64
- [vars.errorMessageFontSize]: refs.errorMessageFontSize,
65
-
66
- // obfuscated
67
- [vars.inputTextSecurity]: refs.inputTextSecurity,
68
- };
69
-
70
- export default textField;
71
- export { vars };