@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,55 +0,0 @@
|
|
|
1
|
-
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
/**
|
|
3
|
-
* Parent component for sliders (both single and range sliders). Used in combination with a `<w-slider-thumb>`.
|
|
4
|
-
*
|
|
5
|
-
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-slider-and-range-slider--docs)
|
|
6
|
-
*
|
|
7
|
-
* @slot - For single sliders place a `<w-slider-thumb>` in the default slot.
|
|
8
|
-
* @slot label - Label for the slider or range slider as a whole.
|
|
9
|
-
* @slot description - Optional description between the label and slider.
|
|
10
|
-
* @slot from - Range sliders need to place a `<w-slider-thumb>` in the from and to slots.
|
|
11
|
-
* @slot to - Range sliders need to place a `<w-slider-thumb>` in the from and to slots.
|
|
12
|
-
*/
|
|
13
|
-
declare class WarpSlider extends LitElement {
|
|
14
|
-
#private;
|
|
15
|
-
static shadowRootOptions: {
|
|
16
|
-
delegatesFocus: boolean;
|
|
17
|
-
mode: ShadowRootMode;
|
|
18
|
-
serializable?: boolean;
|
|
19
|
-
slotAssignment?: SlotAssignmentMode;
|
|
20
|
-
};
|
|
21
|
-
static styles: import("lit").CSSResult[];
|
|
22
|
-
/**
|
|
23
|
-
* The slider fieldset label. Required for proper accessibility.
|
|
24
|
-
*
|
|
25
|
-
* If you need to display HTML, use the `label` slot instead.
|
|
26
|
-
*/
|
|
27
|
-
label: string;
|
|
28
|
-
disabled: boolean;
|
|
29
|
-
allowValuesOutsideRange: boolean;
|
|
30
|
-
error: string;
|
|
31
|
-
helpText: string;
|
|
32
|
-
invalid: boolean;
|
|
33
|
-
/** Ensures a child slider thumb has a value before allowing the containing form to submit. */
|
|
34
|
-
required: boolean;
|
|
35
|
-
min: string;
|
|
36
|
-
max: string;
|
|
37
|
-
/** Pass a value similar to step to create visual markers at that interval */
|
|
38
|
-
markers: number;
|
|
39
|
-
step: number;
|
|
40
|
-
/** Suffix used in text input fields and for the min and max values of the slider. */
|
|
41
|
-
suffix: string;
|
|
42
|
-
/** Function to format the to- and from labels and value in the slider thumb tooltip. */
|
|
43
|
-
formatter: (value: string, type: 'to' | 'from') => string;
|
|
44
|
-
_invalidMessage: string;
|
|
45
|
-
_hasInternalError: boolean;
|
|
46
|
-
constructor();
|
|
47
|
-
get edgeMin(): string;
|
|
48
|
-
get edgeMax(): string;
|
|
49
|
-
connectedCallback(): Promise<void>;
|
|
50
|
-
updated(changedProperties: PropertyValues<this>): void;
|
|
51
|
-
get componentHasError(): boolean;
|
|
52
|
-
get errorText(): string;
|
|
53
|
-
render(): import("lit").TemplateResult<1>;
|
|
54
|
-
}
|
|
55
|
-
export { WarpSlider };
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
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;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { html, LitElement, nothing } from 'lit';
|
|
8
|
-
import { property, state } from 'lit/decorators.js';
|
|
9
|
-
import { activateI18n } from '../i18n.js';
|
|
10
|
-
import { messages as daMessages } from './locales/da/messages.mjs';
|
|
11
|
-
import { messages as enMessages } from './locales/en/messages.mjs';
|
|
12
|
-
import { messages as fiMessages } from './locales/fi/messages.mjs';
|
|
13
|
-
import { messages as nbMessages } from './locales/nb/messages.mjs';
|
|
14
|
-
import { messages as svMessages } from './locales/sv/messages.mjs';
|
|
15
|
-
import { reset } from '../styles.js';
|
|
16
|
-
import { wSliderStyles } from './styles/w-slider.styles.js';
|
|
17
|
-
// Inspo:
|
|
18
|
-
// https://css-tricks.com/multi-thumb-sliders-particular-two-thumb-case/
|
|
19
|
-
// https://css-tricks.com/multi-thumb-sliders-general-case/
|
|
20
|
-
// https://css-tricks.com/lets-make-a-multi-thumb-slider-that-calculates-the-width-between-thumbs/
|
|
21
|
-
/**
|
|
22
|
-
* Parent component for sliders (both single and range sliders). Used in combination with a `<w-slider-thumb>`.
|
|
23
|
-
*
|
|
24
|
-
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-slider-and-range-slider--docs)
|
|
25
|
-
*
|
|
26
|
-
* @slot - For single sliders place a `<w-slider-thumb>` in the default slot.
|
|
27
|
-
* @slot label - Label for the slider or range slider as a whole.
|
|
28
|
-
* @slot description - Optional description between the label and slider.
|
|
29
|
-
* @slot from - Range sliders need to place a `<w-slider-thumb>` in the from and to slots.
|
|
30
|
-
* @slot to - Range sliders need to place a `<w-slider-thumb>` in the from and to slots.
|
|
31
|
-
*/
|
|
32
|
-
class WarpSlider extends LitElement {
|
|
33
|
-
static { this.shadowRootOptions = {
|
|
34
|
-
...LitElement.shadowRootOptions,
|
|
35
|
-
delegatesFocus: true,
|
|
36
|
-
}; }
|
|
37
|
-
static { this.styles = [reset, wSliderStyles]; }
|
|
38
|
-
constructor() {
|
|
39
|
-
super();
|
|
40
|
-
this.disabled = false;
|
|
41
|
-
this.allowValuesOutsideRange = false;
|
|
42
|
-
this.error = '';
|
|
43
|
-
this.helpText = '';
|
|
44
|
-
this.invalid = false;
|
|
45
|
-
/** Ensures a child slider thumb has a value before allowing the containing form to submit. */
|
|
46
|
-
this.required = false;
|
|
47
|
-
/** Suffix used in text input fields and for the min and max values of the slider. */
|
|
48
|
-
this.suffix = '';
|
|
49
|
-
this._invalidMessage = '';
|
|
50
|
-
this._hasInternalError = false;
|
|
51
|
-
activateI18n(enMessages, nbMessages, fiMessages, daMessages, svMessages);
|
|
52
|
-
}
|
|
53
|
-
#syncSliderThumbs() {
|
|
54
|
-
const sliderThumbs = this.querySelectorAll('w-slider-thumb');
|
|
55
|
-
let usedNamedSlots = false;
|
|
56
|
-
for (const thumb of sliderThumbs.values()) {
|
|
57
|
-
// Set attributes that should be in sync between slider thumbs
|
|
58
|
-
thumb.min = this.edgeMin;
|
|
59
|
-
thumb.max = this.edgeMax;
|
|
60
|
-
thumb.step = this.step;
|
|
61
|
-
thumb.suffix = this.suffix;
|
|
62
|
-
thumb.required = this.required;
|
|
63
|
-
thumb.formatter = this.formatter;
|
|
64
|
-
thumb.allowValuesOutsideRange = this.allowValuesOutsideRange;
|
|
65
|
-
if (!thumb.ariaLabel) {
|
|
66
|
-
if (!thumb.slot) {
|
|
67
|
-
thumb.ariaLabel = this.label;
|
|
68
|
-
}
|
|
69
|
-
if (thumb.slot === 'from') {
|
|
70
|
-
thumb.ariaLabel = `${this.label} min`;
|
|
71
|
-
}
|
|
72
|
-
if (thumb.slot === 'to') {
|
|
73
|
-
thumb.ariaLabel = `${this.label} max`;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (thumb.slot === 'from' || thumb.slot === 'to') {
|
|
77
|
-
usedNamedSlots = true;
|
|
78
|
-
}
|
|
79
|
-
thumb.disabled = this.disabled;
|
|
80
|
-
thumb.invalid = this.invalid || this._hasInternalError;
|
|
81
|
-
this.#updateActiveTrack(thumb);
|
|
82
|
-
}
|
|
83
|
-
// Missing a CSS-only way to detect if something is slotted in the named slots
|
|
84
|
-
const fieldset = this.shadowRoot.querySelector('fieldset');
|
|
85
|
-
if (usedNamedSlots) {
|
|
86
|
-
fieldset.style.setProperty('--active-range-inline-start-padding', 'var(--w-slider-thumb-size)');
|
|
87
|
-
fieldset.style.setProperty('--active-range-inline-end-padding', 'var(--w-slider-thumb-size)');
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
fieldset.style.setProperty('--active-range-border-radius', '4px');
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
get edgeMin() {
|
|
94
|
-
return this.allowValuesOutsideRange ? (Number(this.min) - 1).toString() : this.min;
|
|
95
|
-
}
|
|
96
|
-
get edgeMax() {
|
|
97
|
-
return this.allowValuesOutsideRange ? (Number(this.max) + 1).toString() : this.max;
|
|
98
|
-
}
|
|
99
|
-
async connectedCallback() {
|
|
100
|
-
super.connectedCallback();
|
|
101
|
-
await this.updateComplete;
|
|
102
|
-
if (this.step) {
|
|
103
|
-
this.style.setProperty('--step', String(this.step));
|
|
104
|
-
}
|
|
105
|
-
this.style.setProperty('--min', this.edgeMin);
|
|
106
|
-
this.style.setProperty('--max', this.max);
|
|
107
|
-
if (this.markers) {
|
|
108
|
-
this.style.setProperty('--markers', String(this.markers));
|
|
109
|
-
}
|
|
110
|
-
if (this.allowValuesOutsideRange) {
|
|
111
|
-
this.style.setProperty('--over-under-offset', '1');
|
|
112
|
-
}
|
|
113
|
-
this.#syncSliderThumbs();
|
|
114
|
-
}
|
|
115
|
-
updated(changedProperties) {
|
|
116
|
-
if (changedProperties.has('disabled') ||
|
|
117
|
-
changedProperties.has('invalid') ||
|
|
118
|
-
changedProperties.has('required') ||
|
|
119
|
-
changedProperties.has('min') ||
|
|
120
|
-
changedProperties.has('step') ||
|
|
121
|
-
changedProperties.has('max') ||
|
|
122
|
-
changedProperties.has('suffix') ||
|
|
123
|
-
changedProperties.has('formatter') ||
|
|
124
|
-
changedProperties.has('_invalidMessage') ||
|
|
125
|
-
changedProperties.has('_hasInternalError')) {
|
|
126
|
-
this.#syncSliderThumbs();
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
#onInput(e) {
|
|
130
|
-
const input = e.target;
|
|
131
|
-
this.#updateActiveTrack(input);
|
|
132
|
-
const isRangeSlider = input.slot;
|
|
133
|
-
if (isRangeSlider) {
|
|
134
|
-
this.#doValidation();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
#doValidation() {
|
|
138
|
-
// In a range slider changing the value in one input can change the validity
|
|
139
|
-
// of the second input. Specifically, what was a value outside the mininum or
|
|
140
|
-
// maximum can become inside those limits when the limits change, by changing
|
|
141
|
-
// the from or to values. Check to see if a field is invalid, but should be
|
|
142
|
-
// valid based on those rules.
|
|
143
|
-
let from;
|
|
144
|
-
let to;
|
|
145
|
-
const sliderThumbs = this.querySelectorAll('w-slider-thumb');
|
|
146
|
-
for (const thumb of sliderThumbs.values()) {
|
|
147
|
-
if (thumb.slot === 'from')
|
|
148
|
-
from = thumb;
|
|
149
|
-
if (thumb.slot === 'to')
|
|
150
|
-
to = thumb;
|
|
151
|
-
}
|
|
152
|
-
if (!from || !to) {
|
|
153
|
-
// Not a range slider, nothing to do here.
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
if (!from.invalid && !to.invalid) {
|
|
157
|
-
// Both are valid, nothing to do here
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
#onSliderValidity(e) {
|
|
162
|
-
e.stopPropagation();
|
|
163
|
-
const didHaveInternalError = this._hasInternalError || this.invalid;
|
|
164
|
-
const triggeredThumb = e.target;
|
|
165
|
-
this._hasInternalError = Boolean(e.detail.invalid) || this.invalid;
|
|
166
|
-
this._invalidMessage = e.detail.invalid;
|
|
167
|
-
if (didHaveInternalError === true && this._hasInternalError === false) {
|
|
168
|
-
const sliderThumbs = this.querySelectorAll('w-slider-thumb');
|
|
169
|
-
for (const thumb of sliderThumbs.values()) {
|
|
170
|
-
if (thumb !== triggeredThumb) {
|
|
171
|
-
thumb.updateFieldAfterValidation();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
#getEdgeValue(boundary, input) {
|
|
177
|
-
if (input.value === undefined || input.value === null) {
|
|
178
|
-
input.value = this.allowValuesOutsideRange ? '' : boundary;
|
|
179
|
-
}
|
|
180
|
-
// Use boundary for CSS positioning when value is empty
|
|
181
|
-
return input.value === '' ? boundary : input.value;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* We use CSS variables to fill the active track with a background color.
|
|
185
|
-
*/
|
|
186
|
-
#updateActiveTrack(input) {
|
|
187
|
-
const slotName = input.slot;
|
|
188
|
-
if (!slotName) {
|
|
189
|
-
this.style.setProperty('--from', '0');
|
|
190
|
-
}
|
|
191
|
-
if (slotName === 'from') {
|
|
192
|
-
this.style.setProperty('--from', this.#getEdgeValue(this.edgeMin, input));
|
|
193
|
-
}
|
|
194
|
-
if (!slotName || slotName === 'to') {
|
|
195
|
-
this.style.setProperty('--to', this.#getEdgeValue(this.edgeMax, input));
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
get componentHasError() {
|
|
199
|
-
return this.invalid || this._hasInternalError;
|
|
200
|
-
}
|
|
201
|
-
get errorText() {
|
|
202
|
-
if (!this.componentHasError) {
|
|
203
|
-
return '';
|
|
204
|
-
}
|
|
205
|
-
return this.error || this._invalidMessage;
|
|
206
|
-
}
|
|
207
|
-
render() {
|
|
208
|
-
return html `
|
|
209
|
-
<fieldset
|
|
210
|
-
id="fieldset"
|
|
211
|
-
class="w-slider"
|
|
212
|
-
@input="${this.#onInput}"
|
|
213
|
-
@slidervalidity="${this.#onSliderValidity}"
|
|
214
|
-
aria-invalid="${this.errorText ? 'true' : nothing}"
|
|
215
|
-
>
|
|
216
|
-
${this.label
|
|
217
|
-
? html `<legend class="w-slider__label">
|
|
218
|
-
<slot id="label" name="label">${this.label}</slot>
|
|
219
|
-
</legend>`
|
|
220
|
-
: nothing}
|
|
221
|
-
<slot class="w-slider__description" name="description"></slot>
|
|
222
|
-
${this.markers ? html `<div class="w-slider__markers"></div>` : nothing}
|
|
223
|
-
<div class="w-slider__range">
|
|
224
|
-
<div class="w-slider__active-range"></div>
|
|
225
|
-
</div>
|
|
226
|
-
<slot
|
|
227
|
-
class="w-slider__slider"
|
|
228
|
-
@slotchange=${this.#syncSliderThumbs}
|
|
229
|
-
></slot>
|
|
230
|
-
<slot
|
|
231
|
-
class="w-slider__slider"
|
|
232
|
-
name="from"
|
|
233
|
-
@slotchange=${this.#syncSliderThumbs}
|
|
234
|
-
></slot>
|
|
235
|
-
<slot
|
|
236
|
-
class="w-slider__slider"
|
|
237
|
-
name="to"
|
|
238
|
-
@slotchange=${this.#syncSliderThumbs}
|
|
239
|
-
></slot>
|
|
240
|
-
${this.errorText
|
|
241
|
-
? html `<p class="w-slider__error" aria-describes="fieldset">
|
|
242
|
-
${this.errorText}
|
|
243
|
-
</p>`
|
|
244
|
-
: this.helpText
|
|
245
|
-
? html `<p class="w-slider__help-text" aria-describes="fieldset">
|
|
246
|
-
${this.helpText}
|
|
247
|
-
</p>`
|
|
248
|
-
: nothing}
|
|
249
|
-
</fieldset>
|
|
250
|
-
`;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
__decorate([
|
|
254
|
-
property({ reflect: true })
|
|
255
|
-
], WarpSlider.prototype, "label", void 0);
|
|
256
|
-
__decorate([
|
|
257
|
-
property({ type: Boolean, reflect: true })
|
|
258
|
-
], WarpSlider.prototype, "disabled", void 0);
|
|
259
|
-
__decorate([
|
|
260
|
-
property({ type: Boolean, attribute: 'allow-values-outside-range' })
|
|
261
|
-
], WarpSlider.prototype, "allowValuesOutsideRange", void 0);
|
|
262
|
-
__decorate([
|
|
263
|
-
property({ type: String, reflect: true })
|
|
264
|
-
], WarpSlider.prototype, "error", void 0);
|
|
265
|
-
__decorate([
|
|
266
|
-
property({ type: String, reflect: true, attribute: 'help-text' })
|
|
267
|
-
], WarpSlider.prototype, "helpText", void 0);
|
|
268
|
-
__decorate([
|
|
269
|
-
property({ type: Boolean, reflect: true })
|
|
270
|
-
], WarpSlider.prototype, "invalid", void 0);
|
|
271
|
-
__decorate([
|
|
272
|
-
property({ type: Boolean, reflect: true })
|
|
273
|
-
], WarpSlider.prototype, "required", void 0);
|
|
274
|
-
__decorate([
|
|
275
|
-
property({ reflect: true })
|
|
276
|
-
], WarpSlider.prototype, "min", void 0);
|
|
277
|
-
__decorate([
|
|
278
|
-
property({ reflect: true })
|
|
279
|
-
], WarpSlider.prototype, "max", void 0);
|
|
280
|
-
__decorate([
|
|
281
|
-
property({ type: Number, reflect: true })
|
|
282
|
-
], WarpSlider.prototype, "markers", void 0);
|
|
283
|
-
__decorate([
|
|
284
|
-
property({ type: Number, reflect: true })
|
|
285
|
-
], WarpSlider.prototype, "step", void 0);
|
|
286
|
-
__decorate([
|
|
287
|
-
property({ reflect: true })
|
|
288
|
-
], WarpSlider.prototype, "suffix", void 0);
|
|
289
|
-
__decorate([
|
|
290
|
-
property({ attribute: false })
|
|
291
|
-
], WarpSlider.prototype, "formatter", void 0);
|
|
292
|
-
__decorate([
|
|
293
|
-
state()
|
|
294
|
-
], WarpSlider.prototype, "_invalidMessage", void 0);
|
|
295
|
-
__decorate([
|
|
296
|
-
state()
|
|
297
|
-
], WarpSlider.prototype, "_hasInternalError", void 0);
|
|
298
|
-
if (!customElements.get('w-slider')) {
|
|
299
|
-
customElements.define('w-slider', WarpSlider);
|
|
300
|
-
}
|
|
301
|
-
export { WarpSlider };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
2
|
-
import { Slider } from './react';
|
|
3
|
-
declare const _default: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: import("@lit/react").ReactWebComponent<import("./slider").WarpSlider, {}>;
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
|
8
|
-
export type Story = StoryObj<typeof Slider>;
|
|
9
|
-
export declare const Single: Story;
|
|
10
|
-
export declare const Range: Story;
|
|
11
|
-
export declare const SuffixSquareMeters: Story;
|
|
12
|
-
export declare const SuffixCurrency: Story;
|
|
13
|
-
export declare const SuffixKilometers: Story;
|
|
14
|
-
export declare const Marks: Story;
|
|
15
|
-
export declare const Step: Story;
|
|
16
|
-
export declare const OverUnder: Story;
|
|
17
|
-
export declare const SingleError: Story;
|
|
18
|
-
export declare const RangeError: Story;
|
|
19
|
-
export declare const TestCase: Story;
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { Slider, SliderThumb } from './react';
|
|
3
|
-
const locale = 'nb';
|
|
4
|
-
const getNumberFormatter = (locale, opts = {}) => {
|
|
5
|
-
return (value) => new Intl.NumberFormat(locale, { maximumFractionDigits: 0, ...opts }).format(value);
|
|
6
|
-
};
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Forms/Slider and Range Slider',
|
|
9
|
-
component: Slider,
|
|
10
|
-
};
|
|
11
|
-
export const Single = {
|
|
12
|
-
render() {
|
|
13
|
-
return (React.createElement(Slider, { label: "Single", min: "0", max: "100" },
|
|
14
|
-
React.createElement(SliderThumb, { name: "value" })));
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export const Range = {
|
|
18
|
-
render() {
|
|
19
|
-
return (React.createElement(Slider, { label: "Range", min: "0", max: "100" },
|
|
20
|
-
React.createElement(SliderThumb, { name: "from", slot: "from", "aria-label": "From value" }),
|
|
21
|
-
React.createElement(SliderThumb, { name: "to", slot: "to", "aria-label": "To value" })));
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
// Take a suffix attribute on `<Slider>` I think, have `<SliderThumb>` get from that.
|
|
25
|
-
export const SuffixSquareMeters = {
|
|
26
|
-
args: {
|
|
27
|
-
suffix: 'm²',
|
|
28
|
-
},
|
|
29
|
-
render({ suffix }) {
|
|
30
|
-
return (React.createElement(Slider, { label: "Apartment size", min: "0", max: "250", suffix: suffix, formatter: getNumberFormatter(locale) },
|
|
31
|
-
React.createElement(SliderThumb, { slot: "from", "aria-label": "From size", name: "from" }),
|
|
32
|
-
React.createElement(SliderThumb, { slot: "to", "aria-label": "To size", name: "to" })));
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
export const SuffixCurrency = {
|
|
36
|
-
args: {
|
|
37
|
-
suffix: 'kr',
|
|
38
|
-
},
|
|
39
|
-
render({ suffix }) {
|
|
40
|
-
return (React.createElement(Slider, { label: "Price", min: "0", max: "250000", suffix: suffix, formatter: getNumberFormatter(locale) },
|
|
41
|
-
React.createElement(SliderThumb, { slot: "from", "aria-label": "From price", name: "from" }),
|
|
42
|
-
React.createElement(SliderThumb, { slot: "to", "aria-label": "To price", name: "to" })));
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
export const SuffixKilometers = {
|
|
46
|
-
args: {
|
|
47
|
-
suffix: 'km',
|
|
48
|
-
},
|
|
49
|
-
render({ suffix }) {
|
|
50
|
-
return (React.createElement(Slider, { label: "Distance", min: "0", max: "250000", suffix: suffix, formatter: getNumberFormatter(locale) },
|
|
51
|
-
React.createElement(SliderThumb, { slot: "from", "aria-label": "From distance", name: "from" }),
|
|
52
|
-
React.createElement(SliderThumb, { slot: "to", "aria-label": "To distance", name: "to" })));
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
export const Marks = {
|
|
56
|
-
args: {
|
|
57
|
-
suffix: 'km',
|
|
58
|
-
},
|
|
59
|
-
render({ suffix }) {
|
|
60
|
-
return (React.createElement(React.Fragment, null,
|
|
61
|
-
React.createElement(Slider, { label: "Single", min: "0", max: "100", markers: 5, step: 5 },
|
|
62
|
-
React.createElement(SliderThumb, { name: "value" }))));
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
export const Step = {
|
|
66
|
-
args: {
|
|
67
|
-
step: 5,
|
|
68
|
-
},
|
|
69
|
-
render({ step }) {
|
|
70
|
-
return (React.createElement(Slider, { label: "Single", step: step, min: "0", max: "100" },
|
|
71
|
-
React.createElement(SliderThumb, { name: "value" })));
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
export const OverUnder = {
|
|
75
|
-
render() {
|
|
76
|
-
const [overUnderFrom, setOverUnderFrom] = useState('');
|
|
77
|
-
const [overUnderTo, setOverUnderTo] = useState('');
|
|
78
|
-
return (React.createElement(React.Fragment, null,
|
|
79
|
-
React.createElement("form", { id: "overunder", style: { marginBottom: 16 }, lang: "nb", onInput: (val) => {
|
|
80
|
-
const formData = new FormData(val.currentTarget);
|
|
81
|
-
setOverUnderFrom(formData.get('from'));
|
|
82
|
-
setOverUnderTo(formData.get('to'));
|
|
83
|
-
} },
|
|
84
|
-
React.createElement(Slider, { label: "Produksjons\u00E5r", min: "1950", max: "2025", "data-testid": "overunder", formatter: (value) => {
|
|
85
|
-
if (value === '1950') {
|
|
86
|
-
return 'Før 1950';
|
|
87
|
-
}
|
|
88
|
-
if (value === '2025') {
|
|
89
|
-
return 'Etter 2025';
|
|
90
|
-
}
|
|
91
|
-
return value;
|
|
92
|
-
} },
|
|
93
|
-
React.createElement(SliderThumb, { slot: "from", "aria-label": "Fra \u00E5r", "aria-description": "1950 inkluderer kj\u00F8ret\u00F8y produsert fram til 1950", name: "from" }),
|
|
94
|
-
React.createElement(SliderThumb, { slot: "to", "aria-label": "Til \u00E5r", "aria-description": "2025 inkluderer kj\u00F8ret\u00F8y produsert etter 2025", name: "to" }))),
|
|
95
|
-
React.createElement("p", null, "Drag the slider to show the value below. See the Code tab for how to format the labels."),
|
|
96
|
-
React.createElement("output", null,
|
|
97
|
-
React.createElement("dl", null,
|
|
98
|
-
React.createElement("dt", null, "From:"),
|
|
99
|
-
React.createElement("dd", { id: "overunder-from" }, overUnderFrom),
|
|
100
|
-
React.createElement("dt", null, "To:"),
|
|
101
|
-
React.createElement("dd", { id: "overunder-to" }, overUnderTo)))));
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
export const SingleError = {
|
|
105
|
-
render() {
|
|
106
|
-
return (React.createElement(Slider, { label: "Single", min: "0", max: "100" },
|
|
107
|
-
React.createElement("p", { slot: "description" }, "Try typing a value over 100"),
|
|
108
|
-
React.createElement(SliderThumb, null)));
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
export const RangeError = {
|
|
112
|
-
render() {
|
|
113
|
-
return (React.createElement(Slider, { label: "Production year", min: "1950", max: "2025" },
|
|
114
|
-
React.createElement("p", { slot: "description" }, "Try typing a from value higher than a to value"),
|
|
115
|
-
React.createElement(SliderThumb, { slot: "from", name: "from" }),
|
|
116
|
-
React.createElement(SliderThumb, { slot: "to", name: "to" })));
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
export const TestCase = {
|
|
120
|
-
render() {
|
|
121
|
-
const [fromValue, setFromValue] = useState('0');
|
|
122
|
-
const [toValue, setToValue] = useState('150000');
|
|
123
|
-
return (React.createElement(React.Fragment, null,
|
|
124
|
-
React.createElement("form", { id: "overunder", style: { marginBottom: 16 }, lang: "nb", onInput: (val) => {
|
|
125
|
-
const formData = new FormData(val.currentTarget);
|
|
126
|
-
setFromValue(formData.get('from'));
|
|
127
|
-
setToValue(formData.get('to'));
|
|
128
|
-
} },
|
|
129
|
-
React.createElement(Slider, { label: "Pris", min: "0", max: "700000" },
|
|
130
|
-
React.createElement(SliderThumb, { slot: "from", "aria-label": "Fra pris", name: "from", value: fromValue }),
|
|
131
|
-
React.createElement(SliderThumb, { slot: "to", "aria-label": "Til pris", "aria-description": "700000 inkluderer prisen derfra og opp", name: "to", value: toValue }))),
|
|
132
|
-
React.createElement("p", null, "Drag the slider to show the value below. See the Code tab for how to format the labels."),
|
|
133
|
-
React.createElement("output", null,
|
|
134
|
-
React.createElement("dl", null,
|
|
135
|
-
React.createElement("dt", null, "From:"),
|
|
136
|
-
React.createElement("dd", null, fromValue),
|
|
137
|
-
React.createElement("dt", null, "To:"),
|
|
138
|
-
React.createElement("dd", null, toValue)))));
|
|
139
|
-
},
|
|
140
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
-
import '../affix/index.js';
|
|
3
|
-
import '../attention/index.js';
|
|
4
|
-
import '../textfield/index.js';
|
|
5
|
-
import './index.js';
|
|
6
|
-
declare const meta: Meta;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj;
|
|
9
|
-
export declare const Single: Story;
|
|
10
|
-
export declare const Range: Story;
|
|
11
|
-
export declare const SuffixSquareMeters: Story;
|
|
12
|
-
export declare const SuffixCurrency: Story;
|
|
13
|
-
export declare const SuffixKilometers: Story;
|
|
14
|
-
export declare const Marks: Story;
|
|
15
|
-
export declare const Step: Story;
|
|
16
|
-
export declare const OverUnder: Story;
|
|
17
|
-
export declare const SingleError: Story;
|
|
18
|
-
export declare const RangeError: Story;
|
|
19
|
-
export declare const TestCase: Story;
|
|
20
|
-
export declare const CustomError: Story;
|
|
21
|
-
export declare const Description: Story;
|