@warp-ds/elements 2.2.0-next.2 → 2.2.0-next.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +228 -28
- package/dist/.storybook/utilities.d.ts +28 -0
- package/dist/.storybook/utilities.js +52 -0
- package/dist/api.js +1 -49
- package/dist/api.js.map +4 -4
- package/dist/custom-elements.json +7146 -0
- package/dist/index.d.ts +1847 -18
- package/dist/packages/affix/affix.react.stories.d.ts +9 -0
- package/dist/packages/affix/affix.react.stories.js +10 -0
- package/dist/packages/affix/affix.stories.d.ts +10 -0
- package/dist/packages/affix/affix.stories.js +25 -0
- package/dist/packages/affix/affix.test.d.ts +1 -0
- package/dist/packages/affix/affix.test.js +9 -0
- package/dist/packages/affix/index.d.ts +47 -24
- package/dist/packages/affix/index.js +2448 -2240
- package/dist/packages/affix/index.js.map +4 -4
- package/dist/packages/affix/react.d.ts +2 -0
- package/dist/packages/affix/react.js +15 -0
- package/dist/packages/affix/styles.d.ts +1 -0
- package/dist/packages/affix/styles.js +2 -0
- package/dist/packages/alert/alert.react.stories.d.ts +13 -0
- package/dist/packages/alert/alert.react.stories.js +44 -0
- package/dist/packages/alert/alert.stories.d.ts +15 -0
- package/dist/packages/alert/alert.stories.js +68 -0
- package/dist/packages/alert/alert.test.d.ts +1 -0
- package/dist/packages/alert/alert.test.js +18 -0
- package/dist/packages/alert/index.d.ts +21 -16
- package/dist/packages/alert/index.js +2452 -2446
- package/dist/packages/alert/index.js.map +4 -4
- package/dist/packages/alert/react.d.ts +2 -0
- package/dist/packages/alert/react.js +11 -0
- package/dist/packages/alert/styles.d.ts +1 -0
- package/dist/packages/alert/styles.js +2 -0
- package/dist/packages/attention/attention.react.stories.d.ts +15 -0
- package/dist/packages/attention/attention.react.stories.js +92 -0
- package/dist/packages/attention/attention.stories.d.ts +15 -0
- package/dist/packages/attention/attention.stories.js +173 -0
- package/dist/packages/attention/attention.test.d.ts +1 -0
- package/dist/packages/attention/attention.test.js +11 -0
- package/dist/packages/attention/index.d.ts +62 -89
- package/dist/packages/attention/index.js +3521 -3924
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/attention/layout-styles.d.ts +1 -0
- package/dist/packages/attention/layout-styles.js +905 -0
- package/dist/packages/attention/locales/da/messages.mjs +1 -0
- package/dist/packages/attention/locales/en/messages.mjs +1 -0
- package/dist/packages/attention/locales/fi/messages.mjs +1 -0
- package/dist/packages/attention/locales/nb/messages.mjs +1 -0
- package/dist/packages/attention/locales/sv/messages.mjs +1 -0
- package/dist/packages/attention/react.d.ts +15 -0
- package/dist/packages/attention/react.js +17 -0
- package/dist/packages/attention/styles.d.ts +1 -0
- package/dist/packages/attention/styles.js +2 -0
- package/dist/packages/badge/badge.react.stories.d.ts +18 -0
- package/dist/packages/badge/badge.react.stories.js +60 -0
- package/dist/packages/badge/badge.stories.d.ts +17 -0
- package/dist/packages/badge/badge.stories.js +68 -0
- package/dist/packages/badge/badge.test.d.ts +1 -0
- package/dist/packages/badge/badge.test.js +9 -0
- package/dist/packages/badge/index.d.ts +12 -11
- package/dist/packages/badge/index.js +2441 -300
- package/dist/packages/badge/index.js.map +4 -4
- package/dist/packages/badge/react.d.ts +2 -0
- package/dist/packages/badge/react.js +11 -0
- package/dist/packages/badge/styles.d.ts +1 -0
- package/dist/packages/badge/styles.js +2 -0
- package/dist/packages/box/box.react.stories.d.ts +15 -0
- package/dist/packages/box/box.react.stories.js +45 -0
- package/dist/packages/box/box.stories.d.ts +14 -0
- package/dist/packages/box/box.stories.js +59 -0
- package/dist/packages/box/box.test.d.ts +1 -0
- package/dist/packages/box/box.test.js +9 -0
- package/dist/packages/box/index.d.ts +17 -20
- package/dist/packages/box/index.js +2443 -299
- package/dist/packages/box/index.js.map +4 -4
- package/dist/packages/box/react.d.ts +2 -0
- package/dist/packages/box/react.js +11 -0
- package/dist/packages/box/slot.test.d.ts +1 -0
- package/dist/packages/box/slot.test.js +9 -0
- package/dist/packages/box/styles.d.ts +1 -0
- package/dist/packages/box/styles.js +2 -0
- package/dist/packages/breadcrumbs/breadcrumbs.react.stories.d.ts +13 -0
- package/dist/packages/breadcrumbs/breadcrumbs.react.stories.js +40 -0
- package/dist/packages/breadcrumbs/breadcrumbs.stories.d.ts +12 -0
- package/dist/packages/breadcrumbs/breadcrumbs.stories.js +60 -0
- package/dist/packages/breadcrumbs/breadcrumbs.test.d.ts +1 -0
- package/dist/packages/breadcrumbs/breadcrumbs.test.js +16 -0
- package/dist/packages/breadcrumbs/index.d.ts +19 -16
- package/dist/packages/breadcrumbs/index.js +2402 -2051
- package/dist/packages/breadcrumbs/index.js.map +4 -4
- package/dist/packages/breadcrumbs/locales/da/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/locales/en/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/locales/fi/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/locales/nb/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/locales/sv/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/react.d.ts +2 -0
- package/dist/packages/breadcrumbs/react.js +11 -0
- package/dist/packages/breadcrumbs/styles.d.ts +1 -0
- package/dist/packages/breadcrumbs/styles.js +2 -0
- package/dist/packages/button/button.react.stories.d.ts +22 -0
- package/dist/packages/button/button.react.stories.js +102 -0
- package/dist/packages/button/button.stories.d.ts +21 -0
- package/dist/packages/button/button.stories.js +119 -0
- package/dist/packages/button/button.test.d.ts +1 -0
- package/dist/packages/button/button.test.js +25 -0
- package/dist/packages/button/index.d.ts +106 -56
- package/dist/packages/button/index.js +2618 -2130
- package/dist/packages/button/index.js.map +4 -4
- package/dist/packages/button/locales/da/messages.mjs +1 -0
- package/dist/packages/button/locales/en/messages.mjs +1 -0
- package/dist/packages/button/locales/fi/messages.mjs +1 -0
- package/dist/packages/button/locales/nb/messages.mjs +1 -0
- package/dist/packages/button/locales/sv/messages.mjs +1 -0
- package/dist/packages/button/react.d.ts +2 -0
- package/dist/packages/button/react.js +11 -0
- package/dist/packages/button/styles.d.ts +1 -0
- package/dist/packages/button/styles.js +2 -0
- package/dist/packages/card/card.react.stories.d.ts +16 -0
- package/dist/packages/card/card.react.stories.js +63 -0
- package/dist/packages/card/card.stories.d.ts +15 -0
- package/dist/packages/card/card.stories.js +82 -0
- package/dist/packages/card/card.test.d.ts +1 -0
- package/dist/packages/card/card.test.js +9 -0
- package/dist/packages/card/index.d.ts +27 -15
- package/dist/packages/card/index.js +2403 -2067
- package/dist/packages/card/index.js.map +4 -4
- package/dist/packages/card/locales/da/messages.mjs +1 -0
- package/dist/packages/card/locales/en/messages.mjs +1 -0
- package/dist/packages/card/locales/fi/messages.mjs +1 -0
- package/dist/packages/card/locales/nb/messages.mjs +1 -0
- package/dist/packages/card/locales/sv/messages.mjs +1 -0
- package/dist/packages/card/react.d.ts +2 -0
- package/dist/packages/card/react.js +11 -0
- package/dist/packages/card/styles.d.ts +1 -0
- package/dist/packages/card/styles.js +2 -0
- package/dist/packages/combobox/combobox.react.stories.d.ts +28 -0
- package/dist/packages/combobox/combobox.react.stories.js +90 -0
- package/dist/packages/combobox/combobox.stories.d.ts +18 -0
- package/dist/packages/combobox/combobox.stories.js +117 -0
- package/dist/packages/combobox/index.d.ts +95 -0
- package/dist/packages/combobox/index.js +2492 -0
- package/dist/packages/combobox/index.js.map +7 -0
- package/dist/packages/combobox/locales/da/messages.d.mts +1 -0
- package/dist/packages/combobox/locales/da/messages.mjs +1 -0
- package/dist/packages/combobox/locales/en/messages.d.mts +1 -0
- package/dist/packages/combobox/locales/en/messages.mjs +1 -0
- package/dist/packages/combobox/locales/fi/messages.d.mts +1 -0
- package/dist/packages/combobox/locales/fi/messages.mjs +1 -0
- package/dist/packages/combobox/locales/nb/messages.d.mts +1 -0
- package/dist/packages/combobox/locales/nb/messages.mjs +1 -0
- package/dist/packages/combobox/locales/sv/messages.d.mts +1 -0
- package/dist/packages/combobox/locales/sv/messages.mjs +1 -0
- package/dist/packages/combobox/react.d.ts +7 -0
- package/dist/packages/combobox/react.js +17 -0
- package/dist/packages/combobox/styles.d.ts +1 -0
- package/dist/packages/combobox/styles.js +2 -0
- package/dist/packages/datepicker/DatePicker.test.d.ts +2 -0
- package/dist/packages/datepicker/DatePicker.test.js +69 -0
- package/dist/packages/datepicker/datepicker.d.ts +102 -0
- package/dist/packages/datepicker/datepicker.js +2785 -0
- package/dist/packages/datepicker/datepicker.js.map +7 -0
- package/dist/packages/datepicker/datepicker.react.stories.d.ts +18 -0
- package/dist/packages/datepicker/datepicker.react.stories.js +26 -0
- package/dist/packages/datepicker/datepicker.stories.d.ts +12 -0
- package/dist/packages/datepicker/datepicker.stories.js +51 -0
- package/dist/packages/datepicker/datepicker.test.d.ts +2 -0
- package/dist/packages/datepicker/datepicker.test.js +62 -0
- package/dist/packages/datepicker/index.d.ts +1 -0
- package/dist/packages/datepicker/index.js +2785 -0
- package/dist/packages/datepicker/index.js.map +7 -0
- package/dist/packages/datepicker/locales/da/messages.d.mts +1 -0
- package/dist/packages/datepicker/locales/da/messages.mjs +1 -0
- package/dist/packages/datepicker/locales/en/messages.d.mts +1 -0
- package/dist/packages/datepicker/locales/en/messages.mjs +1 -0
- package/dist/packages/datepicker/locales/fi/messages.d.mts +1 -0
- package/dist/packages/datepicker/locales/fi/messages.mjs +1 -0
- package/dist/packages/datepicker/locales/nb/messages.d.mts +1 -0
- package/dist/packages/datepicker/locales/nb/messages.mjs +1 -0
- package/dist/packages/datepicker/locales/sv/messages.d.mts +1 -0
- package/dist/packages/datepicker/locales/sv/messages.mjs +1 -0
- package/dist/packages/datepicker/react.d.ts +5 -0
- package/dist/packages/datepicker/react.js +15 -0
- package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.d.ts +1 -0
- package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.js +15 -0
- package/dist/packages/datepicker/styles/w-datepicker-day.styles.d.ts +1 -0
- package/dist/packages/datepicker/styles/w-datepicker-day.styles.js +64 -0
- package/dist/packages/datepicker/styles/w-datepicker-month.styles.d.ts +1 -0
- package/dist/packages/datepicker/styles/w-datepicker-month.styles.js +72 -0
- package/dist/packages/datepicker/styles/w-datepicker.styles.d.ts +1 -0
- package/dist/packages/datepicker/styles/w-datepicker.styles.js +101 -0
- package/dist/packages/datepicker/utils.d.ts +13 -0
- package/dist/packages/datepicker/utils.js +28 -0
- package/dist/packages/dead-toggle/dead-toggle.react.stories.d.ts +15 -0
- package/dist/packages/dead-toggle/dead-toggle.react.stories.js +34 -0
- package/dist/packages/dead-toggle/dead-toggle.stories.d.ts +14 -0
- package/dist/packages/dead-toggle/dead-toggle.stories.js +45 -0
- package/dist/packages/dead-toggle/dead-toggle.test.d.ts +1 -0
- package/dist/packages/dead-toggle/dead-toggle.test.js +9 -0
- package/dist/packages/dead-toggle/index.d.ts +16 -0
- package/dist/packages/dead-toggle/index.js +2487 -0
- package/dist/packages/dead-toggle/index.js.map +7 -0
- package/dist/packages/dead-toggle/react.d.ts +2 -0
- package/dist/packages/dead-toggle/react.js +11 -0
- package/dist/packages/expandable/expandable.react.stories.d.ts +18 -0
- package/dist/packages/expandable/expandable.react.stories.js +103 -0
- package/dist/packages/expandable/expandable.stories.d.ts +19 -0
- package/dist/packages/expandable/expandable.stories.js +133 -0
- package/dist/packages/expandable/expandable.test.d.ts +1 -0
- package/dist/packages/expandable/expandable.test.js +24 -0
- package/dist/packages/expandable/index.d.ts +52 -50
- package/dist/packages/expandable/index.js +2424 -2286
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/expandable/react.d.ts +2 -0
- package/dist/packages/expandable/react.js +11 -0
- package/dist/packages/expandable/styles.d.ts +1 -0
- package/dist/packages/expandable/styles.js +2 -0
- package/dist/packages/i18n.js +45 -0
- package/dist/packages/link/index.d.ts +34 -0
- package/dist/packages/link/index.js +2646 -0
- package/dist/packages/link/index.js.map +7 -0
- package/dist/packages/link/link.react.stories.d.ts +21 -0
- package/dist/packages/link/link.react.stories.js +96 -0
- package/dist/packages/link/link.stories.d.ts +20 -0
- package/dist/packages/link/link.stories.js +110 -0
- package/dist/packages/link/link.test.d.ts +1 -0
- package/dist/packages/link/link.test.js +9 -0
- package/dist/packages/link/react.d.ts +2 -0
- package/dist/packages/link/react.js +11 -0
- package/dist/packages/link/styles.d.ts +1 -0
- package/dist/packages/link/styles.js +200 -0
- package/dist/packages/modal/index.d.ts +4 -5
- package/dist/packages/modal/index.js +2649 -2575
- package/dist/packages/modal/index.js.map +4 -4
- package/dist/packages/modal/locales/da/messages.mjs +1 -0
- package/dist/packages/modal/locales/en/messages.mjs +1 -0
- package/dist/packages/modal/locales/fi/messages.mjs +1 -0
- package/dist/packages/modal/locales/nb/messages.mjs +1 -0
- package/dist/packages/modal/locales/sv/messages.mjs +1 -0
- package/dist/packages/modal/modal-footer.d.ts +13 -11
- package/dist/packages/modal/modal-footer.js +2460 -0
- package/dist/packages/modal/modal-footer.js.map +7 -0
- package/dist/packages/modal/modal-header.d.ts +25 -31
- package/dist/packages/modal/modal-header.js +2584 -0
- package/dist/packages/modal/modal-header.js.map +7 -0
- package/dist/packages/modal/modal-main.d.ts +27 -31
- package/dist/packages/modal/modal-main.js +2572 -0
- package/dist/packages/modal/modal-main.js.map +7 -0
- package/dist/packages/modal/modal.react.stories.d.ts +14 -0
- package/dist/packages/modal/modal.react.stories.js +27 -0
- package/dist/packages/modal/modal.stories.d.ts +19 -0
- package/dist/packages/modal/modal.stories.js +160 -0
- package/dist/packages/modal/react.d.ts +12 -0
- package/dist/packages/modal/react.js +31 -0
- package/dist/packages/modal/util.d.ts +7 -17
- package/dist/packages/modal/util.js +21 -0
- package/dist/packages/pageindicator/index.d.ts +10 -0
- package/dist/packages/pageindicator/index.js +32 -0
- package/dist/packages/pageindicator/index.js.map +7 -0
- package/dist/packages/pageindicator/pageindicator.react.stories.d.ts +19 -0
- package/dist/packages/pageindicator/pageindicator.react.stories.js +20 -0
- package/dist/packages/pageindicator/pageindicator.stories.d.ts +32 -0
- package/dist/packages/pageindicator/pageindicator.stories.js +71 -0
- package/dist/packages/pageindicator/react.d.ts +2 -0
- package/dist/packages/pageindicator/react.js +11 -0
- package/dist/packages/pageindicator/style.d.ts +1 -0
- package/dist/packages/pageindicator/style.js +26 -0
- package/dist/packages/pagination/index.d.ts +32 -0
- package/dist/packages/pagination/index.js +2500 -0
- package/dist/packages/pagination/index.js.map +7 -0
- package/dist/packages/pagination/locales/da/messages.d.mts +1 -0
- package/dist/packages/pagination/locales/da/messages.mjs +1 -0
- package/dist/packages/pagination/locales/en/messages.d.mts +1 -0
- package/dist/packages/pagination/locales/en/messages.mjs +1 -0
- package/dist/packages/pagination/locales/fi/messages.d.mts +1 -0
- package/dist/packages/pagination/locales/fi/messages.mjs +1 -0
- package/dist/packages/pagination/locales/nb/messages.d.mts +1 -0
- package/dist/packages/pagination/locales/nb/messages.mjs +1 -0
- package/dist/packages/pagination/locales/sv/messages.d.mts +1 -0
- package/dist/packages/pagination/locales/sv/messages.mjs +1 -0
- package/dist/packages/pagination/pagination.react.stories.d.ts +21 -0
- package/dist/packages/pagination/pagination.react.stories.js +45 -0
- package/dist/packages/pagination/pagination.stories.d.ts +14 -0
- package/dist/packages/pagination/pagination.stories.js +56 -0
- package/dist/packages/pagination/pagination.test.d.ts +1 -0
- package/dist/packages/pagination/pagination.test.js +76 -0
- package/dist/packages/pagination/react.d.ts +5 -0
- package/dist/packages/pagination/react.js +15 -0
- package/dist/packages/pagination/styles.d.ts +1 -0
- package/dist/packages/pagination/styles.js +2 -0
- package/dist/packages/pill/index.d.ts +39 -23
- package/dist/packages/pill/index.js +2408 -2175
- package/dist/packages/pill/index.js.map +4 -4
- package/dist/packages/pill/locales/da/messages.mjs +1 -0
- package/dist/packages/pill/locales/en/messages.mjs +1 -0
- package/dist/packages/pill/locales/fi/messages.mjs +1 -0
- package/dist/packages/pill/locales/nb/messages.mjs +1 -0
- package/dist/packages/pill/locales/sv/messages.mjs +1 -0
- package/dist/packages/pill/pill.react.stories.d.ts +23 -0
- package/dist/packages/pill/pill.react.stories.js +22 -0
- package/dist/packages/pill/pill.stories.d.ts +12 -0
- package/dist/packages/pill/pill.stories.js +33 -0
- package/dist/packages/pill/pill.test.d.ts +1 -0
- package/dist/packages/pill/pill.test.js +25 -0
- package/dist/packages/pill/react.d.ts +7 -0
- package/dist/packages/pill/react.js +17 -0
- package/dist/packages/pill/styles.d.ts +1 -0
- package/dist/packages/pill/styles.js +2 -0
- package/dist/packages/rip-and-tear-checkbox/checkbox.d.ts +64 -0
- package/dist/packages/rip-and-tear-checkbox/checkbox.js +160 -0
- package/dist/packages/rip-and-tear-checkbox/checkbox.js.map +7 -0
- package/dist/packages/rip-and-tear-checkbox/checkbox.stories.d.ts +8 -0
- package/dist/packages/rip-and-tear-checkbox/checkbox.stories.js +11 -0
- package/dist/packages/rip-and-tear-checkbox/index.d.ts +1 -0
- package/dist/packages/rip-and-tear-checkbox/index.js +160 -0
- package/dist/packages/rip-and-tear-checkbox/index.js.map +7 -0
- package/dist/packages/rip-and-tear-checkbox/react.d.ts +5 -0
- package/dist/packages/rip-and-tear-checkbox/react.js +15 -0
- package/dist/packages/rip-and-tear-checkbox/rip-and-tear-checkbox.react.stories.d.ts +12 -0
- package/dist/packages/rip-and-tear-checkbox/rip-and-tear-checkbox.react.stories.js +10 -0
- package/dist/packages/rip-and-tear-checkbox/styles.d.ts +1 -0
- package/dist/packages/rip-and-tear-checkbox/styles.js +116 -0
- package/dist/packages/rip-and-tear-radio/base-element.d.ts +46 -0
- package/dist/packages/rip-and-tear-radio/base-element.js +100 -0
- package/dist/packages/rip-and-tear-radio/custom-error-validator.d.ts +6 -0
- package/dist/packages/rip-and-tear-radio/custom-error-validator.js +22 -0
- package/dist/packages/rip-and-tear-radio/form-associated-element.d.ts +103 -0
- package/dist/packages/rip-and-tear-radio/form-associated-element.js +282 -0
- package/dist/packages/rip-and-tear-radio/host-styles.d.ts +1 -0
- package/dist/packages/rip-and-tear-radio/host-styles.js +12 -0
- package/dist/packages/rip-and-tear-radio/index.d.ts +1 -0
- package/dist/packages/rip-and-tear-radio/index.js +270 -0
- package/dist/packages/rip-and-tear-radio/index.js.map +7 -0
- package/dist/packages/rip-and-tear-radio/invalid.d.ts +8 -0
- package/dist/packages/rip-and-tear-radio/invalid.js +5 -0
- package/dist/packages/rip-and-tear-radio/math.d.ts +1 -0
- package/dist/packages/rip-and-tear-radio/math.js +4 -0
- package/dist/packages/rip-and-tear-radio/radio-group-styles.d.ts +1 -0
- package/dist/packages/rip-and-tear-radio/radio-group-styles.js +60 -0
- package/dist/packages/rip-and-tear-radio/radio-group-styles.js.map +7 -0
- package/dist/packages/rip-and-tear-radio/radio-group.d.ts +72 -0
- package/dist/packages/rip-and-tear-radio/radio-group.js +270 -0
- package/dist/packages/rip-and-tear-radio/radio-group.js.map +7 -0
- package/dist/packages/rip-and-tear-radio/radio-styles.d.ts +1 -0
- package/dist/packages/rip-and-tear-radio/radio-styles.js +170 -0
- package/dist/packages/rip-and-tear-radio/radio-styles.js.map +7 -0
- package/dist/packages/rip-and-tear-radio/radio.d.ts +38 -0
- package/dist/packages/rip-and-tear-radio/radio.js +183 -0
- package/dist/packages/rip-and-tear-radio/radio.js.map +7 -0
- package/dist/packages/rip-and-tear-radio/radio.stories.d.ts +8 -0
- package/dist/packages/rip-and-tear-radio/radio.stories.js +275 -0
- package/dist/packages/rip-and-tear-radio/radio.stories.js.map +7 -0
- package/dist/packages/rip-and-tear-radio/react.d.ts +9 -0
- package/dist/packages/rip-and-tear-radio/react.js +22 -0
- package/dist/packages/rip-and-tear-radio/required-validator.d.ts +11 -0
- package/dist/packages/rip-and-tear-radio/required-validator.js +34 -0
- package/dist/packages/rip-and-tear-radio/rip-and-tear-radio.react.stories.d.ts +9 -0
- package/dist/packages/rip-and-tear-radio/rip-and-tear-radio.react.stories.js +10 -0
- package/dist/packages/rip-and-tear-radio/slot.d.ts +20 -0
- package/dist/packages/rip-and-tear-radio/slot.js +71 -0
- package/dist/packages/rip-and-tear-radio/watch.d.ts +26 -0
- package/dist/packages/rip-and-tear-radio/watch.js +39 -0
- package/dist/packages/select/index.d.ts +56 -50
- package/dist/packages/select/index.js +2421 -2236
- package/dist/packages/select/index.js.map +4 -4
- package/dist/packages/select/locales/da/messages.mjs +1 -0
- package/dist/packages/select/locales/en/messages.mjs +1 -0
- package/dist/packages/select/locales/fi/messages.mjs +1 -0
- package/dist/packages/select/locales/nb/messages.mjs +1 -0
- package/dist/packages/select/locales/sv/messages.mjs +1 -0
- package/dist/packages/select/react.d.ts +6 -0
- package/dist/packages/select/react.js +20 -0
- package/dist/packages/select/select.react.stories.d.ts +18 -0
- package/dist/packages/select/select.react.stories.js +28 -0
- package/dist/packages/select/select.stories.d.ts +10 -0
- package/dist/packages/select/select.stories.js +31 -0
- package/dist/packages/select/select.test.d.ts +1 -0
- package/dist/packages/select/select.test.js +31 -0
- package/dist/packages/select/styles.d.ts +1 -0
- package/dist/packages/select/styles.js +2 -0
- package/dist/packages/slider/Slider.d.ts +2 -0
- package/dist/packages/slider/Slider.js +8 -0
- package/dist/packages/slider/SliderThumb.d.ts +2 -0
- package/dist/packages/slider/SliderThumb.js +8 -0
- package/dist/packages/slider/index.d.ts +2 -0
- package/dist/packages/slider/index.js +2791 -0
- package/dist/packages/slider/index.js.map +7 -0
- package/dist/packages/slider/oddbird-css-anchor-positioning.d.ts +2 -0
- package/dist/packages/slider/oddbird-css-anchor-positioning.js +3 -0
- package/dist/packages/slider/react.d.ts +8 -0
- package/dist/packages/slider/react.js +20 -0
- package/dist/packages/slider/slider-thumb.d.ts +57 -0
- package/dist/packages/slider/slider-thumb.js +2663 -0
- package/dist/packages/slider/slider-thumb.js.map +7 -0
- package/dist/packages/slider/slider.d.ts +46 -0
- package/dist/packages/slider/slider.js +2569 -0
- package/dist/packages/slider/slider.js.map +7 -0
- package/dist/packages/slider/slider.react.stories.d.ts +18 -0
- package/dist/packages/slider/slider.react.stories.js +119 -0
- package/dist/packages/slider/slider.stories.d.ts +17 -0
- package/dist/packages/slider/slider.stories.js +203 -0
- package/dist/packages/slider/slider.test.d.ts +4 -0
- package/dist/packages/slider/slider.test.js +83 -0
- package/dist/packages/slider/styles/w-slider-thumb.styles.d.ts +1 -0
- package/dist/packages/slider/styles/w-slider-thumb.styles.js +132 -0
- package/dist/packages/slider/styles/w-slider.styles.d.ts +1 -0
- package/dist/packages/slider/styles/w-slider.styles.js +118 -0
- package/dist/packages/slider/styles.d.ts +1 -0
- package/dist/packages/slider/styles.js +2 -0
- package/dist/packages/steps/index.d.ts +36 -0
- package/dist/packages/steps/index.js +2465 -0
- package/dist/packages/steps/index.js.map +7 -0
- package/dist/packages/steps/locales/da/messages.d.mts +1 -0
- package/dist/packages/steps/locales/da/messages.mjs +1 -0
- package/dist/packages/steps/locales/en/messages.d.mts +1 -0
- package/dist/packages/steps/locales/en/messages.mjs +1 -0
- package/dist/packages/steps/locales/fi/messages.d.mts +1 -0
- package/dist/packages/steps/locales/fi/messages.mjs +1 -0
- package/dist/packages/steps/locales/nb/messages.d.mts +1 -0
- package/dist/packages/steps/locales/nb/messages.mjs +1 -0
- package/dist/packages/steps/locales/sv/messages.d.mts +1 -0
- package/dist/packages/steps/locales/sv/messages.mjs +1 -0
- package/dist/packages/steps/react.d.ts +3 -0
- package/dist/packages/steps/react.js +16 -0
- package/dist/packages/steps/steps.react.stories.d.ts +15 -0
- package/dist/packages/steps/steps.react.stories.js +112 -0
- package/dist/packages/steps/steps.stories.d.ts +12 -0
- package/dist/packages/steps/steps.stories.js +172 -0
- package/dist/packages/steps/styles.d.ts +1 -0
- package/dist/packages/steps/styles.js +2 -0
- package/dist/packages/styles.d.ts +2 -0
- package/dist/packages/styles.js +2442 -0
- package/dist/packages/switch/index.d.ts +15 -0
- package/dist/packages/switch/index.js +2455 -0
- package/dist/packages/switch/index.js.map +7 -0
- package/dist/packages/switch/react.d.ts +5 -0
- package/dist/packages/switch/react.js +15 -0
- package/dist/packages/switch/styles.d.ts +1 -0
- package/dist/packages/switch/styles.js +2 -0
- package/dist/packages/switch/switch.react.stories.d.ts +15 -0
- package/dist/packages/switch/switch.react.stories.js +29 -0
- package/dist/packages/switch/switch.stories.d.ts +9 -0
- package/dist/packages/switch/switch.stories.js +34 -0
- package/dist/packages/tabs/index.d.ts +4 -0
- package/dist/packages/tabs/index.js +2470 -0
- package/dist/packages/tabs/index.js.map +7 -0
- package/dist/packages/tabs/react.d.ts +12 -0
- package/dist/packages/tabs/react.js +31 -0
- package/dist/packages/tabs/styles.d.ts +1 -0
- package/dist/packages/tabs/styles.js +2 -0
- package/dist/packages/tabs/tab-panel.d.ts +20 -0
- package/dist/packages/tabs/tab-panel.js +2441 -0
- package/dist/packages/tabs/tab-panel.js.map +7 -0
- package/dist/packages/tabs/tab.d.ts +18 -0
- package/dist/packages/tabs/tab.js +2463 -0
- package/dist/packages/tabs/tab.js.map +7 -0
- package/dist/packages/tabs/tabs.d.ts +40 -0
- package/dist/packages/tabs/tabs.js +2448 -0
- package/dist/packages/tabs/tabs.js.map +7 -0
- package/dist/packages/tabs/tabs.react.stories.d.ts +15 -0
- package/dist/packages/tabs/tabs.react.stories.js +51 -0
- package/dist/packages/tabs/tabs.stories.d.ts +8 -0
- package/dist/packages/tabs/tabs.stories.js +2545 -0
- package/dist/packages/tabs/tabs.stories.js.map +7 -0
- package/dist/packages/textfield/index.d.ts +78 -74
- package/dist/packages/textfield/index.js +2514 -422
- package/dist/packages/textfield/index.js.map +4 -4
- package/dist/packages/textfield/react.d.ts +11 -0
- package/dist/packages/textfield/react.js +21 -0
- package/dist/packages/textfield/styles/w-textfield.styles.d.ts +1 -0
- package/dist/packages/textfield/styles/w-textfield.styles.js +46 -0
- package/dist/packages/textfield/styles.d.ts +1 -0
- package/dist/packages/textfield/styles.js +2 -0
- package/dist/packages/textfield/textfield.react.stories.d.ts +37 -0
- package/dist/packages/textfield/textfield.react.stories.js +88 -0
- package/dist/packages/textfield/textfield.stories.d.ts +18 -0
- package/dist/packages/textfield/textfield.stories.js +105 -0
- package/dist/packages/textfield/textfield.test.d.ts +2 -0
- package/dist/packages/textfield/textfield.test.js +68 -0
- package/dist/packages/toast/api.d.ts +4 -45
- package/dist/packages/toast/api.js +41 -0
- package/dist/packages/toast/index.d.ts +3 -0
- package/dist/packages/toast/index.js +2466 -2787
- package/dist/packages/toast/index.js.map +4 -4
- package/dist/packages/toast/locales/da/messages.mjs +1 -0
- package/dist/packages/toast/locales/en/messages.mjs +1 -0
- package/dist/packages/toast/locales/fi/messages.mjs +1 -0
- package/dist/packages/toast/locales/nb/messages.mjs +1 -0
- package/dist/packages/toast/locales/sv/messages.mjs +1 -0
- package/dist/packages/toast/styles.d.ts +1 -0
- package/dist/packages/toast/styles.js +2 -0
- package/dist/packages/toast/toast-container.d.ts +12 -63
- package/dist/packages/toast/toast-container.js +2458 -0
- package/dist/packages/toast/toast-container.js.map +7 -0
- package/dist/packages/toast/toast.d.ts +34 -29
- package/dist/packages/toast/toast.js +2466 -0
- package/dist/packages/toast/toast.js.map +7 -0
- package/dist/packages/toast/toast.stories.d.ts +12 -0
- package/dist/packages/toast/toast.stories.js +50 -0
- package/dist/packages/toast/types.d.ts +15 -0
- package/dist/packages/toast/types.js +1 -0
- package/dist/packages/utils/expand-transition.d.ts +3 -2
- package/dist/packages/utils/expand-transition.js +59 -0
- package/dist/packages/utils/index.d.ts +1 -1
- package/dist/packages/utils/index.js +2 -0
- package/dist/packages/utils/index.js.map +7 -0
- package/dist/packages/utils/unstyled-heading.d.ts +3 -3
- package/dist/packages/utils/unstyled-heading.js +22 -0
- package/dist/packages/utils/window-exists.js +1 -0
- package/dist/setup-tests.d.ts +1 -0
- package/dist/setup-tests.js +1 -0
- package/dist/vscode.css-custom-data.json +6 -0
- package/dist/vscode.html-custom-data.json +738 -0
- package/dist/web-types.json +1693 -0
- package/package.json +93 -37
- package/dist/index.js +0 -6838
- package/dist/index.js.map +0 -7
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { getStorybookHelpers } from '@wc-toolkit/storybook-helpers';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import '../affix/index.js';
|
|
4
|
+
import '../textfield/index.js';
|
|
5
|
+
import './index.js';
|
|
6
|
+
const { events: sliderEvents, args: sliderArgs, argTypes: sliderArgTypes, } = getStorybookHelpers('w-slider');
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Forms/Slider and Range Slider',
|
|
9
|
+
args: sliderArgs,
|
|
10
|
+
argTypes: sliderArgTypes,
|
|
11
|
+
parameters: {
|
|
12
|
+
actions: {
|
|
13
|
+
handles: sliderEvents,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
export const Single = {
|
|
19
|
+
render() {
|
|
20
|
+
return html `
|
|
21
|
+
<w-slider label="Single" min="0" max="100">
|
|
22
|
+
<w-slider-thumb name="value"></w-slider-thumb>
|
|
23
|
+
</w-slider>
|
|
24
|
+
`;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export const Range = {
|
|
28
|
+
render() {
|
|
29
|
+
return html `
|
|
30
|
+
<w-slider label="Range" min="0" max="100">
|
|
31
|
+
<w-slider-thumb slot="from" aria-label="From value" name="from"></w-slider-thumb>
|
|
32
|
+
<w-slider-thumb slot="to" aria-label="To value" name="to"></w-slider-thumb>
|
|
33
|
+
</w-slider>
|
|
34
|
+
`;
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
// Take a suffix attribute on `<w-slider>` I think, have `<w-slider-thumb>` get from that.
|
|
38
|
+
export const SuffixSquareMeters = {
|
|
39
|
+
args: {
|
|
40
|
+
locale: 'nb',
|
|
41
|
+
suffix: 'm²',
|
|
42
|
+
},
|
|
43
|
+
render({ locale, suffix }) {
|
|
44
|
+
return html `
|
|
45
|
+
<w-slider label="Apartment size" min="0" max="250" suffix="${suffix}" data-testid="sqm">
|
|
46
|
+
<w-slider-thumb slot="from" aria-label="From size" name="from"></w-slider-thumb>
|
|
47
|
+
<w-slider-thumb slot="to" aria-label="To size" name="to"></w-slider-thumb>
|
|
48
|
+
</w-slider>
|
|
49
|
+
<script type="module">
|
|
50
|
+
const sqmSlider = document.querySelector('w-slider[data-testid="sqm"]');
|
|
51
|
+
sqmSlider.formatter = window.getNumberFormatter('${locale}').format;
|
|
52
|
+
</script>
|
|
53
|
+
`;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
export const SuffixCurrency = {
|
|
57
|
+
args: {
|
|
58
|
+
locale: 'nb',
|
|
59
|
+
suffix: 'kr',
|
|
60
|
+
},
|
|
61
|
+
render({ locale, suffix }) {
|
|
62
|
+
return html `
|
|
63
|
+
<w-slider label="Price" min="0" max="250000" suffix="${suffix}" data-testid="currency">
|
|
64
|
+
<w-slider-thumb slot="from" aria-label="From price" name="from"></w-slider-thumb>
|
|
65
|
+
<w-slider-thumb slot="to" aria-label="To price" name="to"></w-slider-thumb>
|
|
66
|
+
</w-slider>
|
|
67
|
+
<script type="module">
|
|
68
|
+
const currencySlider = document.querySelector('w-slider[data-testid="currency"]');
|
|
69
|
+
currencySlider.formatter = window.getNumberFormatter('${locale}').format;
|
|
70
|
+
</script>
|
|
71
|
+
`;
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
export const SuffixKilometers = {
|
|
75
|
+
args: {
|
|
76
|
+
locale: 'nb',
|
|
77
|
+
suffix: 'km',
|
|
78
|
+
},
|
|
79
|
+
render({ locale, suffix }) {
|
|
80
|
+
return html `
|
|
81
|
+
<w-slider label="Distance" min="0" max="250000" suffix="${suffix}" data-testid="km">
|
|
82
|
+
<w-slider-thumb slot="from" aria-label="From distance" name="from"></w-slider-thumb>
|
|
83
|
+
<w-slider-thumb slot="to" aria-label="To distance" name="to"></w-slider-thumb>
|
|
84
|
+
</w-slider>
|
|
85
|
+
<script type="module">
|
|
86
|
+
const kmSlider = document.querySelector('w-slider[data-testid="km"]');
|
|
87
|
+
kmSlider.formatter = window.getNumberFormatter('${locale}').format;
|
|
88
|
+
</script>
|
|
89
|
+
`;
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
export const Marks = {
|
|
93
|
+
args: {
|
|
94
|
+
locale: 'nb',
|
|
95
|
+
suffix: 'km',
|
|
96
|
+
step: '25000',
|
|
97
|
+
markers: '25000',
|
|
98
|
+
},
|
|
99
|
+
render({ locale, suffix, markers, step }) {
|
|
100
|
+
return html `
|
|
101
|
+
<w-slider label="Distance" markers="${markers}" step="${step}" min="0" max="250000" suffix="${suffix}" data-testid="markers">
|
|
102
|
+
<w-slider-thumb slot="from" aria-label="From distance" name="from"></w-slider-thumb>
|
|
103
|
+
<w-slider-thumb slot="to" aria-label="To distance" name="to"></w-slider-thumb>
|
|
104
|
+
</w-slider>
|
|
105
|
+
|
|
106
|
+
<script type="module">
|
|
107
|
+
const markersSlider = document.querySelector('w-slider[data-testid="markers"]');
|
|
108
|
+
markersSlider.formatter = window.getNumberFormatter('${locale}').format;
|
|
109
|
+
</script>
|
|
110
|
+
`;
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
export const Step = {
|
|
114
|
+
args: {
|
|
115
|
+
step: 5,
|
|
116
|
+
},
|
|
117
|
+
render({ step }) {
|
|
118
|
+
return html `
|
|
119
|
+
<w-slider label="Single" step="${step}" min="0" max="100">
|
|
120
|
+
<w-slider-thumb name="value"></w-slider-thumb>
|
|
121
|
+
</w-slider>
|
|
122
|
+
`;
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
export const OverUnder = {
|
|
126
|
+
args: {},
|
|
127
|
+
render() {
|
|
128
|
+
return html `
|
|
129
|
+
<form id="overunder" style="margin-bottom: 16px" lang="nb">
|
|
130
|
+
<w-slider label="Produksjonsår" min="1950" max="2025" data-testid="overunder">
|
|
131
|
+
<w-slider-thumb
|
|
132
|
+
slot="from"
|
|
133
|
+
aria-label="Fra år"
|
|
134
|
+
aria-description="1950 inkluderer kjøretøy produsert fram til 1950"
|
|
135
|
+
name="from"></w-slider-thumb>
|
|
136
|
+
<w-slider-thumb
|
|
137
|
+
slot="to"
|
|
138
|
+
aria-label="Til år"
|
|
139
|
+
aria-description="2025 inkluderer kjøretøy produsert etter 2025"
|
|
140
|
+
name="to"></w-slider-thumb>
|
|
141
|
+
</w-slider>
|
|
142
|
+
</form>
|
|
143
|
+
<p>Drag the slider to show the value below. See the Code tab for how to format the labels.</p>
|
|
144
|
+
<output>
|
|
145
|
+
<dl>
|
|
146
|
+
<dt>From:</dt>
|
|
147
|
+
<dd id="overunder-from"></dd>
|
|
148
|
+
<dt>To:</dt>
|
|
149
|
+
<dd id="overunder-to"></dd>
|
|
150
|
+
</dl>
|
|
151
|
+
</output>
|
|
152
|
+
<script>
|
|
153
|
+
/** Here is how you can show labels to indicate min and max values are "up to and including" and "this value and above". */
|
|
154
|
+
const overunderSlider = document.querySelector('w-slider[data-testid="overunder"]');
|
|
155
|
+
overunderSlider.formatter = function (value) {
|
|
156
|
+
if (value === '1950') {
|
|
157
|
+
return 'Før 1950';
|
|
158
|
+
}
|
|
159
|
+
if (value === '2025') {
|
|
160
|
+
return 'Etter 2025';
|
|
161
|
+
}
|
|
162
|
+
return value;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/** Code to show the form values in output */
|
|
166
|
+
document.forms['overunder'].addEventListener('input', function () {
|
|
167
|
+
const formData = new FormData(this);
|
|
168
|
+
const from = formData.get('from');
|
|
169
|
+
const to = formData.get('to');
|
|
170
|
+
document.getElementById('overunder-from').innerText = from;
|
|
171
|
+
document.getElementById('overunder-to').innerText = to;
|
|
172
|
+
});
|
|
173
|
+
</script>
|
|
174
|
+
`;
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
export const SingleError = {
|
|
178
|
+
args: {
|
|
179
|
+
locale: 'nb',
|
|
180
|
+
},
|
|
181
|
+
render() {
|
|
182
|
+
return html `
|
|
183
|
+
<w-slider label="Single" min="0" max="100">
|
|
184
|
+
<p slot="description">Try typing a value over 100</p>
|
|
185
|
+
<w-slider-thumb></w-slider-thumb>
|
|
186
|
+
</w-slider>
|
|
187
|
+
`;
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
export const RangeError = {
|
|
191
|
+
args: {
|
|
192
|
+
locale: 'nb',
|
|
193
|
+
},
|
|
194
|
+
render() {
|
|
195
|
+
return html `
|
|
196
|
+
<w-slider label="Production year" min="1950" max="2025" over under>
|
|
197
|
+
<p slot="description">Try typing a from value higher than a to value</p>
|
|
198
|
+
<w-slider-thumb slot="from" name="from"></w-slider-thumb>
|
|
199
|
+
<w-slider-thumb slot="to" name="to"></w-slider-thumb>
|
|
200
|
+
</w-slider>
|
|
201
|
+
`;
|
|
202
|
+
},
|
|
203
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { userEvent } from '@vitest/browser/context';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { expect, test } from 'vitest';
|
|
4
|
+
import { render } from 'vitest-browser-lit';
|
|
5
|
+
import '../attention/index.js';
|
|
6
|
+
import '../affix/index.js';
|
|
7
|
+
import '../textfield/index.js';
|
|
8
|
+
import './index.js';
|
|
9
|
+
test('single slider starts with a default value equal to max', async () => {
|
|
10
|
+
const component = html `
|
|
11
|
+
<form data-testid="form">
|
|
12
|
+
<w-slider label="Single" min="0" max="100">
|
|
13
|
+
<w-slider-thumb name="value"></w-slider-thumb>
|
|
14
|
+
</w-slider>
|
|
15
|
+
</form>
|
|
16
|
+
`;
|
|
17
|
+
const page = render(component);
|
|
18
|
+
await expect.element(page.getByLabelText('Single').first()).toHaveValue('100');
|
|
19
|
+
});
|
|
20
|
+
test('range slider starts with a default from value equal to min, and to value equal to max', async () => {
|
|
21
|
+
const component = html `
|
|
22
|
+
<form data-testid="form">
|
|
23
|
+
<w-slider label="Range" min="0" max="100">
|
|
24
|
+
<w-slider-thumb aria-label="From" name="rangefrom" slot="from"></w-slider-thumb>
|
|
25
|
+
<w-slider-thumb aria-label="To" name="rangeto" slot="to"></w-slider-thumb>
|
|
26
|
+
</w-slider>
|
|
27
|
+
</form>
|
|
28
|
+
`;
|
|
29
|
+
const page = render(component);
|
|
30
|
+
await expect.element(page.getByLabelText('From').first()).toHaveValue('0');
|
|
31
|
+
await expect.element(page.getByLabelText('To').first()).toHaveValue('100');
|
|
32
|
+
});
|
|
33
|
+
test('can set slider value via the range input', async () => {
|
|
34
|
+
const component = html `
|
|
35
|
+
<form data-testid="form">
|
|
36
|
+
<w-slider label="Single" min="0" max="100">
|
|
37
|
+
<w-slider-thumb name="value"></w-slider-thumb>
|
|
38
|
+
</w-slider>
|
|
39
|
+
</form>
|
|
40
|
+
`;
|
|
41
|
+
const page = render(component);
|
|
42
|
+
await userEvent.type(page.getByLabelText('Single').first(), '{ArrowLeft}{ArrowLeft}{ArrowLeft}');
|
|
43
|
+
await expect.element(page.getByLabelText('Single').first()).toHaveValue('97');
|
|
44
|
+
await expect.element(page.getByRole('spinbutton')).toHaveValue(97); // keeps value in sync between inputs
|
|
45
|
+
const formData = new FormData(page.getByTestId('form').element());
|
|
46
|
+
expect(formData.get('value')).toBe('97');
|
|
47
|
+
});
|
|
48
|
+
test('can set slider value via the number input', async () => {
|
|
49
|
+
const component = html `
|
|
50
|
+
<form data-testid="form">
|
|
51
|
+
<w-slider label="Single" min="0" max="100">
|
|
52
|
+
<w-slider-thumb name="value"></w-slider-thumb>
|
|
53
|
+
</w-slider>
|
|
54
|
+
</form>
|
|
55
|
+
`;
|
|
56
|
+
const page = render(component);
|
|
57
|
+
await page.getByRole('spinbutton').fill('50');
|
|
58
|
+
await expect.element(page.getByRole('spinbutton')).toHaveValue(50);
|
|
59
|
+
await expect.element(page.getByLabelText('Single').first()).toHaveValue('50'); // keeps value in sync between inputs
|
|
60
|
+
const formData = new FormData(page.getByTestId('form').element());
|
|
61
|
+
expect(formData.get('value')).toBe('50');
|
|
62
|
+
});
|
|
63
|
+
test('deleting from number input works as expected', async () => {
|
|
64
|
+
const component = html `
|
|
65
|
+
<form data-testid="form">
|
|
66
|
+
<w-slider label="Production year" min="1950" max="2025" over under>
|
|
67
|
+
<p slot="description">Try typing a from value higher than a to value</p>
|
|
68
|
+
<w-slider-thumb slot="from" name="from"></w-slider-thumb>
|
|
69
|
+
<w-slider-thumb slot="to" name="to"></w-slider-thumb>
|
|
70
|
+
</w-slider>
|
|
71
|
+
</form>
|
|
72
|
+
`;
|
|
73
|
+
const page = render(component);
|
|
74
|
+
await expect.element(page.getByRole('spinbutton').last()).toHaveValue(2025);
|
|
75
|
+
await userEvent.type(page.getByRole('spinbutton').last(), '{Backspace}');
|
|
76
|
+
await expect.element(page.getByRole('spinbutton').last()).toHaveValue(202);
|
|
77
|
+
await userEvent.type(page.getByRole('spinbutton').last(), '{Backspace}');
|
|
78
|
+
await expect.element(page.getByRole('spinbutton').last()).toHaveValue(20);
|
|
79
|
+
await userEvent.type(page.getByRole('spinbutton').last(), '{Backspace}');
|
|
80
|
+
await expect.element(page.getByRole('spinbutton').last()).toHaveValue(2);
|
|
81
|
+
await userEvent.type(page.getByRole('spinbutton').last(), '{Backspace}');
|
|
82
|
+
await expect.element(page.getByRole('spinbutton').last()).not.toHaveValue();
|
|
83
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const wSliderThumbStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
/* For some reason the pseudoselectors for webkit and moz must be separate blocks :shrug: */
|
|
3
|
+
export const wSliderThumbStyles = css `
|
|
4
|
+
.w-slider-thumb {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: grid;
|
|
7
|
+
pointer-events: none; /* For range inputs we position two of these on top of each other. Let clicks go through the top one. */
|
|
8
|
+
grid-template-areas:
|
|
9
|
+
'slider slider slider'
|
|
10
|
+
'frommarker . tomarker'
|
|
11
|
+
'fromtextfield . totextfield';
|
|
12
|
+
grid-template-columns: 1fr 24px 1fr;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.w-slider-thumb__range {
|
|
16
|
+
appearance: none;
|
|
17
|
+
background-color: transparent;
|
|
18
|
+
grid-area: slider;
|
|
19
|
+
height: 44px; /* touch target */
|
|
20
|
+
pointer-events: none; /* let clicks pass through for range slider where we place two inputs over each other */
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.w-slider-thumb__range::-webkit-slider-runnable-track {
|
|
24
|
+
box-shadow: none;
|
|
25
|
+
color: var(--w-s-color-text);
|
|
26
|
+
height: var(--w-slider-track-height);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.w-slider-thumb__range:hover::-webkit-slider-thumb {
|
|
30
|
+
background: var(--w-s-color-background-primary-hover);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.w-slider-thumb__range:hover::-moz-range-thumb {
|
|
34
|
+
background: var(--w-s-color-background-primary-hover);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
Use anchor positioning to place the tooltip target in relation to the slider thumb.
|
|
39
|
+
We use a polyfill to bring support to older Safari, Firefox at time of writing.
|
|
40
|
+
*/
|
|
41
|
+
.w-slider-thumb__range::-webkit-slider-thumb {
|
|
42
|
+
anchor-name: --thumb;
|
|
43
|
+
|
|
44
|
+
appearance: none;
|
|
45
|
+
background: var(--w-s-color-background-primary);
|
|
46
|
+
border-radius: 50%;
|
|
47
|
+
height: var(--w-slider-thumb-size);
|
|
48
|
+
margin-top: calc(-1 * calc(var(--w-slider-thumb-offset) - calc(var(--w-slider-track-height) / 2)));
|
|
49
|
+
pointer-events: auto;
|
|
50
|
+
width: var(--w-slider-thumb-size);
|
|
51
|
+
z-index: 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.w-slider-thumb__range::-moz-range-thumb {
|
|
55
|
+
anchor-name: --thumb;
|
|
56
|
+
|
|
57
|
+
appearance: none;
|
|
58
|
+
background: var(--w-s-color-background-primary);
|
|
59
|
+
border-radius: 50%;
|
|
60
|
+
border-color: transparent;
|
|
61
|
+
height: var(--w-slider-thumb-size);
|
|
62
|
+
margin-top: calc(-1 * calc(var(--w-slider-thumb-offset) - calc(var(--w-slider-track-height) / 2)));
|
|
63
|
+
pointer-events: initial;
|
|
64
|
+
width: var(--w-slider-thumb-size);
|
|
65
|
+
z-index: 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.w-slider-thumb__tooltip {
|
|
69
|
+
display: none;
|
|
70
|
+
position: absolute;
|
|
71
|
+
|
|
72
|
+
background-color: var(--w-s-color-background-inverted);
|
|
73
|
+
color: var(--w-s-color-text-inverted-static);
|
|
74
|
+
border-color: var(--w-s-color-background-inverted);
|
|
75
|
+
|
|
76
|
+
padding: 4px 8px;
|
|
77
|
+
border-radius: 4px;
|
|
78
|
+
font-size: 12px;
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
z-index: 1;
|
|
81
|
+
|
|
82
|
+
position-anchor: --thumb;
|
|
83
|
+
|
|
84
|
+
bottom: calc(anchor(top) + 5px);
|
|
85
|
+
justify-self: anchor-center;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.w-slider-thumb__tooltip--visible {
|
|
89
|
+
display: block;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.w-slider-thumb__from-marker,
|
|
93
|
+
.w-slider-thumb__to-marker {
|
|
94
|
+
margin-inline: 2px; /* visual alignment with input border, slider thumb */
|
|
95
|
+
color: var(--w-s-color-text-subtle);
|
|
96
|
+
font-size: var(--w-font-size-s);
|
|
97
|
+
line-height: var(--w-line-height-s);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.w-slider-thumb__from-marker {
|
|
101
|
+
grid-area: frommarker;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.w-slider-thumb__to-marker {
|
|
105
|
+
grid-area: tomarker;
|
|
106
|
+
text-align: right;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.w-slider-thumb__textfield {
|
|
110
|
+
margin-top: 10px;
|
|
111
|
+
pointer-events: auto;
|
|
112
|
+
grid-row: 3 / 4;
|
|
113
|
+
grid-column: 1 / 3; /* Single sliders should have the text field use the fromtextfield _and_ gap portion of the CSS grid. */
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host([name='from']) .w-slider-thumb__textfield {
|
|
117
|
+
grid-column: 1 / 2; /* Range sliders should leave the gap empty. */
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:host([name='from']) .w-slider-thumb__range::-webkit-slider-thumb {
|
|
121
|
+
margin-left: calc(-1px * var(--thumb-offset) / 2);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host([name='to']) .w-slider-thumb__textfield {
|
|
125
|
+
grid-row: 3 / 4;
|
|
126
|
+
grid-column: 3 / 4;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:host([name='to']) .w-slider-thumb__range::-webkit-slider-thumb {
|
|
130
|
+
margin-left: calc(1px * var(--thumb-offset) / 2);
|
|
131
|
+
}
|
|
132
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const wSliderStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const wSliderStyles = css `
|
|
3
|
+
.w-slider {
|
|
4
|
+
position: relative;
|
|
5
|
+
border: none;
|
|
6
|
+
padding: 0;
|
|
7
|
+
margin: 0;
|
|
8
|
+
display: grid;
|
|
9
|
+
width: 100%;
|
|
10
|
+
grid-template-areas:
|
|
11
|
+
'label'
|
|
12
|
+
'description'
|
|
13
|
+
'slider';
|
|
14
|
+
grid-template-columns: 1fr;
|
|
15
|
+
|
|
16
|
+
--w-slider-track-background: var(--w-s-color-background-disabled-subtle);
|
|
17
|
+
--w-slider-track-active-background: var(--w-s-color-background-primary);
|
|
18
|
+
--w-slider-track-height: 4px;
|
|
19
|
+
--w-slider-track-active-height: 6px;
|
|
20
|
+
--w-slider-thumb-background: var(--w-s-color-background-primary);
|
|
21
|
+
--w-slider-thumb-background-hover: var(--w-s-color-background-primary-hover);
|
|
22
|
+
--w-slider-thumb-size: 28px;
|
|
23
|
+
--w-slider-thumb-offset: calc(var(--w-slider-thumb-size) / 2);
|
|
24
|
+
--w-slider-marker-color: var(--w-s-color-border);
|
|
25
|
+
|
|
26
|
+
/* Math corner to calculate the fill of the slider and placement of markers. */
|
|
27
|
+
|
|
28
|
+
/* The --min value can be non-zero, f. ex. choosing a year from 1950 to 2025. Normalize the values so we start at 0 and run to max - min. */
|
|
29
|
+
--_value-range: calc(var(--max) - var(--min));
|
|
30
|
+
--_from-in-range: max(calc(var(--from) - var(--min)), 0);
|
|
31
|
+
|
|
32
|
+
/* limit to maximum value in range so typing a value larger than max doesn't explode layouts */
|
|
33
|
+
--_to-in-range: min(calc(var(--to) - var(--min)), var(--_value-range));
|
|
34
|
+
|
|
35
|
+
/* Position the starting point of the fill in the case of a non-zero --from value in a range slider.
|
|
36
|
+
* In other words, given a width of 100% how many percent should be left unfilled/blank
|
|
37
|
+
* at the beginning of the range slider (dashes in this ASCII-range-slider: |---O******O|) */
|
|
38
|
+
--_from-as-percent-of-max: calc(var(--_from-in-range) / var(--_value-range) * 100);
|
|
39
|
+
--_blank-values-before: var(--_from-as-percent-of-max);
|
|
40
|
+
|
|
41
|
+
/* Set the width of the fill as a percentage.
|
|
42
|
+
* In other words, given a width of 100% how many percent should be left unfilled/blank
|
|
43
|
+
* at the end of the slider (dashes in this ASCII-slider: |******O---|) */
|
|
44
|
+
--_to-as-percent-of-max: calc(var(--_to-in-range) / var(--_value-range) * 100);
|
|
45
|
+
--_filled-values: calc(var(--_to-as-percent-of-max) - var(--_blank-values-before));
|
|
46
|
+
|
|
47
|
+
/* Vertical position of range and markers */
|
|
48
|
+
--_range-top: calc(
|
|
49
|
+
var(--w-slider-thumb-size) / 2 + calc(var(--w-slider-track-active-height) - calc(var(--w-slider-track-height) / 2) + 1px)
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.w-slider__label {
|
|
54
|
+
grid-area: label;
|
|
55
|
+
font-size: var(--w-font-size-s);
|
|
56
|
+
line-height: var(--w-line-height-s);
|
|
57
|
+
font-weight: bold;
|
|
58
|
+
padding-bottom: 8px;
|
|
59
|
+
color: var(--w-s-color-text);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.w-slider__description {
|
|
63
|
+
grid-area: description;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.w-slider__active-range {
|
|
67
|
+
align-self: center;
|
|
68
|
+
background: var(--w-slider-track-background);
|
|
69
|
+
border-radius: 4px;
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: var(--_range-top);
|
|
72
|
+
left: 0;
|
|
73
|
+
right: 0;
|
|
74
|
+
grid-area: slider;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.w-slider__markers {
|
|
78
|
+
--_marker-height: 7px;
|
|
79
|
+
--_marker-width: 1px;
|
|
80
|
+
|
|
81
|
+
align-self: center;
|
|
82
|
+
|
|
83
|
+
/* Creates a linear gradient with --_marker-width wide markers
|
|
84
|
+
followed by enough transparent that we can repeat the gradient
|
|
85
|
+
along the X axis and have markers visible where we want them. */
|
|
86
|
+
background: linear-gradient(to right, var(--w-slider-marker-color) var(--_marker-width), rgba(0, 0, 0, 0) 1px) repeat-x;
|
|
87
|
+
--_step-width-as-percent: calc(var(--markers) / var(--_value-range) * 100);
|
|
88
|
+
background-size: calc(var(--_step-width-as-percent) * 1% - 0.1%) var(--_marker-height);
|
|
89
|
+
|
|
90
|
+
background-position: bottom 0 left 8px right 8px;
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: calc(var(--_range-top) + 2px);
|
|
93
|
+
left: 1px;
|
|
94
|
+
right: 1px;
|
|
95
|
+
grid-area: slider;
|
|
96
|
+
height: var(--_marker-height);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.w-slider__active-range::before {
|
|
100
|
+
background: var(--w-slider-track-active-background);
|
|
101
|
+
border-radius: 4px;
|
|
102
|
+
content: '';
|
|
103
|
+
display: block;
|
|
104
|
+
height: var(--w-slider-track-active-height);
|
|
105
|
+
|
|
106
|
+
margin-left: calc(var(--_blank-values-before) * 1%);
|
|
107
|
+
width: calc(var(--_filled-values) * 1%);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
slot::slotted(w-slider-thumb) {
|
|
111
|
+
position: static;
|
|
112
|
+
top: 0;
|
|
113
|
+
left: 0;
|
|
114
|
+
right: 0;
|
|
115
|
+
bottom: 0;
|
|
116
|
+
grid-area: slider;
|
|
117
|
+
}
|
|
118
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.hidden{display:none}.static{position:static}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}`;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@warp-ds/icons/elements/check-16';
|
|
3
|
+
/**
|
|
4
|
+
* Steps are used to show progress through a process or to guide users through a multi-step task.
|
|
5
|
+
*
|
|
6
|
+
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/components-steps--docs)
|
|
7
|
+
*/
|
|
8
|
+
declare class WarpSteps extends LitElement {
|
|
9
|
+
horizontal: boolean;
|
|
10
|
+
right: boolean;
|
|
11
|
+
static styles: import("lit").CSSResult[];
|
|
12
|
+
constructor();
|
|
13
|
+
updated(): void;
|
|
14
|
+
updateStepsContext(): void;
|
|
15
|
+
render(): import("lit").TemplateResult<1>;
|
|
16
|
+
}
|
|
17
|
+
interface StepsContext {
|
|
18
|
+
horizontal?: boolean;
|
|
19
|
+
right?: boolean;
|
|
20
|
+
isLast?: boolean;
|
|
21
|
+
isFirst?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Individual step component that shows a single step in a process
|
|
25
|
+
*/
|
|
26
|
+
declare class WarpStep extends LitElement {
|
|
27
|
+
active: boolean;
|
|
28
|
+
completed: boolean;
|
|
29
|
+
private _context;
|
|
30
|
+
static styles: import("lit").CSSResult[];
|
|
31
|
+
constructor();
|
|
32
|
+
setContext(context: StepsContext): void;
|
|
33
|
+
getAriaLabel(): string;
|
|
34
|
+
render(): import("lit").TemplateResult<1>;
|
|
35
|
+
}
|
|
36
|
+
export { WarpSteps, WarpStep };
|