@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,220 +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 { classNames as classnames } from '@chbphone55/classnames';
|
|
9
|
-
import { i18n } from '@lingui/core';
|
|
10
|
-
import { FormControlMixin } from '@open-wc/form-control';
|
|
11
|
-
import { html, LitElement, nothing } from 'lit';
|
|
12
|
-
import { property, state } from 'lit/decorators.js';
|
|
13
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
14
|
-
import { reset } from '../styles.js';
|
|
15
|
-
import { styles } from './styles.js';
|
|
16
|
-
const ccInput = {
|
|
17
|
-
// input classes
|
|
18
|
-
base: 'block text-m leading-m mb-0 px-8 py-12 rounded-4 w-full focusable focus:[--w-outline-offset:-2px] caret-current', // true
|
|
19
|
-
default: 'border-1 s-text s-bg s-border-strong hover:s-border-strong-hover active:s-border-selected', // !isInvalid && !isDisabled && !isReadOnly
|
|
20
|
-
disabled: 'border-1 s-text-disabled s-bg-disabled-subtle s-border-disabled pointer-events-none', // !isInvalid && isDisabled && !isReadOnly
|
|
21
|
-
invalid: 'border-1 s-text-negative s-bg s-border-negative hover:s-border-negative-hover outline-[--w-s-color-border-negative]!', // isInvalid && !isDisabled && !isReadOnly
|
|
22
|
-
readOnly: 'pl-0 bg-transparent pointer-events-none', // !isInvalid && !isDisabled && isReadOnly
|
|
23
|
-
placeholder: 'placeholder:s-text-placeholder',
|
|
24
|
-
suffix: 'pr-40',
|
|
25
|
-
prefix: 'pl-[var(--w-prefix-width,_40px)]',
|
|
26
|
-
// textarea classes
|
|
27
|
-
textArea: 'min-h-[42] sm:min-h-[45]',
|
|
28
|
-
fixed: 'resize-none',
|
|
29
|
-
};
|
|
30
|
-
const ccLabel = {
|
|
31
|
-
base: 'antialiased block relative text-s font-bold pb-4 cursor-pointer s-text flex',
|
|
32
|
-
optional: 'pl-8 font-normal text-s s-text-subtle',
|
|
33
|
-
};
|
|
34
|
-
const ccHelpText = {
|
|
35
|
-
base: 'text-xs mt-4 block',
|
|
36
|
-
color: 's-text-subtle',
|
|
37
|
-
colorInvalid: 's-text-negative',
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* A single line text input element.
|
|
41
|
-
*
|
|
42
|
-
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-textfield--docs)
|
|
43
|
-
*/
|
|
44
|
-
class WarpTextarea extends FormControlMixin(LitElement) {
|
|
45
|
-
constructor() {
|
|
46
|
-
super(...arguments);
|
|
47
|
-
this.minHeight = Number.NEGATIVE_INFINITY;
|
|
48
|
-
this.maxHeight = Number.POSITIVE_INFINITY;
|
|
49
|
-
// capture the initial value using connectedCallback and #initialValue
|
|
50
|
-
this.#initialValue = null;
|
|
51
|
-
}
|
|
52
|
-
static { this.shadowRootOptions = {
|
|
53
|
-
...LitElement.shadowRootOptions,
|
|
54
|
-
delegatesFocus: true,
|
|
55
|
-
}; }
|
|
56
|
-
// capture the initial value using connectedCallback and #initialValue
|
|
57
|
-
#initialValue;
|
|
58
|
-
updated(changedProperties) {
|
|
59
|
-
if (changedProperties.has('value')) {
|
|
60
|
-
this.setValue(this.value);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
resetFormControl() {
|
|
64
|
-
this.value = this.#initialValue;
|
|
65
|
-
}
|
|
66
|
-
static { this.styles = [reset, styles]; }
|
|
67
|
-
/** @internal */
|
|
68
|
-
get _textareaStyles() {
|
|
69
|
-
return classnames([
|
|
70
|
-
ccInput.base,
|
|
71
|
-
ccInput.textArea,
|
|
72
|
-
!!this.placeholder && ccInput.placeholder,
|
|
73
|
-
!this.invalid && !this.disabled && !(this.readonly || this.readOnly) && ccInput.default,
|
|
74
|
-
this.invalid && !this.disabled && !(this.readonly || this.readOnly) && ccInput.invalid,
|
|
75
|
-
!this.invalid && this.disabled && !(this.readonly || this.readOnly) && ccInput.disabled,
|
|
76
|
-
!this.invalid && !this.disabled && (this.readonly || this.readOnly) && ccInput.readOnly,
|
|
77
|
-
this.maxRows && ccInput.fixed,
|
|
78
|
-
]);
|
|
79
|
-
}
|
|
80
|
-
/** @internal */
|
|
81
|
-
get _helptextstyles() {
|
|
82
|
-
return classnames([ccHelpText.base, this.invalid ? ccHelpText.colorInvalid : ccHelpText.color]);
|
|
83
|
-
}
|
|
84
|
-
/** @internal */
|
|
85
|
-
get _helpId() {
|
|
86
|
-
if (this.helpText)
|
|
87
|
-
return `${this._id}__hint`;
|
|
88
|
-
return undefined;
|
|
89
|
-
}
|
|
90
|
-
/** @internal */
|
|
91
|
-
get _id() {
|
|
92
|
-
return 'textfield';
|
|
93
|
-
}
|
|
94
|
-
/** @internal */
|
|
95
|
-
get _error() {
|
|
96
|
-
if (this.invalid && this._helpId)
|
|
97
|
-
return this._helpId;
|
|
98
|
-
return undefined;
|
|
99
|
-
}
|
|
100
|
-
async connectedCallback() {
|
|
101
|
-
super.connectedCallback();
|
|
102
|
-
this.#initialValue = this.value;
|
|
103
|
-
this.setValue(this.value);
|
|
104
|
-
await this.updateComplete;
|
|
105
|
-
if (this.value || this.minRows) {
|
|
106
|
-
// If the component starts with a value or minHeight,
|
|
107
|
-
// resize it automatically to show all the content, or maxHeight.
|
|
108
|
-
this.#resize(this.shadowRoot.querySelector('textarea'));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
handler(e) {
|
|
112
|
-
const target = e.currentTarget;
|
|
113
|
-
this.value = target.value;
|
|
114
|
-
this.#resize(target);
|
|
115
|
-
}
|
|
116
|
-
/** Calculate the new height for the area on input */
|
|
117
|
-
#resize(target) {
|
|
118
|
-
const style = getComputedStyle(target);
|
|
119
|
-
const borderTopWitdh = Number.parseFloat(style.getPropertyValue('border-top-width'));
|
|
120
|
-
const borderBottomWitdh = Number.parseFloat(style.getPropertyValue('border-top-width'));
|
|
121
|
-
const lineHeight = Number.parseFloat(style.getPropertyValue('line-height'));
|
|
122
|
-
const topPadding = Number.parseFloat(style.getPropertyValue('padding-top'));
|
|
123
|
-
const bottomPadding = Number.parseFloat(style.getPropertyValue('padding-bottom'));
|
|
124
|
-
const offset = topPadding + bottomPadding + borderBottomWitdh + borderTopWitdh;
|
|
125
|
-
if (this.minRows) {
|
|
126
|
-
this.minHeight = lineHeight * this.minRows + offset;
|
|
127
|
-
}
|
|
128
|
-
if (this.minRows) {
|
|
129
|
-
this.maxHeight = lineHeight * this.minRows + offset;
|
|
130
|
-
}
|
|
131
|
-
const borderBoxHeight = target.scrollHeight + borderTopWitdh + borderBottomWitdh;
|
|
132
|
-
const height = Math.min(this.maxHeight, Math.max(this.minHeight, borderBoxHeight));
|
|
133
|
-
target.style.setProperty('height', height + 'px');
|
|
134
|
-
}
|
|
135
|
-
render() {
|
|
136
|
-
return html `
|
|
137
|
-
${this.label
|
|
138
|
-
? html `
|
|
139
|
-
<label for="${this._id}" class=${ccLabel.base}>
|
|
140
|
-
${this.label}
|
|
141
|
-
${this.optional
|
|
142
|
-
? html `
|
|
143
|
-
<span class="${ccLabel.optional}">
|
|
144
|
-
${i18n.t({
|
|
145
|
-
id: 'textarea.label.optional',
|
|
146
|
-
message: '(optional)',
|
|
147
|
-
comment: 'Shown behind label when marked as optional',
|
|
148
|
-
})}
|
|
149
|
-
</span>
|
|
150
|
-
`
|
|
151
|
-
: nothing}
|
|
152
|
-
</label>`
|
|
153
|
-
: nothing}
|
|
154
|
-
<textarea
|
|
155
|
-
id="${this._id}"
|
|
156
|
-
class="${this._textareaStyles}"
|
|
157
|
-
name="${ifDefined(this.name)}"
|
|
158
|
-
placeholder="${ifDefined(this.placeholder)}"
|
|
159
|
-
.value="${this.value || ''}"
|
|
160
|
-
aria-describedby="${ifDefined(this._helpId || (this.ariaDescription ? 'aria-description' : undefined))}"
|
|
161
|
-
aria-errormessage="${ifDefined(this._error)}"
|
|
162
|
-
aria-invalid="${ifDefined(this.invalid)}"
|
|
163
|
-
?disabled="${this.disabled}"
|
|
164
|
-
?readonly="${this.readonly || this.readOnly}"
|
|
165
|
-
?required="${this.required}"
|
|
166
|
-
@input="${this.handler}">
|
|
167
|
-
</textarea>
|
|
168
|
-
${this.helpText ? html `<div class="${this._helptextstyles}" id="${this._helpId}">${this.helpText}</div>` : nothing}
|
|
169
|
-
`;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
__decorate([
|
|
173
|
-
property({ type: Boolean, reflect: true })
|
|
174
|
-
], WarpTextarea.prototype, "disabled", void 0);
|
|
175
|
-
__decorate([
|
|
176
|
-
property({ type: Boolean, reflect: true })
|
|
177
|
-
], WarpTextarea.prototype, "invalid", void 0);
|
|
178
|
-
__decorate([
|
|
179
|
-
property({ type: String, reflect: true })
|
|
180
|
-
], WarpTextarea.prototype, "label", void 0);
|
|
181
|
-
__decorate([
|
|
182
|
-
property({ type: String, reflect: true, attribute: 'help-text' })
|
|
183
|
-
], WarpTextarea.prototype, "helpText", void 0);
|
|
184
|
-
__decorate([
|
|
185
|
-
property({ type: Number, reflect: true, attribute: 'maximum-rows' })
|
|
186
|
-
], WarpTextarea.prototype, "maxRows", void 0);
|
|
187
|
-
__decorate([
|
|
188
|
-
property({ type: Number, reflect: true, attribute: 'minimum-rows' })
|
|
189
|
-
], WarpTextarea.prototype, "minRows", void 0);
|
|
190
|
-
__decorate([
|
|
191
|
-
property()
|
|
192
|
-
], WarpTextarea.prototype, "name", void 0);
|
|
193
|
-
__decorate([
|
|
194
|
-
property()
|
|
195
|
-
], WarpTextarea.prototype, "placeholder", void 0);
|
|
196
|
-
__decorate([
|
|
197
|
-
property({ type: Boolean, reflect: true, attribute: 'read-only' })
|
|
198
|
-
], WarpTextarea.prototype, "readOnly", void 0);
|
|
199
|
-
__decorate([
|
|
200
|
-
property({ type: Boolean, reflect: true })
|
|
201
|
-
], WarpTextarea.prototype, "readonly", void 0);
|
|
202
|
-
__decorate([
|
|
203
|
-
property({ type: Boolean, reflect: true })
|
|
204
|
-
], WarpTextarea.prototype, "required", void 0);
|
|
205
|
-
__decorate([
|
|
206
|
-
property({ type: String, reflect: true })
|
|
207
|
-
], WarpTextarea.prototype, "value", void 0);
|
|
208
|
-
__decorate([
|
|
209
|
-
property({ type: Boolean, reflect: true })
|
|
210
|
-
], WarpTextarea.prototype, "optional", void 0);
|
|
211
|
-
__decorate([
|
|
212
|
-
state()
|
|
213
|
-
], WarpTextarea.prototype, "minHeight", void 0);
|
|
214
|
-
__decorate([
|
|
215
|
-
state()
|
|
216
|
-
], WarpTextarea.prototype, "maxHeight", void 0);
|
|
217
|
-
if (!customElements.get('w-textarea')) {
|
|
218
|
-
customElements.define('w-textarea', WarpTextarea);
|
|
219
|
-
}
|
|
220
|
-
export { WarpTextarea };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StoryObj } from '@storybook/react';
|
|
3
|
-
import { Textarea } from './react';
|
|
4
|
-
declare const _default: {
|
|
5
|
-
title: string;
|
|
6
|
-
render(args: Omit<React.HTMLAttributes<import("./textarea").WarpTextarea>, "label" | "onblur" | "onchange" | "onfocus" | "oninput" | "onFocus" | "onBlur" | "onChange" | "onInput" | "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "form" | "disabled" | "name" | "value" | "updated" | "resetFormControl" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "invalid" | "helpText" | "optional" | "readOnly" | "readonly" | "placeholder" | "required" | "_helptextstyles" | "_helpId" | "_id" | "_error" | "handler" | "maxRows" | "minRows" | "minHeight" | "maxHeight" | "_textareaStyles"> & {
|
|
7
|
-
onBlur?: (e: Event) => void;
|
|
8
|
-
onblur?: (e: Event) => void;
|
|
9
|
-
onChange?: (e: Event) => void;
|
|
10
|
-
onchange?: (e: Event) => void;
|
|
11
|
-
onInput?: (e: Event) => void;
|
|
12
|
-
oninput?: (e: Event) => void;
|
|
13
|
-
onFocus?: (e: Event) => void;
|
|
14
|
-
onfocus?: (e: Event) => void;
|
|
15
|
-
} & Partial<Omit<import("./textarea").WarpTextarea, keyof HTMLElement>> & React.RefAttributes<import("./textarea").WarpTextarea>): React.JSX.Element;
|
|
16
|
-
component: import("@lit/react").ReactWebComponent<import("./textarea").WarpTextarea, {
|
|
17
|
-
onBlur: string;
|
|
18
|
-
onblur: string;
|
|
19
|
-
onChange: string;
|
|
20
|
-
onchange: string;
|
|
21
|
-
onInput: string;
|
|
22
|
-
oninput: string;
|
|
23
|
-
onFocus: string;
|
|
24
|
-
onfocus: string;
|
|
25
|
-
}>;
|
|
26
|
-
};
|
|
27
|
-
export default _default;
|
|
28
|
-
export type Story = StoryObj<typeof Textarea>;
|
|
29
|
-
export declare const Default: Story;
|
|
30
|
-
export declare const WithPlaceholder: Story;
|
|
31
|
-
export declare const WithHelpText: Story;
|
|
32
|
-
export declare const Invalid: Story;
|
|
33
|
-
export declare const Disabled: Story;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Textarea } from './react';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Forms/Textarea',
|
|
5
|
-
render(args) {
|
|
6
|
-
return React.createElement(Textarea, { ...args });
|
|
7
|
-
},
|
|
8
|
-
component: Textarea,
|
|
9
|
-
};
|
|
10
|
-
export const Default = {
|
|
11
|
-
args: {
|
|
12
|
-
label: 'Email',
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
export const WithPlaceholder = {
|
|
16
|
-
args: {
|
|
17
|
-
label: 'Email',
|
|
18
|
-
placeholder: 'user@example.com',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
export const WithHelpText = {
|
|
22
|
-
args: {
|
|
23
|
-
label: 'Password',
|
|
24
|
-
helpText: 'Must be at least 8 characters',
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
export const Invalid = {
|
|
28
|
-
args: {
|
|
29
|
-
label: 'Email',
|
|
30
|
-
invalid: true,
|
|
31
|
-
helpText: 'Please enter a valid email address',
|
|
32
|
-
value: 'invalid-email',
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
export const Disabled = {
|
|
36
|
-
args: {
|
|
37
|
-
label: 'Email',
|
|
38
|
-
disabled: true,
|
|
39
|
-
value: 'user@example.com',
|
|
40
|
-
},
|
|
41
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
-
import type { WarpTextarea } from './index.js';
|
|
3
|
-
import './index.js';
|
|
4
|
-
declare const args: Partial<WarpTextarea> & {
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
};
|
|
7
|
-
declare const meta: Meta<typeof args>;
|
|
8
|
-
export default meta;
|
|
9
|
-
type Story = StoryObj<typeof args>;
|
|
10
|
-
export declare const Default: Story;
|
|
11
|
-
export declare const WithPlaceholder: Story;
|
|
12
|
-
export declare const WithHelpText: Story;
|
|
13
|
-
export declare const NoVisualLabel: Story;
|
|
14
|
-
export declare const Invalid: Story;
|
|
15
|
-
export declare const Disabled: Story;
|
|
16
|
-
export declare const ReadOnly: Story;
|
|
17
|
-
export declare const Optional: Story;
|
|
18
|
-
export declare const ControlledSize: Story;
|
|
19
|
-
export declare const Autofocus: Story;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { spread } from '@open-wc/lit-helpers';
|
|
2
|
-
import { getStorybookHelpers } from '@wc-toolkit/storybook-helpers';
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
import { prespread } from '../../.storybook/utilities.js';
|
|
5
|
-
import './index.js';
|
|
6
|
-
const { events, args, argTypes } = getStorybookHelpers('w-textarea');
|
|
7
|
-
const meta = {
|
|
8
|
-
title: 'Forms/Textarea',
|
|
9
|
-
render(args) {
|
|
10
|
-
return html `<w-textarea ${spread(prespread(args))}></w-textarea>`;
|
|
11
|
-
},
|
|
12
|
-
args,
|
|
13
|
-
argTypes,
|
|
14
|
-
parameters: {
|
|
15
|
-
actions: {
|
|
16
|
-
handles: events,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
export default meta;
|
|
21
|
-
export const Default = {
|
|
22
|
-
args: {
|
|
23
|
-
label: 'Description',
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
export const WithPlaceholder = {
|
|
27
|
-
args: {
|
|
28
|
-
label: 'Description',
|
|
29
|
-
placeholder: 'A Link to the Past is a distant prequel to the original The Legend of Zelda',
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
export const WithHelpText = {
|
|
33
|
-
args: {
|
|
34
|
-
label: 'Description',
|
|
35
|
-
'help-text': 'You can provide a help text if necessary',
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
export const NoVisualLabel = {
|
|
39
|
-
args: {
|
|
40
|
-
'aria-label': 'Description',
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
export const Invalid = {
|
|
44
|
-
args: {
|
|
45
|
-
label: 'Description',
|
|
46
|
-
invalid: true,
|
|
47
|
-
'help-text': 'A description is required',
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
export const Disabled = {
|
|
51
|
-
args: {
|
|
52
|
-
label: 'Description',
|
|
53
|
-
disabled: true,
|
|
54
|
-
value: 'A Link to the Past is a distant prequel to the original The Legend of Zelda, and, within the official chronology, is the first game in the "Defeated Hero" timeline that connects to an alternate reality scenario where the Hero of Time does not succeed in Ocarina of Time.',
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
export const ReadOnly = {
|
|
58
|
-
args: {
|
|
59
|
-
label: 'Description',
|
|
60
|
-
'read-only': true,
|
|
61
|
-
value: 'A Link to the Past is a distant prequel to the original The Legend of Zelda, and, within the official chronology, is the first game in the "Defeated Hero" timeline that connects to an alternate reality scenario where the Hero of Time does not succeed in Ocarina of Time.',
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
export const Optional = {
|
|
65
|
-
args: {
|
|
66
|
-
label: 'Description',
|
|
67
|
-
optional: true,
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
export const ControlledSize = {
|
|
71
|
-
args: {
|
|
72
|
-
label: 'Description',
|
|
73
|
-
'minimum-rows': 3,
|
|
74
|
-
'maximum-rows': 3,
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
export const Autofocus = {
|
|
78
|
-
args: {
|
|
79
|
-
label: 'Description',
|
|
80
|
-
'minimum-rows': 3,
|
|
81
|
-
'maximum-rows': 3,
|
|
82
|
-
placeholder: 'Refresh to see the autofocus take effect',
|
|
83
|
-
autofocus: true,
|
|
84
|
-
},
|
|
85
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.js';
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { userEvent } from '@vitest/browser/context';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import { expect, test, vi } from 'vitest';
|
|
4
|
-
import { render } from 'vitest-browser-lit';
|
|
5
|
-
import './index.js';
|
|
6
|
-
test('renders the textarea', async () => {
|
|
7
|
-
const component = html `<w-textarea label="Test label"></w-textarea>`;
|
|
8
|
-
const page = render(component);
|
|
9
|
-
await expect.element(page.getByText('Test label')).toBeVisible();
|
|
10
|
-
});
|
|
11
|
-
test('works as expected in forms', async () => {
|
|
12
|
-
const label = 'Test label';
|
|
13
|
-
const component = html `
|
|
14
|
-
<form data-testid="form">
|
|
15
|
-
<w-textarea label="${label}" name="message" value="Hola el Mundo"></w-textarea>
|
|
16
|
-
</form>
|
|
17
|
-
`;
|
|
18
|
-
const page = render(component);
|
|
19
|
-
await expect.element(page.getByLabelText(label)).toHaveValue('Hola el Mundo');
|
|
20
|
-
let formData = new FormData(page.getByTestId('form').element());
|
|
21
|
-
expect(formData.get('message')).toBe('Hola el Mundo');
|
|
22
|
-
const inputHandler = vi.fn();
|
|
23
|
-
const changeHandler = vi.fn();
|
|
24
|
-
page.getByLabelText(label).element().addEventListener('input', inputHandler);
|
|
25
|
-
page.getByLabelText(label).element().addEventListener('change', changeHandler);
|
|
26
|
-
await page.getByLabelText(label).fill('Hello, World');
|
|
27
|
-
expect(inputHandler).toHaveBeenCalled();
|
|
28
|
-
expect(changeHandler).not.toHaveBeenCalled();
|
|
29
|
-
await userEvent.tab(); // trigger a blur to fire the change event
|
|
30
|
-
expect(changeHandler).toHaveBeenCalled();
|
|
31
|
-
await expect.element(page.getByLabelText(label)).toHaveValue('Hello, World');
|
|
32
|
-
formData = new FormData(page.getByTestId('form').element());
|
|
33
|
-
expect(formData.get('message')).toBe('Hello, World');
|
|
34
|
-
});
|
|
35
|
-
test('renders help text if provided', async () => {
|
|
36
|
-
const component = html `<w-textarea label="Test label" help-text="Helpful help text"></w-textarea>`;
|
|
37
|
-
const page = render(component);
|
|
38
|
-
await expect.element(page.getByText('Helpful help text')).toBeVisible();
|
|
39
|
-
});
|
|
40
|
-
test('marks input field as aria-invalid if the invalid prop is true', async () => {
|
|
41
|
-
const component = html `<w-textarea label="Test label" invalid help-text="No, bad input!"></w-textarea>`;
|
|
42
|
-
const page = render(component);
|
|
43
|
-
await expect.element(page.getByLabelText('Test label')).toHaveAccessibleErrorMessage('No, bad input!');
|
|
44
|
-
});
|
|
45
|
-
test('marks input field as readonly if the readonly prop is true', async () => {
|
|
46
|
-
const component = html `<w-textarea label="Test label" readonly></w-textarea>`;
|
|
47
|
-
const page = render(component);
|
|
48
|
-
await expect.element(page.getByLabelText('Test label')).toHaveAttribute('readonly', '');
|
|
49
|
-
});
|
|
50
|
-
test('can reset textarea by resetting surrounding form', async () => {
|
|
51
|
-
render(html `
|
|
52
|
-
<form>
|
|
53
|
-
<w-textarea name="message" value="Hola el Mundo"></w-textarea>
|
|
54
|
-
</form>
|
|
55
|
-
`);
|
|
56
|
-
const form = document.querySelector('form');
|
|
57
|
-
const wTextArea = document.querySelector('w-textarea');
|
|
58
|
-
// sanity
|
|
59
|
-
expect(form).not.toBeNull();
|
|
60
|
-
expect(wTextArea).not.toBeNull();
|
|
61
|
-
expect(wTextArea.value).toBe('Hola el Mundo');
|
|
62
|
-
wTextArea.value = 'Definitely not Hola el Mundo';
|
|
63
|
-
await wTextArea.updateComplete;
|
|
64
|
-
// Reset the form
|
|
65
|
-
form.reset();
|
|
66
|
-
await wTextArea.updateComplete;
|
|
67
|
-
expect(wTextArea.value).toBe('Hola el Mundo');
|
|
68
|
-
});
|