@doist/reactist 10.0.0 → 11.2.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/dist/reactist.cjs.development.js +3031 -1700
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +34 -20
- package/es/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/es/components/{button/button.js → deprecated-button/deprecated-button.js} +8 -3
- package/es/components/deprecated-button/deprecated-button.js.map +1 -0
- package/es/components/{button → deprecated-button}/index.js +1 -1
- package/es/components/{avatar → deprecated-button}/index.js.map +0 -0
- package/es/components/{loading/loading.js → deprecated-loading/deprecated-loading.js} +3 -1
- package/es/components/deprecated-loading/deprecated-loading.js.map +1 -0
- package/es/components/{modal/modal.js → deprecated-modal/deprecated-modal.js} +14 -6
- package/es/components/deprecated-modal/deprecated-modal.js.map +1 -0
- package/es/components/{modal → deprecated-modal}/index.js +1 -1
- package/es/components/deprecated-modal/index.js.map +1 -0
- package/es/components/dropdown/dropdown.js +5 -3
- package/es/components/dropdown/dropdown.js.map +1 -1
- package/es/components/key-capturer/key-capturer.js +1 -1
- package/es/components/key-capturer/key-capturer.js.map +1 -1
- package/es/components/keyboard-shortcut/keyboard-shortcut.js +3 -2
- package/es/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/es/components/menu/menu.js +53 -30
- package/es/components/menu/menu.js.map +1 -1
- package/es/components/notification/notification.js +9 -4
- package/es/components/notification/notification.js.map +1 -1
- package/es/components/popover/popover.js +1 -1
- package/es/components/popover/popover.js.map +1 -1
- package/es/components/popover/positioning-utils.js.map +1 -1
- package/es/components/progress-bar/progress-bar.js +8 -2
- package/es/components/progress-bar/progress-bar.js.map +1 -1
- package/es/components/select/select.js +4 -2
- package/es/components/select/select.js.map +1 -1
- package/es/components/time/time-utils.js.map +1 -1
- package/es/components/time/time.js +1 -1
- package/es/components/time/time.js.map +1 -1
- package/es/components/tooltip/tooltip.js +4 -2
- package/es/components/tooltip/tooltip.js.map +1 -1
- package/es/hooks/use-previous/use-previous.js +26 -0
- package/es/hooks/use-previous/use-previous.js.map +1 -0
- package/es/index.js +32 -13
- package/es/index.js.map +1 -1
- package/es/new-components/alert/alert.js +48 -0
- package/es/new-components/alert/alert.js.map +1 -0
- package/es/new-components/alert/alert.module.css.js +4 -0
- package/es/new-components/alert/alert.module.css.js.map +1 -0
- package/es/{components → new-components}/avatar/avatar.js +14 -8
- package/es/new-components/avatar/avatar.js.map +1 -0
- package/es/new-components/avatar/avatar.module.css.js +4 -0
- package/es/new-components/avatar/avatar.module.css.js.map +1 -0
- package/es/{components → new-components}/avatar/utils.js +0 -0
- package/es/new-components/avatar/utils.js.map +1 -0
- package/es/new-components/base-button/base-button.js +74 -0
- package/es/new-components/base-button/base-button.js.map +1 -0
- package/es/new-components/base-button/base-button.module.css.js +4 -0
- package/es/new-components/base-button/base-button.module.css.js.map +1 -0
- package/es/new-components/base-field/base-field.js +65 -0
- package/es/new-components/base-field/base-field.js.map +1 -0
- package/es/new-components/base-field/base-field.module.css.js +4 -0
- package/es/new-components/base-field/base-field.module.css.js.map +1 -0
- package/es/new-components/box/box.js +74 -0
- package/es/new-components/box/box.js.map +1 -0
- package/es/new-components/box/box.module.css.js +4 -0
- package/es/new-components/box/box.module.css.js.map +1 -0
- package/es/new-components/box/margin.module.css.js +4 -0
- package/es/new-components/box/margin.module.css.js.map +1 -0
- package/es/new-components/box/padding.module.css.js +4 -0
- package/es/new-components/box/padding.module.css.js.map +1 -0
- package/es/new-components/box/width.module.css.js +4 -0
- package/es/new-components/box/width.module.css.js.map +1 -0
- package/es/new-components/button/button.js +41 -0
- package/es/new-components/button/button.js.map +1 -0
- package/es/new-components/button-link/button-link.js +42 -0
- package/es/new-components/button-link/button-link.js.map +1 -0
- package/es/new-components/checkbox-field/checkbox-field.js +88 -0
- package/es/new-components/checkbox-field/checkbox-field.js.map +1 -0
- package/es/new-components/checkbox-field/checkbox-field.module.css.js +4 -0
- package/es/new-components/checkbox-field/checkbox-field.module.css.js.map +1 -0
- package/es/new-components/checkbox-field/checkbox-icon.js +61 -0
- package/es/new-components/checkbox-field/checkbox-icon.js.map +1 -0
- package/es/new-components/columns/columns.js +59 -0
- package/es/new-components/columns/columns.js.map +1 -0
- package/es/new-components/columns/columns.module.css.js +4 -0
- package/es/new-components/columns/columns.module.css.js.map +1 -0
- package/es/new-components/common-helpers.js +24 -0
- package/es/new-components/common-helpers.js.map +1 -0
- package/es/new-components/divider/divider.js +21 -0
- package/es/new-components/divider/divider.js.map +1 -0
- package/es/new-components/divider/divider.module.css.js +4 -0
- package/es/new-components/divider/divider.module.css.js.map +1 -0
- package/es/new-components/heading/heading.js +37 -0
- package/es/new-components/heading/heading.js.map +1 -0
- package/es/new-components/heading/heading.module.css.js +4 -0
- package/es/new-components/heading/heading.module.css.js.map +1 -0
- package/es/new-components/hidden/hidden.js +55 -0
- package/es/new-components/hidden/hidden.js.map +1 -0
- package/es/new-components/hidden/hidden.module.css.js +4 -0
- package/es/new-components/hidden/hidden.module.css.js.map +1 -0
- package/es/new-components/hidden-visually/hidden-visually.js +22 -0
- package/es/new-components/hidden-visually/hidden-visually.js.map +1 -0
- package/es/new-components/hidden-visually/hidden-visually.module.css.js +4 -0
- package/es/new-components/hidden-visually/hidden-visually.module.css.js.map +1 -0
- package/es/new-components/icons/alert-icon.js +77 -0
- package/es/new-components/icons/alert-icon.js.map +1 -0
- package/es/new-components/icons/close-icon.js +15 -0
- package/es/new-components/icons/close-icon.js.map +1 -0
- package/es/new-components/icons/password-hidden-icon.js +29 -0
- package/es/new-components/icons/password-hidden-icon.js.map +1 -0
- package/es/new-components/icons/password-visible-icon.js +22 -0
- package/es/new-components/icons/password-visible-icon.js.map +1 -0
- package/es/new-components/inline/inline.js +36 -0
- package/es/new-components/inline/inline.js.map +1 -0
- package/es/new-components/inline/inline.module.css.js +4 -0
- package/es/new-components/inline/inline.module.css.js.map +1 -0
- package/es/new-components/loading/loading.js +37 -0
- package/es/new-components/loading/loading.js.map +1 -0
- package/es/new-components/modal/modal.js +220 -0
- package/es/new-components/modal/modal.js.map +1 -0
- package/es/new-components/modal/modal.module.css.js +4 -0
- package/es/new-components/modal/modal.module.css.js.map +1 -0
- package/es/new-components/notice/notice.js +30 -0
- package/es/new-components/notice/notice.js.map +1 -0
- package/es/new-components/notice/notice.module.css.js +4 -0
- package/es/new-components/notice/notice.module.css.js.map +1 -0
- package/es/new-components/password-field/password-field.js +76 -0
- package/es/new-components/password-field/password-field.js.map +1 -0
- package/es/new-components/password-field/password-field.module.css.js +4 -0
- package/es/new-components/password-field/password-field.module.css.js.map +1 -0
- package/es/new-components/responsive-props.js +75 -0
- package/es/new-components/responsive-props.js.map +1 -0
- package/es/new-components/select-field/select-field.js +53 -0
- package/es/new-components/select-field/select-field.js.map +1 -0
- package/es/new-components/select-field/select-field.module.css.js +4 -0
- package/es/new-components/select-field/select-field.module.css.js.map +1 -0
- package/es/new-components/spinner/spinner.js +26 -0
- package/es/new-components/spinner/spinner.js.map +1 -0
- package/es/new-components/spinner/spinner.module.css.js +4 -0
- package/es/new-components/spinner/spinner.module.css.js.map +1 -0
- package/es/new-components/stack/stack.js +42 -0
- package/es/new-components/stack/stack.js.map +1 -0
- package/es/new-components/stack/stack.module.css.js +4 -0
- package/es/new-components/stack/stack.module.css.js.map +1 -0
- package/es/new-components/switch-field/switch-field.js +96 -0
- package/es/new-components/switch-field/switch-field.js.map +1 -0
- package/es/new-components/switch-field/switch-field.module.css.js +4 -0
- package/es/new-components/switch-field/switch-field.module.css.js.map +1 -0
- package/es/new-components/tabs/tabs.js +147 -0
- package/es/new-components/tabs/tabs.js.map +1 -0
- package/es/new-components/tabs/tabs.module.css.js +4 -0
- package/es/new-components/tabs/tabs.module.css.js.map +1 -0
- package/es/new-components/text/text.js +36 -0
- package/es/new-components/text/text.js.map +1 -0
- package/es/new-components/text/text.module.css.js +4 -0
- package/es/new-components/text/text.module.css.js.map +1 -0
- package/es/new-components/text-area/text-area.js +34 -0
- package/es/new-components/text-area/text-area.js.map +1 -0
- package/es/new-components/text-area/text-area.module.css.js +4 -0
- package/es/new-components/text-area/text-area.module.css.js.map +1 -0
- package/es/new-components/text-field/text-field.js +41 -0
- package/es/new-components/text-field/text-field.js.map +1 -0
- package/es/new-components/text-field/text-field.module.css.js +4 -0
- package/es/new-components/text-field/text-field.module.css.js.map +1 -0
- package/es/new-components/text-link/text-link.js +27 -0
- package/es/new-components/text-link/text-link.js.map +1 -0
- package/es/new-components/text-link/text-link.module.css.js +4 -0
- package/es/new-components/text-link/text-link.module.css.js.map +1 -0
- package/es/utils/polymorphism.js +17 -0
- package/es/utils/polymorphism.js.map +1 -0
- package/lib/_virtual/_rollupPluginBabelHelpers.js +1 -1
- package/lib/components/{avatar/utils.test.d.ts → checkbox/checkbox.test.d.ts} +0 -0
- package/lib/components/color-picker/color-picker.test.d.ts +1 -0
- package/lib/components/{button/button.d.ts → deprecated-button/deprecated-button.d.ts} +7 -1
- package/lib/components/deprecated-button/deprecated-button.js +2 -0
- package/lib/components/deprecated-button/deprecated-button.js.map +1 -0
- package/lib/components/deprecated-button/deprecated-button.test.d.ts +1 -0
- package/lib/components/deprecated-button/index.d.ts +4 -0
- package/lib/components/{avatar → deprecated-button}/index.js +1 -1
- package/lib/components/{avatar → deprecated-button}/index.js.map +0 -0
- package/lib/components/{loading/loading.d.ts → deprecated-loading/deprecated-loading.d.ts} +2 -1
- package/lib/components/{loading/loading.js → deprecated-loading/deprecated-loading.js} +1 -1
- package/lib/components/deprecated-loading/deprecated-loading.js.map +1 -0
- package/lib/components/deprecated-loading/deprecated-loading.test.d.ts +1 -0
- package/lib/components/deprecated-loading/index.d.ts +1 -0
- package/lib/components/{modal/modal.d.ts → deprecated-modal/deprecated-modal.d.ts} +7 -2
- package/lib/components/deprecated-modal/deprecated-modal.js +2 -0
- package/lib/components/deprecated-modal/deprecated-modal.js.map +1 -0
- package/lib/components/deprecated-modal/deprecated-modal.test.d.ts +1 -0
- package/lib/components/{modal → deprecated-modal}/index.d.ts +2 -2
- package/lib/components/deprecated-modal/index.js +2 -0
- package/lib/components/deprecated-modal/index.js.map +1 -0
- package/lib/components/dropdown/dropdown.js +1 -1
- package/lib/components/dropdown/dropdown.js.map +1 -1
- package/lib/components/dropdown/dropdown.test.d.ts +1 -0
- package/lib/components/input/input.test.d.ts +1 -0
- package/lib/components/key-capturer/key-capturer.js +1 -1
- package/lib/components/key-capturer/key-capturer.test.d.ts +1 -0
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js +1 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.test.d.ts +1 -0
- package/lib/components/menu/menu.d.ts +8 -10
- package/lib/components/menu/menu.js +1 -1
- package/lib/components/menu/menu.js.map +1 -1
- package/lib/components/menu/menu.test.d.ts +1 -0
- package/lib/components/notification/notification.d.ts +4 -2
- package/lib/components/notification/notification.js +1 -1
- package/lib/components/notification/notification.js.map +1 -1
- package/lib/components/notification/notification.test.d.ts +1 -0
- package/lib/components/popover/popover.js +1 -1
- package/lib/components/popover/popover.test.d.ts +1 -0
- package/lib/components/progress-bar/progress-bar.d.ts +3 -1
- package/lib/components/progress-bar/progress-bar.js +1 -1
- package/lib/components/progress-bar/progress-bar.js.map +1 -1
- package/lib/components/progress-bar/progress-bar.test.d.ts +1 -0
- package/lib/components/select/select.js +1 -1
- package/lib/components/select/select.js.map +1 -1
- package/lib/components/select/select.test.d.ts +1 -0
- package/lib/components/time/time.js +1 -1
- package/lib/components/time/time.test.d.ts +1 -0
- package/lib/components/tooltip/tooltip.js +1 -1
- package/lib/components/tooltip/tooltip.js.map +1 -1
- package/lib/components/tooltip/tooltip.test.d.ts +1 -0
- package/lib/hooks/use-previous/index.d.ts +1 -0
- package/lib/hooks/use-previous/use-previous.d.ts +15 -0
- package/lib/hooks/use-previous/use-previous.js +2 -0
- package/lib/hooks/use-previous/use-previous.js.map +1 -0
- package/lib/index.d.ts +33 -13
- package/lib/index.js +1 -1
- package/lib/new-components/alert/alert.d.ts +17 -0
- package/lib/new-components/alert/alert.js +2 -0
- package/lib/new-components/alert/alert.js.map +1 -0
- package/lib/new-components/alert/alert.module.css.js +2 -0
- package/lib/new-components/alert/alert.module.css.js.map +1 -0
- package/lib/new-components/alert/alert.test.d.ts +1 -0
- package/lib/new-components/alert/index.d.ts +1 -0
- package/lib/{components → new-components}/avatar/avatar.d.ts +6 -3
- package/lib/new-components/avatar/avatar.js +2 -0
- package/lib/new-components/avatar/avatar.js.map +1 -0
- package/lib/new-components/avatar/avatar.module.css.js +2 -0
- package/lib/new-components/avatar/avatar.module.css.js.map +1 -0
- package/lib/new-components/avatar/avatar.test.d.ts +1 -0
- package/lib/new-components/avatar/index.d.ts +1 -0
- package/lib/{components → new-components}/avatar/utils.d.ts +0 -0
- package/lib/{components → new-components}/avatar/utils.js +0 -0
- package/lib/new-components/avatar/utils.js.map +1 -0
- package/lib/new-components/avatar/utils.test.d.ts +1 -0
- package/lib/new-components/base-button/base-button.d.ts +69 -0
- package/lib/new-components/base-button/base-button.js +2 -0
- package/lib/new-components/base-button/base-button.js.map +1 -0
- package/lib/new-components/base-button/base-button.module.css.js +2 -0
- package/lib/new-components/base-button/base-button.module.css.js.map +1 -0
- package/lib/new-components/base-button/index.d.ts +1 -0
- package/lib/new-components/base-field/base-field.d.ts +64 -0
- package/lib/new-components/base-field/base-field.js +2 -0
- package/lib/new-components/base-field/base-field.js.map +1 -0
- package/lib/new-components/base-field/base-field.module.css.js +2 -0
- package/lib/new-components/base-field/base-field.module.css.js.map +1 -0
- package/lib/new-components/base-field/index.d.ts +1 -0
- package/lib/new-components/box/box.d.ts +58 -0
- package/lib/new-components/box/box.js +2 -0
- package/lib/new-components/box/box.js.map +1 -0
- package/lib/new-components/box/box.module.css.js +2 -0
- package/lib/new-components/box/box.module.css.js.map +1 -0
- package/lib/new-components/box/box.test.d.ts +1 -0
- package/lib/new-components/box/index.d.ts +1 -0
- package/lib/new-components/box/margin.module.css.js +2 -0
- package/lib/new-components/box/margin.module.css.js.map +1 -0
- package/lib/new-components/box/padding.module.css.js +2 -0
- package/lib/new-components/box/padding.module.css.js.map +1 -0
- package/lib/new-components/box/width.module.css.js +2 -0
- package/lib/new-components/box/width.module.css.js.map +1 -0
- package/lib/new-components/button/button.d.ts +50 -0
- package/lib/new-components/button/button.js +2 -0
- package/lib/new-components/button/button.js.map +1 -0
- package/lib/new-components/button/button.test.d.ts +1 -0
- package/lib/new-components/button/index.d.ts +1 -0
- package/lib/new-components/button-link/button-link-story-wrapper.d.ts +7 -0
- package/lib/new-components/button-link/button-link.d.ts +15 -0
- package/lib/new-components/button-link/button-link.js +2 -0
- package/lib/new-components/button-link/button-link.js.map +1 -0
- package/lib/new-components/button-link/button-link.test.d.ts +1 -0
- package/lib/new-components/button-link/index.d.ts +1 -0
- package/lib/new-components/checkbox-field/checkbox-field.d.ts +21 -0
- package/lib/new-components/checkbox-field/checkbox-field.js +2 -0
- package/lib/new-components/checkbox-field/checkbox-field.js.map +1 -0
- package/lib/new-components/checkbox-field/checkbox-field.module.css.js +2 -0
- package/lib/new-components/checkbox-field/checkbox-field.module.css.js.map +1 -0
- package/lib/new-components/checkbox-field/checkbox-field.test.d.ts +1 -0
- package/lib/new-components/checkbox-field/checkbox-icon.d.ts +8 -0
- package/lib/new-components/checkbox-field/checkbox-icon.js +2 -0
- package/lib/new-components/checkbox-field/checkbox-icon.js.map +1 -0
- package/lib/new-components/checkbox-field/index.d.ts +1 -0
- package/lib/new-components/columns/columns.d.ts +20 -0
- package/lib/new-components/columns/columns.js +2 -0
- package/lib/new-components/columns/columns.js.map +1 -0
- package/lib/new-components/columns/columns.module.css.js +2 -0
- package/lib/new-components/columns/columns.module.css.js.map +1 -0
- package/lib/new-components/columns/columns.test.d.ts +1 -0
- package/lib/new-components/columns/index.d.ts +1 -0
- package/lib/new-components/common-helpers.d.ts +2 -0
- package/lib/new-components/common-helpers.js +2 -0
- package/lib/new-components/common-helpers.js.map +1 -0
- package/lib/new-components/common-types.d.ts +23 -0
- package/lib/new-components/divider/divider.d.ts +8 -0
- package/lib/new-components/divider/divider.js +2 -0
- package/lib/new-components/divider/divider.js.map +1 -0
- package/lib/new-components/divider/divider.module.css.js +2 -0
- package/lib/new-components/divider/divider.module.css.js.map +1 -0
- package/lib/new-components/divider/index.d.ts +1 -0
- package/lib/new-components/heading/heading.d.ts +115 -0
- package/lib/new-components/heading/heading.js +2 -0
- package/lib/new-components/heading/heading.js.map +1 -0
- package/lib/new-components/heading/heading.module.css.js +2 -0
- package/lib/new-components/heading/heading.module.css.js.map +1 -0
- package/lib/new-components/heading/heading.test.d.ts +1 -0
- package/lib/new-components/heading/index.d.ts +1 -0
- package/lib/new-components/hidden/hidden.d.ts +49 -0
- package/lib/new-components/hidden/hidden.js +2 -0
- package/lib/new-components/hidden/hidden.js.map +1 -0
- package/lib/new-components/hidden/hidden.module.css.js +2 -0
- package/lib/new-components/hidden/hidden.module.css.js.map +1 -0
- package/lib/new-components/hidden/hidden.test.d.ts +1 -0
- package/lib/new-components/hidden/index.d.ts +1 -0
- package/lib/new-components/hidden-visually/hidden-visually.d.ts +11 -0
- package/lib/new-components/hidden-visually/hidden-visually.js +2 -0
- package/lib/new-components/hidden-visually/hidden-visually.js.map +1 -0
- package/lib/new-components/hidden-visually/hidden-visually.module.css.js +2 -0
- package/lib/new-components/hidden-visually/hidden-visually.module.css.js.map +1 -0
- package/lib/new-components/hidden-visually/hidden-visually.test.d.ts +1 -0
- package/lib/new-components/hidden-visually/index.d.ts +1 -0
- package/lib/new-components/icons/alert-icon.d.ts +6 -0
- package/lib/new-components/icons/alert-icon.js +2 -0
- package/lib/new-components/icons/alert-icon.js.map +1 -0
- package/lib/new-components/icons/close-icon.d.ts +3 -0
- package/lib/new-components/icons/close-icon.js +2 -0
- package/lib/new-components/icons/close-icon.js.map +1 -0
- package/lib/new-components/icons/password-hidden-icon.d.ts +3 -0
- package/lib/new-components/icons/password-hidden-icon.js +2 -0
- package/lib/new-components/icons/password-hidden-icon.js.map +1 -0
- package/lib/new-components/icons/password-visible-icon.d.ts +3 -0
- package/lib/new-components/icons/password-visible-icon.js +2 -0
- package/lib/new-components/icons/password-visible-icon.js.map +1 -0
- package/lib/new-components/inline/index.d.ts +1 -0
- package/lib/new-components/inline/inline.d.ts +12 -0
- package/lib/new-components/inline/inline.js +2 -0
- package/lib/new-components/inline/inline.js.map +1 -0
- package/lib/new-components/inline/inline.module.css.js +2 -0
- package/lib/new-components/inline/inline.module.css.js.map +1 -0
- package/lib/new-components/inline/inline.test.d.ts +1 -0
- package/lib/new-components/loading/index.d.ts +1 -0
- package/lib/new-components/loading/loading.d.ts +27 -0
- package/lib/new-components/loading/loading.js +2 -0
- package/lib/new-components/loading/loading.js.map +1 -0
- package/lib/new-components/loading/loading.test.d.ts +1 -0
- package/lib/new-components/modal/index.d.ts +1 -0
- package/lib/new-components/modal/modal-stories-components.d.ts +35 -0
- package/lib/new-components/modal/modal.d.ts +156 -0
- package/lib/new-components/modal/modal.js +2 -0
- package/lib/new-components/modal/modal.js.map +1 -0
- package/lib/new-components/modal/modal.module.css.js +2 -0
- package/lib/new-components/modal/modal.module.css.js.map +1 -0
- package/lib/new-components/modal/modal.test.d.ts +1 -0
- package/lib/new-components/notice/index.d.ts +1 -0
- package/lib/new-components/notice/notice.d.ts +10 -0
- package/lib/new-components/notice/notice.js +2 -0
- package/lib/new-components/notice/notice.js.map +1 -0
- package/lib/new-components/notice/notice.module.css.js +2 -0
- package/lib/new-components/notice/notice.module.css.js.map +1 -0
- package/lib/new-components/notice/notice.test.d.ts +1 -0
- package/lib/new-components/password-field/index.d.ts +1 -0
- package/lib/new-components/password-field/password-field.d.ts +8 -0
- package/lib/new-components/password-field/password-field.js +2 -0
- package/lib/new-components/password-field/password-field.js.map +1 -0
- package/lib/new-components/password-field/password-field.module.css.js +2 -0
- package/lib/new-components/password-field/password-field.module.css.js.map +1 -0
- package/lib/new-components/password-field/password-field.test.d.ts +1 -0
- package/lib/new-components/responsive-props.d.ts +44 -0
- package/lib/new-components/responsive-props.js +2 -0
- package/lib/new-components/responsive-props.js.map +1 -0
- package/lib/new-components/select-field/index.d.ts +1 -0
- package/lib/new-components/select-field/select-field.d.ts +6 -0
- package/lib/new-components/select-field/select-field.js +2 -0
- package/lib/new-components/select-field/select-field.js.map +1 -0
- package/lib/new-components/select-field/select-field.module.css.js +2 -0
- package/lib/new-components/select-field/select-field.module.css.js.map +1 -0
- package/lib/new-components/select-field/select-field.test.d.ts +1 -0
- package/lib/new-components/spinner/index.d.ts +1 -0
- package/lib/new-components/spinner/spinner.d.ts +5 -0
- package/lib/new-components/spinner/spinner.js +2 -0
- package/lib/new-components/spinner/spinner.js.map +1 -0
- package/lib/new-components/spinner/spinner.module.css.js +2 -0
- package/lib/new-components/spinner/spinner.module.css.js.map +1 -0
- package/lib/new-components/stack/index.d.ts +1 -0
- package/lib/new-components/stack/stack.d.ts +15 -0
- package/lib/new-components/stack/stack.js +2 -0
- package/lib/new-components/stack/stack.js.map +1 -0
- package/lib/new-components/stack/stack.module.css.js +2 -0
- package/lib/new-components/stack/stack.module.css.js.map +1 -0
- package/lib/new-components/stack/stack.test.d.ts +1 -0
- package/lib/new-components/switch-field/index.d.ts +1 -0
- package/lib/new-components/switch-field/switch-field.d.ts +13 -0
- package/lib/new-components/switch-field/switch-field.js +2 -0
- package/lib/new-components/switch-field/switch-field.js.map +1 -0
- package/lib/new-components/switch-field/switch-field.module.css.js +2 -0
- package/lib/new-components/switch-field/switch-field.module.css.js.map +1 -0
- package/lib/new-components/switch-field/switch-field.test.d.ts +1 -0
- package/lib/new-components/tabs/index.d.ts +1 -0
- package/lib/new-components/tabs/tabs.d.ts +92 -0
- package/lib/new-components/tabs/tabs.js +2 -0
- package/lib/new-components/tabs/tabs.js.map +1 -0
- package/lib/new-components/tabs/tabs.module.css.js +2 -0
- package/lib/new-components/tabs/tabs.module.css.js.map +1 -0
- package/lib/new-components/tabs/tabs.test.d.ts +1 -0
- package/lib/new-components/test-helpers.d.ts +9 -0
- package/lib/new-components/text/index.d.ts +1 -0
- package/lib/new-components/text/text.d.ts +47 -0
- package/lib/new-components/text/text.js +2 -0
- package/lib/new-components/text/text.js.map +1 -0
- package/lib/new-components/text/text.module.css.js +2 -0
- package/lib/new-components/text/text.module.css.js.map +1 -0
- package/lib/new-components/text/text.test.d.ts +1 -0
- package/lib/new-components/text-area/index.d.ts +1 -0
- package/lib/new-components/text-area/text-area.d.ts +8 -0
- package/lib/new-components/text-area/text-area.js +2 -0
- package/lib/new-components/text-area/text-area.js.map +1 -0
- package/lib/new-components/text-area/text-area.module.css.js +2 -0
- package/lib/new-components/text-area/text-area.module.css.js.map +1 -0
- package/lib/new-components/text-field/index.d.ts +1 -0
- package/lib/new-components/text-field/text-field.d.ts +9 -0
- package/lib/new-components/text-field/text-field.js +2 -0
- package/lib/new-components/text-field/text-field.js.map +1 -0
- package/lib/new-components/text-field/text-field.module.css.js +2 -0
- package/lib/new-components/text-field/text-field.module.css.js.map +1 -0
- package/lib/new-components/text-field/text-field.test.d.ts +1 -0
- package/lib/new-components/text-link/index.d.ts +1 -0
- package/lib/new-components/text-link/text-link.d.ts +5 -0
- package/lib/new-components/text-link/text-link.js +2 -0
- package/lib/new-components/text-link/text-link.js.map +1 -0
- package/lib/new-components/text-link/text-link.module.css.js +2 -0
- package/lib/new-components/text-link/text-link.module.css.js.map +1 -0
- package/lib/utils/polymorphism.d.ts +151 -0
- package/lib/utils/polymorphism.js +2 -0
- package/lib/utils/polymorphism.js.map +1 -0
- package/package.json +25 -16
- package/styles/alert.css +9 -0
- package/styles/alert.module.css.css +1 -0
- package/styles/avatar.css +5 -1
- package/styles/avatar.module.css.css +1 -0
- package/styles/base-button.css +7 -0
- package/styles/base-button.module.css.css +1 -0
- package/styles/base-field.css +8 -0
- package/styles/base-field.module.css.css +1 -0
- package/styles/box.css +4 -0
- package/styles/box.module.css.css +1 -0
- package/styles/checkbox-field.css +6 -0
- package/styles/checkbox-field.module.css.css +1 -0
- package/styles/color-picker.css +2 -2
- package/styles/columns.css +5 -0
- package/styles/columns.module.css.css +1 -0
- package/styles/{button.css → deprecated-button.css} +2 -2
- package/styles/deprecated-loading.css +1 -0
- package/styles/deprecated-modal.css +1 -0
- package/styles/divider.css +5 -0
- package/styles/divider.module.css.css +1 -0
- package/styles/dropdown.css +3 -3
- package/styles/heading.css +5 -0
- package/styles/heading.module.css.css +1 -0
- package/styles/hidden-visually.css +5 -0
- package/styles/hidden-visually.module.css.css +1 -0
- package/styles/hidden.css +5 -0
- package/styles/hidden.module.css.css +1 -0
- package/styles/inline.css +5 -0
- package/styles/inline.module.css.css +1 -0
- package/styles/loading.css +5 -1
- package/styles/margin.module.css.css +1 -0
- package/styles/menu.css +1 -1
- package/styles/modal.css +11 -1
- package/styles/modal.module.css.css +1 -0
- package/styles/notice.css +6 -0
- package/styles/notice.module.css.css +1 -0
- package/styles/padding.module.css.css +1 -0
- package/styles/password-field.css +11 -0
- package/styles/password-field.module.css.css +1 -0
- package/styles/progress-bar.css +5 -0
- package/styles/reactist.css +34 -12
- package/styles/select-field.css +9 -0
- package/styles/select-field.module.css.css +1 -0
- package/styles/spinner.module.css.css +1 -0
- package/styles/stack.css +6 -0
- package/styles/stack.module.css.css +1 -0
- package/styles/switch-field.css +10 -0
- package/styles/switch-field.module.css.css +1 -0
- package/styles/tabs.css +6 -1
- package/styles/tabs.module.css.css +1 -0
- package/styles/text-area.css +9 -0
- package/styles/text-area.module.css.css +1 -0
- package/styles/text-field.css +9 -0
- package/styles/text-field.module.css.css +1 -0
- package/styles/text-link.css +5 -0
- package/styles/text-link.module.css.css +1 -0
- package/styles/text.css +5 -0
- package/styles/text.module.css.css +1 -0
- package/styles/time.css +2 -2
- package/styles/width.module.css.css +1 -0
- package/es/components/avatar/avatar.js.map +0 -1
- package/es/components/avatar/index.js +0 -6
- package/es/components/avatar/utils.js.map +0 -1
- package/es/components/button/button.js.map +0 -1
- package/es/components/button/index.js.map +0 -1
- package/es/components/error-message/error-message.js +0 -90
- package/es/components/error-message/error-message.js.map +0 -1
- package/es/components/error-message/index.js +0 -6
- package/es/components/error-message/index.js.map +0 -1
- package/es/components/icon/icon.js +0 -96
- package/es/components/icon/icon.js.map +0 -1
- package/es/components/icon/index.js +0 -6
- package/es/components/icon/index.js.map +0 -1
- package/es/components/icons/ThinQuestionMarkIcon.svg.js +0 -24
- package/es/components/icons/ThinQuestionMarkIcon.svg.js.map +0 -1
- package/es/components/icons/ThreeDotsIcon.svg.js +0 -40
- package/es/components/icons/ThreeDotsIcon.svg.js.map +0 -1
- package/es/components/loading/index.js +0 -6
- package/es/components/loading/index.js.map +0 -1
- package/es/components/loading/loading.js.map +0 -1
- package/es/components/menu/type-helpers.js +0 -9
- package/es/components/menu/type-helpers.js.map +0 -1
- package/es/components/modal/index.js.map +0 -1
- package/es/components/modal/modal.js.map +0 -1
- package/es/components/range-input/index.js +0 -6
- package/es/components/range-input/index.js.map +0 -1
- package/es/components/range-input/range-input.js +0 -55
- package/es/components/range-input/range-input.js.map +0 -1
- package/es/components/tabs/tabs.js +0 -123
- package/es/components/tabs/tabs.js.map +0 -1
- package/es/components/tip/index.js +0 -6
- package/es/components/tip/index.js.map +0 -1
- package/es/components/tip/tip.js +0 -30
- package/es/components/tip/tip.js.map +0 -1
- package/lib/components/avatar/avatar.js +0 -2
- package/lib/components/avatar/avatar.js.map +0 -1
- package/lib/components/avatar/index.d.ts +0 -2
- package/lib/components/avatar/utils.js.map +0 -1
- package/lib/components/button/button.js +0 -2
- package/lib/components/button/button.js.map +0 -1
- package/lib/components/button/index.d.ts +0 -4
- package/lib/components/button/index.js +0 -2
- package/lib/components/button/index.js.map +0 -1
- package/lib/components/error-message/error-message.d.ts +0 -23
- package/lib/components/error-message/error-message.js +0 -2
- package/lib/components/error-message/error-message.js.map +0 -1
- package/lib/components/error-message/index.d.ts +0 -2
- package/lib/components/error-message/index.js +0 -2
- package/lib/components/error-message/index.js.map +0 -1
- package/lib/components/icon/icon.d.ts +0 -31
- package/lib/components/icon/icon.js +0 -2
- package/lib/components/icon/icon.js.map +0 -1
- package/lib/components/icon/index.d.ts +0 -2
- package/lib/components/icon/index.js +0 -2
- package/lib/components/icon/index.js.map +0 -1
- package/lib/components/icons/ThinQuestionMarkIcon.svg.js +0 -2
- package/lib/components/icons/ThinQuestionMarkIcon.svg.js.map +0 -1
- package/lib/components/icons/ThreeDotsIcon.svg.js +0 -2
- package/lib/components/icons/ThreeDotsIcon.svg.js.map +0 -1
- package/lib/components/loading/index.d.ts +0 -2
- package/lib/components/loading/index.js +0 -2
- package/lib/components/loading/index.js.map +0 -1
- package/lib/components/loading/loading.js.map +0 -1
- package/lib/components/menu/type-helpers.d.ts +0 -25
- package/lib/components/menu/type-helpers.js +0 -2
- package/lib/components/menu/type-helpers.js.map +0 -1
- package/lib/components/modal/index.js +0 -2
- package/lib/components/modal/index.js.map +0 -1
- package/lib/components/modal/modal.js +0 -2
- package/lib/components/modal/modal.js.map +0 -1
- package/lib/components/range-input/index.d.ts +0 -2
- package/lib/components/range-input/index.js +0 -2
- package/lib/components/range-input/index.js.map +0 -1
- package/lib/components/range-input/range-input.d.ts +0 -25
- package/lib/components/range-input/range-input.js +0 -2
- package/lib/components/range-input/range-input.js.map +0 -1
- package/lib/components/tabs/index.d.ts +0 -1
- package/lib/components/tabs/tabs.d.ts +0 -33
- package/lib/components/tabs/tabs.js +0 -2
- package/lib/components/tabs/tabs.js.map +0 -1
- package/lib/components/tip/index.d.ts +0 -2
- package/lib/components/tip/index.js +0 -2
- package/lib/components/tip/index.js.map +0 -1
- package/lib/components/tip/tip.d.ts +0 -20
- package/lib/components/tip/tip.js +0 -2
- package/lib/components/tip/tip.js.map +0 -1
- package/styles/error-message.css +0 -1
- package/styles/icon.css +0 -2
- package/styles/range-input.css +0 -1
- package/styles/tip.css +0 -4
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { createElement, Children, Fragment } from 'react';
|
|
3
|
+
import { polymorphicComponent } from '../../utils/polymorphism.js';
|
|
4
|
+
import { mapResponsiveProp, getClassNames } from '../responsive-props.js';
|
|
5
|
+
import { Box } from '../box/box.js';
|
|
6
|
+
import { Divider } from '../divider/divider.js';
|
|
7
|
+
import flattenChildren from 'react-keyed-flatten-children';
|
|
8
|
+
import styles from './stack.module.css.js';
|
|
9
|
+
|
|
10
|
+
var _excluded = ["as", "space", "align", "dividers", "children", "exceptionallySetClassName"];
|
|
11
|
+
var Stack = /*#__PURE__*/polymorphicComponent(function Stack(_ref, ref) {
|
|
12
|
+
var as = _ref.as,
|
|
13
|
+
space = _ref.space,
|
|
14
|
+
_ref$align = _ref.align,
|
|
15
|
+
align = _ref$align === void 0 ? 'start' : _ref$align,
|
|
16
|
+
_ref$dividers = _ref.dividers,
|
|
17
|
+
dividers = _ref$dividers === void 0 ? 'none' : _ref$dividers,
|
|
18
|
+
children = _ref.children,
|
|
19
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
20
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
21
|
+
|
|
22
|
+
var alignProps = align === 'start' ? undefined : {
|
|
23
|
+
width: 'full',
|
|
24
|
+
flexDirection: 'column',
|
|
25
|
+
display: 'flex',
|
|
26
|
+
alignItems: mapResponsiveProp(align, function (align) {
|
|
27
|
+
return align === 'start' ? 'flexStart' : align === 'end' ? 'flexEnd' : 'center';
|
|
28
|
+
})
|
|
29
|
+
};
|
|
30
|
+
return /*#__PURE__*/createElement(Box, Object.assign({}, props, alignProps, {
|
|
31
|
+
as: as,
|
|
32
|
+
className: [exceptionallySetClassName, getClassNames(styles, 'space', space)],
|
|
33
|
+
ref: ref
|
|
34
|
+
}), dividers !== 'none' ? Children.map(flattenChildren(children), function (child, index) {
|
|
35
|
+
return index > 0 ? /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Divider, {
|
|
36
|
+
weight: dividers
|
|
37
|
+
}), child) : child;
|
|
38
|
+
}) : children);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export { Stack };
|
|
42
|
+
//# sourceMappingURL=stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.js","sources":["../../../src/new-components/stack/stack.tsx"],"sourcesContent":["import * as React from 'react'\nimport flattenChildren from 'react-keyed-flatten-children'\nimport { polymorphicComponent } from '../../utils/polymorphism'\nimport { getClassNames, mapResponsiveProp } from '../responsive-props'\nimport { Box } from '../box'\nimport { Divider } from '../divider'\n\nimport type { ResponsiveProp } from '../responsive-props'\nimport type { DividerWeight, Space } from '../common-types'\nimport type { BoxProps, ReusableBoxProps } from '../box'\n\nimport styles from './stack.module.css'\n\ntype Align = 'start' | 'center' | 'end'\n\ninterface StackProps extends ReusableBoxProps {\n /** Space between items */\n space?: ResponsiveProp<Space>\n /** Align items horizontally */\n align?: ResponsiveProp<Align>\n /** The weight of the dividers to add. Defaults to 'none', which means no dividers are added */\n dividers?: DividerWeight\n}\n\nconst Stack = polymorphicComponent<'div', StackProps>(function Stack(\n {\n as,\n space,\n align = 'start',\n dividers = 'none',\n children,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const alignProps: BoxProps | undefined =\n align === 'start'\n ? undefined\n : {\n width: 'full',\n flexDirection: 'column',\n display: 'flex',\n alignItems: mapResponsiveProp(align, (align) =>\n align === 'start' ? 'flexStart' : align === 'end' ? 'flexEnd' : 'center',\n ),\n }\n\n return (\n <Box\n {...props}\n {...alignProps}\n as={as}\n className={[exceptionallySetClassName, getClassNames(styles, 'space', space)]}\n ref={ref}\n >\n {dividers !== 'none'\n ? React.Children.map(flattenChildren(children), (child, index) =>\n index > 0 ? (\n <>\n <Divider weight={dividers} />\n {child}\n </>\n ) : (\n child\n ),\n )\n : children}\n </Box>\n )\n})\n\nexport type { StackProps }\nexport { Stack }\n"],"names":["Stack","polymorphicComponent","ref","as","space","align","dividers","children","exceptionallySetClassName","props","alignProps","undefined","width","flexDirection","display","alignItems","mapResponsiveProp","React","Box","className","getClassNames","styles","map","flattenChildren","child","index","Divider","weight"],"mappings":";;;;;;;;;;IAwBMA,KAAK,gBAAGC,oBAAoB,CAAoB,SAASD,KAAT,OAUlDE,GAVkD;MAE9CC,UAAAA;MACAC,aAAAA;wBACAC;MAAAA,gCAAQ;2BACRC;MAAAA,sCAAW;MACXC,gBAAAA;MACAC,iCAAAA;MACGC;;AAIP,MAAMC,UAAU,GACZL,KAAK,KAAK,OAAV,GACMM,SADN,GAEM;AACIC,IAAAA,KAAK,EAAE,MADX;AAEIC,IAAAA,aAAa,EAAE,QAFnB;AAGIC,IAAAA,OAAO,EAAE,MAHb;AAIIC,IAAAA,UAAU,EAAEC,iBAAiB,CAACX,KAAD,EAAQ,UAACA,KAAD;AAAA,aACjCA,KAAK,KAAK,OAAV,GAAoB,WAApB,GAAkCA,KAAK,KAAK,KAAV,GAAkB,SAAlB,GAA8B,QAD/B;AAAA,KAAR;AAJjC,GAHV;AAYA,sBACIY,aAAA,CAACC,GAAD,oBACQT,OACAC;AACJP,IAAAA,EAAE,EAAEA;AACJgB,IAAAA,SAAS,EAAE,CAACX,yBAAD,EAA4BY,aAAa,CAACC,MAAD,EAAS,OAAT,EAAkBjB,KAAlB,CAAzC;AACXF,IAAAA,GAAG,EAAEA;IALT,EAOKI,QAAQ,KAAK,MAAb,GACKW,QAAA,CAAeK,GAAf,CAAmBC,eAAe,CAAChB,QAAD,CAAlC,EAA8C,UAACiB,KAAD,EAAQC,KAAR;AAAA,WAC1CA,KAAK,GAAG,CAAR,gBACIR,aAAA,SAAA,MAAA,eACIA,aAAA,CAACS,OAAD;AAASC,MAAAA,MAAM,EAAErB;KAAjB,CADJ,EAEKkB,KAFL,CADJ,GAMIA,KAPsC;AAAA,GAA9C,CADL,GAWKjB,QAlBV,CADJ;AAsBH,CA9CiC;;;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var modules_3af3b7ac = {"space-xsmall":"_7b475ead","space-small":"_5641699f","space-medium":"_1a1c63e4","space-large":"_560f80a0","space-xlarge":"_84ffebbc","space-xxlarge":"b60a65cb","tablet-space-xsmall":"d808f5c3","tablet-space-small":"a51c76b3","tablet-space-medium":"_7185a7aa","tablet-space-large":"af82e610","tablet-space-xlarge":"_88b4ff46","tablet-space-xxlarge":"_9de15321","desktop-space-xsmall":"_6fb32d20","desktop-space-small":"_07ee315a","desktop-space-medium":"a270d7ec","desktop-space-large":"ea6ebb29","desktop-space-xlarge":"_35b36178","desktop-space-xxlarge":"_56c7dc23"};
|
|
2
|
+
|
|
3
|
+
export default modules_3af3b7ac;
|
|
4
|
+
//# sourceMappingURL=stack.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { forwardRef, useState, createElement } from 'react';
|
|
3
|
+
import { Box } from '../box/box.js';
|
|
4
|
+
import { Stack } from '../stack/stack.js';
|
|
5
|
+
import { HiddenVisually } from '../hidden-visually/hidden-visually.js';
|
|
6
|
+
import { Text } from '../text/text.js';
|
|
7
|
+
import { useId } from '../common-helpers.js';
|
|
8
|
+
import { FieldHint } from '../base-field/base-field.js';
|
|
9
|
+
import styles from './switch-field.module.css.js';
|
|
10
|
+
|
|
11
|
+
var _excluded = ["label", "hint", "disabled", "hidden", "defaultChecked", "id", "aria-describedby", "aria-label", "aria-labelledby", "onChange"];
|
|
12
|
+
var SwitchField = /*#__PURE__*/forwardRef(function SwitchField(_ref, ref) {
|
|
13
|
+
var _ref2, _props$checked, _props$checked2;
|
|
14
|
+
|
|
15
|
+
var label = _ref.label,
|
|
16
|
+
hint = _ref.hint,
|
|
17
|
+
_ref$disabled = _ref.disabled,
|
|
18
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
19
|
+
hidden = _ref.hidden,
|
|
20
|
+
defaultChecked = _ref.defaultChecked,
|
|
21
|
+
originalId = _ref.id,
|
|
22
|
+
originalAriaDescribedBy = _ref['aria-describedby'],
|
|
23
|
+
originalAriaLabel = _ref['aria-label'],
|
|
24
|
+
originalAriaLabelledby = _ref['aria-labelledby'],
|
|
25
|
+
_onChange = _ref.onChange,
|
|
26
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
27
|
+
|
|
28
|
+
var id = useId(originalId);
|
|
29
|
+
var hintId = useId();
|
|
30
|
+
var ariaDescribedBy = originalAriaDescribedBy !== null && originalAriaDescribedBy !== void 0 ? originalAriaDescribedBy : hint ? hintId : undefined;
|
|
31
|
+
var ariaLabel = originalAriaLabel !== null && originalAriaLabel !== void 0 ? originalAriaLabel : undefined;
|
|
32
|
+
var ariaLabelledBy = originalAriaLabelledby !== null && originalAriaLabelledby !== void 0 ? originalAriaLabelledby : undefined;
|
|
33
|
+
|
|
34
|
+
var _React$useState = useState(false),
|
|
35
|
+
keyFocused = _React$useState[0],
|
|
36
|
+
setKeyFocused = _React$useState[1];
|
|
37
|
+
|
|
38
|
+
var _React$useState2 = useState((_ref2 = (_props$checked = props.checked) !== null && _props$checked !== void 0 ? _props$checked : defaultChecked) !== null && _ref2 !== void 0 ? _ref2 : false),
|
|
39
|
+
checkedState = _React$useState2[0],
|
|
40
|
+
setChecked = _React$useState2[1];
|
|
41
|
+
|
|
42
|
+
var isChecked = (_props$checked2 = props.checked) !== null && _props$checked2 !== void 0 ? _props$checked2 : checkedState;
|
|
43
|
+
return /*#__PURE__*/createElement(Stack, {
|
|
44
|
+
space: "small",
|
|
45
|
+
hidden: hidden
|
|
46
|
+
}, /*#__PURE__*/createElement(Box, {
|
|
47
|
+
className: [styles.container, disabled ? styles.disabled : null, isChecked ? styles.checked : null, keyFocused ? styles.keyFocused : null],
|
|
48
|
+
as: "label",
|
|
49
|
+
display: "flex",
|
|
50
|
+
alignItems: "center"
|
|
51
|
+
}, /*#__PURE__*/createElement(Box, {
|
|
52
|
+
position: "relative",
|
|
53
|
+
display: "inlineBlock",
|
|
54
|
+
overflow: "visible",
|
|
55
|
+
marginRight: "small",
|
|
56
|
+
flexShrink: 0,
|
|
57
|
+
className: styles.toggle
|
|
58
|
+
}, /*#__PURE__*/createElement(HiddenVisually, null, /*#__PURE__*/createElement("input", Object.assign({}, props, {
|
|
59
|
+
id: id,
|
|
60
|
+
type: "checkbox",
|
|
61
|
+
disabled: disabled,
|
|
62
|
+
"aria-describedby": ariaDescribedBy,
|
|
63
|
+
"aria-label": ariaLabel,
|
|
64
|
+
"aria-labelledby": ariaLabelledBy,
|
|
65
|
+
ref: ref,
|
|
66
|
+
checked: isChecked,
|
|
67
|
+
onChange: function onChange(event) {
|
|
68
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(event);
|
|
69
|
+
|
|
70
|
+
if (!event.defaultPrevented) {
|
|
71
|
+
setChecked(event.currentTarget.checked);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
onBlur: function onBlur(event) {
|
|
75
|
+
var _props$onBlur;
|
|
76
|
+
|
|
77
|
+
setKeyFocused(false);
|
|
78
|
+
props === null || props === void 0 ? void 0 : (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 ? void 0 : _props$onBlur.call(props, event);
|
|
79
|
+
},
|
|
80
|
+
onKeyUp: function onKeyUp(event) {
|
|
81
|
+
var _props$onKeyUp;
|
|
82
|
+
|
|
83
|
+
setKeyFocused(true);
|
|
84
|
+
props === null || props === void 0 ? void 0 : (_props$onKeyUp = props.onKeyUp) === null || _props$onKeyUp === void 0 ? void 0 : _props$onKeyUp.call(props, event);
|
|
85
|
+
}
|
|
86
|
+
}))), /*#__PURE__*/createElement("span", {
|
|
87
|
+
className: styles.handle
|
|
88
|
+
})), /*#__PURE__*/createElement(Text, {
|
|
89
|
+
exceptionallySetClassName: styles.label
|
|
90
|
+
}, label)), hint ? /*#__PURE__*/createElement(FieldHint, {
|
|
91
|
+
id: hintId
|
|
92
|
+
}, hint) : null);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export { SwitchField };
|
|
96
|
+
//# sourceMappingURL=switch-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch-field.js","sources":["../../../src/new-components/switch-field/switch-field.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport { Stack } from '../stack'\nimport { Text } from '../text'\nimport { HiddenVisually } from '../hidden-visually'\nimport { FieldComponentProps, FieldHint } from '../base-field'\nimport { useId } from '../common-helpers'\nimport styles from './switch-field.module.css'\n\ntype SwitchFieldProps = Omit<\n FieldComponentProps<HTMLInputElement>,\n | 'type'\n | 'secondaryLabel'\n | 'auxiliaryLabel'\n | 'maxWidth'\n | 'aria-describedby'\n | 'aria-label'\n | 'aria-labelledby'\n> & {\n /** Identifies the element (or elements) that describes the switch for assistive technologies. */\n 'aria-describedby'?: string\n /** Defines a string value that labels the current switch for assistive technologies. */\n 'aria-label'?: string\n /** Identifies the element (or elements) that labels the current switch for assistive technologies. */\n 'aria-labelledby'?: string\n}\n\nconst SwitchField = React.forwardRef<HTMLInputElement, SwitchFieldProps>(function SwitchField(\n {\n label,\n hint,\n disabled = false,\n hidden,\n defaultChecked,\n id: originalId,\n 'aria-describedby': originalAriaDescribedBy,\n 'aria-label': originalAriaLabel,\n 'aria-labelledby': originalAriaLabelledby,\n onChange,\n ...props\n },\n ref,\n) {\n const id = useId(originalId)\n const hintId = useId()\n\n const ariaDescribedBy = originalAriaDescribedBy ?? (hint ? hintId : undefined)\n const ariaLabel = originalAriaLabel ?? undefined\n const ariaLabelledBy = originalAriaLabelledby ?? undefined\n\n const [keyFocused, setKeyFocused] = React.useState(false)\n const [checkedState, setChecked] = React.useState(props.checked ?? defaultChecked ?? false)\n const isChecked = props.checked ?? checkedState\n\n return (\n <Stack space=\"small\" hidden={hidden}>\n <Box\n className={[\n styles.container,\n disabled ? styles.disabled : null,\n isChecked ? styles.checked : null,\n keyFocused ? styles.keyFocused : null,\n ]}\n as=\"label\"\n display=\"flex\"\n alignItems=\"center\"\n >\n <Box\n position=\"relative\"\n display=\"inlineBlock\"\n overflow=\"visible\"\n marginRight=\"small\"\n flexShrink={0}\n className={styles.toggle}\n >\n <HiddenVisually>\n <input\n {...props}\n id={id}\n type=\"checkbox\"\n disabled={disabled}\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={ref}\n checked={isChecked}\n onChange={(event) => {\n onChange?.(event)\n if (!event.defaultPrevented) {\n setChecked(event.currentTarget.checked)\n }\n }}\n onBlur={(event) => {\n setKeyFocused(false)\n props?.onBlur?.(event)\n }}\n onKeyUp={(event) => {\n setKeyFocused(true)\n props?.onKeyUp?.(event)\n }}\n />\n </HiddenVisually>\n <span className={styles.handle} />\n </Box>\n <Text exceptionallySetClassName={styles.label}>{label}</Text>\n </Box>\n {hint ? <FieldHint id={hintId}>{hint}</FieldHint> : null}\n </Stack>\n )\n})\n\nexport { SwitchField }\nexport type { SwitchFieldProps }\n"],"names":["SwitchField","React","ref","label","hint","disabled","hidden","defaultChecked","originalId","id","originalAriaDescribedBy","originalAriaLabel","originalAriaLabelledby","onChange","props","useId","hintId","ariaDescribedBy","undefined","ariaLabel","ariaLabelledBy","keyFocused","setKeyFocused","checked","checkedState","setChecked","isChecked","Stack","space","Box","className","styles","container","as","display","alignItems","position","overflow","marginRight","flexShrink","toggle","HiddenVisually","type","event","defaultPrevented","currentTarget","onBlur","onKeyUp","handle","Text","exceptionallySetClassName","FieldHint"],"mappings":";;;;;;;;;;;IA2BMA,WAAW,gBAAGC,UAAA,CAAqD,SAASD,WAAT,OAcrEE,GAdqE;;;MAEjEC,aA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ADJ,EAmDKC,IAAI,gBAAGH,aAAA,CAACkD,SAAD;AAAW1C,IAAAA,EAAE,EAAEO;GAAf,EAAwBZ,IAAxB,CAAH,GAA+C,IAnDxD,CADJ;AAuDH,CAlFmB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch-field.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { objectSpread2 as _objectSpread2, objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { useEffect, useMemo, createElement, useContext, useState, createContext } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { polymorphicComponent } from '../../utils/polymorphism.js';
|
|
5
|
+
import { Inline } from '../inline/inline.js';
|
|
6
|
+
import { useTabState, Tab as Tab$1, TabList as TabList$1, TabPanel as TabPanel$1 } from 'reakit/Tab';
|
|
7
|
+
import { usePrevious } from '../../hooks/use-previous/use-previous.js';
|
|
8
|
+
import styles from './tabs.module.css.js';
|
|
9
|
+
|
|
10
|
+
var _excluded = ["color", "variant"],
|
|
11
|
+
_excluded2 = ["children", "space"],
|
|
12
|
+
_excluded3 = ["color", "variant"],
|
|
13
|
+
_excluded4 = ["children", "id", "as", "render"],
|
|
14
|
+
_excluded5 = ["color", "variant"];
|
|
15
|
+
var TabsContext = /*#__PURE__*/createContext(null);
|
|
16
|
+
/**
|
|
17
|
+
* Used to group components that compose a set of tabs. There can only be one active tab within the same `<Tabs>` group.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
function Tabs(_ref) {
|
|
21
|
+
var children = _ref.children,
|
|
22
|
+
selectedId = _ref.selectedId,
|
|
23
|
+
_ref$color = _ref.color,
|
|
24
|
+
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
25
|
+
_ref$variant = _ref.variant,
|
|
26
|
+
variant = _ref$variant === void 0 ? 'normal' : _ref$variant;
|
|
27
|
+
var tabState = useTabState({
|
|
28
|
+
selectedId: selectedId
|
|
29
|
+
});
|
|
30
|
+
var previousSelectedId = usePrevious(selectedId);
|
|
31
|
+
var actualSelectedId = tabState.selectedId,
|
|
32
|
+
select = tabState.select;
|
|
33
|
+
useEffect(function selectTab() {
|
|
34
|
+
if (previousSelectedId !== selectedId && selectedId !== actualSelectedId && selectedId !== undefined) {
|
|
35
|
+
select(selectedId);
|
|
36
|
+
}
|
|
37
|
+
}, [selectedId, actualSelectedId, select, previousSelectedId]);
|
|
38
|
+
var memoizedTabState = useMemo(function memoizeTabState() {
|
|
39
|
+
return _objectSpread2(_objectSpread2({}, tabState), {}, {
|
|
40
|
+
color: color,
|
|
41
|
+
variant: variant
|
|
42
|
+
});
|
|
43
|
+
}, // There is no guarantee that useTabState returns a stable object when there are no changes, so
|
|
44
|
+
// following reakit/Tab's example we only return a new objet when any of its values have changed
|
|
45
|
+
// eslint-disable-next-line
|
|
46
|
+
[color, variant].concat(Object.values(tabState)));
|
|
47
|
+
return /*#__PURE__*/createElement(TabsContext.Provider, {
|
|
48
|
+
value: memoizedTabState
|
|
49
|
+
}, children);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Represents the individual tab elements within the group. Each `<Tab>` must have a corresponding `<TabPanel>` component.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
function Tab(_ref2) {
|
|
56
|
+
var children = _ref2.children,
|
|
57
|
+
id = _ref2.id;
|
|
58
|
+
var tabContextValue = useContext(TabsContext);
|
|
59
|
+
|
|
60
|
+
if (!tabContextValue) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var color = tabContextValue.color,
|
|
65
|
+
variant = tabContextValue.variant,
|
|
66
|
+
tabState = _objectWithoutPropertiesLoose(tabContextValue, _excluded);
|
|
67
|
+
|
|
68
|
+
return /*#__PURE__*/createElement(Tab$1, Object.assign({
|
|
69
|
+
className: classNames(styles.tab, styles["tab-" + (variant !== null && variant !== void 0 ? variant : '')], styles["tab-" + (color !== null && color !== void 0 ? color : '')]),
|
|
70
|
+
id: id
|
|
71
|
+
}, tabState), children);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A component used to group `<Tab>` elements together.
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
function TabList(_ref3) {
|
|
78
|
+
var children = _ref3.children,
|
|
79
|
+
_ref3$space = _ref3.space,
|
|
80
|
+
space = _ref3$space === void 0 ? 'medium' : _ref3$space,
|
|
81
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2);
|
|
82
|
+
|
|
83
|
+
var tabContextValue = useContext(TabsContext);
|
|
84
|
+
|
|
85
|
+
if (!tabContextValue) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
var tabState = _objectWithoutPropertiesLoose(tabContextValue, _excluded3);
|
|
90
|
+
|
|
91
|
+
return /*#__PURE__*/createElement(TabList$1, Object.assign({}, props, tabState), /*#__PURE__*/createElement(Inline, {
|
|
92
|
+
space: space
|
|
93
|
+
}, children));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Used to define the content to be rendered when a tab is active. Each `<TabPanel>` must have a corresponding `<Tab>` component.
|
|
97
|
+
*/
|
|
98
|
+
|
|
99
|
+
var TabPanel = /*#__PURE__*/polymorphicComponent(function TabPanel(_ref4, ref) {
|
|
100
|
+
var children = _ref4.children,
|
|
101
|
+
id = _ref4.id,
|
|
102
|
+
as = _ref4.as,
|
|
103
|
+
_ref4$render = _ref4.render,
|
|
104
|
+
render = _ref4$render === void 0 ? 'always' : _ref4$render,
|
|
105
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
106
|
+
|
|
107
|
+
var tabContextValue = useContext(TabsContext);
|
|
108
|
+
|
|
109
|
+
var _React$useState = useState(false),
|
|
110
|
+
tabRendered = _React$useState[0],
|
|
111
|
+
setTabRendered = _React$useState[1];
|
|
112
|
+
|
|
113
|
+
var tabIsActive = (tabContextValue === null || tabContextValue === void 0 ? void 0 : tabContextValue.selectedId) === id;
|
|
114
|
+
useEffect(function trackTabRenderedState() {
|
|
115
|
+
if (!tabRendered && tabIsActive) {
|
|
116
|
+
setTabRendered(true);
|
|
117
|
+
}
|
|
118
|
+
}, [tabRendered, tabIsActive]);
|
|
119
|
+
|
|
120
|
+
if (!tabContextValue) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
var tabState = _objectWithoutPropertiesLoose(tabContextValue, _excluded5);
|
|
125
|
+
|
|
126
|
+
return /*#__PURE__*/createElement(TabPanel$1, Object.assign({
|
|
127
|
+
tabId: id
|
|
128
|
+
}, tabState, props, {
|
|
129
|
+
as: as,
|
|
130
|
+
ref: ref
|
|
131
|
+
}), render === 'always' ? children : null, render === 'active' && tabIsActive ? children : null, render === 'lazy' && (tabIsActive || tabRendered) ? children : null);
|
|
132
|
+
});
|
|
133
|
+
/**
|
|
134
|
+
* Allows content to be rendered based on the current tab being selected while outside of the TabPanel
|
|
135
|
+
* component. Can be placed freely within the main `<Tabs>` component.
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
function TabAwareSlot(_ref5) {
|
|
139
|
+
var children = _ref5.children;
|
|
140
|
+
var tabContextValue = useContext(TabsContext);
|
|
141
|
+
return tabContextValue ? children({
|
|
142
|
+
selectedId: tabContextValue.selectedId
|
|
143
|
+
}) : null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { Tab, TabAwareSlot, TabList, TabPanel, Tabs };
|
|
147
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","sources":["../../../src/new-components/tabs/tabs.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\nimport {\n useTabState,\n Tab as BaseTab,\n TabList as BaseTabList,\n TabPanel as BaseTabPanel,\n TabStateReturn,\n} from 'reakit/Tab'\nimport { Inline } from '../inline'\nimport { usePrevious } from '../../hooks/use-previous'\nimport { polymorphicComponent } from '../../utils/polymorphism'\nimport type { ResponsiveProp } from '../responsive-props'\nimport type { Space } from '../common-types'\n\nimport styles from './tabs.module.css'\n\nconst TabsContext = React.createContext<\n (TabStateReturn & Omit<TabsProps, 'children' | 'selectedId'>) | null\n>(null)\n\ntype TabsProps = {\n /** The `<Tabs>` component must be composed from a `<TabList>` and corresponding `<TabPanel>` components */\n children: React.ReactNode\n /**\n * Determines the primary colour of the tabs\n */\n color?: 'primary' | 'secondary' | 'tertiary'\n /**\n * Determines the style of the tabs\n */\n variant?: 'normal' | 'plain'\n /**\n * The id of the selected tab\n */\n selectedId?: string | null\n}\n\n/**\n * Used to group components that compose a set of tabs. There can only be one active tab within the same `<Tabs>` group.\n */\nexport function Tabs({\n children,\n selectedId,\n color = 'primary',\n variant = 'normal',\n}: TabsProps): React.ReactElement {\n const tabState = useTabState({ selectedId })\n const previousSelectedId = usePrevious(selectedId)\n const { selectedId: actualSelectedId, select } = tabState\n\n React.useEffect(\n function selectTab() {\n if (\n previousSelectedId !== selectedId &&\n selectedId !== actualSelectedId &&\n selectedId !== undefined\n ) {\n select(selectedId)\n }\n },\n [selectedId, actualSelectedId, select, previousSelectedId],\n )\n\n const memoizedTabState = React.useMemo(\n function memoizeTabState() {\n return {\n ...tabState,\n color,\n variant,\n }\n },\n // There is no guarantee that useTabState returns a stable object when there are no changes, so\n // following reakit/Tab's example we only return a new objet when any of its values have changed\n // eslint-disable-next-line\n [color, variant, ...Object.values(tabState)],\n )\n\n return <TabsContext.Provider value={memoizedTabState}>{children}</TabsContext.Provider>\n}\n\ntype TabProps = {\n /** The content to render inside of the tab button */\n children: React.ReactNode\n\n /** The tab's identifier. This must match its corresponding `<TabPanel>`'s id */\n id: string\n}\n\n/**\n * Represents the individual tab elements within the group. Each `<Tab>` must have a corresponding `<TabPanel>` component.\n */\nexport function Tab({ children, id }: TabProps): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n\n if (!tabContextValue) {\n return null\n }\n\n const { color, variant, ...tabState } = tabContextValue\n\n return (\n <BaseTab\n className={classNames(\n styles.tab,\n styles[`tab-${variant ?? ''}`],\n styles[`tab-${color ?? ''}`],\n )}\n id={id}\n {...tabState}\n >\n {children}\n </BaseTab>\n )\n}\n\ntype TabListProps = (\n | {\n /** Labels the tab list for assistive technologies. This must be provided if `aria-labelledby` is omitted. */\n 'aria-label': string\n }\n | {\n /**\n * One or more element IDs used to label the tab list for assistive technologies. Required if\n * `aria-label` is omitted.\n */\n 'aria-labelledby': string\n }\n | {\n /**\n * For cases where multiple instances of the tab list exists, the duplicates may be marked as aria-hidden\n */\n 'aria-hidden': boolean\n }\n) & {\n /**\n * A list of `<Tab>` elements\n */\n children: React.ReactNode\n\n /**\n * Controls the spacing between tabs\n */\n space?: ResponsiveProp<Space>\n}\n\n/**\n * A component used to group `<Tab>` elements together.\n */\nexport function TabList({\n children,\n space = 'medium',\n ...props\n}: TabListProps): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n\n if (!tabContextValue) {\n return null\n }\n\n const { color, variant, ...tabState } = tabContextValue\n\n return (\n <BaseTabList {...props} {...tabState}>\n <Inline space={space}>{children}</Inline>\n </BaseTabList>\n )\n}\n\ntype TabPanelProps = {\n /** The content to be rendered inside the tab */\n children: React.ReactNode\n\n /** The tabPanel's identifier. This must match its corresponding `<Tab>`'s id */\n id: string\n\n /**\n * By default, the tab panel's content is always rendered even when they are not active. This behaviour can be changed to\n * 'active', which renders only when the tab is active, and 'lazy', meaning while inactive tab panels will not be rendered\n * initially, they will remain mounted once they are active until the entire Tabs tree is unmounted.\n */\n render?: 'always' | 'active' | 'lazy'\n}\n\n/**\n * Used to define the content to be rendered when a tab is active. Each `<TabPanel>` must have a corresponding `<Tab>` component.\n */\nexport const TabPanel = polymorphicComponent<'div', TabPanelProps, 'omitClassName'>(\n function TabPanel(\n { children, id, as, render = 'always', ...props },\n ref,\n ): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n const [tabRendered, setTabRendered] = React.useState(false)\n const tabIsActive = tabContextValue?.selectedId === id\n\n React.useEffect(\n function trackTabRenderedState() {\n if (!tabRendered && tabIsActive) {\n setTabRendered(true)\n }\n },\n [tabRendered, tabIsActive],\n )\n\n if (!tabContextValue) {\n return null\n }\n\n const { color, variant, ...tabState } = tabContextValue\n\n return (\n <BaseTabPanel tabId={id} {...tabState} {...props} as={as} ref={ref}>\n {render === 'always' ? children : null}\n {render === 'active' && tabIsActive ? children : null}\n {render === 'lazy' && (tabIsActive || tabRendered) ? children : null}\n </BaseTabPanel>\n )\n },\n)\n\ntype TabAwareSlotProps = {\n /**\n * Render prop used to provide the content to be rendered inside the slot. The render prop will be\n * called with the current `selectedId`\n */\n children: (provided: { selectedId?: string | null }) => React.ReactElement | null\n}\n\n/**\n * Allows content to be rendered based on the current tab being selected while outside of the TabPanel\n * component. Can be placed freely within the main `<Tabs>` component.\n */\nexport function TabAwareSlot({ children }: TabAwareSlotProps): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n\n return tabContextValue ? children({ selectedId: tabContextValue.selectedId }) : null\n}\n"],"names":["TabsContext","React","Tabs","children","selectedId","color","variant","tabState","useTabState","previousSelectedId","usePrevious","actualSelectedId","select","selectTab","undefined","memoizedTabState","memoizeTabState","Object","values","Provider","value","Tab","id","tabContextValue","BaseTab","className","classNames","styles","tab","TabList","space","props","BaseTabList","Inline","TabPanel","polymorphicComponent","ref","as","render","tabRendered","setTabRendered","tabIsActive","trackTabRenderedState","BaseTabPanel","tabId","TabAwareSlot"],"mappings":";;;;;;;;;;;;;;AAiBA,IAAMA,WAAW,gBAAGC,aAAA,CAElB,IAFkB,CAApB;AAqBA;;;;SAGgBC;MACZC,gBAAAA;MACAC,kBAAAA;wBACAC;MAAAA,gCAAQ;0BACRC;MAAAA,oCAAU;AAEV,MAAMC,QAAQ,GAAGC,WAAW,CAAC;AAAEJ,IAAAA,UAAU,EAAVA;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A,sBACItB,aAAA,CAAC0C,UAAD;AAAcC,IAAAA,KAAK,EAAEtB;KAAQf,UAAcwB;AAAOM,IAAAA,EAAE,EAAEA;AAAID,IAAAA,GAAG,EAAEA;IAA/D,EACKE,MAAM,KAAK,QAAX,GAAsBnC,QAAtB,GAAiC,IADtC,EAEKmC,MAAM,KAAK,QAAX,IAAuBG,WAAvB,GAAqCtC,QAArC,GAAgD,IAFrD,EAGKmC,MAAM,KAAK,MAAX,KAAsBG,WAAW,IAAIF,WAArC,IAAoDpC,QAApD,GAA+D,IAHpE,CADJ;AAOH,CA/BuC;AA0C5C;;;;;SAIgB0C;MAAe1C,iBAAAA;AAC3B,MAAMoB,eAAe,GAAGtB,UAAA,CAAiBD,WAAjB,CAAxB;AAEA,SAAOuB,eAAe,GAAGpB,QAAQ,CAAC;AAAEC,IAAAA,UAAU,EAAEmB,eAAe,CAACnB;AAA9B,GAAD,CAAX,GAA0D,IAAhF;AACH;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { createElement } from 'react';
|
|
3
|
+
import { polymorphicComponent } from '../../utils/polymorphism.js';
|
|
4
|
+
import { getClassNames } from '../responsive-props.js';
|
|
5
|
+
import { Box } from '../box/box.js';
|
|
6
|
+
import styles from './text.module.css.js';
|
|
7
|
+
|
|
8
|
+
var _excluded = ["as", "size", "weight", "tone", "align", "children", "lineClamp", "exceptionallySetClassName"];
|
|
9
|
+
var Text = /*#__PURE__*/polymorphicComponent(function Text(_ref, ref) {
|
|
10
|
+
var as = _ref.as,
|
|
11
|
+
_ref$size = _ref.size,
|
|
12
|
+
size = _ref$size === void 0 ? 'body' : _ref$size,
|
|
13
|
+
_ref$weight = _ref.weight,
|
|
14
|
+
weight = _ref$weight === void 0 ? 'regular' : _ref$weight,
|
|
15
|
+
_ref$tone = _ref.tone,
|
|
16
|
+
tone = _ref$tone === void 0 ? 'normal' : _ref$tone,
|
|
17
|
+
align = _ref.align,
|
|
18
|
+
children = _ref.children,
|
|
19
|
+
lineClamp = _ref.lineClamp,
|
|
20
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
21
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
22
|
+
|
|
23
|
+
var lineClampMultipleLines = typeof lineClamp === 'string' ? Number(lineClamp) > 1 : (lineClamp !== null && lineClamp !== void 0 ? lineClamp : 1) > 1;
|
|
24
|
+
return /*#__PURE__*/createElement(Box, Object.assign({}, props, {
|
|
25
|
+
as: as,
|
|
26
|
+
className: [exceptionallySetClassName, styles.text, size !== 'body' ? getClassNames(styles, 'size', size) : null, weight !== 'regular' ? getClassNames(styles, 'weight', weight) : null, tone !== 'normal' ? getClassNames(styles, 'tone', tone) : null, lineClampMultipleLines ? styles.lineClampMultipleLines : null, lineClamp ? getClassNames(styles, 'lineClamp', lineClamp.toString()) : null],
|
|
27
|
+
textAlign: align,
|
|
28
|
+
// Prevents emojis from being cut-off
|
|
29
|
+
// See https://github.com/Doist/reactist/pull/528
|
|
30
|
+
paddingRight: lineClamp ? 'xsmall' : undefined,
|
|
31
|
+
ref: ref
|
|
32
|
+
}), children);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export { Text };
|
|
36
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sources":["../../../src/new-components/text/text.tsx"],"sourcesContent":["import * as React from 'react'\nimport { getClassNames } from '../responsive-props'\nimport { Box } from '../box'\nimport { polymorphicComponent } from '../../utils/polymorphism'\n\nimport type { Tone } from '../common-types'\nimport type { BoxProps } from '../box'\n\nimport styles from './text.module.css'\n\ntype TextProps = {\n children: React.ReactNode\n /**\n * The size of the text.\n *\n * The supported values, from smaller size to larger size, are:\n * 'caption', 'copy', 'body', and 'subtitle'\n *\n * @default 'body'\n */\n size?: 'caption' | 'copy' | 'body' | 'subtitle'\n /**\n * The weight of the text font.\n *\n * @default 'regular'\n */\n weight?: 'regular' | 'semibold' | 'bold'\n /**\n * The tone (semantic color) of the text.\n *\n * @default 'normal'\n */\n tone?: Tone\n /**\n * Used to truncate the text to a given number of lines.\n *\n * It will add an ellipsis (`…`) to the text at the end of the last line, only if the text was\n * truncated. If the text fits without it being truncated, no ellipsis is added.\n *\n * By default, the text is not truncated at all, no matter how many lines it takes to render it.\n *\n * @default undefined\n */\n lineClamp?: 1 | 2 | 3 | 4 | 5 | '1' | '2' | '3' | '4' | '5'\n /**\n * How to align the text horizontally.\n *\n * @default 'start'\n */\n align?: BoxProps['textAlign']\n}\n\nconst Text = polymorphicComponent<'div', TextProps>(function Text(\n {\n as,\n size = 'body',\n weight = 'regular',\n tone = 'normal',\n align,\n children,\n lineClamp,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const lineClampMultipleLines =\n typeof lineClamp === 'string' ? Number(lineClamp) > 1 : (lineClamp ?? 1) > 1\n\n return (\n <Box\n {...props}\n as={as}\n className={[\n exceptionallySetClassName,\n styles.text,\n size !== 'body' ? getClassNames(styles, 'size', size) : null,\n weight !== 'regular' ? getClassNames(styles, 'weight', weight) : null,\n tone !== 'normal' ? getClassNames(styles, 'tone', tone) : null,\n lineClampMultipleLines ? styles.lineClampMultipleLines : null,\n lineClamp ? getClassNames(styles, 'lineClamp', lineClamp.toString()) : null,\n ]}\n textAlign={align}\n // Prevents emojis from being cut-off\n // See https://github.com/Doist/reactist/pull/528\n paddingRight={lineClamp ? 'xsmall' : undefined}\n ref={ref}\n >\n {children}\n </Box>\n )\n})\n\nexport type { TextProps }\nexport { Text }\n"],"names":["Text","polymorphicComponent","ref","as","size","weight","tone","align","children","lineClamp","exceptionallySetClassName","props","lineClampMultipleLines","Number","React","Box","className","styles","text","getClassNames","toString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{"text":"c5028ea8","size-caption":"_05d3a546","size-copy":"_100565e3","size-subtitle":"b8f72625","weight-semibold":"_398ecda1","weight-bold":"_8054cd6b","tone-secondary":"_6abd56b1","tone-danger":"_274b4a47","lineClampMultipleLines":"_724b0054","lineClamp-1":"_51ac6ee4","lineClamp-2":"b0742803","lineClamp-3":"dd664c95","lineClamp-4":"b02775b5","lineClamp-5":"da91b300"};
|
|
2
|
+
|
|
3
|
+
export default modules_a9637dd3;
|
|
4
|
+
//# sourceMappingURL=text.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { createElement } from 'react';
|
|
3
|
+
import { Box } from '../box/box.js';
|
|
4
|
+
import { BaseField } from '../base-field/base-field.js';
|
|
5
|
+
import styles from './text-area.module.css.js';
|
|
6
|
+
|
|
7
|
+
var _excluded = ["id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "maxWidth"];
|
|
8
|
+
|
|
9
|
+
function TextArea(_ref) {
|
|
10
|
+
var id = _ref.id,
|
|
11
|
+
label = _ref.label,
|
|
12
|
+
secondaryLabel = _ref.secondaryLabel,
|
|
13
|
+
auxiliaryLabel = _ref.auxiliaryLabel,
|
|
14
|
+
hint = _ref.hint,
|
|
15
|
+
maxWidth = _ref.maxWidth,
|
|
16
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
17
|
+
|
|
18
|
+
return /*#__PURE__*/createElement(BaseField, {
|
|
19
|
+
id: id,
|
|
20
|
+
label: label,
|
|
21
|
+
secondaryLabel: secondaryLabel,
|
|
22
|
+
auxiliaryLabel: auxiliaryLabel,
|
|
23
|
+
hint: hint,
|
|
24
|
+
className: styles.container,
|
|
25
|
+
maxWidth: maxWidth
|
|
26
|
+
}, function (extraProps) {
|
|
27
|
+
return /*#__PURE__*/createElement(Box, {
|
|
28
|
+
width: "full"
|
|
29
|
+
}, /*#__PURE__*/createElement("textarea", Object.assign({}, props, extraProps)));
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { TextArea };
|
|
34
|
+
//# sourceMappingURL=text-area.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-area.js","sources":["../../../src/new-components/text-area/text-area.tsx"],"sourcesContent":["import * as React from 'react'\nimport { BaseField, FieldComponentProps } from '../base-field'\nimport { Box } from '../box'\nimport styles from './text-area.module.css'\n\ntype TextAreaProps = FieldComponentProps<HTMLTextAreaElement> & {\n rows?: number\n}\n\nfunction TextArea({\n id,\n label,\n secondaryLabel,\n auxiliaryLabel,\n hint,\n maxWidth,\n ...props\n}: TextAreaProps) {\n return (\n <BaseField\n id={id}\n label={label}\n secondaryLabel={secondaryLabel}\n auxiliaryLabel={auxiliaryLabel}\n hint={hint}\n className={styles.container}\n maxWidth={maxWidth}\n >\n {(extraProps) => (\n <Box width=\"full\">\n <textarea {...props} {...extraProps} />\n </Box>\n )}\n </BaseField>\n )\n}\n\nexport { TextArea }\nexport type { TextAreaProps }\n"],"names":["TextArea","id","label","secondaryLabel","auxiliaryLabel","hint","maxWidth","props","React","BaseField","className","styles","container","extraProps","Box","width"],"mappings":";;;;;;;;AASA,SAASA,QAAT;MACIC,UAAAA;MACAC,aAAAA;MACAC,sBAAAA;MACAC,sBAAAA;MACAC,YAAAA;MACAC,gBAAAA;MACGC;;AAEH,sBACIC,aAAA,CAACC,SAAD;AACIR,IAAAA,EAAE,EAAEA;AACJC,IAAAA,KAAK,EAAEA;AACPC,IAAAA,cAAc,EAAEA;AAChBC,IAAAA,cAAc,EAAEA;AAChBC,IAAAA,IAAI,EAAEA;AACNK,IAAAA,SAAS,EAAEC,MAAM,CAACC;AAClBN,IAAAA,QAAQ,EAAEA;GAPd,EASK,UAACO,UAAD;AAAA,wBACGL,aAAA,CAACM,GAAD;AAAKC,MAAAA,KAAK,EAAC;KAAX,eACIP,aAAA,WAAA,oBAAcD,OAAWM,WAAzB,CADJ,CADH;AAAA,GATL,CADJ;AAiBH;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-area.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { forwardRef, createElement } from 'react';
|
|
3
|
+
import { Box } from '../box/box.js';
|
|
4
|
+
import { BaseField } from '../base-field/base-field.js';
|
|
5
|
+
import styles from './text-field.module.css.js';
|
|
6
|
+
|
|
7
|
+
var _excluded = ["id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "type", "maxWidth", "hidden", "aria-describedby"];
|
|
8
|
+
var TextField = /*#__PURE__*/forwardRef(function TextField(_ref, ref) {
|
|
9
|
+
var id = _ref.id,
|
|
10
|
+
label = _ref.label,
|
|
11
|
+
secondaryLabel = _ref.secondaryLabel,
|
|
12
|
+
auxiliaryLabel = _ref.auxiliaryLabel,
|
|
13
|
+
hint = _ref.hint,
|
|
14
|
+
_ref$type = _ref.type,
|
|
15
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
16
|
+
maxWidth = _ref.maxWidth,
|
|
17
|
+
hidden = _ref.hidden,
|
|
18
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
19
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
|
+
|
|
21
|
+
return /*#__PURE__*/createElement(BaseField, {
|
|
22
|
+
id: id,
|
|
23
|
+
label: label,
|
|
24
|
+
secondaryLabel: secondaryLabel,
|
|
25
|
+
auxiliaryLabel: auxiliaryLabel,
|
|
26
|
+
hint: hint,
|
|
27
|
+
maxWidth: maxWidth,
|
|
28
|
+
hidden: hidden,
|
|
29
|
+
"aria-describedby": ariaDescribedBy
|
|
30
|
+
}, function (extraProps) {
|
|
31
|
+
return /*#__PURE__*/createElement(Box, {
|
|
32
|
+
className: styles.inputWrapper
|
|
33
|
+
}, /*#__PURE__*/createElement("input", Object.assign({}, props, extraProps, {
|
|
34
|
+
type: type,
|
|
35
|
+
ref: ref
|
|
36
|
+
})));
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export { TextField };
|
|
41
|
+
//# sourceMappingURL=text-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.js","sources":["../../../src/new-components/text-field/text-field.tsx"],"sourcesContent":["import * as React from 'react'\nimport { BaseField } from '../base-field'\nimport { Box } from '../box'\nimport styles from './text-field.module.css'\nimport type { FieldComponentProps } from '../base-field'\n\ntype TextFieldType = 'email' | 'search' | 'tel' | 'text' | 'url'\n\ntype TextFieldProps = Omit<FieldComponentProps<HTMLInputElement>, 'type'> & {\n type?: TextFieldType\n}\n\nconst TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(function TextField(\n {\n id,\n label,\n secondaryLabel,\n auxiliaryLabel,\n hint,\n type = 'text',\n maxWidth,\n hidden,\n 'aria-describedby': ariaDescribedBy,\n ...props\n },\n ref,\n) {\n return (\n <BaseField\n id={id}\n label={label}\n secondaryLabel={secondaryLabel}\n auxiliaryLabel={auxiliaryLabel}\n hint={hint}\n maxWidth={maxWidth}\n hidden={hidden}\n aria-describedby={ariaDescribedBy}\n >\n {(extraProps) => (\n <Box className={styles.inputWrapper}>\n <input {...props} {...extraProps} type={type} ref={ref} />\n </Box>\n )}\n </BaseField>\n )\n})\n\nexport { TextField }\nexport type { TextFieldProps, TextFieldType }\n"],"names":["TextField","React","ref","id","label","secondaryLabel","auxiliaryLabel","hint","type","maxWidth","hidden","ariaDescribedBy","props","BaseField","extraProps","Box","className","styles","inputWrapper"],"mappings":";;;;;;;IAYMA,SAAS,gBAAGC,UAAA,CAAmD,SAASD,SAAT,OAajEE,GAbiE;MAE7DC,UAAAA;MACAC,aAAAA;MACAC,sBAAAA;MACAC,sBAAAA;MACAC,YAAAA;uBACAC;MAAAA,8BAAO;MACPC,gBAAAA;MACAC,cAAAA;MACoBC,uBAApB;MACGC;;AAIP,sBACIX,aAAA,CAACY,SAAD;AACIV,IAAAA,EAAE,EAAEA;AACJC,IAAAA,KAAK,EAAEA;AACPC,IAAAA,cAAc,EAAEA;AAChBC,IAAAA,cAAc,EAAEA;AAChBC,IAAAA,IAAI,EAAEA;AACNE,IAAAA,QAAQ,EAAEA;AACVC,IAAAA,MAAM,EAAEA;wBACUC;GARtB,EAUK,UAACG,UAAD;AAAA,wBACGb,aAAA,CAACc,GAAD;AAAKC,MAAAA,SAAS,EAAEC,MAAM,CAACC;KAAvB,eACIjB,aAAA,QAAA,oBAAWW,OAAWE;AAAYN,MAAAA,IAAI,EAAEA;AAAMN,MAAAA,GAAG,EAAEA;MAAnD,CADJ,CADH;AAAA,GAVL,CADJ;AAkBH,CAjCiB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { createElement } from 'react';
|
|
3
|
+
import { polymorphicComponent } from '../../utils/polymorphism.js';
|
|
4
|
+
import { Box } from '../box/box.js';
|
|
5
|
+
import styles from './text-link.module.css.js';
|
|
6
|
+
|
|
7
|
+
var _excluded = ["as", "openInNewTab", "exceptionallySetClassName"];
|
|
8
|
+
var TextLink = /*#__PURE__*/polymorphicComponent(function TextLink(_ref, ref) {
|
|
9
|
+
var _ref$as = _ref.as,
|
|
10
|
+
as = _ref$as === void 0 ? 'a' : _ref$as,
|
|
11
|
+
_ref$openInNewTab = _ref.openInNewTab,
|
|
12
|
+
openInNewTab = _ref$openInNewTab === void 0 ? false : _ref$openInNewTab,
|
|
13
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
14
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
15
|
+
|
|
16
|
+
return /*#__PURE__*/createElement(Box, Object.assign({}, props, {
|
|
17
|
+
as: as,
|
|
18
|
+
display: "inline",
|
|
19
|
+
className: [exceptionallySetClassName, styles.container],
|
|
20
|
+
ref: ref,
|
|
21
|
+
target: openInNewTab ? '_blank' : undefined,
|
|
22
|
+
rel: openInNewTab ? 'noopener noreferrer' : undefined
|
|
23
|
+
}));
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { TextLink };
|
|
27
|
+
//# sourceMappingURL=text-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-link.js","sources":["../../../src/new-components/text-link/text-link.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport { polymorphicComponent } from '../../utils/polymorphism'\nimport styles from './text-link.module.css'\nimport type { OpenInNewTab } from '../common-types'\n\ntype TextLinkProps = OpenInNewTab\n\nconst TextLink = polymorphicComponent<'a', TextLinkProps>(function TextLink(\n { as = 'a', openInNewTab = false, exceptionallySetClassName, ...props },\n ref,\n) {\n return (\n <Box\n {...props}\n as={as}\n display=\"inline\"\n className={[exceptionallySetClassName, styles.container]}\n ref={ref}\n target={openInNewTab ? '_blank' : undefined}\n rel={openInNewTab ? 'noopener noreferrer' : undefined}\n />\n )\n})\n\nexport { TextLink }\nexport type { TextLinkProps }\n"],"names":["TextLink","polymorphicComponent","ref","as","openInNewTab","exceptionallySetClassName","props","React","Box","display","className","styles","container","target","undefined","rel"],"mappings":";;;;;;;IAQMA,QAAQ,gBAAGC,oBAAoB,CAAqB,SAASD,QAAT,OAEtDE,GAFsD;qBACpDC;MAAAA,0BAAK;+BAAKC;MAAAA,8CAAe;MAAOC,iCAAAA;MAA8BC;;AAGhE,sBACIC,aAAA,CAACC,GAAD,oBACQF;AACJH,IAAAA,EAAE,EAAEA;AACJM,IAAAA,OAAO,EAAC;AACRC,IAAAA,SAAS,EAAE,CAACL,yBAAD,EAA4BM,MAAM,CAACC,SAAnC;AACXV,IAAAA,GAAG,EAAEA;AACLW,IAAAA,MAAM,EAAET,YAAY,GAAG,QAAH,GAAcU;AAClCC,IAAAA,GAAG,EAAEX,YAAY,GAAG,qBAAH,GAA2BU;IAPhD,CADJ;AAWH,CAfoC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-link.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
/**
|
|
5
|
+
* A wrapper to use React.forwardRef with polymorphic components in a type-safe manner. This is a
|
|
6
|
+
* convenience over merely using React.forwardRef directly, and then manually forcing the resulting
|
|
7
|
+
* value to be typed using `as PolymorphicComponent<…>`.
|
|
8
|
+
*
|
|
9
|
+
* @see PolymorphicComponent for details about what this type does
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
function polymorphicComponent(render) {
|
|
13
|
+
return /*#__PURE__*/forwardRef(render);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { polymorphicComponent };
|
|
17
|
+
//# sourceMappingURL=polymorphism.js.map
|