@cupra/ui-kit 1.0.0-canary.9 → 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,142 @@
|
|
|
1
|
+
import { UiKitElement as m } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as u } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { FormAssociatedMixin as v } from "../../mixins/FormAssociatedMixin.js";
|
|
4
|
+
import { booleanConverter as h } from "../../utils/booleanConverter.js";
|
|
5
|
+
import { htmlWithTokens as f } from "../../utils/htmlWithTokens.js";
|
|
6
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
7
|
+
import { nothing as n, html as a } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
8
|
+
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
9
|
+
import { property as r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
10
|
+
import { classMap as y } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
11
|
+
import { commonStyles as b } from "./styles/common.styles.js";
|
|
12
|
+
var x = Object.defineProperty, g = Object.getOwnPropertyDescriptor, t = (o, s, p, c) => {
|
|
13
|
+
for (var i = c > 1 ? void 0 : c ? g(s, p) : s, l = o.length - 1, d; l >= 0; l--)
|
|
14
|
+
(d = o[l]) && (i = (c ? d(s, p, i) : d(i)) || i);
|
|
15
|
+
return c && i && x(s, p, i), i;
|
|
16
|
+
};
|
|
17
|
+
let e = class extends v(m) {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments), this.inputPlacement = "left", this.checked = !1, this.required = !1, this.disabled = !1, this.mode = "light", this.size = "medium", this.helperText = "", this.infoText = "", this.forcedError = "", this.invalidError = "", this.indeterminate = !1;
|
|
20
|
+
}
|
|
21
|
+
handleChange(o) {
|
|
22
|
+
const s = o.target;
|
|
23
|
+
this.checked = s.checked, this.dispatchEvent(
|
|
24
|
+
new CustomEvent("change", {
|
|
25
|
+
bubbles: !0,
|
|
26
|
+
composed: !0,
|
|
27
|
+
detail: {
|
|
28
|
+
checked: this.checked,
|
|
29
|
+
value: this.value
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
get classes() {
|
|
35
|
+
return {
|
|
36
|
+
container: !0,
|
|
37
|
+
[this.inputPlacement]: !!this.inputPlacement,
|
|
38
|
+
[this.mode]: !!this.mode,
|
|
39
|
+
[this.size]: !!this.size,
|
|
40
|
+
disabled: this.disabled,
|
|
41
|
+
checked: this.checked,
|
|
42
|
+
error: !!this.forcedError
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
get iconTemplate() {
|
|
46
|
+
if (!this.checked) return n;
|
|
47
|
+
const o = this.indeterminate ? "minus" : "check";
|
|
48
|
+
return this.componentFactory.createIcon({
|
|
49
|
+
class: "icon",
|
|
50
|
+
"icon-name": o
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
get styleTokens() {
|
|
54
|
+
return f`
|
|
55
|
+
<style>
|
|
56
|
+
:host{
|
|
57
|
+
color-scheme: ${this.mode};
|
|
58
|
+
pointer-events: ${this.disabled ? "none" : "visible"};
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
return a`
|
|
65
|
+
${this.styleTokens}
|
|
66
|
+
<div class=${y(this.classes)}>
|
|
67
|
+
<label>
|
|
68
|
+
<span class="checkmark-container">
|
|
69
|
+
<span class="checkmark">
|
|
70
|
+
${this.iconTemplate}
|
|
71
|
+
<input
|
|
72
|
+
tabindex="0"
|
|
73
|
+
type="checkbox"
|
|
74
|
+
name=${this.name}
|
|
75
|
+
value=${this.value}
|
|
76
|
+
?required=${this.required}
|
|
77
|
+
?checked=${this.checked}
|
|
78
|
+
?disabled=${this.disabled}
|
|
79
|
+
@change=${this.handleChange}
|
|
80
|
+
/>
|
|
81
|
+
</span>
|
|
82
|
+
</span>
|
|
83
|
+
<div class="text-container">
|
|
84
|
+
<div class="text">
|
|
85
|
+
<slot></slot>
|
|
86
|
+
${this.infoText ? a` <div class="info-text">${this.infoText}</div> ` : n}
|
|
87
|
+
</div>
|
|
88
|
+
${this.helperText ? a` <div class="helper-text">${this.helperText}</div> ` : n}
|
|
89
|
+
${this.forcedError ? a` <div class="error-text">${this.forcedError}</div> ` : n}
|
|
90
|
+
${this.invalidError && !this.forcedError ? a`<div class="error-text invalid-error">${this.invalidError}</div>` : n}
|
|
91
|
+
</div>
|
|
92
|
+
</label>
|
|
93
|
+
</div>
|
|
94
|
+
`;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
e.styles = [b];
|
|
98
|
+
t([
|
|
99
|
+
r({ type: String })
|
|
100
|
+
], e.prototype, "name", 2);
|
|
101
|
+
t([
|
|
102
|
+
r({ type: String })
|
|
103
|
+
], e.prototype, "value", 2);
|
|
104
|
+
t([
|
|
105
|
+
r({ type: String, attribute: "input-placement" })
|
|
106
|
+
], e.prototype, "inputPlacement", 2);
|
|
107
|
+
t([
|
|
108
|
+
r({ type: Boolean, converter: h, reflect: !0 })
|
|
109
|
+
], e.prototype, "checked", 2);
|
|
110
|
+
t([
|
|
111
|
+
r({ type: Boolean, converter: h })
|
|
112
|
+
], e.prototype, "required", 2);
|
|
113
|
+
t([
|
|
114
|
+
r({ type: Boolean, converter: h })
|
|
115
|
+
], e.prototype, "disabled", 2);
|
|
116
|
+
t([
|
|
117
|
+
r({ type: String, reflect: !0 })
|
|
118
|
+
], e.prototype, "mode", 2);
|
|
119
|
+
t([
|
|
120
|
+
r({ type: String })
|
|
121
|
+
], e.prototype, "size", 2);
|
|
122
|
+
t([
|
|
123
|
+
r({ type: String, attribute: "helper-text" })
|
|
124
|
+
], e.prototype, "helperText", 2);
|
|
125
|
+
t([
|
|
126
|
+
r({ type: String, attribute: "info-text" })
|
|
127
|
+
], e.prototype, "infoText", 2);
|
|
128
|
+
t([
|
|
129
|
+
r({ type: String, attribute: "forced-error" })
|
|
130
|
+
], e.prototype, "forcedError", 2);
|
|
131
|
+
t([
|
|
132
|
+
r({ type: String, attribute: "invalid-error" })
|
|
133
|
+
], e.prototype, "invalidError", 2);
|
|
134
|
+
t([
|
|
135
|
+
r({ type: Boolean, converter: h })
|
|
136
|
+
], e.prototype, "indeterminate", 2);
|
|
137
|
+
e = t([
|
|
138
|
+
u("ds-checkbox")
|
|
139
|
+
], e);
|
|
140
|
+
export {
|
|
141
|
+
e as DsCheckbox
|
|
142
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
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 i } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
|
+
const r = i`
|
|
6
|
+
:host {
|
|
7
|
+
display: block;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
label {
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: flex-start;
|
|
15
|
+
align-items: flex-start;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
input {
|
|
19
|
+
position: absolute;
|
|
20
|
+
opacity: 0;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
top: 0;
|
|
24
|
+
left: 0;
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 0;
|
|
27
|
+
z-index: 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.checkmark-container {
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.checkmark {
|
|
35
|
+
position: relative;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
border-style: solid;
|
|
38
|
+
transition: all 200ms ease-in-out;
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
align-items: center;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.invalid-error {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.container:has(input:invalid) .invalid-error {
|
|
50
|
+
display: block;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.container:has(input:invalid) .helper-text,
|
|
54
|
+
.container.error .helper-text {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
export {
|
|
59
|
+
r as commonStyles
|
|
60
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { UiKitElement as h } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as p } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { booleanConverter as d } from "../../utils/booleanConverter.js";
|
|
4
|
+
import { htmlWithTokens as m } from "../../utils/htmlWithTokens.js";
|
|
5
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
6
|
+
import { nothing as u, html as y } 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 n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
9
|
+
import { state as f } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
10
|
+
import { classMap as b } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
11
|
+
import { commonStyles as v } from "./styles/common.styles.js";
|
|
12
|
+
var g = Object.defineProperty, k = Object.getOwnPropertyDescriptor, i = (e, l, r, s) => {
|
|
13
|
+
for (var o = s > 1 ? void 0 : s ? k(l, r) : l, a = e.length - 1, c; a >= 0; a--)
|
|
14
|
+
(c = e[a]) && (o = (s ? c(l, r, o) : c(o)) || o);
|
|
15
|
+
return s && o && g(l, r, o), o;
|
|
16
|
+
};
|
|
17
|
+
let t = class extends h {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments), this.mode = "light", this.size = "large", this.selected = !1, this.deselectable = !1, this.slottedText = "";
|
|
20
|
+
}
|
|
21
|
+
firstUpdated(e) {
|
|
22
|
+
super.firstUpdated(e);
|
|
23
|
+
const r = this.shadowRoot.querySelector("slot").assignedNodes({ flatten: !0 });
|
|
24
|
+
this.slottedText = r.filter((s) => s.nodeType === Node.TEXT_NODE).map((s) => s.textContent.trim()).join(" ");
|
|
25
|
+
}
|
|
26
|
+
get classes() {
|
|
27
|
+
return {
|
|
28
|
+
container: !0,
|
|
29
|
+
"ds-blur": !0,
|
|
30
|
+
[this.size]: !0,
|
|
31
|
+
[this.mode]: !!this.mode,
|
|
32
|
+
selected: this.selected,
|
|
33
|
+
deselectable: this.deselectable
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
get styleTokens() {
|
|
37
|
+
return m`
|
|
38
|
+
<style>
|
|
39
|
+
:host{
|
|
40
|
+
color-scheme: ${this.mode};
|
|
41
|
+
pointer-events: ${this.selected ? "none" : "visible"};
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
handleClick() {
|
|
47
|
+
this.selected || this.dispatchEvent(
|
|
48
|
+
new CustomEvent("select", {
|
|
49
|
+
bubbles: !0,
|
|
50
|
+
composed: !0,
|
|
51
|
+
detail: {
|
|
52
|
+
value: this.value
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
handleKeyDown(e) {
|
|
58
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.handleClick());
|
|
59
|
+
}
|
|
60
|
+
handleClickIcon(e) {
|
|
61
|
+
e.stopImmediatePropagation(), !(!this.deselectable || !this.selected) && this.dispatchEvent(
|
|
62
|
+
new CustomEvent("deselect", {
|
|
63
|
+
bubbles: !0,
|
|
64
|
+
composed: !0,
|
|
65
|
+
detail: {
|
|
66
|
+
value: this.value
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
handleKeyDownIcon(e) {
|
|
72
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.handleClickIcon(e));
|
|
73
|
+
}
|
|
74
|
+
get iconTemplate() {
|
|
75
|
+
if (!this.selected || !this.deselectable) return u;
|
|
76
|
+
const e = this.mode === "light" ? "dark" : "light";
|
|
77
|
+
return this.componentFactory.createIcon({
|
|
78
|
+
class: "icon",
|
|
79
|
+
"icon-name": "cross",
|
|
80
|
+
"data-testid": "ds-chip-icon",
|
|
81
|
+
"@click": this.handleClickIcon,
|
|
82
|
+
"@keydown": this.handleKeyDownIcon,
|
|
83
|
+
role: "button",
|
|
84
|
+
"aria-label": `deselect ${this.slottedText}`,
|
|
85
|
+
tabindex: "0",
|
|
86
|
+
mode: e
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
return y`
|
|
91
|
+
${this.styleTokens}
|
|
92
|
+
<div
|
|
93
|
+
role="button"
|
|
94
|
+
aria-label=${`chip ${this.slottedText}`}
|
|
95
|
+
tabindex="0"
|
|
96
|
+
data-testid="ds-chip-container"
|
|
97
|
+
class=${b(this.classes)}
|
|
98
|
+
@click=${this.handleClick}
|
|
99
|
+
@keydown=${this.handleKeyDown}
|
|
100
|
+
>
|
|
101
|
+
<slot></slot>
|
|
102
|
+
${this.iconTemplate}
|
|
103
|
+
</div>
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
t.styles = [v];
|
|
108
|
+
i([
|
|
109
|
+
n({ type: String })
|
|
110
|
+
], t.prototype, "value", 2);
|
|
111
|
+
i([
|
|
112
|
+
n({ type: String, reflect: !0 })
|
|
113
|
+
], t.prototype, "mode", 2);
|
|
114
|
+
i([
|
|
115
|
+
n({ type: String, reflect: !0 })
|
|
116
|
+
], t.prototype, "size", 2);
|
|
117
|
+
i([
|
|
118
|
+
n({ type: Boolean, converter: d, reflect: !0 })
|
|
119
|
+
], t.prototype, "selected", 2);
|
|
120
|
+
i([
|
|
121
|
+
n({ type: Boolean, converter: d })
|
|
122
|
+
], t.prototype, "deselectable", 2);
|
|
123
|
+
i([
|
|
124
|
+
f()
|
|
125
|
+
], t.prototype, "slottedText", 2);
|
|
126
|
+
t = i([
|
|
127
|
+
p("ds-chip")
|
|
128
|
+
], t);
|
|
129
|
+
export {
|
|
130
|
+
t as DsChip
|
|
131
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
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 e } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
|
+
const r = e`
|
|
6
|
+
:host {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.container {
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
user-select: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.icon {
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
pointer-events: visible;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
export {
|
|
24
|
+
r as commonStyles
|
|
25
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { UiKitElement as p } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as d } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { arrayConverter as m } from "../../utils/arrayConverter.js";
|
|
4
|
+
import { booleanConverter as u } from "../../utils/booleanConverter.js";
|
|
5
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
6
|
+
import { nothing as C, html as v } 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 o } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
9
|
+
import { state as n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
10
|
+
import { query as f } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
|
|
11
|
+
import { queryAssignedElements as S } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js";
|
|
12
|
+
import { classMap as b } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
13
|
+
import { commonStyles as y } from "./styles/common.styles.js";
|
|
14
|
+
var g = Object.defineProperty, z = Object.getOwnPropertyDescriptor, h = (e, t, s, i) => {
|
|
15
|
+
for (var r = i > 1 ? void 0 : i ? z(t, s) : t, a = e.length - 1, c; a >= 0; a--)
|
|
16
|
+
(c = e[a]) && (r = (i ? c(t, s, r) : c(r)) || r);
|
|
17
|
+
return i && r && g(t, s, r), r;
|
|
18
|
+
};
|
|
19
|
+
let l = class extends p {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments), this.multiChoice = null, this.size = "medium", this.mode = "light", this.hasScrollLeft = !1, this.hasScrollRight = !1, this.resizeObserver = new ResizeObserver(() => {
|
|
22
|
+
this.handleScrollNav();
|
|
23
|
+
}), this.handleScrollNav = () => {
|
|
24
|
+
var t, s, i, r;
|
|
25
|
+
const e = ((t = this.chipsContainer) == null ? void 0 : t.scrollLeft) + ((s = this.chipsContainer) == null ? void 0 : s.clientWidth);
|
|
26
|
+
this.hasScrollLeft = ((i = this.chipsContainer) == null ? void 0 : i.scrollLeft) > 0, this.hasScrollRight = e < ((r = this.chipsContainer) == null ? void 0 : r.scrollWidth);
|
|
27
|
+
}, this.handleScrollLeft = () => {
|
|
28
|
+
this.chipsContainer.scrollBy({ left: -150, behavior: "smooth" });
|
|
29
|
+
}, this.handleScrollRight = () => {
|
|
30
|
+
this.chipsContainer.scrollBy({ left: 150, behavior: "smooth" });
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
firstUpdated() {
|
|
34
|
+
this.handleScrollNav(), this.resizeObserver.observe(this.chipsContainer), this.chips.forEach((e) => this.resizeObserver.observe(e)), window.addEventListener("resize", this.handleScrollNav), this.chipsContainer.addEventListener("scroll", this.handleScrollNav);
|
|
35
|
+
}
|
|
36
|
+
disconnectedCallback() {
|
|
37
|
+
super.disconnectedCallback(), this.resizeObserver.disconnect(), window.removeEventListener("resize", this.handleScrollNav), this.chipsContainer.removeEventListener("scroll", this.handleScrollNav);
|
|
38
|
+
}
|
|
39
|
+
getScrollButtonTemplate(e, t) {
|
|
40
|
+
if (e === "left" && !this.hasScrollLeft || e === "right" && !this.hasScrollRight)
|
|
41
|
+
return C;
|
|
42
|
+
const s = `arrow-${e}`;
|
|
43
|
+
return this.componentFactory.createIconButton({
|
|
44
|
+
class: `scroll-button ${e}`,
|
|
45
|
+
"data-testid": `scroll-button-${e}`,
|
|
46
|
+
"data-aria-label": `scroll-button-${e}`,
|
|
47
|
+
"@click": t,
|
|
48
|
+
size: this.size || "large",
|
|
49
|
+
"icon-name": s,
|
|
50
|
+
variant: "standard",
|
|
51
|
+
mode: this.mode
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
updated(e) {
|
|
55
|
+
super.updated(e), (e.has("selectedChips") || e.has("multiChoice") || e.has("size") || e.has("mode")) && this.updateChildChips();
|
|
56
|
+
}
|
|
57
|
+
updateChildChips() {
|
|
58
|
+
var e;
|
|
59
|
+
(e = this.chips) == null || e.forEach((t) => {
|
|
60
|
+
var s, i;
|
|
61
|
+
t.size = this.size, t.selected = (i = (s = this.selectedChips) == null ? void 0 : s.includes) == null ? void 0 : i.call(s, t.value), t.deselectable = !!this.multiChoice, t.mode = this.mode;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
get chipsContainerClasses() {
|
|
65
|
+
return {
|
|
66
|
+
"chips-container": !0,
|
|
67
|
+
"scroll-left": this.hasScrollLeft,
|
|
68
|
+
"scroll-right": this.hasScrollRight
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
handleSelect(e) {
|
|
72
|
+
var s, i;
|
|
73
|
+
let t;
|
|
74
|
+
this.multiChoice && !((i = (s = this.selectedChips) == null ? void 0 : s.includes) != null && i.call(s, e.detail.value)) ? t = [...this.selectedChips || [], e.detail.value] : t = [e.detail.value], this.selectedChips = t, this.updateChildChips(), this.dispatchEvent(
|
|
75
|
+
new CustomEvent("ds-chips:change", {
|
|
76
|
+
bubbles: !0,
|
|
77
|
+
composed: !0,
|
|
78
|
+
detail: {
|
|
79
|
+
selectedChips: t
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
handleDeselect(e) {
|
|
85
|
+
const t = [...(this.selectedChips || []).filter((s) => s !== e.detail.value)];
|
|
86
|
+
this.selectedChips = t, this.updateChildChips(), this.dispatchEvent(
|
|
87
|
+
new CustomEvent("ds-chips:change", {
|
|
88
|
+
bubbles: !0,
|
|
89
|
+
composed: !0,
|
|
90
|
+
detail: {
|
|
91
|
+
selectedChips: t
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
render() {
|
|
97
|
+
return v`
|
|
98
|
+
<div
|
|
99
|
+
class="container"
|
|
100
|
+
data-testid="ds-chips-container"
|
|
101
|
+
@select=${this.handleSelect}
|
|
102
|
+
@deselect=${this.handleDeselect}
|
|
103
|
+
>
|
|
104
|
+
${this.getScrollButtonTemplate("left", this.handleScrollLeft)}
|
|
105
|
+
<nav tabindex="0" class=${b(this.chipsContainerClasses)}>
|
|
106
|
+
<slot @slotchange=${this.updateChildChips}></slot>
|
|
107
|
+
</nav>
|
|
108
|
+
${this.getScrollButtonTemplate("right", this.handleScrollRight)}
|
|
109
|
+
</div>
|
|
110
|
+
`;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
l.styles = [y];
|
|
114
|
+
h([
|
|
115
|
+
o({ type: Array, attribute: "selected-chips", converter: m, reflect: !0 })
|
|
116
|
+
], l.prototype, "selectedChips", 2);
|
|
117
|
+
h([
|
|
118
|
+
o({ type: Boolean, attribute: "multi-choice", converter: u })
|
|
119
|
+
], l.prototype, "multiChoice", 2);
|
|
120
|
+
h([
|
|
121
|
+
o({ type: String })
|
|
122
|
+
], l.prototype, "size", 2);
|
|
123
|
+
h([
|
|
124
|
+
o({ type: String, reflect: !0 })
|
|
125
|
+
], l.prototype, "mode", 2);
|
|
126
|
+
h([
|
|
127
|
+
n()
|
|
128
|
+
], l.prototype, "hasScrollLeft", 2);
|
|
129
|
+
h([
|
|
130
|
+
n()
|
|
131
|
+
], l.prototype, "hasScrollRight", 2);
|
|
132
|
+
h([
|
|
133
|
+
S({ slot: "" })
|
|
134
|
+
], l.prototype, "chips", 2);
|
|
135
|
+
h([
|
|
136
|
+
f(".chips-container")
|
|
137
|
+
], l.prototype, "chipsContainer", 2);
|
|
138
|
+
l = h([
|
|
139
|
+
d("ds-chips")
|
|
140
|
+
], l);
|
|
141
|
+
export {
|
|
142
|
+
l as DsChips
|
|
143
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
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 a = t`
|
|
6
|
+
.container {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
position: relative;
|
|
9
|
+
max-width: 100%;
|
|
10
|
+
position: relative;
|
|
11
|
+
--ds-chips-fade-width: 54px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.chips-container {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
justify-content: flex-start;
|
|
18
|
+
overflow-y: auto;
|
|
19
|
+
scrollbar-width: none;
|
|
20
|
+
scroll-behavior: smooth;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.chips-container.scroll-left:before {
|
|
24
|
+
content: '';
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 0;
|
|
27
|
+
left: 0;
|
|
28
|
+
width: var(--ds-chips-fade-width);
|
|
29
|
+
height: 100%;
|
|
30
|
+
pointer-events: none;
|
|
31
|
+
background: linear-gradient(
|
|
32
|
+
to right,
|
|
33
|
+
var(--ds-chips-fade-color) 0%,
|
|
34
|
+
var(--ds-chips-fade-color) 40%,
|
|
35
|
+
rgba(255, 255, 255, 0) 100%
|
|
36
|
+
);
|
|
37
|
+
z-index: var(--ds-z-index-default, 1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.chips-container.scroll-right:after {
|
|
41
|
+
content: '';
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
right: 0;
|
|
45
|
+
width: var(--ds-chips-fade-width);
|
|
46
|
+
height: 100%;
|
|
47
|
+
pointer-events: none;
|
|
48
|
+
background: linear-gradient(
|
|
49
|
+
to left,
|
|
50
|
+
var(--ds-chips-fade-color) 0%,
|
|
51
|
+
var(--ds-chips-fade-color) 40%,
|
|
52
|
+
rgba(255, 255, 255, 0) 100%
|
|
53
|
+
);
|
|
54
|
+
z-index: var(--ds-z-index-default, 1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//.chips-container.scroll-left.scroll-right {
|
|
58
|
+
// mask-image: linear-gradient(
|
|
59
|
+
// to right,
|
|
60
|
+
// rgba(0, 0, 0, 0) 0px,
|
|
61
|
+
// rgba(0, 0, 0, 0) 32px,
|
|
62
|
+
// rgba(0, 0, 0, 1) 48px,
|
|
63
|
+
// rgba(0, 0, 0, 1) calc(100% - 48px),
|
|
64
|
+
// rgba(0, 0, 0, 0) calc(100% - 32px),
|
|
65
|
+
// rgba(0, 0, 0, 0) 100%
|
|
66
|
+
// );
|
|
67
|
+
//}
|
|
68
|
+
|
|
69
|
+
.chips-container::-webkit-scrollbar {
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
::slotted(*) {
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
flex: 0 1 auto;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.scroll-button {
|
|
79
|
+
position: absolute;
|
|
80
|
+
top: 0;
|
|
81
|
+
z-index: 2;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.scroll-button.left {
|
|
85
|
+
left: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.scroll-button.right {
|
|
89
|
+
right: 0;
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
92
|
+
export {
|
|
93
|
+
a as commonStyles
|
|
94
|
+
};
|