@warp-ds/elements 2.4.0 → 2.5.0-next.2
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/api.js.map +2 -2
- package/dist/custom-elements.json +878 -412
- package/dist/index.d.ts +2204 -777
- package/dist/packages/affix/{index.js → affix.js} +1 -1
- package/dist/packages/affix/{index.js.map → affix.js.map} +1 -1
- package/dist/packages/affix/affix.react.stories.d.ts +1 -1
- package/dist/packages/affix/affix.stories.d.ts +2 -2
- package/dist/packages/affix/affix.stories.js +1 -1
- package/dist/packages/affix/affix.test.d.ts +1 -1
- package/dist/packages/affix/affix.test.js +1 -1
- package/dist/packages/affix/react.d.ts +1 -1
- package/dist/packages/alert/{index.js → alert.js} +1 -1
- package/dist/packages/alert/{index.js.map → alert.js.map} +1 -1
- package/dist/packages/alert/alert.react.stories.d.ts +1 -1
- package/dist/packages/alert/alert.stories.d.ts +2 -2
- package/dist/packages/alert/alert.stories.js +1 -1
- package/dist/packages/alert/alert.test.d.ts +1 -1
- package/dist/packages/alert/alert.test.js +1 -1
- package/dist/packages/alert/react.d.ts +1 -1
- package/dist/packages/alert/react.js +1 -1
- package/dist/packages/attention/{index.d.ts → attention.d.ts} +1 -1
- package/dist/packages/attention/{index.js → attention.js} +18 -18
- package/dist/packages/attention/attention.js.map +7 -0
- package/dist/packages/attention/attention.react.stories.d.ts +1 -1
- package/dist/packages/attention/attention.stories.d.ts +3 -3
- package/dist/packages/attention/attention.stories.js +2 -2
- package/dist/packages/attention/attention.test.d.ts +1 -1
- package/dist/packages/attention/attention.test.js +1 -1
- package/dist/packages/attention/react.d.ts +1 -1
- package/dist/packages/attention/react.js +1 -1
- package/dist/packages/badge/{index.js → badge.js} +1 -1
- package/dist/packages/badge/{index.js.map → badge.js.map} +1 -1
- package/dist/packages/badge/badge.react.stories.d.ts +3 -3
- package/dist/packages/badge/badge.stories.d.ts +2 -2
- package/dist/packages/badge/badge.stories.js +1 -1
- package/dist/packages/badge/badge.test.d.ts +1 -1
- package/dist/packages/badge/badge.test.js +1 -1
- package/dist/packages/badge/react.d.ts +1 -1
- package/dist/packages/badge/react.js +1 -1
- package/dist/packages/box/{index.js → box.js} +1 -1
- package/dist/packages/box/{index.js.map → box.js.map} +1 -1
- package/dist/packages/box/box.react.stories.d.ts +3 -3
- package/dist/packages/box/box.stories.d.ts +2 -2
- package/dist/packages/box/box.stories.js +1 -1
- package/dist/packages/box/box.test.d.ts +1 -1
- package/dist/packages/box/box.test.js +1 -1
- package/dist/packages/box/react.d.ts +1 -1
- package/dist/packages/box/react.js +1 -1
- package/dist/packages/box/slot.test.d.ts +1 -1
- package/dist/packages/box/slot.test.js +1 -1
- package/dist/packages/breadcrumbs/{index.js → breadcrumbs.js} +10 -10
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +7 -0
- package/dist/packages/breadcrumbs/breadcrumbs.react.stories.d.ts +3 -3
- package/dist/packages/breadcrumbs/breadcrumbs.stories.d.ts +2 -2
- package/dist/packages/breadcrumbs/breadcrumbs.stories.js +1 -1
- package/dist/packages/breadcrumbs/breadcrumbs.test.d.ts +1 -1
- package/dist/packages/breadcrumbs/breadcrumbs.test.js +1 -1
- package/dist/packages/breadcrumbs/react.d.ts +1 -1
- package/dist/packages/breadcrumbs/react.js +1 -1
- package/dist/packages/button/{index.d.ts → button.d.ts} +1 -1
- package/dist/packages/button/{index.js → button.js} +12 -12
- package/dist/packages/button/button.js.map +7 -0
- package/dist/packages/button/button.react.stories.d.ts +3 -3
- package/dist/packages/button/button.stories.d.ts +2 -2
- package/dist/packages/button/button.stories.js +1 -1
- package/dist/packages/button/button.test.d.ts +1 -1
- package/dist/packages/button/button.test.js +1 -1
- package/dist/packages/button/react.d.ts +1 -1
- package/dist/packages/button/react.js +1 -1
- package/dist/packages/card/{index.js → card.js} +9 -9
- package/dist/packages/card/card.js.map +7 -0
- package/dist/packages/card/card.react.stories.d.ts +3 -3
- package/dist/packages/card/card.stories.d.ts +2 -2
- package/dist/packages/card/card.stories.js +1 -1
- package/dist/packages/card/card.test.d.ts +1 -1
- package/dist/packages/card/card.test.js +1 -1
- package/dist/packages/card/react.d.ts +1 -1
- package/dist/packages/card/react.js +1 -1
- package/dist/packages/combobox/{index.js → combobox.js} +14 -14
- package/dist/packages/combobox/{index.js.map → combobox.js.map} +4 -4
- package/dist/packages/combobox/combobox.react.stories.d.ts +4 -4
- package/dist/packages/combobox/combobox.stories.d.ts +3 -3
- package/dist/packages/combobox/combobox.stories.js +2 -2
- package/dist/packages/combobox/combobox.test.d.ts +2 -2
- package/dist/packages/combobox/combobox.test.js +2 -2
- package/dist/packages/combobox/react.d.ts +1 -1
- package/dist/packages/combobox/react.js +1 -1
- package/dist/packages/datepicker/DatePicker.test.d.ts +2 -2
- package/dist/packages/datepicker/DatePicker.test.js +2 -2
- package/dist/packages/datepicker/datepicker.js +15 -15
- package/dist/packages/datepicker/datepicker.js.map +3 -3
- package/dist/packages/datepicker/datepicker.react.stories.d.ts +2 -2
- package/dist/packages/datepicker/datepicker.stories.d.ts +3 -3
- package/dist/packages/datepicker/datepicker.stories.js +2 -2
- package/dist/packages/datepicker/datepicker.test.d.ts +2 -2
- package/dist/packages/datepicker/datepicker.test.js +2 -2
- package/dist/packages/datepicker/react.js +1 -1
- package/dist/packages/expandable/{index.js → expandable.js} +1 -1
- package/dist/packages/expandable/{index.js.map → expandable.js.map} +1 -1
- package/dist/packages/expandable/expandable.react.stories.d.ts +3 -3
- package/dist/packages/expandable/expandable.stories.d.ts +2 -2
- package/dist/packages/expandable/expandable.stories.js +1 -1
- package/dist/packages/expandable/expandable.test.d.ts +1 -1
- package/dist/packages/expandable/expandable.test.js +1 -1
- package/dist/packages/expandable/react.d.ts +1 -1
- package/dist/packages/expandable/react.js +1 -1
- package/dist/packages/i18n.js +6 -2
- package/dist/packages/icon/icon.d.ts +22 -0
- package/dist/packages/icon/icon.js +27 -0
- package/dist/packages/icon/icon.js.map +7 -0
- package/dist/packages/icon/icon.react.stories.d.ts +28 -0
- package/dist/packages/icon/icon.react.stories.js +37 -0
- package/dist/packages/icon/icon.stories.d.ts +39 -0
- package/dist/packages/icon/icon.stories.js +43 -0
- package/dist/packages/icon/react.d.ts +2 -0
- package/dist/packages/{deadtoggle → icon}/react.js +3 -3
- package/dist/packages/icon/style.js +27 -0
- package/dist/packages/link/{index.js → link.js} +3 -3
- package/dist/packages/link/link.js.map +7 -0
- package/dist/packages/link/link.react.stories.d.ts +3 -3
- package/dist/packages/link/link.stories.d.ts +2 -2
- package/dist/packages/link/link.stories.js +1 -1
- package/dist/packages/link/link.test.d.ts +1 -1
- package/dist/packages/link/link.test.js +1 -1
- package/dist/packages/link/react.d.ts +1 -1
- package/dist/packages/link/react.js +1 -1
- package/dist/packages/link/styles.js +2 -2
- package/dist/packages/modal/index.d.ts +6 -3
- package/dist/packages/modal/index.js +10 -2717
- package/dist/packages/modal/{modal-main.js → modal.js} +1 -1
- package/dist/packages/modal/{modal-main.js.map → modal.js.map} +1 -1
- package/dist/packages/modal/modal.react.stories.d.ts +1 -1
- package/dist/packages/modal/modal.stories.d.ts +6 -3
- package/dist/packages/modal/modal.stories.js +3 -1
- package/dist/packages/modal/react.d.ts +3 -6
- package/dist/packages/modal/react.js +4 -15
- package/dist/packages/{modal → modal-footer}/modal-footer.d.ts +2 -2
- package/dist/packages/{modal → modal-footer}/modal-footer.js +4 -4
- package/dist/packages/modal-footer/modal-footer.js.map +7 -0
- package/dist/packages/modal-footer/react.d.ts +2 -0
- package/dist/packages/{stepindicator → modal-footer}/react.js +3 -8
- package/dist/packages/{modal → modal-header}/modal-header.d.ts +1 -1
- package/dist/packages/{modal → modal-header}/modal-header.js +7 -7
- package/dist/packages/modal-header/modal-header.js.map +7 -0
- package/dist/packages/modal-header/react.d.ts +5 -0
- package/dist/packages/{pagination → modal-header}/react.js +5 -5
- package/dist/packages/page-indicator/locales/da/messages.mjs +1 -0
- package/dist/packages/page-indicator/locales/en/messages.mjs +1 -0
- package/dist/packages/page-indicator/locales/fi/messages.mjs +1 -0
- package/dist/packages/page-indicator/locales/nb/messages.mjs +1 -0
- package/dist/packages/page-indicator/locales/sv/messages.mjs +1 -0
- package/dist/packages/page-indicator/page-indicator.d.ts +26 -0
- package/dist/packages/page-indicator/page-indicator.js +41 -0
- package/dist/packages/page-indicator/page-indicator.js.map +7 -0
- package/dist/packages/{pageindicator/pageindicator.react.stories.d.ts → page-indicator/page-indicator.react.stories.d.ts} +3 -3
- package/dist/packages/{pageindicator/pageindicator.stories.d.ts → page-indicator/page-indicator.stories.d.ts} +1 -1
- package/dist/packages/page-indicator/page-indicator.stories.js +87 -0
- package/dist/packages/page-indicator/page-indicator.test.d.ts +1 -0
- package/dist/packages/page-indicator/page-indicator.test.js +118 -0
- package/dist/packages/{pageindicator → page-indicator}/react.d.ts +1 -1
- package/dist/packages/{pageindicator → page-indicator}/react.js +2 -2
- package/dist/packages/{pageindicator → page-indicator}/style.js +4 -4
- package/dist/packages/pill/{index.js → pill.js} +9 -9
- package/dist/packages/pill/pill.js.map +7 -0
- package/dist/packages/pill/pill.react.stories.d.ts +4 -4
- package/dist/packages/pill/pill.stories.d.ts +2 -2
- package/dist/packages/pill/pill.stories.js +1 -1
- package/dist/packages/pill/pill.test.d.ts +1 -1
- package/dist/packages/pill/pill.test.js +1 -1
- package/dist/packages/pill/react.d.ts +1 -1
- package/dist/packages/pill/react.js +1 -1
- package/dist/packages/select/react.d.ts +1 -1
- package/dist/packages/select/react.js +1 -1
- package/dist/packages/select/{index.js → select.js} +16 -16
- package/dist/packages/select/select.js.map +7 -0
- package/dist/packages/select/select.react.stories.d.ts +4 -4
- package/dist/packages/select/select.react.stories.js +1 -1
- package/dist/packages/select/select.stories.d.ts +2 -2
- package/dist/packages/select/select.stories.js +1 -1
- package/dist/packages/select/select.test.d.ts +1 -1
- package/dist/packages/select/select.test.js +1 -1
- package/dist/packages/switch/react.d.ts +1 -1
- package/dist/packages/switch/react.js +1 -1
- package/dist/packages/switch/{index.js → switch.js} +1 -1
- package/dist/packages/switch/{index.js.map → switch.js.map} +1 -1
- package/dist/packages/switch/switch.react.stories.d.ts +1 -1
- package/dist/packages/switch/switch.stories.d.ts +1 -1
- package/dist/packages/switch/switch.stories.js +1 -1
- package/dist/packages/switch/switch.test.d.ts +1 -1
- package/dist/packages/switch/switch.test.js +2 -2
- package/dist/packages/tab/react.d.ts +7 -0
- package/dist/packages/tab/react.js +17 -0
- package/dist/packages/{tabs → tab}/tab.d.ts +2 -5
- package/dist/packages/tab/tab.js +2464 -0
- package/dist/packages/tab/tab.js.map +7 -0
- package/dist/packages/tab-panel/react.d.ts +2 -0
- package/dist/packages/tab-panel/react.js +11 -0
- package/dist/packages/{tabs → tab-panel}/tab-panel.d.ts +3 -3
- package/dist/packages/tab-panel/tab-panel.js +2441 -0
- package/dist/packages/tab-panel/tab-panel.js.map +7 -0
- package/dist/packages/tabs/index.d.ts +2 -3
- package/dist/packages/tabs/index.js +3 -2
- package/dist/packages/tabs/react.d.ts +3 -8
- package/dist/packages/tabs/react.js +4 -17
- package/dist/packages/tabs/tabs.d.ts +2 -5
- package/dist/packages/tabs/tabs.js +2447 -252
- package/dist/packages/tabs/tabs.js.map +7 -0
- package/dist/packages/tabs/tabs.react.stories.d.ts +14 -1
- package/dist/packages/tabs/tabs.react.stories.js +55 -35
- package/dist/packages/tabs/tabs.stories.d.ts +5 -4
- package/dist/packages/tabs/tabs.stories.js +89 -65
- package/dist/packages/textfield/react.d.ts +1 -1
- package/dist/packages/textfield/react.js +1 -1
- package/dist/packages/textfield/{index.js → textfield.js} +1 -1
- package/dist/packages/textfield/{index.js.map → textfield.js.map} +1 -1
- package/dist/packages/textfield/textfield.react.stories.d.ts +4 -4
- package/dist/packages/textfield/textfield.stories.d.ts +2 -2
- package/dist/packages/textfield/textfield.stories.js +1 -1
- package/dist/packages/textfield/textfield.test.d.ts +2 -2
- package/dist/packages/textfield/textfield.test.js +2 -2
- package/dist/packages/toast/index.d.ts +5 -3
- package/dist/packages/toast/index.js +7 -2483
- package/dist/packages/toast/toast.js +8 -8
- package/dist/packages/toast/toast.js.map +3 -3
- package/dist/packages/toast/toast.stories.d.ts +4 -3
- package/dist/packages/toast/toast.stories.js +3 -2
- package/dist/packages/{toast → toast-container}/toast-container.d.ts +1 -1
- package/dist/packages/toast-container/toast-container.js.map +7 -0
- package/dist/web-types.json +175 -38
- package/package.json +91 -38
- package/dist/packages/attention/index.js.map +0 -7
- package/dist/packages/breadcrumbs/index.js.map +0 -7
- package/dist/packages/button/index.js.map +0 -7
- package/dist/packages/card/index.js.map +0 -7
- package/dist/packages/checkbox/checkbox-group.d.ts +0 -10
- package/dist/packages/checkbox/checkbox-group.js +0 -15
- package/dist/packages/checkbox/checkbox.d.ts +0 -66
- package/dist/packages/checkbox/checkbox.js +0 -220
- package/dist/packages/checkbox/checkbox.react.stories.d.ts +0 -12
- package/dist/packages/checkbox/checkbox.react.stories.js +0 -10
- package/dist/packages/checkbox/checkbox.stories.d.ts +0 -11
- package/dist/packages/checkbox/checkbox.stories.js +0 -25
- package/dist/packages/checkbox/index.d.ts +0 -2
- package/dist/packages/checkbox/index.js +0 -2
- package/dist/packages/checkbox/react.d.ts +0 -7
- package/dist/packages/checkbox/react.js +0 -20
- package/dist/packages/checkbox/styles.d.ts +0 -0
- package/dist/packages/checkbox/styles.js +0 -0
- package/dist/packages/datepicker/index.d.ts +0 -1
- package/dist/packages/datepicker/index.js +0 -2785
- package/dist/packages/datepicker/index.js.map +0 -7
- package/dist/packages/deadtoggle/dead-toggle.react.stories.d.ts +0 -15
- package/dist/packages/deadtoggle/dead-toggle.react.stories.js +0 -34
- package/dist/packages/deadtoggle/dead-toggle.stories.d.ts +0 -14
- package/dist/packages/deadtoggle/dead-toggle.stories.js +0 -45
- package/dist/packages/deadtoggle/dead-toggle.test.d.ts +0 -1
- package/dist/packages/deadtoggle/dead-toggle.test.js +0 -9
- package/dist/packages/deadtoggle/index.d.ts +0 -17
- package/dist/packages/deadtoggle/index.js +0 -51
- package/dist/packages/deadtoggle/react.d.ts +0 -2
- package/dist/packages/link/index.js.map +0 -7
- package/dist/packages/modal/index.js.map +0 -7
- package/dist/packages/modal/modal-footer.js.map +0 -7
- package/dist/packages/modal/modal-header.js.map +0 -7
- package/dist/packages/pageindicator/index.d.ts +0 -10
- package/dist/packages/pageindicator/index.js +0 -48
- package/dist/packages/pageindicator/pageindicator.stories.js +0 -71
- package/dist/packages/pagination/index.d.ts +0 -32
- package/dist/packages/pagination/index.js +0 -199
- package/dist/packages/pagination/locales/da/messages.mjs +0 -1
- package/dist/packages/pagination/locales/en/messages.mjs +0 -1
- package/dist/packages/pagination/locales/fi/messages.mjs +0 -1
- package/dist/packages/pagination/locales/nb/messages.mjs +0 -1
- package/dist/packages/pagination/locales/sv/messages.mjs +0 -1
- package/dist/packages/pagination/pagination.react.stories.d.ts +0 -21
- package/dist/packages/pagination/pagination.react.stories.js +0 -45
- package/dist/packages/pagination/pagination.stories.d.ts +0 -14
- package/dist/packages/pagination/pagination.stories.js +0 -56
- package/dist/packages/pagination/pagination.test.d.ts +0 -1
- package/dist/packages/pagination/pagination.test.js +0 -76
- package/dist/packages/pagination/react.d.ts +0 -5
- package/dist/packages/pagination/styles.js +0 -2
- package/dist/packages/pill/index.js.map +0 -7
- package/dist/packages/radio/base-element.d.ts +0 -46
- package/dist/packages/radio/base-element.js +0 -100
- package/dist/packages/radio/custom-error-validator.d.ts +0 -6
- package/dist/packages/radio/custom-error-validator.js +0 -22
- package/dist/packages/radio/form-associated-element.d.ts +0 -103
- package/dist/packages/radio/form-associated-element.js +0 -282
- package/dist/packages/radio/host-styles.d.ts +0 -1
- package/dist/packages/radio/host-styles.js +0 -12
- package/dist/packages/radio/index.d.ts +0 -2
- package/dist/packages/radio/index.js +0 -2
- package/dist/packages/radio/invalid.d.ts +0 -8
- package/dist/packages/radio/invalid.js +0 -5
- package/dist/packages/radio/math.d.ts +0 -1
- package/dist/packages/radio/math.js +0 -4
- package/dist/packages/radio/radio-group-styles.d.ts +0 -1
- package/dist/packages/radio/radio-group-styles.js +0 -59
- package/dist/packages/radio/radio-group.d.ts +0 -72
- package/dist/packages/radio/radio-group.js +0 -342
- package/dist/packages/radio/radio-styles.d.ts +0 -0
- package/dist/packages/radio/radio-styles.js +0 -0
- package/dist/packages/radio/radio.d.ts +0 -38
- package/dist/packages/radio/radio.js +0 -115
- package/dist/packages/radio/radio.react.stories.d.ts +0 -9
- package/dist/packages/radio/radio.react.stories.js +0 -10
- package/dist/packages/radio/radio.stories.d.ts +0 -15
- package/dist/packages/radio/radio.stories.js +0 -61
- package/dist/packages/radio/react.d.ts +0 -9
- package/dist/packages/radio/react.js +0 -22
- package/dist/packages/radio/required-validator.d.ts +0 -11
- package/dist/packages/radio/required-validator.js +0 -34
- package/dist/packages/radio/slot.d.ts +0 -20
- package/dist/packages/radio/slot.js +0 -71
- package/dist/packages/radio/watch.d.ts +0 -26
- package/dist/packages/radio/watch.js +0 -39
- package/dist/packages/select/index.js.map +0 -7
- package/dist/packages/slider/Slider.d.ts +0 -2
- package/dist/packages/slider/Slider.js +0 -8
- package/dist/packages/slider/SliderThumb.d.ts +0 -2
- package/dist/packages/slider/SliderThumb.js +0 -8
- package/dist/packages/slider/index.d.ts +0 -2
- package/dist/packages/slider/index.js +0 -2
- package/dist/packages/slider/locales/da/messages.d.mts +0 -1
- package/dist/packages/slider/locales/da/messages.mjs +0 -1
- package/dist/packages/slider/locales/en/messages.d.mts +0 -1
- package/dist/packages/slider/locales/en/messages.mjs +0 -1
- package/dist/packages/slider/locales/fi/messages.d.mts +0 -1
- package/dist/packages/slider/locales/fi/messages.mjs +0 -1
- package/dist/packages/slider/locales/nb/messages.d.mts +0 -1
- package/dist/packages/slider/locales/nb/messages.mjs +0 -1
- package/dist/packages/slider/locales/sv/messages.d.mts +0 -1
- package/dist/packages/slider/locales/sv/messages.mjs +0 -1
- package/dist/packages/slider/oddbird-css-anchor-positioning.d.ts +0 -2
- package/dist/packages/slider/oddbird-css-anchor-positioning.js +0 -3
- package/dist/packages/slider/react.d.ts +0 -8
- package/dist/packages/slider/react.js +0 -20
- package/dist/packages/slider/slider-thumb.d.ts +0 -63
- package/dist/packages/slider/slider-thumb.js +0 -501
- package/dist/packages/slider/slider.d.ts +0 -55
- package/dist/packages/slider/slider.js +0 -301
- package/dist/packages/slider/slider.react.stories.d.ts +0 -19
- package/dist/packages/slider/slider.react.stories.js +0 -140
- package/dist/packages/slider/slider.stories.d.ts +0 -21
- package/dist/packages/slider/slider.stories.js +0 -404
- package/dist/packages/slider/slider.test.d.ts +0 -4
- package/dist/packages/slider/slider.test.js +0 -111
- package/dist/packages/slider/styles/w-slider-thumb.styles.d.ts +0 -1
- package/dist/packages/slider/styles/w-slider-thumb.styles.js +0 -175
- package/dist/packages/slider/styles/w-slider.styles.d.ts +0 -1
- package/dist/packages/slider/styles/w-slider.styles.js +0 -148
- package/dist/packages/slider/styles.d.ts +0 -1
- package/dist/packages/slider/styles.js +0 -2
- package/dist/packages/stepindicator/index.d.ts +0 -37
- package/dist/packages/stepindicator/index.js +0 -195
- package/dist/packages/stepindicator/locales/da/messages.d.mts +0 -1
- package/dist/packages/stepindicator/locales/da/messages.mjs +0 -1
- package/dist/packages/stepindicator/locales/en/messages.d.mts +0 -1
- package/dist/packages/stepindicator/locales/en/messages.mjs +0 -1
- package/dist/packages/stepindicator/locales/fi/messages.d.mts +0 -1
- package/dist/packages/stepindicator/locales/fi/messages.mjs +0 -1
- package/dist/packages/stepindicator/locales/nb/messages.d.mts +0 -1
- package/dist/packages/stepindicator/locales/nb/messages.mjs +0 -1
- package/dist/packages/stepindicator/locales/sv/messages.d.mts +0 -1
- package/dist/packages/stepindicator/locales/sv/messages.mjs +0 -1
- package/dist/packages/stepindicator/react.d.ts +0 -3
- package/dist/packages/stepindicator/stepindicator.react.stories.d.ts +0 -15
- package/dist/packages/stepindicator/stepindicator.react.stories.js +0 -112
- package/dist/packages/stepindicator/stepindicator.stories.d.ts +0 -12
- package/dist/packages/stepindicator/stepindicator.stories.js +0 -172
- package/dist/packages/stepindicator/styles.d.ts +0 -1
- package/dist/packages/stepindicator/styles.js +0 -2
- package/dist/packages/tabs/tab-panel.js +0 -51
- package/dist/packages/tabs/tab.js +0 -104
- package/dist/packages/textarea/index.d.ts +0 -1
- package/dist/packages/textarea/index.js +0 -1
- package/dist/packages/textarea/locales/da/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/da/messages.mjs +0 -1
- package/dist/packages/textarea/locales/en/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/en/messages.mjs +0 -1
- package/dist/packages/textarea/locales/fi/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/fi/messages.mjs +0 -1
- package/dist/packages/textarea/locales/nb/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/nb/messages.mjs +0 -1
- package/dist/packages/textarea/locales/sv/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/sv/messages.mjs +0 -1
- package/dist/packages/textarea/react.d.ts +0 -11
- package/dist/packages/textarea/react.js +0 -21
- package/dist/packages/textarea/styles.d.ts +0 -1
- package/dist/packages/textarea/styles.js +0 -2
- package/dist/packages/textarea/textarea.d.ts +0 -49
- package/dist/packages/textarea/textarea.js +0 -220
- package/dist/packages/textarea/textarea.react.stories.d.ts +0 -33
- package/dist/packages/textarea/textarea.react.stories.js +0 -41
- package/dist/packages/textarea/textarea.stories.d.ts +0 -19
- package/dist/packages/textarea/textarea.stories.js +0 -85
- package/dist/packages/textarea/textarea.test.d.ts +0 -1
- package/dist/packages/textarea/textarea.test.js +0 -68
- package/dist/packages/toast/index.js.map +0 -7
- package/dist/packages/toast/toast-container.js.map +0 -7
- package/dist/packages/toggle-styles.d.ts +0 -1
- package/dist/packages/toggle-styles.js +0 -108
- /package/dist/packages/affix/{index.d.ts → affix.d.ts} +0 -0
- /package/dist/packages/alert/{index.d.ts → alert.d.ts} +0 -0
- /package/dist/packages/badge/{index.d.ts → badge.d.ts} +0 -0
- /package/dist/packages/box/{index.d.ts → box.d.ts} +0 -0
- /package/dist/packages/breadcrumbs/{index.d.ts → breadcrumbs.d.ts} +0 -0
- /package/dist/packages/card/{index.d.ts → card.d.ts} +0 -0
- /package/dist/packages/combobox/{index.d.ts → combobox.d.ts} +0 -0
- /package/dist/packages/expandable/{index.d.ts → expandable.d.ts} +0 -0
- /package/dist/packages/{pageindicator → icon}/style.d.ts +0 -0
- /package/dist/packages/link/{index.d.ts → link.d.ts} +0 -0
- /package/dist/packages/modal/{modal-main.d.ts → modal.d.ts} +0 -0
- /package/dist/packages/{pagination → page-indicator}/locales/da/messages.d.mts +0 -0
- /package/dist/packages/{pagination → page-indicator}/locales/en/messages.d.mts +0 -0
- /package/dist/packages/{pagination → page-indicator}/locales/fi/messages.d.mts +0 -0
- /package/dist/packages/{pagination → page-indicator}/locales/nb/messages.d.mts +0 -0
- /package/dist/packages/{pagination → page-indicator}/locales/sv/messages.d.mts +0 -0
- /package/dist/packages/{pageindicator/pageindicator.react.stories.js → page-indicator/page-indicator.react.stories.js} +0 -0
- /package/dist/packages/{pagination/styles.d.ts → page-indicator/style.d.ts} +0 -0
- /package/dist/packages/pill/{index.d.ts → pill.d.ts} +0 -0
- /package/dist/packages/select/{index.d.ts → select.d.ts} +0 -0
- /package/dist/packages/switch/{index.d.ts → switch.d.ts} +0 -0
- /package/dist/packages/textfield/{index.d.ts → textfield.d.ts} +0 -0
- /package/dist/packages/{toast → toast-container}/toast-container.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const messages: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*eslint-disable*/ export const messages = JSON.parse("{\"slider.error.overlap\":[\"Maksimumværdien må ikke være mindre end minimumværdien\"],\"slider.error.required\":[\"Dette felt er påkrævet\"],\"slider.error.out_of_bounds\":[\"Værdien skal være mellem \",[\"min\"],\" og \",[\"max\"]]}");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const messages: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*eslint-disable*/ export const messages = JSON.parse("{\"slider.error.overlap\":[\"The maximum value cannot be less than the minimum\"],\"slider.error.required\":[\"This field is required\"],\"slider.error.out_of_bounds\":[\"Value must be between \",[\"min\"],\" and \",[\"max\"]]}");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const messages: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*eslint-disable*/ export const messages = JSON.parse("{\"slider.error.overlap\":[\"Maksimiarvo ei voi olla pienempi kuin minimiarvo\"],\"slider.error.required\":[\"Tämä kenttä on pakollinen\"],\"slider.error.out_of_bounds\":[\"Arvon on oltava välillä \",[\"min\"],\" - \",[\"max\"]]}");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const messages: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*eslint-disable*/ export const messages = JSON.parse("{\"slider.error.overlap\":[\"Maksimumsverdien kan ikke være mindre enn minimumsverdien\"],\"slider.error.required\":[\"Dette feltet er påkrevd\"],\"slider.error.out_of_bounds\":[\"Verdien må være mellom \",[\"min\"],\" og \",[\"max\"]]}");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const messages: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*eslint-disable*/ export const messages = JSON.parse("{\"slider.error.overlap\":[\"Maxvärdet kan inte vara mindre än minimivärdet\"],\"slider.error.required\":[\"Detta fält är obligatoriskt\"],\"slider.error.out_of_bounds\":[\"Värdet måste vara mellan \",[\"min\"],\" och \",[\"max\"]]}");
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { EventName } from '@lit/react';
|
|
2
|
-
import { WarpSlider } from './slider.js';
|
|
3
|
-
import { WarpSliderThumb } from './slider-thumb.js';
|
|
4
|
-
export declare const Slider: import("@lit/react").ReactWebComponent<WarpSlider, {}>;
|
|
5
|
-
export declare const SliderThumb: import("@lit/react").ReactWebComponent<WarpSliderThumb, {
|
|
6
|
-
onSliderValidity: EventName<CustomEvent>;
|
|
7
|
-
'onslider-validity': EventName<CustomEvent>;
|
|
8
|
-
}>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { createComponent } from '@lit/react';
|
|
4
|
-
// decouple from CDN by providing a dummy class
|
|
5
|
-
class Component extends LitElement {
|
|
6
|
-
}
|
|
7
|
-
export const Slider = createComponent({
|
|
8
|
-
tagName: 'w-slider',
|
|
9
|
-
elementClass: Component,
|
|
10
|
-
react: React,
|
|
11
|
-
});
|
|
12
|
-
export const SliderThumb = createComponent({
|
|
13
|
-
tagName: 'w-slider-thumb',
|
|
14
|
-
elementClass: Component,
|
|
15
|
-
react: React,
|
|
16
|
-
events: {
|
|
17
|
-
onSliderValidity: 'slidervalidity',
|
|
18
|
-
'onslider-validity': 'slidervalidity', // should be slider-validity
|
|
19
|
-
},
|
|
20
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
import type { WarpTextField } from '../textfield/index.js';
|
|
3
|
-
declare const WarpSliderThumb_base: import("@open-wc/form-control").Constructor<import("@open-wc/form-control").FormControlInterface> & typeof LitElement;
|
|
4
|
-
/**
|
|
5
|
-
* Component to place inside a `<w-slider>`.
|
|
6
|
-
*
|
|
7
|
-
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-slider-and-range-slider--docs)
|
|
8
|
-
*/
|
|
9
|
-
declare class WarpSliderThumb extends WarpSliderThumb_base {
|
|
10
|
-
#private;
|
|
11
|
-
static shadowRootOptions: {
|
|
12
|
-
delegatesFocus: boolean;
|
|
13
|
-
mode: ShadowRootMode;
|
|
14
|
-
serializable?: boolean;
|
|
15
|
-
slotAssignment?: SlotAssignmentMode;
|
|
16
|
-
};
|
|
17
|
-
static styles: import("lit").CSSResult[];
|
|
18
|
-
ariaLabel: string;
|
|
19
|
-
ariaDescription: string;
|
|
20
|
-
label: string;
|
|
21
|
-
name: string;
|
|
22
|
-
value: string;
|
|
23
|
-
disabled: boolean;
|
|
24
|
-
invalid: boolean;
|
|
25
|
-
/** Set by `<w-slider>` */
|
|
26
|
-
allowValuesOutsideRange: boolean;
|
|
27
|
-
/** Set by `<w-slider>` */
|
|
28
|
-
markers: string;
|
|
29
|
-
/** Set by `<w-slider>` */
|
|
30
|
-
required: boolean;
|
|
31
|
-
/** Set by `<w-slider>` */
|
|
32
|
-
step: number;
|
|
33
|
-
/** Set by `<w-slider>` */
|
|
34
|
-
min: string;
|
|
35
|
-
/** Set by `<w-slider>` */
|
|
36
|
-
max: string;
|
|
37
|
-
/** Set by `<w-slider>` */
|
|
38
|
-
suffix: string;
|
|
39
|
-
/** JS hook to help you format the numeric value how you want. */
|
|
40
|
-
formatter: (value: string, type: 'from' | 'to') => string;
|
|
41
|
-
range: HTMLInputElement;
|
|
42
|
-
textfield: WarpTextField;
|
|
43
|
-
/** @internal */
|
|
44
|
-
_showTooltip: boolean;
|
|
45
|
-
/** @internal */
|
|
46
|
-
_inputHasFocus: boolean;
|
|
47
|
-
resetFormControl(): void;
|
|
48
|
-
/**
|
|
49
|
-
* Reference to the anchor positioning style element used by the polyfill.
|
|
50
|
-
* @internal
|
|
51
|
-
*/
|
|
52
|
-
anchorPositioningStyleElement: HTMLStyleElement | null;
|
|
53
|
-
updateFieldAfterValidation(): Promise<void>;
|
|
54
|
-
connectedCallback(): Promise<void>;
|
|
55
|
-
get boundaryValue(): string;
|
|
56
|
-
/** Value to display in the textfield (shows boundary when focused on empty value) */
|
|
57
|
-
get textFieldDisplayValue(): string;
|
|
58
|
-
/** Value to display in the tooltip */
|
|
59
|
-
get tooltipDisplayValue(): string | number;
|
|
60
|
-
updated(changedProperties: PropertyValues<this>): void;
|
|
61
|
-
render(): import("lit").TemplateResult<1>;
|
|
62
|
-
}
|
|
63
|
-
export { WarpSliderThumb };
|
|
@@ -1,501 +0,0 @@
|
|
|
1
|
-
// @warp-css;
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
import { FormControlMixin } from '@open-wc/form-control';
|
|
9
|
-
import { html, LitElement, nothing } from 'lit';
|
|
10
|
-
import { property, query, state } from 'lit/decorators.js';
|
|
11
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
12
|
-
import { reset } from '../styles.js';
|
|
13
|
-
import { wSliderThumbStyles } from './styles/w-slider-thumb.styles.js';
|
|
14
|
-
import { styles as unoStyles } from './styles.js';
|
|
15
|
-
import { i18n } from '@lingui/core';
|
|
16
|
-
/**
|
|
17
|
-
* Component to place inside a `<w-slider>`.
|
|
18
|
-
*
|
|
19
|
-
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-slider-and-range-slider--docs)
|
|
20
|
-
*/
|
|
21
|
-
class WarpSliderThumb extends FormControlMixin(LitElement) {
|
|
22
|
-
constructor() {
|
|
23
|
-
super(...arguments);
|
|
24
|
-
this.invalid = false;
|
|
25
|
-
/** Set by `<w-slider>` */
|
|
26
|
-
this.allowValuesOutsideRange = false;
|
|
27
|
-
/** Set by `<w-slider>` */
|
|
28
|
-
this.suffix = '';
|
|
29
|
-
/** @internal */
|
|
30
|
-
this._showTooltip = false;
|
|
31
|
-
/** @internal */
|
|
32
|
-
this._inputHasFocus = false;
|
|
33
|
-
// capture the initial value using connectedCallback and #initialValue
|
|
34
|
-
this.#initialValue = null;
|
|
35
|
-
/**
|
|
36
|
-
* Reference to the anchor positioning style element used by the polyfill.
|
|
37
|
-
* @internal
|
|
38
|
-
*/
|
|
39
|
-
this.anchorPositioningStyleElement = null;
|
|
40
|
-
}
|
|
41
|
-
static { this.shadowRootOptions = {
|
|
42
|
-
...LitElement.shadowRootOptions,
|
|
43
|
-
delegatesFocus: true,
|
|
44
|
-
}; }
|
|
45
|
-
static { this.styles = [reset, unoStyles, wSliderThumbStyles]; }
|
|
46
|
-
// capture the initial value using connectedCallback and #initialValue
|
|
47
|
-
#initialValue;
|
|
48
|
-
resetFormControl() {
|
|
49
|
-
this.value = this.#initialValue;
|
|
50
|
-
}
|
|
51
|
-
#showTooltip() {
|
|
52
|
-
this._showTooltip = true;
|
|
53
|
-
this.shadowRoot.querySelector('w-attention').handleDone();
|
|
54
|
-
}
|
|
55
|
-
#hideTooltip() {
|
|
56
|
-
this._showTooltip = false;
|
|
57
|
-
}
|
|
58
|
-
// Synchronizes the range input's value with the form value
|
|
59
|
-
#syncRangeValue() {
|
|
60
|
-
if (!this.range)
|
|
61
|
-
return;
|
|
62
|
-
if (this.value === '') {
|
|
63
|
-
this.range.value = this.boundaryValue;
|
|
64
|
-
}
|
|
65
|
-
else if (this.value) {
|
|
66
|
-
this.range.value = this.value;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
#handleValidity(error) {
|
|
70
|
-
this.dispatchEvent(new CustomEvent('slidervalidity', {
|
|
71
|
-
bubbles: true,
|
|
72
|
-
detail: { invalid: error, slot: this.slot },
|
|
73
|
-
}));
|
|
74
|
-
}
|
|
75
|
-
async updateFieldAfterValidation() {
|
|
76
|
-
const input = this.shadowRoot.querySelector('w-textfield');
|
|
77
|
-
await this.#handleValueChange(input.value, true);
|
|
78
|
-
}
|
|
79
|
-
async #handleValueChange(value, isFromTextInput) {
|
|
80
|
-
let valueNum = Number.parseInt(value);
|
|
81
|
-
if (this.allowValuesOutsideRange && !isFromTextInput && this.step) {
|
|
82
|
-
const valueIsCloseToSliderEdge = (this.slot === 'to' && valueNum >= Number(this.max) - 1) ||
|
|
83
|
-
(this.slot === 'from' && valueNum <= Number(this.min) + 1);
|
|
84
|
-
if (!valueIsCloseToSliderEdge) {
|
|
85
|
-
const multiplier = 1 / this.step;
|
|
86
|
-
valueNum = Math.round(valueNum * multiplier) / multiplier;
|
|
87
|
-
value = valueNum.toString();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
// Update validation state
|
|
91
|
-
// Check that the user hasn't typed in a value beyond max or min
|
|
92
|
-
const maxNum = Number.parseInt(this.max);
|
|
93
|
-
const minNum = Number.parseInt(this.min);
|
|
94
|
-
if (!this.allowValuesOutsideRange && (valueNum > maxNum || valueNum < minNum)) {
|
|
95
|
-
this.#handleValidity(i18n.t({
|
|
96
|
-
id: 'slider.error.out_of_bounds',
|
|
97
|
-
message: 'Value must be between {min} and {max}',
|
|
98
|
-
values: {
|
|
99
|
-
min: `${this.min} ${this.suffix}`.trim(),
|
|
100
|
-
max: `${this.max} ${this.suffix}`.trim(),
|
|
101
|
-
},
|
|
102
|
-
}));
|
|
103
|
-
return { shouldCancel: true };
|
|
104
|
-
}
|
|
105
|
-
if (value === '') {
|
|
106
|
-
if (this.required) {
|
|
107
|
-
this.#handleValidity(i18n.t({
|
|
108
|
-
id: 'slider.error.required',
|
|
109
|
-
message: 'This field is required',
|
|
110
|
-
}));
|
|
111
|
-
}
|
|
112
|
-
// To not bork when input field is empty
|
|
113
|
-
return { shouldCancel: true };
|
|
114
|
-
}
|
|
115
|
-
this.value = value;
|
|
116
|
-
const valueIsAtTheSliderEdge = value === this.max || value === this.min;
|
|
117
|
-
// Stop a range slider's from value from reaching past the to value and vice versa
|
|
118
|
-
// by updating the other component's min and max values.
|
|
119
|
-
// Skip this check when typing in textfield with allowValuesOutsideRange enabled
|
|
120
|
-
let shouldCancel = false;
|
|
121
|
-
if (this.slot) {
|
|
122
|
-
const toThumb = this.parentElement.querySelector('w-slider-thumb[slot="to"]');
|
|
123
|
-
const fromThumb = this.parentElement.querySelector('w-slider-thumb[slot="from"]');
|
|
124
|
-
const toValue = toThumb.textfield.value || this.max;
|
|
125
|
-
const fromValue = fromThumb.textfield.value || this.min;
|
|
126
|
-
const numericToValue = Number.parseInt(toValue);
|
|
127
|
-
const numericFromValue = Number.parseInt(fromValue);
|
|
128
|
-
const numberOverLapError = i18n.t({
|
|
129
|
-
id: 'slider.error.overlap',
|
|
130
|
-
message: 'The maximum value cannot be less than the minimum',
|
|
131
|
-
});
|
|
132
|
-
if (this.slot === 'from') {
|
|
133
|
-
// Check that the from value is not about to be dragged past the --to value
|
|
134
|
-
const toBoundary = this.allowValuesOutsideRange && numericToValue > maxNum
|
|
135
|
-
? numericToValue
|
|
136
|
-
: Math.min(numericToValue, this.allowValuesOutsideRange ? maxNum - 1 : maxNum);
|
|
137
|
-
if (valueNum > toBoundary) {
|
|
138
|
-
shouldCancel = true;
|
|
139
|
-
// The user might have moved the slider so fast that this.value is far away from overlapping.
|
|
140
|
-
// Set it to be equal to the to/from value, depending on what slider the user's moving.
|
|
141
|
-
if (this.allowValuesOutsideRange && valueIsAtTheSliderEdge) {
|
|
142
|
-
this.value = String(toBoundary);
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
this.value = toValue;
|
|
146
|
-
}
|
|
147
|
-
if (isFromTextInput) {
|
|
148
|
-
this.#handleValidity(numberOverLapError);
|
|
149
|
-
// Don't override the user's input in the textfield
|
|
150
|
-
await this.updateComplete;
|
|
151
|
-
this.textfield.value = value;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
// Check that the to value is not about to be dragged past the --from value
|
|
157
|
-
const fromBoundary = this.allowValuesOutsideRange && numericFromValue < minNum
|
|
158
|
-
? numericFromValue
|
|
159
|
-
: Math.max(Number.parseInt(fromValue), this.allowValuesOutsideRange ? minNum + 1 : minNum);
|
|
160
|
-
if (valueNum < fromBoundary) {
|
|
161
|
-
shouldCancel = true;
|
|
162
|
-
// The user might have moved the slider so fast that this.value is far away from overlapping.
|
|
163
|
-
// Set it to be equal to the to/from value, depending on what slider the user's moving.
|
|
164
|
-
if (this.allowValuesOutsideRange && valueIsAtTheSliderEdge) {
|
|
165
|
-
this.value = String(fromBoundary);
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
this.value = fromValue;
|
|
169
|
-
}
|
|
170
|
-
if (isFromTextInput) {
|
|
171
|
-
this.#handleValidity(numberOverLapError);
|
|
172
|
-
// Don't override the user's input in the textfield
|
|
173
|
-
await this.updateComplete;
|
|
174
|
-
this.textfield.value = value;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
if (shouldCancel) {
|
|
180
|
-
return { shouldCancel: true };
|
|
181
|
-
}
|
|
182
|
-
this.#handleValidity('');
|
|
183
|
-
this.range.value = Math.min(Math.max(Number(value), Number(this.min)), Number(this.max)).toString();
|
|
184
|
-
this.value = this.allowValuesOutsideRange && !isFromTextInput && valueIsAtTheSliderEdge ? '' : value;
|
|
185
|
-
this.shadowRoot.querySelector('w-attention').handleDone();
|
|
186
|
-
return { shouldCancel: false };
|
|
187
|
-
}
|
|
188
|
-
async #onInput(e) {
|
|
189
|
-
const isFromTextInput = e.currentTarget.tagName === 'W-TEXTFIELD';
|
|
190
|
-
if (e instanceof CustomEvent)
|
|
191
|
-
return; // We rely on the InputEvent event that fires right after the CustomEvent
|
|
192
|
-
const value = e.currentTarget.value;
|
|
193
|
-
const result = await this.#handleValueChange(value, isFromTextInput);
|
|
194
|
-
if (result.shouldCancel) {
|
|
195
|
-
e.preventDefault();
|
|
196
|
-
// Needed to stop slider from moving independendtly of the value when we cancel the event
|
|
197
|
-
return false;
|
|
198
|
-
}
|
|
199
|
-
return true;
|
|
200
|
-
}
|
|
201
|
-
async #onRangeSliderKeyDown(e) {
|
|
202
|
-
if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight')
|
|
203
|
-
return;
|
|
204
|
-
const currentValue = Number(this.range.value);
|
|
205
|
-
const stepValue = this.step || 1;
|
|
206
|
-
let newValue;
|
|
207
|
-
if (e.key === 'ArrowLeft') {
|
|
208
|
-
newValue = currentValue - stepValue;
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
newValue = currentValue + stepValue;
|
|
212
|
-
}
|
|
213
|
-
newValue = Math.min(Math.max(newValue, Number(this.min)), Number(this.max));
|
|
214
|
-
const result = await this.#handleValueChange(newValue.toString(), false);
|
|
215
|
-
if (result.shouldCancel) {
|
|
216
|
-
e.preventDefault();
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
async connectedCallback() {
|
|
220
|
-
super.connectedCallback();
|
|
221
|
-
this.#initialValue = this.value;
|
|
222
|
-
this.setValue(this.value);
|
|
223
|
-
if (!('anchorName' in document.documentElement.style)) {
|
|
224
|
-
// Load the polyfill for CSS anchor positioning by @oddbird for browsers without native support.
|
|
225
|
-
const dirname = import.meta.url.substring(0, import.meta.url.lastIndexOf('/'));
|
|
226
|
-
try {
|
|
227
|
-
const [{ default: polyfill }] = await Promise.all([
|
|
228
|
-
import(
|
|
229
|
-
/* @vite-ignore */
|
|
230
|
-
`${dirname}/oddbird-css-anchor-positioning.js`),
|
|
231
|
-
this.updateComplete,
|
|
232
|
-
]);
|
|
233
|
-
// We need to work around a limitation in the polyfill. It doesn't support constructed stylesheets.
|
|
234
|
-
// This is based on the approach in Fluent UI: https://github.com/microsoft/fluentui/pull/32852/files#diff-7b316dca1b4391eae93d5edf48e9689e83d39f1c82cb3f8d61450dfad6f3c59eR73
|
|
235
|
-
if (!this.anchorPositioningStyleElement) {
|
|
236
|
-
this.anchorPositioningStyleElement = document.createElement('style');
|
|
237
|
-
this.shadowRoot.prepend(this.anchorPositioningStyleElement);
|
|
238
|
-
}
|
|
239
|
-
this.anchorPositioningStyleElement.textContent = `
|
|
240
|
-
/*
|
|
241
|
-
* The polyfill can only anchor to ::before and ::after pseudo elements, not the pseudo element slider thumb.
|
|
242
|
-
* We work around that by recreating a transparent version of the active range
|
|
243
|
-
* so that we can position relative to that, without crossing the shadow root boundary.
|
|
244
|
-
*/
|
|
245
|
-
.polyfill-range {
|
|
246
|
-
align-self: center;
|
|
247
|
-
background: transparent;
|
|
248
|
-
height: var(--w-slider-track-active-height);
|
|
249
|
-
position: absolute;
|
|
250
|
-
padding-inline-start: var(--active-range-inline-start-padding, 0);
|
|
251
|
-
padding-inline-end: var(--active-range-inline-end-padding, 0);
|
|
252
|
-
top: var(--_range-top);
|
|
253
|
-
left: 0;
|
|
254
|
-
right: 0;
|
|
255
|
-
grid-area: slider;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.polyfill-active-range {
|
|
259
|
-
anchor-name: --polyfilled-thumb;
|
|
260
|
-
|
|
261
|
-
box-sizing: content-box;
|
|
262
|
-
background: transparent;
|
|
263
|
-
height: var(--w-slider-track-active-height);
|
|
264
|
-
|
|
265
|
-
border-start-start-radius: var(--active-range-border-radius, 0);
|
|
266
|
-
border-end-start-radius: var(--active-range-border-radius, 0);
|
|
267
|
-
|
|
268
|
-
margin-left: calc(calc(var(--_blank-values-before) * 1%) - var(--active-range-inline-start-padding, 0px));
|
|
269
|
-
width: calc(calc(var(--_filled-values) * 1%) + var(--active-range-inline-end-padding, 0px));
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
#target {
|
|
273
|
-
position: absolute;
|
|
274
|
-
top: anchor(--polyfilled-thumb top);
|
|
275
|
-
right: anchor(--polyfilled-thumb right);
|
|
276
|
-
margin-right: 12px;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
:host([name='from']) .polyfill-active-range {
|
|
280
|
-
margin-left: calc(calc(var(--_blank-values-before) * 1%) - var(--active-range-inline-start-padding, 0px));
|
|
281
|
-
width: calc(calc(var(--_filled-values) * 1%) + var(--active-range-inline-end-padding, 0px));
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
:host([name='from']) #target {
|
|
285
|
-
left: anchor(--polyfilled-thumb left);
|
|
286
|
-
margin-left: 38px;
|
|
287
|
-
}
|
|
288
|
-
`;
|
|
289
|
-
await polyfill({
|
|
290
|
-
roots: [this.shadowRoot],
|
|
291
|
-
elements: [this.anchorPositioningStyleElement],
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
catch (e) {
|
|
295
|
-
console.error(new Error('Error registering the CSS anchor positioning polyfill. The UI will look broken.', { cause: e }));
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
await this.updateComplete;
|
|
300
|
-
}
|
|
301
|
-
this.#syncRangeValue();
|
|
302
|
-
}
|
|
303
|
-
#onTextFieldFocus(e) {
|
|
304
|
-
// Safari fires the focus event we register on `w-textfield` also when the range input
|
|
305
|
-
// is focused. This breaks the input masking. Rely on the custom event that is also
|
|
306
|
-
// fired by w-textfield on focus.
|
|
307
|
-
if (e instanceof CustomEvent && e.type === 'focus') {
|
|
308
|
-
this._inputHasFocus = true;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
#onTextFieldBlur(e) {
|
|
312
|
-
if (e instanceof CustomEvent && e.type === 'blur') {
|
|
313
|
-
this._inputHasFocus = false;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
// The boundary value for this thumb (min for 'from', max for 'to' or default)
|
|
317
|
-
get boundaryValue() {
|
|
318
|
-
return this.slot === 'from' ? this.min : this.max;
|
|
319
|
-
}
|
|
320
|
-
/** Value to display in the textfield (shows boundary when focused on empty value) */
|
|
321
|
-
get textFieldDisplayValue() {
|
|
322
|
-
if (this._inputHasFocus) {
|
|
323
|
-
// When focused, show the range's clamped value if the form value is empty (slider at boundary)
|
|
324
|
-
// This allows users to see and edit the actual min/max value
|
|
325
|
-
if (this.value !== '') {
|
|
326
|
-
return this.value;
|
|
327
|
-
}
|
|
328
|
-
if (!this.range?.value) {
|
|
329
|
-
return '';
|
|
330
|
-
}
|
|
331
|
-
return Math.min(Math.max(Number(this.range.value), Number(this.min) + 1), Number(this.max) - 1).toString();
|
|
332
|
-
}
|
|
333
|
-
// When not focused, display the value as-is:
|
|
334
|
-
// - Empty string if slider set it to empty (at boundary)
|
|
335
|
-
// - Actual value if user typed it (even if it equals min/max)
|
|
336
|
-
return this.value;
|
|
337
|
-
}
|
|
338
|
-
/** Value to display in the tooltip */
|
|
339
|
-
get tooltipDisplayValue() {
|
|
340
|
-
if (this.formatter) {
|
|
341
|
-
return this.formatter(this.value, this.slot);
|
|
342
|
-
}
|
|
343
|
-
if (this.value === '') {
|
|
344
|
-
return this.range?.value ?? this.boundaryValue;
|
|
345
|
-
}
|
|
346
|
-
return this.value || 0;
|
|
347
|
-
}
|
|
348
|
-
updated(changedProperties) {
|
|
349
|
-
if (changedProperties.has('value')) {
|
|
350
|
-
this.setValue(this.value);
|
|
351
|
-
this.#syncRangeValue();
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
render() {
|
|
355
|
-
return html `
|
|
356
|
-
<div class="w-slider-thumb">
|
|
357
|
-
<label for="range">${this.label}</label>
|
|
358
|
-
${!('anchorName' in document.documentElement.style)
|
|
359
|
-
? html `<div class="polyfill-range">
|
|
360
|
-
<div class="polyfill-active-range"></div>
|
|
361
|
-
</div>`
|
|
362
|
-
: nothing}
|
|
363
|
-
<input
|
|
364
|
-
id="range"
|
|
365
|
-
aria-label="${this.ariaLabel}"
|
|
366
|
-
aria-describedby="${ifDefined(this.ariaDescription ? 'aria-description' : undefined)}"
|
|
367
|
-
class="w-slider-thumb__range"
|
|
368
|
-
type="range"
|
|
369
|
-
.value="${this.value}"
|
|
370
|
-
aria-valuetext="${this.tooltipDisplayValue}"
|
|
371
|
-
min="${this.min}"
|
|
372
|
-
max="${this.max}"
|
|
373
|
-
step="${ifDefined(!this.allowValuesOutsideRange && this.step ? this.step : undefined)}"
|
|
374
|
-
?disabled="${this.disabled}"
|
|
375
|
-
@mousedown="${this.#showTooltip}"
|
|
376
|
-
@mouseup="${this.#hideTooltip}"
|
|
377
|
-
@touchstart="${this.#showTooltip}"
|
|
378
|
-
@touchend="${this.#hideTooltip}"
|
|
379
|
-
@focus="${this.#showTooltip}"
|
|
380
|
-
@blur="${this.#hideTooltip}"
|
|
381
|
-
@input="${this.#onInput}"
|
|
382
|
-
@keydown="${this.allowValuesOutsideRange ? this.#onRangeSliderKeyDown : nothing}"
|
|
383
|
-
/>
|
|
384
|
-
|
|
385
|
-
${this.slot === 'from'
|
|
386
|
-
? html `<span class="w-slider-thumb__from-marker"
|
|
387
|
-
>${this.formatter ? this.formatter(this.allowValuesOutsideRange ? '' : this.min, 'from') : this.min}
|
|
388
|
-
${this.suffix}</span
|
|
389
|
-
>`
|
|
390
|
-
: nothing}
|
|
391
|
-
${this.slot === 'to'
|
|
392
|
-
? html `<span class="w-slider-thumb__to-marker"
|
|
393
|
-
>${this.formatter ? this.formatter(this.allowValuesOutsideRange ? '' : this.max, 'to') : this.max}
|
|
394
|
-
${this.suffix}</span
|
|
395
|
-
>`
|
|
396
|
-
: nothing}
|
|
397
|
-
|
|
398
|
-
<w-textfield
|
|
399
|
-
aria-label="${this.ariaLabel}"
|
|
400
|
-
aria-description="${ifDefined(this.ariaDescription)}"
|
|
401
|
-
class="w-slider-thumb__textfield"
|
|
402
|
-
type="number"
|
|
403
|
-
.formatter=${this.formatter ? (value) => this.formatter(value, this.slot) : nothing}
|
|
404
|
-
.value="${this.textFieldDisplayValue}"
|
|
405
|
-
min="${this.allowValuesOutsideRange ? nothing : this.min}"
|
|
406
|
-
max="${this.allowValuesOutsideRange ? nothing : this.max}"
|
|
407
|
-
step="${ifDefined(this.step)}"
|
|
408
|
-
?invalid="${Boolean(this.invalid)}"
|
|
409
|
-
@input="${this.#onInput}"
|
|
410
|
-
@focus="${this.#onTextFieldFocus}"
|
|
411
|
-
@blur="${this.#onTextFieldBlur}"
|
|
412
|
-
>
|
|
413
|
-
${this.suffix ? html `<w-affix slot="suffix" label="${this.suffix}"></w-affix>` : nothing}
|
|
414
|
-
</w-textfield>
|
|
415
|
-
|
|
416
|
-
<w-attention
|
|
417
|
-
tooltip
|
|
418
|
-
placement="top"
|
|
419
|
-
flip
|
|
420
|
-
distance="24"
|
|
421
|
-
.show="${this._showTooltip}"
|
|
422
|
-
>
|
|
423
|
-
<output
|
|
424
|
-
id="target"
|
|
425
|
-
class="w-slider-thumb__tooltip-target"
|
|
426
|
-
slot="target"
|
|
427
|
-
></output>
|
|
428
|
-
<span slot="message">
|
|
429
|
-
${this.tooltipDisplayValue}${this.suffix ? html ` ${this.suffix}` : nothing}
|
|
430
|
-
</span>
|
|
431
|
-
</w-attention>
|
|
432
|
-
|
|
433
|
-
<!-- aria-description is still not recommended for general use, so make a visually hidden element and refer to it with aria-describedby -->
|
|
434
|
-
<span class="sr-only" id="aria-description"
|
|
435
|
-
>${this.ariaDescription}</span
|
|
436
|
-
>
|
|
437
|
-
</div>
|
|
438
|
-
`;
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
__decorate([
|
|
442
|
-
property({ attribute: 'aria-label', reflect: true })
|
|
443
|
-
], WarpSliderThumb.prototype, "ariaLabel", void 0);
|
|
444
|
-
__decorate([
|
|
445
|
-
property({ attribute: 'aria-description', reflect: true })
|
|
446
|
-
], WarpSliderThumb.prototype, "ariaDescription", void 0);
|
|
447
|
-
__decorate([
|
|
448
|
-
property({ reflect: true })
|
|
449
|
-
], WarpSliderThumb.prototype, "label", void 0);
|
|
450
|
-
__decorate([
|
|
451
|
-
property({ reflect: true })
|
|
452
|
-
], WarpSliderThumb.prototype, "name", void 0);
|
|
453
|
-
__decorate([
|
|
454
|
-
property({ reflect: true })
|
|
455
|
-
], WarpSliderThumb.prototype, "value", void 0);
|
|
456
|
-
__decorate([
|
|
457
|
-
property({ type: Boolean, reflect: true })
|
|
458
|
-
], WarpSliderThumb.prototype, "disabled", void 0);
|
|
459
|
-
__decorate([
|
|
460
|
-
property({ type: Boolean, reflect: true })
|
|
461
|
-
], WarpSliderThumb.prototype, "invalid", void 0);
|
|
462
|
-
__decorate([
|
|
463
|
-
property({ attribute: false, reflect: false })
|
|
464
|
-
], WarpSliderThumb.prototype, "allowValuesOutsideRange", void 0);
|
|
465
|
-
__decorate([
|
|
466
|
-
state()
|
|
467
|
-
], WarpSliderThumb.prototype, "markers", void 0);
|
|
468
|
-
__decorate([
|
|
469
|
-
state()
|
|
470
|
-
], WarpSliderThumb.prototype, "required", void 0);
|
|
471
|
-
__decorate([
|
|
472
|
-
state()
|
|
473
|
-
], WarpSliderThumb.prototype, "step", void 0);
|
|
474
|
-
__decorate([
|
|
475
|
-
state()
|
|
476
|
-
], WarpSliderThumb.prototype, "min", void 0);
|
|
477
|
-
__decorate([
|
|
478
|
-
state()
|
|
479
|
-
], WarpSliderThumb.prototype, "max", void 0);
|
|
480
|
-
__decorate([
|
|
481
|
-
state()
|
|
482
|
-
], WarpSliderThumb.prototype, "suffix", void 0);
|
|
483
|
-
__decorate([
|
|
484
|
-
state()
|
|
485
|
-
], WarpSliderThumb.prototype, "formatter", void 0);
|
|
486
|
-
__decorate([
|
|
487
|
-
query('input[type="range"]')
|
|
488
|
-
], WarpSliderThumb.prototype, "range", void 0);
|
|
489
|
-
__decorate([
|
|
490
|
-
query('w-textfield')
|
|
491
|
-
], WarpSliderThumb.prototype, "textfield", void 0);
|
|
492
|
-
__decorate([
|
|
493
|
-
state()
|
|
494
|
-
], WarpSliderThumb.prototype, "_showTooltip", void 0);
|
|
495
|
-
__decorate([
|
|
496
|
-
state()
|
|
497
|
-
], WarpSliderThumb.prototype, "_inputHasFocus", void 0);
|
|
498
|
-
if (!customElements.get('w-slider-thumb')) {
|
|
499
|
-
customElements.define('w-slider-thumb', WarpSliderThumb);
|
|
500
|
-
}
|
|
501
|
-
export { WarpSliderThumb };
|