@descope/web-components-ui 0.0.1
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/LICENSE +21 -0
- package/README.md +25 -0
- package/dist/cjs/index.cjs.js +18314 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.esm.js +20157 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/umd/1172.js +240 -0
- package/dist/umd/1172.js.LICENSE.txt +23 -0
- package/dist/umd/1396.js +37 -0
- package/dist/umd/1396.js.LICENSE.txt +11 -0
- package/dist/umd/1402.js +1 -0
- package/dist/umd/1484.js +148 -0
- package/dist/umd/1484.js.LICENSE.txt +17 -0
- package/dist/umd/189.js +338 -0
- package/dist/umd/189.js.LICENSE.txt +11 -0
- package/dist/umd/201.js +73 -0
- package/dist/umd/201.js.LICENSE.txt +23 -0
- package/dist/umd/2159.js +608 -0
- package/dist/umd/2159.js.LICENSE.txt +23 -0
- package/dist/umd/2540.js +1 -0
- package/dist/umd/2570.js +338 -0
- package/dist/umd/2570.js.LICENSE.txt +11 -0
- package/dist/umd/2666.js +148 -0
- package/dist/umd/2666.js.LICENSE.txt +11 -0
- package/dist/umd/2755.js +1 -0
- package/dist/umd/3110.js +275 -0
- package/dist/umd/3110.js.LICENSE.txt +23 -0
- package/dist/umd/3191.js +506 -0
- package/dist/umd/3191.js.LICENSE.txt +17 -0
- package/dist/umd/3437.js +2 -0
- package/dist/umd/3437.js.LICENSE.txt +15 -0
- package/dist/umd/3638.js +2 -0
- package/dist/umd/3638.js.LICENSE.txt +5 -0
- package/dist/umd/404.js +148 -0
- package/dist/umd/404.js.LICENSE.txt +17 -0
- package/dist/umd/4114.js +124 -0
- package/dist/umd/4114.js.LICENSE.txt +33 -0
- package/dist/umd/4127.js +449 -0
- package/dist/umd/4127.js.LICENSE.txt +17 -0
- package/dist/umd/4187.js +2 -0
- package/dist/umd/4187.js.LICENSE.txt +5 -0
- package/dist/umd/4218.js +129 -0
- package/dist/umd/4218.js.LICENSE.txt +23 -0
- package/dist/umd/4455.js +422 -0
- package/dist/umd/4455.js.LICENSE.txt +11 -0
- package/dist/umd/4480.js +1 -0
- package/dist/umd/4554.js +303 -0
- package/dist/umd/4554.js.LICENSE.txt +11 -0
- package/dist/umd/4574.js +400 -0
- package/dist/umd/4574.js.LICENSE.txt +23 -0
- package/dist/umd/4619.js +1 -0
- package/dist/umd/4902.js +170 -0
- package/dist/umd/4902.js.LICENSE.txt +23 -0
- package/dist/umd/507.js +279 -0
- package/dist/umd/507.js.LICENSE.txt +11 -0
- package/dist/umd/5096.js +109 -0
- package/dist/umd/5096.js.LICENSE.txt +5 -0
- package/dist/umd/5318.js +1 -0
- package/dist/umd/5414.js +2 -0
- package/dist/umd/5414.js.LICENSE.txt +1 -0
- package/dist/umd/5563.js +319 -0
- package/dist/umd/5563.js.LICENSE.txt +55 -0
- package/dist/umd/7097.js +338 -0
- package/dist/umd/7097.js.LICENSE.txt +11 -0
- package/dist/umd/7150.js +2 -0
- package/dist/umd/7150.js.LICENSE.txt +485 -0
- package/dist/umd/731.js +832 -0
- package/dist/umd/731.js.LICENSE.txt +17 -0
- package/dist/umd/742.js +2 -0
- package/dist/umd/742.js.LICENSE.txt +21 -0
- package/dist/umd/7979.js +419 -0
- package/dist/umd/7979.js.LICENSE.txt +11 -0
- package/dist/umd/8823.js +1 -0
- package/dist/umd/9030.js +381 -0
- package/dist/umd/9030.js.LICENSE.txt +17 -0
- package/dist/umd/9243.js +202 -0
- package/dist/umd/9243.js.LICENSE.txt +51 -0
- package/dist/umd/9478.js +338 -0
- package/dist/umd/9478.js.LICENSE.txt +11 -0
- package/dist/umd/DescopeDev.js +1 -0
- package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +1 -0
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js +2 -0
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js.LICENSE.txt +5 -0
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +2 -0
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.LICENSE.txt +5 -0
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -0
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-internal-index-js.js +1 -0
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -0
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-internal-index-js.js +1 -0
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -0
- package/dist/umd/descope-alert-index-js.js +1 -0
- package/dist/umd/descope-apps-list-index-js.js +1 -0
- package/dist/umd/descope-avatar.js +1 -0
- package/dist/umd/descope-badge-index-js.js +1 -0
- package/dist/umd/descope-button-index-js.js +338 -0
- package/dist/umd/descope-button-index-js.js.LICENSE.txt +11 -0
- package/dist/umd/descope-code-snippet-index-js.js +1 -0
- package/dist/umd/descope-combo-box-index-js.js +113 -0
- package/dist/umd/descope-combo-box-index-js.js.LICENSE.txt +11 -0
- package/dist/umd/descope-container-index-js.js +1 -0
- package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -0
- package/dist/umd/descope-date-field-index-js.js +1 -0
- package/dist/umd/descope-divider-index-js.js +1 -0
- package/dist/umd/descope-email-field-index-js.js +54 -0
- package/dist/umd/descope-email-field-index-js.js.LICENSE.txt +11 -0
- package/dist/umd/descope-enriched-text-index-js.js +1 -0
- package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js +90 -0
- package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js.LICENSE.txt +17 -0
- package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js +105 -0
- package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js.LICENSE.txt +29 -0
- package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +2 -0
- package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js.LICENSE.txt +17 -0
- package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +90 -0
- package/dist/umd/descope-grid-descope-grid-text-column-index-js.js.LICENSE.txt +17 -0
- package/dist/umd/descope-grid-index-js.js +1 -0
- package/dist/umd/descope-hybrid-field-index-js.js +19 -0
- package/dist/umd/descope-hybrid-field-index-js.js.LICENSE.txt +5 -0
- package/dist/umd/descope-icon-index-js.js +1 -0
- package/dist/umd/descope-image-index-js.js +1 -0
- package/dist/umd/descope-link-index-js.js +1 -0
- package/dist/umd/descope-list-index-js.js +1 -0
- package/dist/umd/descope-loader-linear-index-js.js +1 -0
- package/dist/umd/descope-loader-radial-index-js.js +1 -0
- package/dist/umd/descope-logo-index-js.js +1 -0
- package/dist/umd/descope-modal-index-js.js +1 -0
- package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -0
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -0
- package/dist/umd/descope-new-password-index-js.js +1 -0
- package/dist/umd/descope-notification-descope-notification-card-index-js.js +1 -0
- package/dist/umd/descope-notification-index-js.js +1 -0
- package/dist/umd/descope-notp-image-index-js.js +1 -0
- package/dist/umd/descope-number-field-index-js.js +1 -0
- package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -0
- package/dist/umd/descope-passcode-index-js.js +1 -0
- package/dist/umd/descope-password-index-js.js +1 -0
- package/dist/umd/descope-policy-validation-index-js.js +1 -0
- package/dist/umd/descope-radio-group-index-js.js +1 -0
- package/dist/umd/descope-recaptcha-index-js.js +1 -0
- package/dist/umd/descope-scopes-list-index-js.js +2 -0
- package/dist/umd/descope-scopes-list-index-js.js.LICENSE.txt +5 -0
- package/dist/umd/descope-security-questions-setup-index-js.js +1 -0
- package/dist/umd/descope-security-questions-verify-index-js.js +37 -0
- package/dist/umd/descope-security-questions-verify-index-js.js.LICENSE.txt +11 -0
- package/dist/umd/descope-text-area-index-js.js +1 -0
- package/dist/umd/descope-text-field-index-js.js +37 -0
- package/dist/umd/descope-text-field-index-js.js.LICENSE.txt +11 -0
- package/dist/umd/descope-text.js +1 -0
- package/dist/umd/descope-third-party-app-logo-index-js.js +1 -0
- package/dist/umd/descope-totp-image-index-js.js +1 -0
- package/dist/umd/descope-upload-file-index-js.js +1 -0
- package/dist/umd/descope-user-attribute-index-js.js +1 -0
- package/dist/umd/descope-user-auth-method-index-js.js +1 -0
- package/dist/umd/index.js +1 -0
- package/dist/umd/mapping-fields-descope-mappings-field-descope-mapping-item-index-js.js +1 -0
- package/dist/umd/mapping-fields-descope-mappings-field-descope-mappings-field-internal-index-js.js +1 -0
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -0
- package/dist/umd/mapping-fields-descope-saml-group-mappings-descope-saml-group-mappings-internal-index-js.js +1 -0
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -0
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -0
- package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -0
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +37 -0
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.LICENSE.txt +11 -0
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +148 -0
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.LICENSE.txt +17 -0
- package/node_modules/common/.eslintrc.json +18 -0
- package/node_modules/common/README.md +7 -0
- package/node_modules/common/package.json +34 -0
- package/node_modules/common/project.json +7 -0
- package/node_modules/common/src/baseClasses/baseClasses/createBaseClass.js +66 -0
- package/node_modules/common/src/baseClasses/baseClasses/createBaseInputClass.js +14 -0
- package/node_modules/common/src/baseClasses/baseClasses/createCssVarImageClass.js +55 -0
- package/node_modules/common/src/baseClasses/index.js +3 -0
- package/node_modules/common/src/componentsHelpers/index.js +95 -0
- package/node_modules/common/src/componentsMixins/helpers/mixinsHelpers.js +10 -0
- package/node_modules/common/src/componentsMixins/index.js +1 -0
- package/node_modules/common/src/componentsMixins/mixins/activableMixin.js +14 -0
- package/node_modules/common/src/componentsMixins/mixins/changeMixin.js +22 -0
- package/node_modules/common/src/componentsMixins/mixins/componentNameValidationMixin.js +23 -0
- package/node_modules/common/src/componentsMixins/mixins/componentsContextMixin.js +12 -0
- package/node_modules/common/src/componentsMixins/mixins/createDynamicDataMixin.js +100 -0
- package/node_modules/common/src/componentsMixins/mixins/createProxy.js +58 -0
- package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/helpers.js +106 -0
- package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/index.js +167 -0
- package/node_modules/common/src/componentsMixins/mixins/draggableMixin.js +62 -0
- package/node_modules/common/src/componentsMixins/mixins/externalInputHelpers.js +93 -0
- package/node_modules/common/src/componentsMixins/mixins/externalInputMixin.js +170 -0
- package/node_modules/common/src/componentsMixins/mixins/hoverableMixin.js +13 -0
- package/node_modules/common/src/componentsMixins/mixins/index.js +14 -0
- package/node_modules/common/src/componentsMixins/mixins/inputEventsDispatchingMixin.js +76 -0
- package/node_modules/common/src/componentsMixins/mixins/inputValidationMixin.js +210 -0
- package/node_modules/common/src/componentsMixins/mixins/lifecycleEventsMixin.js +23 -0
- package/node_modules/common/src/componentsMixins/mixins/normalizeBooleanAttributesMixin.js +57 -0
- package/node_modules/common/src/componentsMixins/mixins/portalMixin.js +112 -0
- package/node_modules/common/src/componentsMixins/mixins/proxyInputMixin.js +242 -0
- package/node_modules/common/src/constants.js +4 -0
- package/node_modules/common/src/icons/errorMessageIconBase64.js +1 -0
- package/node_modules/common/src/sbControls.js +302 -0
- package/node_modules/common/src/themeHelpers/colorsHelpers.js +94 -0
- package/node_modules/common/src/themeHelpers/componentsThemeManager.js +45 -0
- package/node_modules/common/src/themeHelpers/index.js +176 -0
- package/node_modules/common/src/utils/index.js +68 -0
- package/node_modules/descope-avatar/e2e/descope-avatar.spec.ts +54 -0
- package/node_modules/descope-avatar/package.json +34 -0
- package/node_modules/descope-avatar/project.json +7 -0
- package/node_modules/descope-avatar/src/component/AvatarClass.js +109 -0
- package/node_modules/descope-avatar/src/component/index.js +8 -0
- package/node_modules/descope-avatar/src/theme.js +44 -0
- package/node_modules/descope-avatar/stories/avatar.jpeg +0 -0
- package/node_modules/descope-avatar/stories/descope-avatar.stories.js +32 -0
- package/node_modules/descope-text/e2e/descope-text.spec.ts +35 -0
- package/node_modules/descope-text/package.json +31 -0
- package/node_modules/descope-text/project.json +7 -0
- package/node_modules/descope-text/src/component/TextClass.js +63 -0
- package/node_modules/descope-text/src/component/index.js +5 -0
- package/node_modules/descope-text/src/theme.js +91 -0
- package/node_modules/descope-text/stories/descope-text.stories.js +55 -0
- package/package.json +151 -0
- package/src/baseClasses/createBaseClass.js +66 -0
- package/src/baseClasses/createBaseInputClass.js +16 -0
- package/src/baseClasses/createCssVarImageClass.js +53 -0
- package/src/components/boolean-fields/booleanFieldMixin.js +36 -0
- package/src/components/boolean-fields/commonStyles.js +50 -0
- package/src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js +77 -0
- package/src/components/boolean-fields/descope-boolean-field-internal/index.js +3 -0
- package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +133 -0
- package/src/components/boolean-fields/descope-checkbox/index.js +8 -0
- package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +154 -0
- package/src/components/boolean-fields/descope-switch-toggle/index.js +8 -0
- package/src/components/button-selection-group-fields/baseButtonSelectionGroup.js +171 -0
- package/src/components/button-selection-group-fields/createBaseButtonSelectionGroupInternalClass.js +101 -0
- package/src/components/button-selection-group-fields/descope-button-multi-selection-group/ButtonMultiSelectionGroupClass.js +67 -0
- package/src/components/button-selection-group-fields/descope-button-multi-selection-group/index.js +7 -0
- package/src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/ButtonMultiSelectionGroupInternalClass.js +108 -0
- package/src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/index.js +8 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group/ButtonSelectionGroupClass.js +67 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group/index.js +7 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group-internal/ButtonSelectionGroupInternalClass.js +77 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group-internal/index.js +8 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group-item/ButtonSelectionGroupItemClass.js +115 -0
- package/src/components/button-selection-group-fields/descope-button-selection-group-item/index.js +6 -0
- package/src/components/descope-alert/AlertClass.js +105 -0
- package/src/components/descope-alert/index.js +6 -0
- package/src/components/descope-apps-list/AppsListClass.js +97 -0
- package/src/components/descope-apps-list/index.js +8 -0
- package/src/components/descope-badge/BadgeClass.js +57 -0
- package/src/components/descope-badge/index.js +5 -0
- package/src/components/descope-button/ButtonClass.js +163 -0
- package/src/components/descope-button/clickableMixin.js +10 -0
- package/src/components/descope-button/index.js +6 -0
- package/src/components/descope-code-snippet/CodeSnippetClass.js +238 -0
- package/src/components/descope-code-snippet/helpers.js +9 -0
- package/src/components/descope-code-snippet/index.js +5 -0
- package/src/components/descope-combo-box/ComboBoxClass.js +543 -0
- package/src/components/descope-combo-box/index.js +6 -0
- package/src/components/descope-container/ContainerClass.js +65 -0
- package/src/components/descope-container/index.js +5 -0
- package/src/components/descope-date-field/DateCounterClass.js +83 -0
- package/src/components/descope-date-field/DateFieldClass.js +702 -0
- package/src/components/descope-date-field/consts.js +55 -0
- package/src/components/descope-date-field/descope-calendar/CalendarClass.js +668 -0
- package/src/components/descope-date-field/descope-calendar/helpers.js +186 -0
- package/src/components/descope-date-field/descope-calendar/index.js +9 -0
- package/src/components/descope-date-field/formats.js +49 -0
- package/src/components/descope-date-field/helpers.js +72 -0
- package/src/components/descope-date-field/icons.js +14 -0
- package/src/components/descope-date-field/index.js +10 -0
- package/src/components/descope-divider/DividerClass.js +105 -0
- package/src/components/descope-divider/index.js +6 -0
- package/src/components/descope-email-field/EmailFieldClass.js +90 -0
- package/src/components/descope-email-field/index.js +6 -0
- package/src/components/descope-enriched-text/EnrichedTextClass.js +204 -0
- package/src/components/descope-enriched-text/consts.js +14 -0
- package/src/components/descope-enriched-text/helpers.js +5 -0
- package/src/components/descope-enriched-text/index.js +5 -0
- package/src/components/descope-grid/GridClass.js +368 -0
- package/src/components/descope-grid/descope-grid-custom-column/GridCustomColumnClass.js +31 -0
- package/src/components/descope-grid/descope-grid-custom-column/index.js +7 -0
- package/src/components/descope-grid/descope-grid-item-details-column/GridItemDetailsColumnClass.js +37 -0
- package/src/components/descope-grid/descope-grid-item-details-column/index.js +8 -0
- package/src/components/descope-grid/descope-grid-selection-column/GridSelectionColumnClass.js +58 -0
- package/src/components/descope-grid/descope-grid-selection-column/index.js +7 -0
- package/src/components/descope-grid/descope-grid-text-column/GridTextColumnClass.js +26 -0
- package/src/components/descope-grid/descope-grid-text-column/index.js +6 -0
- package/src/components/descope-grid/helpers.js +74 -0
- package/src/components/descope-grid/index.js +12 -0
- package/src/components/descope-hybrid-field/HybridFieldClass.js +363 -0
- package/src/components/descope-hybrid-field/helpers.js +5 -0
- package/src/components/descope-hybrid-field/index.js +9 -0
- package/src/components/descope-icon/IconClass.js +82 -0
- package/src/components/descope-icon/helpers.js +51 -0
- package/src/components/descope-icon/index.js +5 -0
- package/src/components/descope-image/ImageClass.js +48 -0
- package/src/components/descope-image/index.js +5 -0
- package/src/components/descope-link/LinkClass.js +71 -0
- package/src/components/descope-link/index.js +6 -0
- package/src/components/descope-list/ListClass.js +154 -0
- package/src/components/descope-list/ListItemClass.js +56 -0
- package/src/components/descope-list/index.js +7 -0
- package/src/components/descope-loader-linear/LoaderLinearClass.js +69 -0
- package/src/components/descope-loader-linear/index.js +5 -0
- package/src/components/descope-loader-radial/LoaderRadialClass.js +50 -0
- package/src/components/descope-loader-radial/index.js +5 -0
- package/src/components/descope-logo/LogoClass.js +10 -0
- package/src/components/descope-logo/index.js +5 -0
- package/src/components/descope-modal/ModalClass.js +112 -0
- package/src/components/descope-modal/index.js +6 -0
- package/src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js +676 -0
- package/src/components/descope-multi-select-combo-box/index.js +6 -0
- package/src/components/descope-new-password/NewPasswordClass.js +218 -0
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +246 -0
- package/src/components/descope-new-password/descope-new-password-internal/componentName.js +3 -0
- package/src/components/descope-new-password/descope-new-password-internal/index.js +4 -0
- package/src/components/descope-new-password/index.js +9 -0
- package/src/components/descope-notification/NotificationClass.js +107 -0
- package/src/components/descope-notification/descope-notification-card/NotificationCardClass.js +115 -0
- package/src/components/descope-notification/descope-notification-card/index.js +6 -0
- package/src/components/descope-notification/descope-notification-container.js +13 -0
- package/src/components/descope-notification/index.js +8 -0
- package/src/components/descope-notp-image/NotpImageClass.js +10 -0
- package/src/components/descope-notp-image/index.js +5 -0
- package/src/components/descope-number-field/NumberFieldClass.js +54 -0
- package/src/components/descope-number-field/index.js +6 -0
- package/src/components/descope-passcode/PasscodeClass.js +209 -0
- package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +231 -0
- package/src/components/descope-passcode/descope-passcode-internal/helpers.js +41 -0
- package/src/components/descope-passcode/descope-passcode-internal/index.js +3 -0
- package/src/components/descope-passcode/index.js +8 -0
- package/src/components/descope-password/PasswordClass.js +302 -0
- package/src/components/descope-password/index.js +6 -0
- package/src/components/descope-password/passwordDraggableMixin.js +40 -0
- package/src/components/descope-policy-validation/PolicyValidationClass.js +220 -0
- package/src/components/descope-policy-validation/helpers.js +2 -0
- package/src/components/descope-policy-validation/index.js +5 -0
- package/src/components/descope-radio-group/RadioButtonClass.js +77 -0
- package/src/components/descope-radio-group/RadioGroupClass.js +192 -0
- package/src/components/descope-radio-group/index.js +8 -0
- package/src/components/descope-recaptcha/RecaptchaClass.js +230 -0
- package/src/components/descope-recaptcha/index.js +5 -0
- package/src/components/descope-scopes-list/ScopesListClass.js +131 -0
- package/src/components/descope-scopes-list/index.js +7 -0
- package/src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js +240 -0
- package/src/components/descope-security-questions-setup/index.js +7 -0
- package/src/components/descope-security-questions-verify/SecurityQuestionsVerifyClass.js +232 -0
- package/src/components/descope-security-questions-verify/index.js +7 -0
- package/src/components/descope-text-area/TextAreaClass.js +102 -0
- package/src/components/descope-text-area/index.js +6 -0
- package/src/components/descope-text-field/TextFieldClass.js +142 -0
- package/src/components/descope-text-field/index.js +9 -0
- package/src/components/descope-text-field/textFieldMappings.js +151 -0
- package/src/components/descope-third-party-app-logo/ThirdPartyAppLogoClass.js +103 -0
- package/src/components/descope-third-party-app-logo/arrows.svg +4 -0
- package/src/components/descope-third-party-app-logo/index.js +7 -0
- package/src/components/descope-totp-image/TotpImageClass.js +10 -0
- package/src/components/descope-totp-image/index.js +5 -0
- package/src/components/descope-upload-file/UploadFileClass.js +236 -0
- package/src/components/descope-upload-file/helpers.js +11 -0
- package/src/components/descope-upload-file/index.js +6 -0
- package/src/components/descope-user-attribute/UserAttributeClass.js +245 -0
- package/src/components/descope-user-attribute/delete.svg +3 -0
- package/src/components/descope-user-attribute/edit.svg +3 -0
- package/src/components/descope-user-attribute/index.js +9 -0
- package/src/components/descope-user-auth-method/UserAuthMethodClass.js +204 -0
- package/src/components/descope-user-auth-method/green-v.svg +3 -0
- package/src/components/descope-user-auth-method/index.js +9 -0
- package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +188 -0
- package/src/components/mapping-fields/descope-mappings-field/descope-mapping-item/MappingItem.js +167 -0
- package/src/components/mapping-fields/descope-mappings-field/descope-mapping-item/index.js +3 -0
- package/src/components/mapping-fields/descope-mappings-field/descope-mappings-field-internal/MappingsFieldInternal.js +257 -0
- package/src/components/mapping-fields/descope-mappings-field/descope-mappings-field-internal/index.js +3 -0
- package/src/components/mapping-fields/descope-mappings-field/index.js +14 -0
- package/src/components/mapping-fields/descope-saml-group-mappings/SamlGroupMappingsClass.js +116 -0
- package/src/components/mapping-fields/descope-saml-group-mappings/descope-saml-group-mappings-internal/SamlGroupMappingsInternal.js +136 -0
- package/src/components/mapping-fields/descope-saml-group-mappings/descope-saml-group-mappings-internal/index.js +3 -0
- package/src/components/mapping-fields/descope-saml-group-mappings/index.js +10 -0
- package/src/components/phone-fields/CountryCodes.js +1215 -0
- package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +313 -0
- package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +272 -0
- package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/index.js +6 -0
- package/src/components/phone-fields/descope-phone-field/helpers.js +52 -0
- package/src/components/phone-fields/descope-phone-field/index.js +9 -0
- package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +236 -0
- package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/PhoneFieldInternalInputBox.js +172 -0
- package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/index.js +5 -0
- package/src/components/phone-fields/descope-phone-input-box-field/index.js +9 -0
- package/src/components/phone-fields/helpers.js +5 -0
- package/src/constants.js +4 -0
- package/src/darkTheme.js +52 -0
- package/src/dev/index.js +3 -0
- package/src/helpers/componentHelpers.js +95 -0
- package/src/helpers/index.js +68 -0
- package/src/helpers/mixinsHelpers.js +10 -0
- package/src/helpers/themeHelpers/colorsHelpers.js +94 -0
- package/src/helpers/themeHelpers/index.js +175 -0
- package/src/helpers/themeHelpers/resetHelpers.js +144 -0
- package/src/index.cjs.js +60 -0
- package/src/index.d.ts +72 -0
- package/src/index.js +62 -0
- package/src/index.umd.js +28 -0
- package/src/mixins/activableMixin.js +14 -0
- package/src/mixins/changeMixin.js +22 -0
- package/src/mixins/componentNameValidationMixin.js +23 -0
- package/src/mixins/componentsContextMixin.js +12 -0
- package/src/mixins/createDynamicDataMixin.js +100 -0
- package/src/mixins/createProxy.js +58 -0
- package/src/mixins/createStyleMixin/helpers.js +106 -0
- package/src/mixins/createStyleMixin/index.js +167 -0
- package/src/mixins/draggableMixin.js +62 -0
- package/src/mixins/externalInputHelpers.js +93 -0
- package/src/mixins/externalInputMixin.js +170 -0
- package/src/mixins/hoverableMixin.js +13 -0
- package/src/mixins/index.js +13 -0
- package/src/mixins/inputEventsDispatchingMixin.js +76 -0
- package/src/mixins/inputValidationMixin.js +210 -0
- package/src/mixins/lifecycleEventsMixin.js +23 -0
- package/src/mixins/normalizeBooleanAttributesMixin.js +59 -0
- package/src/mixins/portalMixin.js +111 -0
- package/src/mixins/proxyInputMixin.js +242 -0
- package/src/theme/components/alert.js +88 -0
- package/src/theme/components/appsList.js +36 -0
- package/src/theme/components/badge.js +71 -0
- package/src/theme/components/button.js +133 -0
- package/src/theme/components/buttonSelectionGroup/baseButtonSelectionGroup.js +23 -0
- package/src/theme/components/buttonSelectionGroup/buttonMultiSelectionGroup.js +11 -0
- package/src/theme/components/buttonSelectionGroup/buttonSelectionGroup.js +11 -0
- package/src/theme/components/buttonSelectionGroup/buttonSelectionGroupItem.js +34 -0
- package/src/theme/components/calendar.js +91 -0
- package/src/theme/components/checkbox.js +39 -0
- package/src/theme/components/codeSnippet.js +145 -0
- package/src/theme/components/comboBox.js +93 -0
- package/src/theme/components/container.js +127 -0
- package/src/theme/components/dateField.js +32 -0
- package/src/theme/components/divider.js +49 -0
- package/src/theme/components/emailField.js +50 -0
- package/src/theme/components/enrichedText.js +40 -0
- package/src/theme/components/grid.js +52 -0
- package/src/theme/components/hybridField.js +22 -0
- package/src/theme/components/icon.js +7 -0
- package/src/theme/components/image.js +8 -0
- package/src/theme/components/index.js +124 -0
- package/src/theme/components/inputWrapper.js +130 -0
- package/src/theme/components/link.js +36 -0
- package/src/theme/components/list/list.js +56 -0
- package/src/theme/components/list/listItem.js +41 -0
- package/src/theme/components/loader/index.js +4 -0
- package/src/theme/components/loader/loaderLinear.js +45 -0
- package/src/theme/components/loader/loaderRadial.js +57 -0
- package/src/theme/components/logo.js +10 -0
- package/src/theme/components/mappingsField.js +30 -0
- package/src/theme/components/modal.js +19 -0
- package/src/theme/components/multiSelectComboBox.js +86 -0
- package/src/theme/components/newPassword.js +40 -0
- package/src/theme/components/notificationCard.js +54 -0
- package/src/theme/components/notpImage.js +10 -0
- package/src/theme/components/numberField.js +50 -0
- package/src/theme/components/passcode.js +47 -0
- package/src/theme/components/password.js +55 -0
- package/src/theme/components/phoneField.js +44 -0
- package/src/theme/components/phoneInputBoxField.js +50 -0
- package/src/theme/components/policyValidation.js +29 -0
- package/src/theme/components/radioGroup/radioButton.js +44 -0
- package/src/theme/components/radioGroup/radioGroup.js +42 -0
- package/src/theme/components/samlGroupMappings.js +20 -0
- package/src/theme/components/scopesList.js +15 -0
- package/src/theme/components/securityQuestionsSetup.js +12 -0
- package/src/theme/components/securityQuestionsVerify.js +16 -0
- package/src/theme/components/switchToggle.js +77 -0
- package/src/theme/components/textArea.js +48 -0
- package/src/theme/components/textField.js +63 -0
- package/src/theme/components/thirdPartyAppLogo.js +36 -0
- package/src/theme/components/totpImage.js +10 -0
- package/src/theme/components/uploadFile.js +66 -0
- package/src/theme/components/userAttribute.js +20 -0
- package/src/theme/components/userAuthMethod.js +20 -0
- package/src/theme/globals.js +181 -0
- package/src/theme/index.js +5 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/* eslint-disable no-param-reassign */
|
|
2
|
+
import { compose } from '../../utils';
|
|
3
|
+
import { forwardAttrs, getComponentName } from '../../componentsHelpers';
|
|
4
|
+
import { createDispatchEvent } from '../helpers/mixinsHelpers';
|
|
5
|
+
import { inputValidationMixin } from '../mixins/inputValidationMixin';
|
|
6
|
+
import { createStyleMixin } from '../mixins/createStyleMixin';
|
|
7
|
+
|
|
8
|
+
const errorAttrs = ['invalid', 'required'];
|
|
9
|
+
|
|
10
|
+
const forwardProps = (src, targets, property) => {
|
|
11
|
+
const targetArr = Array.isArray(targets) ? targets : [targets];
|
|
12
|
+
|
|
13
|
+
Object.defineProperty(src, property, {
|
|
14
|
+
set(v) {
|
|
15
|
+
targetArr.forEach((target) => {
|
|
16
|
+
target[property] = v;
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
get() {
|
|
20
|
+
return targets[0][property];
|
|
21
|
+
},
|
|
22
|
+
configurable: true,
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// recursively take the first slot child until it finds an element which is not a slot
|
|
27
|
+
// stops after "nestingLevel" times
|
|
28
|
+
const getNestedInput = (ele) => {
|
|
29
|
+
if (!ele) return undefined;
|
|
30
|
+
|
|
31
|
+
const nestingLevel = 10;
|
|
32
|
+
|
|
33
|
+
let nonSlotEle = ele;
|
|
34
|
+
for (let i = 0; i < nestingLevel; i++) {
|
|
35
|
+
[nonSlotEle] = nonSlotEle.assignedElements();
|
|
36
|
+
if (nonSlotEle?.localName !== 'slot') return nonSlotEle;
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const proxyInputMixin =
|
|
42
|
+
({
|
|
43
|
+
proxyProps = [],
|
|
44
|
+
// useProxyTargets flag allows to forwardProps to other targets, other than
|
|
45
|
+
// `this.inputElement`. It's to be used within `external-input` components,
|
|
46
|
+
// if needed
|
|
47
|
+
useProxyTargets = false,
|
|
48
|
+
// allows us to set the event that should trigger validation
|
|
49
|
+
// it can be either a string or an array of strings (for multiple events)
|
|
50
|
+
inputEvent = 'input',
|
|
51
|
+
triggerValidationEvents = [],
|
|
52
|
+
// Proxies all validations from the parent component to the input element
|
|
53
|
+
proxyParentValidation = false,
|
|
54
|
+
}) =>
|
|
55
|
+
(superclass) =>
|
|
56
|
+
class ProxyInputMixinClass extends inputValidationMixin(superclass) {
|
|
57
|
+
static get observedAttributes() {
|
|
58
|
+
return [...(superclass.observedAttributes || []), ...errorAttrs];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
#inputElement;
|
|
62
|
+
|
|
63
|
+
#dispatchChange = createDispatchEvent.bind(this, 'change');
|
|
64
|
+
|
|
65
|
+
constructor() {
|
|
66
|
+
super();
|
|
67
|
+
|
|
68
|
+
this.#inputElement = super.inputElement;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// the web-component does not loaded immediately, so we want to defer the warning
|
|
72
|
+
// and show it only if the input element was not found after the component is loaded
|
|
73
|
+
warnIfInputElementIsMissing() {
|
|
74
|
+
clearTimeout(this.inputElementTimerId);
|
|
75
|
+
|
|
76
|
+
this.inputElementTimerId = setTimeout(() => {
|
|
77
|
+
// eslint-disable-next-line no-console
|
|
78
|
+
!this.#inputElement && console.warn(this.localName, 'no input was found');
|
|
79
|
+
}, 0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
get inputElement() {
|
|
83
|
+
if (this.#inputElement) return this.#inputElement;
|
|
84
|
+
|
|
85
|
+
this.warnIfInputElementIsMissing();
|
|
86
|
+
|
|
87
|
+
const inputSlot = this.baseElement.shadowRoot?.querySelector('slot[name="input"]');
|
|
88
|
+
const textAreaSlot = this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');
|
|
89
|
+
|
|
90
|
+
this.#inputElement = getNestedInput(inputSlot) || getNestedInput(textAreaSlot);
|
|
91
|
+
|
|
92
|
+
return this.#inputElement;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
set inputElement(ele) {
|
|
96
|
+
this.#inputElement = ele;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
getValidity() {
|
|
100
|
+
return this.inputElement?.validity || {};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
#handleErrorMessage() {
|
|
104
|
+
this.setAttribute('error-message', this.validationMessage);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// We do not want to show the default validity report tooltip
|
|
108
|
+
// So we are overriding the reportValidity fn to show the input's error message
|
|
109
|
+
reportValidity = () => {
|
|
110
|
+
// we want to update validity so in case the value was set programmatically, we won't get an error
|
|
111
|
+
this.inputElement.setCustomValidity('');
|
|
112
|
+
this.setCustomValidity('');
|
|
113
|
+
if (!this.checkValidity()) {
|
|
114
|
+
this.setAttribute('invalid', 'true');
|
|
115
|
+
this.#handleErrorMessage();
|
|
116
|
+
this.focus();
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// we are keeping also the default reportValidity because there are some components that still using it
|
|
121
|
+
defaultReportValidity() {
|
|
122
|
+
return super.reportValidity();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
init() {
|
|
126
|
+
super.init?.();
|
|
127
|
+
|
|
128
|
+
// vaadin sets invalid indication on blur
|
|
129
|
+
// we want invalid indication to appear only when calling reportValidity
|
|
130
|
+
// this is why we are overriding vaadin's setInvalid behavior
|
|
131
|
+
// to update only when the element is valid (so invalid indication will only be removed)
|
|
132
|
+
// and we are adding it in reportValidity
|
|
133
|
+
// eslint-disable-next-line func-names
|
|
134
|
+
this.baseElement._setInvalid = function (invalid) {
|
|
135
|
+
if (!invalid && this._shouldSetInvalid(invalid)) {
|
|
136
|
+
this.invalid = invalid;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// We want to ensure that `input` events properly cross ShadowDOM boundries
|
|
141
|
+
// e.g. When we autofill a component's input with 1Password, for instance,
|
|
142
|
+
// the event is fired without `composed: true` and doesn't our component's
|
|
143
|
+
// ShadowDOM.
|
|
144
|
+
this.baseElement.addEventListener('input', (e) => {
|
|
145
|
+
if (!e.composed) {
|
|
146
|
+
this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
triggerValidationEvents.forEach((e) => {
|
|
151
|
+
this.baseElement?.addEventListener(e, () => {
|
|
152
|
+
this.inputElement?.setCustomValidity('');
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// on some cases the base element is not ready so the inputElement is empty
|
|
157
|
+
// we are deferring this section to make sure the base element is ready
|
|
158
|
+
setTimeout(() => {
|
|
159
|
+
const validationEvents = Array.isArray(inputEvent) ? inputEvent : [inputEvent];
|
|
160
|
+
|
|
161
|
+
validationEvents.forEach((e) => {
|
|
162
|
+
this.baseElement?.addEventListener(e, () => {
|
|
163
|
+
if (!this.baseElement.checkValidity()) {
|
|
164
|
+
this.#handleErrorMessage();
|
|
165
|
+
} else {
|
|
166
|
+
this.removeAttribute('invalid');
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
this.baseElement.addEventListener('change', () => {
|
|
172
|
+
this.#dispatchChange();
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
this.addEventListener('invalid', () => {
|
|
176
|
+
if (!this.checkValidity()) {
|
|
177
|
+
this.setAttribute('invalid', 'true');
|
|
178
|
+
}
|
|
179
|
+
this.#handleErrorMessage();
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// sync properties
|
|
183
|
+
proxyProps.forEach((prop) => {
|
|
184
|
+
const externalInput = this.querySelector('input[slot="external-input"]') || null;
|
|
185
|
+
const proxyTargets = useProxyTargets
|
|
186
|
+
? [this.baseElement, externalInput].filter(Boolean)
|
|
187
|
+
: [];
|
|
188
|
+
forwardProps(this, [this.inputElement, ...proxyTargets], prop);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
this.setSelectionRange = this.inputElement.setSelectionRange?.bind(this.inputElement);
|
|
192
|
+
|
|
193
|
+
forwardAttrs(this, this.inputElement, { includeAttrs: ['inputmode'] });
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
if (proxyParentValidation) {
|
|
197
|
+
// All functions called on the inputElement internals will be applied to the parent
|
|
198
|
+
// component internals as well. As a result, there's no need to add outer mechanisms
|
|
199
|
+
// to update the parent component's validity state based on the input elements validity.
|
|
200
|
+
const inputElementInternals = this.inputElement.internals;
|
|
201
|
+
const parentThis = this;
|
|
202
|
+
this.inputElement.internals = new Proxy(inputElementInternals, {
|
|
203
|
+
get: (target, prop) => {
|
|
204
|
+
if (typeof target[prop] === 'function' && prop === 'setValidity') {
|
|
205
|
+
return (...args) => {
|
|
206
|
+
// If we're calling setValidity with 3 args, then the validationTarget
|
|
207
|
+
// needs to be swapped to be the inputElement
|
|
208
|
+
if (args.length === 3) {
|
|
209
|
+
const newArgs = args.slice(0, args.length - 1);
|
|
210
|
+
newArgs.push(parentThis.inputElement);
|
|
211
|
+
parentThis.internals[prop](...newArgs);
|
|
212
|
+
} else {
|
|
213
|
+
parentThis.internals[prop](...args);
|
|
214
|
+
}
|
|
215
|
+
return target[prop](...args);
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (typeof target[prop] === 'function') {
|
|
220
|
+
return (...args) => {
|
|
221
|
+
parentThis.internals[prop](...args);
|
|
222
|
+
return target[prop](...args);
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return target[prop];
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
const composedProxyInputMixin = (proxyInputMixinConfig) =>
|
|
234
|
+
compose(
|
|
235
|
+
proxyInputMixin(proxyInputMixinConfig),
|
|
236
|
+
// in order to use input-wrapper across all our input components, we need to inject its theme
|
|
237
|
+
// to every proxy input mixin, to allow its css vars to be scoped properly and accessible
|
|
238
|
+
// in the proxy input component
|
|
239
|
+
createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') })
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
export { composedProxyInputMixin as proxyInputMixin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default `data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjZTIxZDEyIiB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIA0KCSB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAzMC4zMzQgMzAuMzM0Ig0KCSB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0xNS4xNjcsMEM2LjgwNSwwLDAuMDAxLDYuODA0LDAuMDAxLDE1LjE2N2MwLDguMzYyLDYuODA0LDE1LjE2NywxNS4xNjYsMTUuMTY3YzguMzYxLDAsMTUuMTY2LTYuODA1LDE1LjE2Ni0xNS4xNjcNCgkJQzMwLjMzMyw2LjgwNCwyMy41MjgsMCwxNS4xNjcsMHogTTE3LjE2NywyNS42NjdoLTR2LTQuNWg0VjI1LjY2N3ogTTE3LjE2NywxOS41NDJoLTRWNS4xNjdoNFYxOS41NDJ6Ii8+DQo8L2c+DQo8L3N2Zz4=`;
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import errorMessageIconBase64 from './icons/errorMessageIconBase64';
|
|
2
|
+
|
|
3
|
+
export const labelControl = {
|
|
4
|
+
label: {
|
|
5
|
+
name: 'Label',
|
|
6
|
+
control: { type: 'text' },
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const helperTextControl = {
|
|
11
|
+
'helper-text': {
|
|
12
|
+
name: 'Helper Text',
|
|
13
|
+
control: { type: 'text' },
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const placeholderControl = {
|
|
18
|
+
placeholder: {
|
|
19
|
+
name: 'Placeholder',
|
|
20
|
+
control: { type: 'text' },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const sizeControl = {
|
|
25
|
+
size: {
|
|
26
|
+
name: 'Size',
|
|
27
|
+
options: ['xs', 'sm', 'md', 'lg'],
|
|
28
|
+
control: { type: 'select' },
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const loadingControl = {
|
|
33
|
+
loading: {
|
|
34
|
+
name: 'Loading',
|
|
35
|
+
control: { type: 'boolean' },
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const fullWidthControl = {
|
|
40
|
+
'full-width': {
|
|
41
|
+
name: 'Full Width',
|
|
42
|
+
control: { type: 'boolean' },
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const disabledControl = {
|
|
47
|
+
disabled: {
|
|
48
|
+
name: 'Disabled',
|
|
49
|
+
control: { type: 'boolean' },
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const readOnlyControl = {
|
|
54
|
+
readonly: {
|
|
55
|
+
name: 'Read Only',
|
|
56
|
+
control: { type: 'boolean' },
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const requiredControl = {
|
|
61
|
+
required: {
|
|
62
|
+
name: 'Required',
|
|
63
|
+
control: { type: 'boolean' },
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const directionControl = {
|
|
68
|
+
direction: {
|
|
69
|
+
name: 'Direction',
|
|
70
|
+
options: ['ltr', 'rtl'],
|
|
71
|
+
control: { type: 'select' },
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const borderedControl = {
|
|
76
|
+
bordered: {
|
|
77
|
+
name: 'Bordered',
|
|
78
|
+
control: { type: 'boolean' },
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const minLengthControl = {
|
|
83
|
+
minlength: {
|
|
84
|
+
name: 'Min. Length',
|
|
85
|
+
control: { type: 'text' },
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const maxLengthControl = {
|
|
90
|
+
maxlength: {
|
|
91
|
+
name: 'Max. Length',
|
|
92
|
+
control: { type: 'text' },
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const textContentControl = {
|
|
97
|
+
text: {
|
|
98
|
+
name: 'Content',
|
|
99
|
+
control: { type: 'text' },
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const modeControl = {
|
|
104
|
+
mode: {
|
|
105
|
+
name: 'Mode',
|
|
106
|
+
options: ['none', 'primary', 'secondary', 'success', 'error'],
|
|
107
|
+
control: { type: 'select' },
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export const textAlignControl = {
|
|
112
|
+
'text-align': {
|
|
113
|
+
name: 'Text Align',
|
|
114
|
+
options: ['left', 'center', 'right'],
|
|
115
|
+
control: { type: 'select' },
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export const errorMissingValueControl = {
|
|
120
|
+
'data-errormessage-value-missing': {
|
|
121
|
+
name: 'Custom Error: Mandatory',
|
|
122
|
+
control: { type: 'text' },
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const errorPatternMismatchControl = {
|
|
127
|
+
'data-errormessage-pattern-mismatch': {
|
|
128
|
+
name: 'Custom Error: Pattern Mismatch',
|
|
129
|
+
control: { type: 'text' },
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export const errorTypeMismatchControl = {
|
|
134
|
+
'data-errormessage-type-mismatch': {
|
|
135
|
+
name: 'Custom Error: Type Mismatch',
|
|
136
|
+
control: { type: 'text' },
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const errorBadInputControl = {
|
|
141
|
+
'data-errormessage-bad-input': {
|
|
142
|
+
name: 'Custom Error: Bad Input',
|
|
143
|
+
control: { type: 'text' },
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const errorRangeUnderflowControl = {
|
|
148
|
+
'data-errormessage-range-underflow': {
|
|
149
|
+
name: 'Custom Error: Below minimum value',
|
|
150
|
+
control: { type: 'text' },
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const errorRangeOverflowControl = {
|
|
155
|
+
'data-errormessage-range-overflow': {
|
|
156
|
+
name: 'Custom Error: Exceeds maximum value',
|
|
157
|
+
control: { type: 'text' },
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const fillControl = {
|
|
162
|
+
'st-fill': {
|
|
163
|
+
name: 'Fill',
|
|
164
|
+
control: { type: 'color' },
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export const customHeightControl = {
|
|
169
|
+
'st-host-height': {
|
|
170
|
+
name: 'Custom Height',
|
|
171
|
+
control: { type: 'text' },
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export const customWidthControl = {
|
|
176
|
+
'st-host-width': {
|
|
177
|
+
name: 'Custom Width',
|
|
178
|
+
control: { type: 'text' },
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export const checkboxValueControl = {
|
|
183
|
+
checked: {
|
|
184
|
+
name: 'Checked',
|
|
185
|
+
control: { type: 'boolean' },
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export const buttonVariantControl = {
|
|
190
|
+
variant: {
|
|
191
|
+
name: 'Button Variant',
|
|
192
|
+
options: ['contained', 'outline', 'link'],
|
|
193
|
+
control: { type: 'select' },
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export const boxShadowControl = {
|
|
198
|
+
shadow: {
|
|
199
|
+
name: 'Shadow',
|
|
200
|
+
options: ['sm', 'md', 'lg', 'xl', '2xl'],
|
|
201
|
+
control: { type: 'select' },
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export const borderRadiusControl = {
|
|
206
|
+
'border-radius': {
|
|
207
|
+
name: 'Radius',
|
|
208
|
+
options: ['sm', 'md', 'lg', 'xl', '2xl', '3xl'],
|
|
209
|
+
control: { type: 'select' },
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export const imgSrcControl = {
|
|
214
|
+
src: {
|
|
215
|
+
name: 'Image Source',
|
|
216
|
+
control: { type: 'text' },
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export const typographyVariantControl = {
|
|
221
|
+
variant: {
|
|
222
|
+
name: 'Variant',
|
|
223
|
+
options: ['h1', 'h2', 'h3', 'subtitle1', 'subtitle2', 'body1', 'body2'],
|
|
224
|
+
control: { type: 'select' },
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
export const overrideRenderItemControl = {
|
|
229
|
+
overrideRenderItem: {
|
|
230
|
+
name: 'Override the default item renderer function',
|
|
231
|
+
control: { type: 'boolean' },
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
export const itemsSourceControl = {
|
|
236
|
+
itemsSource: {
|
|
237
|
+
name: 'Where to take the items from',
|
|
238
|
+
control: {
|
|
239
|
+
type: 'select',
|
|
240
|
+
options: {
|
|
241
|
+
Children: 'children',
|
|
242
|
+
'"data" attribute': 'attr',
|
|
243
|
+
'"data" property': 'prop',
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export const minItemsSelectionControl = {
|
|
250
|
+
minItemsSelection: {
|
|
251
|
+
name: 'Min Items Selection',
|
|
252
|
+
control: { type: 'number' },
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
export const maxItemsSelectionControl = {
|
|
257
|
+
maxItemsSelection: {
|
|
258
|
+
name: 'Max Items Selection',
|
|
259
|
+
control: { type: 'number' },
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export const labelSpacingControl = {
|
|
264
|
+
'label-spacing': {
|
|
265
|
+
name: 'Label Spacing',
|
|
266
|
+
control: { type: 'range', min: 0, max: 200, step: 1 },
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export const inputLabelTypeControl = {
|
|
271
|
+
'label-type': {
|
|
272
|
+
name: 'Label Type',
|
|
273
|
+
control: {
|
|
274
|
+
type: 'select',
|
|
275
|
+
options: ['static', 'floating'],
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
export const inputCopyToClipboardControl = {
|
|
281
|
+
'copy-to-clipboard': {
|
|
282
|
+
name: 'Copy to clipboard',
|
|
283
|
+
control: {
|
|
284
|
+
type: 'boolean',
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
export const errorMessageIconControl = {
|
|
290
|
+
errorMsgIcon: {
|
|
291
|
+
name: 'Error Message Icon',
|
|
292
|
+
control: {
|
|
293
|
+
type: 'boolean',
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
export const errorMessageIconAttrs = `
|
|
299
|
+
st-error-message-icon="url(${errorMessageIconBase64})"
|
|
300
|
+
st-error-message-icon-size="14px"
|
|
301
|
+
st-error-message-icon-padding="1.5em"
|
|
302
|
+
`;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import Color from 'color';
|
|
2
|
+
|
|
3
|
+
const colorGaps = {
|
|
4
|
+
darkLight: 0.4,
|
|
5
|
+
highlight: 0.8,
|
|
6
|
+
contrast: 1,
|
|
7
|
+
edgeColor: {
|
|
8
|
+
darkLight: 0.25,
|
|
9
|
+
highlight: 0.1,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const darken = (c, percentage) => c.darken(percentage).hex();
|
|
14
|
+
|
|
15
|
+
const contrast = (c) => {
|
|
16
|
+
const isDark = c.isDark();
|
|
17
|
+
return c
|
|
18
|
+
.mix(Color(isDark ? 'white' : 'black'), colorGaps.contrast)
|
|
19
|
+
.saturate(1)
|
|
20
|
+
.hex();
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const lighten = (c, percentage) => {
|
|
24
|
+
const isDark = c.lightness() < 0.5;
|
|
25
|
+
|
|
26
|
+
if (isDark) {
|
|
27
|
+
return c.lightness(percentage * 100).hex();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return c.lighten(percentage).hex();
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const isNearBlack = (color) => color.luminosity() < 0.01;
|
|
34
|
+
const isNearWhite = (color) => color.luminosity() > 0.99;
|
|
35
|
+
|
|
36
|
+
const generateDarkColor = (color, theme) => {
|
|
37
|
+
if (theme === 'dark') {
|
|
38
|
+
return isNearWhite(color)
|
|
39
|
+
? darken(color, colorGaps.edgeColor.darkLight)
|
|
40
|
+
: lighten(color, colorGaps.darkLight);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return isNearBlack(color)
|
|
44
|
+
? lighten(color, colorGaps.edgeColor.darkLight)
|
|
45
|
+
: darken(color, colorGaps.darkLight);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const generateLightColor = (color, theme) => {
|
|
49
|
+
if (theme === 'dark') {
|
|
50
|
+
return isNearBlack(color)
|
|
51
|
+
? lighten(color, colorGaps.edgeColor.darkLight)
|
|
52
|
+
: darken(color, colorGaps.darkLight);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return isNearWhite(color)
|
|
56
|
+
? darken(color, colorGaps.edgeColor.darkLight)
|
|
57
|
+
: lighten(color, colorGaps.darkLight);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const generateHighlightColor = (color, theme) => {
|
|
61
|
+
if (theme === 'dark') {
|
|
62
|
+
return isNearBlack(color)
|
|
63
|
+
? lighten(color, colorGaps.edgeColor.highlight)
|
|
64
|
+
: darken(color, colorGaps.highlight);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return isNearWhite(color)
|
|
68
|
+
? darken(color, colorGaps.edgeColor.highlight)
|
|
69
|
+
: lighten(color, colorGaps.highlight);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const genColor = (color, theme) => {
|
|
73
|
+
const mainColor = new Color(color.main || color);
|
|
74
|
+
|
|
75
|
+
const res = {
|
|
76
|
+
main: mainColor.hex(),
|
|
77
|
+
dark: color.dark || generateDarkColor(mainColor, theme),
|
|
78
|
+
light: color.light || generateLightColor(mainColor, theme),
|
|
79
|
+
highlight: color.highlight || generateHighlightColor(mainColor, theme),
|
|
80
|
+
contrast: color.contrast || contrast(mainColor),
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return res;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const genColors = (colors) => {
|
|
87
|
+
return Object.keys(colors).reduce((acc, colorName) => {
|
|
88
|
+
const currentColor = colors[colorName];
|
|
89
|
+
|
|
90
|
+
return Object.assign(acc, {
|
|
91
|
+
[colorName]: genColor(currentColor),
|
|
92
|
+
});
|
|
93
|
+
}, {});
|
|
94
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
class ComponentsThemeManager {
|
|
2
|
+
static mountOnPropName = 'DescopeThemeManager';
|
|
3
|
+
|
|
4
|
+
#themes = {};
|
|
5
|
+
|
|
6
|
+
#currentThemeName = 'light';
|
|
7
|
+
|
|
8
|
+
#callbacks = new Set();
|
|
9
|
+
|
|
10
|
+
#notify() {
|
|
11
|
+
this.#callbacks.forEach((cb) => cb?.());
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get currentThemeName() {
|
|
15
|
+
return this.#currentThemeName;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
set currentThemeName(themeName) {
|
|
19
|
+
this.#currentThemeName = themeName;
|
|
20
|
+
this.#notify();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get currentTheme() {
|
|
24
|
+
return this.#themes[this.currentThemeName];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
onCurrentThemeChange(cb) {
|
|
28
|
+
this.#callbacks.add(cb);
|
|
29
|
+
|
|
30
|
+
return () => {
|
|
31
|
+
this.#callbacks.delete(cb);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
set themes(themes) {
|
|
36
|
+
this.#themes = themes;
|
|
37
|
+
this.#notify();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get hasThemes() {
|
|
41
|
+
return !!Object.keys(this.#themes).length;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const componentsThemeManager = new ComponentsThemeManager();
|