@doist/reactist 9.2.0-beta.8 → 10.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/reactist.cjs.development.js +1499 -866
- 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/color-picker/color-picker.js +1 -1
- package/es/components/color-picker/color-picker.js.map +1 -1
- package/es/components/{button/button.js → deprecated-button/deprecated-button.js} +9 -4
- package/es/components/deprecated-button/deprecated-button.js.map +1 -0
- package/es/components/{button → deprecated-button}/index.js +1 -1
- package/es/components/{button → 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} +9 -2
- 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 +8 -4
- package/es/components/dropdown/dropdown.js.map +1 -1
- package/es/components/error-message/error-message.js +4 -2
- package/es/components/error-message/error-message.js.map +1 -1
- package/es/components/icon/icon.js.map +1 -1
- package/es/components/key-capturer/key-capturer.js.map +1 -1
- package/es/components/keyboard-shortcut/keyboard-shortcut.js +6 -3
- package/es/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/es/components/menu/menu.js +40 -27
- package/es/components/menu/menu.js.map +1 -1
- package/es/components/notification/notification.js +3 -1
- package/es/components/notification/notification.js.map +1 -1
- package/es/components/popover/popover.js.map +1 -1
- package/es/components/popover/positioning-utils.js.map +1 -1
- package/es/components/range-input/range-input.js +1 -1
- package/es/components/range-input/range-input.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.map +1 -1
- package/es/components/tooltip/tooltip.js +3 -1
- 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 +11 -6
- package/es/index.js.map +1 -1
- package/es/new-components/base-button/base-button.js +72 -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 +29 -29
- package/es/new-components/base-field/base-field.js.map +1 -1
- package/es/new-components/base-field/base-field.module.css.js +1 -1
- package/es/new-components/box/box.js +29 -10
- package/es/new-components/box/box.js.map +1 -1
- package/es/new-components/box/box.module.css.js +1 -1
- 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/button/button.js +41 -0
- package/es/new-components/button/button.js.map +1 -0
- package/es/new-components/button-link/button-link.js +26 -14
- package/es/new-components/button-link/button-link.js.map +1 -1
- package/es/new-components/checkbox-field/checkbox-field.js +46 -23
- package/es/new-components/checkbox-field/checkbox-field.js.map +1 -1
- package/es/new-components/checkbox-field/checkbox-field.module.css.js +1 -1
- package/es/new-components/checkbox-field/checkbox-icon.js +2 -1
- package/es/new-components/checkbox-field/checkbox-icon.js.map +1 -1
- package/es/new-components/columns/columns.js +28 -14
- package/es/new-components/columns/columns.js.map +1 -1
- package/es/new-components/columns/columns.module.css.js +1 -1
- package/es/new-components/divider/divider.js +6 -4
- package/es/new-components/divider/divider.js.map +1 -1
- package/es/new-components/divider/divider.module.css.js +1 -1
- package/es/new-components/heading/heading.js +10 -3
- package/es/new-components/heading/heading.js.map +1 -1
- package/es/new-components/heading/heading.module.css.js +1 -1
- 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 +2 -1
- package/es/new-components/icons/alert-icon.js.map +1 -1
- package/es/new-components/inline/inline.js +10 -8
- package/es/new-components/inline/inline.js.map +1 -1
- package/es/new-components/loading/loading.js +34 -0
- package/es/new-components/loading/loading.js.map +1 -0
- package/es/new-components/modal/modal.js +206 -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/password-field/password-field.js +8 -4
- package/es/new-components/password-field/password-field.js.map +1 -1
- package/es/new-components/responsive-props.js +21 -11
- package/es/new-components/responsive-props.js.map +1 -1
- package/es/new-components/select-field/select-field.js +13 -6
- package/es/new-components/select-field/select-field.js.map +1 -1
- package/es/new-components/select-field/select-field.module.css.js +1 -1
- 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 +23 -12
- package/es/new-components/stack/stack.js.map +1 -1
- package/es/new-components/switch-field/switch-field.js +48 -28
- package/es/new-components/switch-field/switch-field.js.map +1 -1
- package/es/new-components/switch-field/switch-field.module.css.js +1 -1
- 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 +16 -10
- package/es/new-components/text/text.js.map +1 -1
- package/es/new-components/text/text.module.css.js +1 -1
- package/es/new-components/text-area/text-area.js +3 -1
- package/es/new-components/text-area/text-area.js.map +1 -1
- package/es/new-components/text-area/text-area.module.css.js +1 -1
- package/es/new-components/text-field/text-field.js +5 -2
- package/es/new-components/text-field/text-field.js.map +1 -1
- package/es/new-components/text-field/text-field.module.css.js +1 -1
- package/es/new-components/text-link/text-link.js +9 -7
- package/es/new-components/text-link/text-link.js.map +1 -1
- 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/color-picker/color-picker.js +1 -1
- package/lib/components/color-picker/color-picker.js.map +1 -1
- 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/{button/button.test.d.ts → deprecated-button/deprecated-button.test.d.ts} +0 -0
- package/lib/components/deprecated-button/index.d.ts +4 -0
- package/lib/components/{loading → deprecated-button}/index.js +1 -1
- package/lib/components/{button → 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/{loading/Loading.test.d.ts → deprecated-loading/deprecated-loading.test.d.ts} +0 -0
- package/lib/components/deprecated-loading/index.d.ts +1 -0
- package/lib/components/{modal/modal.d.ts → deprecated-modal/deprecated-modal.d.ts} +6 -1
- package/lib/components/{modal/modal.js → deprecated-modal/deprecated-modal.js} +2 -2
- package/lib/components/deprecated-modal/deprecated-modal.js.map +1 -0
- package/lib/components/{modal/modal.test.d.ts → deprecated-modal/deprecated-modal.test.d.ts} +0 -0
- package/lib/components/{modal → deprecated-modal}/index.d.ts +3 -3
- 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/error-message/error-message.js +1 -1
- package/lib/components/error-message/error-message.js.map +1 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js +1 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/lib/components/menu/index.d.ts +1 -1
- 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/notification/notification.js +1 -1
- package/lib/components/notification/notification.js.map +1 -1
- package/lib/components/range-input/range-input.js +1 -1
- package/lib/components/range-input/range-input.js.map +1 -1
- package/lib/components/select/select.js +1 -1
- package/lib/components/select/select.js.map +1 -1
- package/lib/components/tooltip/index.d.ts +1 -1
- package/lib/components/tooltip/tooltip.js +1 -1
- package/lib/components/tooltip/tooltip.js.map +1 -1
- 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 +10 -5
- package/lib/index.js +1 -1
- package/lib/new-components/base-button/base-button.d.ts +65 -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 +53 -13
- package/lib/new-components/base-field/base-field.js +1 -1
- package/lib/new-components/base-field/base-field.js.map +1 -1
- package/lib/new-components/base-field/base-field.module.css.js +1 -1
- package/lib/new-components/box/box.d.ts +24 -13
- package/lib/new-components/box/box.js +1 -1
- package/lib/new-components/box/box.js.map +1 -1
- package/lib/new-components/box/box.module.css.js +1 -1
- package/lib/{components/tabs/tabs.test.d.ts → new-components/box/box.test.d.ts} +0 -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/button/button.d.ts +48 -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 +14 -8
- package/lib/new-components/button-link/button-link.js +1 -1
- package/lib/new-components/button-link/button-link.js.map +1 -1
- package/lib/new-components/button-link/button-link.test.d.ts +1 -0
- package/lib/new-components/checkbox-field/checkbox-field.d.ts +3 -3
- package/lib/new-components/checkbox-field/checkbox-field.js +1 -1
- package/lib/new-components/checkbox-field/checkbox-field.js.map +1 -1
- package/lib/new-components/checkbox-field/checkbox-field.module.css.js +1 -1
- package/lib/new-components/checkbox-field/checkbox-field.test.d.ts +1 -0
- package/lib/new-components/checkbox-field/checkbox-icon.js +1 -1
- package/lib/new-components/checkbox-field/checkbox-icon.js.map +1 -1
- package/lib/new-components/columns/columns.d.ts +4 -5
- package/lib/new-components/columns/columns.js +1 -1
- package/lib/new-components/columns/columns.js.map +1 -1
- package/lib/new-components/columns/columns.module.css.js +1 -1
- package/lib/new-components/columns/columns.test.d.ts +1 -0
- package/lib/new-components/common-types.d.ts +2 -0
- package/lib/new-components/divider/divider.d.ts +2 -2
- package/lib/new-components/divider/divider.js +1 -1
- package/lib/new-components/divider/divider.js.map +1 -1
- package/lib/new-components/divider/divider.module.css.js +1 -1
- package/lib/new-components/heading/heading.d.ts +101 -2
- package/lib/new-components/heading/heading.js +1 -1
- package/lib/new-components/heading/heading.js.map +1 -1
- package/lib/new-components/heading/heading.module.css.js +1 -1
- package/lib/new-components/heading/heading.test.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.js +1 -1
- package/lib/new-components/icons/alert-icon.js.map +1 -1
- package/lib/new-components/inline/inline.d.ts +1 -2
- package/lib/new-components/inline/inline.js +1 -1
- package/lib/new-components/inline/inline.js.map +1 -1
- 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 +26 -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 +151 -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/password-field/password-field.d.ts +2 -2
- package/lib/new-components/password-field/password-field.js +1 -1
- package/lib/new-components/password-field/password-field.js.map +1 -1
- package/lib/new-components/password-field/password-field.test.d.ts +1 -0
- package/lib/new-components/responsive-props.d.ts +12 -14
- package/lib/new-components/responsive-props.js +1 -1
- package/lib/new-components/responsive-props.js.map +1 -1
- package/lib/new-components/select-field/select-field.d.ts +4 -4
- package/lib/new-components/select-field/select-field.js +1 -1
- package/lib/new-components/select-field/select-field.js.map +1 -1
- package/lib/new-components/select-field/select-field.module.css.js +1 -1
- 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/stack.d.ts +8 -5
- package/lib/new-components/stack/stack.js +1 -1
- package/lib/new-components/stack/stack.js.map +1 -1
- package/lib/new-components/stack/stack.test.d.ts +1 -0
- package/lib/new-components/switch-field/switch-field.d.ts +4 -4
- package/lib/new-components/switch-field/switch-field.js +1 -1
- package/lib/new-components/switch-field/switch-field.js.map +1 -1
- package/lib/new-components/switch-field/switch-field.module.css.js +1 -1
- 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/text.d.ts +38 -5
- package/lib/new-components/text/text.js +1 -1
- package/lib/new-components/text/text.js.map +1 -1
- package/lib/new-components/text/text.module.css.js +1 -1
- package/lib/new-components/text/text.test.d.ts +1 -0
- package/lib/new-components/text-area/text-area.d.ts +2 -2
- package/lib/new-components/text-area/text-area.js +1 -1
- package/lib/new-components/text-area/text-area.js.map +1 -1
- package/lib/new-components/text-area/text-area.module.css.js +1 -1
- package/lib/new-components/text-field/text-field.d.ts +7 -4
- package/lib/new-components/text-field/text-field.js +1 -1
- package/lib/new-components/text-field/text-field.js.map +1 -1
- package/lib/new-components/text-field/text-field.module.css.js +1 -1
- package/lib/new-components/text-field/text-field.test.d.ts +1 -0
- package/lib/new-components/text-link/text-link.d.ts +1 -2
- package/lib/new-components/text-link/text-link.js +1 -1
- package/lib/new-components/text-link/text-link.js.map +1 -1
- 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 +27 -23
- package/styles/alert.css +4 -2
- package/styles/base-button.css +6 -0
- package/styles/base-button.module.css.css +1 -0
- package/styles/base-field.css +7 -3
- package/styles/base-field.module.css.css +1 -1
- package/styles/box.css +3 -0
- package/styles/box.module.css.css +1 -1
- package/styles/checkbox-field.css +6 -2
- package/styles/checkbox-field.module.css.css +1 -1
- package/styles/color-picker.css +1 -1
- package/styles/columns.css +4 -2
- package/styles/columns.module.css.css +1 -1
- package/styles/deprecated-button.css +2 -0
- package/styles/deprecated-loading.css +1 -0
- package/styles/deprecated-modal.css +1 -0
- package/styles/divider.css +4 -2
- package/styles/divider.module.css.css +1 -1
- package/styles/dropdown.css +1 -1
- package/styles/heading.css +4 -2
- package/styles/heading.module.css.css +1 -1
- package/styles/hidden-visually.css +4 -0
- package/styles/hidden-visually.module.css.css +1 -0
- package/styles/hidden.css +4 -0
- package/styles/hidden.module.css.css +1 -0
- package/styles/inline.css +3 -1
- package/styles/loading.css +4 -1
- package/styles/margin.module.css.css +1 -0
- package/styles/menu.css +1 -1
- package/styles/modal.css +10 -1
- package/styles/modal.module.css.css +1 -0
- package/styles/notice.css +4 -2
- package/styles/padding.module.css.css +1 -0
- package/styles/password-field.css +8 -4
- package/styles/reactist.css +24 -19
- package/styles/select-field.css +8 -4
- package/styles/select-field.module.css.css +1 -1
- package/styles/spinner.module.css.css +1 -0
- package/styles/stack.css +4 -2
- package/styles/switch-field.css +9 -4
- package/styles/switch-field.module.css.css +1 -1
- package/styles/tabs.css +5 -1
- package/styles/tabs.module.css.css +1 -0
- package/styles/text-area.css +8 -4
- package/styles/text-area.module.css.css +1 -1
- package/styles/text-field.css +8 -4
- package/styles/text-field.module.css.css +1 -1
- package/styles/text-link.css +3 -1
- package/styles/text.css +4 -2
- package/styles/text.module.css.css +1 -1
- package/styles/tip.css +1 -1
- package/CHANGELOG.md +0 -496
- package/es/components/button/button.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/tabs/tabs.js +0 -123
- package/es/components/tabs/tabs.js.map +0 -1
- package/es/new-components/button-link/button-link.module.css.js +0 -4
- package/es/new-components/button-link/button-link.module.css.js.map +0 -1
- package/es/new-components/loading-spinner/loading-spinner.js +0 -37
- package/es/new-components/loading-spinner/loading-spinner.js.map +0 -1
- package/es/new-components/loading-spinner/loading-spinner.module.css.js +0 -4
- package/es/new-components/loading-spinner/loading-spinner.module.css.js.map +0 -1
- package/es/new-components/type-helpers.js +0 -10
- package/es/new-components/type-helpers.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/loading/index.d.ts +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.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/new-components/button-link/button-link.module.css.js +0 -2
- package/lib/new-components/button-link/button-link.module.css.js.map +0 -1
- package/lib/new-components/loading-spinner/index.d.ts +0 -1
- package/lib/new-components/loading-spinner/loading-spinner.d.ts +0 -8
- package/lib/new-components/loading-spinner/loading-spinner.js +0 -2
- package/lib/new-components/loading-spinner/loading-spinner.js.map +0 -1
- package/lib/new-components/loading-spinner/loading-spinner.module.css.js +0 -2
- package/lib/new-components/loading-spinner/loading-spinner.module.css.js.map +0 -1
- package/lib/new-components/type-helpers.d.ts +0 -26
- package/lib/new-components/type-helpers.js +0 -2
- package/lib/new-components/type-helpers.js.map +0 -1
- package/styles/button-link.css +0 -2
- package/styles/button-link.module.css.css +0 -1
- package/styles/button.css +0 -2
- package/styles/loading-spinner.module.css.css +0 -1
|
@@ -8,9 +8,11 @@ var React = require('react');
|
|
|
8
8
|
var React__default = _interopDefault(React);
|
|
9
9
|
var classNames = _interopDefault(require('classnames'));
|
|
10
10
|
var flattenChildren = _interopDefault(require('react-keyed-flatten-children'));
|
|
11
|
-
var VisuallyHidden = require('reakit/VisuallyHidden');
|
|
12
|
-
var reakitUtils = require('reakit-utils');
|
|
13
11
|
var Tooltip$1 = require('reakit/Tooltip');
|
|
12
|
+
var reakitUtils = require('reakit-utils');
|
|
13
|
+
var Tab$1 = require('reakit/Tab');
|
|
14
|
+
var dialog = require('@reach/dialog');
|
|
15
|
+
var FocusLock = _interopDefault(require('react-focus-lock'));
|
|
14
16
|
var ReactDOM = _interopDefault(require('react-dom'));
|
|
15
17
|
var PropTypes = _interopDefault(require('prop-types'));
|
|
16
18
|
var dayjs = _interopDefault(require('dayjs'));
|
|
@@ -18,29 +20,18 @@ var LocalizedFormat = _interopDefault(require('dayjs/plugin/localizedFormat'));
|
|
|
18
20
|
var Reakit = require('reakit/Menu');
|
|
19
21
|
var Popover$1 = require('reakit/Popover');
|
|
20
22
|
|
|
21
|
-
function _defineProperty(obj, key, value) {
|
|
22
|
-
if (key in obj) {
|
|
23
|
-
Object.defineProperty(obj, key, {
|
|
24
|
-
value: value,
|
|
25
|
-
enumerable: true,
|
|
26
|
-
configurable: true,
|
|
27
|
-
writable: true
|
|
28
|
-
});
|
|
29
|
-
} else {
|
|
30
|
-
obj[key] = value;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return obj;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
23
|
function ownKeys(object, enumerableOnly) {
|
|
37
24
|
var keys = Object.keys(object);
|
|
38
25
|
|
|
39
26
|
if (Object.getOwnPropertySymbols) {
|
|
40
27
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
|
|
29
|
+
if (enumerableOnly) {
|
|
30
|
+
symbols = symbols.filter(function (sym) {
|
|
31
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
44
35
|
keys.push.apply(keys, symbols);
|
|
45
36
|
}
|
|
46
37
|
|
|
@@ -67,10 +58,35 @@ function _objectSpread2(target) {
|
|
|
67
58
|
return target;
|
|
68
59
|
}
|
|
69
60
|
|
|
61
|
+
function _defineProperty(obj, key, value) {
|
|
62
|
+
if (key in obj) {
|
|
63
|
+
Object.defineProperty(obj, key, {
|
|
64
|
+
value: value,
|
|
65
|
+
enumerable: true,
|
|
66
|
+
configurable: true,
|
|
67
|
+
writable: true
|
|
68
|
+
});
|
|
69
|
+
} else {
|
|
70
|
+
obj[key] = value;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return obj;
|
|
74
|
+
}
|
|
75
|
+
|
|
70
76
|
function _inheritsLoose(subClass, superClass) {
|
|
71
77
|
subClass.prototype = Object.create(superClass.prototype);
|
|
72
78
|
subClass.prototype.constructor = subClass;
|
|
73
|
-
|
|
79
|
+
|
|
80
|
+
_setPrototypeOf(subClass, superClass);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function _setPrototypeOf(o, p) {
|
|
84
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
85
|
+
o.__proto__ = p;
|
|
86
|
+
return o;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return _setPrototypeOf(o, p);
|
|
74
90
|
}
|
|
75
91
|
|
|
76
92
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -96,13 +112,19 @@ function _assertThisInitialized(self) {
|
|
|
96
112
|
return self;
|
|
97
113
|
}
|
|
98
114
|
|
|
99
|
-
/* eslint-disable @typescript-eslint/
|
|
115
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
116
|
+
/**
|
|
117
|
+
* A wrapper to use React.forwardRef with polymorphic components in a type-safe manner. This is a
|
|
118
|
+
* convenience over merely using React.forwardRef directly, and then manually forcing the resulting
|
|
119
|
+
* value to be typed using `as PolymorphicComponent<…>`.
|
|
120
|
+
*
|
|
121
|
+
* @see PolymorphicComponent for details about what this type does
|
|
122
|
+
*/
|
|
100
123
|
|
|
101
|
-
function
|
|
124
|
+
function polymorphicComponent(render) {
|
|
102
125
|
return /*#__PURE__*/React.forwardRef(render);
|
|
103
126
|
}
|
|
104
127
|
|
|
105
|
-
var prefix = ['', 'tablet-', 'desktop-'];
|
|
106
128
|
/**
|
|
107
129
|
* Builds a css module class name for a given prop + prop-value combination.
|
|
108
130
|
*
|
|
@@ -126,9 +148,15 @@ function getClassNames(styles, property, value) {
|
|
|
126
148
|
return null;
|
|
127
149
|
}
|
|
128
150
|
|
|
129
|
-
var classList =
|
|
130
|
-
|
|
131
|
-
|
|
151
|
+
var classList = [];
|
|
152
|
+
|
|
153
|
+
if (typeof value === 'string') {
|
|
154
|
+
classList.push(styles[property + "-" + value]);
|
|
155
|
+
} else {
|
|
156
|
+
if (value.mobile) classList.push(styles[property + "-" + value.mobile]);
|
|
157
|
+
if (value.tablet) classList.push(styles["tablet-" + property + "-" + value.tablet]);
|
|
158
|
+
if (value.desktop) classList.push(styles["desktop-" + property + "-" + value.desktop]);
|
|
159
|
+
}
|
|
132
160
|
|
|
133
161
|
if ( !classList.every(Boolean)) {
|
|
134
162
|
// eslint-disable-next-line no-console
|
|
@@ -144,8 +172,9 @@ function getClassNames(styles, property, value) {
|
|
|
144
172
|
/**
|
|
145
173
|
* A mapping over a responsive prop value.
|
|
146
174
|
*
|
|
147
|
-
* Since response values can be
|
|
148
|
-
* to
|
|
175
|
+
* Since response values can be an object but also a scalar value, this helper makes it easier to
|
|
176
|
+
* to map the values when it's an object but keeps it consistent for the case when it is a scalar
|
|
177
|
+
* value as well.
|
|
149
178
|
*
|
|
150
179
|
* @param fromValue the responsive prop value
|
|
151
180
|
* @param mapper the mapping function
|
|
@@ -153,28 +182,36 @@ function getClassNames(styles, property, value) {
|
|
|
153
182
|
|
|
154
183
|
|
|
155
184
|
function mapResponsiveProp(fromValue, mapper) {
|
|
156
|
-
if (
|
|
157
|
-
return
|
|
185
|
+
if (!fromValue) {
|
|
186
|
+
return undefined;
|
|
158
187
|
}
|
|
159
188
|
|
|
160
|
-
if (
|
|
161
|
-
return fromValue
|
|
189
|
+
if (typeof fromValue !== 'object') {
|
|
190
|
+
return mapper(fromValue);
|
|
162
191
|
}
|
|
163
192
|
|
|
164
|
-
return
|
|
193
|
+
return {
|
|
194
|
+
mobile: fromValue.mobile ? mapper(fromValue.mobile) : undefined,
|
|
195
|
+
tablet: fromValue.tablet ? mapper(fromValue.tablet) : undefined,
|
|
196
|
+
desktop: fromValue.desktop ? mapper(fromValue.desktop) : undefined
|
|
197
|
+
};
|
|
165
198
|
}
|
|
166
199
|
|
|
167
|
-
var modules_54d944f2 = {"box":"
|
|
200
|
+
var modules_54d944f2 = {"box":"_26c5201d","position-absolute":"_77c3d8d1","position-fixed":"_37cb98fb","position-relative":"df16028f","position-sticky":"_4205abac","tablet-position-absolute":"d6993b5e","tablet-position-fixed":"a015e0f5","tablet-position-relative":"_236dd3b1","tablet-position-sticky":"b7ac4837","desktop-position-absolute":"fd93a726","desktop-position-fixed":"_49228edc","desktop-position-relative":"d972b518","desktop-position-sticky":"b2a2baf3","display-block":"_22f1edd1","display-flex":"c23d2d6f","display-inline":"_5359896d","display-inlineBlock":"a54a41a6","display-inlineFlex":"d02f3d43","display-none":"_760c0710","tablet-display-block":"_64e2ebe6","tablet-display-flex":"_25274f78","tablet-display-inline":"_2077d063","tablet-display-inlineBlock":"aaed581f","tablet-display-inlineFlex":"_1d4a6eb5","tablet-display-none":"_66f24c78","desktop-display-block":"_145cca89","desktop-display-flex":"_1861c899","desktop-display-inline":"_96a720c8","desktop-display-inlineBlock":"_56acf5d5","desktop-display-inlineFlex":"_2a268e4b","desktop-display-none":"b4f30b9e","minWidth-0":"_0b071847","minWidth-xsmall":"_8b67f007","minWidth-small":"e3ec3474","minWidth-medium":"_5cccd4fc","minWidth-large":"_06eeac65","minWidth-xlarge":"ee1b6344","maxWidth-xsmall":"_2df097d0","maxWidth-small":"b771df2a","maxWidth-medium":"_00ad4e35","maxWidth-large":"_4a848dab","maxWidth-xlarge":"bf216b15","maxWidth-full":"a60a7855","flexDirection-column":"_4cf1b6c9","flexDirection-row":"e056fa5a","tablet-flexDirection-column":"b9aa8d99","tablet-flexDirection-row":"_2e8b3442","desktop-flexDirection-column":"_2162c612","desktop-flexDirection-row":"_279bf1e4","flexWrap-wrap":"_346d3a71","flexWrap-nowrap":"_786fd122","flexShrink-0":"_4b864fc2","flexGrow-0":"_795f552f","flexGrow-1":"a68bcd0f","alignItems-flexStart":"_34e24973","alignItems-center":"_648380f4","alignItems-flexEnd":"_18b4e1d6","alignItems-baseline":"_805c1b65","tablet-alignItems-flexStart":"fd4006c2","tablet-alignItems-center":"c3ba10a7","tablet-alignItems-flexEnd":"_984cd304","tablet-alignItems-baseline":"_696cc167","desktop-alignItems-flexStart":"_74133d54","desktop-alignItems-center":"_92ab46df","desktop-alignItems-flexEnd":"_177026d9","desktop-alignItems-baseline":"ebd2f31f","justifyContent-flexStart":"_4969235b","justifyContent-center":"_9594db58","justifyContent-flexEnd":"_6789fdd3","justifyContent-spaceAround":"b9902d94","justifyContent-spaceBetween":"_3c3ae41b","justifyContent-spaceEvenly":"_8dce8767","tablet-justifyContent-flexStart":"_6bd82354","tablet-justifyContent-center":"_3044c29a","tablet-justifyContent-flexEnd":"_13da8745","tablet-justifyContent-spaceAround":"_981fa9c8","tablet-justifyContent-spaceBetween":"d34811a6","tablet-justifyContent-spaceEvenly":"_53e07124","desktop-justifyContent-flexStart":"e709f277","desktop-justifyContent-center":"abc87cc4","desktop-justifyContent-flexEnd":"ce410292","desktop-justifyContent-spaceBetween":"_5ab1bc04","overflow-hidden":"_11a684c0","overflow-auto":"_2c024f85","overflow-visible":"_4d4892bd","overflow-scroll":"_22ffbb40","width-full":"_330d9b0b","height-full":"fb8deb05","bg-default":"_133f5c00","bg-aside":"b2be7ffe","bg-highlight":"a45e67ff","bg-selected":"b90226b5","borderRadius-standard":"_6e988219","borderRadius-full":"_14cf204e","border-primary":"a710cfdd","border-secondary":"_52263feb","border-tertiary":"_546ec3ef","textAlign-start":"_7fa90cb9","textAlign-center":"_54c80396","textAlign-end":"e4b1ea49","textAlign-justify":"_0eecd510","tablet-textAlign-start":"a309e75d","tablet-textAlign-center":"_67fb1a07","tablet-textAlign-end":"_0fa851ec","tablet-textAlign-justify":"_585a0e34","desktop-textAlign-start":"_5f909690","desktop-textAlign-center":"_13e03993","desktop-textAlign-end":"f142a1cb","desktop-textAlign-justify":"_2bba79a9"};
|
|
201
|
+
|
|
202
|
+
var modules_b537a8ee = {"paddingTop-xsmall":"c4803194","paddingTop-small":"_4e9ab24b","paddingTop-medium":"_1d226e27","paddingTop-large":"eb6097f1","paddingTop-xlarge":"d3229ba4","paddingTop-xxlarge":"_47978ba4","tablet-paddingTop-xsmall":"f987719c","tablet-paddingTop-small":"_8dbc4b4d","tablet-paddingTop-medium":"ae44fe07","tablet-paddingTop-large":"ffe9548d","tablet-paddingTop-xlarge":"f2b76a44","tablet-paddingTop-xxlarge":"c6eb8f43","desktop-paddingTop-xsmall":"_8699b560","desktop-paddingTop-small":"_02c374b7","desktop-paddingTop-medium":"_0dd0332f","desktop-paddingTop-large":"da55f1f6","desktop-paddingTop-xlarge":"_8ef2a278","desktop-paddingTop-xxlarge":"_8b493b28","paddingRight-xsmall":"_211eebc7","paddingRight-small":"ad0ccf15","paddingRight-medium":"a03e39af","paddingRight-large":"f0941ead","paddingRight-xlarge":"e47c5a43","paddingRight-xxlarge":"e849a5cf","tablet-paddingRight-xsmall":"_85374228","tablet-paddingRight-small":"_89df37b9","tablet-paddingRight-medium":"_1cc50ebe","tablet-paddingRight-large":"_1060982b","tablet-paddingRight-xlarge":"be58847d","tablet-paddingRight-xxlarge":"_45093484","desktop-paddingRight-xsmall":"f8d99d6a","desktop-paddingRight-small":"efa076d9","desktop-paddingRight-medium":"e59caa64","desktop-paddingRight-large":"da42f46a","desktop-paddingRight-xlarge":"b3ee2580","desktop-paddingRight-xxlarge":"_3ef94658","paddingBottom-xsmall":"b0e6eab4","paddingBottom-small":"_9510d053","paddingBottom-medium":"d7af60c9","paddingBottom-large":"b75f86cd","paddingBottom-xlarge":"fbd4ce29","paddingBottom-xxlarge":"_33e3ad63","tablet-paddingBottom-xsmall":"f0302da7","tablet-paddingBottom-small":"_4f9b8012","tablet-paddingBottom-medium":"_4333e20e","tablet-paddingBottom-large":"_30bbc76c","tablet-paddingBottom-xlarge":"ba5a4008","tablet-paddingBottom-xxlarge":"_423a3b1a","desktop-paddingBottom-xsmall":"b40139b7","desktop-paddingBottom-small":"f96071fa","desktop-paddingBottom-medium":"fe803c9a","desktop-paddingBottom-large":"_01686eb9","desktop-paddingBottom-xlarge":"afa763d8","desktop-paddingBottom-xxlarge":"a95785f1","paddingLeft-xsmall":"cad4e2ec","paddingLeft-small":"d70b3c17","paddingLeft-medium":"_8c851bd6","paddingLeft-large":"_078feb3c","paddingLeft-xlarge":"_76ab968c","paddingLeft-xxlarge":"aaca85d7","tablet-paddingLeft-xsmall":"_5eb0e5aa","tablet-paddingLeft-small":"_0384fb4f","tablet-paddingLeft-medium":"edffff6f","tablet-paddingLeft-large":"_873b9a46","tablet-paddingLeft-xlarge":"_89105db5","tablet-paddingLeft-xxlarge":"db1966fe","desktop-paddingLeft-xsmall":"b17f826b","desktop-paddingLeft-small":"_6dc83610","desktop-paddingLeft-medium":"_3421b8b2","desktop-paddingLeft-large":"_68cec7a6","desktop-paddingLeft-xlarge":"_94bde020","desktop-paddingLeft-xxlarge":"b94ee579"};
|
|
168
203
|
|
|
169
|
-
var
|
|
170
|
-
var _ref2, _ref3, _ref4, _ref5;
|
|
204
|
+
var modules_131405ac = {"marginTop-xsmall":"c7813d79","marginTop-small":"d3449da6","marginTop-medium":"_4ea254c1","marginTop-large":"c0844f64","marginTop-xlarge":"_213145b4","marginTop-xxlarge":"df61c84c","marginTop--xsmall":"efe72b13","marginTop--small":"_870c2768","marginTop--medium":"_0b927c57","marginTop--large":"_461db014","marginTop--xlarge":"_2a3a8cb8","marginTop--xxlarge":"_9bcda921","tablet-marginTop-xsmall":"_6add01e4","tablet-marginTop-small":"_735ef86b","tablet-marginTop-medium":"_0477d068","tablet-marginTop-large":"_2c90af97","tablet-marginTop-xlarge":"_63a82db6","tablet-marginTop-xxlarge":"_03cd7726","tablet-marginTop--xsmall":"c986a62a","tablet-marginTop--small":"be2bdcdd","tablet-marginTop--medium":"_47d2686b","tablet-marginTop--large":"_25e5af9d","tablet-marginTop--xlarge":"ee82f441","tablet-marginTop--xxlarge":"a6f9d404","desktop-marginTop-xsmall":"_4d8d9a36","desktop-marginTop-small":"e813cee7","desktop-marginTop-medium":"_56975b7d","desktop-marginTop-large":"_53b367f6","desktop-marginTop-xlarge":"d69e7311","desktop-marginTop-xxlarge":"_92f57c7e","desktop-marginTop--xsmall":"_96880d3e","desktop-marginTop--small":"dc3f3555","desktop-marginTop--medium":"_86dd06bb","desktop-marginTop--large":"c93ef12e","desktop-marginTop--xlarge":"bc8fd4a2","desktop-marginTop--xxlarge":"b12a9124","marginRight-xsmall":"_6016f4fb","marginRight-small":"b85e3dfa","marginRight-medium":"_297575f4","marginRight-large":"b401ac6c","marginRight-xlarge":"dc3ec387","marginRight-xxlarge":"_24694604","marginRight--xsmall":"_8e9bf2ee","marginRight--small":"ae9d1115","marginRight--medium":"_14e46fc3","marginRight--large":"_3370631b","marginRight--xlarge":"_3f0e9b50","marginRight--xxlarge":"bc13e010","tablet-marginRight-xsmall":"_6fa1aae3","tablet-marginRight-small":"_2976c5cb","tablet-marginRight-medium":"_38d94802","tablet-marginRight-large":"db9569b5","tablet-marginRight-xlarge":"_4a52f06d","tablet-marginRight-xxlarge":"_8a0f0410","tablet-marginRight--xsmall":"e7d40e9d","tablet-marginRight--small":"_680fde91","tablet-marginRight--medium":"_021010ca","tablet-marginRight--large":"_9e52c87c","tablet-marginRight--xlarge":"_4d602613","tablet-marginRight--xxlarge":"_21b1b65a","desktop-marginRight-xsmall":"_7321bc07","desktop-marginRight-small":"fa1721f4","desktop-marginRight-medium":"_3fd7b4b8","desktop-marginRight-large":"_4fdc2f74","desktop-marginRight-xlarge":"c0254761","desktop-marginRight-xxlarge":"_710a5f09","desktop-marginRight--xsmall":"e08bee7f","desktop-marginRight--small":"e5ab73d2","desktop-marginRight--medium":"_5e731477","desktop-marginRight--large":"_0f57a22e","desktop-marginRight--xlarge":"_25f26ed3","desktop-marginRight--xxlarge":"_11a3b4e0","marginBottom-xsmall":"_6a4f69f7","marginBottom-small":"db26b033","marginBottom-medium":"c7313022","marginBottom-large":"a5885889","marginBottom-xlarge":"_33dfbd8e","marginBottom-xxlarge":"_795ad2de","marginBottom--xsmall":"a329dbd3","marginBottom--small":"_85e739fb","marginBottom--medium":"_681f65ff","marginBottom--large":"caf50d8f","marginBottom--xlarge":"_1e084cbf","marginBottom--xxlarge":"_3dfb1c7e","tablet-marginBottom-xsmall":"ef4735be","tablet-marginBottom-small":"de55afba","tablet-marginBottom-medium":"_0e33ce88","tablet-marginBottom-large":"_8ca391fc","tablet-marginBottom-xlarge":"_3a609d23","tablet-marginBottom-xxlarge":"_3e1177e4","tablet-marginBottom--xsmall":"d384884d","tablet-marginBottom--small":"_75254cec","tablet-marginBottom--medium":"_5d9f127d","tablet-marginBottom--large":"_835f1089","tablet-marginBottom--xlarge":"dad52a72","tablet-marginBottom--xxlarge":"_8703a4bf","desktop-marginBottom-xsmall":"_90fd20e9","desktop-marginBottom-small":"f3769191","desktop-marginBottom-medium":"_156410f8","desktop-marginBottom-large":"_7fed74d0","desktop-marginBottom-xlarge":"_477dc10e","desktop-marginBottom-xxlarge":"_85c82d89","desktop-marginBottom--xsmall":"_4f09c1e0","desktop-marginBottom--small":"_9523e048","desktop-marginBottom--medium":"efe10240","desktop-marginBottom--large":"c43971e6","desktop-marginBottom--xlarge":"f9b4da15","desktop-marginBottom--xxlarge":"a10fdf70","marginLeft-xsmall":"f9be90b4","marginLeft-small":"f53218d5","marginLeft-medium":"c4a9b3ab","marginLeft-large":"_5755e2c3","marginLeft-xlarge":"_33fc9354","marginLeft-xxlarge":"_4749a3bf","marginLeft--xsmall":"c76cb3c7","marginLeft--small":"_96003c07","marginLeft--medium":"_09988d07","marginLeft--large":"b4a486f6","marginLeft--xlarge":"f396e75e","marginLeft--xxlarge":"_81d1f26d","tablet-marginLeft-xsmall":"_0a46e8f1","tablet-marginLeft-small":"_57c970af","tablet-marginLeft-medium":"_4b6099d3","tablet-marginLeft-large":"_378fcff5","tablet-marginLeft-xlarge":"f8785663","tablet-marginLeft-xxlarge":"_72f957ee","tablet-marginLeft--xsmall":"_2288c7e1","tablet-marginLeft--small":"b27c1c05","tablet-marginLeft--medium":"_702cbb13","tablet-marginLeft--large":"_1a2748b4","tablet-marginLeft--xlarge":"b8c043a5","tablet-marginLeft--xxlarge":"_8dc8ff63","desktop-marginLeft-xsmall":"c2af646d","desktop-marginLeft-small":"c03d07be","desktop-marginLeft-medium":"_915fb1d3","desktop-marginLeft-large":"_64214ee1","desktop-marginLeft-xlarge":"_7be4a22c","desktop-marginLeft-xxlarge":"_5ec0a401","desktop-marginLeft--xsmall":"ea29f1ee","desktop-marginLeft--small":"c26652c7","desktop-marginLeft--medium":"c24f6af9","desktop-marginLeft--large":"c2671f27","desktop-marginLeft--xlarge":"cc51a04e","desktop-marginLeft--xxlarge":"fd581f54"};
|
|
171
205
|
|
|
172
|
-
|
|
173
|
-
|
|
206
|
+
var _excluded = ["as", "position", "display", "flexDirection", "flexWrap", "flexGrow", "flexShrink", "alignItems", "justifyContent", "overflow", "width", "height", "background", "border", "borderRadius", "minWidth", "maxWidth", "textAlign", "padding", "paddingY", "paddingX", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "margin", "marginY", "marginX", "marginTop", "marginRight", "marginBottom", "marginLeft", "className", "children"];
|
|
207
|
+
var Box = /*#__PURE__*/polymorphicComponent(function Box(_ref, ref) {
|
|
208
|
+
var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9;
|
|
209
|
+
|
|
210
|
+
var _ref$as = _ref.as,
|
|
211
|
+
component = _ref$as === void 0 ? 'div' : _ref$as,
|
|
174
212
|
_ref$position = _ref.position,
|
|
175
213
|
position = _ref$position === void 0 ? 'static' : _ref$position,
|
|
176
|
-
|
|
177
|
-
display = _ref$display === void 0 ? 'block' : _ref$display,
|
|
214
|
+
display = _ref.display,
|
|
178
215
|
_ref$flexDirection = _ref.flexDirection,
|
|
179
216
|
flexDirection = _ref$flexDirection === void 0 ? 'row' : _ref$flexDirection,
|
|
180
217
|
flexWrap = _ref.flexWrap,
|
|
@@ -190,6 +227,8 @@ var Box = /*#__PURE__*/forwardRefWithAs(function Box(_ref, ref) {
|
|
|
190
227
|
borderRadius = _ref.borderRadius,
|
|
191
228
|
minWidth = _ref.minWidth,
|
|
192
229
|
maxWidth = _ref.maxWidth,
|
|
230
|
+
_ref$textAlign = _ref.textAlign,
|
|
231
|
+
textAlign = _ref$textAlign === void 0 ? 'start' : _ref$textAlign,
|
|
193
232
|
padding = _ref.padding,
|
|
194
233
|
paddingY = _ref.paddingY,
|
|
195
234
|
paddingX = _ref.paddingX,
|
|
@@ -197,89 +236,122 @@ var Box = /*#__PURE__*/forwardRefWithAs(function Box(_ref, ref) {
|
|
|
197
236
|
paddingRight = _ref.paddingRight,
|
|
198
237
|
paddingBottom = _ref.paddingBottom,
|
|
199
238
|
paddingLeft = _ref.paddingLeft,
|
|
239
|
+
margin = _ref.margin,
|
|
240
|
+
marginY = _ref.marginY,
|
|
241
|
+
marginX = _ref.marginX,
|
|
242
|
+
marginTop = _ref.marginTop,
|
|
243
|
+
marginRight = _ref.marginRight,
|
|
244
|
+
marginBottom = _ref.marginBottom,
|
|
245
|
+
marginLeft = _ref.marginLeft,
|
|
200
246
|
className = _ref.className,
|
|
201
247
|
children = _ref.children,
|
|
202
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
248
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
203
249
|
|
|
204
250
|
var resolvedPaddingTop = (_ref2 = paddingTop !== null && paddingTop !== void 0 ? paddingTop : paddingY) !== null && _ref2 !== void 0 ? _ref2 : padding;
|
|
205
251
|
var resolvedPaddingRight = (_ref3 = paddingRight !== null && paddingRight !== void 0 ? paddingRight : paddingX) !== null && _ref3 !== void 0 ? _ref3 : padding;
|
|
206
252
|
var resolvedPaddingBottom = (_ref4 = paddingBottom !== null && paddingBottom !== void 0 ? paddingBottom : paddingY) !== null && _ref4 !== void 0 ? _ref4 : padding;
|
|
207
253
|
var resolvedPaddingLeft = (_ref5 = paddingLeft !== null && paddingLeft !== void 0 ? paddingLeft : paddingX) !== null && _ref5 !== void 0 ? _ref5 : padding;
|
|
208
|
-
var
|
|
254
|
+
var resolvedMarginTop = (_ref6 = marginTop !== null && marginTop !== void 0 ? marginTop : marginY) !== null && _ref6 !== void 0 ? _ref6 : margin;
|
|
255
|
+
var resolvedMarginRight = (_ref7 = marginRight !== null && marginRight !== void 0 ? marginRight : marginX) !== null && _ref7 !== void 0 ? _ref7 : margin;
|
|
256
|
+
var resolvedMarginBottom = (_ref8 = marginBottom !== null && marginBottom !== void 0 ? marginBottom : marginY) !== null && _ref8 !== void 0 ? _ref8 : margin;
|
|
257
|
+
var resolvedMarginLeft = (_ref9 = marginLeft !== null && marginLeft !== void 0 ? marginLeft : marginX) !== null && _ref9 !== void 0 ? _ref9 : margin;
|
|
258
|
+
var omitFlex = !display || typeof display === 'string' && display !== 'flex' && display !== 'inlineFlex';
|
|
209
259
|
return /*#__PURE__*/React.createElement(component, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
210
|
-
className: classNames(className, modules_54d944f2.box, getClassNames(modules_54d944f2, 'display', display), position !== 'static' ? getClassNames(modules_54d944f2, 'position', position) : null, minWidth != null ? getClassNames(modules_54d944f2, 'minWidth', String(minWidth)) : null, getClassNames(modules_54d944f2, 'maxWidth', maxWidth),
|
|
260
|
+
className: classNames(className, modules_54d944f2.box, display ? getClassNames(modules_54d944f2, 'display', display) : null, position !== 'static' ? getClassNames(modules_54d944f2, 'position', position) : null, minWidth != null ? getClassNames(modules_54d944f2, 'minWidth', String(minWidth)) : null, getClassNames(modules_54d944f2, 'maxWidth', maxWidth), textAlign !== 'start' ? getClassNames(modules_54d944f2, 'textAlign', textAlign) : null, // padding
|
|
261
|
+
getClassNames(modules_b537a8ee, 'paddingTop', resolvedPaddingTop), getClassNames(modules_b537a8ee, 'paddingRight', resolvedPaddingRight), getClassNames(modules_b537a8ee, 'paddingBottom', resolvedPaddingBottom), getClassNames(modules_b537a8ee, 'paddingLeft', resolvedPaddingLeft), // margin
|
|
262
|
+
getClassNames(modules_131405ac, 'marginTop', resolvedMarginTop), getClassNames(modules_131405ac, 'marginRight', resolvedMarginRight), getClassNames(modules_131405ac, 'marginBottom', resolvedMarginBottom), getClassNames(modules_131405ac, 'marginLeft', resolvedMarginLeft), // flex props
|
|
263
|
+
omitFlex ? null : getClassNames(modules_54d944f2, 'flexDirection', flexDirection), omitFlex ? null : getClassNames(modules_54d944f2, 'flexWrap', flexWrap), omitFlex ? null : getClassNames(modules_54d944f2, 'alignItems', alignItems), omitFlex ? null : getClassNames(modules_54d944f2, 'justifyContent', justifyContent), flexShrink != null ? getClassNames(modules_54d944f2, 'flexShrink', String(flexShrink)) : null, flexGrow != null ? getClassNames(modules_54d944f2, 'flexGrow', String(flexGrow)) : null, // other props
|
|
264
|
+
getClassNames(modules_54d944f2, 'overflow', overflow), getClassNames(modules_54d944f2, 'width', width), getClassNames(modules_54d944f2, 'height', height), getClassNames(modules_54d944f2, 'bg', background), borderRadius !== 'none' ? getClassNames(modules_54d944f2, 'borderRadius', borderRadius) : null, border !== 'none' ? getClassNames(modules_54d944f2, 'border', border) : null) || undefined,
|
|
211
265
|
ref: ref
|
|
212
266
|
}), children);
|
|
213
267
|
});
|
|
214
268
|
|
|
215
|
-
var modules_67f2d07a = {"space-xsmall":"
|
|
269
|
+
var modules_67f2d07a = {"space-xsmall":"_6f59c771","column":"_91e05f0f","space-small":"_5a55af26","space-medium":"fa261310","space-large":"_6ebd4e46","space-xlarge":"_55ce4aea","space-xxlarge":"_04c9c3ac","tablet-space-xsmall":"ab76d8cd","tablet-space-small":"_14629bfb","tablet-space-medium":"_5b4e39ea","tablet-space-large":"ba270182","tablet-space-xlarge":"b96e7ec7","tablet-space-xxlarge":"d276612c","desktop-space-xsmall":"d7a73106","desktop-space-small":"_8f5e0e9e","desktop-space-medium":"_3a168411","desktop-space-large":"_0abcc12e","desktop-space-xlarge":"e0bafc60","desktop-space-xxlarge":"d2df9afd","columnWidth-auto":"b18d0b47","columnWidth-1-2":"_102a6b27","columnWidth-1-3":"_829872fe","columnWidth-2-3":"cf5aef9a","columnWidth-1-4":"_931bf714","columnWidth-3-4":"b0303130","columnWidth-1-5":"f6589a6f","columnWidth-2-5":"_2823aed9","columnWidth-3-5":"d00ba3bb","columnWidth-4-5":"_338f2d7c","tablet-tablet-space-xsmall":"_06582234"};
|
|
216
270
|
|
|
217
|
-
var
|
|
271
|
+
var _excluded$1 = ["width", "children", "exceptionallySetClassName"],
|
|
272
|
+
_excluded2 = ["space", "align", "alignY", "collapseBelow", "children", "exceptionallySetClassName"];
|
|
273
|
+
var Column = /*#__PURE__*/polymorphicComponent(function Column(_ref, ref) {
|
|
218
274
|
var _ref$width = _ref.width,
|
|
219
275
|
width = _ref$width === void 0 ? 'auto' : _ref$width,
|
|
220
276
|
children = _ref.children,
|
|
221
|
-
|
|
277
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
278
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
222
279
|
|
|
223
|
-
return /*#__PURE__*/React.createElement(Box, Object.assign({
|
|
224
|
-
className: [modules_67f2d07a.column, width !== 'content' ? getClassNames(modules_67f2d07a, 'columnWidth', width.replace('/', '-')) : null],
|
|
280
|
+
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
281
|
+
className: [exceptionallySetClassName, modules_67f2d07a.column, width !== 'content' ? getClassNames(modules_67f2d07a, 'columnWidth', width.replace('/', '-')) : null],
|
|
225
282
|
minWidth: 0,
|
|
226
283
|
width: width !== 'content' ? 'full' : undefined,
|
|
284
|
+
height: "full",
|
|
227
285
|
flexShrink: width === 'content' ? 0 : undefined,
|
|
228
286
|
ref: ref
|
|
229
|
-
}
|
|
287
|
+
}), children);
|
|
230
288
|
});
|
|
231
|
-
var Columns = /*#__PURE__*/
|
|
289
|
+
var Columns = /*#__PURE__*/polymorphicComponent(function Columns(_ref2, ref) {
|
|
232
290
|
var space = _ref2.space,
|
|
233
|
-
align = _ref2.align,
|
|
234
|
-
|
|
291
|
+
_ref2$align = _ref2.align,
|
|
292
|
+
align = _ref2$align === void 0 ? 'left' : _ref2$align,
|
|
293
|
+
_ref2$alignY = _ref2.alignY,
|
|
294
|
+
alignY = _ref2$alignY === void 0 ? 'top' : _ref2$alignY,
|
|
235
295
|
collapseBelow = _ref2.collapseBelow,
|
|
236
296
|
children = _ref2.children,
|
|
237
|
-
|
|
297
|
+
exceptionallySetClassName = _ref2.exceptionallySetClassName,
|
|
298
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
238
299
|
|
|
239
300
|
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
240
|
-
className: getClassNames(modules_67f2d07a, 'space', space),
|
|
241
|
-
flexDirection: collapseBelow === 'desktop' ? ['column', 'column', 'row'] : collapseBelow === 'tablet' ? ['column', 'row'] : 'row',
|
|
301
|
+
className: [exceptionallySetClassName, getClassNames(modules_67f2d07a, 'space', space)],
|
|
242
302
|
display: "flex",
|
|
303
|
+
flexDirection: collapseBelow === 'desktop' ? {
|
|
304
|
+
mobile: 'column',
|
|
305
|
+
tablet: 'column',
|
|
306
|
+
desktop: 'row'
|
|
307
|
+
} : collapseBelow === 'tablet' ? {
|
|
308
|
+
mobile: 'column',
|
|
309
|
+
tablet: 'row'
|
|
310
|
+
} : 'row',
|
|
243
311
|
alignItems: mapResponsiveProp(alignY, function (alignY) {
|
|
244
|
-
return alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' :
|
|
312
|
+
return alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : alignY;
|
|
245
313
|
}),
|
|
246
314
|
justifyContent: mapResponsiveProp(align, function (align) {
|
|
247
|
-
return align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' :
|
|
315
|
+
return align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : align;
|
|
248
316
|
}),
|
|
249
317
|
ref: ref
|
|
250
318
|
}), children);
|
|
251
319
|
});
|
|
252
320
|
|
|
253
|
-
var modules_c742c4d7 = {"
|
|
321
|
+
var modules_c742c4d7 = {"weight-primary":"_3f3a401c","weight-secondary":"_03b05b70","weight-tertiary":"b6f67ff8"};
|
|
322
|
+
|
|
323
|
+
var _excluded$2 = ["weight"];
|
|
254
324
|
|
|
255
325
|
function Divider(_ref) {
|
|
256
326
|
var _ref$weight = _ref.weight,
|
|
257
|
-
weight = _ref$weight === void 0 ? '
|
|
258
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
327
|
+
weight = _ref$weight === void 0 ? 'tertiary' : _ref$weight,
|
|
328
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
259
329
|
|
|
260
330
|
return /*#__PURE__*/React.createElement(Box, Object.assign({
|
|
261
|
-
|
|
262
|
-
className:
|
|
331
|
+
as: "hr",
|
|
332
|
+
className: getClassNames(modules_c742c4d7, 'weight', weight)
|
|
263
333
|
}, props));
|
|
264
334
|
}
|
|
265
335
|
|
|
266
336
|
var modules_da5d5c21 = {"space-xsmall":"_6b1279e0","space-small":"_0d82c42d","space-medium":"_556714e1","space-large":"e90b43fb","space-xlarge":"a9c34345","space-xxlarge":"aa102efe","tablet-space-xsmall":"_34d16157","tablet-space-small":"c7e0e54f","tablet-space-medium":"_7f2a4e4b","tablet-space-large":"ae256487","tablet-space-xlarge":"e88be0f7","tablet-space-xxlarge":"dc7bcb18","desktop-space-xsmall":"_853f3012","desktop-space-small":"_3bfaf758","desktop-space-medium":"_36462a93","desktop-space-large":"e73081b7","desktop-space-xlarge":"e22ec9dd","desktop-space-xxlarge":"_4a20bd12"};
|
|
267
337
|
|
|
268
|
-
var
|
|
269
|
-
|
|
338
|
+
var _excluded$3 = ["as", "space", "align", "alignY", "children", "exceptionallySetClassName"];
|
|
339
|
+
var Inline = /*#__PURE__*/polymorphicComponent(function Inline(_ref, ref) {
|
|
340
|
+
var as = _ref.as,
|
|
270
341
|
space = _ref.space,
|
|
271
342
|
_ref$align = _ref.align,
|
|
272
343
|
align = _ref$align === void 0 ? 'left' : _ref$align,
|
|
273
344
|
_ref$alignY = _ref.alignY,
|
|
274
345
|
alignY = _ref$alignY === void 0 ? 'center' : _ref$alignY,
|
|
275
346
|
children = _ref.children,
|
|
276
|
-
|
|
347
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
348
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
277
349
|
|
|
278
|
-
return /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Box, Object.assign({
|
|
279
|
-
|
|
350
|
+
return /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
351
|
+
as: as,
|
|
280
352
|
display: "flex",
|
|
281
353
|
flexWrap: "wrap",
|
|
282
|
-
className: getClassNames(modules_da5d5c21, 'space', space),
|
|
354
|
+
className: [exceptionallySetClassName, getClassNames(modules_da5d5c21, 'space', space)],
|
|
283
355
|
ref: ref,
|
|
284
356
|
alignItems: mapResponsiveProp(alignY, function (alignY) {
|
|
285
357
|
return alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : 'center';
|
|
@@ -287,31 +359,109 @@ var Inline = /*#__PURE__*/forwardRefWithAs(function Inline(_ref, ref) {
|
|
|
287
359
|
justifyContent: mapResponsiveProp(align, function (align) {
|
|
288
360
|
return align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : 'center';
|
|
289
361
|
})
|
|
290
|
-
}
|
|
362
|
+
}), children));
|
|
291
363
|
});
|
|
292
364
|
|
|
293
365
|
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"};
|
|
294
366
|
|
|
295
|
-
var
|
|
296
|
-
|
|
367
|
+
var _excluded$4 = ["as", "space", "align", "dividers", "children", "exceptionallySetClassName"];
|
|
368
|
+
var Stack = /*#__PURE__*/polymorphicComponent(function Stack(_ref, ref) {
|
|
369
|
+
var as = _ref.as,
|
|
297
370
|
space = _ref.space,
|
|
371
|
+
_ref$align = _ref.align,
|
|
372
|
+
align = _ref$align === void 0 ? 'start' : _ref$align,
|
|
298
373
|
_ref$dividers = _ref.dividers,
|
|
299
|
-
dividers = _ref$dividers === void 0 ?
|
|
374
|
+
dividers = _ref$dividers === void 0 ? 'none' : _ref$dividers,
|
|
300
375
|
children = _ref.children,
|
|
301
|
-
|
|
302
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
376
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
377
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
378
|
+
|
|
379
|
+
var alignProps = align === 'start' ? undefined : {
|
|
380
|
+
width: 'full',
|
|
381
|
+
flexDirection: 'column',
|
|
382
|
+
display: 'flex',
|
|
383
|
+
alignItems: mapResponsiveProp(align, function (align) {
|
|
384
|
+
return align === 'start' ? 'flexStart' : align === 'end' ? 'flexEnd' : 'center';
|
|
385
|
+
})
|
|
386
|
+
};
|
|
387
|
+
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, alignProps, {
|
|
388
|
+
as: as,
|
|
389
|
+
className: [exceptionallySetClassName, getClassNames(modules_3af3b7ac, 'space', space)],
|
|
307
390
|
ref: ref
|
|
308
|
-
}
|
|
391
|
+
}), dividers !== 'none' ? React.Children.map(flattenChildren(children), function (child, index) {
|
|
309
392
|
return index > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
|
|
310
|
-
weight:
|
|
393
|
+
weight: dividers
|
|
311
394
|
}), child) : child;
|
|
312
395
|
}) : children);
|
|
313
396
|
});
|
|
314
397
|
|
|
398
|
+
var modules_4689e97e = {"hiddenOnPrint":"_0e595dea"};
|
|
399
|
+
|
|
400
|
+
var _excluded$5 = ["display", "children", "exceptionallySetClassName"];
|
|
401
|
+
/**
|
|
402
|
+
* A component that allows to specify how to hide itself on certain responsive screen sizes, or on
|
|
403
|
+
* print media.
|
|
404
|
+
*
|
|
405
|
+
* @see HiddenProps
|
|
406
|
+
* @see HiddenVisually for hiding content only visually, while keeping it available for assistive
|
|
407
|
+
* technologies.
|
|
408
|
+
*/
|
|
409
|
+
|
|
410
|
+
var Hidden = /*#__PURE__*/polymorphicComponent(function Hidden(_ref, ref) {
|
|
411
|
+
var _ref$display = _ref.display,
|
|
412
|
+
display = _ref$display === void 0 ? 'block' : _ref$display,
|
|
413
|
+
children = _ref.children,
|
|
414
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
415
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
416
|
+
|
|
417
|
+
var hiddenOnPrint = 'print' in props && props.print;
|
|
418
|
+
var hiddenOnDesktop = ('above' in props);
|
|
419
|
+
var hiddenOnMobile = ('below' in props);
|
|
420
|
+
var hiddenOnTablet = 'below' in props && props.below === 'desktop' || 'above' in props && props.above === 'mobile';
|
|
421
|
+
|
|
422
|
+
if (hiddenOnDesktop && hiddenOnMobile) {
|
|
423
|
+
// eslint-disable-next-line no-console
|
|
424
|
+
console.warn('<Hidden /> should receive either above="…" or below="…" but not both');
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
if (!hiddenOnDesktop && !hiddenOnMobile && !hiddenOnPrint) {
|
|
428
|
+
// eslint-disable-next-line no-console
|
|
429
|
+
console.warn('<Hidden /> did not receive any criteria to hide itself');
|
|
430
|
+
} // We need to delete these so they do not get forwarded to the Box
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
if ('above' in props) delete props['above'];
|
|
434
|
+
if ('below' in props) delete props['below'];
|
|
435
|
+
if ('print' in props) delete props['print'];
|
|
436
|
+
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
437
|
+
ref: ref,
|
|
438
|
+
className: [exceptionallySetClassName, hiddenOnPrint ? modules_4689e97e.hiddenOnPrint : null],
|
|
439
|
+
display: hiddenOnDesktop && hiddenOnMobile ? 'none' : {
|
|
440
|
+
mobile: hiddenOnMobile ? 'none' : display,
|
|
441
|
+
tablet: hiddenOnTablet ? 'none' : display,
|
|
442
|
+
desktop: hiddenOnDesktop ? 'none' : display
|
|
443
|
+
}
|
|
444
|
+
}), children);
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
var modules_61c16c43 = {"hiddenVisually":"_618235b7"};
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Provides content to assistive technologies while hiding it from the screen.
|
|
451
|
+
*
|
|
452
|
+
* @see Hidden for fully hiding content, and only under certain conditions.
|
|
453
|
+
*/
|
|
454
|
+
|
|
455
|
+
var HiddenVisually = /*#__PURE__*/polymorphicComponent(function HiddenVisually(props, ref) {
|
|
456
|
+
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
457
|
+
ref: ref,
|
|
458
|
+
position: "absolute",
|
|
459
|
+
overflow: "hidden",
|
|
460
|
+
className: modules_61c16c43.hiddenVisually
|
|
461
|
+
}));
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
var _excluded$6 = ["tone"];
|
|
315
465
|
var alertIconForTone = {
|
|
316
466
|
info: AlertInfoIcon,
|
|
317
467
|
positive: AlertPositiveIcon,
|
|
@@ -321,7 +471,7 @@ var alertIconForTone = {
|
|
|
321
471
|
|
|
322
472
|
function AlertIcon(_ref) {
|
|
323
473
|
var tone = _ref.tone,
|
|
324
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
474
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
325
475
|
|
|
326
476
|
var Icon = alertIconForTone[tone];
|
|
327
477
|
return Icon ? /*#__PURE__*/React.createElement(Icon, Object.assign({}, props)) : null;
|
|
@@ -424,38 +574,54 @@ function Alert(_ref) {
|
|
|
424
574
|
}, /*#__PURE__*/React.createElement(CloseIcon, null))) : null));
|
|
425
575
|
}
|
|
426
576
|
|
|
427
|
-
var
|
|
577
|
+
var modules_c7f5018f = {"svg":"_51539197","spinner":"_54fbe2b3","tint":"a0c466ed","fill":"_745b73d3"};
|
|
578
|
+
|
|
579
|
+
function Spinner(_ref) {
|
|
580
|
+
var _ref$size = _ref.size,
|
|
581
|
+
size = _ref$size === void 0 ? 24 : _ref$size;
|
|
582
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
583
|
+
"aria-hidden": true,
|
|
584
|
+
width: size,
|
|
585
|
+
height: size,
|
|
586
|
+
viewBox: "0 0 24 24",
|
|
587
|
+
className: modules_c7f5018f.svg
|
|
588
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
589
|
+
fill: "none",
|
|
590
|
+
fillRule: "nonzero"
|
|
591
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
592
|
+
className: modules_c7f5018f.tint,
|
|
593
|
+
d: "M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z"
|
|
594
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
595
|
+
className: modules_c7f5018f.fill,
|
|
596
|
+
d: "M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z"
|
|
597
|
+
})));
|
|
598
|
+
}
|
|
428
599
|
|
|
600
|
+
var _excluded$7 = ["size", "exceptionallySetClassName"];
|
|
429
601
|
var sizeMapping = {
|
|
430
602
|
small: 24,
|
|
431
603
|
medium: 36,
|
|
432
604
|
large: 48
|
|
433
605
|
};
|
|
434
606
|
|
|
435
|
-
function
|
|
607
|
+
function Loading(_ref) {
|
|
608
|
+
var _sizeMapping$size;
|
|
609
|
+
|
|
436
610
|
var _ref$size = _ref.size,
|
|
437
611
|
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
fillRule: "nonzero"
|
|
452
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
453
|
-
className: modules_aa6c8f31.spinner,
|
|
454
|
-
d: "M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z"
|
|
455
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
456
|
-
className: modules_aa6c8f31.spinnerBackground,
|
|
457
|
-
d: "M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z"
|
|
458
|
-
})))));
|
|
612
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
613
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
614
|
+
|
|
615
|
+
var numericSize = (_sizeMapping$size = sizeMapping[size]) !== null && _sizeMapping$size !== void 0 ? _sizeMapping$size : sizeMapping.small;
|
|
616
|
+
return /*#__PURE__*/React__default.createElement(Box, Object.assign({}, props, {
|
|
617
|
+
className: exceptionallySetClassName,
|
|
618
|
+
display: "flex",
|
|
619
|
+
alignItems: "center",
|
|
620
|
+
justifyContent: "center",
|
|
621
|
+
role: "progressbar"
|
|
622
|
+
}), /*#__PURE__*/React__default.createElement(Spinner, {
|
|
623
|
+
size: numericSize
|
|
624
|
+
}));
|
|
459
625
|
}
|
|
460
626
|
|
|
461
627
|
var modules_1b547e7e = {"container":"_464500ae","tone-info":"_1abfe147","tone-positive":"_36ce9859","tone-caution":"f92214b7","tone-critical":"be6cf28e"};
|
|
@@ -479,8 +645,9 @@ function Notice(_ref) {
|
|
|
479
645
|
})), /*#__PURE__*/React.createElement(Column, null, children)));
|
|
480
646
|
}
|
|
481
647
|
|
|
482
|
-
var modules_949d2ff4 = {"heading":"
|
|
648
|
+
var modules_949d2ff4 = {"heading":"_2f45487c","weight-light":"a20cbde9","tone-secondary":"_75f44518","tone-danger":"_3952cc59","size-largest":"b71d22ef","size-larger":"f15346e2","size-smaller":"_3cae1428","lineClampMultipleLines":"_347f6fcd","lineClamp-1":"_895c0b16","lineClamp-2":"_2e4808bd","lineClamp-3":"_1bdb7bdc","lineClamp-4":"_159943ea","lineClamp-5":"e44e008d"};
|
|
483
649
|
|
|
650
|
+
var _excluded$8 = ["level", "weight", "size", "tone", "children", "lineClamp", "align", "exceptionallySetClassName"];
|
|
484
651
|
var Heading = /*#__PURE__*/React.forwardRef(function Heading(_ref, ref) {
|
|
485
652
|
var level = _ref.level,
|
|
486
653
|
_ref$weight = _ref.weight,
|
|
@@ -490,181 +657,55 @@ var Heading = /*#__PURE__*/React.forwardRef(function Heading(_ref, ref) {
|
|
|
490
657
|
tone = _ref$tone === void 0 ? 'normal' : _ref$tone,
|
|
491
658
|
children = _ref.children,
|
|
492
659
|
lineClamp = _ref.lineClamp,
|
|
493
|
-
|
|
660
|
+
align = _ref.align,
|
|
661
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
662
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
494
663
|
|
|
495
664
|
// In TypeScript v4.1, this would be properly recognized without needing the type assertion
|
|
496
665
|
// https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types
|
|
497
666
|
var headingElementName = "h" + level;
|
|
498
667
|
var lineClampMultipleLines = typeof lineClamp === 'string' ? parseInt(lineClamp, 10) > 1 : (lineClamp || 0) > 1;
|
|
499
668
|
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
500
|
-
className: [modules_949d2ff4.heading, weight !== 'regular' ? getClassNames(modules_949d2ff4, 'weight', weight) : null, tone !== 'normal' ? getClassNames(modules_949d2ff4, 'tone', tone) : null, getClassNames(modules_949d2ff4, 'size', size), lineClampMultipleLines ? modules_949d2ff4.
|
|
501
|
-
|
|
669
|
+
className: [exceptionallySetClassName, modules_949d2ff4.heading, weight !== 'regular' ? getClassNames(modules_949d2ff4, 'weight', weight) : null, tone !== 'normal' ? getClassNames(modules_949d2ff4, 'tone', tone) : null, getClassNames(modules_949d2ff4, 'size', size), lineClampMultipleLines ? modules_949d2ff4.lineClampMultipleLines : null, lineClamp ? getClassNames(modules_949d2ff4, 'lineClamp', lineClamp.toString()) : null],
|
|
670
|
+
textAlign: align,
|
|
671
|
+
// Prevents emojis from being cut-off
|
|
672
|
+
// See https://github.com/Doist/reactist/pull/528
|
|
673
|
+
paddingRight: lineClamp ? 'xsmall' : undefined,
|
|
674
|
+
as: headingElementName,
|
|
502
675
|
ref: ref
|
|
503
676
|
}), children);
|
|
504
677
|
});
|
|
505
678
|
|
|
506
|
-
var modules_a9637dd3 = {"text":"
|
|
679
|
+
var modules_a9637dd3 = {"text":"c12d1277","size-caption":"c88e1204","size-copy":"_426d67ec","size-subtitle":"f978d6c7","weight-semibold":"_0c31eccd","weight-bold":"aba17bdd","tone-secondary":"_2767b43d","tone-danger":"e8ae531e","lineClampMultipleLines":"dc839422","lineClamp-1":"e2d23135","lineClamp-2":"_7c778b7e","lineClamp-3":"_5ff41166","lineClamp-4":"b7a4998e","lineClamp-5":"_6a7f8803"};
|
|
507
680
|
|
|
508
|
-
var
|
|
509
|
-
|
|
510
|
-
|
|
681
|
+
var _excluded$9 = ["as", "size", "weight", "tone", "align", "children", "lineClamp", "exceptionallySetClassName"];
|
|
682
|
+
var Text = /*#__PURE__*/polymorphicComponent(function Text(_ref, ref) {
|
|
683
|
+
var as = _ref.as,
|
|
511
684
|
_ref$size = _ref.size,
|
|
512
|
-
size = _ref$size === void 0 ? '
|
|
685
|
+
size = _ref$size === void 0 ? 'body' : _ref$size,
|
|
513
686
|
_ref$weight = _ref.weight,
|
|
514
687
|
weight = _ref$weight === void 0 ? 'regular' : _ref$weight,
|
|
515
688
|
_ref$tone = _ref.tone,
|
|
516
689
|
tone = _ref$tone === void 0 ? 'normal' : _ref$tone,
|
|
690
|
+
align = _ref.align,
|
|
517
691
|
children = _ref.children,
|
|
518
692
|
lineClamp = _ref.lineClamp,
|
|
519
|
-
|
|
693
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
694
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
|
520
695
|
|
|
521
|
-
var lineClampMultipleLines = typeof lineClamp === 'string' ?
|
|
522
|
-
return /*#__PURE__*/React.createElement(Box, Object.assign({},
|
|
523
|
-
|
|
524
|
-
className: [modules_a9637dd3.text, size !== '
|
|
696
|
+
var lineClampMultipleLines = typeof lineClamp === 'string' ? Number(lineClamp) > 1 : (lineClamp !== null && lineClamp !== void 0 ? lineClamp : 1) > 1;
|
|
697
|
+
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
698
|
+
as: as,
|
|
699
|
+
className: [exceptionallySetClassName, modules_a9637dd3.text, size !== 'body' ? getClassNames(modules_a9637dd3, 'size', size) : null, weight !== 'regular' ? getClassNames(modules_a9637dd3, 'weight', weight) : null, tone !== 'normal' ? getClassNames(modules_a9637dd3, 'tone', tone) : null, lineClampMultipleLines ? modules_a9637dd3.lineClampMultipleLines : null, lineClamp ? getClassNames(modules_a9637dd3, 'lineClamp', lineClamp.toString()) : null],
|
|
700
|
+
textAlign: align,
|
|
701
|
+
// Prevents emojis from being cut-off
|
|
702
|
+
// See https://github.com/Doist/reactist/pull/528
|
|
703
|
+
paddingRight: lineClamp ? 'xsmall' : undefined,
|
|
525
704
|
ref: ref
|
|
526
705
|
}), children);
|
|
527
706
|
});
|
|
528
707
|
|
|
529
|
-
var
|
|
530
|
-
|
|
531
|
-
var ButtonLink = /*#__PURE__*/forwardRefWithAs(function ButtonLink(_ref, ref) {
|
|
532
|
-
var _ref$component = _ref.component,
|
|
533
|
-
component = _ref$component === void 0 ? 'a' : _ref$component,
|
|
534
|
-
variant = _ref.variant,
|
|
535
|
-
_ref$size = _ref.size,
|
|
536
|
-
size = _ref$size === void 0 ? 'default' : _ref$size,
|
|
537
|
-
_ref$openInNewTab = _ref.openInNewTab,
|
|
538
|
-
openInNewTab = _ref$openInNewTab === void 0 ? false : _ref$openInNewTab,
|
|
539
|
-
props = _objectWithoutPropertiesLoose(_ref, ["component", "variant", "size", "openInNewTab"]);
|
|
540
|
-
|
|
541
|
-
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
542
|
-
component: component,
|
|
543
|
-
display: "inlineFlex",
|
|
544
|
-
alignItems: "center",
|
|
545
|
-
justifyContent: "center",
|
|
546
|
-
className: [modules_b0eaa640.container, 'reactist_button', variant ? "reactist_button--" + variant : null, size !== 'default' ? "reactist_button--" + size : null],
|
|
547
|
-
ref: ref,
|
|
548
|
-
target: openInNewTab ? '_blank' : undefined,
|
|
549
|
-
rel: openInNewTab ? 'noopener noreferrer' : undefined
|
|
550
|
-
}));
|
|
551
|
-
});
|
|
552
|
-
|
|
553
|
-
var modules_3d05deee = {"container":"_12eda218"};
|
|
554
|
-
|
|
555
|
-
var TextLink = /*#__PURE__*/forwardRefWithAs(function TextLink(_ref, ref) {
|
|
556
|
-
var _ref$component = _ref.component,
|
|
557
|
-
component = _ref$component === void 0 ? 'a' : _ref$component,
|
|
558
|
-
_ref$openInNewTab = _ref.openInNewTab,
|
|
559
|
-
openInNewTab = _ref$openInNewTab === void 0 ? false : _ref$openInNewTab,
|
|
560
|
-
props = _objectWithoutPropertiesLoose(_ref, ["component", "tone", "openInNewTab"]);
|
|
561
|
-
|
|
562
|
-
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
563
|
-
component: component,
|
|
564
|
-
display: "inline",
|
|
565
|
-
className: modules_3d05deee.container,
|
|
566
|
-
ref: ref,
|
|
567
|
-
target: openInNewTab ? '_blank' : undefined,
|
|
568
|
-
rel: openInNewTab ? 'noopener noreferrer' : undefined
|
|
569
|
-
}));
|
|
570
|
-
});
|
|
571
|
-
|
|
572
|
-
var svgPath = {
|
|
573
|
-
checked: 'M18 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm-2.457 4.293l-5.293 5.293-1.793-1.793a1 1 0 1 0-1.414 1.414l2.5 2.5a1 1 0 0 0 1.414 0l6-6a1 1 0 1 0-1.414-1.414z',
|
|
574
|
-
unchecked: 'M18 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm0 1H6a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1z',
|
|
575
|
-
mixed: 'M18 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm-2 7H8a1 1 0 0 0 0 2h8a1 1 0 0 0 0-2z',
|
|
576
|
-
filled: 'M6 4H18C19.1046 4 20 4.89543 20 6V18C20 19.1046 19.1046 20 18 20H6C4.89543 20 4 19.1046 4 18V6C4 4.89543 4.89543 4 6 4Z'
|
|
577
|
-
};
|
|
578
|
-
|
|
579
|
-
function getPathKey(_ref) {
|
|
580
|
-
var checked = _ref.checked,
|
|
581
|
-
indeterminate = _ref.indeterminate,
|
|
582
|
-
disabled = _ref.disabled;
|
|
583
|
-
|
|
584
|
-
if (indeterminate) {
|
|
585
|
-
return 'mixed'; // indeterminate, when true, overrides the checked state
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
if (checked) {
|
|
589
|
-
return 'checked';
|
|
590
|
-
} // We only used 'filled' when unchecked AND disabled, because the default unchecked icon
|
|
591
|
-
// is not enough to convey the disabled state with opacity alone. For all other cases
|
|
592
|
-
// above, when disabled, we use the same icon the corresponds to that state, and the
|
|
593
|
-
// opacity conveys the fact that the checkbox is disabled.
|
|
594
|
-
// See https://twist.com/a/1585/ch/414345/t/2257308/c/65201390
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
if (disabled) {
|
|
598
|
-
return 'filled';
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
return 'unchecked';
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
function CheckboxIcon(_ref2) {
|
|
605
|
-
var checked = _ref2.checked,
|
|
606
|
-
indeterminate = _ref2.indeterminate,
|
|
607
|
-
disabled = _ref2.disabled,
|
|
608
|
-
props = _objectWithoutPropertiesLoose(_ref2, ["checked", "indeterminate", "disabled"]);
|
|
609
|
-
|
|
610
|
-
var pathKey = getPathKey({
|
|
611
|
-
checked: checked,
|
|
612
|
-
indeterminate: indeterminate,
|
|
613
|
-
disabled: disabled
|
|
614
|
-
});
|
|
615
|
-
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
616
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
617
|
-
width: "24",
|
|
618
|
-
height: "24",
|
|
619
|
-
viewBox: "0 0 24 24"
|
|
620
|
-
}, props), /*#__PURE__*/React.createElement("path", {
|
|
621
|
-
fill: "currentColor",
|
|
622
|
-
fillRule: "nonzero",
|
|
623
|
-
d: svgPath[pathKey]
|
|
624
|
-
}));
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
var modules_664a6a80 = {"container":"_6ba70fbf","checked":"_13189b71"};
|
|
628
|
-
|
|
629
|
-
function CheckboxField(_ref) {
|
|
630
|
-
var _ref2;
|
|
631
|
-
|
|
632
|
-
var label = _ref.label,
|
|
633
|
-
className = _ref.className,
|
|
634
|
-
style = _ref.style,
|
|
635
|
-
checked = _ref.checked,
|
|
636
|
-
_ref$indeterminate = _ref.indeterminate,
|
|
637
|
-
indeterminate = _ref$indeterminate === void 0 ? false : _ref$indeterminate,
|
|
638
|
-
props = _objectWithoutPropertiesLoose(_ref, ["label", "className", "style", "checked", "indeterminate"]);
|
|
639
|
-
|
|
640
|
-
if (!label && !props['aria-label'] && !props['aria-labelledby']) {
|
|
641
|
-
// eslint-disable-next-line no-console
|
|
642
|
-
console.warn('A Checkbox needs a label');
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
var checkboxRef = React.useRef(null);
|
|
646
|
-
React.useEffect(function setIndeterminate() {
|
|
647
|
-
if (checkboxRef.current) {
|
|
648
|
-
checkboxRef.current.indeterminate = indeterminate;
|
|
649
|
-
}
|
|
650
|
-
}, [indeterminate]);
|
|
651
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
652
|
-
component: "label",
|
|
653
|
-
display: "flex",
|
|
654
|
-
alignItems: "center",
|
|
655
|
-
className: [className, modules_664a6a80.container, (_ref2 = {}, _ref2[modules_664a6a80.checked] = checked, _ref2), 'focus-marker-enabled-within'],
|
|
656
|
-
style: style
|
|
657
|
-
}, /*#__PURE__*/React.createElement(VisuallyHidden.VisuallyHidden, null, /*#__PURE__*/React.createElement("input", Object.assign({}, props, {
|
|
658
|
-
ref: checkboxRef,
|
|
659
|
-
type: "checkbox",
|
|
660
|
-
checked: checked
|
|
661
|
-
}))), /*#__PURE__*/React.createElement(CheckboxIcon, {
|
|
662
|
-
"aria-hidden": true,
|
|
663
|
-
checked: checked,
|
|
664
|
-
indeterminate: indeterminate,
|
|
665
|
-
disabled: props.disabled
|
|
666
|
-
}), label ? /*#__PURE__*/React.createElement("span", null, label) : null);
|
|
667
|
-
}
|
|
708
|
+
var _excluded$a = ["children", "content", "position", "gapSize", "className"];
|
|
668
709
|
|
|
669
710
|
var SHOW_DELAY = 500;
|
|
670
711
|
var HIDE_DELAY = 100;
|
|
@@ -692,7 +733,7 @@ function Tooltip(_ref) {
|
|
|
692
733
|
_ref$gapSize = _ref.gapSize,
|
|
693
734
|
gapSize = _ref$gapSize === void 0 ? 3 : _ref$gapSize,
|
|
694
735
|
className = _ref.className,
|
|
695
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
736
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
696
737
|
|
|
697
738
|
var tooltip = useDelayedTooltipState({
|
|
698
739
|
placement: position,
|
|
@@ -777,79 +818,354 @@ function useDelay() {
|
|
|
777
818
|
}, [clearTimeouts]);
|
|
778
819
|
}
|
|
779
820
|
|
|
780
|
-
var
|
|
821
|
+
var modules_b9569bce = {"label":"_1f20c88a","baseButton":"_623015f3","size-small":"_062de645","size-normal":"_55e2a6a9","size-large":"cab32a7c","disabled":"e71c191a","iconButton":"_368efc16","startIcon":"d35389c1","endIcon":"_900d41d8","variant-primary":"_7c95e162","variant-secondary":"_9cb889aa","variant-tertiary":"_611b5b28","variant-quaternary":"_80c2bb84","tone-destructive":"ee13c455"};
|
|
781
822
|
|
|
782
|
-
|
|
783
|
-
return uid++;
|
|
784
|
-
}
|
|
823
|
+
var _excluded$b = ["as", "variant", "tone", "size", "disabled", "loading", "tooltip", "onClick", "exceptionallySetClassName", "children", "startIcon", "endIcon", "icon"];
|
|
785
824
|
|
|
786
|
-
function
|
|
787
|
-
|
|
788
|
-
return prefix + "-" + num;
|
|
825
|
+
function preventDefault(event) {
|
|
826
|
+
event.preventDefault();
|
|
789
827
|
}
|
|
790
|
-
|
|
791
|
-
|
|
828
|
+
/**
|
|
829
|
+
* The component that powers `Button` and `ButtonLink`, where the button styling logic and some
|
|
830
|
+
* common functionality resides. This component is internal to Reactist.
|
|
831
|
+
*
|
|
832
|
+
* 🎨 [Figma](https://www.figma.com/file/LYlWNzvhMDh907l07mPPQk/Product-Web?node-id=4693%3A175143)
|
|
833
|
+
*
|
|
834
|
+
* @see Button
|
|
835
|
+
* @see ButtonLink
|
|
836
|
+
*/
|
|
792
837
|
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
838
|
+
|
|
839
|
+
var BaseButton = /*#__PURE__*/polymorphicComponent(function BaseButton(_ref, ref) {
|
|
840
|
+
var _ref$as = _ref.as,
|
|
841
|
+
as = _ref$as === void 0 ? 'div' : _ref$as,
|
|
842
|
+
variant = _ref.variant,
|
|
843
|
+
_ref$tone = _ref.tone,
|
|
844
|
+
tone = _ref$tone === void 0 ? 'normal' : _ref$tone,
|
|
845
|
+
_ref$size = _ref.size,
|
|
846
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
847
|
+
_ref$disabled = _ref.disabled,
|
|
848
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
849
|
+
_ref$loading = _ref.loading,
|
|
850
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
851
|
+
tooltip = _ref.tooltip,
|
|
852
|
+
onClick = _ref.onClick,
|
|
853
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
854
|
+
children = _ref.children,
|
|
855
|
+
startIcon = _ref.startIcon,
|
|
856
|
+
endIcon = _ref.endIcon,
|
|
857
|
+
icon = _ref.icon,
|
|
858
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
859
|
+
|
|
860
|
+
var isDisabled = loading || disabled;
|
|
861
|
+
var buttonElement = /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
862
|
+
as: as,
|
|
863
|
+
ref: ref,
|
|
864
|
+
"aria-disabled": isDisabled,
|
|
865
|
+
onClick: isDisabled ? preventDefault : onClick,
|
|
866
|
+
className: [exceptionallySetClassName, modules_b9569bce.baseButton, modules_b9569bce["variant-" + variant], modules_b9569bce["tone-" + tone], modules_b9569bce["size-" + size], icon ? modules_b9569bce.iconButton : null, disabled ? modules_b9569bce.disabled : null]
|
|
867
|
+
}), icon ? loading && /*#__PURE__*/React.createElement(Spinner, null) || icon : /*#__PURE__*/React.createElement(React.Fragment, null, startIcon ? /*#__PURE__*/React.createElement(Box, {
|
|
868
|
+
display: "flex",
|
|
869
|
+
className: modules_b9569bce.startIcon,
|
|
870
|
+
"aria-hidden": true
|
|
871
|
+
}, loading && !endIcon ? /*#__PURE__*/React.createElement(Spinner, null) : startIcon) : null, children ? /*#__PURE__*/React.createElement("span", {
|
|
872
|
+
className: modules_b9569bce.label
|
|
873
|
+
}, children) : null, endIcon || loading && !startIcon ? /*#__PURE__*/React.createElement(Box, {
|
|
874
|
+
display: "flex",
|
|
875
|
+
className: modules_b9569bce.endIcon,
|
|
876
|
+
"aria-hidden": true
|
|
877
|
+
}, loading ? /*#__PURE__*/React.createElement(Spinner, null) : endIcon) : null)); // If it's an icon-only button, make sure it uses the aria-label as tooltip if no tooltip was provided
|
|
878
|
+
|
|
879
|
+
var tooltipContent = icon ? tooltip !== null && tooltip !== void 0 ? tooltip : props['aria-label'] : tooltip;
|
|
880
|
+
return tooltipContent ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
881
|
+
content: tooltipContent
|
|
882
|
+
}, buttonElement) : buttonElement;
|
|
883
|
+
});
|
|
884
|
+
|
|
885
|
+
var _excluded$c = ["variant", "tone", "size", "type", "disabled", "exceptionallySetClassName"];
|
|
886
|
+
/**
|
|
887
|
+
* A semantic button that also looks like a button, and provides all the necessary visual variants.
|
|
888
|
+
* It follows the [WAI-ARIA Button Pattern](https://www.w3.org/TR/wai-aria-practices/#button).
|
|
889
|
+
*
|
|
890
|
+
* 🎨 [Figma](https://www.figma.com/file/LYlWNzvhMDh907l07mPPQk/Product-Web?node-id=4693%3A175143)
|
|
891
|
+
*
|
|
892
|
+
* @see ButtonLink
|
|
893
|
+
*/
|
|
894
|
+
|
|
895
|
+
var Button = /*#__PURE__*/React.forwardRef(function Button(_ref, ref) {
|
|
896
|
+
var variant = _ref.variant,
|
|
897
|
+
_ref$tone = _ref.tone,
|
|
898
|
+
tone = _ref$tone === void 0 ? 'normal' : _ref$tone,
|
|
899
|
+
_ref$size = _ref.size,
|
|
900
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
901
|
+
_ref$type = _ref.type,
|
|
902
|
+
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
903
|
+
_ref$disabled = _ref.disabled,
|
|
904
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
905
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
906
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
907
|
+
|
|
908
|
+
return /*#__PURE__*/React.createElement(BaseButton, Object.assign({}, props, {
|
|
909
|
+
as: "button",
|
|
910
|
+
ref: ref,
|
|
911
|
+
variant: variant,
|
|
912
|
+
tone: tone,
|
|
913
|
+
size: size,
|
|
914
|
+
type: type,
|
|
915
|
+
disabled: disabled,
|
|
916
|
+
exceptionallySetClassName: exceptionallySetClassName
|
|
917
|
+
}));
|
|
918
|
+
});
|
|
919
|
+
|
|
920
|
+
var _excluded$d = ["as", "variant", "tone", "size", "exceptionallySetClassName", "openInNewTab"];
|
|
921
|
+
/**
|
|
922
|
+
* A semantic link that looks like a button, exactly matching the `Button` component in all visual
|
|
923
|
+
* aspects.
|
|
924
|
+
*
|
|
925
|
+
*🎨 [Figma](https://www.figma.com/file/LYlWNzvhMDh907l07mPPQk/Product-Web?node-id=4693%3A175143)
|
|
926
|
+
*
|
|
927
|
+
* @see Button
|
|
928
|
+
*/
|
|
929
|
+
|
|
930
|
+
var ButtonLink = /*#__PURE__*/polymorphicComponent(function ButtonLink(_ref, ref) {
|
|
931
|
+
var _ref$as = _ref.as,
|
|
932
|
+
as = _ref$as === void 0 ? 'a' : _ref$as,
|
|
933
|
+
variant = _ref.variant,
|
|
934
|
+
_ref$tone = _ref.tone,
|
|
935
|
+
tone = _ref$tone === void 0 ? 'normal' : _ref$tone,
|
|
936
|
+
_ref$size = _ref.size,
|
|
937
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
938
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
939
|
+
_ref$openInNewTab = _ref.openInNewTab,
|
|
940
|
+
openInNewTab = _ref$openInNewTab === void 0 ? false : _ref$openInNewTab,
|
|
941
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
942
|
+
|
|
943
|
+
return /*#__PURE__*/React.createElement(BaseButton, Object.assign({}, props, {
|
|
944
|
+
as: as,
|
|
945
|
+
ref: ref,
|
|
946
|
+
variant: variant,
|
|
947
|
+
tone: tone,
|
|
948
|
+
size: size,
|
|
949
|
+
exceptionallySetClassName: exceptionallySetClassName,
|
|
950
|
+
target: openInNewTab ? '_blank' : undefined,
|
|
951
|
+
rel: openInNewTab ? 'noopener noreferrer' : undefined
|
|
952
|
+
}));
|
|
953
|
+
});
|
|
954
|
+
|
|
955
|
+
var modules_3d05deee = {"container":"_12eda218"};
|
|
956
|
+
|
|
957
|
+
var _excluded$e = ["as", "openInNewTab", "exceptionallySetClassName"];
|
|
958
|
+
var TextLink = /*#__PURE__*/polymorphicComponent(function TextLink(_ref, ref) {
|
|
959
|
+
var _ref$as = _ref.as,
|
|
960
|
+
as = _ref$as === void 0 ? 'a' : _ref$as,
|
|
961
|
+
_ref$openInNewTab = _ref.openInNewTab,
|
|
962
|
+
openInNewTab = _ref$openInNewTab === void 0 ? false : _ref$openInNewTab,
|
|
963
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
964
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
965
|
+
|
|
966
|
+
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
967
|
+
as: as,
|
|
968
|
+
display: "inline",
|
|
969
|
+
className: [exceptionallySetClassName, modules_3d05deee.container],
|
|
970
|
+
ref: ref,
|
|
971
|
+
target: openInNewTab ? '_blank' : undefined,
|
|
972
|
+
rel: openInNewTab ? 'noopener noreferrer' : undefined
|
|
973
|
+
}));
|
|
974
|
+
});
|
|
975
|
+
|
|
976
|
+
var _excluded$f = ["checked", "indeterminate", "disabled"];
|
|
977
|
+
var svgPath = {
|
|
978
|
+
checked: 'M18 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm-2.457 4.293l-5.293 5.293-1.793-1.793a1 1 0 1 0-1.414 1.414l2.5 2.5a1 1 0 0 0 1.414 0l6-6a1 1 0 1 0-1.414-1.414z',
|
|
979
|
+
unchecked: 'M18 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm0 1H6a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1z',
|
|
980
|
+
mixed: 'M18 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm-2 7H8a1 1 0 0 0 0 2h8a1 1 0 0 0 0-2z',
|
|
981
|
+
filled: 'M6 4H18C19.1046 4 20 4.89543 20 6V18C20 19.1046 19.1046 20 18 20H6C4.89543 20 4 19.1046 4 18V6C4 4.89543 4.89543 4 6 4Z'
|
|
982
|
+
};
|
|
983
|
+
|
|
984
|
+
function getPathKey(_ref) {
|
|
985
|
+
var checked = _ref.checked,
|
|
986
|
+
indeterminate = _ref.indeterminate,
|
|
987
|
+
disabled = _ref.disabled;
|
|
988
|
+
|
|
989
|
+
if (indeterminate) {
|
|
990
|
+
return 'mixed'; // indeterminate, when true, overrides the checked state
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
if (checked) {
|
|
994
|
+
return 'checked';
|
|
995
|
+
} // We only used 'filled' when unchecked AND disabled, because the default unchecked icon
|
|
996
|
+
// is not enough to convey the disabled state with opacity alone. For all other cases
|
|
997
|
+
// above, when disabled, we use the same icon the corresponds to that state, and the
|
|
998
|
+
// opacity conveys the fact that the checkbox is disabled.
|
|
999
|
+
// See https://twist.com/a/1585/ch/414345/t/2257308/c/65201390
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
if (disabled) {
|
|
1003
|
+
return 'filled';
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
return 'unchecked';
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
function CheckboxIcon(_ref2) {
|
|
1010
|
+
var checked = _ref2.checked,
|
|
1011
|
+
indeterminate = _ref2.indeterminate,
|
|
1012
|
+
disabled = _ref2.disabled,
|
|
1013
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$f);
|
|
1014
|
+
|
|
1015
|
+
var pathKey = getPathKey({
|
|
1016
|
+
checked: checked,
|
|
1017
|
+
indeterminate: indeterminate,
|
|
1018
|
+
disabled: disabled
|
|
1019
|
+
});
|
|
1020
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
1021
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1022
|
+
width: "24",
|
|
1023
|
+
height: "24",
|
|
1024
|
+
viewBox: "0 0 24 24"
|
|
1025
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
1026
|
+
fill: "currentColor",
|
|
1027
|
+
fillRule: "nonzero",
|
|
1028
|
+
d: svgPath[pathKey]
|
|
1029
|
+
}));
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
var modules_664a6a80 = {"container":"f9e0a1b8","disabled":"_01411889","checked":"ffdfd8fb"};
|
|
1033
|
+
|
|
1034
|
+
var _excluded$g = ["label", "disabled", "indeterminate", "defaultChecked", "onChange"];
|
|
1035
|
+
var CheckboxField = /*#__PURE__*/React.forwardRef(function CheckboxField(_ref, ref) {
|
|
1036
|
+
var _ref2, _props$checked, _props$checked2;
|
|
1037
|
+
|
|
1038
|
+
var label = _ref.label,
|
|
1039
|
+
disabled = _ref.disabled,
|
|
1040
|
+
indeterminate = _ref.indeterminate,
|
|
1041
|
+
defaultChecked = _ref.defaultChecked,
|
|
1042
|
+
_onChange = _ref.onChange,
|
|
1043
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
1044
|
+
|
|
1045
|
+
var isControlledComponent = typeof props.checked === 'boolean';
|
|
1046
|
+
|
|
1047
|
+
if (typeof indeterminate === 'boolean' && !isControlledComponent) {
|
|
1048
|
+
// eslint-disable-next-line no-console
|
|
1049
|
+
console.warn('Cannot use indeterminate on an uncontrolled checkbox');
|
|
1050
|
+
indeterminate = undefined;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
if (!label && !props['aria-label'] && !props['aria-labelledby']) {
|
|
1054
|
+
// eslint-disable-next-line no-console
|
|
1055
|
+
console.warn('A Checkbox needs a label');
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
var _React$useState = React.useState((_ref2 = (_props$checked = props.checked) !== null && _props$checked !== void 0 ? _props$checked : defaultChecked) !== null && _ref2 !== void 0 ? _ref2 : false),
|
|
1059
|
+
checkedState = _React$useState[0],
|
|
1060
|
+
setChecked = _React$useState[1];
|
|
1061
|
+
|
|
1062
|
+
var isChecked = (_props$checked2 = props.checked) !== null && _props$checked2 !== void 0 ? _props$checked2 : checkedState;
|
|
1063
|
+
var internalRef = React.useRef(null);
|
|
1064
|
+
var combinedRef = reakitUtils.useForkRef(internalRef, ref);
|
|
1065
|
+
React.useEffect(function setIndeterminate() {
|
|
1066
|
+
if (internalRef.current && typeof indeterminate === 'boolean') {
|
|
1067
|
+
internalRef.current.indeterminate = indeterminate;
|
|
1068
|
+
}
|
|
1069
|
+
}, [indeterminate]);
|
|
1070
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
1071
|
+
as: "label",
|
|
1072
|
+
display: "flex",
|
|
1073
|
+
alignItems: "center",
|
|
1074
|
+
className: [modules_664a6a80.container, disabled ? modules_664a6a80.disabled : null, isChecked ? modules_664a6a80.checked : null, 'focus-marker-enabled-within']
|
|
1075
|
+
}, /*#__PURE__*/React.createElement(HiddenVisually, null, /*#__PURE__*/React.createElement("input", Object.assign({}, props, {
|
|
1076
|
+
ref: combinedRef,
|
|
1077
|
+
type: "checkbox",
|
|
1078
|
+
checked: isChecked,
|
|
1079
|
+
disabled: disabled,
|
|
1080
|
+
onChange: function onChange(event) {
|
|
1081
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(event);
|
|
1082
|
+
|
|
1083
|
+
if (!event.defaultPrevented) {
|
|
1084
|
+
setChecked(event.currentTarget.checked);
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
}))), /*#__PURE__*/React.createElement(CheckboxIcon, {
|
|
1088
|
+
"aria-hidden": true,
|
|
1089
|
+
checked: isChecked,
|
|
1090
|
+
indeterminate: indeterminate,
|
|
1091
|
+
disabled: disabled
|
|
1092
|
+
}), label ? /*#__PURE__*/React.createElement(Text, null, label) : null);
|
|
1093
|
+
});
|
|
1094
|
+
|
|
1095
|
+
var uid = 0;
|
|
1096
|
+
|
|
1097
|
+
function uniqueId() {
|
|
1098
|
+
return uid++;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
function generateElementId(prefix) {
|
|
1102
|
+
var num = uniqueId();
|
|
1103
|
+
return prefix + "-" + num;
|
|
1104
|
+
}
|
|
1105
|
+
function useId(providedId) {
|
|
1106
|
+
var ref = React.useRef(providedId !== null && providedId !== void 0 ? providedId : null);
|
|
1107
|
+
|
|
1108
|
+
if (!ref.current) {
|
|
1109
|
+
ref.current = generateElementId('element');
|
|
1110
|
+
}
|
|
796
1111
|
|
|
797
1112
|
return ref.current;
|
|
798
1113
|
}
|
|
799
1114
|
|
|
800
|
-
var modules_540a88ff = {"container":"
|
|
1115
|
+
var modules_540a88ff = {"container":"ed7d894c","primaryLabel":"_22213081","secondaryLabel":"be8637dd","auxiliaryLabel":"_72b46ad5"};
|
|
801
1116
|
|
|
802
|
-
function FieldHint(
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
return /*#__PURE__*/React.createElement(Text, {
|
|
806
|
-
component: "p",
|
|
1117
|
+
function FieldHint(props) {
|
|
1118
|
+
return /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
1119
|
+
as: "p",
|
|
807
1120
|
tone: "secondary",
|
|
808
|
-
size: "
|
|
809
|
-
|
|
810
|
-
className: modules_540a88ff.fieldHint
|
|
811
|
-
}, children);
|
|
1121
|
+
size: "copy"
|
|
1122
|
+
}, props));
|
|
812
1123
|
}
|
|
813
1124
|
|
|
814
|
-
function BaseField(
|
|
815
|
-
var label =
|
|
816
|
-
secondaryLabel =
|
|
817
|
-
auxiliaryLabel =
|
|
818
|
-
hint =
|
|
819
|
-
className =
|
|
820
|
-
children =
|
|
821
|
-
maxWidth =
|
|
822
|
-
hidden =
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
var id = useId(
|
|
1125
|
+
function BaseField(_ref) {
|
|
1126
|
+
var label = _ref.label,
|
|
1127
|
+
secondaryLabel = _ref.secondaryLabel,
|
|
1128
|
+
auxiliaryLabel = _ref.auxiliaryLabel,
|
|
1129
|
+
hint = _ref.hint,
|
|
1130
|
+
className = _ref.className,
|
|
1131
|
+
children = _ref.children,
|
|
1132
|
+
maxWidth = _ref.maxWidth,
|
|
1133
|
+
hidden = _ref.hidden,
|
|
1134
|
+
originalAriaDescribedBy = _ref['aria-describedby'],
|
|
1135
|
+
originalId = _ref.id;
|
|
1136
|
+
var id = useId(originalId);
|
|
826
1137
|
var hintId = useId();
|
|
827
|
-
var ariaDescribedBy = hint ?
|
|
828
|
-
return /*#__PURE__*/React.createElement(
|
|
1138
|
+
var ariaDescribedBy = originalAriaDescribedBy !== null && originalAriaDescribedBy !== void 0 ? originalAriaDescribedBy : hint ? hintId : undefined;
|
|
1139
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
1140
|
+
space: "small"
|
|
1141
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
829
1142
|
className: [className, modules_540a88ff.container],
|
|
830
1143
|
maxWidth: maxWidth,
|
|
831
1144
|
hidden: hidden
|
|
832
1145
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
833
|
-
|
|
1146
|
+
as: "span",
|
|
834
1147
|
display: "flex",
|
|
835
1148
|
justifyContent: "spaceBetween",
|
|
836
1149
|
alignItems: "flexEnd",
|
|
837
1150
|
paddingBottom: "small"
|
|
838
1151
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
839
|
-
|
|
1152
|
+
size: "body",
|
|
1153
|
+
as: "label",
|
|
840
1154
|
htmlFor: id
|
|
841
1155
|
}, label ? /*#__PURE__*/React.createElement("span", {
|
|
842
1156
|
className: modules_540a88ff.primaryLabel
|
|
843
1157
|
}, label) : null, secondaryLabel ? /*#__PURE__*/React.createElement("span", {
|
|
844
1158
|
className: modules_540a88ff.secondaryLabel
|
|
845
1159
|
}, "\xA0(", secondaryLabel, ")") : null), auxiliaryLabel ? /*#__PURE__*/React.createElement(Box, {
|
|
846
|
-
className: modules_540a88ff.auxiliaryLabel
|
|
1160
|
+
className: modules_540a88ff.auxiliaryLabel,
|
|
1161
|
+
paddingLeft: "small"
|
|
847
1162
|
}, auxiliaryLabel) : null), children(ariaDescribedBy ? {
|
|
848
1163
|
id: id,
|
|
849
1164
|
'aria-describedby': ariaDescribedBy
|
|
850
1165
|
} : {
|
|
851
1166
|
id: id
|
|
852
|
-
}), hint ? /*#__PURE__*/React.createElement(FieldHint, {
|
|
1167
|
+
})), hint ? /*#__PURE__*/React.createElement(FieldHint, {
|
|
1168
|
+
hidden: hidden,
|
|
853
1169
|
id: hintId
|
|
854
1170
|
}, hint) : null);
|
|
855
1171
|
}
|
|
@@ -899,17 +1215,20 @@ function PasswordHiddenIcon(props) {
|
|
|
899
1215
|
|
|
900
1216
|
var modules_3f03ead6 = {"inputWrapper":"_460d581b"};
|
|
901
1217
|
|
|
902
|
-
var modules_aaf25250 = {"inputWrapper":"
|
|
1218
|
+
var modules_aaf25250 = {"inputWrapper":"dd9ffeab"};
|
|
903
1219
|
|
|
1220
|
+
var _excluded$h = ["label", "secondaryLabel", "auxiliaryLabel", "hint", "maxWidth", "togglePasswordLabel", "hidden", "aria-describedby"];
|
|
904
1221
|
var PasswordField = /*#__PURE__*/React.forwardRef(function PasswordField(_ref, ref) {
|
|
905
1222
|
var label = _ref.label,
|
|
906
1223
|
secondaryLabel = _ref.secondaryLabel,
|
|
907
1224
|
auxiliaryLabel = _ref.auxiliaryLabel,
|
|
908
1225
|
hint = _ref.hint,
|
|
909
1226
|
maxWidth = _ref.maxWidth,
|
|
910
|
-
|
|
1227
|
+
_ref$togglePasswordLa = _ref.togglePasswordLabel,
|
|
1228
|
+
togglePasswordLabel = _ref$togglePasswordLa === void 0 ? 'Toggle password visibility' : _ref$togglePasswordLa,
|
|
911
1229
|
hidden = _ref.hidden,
|
|
912
|
-
|
|
1230
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
1231
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
|
913
1232
|
|
|
914
1233
|
var id = useId(props.id);
|
|
915
1234
|
var internalRef = React.useRef(null);
|
|
@@ -935,7 +1254,8 @@ var PasswordField = /*#__PURE__*/React.forwardRef(function PasswordField(_ref, r
|
|
|
935
1254
|
auxiliaryLabel: auxiliaryLabel,
|
|
936
1255
|
hint: hint,
|
|
937
1256
|
maxWidth: maxWidth,
|
|
938
|
-
hidden: hidden
|
|
1257
|
+
hidden: hidden,
|
|
1258
|
+
"aria-describedby": ariaDescribedBy
|
|
939
1259
|
}, function (extraProps) {
|
|
940
1260
|
return /*#__PURE__*/React.createElement(Box, {
|
|
941
1261
|
display: "flex",
|
|
@@ -959,9 +1279,10 @@ var PasswordField = /*#__PURE__*/React.forwardRef(function PasswordField(_ref, r
|
|
|
959
1279
|
});
|
|
960
1280
|
});
|
|
961
1281
|
|
|
962
|
-
var modules_1fa9b208 = {"selectWrapper":"
|
|
1282
|
+
var modules_1fa9b208 = {"selectWrapper":"_828e09c5"};
|
|
963
1283
|
|
|
964
|
-
|
|
1284
|
+
var _excluded$i = ["id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "maxWidth", "children", "hidden", "aria-describedby"];
|
|
1285
|
+
var SelectField = /*#__PURE__*/React.forwardRef(function SelectField(_ref, ref) {
|
|
965
1286
|
var id = _ref.id,
|
|
966
1287
|
label = _ref.label,
|
|
967
1288
|
secondaryLabel = _ref.secondaryLabel,
|
|
@@ -969,7 +1290,9 @@ function SelectField(_ref) {
|
|
|
969
1290
|
hint = _ref.hint,
|
|
970
1291
|
maxWidth = _ref.maxWidth,
|
|
971
1292
|
children = _ref.children,
|
|
972
|
-
|
|
1293
|
+
hidden = _ref.hidden,
|
|
1294
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
1295
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
973
1296
|
|
|
974
1297
|
return /*#__PURE__*/React.createElement(BaseField, {
|
|
975
1298
|
id: id,
|
|
@@ -977,15 +1300,19 @@ function SelectField(_ref) {
|
|
|
977
1300
|
secondaryLabel: secondaryLabel,
|
|
978
1301
|
auxiliaryLabel: auxiliaryLabel,
|
|
979
1302
|
hint: hint,
|
|
980
|
-
maxWidth: maxWidth
|
|
1303
|
+
maxWidth: maxWidth,
|
|
1304
|
+
hidden: hidden,
|
|
1305
|
+
"aria-describedby": ariaDescribedBy
|
|
981
1306
|
}, function (extraProps) {
|
|
982
1307
|
return /*#__PURE__*/React.createElement(Box, {
|
|
983
1308
|
className: modules_1fa9b208.selectWrapper
|
|
984
|
-
}, /*#__PURE__*/React.createElement("select", Object.assign({}, props, extraProps
|
|
1309
|
+
}, /*#__PURE__*/React.createElement("select", Object.assign({}, props, extraProps, {
|
|
1310
|
+
ref: ref
|
|
1311
|
+
}), children), /*#__PURE__*/React.createElement(SelectChevron, {
|
|
985
1312
|
"aria-hidden": true
|
|
986
1313
|
}));
|
|
987
1314
|
});
|
|
988
|
-
}
|
|
1315
|
+
});
|
|
989
1316
|
|
|
990
1317
|
function SelectChevron(props) {
|
|
991
1318
|
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
@@ -999,54 +1326,73 @@ function SelectChevron(props) {
|
|
|
999
1326
|
}));
|
|
1000
1327
|
}
|
|
1001
1328
|
|
|
1002
|
-
var modules_8e05f7c9 = {"container":"
|
|
1003
|
-
|
|
1004
|
-
function join() {
|
|
1005
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1006
|
-
args[_key] = arguments[_key];
|
|
1007
|
-
}
|
|
1329
|
+
var modules_8e05f7c9 = {"container":"_99a80509","disabled":"b5cf26ef","checked":"a63c43a2","toggle":"f318ae83","label":"_427926b9","handle":"_9fcd994c"};
|
|
1008
1330
|
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
return list.length > 0 ? list.join(' ') : undefined;
|
|
1013
|
-
}
|
|
1331
|
+
var _excluded$j = ["label", "hint", "disabled", "hidden", "defaultChecked", "id", "aria-describedby", "onChange"];
|
|
1332
|
+
var SwitchField = /*#__PURE__*/React.forwardRef(function SwitchField(_ref, ref) {
|
|
1333
|
+
var _ref2, _props$checked, _props$checked2;
|
|
1014
1334
|
|
|
1015
|
-
function SwitchField(_ref) {
|
|
1016
1335
|
var label = _ref.label,
|
|
1017
1336
|
hint = _ref.hint,
|
|
1018
1337
|
_ref$disabled = _ref.disabled,
|
|
1019
1338
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1339
|
+
hidden = _ref.hidden,
|
|
1340
|
+
defaultChecked = _ref.defaultChecked,
|
|
1341
|
+
originalId = _ref.id,
|
|
1342
|
+
originalAriaDescribedBy = _ref['aria-describedby'],
|
|
1343
|
+
_onChange = _ref.onChange,
|
|
1344
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
|
1024
1345
|
|
|
1025
|
-
var id = useId(
|
|
1346
|
+
var id = useId(originalId);
|
|
1026
1347
|
var hintId = useId();
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1348
|
+
var ariaDescribedBy = originalAriaDescribedBy !== null && originalAriaDescribedBy !== void 0 ? originalAriaDescribedBy : hint ? hintId : undefined;
|
|
1349
|
+
|
|
1350
|
+
var _React$useState = React.useState((_ref2 = (_props$checked = props.checked) !== null && _props$checked !== void 0 ? _props$checked : defaultChecked) !== null && _ref2 !== void 0 ? _ref2 : false),
|
|
1351
|
+
checkedState = _React$useState[0],
|
|
1352
|
+
setChecked = _React$useState[1];
|
|
1353
|
+
|
|
1354
|
+
var isChecked = (_props$checked2 = props.checked) !== null && _props$checked2 !== void 0 ? _props$checked2 : checkedState;
|
|
1355
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
1356
|
+
space: "small",
|
|
1357
|
+
hidden: hidden
|
|
1030
1358
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
1031
|
-
|
|
1359
|
+
className: [modules_8e05f7c9.container, disabled ? modules_8e05f7c9.disabled : null, isChecked ? modules_8e05f7c9.checked : null],
|
|
1360
|
+
as: "label",
|
|
1032
1361
|
display: "flex",
|
|
1033
1362
|
alignItems: "center"
|
|
1034
1363
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
1035
|
-
|
|
1036
|
-
|
|
1364
|
+
position: "relative",
|
|
1365
|
+
display: "inlineBlock",
|
|
1366
|
+
overflow: "visible",
|
|
1367
|
+
marginRight: "small",
|
|
1368
|
+
flexShrink: 0,
|
|
1369
|
+
className: modules_8e05f7c9.toggle
|
|
1370
|
+
}, /*#__PURE__*/React.createElement(HiddenVisually, null, /*#__PURE__*/React.createElement("input", Object.assign({}, props, {
|
|
1037
1371
|
id: id,
|
|
1038
1372
|
type: "checkbox",
|
|
1039
|
-
checked: checked,
|
|
1040
1373
|
disabled: disabled,
|
|
1041
|
-
"aria-describedby":
|
|
1042
|
-
|
|
1374
|
+
"aria-describedby": ariaDescribedBy,
|
|
1375
|
+
ref: ref,
|
|
1376
|
+
checked: isChecked,
|
|
1377
|
+
onChange: function onChange(event) {
|
|
1378
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(event);
|
|
1379
|
+
|
|
1380
|
+
if (!event.defaultPrevented) {
|
|
1381
|
+
setChecked(event.currentTarget.checked);
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
}))), /*#__PURE__*/React.createElement("span", {
|
|
1043
1385
|
className: modules_8e05f7c9.handle
|
|
1044
|
-
})), /*#__PURE__*/React.createElement(
|
|
1386
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
1387
|
+
exceptionallySetClassName: modules_8e05f7c9.label
|
|
1388
|
+
}, label)), hint ? /*#__PURE__*/React.createElement(FieldHint, {
|
|
1045
1389
|
id: hintId
|
|
1046
1390
|
}, hint) : null);
|
|
1047
|
-
}
|
|
1391
|
+
});
|
|
1048
1392
|
|
|
1049
|
-
var modules_2728c236 = {"container":"
|
|
1393
|
+
var modules_2728c236 = {"container":"_5a579f96"};
|
|
1394
|
+
|
|
1395
|
+
var _excluded$k = ["id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "maxWidth"];
|
|
1050
1396
|
|
|
1051
1397
|
function TextArea(_ref) {
|
|
1052
1398
|
var id = _ref.id,
|
|
@@ -1055,7 +1401,7 @@ function TextArea(_ref) {
|
|
|
1055
1401
|
auxiliaryLabel = _ref.auxiliaryLabel,
|
|
1056
1402
|
hint = _ref.hint,
|
|
1057
1403
|
maxWidth = _ref.maxWidth,
|
|
1058
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
1404
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
|
1059
1405
|
|
|
1060
1406
|
return /*#__PURE__*/React.createElement(BaseField, {
|
|
1061
1407
|
id: id,
|
|
@@ -1072,6 +1418,7 @@ function TextArea(_ref) {
|
|
|
1072
1418
|
});
|
|
1073
1419
|
}
|
|
1074
1420
|
|
|
1421
|
+
var _excluded$l = ["id", "label", "secondaryLabel", "auxiliaryLabel", "hint", "type", "maxWidth", "hidden", "aria-describedby"];
|
|
1075
1422
|
var TextField = /*#__PURE__*/React.forwardRef(function TextField(_ref, ref) {
|
|
1076
1423
|
var id = _ref.id,
|
|
1077
1424
|
label = _ref.label,
|
|
@@ -1082,7 +1429,8 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(_ref, ref) {
|
|
|
1082
1429
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1083
1430
|
maxWidth = _ref.maxWidth,
|
|
1084
1431
|
hidden = _ref.hidden,
|
|
1085
|
-
|
|
1432
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
1433
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
1086
1434
|
|
|
1087
1435
|
return /*#__PURE__*/React.createElement(BaseField, {
|
|
1088
1436
|
id: id,
|
|
@@ -1091,7 +1439,8 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(_ref, ref) {
|
|
|
1091
1439
|
auxiliaryLabel: auxiliaryLabel,
|
|
1092
1440
|
hint: hint,
|
|
1093
1441
|
maxWidth: maxWidth,
|
|
1094
|
-
hidden: hidden
|
|
1442
|
+
hidden: hidden,
|
|
1443
|
+
"aria-describedby": ariaDescribedBy
|
|
1095
1444
|
}, function (extraProps) {
|
|
1096
1445
|
return /*#__PURE__*/React.createElement(Box, {
|
|
1097
1446
|
className: modules_aaf25250.inputWrapper
|
|
@@ -1102,35 +1451,388 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(_ref, ref) {
|
|
|
1102
1451
|
});
|
|
1103
1452
|
});
|
|
1104
1453
|
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
}
|
|
1454
|
+
/**
|
|
1455
|
+
* usePrevious tracks the change of the given value -
|
|
1456
|
+
* when a given value has been changed from a previous call,
|
|
1457
|
+
* it will return the value prior to the change.
|
|
1458
|
+
*
|
|
1459
|
+
* Example:
|
|
1460
|
+
*
|
|
1461
|
+
* const [x, setX] = useState(1)
|
|
1462
|
+
* const prevX = usePrevious(x)
|
|
1463
|
+
*
|
|
1464
|
+
* Suppose `setX(2)` is called, then in the next component render
|
|
1465
|
+
* x = 2 and prevX = 1
|
|
1466
|
+
*/
|
|
1119
1467
|
|
|
1120
|
-
|
|
1468
|
+
function usePrevious(value) {
|
|
1469
|
+
var ref = React.useRef(null);
|
|
1470
|
+
React.useEffect(function () {
|
|
1471
|
+
ref.current = value;
|
|
1472
|
+
}, [value]);
|
|
1473
|
+
return ref.current;
|
|
1121
1474
|
}
|
|
1122
1475
|
|
|
1123
|
-
|
|
1124
|
-
var seed = email.split('@')[0];
|
|
1125
|
-
var hash = seed.charCodeAt(0) + seed.charCodeAt(seed.length - 1) || 0;
|
|
1126
|
-
return hash % maxIndex;
|
|
1127
|
-
}
|
|
1476
|
+
var modules_40c67f5b = {"tab":"_7cdcd0b6","tab-normal":"af6705d0","tab-primary":"ad705020","tab-secondary":"_69a2043b","tab-tertiary":"_5b695667","tab-plain":"_88d3dc5e"};
|
|
1128
1477
|
|
|
1129
|
-
var
|
|
1130
|
-
|
|
1478
|
+
var _excluded$m = ["color", "variant"],
|
|
1479
|
+
_excluded2$1 = ["children", "space"],
|
|
1480
|
+
_excluded3 = ["color", "variant"],
|
|
1481
|
+
_excluded4 = ["children", "id", "as", "render"],
|
|
1482
|
+
_excluded5 = ["color", "variant"];
|
|
1483
|
+
var TabsContext = /*#__PURE__*/React.createContext(null);
|
|
1484
|
+
/**
|
|
1485
|
+
* Used to group components that compose a set of tabs. There can only be one active tab within the same `<Tabs>` group.
|
|
1486
|
+
*/
|
|
1131
1487
|
|
|
1132
|
-
function
|
|
1133
|
-
var
|
|
1488
|
+
function Tabs(_ref) {
|
|
1489
|
+
var children = _ref.children,
|
|
1490
|
+
selectedId = _ref.selectedId,
|
|
1491
|
+
_ref$color = _ref.color,
|
|
1492
|
+
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
1493
|
+
_ref$variant = _ref.variant,
|
|
1494
|
+
variant = _ref$variant === void 0 ? 'normal' : _ref$variant;
|
|
1495
|
+
var tabState = Tab$1.useTabState({
|
|
1496
|
+
selectedId: selectedId
|
|
1497
|
+
});
|
|
1498
|
+
var previousSelectedId = usePrevious(selectedId);
|
|
1499
|
+
var actualSelectedId = tabState.selectedId,
|
|
1500
|
+
select = tabState.select;
|
|
1501
|
+
React.useEffect(function selectTab() {
|
|
1502
|
+
if (previousSelectedId !== selectedId && selectedId !== actualSelectedId && selectedId !== undefined) {
|
|
1503
|
+
select(selectedId);
|
|
1504
|
+
}
|
|
1505
|
+
}, [selectedId, actualSelectedId, select, previousSelectedId]);
|
|
1506
|
+
var memoizedTabState = React.useMemo(function memoizeTabState() {
|
|
1507
|
+
return _objectSpread2(_objectSpread2({}, tabState), {}, {
|
|
1508
|
+
color: color,
|
|
1509
|
+
variant: variant
|
|
1510
|
+
});
|
|
1511
|
+
}, // There is no guarantee that useTabState returns a stable object when there are no changes, so
|
|
1512
|
+
// following reakit/Tab's example we only return a new objet when any of its values have changed
|
|
1513
|
+
// eslint-disable-next-line
|
|
1514
|
+
[color, variant].concat(Object.values(tabState)));
|
|
1515
|
+
return /*#__PURE__*/React.createElement(TabsContext.Provider, {
|
|
1516
|
+
value: memoizedTabState
|
|
1517
|
+
}, children);
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Represents the individual tab elements within the group. Each `<Tab>` must have a corresponding `<TabPanel>` component.
|
|
1521
|
+
*/
|
|
1522
|
+
|
|
1523
|
+
function Tab(_ref2) {
|
|
1524
|
+
var children = _ref2.children,
|
|
1525
|
+
id = _ref2.id;
|
|
1526
|
+
var tabContextValue = React.useContext(TabsContext);
|
|
1527
|
+
|
|
1528
|
+
if (!tabContextValue) {
|
|
1529
|
+
return null;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
var color = tabContextValue.color,
|
|
1533
|
+
variant = tabContextValue.variant,
|
|
1534
|
+
tabState = _objectWithoutPropertiesLoose(tabContextValue, _excluded$m);
|
|
1535
|
+
|
|
1536
|
+
return /*#__PURE__*/React.createElement(Tab$1.Tab, Object.assign({
|
|
1537
|
+
className: classNames(modules_40c67f5b.tab, modules_40c67f5b["tab-" + (variant !== null && variant !== void 0 ? variant : '')], modules_40c67f5b["tab-" + (color !== null && color !== void 0 ? color : '')]),
|
|
1538
|
+
id: id
|
|
1539
|
+
}, tabState), children);
|
|
1540
|
+
}
|
|
1541
|
+
/**
|
|
1542
|
+
* A component used to group `<Tab>` elements together.
|
|
1543
|
+
*/
|
|
1544
|
+
|
|
1545
|
+
function TabList(_ref3) {
|
|
1546
|
+
var children = _ref3.children,
|
|
1547
|
+
_ref3$space = _ref3.space,
|
|
1548
|
+
space = _ref3$space === void 0 ? 'medium' : _ref3$space,
|
|
1549
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$1);
|
|
1550
|
+
|
|
1551
|
+
var tabContextValue = React.useContext(TabsContext);
|
|
1552
|
+
|
|
1553
|
+
if (!tabContextValue) {
|
|
1554
|
+
return null;
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
var tabState = _objectWithoutPropertiesLoose(tabContextValue, _excluded3);
|
|
1558
|
+
|
|
1559
|
+
return /*#__PURE__*/React.createElement(Tab$1.TabList, Object.assign({}, props, tabState), /*#__PURE__*/React.createElement(Inline, {
|
|
1560
|
+
space: space
|
|
1561
|
+
}, children));
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* Used to define the content to be rendered when a tab is active. Each `<TabPanel>` must have a corresponding `<Tab>` component.
|
|
1565
|
+
*/
|
|
1566
|
+
|
|
1567
|
+
var TabPanel = /*#__PURE__*/polymorphicComponent(function TabPanel(_ref4, ref) {
|
|
1568
|
+
var children = _ref4.children,
|
|
1569
|
+
id = _ref4.id,
|
|
1570
|
+
as = _ref4.as,
|
|
1571
|
+
_ref4$render = _ref4.render,
|
|
1572
|
+
render = _ref4$render === void 0 ? 'always' : _ref4$render,
|
|
1573
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
1574
|
+
|
|
1575
|
+
var tabContextValue = React.useContext(TabsContext);
|
|
1576
|
+
|
|
1577
|
+
var _React$useState = React.useState(false),
|
|
1578
|
+
tabRendered = _React$useState[0],
|
|
1579
|
+
setTabRendered = _React$useState[1];
|
|
1580
|
+
|
|
1581
|
+
var tabIsActive = (tabContextValue === null || tabContextValue === void 0 ? void 0 : tabContextValue.selectedId) === id;
|
|
1582
|
+
React.useEffect(function trackTabRenderedState() {
|
|
1583
|
+
if (!tabRendered && tabIsActive) {
|
|
1584
|
+
setTabRendered(true);
|
|
1585
|
+
}
|
|
1586
|
+
}, [tabRendered, tabIsActive]);
|
|
1587
|
+
|
|
1588
|
+
if (!tabContextValue) {
|
|
1589
|
+
return null;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
var tabState = _objectWithoutPropertiesLoose(tabContextValue, _excluded5);
|
|
1593
|
+
|
|
1594
|
+
return /*#__PURE__*/React.createElement(Tab$1.TabPanel, Object.assign({
|
|
1595
|
+
tabId: id
|
|
1596
|
+
}, tabState, props, {
|
|
1597
|
+
as: as,
|
|
1598
|
+
ref: ref
|
|
1599
|
+
}), render === 'always' ? children : null, render === 'active' && tabIsActive ? children : null, render === 'lazy' && (tabIsActive || tabRendered) ? children : null);
|
|
1600
|
+
});
|
|
1601
|
+
/**
|
|
1602
|
+
* Allows content to be rendered based on the current tab being selected while outside of the TabPanel
|
|
1603
|
+
* component. Can be placed freely within the main `<Tabs>` component.
|
|
1604
|
+
*/
|
|
1605
|
+
|
|
1606
|
+
function TabAwareSlot(_ref5) {
|
|
1607
|
+
var children = _ref5.children;
|
|
1608
|
+
var tabContextValue = React.useContext(TabsContext);
|
|
1609
|
+
return tabContextValue ? children({
|
|
1610
|
+
selectedId: tabContextValue.selectedId
|
|
1611
|
+
}) : null;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
var modules_8f59d13b = {"reach-portal":"dddb40c3","fadein":"_955f2d73","fitContent":"_95c7550e","container":"_88079712","full":"_4779d078","large":"_5fd86231","medium":"bdfb5931","small":"_4e848a11","xlarge":"d673fba2","overlay":"ea9ae0cc","expand":"a8bf8a4f","buttonContainer":"_44d6850e"};
|
|
1615
|
+
|
|
1616
|
+
var _excluded$n = ["isOpen", "onDismiss", "height", "width", "exceptionallySetClassName", "autoFocus", "children"],
|
|
1617
|
+
_excluded2$2 = ["children", "button", "withDivider", "exceptionallySetClassName"],
|
|
1618
|
+
_excluded3$1 = ["exceptionallySetClassName", "children"],
|
|
1619
|
+
_excluded4$1 = ["exceptionallySetClassName", "withDivider"],
|
|
1620
|
+
_excluded5$1 = ["children"];
|
|
1621
|
+
var ModalContext = /*#__PURE__*/React.createContext({
|
|
1622
|
+
onDismiss: undefined,
|
|
1623
|
+
height: 'fitContent'
|
|
1624
|
+
});
|
|
1625
|
+
|
|
1626
|
+
function isNotInternalFrame(element) {
|
|
1627
|
+
return !(element.ownerDocument === document && element.tagName.toLowerCase() === 'iframe');
|
|
1628
|
+
}
|
|
1629
|
+
/**
|
|
1630
|
+
* Renders a modal that sits on top of the rest of the content in the entire page.
|
|
1631
|
+
*
|
|
1632
|
+
* Follows the WAI-ARIA Dialog (Modal) Pattern.
|
|
1633
|
+
*
|
|
1634
|
+
* @see ModalHeader
|
|
1635
|
+
* @see ModalFooter
|
|
1636
|
+
* @see ModalBody
|
|
1637
|
+
*/
|
|
1638
|
+
|
|
1639
|
+
|
|
1640
|
+
function Modal(_ref) {
|
|
1641
|
+
var isOpen = _ref.isOpen,
|
|
1642
|
+
onDismiss = _ref.onDismiss,
|
|
1643
|
+
_ref$height = _ref.height,
|
|
1644
|
+
height = _ref$height === void 0 ? 'fitContent' : _ref$height,
|
|
1645
|
+
_ref$width = _ref.width,
|
|
1646
|
+
width = _ref$width === void 0 ? 'medium' : _ref$width,
|
|
1647
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
1648
|
+
_ref$autoFocus = _ref.autoFocus,
|
|
1649
|
+
autoFocus = _ref$autoFocus === void 0 ? true : _ref$autoFocus,
|
|
1650
|
+
children = _ref.children,
|
|
1651
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
1652
|
+
|
|
1653
|
+
var contextValue = React.useMemo(function () {
|
|
1654
|
+
return {
|
|
1655
|
+
onDismiss: onDismiss,
|
|
1656
|
+
height: height
|
|
1657
|
+
};
|
|
1658
|
+
}, [onDismiss, height]);
|
|
1659
|
+
return /*#__PURE__*/React.createElement(dialog.DialogOverlay, {
|
|
1660
|
+
isOpen: isOpen,
|
|
1661
|
+
onDismiss: onDismiss,
|
|
1662
|
+
dangerouslyBypassFocusLock // We're setting up our own focus lock below
|
|
1663
|
+
: true,
|
|
1664
|
+
className: classNames(modules_8f59d13b.overlay, modules_8f59d13b[height], modules_8f59d13b[width]),
|
|
1665
|
+
"data-testid": "modal-overlay"
|
|
1666
|
+
}, /*#__PURE__*/React.createElement(FocusLock, {
|
|
1667
|
+
autoFocus: autoFocus,
|
|
1668
|
+
whiteList: isNotInternalFrame
|
|
1669
|
+
}, /*#__PURE__*/React.createElement(dialog.DialogContent, Object.assign({}, props, {
|
|
1670
|
+
as: Box,
|
|
1671
|
+
borderRadius: "full",
|
|
1672
|
+
background: "default",
|
|
1673
|
+
display: "flex",
|
|
1674
|
+
flexDirection: "column",
|
|
1675
|
+
overflow: "hidden",
|
|
1676
|
+
height: height === 'expand' ? 'full' : undefined,
|
|
1677
|
+
flexGrow: height === 'expand' ? 1 : 0,
|
|
1678
|
+
className: [exceptionallySetClassName, modules_8f59d13b.container]
|
|
1679
|
+
}), /*#__PURE__*/React.createElement(ModalContext.Provider, {
|
|
1680
|
+
value: contextValue
|
|
1681
|
+
}, children))));
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* The close button rendered by ModalHeader. Provided independently so that consumers can customize
|
|
1685
|
+
* the button's label.
|
|
1686
|
+
*
|
|
1687
|
+
* @see ModalHeader
|
|
1688
|
+
*/
|
|
1689
|
+
|
|
1690
|
+
function ModalCloseButton(props) {
|
|
1691
|
+
var _React$useContext = React.useContext(ModalContext),
|
|
1692
|
+
onDismiss = _React$useContext.onDismiss;
|
|
1693
|
+
|
|
1694
|
+
return /*#__PURE__*/React.createElement(Button, Object.assign({}, props, {
|
|
1695
|
+
variant: "quaternary",
|
|
1696
|
+
onClick: onDismiss,
|
|
1697
|
+
icon: /*#__PURE__*/React.createElement(CloseIcon, null)
|
|
1698
|
+
}));
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* Renders a standard modal header area with an optional close button.
|
|
1702
|
+
*
|
|
1703
|
+
* @see Modal
|
|
1704
|
+
* @see ModalFooter
|
|
1705
|
+
* @see ModalBody
|
|
1706
|
+
*/
|
|
1707
|
+
|
|
1708
|
+
function ModalHeader(_ref2) {
|
|
1709
|
+
var children = _ref2.children,
|
|
1710
|
+
_ref2$button = _ref2.button,
|
|
1711
|
+
button = _ref2$button === void 0 ? true : _ref2$button,
|
|
1712
|
+
_ref2$withDivider = _ref2.withDivider,
|
|
1713
|
+
withDivider = _ref2$withDivider === void 0 ? false : _ref2$withDivider,
|
|
1714
|
+
exceptionallySetClassName = _ref2.exceptionallySetClassName,
|
|
1715
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$2);
|
|
1716
|
+
|
|
1717
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
1718
|
+
as: "header",
|
|
1719
|
+
paddingLeft: "large",
|
|
1720
|
+
paddingRight: "small",
|
|
1721
|
+
paddingY: "small",
|
|
1722
|
+
className: exceptionallySetClassName
|
|
1723
|
+
}), /*#__PURE__*/React.createElement(Columns, {
|
|
1724
|
+
space: "large",
|
|
1725
|
+
alignY: "center"
|
|
1726
|
+
}, /*#__PURE__*/React.createElement(Column, {
|
|
1727
|
+
width: "auto"
|
|
1728
|
+
}, children), /*#__PURE__*/React.createElement(Column, {
|
|
1729
|
+
width: "content",
|
|
1730
|
+
exceptionallySetClassName: modules_8f59d13b.buttonContainer
|
|
1731
|
+
}, typeof button !== 'boolean' ? button : button === true ? /*#__PURE__*/React.createElement(ModalCloseButton, {
|
|
1732
|
+
"aria-label": "Close modal"
|
|
1733
|
+
}) : null))), withDivider ? /*#__PURE__*/React.createElement(Divider, null) : null);
|
|
1734
|
+
}
|
|
1735
|
+
/**
|
|
1736
|
+
* Renders the body of a modal.
|
|
1737
|
+
*
|
|
1738
|
+
* Convenient to use alongside ModalHeader and/or ModalFooter as needed. It ensures, among other
|
|
1739
|
+
* things, that the contet of the modal body expands or contracts depending on the modal height
|
|
1740
|
+
* setting or the size of the content. The body content also automatically scrolls when it's too
|
|
1741
|
+
* large to fit the available space.
|
|
1742
|
+
*
|
|
1743
|
+
* @see Modal
|
|
1744
|
+
* @see ModalHeader
|
|
1745
|
+
* @see ModalFooter
|
|
1746
|
+
*/
|
|
1747
|
+
|
|
1748
|
+
function ModalBody(_ref3) {
|
|
1749
|
+
var exceptionallySetClassName = _ref3.exceptionallySetClassName,
|
|
1750
|
+
children = _ref3.children,
|
|
1751
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded3$1);
|
|
1752
|
+
|
|
1753
|
+
var _React$useContext2 = React.useContext(ModalContext),
|
|
1754
|
+
height = _React$useContext2.height;
|
|
1755
|
+
|
|
1756
|
+
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
1757
|
+
className: exceptionallySetClassName,
|
|
1758
|
+
flexGrow: height === 'expand' ? 1 : 0,
|
|
1759
|
+
height: height === 'expand' ? 'full' : undefined,
|
|
1760
|
+
overflow: "auto"
|
|
1761
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
1762
|
+
padding: "large",
|
|
1763
|
+
paddingBottom: "xxlarge"
|
|
1764
|
+
}, children));
|
|
1765
|
+
}
|
|
1766
|
+
/**
|
|
1767
|
+
* Renders a standard modal footer area.
|
|
1768
|
+
*
|
|
1769
|
+
* @see Modal
|
|
1770
|
+
* @see ModalHeader
|
|
1771
|
+
* @see ModalBody
|
|
1772
|
+
*/
|
|
1773
|
+
|
|
1774
|
+
function ModalFooter(_ref4) {
|
|
1775
|
+
var exceptionallySetClassName = _ref4.exceptionallySetClassName,
|
|
1776
|
+
_ref4$withDivider = _ref4.withDivider,
|
|
1777
|
+
withDivider = _ref4$withDivider === void 0 ? false : _ref4$withDivider,
|
|
1778
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded4$1);
|
|
1779
|
+
|
|
1780
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, withDivider ? /*#__PURE__*/React.createElement(Divider, null) : null, /*#__PURE__*/React.createElement(Box, Object.assign({
|
|
1781
|
+
as: "footer"
|
|
1782
|
+
}, props, {
|
|
1783
|
+
className: exceptionallySetClassName,
|
|
1784
|
+
padding: "large"
|
|
1785
|
+
})));
|
|
1786
|
+
} //
|
|
1787
|
+
// ModalActions
|
|
1788
|
+
//
|
|
1789
|
+
|
|
1790
|
+
/**
|
|
1791
|
+
* A specific version of the ModalFooter, tailored to showing an inline list of actions (buttons).
|
|
1792
|
+
* @see ModalFooter
|
|
1793
|
+
*/
|
|
1794
|
+
|
|
1795
|
+
function ModalActions(_ref5) {
|
|
1796
|
+
var children = _ref5.children,
|
|
1797
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded5$1);
|
|
1798
|
+
|
|
1799
|
+
return /*#__PURE__*/React.createElement(ModalFooter, Object.assign({}, props), /*#__PURE__*/React.createElement(Inline, {
|
|
1800
|
+
align: "right",
|
|
1801
|
+
space: "large"
|
|
1802
|
+
}, React.Children.map(children, function (child) {
|
|
1803
|
+
return /*#__PURE__*/React.createElement("div", null, child);
|
|
1804
|
+
})));
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
function getInitials(name) {
|
|
1808
|
+
if (!name) {
|
|
1809
|
+
return '';
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
var seed = name.trim().split(' ');
|
|
1813
|
+
var firstInitial = seed[0];
|
|
1814
|
+
var lastInitial = seed[seed.length - 1];
|
|
1815
|
+
var initials = firstInitial[0]; // Better readable this way.
|
|
1816
|
+
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
|
|
1817
|
+
|
|
1818
|
+
if (firstInitial[0] !== lastInitial[0]) {
|
|
1819
|
+
initials += lastInitial[0];
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
return initials.toUpperCase();
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
function emailToIndex(email, maxIndex) {
|
|
1826
|
+
var seed = email.split('@')[0];
|
|
1827
|
+
var hash = seed.charCodeAt(0) + seed.charCodeAt(seed.length - 1) || 0;
|
|
1828
|
+
return hash % maxIndex;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
var AVATAR_COLORS = ['#fcc652', '#e9952c', '#e16b2d', '#d84b40', '#e8435a', '#e5198a', '#ad3889', '#86389c', '#a8a8a8', '#98be2f', '#5d9d50', '#5f9f85', '#5bbcb6', '#32a3bf', '#2bafeb', '#2d88c3', '#3863cc', '#5e5e5e'];
|
|
1832
|
+
var AVATAR_SIZES = ['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'xxxl'];
|
|
1833
|
+
|
|
1834
|
+
function Avatar(_ref) {
|
|
1835
|
+
var user = _ref.user,
|
|
1134
1836
|
avatarUrl = _ref.avatarUrl,
|
|
1135
1837
|
_ref$size = _ref.size,
|
|
1136
1838
|
size = _ref$size === void 0 ? 'l' : _ref$size,
|
|
@@ -1154,7 +1856,34 @@ function Avatar(_ref) {
|
|
|
1154
1856
|
|
|
1155
1857
|
Avatar.displayName = 'Avatar';
|
|
1156
1858
|
|
|
1157
|
-
|
|
1859
|
+
function Checkbox(_ref) {
|
|
1860
|
+
var label = _ref.label,
|
|
1861
|
+
disabled = _ref.disabled,
|
|
1862
|
+
_ref$checked = _ref.checked,
|
|
1863
|
+
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
1864
|
+
onChange = _ref.onChange;
|
|
1865
|
+
return /*#__PURE__*/React__default.createElement("label", {
|
|
1866
|
+
className: "reactist_checkbox"
|
|
1867
|
+
}, /*#__PURE__*/React__default.createElement("input", {
|
|
1868
|
+
className: "reactist_checkbox--input",
|
|
1869
|
+
value: label,
|
|
1870
|
+
checked: checked,
|
|
1871
|
+
disabled: disabled,
|
|
1872
|
+
onChange: disabled || !onChange ? undefined : function (event) {
|
|
1873
|
+
return onChange(event.target.checked);
|
|
1874
|
+
},
|
|
1875
|
+
type: "checkbox"
|
|
1876
|
+
}), label);
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
Checkbox.displayName = 'Checkbox';
|
|
1880
|
+
|
|
1881
|
+
var _excluded$o = ["type", "variant", "size", "loading", "disabled", "tooltip", "onClick", "children"];
|
|
1882
|
+
/**
|
|
1883
|
+
* @deprecated
|
|
1884
|
+
*/
|
|
1885
|
+
|
|
1886
|
+
var Button$1 = /*#__PURE__*/React__default.forwardRef(function Button(_ref, ref) {
|
|
1158
1887
|
var _ref$type = _ref.type,
|
|
1159
1888
|
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
1160
1889
|
variant = _ref.variant,
|
|
@@ -1167,7 +1896,7 @@ var Button = /*#__PURE__*/React__default.forwardRef(function Button(_ref, ref) {
|
|
|
1167
1896
|
tooltip = _ref.tooltip,
|
|
1168
1897
|
onClick = _ref.onClick,
|
|
1169
1898
|
children = _ref.children,
|
|
1170
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
1899
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
1171
1900
|
|
|
1172
1901
|
var className = classNames('reactist_button', variant ? "reactist_button--" + variant : null, size !== 'default' ? "reactist_button--" + size : null, {
|
|
1173
1902
|
'reactist_button--loading': loading
|
|
@@ -1176,41 +1905,21 @@ var Button = /*#__PURE__*/React__default.forwardRef(function Button(_ref, ref) {
|
|
|
1176
1905
|
ref: ref,
|
|
1177
1906
|
type: type,
|
|
1178
1907
|
className: className,
|
|
1179
|
-
disabled: disabled || loading,
|
|
1180
|
-
onClick: onClick
|
|
1908
|
+
"aria-disabled": disabled || loading,
|
|
1909
|
+
onClick: disabled || loading ? undefined : onClick
|
|
1181
1910
|
}), children);
|
|
1182
1911
|
return tooltip ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
1183
1912
|
content: tooltip
|
|
1184
1913
|
}, button) : button;
|
|
1185
1914
|
});
|
|
1186
|
-
Button.displayName = 'Button';
|
|
1187
|
-
Button.defaultProps = {
|
|
1915
|
+
Button$1.displayName = 'Button';
|
|
1916
|
+
Button$1.defaultProps = {
|
|
1188
1917
|
size: 'default',
|
|
1189
1918
|
loading: false,
|
|
1190
1919
|
disabled: false
|
|
1191
1920
|
};
|
|
1192
1921
|
|
|
1193
|
-
|
|
1194
|
-
var label = _ref.label,
|
|
1195
|
-
disabled = _ref.disabled,
|
|
1196
|
-
_ref$checked = _ref.checked,
|
|
1197
|
-
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
1198
|
-
onChange = _ref.onChange;
|
|
1199
|
-
return /*#__PURE__*/React__default.createElement("label", {
|
|
1200
|
-
className: "reactist_checkbox"
|
|
1201
|
-
}, /*#__PURE__*/React__default.createElement("input", {
|
|
1202
|
-
className: "reactist_checkbox--input",
|
|
1203
|
-
value: label,
|
|
1204
|
-
checked: checked,
|
|
1205
|
-
disabled: disabled,
|
|
1206
|
-
onChange: disabled || !onChange ? undefined : function (event) {
|
|
1207
|
-
return onChange(event.target.checked);
|
|
1208
|
-
},
|
|
1209
|
-
type: "checkbox"
|
|
1210
|
-
}), label);
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
Checkbox.displayName = 'Checkbox';
|
|
1922
|
+
var _excluded$p = ["children", "onClick", "tooltip", "className"];
|
|
1214
1923
|
|
|
1215
1924
|
var Box$1 = /*#__PURE__*/function (_React$Component) {
|
|
1216
1925
|
_inheritsLoose(Box, _React$Component);
|
|
@@ -1302,7 +2011,9 @@ var Box$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
1302
2011
|
};
|
|
1303
2012
|
|
|
1304
2013
|
_proto._getTriggerComponent = function _getTriggerComponent() {
|
|
1305
|
-
var
|
|
2014
|
+
var _this$props$children;
|
|
2015
|
+
|
|
2016
|
+
var _trigger = (_this$props$children = this.props.children) === null || _this$props$children === void 0 ? void 0 : _this$props$children[0];
|
|
1306
2017
|
|
|
1307
2018
|
return _trigger ? /*#__PURE__*/React__default.cloneElement(_trigger, {
|
|
1308
2019
|
onClick: this._toggleShowBody
|
|
@@ -1330,7 +2041,7 @@ var Box$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
1330
2041
|
top: top,
|
|
1331
2042
|
bottom: !top
|
|
1332
2043
|
});
|
|
1333
|
-
var body = children
|
|
2044
|
+
var body = children === null || children === void 0 ? void 0 : children[1];
|
|
1334
2045
|
var contentMarkup = typeof body === 'function' ? body(props) : body ? /*#__PURE__*/React__default.cloneElement(body, props) : undefined;
|
|
1335
2046
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
1336
2047
|
className: className,
|
|
@@ -1360,7 +2071,7 @@ var Trigger = /*#__PURE__*/React__default.forwardRef(function Trigger(_ref, ref)
|
|
|
1360
2071
|
onClick = _ref.onClick,
|
|
1361
2072
|
tooltip = _ref.tooltip,
|
|
1362
2073
|
className = _ref.className,
|
|
1363
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
2074
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
1364
2075
|
|
|
1365
2076
|
function handleClick(event) {
|
|
1366
2077
|
event.preventDefault();
|
|
@@ -1368,7 +2079,7 @@ var Trigger = /*#__PURE__*/React__default.forwardRef(function Trigger(_ref, ref)
|
|
|
1368
2079
|
if (onClick) onClick(event);
|
|
1369
2080
|
}
|
|
1370
2081
|
|
|
1371
|
-
return /*#__PURE__*/React__default.createElement(Button, Object.assign({}, props, {
|
|
2082
|
+
return /*#__PURE__*/React__default.createElement(Button$1, Object.assign({}, props, {
|
|
1372
2083
|
className: classNames('trigger', className),
|
|
1373
2084
|
onClick: handleClick,
|
|
1374
2085
|
tooltip: tooltip,
|
|
@@ -1476,7 +2187,7 @@ function ColorItem(_ref2) {
|
|
|
1476
2187
|
backgroundColor: color
|
|
1477
2188
|
},
|
|
1478
2189
|
onClick: function onClick() {
|
|
1479
|
-
return _onClick
|
|
2190
|
+
return _onClick === null || _onClick === void 0 ? void 0 : _onClick(colorIndex);
|
|
1480
2191
|
}
|
|
1481
2192
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
1482
2193
|
className: "color_item--inner_ring"
|
|
@@ -1503,10 +2214,12 @@ var ErrorMessage = /*#__PURE__*/function (_React$Component) {
|
|
|
1503
2214
|
_this._triggerDelayedHide = function () {
|
|
1504
2215
|
_this._clearTimeout();
|
|
1505
2216
|
|
|
1506
|
-
|
|
2217
|
+
setTimeout(_this._hide, _this.props.timeout);
|
|
1507
2218
|
};
|
|
1508
2219
|
|
|
1509
2220
|
_this._hide = function () {
|
|
2221
|
+
var _this$props$onHide, _this$props;
|
|
2222
|
+
|
|
1510
2223
|
_this._clearTimeout();
|
|
1511
2224
|
|
|
1512
2225
|
_this.setState(function () {
|
|
@@ -1515,7 +2228,7 @@ var ErrorMessage = /*#__PURE__*/function (_React$Component) {
|
|
|
1515
2228
|
};
|
|
1516
2229
|
});
|
|
1517
2230
|
|
|
1518
|
-
_this.props.onHide
|
|
2231
|
+
(_this$props$onHide = (_this$props = _this.props).onHide) === null || _this$props$onHide === void 0 ? void 0 : _this$props$onHide.call(_this$props);
|
|
1519
2232
|
};
|
|
1520
2233
|
|
|
1521
2234
|
var isValidMessage = _this._isValidMessage(props.message);
|
|
@@ -1703,6 +2416,7 @@ var Input = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
1703
2416
|
});
|
|
1704
2417
|
Input.displayName = 'Input';
|
|
1705
2418
|
|
|
2419
|
+
var _excluded$q = ["children", "className", "translateKey", "isMac"];
|
|
1706
2420
|
// Support for setting up how to translate modifiers globally.
|
|
1707
2421
|
//
|
|
1708
2422
|
|
|
@@ -1750,7 +2464,7 @@ function hasModifiers(str) {
|
|
|
1750
2464
|
}
|
|
1751
2465
|
|
|
1752
2466
|
function isSpecialKey(str) {
|
|
1753
|
-
return /^(mod|cmd|ctrl|control|alt|shift|space)$/i.test(str);
|
|
2467
|
+
return /^(mod|cmd|ctrl|control|alt|shift|space|super)$/i.test(str);
|
|
1754
2468
|
}
|
|
1755
2469
|
|
|
1756
2470
|
function parseKeys(shortcut, isMac, translateKey) {
|
|
@@ -1778,13 +2492,15 @@ function parseKeys(shortcut, isMac, translateKey) {
|
|
|
1778
2492
|
}
|
|
1779
2493
|
|
|
1780
2494
|
function KeyboardShortcut(_ref) {
|
|
2495
|
+
var _navigator$platform$t, _navigator$platform;
|
|
2496
|
+
|
|
1781
2497
|
var children = _ref.children,
|
|
1782
2498
|
className = _ref.className,
|
|
1783
2499
|
_ref$translateKey = _ref.translateKey,
|
|
1784
2500
|
translateKey = _ref$translateKey === void 0 ? globalTranslateKey : _ref$translateKey,
|
|
1785
2501
|
_ref$isMac = _ref.isMac,
|
|
1786
|
-
isMac = _ref$isMac === void 0 ? navigator.platform
|
|
1787
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
2502
|
+
isMac = _ref$isMac === void 0 ? (_navigator$platform$t = (_navigator$platform = navigator.platform) === null || _navigator$platform === void 0 ? void 0 : _navigator$platform.toUpperCase().includes('MAC')) !== null && _navigator$platform$t !== void 0 ? _navigator$platform$t : false : _ref$isMac,
|
|
2503
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
1788
2504
|
|
|
1789
2505
|
var shortcuts = typeof children === 'string' ? [children] : children;
|
|
1790
2506
|
return /*#__PURE__*/React.createElement("span", Object.assign({
|
|
@@ -1981,314 +2697,36 @@ function KeyCapturer(props) {
|
|
|
1981
2697
|
return /*#__PURE__*/React__default.cloneElement(children, _objectSpread2((_objectSpread2$1 = {}, _objectSpread2$1[eventName] = handleKeyEvent, _objectSpread2$1), composingEventHandlers));
|
|
1982
2698
|
}
|
|
1983
2699
|
|
|
1984
|
-
function
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
_ref$bgColor = _ref.bgColor,
|
|
1989
|
-
bgColor = _ref$bgColor === void 0 ? '#D9E6FB' : _ref$bgColor,
|
|
1990
|
-
_ref$size = _ref.size,
|
|
1991
|
-
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
1992
|
-
_ref$ariaLabel = _ref['aria-label'],
|
|
1993
|
-
ariaLabel = _ref$ariaLabel === void 0 ? 'Loading' : _ref$ariaLabel;
|
|
1994
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
1995
|
-
className: classNames('reactist_loading', className),
|
|
1996
|
-
"aria-label": ariaLabel,
|
|
1997
|
-
"aria-live": "assertive",
|
|
1998
|
-
role: "alert"
|
|
1999
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
2000
|
-
className: "reactist_loading--spinner"
|
|
2001
|
-
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
2002
|
-
width: size,
|
|
2003
|
-
height: size,
|
|
2004
|
-
viewBox: '0 0 24 24'
|
|
2005
|
-
}, /*#__PURE__*/React__default.createElement("g", {
|
|
2006
|
-
fill: "none",
|
|
2007
|
-
fillRule: "nonzero"
|
|
2008
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
2009
|
-
fill: spinnerColor,
|
|
2010
|
-
d: "M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z"
|
|
2011
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
2012
|
-
fill: bgColor,
|
|
2013
|
-
d: "M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z"
|
|
2014
|
-
})))));
|
|
2015
|
-
}
|
|
2016
|
-
|
|
2017
|
-
Loading.displayName = 'Loading';
|
|
2700
|
+
var hasEnoughSpace = function hasEnoughSpace(windowDimensions, elementDimensions, wrapperDimensions, wrapperPosition, position, gap) {
|
|
2701
|
+
if (gap === void 0) {
|
|
2702
|
+
gap = 0;
|
|
2703
|
+
}
|
|
2018
2704
|
|
|
2019
|
-
var
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
d: "M11.293 12L5.146 5.854a.5.5 0 1 1 .708-.708L12 11.293l6.146-6.147a.5.5 0 0 1 .708.708L12.707 12l6.147 6.146a.5.5 0 0 1-.708.708L12 12.707l-6.146 6.147a.5.5 0 0 1-.708-.708L11.293 12z"
|
|
2028
|
-
}));
|
|
2029
|
-
};
|
|
2705
|
+
var windowHeight = windowDimensions.height,
|
|
2706
|
+
windowWidth = windowDimensions.width;
|
|
2707
|
+
var elementHeight = elementDimensions.height,
|
|
2708
|
+
elementWidth = elementDimensions.width;
|
|
2709
|
+
var wrapperHeight = wrapperDimensions.height,
|
|
2710
|
+
wrapperWidth = wrapperDimensions.width;
|
|
2711
|
+
var wrapperX = wrapperPosition.x,
|
|
2712
|
+
wrapperY = wrapperPosition.y;
|
|
2030
2713
|
|
|
2031
|
-
var
|
|
2032
|
-
_inheritsLoose(Box, _React$Component);
|
|
2714
|
+
var verticalPosition = _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
2033
2715
|
|
|
2034
|
-
|
|
2035
|
-
var _this;
|
|
2716
|
+
var horizontalPosition = _calculateHorizontalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
2036
2717
|
|
|
2037
|
-
|
|
2718
|
+
var canPlaceVertically = verticalPosition >= 0 && verticalPosition + elementWidth <= windowWidth;
|
|
2719
|
+
var canPlaceHorizontally = horizontalPosition >= 0 && horizontalPosition + elementHeight <= windowHeight;
|
|
2038
2720
|
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
_this._closeModal();
|
|
2049
|
-
|
|
2050
|
-
if (event.preventDefault) event.preventDefault();
|
|
2051
|
-
}
|
|
2052
|
-
};
|
|
2053
|
-
|
|
2054
|
-
_this._handleOverlayClick = function (event) {
|
|
2055
|
-
if (event.target instanceof Element && (event.target.id === 'reactist-overlay' || event.target.id === 'reactist-overlay-inner')) {
|
|
2056
|
-
_this._closeModal();
|
|
2057
|
-
}
|
|
2058
|
-
};
|
|
2059
|
-
|
|
2060
|
-
return _this;
|
|
2061
|
-
}
|
|
2062
|
-
|
|
2063
|
-
var _proto = Box.prototype;
|
|
2064
|
-
|
|
2065
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
2066
|
-
window.addEventListener('keydown', this._handleKeyDown);
|
|
2067
|
-
};
|
|
2068
|
-
|
|
2069
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
2070
|
-
window.removeEventListener('keydown', this._handleKeyDown);
|
|
2071
|
-
};
|
|
2072
|
-
|
|
2073
|
-
_proto.render = function render() {
|
|
2074
|
-
var _this$props = this.props,
|
|
2075
|
-
large = _this$props.large,
|
|
2076
|
-
medium = _this$props.medium,
|
|
2077
|
-
style = _this$props.style,
|
|
2078
|
-
children = _this$props.children,
|
|
2079
|
-
closeOnOverlayClick = _this$props.closeOnOverlayClick;
|
|
2080
|
-
var className = classNames('reactist_modal_box', {
|
|
2081
|
-
large: large,
|
|
2082
|
-
medium: medium
|
|
2083
|
-
}, this.props.className);
|
|
2084
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
2085
|
-
className: "reactist_overlay",
|
|
2086
|
-
id: "reactist-overlay",
|
|
2087
|
-
onClick: closeOnOverlayClick ? this._handleOverlayClick : undefined
|
|
2088
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2089
|
-
className: "reactist_overlay_inner",
|
|
2090
|
-
id: "reactist-overlay-inner"
|
|
2091
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2092
|
-
style: style,
|
|
2093
|
-
className: className
|
|
2094
|
-
}, children)));
|
|
2095
|
-
};
|
|
2096
|
-
|
|
2097
|
-
return Box;
|
|
2098
|
-
}(React__default.Component);
|
|
2099
|
-
|
|
2100
|
-
Box$2.displayName = 'Modal.Box';
|
|
2101
|
-
Box$2.defaultProps = {
|
|
2102
|
-
large: false,
|
|
2103
|
-
closeOnOverlayClick: false
|
|
2104
|
-
};
|
|
2105
|
-
|
|
2106
|
-
var Header = /*#__PURE__*/function (_React$Component2) {
|
|
2107
|
-
_inheritsLoose(Header, _React$Component2);
|
|
2108
|
-
|
|
2109
|
-
function Header() {
|
|
2110
|
-
return _React$Component2.apply(this, arguments) || this;
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
|
-
var _proto2 = Header.prototype;
|
|
2114
|
-
|
|
2115
|
-
_proto2._closeModal = function _closeModal(event) {
|
|
2116
|
-
event.preventDefault();
|
|
2117
|
-
|
|
2118
|
-
if (typeof this.props.beforeClose === 'function') {
|
|
2119
|
-
this.props.beforeClose();
|
|
2120
|
-
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
var modalElement = document.getElementById('modal_box');
|
|
2124
|
-
ReactDOM.unmountComponentAtNode(modalElement);
|
|
2125
|
-
};
|
|
2126
|
-
|
|
2127
|
-
_proto2.render = function render() {
|
|
2128
|
-
return (
|
|
2129
|
-
/*#__PURE__*/
|
|
2130
|
-
|
|
2131
|
-
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
2132
|
-
React__default.createElement("div", {
|
|
2133
|
-
className: "reactist_modal_box__header"
|
|
2134
|
-
}, /*#__PURE__*/React__default.createElement("p", null, this.props.title && /*#__PURE__*/React__default.createElement("span", {
|
|
2135
|
-
className: "title"
|
|
2136
|
-
}, this.props.title), this.props.subtitle && /*#__PURE__*/React__default.createElement("span", {
|
|
2137
|
-
className: "subtitle"
|
|
2138
|
-
}, this.props.subtitle), this.props.children), /*#__PURE__*/React__default.createElement("a", {
|
|
2139
|
-
className: "close",
|
|
2140
|
-
onClick: this._closeModal.bind(this),
|
|
2141
|
-
href: "#"
|
|
2142
|
-
}, /*#__PURE__*/React__default.createElement(CloseIcon$1, null)))
|
|
2143
|
-
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
2144
|
-
|
|
2145
|
-
);
|
|
2146
|
-
};
|
|
2147
|
-
|
|
2148
|
-
return Header;
|
|
2149
|
-
}(React__default.Component);
|
|
2150
|
-
|
|
2151
|
-
Header.displayName = 'Modal.Header';
|
|
2152
|
-
|
|
2153
|
-
var Body$1 = /*#__PURE__*/function (_React$Component3) {
|
|
2154
|
-
_inheritsLoose(Body, _React$Component3);
|
|
2155
|
-
|
|
2156
|
-
function Body() {
|
|
2157
|
-
return _React$Component3.apply(this, arguments) || this;
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
|
-
var _proto3 = Body.prototype;
|
|
2161
|
-
|
|
2162
|
-
_proto3._closeModal = function _closeModal(event) {
|
|
2163
|
-
event.preventDefault(); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2164
|
-
|
|
2165
|
-
var modalElement = document.getElementById('modal_box');
|
|
2166
|
-
ReactDOM.unmountComponentAtNode(modalElement);
|
|
2167
|
-
};
|
|
2168
|
-
|
|
2169
|
-
_proto3.render = function render() {
|
|
2170
|
-
var _this$props2 = this.props,
|
|
2171
|
-
icon = _this$props2.icon,
|
|
2172
|
-
plain = _this$props2.plain,
|
|
2173
|
-
children = _this$props2.children,
|
|
2174
|
-
style = _this$props2.style,
|
|
2175
|
-
showCloseIcon = _this$props2.showCloseIcon;
|
|
2176
|
-
var className = classNames('reactist_modal_box__body', {
|
|
2177
|
-
plain: plain
|
|
2178
|
-
}, this.props.className);
|
|
2179
|
-
return (
|
|
2180
|
-
/*#__PURE__*/
|
|
2181
|
-
|
|
2182
|
-
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
2183
|
-
React__default.createElement("div", {
|
|
2184
|
-
className: className,
|
|
2185
|
-
style: style
|
|
2186
|
-
}, showCloseIcon && /*#__PURE__*/React__default.createElement("a", {
|
|
2187
|
-
className: "close",
|
|
2188
|
-
onClick: this._closeModal.bind(this),
|
|
2189
|
-
href: "#"
|
|
2190
|
-
}, /*#__PURE__*/React__default.createElement(CloseIcon$1, null)), icon ? /*#__PURE__*/React__default.createElement("div", {
|
|
2191
|
-
className: "dialog"
|
|
2192
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2193
|
-
className: "reactist_icon"
|
|
2194
|
-
}, icon), /*#__PURE__*/React__default.createElement("div", {
|
|
2195
|
-
className: "content"
|
|
2196
|
-
}, children)) : children)
|
|
2197
|
-
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
2198
|
-
|
|
2199
|
-
);
|
|
2200
|
-
};
|
|
2201
|
-
|
|
2202
|
-
return Body;
|
|
2203
|
-
}(React__default.Component);
|
|
2204
|
-
|
|
2205
|
-
Body$1.displayName = 'Modal.Body';
|
|
2206
|
-
Body$1.defaultProps = {
|
|
2207
|
-
showCloseIcon: false
|
|
2208
|
-
};
|
|
2209
|
-
|
|
2210
|
-
var Actions = /*#__PURE__*/function (_React$Component4) {
|
|
2211
|
-
_inheritsLoose(Actions, _React$Component4);
|
|
2212
|
-
|
|
2213
|
-
function Actions() {
|
|
2214
|
-
return _React$Component4.apply(this, arguments) || this;
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
var _proto4 = Actions.prototype;
|
|
2218
|
-
|
|
2219
|
-
_proto4._onClick = function _onClick(onClick) {
|
|
2220
|
-
if (onClick) {
|
|
2221
|
-
onClick();
|
|
2222
|
-
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
var modalElement = document.getElementById('modal_box');
|
|
2226
|
-
ReactDOM.unmountComponentAtNode(modalElement);
|
|
2227
|
-
};
|
|
2228
|
-
|
|
2229
|
-
_proto4.render = function render() {
|
|
2230
|
-
var _this2 = this;
|
|
2231
|
-
|
|
2232
|
-
var children = React__default.Children.map( // see: https://github.com/microsoft/TypeScript/issues/21699
|
|
2233
|
-
// @ts-expect-error Children cannot be typed properly yet in React
|
|
2234
|
-
this.props.children, function (child) {
|
|
2235
|
-
if (child && child.props && child.props.close) {
|
|
2236
|
-
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
2237
|
-
onClick: function onClick() {
|
|
2238
|
-
return _this2._onClick(child.props.onClick);
|
|
2239
|
-
}
|
|
2240
|
-
});
|
|
2241
|
-
} else {
|
|
2242
|
-
return child ? /*#__PURE__*/React__default.cloneElement(child) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
2243
|
-
}
|
|
2244
|
-
});
|
|
2245
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
2246
|
-
className: "reactist_modal_box__actions"
|
|
2247
|
-
}, children);
|
|
2248
|
-
};
|
|
2249
|
-
|
|
2250
|
-
return Actions;
|
|
2251
|
-
}(React__default.Component);
|
|
2252
|
-
|
|
2253
|
-
Actions.displayName = 'Modal.Actions';
|
|
2254
|
-
|
|
2255
|
-
var index = {
|
|
2256
|
-
Box: Box$2,
|
|
2257
|
-
Header: Header,
|
|
2258
|
-
Body: Body$1,
|
|
2259
|
-
Actions: Actions
|
|
2260
|
-
};
|
|
2261
|
-
|
|
2262
|
-
var hasEnoughSpace = function hasEnoughSpace(windowDimensions, elementDimensions, wrapperDimensions, wrapperPosition, position, gap) {
|
|
2263
|
-
if (gap === void 0) {
|
|
2264
|
-
gap = 0;
|
|
2265
|
-
}
|
|
2266
|
-
|
|
2267
|
-
var windowHeight = windowDimensions.height,
|
|
2268
|
-
windowWidth = windowDimensions.width;
|
|
2269
|
-
var elementHeight = elementDimensions.height,
|
|
2270
|
-
elementWidth = elementDimensions.width;
|
|
2271
|
-
var wrapperHeight = wrapperDimensions.height,
|
|
2272
|
-
wrapperWidth = wrapperDimensions.width;
|
|
2273
|
-
var wrapperX = wrapperPosition.x,
|
|
2274
|
-
wrapperY = wrapperPosition.y;
|
|
2275
|
-
|
|
2276
|
-
var verticalPosition = _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
2277
|
-
|
|
2278
|
-
var horizontalPosition = _calculateHorizontalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
2279
|
-
|
|
2280
|
-
var canPlaceVertically = verticalPosition >= 0 && verticalPosition + elementWidth <= windowWidth;
|
|
2281
|
-
var canPlaceHorizontally = horizontalPosition >= 0 && horizontalPosition + elementHeight <= windowHeight;
|
|
2282
|
-
|
|
2283
|
-
if (position === 'top') {
|
|
2284
|
-
return canPlaceVertically && wrapperY - elementHeight - gap >= 0;
|
|
2285
|
-
} else if (position === 'right') {
|
|
2286
|
-
return canPlaceHorizontally && wrapperX + wrapperWidth + elementWidth + gap <= windowWidth;
|
|
2287
|
-
} else if (position === 'left') {
|
|
2288
|
-
return canPlaceHorizontally && wrapperX - elementWidth - gap >= 0;
|
|
2289
|
-
} else if (position === 'bottom') {
|
|
2290
|
-
return canPlaceVertically && wrapperY + wrapperHeight + elementHeight + gap <= windowHeight;
|
|
2291
|
-
}
|
|
2721
|
+
if (position === 'top') {
|
|
2722
|
+
return canPlaceVertically && wrapperY - elementHeight - gap >= 0;
|
|
2723
|
+
} else if (position === 'right') {
|
|
2724
|
+
return canPlaceHorizontally && wrapperX + wrapperWidth + elementWidth + gap <= windowWidth;
|
|
2725
|
+
} else if (position === 'left') {
|
|
2726
|
+
return canPlaceHorizontally && wrapperX - elementWidth - gap >= 0;
|
|
2727
|
+
} else if (position === 'bottom') {
|
|
2728
|
+
return canPlaceVertically && wrapperY + wrapperHeight + elementHeight + gap <= windowHeight;
|
|
2729
|
+
}
|
|
2292
2730
|
|
|
2293
2731
|
return false;
|
|
2294
2732
|
};
|
|
@@ -2638,7 +3076,7 @@ function RangeInput(_ref) {
|
|
|
2638
3076
|
max: max,
|
|
2639
3077
|
step: stepSize,
|
|
2640
3078
|
onChange: function onChange(event) {
|
|
2641
|
-
return _onChange
|
|
3079
|
+
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(parseInt(event.target.value));
|
|
2642
3080
|
}
|
|
2643
3081
|
}), /*#__PURE__*/React__default.createElement("span", {
|
|
2644
3082
|
className: "range_btn plus",
|
|
@@ -2650,6 +3088,8 @@ function RangeInput(_ref) {
|
|
|
2650
3088
|
|
|
2651
3089
|
RangeInput.displayName = 'RangeInput';
|
|
2652
3090
|
|
|
3091
|
+
var _excluded$r = ["value", "options", "onChange", "disabled", "className", "defaultValue"];
|
|
3092
|
+
|
|
2653
3093
|
function Select(_ref) {
|
|
2654
3094
|
var value = _ref.value,
|
|
2655
3095
|
_ref$options = _ref.options,
|
|
@@ -2660,7 +3100,7 @@ function Select(_ref) {
|
|
|
2660
3100
|
_ref$className = _ref.className,
|
|
2661
3101
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
2662
3102
|
defaultValue = _ref.defaultValue,
|
|
2663
|
-
otherProps = _objectWithoutPropertiesLoose(_ref,
|
|
3103
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
2664
3104
|
|
|
2665
3105
|
var selectClassName = classNames('reactist_select', {
|
|
2666
3106
|
disabled: disabled
|
|
@@ -2673,7 +3113,7 @@ function Select(_ref) {
|
|
|
2673
3113
|
},
|
|
2674
3114
|
disabled: disabled,
|
|
2675
3115
|
defaultValue: defaultValue
|
|
2676
|
-
}, otherProps), options
|
|
3116
|
+
}, otherProps), options === null || options === void 0 ? void 0 : options.map(function (option) {
|
|
2677
3117
|
return /*#__PURE__*/React__default.createElement("option", {
|
|
2678
3118
|
key: option.key || option.value,
|
|
2679
3119
|
value: option.value,
|
|
@@ -2947,19 +3387,33 @@ Tip.defaultProps = {
|
|
|
2947
3387
|
top: false
|
|
2948
3388
|
};
|
|
2949
3389
|
|
|
2950
|
-
function
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
3390
|
+
var CloseIcon$1 = function CloseIcon() {
|
|
3391
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
3392
|
+
width: "24",
|
|
3393
|
+
height: "24",
|
|
3394
|
+
viewBox: "0 0 24 24"
|
|
3395
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
3396
|
+
fill: "gray",
|
|
3397
|
+
fillRule: "evenodd",
|
|
3398
|
+
d: "M11.293 12L5.146 5.854a.5.5 0 1 1 .708-.708L12 11.293l6.146-6.147a.5.5 0 0 1 .708.708L12.707 12l6.147 6.146a.5.5 0 0 1-.708.708L12 12.707l-6.146 6.147a.5.5 0 0 1-.708-.708L11.293 12z"
|
|
3399
|
+
}));
|
|
3400
|
+
};
|
|
3401
|
+
|
|
3402
|
+
var _excluded$s = ["id", "icon", "title", "subtitle", "children", "customCloseButton", "onClick", "onClose", "closeAltText", "className"];
|
|
3403
|
+
|
|
3404
|
+
function Notification(_ref) {
|
|
3405
|
+
var id = _ref.id,
|
|
3406
|
+
icon = _ref.icon,
|
|
3407
|
+
title = _ref.title,
|
|
3408
|
+
subtitle = _ref.subtitle,
|
|
3409
|
+
children = _ref.children,
|
|
3410
|
+
customCloseButton = _ref.customCloseButton,
|
|
3411
|
+
onClick = _ref.onClick,
|
|
2958
3412
|
onClose = _ref.onClose,
|
|
2959
3413
|
_ref$closeAltText = _ref.closeAltText,
|
|
2960
3414
|
closeAltText = _ref$closeAltText === void 0 ? 'Close' : _ref$closeAltText,
|
|
2961
3415
|
className = _ref.className,
|
|
2962
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
3416
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
2963
3417
|
|
|
2964
3418
|
var titleId = title ? id + "-title" : null;
|
|
2965
3419
|
var titleIdAttribute = titleId ? {
|
|
@@ -3008,128 +3462,17 @@ function Notification(_ref) {
|
|
|
3008
3462
|
}, customCloseButton !== null && customCloseButton !== void 0 ? customCloseButton : /*#__PURE__*/React__default.createElement(CloseIcon$1, null)) : null);
|
|
3009
3463
|
}
|
|
3010
3464
|
|
|
3011
|
-
var
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
activeTabIndex: i
|
|
3023
|
-
};
|
|
3024
|
-
});
|
|
3025
|
-
|
|
3026
|
-
if (_this.props.onChange) _this.props.onChange(tab.props.value);
|
|
3027
|
-
};
|
|
3028
|
-
|
|
3029
|
-
_this._renderTabLinks = function (tabs) {
|
|
3030
|
-
return tabs.map(function (t, i) {
|
|
3031
|
-
var _t$props = t.props,
|
|
3032
|
-
title = _t$props.title,
|
|
3033
|
-
disabled = _t$props.disabled;
|
|
3034
|
-
var value = t.props.value || i;
|
|
3035
|
-
var className = classNames('reactist_tabs__header--item', {
|
|
3036
|
-
disabled: disabled,
|
|
3037
|
-
active: i === _this.state.activeTabIndex
|
|
3038
|
-
});
|
|
3039
|
-
return (
|
|
3040
|
-
/*#__PURE__*/
|
|
3041
|
-
// eslint-disable-next-line jsx-a11y/anchor-is-valid
|
|
3042
|
-
React__default.createElement("a", {
|
|
3043
|
-
className: className,
|
|
3044
|
-
href: "",
|
|
3045
|
-
key: value,
|
|
3046
|
-
onClick: function onClick(event) {
|
|
3047
|
-
event.preventDefault();
|
|
3048
|
-
|
|
3049
|
-
if (!disabled) {
|
|
3050
|
-
_this._switchActiveTab(t, i);
|
|
3051
|
-
}
|
|
3052
|
-
}
|
|
3053
|
-
}, title)
|
|
3054
|
-
);
|
|
3055
|
-
});
|
|
3056
|
-
};
|
|
3057
|
-
|
|
3058
|
-
var defaultTab = props.defaultTab,
|
|
3059
|
-
onChange = props.onChange;
|
|
3060
|
-
var children = React__default.Children.toArray(_this.props.children);
|
|
3061
|
-
var hasDefault = defaultTab || defaultTab === 0;
|
|
3062
|
-
|
|
3063
|
-
if (hasDefault || onChange) {
|
|
3064
|
-
if (children) {
|
|
3065
|
-
var missing = children.find(function (c) {
|
|
3066
|
-
return !c.props.value && c.props.value !== 0;
|
|
3067
|
-
});
|
|
3068
|
-
if (missing) throw new Error('(Tab) Missing property: all Tab must have "value" set if "defaultTab" or "onChange" is used');
|
|
3069
|
-
}
|
|
3070
|
-
}
|
|
3071
|
-
|
|
3072
|
-
if (hasDefault && children) {
|
|
3073
|
-
var i = children.findIndex(function (x) {
|
|
3074
|
-
return x.props.value === defaultTab;
|
|
3075
|
-
});
|
|
3076
|
-
if (i === -1) throw new Error( // `hasDefault` being `true` guarantees `defaultTab` being a `number`.
|
|
3077
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
3078
|
-
"(Tabs) Unable to find Tab with the matching defaultTab value \"" + defaultTab + "\"");
|
|
3079
|
-
_this.state = {
|
|
3080
|
-
activeTabIndex: i
|
|
3081
|
-
};
|
|
3082
|
-
} else {
|
|
3083
|
-
_this.state = {
|
|
3084
|
-
activeTabIndex: 0
|
|
3085
|
-
};
|
|
3086
|
-
}
|
|
3087
|
-
|
|
3088
|
-
return _this;
|
|
3089
|
-
}
|
|
3090
|
-
|
|
3091
|
-
var _proto = Tabs.prototype;
|
|
3092
|
-
|
|
3093
|
-
_proto.render = function render() {
|
|
3094
|
-
// ensures that single or no child components don't throw
|
|
3095
|
-
var children = React__default.Children.toArray(this.props.children);
|
|
3096
|
-
var activeTab = children[this.state.activeTabIndex] || children[0] || null;
|
|
3097
|
-
var cls = classNames("reactist_tabs" + (this.props.spreadLayout ? '--spreadlayout' : ''));
|
|
3098
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
3099
|
-
className: cls
|
|
3100
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3101
|
-
className: "reactist_tabs__header"
|
|
3102
|
-
}, this._renderTabLinks(children)), /*#__PURE__*/React__default.createElement("div", {
|
|
3103
|
-
className: "reactist_tabs__body"
|
|
3104
|
-
}, activeTab));
|
|
3105
|
-
};
|
|
3106
|
-
|
|
3107
|
-
return Tabs;
|
|
3108
|
-
}(React__default.Component);
|
|
3109
|
-
|
|
3110
|
-
Tabs.displayName = 'Tabs';
|
|
3111
|
-
Tabs.defaultProps = {
|
|
3112
|
-
spreadLayout: false
|
|
3113
|
-
};
|
|
3114
|
-
|
|
3115
|
-
var Tab = function Tab(_ref) {
|
|
3116
|
-
var children = _ref.children,
|
|
3117
|
-
className = _ref.className;
|
|
3118
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
3119
|
-
className: classNames('reactist_tabs__tab', className)
|
|
3120
|
-
}, children);
|
|
3121
|
-
};
|
|
3122
|
-
|
|
3123
|
-
Tab.displayName = 'Tab';
|
|
3124
|
-
Tab.defaultProps = {
|
|
3125
|
-
disabled: false
|
|
3126
|
-
};
|
|
3127
|
-
|
|
3128
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
3129
|
-
function forwardRefWithAs$1(render) {
|
|
3130
|
-
return /*#__PURE__*/React.forwardRef(render);
|
|
3131
|
-
}
|
|
3132
|
-
|
|
3465
|
+
var _excluded$t = ["children", "onItemSelect"],
|
|
3466
|
+
_excluded2$3 = ["exceptionallySetClassName"],
|
|
3467
|
+
_excluded3$2 = ["handleItemSelect"],
|
|
3468
|
+
_excluded4$2 = ["exceptionallySetClassName"],
|
|
3469
|
+
_excluded5$2 = ["handleItemSelect"],
|
|
3470
|
+
_excluded6 = ["value", "children", "onSelect", "hideOnSelect", "onClick", "exceptionallySetClassName"],
|
|
3471
|
+
_excluded7 = ["handleItemSelect"],
|
|
3472
|
+
_excluded8 = ["children", "onItemSelect"],
|
|
3473
|
+
_excluded9 = ["handleItemSelect"],
|
|
3474
|
+
_excluded10 = ["label", "children", "exceptionallySetClassName"],
|
|
3475
|
+
_excluded11 = ["handleItemSelect"];
|
|
3133
3476
|
var MenuContext = /*#__PURE__*/React.createContext( // Reakit gives us no means to obtain a valid initial/default value of type MenuStateReturn
|
|
3134
3477
|
// (it is normally obtained by calling useMenuState but we can't call hooks outside components).
|
|
3135
3478
|
// This is however of little consequence since this value is only used if some of the components
|
|
@@ -3144,7 +3487,7 @@ var MenuContext = /*#__PURE__*/React.createContext( // Reakit gives us no means
|
|
|
3144
3487
|
function Menu(_ref) {
|
|
3145
3488
|
var children = _ref.children,
|
|
3146
3489
|
onItemSelect = _ref.onItemSelect,
|
|
3147
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
3490
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
3148
3491
|
|
|
3149
3492
|
var state = Reakit.useMenuState(_objectSpread2({
|
|
3150
3493
|
loop: true
|
|
@@ -3160,25 +3503,22 @@ function Menu(_ref) {
|
|
|
3160
3503
|
return /*#__PURE__*/React.createElement(MenuContext.Provider, {
|
|
3161
3504
|
value: value
|
|
3162
3505
|
}, children);
|
|
3163
|
-
}
|
|
3164
|
-
// MenuButton
|
|
3165
|
-
//
|
|
3166
|
-
|
|
3506
|
+
}
|
|
3167
3507
|
/**
|
|
3168
3508
|
* A button to toggle a dropdown menu open or closed.
|
|
3169
3509
|
*/
|
|
3170
3510
|
|
|
3171
3511
|
|
|
3172
|
-
var MenuButton = /*#__PURE__*/
|
|
3173
|
-
var
|
|
3174
|
-
props = _objectWithoutPropertiesLoose(_ref2,
|
|
3512
|
+
var MenuButton = /*#__PURE__*/polymorphicComponent(function MenuButton(_ref2, ref) {
|
|
3513
|
+
var exceptionallySetClassName = _ref2.exceptionallySetClassName,
|
|
3514
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
|
|
3175
3515
|
|
|
3176
3516
|
var _React$useContext = React.useContext(MenuContext),
|
|
3177
|
-
state = _objectWithoutPropertiesLoose(_React$useContext,
|
|
3517
|
+
state = _objectWithoutPropertiesLoose(_React$useContext, _excluded3$2);
|
|
3178
3518
|
|
|
3179
3519
|
return /*#__PURE__*/React.createElement(Reakit.MenuButton, Object.assign({}, props, state, {
|
|
3180
3520
|
ref: ref,
|
|
3181
|
-
className: classNames('reactist_menubutton',
|
|
3521
|
+
className: classNames('reactist_menubutton', exceptionallySetClassName)
|
|
3182
3522
|
}));
|
|
3183
3523
|
});
|
|
3184
3524
|
var BACKDROP_STYLE = {
|
|
@@ -3216,16 +3556,16 @@ function MenuBackdrop(_ref3) {
|
|
|
3216
3556
|
*/
|
|
3217
3557
|
|
|
3218
3558
|
|
|
3219
|
-
var MenuList = /*#__PURE__*/
|
|
3220
|
-
var
|
|
3221
|
-
props = _objectWithoutPropertiesLoose(_ref4,
|
|
3559
|
+
var MenuList = /*#__PURE__*/polymorphicComponent(function MenuList(_ref4, ref) {
|
|
3560
|
+
var exceptionallySetClassName = _ref4.exceptionallySetClassName,
|
|
3561
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded4$2);
|
|
3222
3562
|
|
|
3223
3563
|
var _React$useContext2 = React.useContext(MenuContext),
|
|
3224
|
-
state = _objectWithoutPropertiesLoose(_React$useContext2,
|
|
3564
|
+
state = _objectWithoutPropertiesLoose(_React$useContext2, _excluded5$2);
|
|
3225
3565
|
|
|
3226
3566
|
return state.visible ? /*#__PURE__*/React.createElement(MenuBackdrop, Object.assign({}, state), /*#__PURE__*/React.createElement(Reakit.Menu, Object.assign({}, props, state, {
|
|
3227
3567
|
ref: ref,
|
|
3228
|
-
className: classNames('reactist_menulist',
|
|
3568
|
+
className: classNames('reactist_menulist', exceptionallySetClassName)
|
|
3229
3569
|
}))) : null;
|
|
3230
3570
|
});
|
|
3231
3571
|
/**
|
|
@@ -3233,18 +3573,19 @@ var MenuList = /*#__PURE__*/forwardRefWithAs$1(function MenuList(_ref4, ref) {
|
|
|
3233
3573
|
* callback.
|
|
3234
3574
|
*/
|
|
3235
3575
|
|
|
3236
|
-
var MenuItem = /*#__PURE__*/
|
|
3576
|
+
var MenuItem = /*#__PURE__*/polymorphicComponent(function MenuItem(_ref5, ref) {
|
|
3237
3577
|
var value = _ref5.value,
|
|
3238
3578
|
children = _ref5.children,
|
|
3239
3579
|
onSelect = _ref5.onSelect,
|
|
3240
3580
|
_ref5$hideOnSelect = _ref5.hideOnSelect,
|
|
3241
3581
|
hideOnSelect = _ref5$hideOnSelect === void 0 ? true : _ref5$hideOnSelect,
|
|
3242
3582
|
onClick = _ref5.onClick,
|
|
3243
|
-
|
|
3583
|
+
exceptionallySetClassName = _ref5.exceptionallySetClassName,
|
|
3584
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded6);
|
|
3244
3585
|
|
|
3245
3586
|
var _React$useContext3 = React.useContext(MenuContext),
|
|
3246
3587
|
handleItemSelect = _React$useContext3.handleItemSelect,
|
|
3247
|
-
state = _objectWithoutPropertiesLoose(_React$useContext3,
|
|
3588
|
+
state = _objectWithoutPropertiesLoose(_React$useContext3, _excluded7);
|
|
3248
3589
|
|
|
3249
3590
|
var hide = state.hide;
|
|
3250
3591
|
var handleClick = React.useCallback(function handleClick(event) {
|
|
@@ -3256,7 +3597,8 @@ var MenuItem = /*#__PURE__*/forwardRefWithAs$1(function MenuItem(_ref5, ref) {
|
|
|
3256
3597
|
}, [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value]);
|
|
3257
3598
|
return /*#__PURE__*/React.createElement(Reakit.MenuItem, Object.assign({}, props, state, {
|
|
3258
3599
|
ref: ref,
|
|
3259
|
-
onClick: handleClick
|
|
3600
|
+
onClick: handleClick,
|
|
3601
|
+
className: exceptionallySetClassName
|
|
3260
3602
|
}), children);
|
|
3261
3603
|
});
|
|
3262
3604
|
/**
|
|
@@ -3284,11 +3626,11 @@ var MenuItem = /*#__PURE__*/forwardRefWithAs$1(function MenuItem(_ref5, ref) {
|
|
|
3284
3626
|
var SubMenu = /*#__PURE__*/React.forwardRef(function SubMenu(_ref6, ref) {
|
|
3285
3627
|
var children = _ref6.children,
|
|
3286
3628
|
onItemSelect = _ref6.onItemSelect,
|
|
3287
|
-
props = _objectWithoutPropertiesLoose(_ref6,
|
|
3629
|
+
props = _objectWithoutPropertiesLoose(_ref6, _excluded8);
|
|
3288
3630
|
|
|
3289
3631
|
var _React$useContext4 = React.useContext(MenuContext),
|
|
3290
3632
|
parentMenuItemSelect = _React$useContext4.handleItemSelect,
|
|
3291
|
-
state = _objectWithoutPropertiesLoose(_React$useContext4,
|
|
3633
|
+
state = _objectWithoutPropertiesLoose(_React$useContext4, _excluded9);
|
|
3292
3634
|
|
|
3293
3635
|
var parentMenuHide = state.hide;
|
|
3294
3636
|
var handleSubItemSelect = React.useCallback(function handleSubItemSelect(value) {
|
|
@@ -3318,22 +3660,300 @@ var SubMenu = /*#__PURE__*/React.forwardRef(function SubMenu(_ref6, ref) {
|
|
|
3318
3660
|
* before and/or after the group if you so wish.
|
|
3319
3661
|
*/
|
|
3320
3662
|
|
|
3321
|
-
var MenuGroup = /*#__PURE__*/
|
|
3663
|
+
var MenuGroup = /*#__PURE__*/polymorphicComponent(function MenuGroud(_ref7, ref) {
|
|
3322
3664
|
var label = _ref7.label,
|
|
3323
3665
|
children = _ref7.children,
|
|
3324
|
-
|
|
3666
|
+
exceptionallySetClassName = _ref7.exceptionallySetClassName,
|
|
3667
|
+
props = _objectWithoutPropertiesLoose(_ref7, _excluded10);
|
|
3325
3668
|
|
|
3326
3669
|
var _React$useContext5 = React.useContext(MenuContext),
|
|
3327
|
-
state = _objectWithoutPropertiesLoose(_React$useContext5,
|
|
3670
|
+
state = _objectWithoutPropertiesLoose(_React$useContext5, _excluded11);
|
|
3328
3671
|
|
|
3329
3672
|
return /*#__PURE__*/React.createElement(Reakit.MenuGroup, Object.assign({
|
|
3330
3673
|
ref: ref
|
|
3331
|
-
}, props, state
|
|
3674
|
+
}, props, state, {
|
|
3675
|
+
className: exceptionallySetClassName
|
|
3676
|
+
}), label ? /*#__PURE__*/React.createElement("div", {
|
|
3332
3677
|
role: "presentation",
|
|
3333
3678
|
className: "reactist_menugroup__label"
|
|
3334
3679
|
}, label) : null, children);
|
|
3335
3680
|
});
|
|
3336
3681
|
|
|
3682
|
+
/** @deprecated */
|
|
3683
|
+
|
|
3684
|
+
var Box$2 = /*#__PURE__*/function (_React$Component) {
|
|
3685
|
+
_inheritsLoose(Box, _React$Component);
|
|
3686
|
+
|
|
3687
|
+
function Box() {
|
|
3688
|
+
var _this;
|
|
3689
|
+
|
|
3690
|
+
_this = _React$Component.apply(this, arguments) || this;
|
|
3691
|
+
|
|
3692
|
+
_this._closeModal = function () {
|
|
3693
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3694
|
+
var modalElement = document.getElementById('modal_box');
|
|
3695
|
+
ReactDOM.unmountComponentAtNode(modalElement);
|
|
3696
|
+
};
|
|
3697
|
+
|
|
3698
|
+
_this._handleKeyDown = function (event) {
|
|
3699
|
+
if (event.keyCode === 27) {
|
|
3700
|
+
// ESC
|
|
3701
|
+
_this._closeModal();
|
|
3702
|
+
|
|
3703
|
+
if (event.preventDefault) event.preventDefault();
|
|
3704
|
+
}
|
|
3705
|
+
};
|
|
3706
|
+
|
|
3707
|
+
_this._handleOverlayClick = function (event) {
|
|
3708
|
+
if (event.target instanceof Element && (event.target.id === 'reactist-overlay' || event.target.id === 'reactist-overlay-inner')) {
|
|
3709
|
+
_this._closeModal();
|
|
3710
|
+
}
|
|
3711
|
+
};
|
|
3712
|
+
|
|
3713
|
+
return _this;
|
|
3714
|
+
}
|
|
3715
|
+
|
|
3716
|
+
var _proto = Box.prototype;
|
|
3717
|
+
|
|
3718
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
3719
|
+
window.addEventListener('keydown', this._handleKeyDown);
|
|
3720
|
+
};
|
|
3721
|
+
|
|
3722
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
3723
|
+
window.removeEventListener('keydown', this._handleKeyDown);
|
|
3724
|
+
};
|
|
3725
|
+
|
|
3726
|
+
_proto.render = function render() {
|
|
3727
|
+
var _this$props = this.props,
|
|
3728
|
+
large = _this$props.large,
|
|
3729
|
+
medium = _this$props.medium,
|
|
3730
|
+
style = _this$props.style,
|
|
3731
|
+
children = _this$props.children,
|
|
3732
|
+
closeOnOverlayClick = _this$props.closeOnOverlayClick;
|
|
3733
|
+
var className = classNames('reactist_modal_box', {
|
|
3734
|
+
large: large,
|
|
3735
|
+
medium: medium
|
|
3736
|
+
}, this.props.className);
|
|
3737
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
3738
|
+
className: "reactist_overlay",
|
|
3739
|
+
id: "reactist-overlay",
|
|
3740
|
+
onClick: closeOnOverlayClick ? this._handleOverlayClick : undefined
|
|
3741
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3742
|
+
className: "reactist_overlay_inner",
|
|
3743
|
+
id: "reactist-overlay-inner"
|
|
3744
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3745
|
+
style: style,
|
|
3746
|
+
className: className
|
|
3747
|
+
}, children)));
|
|
3748
|
+
};
|
|
3749
|
+
|
|
3750
|
+
return Box;
|
|
3751
|
+
}(React__default.Component);
|
|
3752
|
+
|
|
3753
|
+
Box$2.displayName = 'Modal.Box';
|
|
3754
|
+
Box$2.defaultProps = {
|
|
3755
|
+
large: false,
|
|
3756
|
+
closeOnOverlayClick: false
|
|
3757
|
+
};
|
|
3758
|
+
/** @deprecated */
|
|
3759
|
+
|
|
3760
|
+
var Header = /*#__PURE__*/function (_React$Component2) {
|
|
3761
|
+
_inheritsLoose(Header, _React$Component2);
|
|
3762
|
+
|
|
3763
|
+
function Header() {
|
|
3764
|
+
return _React$Component2.apply(this, arguments) || this;
|
|
3765
|
+
}
|
|
3766
|
+
|
|
3767
|
+
var _proto2 = Header.prototype;
|
|
3768
|
+
|
|
3769
|
+
_proto2._closeModal = function _closeModal(event) {
|
|
3770
|
+
event.preventDefault();
|
|
3771
|
+
|
|
3772
|
+
if (typeof this.props.beforeClose === 'function') {
|
|
3773
|
+
this.props.beforeClose();
|
|
3774
|
+
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3775
|
+
|
|
3776
|
+
|
|
3777
|
+
var modalElement = document.getElementById('modal_box');
|
|
3778
|
+
ReactDOM.unmountComponentAtNode(modalElement);
|
|
3779
|
+
};
|
|
3780
|
+
|
|
3781
|
+
_proto2.render = function render() {
|
|
3782
|
+
return (
|
|
3783
|
+
/*#__PURE__*/
|
|
3784
|
+
|
|
3785
|
+
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
3786
|
+
React__default.createElement("div", {
|
|
3787
|
+
className: "reactist_modal_box__header"
|
|
3788
|
+
}, /*#__PURE__*/React__default.createElement("p", null, this.props.title && /*#__PURE__*/React__default.createElement("span", {
|
|
3789
|
+
className: "title"
|
|
3790
|
+
}, this.props.title), this.props.subtitle && /*#__PURE__*/React__default.createElement("span", {
|
|
3791
|
+
className: "subtitle"
|
|
3792
|
+
}, this.props.subtitle), this.props.children), /*#__PURE__*/React__default.createElement("a", {
|
|
3793
|
+
className: "close",
|
|
3794
|
+
onClick: this._closeModal.bind(this),
|
|
3795
|
+
href: "#"
|
|
3796
|
+
}, /*#__PURE__*/React__default.createElement(CloseIcon$1, null)))
|
|
3797
|
+
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
3798
|
+
|
|
3799
|
+
);
|
|
3800
|
+
};
|
|
3801
|
+
|
|
3802
|
+
return Header;
|
|
3803
|
+
}(React__default.Component);
|
|
3804
|
+
|
|
3805
|
+
Header.displayName = 'Modal.Header';
|
|
3806
|
+
/** @deprecated */
|
|
3807
|
+
|
|
3808
|
+
var Body$1 = /*#__PURE__*/function (_React$Component3) {
|
|
3809
|
+
_inheritsLoose(Body, _React$Component3);
|
|
3810
|
+
|
|
3811
|
+
function Body() {
|
|
3812
|
+
return _React$Component3.apply(this, arguments) || this;
|
|
3813
|
+
}
|
|
3814
|
+
|
|
3815
|
+
var _proto3 = Body.prototype;
|
|
3816
|
+
|
|
3817
|
+
_proto3._closeModal = function _closeModal(event) {
|
|
3818
|
+
event.preventDefault(); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3819
|
+
|
|
3820
|
+
var modalElement = document.getElementById('modal_box');
|
|
3821
|
+
ReactDOM.unmountComponentAtNode(modalElement);
|
|
3822
|
+
};
|
|
3823
|
+
|
|
3824
|
+
_proto3.render = function render() {
|
|
3825
|
+
var _this$props2 = this.props,
|
|
3826
|
+
icon = _this$props2.icon,
|
|
3827
|
+
plain = _this$props2.plain,
|
|
3828
|
+
children = _this$props2.children,
|
|
3829
|
+
style = _this$props2.style,
|
|
3830
|
+
showCloseIcon = _this$props2.showCloseIcon;
|
|
3831
|
+
var className = classNames('reactist_modal_box__body', {
|
|
3832
|
+
plain: plain
|
|
3833
|
+
}, this.props.className);
|
|
3834
|
+
return (
|
|
3835
|
+
/*#__PURE__*/
|
|
3836
|
+
|
|
3837
|
+
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
3838
|
+
React__default.createElement("div", {
|
|
3839
|
+
className: className,
|
|
3840
|
+
style: style
|
|
3841
|
+
}, showCloseIcon && /*#__PURE__*/React__default.createElement("a", {
|
|
3842
|
+
className: "close",
|
|
3843
|
+
onClick: this._closeModal.bind(this),
|
|
3844
|
+
href: "#"
|
|
3845
|
+
}, /*#__PURE__*/React__default.createElement(CloseIcon$1, null)), icon ? /*#__PURE__*/React__default.createElement("div", {
|
|
3846
|
+
className: "dialog"
|
|
3847
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3848
|
+
className: "reactist_icon"
|
|
3849
|
+
}, icon), /*#__PURE__*/React__default.createElement("div", {
|
|
3850
|
+
className: "content"
|
|
3851
|
+
}, children)) : children)
|
|
3852
|
+
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
3853
|
+
|
|
3854
|
+
);
|
|
3855
|
+
};
|
|
3856
|
+
|
|
3857
|
+
return Body;
|
|
3858
|
+
}(React__default.Component);
|
|
3859
|
+
|
|
3860
|
+
Body$1.displayName = 'Modal.Body';
|
|
3861
|
+
Body$1.defaultProps = {
|
|
3862
|
+
showCloseIcon: false
|
|
3863
|
+
};
|
|
3864
|
+
/** @deprecated */
|
|
3865
|
+
|
|
3866
|
+
var Actions = /*#__PURE__*/function (_React$Component4) {
|
|
3867
|
+
_inheritsLoose(Actions, _React$Component4);
|
|
3868
|
+
|
|
3869
|
+
function Actions() {
|
|
3870
|
+
return _React$Component4.apply(this, arguments) || this;
|
|
3871
|
+
}
|
|
3872
|
+
|
|
3873
|
+
var _proto4 = Actions.prototype;
|
|
3874
|
+
|
|
3875
|
+
_proto4._onClick = function _onClick(onClick) {
|
|
3876
|
+
if (onClick) {
|
|
3877
|
+
onClick();
|
|
3878
|
+
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3879
|
+
|
|
3880
|
+
|
|
3881
|
+
var modalElement = document.getElementById('modal_box');
|
|
3882
|
+
ReactDOM.unmountComponentAtNode(modalElement);
|
|
3883
|
+
};
|
|
3884
|
+
|
|
3885
|
+
_proto4.render = function render() {
|
|
3886
|
+
var _this2 = this;
|
|
3887
|
+
|
|
3888
|
+
var children = React__default.Children.map( // see: https://github.com/microsoft/TypeScript/issues/21699
|
|
3889
|
+
// @ts-expect-error Children cannot be typed properly yet in React
|
|
3890
|
+
this.props.children, function (child) {
|
|
3891
|
+
var _child$props;
|
|
3892
|
+
|
|
3893
|
+
if (child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.close) {
|
|
3894
|
+
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
3895
|
+
onClick: function onClick() {
|
|
3896
|
+
return _this2._onClick(child.props.onClick);
|
|
3897
|
+
}
|
|
3898
|
+
});
|
|
3899
|
+
} else {
|
|
3900
|
+
return child ? /*#__PURE__*/React__default.cloneElement(child) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
3901
|
+
}
|
|
3902
|
+
});
|
|
3903
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
3904
|
+
className: "reactist_modal_box__actions"
|
|
3905
|
+
}, children);
|
|
3906
|
+
};
|
|
3907
|
+
|
|
3908
|
+
return Actions;
|
|
3909
|
+
}(React__default.Component);
|
|
3910
|
+
|
|
3911
|
+
Actions.displayName = 'Modal.Actions';
|
|
3912
|
+
|
|
3913
|
+
var index = {
|
|
3914
|
+
Box: Box$2,
|
|
3915
|
+
Header: Header,
|
|
3916
|
+
Body: Body$1,
|
|
3917
|
+
Actions: Actions
|
|
3918
|
+
};
|
|
3919
|
+
|
|
3920
|
+
/** @deprecated */
|
|
3921
|
+
|
|
3922
|
+
function Loading$1(_ref) {
|
|
3923
|
+
var className = _ref.className,
|
|
3924
|
+
_ref$spinnerColor = _ref.spinnerColor,
|
|
3925
|
+
spinnerColor = _ref$spinnerColor === void 0 ? '#3F82EF' : _ref$spinnerColor,
|
|
3926
|
+
_ref$bgColor = _ref.bgColor,
|
|
3927
|
+
bgColor = _ref$bgColor === void 0 ? '#D9E6FB' : _ref$bgColor,
|
|
3928
|
+
_ref$size = _ref.size,
|
|
3929
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
3930
|
+
_ref$ariaLabel = _ref['aria-label'],
|
|
3931
|
+
ariaLabel = _ref$ariaLabel === void 0 ? 'Loading' : _ref$ariaLabel;
|
|
3932
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
3933
|
+
className: classNames('reactist_loading', className),
|
|
3934
|
+
"aria-label": ariaLabel,
|
|
3935
|
+
"aria-live": "assertive",
|
|
3936
|
+
role: "alert"
|
|
3937
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
3938
|
+
className: "reactist_loading--spinner"
|
|
3939
|
+
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
3940
|
+
width: size,
|
|
3941
|
+
height: size,
|
|
3942
|
+
viewBox: '0 0 24 24'
|
|
3943
|
+
}, /*#__PURE__*/React__default.createElement("g", {
|
|
3944
|
+
fill: "none",
|
|
3945
|
+
fillRule: "nonzero"
|
|
3946
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
3947
|
+
fill: spinnerColor,
|
|
3948
|
+
d: "M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z"
|
|
3949
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
3950
|
+
fill: bgColor,
|
|
3951
|
+
d: "M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z"
|
|
3952
|
+
})))));
|
|
3953
|
+
}
|
|
3954
|
+
|
|
3955
|
+
Loading$1.displayName = 'Loading';
|
|
3956
|
+
|
|
3337
3957
|
exports.Alert = Alert;
|
|
3338
3958
|
exports.Avatar = Avatar;
|
|
3339
3959
|
exports.Box = Box;
|
|
@@ -3345,23 +3965,32 @@ exports.CheckboxField = CheckboxField;
|
|
|
3345
3965
|
exports.ColorPicker = ColorPicker;
|
|
3346
3966
|
exports.Column = Column;
|
|
3347
3967
|
exports.Columns = Columns;
|
|
3968
|
+
exports.DeprecatedButton = Button$1;
|
|
3969
|
+
exports.DeprecatedLoading = Loading$1;
|
|
3970
|
+
exports.DeprecatedModal = index;
|
|
3348
3971
|
exports.Divider = Divider;
|
|
3349
3972
|
exports.Dropdown = Dropdown;
|
|
3350
3973
|
exports.ErrorMessage = ErrorMessage;
|
|
3351
3974
|
exports.Heading = Heading;
|
|
3975
|
+
exports.Hidden = Hidden;
|
|
3976
|
+
exports.HiddenVisually = HiddenVisually;
|
|
3352
3977
|
exports.Icon = Icon;
|
|
3353
3978
|
exports.Inline = Inline;
|
|
3354
3979
|
exports.Input = Input;
|
|
3355
3980
|
exports.KeyCapturer = KeyCapturer;
|
|
3356
3981
|
exports.KeyboardShortcut = KeyboardShortcut;
|
|
3357
3982
|
exports.Loading = Loading;
|
|
3358
|
-
exports.LoadingSpinner = LoadingSpinner;
|
|
3359
3983
|
exports.Menu = Menu;
|
|
3360
3984
|
exports.MenuButton = MenuButton;
|
|
3361
3985
|
exports.MenuGroup = MenuGroup;
|
|
3362
3986
|
exports.MenuItem = MenuItem;
|
|
3363
3987
|
exports.MenuList = MenuList;
|
|
3364
|
-
exports.Modal =
|
|
3988
|
+
exports.Modal = Modal;
|
|
3989
|
+
exports.ModalActions = ModalActions;
|
|
3990
|
+
exports.ModalBody = ModalBody;
|
|
3991
|
+
exports.ModalCloseButton = ModalCloseButton;
|
|
3992
|
+
exports.ModalFooter = ModalFooter;
|
|
3993
|
+
exports.ModalHeader = ModalHeader;
|
|
3365
3994
|
exports.Notice = Notice;
|
|
3366
3995
|
exports.Notification = Notification;
|
|
3367
3996
|
exports.PasswordField = PasswordField;
|
|
@@ -3375,6 +4004,9 @@ exports.Stack = Stack;
|
|
|
3375
4004
|
exports.SubMenu = SubMenu;
|
|
3376
4005
|
exports.SwitchField = SwitchField;
|
|
3377
4006
|
exports.Tab = Tab;
|
|
4007
|
+
exports.TabAwareSlot = TabAwareSlot;
|
|
4008
|
+
exports.TabList = TabList;
|
|
4009
|
+
exports.TabPanel = TabPanel;
|
|
3378
4010
|
exports.Tabs = Tabs;
|
|
3379
4011
|
exports.Text = Text;
|
|
3380
4012
|
exports.TextArea = TextArea;
|
|
@@ -3383,4 +4015,5 @@ exports.TextLink = TextLink;
|
|
|
3383
4015
|
exports.Time = Time;
|
|
3384
4016
|
exports.Tip = Tip;
|
|
3385
4017
|
exports.Tooltip = Tooltip;
|
|
4018
|
+
exports.usePrevious = usePrevious;
|
|
3386
4019
|
//# sourceMappingURL=reactist.cjs.development.js.map
|