@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
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ComponentTypes } from '../type-helpers';
|
|
3
2
|
import type { Tone } from '../common-types';
|
|
3
|
+
import type { BoxProps } from '../box';
|
|
4
4
|
declare type TextProps = {
|
|
5
|
-
component?: ComponentTypes;
|
|
6
5
|
children: React.ReactNode;
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The size of the text.
|
|
8
|
+
*
|
|
9
|
+
* The supported values, from smaller size to larger size, are:
|
|
10
|
+
* 'caption', 'copy', 'body', and 'subtitle'
|
|
11
|
+
*
|
|
12
|
+
* @default 'body'
|
|
13
|
+
*/
|
|
14
|
+
size?: 'caption' | 'copy' | 'body' | 'subtitle';
|
|
15
|
+
/**
|
|
16
|
+
* The weight of the text font.
|
|
17
|
+
*
|
|
18
|
+
* @default 'regular'
|
|
19
|
+
*/
|
|
20
|
+
weight?: 'regular' | 'semibold' | 'bold';
|
|
21
|
+
/**
|
|
22
|
+
* The tone (semantic color) of the text.
|
|
23
|
+
*
|
|
24
|
+
* @default 'normal'
|
|
25
|
+
*/
|
|
9
26
|
tone?: Tone;
|
|
27
|
+
/**
|
|
28
|
+
* Used to truncate the text to a given number of lines.
|
|
29
|
+
*
|
|
30
|
+
* It will add an ellipsis (`…`) to the text at the end of the last line, only if the text was
|
|
31
|
+
* truncated. If the text fits without it being truncated, no ellipsis is added.
|
|
32
|
+
*
|
|
33
|
+
* By default, the text is not truncated at all, no matter how many lines it takes to render it.
|
|
34
|
+
*
|
|
35
|
+
* @default undefined
|
|
36
|
+
*/
|
|
10
37
|
lineClamp?: 1 | 2 | 3 | 4 | 5 | '1' | '2' | '3' | '4' | '5';
|
|
38
|
+
/**
|
|
39
|
+
* How to align the text horizontally.
|
|
40
|
+
*
|
|
41
|
+
* @default 'start'
|
|
42
|
+
*/
|
|
43
|
+
align?: BoxProps['textAlign'];
|
|
11
44
|
};
|
|
12
|
-
declare const Text: import("
|
|
45
|
+
declare const Text: import("../../utils/polymorphism").PolymorphicComponent<"div", TextProps, "obfuscateClassName">;
|
|
13
46
|
export type { TextProps };
|
|
14
47
|
export { Text };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),l=require("react"),t=require("../../utils/polymorphism.js"),s=require("../responsive-props.js"),a=require("../box/box.js"),i=require("./text.module.css.js"),r=["as","size","weight","tone","align","children","lineClamp","exceptionallySetClassName"];exports.Text=t.polymorphicComponent((function(t,o){var n=t.as,u=t.size,p=void 0===u?"body":u,m=t.weight,d=void 0===m?"regular":m,g=t.tone,c=void 0===g?"normal":g,x=t.align,C=t.children,f=t.lineClamp,b=t.exceptionallySetClassName,h=e.objectWithoutPropertiesLoose(t,r),v="string"==typeof f?Number(f)>1:(null!=f?f:1)>1;return l.createElement(a.Box,Object.assign({},h,{as:n,className:[b,i.default.text,"body"!==p?s.getClassNames(i.default,"size",p):null,"regular"!==d?s.getClassNames(i.default,"weight",d):null,"normal"!==c?s.getClassNames(i.default,"tone",c):null,v?i.default.lineClampMultipleLines:null,f?s.getClassNames(i.default,"lineClamp",f.toString()):null],textAlign:x,paddingRight:f?"xsmall":void 0,ref:o}),C)}));
|
|
2
2
|
//# sourceMappingURL=text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sources":["../../../src/new-components/text/text.tsx"],"sourcesContent":["import * as React from 'react'\nimport { getClassNames } from '../responsive-props'\nimport { Box } from '../box'\
|
|
1
|
+
{"version":3,"file":"text.js","sources":["../../../src/new-components/text/text.tsx"],"sourcesContent":["import * as React from 'react'\nimport { getClassNames } from '../responsive-props'\nimport { Box } from '../box'\nimport { polymorphicComponent } from '../../utils/polymorphism'\n\nimport type { Tone } from '../common-types'\nimport type { BoxProps } from '../box'\n\nimport styles from './text.module.css'\n\ntype TextProps = {\n children: React.ReactNode\n /**\n * The size of the text.\n *\n * The supported values, from smaller size to larger size, are:\n * 'caption', 'copy', 'body', and 'subtitle'\n *\n * @default 'body'\n */\n size?: 'caption' | 'copy' | 'body' | 'subtitle'\n /**\n * The weight of the text font.\n *\n * @default 'regular'\n */\n weight?: 'regular' | 'semibold' | 'bold'\n /**\n * The tone (semantic color) of the text.\n *\n * @default 'normal'\n */\n tone?: Tone\n /**\n * Used to truncate the text to a given number of lines.\n *\n * It will add an ellipsis (`…`) to the text at the end of the last line, only if the text was\n * truncated. If the text fits without it being truncated, no ellipsis is added.\n *\n * By default, the text is not truncated at all, no matter how many lines it takes to render it.\n *\n * @default undefined\n */\n lineClamp?: 1 | 2 | 3 | 4 | 5 | '1' | '2' | '3' | '4' | '5'\n /**\n * How to align the text horizontally.\n *\n * @default 'start'\n */\n align?: BoxProps['textAlign']\n}\n\nconst Text = polymorphicComponent<'div', TextProps>(function Text(\n {\n as,\n size = 'body',\n weight = 'regular',\n tone = 'normal',\n align,\n children,\n lineClamp,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const lineClampMultipleLines =\n typeof lineClamp === 'string' ? Number(lineClamp) > 1 : (lineClamp ?? 1) > 1\n\n return (\n <Box\n {...props}\n as={as}\n className={[\n exceptionallySetClassName,\n styles.text,\n size !== 'body' ? getClassNames(styles, 'size', size) : null,\n weight !== 'regular' ? getClassNames(styles, 'weight', weight) : null,\n tone !== 'normal' ? getClassNames(styles, 'tone', tone) : null,\n lineClampMultipleLines ? styles.lineClampMultipleLines : null,\n lineClamp ? getClassNames(styles, 'lineClamp', lineClamp.toString()) : null,\n ]}\n textAlign={align}\n // Prevents emojis from being cut-off\n // See https://github.com/Doist/reactist/pull/528\n paddingRight={lineClamp ? 'xsmall' : undefined}\n ref={ref}\n >\n {children}\n </Box>\n )\n})\n\nexport type { TextProps }\nexport { Text }\n"],"names":["polymorphicComponent","ref","as","size","weight","tone","align","children","lineClamp","exceptionallySetClassName","props","lineClampMultipleLines","Number","React","Box","className","styles","text","getClassNames","toString","textAlign","paddingRight","undefined"],"mappings":"sYAoDaA,wBAAuC,WAYhDC,OAVIC,IAAAA,OACAC,KAAAA,aAAO,aACPC,OAAAA,aAAS,gBACTC,KAAAA,aAAO,WACPC,IAAAA,MACAC,IAAAA,SACAC,IAAAA,UACAC,IAAAA,0BACGC,sCAIDC,EACmB,iBAAdH,EAAyBI,OAAOJ,GAAa,GAAKA,MAAAA,EAAAA,EAAa,GAAK,SAG3EK,gBAACC,uBACOJ,GACJR,GAAIA,EACJa,UAAW,CACPN,EACAO,UAAOC,KACE,SAATd,EAAkBe,gBAAcF,UAAQ,OAAQb,GAAQ,KAC7C,YAAXC,EAAuBc,gBAAcF,UAAQ,SAAUZ,GAAU,KACxD,WAATC,EAAoBa,gBAAcF,UAAQ,OAAQX,GAAQ,KAC1DM,EAAyBK,UAAOL,uBAAyB,KACzDH,EAAYU,gBAAcF,UAAQ,YAAaR,EAAUW,YAAc,MAE3EC,UAAWd,EAGXe,aAAcb,EAAY,cAAWc,EACrCrB,IAAKA,IAEJM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={text:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={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"};
|
|
2
2
|
//# sourceMappingURL=text.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
declare type TextAreaProps =
|
|
2
|
+
import { FieldComponentProps } from '../base-field';
|
|
3
|
+
declare type TextAreaProps = FieldComponentProps<HTMLTextAreaElement>;
|
|
4
4
|
declare function TextArea({ id, label, secondaryLabel, auxiliaryLabel, hint, maxWidth, ...props }: TextAreaProps): JSX.Element;
|
|
5
5
|
export { TextArea };
|
|
6
6
|
export type { TextAreaProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),a=require("react"),r=require("../box/box.js"),t=require("../base-field/base-field.js"),i=require("./text-area.module.css.js");exports.TextArea=function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),a=require("react"),r=require("../box/box.js"),t=require("../base-field/base-field.js"),i=require("./text-area.module.css.js"),l=["id","label","secondaryLabel","auxiliaryLabel","hint","maxWidth"];exports.TextArea=function(s){var u=s.id,n=s.label,o=s.secondaryLabel,b=s.auxiliaryLabel,d=s.hint,c=s.maxWidth,x=e.objectWithoutPropertiesLoose(s,l);return a.createElement(t.BaseField,{id:u,label:n,secondaryLabel:o,auxiliaryLabel:b,hint:d,className:i.default.container,maxWidth:c},(function(e){return a.createElement(r.Box,{width:"full"},a.createElement("textarea",Object.assign({},x,e)))}))};
|
|
2
2
|
//# sourceMappingURL=text-area.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-area.js","sources":["../../../src/new-components/text-area/text-area.tsx"],"sourcesContent":["import * as React from 'react'\nimport { BaseField,
|
|
1
|
+
{"version":3,"file":"text-area.js","sources":["../../../src/new-components/text-area/text-area.tsx"],"sourcesContent":["import * as React from 'react'\nimport { BaseField, FieldComponentProps } from '../base-field'\nimport { Box } from '../box'\nimport styles from './text-area.module.css'\n\ntype TextAreaProps = FieldComponentProps<HTMLTextAreaElement>\n\nfunction TextArea({\n id,\n label,\n secondaryLabel,\n auxiliaryLabel,\n hint,\n maxWidth,\n ...props\n}: TextAreaProps) {\n return (\n <BaseField\n id={id}\n label={label}\n secondaryLabel={secondaryLabel}\n auxiliaryLabel={auxiliaryLabel}\n hint={hint}\n className={styles.container}\n maxWidth={maxWidth}\n >\n {(extraProps) => (\n <Box width=\"full\">\n <textarea {...props} {...extraProps} />\n </Box>\n )}\n </BaseField>\n )\n}\n\nexport { TextArea }\nexport type { TextAreaProps }\n"],"names":["id","label","secondaryLabel","auxiliaryLabel","hint","maxWidth","props","React","BaseField","className","styles","container","extraProps","Box","width"],"mappings":"qVAOA,gBACIA,IAAAA,GACAC,IAAAA,MACAC,IAAAA,eACAC,IAAAA,eACAC,IAAAA,KACAC,IAAAA,SACGC,6CAGCC,gBAACC,aACGR,GAAIA,EACJC,MAAOA,EACPC,eAAgBA,EAChBC,eAAgBA,EAChBC,KAAMA,EACNK,UAAWC,UAAOC,UAClBN,SAAUA,IAET,SAACO,UACEL,gBAACM,OAAIC,MAAM,QACPP,4CAAcD,EAAWM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={container:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={container:"_5a579f96"};
|
|
2
2
|
//# sourceMappingURL=text-area.module.css.js.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare type
|
|
4
|
-
declare
|
|
2
|
+
import type { FieldComponentProps } from '../base-field';
|
|
3
|
+
declare type TextFieldType = 'email' | 'search' | 'tel' | 'text' | 'url';
|
|
4
|
+
declare type TextFieldProps = Omit<FieldComponentProps<HTMLInputElement>, 'type'> & {
|
|
5
|
+
type?: TextFieldType;
|
|
6
|
+
};
|
|
7
|
+
declare const TextField: React.ForwardRefExoticComponent<Pick<TextFieldProps, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "label" | "secondaryLabel" | "auxiliaryLabel" | "hint" | "maxWidth" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "list" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "pattern" | "readOnly" | "required" | "size" | "src" | "step" | "type" | "value" | "width"> & React.RefAttributes<HTMLInputElement>>;
|
|
5
8
|
export { TextField };
|
|
6
|
-
export type { TextFieldProps };
|
|
9
|
+
export type { TextFieldProps, TextFieldType };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),i=require("../box/box.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),i=require("../box/box.js"),a=require("../base-field/base-field.js"),t=require("./text-field.module.css.js"),l=["id","label","secondaryLabel","auxiliaryLabel","hint","type","maxWidth","hidden","aria-describedby"];exports.TextField=r.forwardRef((function(d,s){var b=d.id,n=d.label,u=d.secondaryLabel,o=d.auxiliaryLabel,c=d.hint,x=d.type,p=void 0===x?"text":x,y=d.maxWidth,f=d.hidden,h=d["aria-describedby"],m=e.objectWithoutPropertiesLoose(d,l);return r.createElement(a.BaseField,{id:b,label:n,secondaryLabel:u,auxiliaryLabel:o,hint:c,maxWidth:y,hidden:f,"aria-describedby":h},(function(e){return r.createElement(i.Box,{className:t.default.inputWrapper},r.createElement("input",Object.assign({},m,e,{type:p,ref:s})))}))}));
|
|
2
2
|
//# sourceMappingURL=text-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.js","sources":["../../../src/new-components/text-field/text-field.tsx"],"sourcesContent":["import * as React from 'react'\nimport { BaseField
|
|
1
|
+
{"version":3,"file":"text-field.js","sources":["../../../src/new-components/text-field/text-field.tsx"],"sourcesContent":["import * as React from 'react'\nimport { BaseField } from '../base-field'\nimport { Box } from '../box'\nimport styles from './text-field.module.css'\nimport type { FieldComponentProps } from '../base-field'\n\ntype TextFieldType = 'email' | 'search' | 'tel' | 'text' | 'url'\n\ntype TextFieldProps = Omit<FieldComponentProps<HTMLInputElement>, 'type'> & {\n type?: TextFieldType\n}\n\nconst TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(function TextField(\n {\n id,\n label,\n secondaryLabel,\n auxiliaryLabel,\n hint,\n type = 'text',\n maxWidth,\n hidden,\n 'aria-describedby': ariaDescribedBy,\n ...props\n },\n ref,\n) {\n return (\n <BaseField\n id={id}\n label={label}\n secondaryLabel={secondaryLabel}\n auxiliaryLabel={auxiliaryLabel}\n hint={hint}\n maxWidth={maxWidth}\n hidden={hidden}\n aria-describedby={ariaDescribedBy}\n >\n {(extraProps) => (\n <Box className={styles.inputWrapper}>\n <input {...props} {...extraProps} type={type} ref={ref} />\n </Box>\n )}\n </BaseField>\n )\n})\n\nexport { TextField }\nexport type { TextFieldProps, TextFieldType }\n"],"names":["React","ref","id","label","secondaryLabel","auxiliaryLabel","hint","type","maxWidth","hidden","ariaDescribedBy","props","BaseField","extraProps","Box","className","styles","inputWrapper"],"mappings":"0XAYkBA,cAAmD,WAajEC,OAXIC,IAAAA,GACAC,IAAAA,MACAC,IAAAA,eACAC,IAAAA,eACAC,IAAAA,SACAC,KAAAA,aAAO,SACPC,IAAAA,SACAC,IAAAA,OACoBC,IAApB,oBACGC,6CAKHX,gBAACY,aACGV,GAAIA,EACJC,MAAOA,EACPC,eAAgBA,EAChBC,eAAgBA,EAChBC,KAAMA,EACNE,SAAUA,EACVC,OAAQA,qBACUC,IAEjB,SAACG,UACEb,gBAACc,OAAIC,UAAWC,UAAOC,cACnBjB,yCAAWW,EAAWE,GAAYN,KAAMA,EAAMN,IAAKA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={inputWrapper:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={inputWrapper:"dd9ffeab"};
|
|
2
2
|
//# sourceMappingURL=text-field.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { OpenInNewTab } from '../common-types';
|
|
3
2
|
declare type TextLinkProps = OpenInNewTab;
|
|
4
|
-
declare const TextLink: import("
|
|
3
|
+
declare const TextLink: import("../../utils/polymorphism").PolymorphicComponent<"a", OpenInNewTab, "obfuscateClassName">;
|
|
5
4
|
export { TextLink };
|
|
6
5
|
export type { TextLinkProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),o=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),o=require("../../utils/polymorphism.js"),t=require("../box/box.js"),i=require("./text-link.module.css.js"),s=["as","openInNewTab","exceptionallySetClassName"];exports.TextLink=o.polymorphicComponent((function(o,a){var l=o.as,n=void 0===l?"a":l,p=o.openInNewTab,u=void 0!==p&&p,c=o.exceptionallySetClassName,b=e.objectWithoutPropertiesLoose(o,s);return r.createElement(t.Box,Object.assign({},b,{as:n,display:"inline",className:[c,i.default.container],ref:a,target:u?"_blank":void 0,rel:u?"noopener noreferrer":void 0}))}));
|
|
2
2
|
//# sourceMappingURL=text-link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-link.js","sources":["../../../src/new-components/text-link/text-link.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport {
|
|
1
|
+
{"version":3,"file":"text-link.js","sources":["../../../src/new-components/text-link/text-link.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport { polymorphicComponent } from '../../utils/polymorphism'\nimport styles from './text-link.module.css'\nimport type { OpenInNewTab } from '../common-types'\n\ntype TextLinkProps = OpenInNewTab\n\nconst TextLink = polymorphicComponent<'a', TextLinkProps>(function TextLink(\n { as = 'a', openInNewTab = false, exceptionallySetClassName, ...props },\n ref,\n) {\n return (\n <Box\n {...props}\n as={as}\n display=\"inline\"\n className={[exceptionallySetClassName, styles.container]}\n ref={ref}\n target={openInNewTab ? '_blank' : undefined}\n rel={openInNewTab ? 'noopener noreferrer' : undefined}\n />\n )\n})\n\nexport { TextLink }\nexport type { TextLinkProps }\n"],"names":["polymorphicComponent","ref","as","openInNewTab","exceptionallySetClassName","props","React","Box","display","className","styles","container","target","undefined","rel"],"mappings":"oUAQiBA,wBAAyC,WAEtDC,WADEC,GAAAA,aAAK,UAAKC,aAAAA,gBAAsBC,IAAAA,0BAA8BC,6CAI5DC,gBAACC,uBACOF,GACJH,GAAIA,EACJM,QAAQ,SACRC,UAAW,CAACL,EAA2BM,UAAOC,WAC9CV,IAAKA,EACLW,OAAQT,EAAe,cAAWU,EAClCC,IAAKX,EAAe,2BAAwBU"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type Merge<P1, P2> = Omit<P1, keyof P2> & P2;
|
|
3
|
+
declare type EmptyObject = {
|
|
4
|
+
[K in any]: never;
|
|
5
|
+
};
|
|
6
|
+
declare type ObfuscateClassNameMode = 'keepClassName' | 'obfuscateClassName' | 'omitClassName';
|
|
7
|
+
declare type ObfuscatedClassName = {
|
|
8
|
+
/**
|
|
9
|
+
* Used internally to set the `className` prop of the main container element for this component.
|
|
10
|
+
*
|
|
11
|
+
* Aside from the different name, the prop behaves the same as the native `className`. The only
|
|
12
|
+
* reason for the name change is to discourage applying custom CSS to the design system
|
|
13
|
+
* components, which are supposed to _eventually_ provide all the styling features we may need.
|
|
14
|
+
*
|
|
15
|
+
* This prop is meant to be used only in certain circumstances, when you really need a escape
|
|
16
|
+
* hatch to apply custom styles to a component. Before reaching for this feature, try harder to
|
|
17
|
+
* see if you can solve your needs with what the design system provides.
|
|
18
|
+
*
|
|
19
|
+
* For instance, instead of applying layout-related styles to a non-layout component, consider
|
|
20
|
+
* wrapping it inside a layout component.
|
|
21
|
+
*
|
|
22
|
+
* @see PolymorphicComponent
|
|
23
|
+
*/
|
|
24
|
+
exceptionallySetClassName?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`
|
|
28
|
+
* prop instead.
|
|
29
|
+
*
|
|
30
|
+
* This can be customized via the second generic parameter, as there are cases where it may be
|
|
31
|
+
* needed to omit this behaviour and keep the `className`. You can also instruct it to remove the
|
|
32
|
+
* `className` prop while not replacing it with the `exceptionallySetClassName` one.
|
|
33
|
+
*
|
|
34
|
+
* @see ObfuscatedClassName['exceptionallySetClassName'] for details about this prop
|
|
35
|
+
* @see PolymorphicComponent for details about this feature
|
|
36
|
+
*/
|
|
37
|
+
declare type WithObfuscatedClassName<Props, ShouldObfuscateClassName extends ObfuscateClassNameMode> = 'className' extends keyof Props ? ShouldObfuscateClassName extends 'obfuscateClassName' ? Omit<Props, 'className'> & ObfuscatedClassName : ShouldObfuscateClassName extends 'omitClassName' ? Omit<Props, 'className'> : ShouldObfuscateClassName extends 'keepClassName' ? Props : never : Props;
|
|
38
|
+
declare type PolymorphicProp<ComponentType extends React.ElementType> = {
|
|
39
|
+
/**
|
|
40
|
+
* Used to instruct this component what React element to render as. It can be both a string
|
|
41
|
+
* representing a HTML tag name, or a React component.
|
|
42
|
+
*
|
|
43
|
+
* When using this prop, the component you apply it to will also recognize in its props types
|
|
44
|
+
* all the props from the component or HTML element you are rendering it as.
|
|
45
|
+
*
|
|
46
|
+
* Some uses for this feature:
|
|
47
|
+
*
|
|
48
|
+
* - Using some of our layout components, while at the same time being able to set them to use
|
|
49
|
+
* semantic HTML elements needed for accessibility purposes (e.g. `nav`, `main`, etc).
|
|
50
|
+
* - Using a design system link component, but have it internally use a client-side router link
|
|
51
|
+
* implemented via a React component (e.g. react-router's `Link`).
|
|
52
|
+
*
|
|
53
|
+
* Keep in mind that not all compositions of this kind may work well, especially when composing
|
|
54
|
+
* with another React component and not with a HTML tag name. In particular, if the components
|
|
55
|
+
* being composed have opposing concerns of clashing features (e.g. they have contradicting
|
|
56
|
+
* styles applied to them) things may not go well. In those cases prefer to nest them instead.
|
|
57
|
+
*
|
|
58
|
+
* @see PolymorphicComponent
|
|
59
|
+
*/
|
|
60
|
+
as?: ComponentType;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Given a component or element type, and a set of additional props, this builds the entire set of
|
|
64
|
+
* props for a polymorphic component.
|
|
65
|
+
*
|
|
66
|
+
* It does three things:
|
|
67
|
+
*
|
|
68
|
+
* 1. it merges the element type props with the `OwnProps`
|
|
69
|
+
* 2. it adds the `as` prop to allow for polymorphism to happen
|
|
70
|
+
* 3. it optionally obfuscates or omits the className prop if present
|
|
71
|
+
*
|
|
72
|
+
* @see PolymorphicProp
|
|
73
|
+
* @see WithObfuscatedClassName
|
|
74
|
+
*/
|
|
75
|
+
declare type PolymorphicComponentProps<ComponentType extends React.ElementType, OwnProps, ShouldObfuscateClassName extends ObfuscateClassNameMode> = Merge<WithObfuscatedClassName<React.ComponentProps<ComponentType>, ShouldObfuscateClassName>, OwnProps & PolymorphicProp<ComponentType>>;
|
|
76
|
+
declare type ElementTagNameMap = HTMLElementTagNameMap & Pick<SVGElementTagNameMap, Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>>;
|
|
77
|
+
declare type ElementByTag<TagName extends keyof ElementTagNameMap> = ElementTagNameMap[TagName];
|
|
78
|
+
declare type ElementByTagOrAny<ComponentType extends React.ElementType> = ComponentType extends keyof ElementTagNameMap ? ElementByTag<ComponentType> : any;
|
|
79
|
+
/**
|
|
80
|
+
* The function passed to React.forwardRef, but typed in a way that's prepared for polymorphism via
|
|
81
|
+
* the `as` prop. It also allows to specify if the `className` prop should be obfuscated or omitted.
|
|
82
|
+
*
|
|
83
|
+
* @see PolymorphicComponentProps
|
|
84
|
+
* @see WithObfuscatedClassName
|
|
85
|
+
*/
|
|
86
|
+
interface ForwardRefFunction<ComponentType extends React.ElementType, OwnProps, ShouldObfuscateClassName extends ObfuscateClassNameMode> {
|
|
87
|
+
(props: PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>, ref: ((instance: ElementByTagOrAny<ComponentType> | null) => void) | React.MutableRefObject<ElementByTagOrAny<ComponentType> | null> | null): React.ReactElement | null;
|
|
88
|
+
displayName?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A component that can customize the React element type that it renders (a.k.a. a polymorphic
|
|
92
|
+
* component). This is achieved by passing a prop `as={ElementType}` or `as="html-tag-name"`.
|
|
93
|
+
*
|
|
94
|
+
* It transparently takes care of forwarding refs, and properly sets the ref type depending on the
|
|
95
|
+
* element type.
|
|
96
|
+
*
|
|
97
|
+
* ## Recognizing props based on the polymorphic type
|
|
98
|
+
*
|
|
99
|
+
* The `ComponentType` argument sets the default type for the `as` prop. Whatever the `as` prop
|
|
100
|
+
* component or HTML element is, the type system will automatically allow you to pass props that are
|
|
101
|
+
* not explicitly defined by you, but that are recognized as valid props to be passed to the
|
|
102
|
+
* component you are rendering.
|
|
103
|
+
*
|
|
104
|
+
* For instance, see the following example:
|
|
105
|
+
*
|
|
106
|
+
* ```jsx
|
|
107
|
+
* <Box as="label" htmlFor="field-id">Hello</Box>
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* The `htmlFor` prop is exclusive to label elements. If you omit the `as="label"` prop, the type
|
|
111
|
+
* system will consider the `htmlFor` prop to be an error. The same happens if you pass a value of
|
|
112
|
+
* an incorrect type to such prop. For instance, the example below will issue a type error:
|
|
113
|
+
*
|
|
114
|
+
* ```jsx
|
|
115
|
+
* <Box as="label" htmlFor={123}>Hello</Box>
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* ## Omitting or obfuscating the `className` prop
|
|
119
|
+
*
|
|
120
|
+
* If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`
|
|
121
|
+
* prop instead.
|
|
122
|
+
*
|
|
123
|
+
* This is to discourage customizing design system components via custom styling, while still
|
|
124
|
+
* leaving the door open to do it as an escape hatch when the design system still has shortcomings
|
|
125
|
+
* with respect to the product designs we want to achieve.
|
|
126
|
+
*
|
|
127
|
+
* The cumbersome name also serves the purpose of aiding in easily searching for the places in the
|
|
128
|
+
* code where this escape hatch was needed, in order to identify areas where the design system
|
|
129
|
+
* components need to improve to better match our needs.
|
|
130
|
+
*
|
|
131
|
+
* This behaviour can be customized via an optional second generic argument that allows to disable
|
|
132
|
+
* this feature, or to omit the `className` altogether without replacing it with the obfuscated prop
|
|
133
|
+
* name.
|
|
134
|
+
*/
|
|
135
|
+
interface PolymorphicComponent<ComponentType extends React.ElementType, OwnProps, ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName'> {
|
|
136
|
+
<TT extends React.ElementType = ComponentType>(props: PolymorphicComponentProps<TT, OwnProps, ShouldObfuscateClassName>): React.ReactElement | null;
|
|
137
|
+
readonly $$typeof: symbol;
|
|
138
|
+
defaultProps?: Partial<PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>>;
|
|
139
|
+
propTypes?: React.WeakValidationMap<PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>>;
|
|
140
|
+
displayName?: string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* A wrapper to use React.forwardRef with polymorphic components in a type-safe manner. This is a
|
|
144
|
+
* convenience over merely using React.forwardRef directly, and then manually forcing the resulting
|
|
145
|
+
* value to be typed using `as PolymorphicComponent<…>`.
|
|
146
|
+
*
|
|
147
|
+
* @see PolymorphicComponent for details about what this type does
|
|
148
|
+
*/
|
|
149
|
+
declare function polymorphicComponent<ComponentType extends React.ElementType = 'div', OwnProps = EmptyObject, ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName'>(render: ForwardRefFunction<ComponentType, OwnProps, ShouldObfuscateClassName>): PolymorphicComponent<ComponentType, OwnProps, ShouldObfuscateClassName>;
|
|
150
|
+
export type { PolymorphicComponent, ObfuscatedClassName };
|
|
151
|
+
export { polymorphicComponent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polymorphism.js","sources":["../../src/utils/polymorphism.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport * as React from 'react'\n\ntype Merge<P1, P2> = Omit<P1, keyof P2> & P2\n\ntype EmptyObject = {\n [K in any]: never\n}\n\ntype ObfuscateClassNameMode = 'keepClassName' | 'obfuscateClassName' | 'omitClassName'\n\ntype ObfuscatedClassName = {\n /**\n * Used internally to set the `className` prop of the main container element for this component.\n *\n * Aside from the different name, the prop behaves the same as the native `className`. The only\n * reason for the name change is to discourage applying custom CSS to the design system\n * components, which are supposed to _eventually_ provide all the styling features we may need.\n *\n * This prop is meant to be used only in certain circumstances, when you really need a escape\n * hatch to apply custom styles to a component. Before reaching for this feature, try harder to\n * see if you can solve your needs with what the design system provides.\n *\n * For instance, instead of applying layout-related styles to a non-layout component, consider\n * wrapping it inside a layout component.\n *\n * @see PolymorphicComponent\n */\n exceptionallySetClassName?: string\n}\n\n/**\n * If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`\n * prop instead.\n *\n * This can be customized via the second generic parameter, as there are cases where it may be\n * needed to omit this behaviour and keep the `className`. You can also instruct it to remove the\n * `className` prop while not replacing it with the `exceptionallySetClassName` one.\n *\n * @see ObfuscatedClassName['exceptionallySetClassName'] for details about this prop\n * @see PolymorphicComponent for details about this feature\n */\ntype WithObfuscatedClassName<\n Props,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> = 'className' extends keyof Props\n ? ShouldObfuscateClassName extends 'obfuscateClassName'\n ? Omit<Props, 'className'> & ObfuscatedClassName\n : ShouldObfuscateClassName extends 'omitClassName'\n ? Omit<Props, 'className'>\n : ShouldObfuscateClassName extends 'keepClassName'\n ? Props\n : never\n : Props\n\ntype PolymorphicProp<ComponentType extends React.ElementType> = {\n /**\n * Used to instruct this component what React element to render as. It can be both a string\n * representing a HTML tag name, or a React component.\n *\n * When using this prop, the component you apply it to will also recognize in its props types\n * all the props from the component or HTML element you are rendering it as.\n *\n * Some uses for this feature:\n *\n * - Using some of our layout components, while at the same time being able to set them to use\n * semantic HTML elements needed for accessibility purposes (e.g. `nav`, `main`, etc).\n * - Using a design system link component, but have it internally use a client-side router link\n * implemented via a React component (e.g. react-router's `Link`).\n *\n * Keep in mind that not all compositions of this kind may work well, especially when composing\n * with another React component and not with a HTML tag name. In particular, if the components\n * being composed have opposing concerns of clashing features (e.g. they have contradicting\n * styles applied to them) things may not go well. In those cases prefer to nest them instead.\n *\n * @see PolymorphicComponent\n */\n as?: ComponentType\n}\n\n/**\n * Given a component or element type, and a set of additional props, this builds the entire set of\n * props for a polymorphic component.\n *\n * It does three things:\n *\n * 1. it merges the element type props with the `OwnProps`\n * 2. it adds the `as` prop to allow for polymorphism to happen\n * 3. it optionally obfuscates or omits the className prop if present\n *\n * @see PolymorphicProp\n * @see WithObfuscatedClassName\n */\ntype PolymorphicComponentProps<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> = Merge<\n WithObfuscatedClassName<React.ComponentProps<ComponentType>, ShouldObfuscateClassName>,\n OwnProps & PolymorphicProp<ComponentType>\n>\n\ntype ElementTagNameMap = HTMLElementTagNameMap &\n Pick<SVGElementTagNameMap, Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>>\n\ntype ElementByTag<TagName extends keyof ElementTagNameMap> = ElementTagNameMap[TagName]\n\ntype ElementByTagOrAny<\n ComponentType extends React.ElementType\n> = ComponentType extends keyof ElementTagNameMap ? ElementByTag<ComponentType> : any\n\n/**\n * The function passed to React.forwardRef, but typed in a way that's prepared for polymorphism via\n * the `as` prop. It also allows to specify if the `className` prop should be obfuscated or omitted.\n *\n * @see PolymorphicComponentProps\n * @see WithObfuscatedClassName\n */\ninterface ForwardRefFunction<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> {\n (\n props: PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>,\n ref:\n | ((instance: ElementByTagOrAny<ComponentType> | null) => void)\n | React.MutableRefObject<ElementByTagOrAny<ComponentType> | null>\n | null,\n ): React.ReactElement | null\n displayName?: string\n}\n\n/**\n * A component that can customize the React element type that it renders (a.k.a. a polymorphic\n * component). This is achieved by passing a prop `as={ElementType}` or `as=\"html-tag-name\"`.\n *\n * It transparently takes care of forwarding refs, and properly sets the ref type depending on the\n * element type.\n *\n * ## Recognizing props based on the polymorphic type\n *\n * The `ComponentType` argument sets the default type for the `as` prop. Whatever the `as` prop\n * component or HTML element is, the type system will automatically allow you to pass props that are\n * not explicitly defined by you, but that are recognized as valid props to be passed to the\n * component you are rendering.\n *\n * For instance, see the following example:\n *\n * ```jsx\n * <Box as=\"label\" htmlFor=\"field-id\">Hello</Box>\n * ```\n *\n * The `htmlFor` prop is exclusive to label elements. If you omit the `as=\"label\"` prop, the type\n * system will consider the `htmlFor` prop to be an error. The same happens if you pass a value of\n * an incorrect type to such prop. For instance, the example below will issue a type error:\n *\n * ```jsx\n * <Box as=\"label\" htmlFor={123}>Hello</Box>\n * ```\n *\n * ## Omitting or obfuscating the `className` prop\n *\n * If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`\n * prop instead.\n *\n * This is to discourage customizing design system components via custom styling, while still\n * leaving the door open to do it as an escape hatch when the design system still has shortcomings\n * with respect to the product designs we want to achieve.\n *\n * The cumbersome name also serves the purpose of aiding in easily searching for the places in the\n * code where this escape hatch was needed, in order to identify areas where the design system\n * components need to improve to better match our needs.\n *\n * This behaviour can be customized via an optional second generic argument that allows to disable\n * this feature, or to omit the `className` altogether without replacing it with the obfuscated prop\n * name.\n */\ninterface PolymorphicComponent<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName'\n> {\n <TT extends React.ElementType = ComponentType>(\n props: PolymorphicComponentProps<TT, OwnProps, ShouldObfuscateClassName>,\n ): React.ReactElement | null\n readonly $$typeof: symbol\n defaultProps?: Partial<\n PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>\n >\n propTypes?: React.WeakValidationMap<\n PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>\n >\n displayName?: string\n}\n\n/**\n * A wrapper to use React.forwardRef with polymorphic components in a type-safe manner. This is a\n * convenience over merely using React.forwardRef directly, and then manually forcing the resulting\n * value to be typed using `as PolymorphicComponent<…>`.\n *\n * @see PolymorphicComponent for details about what this type does\n */\nfunction polymorphicComponent<\n ComponentType extends React.ElementType = 'div',\n OwnProps = EmptyObject,\n ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName'\n>(render: ForwardRefFunction<ComponentType, OwnProps, ShouldObfuscateClassName>) {\n return React.forwardRef(render) as PolymorphicComponent<\n ComponentType,\n OwnProps,\n ShouldObfuscateClassName\n >\n}\n\nexport type { PolymorphicComponent, ObfuscatedClassName }\nexport { polymorphicComponent }\n"],"names":["render","React"],"mappings":"wHA4MA,SAIEA,UACSC,aAAiBD"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@doist/reactist",
|
|
3
3
|
"description": "Open source React components by Doist",
|
|
4
4
|
"author": "Henning Muszynski <henning@doist.com> (http://doist.com)",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "10.0.0-beta.12",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/Doist/reactist#readme",
|
|
8
8
|
"repository": "git+https://github.com/Doist/reactist.git",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"styles"
|
|
22
22
|
],
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": "
|
|
25
|
-
"npm": "^
|
|
24
|
+
"node": "<=16.10.0",
|
|
25
|
+
"npm": "^7.0.0"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"postinstall": "patch-package",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"type-check": "tsc --noEmit -p ./tsconfig.json",
|
|
40
40
|
"lint": "tsdx lint src stories",
|
|
41
41
|
"storybook": "start-storybook -p 6006",
|
|
42
|
-
"prettify": "prettier --write \"./**/*.{js,jsx,ts,tsx,json,css,scss,less,md}\""
|
|
42
|
+
"prettify": "prettier --write \"./**/*.{js,jsx,ts,tsx,json,css,scss,less,md,mdx}\""
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"classnames": "^2.2.5",
|
|
46
|
+
"prop-types": "^15.6.2",
|
|
46
47
|
"react": "^15.5.4 || ^16.2.0",
|
|
47
|
-
"react-dom": "^15.5.4 || ^16.2.0"
|
|
48
|
-
"prop-types": "^15.6.2"
|
|
48
|
+
"react-dom": "^15.5.4 || ^16.2.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@babel/core": "^7.9.6",
|
|
@@ -59,27 +59,28 @@
|
|
|
59
59
|
"@babel/preset-react": "^7.0.0",
|
|
60
60
|
"@babel/preset-typescript": "^7.10.1",
|
|
61
61
|
"@babel/register": "^7.0.0",
|
|
62
|
-
"@doist/eslint-config": "^
|
|
62
|
+
"@doist/eslint-config": "^6.0.2",
|
|
63
63
|
"@doist/prettier-config": "^3.0.5",
|
|
64
|
-
"@storybook/addon-actions": "^
|
|
65
|
-
"@storybook/addon-
|
|
66
|
-
"@storybook/addon-
|
|
67
|
-
"@storybook/addon-knobs": "^
|
|
68
|
-
"@storybook/addon-links": "^
|
|
69
|
-
"@storybook/addon-options": "^5.3.
|
|
70
|
-
"@storybook/
|
|
71
|
-
"@storybook/
|
|
72
|
-
"@
|
|
73
|
-
"@testing-library/
|
|
74
|
-
"@testing-library/
|
|
64
|
+
"@storybook/addon-actions": "^6.3.10",
|
|
65
|
+
"@storybook/addon-controls": "^6.3.10",
|
|
66
|
+
"@storybook/addon-docs": "^6.3.10",
|
|
67
|
+
"@storybook/addon-knobs": "^6.3.1",
|
|
68
|
+
"@storybook/addon-links": "^6.3.10",
|
|
69
|
+
"@storybook/addon-options": "^5.3.21",
|
|
70
|
+
"@storybook/addon-postcss": "^2.0.0",
|
|
71
|
+
"@storybook/addons": "^6.3.10",
|
|
72
|
+
"@storybook/react": "^6.3.10",
|
|
73
|
+
"@testing-library/jest-dom": "^5.14.1",
|
|
74
|
+
"@testing-library/react": "^12.0.0",
|
|
75
|
+
"@testing-library/user-event": "^13.2.1",
|
|
75
76
|
"@types/cheerio": "^0.22.22",
|
|
76
77
|
"@types/classnames": "^2.2.10",
|
|
77
78
|
"@types/enzyme": "^3.10.7",
|
|
78
79
|
"@types/enzyme-adapter-react-16": "^1.0.6",
|
|
79
80
|
"@types/react": "^16.9.52",
|
|
80
81
|
"@types/react-dom": "^16.9.8",
|
|
81
|
-
"@typescript-eslint/eslint-plugin": "^4.
|
|
82
|
-
"@typescript-eslint/parser": "^4.
|
|
82
|
+
"@typescript-eslint/eslint-plugin": "^4.22.1",
|
|
83
|
+
"@typescript-eslint/parser": "^4.22.1",
|
|
83
84
|
"autoprefixer": "^9.8.0",
|
|
84
85
|
"babel-core": "^7.0.0-bridge.0",
|
|
85
86
|
"babel-loader": "^8.1.0",
|
|
@@ -89,11 +90,11 @@
|
|
|
89
90
|
"enzyme": "^3.11.0",
|
|
90
91
|
"enzyme-adapter-react-16": "^1.15.5",
|
|
91
92
|
"enzyme-to-json": "^3.6.1",
|
|
92
|
-
"eslint": "^7.
|
|
93
|
+
"eslint": "^7.25.0",
|
|
93
94
|
"eslint-config-prettier": "^6.12.0",
|
|
94
95
|
"eslint-plugin-jest": "^24.1.0",
|
|
95
96
|
"eslint-plugin-prettier": "^3.1.4",
|
|
96
|
-
"eslint-plugin-react": "^7.
|
|
97
|
+
"eslint-plugin-react": "^7.23.2",
|
|
97
98
|
"husky": "^4.3.0",
|
|
98
99
|
"jest": "^24.7.1",
|
|
99
100
|
"jest-environment-jsdom-sixteen": "^1.0.3",
|
|
@@ -110,7 +111,6 @@
|
|
|
110
111
|
"react-docgen-typescript-loader": "^3.7.2",
|
|
111
112
|
"react-dom": "^16.13.1",
|
|
112
113
|
"react-is": "^16.13.1",
|
|
113
|
-
"react-storybook-addon-chapters": "^3.1.7",
|
|
114
114
|
"react-svg-loader": "^3.0.3",
|
|
115
115
|
"react-test-renderer": "^16.13.1",
|
|
116
116
|
"rimraf": "^3.0.2",
|
|
@@ -125,9 +125,13 @@
|
|
|
125
125
|
"webpack": "^4.43.0"
|
|
126
126
|
},
|
|
127
127
|
"dependencies": {
|
|
128
|
+
"@reach/dialog": "^0.16.0",
|
|
129
|
+
"@types/testing-library__jest-dom": "^5.14.1",
|
|
128
130
|
"dayjs": "^1.8.10",
|
|
129
131
|
"patch-package": "^6.4.6",
|
|
132
|
+
"react-focus-lock": "^2.5.2",
|
|
130
133
|
"react-keyed-flatten-children": "^1.3.0",
|
|
134
|
+
"react-markdown": "^5.0.3",
|
|
131
135
|
"reakit": "1.3.0"
|
|
132
136
|
}
|
|
133
137
|
}
|