@rededor/cura 0.5.4 → 1.0.0-alpha.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/dist/assets/icons/iconset-default-list.ts +1 -1
- package/dist/assets/icons/iconset-default-tmp.svg +8 -0
- package/dist/assets/icons/iconset-default.svg +1 -1
- package/dist/cjs/app-globals-bcffd819.js +511 -0
- package/dist/cjs/app-globals-bcffd819.js.map +1 -0
- package/dist/cjs/cura-accordion_9.cjs.entry.js +544 -0
- package/dist/cjs/cura-accordion_9.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-alert.cjs.entry.js +57 -55
- package/dist/cjs/cura-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-avatar.cjs.entry.js +68 -0
- package/dist/cjs/cura-avatar.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-button-outline.cjs.entry.js +102 -71
- package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-select.cjs.entry.js +91 -85
- package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-transparent_2.cjs.entry.js +4055 -0
- package/dist/cjs/cura-button-transparent_2.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-calendar.cjs.entry.js +3913 -0
- package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-card.cjs.entry.js +53 -0
- package/dist/cjs/cura-card.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-checkbox.cjs.entry.js +168 -131
- package/dist/cjs/cura-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-display.cjs.entry.js +63 -62
- package/dist/cjs/cura-display.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +22 -0
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +55 -0
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-dropdown-search.cjs.entry.js +209 -0
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-forms.definitions-c164f1b8.js +20 -0
- package/dist/cjs/cura-forms.definitions-c164f1b8.js.map +1 -0
- package/dist/cjs/cura-icon.definitions-8d714f6a.js +21 -0
- package/dist/cjs/cura-icon.definitions-8d714f6a.js.map +1 -0
- package/dist/cjs/cura-icons-view.cjs.entry.js +24 -23
- package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-radio.cjs.entry.js +142 -103
- package/dist/cjs/cura-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-select_2.cjs.entry.js +325 -0
- package/dist/cjs/cura-select_2.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-switch.cjs.entry.js +113 -78
- package/dist/cjs/cura-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/cura.cjs.js +13 -22
- package/dist/cjs/cura.cjs.js.map +1 -1
- package/dist/cjs/index-5b63ff7a.js +1529 -0
- package/dist/cjs/index-5b63ff7a.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +6 -31
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/api/cura-api.js +30 -30
- package/dist/collection/api/cura-api.js.map +1 -1
- package/dist/collection/api/cura-api.type.js +2 -2
- package/dist/collection/api/cura-api.type.js.map +1 -1
- package/dist/collection/api/modules/cura-theme-breakpoints-module.js +10 -10
- package/dist/collection/api/modules/cura-theme-breakpoints-module.js.map +1 -1
- package/dist/collection/api/modules/cura-theme-colors-module.js +72 -72
- package/dist/collection/api/modules/cura-theme-colors-module.js.map +1 -1
- package/dist/collection/api/modules/cura-theme-fonts-module.js +28 -28
- package/dist/collection/api/modules/cura-theme-fonts-module.js.map +1 -1
- package/dist/collection/api/modules/cura-theme-module.js +66 -66
- package/dist/collection/api/modules/cura-theme-module.js.map +1 -1
- package/dist/collection/api/modules/cura-theme-spacing-module.js +9 -9
- package/dist/collection/api/modules/cura-theme-spacing-module.js.map +1 -1
- package/dist/collection/api/theme-presets/static.js +63 -63
- package/dist/collection/api/theme-presets/static.js.map +1 -1
- package/dist/collection/api/theme-presets/theme-default.js +41 -41
- package/dist/collection/api/theme-presets/theme-default.js.map +1 -1
- package/dist/collection/api/theme-presets/theme-legacy-default.js +24 -24
- package/dist/collection/api/theme-presets/theme-legacy-default.js.map +1 -1
- package/dist/collection/api/theme-presets/theme-maternity.js +38 -38
- package/dist/collection/api/theme-presets/theme-maternity.js.map +1 -1
- package/dist/collection/api/theme-presets/theme-oncology.js +46 -46
- package/dist/collection/api/theme-presets/theme-oncology.js.map +1 -1
- package/dist/collection/api/theme-presets/theme-presets.js +8 -8
- package/dist/collection/api/theme-presets/theme-presets.js.map +1 -1
- package/dist/collection/assets/icons/iconset-default-list.js +1 -1
- package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
- package/dist/collection/assets/icons/iconset-default-tmp.svg +8 -0
- package/dist/collection/assets/icons/iconset-default.svg +1 -1
- package/dist/collection/assets/images/avatar/doctor-default.svg +8 -0
- package/dist/collection/assets/images/avatar/dora-default.svg +5 -0
- package/dist/collection/assets/images/avatar/patient-default.svg +12 -0
- package/dist/collection/assets/images/avatar/unit-default.svg +9 -0
- package/dist/collection/assets/images/logoCura.svg +15 -0
- package/dist/collection/assets-raw/icons/default/contacts.svg +3 -0
- package/dist/collection/assets-raw/icons/default/scheduleCancel.svg +3 -0
- package/dist/collection/collection-manifest.json +29 -21
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.js +267 -267
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.js.map +1 -1
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js +127 -127
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js.map +1 -1
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.js +196 -196
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.js.map +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.css +112 -46
- package/dist/collection/components/buttons/cura-button/cura-button.js +368 -306
- package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.stories.js +184 -159
- package/dist/collection/components/buttons/cura-button/cura-button.stories.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.css +37 -64
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +374 -306
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js +184 -159
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.css +36 -23
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +265 -260
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.css +32 -50
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +339 -306
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js +172 -159
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js.map +1 -1
- package/dist/collection/components/cura-alert/cura-alert.js +182 -164
- package/dist/collection/components/cura-alert/cura-alert.js.map +1 -1
- package/dist/collection/components/cura-alert/cura-alert.stories.js +90 -77
- package/dist/collection/components/cura-alert/cura-alert.stories.js.map +1 -1
- package/dist/collection/components/cura-avatar/cura-avatar.css +24 -0
- package/dist/collection/components/cura-avatar/cura-avatar.definitions.js +7 -0
- package/dist/collection/components/cura-avatar/cura-avatar.definitions.js.map +1 -0
- package/dist/collection/components/cura-avatar/cura-avatar.js +231 -0
- package/dist/collection/components/cura-avatar/cura-avatar.js.map +1 -0
- package/dist/collection/components/cura-avatar/cura-avatar.stories.js +198 -0
- package/dist/collection/components/cura-avatar/cura-avatar.stories.js.map +1 -0
- package/dist/collection/components/cura-calendar/cura-calendar.css +181 -0
- package/dist/collection/components/cura-calendar/cura-calendar.js +681 -0
- package/dist/collection/components/cura-calendar/cura-calendar.js.map +1 -0
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js +126 -0
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js.map +1 -0
- package/dist/collection/components/cura-card/cura-card.css +175 -0
- package/dist/collection/components/cura-card/cura-card.js +201 -0
- package/dist/collection/components/cura-card/cura-card.js.map +1 -0
- package/dist/collection/components/cura-card/cura-card.stories.js +127 -0
- package/dist/collection/components/cura-card/cura-card.stories.js.map +1 -0
- package/dist/collection/components/cura-icon/cura-icon.definitions.js +11 -11
- package/dist/collection/components/cura-icon/cura-icon.definitions.js.map +1 -1
- package/dist/collection/components/cura-icon/cura-icon.js +151 -151
- package/dist/collection/components/cura-icon/cura-icon.js.map +1 -1
- package/dist/collection/components/cura-icon/cura-icon.stories.js +60 -60
- package/dist/collection/components/cura-icon/cura-icon.stories.js.map +1 -1
- package/dist/collection/components/cura-icons-view/cura-icons-view.js +37 -37
- package/dist/collection/components/cura-icons-view/cura-icons-view.js.map +1 -1
- package/dist/collection/components/cura-icons-view/cura-icons-view.stories.js +7 -7
- package/dist/collection/components/cura-icons-view/cura-icons-view.stories.js.map +1 -1
- package/dist/collection/components/cura-page-template/cura-page-template.js +52 -52
- package/dist/collection/components/cura-page-template/cura-page-template.js.map +1 -1
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.css +19 -11
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +457 -427
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js.map +1 -1
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.stories.js +170 -170
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.css +50 -0
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +136 -0
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js.map +1 -0
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js +56 -0
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js.map +1 -0
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.css +10 -0
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +19 -0
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js.map +1 -0
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.css +149 -0
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +384 -0
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -0
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js +181 -0
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js.map +1 -0
- package/dist/collection/components/forms/cura-forms.definitions.js +12 -12
- package/dist/collection/components/forms/cura-forms.definitions.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.css +849 -139
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js +732 -641
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.stories.js +217 -196
- package/dist/collection/components/forms/cura-input-text/cura-input-text.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js +40 -40
- package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js.map +1 -1
- package/dist/collection/components/forms/cura-label/cura-label.js +187 -187
- package/dist/collection/components/forms/cura-label/cura-label.js.map +1 -1
- package/dist/collection/components/forms/cura-label/cura-label.stories.js +108 -108
- package/dist/collection/components/forms/cura-label/cura-label.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-radio/cura-radio.js +395 -363
- package/dist/collection/components/forms/cura-radio/cura-radio.js.map +1 -1
- package/dist/collection/components/forms/cura-radio/cura-radio.stories.js +150 -150
- package/dist/collection/components/forms/cura-radio/cura-radio.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.css +519 -0
- package/dist/collection/components/forms/cura-select/cura-select.js +444 -0
- package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -0
- package/dist/collection/components/forms/cura-select/cura-select.stories.js +144 -0
- package/dist/collection/components/forms/cura-select/cura-select.stories.js.map +1 -0
- package/dist/collection/components/forms/cura-select-options/cura-select-option.css +28 -0
- package/dist/collection/components/forms/cura-select-options/cura-select-option.js +138 -0
- package/dist/collection/components/forms/cura-select-options/cura-select-option.js.map +1 -0
- package/dist/collection/components/forms/cura-switch/cura-switch.css +88 -24
- package/dist/collection/components/forms/cura-switch/cura-switch.js +292 -264
- package/dist/collection/components/forms/cura-switch/cura-switch.js.map +1 -1
- package/dist/collection/components/forms/cura-switch/cura-switch.stories.js +115 -115
- package/dist/collection/components/forms/cura-switch/cura-switch.stories.js.map +1 -1
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +74 -74
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js.map +1 -1
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.stories.js +41 -41
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.stories.js.map +1 -1
- package/dist/collection/components/text/cura-display/cura-display.js +174 -174
- package/dist/collection/components/text/cura-display/cura-display.js.map +1 -1
- package/dist/collection/components/text/cura-display/cura-display.stories.js +97 -97
- package/dist/collection/components/text/cura-display/cura-display.stories.js.map +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +220 -220
- package/dist/collection/components/text/cura-heading/cura-heading.js.map +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.stories.js +117 -117
- package/dist/collection/components/text/cura-heading/cura-heading.stories.js.map +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +168 -168
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js.map +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js +98 -98
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js.map +1 -1
- package/dist/collection/index.js +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/rededor-cura-start.js +7 -7
- package/dist/collection/rededor-cura-start.js.map +1 -1
- package/dist/collection/utils/utils.js +11 -11
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/cura-accordion-item.d.ts +2 -2
- package/dist/components/cura-accordion-item.js +62 -61
- package/dist/components/cura-accordion-item.js.map +1 -1
- package/dist/components/cura-accordion.d.ts +2 -2
- package/dist/components/cura-accordion.js +108 -104
- package/dist/components/cura-accordion.js.map +1 -1
- package/dist/components/cura-alert.d.ts +2 -2
- package/dist/components/cura-alert.js +93 -88
- package/dist/components/cura-alert.js.map +1 -1
- package/dist/components/cura-avatar.d.ts +11 -0
- package/dist/components/cura-avatar.js +95 -0
- package/dist/components/cura-avatar.js.map +1 -0
- package/dist/components/cura-button-outline.d.ts +2 -2
- package/dist/components/cura-button-outline.js +147 -109
- package/dist/components/cura-button-outline.js.map +1 -1
- package/dist/components/cura-button-select.d.ts +2 -2
- package/dist/components/cura-button-select.js +129 -113
- package/dist/components/cura-button-select.js.map +1 -1
- package/dist/components/cura-button-transparent.d.ts +2 -2
- package/dist/components/cura-button-transparent.js +1 -116
- package/dist/components/cura-button-transparent.js.map +1 -1
- package/dist/components/cura-button-transparent2.js +144 -0
- package/dist/components/cura-button-transparent2.js.map +1 -0
- package/dist/components/cura-button.d.ts +2 -2
- package/dist/components/cura-button.js +145 -109
- package/dist/components/cura-button.js.map +1 -1
- package/dist/components/cura-calendar.d.ts +11 -0
- package/dist/components/cura-calendar.js +3969 -0
- package/dist/components/cura-calendar.js.map +1 -0
- package/dist/components/cura-card.d.ts +11 -0
- package/dist/components/cura-card.js +75 -0
- package/dist/components/cura-card.js.map +1 -0
- package/dist/components/cura-checkbox.d.ts +2 -2
- package/dist/components/cura-checkbox.js +210 -174
- package/dist/components/cura-checkbox.js.map +1 -1
- package/dist/components/cura-display.d.ts +2 -2
- package/dist/components/cura-display.js +85 -81
- package/dist/components/cura-display.js.map +1 -1
- package/dist/components/cura-dropdown-search-option-title.d.ts +11 -0
- package/dist/components/cura-dropdown-search-option-title.js +42 -0
- package/dist/components/cura-dropdown-search-option-title.js.map +1 -0
- package/dist/components/cura-dropdown-search-option.d.ts +11 -0
- package/dist/components/cura-dropdown-search-option.js +82 -0
- package/dist/components/cura-dropdown-search-option.js.map +1 -0
- package/dist/components/cura-dropdown-search.d.ts +11 -0
- package/dist/components/cura-dropdown-search.js +272 -0
- package/dist/components/cura-dropdown-search.js.map +1 -0
- package/dist/components/cura-forms.definitions.js +12 -12
- package/dist/components/cura-forms.definitions.js.map +1 -1
- package/dist/components/cura-heading.d.ts +2 -2
- package/dist/components/cura-heading2.js +97 -93
- package/dist/components/cura-heading2.js.map +1 -1
- package/dist/components/cura-icon.d.ts +2 -2
- package/dist/components/cura-icon2.js +74 -69
- package/dist/components/cura-icon2.js.map +1 -1
- package/dist/components/cura-icons-view.d.ts +2 -2
- package/dist/components/cura-icons-view.js +57 -56
- package/dist/components/cura-icons-view.js.map +1 -1
- package/dist/components/cura-input-text.d.ts +2 -2
- package/dist/components/cura-input-text.js +1 -3954
- package/dist/components/cura-input-text.js.map +1 -1
- package/dist/{cjs/cura-input-text.cjs.entry.js → components/cura-input-text2.js} +393 -283
- package/dist/components/cura-input-text2.js.map +1 -0
- package/dist/components/cura-label.d.ts +2 -2
- package/dist/components/cura-label2.js +81 -77
- package/dist/components/cura-label2.js.map +1 -1
- package/dist/components/cura-loader-circle.d.ts +2 -2
- package/dist/components/cura-loader-circle2.js +41 -40
- package/dist/components/cura-loader-circle2.js.map +1 -1
- package/dist/components/cura-page-template.d.ts +2 -2
- package/dist/components/cura-page-template.js +36 -35
- package/dist/components/cura-page-template.js.map +1 -1
- package/dist/components/cura-paragraph.d.ts +2 -2
- package/dist/components/cura-paragraph2.js +79 -75
- package/dist/components/cura-paragraph2.js.map +1 -1
- package/dist/components/cura-radio.d.ts +2 -2
- package/dist/components/cura-radio.js +176 -139
- package/dist/components/cura-radio.js.map +1 -1
- package/dist/components/cura-select-option.d.ts +11 -0
- package/dist/components/cura-select-option.js +8 -0
- package/dist/components/cura-select-option.js.map +1 -0
- package/dist/components/cura-select-option2.js +87 -0
- package/dist/components/cura-select-option2.js.map +1 -0
- package/dist/components/cura-select.d.ts +11 -0
- package/dist/components/cura-select.js +8 -0
- package/dist/components/cura-select.js.map +1 -0
- package/dist/components/cura-select2.js +308 -0
- package/dist/components/cura-select2.js.map +1 -0
- package/dist/components/cura-switch.d.ts +2 -2
- package/dist/components/cura-switch.js +138 -105
- package/dist/components/cura-switch.js.map +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +482 -466
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/index.esm.js.map +1 -1
- package/dist/cura/p-12d75346.entry.js +2 -0
- package/dist/cura/p-12d75346.entry.js.map +1 -0
- package/dist/cura/p-2176f253.entry.js +2 -0
- package/dist/cura/p-2176f253.entry.js.map +1 -0
- package/dist/cura/p-22292bfa.entry.js +2 -0
- package/dist/cura/p-22292bfa.entry.js.map +1 -0
- package/dist/cura/p-2a8be665.entry.js +2 -0
- package/dist/cura/p-2a8be665.entry.js.map +1 -0
- package/dist/cura/p-2d70b515.entry.js +2 -0
- package/dist/cura/p-2d70b515.entry.js.map +1 -0
- package/dist/cura/p-3c2ebc3a.entry.js +2 -0
- package/dist/cura/p-3c2ebc3a.entry.js.map +1 -0
- package/dist/cura/p-45a0a5e8.entry.js +2 -0
- package/dist/cura/p-45a0a5e8.entry.js.map +1 -0
- package/dist/cura/p-586bbe43.js +3 -0
- package/dist/cura/p-586bbe43.js.map +1 -0
- package/dist/cura/p-5d8e3ee3.entry.js +2 -0
- package/dist/cura/p-5d8e3ee3.entry.js.map +1 -0
- package/dist/cura/{p-f8fffdc1.js → p-70c369b1.js} +1 -1
- package/dist/cura/p-70c369b1.js.map +1 -0
- package/dist/cura/p-7c41f034.entry.js +2 -0
- package/dist/cura/p-7c41f034.entry.js.map +1 -0
- package/dist/cura/p-8cecf9e5.entry.js +2 -0
- package/dist/cura/p-8cecf9e5.entry.js.map +1 -0
- package/dist/cura/p-94b5c3b3.entry.js +2 -0
- package/dist/cura/p-94b5c3b3.entry.js.map +1 -0
- package/dist/cura/p-a5456007.entry.js +2 -0
- package/dist/cura/p-a5456007.entry.js.map +1 -0
- package/dist/cura/{p-c791725b.js → p-a7221f0c.js} +1 -1
- package/dist/{esm-es5/cura-icon.definitions-a63d1862.js.map → cura/p-a7221f0c.js.map} +1 -1
- package/dist/cura/p-cd757625.entry.js +2 -0
- package/dist/cura/p-cd757625.entry.js.map +1 -0
- package/dist/cura/p-de870781.entry.js +2 -0
- package/dist/cura/p-de870781.entry.js.map +1 -0
- package/dist/cura/p-e661bcca.entry.js +2 -0
- package/dist/cura/p-e661bcca.entry.js.map +1 -0
- package/dist/cura/p-ee7388a5.entry.js +2 -0
- package/dist/cura/p-ee7388a5.entry.js.map +1 -0
- package/dist/cura/{p-3688570d.js → p-f9b8f665.js} +1 -1
- package/dist/{esm-es5/cura-forms.definitions-0f774253.js.map → cura/p-f9b8f665.js.map} +1 -1
- package/dist/cura/p-fb9bece3.entry.js +2 -0
- package/dist/cura/p-fb9bece3.entry.js.map +1 -0
- package/dist/esm/app-globals-f2da2b14.js +509 -0
- package/dist/esm/app-globals-f2da2b14.js.map +1 -0
- package/dist/esm/cura-accordion_9.entry.js +532 -0
- package/dist/esm/cura-accordion_9.entry.js.map +1 -0
- package/dist/esm/cura-alert.entry.js +57 -55
- package/dist/esm/cura-alert.entry.js.map +1 -1
- package/dist/esm/cura-avatar.entry.js +64 -0
- package/dist/esm/cura-avatar.entry.js.map +1 -0
- package/dist/esm/cura-button-outline.entry.js +102 -71
- package/dist/esm/cura-button-outline.entry.js.map +1 -1
- package/dist/esm/cura-button-select.entry.js +91 -85
- package/dist/esm/cura-button-select.entry.js.map +1 -1
- package/dist/esm/{cura-input-text.entry.js → cura-button-transparent_2.entry.js} +423 -276
- package/dist/esm/cura-button-transparent_2.entry.js.map +1 -0
- package/dist/esm/cura-calendar.entry.js +3909 -0
- package/dist/esm/cura-calendar.entry.js.map +1 -0
- package/dist/esm/cura-card.entry.js +49 -0
- package/dist/esm/cura-card.entry.js.map +1 -0
- package/dist/esm/cura-checkbox.entry.js +168 -131
- package/dist/esm/cura-checkbox.entry.js.map +1 -1
- package/dist/esm/cura-display.entry.js +63 -62
- package/dist/esm/cura-display.entry.js.map +1 -1
- package/dist/esm/cura-dropdown-search-option-title.entry.js +18 -0
- package/dist/esm/cura-dropdown-search-option-title.entry.js.map +1 -0
- package/dist/esm/cura-dropdown-search-option.entry.js +51 -0
- package/dist/esm/cura-dropdown-search-option.entry.js.map +1 -0
- package/dist/esm/cura-dropdown-search.entry.js +205 -0
- package/dist/esm/cura-dropdown-search.entry.js.map +1 -0
- package/dist/esm/cura-forms.definitions-2f963167.js +18 -0
- package/dist/esm/cura-forms.definitions-2f963167.js.map +1 -0
- package/dist/esm/cura-icon.definitions-aaa4e80f.js +18 -0
- package/dist/esm/cura-icon.definitions-aaa4e80f.js.map +1 -0
- package/dist/esm/cura-icons-view.entry.js +24 -23
- package/dist/esm/cura-icons-view.entry.js.map +1 -1
- package/dist/esm/cura-radio.entry.js +142 -103
- package/dist/esm/cura-radio.entry.js.map +1 -1
- package/dist/esm/cura-select_2.entry.js +320 -0
- package/dist/esm/cura-select_2.entry.js.map +1 -0
- package/dist/esm/cura-switch.entry.js +113 -78
- package/dist/esm/cura-switch.entry.js.map +1 -1
- package/dist/esm/cura.js +14 -23
- package/dist/esm/cura.js.map +1 -1
- package/dist/esm/index-b6c443d5.js +1500 -0
- package/dist/esm/index-b6c443d5.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +8 -33
- package/dist/esm/loader.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/loader/cdn.js +1 -3
- package/dist/loader/index.cjs.js +1 -3
- package/dist/loader/index.d.ts +4 -1
- package/dist/loader/index.es2017.js +1 -3
- package/dist/loader/index.js +1 -3
- package/dist/types/api/cura-api.d.ts +3 -3
- package/dist/types/api/cura-api.type.d.ts +44 -44
- package/dist/types/api/modules/cura-theme-breakpoints-module.d.ts +3 -3
- package/dist/types/api/modules/cura-theme-colors-module.d.ts +46 -46
- package/dist/types/api/modules/cura-theme-fonts-module.d.ts +22 -22
- package/dist/types/api/modules/cura-theme-module.d.ts +25 -25
- package/dist/types/api/modules/cura-theme-spacing-module.d.ts +4 -4
- package/dist/types/api/theme-presets/static.d.ts +62 -62
- package/dist/types/api/theme-presets/theme-default.d.ts +38 -38
- package/dist/types/api/theme-presets/theme-legacy-default.d.ts +38 -38
- package/dist/types/api/theme-presets/theme-maternity.d.ts +38 -38
- package/dist/types/api/theme-presets/theme-oncology.d.ts +45 -45
- package/dist/types/api/theme-presets/theme-presets.d.ts +175 -175
- package/dist/types/components/accordion/cura-accordion/cura-accordion.d.ts +37 -37
- package/dist/types/components/accordion/cura-accordion/cura-accordion.stories.d.ts +140 -140
- package/dist/types/components/accordion/cura-accordion-item/cura-accordion-item.d.ts +27 -27
- package/dist/types/components/buttons/cura-button/cura-button.d.ts +70 -59
- package/dist/types/components/buttons/cura-button/cura-button.stories.d.ts +184 -155
- package/dist/types/components/buttons/cura-button-outline/cura-button-outline.d.ts +70 -59
- package/dist/types/components/buttons/cura-button-outline/cura-button-outline.stories.d.ts +184 -155
- package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +48 -47
- package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.d.ts +65 -59
- package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.stories.d.ts +169 -155
- package/dist/types/components/cura-alert/cura-alert.d.ts +14 -13
- package/dist/types/components/cura-alert/cura-alert.stories.d.ts +85 -70
- package/dist/types/components/cura-avatar/cura-avatar.d.ts +24 -0
- package/dist/types/components/cura-avatar/cura-avatar.definitions.d.ts +14 -0
- package/dist/types/components/cura-avatar/cura-avatar.stories.d.ts +167 -0
- package/dist/types/components/cura-calendar/cura-calendar.d.ts +323 -0
- package/dist/types/components/cura-calendar/cura-calendar.stories.d.ts +128 -0
- package/dist/types/components/cura-card/cura-card.d.ts +48 -0
- package/dist/types/components/cura-card/cura-card.stories.d.ts +98 -0
- package/dist/types/components/cura-icon/cura-icon.d.ts +12 -12
- package/dist/types/components/cura-icon/cura-icon.definitions.d.ts +44 -44
- package/dist/types/components/cura-icon/cura-icon.stories.d.ts +56 -56
- package/dist/types/components/cura-icons-view/cura-icons-view.d.ts +6 -6
- package/dist/types/components/cura-icons-view/cura-icons-view.stories.d.ts +3 -3
- package/dist/types/components/cura-page-template/cura-page-template.d.ts +6 -6
- package/dist/types/components/forms/cura-checkbox/cura-checkbox.d.ts +111 -95
- package/dist/types/components/forms/cura-checkbox/cura-checkbox.stories.d.ts +193 -193
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.d.ts +27 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.d.ts +44 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.d.ts +3 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +103 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.stories.d.ts +112 -0
- package/dist/types/components/forms/cura-forms.definitions.d.ts +12 -12
- package/dist/types/components/forms/cura-input-text/cura-input-text.d.ts +169 -132
- package/dist/types/components/forms/cura-input-text/cura-input-text.stories.d.ts +241 -218
- package/dist/types/components/forms/cura-input-text/mask-presets/input-mask-presets.d.ts +1 -2
- package/dist/types/components/forms/cura-label/cura-label.d.ts +52 -52
- package/dist/types/components/forms/cura-label/cura-label.stories.d.ts +112 -112
- package/dist/types/components/forms/cura-radio/cura-radio.d.ts +96 -74
- package/dist/types/components/forms/cura-radio/cura-radio.stories.d.ts +162 -162
- package/dist/types/components/forms/cura-select/cura-select.d.ts +176 -0
- package/dist/types/components/forms/cura-select/cura-select.stories.d.ts +156 -0
- package/dist/types/components/forms/cura-select-options/cura-select-option.d.ts +17 -0
- package/dist/types/components/forms/cura-switch/cura-switch.d.ts +78 -57
- package/dist/types/components/forms/cura-switch/cura-switch.stories.d.ts +121 -121
- package/dist/types/components/loaders/cura-loader-circle/cura-loader-circle.d.ts +21 -21
- package/dist/types/components/loaders/cura-loader-circle/cura-loader-circle.stories.d.ts +35 -35
- package/dist/types/components/text/cura-display/cura-display.d.ts +47 -47
- package/dist/types/components/text/cura-display/cura-display.stories.d.ts +101 -101
- package/dist/types/components/text/cura-heading/cura-heading.d.ts +58 -58
- package/dist/types/components/text/cura-heading/cura-heading.stories.d.ts +127 -127
- package/dist/types/components/text/cura-paragraph/cura-paragraph.d.ts +47 -47
- package/dist/types/components/text/cura-paragraph/cura-paragraph.stories.d.ts +99 -99
- package/dist/types/components.d.ts +689 -13
- package/dist/types/index.d.ts +4 -4
- package/dist/types/rededor-cura-start.d.ts +4 -4
- package/dist/types/stencil-public-runtime.d.ts +51 -15
- package/package.json +5 -5
- package/dist/cjs/app-globals-2988084b.js +0 -511
- package/dist/cjs/app-globals-2988084b.js.map +0 -1
- package/dist/cjs/css-shim-83cf0349.js +0 -8
- package/dist/cjs/css-shim-83cf0349.js.map +0 -1
- package/dist/cjs/cura-accordion_8.cjs.entry.js +0 -445
- package/dist/cjs/cura-accordion_8.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-button-transparent.cjs.entry.js +0 -83
- package/dist/cjs/cura-button-transparent.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-forms.definitions-11be2ebd.js +0 -20
- package/dist/cjs/cura-forms.definitions-11be2ebd.js.map +0 -1
- package/dist/cjs/cura-icon.definitions-b73b0178.js +0 -21
- package/dist/cjs/cura-icon.definitions-b73b0178.js.map +0 -1
- package/dist/cjs/cura-input-text.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-label.cjs.entry.js +0 -69
- package/dist/cjs/cura-label.cjs.entry.js.map +0 -1
- package/dist/cjs/index-7616f620.js +0 -2281
- package/dist/cjs/index-7616f620.js.map +0 -1
- package/dist/cjs/shadow-css-8baae635.js +0 -391
- package/dist/cjs/shadow-css-8baae635.js.map +0 -1
- package/dist/collection/utils/utils.spec.js +0 -16
- package/dist/collection/utils/utils.spec.js.map +0 -1
- package/dist/cura/cura.js +0 -133
- package/dist/cura/p-118112e5.system.js +0 -14
- package/dist/cura/p-118112e5.system.js.map +0 -1
- package/dist/cura/p-120926c5.system.js +0 -2
- package/dist/cura/p-120926c5.system.js.map +0 -1
- package/dist/cura/p-1228e771.entry.js +0 -2
- package/dist/cura/p-1228e771.entry.js.map +0 -1
- package/dist/cura/p-183305c3.js +0 -2
- package/dist/cura/p-183305c3.js.map +0 -1
- package/dist/cura/p-2d42ccf4.entry.js +0 -2
- package/dist/cura/p-2d42ccf4.entry.js.map +0 -1
- package/dist/cura/p-3688570d.js.map +0 -1
- package/dist/cura/p-36a83bc7.system.js +0 -3
- package/dist/cura/p-36a83bc7.system.js.map +0 -1
- package/dist/cura/p-3f3355f3.system.entry.js +0 -2
- package/dist/cura/p-3f3355f3.system.entry.js.map +0 -1
- package/dist/cura/p-3f5de5e2.entry.js +0 -2
- package/dist/cura/p-3f5de5e2.entry.js.map +0 -1
- package/dist/cura/p-3f6aaefc.system.js +0 -2
- package/dist/cura/p-3f6aaefc.system.js.map +0 -1
- package/dist/cura/p-48426f60.system.js +0 -2
- package/dist/cura/p-48426f60.system.js.map +0 -1
- package/dist/cura/p-4db87e8d.system.entry.js +0 -2
- package/dist/cura/p-4db87e8d.system.entry.js.map +0 -1
- package/dist/cura/p-51e00a16.entry.js +0 -2
- package/dist/cura/p-51e00a16.entry.js.map +0 -1
- package/dist/cura/p-72a9ed55.entry.js +0 -2
- package/dist/cura/p-72a9ed55.entry.js.map +0 -1
- package/dist/cura/p-75b2e4d1.system.entry.js +0 -2
- package/dist/cura/p-75b2e4d1.system.entry.js.map +0 -1
- package/dist/cura/p-880917c1.entry.js +0 -2
- package/dist/cura/p-880917c1.entry.js.map +0 -1
- package/dist/cura/p-8d959fb2.entry.js +0 -2
- package/dist/cura/p-8d959fb2.entry.js.map +0 -1
- package/dist/cura/p-9471c93e.system.entry.js +0 -2
- package/dist/cura/p-9471c93e.system.entry.js.map +0 -1
- package/dist/cura/p-98014544.entry.js +0 -2
- package/dist/cura/p-98014544.entry.js.map +0 -1
- package/dist/cura/p-98352c92.system.entry.js +0 -2
- package/dist/cura/p-98352c92.system.entry.js.map +0 -1
- package/dist/cura/p-a32889a4.system.js +0 -2
- package/dist/cura/p-a32889a4.system.js.map +0 -1
- package/dist/cura/p-ab8c9a8f.system.entry.js +0 -2
- package/dist/cura/p-ab8c9a8f.system.entry.js.map +0 -1
- package/dist/cura/p-ad194144.entry.js +0 -2
- package/dist/cura/p-ad194144.entry.js.map +0 -1
- package/dist/cura/p-b0e13882.system.entry.js +0 -2
- package/dist/cura/p-b0e13882.system.entry.js.map +0 -1
- package/dist/cura/p-ba66d7be.js +0 -3
- package/dist/cura/p-ba66d7be.js.map +0 -1
- package/dist/cura/p-bb3f9d05.entry.js +0 -2
- package/dist/cura/p-bb3f9d05.entry.js.map +0 -1
- package/dist/cura/p-beab48cd.js +0 -13
- package/dist/cura/p-beab48cd.js.map +0 -1
- package/dist/cura/p-c791725b.js.map +0 -1
- package/dist/cura/p-cb4e2a0c.system.entry.js +0 -2
- package/dist/cura/p-cb4e2a0c.system.entry.js.map +0 -1
- package/dist/cura/p-d3f9c888.system.js +0 -2
- package/dist/cura/p-d3f9c888.system.js.map +0 -1
- package/dist/cura/p-e5e259fd.system.entry.js +0 -2
- package/dist/cura/p-e5e259fd.system.entry.js.map +0 -1
- package/dist/cura/p-edeffbfc.entry.js +0 -2
- package/dist/cura/p-edeffbfc.entry.js.map +0 -1
- package/dist/cura/p-f51705c2.system.entry.js +0 -2
- package/dist/cura/p-f51705c2.system.entry.js.map +0 -1
- package/dist/cura/p-f89f2ecc.system.entry.js +0 -2
- package/dist/cura/p-f89f2ecc.system.entry.js.map +0 -1
- package/dist/cura/p-f8fffdc1.js.map +0 -1
- package/dist/cura/p-fc4ba4ce.system.js +0 -2
- package/dist/cura/p-fc4ba4ce.system.js.map +0 -1
- package/dist/cura/p-fef52079.entry.js +0 -2
- package/dist/cura/p-fef52079.entry.js.map +0 -1
- package/dist/cura/p-ffd41520.system.entry.js +0 -2
- package/dist/cura/p-ffd41520.system.entry.js.map +0 -1
- package/dist/esm/app-globals-29001758.js +0 -509
- package/dist/esm/app-globals-29001758.js.map +0 -1
- package/dist/esm/css-shim-d13f0738.js +0 -6
- package/dist/esm/css-shim-d13f0738.js.map +0 -1
- package/dist/esm/cura-accordion_8.entry.js +0 -434
- package/dist/esm/cura-accordion_8.entry.js.map +0 -1
- package/dist/esm/cura-button-transparent.entry.js +0 -79
- package/dist/esm/cura-button-transparent.entry.js.map +0 -1
- package/dist/esm/cura-forms.definitions-0f774253.js +0 -18
- package/dist/esm/cura-forms.definitions-0f774253.js.map +0 -1
- package/dist/esm/cura-icon.definitions-a63d1862.js +0 -18
- package/dist/esm/cura-icon.definitions-a63d1862.js.map +0 -1
- package/dist/esm/cura-input-text.entry.js.map +0 -1
- package/dist/esm/cura-label.entry.js +0 -65
- package/dist/esm/cura-label.entry.js.map +0 -1
- package/dist/esm/index-81f1a268.js +0 -2249
- package/dist/esm/index-81f1a268.js.map +0 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/shadow-css-07b0c8c8.js +0 -389
- package/dist/esm/shadow-css-07b0c8c8.js.map +0 -1
- package/dist/esm-es5/app-globals-29001758.js +0 -2
- package/dist/esm-es5/app-globals-29001758.js.map +0 -1
- package/dist/esm-es5/css-shim-d13f0738.js +0 -2
- package/dist/esm-es5/css-shim-d13f0738.js.map +0 -1
- package/dist/esm-es5/cura-accordion_8.entry.js +0 -2
- package/dist/esm-es5/cura-accordion_8.entry.js.map +0 -1
- package/dist/esm-es5/cura-alert.entry.js +0 -2
- package/dist/esm-es5/cura-alert.entry.js.map +0 -1
- package/dist/esm-es5/cura-button-outline.entry.js +0 -2
- package/dist/esm-es5/cura-button-outline.entry.js.map +0 -1
- package/dist/esm-es5/cura-button-select.entry.js +0 -2
- package/dist/esm-es5/cura-button-select.entry.js.map +0 -1
- package/dist/esm-es5/cura-button-transparent.entry.js +0 -2
- package/dist/esm-es5/cura-button-transparent.entry.js.map +0 -1
- package/dist/esm-es5/cura-checkbox.entry.js +0 -2
- package/dist/esm-es5/cura-checkbox.entry.js.map +0 -1
- package/dist/esm-es5/cura-display.entry.js +0 -2
- package/dist/esm-es5/cura-display.entry.js.map +0 -1
- package/dist/esm-es5/cura-forms.definitions-0f774253.js +0 -2
- package/dist/esm-es5/cura-icon.definitions-a63d1862.js +0 -2
- package/dist/esm-es5/cura-icons-view.entry.js +0 -2
- package/dist/esm-es5/cura-icons-view.entry.js.map +0 -1
- package/dist/esm-es5/cura-input-text.entry.js +0 -2
- package/dist/esm-es5/cura-input-text.entry.js.map +0 -1
- package/dist/esm-es5/cura-label.entry.js +0 -2
- package/dist/esm-es5/cura-label.entry.js.map +0 -1
- package/dist/esm-es5/cura-radio.entry.js +0 -2
- package/dist/esm-es5/cura-radio.entry.js.map +0 -1
- package/dist/esm-es5/cura-switch.entry.js +0 -2
- package/dist/esm-es5/cura-switch.entry.js.map +0 -1
- package/dist/esm-es5/cura.js +0 -2
- package/dist/esm-es5/cura.js.map +0 -1
- package/dist/esm-es5/index-81f1a268.js +0 -3
- package/dist/esm-es5/index-81f1a268.js.map +0 -1
- package/dist/esm-es5/index.js +0 -2
- package/dist/esm-es5/index.js.map +0 -1
- package/dist/esm-es5/loader.js +0 -2
- package/dist/esm-es5/loader.js.map +0 -1
- package/dist/esm-es5/shadow-css-07b0c8c8.js +0 -13
- package/dist/esm-es5/shadow-css-07b0c8c8.js.map +0 -1
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-b6c443d5.js';
|
|
2
|
+
|
|
3
|
+
const curaSelectCss = ":host{display:block;position:relative;font-family:var(--font-family)}.wrapper{width:100%;user-select:none;text-align:left !important}.wrapper cura-label{margin-bottom:8px}.wrapper .helper-text{margin-top:8px;color:var(--neutral-dark)}.wrapper .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.wrapper .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper .cura-input-field .feedback-icon{padding-left:12px}.wrapper .cura-input-field .up-down-icon{order:3;padding-right:12px;cursor:pointer;pointer-events:all}.wrapper .cura-input-field input{padding:0px 12px 0px 8px}.wrapper .cura-input-field.open{border-radius:4px 4px 0 0 !important}.wrapper.transparent{background-color:transparent;padding:0px;max-height:80px}.wrapper.transparent .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;background-color:transparent !important;border:none !important;border-radius:0;height:27px}.wrapper.transparent .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.transparent .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.transparent .cura-input-field .feedback-icon{padding-left:12px}.wrapper.transparent .cura-input-field input{color:var(--neutral-black) !important;font-size:16px;font-weight:var(--font-weight-bold) !important;padding:0}.wrapper.transparent .cura-input-field input::placeholder{color:var(--neutral-black)}.wrapper.transparent .cura-input-field .feedback-icon{order:3;margin:0 20px 0 0}.wrapper.transparent:focus-within .cura-input-field{border:none !important;background-color:transparent !important}.wrapper.transparent:focus-within .cura-input-field input{border:none !important;outline:none}.wrapper.transparent .helper-text{margin-top:0px}.wrapper:hover:not(.disabled):not(.isLoading):not(.success):not(.error):not(.isFocused):not(.readOnly):not(.transparent) .cura-input-field{border-color:var(--neutral-dark)}.wrapper:hover:not(.disabled):not(.isLoading):not(.success):not(.error):not(.isFocused):not(.readOnly):not(.transparent) .cura-input-field input{color:var(--neutral-dark)}.wrapper:hover:not(.disabled):not(.isLoading):not(.success):not(.error):not(.isFocused):not(.readOnly):not(.transparent) .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper:focus-within .cura-input-field{border:2px solid var(--info-base) !important;background-color:var(--neutral-purewhite);outline:none}.wrapper:focus-within .cura-input-field input{color:var(--neutral-black) !important}.wrapper.success .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.wrapper.success .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.success .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.success .cura-input-field .feedback-icon{padding-left:12px}.wrapper.success .cura-input-field input{color:var(--success-darker) !important}.wrapper.success .cura-input-field input::placeholder{color:var(--success-darker) !important}.wrapper.success:not(.transparent) .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;border:2px solid var(--success-dark) !important;background-color:var(--success-lighter) !important}.wrapper.success:not(.transparent) .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.success:not(.transparent) .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.success:not(.transparent) .cura-input-field .feedback-icon{padding-left:12px}.wrapper.error .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.wrapper.error .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.error .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.error .cura-input-field .feedback-icon{padding-left:12px}.wrapper.error .cura-input-field input{color:var(--error-darker) !important}.wrapper.error .cura-input-field input::placeholder{color:var(--error-darker) !important}.wrapper.error:not(.transparent) .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;border:2px solid var(--error-dark) !important;background-color:var(--error-lighter) !important}.wrapper.error:not(.transparent) .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.error:not(.transparent) .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.error:not(.transparent) .cura-input-field .feedback-icon{padding-left:12px}.wrapper.disabled .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;background-color:var(--neutral-white);border:2px solid var(--neutral-base)}.wrapper.disabled .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.disabled .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.disabled .cura-input-field .feedback-icon{padding-left:12px}.wrapper.disabled .cura-input-field input{color:var(--neutral-medium)}.wrapper.disabled .cura-input-field input::placeholder{color:var(--neutral-medium)}.wrapper.small .cura-input-field{width:100%;height:32px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.wrapper.small .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:12px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.small .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.small .cura-input-field .feedback-icon{padding-left:12px}.wrapper.small .cura-input-field input{line-height:13px;letter-spacing:0.72px}.wrapper.small .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-regular)}.wrapper.small.label .menu{top:53px}.wrapper.small .menu{top:33px}.wrapper.medium .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.wrapper.medium .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.medium .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.medium .cura-input-field .feedback-icon{padding-left:12px}.wrapper.medium .cura-input-field input{line-height:16px;letter-spacing:0.56px}.wrapper.medium .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-regular)}.wrapper.medium.label .menu{top:61px}.wrapper.medium .menu{top:40px}.wrapper.large .cura-input-field{width:100%;height:44px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.wrapper.large .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:16px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.large .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.large .cura-input-field .feedback-icon{padding-left:12px}.wrapper.large .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-bold)}.wrapper.large.label .menu{top:69px}.wrapper.large .menu{top:47px}.required{color:red}.menu{position:absolute;left:0;right:-1px;background:#fff;border:2px solid var(--neutral-light);border-radius:4px;z-index:1000;max-height:285px;overflow:hidden;border-top:transparent;align-items:center;scrollbar-color:var(--neutral-medium) var(--neutral-black-20);overflow-y:scroll;box-shadow:0px 4px 8px 0px rgba(38, 38, 38, 0.16)}.menu.open{border-radius:0 !important}";
|
|
4
|
+
const CuraSelectStyle0 = curaSelectCss;
|
|
5
|
+
|
|
6
|
+
const CuraSelect = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.selected = createEvent(this, "selected", 7);
|
|
10
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
11
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
15
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Styles to be applied to the component.
|
|
19
|
+
*/
|
|
20
|
+
this.styles = {};
|
|
21
|
+
/**
|
|
22
|
+
* Theme object containing font and color information.
|
|
23
|
+
*/
|
|
24
|
+
this.theme = window.CuraAPI.theme;
|
|
25
|
+
/**
|
|
26
|
+
* Handles mutations observed by the MutationObserver.
|
|
27
|
+
* Updates the selected option or filters options based on the mutation type.
|
|
28
|
+
*/
|
|
29
|
+
this.handleMutations = (mutations) => {
|
|
30
|
+
mutations.forEach(mutation => {
|
|
31
|
+
if (mutation.type === 'attributes') {
|
|
32
|
+
if (mutation.attributeName === 'selected')
|
|
33
|
+
this.updateSelectedOption();
|
|
34
|
+
if (mutation.attributeName === 'value')
|
|
35
|
+
this.filterOptions();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Handles the selection of an option.
|
|
41
|
+
*/
|
|
42
|
+
this.onOptiselected = (event) => {
|
|
43
|
+
const selectedOption = event.target;
|
|
44
|
+
this.clearSelectedAttributes();
|
|
45
|
+
selectedOption.setAttribute('selected', 'true');
|
|
46
|
+
};
|
|
47
|
+
this.handleKeyDown = (event) => {
|
|
48
|
+
var _a;
|
|
49
|
+
if (!this.isOpen)
|
|
50
|
+
return;
|
|
51
|
+
const { key } = event;
|
|
52
|
+
if (key === 'ArrowDown') {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
this.updateActiveIndex(1);
|
|
55
|
+
}
|
|
56
|
+
if (key === 'ArrowUp') {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
this.updateActiveIndex(-1);
|
|
59
|
+
}
|
|
60
|
+
if (key === 'Enter') {
|
|
61
|
+
(_a = this.options[this.activeIndex]) === null || _a === void 0 ? void 0 : _a.click();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
this.handleInputChange = (e) => {
|
|
65
|
+
this.value = e.target.value;
|
|
66
|
+
this.isOpen = !!this.value.length;
|
|
67
|
+
this.internals.setFormValue(this.value);
|
|
68
|
+
};
|
|
69
|
+
this.handleClick = (event) => {
|
|
70
|
+
if (this.disabled)
|
|
71
|
+
return event.preventDefault();
|
|
72
|
+
const target = event.target;
|
|
73
|
+
if (target.tagName === 'CURA-SELECT-OPTION')
|
|
74
|
+
return this.onOptiselected(event);
|
|
75
|
+
this.isOpen = !this.isOpen;
|
|
76
|
+
};
|
|
77
|
+
this.label = '';
|
|
78
|
+
this.placeholder = '';
|
|
79
|
+
this.value = '';
|
|
80
|
+
this.mode = 'default';
|
|
81
|
+
this.size = 'medium';
|
|
82
|
+
this.status = 'default';
|
|
83
|
+
this.disabled = false;
|
|
84
|
+
this.required = false;
|
|
85
|
+
this.isHovered = false;
|
|
86
|
+
this.isFocused = false;
|
|
87
|
+
this.isOpen = false;
|
|
88
|
+
this.options = undefined;
|
|
89
|
+
this.activeIndex = -1;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Callback for form association.
|
|
93
|
+
*/
|
|
94
|
+
formAssociatedCallback(form) {
|
|
95
|
+
form.ariaLabel = this.label;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Callback to restore the switch state from the form.
|
|
99
|
+
*/
|
|
100
|
+
formStateRestoreCallback(state) {
|
|
101
|
+
this.value = state.value;
|
|
102
|
+
this.updateSelectedOption();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Callback to reset the switch state when the form is reset.
|
|
106
|
+
*/
|
|
107
|
+
formResetCallback() {
|
|
108
|
+
this.value = '';
|
|
109
|
+
this.clearSelectedAttributes();
|
|
110
|
+
this.internals.setFormValue(this.value);
|
|
111
|
+
this.internals.setValidity({});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Callback to update the switch's disabled state when the form's disabled state changes.
|
|
115
|
+
*/
|
|
116
|
+
formDisabledCallback(disabled) {
|
|
117
|
+
this.disabled = disabled;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Lifecycle method called before the component is rendered.
|
|
121
|
+
* Initializes the options for the select component.
|
|
122
|
+
*/
|
|
123
|
+
componentWillLoad() {
|
|
124
|
+
this.initializeOptions();
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Lifecycle method called after the component is rendered.
|
|
128
|
+
* Initializes select-related functionality.
|
|
129
|
+
*/
|
|
130
|
+
componentDidLoad() {
|
|
131
|
+
this.setupMutationObserver();
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Lifecycle method called when the component is connected to the DOM.
|
|
135
|
+
* Applies styles based on the theme.
|
|
136
|
+
*/
|
|
137
|
+
connectedCallback() {
|
|
138
|
+
this.applyStyles();
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Lifecycle method called when the component is disconnected from the DOM.
|
|
142
|
+
* Disconnects the MutationObserver if it exists.
|
|
143
|
+
*/
|
|
144
|
+
disconnectedCallback() {
|
|
145
|
+
var _a;
|
|
146
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
147
|
+
}
|
|
148
|
+
initializeOptions() {
|
|
149
|
+
this.options = this.host.querySelectorAll('cura-select-option');
|
|
150
|
+
this.options.forEach(option => {
|
|
151
|
+
option.setAttribute('size', this.size);
|
|
152
|
+
option.setAttribute('selected', 'false');
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Applies styles to the component based on the theme.
|
|
157
|
+
*/
|
|
158
|
+
applyStyles() {
|
|
159
|
+
const { fonts, colors } = this.theme;
|
|
160
|
+
const fontWeights = fonts.getWeights();
|
|
161
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--font-weight-medium': fontWeights.medium, '--font-weight-bold': fontWeights.bold, '--font-weight-regular': fontWeights.regular, '--font-color': fonts.getColor(), '--font-family': fonts.getFamily(), '--font-size': fonts.getSize() });
|
|
162
|
+
const colorKeys = [
|
|
163
|
+
'primary-base', 'neutral-purewhite', 'neutral-white', 'neutral-black', 'neutral-medium', 'neutral-light',
|
|
164
|
+
'neutral-base', 'neutral-dark', 'success-dark', 'success-darker', 'success-lighter',
|
|
165
|
+
'error-lighter', 'error-dark', 'error-darker', 'error-base', 'info-base'
|
|
166
|
+
];
|
|
167
|
+
colorKeys.forEach(key => {
|
|
168
|
+
this.styles[`--${key}`] = colors.getColor(key);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Sets up a MutationObserver to watch for changes in the component.
|
|
173
|
+
*/
|
|
174
|
+
setupMutationObserver() {
|
|
175
|
+
this.mutationObserver = new MutationObserver(this.handleMutations);
|
|
176
|
+
this.mutationObserver.observe(this.host, { attributes: true, subtree: true, attributeFilter: ['selected', 'value'] });
|
|
177
|
+
}
|
|
178
|
+
updateSelectedOption() {
|
|
179
|
+
const selectedOption = this.host.querySelector('cura-select-option[selected]');
|
|
180
|
+
if (selectedOption) {
|
|
181
|
+
const selectedValue = selectedOption.textContent;
|
|
182
|
+
if (this.value !== selectedValue) {
|
|
183
|
+
this.value = selectedValue;
|
|
184
|
+
this.isOpen = false;
|
|
185
|
+
this.internals.setFormValue(this.value);
|
|
186
|
+
this.selected.emit({ value: this.value, selected: true });
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Clears the 'selected' attribute from all options.
|
|
192
|
+
*/
|
|
193
|
+
clearSelectedAttributes() {
|
|
194
|
+
this.options.forEach(option => option.removeAttribute('selected'));
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Filters the options based on the current input value.
|
|
198
|
+
*/
|
|
199
|
+
filterOptions() {
|
|
200
|
+
const inputValue = this.value.toLowerCase();
|
|
201
|
+
this.options.forEach(option => {
|
|
202
|
+
var _a;
|
|
203
|
+
const optionValue = ((_a = option.textContent) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '';
|
|
204
|
+
const isVisible = this.isOpen ? optionValue.includes(inputValue) : true;
|
|
205
|
+
option.style.display = isVisible ? 'block' : 'none';
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
updateActiveIndex(direction) {
|
|
209
|
+
if (this.options.length === 0)
|
|
210
|
+
return;
|
|
211
|
+
this.activeIndex = (this.activeIndex + direction + this.options.length) % this.options.length;
|
|
212
|
+
this.updateOptionHighlights();
|
|
213
|
+
}
|
|
214
|
+
updateOptionHighlights() {
|
|
215
|
+
this.options.forEach((option, index) => option.active = index === this.activeIndex);
|
|
216
|
+
}
|
|
217
|
+
getClasses() {
|
|
218
|
+
return {
|
|
219
|
+
wrapper: true,
|
|
220
|
+
label: !!this.label,
|
|
221
|
+
disabled: this.disabled,
|
|
222
|
+
transparent: this.mode === 'transparent',
|
|
223
|
+
[this.size.toLowerCase()]: true,
|
|
224
|
+
[this.status.toLowerCase()]: true,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Determines the color based on the item type and component state.
|
|
229
|
+
*/
|
|
230
|
+
getColor(item) {
|
|
231
|
+
if (this.disabled)
|
|
232
|
+
return 'neutral-medium';
|
|
233
|
+
const isStatusDefault = this.status === 'default';
|
|
234
|
+
const isHoveredOrFocused = this.isFocused || this.isHovered;
|
|
235
|
+
if (item === 'label') {
|
|
236
|
+
if (!isStatusDefault || isHoveredOrFocused)
|
|
237
|
+
return 'neutral-black';
|
|
238
|
+
return 'neutral-dark';
|
|
239
|
+
}
|
|
240
|
+
if (isHoveredOrFocused && isStatusDefault)
|
|
241
|
+
return 'neutral-black';
|
|
242
|
+
if (this.status === 'success')
|
|
243
|
+
return 'success-dark';
|
|
244
|
+
if (this.status === 'error')
|
|
245
|
+
return 'error-dark';
|
|
246
|
+
return 'neutral-dark';
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Renders the icon based on the component's status.
|
|
250
|
+
*/
|
|
251
|
+
renderIcon() {
|
|
252
|
+
if (this.status === 'default')
|
|
253
|
+
return null;
|
|
254
|
+
const icon = { success: 'checkCircle', error: 'alertCircle' }[this.status];
|
|
255
|
+
return (h("cura-icon", { class: 'feedback-icon', name: icon, iconset: 'default', size: this.size === 'large' ? 20 : 16, color: this.getColor('icon'), style: this.styles }));
|
|
256
|
+
}
|
|
257
|
+
render() {
|
|
258
|
+
return (h(Host, { key: '25024f752db0a0189ece93612e54a43b47668efd', style: this.styles }, h("div", { key: 'eae2f00129bb2d82fa1586ce7f6e2e4bb71b20de', class: this.getClasses(), tabIndex: 0, ref: (el) => (this.selectRef = el), onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), onKeyDown: this.handleKeyDown, onClick: this.handleClick }, this.label && (h("cura-label", { key: '0ac1eb8e18c97432a2c46e35dc04fce4d2dc640a', class: 'label', weight: 'bold', size: this.size === 'large' ? 'small' : 'xsmall', color: this.getColor('label') }, this.label, " ", this.required && h("span", { key: '09e8e758d595c641afbb7729847bc6e123ecd869', class: 'required' }, "* "))), h("div", { key: '2248ebad1ab820689635db06db8725d39118b04b', class: {
|
|
259
|
+
'cura-input-field': true,
|
|
260
|
+
'open': this.isOpen
|
|
261
|
+
} }, this.renderIcon(), h("input", { key: 'ea3909b76182006256055be075a446a8cb2813af', tabIndex: 0, type: "text", autocomplete: 'off', onFocus: () => (this.isFocused = true), onBlur: () => (this.isFocused = false), "aria-required": String(this.required), "aria-disabled": String(this.disabled), "aria-invalid": String(this.status === 'error'), onInput: this.handleInputChange, style: this.styles, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.value }), h("cura-icon", { key: '13a28271273b9a96e39cb62ca91e6769ea33ee43', name: this.isOpen ? 'up' : 'down', class: "up-down-icon", color: this.disabled ? 'neutral-dark' : 'primary-base', size: 16, iconset: 'default' })), h("cura-label", { key: 'fb1802d14cf6099e0ddf71f0623c1f0ffba6747c', class: "helper-text", size: 'xsmall', color: this.getColor('text'), weight: this.mode === 'transparent' ? 'bold' : 'regular' }, h("slot", { key: '2c257fd28f5c560dd66fe9f73c2fb3c165174efa' })), this.isOpen && (h("div", { key: '36dbd0fa457f7d1ec9c771dafc7491a821267812', class: {
|
|
262
|
+
'menu': true,
|
|
263
|
+
'open': this.isOpen
|
|
264
|
+
} }, h("slot", { key: 'f8d751989092e50820cb7b71903eef743f672a6b', name: 'option' }))))));
|
|
265
|
+
}
|
|
266
|
+
static get formAssociated() { return true; }
|
|
267
|
+
get host() { return getElement(this); }
|
|
268
|
+
};
|
|
269
|
+
CuraSelect.style = CuraSelectStyle0;
|
|
270
|
+
|
|
271
|
+
const curaSelectOptionCss = ":host{display:block}.item{display:flex;padding:12px 8px;cursor:pointer;justify-content:space-between;align-items:center;box-sizing:border-box;background:var(--neutral-purewhite)}.item.selected{background-color:var(--primary-lighter-50);border-bottom:1px solid var(--primary-light)}.item:hover:not(.selected){background:var(--neutral-white);box-shadow:0 2px 0 0 var(--neutral-light)}.item.active{background:var(--neutral-white) !important}.item.selected.active{background-color:var(--primary-lighter-50) !important;box-shadow:none}";
|
|
272
|
+
const CuraSelectOptionStyle0 = curaSelectOptionCss;
|
|
273
|
+
|
|
274
|
+
const CuraSelectOption = class {
|
|
275
|
+
constructor(hostRef) {
|
|
276
|
+
registerInstance(this, hostRef);
|
|
277
|
+
this.theme = window.CuraAPI.theme;
|
|
278
|
+
this.value = undefined;
|
|
279
|
+
this.selected = false;
|
|
280
|
+
this.active = false;
|
|
281
|
+
this.size = 'small';
|
|
282
|
+
this.styles = {};
|
|
283
|
+
}
|
|
284
|
+
connectedCallback() {
|
|
285
|
+
const colors = [
|
|
286
|
+
{ name: '--primary-lighter-50', theme: 'primary-lighter', opacity: 0.5 },
|
|
287
|
+
{ name: '--primary-light', theme: 'primary-light' },
|
|
288
|
+
{ name: '--neutral-light', theme: 'neutral-light' },
|
|
289
|
+
{ name: '--neutral-purewhite', theme: 'neutral-purewhite' },
|
|
290
|
+
];
|
|
291
|
+
colors.forEach(color => this.styles = Object.assign(Object.assign({}, this.styles), { [color.name]: this.theme.colors.getColor(color.theme, color === null || color === void 0 ? void 0 : color.opacity) }));
|
|
292
|
+
}
|
|
293
|
+
getSize(element) {
|
|
294
|
+
const sizeMap = {
|
|
295
|
+
large: element === 'label' ? 'medium' : 20,
|
|
296
|
+
medium: element === 'label' ? 'small' : 16,
|
|
297
|
+
small: element === 'label' ? 'xsmall' : 'micro',
|
|
298
|
+
};
|
|
299
|
+
return sizeMap[this.size] || sizeMap['medium'];
|
|
300
|
+
}
|
|
301
|
+
getClasses() {
|
|
302
|
+
return {
|
|
303
|
+
'item': true,
|
|
304
|
+
'selected': this.selected,
|
|
305
|
+
'active': this.active
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
render() {
|
|
309
|
+
return (h(Host, { key: '9eb6b609efeb50130efd27c20bc7a42441687ce7', slot: "option" }, h("div", { key: 'f72ff1ec9f5b5a579152b09e7a02496be5ab944b', class: this.getClasses(), style: this.styles }, h("cura-label", { key: '0b45ade14ca8ad351a696ec6bad4349eadec38f1', color: `${this.selected ? 'primary-base' : 'neutral-black'}`, size: this.getSize('label'), "margin-block": "0" }, h("slot", { key: '2015c43b9b1686fdef5f0369a91ce376327e5d7f' })), this.selected && h("cura-icon", { key: '9ee481f8ee3e586bd629559e90acf30976711059', name: 'check', size: this.getSize('icon'), color: "primary-base" }))));
|
|
310
|
+
}
|
|
311
|
+
get host() { return getElement(this); }
|
|
312
|
+
static get watchers() { return {
|
|
313
|
+
"size": ["getSize"]
|
|
314
|
+
}; }
|
|
315
|
+
};
|
|
316
|
+
CuraSelectOption.style = CuraSelectOptionStyle0;
|
|
317
|
+
|
|
318
|
+
export { CuraSelect as cura_select, CuraSelectOption as cura_select_option };
|
|
319
|
+
|
|
320
|
+
//# sourceMappingURL=cura-select_2.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"cura-select.cura-select-option.entry.js","mappings":";;AAAA,MAAM,aAAa,GAAG,s+VAAs+V,CAAC;AAC7/V,yBAAe,aAAa;;MCOf,UAAU;;;;;;;;;;;;;;QAkGrB,WAAM,GAAG,EAAE,CAAC;;;;QAKZ,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;;;;;QA8G7B,oBAAe,GAAG,CAAC,SAA2B;YAC5C,SAAS,CAAC,OAAO,CAAC,QAAQ;gBACxB,IAAI,QAAQ,CAAC,IAAI,KAAK,YAAY,EAAE;oBAClC,IAAI,QAAQ,CAAC,aAAa,KAAK,UAAU;wBAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC;oBACvE,IAAI,QAAQ,CAAC,aAAa,KAAK,OAAO;wBAAE,IAAI,CAAC,aAAa,EAAE,CAAC;iBAC9D;aACF,CAAC,CAAC;SACJ,CAAC;;;;QAIF,mBAAc,GAAG,CAAC,KAAY;YAC5B,MAAM,cAAc,GAAG,KAAK,CAAC,MAAqB,CAAC;YACnD,IAAI,CAAC,uBAAuB,EAAE,CAAC;YAC/B,cAAc,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;SACjD,CAAC;QAoCF,kBAAa,GAAG,CAAC,KAAoB;;YACnC,IAA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G,IAAI,CAAC,QAAQ,GAAG,cAAc,GAAG,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,kBAAe,GAAG,IACrH,8DAAa,CACF,EACZ,IAAI,CAAC,QAAQ,IAAI,kEAAW,IAAI,EAAC,OAAO,EAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAC,cAAc,GAAa,CACnG,CACD,EACP;KACH;;;;;;;;;;","names":[],"sources":["src/components/forms/cura-select/cura-select.scss?tag=cura-select&encapsulation=shadow","src/components/forms/cura-select/cura-select.tsx","src/components/forms/cura-select-options/cura-select-option.scss?tag=cura-select-option&encapsulation=shadow","src/components/forms/cura-select-options/cura-select-option.tsx"],"sourcesContent":["@import \"../../../scss/mixins/forms.scss\";\n\n:host {\n display: block;\n position: relative;\n font-family: var(--font-family);\n}\n\n.wrapper {\n width: 100%;\n user-select: none;\n text-align: left !important;\n\n @include cura-label();\n @include helper-text();\n\n @include cura-input-field() {\n .up-down-icon {\n order: 3;\n padding-right: 12px;\n cursor: pointer;\n pointer-events: all;\n }\n\n input {\n padding: 0px 12px 0px 8px;\n }\n\n &.open {\n border-radius: 4px 4px 0 0 !important;\n }\n\n\n }\n\n @include cura-input-transparent();\n\n @include cura-forms-hover();\n @include cura-forms-focused();\n\n\n @include cura-forms-success();\n @include cura-forms-error();\n @include cura-forms-disabled();\n\n @include cura-forms-small() {\n &.label {.menu {top: 53px;} }\n .menu { top: 33px; }\n }\n\n @include cura-forms-medium() {\n &.label {.menu { top: 61px;} }\n .menu { top: 40px; }\n }\n\n @include cura-forms-large() {\n &.label {.menu { top: 69px } }\n .menu {top: 47px; }\n }\n}\n\n.required {\n color: red;\n}\n\n.menu {\n position: absolute;\n left: 0;\n right: -1px;\n background: #fff;\n border: 2px solid var(--neutral-light);\n border-radius: 4px;\n z-index: 1000;\n max-height: 285px;\n overflow: hidden;\n border-top: transparent;\n align-items: center;\n\n scrollbar-color: var(--neutral-medium) var(--neutral-black-20);\n overflow-y: scroll;\n box-shadow: 0px 4px 8px 0px rgba(38, 38, 38, 0.16);\n\n &.open {\n border-radius: 0 !important;\n }\n}\n\n","import { Component, Element, Host, Prop, State, h, Event, EventEmitter, AttachInternals } from '@stencil/core';\n\n@Component({\n tag: 'cura-select',\n styleUrl: 'cura-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CuraSelect {\n /**\n * The label text for the select component.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) label: string = '';\n\n /**\n * Placeholder text for the input field.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) placeholder: string = '';\n\n /**\n * Current value of the select component.\n * Reflects as an attribute in the DOM and is mutable.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * Display mode of the select component.\n * Can be 'default' or 'transparent'.\n */\n @Prop({ reflect: true }) mode: 'default' | 'transparent' = 'default';\n\n /**\n * Size of the select component.\n * Can be 'small', 'medium', or 'large'.\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /**\n * Status of the select component.\n * Can be 'success', 'error', or 'default'.\n */\n @Prop({ reflect: true, mutable: true }) status: 'success' | 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * Whether the select component is required.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Internal state: Whether the input is hovered.\n * Default: false\n */\n @State() isHovered: boolean = false;\n\n /**\n * Internal state: Whether the input is focused.\n * Default: false\n */\n @State() isFocused: boolean = false;\n\n /**\n * Internal state: Whether the dropdown menu is open.\n * Default: false\n */\n @State() isOpen: boolean = false;\n\n /**\n * Internal state: Collection of options for the select component.\n */\n @State() options: NodeListOf<HTMLElement>;\n\n\n @State() activeIndex: number = -1\n\n /**\n * Reference to the host element of the component.\n */\n @Element() host: HTMLElement;\n\n /**\n * Event emitted when an option is selected.\n */\n @Event() selected: EventEmitter;\n\n /**\n * Reference to the select component element.\n */\n selectRef: HTMLElement;\n\n /**\n * MutationObserver to watch changes in the component.\n */\n mutationObserver: MutationObserver;\n\n /**\n * Styles to be applied to the component.\n */\n styles = {};\n\n /**\n * Theme object containing font and color information.\n */\n theme = window.CuraAPI.theme;\n\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Callback for form association.\n */\n formAssociatedCallback(form: { ariaLabel: string; }) {\n form.ariaLabel = this.label;\n }\n\n /**\n * Callback to restore the switch state from the form.\n */\n formStateRestoreCallback(state: { value: string }) {\n this.value = state.value;\n this.updateSelectedOption();\n }\n\n /**\n * Callback to reset the switch state when the form is reset.\n */\n formResetCallback() {\n this.value = '';\n this.clearSelectedAttributes()\n this.internals.setFormValue(this.value);\n this.internals.setValidity({});\n }\n\n /**\n * Callback to update the switch's disabled state when the form's disabled state changes.\n */\n formDisabledCallback(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Lifecycle method called before the component is rendered.\n * Initializes the options for the select component.\n */\n componentWillLoad() {\n this.initializeOptions();\n }\n /**\n * Lifecycle method called after the component is rendered.\n * Initializes select-related functionality.\n */\n componentDidLoad() {\n this.setupMutationObserver();\n }\n /**\n * Lifecycle method called when the component is connected to the DOM.\n * Applies styles based on the theme.\n */\n connectedCallback() {\n this.applyStyles();\n }\n /**\n * Lifecycle method called when the component is disconnected from the DOM.\n * Disconnects the MutationObserver if it exists.\n */\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n }\n\n initializeOptions() {\n this.options = this.host.querySelectorAll('cura-select-option');\n this.options.forEach(option => {\n option.setAttribute('size', this.size);\n option.setAttribute('selected', 'false');\n });\n }\n /**\n * Applies styles to the component based on the theme.\n */\n applyStyles() {\n const { fonts, colors } = this.theme;\n const fontWeights = fonts.getWeights();\n\n this.styles = {\n ...this.styles,\n '--font-weight-medium': fontWeights.medium,\n '--font-weight-bold': fontWeights.bold,\n '--font-weight-regular': fontWeights.regular,\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-size': fonts.getSize(),\n };\n\n const colorKeys = [\n 'primary-base', 'neutral-purewhite', 'neutral-white', 'neutral-black', 'neutral-medium', 'neutral-light',\n 'neutral-base', 'neutral-dark', 'success-dark', 'success-darker', 'success-lighter',\n 'error-lighter', 'error-dark', 'error-darker', 'error-base', 'info-base'\n ];\n\n colorKeys.forEach(key => {\n this.styles[`--${key}`] = colors.getColor(key);\n });\n }\n /**\n * Sets up a MutationObserver to watch for changes in the component.\n */\n setupMutationObserver() {\n this.mutationObserver = new MutationObserver(this.handleMutations);\n this.mutationObserver.observe(this.host, { attributes: true, subtree: true, attributeFilter: ['selected', 'value'] });\n }\n /**\n * Handles mutations observed by the MutationObserver.\n * Updates the selected option or filters options based on the mutation type.\n */\n handleMutations = (mutations: MutationRecord[]) => {\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes') {\n if (mutation.attributeName === 'selected') this.updateSelectedOption();\n if (mutation.attributeName === 'value') this.filterOptions();\n }\n });\n };\n /**\n * Handles the selection of an option.\n */\n onOptiselected = (event: Event) => {\n const selectedOption = event.target as HTMLElement;\n this.clearSelectedAttributes();\n selectedOption.setAttribute('selected', 'true');\n };\n\n updateSelectedOption() {\n const selectedOption = this.host.querySelector('cura-select-option[selected]');\n\n if (selectedOption) {\n const selectedValue = selectedOption.textContent;\n if (this.value !== selectedValue) {\n this.value = selectedValue ;\n this.isOpen = false;\n this.internals.setFormValue(this.value);\n this.selected.emit({ value: this.value, selected: true });\n }\n }\n }\n\n /**\n * Clears the 'selected' attribute from all options.\n */\n clearSelectedAttributes() {\n this.options.forEach(option => option.removeAttribute('selected'));\n }\n\n /**\n * Filters the options based on the current input value.\n */\n filterOptions() {\n const inputValue = this.value.toLowerCase();\n\n this.options.forEach(option => {\n const optionValue = option.textContent?.toLowerCase() || '';\n const isVisible = this.isOpen ? optionValue.includes(inputValue) : true;\n option.style.display = isVisible ? 'block' : 'none';\n });\n }\n\n handleKeyDown = (event: KeyboardEvent) => {\n if (!this.isOpen) return;\n const { key } = event\n\n if (key === 'ArrowDown') {\n event.preventDefault();\n this.updateActiveIndex(1);\n }\n\n if (key === 'ArrowUp') {\n event.preventDefault();\n this.updateActiveIndex(-1);\n }\n\n if (key === 'Enter') {\n this.options[this.activeIndex]?.click();\n }\n }\n\n updateActiveIndex(direction: number) {\n if (this.options.length === 0) return;\n this.activeIndex = (this.activeIndex + direction + this.options.length) % this.options.length;\n this.updateOptionHighlights()\n }\n\n updateOptionHighlights() {\n this.options.forEach((option, index) => (option as any).active = index === this.activeIndex);\n }\n\n\n handleInputChange = (e: Event) => {\n this.value = (e.target as HTMLInputElement).value;\n this.isOpen = !!this.value.length;\n this.internals.setFormValue(this.value);\n };\n\n\n getClasses() {\n return {\n wrapper: true,\n label: !!this.label,\n disabled: this.disabled,\n transparent: this.mode === 'transparent',\n [this.size.toLowerCase()]: true,\n [this.status.toLowerCase()]: true,\n };\n }\n\n /**\n * Determines the color based on the item type and component state.\n */\n getColor(item: 'label' | 'text' | 'icon') {\n if (this.disabled) return 'neutral-medium';\n\n const isStatusDefault = this.status === 'default';\n const isHoveredOrFocused = this.isFocused || this.isHovered;\n\n if (item === 'label') {\n if (!isStatusDefault || isHoveredOrFocused) return 'neutral-black';\n return 'neutral-dark';\n }\n\n if (isHoveredOrFocused && isStatusDefault) return 'neutral-black';\n if (this.status === 'success') return 'success-dark';\n if (this.status === 'error') return 'error-dark';\n\n return 'neutral-dark';\n }\n\n /**\n * Renders the icon based on the component's status.\n */\n renderIcon() {\n if (this.status === 'default') return null;\n const icon = { success: 'checkCircle', error: 'alertCircle' }[this.status];\n return (\n <cura-icon\n class='feedback-icon'\n name={icon}\n iconset='default'\n size={this.size === 'large' ? 20 : 16}\n color={this.getColor('icon')}\n style={this.styles}\n />\n );\n }\n\n handleClick = (event: MouseEvent) => {\n if (this.disabled) return event.preventDefault();\n const target = event.target as HTMLElement;\n\n if (target.tagName === 'CURA-SELECT-OPTION') return this.onOptiselected(event);\n this.isOpen = !this.isOpen;\n };\n\n\n render() {\n return (\n <Host style={this.styles}>\n <div\n class={this.getClasses()}\n tabIndex={0}\n ref={(el) => (this.selectRef = el as HTMLElement)}\n onMouseEnter={() => (this.isHovered = true)}\n onMouseLeave={() => (this.isHovered = false)}\n onKeyDown={this.handleKeyDown}\n onClick={this.handleClick}\n >\n {this.label && (\n <cura-label\n class='label'\n weight='bold'\n size={this.size === 'large' ? 'small' : 'xsmall'}\n color={this.getColor('label')}\n >\n {this.label} {this.required && <span class='required'>* </span>}\n </cura-label>\n )}\n\n <div class={{\n 'cura-input-field': true,\n 'open': this.isOpen\n }}>\n {this.renderIcon()}\n <input\n tabIndex={0}\n type=\"text\"\n autocomplete='off'\n onFocus={() => (this.isFocused = true)}\n onBlur={() => (this.isFocused = false)}\n aria-required={String(this.required)}\n aria-disabled={String(this.disabled)}\n aria-invalid={String(this.status === 'error')}\n onInput={this.handleInputChange}\n style={this.styles}\n placeholder={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n value={this.value}\n />\n <cura-icon\n name={this.isOpen ? 'up' : 'down'}\n class=\"up-down-icon\"\n color={this.disabled ? 'neutral-dark' : 'primary-base'}\n size={16}\n iconset='default'\n />\n </div>\n <cura-label\n class=\"helper-text\"\n size='xsmall'\n color={this.getColor('text')}\n weight={this.mode === 'transparent' ? 'bold' : 'regular'} >\n <slot></slot>\n </cura-label>\n {this.isOpen && (\n <div class={{\n 'menu': true,\n 'open': this.isOpen\n }}>\n <slot name='option'></slot>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: block;\n}\n\n.item {\n display: flex;\n padding: 12px 8px;\n cursor: pointer;\n justify-content: space-between;\n align-items: center;\n box-sizing: border-box;\n background: var(--neutral-purewhite);\n\n &.selected {\n background-color: var(--primary-lighter-50);\n border-bottom: 1px solid var(--primary-light);\n }\n\n &:hover:not(.selected) {\n background: var(--neutral-white);\n box-shadow: 0 2px 0 0 var(--neutral-light);\n }\n\n &.active {\n background: var(--neutral-white) !important;\n }\n\n &.selected.active {\n background-color: var(--primary-lighter-50) !important;\n box-shadow: none;\n }\n}\n","import { Component, h, Host, Prop, State, Element, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cura-select-option',\n styleUrl: 'cura-select-option.scss',\n shadow: true,\n})\nexport class CuraSelectOption {\n @Prop({ reflect: true }) value: string;\n @Prop({ reflect: true }) selected: boolean = false;\n @Prop({ reflect: true }) active: boolean = false;\n @Prop() size: 'xsmall' | 'small' | 'medium' | 'large' = 'small'\n @State() styles = {};\n @Element() host: HTMLElement;\n\n theme = window.CuraAPI.theme;\n\n connectedCallback() {\n const colors = [\n { name: '--primary-lighter-50', theme: 'primary-lighter', opacity: 0.5 },\n { name: '--primary-light', theme: 'primary-light' },\n { name: '--neutral-light', theme: 'neutral-light' },\n { name: '--neutral-purewhite', theme: 'neutral-purewhite' },\n ];\n\n colors.forEach(color => this.styles = { ...this.styles, [color.name]: this.theme.colors.getColor(color.theme, color?.opacity) });\n }\n\n @Watch('size')\n getSize(element: string) {\n const sizeMap = {\n large: element === 'label' ? 'medium' : 20,\n medium: element === 'label' ? 'small' : 16,\n small: element === 'label' ? 'xsmall' : 'micro',\n };\n\n return sizeMap[this.size] || sizeMap['medium'];\n }\n\n getClasses() {\n return {\n 'item': true,\n 'selected': this.selected,\n 'active':this.active\n };\n }\n\n render() {\n return (\n <Host slot=\"option\">\n <div class={this.getClasses()} style={this.styles}>\n <cura-label color={`${this.selected ? 'primary-base' : 'neutral-black'}`} size={this.getSize('label')} margin-block=\"0\">\n <slot></slot>\n </cura-label>\n {this.selected && <cura-icon name='check' size={this.getSize('icon')} color=\"primary-base\"></cura-icon>}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,85 +1,120 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
2
|
-
import { f as formsSizes } from './cura-forms.definitions-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-b6c443d5.js';
|
|
2
|
+
import { f as formsSizes } from './cura-forms.definitions-2f963167.js';
|
|
3
3
|
|
|
4
|
-
const curaSwitchCss = "@charset \"UTF-8\";:host{display:block;width
|
|
4
|
+
const curaSwitchCss = "@charset \"UTF-8\";:host{display:block;width:fit-content;box-sizing:border-box}.container{display:flex;align-items:center;flex-direction:row-reverse;gap:var(--gap);text-align:left}.position{flex-direction:row}.label,.message{text-align:left}.control{width:fit-content}.track{background:var(--neutral-dark-base);border-radius:16px;transition:background-color 0.3s;align-items:flex-start;flex-shrink:0;box-sizing:border-box;width:var(--size-track);height:var(--size);position:relative}.thumb{background:var(--neutral-purewhite);border:2px solid var(--neutral-darker-medium);border-radius:50%;position:absolute;transition:transform 0.3s, outline 0.3s;display:inline-block;cursor:pointer;user-select:none;box-sizing:border-box;width:var(--size);height:var(--size);top:50%;transform:translateY(-50%)}.checked .thumb{border-color:var(--color-dark);box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));background:var(--neutral-purewhite);transform:translateX(var(--size)) translateY(-50%)}.checked .thumb:hover{background:var(--neutral-pale) !important;border-color:var(--neutral-darker-medium) !important}.checked .thumb:active{border-color:var(--color-dark);background:var(--neutral-pale)}.checked .track{background:var(--color-base-light)}.disabled .track{background:var(--neutral-black-neutral-pale)}.disabled .thumb{background:var(--neutral-black-neutral-base) !important;border-color:var(--neutral-black-neutral-pale) !important;cursor:not-allowed}.disabled.checked .track{background:var(--neutral-black-neutral-pale)}.container.disabled .thumb:focus{outline:none !important;border-color:var(--neutral-black-neutral-pale) !important}:not(.disabled):not(.checked) .thumb:hover{border-color:var(--color-dark);background:var(--neutral-pale)}:not(.disabled):not(.checked) .thumb:active{border-color:var(--color-dark);background:var(--neutral-pale)}:not(.disabled) .thumb:focus{outline:2px solid var(--info-base) !important;border:2px solid var(--neutral-darker-medium);z-index:1}:not(.disabled) .checked .thumb:focus{outline:2px solid var(--info-base) !important;border-color:var(--color-dark)}";
|
|
5
|
+
const CuraSwitchStyle0 = curaSwitchCss;
|
|
5
6
|
|
|
6
7
|
const CuraSwitch = class {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.onchange = createEvent(this, "onchange", 7);
|
|
11
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
12
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
16
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
17
|
+
}
|
|
18
|
+
this.sizes = {
|
|
19
|
+
large: { size: 64 },
|
|
20
|
+
medium: { size: 48 },
|
|
21
|
+
small: { size: 40 },
|
|
22
|
+
};
|
|
23
|
+
this.isDarkbackground = () => this.background === 'dark';
|
|
24
|
+
this.toggleSwitch = () => {
|
|
25
|
+
if (this.disabled)
|
|
26
|
+
return null;
|
|
27
|
+
this.checked = !this.checked;
|
|
28
|
+
this.internals.setFormValue(this.checked.toString());
|
|
29
|
+
this.onchange.emit({ checked: this.checked });
|
|
30
|
+
};
|
|
31
|
+
this.checked = false;
|
|
32
|
+
this.disabled = false;
|
|
33
|
+
this.label = '';
|
|
34
|
+
this.ontabindex = 0;
|
|
35
|
+
this.position = 'left';
|
|
36
|
+
this.size = 'medium';
|
|
37
|
+
this.background = 'light';
|
|
38
|
+
this.color = 'accent';
|
|
39
|
+
this.styles = {};
|
|
40
|
+
}
|
|
41
|
+
sizeHandler() {
|
|
42
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--size-track': `${this.sizes[this.size].size}px`, '--size': `${formsSizes[this.size].size}px`, '--gap': `${formsSizes[this.size].gap}px` });
|
|
43
|
+
}
|
|
44
|
+
setColors() {
|
|
45
|
+
const colors = [
|
|
46
|
+
{ name: '--info-base', background: 'info-base' },
|
|
47
|
+
{ name: '--neutral-black-shadow', background: 'neutral-black', opacity: 0.16 },
|
|
48
|
+
{ name: '--neutral-purewhite', background: 'neutral-purewhite' },
|
|
49
|
+
{ name: '--neutral-medium', background: 'neutral-medium' },
|
|
50
|
+
{ name: '--neutral-pale', background: 'neutral-pale' },
|
|
51
|
+
{ name: '--neutral-dark-base', background: `neutral-${this.isDarkbackground() ? 'dark' : 'base'}` },
|
|
52
|
+
{ name: '--neutral-darker-medium', background: `neutral-${this.isDarkbackground() ? 'darker' : 'medium'}` },
|
|
53
|
+
{ name: '--neutral-black-neutral-pale', background: `${this.isDarkbackground() ? 'neutral-black' : 'neutral-pale'}` },
|
|
54
|
+
{ name: '--neutral-black-neutral-base', background: `${this.isDarkbackground() ? 'neutral-dark' : 'neutral-base'}` },
|
|
55
|
+
{ name: '--color-base-light', background: `${this.color}-light` },
|
|
56
|
+
{ name: '--color-dark', background: `${this.color}-dark` },
|
|
57
|
+
];
|
|
58
|
+
colors.forEach(color => {
|
|
59
|
+
this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.background, color === null || color === void 0 ? void 0 : color.opacity);
|
|
60
|
+
});
|
|
61
|
+
this.styles = Object.assign({}, this.styles);
|
|
62
|
+
}
|
|
63
|
+
connectedCallback() {
|
|
64
|
+
this.sizeHandler();
|
|
65
|
+
this.setColors();
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Callback for form association.
|
|
69
|
+
*/
|
|
70
|
+
formAssociatedCallback(form) {
|
|
71
|
+
form.ariaLabel = this.label;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Callback to restore the switch state from the form.
|
|
75
|
+
*/
|
|
76
|
+
formStateRestoreCallback(state) {
|
|
77
|
+
this.checked = state.value === 'true';
|
|
78
|
+
this.internals.setFormValue(this.checked.toString());
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Callback to reset the switch state when the form is reset.
|
|
82
|
+
*/
|
|
83
|
+
formResetCallback() {
|
|
84
|
+
this.checked = false;
|
|
85
|
+
this.internals.setValidity({});
|
|
86
|
+
this.internals.setFormValue(this.checked.toString());
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Callback to update the switch's disabled state when the form's disabled state changes.
|
|
90
|
+
*/
|
|
91
|
+
formDisabledCallback(disabled) {
|
|
92
|
+
this.disabled = disabled;
|
|
93
|
+
}
|
|
94
|
+
assignColor(colorDark, colorLight) {
|
|
95
|
+
if (this.disabled)
|
|
96
|
+
return this.isDarkbackground() ? 'neutral-dark' : 'neutral-dark';
|
|
97
|
+
return this.isDarkbackground() ? colorDark : colorLight;
|
|
98
|
+
}
|
|
99
|
+
getClasses() {
|
|
100
|
+
const classes = {};
|
|
101
|
+
classes['container'] = true;
|
|
102
|
+
classes['checked'] = this.checked;
|
|
103
|
+
classes['disabled'] = this.disabled;
|
|
104
|
+
classes['position'] = this.position === 'right';
|
|
105
|
+
return classes;
|
|
106
|
+
}
|
|
107
|
+
render() {
|
|
108
|
+
return (h(Host, { key: 'e0040434db080b1ccdb12a1389ca028f5c02f66a' }, h("div", { key: '6008f7aef47e0519e965c2be573dc1eacc001b6c', class: this.getClasses(), style: this.styles }, h("div", { key: 'a954404dce1c7eafd79cb3236e8761a3dc29f86e', class: "info" }, h("cura-label", { key: '6ff5cc1f26abad0f173c4e1330aaae43357b7737', style: { textAlign: this.position === 'right' ? 'right' : 'left' }, class: "label", weight: "bold", size: this.size === 'large' ? 'medium' : 'xsmall', lineHeight: "125%", color: this.assignColor('neutral-white', 'neutral-black') }, this.label), h("cura-label", { key: 'b82e4cb25ef94481642e1d5a2180eb4e12b8eff8', style: { textAlign: this.position === 'right' ? 'right' : 'left' }, color: this.assignColor('primary-lighter', 'neutral-dark'), size: "xsmall", class: "message" }, h("slot", { key: '243e906253614d9ce837e0c598b259ad7c87afb4' }))), h("div", { key: '36d0165722a6fae98ca829a5a2e89edef3694ff2', onClick: this.toggleSwitch, class: "control" }, h("div", { key: 'f9c0c7cbc84b655e37e7e8df1c2293c1260445ca', class: `track ${this.size.toLowerCase()}` }, h("div", { key: 'e5ca4006ad41a6cbf8d62ca612b52ef26fb7255f', class: `thumb ${this.size.toLowerCase()}`, tabIndex: this.ontabindex }))))));
|
|
109
|
+
}
|
|
110
|
+
static get formAssociated() { return true; }
|
|
111
|
+
static get watchers() { return {
|
|
112
|
+
"size": ["sizeHandler"],
|
|
113
|
+
"color": ["setColors"],
|
|
114
|
+
"background": ["setColors"]
|
|
115
|
+
}; }
|
|
81
116
|
};
|
|
82
|
-
CuraSwitch.style =
|
|
117
|
+
CuraSwitch.style = CuraSwitchStyle0;
|
|
83
118
|
|
|
84
119
|
export { CuraSwitch as cura_switch };
|
|
85
120
|
|