@warp-ds/elements 2.2.0-next.1 → 2.2.0-next.11
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 +27 -17
- 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 +4282 -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 +52 -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 +8 -0
- package/dist/packages/affix/styles.d.ts +1 -0
- package/dist/packages/affix/styles.js +2 -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 +16 -0
- package/dist/packages/alert/index.d.ts +27 -17
- 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 +8 -0
- package/dist/packages/alert/styles.d.ts +1 -0
- package/dist/packages/alert/styles.js +2 -0
- package/dist/packages/attention/attention.stories.d.ts +15 -0
- package/dist/packages/attention/attention.stories.js +188 -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 -90
- package/dist/packages/attention/index.js +3360 -3984
- 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 +1 -0
- package/dist/packages/attention/react.js +9 -0
- package/dist/packages/attention/styles.d.ts +1 -0
- package/dist/packages/attention/styles.js +2 -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 +17 -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 +8 -0
- package/dist/packages/badge/styles.d.ts +1 -0
- package/dist/packages/badge/styles.js +2 -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 +22 -20
- package/dist/packages/box/index.js +2441 -304
- package/dist/packages/box/index.js.map +4 -4
- package/dist/packages/box/react.d.ts +2 -0
- package/dist/packages/box/react.js +8 -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.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 +24 -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 +8 -0
- package/dist/packages/breadcrumbs/styles.d.ts +1 -0
- package/dist/packages/breadcrumbs/styles.js +2 -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 +24 -0
- package/dist/packages/button/index.d.ts +111 -56
- package/dist/packages/button/index.js +2612 -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 +8 -0
- package/dist/packages/button/styles.d.ts +1 -0
- package/dist/packages/button/styles.js +2 -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 +33 -16
- 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 +8 -0
- package/dist/packages/card/styles.d.ts +1 -0
- package/dist/packages/card/styles.js +2 -0
- package/dist/packages/datepicker/DatePicker.test.d.ts +1 -0
- package/dist/packages/datepicker/DatePicker.test.js +68 -0
- package/dist/packages/datepicker/datepicker.d.ts +107 -0
- package/dist/packages/datepicker/datepicker.js +2785 -0
- package/dist/packages/datepicker/datepicker.js.map +7 -0
- package/dist/packages/datepicker/datepicker.stories.d.ts +11 -0
- package/dist/packages/datepicker/datepicker.stories.js +50 -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 +2 -0
- package/dist/packages/datepicker/react.js +8 -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.stories.d.ts +10 -0
- package/dist/packages/dead-toggle/dead-toggle.stories.js +23 -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 +21 -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 +8 -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 +55 -50
- package/dist/packages/expandable/index.js +2416 -2287
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/expandable/react.d.ts +2 -0
- package/dist/packages/expandable/react.js +8 -0
- package/dist/packages/expandable/styles.d.ts +1 -0
- package/dist/packages/expandable/styles.js +2 -0
- package/dist/packages/i18n.js +44 -0
- package/dist/packages/link/index.d.ts +39 -0
- package/dist/packages/link/index.js +2646 -0
- package/dist/packages/link/index.js.map +7 -0
- package/dist/packages/link/link.stories.d.ts +20 -0
- package/dist/packages/link/link.stories.js +121 -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 +8 -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 -2569
- 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 +18 -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 +30 -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 +32 -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.stories.d.ts +19 -0
- package/dist/packages/modal/modal.stories.js +160 -0
- package/dist/packages/modal/react.d.ts +4 -0
- package/dist/packages/modal/react.js +18 -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 +14 -0
- package/dist/packages/pageindicator/index.js +32 -0
- package/dist/packages/pageindicator/index.js.map +7 -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 +8 -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 +37 -0
- package/dist/packages/pagination/index.js +2494 -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.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 +2 -0
- package/dist/packages/pagination/react.js +8 -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 +44 -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.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 +23 -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 +210 -0
- package/dist/packages/rip-and-tear-checkbox/index.d.ts +6 -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/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 +8 -0
- package/dist/packages/rip-and-tear-radio/index.js +272 -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.d.ts +72 -0
- package/dist/packages/rip-and-tear-radio/radio-group.js +339 -0
- package/dist/packages/rip-and-tear-radio/radio-styles.d.ts +1 -0
- package/dist/packages/rip-and-tear-radio/radio-styles.js +172 -0
- package/dist/packages/rip-and-tear-radio/radio.d.ts +38 -0
- package/dist/packages/rip-and-tear-radio/radio.js +107 -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/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 +59 -48
- 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 +2 -0
- package/dist/packages/select/react.js +8 -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/steps/index.d.ts +43 -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 +13 -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 +20 -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 +2 -0
- package/dist/packages/switch/react.js +8 -0
- package/dist/packages/switch/styles.d.ts +1 -0
- package/dist/packages/switch/styles.js +2 -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 +4 -0
- package/dist/packages/tabs/react.js +18 -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 +51 -0
- package/dist/packages/tabs/tab.d.ts +23 -0
- package/dist/packages/tabs/tab.js +103 -0
- package/dist/packages/tabs/tabs.d.ts +38 -0
- package/dist/packages/tabs/tabs.js +238 -0
- package/dist/packages/tabs/tabs.stories.d.ts +8 -0
- package/dist/packages/tabs/tabs.stories.js +84 -0
- package/dist/packages/textfield/index.d.ts +72 -74
- package/dist/packages/textfield/index.js +2456 -413
- package/dist/packages/textfield/index.js.map +4 -4
- package/dist/packages/textfield/react.d.ts +2 -0
- package/dist/packages/textfield/react.js +8 -0
- package/dist/packages/textfield/styles.d.ts +1 -0
- package/dist/packages/textfield/styles.js +2 -0
- package/dist/packages/textfield/textfield.stories.d.ts +17 -0
- package/dist/packages/textfield/textfield.stories.js +86 -0
- package/dist/packages/textfield/textfield.test.d.ts +1 -0
- package/dist/packages/textfield/textfield.test.js +9 -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 +153 -0
- package/dist/packages/toast/toast.d.ts +34 -29
- package/dist/packages/toast/toast.js +200 -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 +421 -0
- package/dist/web-types.json +949 -0
- package/package.json +88 -32
- package/dist/index.d.ts +0 -18
- package/dist/index.js +0 -6832
- package/dist/index.js.map +0 -7
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const RequiredValidator = (options = {}) => {
|
|
2
|
+
let { validationElement, validationProperty } = options;
|
|
3
|
+
if (!validationElement) {
|
|
4
|
+
validationElement = Object.assign(document.createElement('input'), { required: true });
|
|
5
|
+
}
|
|
6
|
+
if (!validationProperty) {
|
|
7
|
+
validationProperty = 'value';
|
|
8
|
+
}
|
|
9
|
+
const obj = {
|
|
10
|
+
observedAttributes: ['required'],
|
|
11
|
+
message: validationElement.validationMessage, // @TODO: Add a translation.
|
|
12
|
+
checkValidity(element) {
|
|
13
|
+
const validity = {
|
|
14
|
+
message: '',
|
|
15
|
+
isValid: true,
|
|
16
|
+
invalidKeys: [],
|
|
17
|
+
};
|
|
18
|
+
const isRequired = element.required ?? element.hasAttribute('required');
|
|
19
|
+
// Always true if the element isn't required.
|
|
20
|
+
if (!isRequired) {
|
|
21
|
+
return validity;
|
|
22
|
+
}
|
|
23
|
+
const value = element[validationProperty];
|
|
24
|
+
const isEmpty = !value;
|
|
25
|
+
if (isEmpty) {
|
|
26
|
+
validity.message = typeof obj.message === 'function' ? obj.message(element) : obj.message || '';
|
|
27
|
+
validity.isValid = false;
|
|
28
|
+
validity.invalidKeys.push('valueMissing');
|
|
29
|
+
}
|
|
30
|
+
return validity;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
return obj;
|
|
34
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/** A reactive controller that determines when slots exist. */
|
|
3
|
+
export declare class HasSlotController implements ReactiveController {
|
|
4
|
+
host: ReactiveControllerHost & Element;
|
|
5
|
+
slotNames: string[];
|
|
6
|
+
constructor(host: ReactiveControllerHost & Element, ...slotNames: string[]);
|
|
7
|
+
private hasDefaultSlot;
|
|
8
|
+
private hasNamedSlot;
|
|
9
|
+
test(slotName: string): boolean;
|
|
10
|
+
hostConnected(): void;
|
|
11
|
+
hostDisconnected(): void;
|
|
12
|
+
private handleSlotChange;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Given a list of nodes, this function iterates over all of them and returns the concatenated
|
|
16
|
+
* HTML as a string. This is useful for getting the HTML that corresponds to a slot’s assigned nodes (since we can't use slot.innerHTML as an alternative).
|
|
17
|
+
* @param nodes - The list of nodes to iterate over.
|
|
18
|
+
* @param callback - A function that can be used to customize the HTML output for specific types of nodes. If the function returns undefined, the default HTML output will be used.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getInnerHTML(nodes: Iterable<Node>, callback?: (node: Node) => string | undefined): string;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** A reactive controller that determines when slots exist. */
|
|
2
|
+
export class HasSlotController {
|
|
3
|
+
constructor(host, ...slotNames) {
|
|
4
|
+
this.slotNames = [];
|
|
5
|
+
this.handleSlotChange = (event) => {
|
|
6
|
+
const slot = event.target;
|
|
7
|
+
if ((this.slotNames.includes('[default]') && !slot.name) || (slot.name && this.slotNames.includes(slot.name))) {
|
|
8
|
+
this.host.requestUpdate();
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
(this.host = host).addController(this);
|
|
12
|
+
this.slotNames = slotNames;
|
|
13
|
+
}
|
|
14
|
+
hasDefaultSlot() {
|
|
15
|
+
return [...this.host.childNodes].some((node) => {
|
|
16
|
+
if (node.nodeType === Node.TEXT_NODE && node.textContent.trim() !== '') {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
20
|
+
const el = node;
|
|
21
|
+
const tagName = el.tagName.toLowerCase();
|
|
22
|
+
// Ignore visually hidden elements since they aren't rendered
|
|
23
|
+
if (tagName === 'w-visually-hidden') {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
// If it doesn't have a slot attribute, it's part of the default slot
|
|
27
|
+
if (!el.hasAttribute('slot')) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
hasNamedSlot(name) {
|
|
35
|
+
return this.host.querySelector(`:scope > [slot="${name}"]`) !== null;
|
|
36
|
+
}
|
|
37
|
+
test(slotName) {
|
|
38
|
+
return slotName === '[default]' ? this.hasDefaultSlot() : this.hasNamedSlot(slotName);
|
|
39
|
+
}
|
|
40
|
+
hostConnected() {
|
|
41
|
+
this.host.shadowRoot.addEventListener('slotchange', this.handleSlotChange);
|
|
42
|
+
}
|
|
43
|
+
hostDisconnected() {
|
|
44
|
+
this.host.shadowRoot.removeEventListener('slotchange', this.handleSlotChange);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Given a list of nodes, this function iterates over all of them and returns the concatenated
|
|
49
|
+
* HTML as a string. This is useful for getting the HTML that corresponds to a slot’s assigned nodes (since we can't use slot.innerHTML as an alternative).
|
|
50
|
+
* @param nodes - The list of nodes to iterate over.
|
|
51
|
+
* @param callback - A function that can be used to customize the HTML output for specific types of nodes. If the function returns undefined, the default HTML output will be used.
|
|
52
|
+
*/
|
|
53
|
+
export function getInnerHTML(nodes, callback) {
|
|
54
|
+
let html = '';
|
|
55
|
+
for (const node of nodes) {
|
|
56
|
+
if (callback) {
|
|
57
|
+
const customHTML = callback(node);
|
|
58
|
+
if (customHTML !== undefined) {
|
|
59
|
+
html += customHTML;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
64
|
+
html += node.outerHTML;
|
|
65
|
+
}
|
|
66
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
67
|
+
html += node.textContent;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return html;
|
|
71
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { LitElement } from 'lit';
|
|
2
|
+
type UpdateHandler = (prev?: unknown, next?: unknown) => void;
|
|
3
|
+
type NonUndefined<A> = A extends undefined ? never : A;
|
|
4
|
+
type UpdateHandlerFunctionKeys<T extends object> = {
|
|
5
|
+
[K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;
|
|
6
|
+
}[keyof T];
|
|
7
|
+
interface WatchOptions {
|
|
8
|
+
/**
|
|
9
|
+
* If true, will only start watching after the initial update/render
|
|
10
|
+
*/
|
|
11
|
+
waitUntilFirstUpdate?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an
|
|
15
|
+
* update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the
|
|
16
|
+
* initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.
|
|
17
|
+
*
|
|
18
|
+
* Usage:
|
|
19
|
+
*
|
|
20
|
+
* @watch('propName')
|
|
21
|
+
* handlePropChange(oldValue, newValue) {
|
|
22
|
+
* ...
|
|
23
|
+
* }
|
|
24
|
+
*/
|
|
25
|
+
export declare function watch(propertyName: string | string[], options?: WatchOptions): <ElemClass extends LitElement>(proto: ElemClass, decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>) => void;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an
|
|
3
|
+
* update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the
|
|
4
|
+
* initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
*
|
|
8
|
+
* @watch('propName')
|
|
9
|
+
* handlePropChange(oldValue, newValue) {
|
|
10
|
+
* ...
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
13
|
+
export function watch(propertyName, options) {
|
|
14
|
+
const resolvedOptions = {
|
|
15
|
+
waitUntilFirstUpdate: false,
|
|
16
|
+
...options,
|
|
17
|
+
};
|
|
18
|
+
return (proto, decoratedFnName) => {
|
|
19
|
+
// @ts-expect-error - update is a protected property
|
|
20
|
+
const { update } = proto;
|
|
21
|
+
const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName];
|
|
22
|
+
// @ts-expect-error - update is a protected property
|
|
23
|
+
proto.update = function (changedProps) {
|
|
24
|
+
watchedProperties.forEach((property) => {
|
|
25
|
+
const key = property;
|
|
26
|
+
if (changedProps.has(key)) {
|
|
27
|
+
const oldValue = changedProps.get(key);
|
|
28
|
+
const newValue = this[key];
|
|
29
|
+
if (oldValue !== newValue) {
|
|
30
|
+
if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) {
|
|
31
|
+
this[decoratedFnName](oldValue, newValue);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
update.call(this, changedProps);
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -1,56 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@warp-ds/icons/elements/chevron-down-16';
|
|
3
|
+
export declare const ccSelect: {
|
|
4
|
+
base: string;
|
|
5
|
+
default: string;
|
|
6
|
+
disabled: string;
|
|
7
|
+
invalid: string;
|
|
8
|
+
readOnly: string;
|
|
9
|
+
wrapper: string;
|
|
10
|
+
selectWrapper: string;
|
|
11
|
+
chevron: string;
|
|
12
|
+
chevronDisabled: string;
|
|
7
13
|
};
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
14
|
+
export declare const ccLabel: {
|
|
15
|
+
base: string;
|
|
16
|
+
optional: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const ccHelpText: {
|
|
19
|
+
base: string;
|
|
20
|
+
color: string;
|
|
21
|
+
colorInvalid: string;
|
|
22
|
+
};
|
|
23
|
+
declare const WarpSelect_base: import("@open-wc/form-control").Constructor<import("@open-wc/form-control").FormControlInterface> & typeof LitElement;
|
|
24
|
+
/**
|
|
25
|
+
* A dropdown component for selecting a single value.
|
|
26
|
+
*
|
|
27
|
+
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-select--docs)
|
|
28
|
+
*/
|
|
29
|
+
export declare class WarpSelect extends WarpSelect_base {
|
|
30
|
+
#private;
|
|
31
|
+
/** Whether the element should receive focus on render */
|
|
32
|
+
autoFocus: boolean;
|
|
33
|
+
/** Renders the field in an invalid state. Often paired with `hint` to provide feedback about the error */
|
|
34
|
+
invalid: boolean;
|
|
35
|
+
/** Whether to always show a hint */
|
|
36
|
+
always: boolean;
|
|
37
|
+
/** The content displayed as the help text */
|
|
38
|
+
hint: string;
|
|
39
|
+
/** The content to disply as the label */
|
|
40
|
+
label: string;
|
|
41
|
+
/** Whether to show optional text */
|
|
42
|
+
optional: boolean;
|
|
43
|
+
/** Renders the field in a disabled state. */
|
|
44
|
+
disabled: boolean;
|
|
45
|
+
/** Renders the field in a readonly state. */
|
|
46
|
+
readOnly: boolean;
|
|
47
|
+
/** @internal */
|
|
48
|
+
_options: string;
|
|
49
|
+
name: string;
|
|
50
|
+
value: string;
|
|
51
|
+
static styles: import("lit").CSSResult[];
|
|
52
|
+
constructor();
|
|
53
|
+
/** @internal */
|
|
54
|
+
_setValue: (value: string) => void;
|
|
48
55
|
firstUpdated(): void;
|
|
49
|
-
handleKeyDown(event:
|
|
56
|
+
handleKeyDown(event: KeyboardEvent): void;
|
|
50
57
|
onChange({ target }: {
|
|
51
58
|
target: any;
|
|
52
59
|
}): void;
|
|
53
60
|
render(): import("lit").TemplateResult<1>;
|
|
54
|
-
|
|
61
|
+
}
|
|
62
|
+
declare global {
|
|
63
|
+
interface HTMLElementTagNameMap {
|
|
64
|
+
'w-select': WarpSelect;
|
|
65
|
+
}
|
|
55
66
|
}
|
|
56
67
|
export {};
|