@cupra/ui-kit 1.0.0-canary.8 → 1.0.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/README.md +5 -3
- package/dist/components/base/DsUiElement.js +47 -0
- package/dist/components/base/UiKitElement.js +82 -0
- package/dist/components/base/ds-base-input/ds-base-input.js +112 -0
- package/dist/components/base/ds-base-input/styles/common.styles.js +63 -0
- package/dist/components/base/ds-base-input/styles/cupra.styles.js +124 -0
- package/dist/components/base/ds-base-progress-bar/ds-base-progress-bar.js +64 -0
- package/dist/components/base/ds-base-progress-bar/styles/common.styles.js +22 -0
- package/dist/components/base/ds-base-progress-bar/styles/cupra-diagonal.styles.js +27 -0
- package/dist/components/base/ds-base-progress-bar/styles/cupra.styles.js +27 -0
- package/dist/components/base/ds-base-progress-bar/styles/seat.styles.js +8 -0
- package/dist/components/ds-accordion/ds-accordion.js +124 -0
- package/dist/components/ds-accordion/styles/common.styles.js +64 -0
- package/dist/components/ds-accordion/theme-config.js +26 -0
- package/dist/components/ds-avatar/ds-avatar.js +102 -0
- package/dist/components/ds-avatar/styles/common.styles.js +12 -0
- package/dist/components/ds-badge/ds-badge.d.ts +18 -0
- package/dist/components/ds-badge/ds-badge.js +53 -0
- package/dist/components/ds-badge/ds-badge.test.d.ts +8 -0
- package/dist/components/ds-badge/ds-badge.types.d.ts +6 -0
- package/dist/components/ds-badge/styles/common.styles.d.ts +1 -0
- package/dist/components/ds-badge/styles/common.styles.js +9 -0
- package/dist/components/ds-badge/styles/cupra-diagonal.styles.d.ts +1 -0
- package/dist/components/ds-badge/styles/cupra-diagonal.styles.js +47 -0
- package/dist/components/ds-bullets/ds-bullets.js +79 -0
- package/dist/components/ds-bullets/styles/common.styles.js +26 -0
- package/dist/components/ds-button/ds-button.js +196 -0
- package/dist/components/ds-button/styles/common.styles.js +116 -0
- package/dist/components/ds-carousel-indicator/ds-carousel-indicator.js +63 -0
- package/dist/components/ds-carousel-indicator/styles/common.styles.js +19 -0
- package/dist/components/ds-checkbox/ds-checkbox.js +142 -0
- package/dist/components/ds-checkbox/styles/common.styles.js +60 -0
- package/dist/components/ds-chip/ds-chip.js +131 -0
- package/dist/components/ds-chip/styles/common.styles.js +25 -0
- package/dist/components/ds-chips/ds-chips.js +143 -0
- package/dist/components/ds-chips/styles/common.styles.js +94 -0
- package/dist/components/ds-currency/ds-currency.js +139 -0
- package/dist/components/ds-currency/styles/common.styles.js +17 -0
- package/dist/components/ds-dialog/ds-dialog.js +107 -0
- package/dist/components/ds-dialog/styles/common.styles.js +82 -0
- package/dist/components/ds-dialog-body/ds-dialog-body.js +46 -0
- package/dist/components/ds-dialog-body/styles/common.styles.js +12 -0
- package/dist/components/ds-dialog-footer/ds-dialog-footer.js +47 -0
- package/dist/components/ds-dialog-footer/styles/common.styles.js +16 -0
- package/dist/components/ds-dialog-header/ds-dialog-header.js +68 -0
- package/dist/components/ds-dialog-header/styles/common.styles.js +12 -0
- package/dist/components/ds-divider/ds-divider.js +58 -0
- package/dist/components/ds-divider/styles/common.styles.js +13 -0
- package/dist/components/ds-hyperlink/ds-hyperlink.js +93 -0
- package/dist/components/ds-hyperlink/styles/common.styles.js +22 -0
- package/dist/components/ds-icon/Icons.type.d.ts +1 -1
- package/dist/components/ds-icon/ds-icon.js +105 -0
- package/dist/components/ds-icon/iconNames.d.ts +1 -1
- package/dist/components/ds-icon/iconNames.js +394 -0
- package/dist/components/ds-icon-button/ds-icon-button.js +138 -0
- package/dist/components/ds-icon-button/styles/common.styles.js +24 -0
- package/dist/components/ds-input/ds-input.js +138 -0
- package/dist/components/ds-interactive-card/ds-interactive-card.js +90 -0
- package/dist/components/ds-interactive-card/styles/common.styles.js +12 -0
- package/dist/components/ds-link-button/ds-link-button.js +120 -0
- package/dist/components/ds-link-button/styles/common.styles.js +24 -0
- package/dist/components/ds-loader-bar/ds-loader-bar.js +23 -0
- package/dist/components/ds-loader-bar/styles/common.styles.js +23 -0
- package/dist/components/ds-loader-dots/ds-loader-dots.js +62 -0
- package/dist/components/ds-loader-dots/styles/common.styles.js +35 -0
- package/dist/components/ds-loader-logo/ds-loader-logo.js +65 -0
- package/dist/components/ds-loader-logo/ds-loader-logo.styles.js +67 -0
- package/dist/components/ds-loader-spinner/ds-loader-spinner.js +53 -0
- package/dist/components/ds-loader-spinner/styles/common.styles.js +56 -0
- package/dist/components/ds-logo/ds-logo.js +69 -0
- package/dist/components/ds-logo/styles/common.styles.js +18 -0
- package/dist/components/ds-main-title/ds-main-title.d.ts +10 -0
- package/dist/components/ds-main-title/ds-main-title.js +35 -0
- package/dist/components/ds-main-title/ds-main-title.test.d.ts +7 -0
- package/dist/components/ds-main-title/ds-main-title.types.d.ts +2 -0
- package/dist/components/ds-main-title/styles/common.styles.d.ts +1 -0
- package/dist/components/ds-main-title/styles/common.styles.js +19 -0
- package/dist/components/ds-map-pin/ds-map-pin.js +116 -0
- package/dist/components/ds-map-pin/styles/common.styles.js +43 -0
- package/dist/components/ds-modal/ds-modal.js +215 -0
- package/dist/components/ds-modal/styles/common.styles.js +289 -0
- package/dist/components/ds-password-input/ds-password-input.js +43 -0
- package/dist/components/ds-picker-item/ds-picker-item.js +89 -0
- package/dist/components/ds-picker-item/styles/common.styles.js +12 -0
- package/dist/components/ds-portal/ds-portal.js +41 -0
- package/dist/components/ds-progress-bar/ds-progress-bar.js +34 -0
- package/dist/components/ds-progress-bar/styles/common.styles.js +12 -0
- package/dist/components/ds-radio/ds-radio.js +111 -0
- package/dist/components/ds-radio/styles/common.styles.js +44 -0
- package/dist/components/ds-radio-button/ds-radio-button.js +185 -0
- package/dist/components/ds-radio-button/styles/common.styles.js +52 -0
- package/dist/components/ds-radio-button-group/ds-radio-button-group.js +83 -0
- package/dist/components/ds-radio-button-group/styles/common.styles.js +25 -0
- package/dist/components/ds-radio-group/ds-radio-group.js +79 -0
- package/dist/components/ds-radio-group/ds-radio-group.styles.js +21 -0
- package/dist/components/ds-rating/ds-rating.d.ts +14 -0
- package/dist/components/ds-rating/ds-rating.js +73 -0
- package/dist/components/ds-rating/ds-rating.test.d.ts +8 -0
- package/dist/components/ds-rating/ds-rating.types.d.ts +6 -0
- package/dist/components/ds-rating/styles/common.styles.d.ts +1 -0
- package/dist/components/ds-rating/styles/common.styles.js +14 -0
- package/dist/components/ds-search/ds-search.js +210 -0
- package/dist/components/ds-search/styles/common.styles.js +61 -0
- package/dist/components/ds-search-input/ds-search-input.js +158 -0
- package/dist/components/ds-search-input/styles/common.styles.js +12 -0
- package/dist/components/ds-secondary-navigation/ds-secondary-navigation.js +233 -0
- package/dist/components/ds-secondary-navigation/styles/common.styles.js +12 -0
- package/dist/components/ds-segmented-control/ds-segmented-control.js +71 -0
- package/dist/components/ds-segmented-control/styles/common.styles.js +56 -0
- package/dist/components/ds-select/controllers/SelectKeyboardController.js +33 -0
- package/dist/components/ds-select/ds-select.js +274 -0
- package/dist/components/ds-select/styles/common.styles.js +29 -0
- package/dist/components/ds-selection/ds-selection.js +57 -0
- package/dist/components/ds-selection/styles/common.styles.js +17 -0
- package/dist/components/ds-sidebar-navigation/ds-sidebar-navigation.js +102 -0
- package/dist/components/ds-sidebar-navigation/styles/common.styles.js +25 -0
- package/dist/components/ds-slider/ds-slider.js +409 -0
- package/dist/components/ds-slider/styles/common.styles.js +61 -0
- package/dist/components/ds-slider/utils/getStepValue/getStepValue.js +28 -0
- package/dist/components/ds-slider/utils/roundToDecimals/roundToDecimals.js +7 -0
- package/dist/components/ds-static-box/ds-static-box.js +77 -0
- package/dist/components/ds-static-box/styles/common.styles.js +12 -0
- package/dist/components/ds-stepper/ds-stepper.js +57 -0
- package/dist/components/ds-stepper/styles/common.styles.js +12 -0
- package/dist/components/ds-tabs/ds-tabs.js +203 -0
- package/dist/components/ds-tabs/styles/common.styles.js +97 -0
- package/dist/components/ds-tabs/theme-config.js +14 -0
- package/dist/components/ds-tag/ds-tag.js +87 -0
- package/dist/components/ds-tag/styles/common.styles.js +20 -0
- package/dist/components/ds-text/ds-text.js +83 -0
- package/dist/components/ds-text/styles/common.styles.js +29 -0
- package/dist/components/ds-text-input/ds-text-input.js +100 -0
- package/dist/components/ds-text-input/styles/common.styles.js +12 -0
- package/dist/components/ds-textarea/ds-textarea.js +87 -0
- package/dist/components/ds-textarea/styles/common.styles.js +12 -0
- package/dist/components/ds-theme-provider/ds-theme-provider.js +90 -0
- package/dist/components/ds-theme-provider/themeContext.js +5 -0
- package/dist/components/ds-toast/ds-toast.js +95 -0
- package/dist/components/ds-toast/styles/common.styles.js +112 -0
- package/dist/components/ds-toast/utils/ToastManager.js +48 -0
- package/dist/components/ds-toast-message/ds-toast-message.js +103 -0
- package/dist/components/ds-toast-message/styles/common.styles.js +12 -0
- package/dist/components/ds-toggle-button/ds-toggle-button.js +73 -0
- package/dist/components/ds-toggle-switch/ds-toggle-switch.js +100 -0
- package/dist/components/ds-toggle-switch/styles/common.styles.js +47 -0
- package/dist/components/ds-tooltip/ds-tooltip.d.ts +38 -23
- package/dist/components/ds-tooltip/ds-tooltip.js +234 -0
- package/dist/components/ds-tooltip/ds-tooltip.test.d.ts +8 -0
- package/dist/components/ds-tooltip/ds-tooltip.types.d.ts +5 -10
- package/dist/components/ds-tooltip/styles/common.styles.d.ts +0 -2
- package/dist/components/ds-tooltip/styles/common.styles.js +130 -0
- package/dist/components/index.d.ts +4 -1
- package/dist/core/theme.constants.d.ts +1 -0
- package/dist/core/theme.constants.js +4 -0
- package/dist/decorators/customUiKitElement.js +23 -0
- package/dist/index.js +61 -9699
- package/dist/mixins/FormAssociatedMixin.js +14 -0
- package/dist/mixins/ViewportMixin.js +32 -0
- package/dist/mixins/inputStatesMixin.js +46 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js +430 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +313 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +132 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
- package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/context-request-event.js +13 -0
- package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.js +29 -0
- package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/controllers/context-provider.js +37 -0
- package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/create-context.js +11 -0
- package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/consume.js +22 -0
- package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.js +42 -0
- package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/value-notifier.js +36 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js +50 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/base.js +9 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js +37 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +19 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-nodes.js +19 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js +20 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js +12 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js +252 -0
- package/dist/node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js +51 -0
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.js +37 -0
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.js +27 -0
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.js +12 -0
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js +34 -0
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.js +10 -0
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/repeat.js +61 -0
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js +27 -0
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.js +11 -0
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js +243 -0
- package/dist/styles/fonts-config.js +28 -0
- package/dist/utils/IconsManager.d.ts +1 -4
- package/dist/utils/IconsManager.js +39 -0
- package/dist/utils/PubSub.d.ts +0 -2
- package/dist/utils/PubSub.js +33 -0
- package/dist/utils/StylesRegistry/StylesRegistry.js +32 -0
- package/dist/utils/arrayConverter.js +19 -0
- package/dist/utils/booleanConverter.js +4 -0
- package/dist/utils/componentFactory.js +167 -0
- package/dist/utils/cssQueries.js +16 -0
- package/dist/utils/cssWithTokens.js +11 -0
- package/dist/utils/formatNumber/formatNumber.js +54 -0
- package/dist/utils/htmlWithTokens.js +11 -0
- package/dist/utils/objectConverter.js +11 -0
- package/dist/utils/validateMaxLength.js +6 -0
- package/dist-react/components/base/DsUiElement.js +47 -0
- package/dist-react/components/base/UiKitElement.js +82 -0
- package/dist-react/components/base/ds-base-input/ds-base-input.js +112 -0
- package/dist-react/components/base/ds-base-input/styles/common.styles.js +63 -0
- package/dist-react/components/base/ds-base-input/styles/cupra.styles.js +124 -0
- package/dist-react/components/base/ds-base-progress-bar/ds-base-progress-bar.js +64 -0
- package/dist-react/components/base/ds-base-progress-bar/styles/common.styles.js +22 -0
- package/dist-react/components/base/ds-base-progress-bar/styles/cupra-diagonal.styles.js +27 -0
- package/dist-react/components/base/ds-base-progress-bar/styles/cupra.styles.js +27 -0
- package/dist-react/components/base/ds-base-progress-bar/styles/seat.styles.js +8 -0
- package/dist-react/components/ds-accordion/ds-accordion.js +124 -0
- package/dist-react/components/ds-accordion/styles/common.styles.js +64 -0
- package/dist-react/components/ds-accordion/theme-config.js +26 -0
- package/dist-react/components/ds-avatar/ds-avatar.js +102 -0
- package/dist-react/components/ds-avatar/styles/common.styles.js +12 -0
- package/dist-react/components/ds-badge/ds-badge.d.ts +18 -0
- package/dist-react/components/ds-badge/ds-badge.js +53 -0
- package/dist-react/components/ds-badge/ds-badge.test.d.ts +8 -0
- package/dist-react/components/ds-badge/ds-badge.types.d.ts +6 -0
- package/dist-react/components/ds-badge/styles/common.styles.d.ts +1 -0
- package/dist-react/components/ds-badge/styles/common.styles.js +9 -0
- package/dist-react/components/ds-badge/styles/cupra-diagonal.styles.d.ts +1 -0
- package/dist-react/components/ds-badge/styles/cupra-diagonal.styles.js +47 -0
- package/dist-react/components/ds-bullets/ds-bullets.js +79 -0
- package/dist-react/components/ds-bullets/styles/common.styles.js +26 -0
- package/dist-react/components/ds-button/ds-button.js +196 -0
- package/dist-react/components/ds-button/styles/common.styles.js +116 -0
- package/dist-react/components/ds-carousel-indicator/ds-carousel-indicator.js +63 -0
- package/dist-react/components/ds-carousel-indicator/styles/common.styles.js +19 -0
- package/dist-react/components/ds-checkbox/ds-checkbox.js +142 -0
- package/dist-react/components/ds-checkbox/styles/common.styles.js +60 -0
- package/dist-react/components/ds-chip/ds-chip.js +131 -0
- package/dist-react/components/ds-chip/styles/common.styles.js +25 -0
- package/dist-react/components/ds-chips/ds-chips.js +143 -0
- package/dist-react/components/ds-chips/styles/common.styles.js +94 -0
- package/dist-react/components/ds-currency/ds-currency.js +139 -0
- package/dist-react/components/ds-currency/styles/common.styles.js +17 -0
- package/dist-react/components/ds-dialog/ds-dialog.js +107 -0
- package/dist-react/components/ds-dialog/styles/common.styles.js +82 -0
- package/dist-react/components/ds-dialog-body/ds-dialog-body.js +46 -0
- package/dist-react/components/ds-dialog-body/styles/common.styles.js +12 -0
- package/dist-react/components/ds-dialog-footer/ds-dialog-footer.js +47 -0
- package/dist-react/components/ds-dialog-footer/styles/common.styles.js +16 -0
- package/dist-react/components/ds-dialog-header/ds-dialog-header.js +68 -0
- package/dist-react/components/ds-dialog-header/styles/common.styles.js +12 -0
- package/dist-react/components/ds-divider/ds-divider.js +58 -0
- package/dist-react/components/ds-divider/styles/common.styles.js +13 -0
- package/dist-react/components/ds-hyperlink/ds-hyperlink.js +93 -0
- package/dist-react/components/ds-hyperlink/styles/common.styles.js +22 -0
- package/dist-react/components/ds-icon/Icons.type.d.ts +1 -1
- package/dist-react/components/ds-icon/ds-icon.js +105 -0
- package/dist-react/components/ds-icon/iconNames.d.ts +1 -1
- package/dist-react/components/ds-icon/iconNames.js +394 -0
- package/dist-react/components/ds-icon-button/ds-icon-button.js +138 -0
- package/dist-react/components/ds-icon-button/styles/common.styles.js +24 -0
- package/dist-react/components/ds-input/ds-input.js +138 -0
- package/dist-react/components/ds-interactive-card/ds-interactive-card.js +90 -0
- package/dist-react/components/ds-interactive-card/styles/common.styles.js +12 -0
- package/dist-react/components/ds-link-button/ds-link-button.js +120 -0
- package/dist-react/components/ds-link-button/styles/common.styles.js +24 -0
- package/dist-react/components/ds-loader-bar/ds-loader-bar.js +23 -0
- package/dist-react/components/ds-loader-bar/styles/common.styles.js +23 -0
- package/dist-react/components/ds-loader-dots/ds-loader-dots.js +62 -0
- package/dist-react/components/ds-loader-dots/styles/common.styles.js +35 -0
- package/dist-react/components/ds-loader-logo/ds-loader-logo.js +65 -0
- package/dist-react/components/ds-loader-logo/ds-loader-logo.styles.js +67 -0
- package/dist-react/components/ds-loader-spinner/ds-loader-spinner.js +53 -0
- package/dist-react/components/ds-loader-spinner/styles/common.styles.js +56 -0
- package/dist-react/components/ds-logo/ds-logo.js +69 -0
- package/dist-react/components/ds-logo/styles/common.styles.js +18 -0
- package/dist-react/components/ds-main-title/ds-main-title.d.ts +10 -0
- package/dist-react/components/ds-main-title/ds-main-title.js +35 -0
- package/dist-react/components/ds-main-title/ds-main-title.test.d.ts +7 -0
- package/dist-react/components/ds-main-title/ds-main-title.types.d.ts +2 -0
- package/dist-react/components/ds-main-title/styles/common.styles.d.ts +1 -0
- package/dist-react/components/ds-main-title/styles/common.styles.js +19 -0
- package/dist-react/components/ds-map-pin/ds-map-pin.js +116 -0
- package/dist-react/components/ds-map-pin/styles/common.styles.js +43 -0
- package/dist-react/components/ds-modal/ds-modal.js +215 -0
- package/dist-react/components/ds-modal/styles/common.styles.js +289 -0
- package/dist-react/components/ds-password-input/ds-password-input.js +43 -0
- package/dist-react/components/ds-picker-item/ds-picker-item.js +89 -0
- package/dist-react/components/ds-picker-item/styles/common.styles.js +12 -0
- package/dist-react/components/ds-portal/ds-portal.js +41 -0
- package/dist-react/components/ds-progress-bar/ds-progress-bar.js +34 -0
- package/dist-react/components/ds-progress-bar/styles/common.styles.js +12 -0
- package/dist-react/components/ds-radio/ds-radio.js +111 -0
- package/dist-react/components/ds-radio/styles/common.styles.js +44 -0
- package/dist-react/components/ds-radio-button/ds-radio-button.js +185 -0
- package/dist-react/components/ds-radio-button/styles/common.styles.js +52 -0
- package/dist-react/components/ds-radio-button-group/ds-radio-button-group.js +83 -0
- package/dist-react/components/ds-radio-button-group/styles/common.styles.js +25 -0
- package/dist-react/components/ds-radio-group/ds-radio-group.js +79 -0
- package/dist-react/components/ds-radio-group/ds-radio-group.styles.js +21 -0
- package/dist-react/components/ds-rating/ds-rating.d.ts +14 -0
- package/dist-react/components/ds-rating/ds-rating.js +73 -0
- package/dist-react/components/ds-rating/ds-rating.test.d.ts +8 -0
- package/dist-react/components/ds-rating/ds-rating.types.d.ts +6 -0
- package/dist-react/components/ds-rating/styles/common.styles.d.ts +1 -0
- package/dist-react/components/ds-rating/styles/common.styles.js +14 -0
- package/dist-react/components/ds-search/ds-search.js +210 -0
- package/dist-react/components/ds-search/styles/common.styles.js +61 -0
- package/dist-react/components/ds-search-input/ds-search-input.js +158 -0
- package/dist-react/components/ds-search-input/styles/common.styles.js +12 -0
- package/dist-react/components/ds-secondary-navigation/ds-secondary-navigation.js +233 -0
- package/dist-react/components/ds-secondary-navigation/styles/common.styles.js +12 -0
- package/dist-react/components/ds-segmented-control/ds-segmented-control.js +71 -0
- package/dist-react/components/ds-segmented-control/styles/common.styles.js +56 -0
- package/dist-react/components/ds-select/controllers/SelectKeyboardController.js +33 -0
- package/dist-react/components/ds-select/ds-select.js +274 -0
- package/dist-react/components/ds-select/styles/common.styles.js +29 -0
- package/dist-react/components/ds-selection/ds-selection.js +57 -0
- package/dist-react/components/ds-selection/styles/common.styles.js +17 -0
- package/dist-react/components/ds-sidebar-navigation/ds-sidebar-navigation.js +102 -0
- package/dist-react/components/ds-sidebar-navigation/styles/common.styles.js +25 -0
- package/dist-react/components/ds-slider/ds-slider.js +409 -0
- package/dist-react/components/ds-slider/styles/common.styles.js +61 -0
- package/dist-react/components/ds-slider/utils/getStepValue/getStepValue.js +28 -0
- package/dist-react/components/ds-slider/utils/roundToDecimals/roundToDecimals.js +7 -0
- package/dist-react/components/ds-static-box/ds-static-box.js +77 -0
- package/dist-react/components/ds-static-box/styles/common.styles.js +12 -0
- package/dist-react/components/ds-stepper/ds-stepper.js +57 -0
- package/dist-react/components/ds-stepper/styles/common.styles.js +12 -0
- package/dist-react/components/ds-tabs/ds-tabs.js +203 -0
- package/dist-react/components/ds-tabs/styles/common.styles.js +97 -0
- package/dist-react/components/ds-tabs/theme-config.js +14 -0
- package/dist-react/components/ds-tag/ds-tag.js +87 -0
- package/dist-react/components/ds-tag/styles/common.styles.js +20 -0
- package/dist-react/components/ds-text/ds-text.js +83 -0
- package/dist-react/components/ds-text/styles/common.styles.js +29 -0
- package/dist-react/components/ds-text-input/ds-text-input.js +100 -0
- package/dist-react/components/ds-text-input/styles/common.styles.js +12 -0
- package/dist-react/components/ds-textarea/ds-textarea.js +87 -0
- package/dist-react/components/ds-textarea/styles/common.styles.js +12 -0
- package/dist-react/components/ds-theme-provider/ds-theme-provider.js +90 -0
- package/dist-react/components/ds-theme-provider/themeContext.js +5 -0
- package/dist-react/components/ds-toast/ds-toast.js +95 -0
- package/dist-react/components/ds-toast/styles/common.styles.js +112 -0
- package/dist-react/components/ds-toast/utils/ToastManager.js +48 -0
- package/dist-react/components/ds-toast-message/ds-toast-message.js +103 -0
- package/dist-react/components/ds-toast-message/styles/common.styles.js +12 -0
- package/dist-react/components/ds-toggle-button/ds-toggle-button.js +73 -0
- package/dist-react/components/ds-toggle-switch/ds-toggle-switch.js +100 -0
- package/dist-react/components/ds-toggle-switch/styles/common.styles.js +47 -0
- package/dist-react/components/ds-tooltip/ds-tooltip.d.ts +38 -23
- package/dist-react/components/ds-tooltip/ds-tooltip.js +234 -0
- package/dist-react/components/ds-tooltip/ds-tooltip.test.d.ts +8 -0
- package/dist-react/components/ds-tooltip/ds-tooltip.types.d.ts +5 -10
- package/dist-react/components/ds-tooltip/styles/common.styles.d.ts +0 -2
- package/dist-react/components/ds-tooltip/styles/common.styles.js +130 -0
- package/dist-react/components/index.d.ts +4 -1
- package/dist-react/core/theme.constants.d.ts +1 -0
- package/dist-react/core/theme.constants.js +4 -0
- package/dist-react/decorators/customUiKitElement.js +23 -0
- package/dist-react/index.js +61 -9623
- package/dist-react/mixins/FormAssociatedMixin.js +14 -0
- package/dist-react/mixins/ViewportMixin.js +32 -0
- package/dist-react/mixins/inputStatesMixin.js +46 -0
- package/dist-react/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js +430 -0
- package/dist-react/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +313 -0
- package/dist-react/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +132 -0
- package/dist-react/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
- package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/context-request-event.js +13 -0
- package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.js +29 -0
- package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/controllers/context-provider.js +37 -0
- package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/create-context.js +11 -0
- package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/consume.js +22 -0
- package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.js +42 -0
- package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/value-notifier.js +36 -0
- package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js +50 -0
- package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/base.js +9 -0
- package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js +37 -0
- package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +19 -0
- package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-nodes.js +19 -0
- package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js +20 -0
- package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js +12 -0
- package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js +252 -0
- package/dist-react/node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js +51 -0
- package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.js +37 -0
- package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.js +27 -0
- package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.js +12 -0
- package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js +34 -0
- package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.js +10 -0
- package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/repeat.js +61 -0
- package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js +27 -0
- package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.js +11 -0
- package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js +243 -0
- package/dist-react/styles/fonts-config.js +28 -0
- package/dist-react/utils/IconsManager.d.ts +1 -4
- package/dist-react/utils/IconsManager.js +39 -0
- package/dist-react/utils/PubSub.d.ts +0 -2
- package/dist-react/utils/PubSub.js +33 -0
- package/dist-react/utils/StylesRegistry/StylesRegistry.js +32 -0
- package/dist-react/utils/arrayConverter.js +19 -0
- package/dist-react/utils/booleanConverter.js +4 -0
- package/dist-react/utils/componentFactory.js +90 -0
- package/dist-react/utils/cssQueries.js +16 -0
- package/dist-react/utils/cssWithTokens.js +11 -0
- package/dist-react/utils/formatNumber/formatNumber.js +54 -0
- package/dist-react/utils/htmlWithTokens.js +11 -0
- package/dist-react/utils/objectConverter.js +11 -0
- package/dist-react/utils/validateMaxLength.js +6 -0
- package/package.json +12 -6
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { UiKitElement as u } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as m } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { inputStatesMixin as c } from "../../mixins/inputStatesMixin.js";
|
|
4
|
+
import { validateMaxLength as f } from "../../utils/validateMaxLength.js";
|
|
5
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
6
|
+
import { html as n, nothing as l } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
7
|
+
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
8
|
+
import { property as p } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
9
|
+
import { classMap as v } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
10
|
+
import { commonStyles as x } from "./styles/common.styles.js";
|
|
11
|
+
var g = Object.defineProperty, E = Object.getOwnPropertyDescriptor, a = (r, e, o, i) => {
|
|
12
|
+
for (var s = i > 1 ? void 0 : i ? E(e, o) : e, h = r.length - 1, d; h >= 0; h--)
|
|
13
|
+
(d = r[h]) && (s = (i ? d(e, o, s) : d(s)) || s);
|
|
14
|
+
return i && s && g(e, o, s), s;
|
|
15
|
+
};
|
|
16
|
+
let t = class extends c(u) {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments), this.keyboardMode = !1, this.size = "medium", this.helperText = "", this.forcedError = "", this.invalidError = "", this.mode = "light";
|
|
19
|
+
}
|
|
20
|
+
onInputReady(r) {
|
|
21
|
+
r.classList.add("ds-scroll");
|
|
22
|
+
}
|
|
23
|
+
get classes() {
|
|
24
|
+
return {
|
|
25
|
+
container: !0,
|
|
26
|
+
error: !!this.forcedError,
|
|
27
|
+
[this.size]: !!this.size,
|
|
28
|
+
[this.mode]: !!this.mode,
|
|
29
|
+
disabled: this.inputStates.disabled,
|
|
30
|
+
filled: this.inputStates.filled,
|
|
31
|
+
invalid: this.inputStates.invalid,
|
|
32
|
+
focus: this.inputStates.focus,
|
|
33
|
+
"focus-visible": this.inputStates.focusVisible
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return n`
|
|
38
|
+
<div class=${v(this.classes)}>
|
|
39
|
+
<div class="input-container">
|
|
40
|
+
<slot></slot>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="footer">
|
|
43
|
+
${this.helperTextTemplate}
|
|
44
|
+
${this.forcedErrorTemplate}
|
|
45
|
+
${this.invalidErrorTemplate}
|
|
46
|
+
${this.lengthTemplate}
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
get lengthTemplate() {
|
|
52
|
+
var e, o, i;
|
|
53
|
+
const r = (o = (e = this.nativeInput) == null ? void 0 : e.maxLength) == null ? void 0 : o.toString();
|
|
54
|
+
return f(r) ? n`<span class="char-counter">${((i = this.inputStates.currentValue) == null ? void 0 : i.length) || 0}/${r}</span>` : l;
|
|
55
|
+
}
|
|
56
|
+
get helperTextTemplate() {
|
|
57
|
+
return this.forcedError || this.inputStates.invalid && this.invalidError ? l : n`<span class="support-text helper-text">${this.helperText}</span>`;
|
|
58
|
+
}
|
|
59
|
+
get forcedErrorTemplate() {
|
|
60
|
+
return this.forcedError ? n`<span class="support-text error-text forced-error">${this.forcedError}</span>` : l;
|
|
61
|
+
}
|
|
62
|
+
get invalidErrorTemplate() {
|
|
63
|
+
return this.forcedError || !this.inputStates.invalid || !this.invalidError ? l : n`<span class="support-text error-text invalid-error">${this.invalidError}</span>`;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
t.styles = [x];
|
|
67
|
+
a([
|
|
68
|
+
p({ type: String })
|
|
69
|
+
], t.prototype, "size", 2);
|
|
70
|
+
a([
|
|
71
|
+
p({ type: String, attribute: "helper-text" })
|
|
72
|
+
], t.prototype, "helperText", 2);
|
|
73
|
+
a([
|
|
74
|
+
p({ type: String, attribute: "forced-error" })
|
|
75
|
+
], t.prototype, "forcedError", 2);
|
|
76
|
+
a([
|
|
77
|
+
p({ type: String, attribute: "invalid-error" })
|
|
78
|
+
], t.prototype, "invalidError", 2);
|
|
79
|
+
a([
|
|
80
|
+
p({ type: String })
|
|
81
|
+
], t.prototype, "mode", 2);
|
|
82
|
+
t = a([
|
|
83
|
+
m("ds-textarea")
|
|
84
|
+
], t);
|
|
85
|
+
export {
|
|
86
|
+
t as DsTextarea
|
|
87
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import "../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
3
|
+
import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { css as o } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
|
+
const p = o`
|
|
6
|
+
:host {
|
|
7
|
+
display: contents;
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
export {
|
|
11
|
+
p as commonStyles
|
|
12
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { THEME_STORAGE_KEY as p } from "../../core/theme.constants.js";
|
|
2
|
+
import { customUiKitElement as f } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { provide as c } from "../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.js";
|
|
4
|
+
import { pubSub as u } from "../../utils/PubSub.js";
|
|
5
|
+
import { booleanConverter as i } from "../../utils/booleanConverter.js";
|
|
6
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
7
|
+
import { nothing as y, html as $ } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
8
|
+
import { LitElement as v } from "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
9
|
+
import { property as d } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
10
|
+
import { state as l } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
11
|
+
import { fontsConfig as F } from "../../styles/fonts-config.js";
|
|
12
|
+
import { themeContext as S } from "./themeContext.js";
|
|
13
|
+
var w = Object.defineProperty, E = Object.getOwnPropertyDescriptor, h = (t, o, s, r) => {
|
|
14
|
+
for (var e = r > 1 ? void 0 : r ? E(o, s) : o, a = t.length - 1, n; a >= 0; a--)
|
|
15
|
+
(n = t[a]) && (e = (r ? n(o, s, e) : n(e)) || e);
|
|
16
|
+
return r && e && w(o, s, e), e;
|
|
17
|
+
};
|
|
18
|
+
let m = class extends v {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments), this.loadFonts = !0, this.loadStyles = !0, this.cssLoaded = !1, this.loadedFonts = /* @__PURE__ */ new Set();
|
|
21
|
+
}
|
|
22
|
+
updated(t) {
|
|
23
|
+
super.updated(t), t.has("theme") && (u.publish("theme", this.theme), sessionStorage == null || sessionStorage.setItem(p, this.theme), this.loadThemeFonts(), this.loadThemeStyles().then(() => {
|
|
24
|
+
this.cssLoaded = !0;
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
loadThemeFonts() {
|
|
28
|
+
var t;
|
|
29
|
+
(t = F[this.theme]) == null || t.fonts.forEach((o) => {
|
|
30
|
+
this.loadThemeFont(o);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
async loadThemeFont({ weight: t, name: o, file: s }) {
|
|
34
|
+
if (!this.loadFonts) return Promise.resolve();
|
|
35
|
+
const r = `${o}-${t}`;
|
|
36
|
+
if (this.loadedFonts.has(r)) return;
|
|
37
|
+
const e = new FontFace(
|
|
38
|
+
o,
|
|
39
|
+
`url('https://ds-assets.cupra.com/fonts/${this.theme}/${s}.woff2') format('woff2'),
|
|
40
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${s}.woff') format('woff'),
|
|
41
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${s}.ttf') format('truetype'),
|
|
42
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${s}.otf') format('opentype')`,
|
|
43
|
+
{
|
|
44
|
+
style: "normal",
|
|
45
|
+
weight: t,
|
|
46
|
+
display: "swap"
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
try {
|
|
50
|
+
await e.load(), document.fonts.add(e), this.loadedFonts.add(r);
|
|
51
|
+
} catch (a) {
|
|
52
|
+
console.error(`Error loading "${o}" font with "${t}" weight:`, a);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
loadThemeStyles() {
|
|
56
|
+
return this.loadStyles ? new Promise((t, o) => {
|
|
57
|
+
const s = "/1.0.0", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
|
|
58
|
+
if (document.head.querySelector(`link[href="${r}"]`)) t();
|
|
59
|
+
else {
|
|
60
|
+
const e = `ui-kit-theme-${s}`, a = document.getElementById(e), n = document.createElement("link");
|
|
61
|
+
n.id = e, n.rel = "stylesheet", n.href = r, n.onload = () => t(), n.onerror = () => o(new Error(`Failed to load theme CSS: ${r}`)), document.head.appendChild(n), a == null || a.remove();
|
|
62
|
+
}
|
|
63
|
+
}) : Promise.resolve();
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return this.cssLoaded ? $`<slot></slot>` : y;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
h([
|
|
70
|
+
d({ type: Boolean, converter: i, attribute: "load-fonts" })
|
|
71
|
+
], m.prototype, "loadFonts", 2);
|
|
72
|
+
h([
|
|
73
|
+
d({ type: Boolean, converter: i, attribute: "load-styles" })
|
|
74
|
+
], m.prototype, "loadStyles", 2);
|
|
75
|
+
h([
|
|
76
|
+
c({ context: S }),
|
|
77
|
+
d({ type: String })
|
|
78
|
+
], m.prototype, "theme", 2);
|
|
79
|
+
h([
|
|
80
|
+
l()
|
|
81
|
+
], m.prototype, "cssLoaded", 2);
|
|
82
|
+
h([
|
|
83
|
+
l()
|
|
84
|
+
], m.prototype, "loadedFonts", 2);
|
|
85
|
+
m = h([
|
|
86
|
+
f("ds-theme-provider")
|
|
87
|
+
], m);
|
|
88
|
+
export {
|
|
89
|
+
m as DsThemeProvider
|
|
90
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { UiKitElement as p } from "../base/UiKitElement.js";
|
|
2
|
+
import { toastManager as l } from "./utils/ToastManager.js";
|
|
3
|
+
import { customUiKitElement as d } from "../../decorators/customUiKitElement.js";
|
|
4
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
5
|
+
import { nothing as f, html as m } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
6
|
+
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
7
|
+
import { property as b } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
8
|
+
import { state as h } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
9
|
+
import { classMap as u } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
10
|
+
import { repeat as g } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/repeat.js";
|
|
11
|
+
import { unsafeHTML as v } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
|
|
12
|
+
import { containerStyles as y, toastStyles as M } from "./styles/common.styles.js";
|
|
13
|
+
var T = Object.defineProperty, x = Object.getOwnPropertyDescriptor, c = (t, i, s, a) => {
|
|
14
|
+
for (var e = a > 1 ? void 0 : a ? x(i, s) : i, o = t.length - 1, n; o >= 0; o--)
|
|
15
|
+
(n = t[o]) && (e = (a ? n(i, s, e) : n(e)) || e);
|
|
16
|
+
return a && e && T(i, s, e), e;
|
|
17
|
+
};
|
|
18
|
+
let r = class extends p {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments), this.position = "top-right", this.toasts = [], this.unsubscribe = null;
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback(), this.unsubscribe = l.subscribe((t) => {
|
|
24
|
+
this.toasts = t;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
disconnectedCallback() {
|
|
28
|
+
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = null), super.disconnectedCallback();
|
|
29
|
+
}
|
|
30
|
+
handleAnimationEnd(t) {
|
|
31
|
+
const i = t.target;
|
|
32
|
+
if (i.classList.contains("exiting") && (t.animationName === "toast-out-left" || t.animationName === "toast-out-right")) {
|
|
33
|
+
const s = i.getAttribute("data-id");
|
|
34
|
+
s && l.removeToast(s);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
getToastMessageTemplate(t) {
|
|
38
|
+
const i = {
|
|
39
|
+
toast: !0,
|
|
40
|
+
[t.status]: !0,
|
|
41
|
+
exiting: t.exiting
|
|
42
|
+
};
|
|
43
|
+
let s = f;
|
|
44
|
+
if (t.referenceId) {
|
|
45
|
+
const a = document.querySelector(`[data-id="${t.referenceId}"]`);
|
|
46
|
+
if (a) {
|
|
47
|
+
const e = a.cloneNode(!0);
|
|
48
|
+
e.setAttribute("data-template", "false"), e.setAttribute("data-id", t.id), s = v(e.outerHTML);
|
|
49
|
+
}
|
|
50
|
+
} else
|
|
51
|
+
s = this.componentFactory.createToastMessage({
|
|
52
|
+
"data-id": t.id,
|
|
53
|
+
"data-template": !1,
|
|
54
|
+
title: t.title,
|
|
55
|
+
text: t.text,
|
|
56
|
+
status: t.status
|
|
57
|
+
});
|
|
58
|
+
return m`<div class=${u(i)} data-id="${t.id}">${s}</div>`;
|
|
59
|
+
}
|
|
60
|
+
get containerClasses() {
|
|
61
|
+
return {
|
|
62
|
+
"toast-container": !0,
|
|
63
|
+
[this.position]: !0
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
return m`
|
|
68
|
+
<div
|
|
69
|
+
part="toast-container"
|
|
70
|
+
class=${u(this.containerClasses)}
|
|
71
|
+
@animationend=${this.handleAnimationEnd}
|
|
72
|
+
aria-live="polite"
|
|
73
|
+
>
|
|
74
|
+
${g(
|
|
75
|
+
this.toasts,
|
|
76
|
+
(t) => t.id,
|
|
77
|
+
(t) => this.getToastMessageTemplate(t)
|
|
78
|
+
)}
|
|
79
|
+
</div>
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
r.styles = [y, M];
|
|
84
|
+
c([
|
|
85
|
+
b({ type: String })
|
|
86
|
+
], r.prototype, "position", 2);
|
|
87
|
+
c([
|
|
88
|
+
h()
|
|
89
|
+
], r.prototype, "toasts", 2);
|
|
90
|
+
r = c([
|
|
91
|
+
d("ds-toast")
|
|
92
|
+
], r);
|
|
93
|
+
export {
|
|
94
|
+
r as DsToast
|
|
95
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import "../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
3
|
+
import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { css as t } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
|
+
const n = t`
|
|
6
|
+
:host {
|
|
7
|
+
display: contents;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.toast-container {
|
|
11
|
+
position: fixed;
|
|
12
|
+
z-index: var(--ds-z-index-toast);
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column-reverse;
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.toast-container.top-right {
|
|
19
|
+
top: 1rem;
|
|
20
|
+
right: 1rem;
|
|
21
|
+
align-items: flex-end;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.toast-container.top-left {
|
|
25
|
+
top: 1rem;
|
|
26
|
+
left: 1rem;
|
|
27
|
+
align-items: flex-start;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.toast-container.bottom-right,
|
|
31
|
+
.toast-container.bottom-left {
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.toast-container.bottom-right {
|
|
36
|
+
bottom: 1rem;
|
|
37
|
+
right: 1rem;
|
|
38
|
+
align-items: flex-end;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.toast-container.bottom-left {
|
|
42
|
+
bottom: 1rem;
|
|
43
|
+
left: 1rem;
|
|
44
|
+
align-items: flex-start;
|
|
45
|
+
}
|
|
46
|
+
`, s = t`
|
|
47
|
+
.toast {
|
|
48
|
+
margin-bottom: 1rem;
|
|
49
|
+
animation: toast-in-top 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;
|
|
50
|
+
transform: translateY(-1rem);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.toast-container.bottom-left .toast,
|
|
54
|
+
.toast-container.bottom-right .toast {
|
|
55
|
+
animation: toast-in-bottom 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;
|
|
56
|
+
transform: translateY(1rem);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.toast-container.bottom-left .toast.exiting,
|
|
60
|
+
.toast-container.top-left .toast.exiting {
|
|
61
|
+
animation: toast-out-left 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.toast-container.bottom-right .toast.exiting,
|
|
65
|
+
.toast-container.top-right .toast.exiting {
|
|
66
|
+
animation: toast-out-right 0.3s cubic-bezier(0, 0, 0.2, 1) forwards;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@keyframes toast-in-bottom {
|
|
70
|
+
from {
|
|
71
|
+
transform: translateY(1rem);
|
|
72
|
+
}
|
|
73
|
+
to {
|
|
74
|
+
transform: translateY(0);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@keyframes toast-in-top {
|
|
79
|
+
from {
|
|
80
|
+
transform: translateY(-1rem);
|
|
81
|
+
}
|
|
82
|
+
to {
|
|
83
|
+
transform: translateY(0);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@keyframes toast-out-left {
|
|
88
|
+
from {
|
|
89
|
+
opacity: 1;
|
|
90
|
+
transform: translateX(0);
|
|
91
|
+
}
|
|
92
|
+
to {
|
|
93
|
+
opacity: 0;
|
|
94
|
+
transform: translateX(-1rem);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@keyframes toast-out-right {
|
|
99
|
+
from {
|
|
100
|
+
opacity: 1;
|
|
101
|
+
transform: translateX(0);
|
|
102
|
+
}
|
|
103
|
+
to {
|
|
104
|
+
opacity: 0;
|
|
105
|
+
transform: translateX(1rem);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
`;
|
|
109
|
+
export {
|
|
110
|
+
n as containerStyles,
|
|
111
|
+
s as toastStyles
|
|
112
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const d = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : Math.random().toString(36).substring(2);
|
|
2
|
+
class n {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.toasts = [], this.subscribers = [], this.defaultDuration = 1e4, this.handleAddToast = (s) => {
|
|
5
|
+
const { id: t = d(), status: e = "default", duration: i = this.defaultDuration, ...o } = s.detail || {}, r = {
|
|
6
|
+
id: t,
|
|
7
|
+
status: e,
|
|
8
|
+
...o,
|
|
9
|
+
exiting: !1
|
|
10
|
+
};
|
|
11
|
+
r.timeoutId = window.setTimeout(() => {
|
|
12
|
+
this.toasts.find((a) => a.id === t).exiting = !0, this.notifySubscribers();
|
|
13
|
+
}, i), this.toasts = [...this.toasts, r], this.notifySubscribers();
|
|
14
|
+
}, this.handleRemoveToast = (s) => {
|
|
15
|
+
const { id: t, referenceId: e } = s.detail || {};
|
|
16
|
+
if (!t && !e) return;
|
|
17
|
+
let i;
|
|
18
|
+
t ? i = this.toasts.find((o) => o.id === t) : e && (i = this.toasts.find((o) => o.referenceId === e)), i && (i != null && i.timeoutId && window.clearTimeout(i.timeoutId), i.exiting = !0, this.notifySubscribers());
|
|
19
|
+
}, this.initialize();
|
|
20
|
+
}
|
|
21
|
+
initialize() {
|
|
22
|
+
window.addEventListener("toast:add", this.handleAddToast), window.addEventListener("toast:remove", this.handleRemoveToast);
|
|
23
|
+
}
|
|
24
|
+
static getInstance() {
|
|
25
|
+
return n.instance || (n.instance = new n()), n.instance;
|
|
26
|
+
}
|
|
27
|
+
removeToast(s) {
|
|
28
|
+
const t = this.toasts.find((e) => e.id === s);
|
|
29
|
+
t != null && t.timeoutId && window.clearTimeout(t.timeoutId), this.toasts = this.toasts.filter((e) => e.id !== s), this.notifySubscribers();
|
|
30
|
+
}
|
|
31
|
+
getToasts() {
|
|
32
|
+
return [...this.toasts];
|
|
33
|
+
}
|
|
34
|
+
subscribe(s) {
|
|
35
|
+
return this.subscribers.push(s), () => {
|
|
36
|
+
this.subscribers = this.subscribers.filter((t) => t !== s);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
notifySubscribers() {
|
|
40
|
+
const s = this.getToasts();
|
|
41
|
+
this.subscribers.forEach((t) => t(s));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const u = n.getInstance();
|
|
45
|
+
export {
|
|
46
|
+
d as generateId,
|
|
47
|
+
u as toastManager
|
|
48
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { UiKitElement as u } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as d } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { booleanConverter as h } from "../../utils/booleanConverter.js";
|
|
4
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
5
|
+
import { nothing as v, html as m } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
6
|
+
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
7
|
+
import { property as r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
8
|
+
import { classMap as f } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
9
|
+
import { when as p } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.js";
|
|
10
|
+
import { toastMessageStyles as g } from "./styles/common.styles.js";
|
|
11
|
+
var y = Object.defineProperty, b = Object.getOwnPropertyDescriptor, s = (a, o, n, i) => {
|
|
12
|
+
for (var e = i > 1 ? void 0 : i ? b(o, n) : o, c = a.length - 1, l; c >= 0; c--)
|
|
13
|
+
(l = a[c]) && (e = (i ? l(o, n, e) : l(e)) || e);
|
|
14
|
+
return i && e && y(o, n, e), e;
|
|
15
|
+
};
|
|
16
|
+
let t = class extends u {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments), this.status = "default", this.dataId = "", this.title = "", this.text = "", this.dataTemplate = !0;
|
|
19
|
+
}
|
|
20
|
+
getIconName() {
|
|
21
|
+
switch (this.status) {
|
|
22
|
+
case "success":
|
|
23
|
+
return "check-mark-circle";
|
|
24
|
+
case "error":
|
|
25
|
+
return "cross-circle";
|
|
26
|
+
case "warning":
|
|
27
|
+
return "exclamation-mark-circle";
|
|
28
|
+
case "info":
|
|
29
|
+
return "info-circle";
|
|
30
|
+
default:
|
|
31
|
+
return "chat-bubble";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
handleClickCloseButton() {
|
|
35
|
+
const a = new CustomEvent("toast:remove", {
|
|
36
|
+
bubbles: !0,
|
|
37
|
+
composed: !0,
|
|
38
|
+
detail: {
|
|
39
|
+
id: this.dataId
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
this.dispatchEvent(a);
|
|
43
|
+
}
|
|
44
|
+
get toastMessageClasses() {
|
|
45
|
+
return {
|
|
46
|
+
container: !0,
|
|
47
|
+
[this.status || "default"]: !0
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
get iconTemplate() {
|
|
51
|
+
return this.componentFactory.createIcon({
|
|
52
|
+
class: "icon",
|
|
53
|
+
"icon-name": this.getIconName(),
|
|
54
|
+
size: 24
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
get closeButtonTemplate() {
|
|
58
|
+
return this.componentFactory.createIconButton({
|
|
59
|
+
"data-aria-label": "close-button",
|
|
60
|
+
"@click": this.handleClickCloseButton,
|
|
61
|
+
"icon-name": "cross",
|
|
62
|
+
variant: "standard",
|
|
63
|
+
size: "medium"
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
return this.dataTemplate ? v : m`
|
|
68
|
+
<div class=${f(this.toastMessageClasses)}>
|
|
69
|
+
${this.iconTemplate}
|
|
70
|
+
<div class="content">
|
|
71
|
+
<div class="header">
|
|
72
|
+
${p(this.title, () => m`<div class="title">${this.title}</div>`)}
|
|
73
|
+
${p(this.text, () => m`<div class="message">${this.text}</div>`)}
|
|
74
|
+
</div>
|
|
75
|
+
<slot></slot>
|
|
76
|
+
</div>
|
|
77
|
+
${this.closeButtonTemplate}
|
|
78
|
+
</div>
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
t.styles = [g];
|
|
83
|
+
s([
|
|
84
|
+
r({ type: String })
|
|
85
|
+
], t.prototype, "status", 2);
|
|
86
|
+
s([
|
|
87
|
+
r({ type: String, attribute: "data-id", reflect: !0 })
|
|
88
|
+
], t.prototype, "dataId", 2);
|
|
89
|
+
s([
|
|
90
|
+
r({ type: String })
|
|
91
|
+
], t.prototype, "title", 2);
|
|
92
|
+
s([
|
|
93
|
+
r({ type: String })
|
|
94
|
+
], t.prototype, "text", 2);
|
|
95
|
+
s([
|
|
96
|
+
r({ type: Boolean, converter: h, attribute: "data-template", reflect: !0 })
|
|
97
|
+
], t.prototype, "dataTemplate", 2);
|
|
98
|
+
t = s([
|
|
99
|
+
d("ds-toast-message")
|
|
100
|
+
], t);
|
|
101
|
+
export {
|
|
102
|
+
t as DsToastMessage
|
|
103
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import "../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
3
|
+
import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { css as t } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
|
+
const r = t`
|
|
6
|
+
:host {
|
|
7
|
+
display: contents;
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
export {
|
|
11
|
+
r as toastMessageStyles
|
|
12
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { DsButton as u } from "../ds-button/ds-button.js";
|
|
2
|
+
import { customUiKitElement as m } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { booleanConverter as l } from "../../utils/booleanConverter.js";
|
|
4
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
5
|
+
import { html as a } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
6
|
+
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
7
|
+
import { property as c } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
8
|
+
import { classMap as b } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
9
|
+
import { when as d } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.js";
|
|
10
|
+
var k = Object.defineProperty, f = Object.getOwnPropertyDescriptor, o = (e, i, n, r) => {
|
|
11
|
+
for (var t = r > 1 ? void 0 : r ? f(i, n) : i, h = e.length - 1, p; h >= 0; h--)
|
|
12
|
+
(p = e[h]) && (t = (r ? p(i, n, t) : p(t)) || t);
|
|
13
|
+
return r && t && k(i, n, t), t;
|
|
14
|
+
};
|
|
15
|
+
let s = class extends u {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments), this.checked = !1, this.checkedText = "", this.uncheckedText = "", this.rounded = !0;
|
|
18
|
+
}
|
|
19
|
+
updated(e) {
|
|
20
|
+
super.updated(e), this.iconName = this.checked ? "minus" : "plus", this.variant = this.checked ? "primary" : "secondary";
|
|
21
|
+
}
|
|
22
|
+
handleClick() {
|
|
23
|
+
this.checked = !this.checked, this.dispatchEvent(
|
|
24
|
+
new CustomEvent("change", {
|
|
25
|
+
bubbles: !0,
|
|
26
|
+
composed: !0,
|
|
27
|
+
detail: {
|
|
28
|
+
checked: this.checked
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
var e;
|
|
35
|
+
return a`
|
|
36
|
+
<style>
|
|
37
|
+
:host {
|
|
38
|
+
pointer-events: ${this.disabled ? "none" : "visible"};
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
41
|
+
${this.cssTokens}
|
|
42
|
+
<button
|
|
43
|
+
aria-label=${(e = this.textContent) == null ? void 0 : e.replace(/^\s+|\s+$/g, "")}
|
|
44
|
+
class=${b(this.classes)}
|
|
45
|
+
?disabled=${this.disabled}
|
|
46
|
+
type=${this.type}
|
|
47
|
+
@click=${this.handleClick}
|
|
48
|
+
>
|
|
49
|
+
${d(this.iconPosition === "left", () => a`${this.iconTemplate}`)}
|
|
50
|
+
${this.checked ? this.checkedText : this.uncheckedText}
|
|
51
|
+
${d(this.iconPosition === "right", () => a`${this.iconTemplate}`)}
|
|
52
|
+
</button>
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
o([
|
|
57
|
+
c({ type: Boolean, converter: l, reflect: !0 })
|
|
58
|
+
], s.prototype, "checked", 2);
|
|
59
|
+
o([
|
|
60
|
+
c({ type: String, attribute: "checked-text" })
|
|
61
|
+
], s.prototype, "checkedText", 2);
|
|
62
|
+
o([
|
|
63
|
+
c({ type: String, attribute: "unchecked-text" })
|
|
64
|
+
], s.prototype, "uncheckedText", 2);
|
|
65
|
+
o([
|
|
66
|
+
c({ type: Boolean, converter: l })
|
|
67
|
+
], s.prototype, "rounded", 2);
|
|
68
|
+
s = o([
|
|
69
|
+
m("ds-toggle-button", { skipTagAsComponentName: !0, extendComponentNames: ["ds-button"] })
|
|
70
|
+
], s);
|
|
71
|
+
export {
|
|
72
|
+
s as DsToggleButton
|
|
73
|
+
};
|