@sats-group/ui-lib 80.3.0 → 81.0.0
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/package.json +6 -2
- package/react/add-bem-modifiers.d.ts +10 -0
- package/react/add-bem-modifiers.js +2 -0
- package/react/add-bem-modifiers.js.map +7 -0
- package/react/badge/badge.d.ts +7 -0
- package/react/badge/badge.js +2 -0
- package/react/badge/badge.js.map +7 -0
- package/react/badge/badge.types.d.ts +29 -0
- package/react/badge/badge.types.js +2 -0
- package/react/badge/badge.types.js.map +7 -0
- package/react/badge/index.js +2 -0
- package/react/badge/index.js.map +7 -0
- package/react/banner/banner.d.ts +4 -0
- package/react/banner/banner.js +2 -0
- package/react/banner/banner.js.map +7 -0
- package/react/banner/banner.types.d.ts +13 -0
- package/react/banner/banner.types.js +1 -0
- package/react/banner/banner.types.js.map +7 -0
- package/react/banner/index.js +2 -0
- package/react/banner/index.js.map +7 -0
- package/react/bomb/bomb.d.ts +4 -0
- package/react/bomb/bomb.js +2 -0
- package/react/bomb/bomb.js.map +7 -0
- package/react/bomb/bomb.types.d.ts +4 -0
- package/react/bomb/bomb.types.js +1 -0
- package/react/bomb/bomb.types.js.map +7 -0
- package/react/bomb/index.js +2 -0
- package/react/bomb/index.js.map +7 -0
- package/react/button/button.d.ts +9 -0
- package/react/button/button.js +2 -0
- package/react/button/button.js.map +7 -0
- package/react/button/{button.types.ts → button.types.d.ts} +0 -1
- package/react/button/button.types.js +1 -0
- package/react/button/button.types.js.map +7 -0
- package/react/button/index.js +2 -0
- package/react/button/index.js.map +7 -0
- package/react/checkbox/checkbox.d.ts +20 -0
- package/react/checkbox/checkbox.js +2 -0
- package/react/checkbox/checkbox.js.map +7 -0
- package/react/checkbox/checkbox.types.d.ts +17 -0
- package/react/checkbox/checkbox.types.js +2 -0
- package/react/checkbox/checkbox.types.js.map +7 -0
- package/react/checkbox/index.js +2 -0
- package/react/checkbox/index.js.map +7 -0
- package/react/chip/chip.d.ts +4 -0
- package/react/chip/chip.js +2 -0
- package/react/chip/chip.js.map +7 -0
- package/react/chip/chip.types.d.ts +18 -0
- package/react/chip/chip.types.js +1 -0
- package/react/chip/chip.types.js.map +7 -0
- package/react/chip/index.js +2 -0
- package/react/chip/index.js.map +7 -0
- package/react/chip/remove.d.ts +3 -0
- package/react/chip/remove.js +2 -0
- package/react/chip/remove.js.map +7 -0
- package/react/chip-selected/chip-selected.d.ts +4 -0
- package/react/chip-selected/chip-selected.js +2 -0
- package/react/chip-selected/chip-selected.js.map +7 -0
- package/react/chip-selected/chip-selected.types.d.ts +10 -0
- package/react/chip-selected/chip-selected.types.js +1 -0
- package/react/chip-selected/chip-selected.types.js.map +7 -0
- package/react/chip-selected/index.js +2 -0
- package/react/chip-selected/index.js.map +7 -0
- package/react/collapse/collapse.d.ts +1134 -0
- package/react/collapse/collapse.js +2 -0
- package/react/collapse/collapse.js.map +7 -0
- package/react/collapse/collapse.types.d.ts +13 -0
- package/react/collapse/collapse.types.js +1 -0
- package/react/collapse/collapse.types.js.map +7 -0
- package/react/collapse/index.js +2 -0
- package/react/collapse/index.js.map +7 -0
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +7 -0
- package/react/confirmation/confirmation.d.ts +4 -0
- package/react/confirmation/confirmation.js +2 -0
- package/react/confirmation/confirmation.js.map +7 -0
- package/react/confirmation/confirmation.types.d.ts +22 -0
- package/react/confirmation/confirmation.types.js +1 -0
- package/react/confirmation/confirmation.types.js.map +7 -0
- package/react/confirmation/index.js +2 -0
- package/react/confirmation/index.js.map +7 -0
- package/react/context-menu/context-menu.d.ts +7 -0
- package/react/context-menu/context-menu.js +2 -0
- package/react/context-menu/context-menu.js.map +7 -0
- package/react/context-menu/context-menu.types.d.ts +64 -0
- package/react/context-menu/context-menu.types.js +2 -0
- package/react/context-menu/context-menu.types.js.map +7 -0
- package/react/context-menu/index.js +2 -0
- package/react/context-menu/index.js.map +7 -0
- package/react/cropped-image/cropped-image.d.ts +7 -0
- package/react/cropped-image/cropped-image.js +2 -0
- package/react/cropped-image/cropped-image.js.map +7 -0
- package/react/cropped-image/cropped-image.types.d.ts +23 -0
- package/react/cropped-image/cropped-image.types.js +2 -0
- package/react/cropped-image/cropped-image.types.js.map +7 -0
- package/react/cropped-image/index.js +2 -0
- package/react/cropped-image/index.js.map +7 -0
- package/react/div-button/div-button.d.ts +8 -0
- package/react/div-button/div-button.js +2 -0
- package/react/div-button/div-button.js.map +7 -0
- package/react/div-button/{div-button.types.ts → div-button.types.d.ts} +0 -1
- package/react/div-button/div-button.types.js +1 -0
- package/react/div-button/div-button.types.js.map +7 -0
- package/react/div-button/index.js +2 -0
- package/react/div-button/index.js.map +7 -0
- package/react/dropdown-list/dropdown-list.d.ts +6 -0
- package/react/dropdown-list/dropdown-list.js +2 -0
- package/react/dropdown-list/dropdown-list.js.map +7 -0
- package/react/dropdown-list/dropdown-list.types.d.ts +15 -0
- package/react/dropdown-list/dropdown-list.types.js +2 -0
- package/react/dropdown-list/dropdown-list.types.js.map +7 -0
- package/react/dropdown-list/index.js +2 -0
- package/react/dropdown-list/index.js.map +7 -0
- package/react/expander/expander.d.ts +6 -0
- package/react/expander/expander.js +2 -0
- package/react/expander/expander.js.map +7 -0
- package/react/expander/expander.types.d.ts +30 -0
- package/react/expander/expander.types.js +2 -0
- package/react/expander/expander.types.js.map +7 -0
- package/react/expander/index.js +2 -0
- package/react/expander/index.js.map +7 -0
- package/react/filter/filter.d.ts +4 -0
- package/react/filter/filter.js +2 -0
- package/react/filter/filter.js.map +7 -0
- package/react/filter/filter.types.d.ts +9 -0
- package/react/filter/filter.types.js +1 -0
- package/react/filter/filter.types.js.map +7 -0
- package/react/filter/index.js +2 -0
- package/react/filter/index.js.map +7 -0
- package/react/filter-wrapper/filter-wrapper.d.ts +4 -0
- package/react/filter-wrapper/filter-wrapper.js +2 -0
- package/react/filter-wrapper/filter-wrapper.js.map +7 -0
- package/react/filter-wrapper/filter-wrapper.types.d.ts +8 -0
- package/react/filter-wrapper/filter-wrapper.types.js +2 -0
- package/react/filter-wrapper/filter-wrapper.types.js.map +7 -0
- package/react/filter-wrapper/index.js +2 -0
- package/react/filter-wrapper/index.js.map +7 -0
- package/react/flag/flag.d.ts +7 -0
- package/react/flag/flag.js +2 -0
- package/react/flag/flag.js.map +7 -0
- package/react/flag/flag.types.d.ts +14 -0
- package/react/flag/flag.types.js +2 -0
- package/react/flag/flag.types.js.map +7 -0
- package/react/flag/index.js +2 -0
- package/react/flag/index.js.map +7 -0
- package/react/form-content/checkbox-category.d.ts +4 -0
- package/react/form-content/checkbox-category.js +2 -0
- package/react/form-content/checkbox-category.js.map +7 -0
- package/react/form-content/form-content.checkbox-list.d.ts +4 -0
- package/react/form-content/form-content.checkbox-list.js +2 -0
- package/react/form-content/form-content.checkbox-list.js.map +7 -0
- package/react/form-content/form-content.checkbox-list.types.d.ts +35 -0
- package/react/form-content/form-content.checkbox-list.types.js +1 -0
- package/react/form-content/form-content.checkbox-list.types.js.map +7 -0
- package/react/form-content/form-content.d.ts +4 -0
- package/react/form-content/form-content.js +2 -0
- package/react/form-content/form-content.js.map +7 -0
- package/react/form-content/form-content.radio-list.d.ts +4 -0
- package/react/form-content/form-content.radio-list.js +2 -0
- package/react/form-content/form-content.radio-list.js.map +7 -0
- package/react/form-content/form-content.range.d.ts +4 -0
- package/react/form-content/form-content.range.js +2 -0
- package/react/form-content/form-content.range.js.map +7 -0
- package/react/form-content/{form-content.range.types.ts → form-content.range.types.d.ts} +7 -8
- package/react/form-content/form-content.range.types.js +1 -0
- package/react/form-content/form-content.range.types.js.map +7 -0
- package/react/form-content/form-content.search.d.ts +4 -0
- package/react/form-content/form-content.search.js +2 -0
- package/react/form-content/form-content.search.js.map +7 -0
- package/react/form-content/form-content.types.d.ts +49 -0
- package/react/form-content/form-content.types.js +2 -0
- package/react/form-content/form-content.types.js.map +7 -0
- package/react/form-content/index.js +2 -0
- package/react/form-content/index.js.map +7 -0
- package/react/hidden-input/{hidden-input.tsx → hidden-input.d.ts} +1 -6
- package/react/hidden-input/hidden-input.js +2 -0
- package/react/hidden-input/hidden-input.js.map +7 -0
- package/react/hidden-input/{hidden-input.types.ts → hidden-input.types.d.ts} +2 -3
- package/react/hidden-input/hidden-input.types.js +1 -0
- package/react/hidden-input/hidden-input.types.js.map +7 -0
- package/react/hidden-input/index.js +2 -0
- package/react/hidden-input/index.js.map +7 -0
- package/react/hooks/focus-previous-element.d.ts +3 -0
- package/react/hooks/focus-previous-element.js +2 -0
- package/react/hooks/focus-previous-element.js.map +7 -0
- package/react/hooks/is-running-on-client.d.ts +2 -0
- package/react/hooks/is-running-on-client.js +2 -0
- package/react/hooks/is-running-on-client.js.map +7 -0
- package/react/hooks/use-click-outside.d.ts +4 -0
- package/react/hooks/use-click-outside.js +2 -0
- package/react/hooks/use-click-outside.js.map +7 -0
- package/react/hooks/use-escape.d.ts +2 -0
- package/react/hooks/use-escape.js +2 -0
- package/react/hooks/use-escape.js.map +7 -0
- package/react/hooks/use-event.d.ts +2 -0
- package/react/hooks/use-event.js +2 -0
- package/react/hooks/use-event.js.map +7 -0
- package/react/hooks/use-is-mounted.d.ts +1 -0
- package/react/hooks/use-is-mounted.js +2 -0
- package/react/hooks/use-is-mounted.js.map +7 -0
- package/react/hooks/use-toggle.d.ts +2 -0
- package/react/hooks/use-toggle.js +2 -0
- package/react/hooks/use-toggle.js.map +7 -0
- package/react/icons/16/add.d.ts +3 -0
- package/react/icons/16/add.js +2 -0
- package/react/icons/16/add.js.map +7 -0
- package/react/icons/16/close.d.ts +3 -0
- package/react/icons/16/close.js +2 -0
- package/react/icons/16/close.js.map +7 -0
- package/react/icons/16/error.d.ts +3 -0
- package/react/icons/16/error.js +2 -0
- package/react/icons/16/error.js.map +7 -0
- package/react/icons/16/fistbump.d.ts +3 -0
- package/react/icons/16/fistbump.js +2 -0
- package/react/icons/16/fistbump.js.map +7 -0
- package/react/icons/16/info.d.ts +3 -0
- package/react/icons/16/info.js +2 -0
- package/react/icons/16/info.js.map +7 -0
- package/react/icons/16/send.d.ts +3 -0
- package/react/icons/16/send.js +2 -0
- package/react/icons/16/send.js.map +7 -0
- package/react/icons/18/arrow-down.d.ts +3 -0
- package/react/icons/18/arrow-down.js +2 -0
- package/react/icons/18/arrow-down.js.map +7 -0
- package/react/icons/18/close.d.ts +3 -0
- package/react/icons/18/close.js +2 -0
- package/react/icons/18/close.js.map +7 -0
- package/react/icons/18/confirm.d.ts +3 -0
- package/react/icons/18/confirm.js +2 -0
- package/react/icons/18/confirm.js.map +7 -0
- package/react/icons/18/error.d.ts +3 -0
- package/react/icons/18/error.js +2 -0
- package/react/icons/18/error.js.map +7 -0
- package/react/icons/18/info.d.ts +3 -0
- package/react/icons/18/info.js +2 -0
- package/react/icons/18/info.js.map +7 -0
- package/react/icons/18/warning-sign.d.ts +3 -0
- package/react/icons/18/warning-sign.js +2 -0
- package/react/icons/18/warning-sign.js.map +7 -0
- package/react/icons/24/arrow-down.d.ts +3 -0
- package/react/icons/24/arrow-down.js +2 -0
- package/react/icons/24/arrow-down.js.map +7 -0
- package/react/icons/24/arrow-right.d.ts +3 -0
- package/react/icons/24/arrow-right.js +2 -0
- package/react/icons/24/arrow-right.js.map +7 -0
- package/react/icons/24/arrow-up.d.ts +3 -0
- package/react/icons/24/arrow-up.js +2 -0
- package/react/icons/24/arrow-up.js.map +7 -0
- package/react/icons/24/close.d.ts +3 -0
- package/react/icons/24/close.js +2 -0
- package/react/icons/24/close.js.map +7 -0
- package/react/icons/24/remove.d.ts +3 -0
- package/react/icons/24/remove.js +2 -0
- package/react/icons/24/remove.js.map +7 -0
- package/react/icons/24/search.d.ts +3 -0
- package/react/icons/24/search.js +2 -0
- package/react/icons/24/search.js.map +7 -0
- package/react/indexed-access-type.js +1 -0
- package/react/indexed-access-type.js.map +7 -0
- package/react/link/index.js +2 -0
- package/react/link/index.js.map +7 -0
- package/react/link/link.d.ts +9 -0
- package/react/link/link.js +2 -0
- package/react/link/link.js.map +7 -0
- package/react/link/link.types.d.ts +29 -0
- package/react/link/link.types.js +2 -0
- package/react/link/link.types.js.map +7 -0
- package/react/link-button/index.js +2 -0
- package/react/link-button/index.js.map +7 -0
- package/react/link-button/link-button.d.ts +8 -0
- package/react/link-button/link-button.js +2 -0
- package/react/link-button/link-button.js.map +7 -0
- package/react/link-button/{link-button.types.ts → link-button.types.d.ts} +0 -1
- package/react/link-button/link-button.types.js +1 -0
- package/react/link-button/link-button.types.js.map +7 -0
- package/react/link-card/index.js +2 -0
- package/react/link-card/index.js.map +7 -0
- package/react/link-card/link-card.d.ts +4 -0
- package/react/link-card/link-card.js +2 -0
- package/react/link-card/link-card.js.map +7 -0
- package/react/link-card/link-card.types.d.ts +5 -0
- package/react/link-card/link-card.types.js +1 -0
- package/react/link-card/link-card.types.js.map +7 -0
- package/react/logos/e-avatar.d.ts +3 -0
- package/react/logos/e-avatar.js +2 -0
- package/react/logos/e-avatar.js.map +7 -0
- package/react/logos/elixia-anniversary-light.d.ts +3 -0
- package/react/logos/elixia-anniversary-light.js +2 -0
- package/react/logos/elixia-anniversary-light.js.map +7 -0
- package/react/logos/elixia-letter.d.ts +3 -0
- package/react/logos/elixia-letter.js +2 -0
- package/react/logos/elixia-letter.js.map +7 -0
- package/react/logos/elixia-pride-dark.d.ts +3 -0
- package/react/logos/elixia-pride-dark.js +2 -0
- package/react/logos/elixia-pride-dark.js.map +7 -0
- package/react/logos/elixia-pride-light.d.ts +3 -0
- package/react/logos/elixia-pride-light.js +2 -0
- package/react/logos/elixia-pride-light.js.map +7 -0
- package/react/logos/elixia-small.d.ts +3 -0
- package/react/logos/elixia-small.js +2 -0
- package/react/logos/elixia-small.js.map +7 -0
- package/react/logos/elixia.d.ts +3 -0
- package/react/logos/elixia.js +2 -0
- package/react/logos/elixia.js.map +7 -0
- package/react/logos/index.js +2 -0
- package/react/logos/index.js.map +7 -0
- package/react/logos/s-avatar.d.ts +3 -0
- package/react/logos/s-avatar.js +2 -0
- package/react/logos/s-avatar.js.map +7 -0
- package/react/logos/sats-anniversary-light.d.ts +3 -0
- package/react/logos/sats-anniversary-light.js +2 -0
- package/react/logos/sats-anniversary-light.js.map +7 -0
- package/react/logos/sats-letter.d.ts +3 -0
- package/react/logos/sats-letter.js +2 -0
- package/react/logos/sats-letter.js.map +7 -0
- package/react/logos/sats-pride-dark.d.ts +3 -0
- package/react/logos/sats-pride-dark.js +2 -0
- package/react/logos/sats-pride-dark.js.map +7 -0
- package/react/logos/sats-pride-light.d.ts +3 -0
- package/react/logos/sats-pride-light.js +2 -0
- package/react/logos/sats-pride-light.js.map +7 -0
- package/react/logos/sats-small.d.ts +3 -0
- package/react/logos/sats-small.js +2 -0
- package/react/logos/sats-small.js.map +7 -0
- package/react/logos/sats.d.ts +3 -0
- package/react/logos/sats.js +2 -0
- package/react/logos/sats.js.map +7 -0
- package/react/message/hook/use-message.d.ts +3 -0
- package/react/message/hook/use-message.js +2 -0
- package/react/message/hook/use-message.js.map +7 -0
- package/react/message/index.js +2 -0
- package/react/message/index.js.map +7 -0
- package/react/message/message.d.ts +6 -0
- package/react/message/message.js +2 -0
- package/react/message/message.js.map +7 -0
- package/react/message/message.types.d.ts +23 -0
- package/react/message/message.types.js +2 -0
- package/react/message/message.types.js.map +7 -0
- package/react/message/publish.d.ts +3 -0
- package/react/message/publish.js +2 -0
- package/react/message/publish.js.map +7 -0
- package/react/message-field/index.js +2 -0
- package/react/message-field/index.js.map +7 -0
- package/react/message-field/message-field.d.ts +7 -0
- package/react/message-field/message-field.js +2 -0
- package/react/message-field/message-field.js.map +7 -0
- package/react/message-field/message-field.types.d.ts +21 -0
- package/react/message-field/message-field.types.js +2 -0
- package/react/message-field/message-field.types.js.map +7 -0
- package/react/modal/index.js +2 -0
- package/react/modal/index.js.map +7 -0
- package/react/modal/modal.d.ts +6 -0
- package/react/modal/modal.js +2 -0
- package/react/modal/modal.js.map +7 -0
- package/react/modal/modal.types.d.ts +32 -0
- package/react/modal/modal.types.js +2 -0
- package/react/modal/modal.types.js.map +7 -0
- package/react/modal/tab-trapper.d.ts +6 -0
- package/react/modal/tab-trapper.js +2 -0
- package/react/modal/tab-trapper.js.map +7 -0
- package/react/progress-bar/index.js +2 -0
- package/react/progress-bar/index.js.map +7 -0
- package/react/progress-bar/progress-bar.d.ts +9 -0
- package/react/progress-bar/progress-bar.js +2 -0
- package/react/progress-bar/progress-bar.js.map +7 -0
- package/react/progress-bar/progress-bar.types.d.ts +30 -0
- package/react/progress-bar/progress-bar.types.js +2 -0
- package/react/progress-bar/progress-bar.types.js.map +7 -0
- package/react/radio/index.js +2 -0
- package/react/radio/index.js.map +7 -0
- package/react/radio/radio.d.ts +17 -0
- package/react/radio/radio.js +2 -0
- package/react/radio/radio.js.map +7 -0
- package/react/radio/radio.types.d.ts +13 -0
- package/react/radio/radio.types.js +2 -0
- package/react/radio/radio.types.js.map +7 -0
- package/react/scale-bar/index.js +2 -0
- package/react/scale-bar/index.js.map +7 -0
- package/react/scale-bar/scale-bar.d.ts +4 -0
- package/react/scale-bar/scale-bar.js +2 -0
- package/react/scale-bar/scale-bar.js.map +7 -0
- package/react/scale-bar/scale-bar.types.d.ts +4 -0
- package/react/scale-bar/scale-bar.types.js +1 -0
- package/react/scale-bar/scale-bar.types.js.map +7 -0
- package/react/search/index.js +2 -0
- package/react/search/index.js.map +7 -0
- package/react/search/search.d.ts +28 -0
- package/react/search/search.js +2 -0
- package/react/search/search.js.map +7 -0
- package/react/search/search.types.d.ts +39 -0
- package/react/search/search.types.js +2 -0
- package/react/search/search.types.js.map +7 -0
- package/react/select/index.js +2 -0
- package/react/select/index.js.map +7 -0
- package/react/select/select.d.ts +10 -0
- package/react/select/select.js +2 -0
- package/react/select/select.js.map +7 -0
- package/react/select/select.scss +14 -0
- package/react/select/select.types.d.ts +21 -0
- package/react/select/select.types.js +2 -0
- package/react/select/select.types.js.map +7 -0
- package/react/select-option/index.js +2 -0
- package/react/select-option/index.js.map +7 -0
- package/react/select-option/{select-option.tsx → select-option.d.ts} +1 -12
- package/react/select-option/select-option.js +2 -0
- package/react/select-option/select-option.js.map +7 -0
- package/react/select-option/select-option.types.d.ts +6 -0
- package/react/select-option/select-option.types.js +1 -0
- package/react/select-option/select-option.types.js.map +7 -0
- package/react/tag/index.js +2 -0
- package/react/tag/index.js.map +7 -0
- package/react/tag/tag.d.ts +7 -0
- package/react/tag/tag.js +2 -0
- package/react/tag/tag.js.map +7 -0
- package/react/tag/tag.types.d.ts +26 -0
- package/react/tag/tag.types.js +2 -0
- package/react/tag/tag.types.js.map +7 -0
- package/react/text/index.js +2 -0
- package/react/text/index.js.map +7 -0
- package/react/text/text.d.ts +7 -0
- package/react/text/text.js +2 -0
- package/react/text/text.js.map +7 -0
- package/react/text/text.types.d.ts +27 -0
- package/react/text/text.types.js +2 -0
- package/react/text/text.types.js.map +7 -0
- package/react/text-area/index.js +2 -0
- package/react/text-area/index.js.map +7 -0
- package/react/text-area/text-area.d.ts +20 -0
- package/react/text-area/text-area.js +2 -0
- package/react/text-area/text-area.js.map +7 -0
- package/react/text-area/text-area.types.d.ts +21 -0
- package/react/text-area/text-area.types.js +2 -0
- package/react/text-area/text-area.types.js.map +7 -0
- package/react/text-input/index.js +2 -0
- package/react/text-input/index.js.map +7 -0
- package/react/text-input/text-input.d.ts +18 -0
- package/react/text-input/text-input.js +2 -0
- package/react/text-input/text-input.js.map +7 -0
- package/react/text-input/text-input.types.d.ts +21 -0
- package/react/text-input/text-input.types.js +2 -0
- package/react/text-input/text-input.types.js.map +7 -0
- package/react/toggle/index.js +2 -0
- package/react/toggle/index.js.map +7 -0
- package/react/toggle/toggle.d.ts +13 -0
- package/react/toggle/toggle.js +2 -0
- package/react/toggle/toggle.js.map +7 -0
- package/react/toggle/toggle.types.d.ts +10 -0
- package/react/toggle/toggle.types.js +1 -0
- package/react/toggle/toggle.types.js.map +7 -0
- package/react/toolbox/index.js +2 -0
- package/react/toolbox/index.js.map +7 -0
- package/react/toolbox/toolbox.d.ts +4 -0
- package/react/toolbox/toolbox.js +2 -0
- package/react/toolbox/toolbox.js.map +7 -0
- package/react/toolbox/toolbox.types.d.ts +34 -0
- package/react/toolbox/toolbox.types.js +2 -0
- package/react/toolbox/toolbox.types.js.map +7 -0
- package/react/ts/debounce.d.ts +1 -0
- package/react/ts/debounce.js +2 -0
- package/react/ts/debounce.js.map +7 -0
- package/react/{types.ts → types.d.ts} +4 -19
- package/react/types.js +1 -0
- package/react/types.js.map +7 -0
- package/react/use-input-validation.d.ts +4 -0
- package/react/use-input-validation.js +2 -0
- package/react/use-input-validation.js.map +7 -0
- package/react/use-input-validation.types.d.ts +13 -0
- package/react/use-input-validation.types.js +1 -0
- package/react/use-input-validation.types.js.map +7 -0
- package/react/visually-button/index.js +2 -0
- package/react/visually-button/index.js.map +7 -0
- package/react/visually-button/maps.d.ts +6 -0
- package/react/visually-button/maps.js +2 -0
- package/react/visually-button/maps.js.map +7 -0
- package/react/visually-button/visually-button.d.ts +8 -0
- package/react/visually-button/visually-button.js +2 -0
- package/react/visually-button/visually-button.js.map +7 -0
- package/react/visually-button/visually-button.types.d.ts +46 -0
- package/react/visually-button/visually-button.types.js +2 -0
- package/react/visually-button/visually-button.types.js.map +7 -0
- package/react/visually-hidden/index.js +2 -0
- package/react/visually-hidden/index.js.map +7 -0
- package/react/visually-hidden/visually-hidden.d.ts +3 -0
- package/react/visually-hidden/visually-hidden.js +2 -0
- package/react/visually-hidden/visually-hidden.js.map +7 -0
- package/.nvmrc +0 -1
- package/catalog-info.yaml +0 -14
- package/eslint.config.mjs +0 -93
- package/react/add-bem-modifiers.ts +0 -51
- package/react/badge/badge.tsx +0 -28
- package/react/badge/badge.types.ts +0 -34
- package/react/banner/banner.tsx +0 -93
- package/react/banner/banner.types.ts +0 -10
- package/react/bomb/bomb.tsx +0 -19
- package/react/bomb/bomb.types.ts +0 -1
- package/react/button/button.tsx +0 -23
- package/react/checkbox/checkbox.tsx +0 -176
- package/react/checkbox/checkbox.types.ts +0 -19
- package/react/chip/chip.tsx +0 -37
- package/react/chip/chip.types.ts +0 -18
- package/react/chip/remove.tsx +0 -14
- package/react/chip-selected/chip-selected.tsx +0 -102
- package/react/chip-selected/chip-selected.types.ts +0 -11
- package/react/collapse/collapse.tsx +0 -179
- package/react/collapse/collapse.types.ts +0 -13
- package/react/components.ts +0 -83
- package/react/confirmation/confirmation.tsx +0 -90
- package/react/confirmation/confirmation.types.ts +0 -25
- package/react/context-menu/context-menu.tsx +0 -201
- package/react/context-menu/context-menu.types.ts +0 -71
- package/react/cropped-image/cropped-image.tsx +0 -36
- package/react/cropped-image/cropped-image.types.ts +0 -26
- package/react/div-button/div-button.tsx +0 -15
- package/react/dropdown-list/dropdown-list.tsx +0 -116
- package/react/dropdown-list/dropdown-list.types.ts +0 -17
- package/react/expander/expander.tsx +0 -170
- package/react/expander/expander.types.ts +0 -33
- package/react/filter/filter.tsx +0 -99
- package/react/filter/filter.types.ts +0 -8
- package/react/filter-wrapper/filter-wrapper.tsx +0 -24
- package/react/filter-wrapper/filter-wrapper.types.ts +0 -10
- package/react/flag/flag.tsx +0 -27
- package/react/flag/flag.types.ts +0 -17
- package/react/form-content/checkbox-category.tsx +0 -183
- package/react/form-content/form-content.checkbox-list.tsx +0 -126
- package/react/form-content/form-content.checkbox-list.types.ts +0 -36
- package/react/form-content/form-content.radio-list.tsx +0 -58
- package/react/form-content/form-content.range.tsx +0 -20
- package/react/form-content/form-content.search.tsx +0 -47
- package/react/form-content/form-content.tsx +0 -96
- package/react/form-content/form-content.types.ts +0 -55
- package/react/hooks/focus-previous-element.ts +0 -30
- package/react/hooks/is-running-on-client.ts +0 -1
- package/react/hooks/use-click-outside.ts +0 -23
- package/react/hooks/use-escape.ts +0 -18
- package/react/hooks/use-event.ts +0 -29
- package/react/hooks/use-is-mounted.ts +0 -11
- package/react/hooks/use-toggle.ts +0 -19
- package/react/icons/16/add.tsx +0 -13
- package/react/icons/16/close.tsx +0 -12
- package/react/icons/16/error.tsx +0 -23
- package/react/icons/16/fistbump.tsx +0 -13
- package/react/icons/16/info.tsx +0 -17
- package/react/icons/16/send.tsx +0 -13
- package/react/icons/18/arrow-down.tsx +0 -13
- package/react/icons/18/close.tsx +0 -18
- package/react/icons/18/confirm.tsx +0 -19
- package/react/icons/18/error.tsx +0 -23
- package/react/icons/18/info.tsx +0 -17
- package/react/icons/18/warning-sign.tsx +0 -23
- package/react/icons/24/arrow-down.tsx +0 -14
- package/react/icons/24/arrow-right.tsx +0 -14
- package/react/icons/24/arrow-up.tsx +0 -14
- package/react/icons/24/close.tsx +0 -12
- package/react/icons/24/remove.tsx +0 -12
- package/react/icons/24/search.tsx +0 -10
- package/react/icons/icons.md +0 -3
- package/react/link/link.tsx +0 -62
- package/react/link/link.types.ts +0 -37
- package/react/link-button/link-button.tsx +0 -17
- package/react/link-card/link-card.tsx +0 -24
- package/react/link-card/link-card.types.ts +0 -5
- package/react/logos/e-avatar.tsx +0 -12
- package/react/logos/elixia-anniversary-light.tsx +0 -70
- package/react/logos/elixia-letter.tsx +0 -12
- package/react/logos/elixia-pride-dark.tsx +0 -102
- package/react/logos/elixia-pride-light.tsx +0 -102
- package/react/logos/elixia-small.tsx +0 -12
- package/react/logos/elixia.tsx +0 -12
- package/react/logos/s-avatar.tsx +0 -12
- package/react/logos/sats-anniversary-light.tsx +0 -76
- package/react/logos/sats-letter.tsx +0 -12
- package/react/logos/sats-pride-dark.tsx +0 -102
- package/react/logos/sats-pride-light.tsx +0 -102
- package/react/logos/sats-small.tsx +0 -12
- package/react/logos/sats.tsx +0 -12
- package/react/message/hook/use-message.ts +0 -22
- package/react/message/message.tsx +0 -60
- package/react/message/message.types.ts +0 -39
- package/react/message/publish.ts +0 -19
- package/react/message-field/message-field.tsx +0 -70
- package/react/message-field/message-field.types.ts +0 -24
- package/react/modal/modal.tsx +0 -131
- package/react/modal/modal.types.ts +0 -36
- package/react/modal/tab-trapper.tsx +0 -68
- package/react/progress-bar/progress-bar.tsx +0 -81
- package/react/progress-bar/progress-bar.types.ts +0 -35
- package/react/radio/radio.tsx +0 -87
- package/react/radio/radio.types.ts +0 -15
- package/react/scale-bar/scale-bar.tsx +0 -29
- package/react/scale-bar/scale-bar.types.ts +0 -4
- package/react/search/search.tsx +0 -267
- package/react/search/search.types.ts +0 -44
- package/react/select/select.tsx +0 -127
- package/react/select/select.types.ts +0 -25
- package/react/select-option/select-option.types.ts +0 -8
- package/react/tag/tag.tsx +0 -26
- package/react/tag/tag.types.ts +0 -30
- package/react/text/text.tsx +0 -40
- package/react/text/text.types.ts +0 -29
- package/react/text-area/text-area.tsx +0 -153
- package/react/text-area/text-area.types.ts +0 -24
- package/react/text-input/text-input.tsx +0 -160
- package/react/text-input/text-input.types.ts +0 -24
- package/react/toggle/toggle.tsx +0 -85
- package/react/toggle/toggle.types.ts +0 -11
- package/react/toolbox/toolbox.tsx +0 -43
- package/react/toolbox/toolbox.types.ts +0 -39
- package/react/ts/debounce.ts +0 -12
- package/react/use-input-validation.ts +0 -60
- package/react/use-input-validation.types.ts +0 -13
- package/react/visually-button/maps.ts +0 -36
- package/react/visually-button/visually-button.tsx +0 -111
- package/react/visually-button/visually-button.types.ts +0 -59
- package/react/visually-hidden/visually-hidden.tsx +0 -10
- /package/react/badge/{index.ts → index.d.ts} +0 -0
- /package/react/banner/{index.ts → index.d.ts} +0 -0
- /package/react/bomb/{index.ts → index.d.ts} +0 -0
- /package/react/button/{index.ts → index.d.ts} +0 -0
- /package/react/checkbox/{index.ts → index.d.ts} +0 -0
- /package/react/chip/{index.ts → index.d.ts} +0 -0
- /package/react/chip-selected/{index.ts → index.d.ts} +0 -0
- /package/react/collapse/{index.ts → index.d.ts} +0 -0
- /package/react/confirmation/{index.ts → index.d.ts} +0 -0
- /package/react/context-menu/{index.ts → index.d.ts} +0 -0
- /package/react/cropped-image/{index.ts → index.d.ts} +0 -0
- /package/react/div-button/{index.ts → index.d.ts} +0 -0
- /package/react/dropdown-list/{index.ts → index.d.ts} +0 -0
- /package/react/expander/{index.ts → index.d.ts} +0 -0
- /package/react/filter/{index.ts → index.d.ts} +0 -0
- /package/react/filter-wrapper/{index.ts → index.d.ts} +0 -0
- /package/react/flag/{index.ts → index.d.ts} +0 -0
- /package/react/form-content/{index.ts → index.d.ts} +0 -0
- /package/react/hidden-input/{index.ts → index.d.ts} +0 -0
- /package/react/{indexed-access-type.ts → indexed-access-type.d.ts} +0 -0
- /package/react/link/{index.ts → index.d.ts} +0 -0
- /package/react/link-button/{index.ts → index.d.ts} +0 -0
- /package/react/link-card/{index.ts → index.d.ts} +0 -0
- /package/react/logos/{index.ts → index.d.ts} +0 -0
- /package/react/message/{index.ts → index.d.ts} +0 -0
- /package/react/message-field/{index.ts → index.d.ts} +0 -0
- /package/react/modal/{index.ts → index.d.ts} +0 -0
- /package/react/progress-bar/{index.ts → index.d.ts} +0 -0
- /package/react/radio/{index.ts → index.d.ts} +0 -0
- /package/react/scale-bar/{index.ts → index.d.ts} +0 -0
- /package/react/search/{index.ts → index.d.ts} +0 -0
- /package/react/select/{index.ts → index.d.ts} +0 -0
- /package/react/select-option/{index.ts → index.d.ts} +0 -0
- /package/react/tag/{index.ts → index.d.ts} +0 -0
- /package/react/text/{index.ts → index.d.ts} +0 -0
- /package/react/text-area/{index.ts → index.d.ts} +0 -0
- /package/react/text-input/{index.ts → index.d.ts} +0 -0
- /package/react/toggle/{index.ts → index.d.ts} +0 -0
- /package/react/toolbox/{index.ts → index.d.ts} +0 -0
- /package/react/visually-button/{index.ts → index.d.ts} +0 -0
- /package/react/visually-hidden/{index.ts → index.d.ts} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var O=Object.defineProperty;var p=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var g=(e,t,a)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,A=(e,t)=>{for(var a in t||(t={}))b.call(t,a)&&g(e,a,t[a]);if(p)for(var a of p(t))y.call(t,a)&&g(e,a,t[a]);return e};var C=(e,t)=>{var a={};for(var i in e)b.call(e,i)&&t.indexOf(i)<0&&(a[i]=e[i]);if(e!=null&&p)for(var i of p(e))t.indexOf(i)<0&&y.call(e,i)&&(a[i]=e[i]);return a};import d from"classnames";import*as r from"react";import n from"../text";import W from"../use-input-validation";import{themes as I,sizes as v}from"./text-area.types";const k=r.forwardRef((B,E)=>{var z=B,{children:e,helpText:t,label:a,name:i,placeholder:w,disabled:u,required:c,isLabelVisible:N=!0,helpIcon:T,size:x=v.default,theme:s=I.light,isShort:$,maxLength:m,defaultValue:l}=z,_=C(z,["children","helpText","label","name","placeholder","disabled","required","isLabelVisible","helpIcon","size","theme","isShort","maxLength","defaultValue"]);const[j,H,f]=W(),[M,h]=r.useState(0);return r.useEffect(()=>{l&&(typeof l=="string"?h(l.length):typeof l=="number"&&h(l))},[_]),r.createElement("label",{className:"text-area"},r.createElement("div",{className:"text-area__wrapper"},N?r.createElement("div",{className:"text-area__header"},r.createElement(n,{theme:n.themes.emphasis,size:x===v.default?n.sizes.basic:n.sizes.small,className:d("text-area__label",{[`text-area__label--theme-${s}-disabled`]:u,[`text-area__label--theme-${s}`]:s})},a,c?r.createElement("span",{className:d("text-area__asterisk",{[`text-area__asterisk--theme-${s}-disabled`]:u,[`text-area__asterisk--theme-${s}`]:s})},"*"):null,e),m?r.createElement(n,{className:"text-area__max",size:n.sizes.small},M,"/",m):null):null,r.createElement("textarea",A({className:d("text-area__input",{[`text-area__input--theme-${s}`]:s,[`text-area__input--theme-${s}-error`]:f,[`text-area__input--size-${x}-short`]:$,[`text-area__input--size-${x}`]:x}),"aria-label":N?a:void 0,name:i,maxLength:m,ref:E,cols:1,required:c,defaultValue:l,rows:$?1:2,onChange:o=>{_.onChange&&_.onChange(o),j(o),m&&h(o.target.value.length)},onInvalid:o=>{_.onInvalid&&_.onInvalid(o),H(o)},placeholder:w,disabled:u},_))),t?r.createElement("div",{className:"text-area__help"},r.createElement(n,{size:n.sizes.interface,className:d("text-area__help-text",{[`text-area__help-text--theme-${s}-error`]:f,[`text-area__help-text--theme-${s}`]:s})},T||null,t)):null,f&&r.createElement("div",{"aria-hidden":"true",className:"text-area__error"},r.createElement(n,null,f)))});k.displayName="TextArea";const q=Object.assign(k,{themes:I,sizes:v});var S=q;export{S as default};
|
|
2
|
+
//# sourceMappingURL=text-area.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../react/text-area/text-area.tsx"],
|
|
4
|
+
"sourcesContent": ["import cn from 'classnames';\nimport * as React from 'react';\n\nimport Text from '../text';\nimport useInputValidation from '../use-input-validation';\n\nimport { TextArea as Props, themes, sizes } from './text-area.types';\n\nconst RefTextArea = React.forwardRef<\n HTMLTextAreaElement,\n React.PropsWithChildren<Props>\n>(\n (\n {\n children,\n helpText,\n label,\n name,\n placeholder,\n disabled,\n required,\n isLabelVisible = true,\n helpIcon,\n size = sizes.default,\n theme = themes.light,\n isShort,\n maxLength,\n defaultValue,\n ...restProps\n },\n ref,\n ) => {\n const [onChange, onInvalid, error] = useInputValidation();\n const [count, setCount] = React.useState(0);\n\n React.useEffect(() => {\n if (defaultValue) {\n if (typeof defaultValue === 'string') {\n setCount(defaultValue.length);\n } else if (typeof defaultValue === 'number') {\n setCount(defaultValue);\n }\n }\n }, [restProps]);\n\n return (\n <label className=\"text-area\">\n <div className=\"text-area__wrapper\">\n {isLabelVisible ? (\n <div className=\"text-area__header\">\n <Text\n theme={Text.themes.emphasis}\n size={\n size === sizes.default ? Text.sizes.basic : Text.sizes.small\n }\n className={cn('text-area__label', {\n [`text-area__label--theme-${theme}-disabled`]: disabled,\n [`text-area__label--theme-${theme}`]: theme,\n })}\n >\n {label}\n {required ? (\n <span\n className={cn('text-area__asterisk', {\n [`text-area__asterisk--theme-${theme}-disabled`]:\n disabled,\n [`text-area__asterisk--theme-${theme}`]: theme,\n })}\n >\n *\n </span>\n ) : null}\n {children}\n </Text>\n {maxLength ? (\n <Text className=\"text-area__max\" size={Text.sizes.small}>\n {count}/{maxLength}\n </Text>\n ) : null}\n </div>\n ) : null}\n <textarea\n className={cn('text-area__input', {\n [`text-area__input--theme-${theme}`]: theme,\n [`text-area__input--theme-${theme}-error`]: error,\n [`text-area__input--size-${size}-short`]: isShort,\n [`text-area__input--size-${size}`]: size,\n })}\n aria-label={isLabelVisible ? label : undefined}\n name={name}\n maxLength={maxLength}\n ref={ref}\n cols={1}\n required={required}\n defaultValue={defaultValue}\n rows={isShort ? 1 : 2}\n onChange={e => {\n // NOTE: To not break compatibility\n if (restProps.onChange) {\n restProps.onChange(e);\n }\n onChange(e);\n if (maxLength) {\n setCount(e.target.value.length);\n }\n }}\n onInvalid={e => {\n // NOTE: To not break compatibility\n if (restProps.onInvalid) restProps.onInvalid(e);\n onInvalid(e);\n }}\n placeholder={placeholder}\n disabled={disabled}\n {...restProps}\n />\n </div>\n\n {helpText ? (\n <div className=\"text-area__help\">\n <Text\n size={Text.sizes.interface}\n className={cn('text-area__help-text', {\n [`text-area__help-text--theme-${theme}-error`]: error,\n [`text-area__help-text--theme-${theme}`]: theme,\n })}\n >\n {helpIcon ? helpIcon : null}\n {helpText}\n </Text>\n </div>\n ) : null}\n\n {/* NOTE: This is aria-hidden because reporting of validation errors is handled by the browser */}\n {error && (\n <div aria-hidden=\"true\" className=\"text-area__error\">\n <Text>{error}</Text>\n </div>\n )}\n </label>\n );\n },\n);\n\n// NOTE: If this isn't set, stack traces say \"forwardRef\" instead of \"TextArea\"\nRefTextArea.displayName = 'TextArea';\n// NOTE: The component is redeclared here because TypeScript doesn't accept assigning extra properties to `RefComponent` when it's declared\n\nconst TextArea: typeof RefTextArea & {\n themes: typeof themes;\n sizes: typeof sizes;\n} = Object.assign(RefTextArea, { themes, sizes });\n\nexport default TextArea;\n"],
|
|
5
|
+
"mappings": "2fAAA,OAAOA,MAAQ,aACf,UAAYC,MAAW,QAEvB,OAAOC,MAAU,UACjB,OAAOC,MAAwB,0BAE/B,OAA4B,UAAAC,EAAQ,SA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sizes", "RefTextArea", "_a", "ref", "_b", "children", "helpText", "label", "name", "placeholder", "disabled", "required", "isLabelVisible", "helpIcon", "size", "theme", "isShort", "maxLength", "defaultValue", "restProps", "__objRest", "onChange", "onInvalid", "error", "count", "setCount", "__spreadValues", "e", "TextArea", "text_area_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { ObjectValues, TextAreaHtmlProps } from '../types';
|
|
3
|
+
export declare const themes: {
|
|
4
|
+
readonly light: "light";
|
|
5
|
+
readonly dark: "dark";
|
|
6
|
+
};
|
|
7
|
+
export declare const sizes: {
|
|
8
|
+
readonly default: "default";
|
|
9
|
+
readonly small: "small";
|
|
10
|
+
};
|
|
11
|
+
export type TextArea = {
|
|
12
|
+
helpText?: string;
|
|
13
|
+
label: string;
|
|
14
|
+
theme?: ObjectValues<typeof themes>;
|
|
15
|
+
size?: ObjectValues<typeof sizes>;
|
|
16
|
+
isLabelVisible?: boolean;
|
|
17
|
+
helpIcon?: ReactElement;
|
|
18
|
+
isShort?: boolean;
|
|
19
|
+
name: string;
|
|
20
|
+
defaultValue?: string;
|
|
21
|
+
} & TextAreaHtmlProps;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../react/text-area/text-area.types.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ReactElement } from 'react';\nimport type { ObjectValues, TextAreaHtmlProps } from '../types';\n\nexport const themes = {\n light: 'light',\n dark: 'dark',\n} as const;\n\nexport const sizes = {\n default: 'default',\n small: 'small',\n} as const;\n\nexport type TextArea = {\n helpText?: string;\n label: string;\n theme?: ObjectValues<typeof themes>;\n size?: ObjectValues<typeof sizes>;\n isLabelVisible?: boolean;\n helpIcon?: ReactElement;\n isShort?: boolean;\n name: string;\n defaultValue?: string;\n} & TextAreaHtmlProps;\n"],
|
|
5
|
+
"mappings": "AAGO,MAAMA,EAAS,CACpB,MAAO,QACP,KAAM,MACR,EAEaC,EAAQ,CACnB,QAAS,UACT,MAAO,OACT",
|
|
6
|
+
"names": ["themes", "sizes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { themes, variants } from './text-input.types';
|
|
3
|
+
declare const RefTextInput: React.ForwardRefExoticComponent<{
|
|
4
|
+
customErrorMessages?: import("../use-input-validation.types").Messages;
|
|
5
|
+
hasError?: boolean;
|
|
6
|
+
helpText?: string;
|
|
7
|
+
label: string;
|
|
8
|
+
leadingIcon?: React.ReactNode;
|
|
9
|
+
name: string;
|
|
10
|
+
theme?: import("../types").ObjectValues<typeof themes>;
|
|
11
|
+
trailingIcon?: React.ReactNode;
|
|
12
|
+
variant?: import("../types").ObjectValues<typeof variants>;
|
|
13
|
+
} & import("../types").InputHtmlProps & React.RefAttributes<HTMLInputElement>>;
|
|
14
|
+
declare const TextInput: typeof RefTextInput & {
|
|
15
|
+
themes: typeof themes;
|
|
16
|
+
variants: typeof variants;
|
|
17
|
+
};
|
|
18
|
+
export default TextInput;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var F=Object.defineProperty;var m=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var I=(i,e,s)=>e in i?F(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s,k=(i,e)=>{for(var s in e||(e={}))w.call(e,s)&&I(i,s,e[s]);if(m)for(var s of m(e))S.call(e,s)&&I(i,s,e[s]);return i};var C=(i,e)=>{var s={};for(var n in i)w.call(i,n)&&e.indexOf(n)<0&&(s[n]=i[n]);if(i!=null&&m)for(var n of m(i))e.indexOf(n)<0&&S.call(i,n)&&(s[n]=i[n]);return s};import G from"classnames";import*as t from"react";import p from"../text";import J from"../use-input-validation";import K from"../icons/16/info";import L from"../icons/16/error";import{themes as _,variants as l}from"./text-input.types";import{useEffect as M}from"react";const E=t.forwardRef((U,q)=>{var b=U,{customErrorMessages:i,defaultValue:e,disabled:s,hasError:n,helpText:N,label:h,leadingIcon:o,maxLength:a,name:O,onChange:j=()=>{},placeholder:H,required:c,theme:z,trailingIcon:d,type:P="text",variant:u=l.large}=b,T=C(b,["customErrorMessages","defaultValue","disabled","hasError","helpText","label","leadingIcon","maxLength","name","onChange","placeholder","required","theme","trailingIcon","type","variant"]);const[A,f]=t.useState(0),[g,y]=t.useState(n),[B,D,x]=J(i,i?i.defaultError:void 0,g),v=a?a>0:void 0;return t.useEffect(()=>{e&&(typeof e=="string"?f(e.length):typeof e=="number"&&f(e))},[T]),M(()=>{y(n)},[n]),t.createElement("label",{className:G("text-input",{"text-input--theme-dark":z===_.dark,"text-input--theme-light":z===_.light,"text-input--disabled":s,"text-input--error":x||g,"text-input--icon":o||d,"text-input--variant-small":u===l.small,"text-input--variant-large":u===l.large})},t.createElement("div",{className:"text-input__wrapper"},t.createElement("div",{className:"text-input__label-wrapper"},t.createElement(p,{className:"text-input__label",theme:p.themes.emphasis,size:u===l.small?p.sizes.small:p.sizes.basic},h,c?t.createElement("span",{className:"text-input__asterisk"},"*"):null),v?t.createElement("div",{className:"text-input__length-counter"},t.createElement(p,{size:u===l.small?p.sizes.small:p.sizes.basic},A,"/",a)):null),t.createElement("div",{className:"text-input__input-wrapper"},o?t.createElement("div",{className:"text-input__icon"},o):null,t.createElement("input",k({className:"text-input__input",defaultValue:e,disabled:s,required:c,name:O,maxLength:v?a:void 0,onInvalid:r=>D(r),onChange:r=>{j(r),B(r),y(!1),v&&f(r.target.value.length)},placeholder:H,ref:q,type:P,"aria-label":h},T)),d?t.createElement("div",{className:"text-input__icon"},d):null),N?t.createElement("div",{className:"text-input__help"},t.createElement("div",{className:"text-input__help-icon"},t.createElement(K,null)),t.createElement(p,{size:p.sizes.interface},N)):null,x?t.createElement("div",{"aria-hidden":"true",className:"text-input__error"},t.createElement("div",{className:"text-input__error-icon"},t.createElement(L,null)),t.createElement(p,{size:p.sizes.interface},x)):null))});E.displayName="TextInput";const Q=Object.assign(E,{themes:_,variants:l});var it=Q;export{it as default};
|
|
2
|
+
//# sourceMappingURL=text-input.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../react/text-input/text-input.tsx"],
|
|
4
|
+
"sourcesContent": ["import cn from 'classnames';\nimport * as React from 'react';\n\nimport Text from '../text';\nimport useInputValidation from '../use-input-validation';\nimport SvgInfo from '../icons/16/info';\nimport SvgError from '../icons/16/error';\n\nimport { themes, variants, TextInput as Props } from './text-input.types';\nimport { useEffect } from 'react';\n\nconst RefTextInput = React.forwardRef<HTMLInputElement, Props>(\n (\n {\n customErrorMessages,\n defaultValue,\n disabled,\n hasError,\n helpText,\n label,\n leadingIcon,\n maxLength,\n name,\n onChange = () => {},\n placeholder,\n required,\n theme,\n trailingIcon,\n type = 'text',\n variant = variants.large,\n ...restProps\n },\n ref,\n ) => {\n const [count, setCount] = React.useState(0);\n const [isError, setIsError] = React.useState(hasError);\n const [validationOnChange, onInvalid, error] = useInputValidation(\n customErrorMessages,\n customErrorMessages ? customErrorMessages.defaultError : undefined,\n isError,\n );\n const isMaxLengthValid = maxLength ? maxLength > 0 : undefined;\n\n React.useEffect(() => {\n if (defaultValue) {\n if (typeof defaultValue === 'string') {\n setCount(defaultValue.length);\n } else if (typeof defaultValue === 'number') {\n setCount(defaultValue);\n }\n }\n }, [restProps]);\n\n useEffect(() => {\n setIsError(hasError);\n }, [hasError]);\n\n return (\n <label\n className={cn('text-input', {\n 'text-input--theme-dark': theme === themes.dark,\n 'text-input--theme-light': theme === themes.light,\n 'text-input--disabled': disabled,\n 'text-input--error': error || isError,\n 'text-input--icon': leadingIcon || trailingIcon,\n 'text-input--variant-small': variant === variants.small,\n 'text-input--variant-large': variant === variants.large,\n })}\n >\n <div className=\"text-input__wrapper\">\n <div className=\"text-input__label-wrapper\">\n <Text\n className=\"text-input__label\"\n theme={Text.themes.emphasis}\n size={\n variant === variants.small ? Text.sizes.small : Text.sizes.basic\n }\n >\n {label}\n {required ? (\n <span className=\"text-input__asterisk\">*</span>\n ) : null}\n </Text>\n {isMaxLengthValid ? (\n <div className=\"text-input__length-counter\">\n <Text\n size={\n variant === variants.small\n ? Text.sizes.small\n : Text.sizes.basic\n }\n >\n {count}/{maxLength}\n </Text>\n </div>\n ) : null}\n </div>\n\n <div className=\"text-input__input-wrapper\">\n {leadingIcon ? (\n <div className=\"text-input__icon\">{leadingIcon}</div>\n ) : null}\n <input\n className=\"text-input__input\"\n defaultValue={defaultValue}\n disabled={disabled}\n required={required}\n name={name}\n maxLength={isMaxLengthValid ? maxLength : undefined}\n onInvalid={e => onInvalid(e)}\n onChange={e => {\n onChange(e);\n validationOnChange(e);\n setIsError(false); // NOTE: We want to reset error state on change to not confuse users.\n if (isMaxLengthValid) {\n setCount(e.target.value.length);\n }\n }}\n placeholder={placeholder}\n ref={ref}\n type={type}\n aria-label={label}\n {...restProps}\n />\n {trailingIcon ? (\n <div className=\"text-input__icon\">{trailingIcon}</div>\n ) : null}\n </div>\n {helpText ? (\n <div className=\"text-input__help\">\n <div className=\"text-input__help-icon\">\n <SvgInfo />\n </div>\n <Text size={Text.sizes.interface}>{helpText}</Text>\n </div>\n ) : null}\n {/* NOTE: This is aria-hidden because reporting of validation errors is handled by the browser */}\n {error ? (\n <div aria-hidden=\"true\" className=\"text-input__error\">\n <div className=\"text-input__error-icon\">\n <SvgError />\n </div>\n <Text size={Text.sizes.interface}>{error}</Text>\n </div>\n ) : null}\n </div>\n </label>\n );\n },\n);\n\n// NOTE: If this isn't set, stack traces say \"forwardRef\" instead of \"TextInput\"\nRefTextInput.displayName = 'TextInput';\n\nconst TextInput: typeof RefTextInput & {\n themes: typeof themes;\n variants: typeof variants;\n} = Object.assign(RefTextInput, { themes, variants });\n\nexport default TextInput;\n"],
|
|
5
|
+
"mappings": "2fAAA,OAAOA,MAAQ,aACf,UAAYC,MAAW,QAEv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AAY,OAAO,UAAU,qBAChCA,EAAA,cAAC,OAAI,UAAU,0BACbA,EAAA,cAACI,EAAA,IAAS,CACZ,EACAJ,EAAA,cAACC,EAAA,CAAK,KAAMA,EAAK,MAAM,WAAYmC,CAAM,CAC3C,EACE,IACN,CACF,CAEJ,CACF,EAGA5B,EAAa,YAAc,YAE3B,MAAMgC,EAGF,OAAO,OAAOhC,EAAc,CAAE,OAAAH,EAAQ,SAAAC,CAAS,CAAC,EAEpD,IAAOmC,GAAQD",
|
|
6
|
+
"names": ["cn", "React", "Text", "useInputValidation", "SvgInfo", "SvgError", "themes", "variants", "useEffect", "RefTextInput", "_a", "ref", "_b", "customErrorMessages", "defaultValue", "disabled", "hasError", "helpText", "label", "leadingIcon", "maxLength", "name", "onChange", "placeholder", "required", "theme", "trailingIcon", "type", "variant", "restProps", "__objRest", "count", "setCount", "isError", "setIsError", "validationOnChange", "onInvalid", "error", "isMaxLengthValid", "__spreadValues", "e", "TextInput", "text_input_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InputHtmlProps, ObjectValues } from '../types';
|
|
2
|
+
import { Messages } from '../use-input-validation.types';
|
|
3
|
+
export declare const themes: {
|
|
4
|
+
readonly dark: "dark";
|
|
5
|
+
readonly light: "light";
|
|
6
|
+
};
|
|
7
|
+
export declare const variants: {
|
|
8
|
+
small: string;
|
|
9
|
+
large: string;
|
|
10
|
+
};
|
|
11
|
+
export type TextInput = {
|
|
12
|
+
customErrorMessages?: Messages;
|
|
13
|
+
hasError?: boolean;
|
|
14
|
+
helpText?: string;
|
|
15
|
+
label: string;
|
|
16
|
+
leadingIcon?: React.ReactNode;
|
|
17
|
+
name: string;
|
|
18
|
+
theme?: ObjectValues<typeof themes>;
|
|
19
|
+
trailingIcon?: React.ReactNode;
|
|
20
|
+
variant?: ObjectValues<typeof variants>;
|
|
21
|
+
} & InputHtmlProps;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../react/text-input/text-input.types.ts"],
|
|
4
|
+
"sourcesContent": ["import { InputHtmlProps, ObjectValues } from '../types';\nimport { Messages } from '../use-input-validation.types';\n\nexport const themes = {\n dark: 'dark',\n light: 'light',\n} as const;\n\nexport const variants = {\n small: 'small',\n large: 'large',\n};\n\nexport type TextInput = {\n customErrorMessages?: Messages;\n hasError?: boolean;\n helpText?: string;\n label: string;\n leadingIcon?: React.ReactNode;\n name: string;\n theme?: ObjectValues<typeof themes>;\n trailingIcon?: React.ReactNode;\n variant?: ObjectValues<typeof variants>;\n} & InputHtmlProps;\n"],
|
|
5
|
+
"mappings": "AAGO,MAAMA,EAAS,CACpB,KAAM,OACN,MAAO,OACT,EAEaC,EAAW,CACtB,MAAO,QACP,MAAO,OACT",
|
|
6
|
+
"names": ["themes", "variants"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const Toggle: React.ForwardRefExoticComponent<Omit<import("../types").InputHtmlProps, "value"> & {
|
|
3
|
+
isLabelVisible?: boolean;
|
|
4
|
+
label: string;
|
|
5
|
+
labelPosition?: "left" | "right";
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
spaceBetween?: boolean;
|
|
9
|
+
testId?: string;
|
|
10
|
+
} & {
|
|
11
|
+
children?: React.ReactNode | undefined;
|
|
12
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
13
|
+
export default Toggle;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var w=Object.defineProperty;var r=Object.getOwnPropertySymbols;var m=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;var d=(o,n,e)=>n in o?w(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e,p=(o,n)=>{for(var e in n||(n={}))m.call(n,e)&&d(o,e,n[e]);if(r)for(var e of r(n))s.call(n,e)&&d(o,e,n[e]);return o};var _=(o,n)=>{var e={};for(var t in o)m.call(o,t)&&n.indexOf(t)<0&&(e[t]=o[t]);if(o!=null&&r)for(var t of r(o))n.indexOf(t)<0&&s.call(o,t)&&(e[t]=o[t]);return e};import v from"classnames";import*as a from"react";import f from"../text";import P from"../use-input-validation";const b=a.forwardRef((k,I)=>{var i=k,{children:o,isLabelVisible:n=!0,label:e,labelPosition:t="right",name:u,value:h="",spaceBetween:N,testId:c}=i,l=_(i,["children","isLabelVisible","label","labelPosition","name","value","spaceBetween","testId"]);const[T,x,C]=P();return a.createElement("div",{className:v("toggle",{"toggle--error":C})},a.createElement("label",{className:v("toggle__content",{"toggle__content--space-between":N}),"data-testid":c},n&&t==="left"&&a.createElement("div",{className:"toggle__label"},a.createElement(f,null,e),o),a.createElement("div",{className:"toggle__button-wrap"},a.createElement("input",p({"aria-label":n?void 0:e,className:"toggle__input",type:"checkbox",name:u,onChange:g=>{l.onChange&&l.onChange(g),T(g)},onInvalid:g=>{l.onInvalid&&l.onInvalid(g),x(g)},ref:I,value:h},l)),a.createElement("span",{className:"toggle__slider"},a.createElement("div",{className:"toggle__slider-element"}))),n&&t==="right"&&a.createElement("div",{className:"toggle__label"},a.createElement(f,null,e),o)))});var q=b;export{q as default};
|
|
2
|
+
//# sourceMappingURL=toggle.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../react/toggle/toggle.tsx"],
|
|
4
|
+
"sourcesContent": ["import cn from 'classnames';\nimport * as React from 'react';\n\nimport Text from '../text';\nimport useInputValidation from '../use-input-validation';\n\nimport { Toggle as Props } from './toggle.types';\n\nconst Toggle = React.forwardRef<\n HTMLInputElement,\n React.PropsWithChildren<Props>\n>(\n (\n {\n children,\n isLabelVisible = true,\n label,\n labelPosition = 'right',\n name,\n value = '',\n spaceBetween,\n testId,\n ...rest\n },\n ref,\n ) => {\n const [onChange, onInvalid, error] = useInputValidation();\n\n return (\n <div\n className={cn('toggle', {\n 'toggle--error': error,\n })}\n >\n <label\n className={cn('toggle__content', {\n 'toggle__content--space-between': spaceBetween,\n })}\n data-testid={testId}\n >\n {isLabelVisible && labelPosition === 'left' && (\n <div className=\"toggle__label\">\n <Text>{label}</Text>\n {children}\n </div>\n )}\n\n <div className=\"toggle__button-wrap\">\n <input\n aria-label={isLabelVisible ? undefined : label}\n className=\"toggle__input\"\n type=\"checkbox\"\n name={name}\n onChange={e => {\n // NOTE: If props specify an `onChange`, we need to call that too\n if (rest.onChange) rest.onChange(e);\n onChange(e);\n }}\n onInvalid={e => {\n // NOTE: If props specify an `onInvalid`, we need to call that too\n if (rest.onInvalid) rest.onInvalid(e);\n onInvalid(e);\n }}\n ref={ref}\n value={value}\n {...rest}\n />\n <span className=\"toggle__slider\">\n <div className=\"toggle__slider-element\"></div>\n </span>\n </div>\n\n {isLabelVisible && labelPosition === 'right' && (\n <div className=\"toggle__label\">\n <Text>{label}</Text>\n {children}\n </div>\n )}\n </label>\n </div>\n );\n },\n);\n\nexport default Toggle;\n"],
|
|
5
|
+
"mappings": "2fAAA,OAAOA,MAAQ,aACf,UAAYC,MAAW,QAEvB,OAAOC,MAAU,UACjB,OAAOC,MAAwB,0BAI/B,MAAMC,EAASH,EAAM,WAInB,CACEI,EAWAC,IACG,CAZH,IAAAC,EAAAF,EACE,UAAAG,EACA,eAAAC,EAAiB,GACjB,MAAAC,EACA,cAAAC,EAAgB,QAChB,KAAAC,EACA,MAAAC,EAAQ,GACR,aAAAC,EACA,OAAAC,CArBN,EAaIR,EASKS,EAAAC,EATLV,EASK,CARH,WACA,iBACA,QACA,gBACA,OACA,QACA,eACA,WAKF,KAAM,CAACW,EAAUC,EAAWC,CAAK,EAAIjB,EAAmB,EAExD,OACEF,EAAA,cAAC,OACC,UAAWD,EAAG,SAAU,CACtB,gBAAiBoB,CACnB,CAAC,GAEDnB,EAAA,cAAC,SACC,UAAWD,EAAG,kBAAmB,CAC/B,iCAAkCc,CACpC,CAAC,EACD,cAAaC,GAEZN,GAAkBE,IAAkB,QACnCV,EAAA,cAAC,OAAI,UAAU,iBACbA,EAAA,cAACC,EAAA,KAAMQ,CAAM,EACZF,CACH,EAGFP,EAAA,cAAC,OAAI,UAAU,uBACbA,EAAA,cAAC,QAAAoB,EAAA,CACC,aAAYZ,EAAiB,OAAYC,EACzC,UAAU,gBACV,KAAK,WACL,KAAME,EACN,SAAUU,GAAK,CAETN,EAAK,UAAUA,EAAK,SAASM,CAAC,EAClCJ,EAASI,CAAC,CACZ,EACA,UAAWA,GAAK,CAEVN,EAAK,WAAWA,EAAK,UAAUM,CAAC,EACpCH,EAAUG,CAAC,CACb,EACA,IAAKhB,EACL,MAAOO,GACHG,EACN,EACAf,EAAA,cAAC,QAAK,UAAU,kBACdA,EAAA,cAAC,OAAI,UAAU,yBAAyB,CAC1C,CACF,EAECQ,GAAkBE,IAAkB,SACnCV,EAAA,cAAC,OAAI,UAAU,iBACbA,EAAA,cAACC,EAAA,KAAMQ,CAAM,EACZF,CACH,CAEJ,CACF,CAEJ,CACF,EAEA,IAAOe,EAAQnB",
|
|
6
|
+
"names": ["cn", "React", "Text", "useInputValidation", "Toggle", "_a", "ref", "_b", "children", "isLabelVisible", "label", "labelPosition", "name", "value", "spaceBetween", "testId", "rest", "__objRest", "onChange", "onInvalid", "error", "__spreadValues", "e", "toggle_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputHtmlProps } from '../types';
|
|
2
|
+
export type Toggle = Omit<InputHtmlProps, 'value'> & {
|
|
3
|
+
isLabelVisible?: boolean;
|
|
4
|
+
label: string;
|
|
5
|
+
labelPosition?: 'left' | 'right';
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
spaceBetween?: boolean;
|
|
9
|
+
testId?: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=toggle.types.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var x=Object.defineProperty,b=Object.defineProperties;var u=Object.getOwnPropertyDescriptors;var e=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var n=(p,o,s)=>o in p?x(p,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):p[o]=s,l=(p,o)=>{for(var s in o||(o={}))f.call(o,s)&&n(p,s,o[s]);if(e)for(var s of e(o))_.call(o,s)&&n(p,s,o[s]);return p},a=(p,o)=>b(p,u(o));import t from"react";import{Types as T}from"./toolbox.types";import r from"../text";import y from"../hidden-input";const N=({items:p})=>t.createElement("div",{className:"toolbox"},p.map(({item:o,icon:s},d)=>t.createElement("div",{className:"toolbox__item-wrapper",key:d},o.type===T.Link?t.createElement("a",a(l({},o.props.link),{className:"toolbox__item"}),s||null,t.createElement(r,{size:r.sizes.small},o.props.text)):t.createElement("form",l({onSubmit:o.props.handleSubmit,method:"POST",className:"toolbox__list-item-form"},o.props.form),t.createElement("button",l({className:"toolbox__item","data-testid":o.props.testId},o.props.button),s||null,t.createElement(r,{size:r.sizes.small},o.props.text)),o.props.hiddenInputs?o.props.hiddenInputs.map((m,i)=>t.createElement(y,l({key:m.name+i},m))):null))));var P=N;export{P as default};
|
|
2
|
+
//# sourceMappingURL=toolbox.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../react/toolbox/toolbox.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\n\nimport { Types, type Toolbox as Props } from './toolbox.types';\nimport Text from '../text';\nimport HiddenInput from '../hidden-input';\n\nconst Toolbox: React.FunctionComponent<Props> = ({ items }) => (\n <div className=\"toolbox\">\n {items.map(({ item, icon }, i) => (\n <div className=\"toolbox__item-wrapper\" key={i}>\n {item.type === Types.Link ? (\n <a {...item.props.link} className=\"toolbox__item\">\n {icon ? icon : null}\n <Text size={Text.sizes.small}>{item.props.text}</Text>\n </a>\n ) : (\n <form\n onSubmit={item.props.handleSubmit}\n method=\"POST\"\n className=\"toolbox__list-item-form\"\n {...item.props.form}\n >\n <button\n className=\"toolbox__item\"\n data-testid={item.props.testId}\n {...item.props.button}\n >\n {icon ? icon : null}\n <Text size={Text.sizes.small}>{item.props.text}</Text>\n </button>\n {item.props.hiddenInputs\n ? item.props.hiddenInputs.map((input, index) => (\n <HiddenInput key={input.name + index} {...input} />\n ))\n : null}\n </form>\n )}\n </div>\n ))}\n </div>\n);\n\nexport default Toolbox;\n"],
|
|
5
|
+
"mappings": "6aAAA,OAAOA,MAAW,QAElB,OAAS,SAAAC,MAAoC,kBAC7C,OAAOC,MAAU,UACjB,OAAOC,MAAiB,kBAExB,MAAMC,EAA0C,CAAC,CAAE,MAAAC,CAAM,IACvDL,EAAA,cAAC,OAAI,UAAU,WACZK,EAAM,IAAI,CAAC,CAAE,KAAAC,EAAM,KAAAC,CAAK,EAAGC,IAC1BR,EAAA,cAAC,OAAI,UAAU,wBAAwB,IAAKQ,GACzCF,EAAK,OAASL,EAAM,KACnBD,EAAA,cAAC,IAAAS,EAAAC,EAAA,GAAMJ,EAAK,MAAM,MAAjB,CAAuB,UAAU,kBAC/BC,GAAc,KACfP,EAAA,cAACE,EAAA,CAAK,KAAMA,EAAK,MAAM,OAAQI,EAAK,MAAM,IAAK,CACjD,EAEAN,EAAA,cAAC,OAAAU,EAAA,CACC,SAAUJ,EAAK,MAAM,aACrB,OAAO,OACP,UAAU,2BACNA,EAAK,MAAM,MAEfN,EAAA,cAAC,SAAAU,EAAA,CACC,UAAU,gBACV,cAAaJ,EAAK,MAAM,QACpBA,EAAK,MAAM,QAEdC,GAAc,KACfP,EAAA,cAACE,EAAA,CAAK,KAAMA,EAAK,MAAM,OAAQI,EAAK,MAAM,IAAK,CACjD,EACCA,EAAK,MAAM,aACRA,EAAK,MAAM,aAAa,IAAI,CAACK,EAAOC,IAClCZ,EAAA,cAACG,EAAAO,EAAA,CAAY,IAAKC,EAAM,KAAOC,GAAWD,EAAO,CAClD,EACD,IACN,CAEJ,CACD,CACH,EAGF,IAAOE,EAAQT",
|
|
6
|
+
"names": ["React", "Types", "Text", "HiddenInput", "Toolbox", "items", "item", "icon", "i", "__spreadProps", "__spreadValues", "input", "index", "toolbox_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { HiddenInput } from '../hidden-input/hidden-input.types';
|
|
3
|
+
import type { ButtonHtmlProps, FormHtmlProps, LinkHtmlProps } from '../types';
|
|
4
|
+
export declare enum Types {
|
|
5
|
+
Button = "Button",
|
|
6
|
+
Link = "Link"
|
|
7
|
+
}
|
|
8
|
+
type LinkItem = {
|
|
9
|
+
type: Types.Link;
|
|
10
|
+
props: {
|
|
11
|
+
text: string;
|
|
12
|
+
link: LinkHtmlProps;
|
|
13
|
+
testId?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
type FormItem = {
|
|
17
|
+
type: Types.Button;
|
|
18
|
+
props: {
|
|
19
|
+
text: string;
|
|
20
|
+
form: FormHtmlProps;
|
|
21
|
+
button: ButtonHtmlProps;
|
|
22
|
+
handleSubmit?: () => void;
|
|
23
|
+
hiddenInputs?: HiddenInput[];
|
|
24
|
+
testId?: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type MenuItem = {
|
|
28
|
+
icon?: ReactNode;
|
|
29
|
+
item: LinkItem | FormItem;
|
|
30
|
+
};
|
|
31
|
+
export type Toolbox = {
|
|
32
|
+
items: MenuItem[];
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../react/toolbox/toolbox.types.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ReactNode } from 'react';\n\nimport type { HiddenInput } from '../hidden-input/hidden-input.types';\nimport type { ButtonHtmlProps, FormHtmlProps, LinkHtmlProps } from '../types';\n\nexport enum Types {\n Button = 'Button',\n Link = 'Link',\n}\n\ntype LinkItem = {\n type: Types.Link;\n props: {\n text: string;\n link: LinkHtmlProps;\n testId?: string;\n };\n};\n\ntype FormItem = {\n type: Types.Button;\n props: {\n text: string;\n form: FormHtmlProps;\n button: ButtonHtmlProps;\n handleSubmit?: () => void;\n hiddenInputs?: HiddenInput[];\n testId?: string;\n };\n};\n\ntype MenuItem = {\n icon?: ReactNode;\n item: LinkItem | FormItem;\n};\n\nexport type Toolbox = {\n items: MenuItem[];\n};\n"],
|
|
5
|
+
"mappings": "AAKO,IAAKA,OACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OAFGA,OAAA",
|
|
6
|
+
"names": ["Types"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function debounce<T extends any[]>(callback: (...args: T) => void, wait: number): (...args: T) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../react/ts/debounce.ts"],
|
|
4
|
+
"sourcesContent": ["// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default function debounce<T extends any[]>(\n callback: (...args: T) => void,\n wait: number,\n) {\n let timerRef: number;\n\n return (...args: T) => {\n clearTimeout(timerRef);\n timerRef = window.setTimeout(() => callback(...args), wait);\n };\n}\n"],
|
|
5
|
+
"mappings": "AACe,SAARA,EACLC,EACAC,EACA,CACA,IAAIC,EAEJ,MAAO,IAAIC,IAAY,CACrB,aAAaD,CAAQ,EACrBA,EAAW,OAAO,WAAW,IAAMF,EAAS,GAAGG,CAAI,EAAGF,CAAI,CAC5D,CACF",
|
|
6
|
+
"names": ["debounce", "callback", "wait", "timerRef", "args"]
|
|
7
|
+
}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AnchorHTMLAttributes,
|
|
3
|
-
ButtonHTMLAttributes,
|
|
4
|
-
HTMLAttributes,
|
|
5
|
-
ImgHTMLAttributes,
|
|
6
|
-
InputHTMLAttributes,
|
|
7
|
-
OptionHTMLAttributes,
|
|
8
|
-
SelectHTMLAttributes,
|
|
9
|
-
TextareaHTMLAttributes,
|
|
10
|
-
FormHTMLAttributes,
|
|
11
|
-
} from 'react';
|
|
12
|
-
|
|
1
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, OptionHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, FormHTMLAttributes } from 'react';
|
|
13
2
|
/** Removes any generics from type, resulting in only the raw type:
|
|
14
3
|
```ts
|
|
15
4
|
// In editors, this type will sometimes show up as `NonNullable<{ a: string | null }>`
|
|
@@ -20,15 +9,11 @@ type X = NonNullable<{
|
|
|
20
9
|
type Y = Flatten<X>;
|
|
21
10
|
```
|
|
22
11
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
: never;
|
|
27
|
-
|
|
12
|
+
export type Flatten<T> = T extends infer T ? {
|
|
13
|
+
[key in keyof T]: T[key];
|
|
14
|
+
} : never;
|
|
28
15
|
/** Extracts the property value types from an object */
|
|
29
16
|
export type ObjectValues<T> = Flatten<T[keyof T]>;
|
|
30
|
-
|
|
31
|
-
// NOTE: The below types include all of the supported props for "html" react components (like `button` or `a`).
|
|
32
17
|
export type ButtonHtmlProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
33
18
|
export type DivHtmlProps = HTMLAttributes<HTMLDivElement>;
|
|
34
19
|
export type LinkHtmlProps = AnchorHTMLAttributes<HTMLAnchorElement>;
|
package/react/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Messages } from './use-input-validation.types';
|
|
2
|
+
type SupportedElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
3
|
+
declare const _default: (customMessages?: Messages, defaultError?: string, isError?: boolean) => [(e: React.ChangeEvent<SupportedElement>) => void, (e: React.FormEvent<SupportedElement>) => void, string | undefined];
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useRef as s,useState as c,useEffect as l}from"react";const f=(t,e)=>{if(t.badInput)return e.badInput;if(t.customError)return e.customError;if(t.patternMismatch)return e.patternMismatch;if(t.rangeOverflow)return e.rangeOverflow;if(t.rangeUnderflow)return e.rangeUnderflow;if(t.stepMismatch)return e.stepMismatch;if(t.tooLong)return e.tooLong;if(t.tooShort)return e.tooShort;if(t.typeMismatch)return e.typeMismatch;if(t.valueMissing)return e.valueMissing};var E=(t={},e,u)=>{const[i,o]=c(),p=s(!1);return l(()=>{o(u&&e?e:void 0)},[u,e]),[n=>{var r;const a=f(n.target.validity,t);o(a||((r=n.target)==null?void 0:r.validationMessage)||void 0)},n=>{var r;p.current=!0;const a=f(n.target.validity,t);o(a||((r=n.target)==null?void 0:r.validationMessage))},i]};export{E as default};
|
|
2
|
+
//# sourceMappingURL=use-input-validation.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../react/use-input-validation.ts"],
|
|
4
|
+
"sourcesContent": ["import { useRef, useState, useEffect } from 'react';\n\nimport { Messages } from './use-input-validation.types';\n\ntype SupportedElement =\n | HTMLInputElement\n | HTMLSelectElement\n | HTMLTextAreaElement;\n\nconst getCustomMessage = (validity: ValidityState, messages: Messages) => {\n if (validity.badInput) return messages.badInput;\n if (validity.customError) return messages.customError;\n if (validity.patternMismatch) return messages.patternMismatch;\n if (validity.rangeOverflow) return messages.rangeOverflow;\n if (validity.rangeUnderflow) return messages.rangeUnderflow;\n if (validity.stepMismatch) return messages.stepMismatch;\n if (validity.tooLong) return messages.tooLong;\n if (validity.tooShort) return messages.tooShort;\n if (validity.typeMismatch) return messages.typeMismatch;\n if (validity.valueMissing) return messages.valueMissing;\n return undefined;\n};\n\nexport default (\n customMessages: Messages = {},\n defaultError?: string,\n isError?: boolean,\n) => {\n const [error, setError] = useState<string | undefined>();\n const validationEnabled = useRef(false);\n\n useEffect(() => {\n if (isError && defaultError) {\n setError(defaultError);\n } else {\n setError(undefined);\n }\n }, [isError, defaultError]);\n\n const onInvalid = (e: React.FormEvent<SupportedElement>) => {\n validationEnabled.current = true;\n\n const message = getCustomMessage(\n (e.target as HTMLInputElement).validity,\n customMessages,\n );\n setError(message || (e.target as HTMLInputElement)?.validationMessage);\n };\n\n const onChange = (e: React.ChangeEvent<SupportedElement>) => {\n const message = getCustomMessage(e.target.validity, customMessages);\n setError(message || e.target?.validationMessage || undefined);\n };\n\n return [onChange, onInvalid, error] as [\n typeof onChange,\n typeof onInvalid,\n typeof error,\n ];\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,UAAAA,EAAQ,YAAAC,EAAU,aAAAC,MAAiB,QAS5C,MAAMC,EAAmB,CAACC,EAAyBC,IAAuB,CACxE,GAAID,EAAS,SAAU,OAAOC,EAAS,SACvC,GAAID,EAAS,YAAa,OAAOC,EAAS,YAC1C,GAAID,EAAS,gBAAiB,OAAOC,EAAS,gBAC9C,GAAID,EAAS,cAAe,OAAOC,EAAS,cAC5C,GAAID,EAAS,eAAgB,OAAOC,EAAS,eAC7C,GAAID,EAAS,aAAc,OAAOC,EAAS,aAC3C,GAAID,EAAS,QAAS,OAAOC,EAAS,QACtC,GAAID,EAAS,SAAU,OAAOC,EAAS,SACvC,GAAID,EAAS,aAAc,OAAOC,EAAS,aAC3C,GAAID,EAAS,aAAc,OAAOC,EAAS,YAE7C,EAEA,IAAOC,EAAQ,CACbC,EAA2B,CAAC,EAC5BC,EACAC,IACG,CACH,KAAM,CAACC,EAAOC,CAAQ,EAAIV,EAA6B,EACjDW,EAAoBZ,EAAO,EAAK,EAEtC,OAAAE,EAAU,IAAM,CAEZS,EADEF,GAAWD,EACJA,EAEA,MAFY,CAIzB,EAAG,CAACC,EAASD,CAAY,CAAC,EAiBnB,CALWK,GAA2C,CAjD/D,IAAAC,EAkDI,MAAMC,EAAUZ,EAAiBU,EAAE,OAAO,SAAUN,CAAc,EAClEI,EAASI,KAAWD,EAAAD,EAAE,SAAF,YAAAC,EAAU,oBAAqB,MAAS,CAC9D,EAbmBD,GAAyC,CAvC9D,IAAAC,EAwCIF,EAAkB,QAAU,GAE5B,MAAMG,EAAUZ,EACbU,EAAE,OAA4B,SAC/BN,CACF,EACAI,EAASI,KAAYD,EAAAD,EAAE,SAAF,YAAAC,EAA+B,kBAAiB,CACvE,EAO6BJ,CAAK,CAKpC",
|
|
6
|
+
"names": ["useRef", "useState", "useEffect", "getCustomMessage", "validity", "messages", "use_input_validation_default", "customMessages", "defaultError", "isError", "error", "setError", "validationEnabled", "e", "_a", "message"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Messages = {
|
|
2
|
+
badInput?: string;
|
|
3
|
+
customError?: string;
|
|
4
|
+
defaultError?: string;
|
|
5
|
+
patternMismatch?: string;
|
|
6
|
+
rangeOverflow?: string;
|
|
7
|
+
rangeUnderflow?: string;
|
|
8
|
+
stepMismatch?: string;
|
|
9
|
+
tooLong?: string;
|
|
10
|
+
tooShort?: string;
|
|
11
|
+
typeMismatch?: string;
|
|
12
|
+
valueMissing?: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=use-input-validation.types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../react/visually-button/index.ts"],
|
|
4
|
+
"sourcesContent": ["import VisuallyButton from './visually-button';\nexport default VisuallyButton;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAoB,oBAC3B,IAAOC,EAAQD",
|
|
6
|
+
"names": ["VisuallyButton", "visually_button_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ValueOf } from '../indexed-access-type';
|
|
2
|
+
import { sizes as textSizes, themes as textThemes } from '../text/text.types';
|
|
3
|
+
import { variants, sizes } from './visually-button.types';
|
|
4
|
+
export declare const italicMap: Partial<Record<ValueOf<typeof variants>, true>>;
|
|
5
|
+
export declare const sizeMap: Record<keyof typeof sizes, keyof typeof textSizes>;
|
|
6
|
+
export declare const themeMap: Record<ValueOf<typeof variants>, keyof typeof textThemes>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{sizes as s,themes as e}from"../text/text.types";const o={cta:!0,"cta-secondary":!0,"cta-secondary-white":!0},p={small:s.small,basic:s.basic,large:s.large},c={complete:e.emphasis,cta:e.headline,"cta-secondary":e.headline,"cta-secondary-white":e.headline,primary:e.emphasis,"primary-destructive":e.emphasis,"primary-white":e.emphasis,secondary:e.emphasis,"secondary-white":e.emphasis,"secondary-destructive":e.emphasis,tertiary:e.emphasis,"tertiary-destructive":e.emphasis,"fixed-tertiary":e.emphasis,waitlist:e.emphasis,"waitlist-secondary":e.emphasis};export{o as italicMap,p as sizeMap,c as themeMap};
|
|
2
|
+
//# sourceMappingURL=maps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../react/visually-button/maps.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ValueOf } from '../indexed-access-type';\nimport { sizes as textSizes, themes as textThemes } from '../text/text.types';\nimport { variants, sizes } from './visually-button.types';\n\nexport const italicMap: Partial<Record<ValueOf<typeof variants>, true>> = {\n cta: true,\n 'cta-secondary': true,\n 'cta-secondary-white': true,\n};\n\nexport const sizeMap: Record<keyof typeof sizes, keyof typeof textSizes> = {\n small: textSizes.small,\n basic: textSizes.basic,\n large: textSizes.large,\n};\n\nexport const themeMap: Record<\n ValueOf<typeof variants>,\n keyof typeof textThemes\n> = {\n complete: textThemes.emphasis,\n cta: textThemes.headline,\n 'cta-secondary': textThemes.headline,\n 'cta-secondary-white': textThemes.headline,\n primary: textThemes.emphasis,\n 'primary-destructive': textThemes.emphasis,\n 'primary-white': textThemes.emphasis,\n secondary: textThemes.emphasis,\n 'secondary-white': textThemes.emphasis,\n 'secondary-destructive': textThemes.emphasis,\n tertiary: textThemes.emphasis,\n 'tertiary-destructive': textThemes.emphasis,\n 'fixed-tertiary': textThemes.emphasis,\n waitlist: textThemes.emphasis,\n 'waitlist-secondary': textThemes.emphasis,\n};\n"],
|
|
5
|
+
"mappings": "AACA,OAAS,SAASA,EAAW,UAAUC,MAAkB,qBAGlD,MAAMC,EAA6D,CACxE,IAAK,GACL,gBAAiB,GACjB,sBAAuB,EACzB,EAEaC,EAA8D,CACzE,MAAOH,EAAU,MACjB,MAAOA,EAAU,MACjB,MAAOA,EAAU,KACnB,EAEaI,EAGT,CACF,SAAUH,EAAW,SACrB,IAAKA,EAAW,SAChB,gBAAiBA,EAAW,SAC5B,sBAAuBA,EAAW,SAClC,QAASA,EAAW,SACpB,sBAAuBA,EAAW,SAClC,gBAAiBA,EAAW,SAC5B,UAAWA,EAAW,SACtB,kBAAmBA,EAAW,SAC9B,wBAAyBA,EAAW,SACpC,SAAUA,EAAW,SACrB,uBAAwBA,EAAW,SACnC,iBAAkBA,EAAW,SAC7B,SAAUA,EAAW,SACrB,qBAAsBA,EAAW,QACnC",
|
|
6
|
+
"names": ["textSizes", "textThemes", "italicMap", "sizeMap", "themeMap"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { sizes, variants, type VisuallyButton as Props } from './visually-button.types';
|
|
3
|
+
declare const VisuallyButtonRef: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
|
|
4
|
+
declare const VisuallyButton: typeof VisuallyButtonRef & {
|
|
5
|
+
sizes: typeof sizes;
|
|
6
|
+
variants: typeof variants;
|
|
7
|
+
};
|
|
8
|
+
export default VisuallyButton;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var z=Object.defineProperty,L=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var u=Object.getOwnPropertySymbols;var c=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable;var m=(t,s,l)=>s in t?z(t,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[s]=l,b=(t,s)=>{for(var l in s||(s={}))c.call(s,l)&&m(t,l,s[l]);if(u)for(var l of u(s))d.call(s,l)&&m(t,l,s[l]);return t},f=(t,s)=>L(t,T(s));var h=(t,s)=>{var l={};for(var o in t)c.call(t,o)&&s.indexOf(o)<0&&(l[o]=t[o]);if(t!=null&&u)for(var o of u(t))s.indexOf(o)<0&&d.call(t,o)&&(l[o]=t[o]);return l};import j from"classnames";import*as i from"react";import E from"../text";import{italicMap as P,sizeMap as $,themeMap as g}from"./maps";import{sizes as x,variants as _}from"./visually-button.types";const C=i.forwardRef((O,M)=>{var v=O,{iconOnly:t,className:s,elementName:l,leadingIcon:o,trailingIcon:e,hasStackedIcon:w,size:r=x.basic,spinning:p,testId:B,text:y,variant:n=_.primary,wide:N}=v,k=h(v,["iconOnly","className","elementName","leadingIcon","trailingIcon","hasStackedIcon","size","spinning","testId","text","variant","wide"]);const a=!!(t&&!!(o||e)),V=a&&l==="div"?"img":void 0;return i.createElement(l,f(b({"aria-label":a?y:void 0,className:j("visually-button",{"visually-button--icon":a,"visually-button--icon-text":(o||e)&&!t,"visually-button--icon-text--stacked":w,[`visually-button--size-${r}`]:r,"visually-button--spinning":p,[`visually-button--variant-${n}`]:n,"visually-button--wide":N},s),"data-testid":B,role:V},k),{ref:M}),o?i.createElement("div",{className:"visually-button__icon"},o):null,a?null:i.createElement(E,{className:"visually-button__text",italic:P[n],size:$[r],theme:g[n],elementName:"span"},y),e?i.createElement("div",{className:"visually-button__icon"},e):null,p?i.createElement("div",{className:"visually-button__spinner"},i.createElement("svg",{className:"visually-button__spinner-icon",width:"24px",height:"24px",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",xmlns:"http://www.w3.org/2000/svg"},i.createElement("circle",{opacity:"0.1",cx:"12",cy:"12",r:"10"}),i.createElement("path",{d:"M12 2C13.9778 2 15.9112 2.58649 17.5557 3.6853C19.2002 4.78412 20.4819 6.3459 21.2388 8.17316C21.9957 10.0004 22.1937 12.0111 21.8079 13.9509C21.422 15.8907 20.4696 17.6725 19.0711 19.0711C17.6725 20.4696 15.8907 21.422 13.9509 21.8079C12.0111 22.1937 10.0004 21.9957 8.17317 21.2388C6.3459 20.4819 4.78412 19.2002 3.6853 17.5557C2.58649 15.9112 2 13.9778 2 12",strokeLinecap:"round",strokeLinejoin:"round"}))):null)});C.displayName="VisuallyButton";const H=Object.assign(C,{sizes:x,variants:_});var J=H;export{J as default};
|
|
2
|
+
//# sourceMappingURL=visually-button.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../react/visually-button/visually-button.tsx"],
|
|
4
|
+
"sourcesContent": ["import cn from 'classnames';\nimport * as React from 'react';\n\nimport Text from '../text';\n\nimport { italicMap, sizeMap, themeMap } from './maps';\nimport {\n sizes,\n variants,\n type VisuallyButton as Props,\n} from './visually-button.types';\n\nconst VisuallyButtonRef = React.forwardRef<HTMLElement, Props>(\n (\n {\n iconOnly,\n className,\n elementName,\n leadingIcon,\n trailingIcon,\n hasStackedIcon,\n size = sizes.basic,\n spinning,\n testId,\n text,\n variant = variants.primary,\n wide,\n ...rest\n },\n ref,\n ) => {\n const hasIcon = Boolean(leadingIcon || trailingIcon);\n const renderIconOnly = Boolean(iconOnly && hasIcon);\n const role = renderIconOnly && elementName === 'div' ? 'img' : undefined;\n\n return React.createElement(\n elementName,\n {\n 'aria-label': renderIconOnly ? text : undefined,\n className: cn(\n 'visually-button',\n {\n 'visually-button--icon': renderIconOnly,\n 'visually-button--icon-text':\n (leadingIcon || trailingIcon) && !iconOnly,\n 'visually-button--icon-text--stacked': hasStackedIcon,\n [`visually-button--size-${size}`]: size,\n 'visually-button--spinning': spinning,\n [`visually-button--variant-${variant}`]: variant,\n 'visually-button--wide': wide,\n },\n className,\n ),\n 'data-testid': testId,\n role,\n ...rest,\n ref,\n },\n leadingIcon ? (\n <div className=\"visually-button__icon\">{leadingIcon}</div>\n ) : null,\n renderIconOnly ? null : (\n <Text\n className=\"visually-button__text\"\n italic={italicMap[variant]}\n size={sizeMap[size]}\n theme={themeMap[variant]}\n elementName=\"span\"\n >\n {text}\n </Text>\n ),\n trailingIcon ? (\n <div className=\"visually-button__icon\">{trailingIcon}</div>\n ) : null,\n spinning ? (\n <div className=\"visually-button__spinner\">\n <svg\n className=\"visually-button__spinner-icon\"\n width=\"24px\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle opacity=\"0.1\" cx=\"12\" cy=\"12\" r=\"10\" />\n <path\n d=\"M12 2C13.9778 2 15.9112 2.58649 17.5557 3.6853C19.2002 4.78412 20.4819 6.3459 21.2388 8.17316C21.9957 10.0004 22.1937 12.0111 21.8079 13.9509C21.422 15.8907 20.4696 17.6725 19.0711 19.0711C17.6725 20.4696 15.8907 21.422 13.9509 21.8079C12.0111 22.1937 10.0004 21.9957 8.17317 21.2388C6.3459 20.4819 4.78412 19.2002 3.6853 17.5557C2.58649 15.9112 2 13.9778 2 12\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n ) : null,\n );\n },\n);\n\nVisuallyButtonRef.displayName = 'VisuallyButton';\n\nconst VisuallyButton: typeof VisuallyButtonRef & {\n sizes: typeof sizes;\n variants: typeof variants;\n} = Object.assign(VisuallyButtonRef, {\n sizes,\n variants,\n});\n\nexport default VisuallyButton;\n"],
|
|
5
|
+
"mappings": "+kBAAA,OAAOA,MAAQ,aACf,UAAYC,MAAW,QAEvB,OAAOC,MAAU,UAEjB,OAAS,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,SAC7C,OACE,SAAAC,EACA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,8BAENA,EAAA,cAAC,UAAO,QAAQ,MAAM,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,EAC7CA,EAAA,cAAC,QACC,EAAE,2WACF,cAAc,QACd,eAAe,QACjB,CACF,CACF,EACE,IACN,CACF,CACF,EAEAO,EAAkB,YAAc,iBAEhC,MAAMsB,EAGF,OAAO,OAAOtB,EAAmB,CACnC,MAAAF,EACA,SAAAC,CACF,CAAC,EAED,IAAOwB,EAAQD",
|
|
6
|
+
"names": ["cn", "React", "Text", "italicMap", "sizeMap", "themeMap", "sizes", "variants", "VisuallyButtonRef", "_a", "ref", "_b", "iconOnly", "className", "elementName", "leadingIcon", "trailingIcon", "hasStackedIcon", "size", "spinning", "testId", "text", "variant", "wide", "rest", "__objRest", "renderIconOnly", "role", "__spreadProps", "__spreadValues", "VisuallyButton", "visually_button_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { ButtonHtmlProps, DivHtmlProps, LinkHtmlProps, ObjectValues } from '../types';
|
|
3
|
+
export declare const sizes: {
|
|
4
|
+
readonly small: "small";
|
|
5
|
+
readonly basic: "basic";
|
|
6
|
+
readonly large: "large";
|
|
7
|
+
};
|
|
8
|
+
export declare const variants: {
|
|
9
|
+
readonly complete: "complete";
|
|
10
|
+
readonly cta: "cta";
|
|
11
|
+
readonly ctaSecondary: "cta-secondary";
|
|
12
|
+
readonly ctaSecondaryWhite: "cta-secondary-white";
|
|
13
|
+
readonly primary: "primary";
|
|
14
|
+
readonly primaryDestructive: "primary-destructive";
|
|
15
|
+
readonly primaryWhite: "primary-white";
|
|
16
|
+
readonly secondary: "secondary";
|
|
17
|
+
readonly secondaryWhite: "secondary-white";
|
|
18
|
+
readonly secondaryDestructive: "secondary-destructive";
|
|
19
|
+
readonly tertiary: "tertiary";
|
|
20
|
+
readonly tertiaryDestructive: "tertiary-destructive";
|
|
21
|
+
readonly fixedTertiary: "fixed-tertiary";
|
|
22
|
+
readonly waitlist: "waitlist";
|
|
23
|
+
readonly waitlistSecondary: "waitlist-secondary";
|
|
24
|
+
};
|
|
25
|
+
type CommonProps<ElementName extends string> = {
|
|
26
|
+
className?: string;
|
|
27
|
+
elementName: ElementName;
|
|
28
|
+
hasStackedIcon?: boolean;
|
|
29
|
+
iconOnly?: boolean;
|
|
30
|
+
leadingIcon?: ReactElement;
|
|
31
|
+
size?: ObjectValues<typeof sizes>;
|
|
32
|
+
spinning?: boolean;
|
|
33
|
+
testId?: string;
|
|
34
|
+
text: string;
|
|
35
|
+
trailingIcon?: ReactElement;
|
|
36
|
+
variant?: ObjectValues<typeof variants>;
|
|
37
|
+
wide?: boolean;
|
|
38
|
+
};
|
|
39
|
+
type Props<ElementProps, ElementName extends string> = ElementProps & CommonProps<ElementName>;
|
|
40
|
+
export type VisuallyButtonButton = Props<ButtonHtmlProps, 'button'>;
|
|
41
|
+
export type VisuallyButtonDiv = Props<DivHtmlProps, 'div'>;
|
|
42
|
+
export type VisuallyButtonLink = Props<LinkHtmlProps, 'a'> & {
|
|
43
|
+
href: string;
|
|
44
|
+
};
|
|
45
|
+
export type VisuallyButton = VisuallyButtonButton | VisuallyButtonDiv | VisuallyButtonLink;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const t={small:"small",basic:"basic",large:"large"},e={complete:"complete",cta:"cta",ctaSecondary:"cta-secondary",ctaSecondaryWhite:"cta-secondary-white",primary:"primary",primaryDestructive:"primary-destructive",primaryWhite:"primary-white",secondary:"secondary",secondaryWhite:"secondary-white",secondaryDestructive:"secondary-destructive",tertiary:"tertiary",tertiaryDestructive:"tertiary-destructive",fixedTertiary:"fixed-tertiary",waitlist:"waitlist",waitlistSecondary:"waitlist-secondary"};export{t as sizes,e as variants};
|
|
2
|
+
//# sourceMappingURL=visually-button.types.js.map
|