@doist/reactist 28.7.2 → 28.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/reactist.cjs.development.js +2091 -3811
- 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/avatar/avatar.js +35 -30
- package/es/avatar/avatar.js.map +1 -1
- package/es/avatar/utils.js +19 -22
- package/es/avatar/utils.js.map +1 -1
- package/es/badge/badge.js +5 -16
- package/es/badge/badge.js.map +1 -1
- package/es/banner/banner.js +39 -115
- package/es/banner/banner.js.map +1 -1
- package/es/banner/banner.module.css.js +1 -1
- package/es/base-field/base-field.js +80 -162
- package/es/base-field/base-field.js.map +1 -1
- package/es/base-field/base-field.module.css.js +1 -1
- package/es/box/box.js +61 -137
- package/es/box/box.js.map +1 -1
- package/es/button/button.js +42 -95
- package/es/button/button.js.map +1 -1
- package/es/checkbox-field/checkbox-field.js +46 -73
- package/es/checkbox-field/checkbox-field.js.map +1 -1
- package/es/checkbox-field/checkbox-field.module.css.js +1 -1
- package/es/checkbox-field/checkbox-icon.js +28 -55
- package/es/checkbox-field/checkbox-icon.js.map +1 -1
- package/es/checkbox-field/use-fork-ref.js +29 -25
- package/es/checkbox-field/use-fork-ref.js.map +1 -1
- package/es/columns/columns.js +22 -46
- package/es/columns/columns.js.map +1 -1
- package/es/columns/columns.module.css.js +1 -1
- package/es/components/color-picker/color-picker.js +45 -66
- package/es/components/color-picker/color-picker.js.map +1 -1
- package/es/components/deprecated-button/deprecated-button.js +11 -34
- package/es/components/deprecated-button/deprecated-button.js.map +1 -1
- package/es/components/deprecated-dropdown/dropdown.js +136 -197
- package/es/components/deprecated-dropdown/dropdown.js.map +1 -1
- package/es/components/deprecated-input/input.js +6 -10
- package/es/components/deprecated-input/input.js.map +1 -1
- package/es/components/deprecated-select/select.js +7 -31
- package/es/components/deprecated-select/select.js.map +1 -1
- package/es/components/key-capturer/key-capturer.js +130 -171
- package/es/components/key-capturer/key-capturer.js.map +1 -1
- package/es/components/keyboard-shortcut/keyboard-shortcut.js +48 -79
- package/es/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/es/components/progress-bar/progress-bar.js +8 -20
- package/es/components/progress-bar/progress-bar.js.map +1 -1
- package/es/components/time/time-utils.js +52 -64
- package/es/components/time/time-utils.js.map +1 -1
- package/es/components/time/time.js +90 -114
- package/es/components/time/time.js.map +1 -1
- package/es/divider/divider.js +4 -13
- package/es/divider/divider.js.map +1 -1
- package/es/heading/heading.js +19 -28
- package/es/heading/heading.js.map +1 -1
- package/es/hidden/hidden.js +36 -45
- package/es/hidden/hidden.js.map +1 -1
- package/es/hidden-visually/hidden-visually.js +7 -13
- package/es/hidden-visually/hidden-visually.js.map +1 -1
- package/es/icons/alert-icon.js +18 -64
- package/es/icons/alert-icon.js.map +1 -1
- package/es/icons/banner-icon.js +25 -97
- package/es/icons/banner-icon.js.map +1 -1
- package/es/icons/close-icon.js +3 -9
- package/es/icons/close-icon.js.map +1 -1
- package/es/icons/password-hidden-icon.js +6 -23
- package/es/icons/password-hidden-icon.js.map +1 -1
- package/es/icons/password-visible-icon.js +5 -16
- package/es/icons/password-visible-icon.js.map +1 -1
- package/es/inline/inline.js +8 -23
- package/es/inline/inline.js.map +1 -1
- package/es/loading/loading.js +17 -28
- package/es/loading/loading.js.map +1 -1
- package/es/menu/menu.js +127 -260
- package/es/menu/menu.js.map +1 -1
- package/es/modal/modal.js +143 -272
- package/es/modal/modal.js.map +1 -1
- package/es/modal/modal.module.css.js +1 -1
- package/es/notice/notice.js +8 -21
- package/es/notice/notice.js.map +1 -1
- package/es/notice/notice.module.css.js +1 -1
- package/es/password-field/password-field.js +10 -24
- package/es/password-field/password-field.js.map +1 -1
- package/es/prose/prose.js +10 -15
- package/es/prose/prose.js.map +1 -1
- package/es/select-field/select-field.js +14 -51
- package/es/select-field/select-field.js.map +1 -1
- package/es/spinner/spinner.js +6 -20
- package/es/spinner/spinner.js.map +1 -1
- package/es/stack/stack.js +15 -27
- package/es/stack/stack.js.map +1 -1
- package/es/switch-field/switch-field.js +38 -73
- package/es/switch-field/switch-field.js.map +1 -1
- package/es/switch-field/switch-field.module.css.js +1 -1
- package/es/tabs/tabs.js +120 -207
- package/es/tabs/tabs.js.map +1 -1
- package/es/text/text.js +16 -25
- package/es/text/text.js.map +1 -1
- package/es/text-area/text-area.js +54 -111
- package/es/text-area/text-area.js.map +1 -1
- package/es/text-field/text-field.js +30 -84
- package/es/text-field/text-field.js.map +1 -1
- package/es/text-link/text-link.js +9 -20
- package/es/text-link/text-link.js.map +1 -1
- package/es/text-link/text-link.module.css.js +1 -1
- package/es/toast/static-toast.js +35 -70
- package/es/toast/static-toast.js.map +1 -1
- package/es/toast/toast-animation.js +121 -159
- package/es/toast/toast-animation.js.map +1 -1
- package/es/toast/use-toasts.js +134 -197
- package/es/toast/use-toasts.js.map +1 -1
- package/es/tooltip/tooltip.js +31 -69
- package/es/tooltip/tooltip.js.map +1 -1
- package/es/utils/common-helpers.js +9 -13
- package/es/utils/common-helpers.js.map +1 -1
- package/es/utils/polymorphism.js +7 -8
- package/es/utils/polymorphism.js.map +1 -1
- package/es/utils/responsive-props.js +57 -66
- package/es/utils/responsive-props.js.map +1 -1
- package/lib/avatar/avatar.d.ts +21 -21
- package/lib/avatar/avatar.js +69 -1
- package/lib/avatar/avatar.js.map +1 -1
- package/lib/avatar/avatar.module.css.js +7 -1
- package/lib/avatar/avatar.module.css.js.map +1 -1
- package/lib/avatar/index.d.ts +1 -1
- package/lib/avatar/utils.d.ts +3 -3
- package/lib/avatar/utils.js +30 -1
- package/lib/avatar/utils.js.map +1 -1
- package/lib/badge/badge.d.ts +15 -15
- package/lib/badge/badge.js +36 -1
- package/lib/badge/badge.js.map +1 -1
- package/lib/badge/badge.module.css.js +7 -1
- package/lib/badge/badge.module.css.js.map +1 -1
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +87 -87
- package/lib/banner/banner.js +79 -1
- package/lib/banner/banner.js.map +1 -1
- package/lib/banner/banner.module.css.js +7 -1
- package/lib/banner/banner.module.css.js.map +1 -1
- package/lib/banner/index.d.ts +2 -2
- package/lib/banner/story-promo-image.d.ts +4 -4
- package/lib/base-field/base-field.d.ts +139 -139
- package/lib/base-field/base-field.js +127 -1
- package/lib/base-field/base-field.js.map +1 -1
- package/lib/base-field/base-field.module.css.js +7 -1
- package/lib/base-field/base-field.module.css.js.map +1 -1
- package/lib/base-field/index.d.ts +1 -1
- package/lib/box/box.d.ts +73 -73
- package/lib/box/box.js +103 -1
- package/lib/box/box.js.map +1 -1
- package/lib/box/box.module.css.js +7 -1
- package/lib/box/box.module.css.js.map +1 -1
- package/lib/box/gap.module.css.js +7 -1
- package/lib/box/gap.module.css.js.map +1 -1
- package/lib/box/index.d.ts +1 -1
- package/lib/box/margin.module.css.js +7 -1
- package/lib/box/margin.module.css.js.map +1 -1
- package/lib/box/padding.module.css.js +7 -1
- package/lib/box/padding.module.css.js.map +1 -1
- package/lib/box/width.module.css.js +7 -1
- package/lib/box/width.module.css.js.map +1 -1
- package/lib/button/button.d.ts +127 -127
- package/lib/button/button.js +86 -1
- package/lib/button/button.js.map +1 -1
- package/lib/button/button.module.css.js +7 -1
- package/lib/button/button.module.css.js.map +1 -1
- package/lib/button/index.d.ts +1 -1
- package/lib/checkbox-field/checkbox-field.d.ts +40 -40
- package/lib/checkbox-field/checkbox-field.js +82 -1
- package/lib/checkbox-field/checkbox-field.js.map +1 -1
- package/lib/checkbox-field/checkbox-field.module.css.js +7 -1
- package/lib/checkbox-field/checkbox-field.module.css.js.map +1 -1
- package/lib/checkbox-field/checkbox-icon.d.ts +8 -8
- package/lib/checkbox-field/checkbox-icon.js +59 -1
- package/lib/checkbox-field/checkbox-icon.js.map +1 -1
- package/lib/checkbox-field/index.d.ts +1 -1
- package/lib/checkbox-field/use-fork-ref.d.ts +11 -11
- package/lib/checkbox-field/use-fork-ref.js +42 -1
- package/lib/checkbox-field/use-fork-ref.js.map +1 -1
- package/lib/columns/columns.d.ts +20 -20
- package/lib/columns/columns.js +57 -1
- package/lib/columns/columns.js.map +1 -1
- package/lib/columns/columns.module.css.js +7 -1
- package/lib/columns/columns.module.css.js.map +1 -1
- package/lib/columns/index.d.ts +1 -1
- package/lib/components/color-picker/color-picker.d.ts +29 -29
- package/lib/components/color-picker/color-picker.js +86 -1
- package/lib/components/color-picker/color-picker.js.map +1 -1
- package/lib/components/color-picker/index.d.ts +3 -3
- package/lib/components/color-picker/index.js +11 -1
- package/lib/components/color-picker/index.js.map +1 -1
- package/lib/components/deprecated-button/deprecated-button.d.ts +54 -54
- package/lib/components/deprecated-button/deprecated-button.js +49 -1
- package/lib/components/deprecated-button/deprecated-button.js.map +1 -1
- package/lib/components/deprecated-button/index.d.ts +4 -4
- package/lib/components/deprecated-button/index.js +9 -1
- package/lib/components/deprecated-button/index.js.map +1 -1
- package/lib/components/deprecated-dropdown/dropdown.d.ts +55 -55
- package/lib/components/deprecated-dropdown/dropdown.js +182 -1
- package/lib/components/deprecated-dropdown/dropdown.js.map +1 -1
- package/lib/components/deprecated-dropdown/index.d.ts +2 -2
- package/lib/components/deprecated-dropdown/index.js +9 -1
- package/lib/components/deprecated-dropdown/index.js.map +1 -1
- package/lib/components/deprecated-input/index.d.ts +2 -2
- package/lib/components/deprecated-input/index.js +9 -1
- package/lib/components/deprecated-input/index.js.map +1 -1
- package/lib/components/deprecated-input/input.d.ts +10 -10
- package/lib/components/deprecated-input/input.js +41 -1
- package/lib/components/deprecated-input/input.js.map +1 -1
- package/lib/components/deprecated-select/index.d.ts +2 -2
- package/lib/components/deprecated-select/index.js +9 -1
- package/lib/components/deprecated-select/index.js.map +1 -1
- package/lib/components/deprecated-select/select.d.ts +33 -33
- package/lib/components/deprecated-select/select.js +43 -1
- package/lib/components/deprecated-select/select.js.map +1 -1
- package/lib/components/icons/CloseIcon.svg.d.ts +3 -3
- package/lib/components/icons/ThinQuestionMarkIcon.svg.d.ts +3 -3
- package/lib/components/icons/ThreeDotsIcon.svg.d.ts +12 -12
- package/lib/components/key-capturer/index.d.ts +3 -3
- package/lib/components/key-capturer/index.js +11 -1
- package/lib/components/key-capturer/index.js.map +1 -1
- package/lib/components/key-capturer/key-capturer.d.ts +40 -40
- package/lib/components/key-capturer/key-capturer.js +171 -1
- package/lib/components/key-capturer/key-capturer.js.map +1 -1
- package/lib/components/keyboard-shortcut/index.d.ts +2 -2
- package/lib/components/keyboard-shortcut/index.js +9 -1
- package/lib/components/keyboard-shortcut/index.js.map +1 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.d.ts +44 -44
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js +97 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/lib/components/progress-bar/index.d.ts +2 -2
- package/lib/components/progress-bar/index.js +9 -1
- package/lib/components/progress-bar/index.js.map +1 -1
- package/lib/components/progress-bar/progress-bar.d.ts +14 -14
- package/lib/components/progress-bar/progress-bar.js +44 -1
- package/lib/components/progress-bar/progress-bar.js.map +1 -1
- package/lib/components/progress-bar/progress-bar.module.css.js +7 -1
- package/lib/components/progress-bar/progress-bar.module.css.js.map +1 -1
- package/lib/components/time/index.d.ts +2 -2
- package/lib/components/time/index.js +9 -1
- package/lib/components/time/index.js.map +1 -1
- package/lib/components/time/time-utils.d.ts +19 -19
- package/lib/components/time/time-utils.js +69 -1
- package/lib/components/time/time-utils.js.map +1 -1
- package/lib/components/time/time.d.ts +39 -39
- package/lib/components/time/time.js +124 -1
- package/lib/components/time/time.js.map +1 -1
- package/lib/divider/divider.d.ts +8 -8
- package/lib/divider/divider.js +36 -1
- package/lib/divider/divider.js.map +1 -1
- package/lib/divider/divider.module.css.js +7 -1
- package/lib/divider/divider.module.css.js.map +1 -1
- package/lib/divider/index.d.ts +1 -1
- package/lib/heading/heading.d.ts +112 -112
- package/lib/heading/heading.js +51 -1
- package/lib/heading/heading.js.map +1 -1
- package/lib/heading/heading.module.css.js +7 -1
- package/lib/heading/heading.module.css.js.map +1 -1
- package/lib/heading/index.d.ts +1 -1
- package/lib/hidden/hidden.d.ts +49 -49
- package/lib/hidden/hidden.js +70 -1
- package/lib/hidden/hidden.js.map +1 -1
- package/lib/hidden/hidden.module.css.js +7 -1
- package/lib/hidden/hidden.module.css.js.map +1 -1
- package/lib/hidden/index.d.ts +1 -1
- package/lib/hidden-visually/hidden-visually.d.ts +11 -11
- package/lib/hidden-visually/hidden-visually.js +40 -1
- package/lib/hidden-visually/hidden-visually.js.map +1 -1
- package/lib/hidden-visually/hidden-visually.module.css.js +7 -1
- package/lib/hidden-visually/hidden-visually.module.css.js.map +1 -1
- package/lib/hidden-visually/index.d.ts +1 -1
- package/lib/hooks/use-previous/index.d.ts +1 -1
- package/lib/hooks/use-previous/use-previous.d.ts +15 -15
- package/lib/icons/alert-icon.d.ts +6 -6
- package/lib/icons/alert-icon.js +56 -1
- package/lib/icons/alert-icon.js.map +1 -1
- package/lib/icons/banner-icon.d.ts +6 -6
- package/lib/icons/banner-icon.js +68 -1
- package/lib/icons/banner-icon.js.map +1 -1
- package/lib/icons/banner-icon.module.css.js +7 -1
- package/lib/icons/banner-icon.module.css.js.map +1 -1
- package/lib/icons/close-icon.d.ts +3 -3
- package/lib/icons/close-icon.js +33 -1
- package/lib/icons/close-icon.js.map +1 -1
- package/lib/icons/password-hidden-icon.d.ts +3 -3
- package/lib/icons/password-hidden-icon.js +36 -1
- package/lib/icons/password-hidden-icon.js.map +1 -1
- package/lib/icons/password-visible-icon.d.ts +3 -3
- package/lib/icons/password-visible-icon.js +35 -1
- package/lib/icons/password-visible-icon.js.map +1 -1
- package/lib/index.d.ts +38 -38
- package/lib/index.js +106 -1
- package/lib/index.js.map +1 -1
- package/lib/inline/index.d.ts +1 -1
- package/lib/inline/inline.d.ts +12 -12
- package/lib/inline/inline.js +40 -1
- package/lib/inline/inline.js.map +1 -1
- package/lib/loading/index.d.ts +1 -1
- package/lib/loading/loading.d.ts +26 -26
- package/lib/loading/loading.js +49 -1
- package/lib/loading/loading.js.map +1 -1
- package/lib/menu/index.d.ts +2 -2
- package/lib/menu/menu.d.ts +128 -128
- package/lib/menu/menu.js +179 -1
- package/lib/menu/menu.js.map +1 -1
- package/lib/modal/index.d.ts +1 -1
- package/lib/modal/modal-stories-components.d.ts +47 -47
- package/lib/modal/modal.d.ts +185 -185
- package/lib/modal/modal.js +209 -1
- package/lib/modal/modal.js.map +1 -1
- package/lib/modal/modal.module.css.js +7 -1
- package/lib/modal/modal.module.css.js.map +1 -1
- package/lib/notice/index.d.ts +1 -1
- package/lib/notice/notice.d.ts +10 -10
- package/lib/notice/notice.js +42 -1
- package/lib/notice/notice.js.map +1 -1
- package/lib/notice/notice.module.css.js +7 -1
- package/lib/notice/notice.module.css.js.map +1 -1
- package/lib/password-field/index.d.ts +1 -1
- package/lib/password-field/password-field.d.ts +10 -10
- package/lib/password-field/password-field.js +43 -1
- package/lib/password-field/password-field.js.map +1 -1
- package/lib/prose/index.d.ts +2 -2
- package/lib/prose/prose-example.d.ts +1 -1
- package/lib/prose/prose.d.ts +44 -44
- package/lib/prose/prose.js +42 -1
- package/lib/prose/prose.js.map +1 -1
- package/lib/prose/prose.module.css.js +7 -1
- package/lib/prose/prose.module.css.js.map +1 -1
- package/lib/select-field/index.d.ts +1 -1
- package/lib/select-field/select-field.d.ts +7 -7
- package/lib/select-field/select-field.js +48 -1
- package/lib/select-field/select-field.js.map +1 -1
- package/lib/select-field/select-field.module.css.js +7 -1
- package/lib/select-field/select-field.module.css.js.map +1 -1
- package/lib/spinner/index.d.ts +1 -1
- package/lib/spinner/spinner.d.ts +5 -5
- package/lib/spinner/spinner.js +36 -1
- package/lib/spinner/spinner.js.map +1 -1
- package/lib/spinner/spinner.module.css.js +7 -1
- package/lib/spinner/spinner.module.css.js.map +1 -1
- package/lib/stack/index.d.ts +1 -1
- package/lib/stack/stack.d.ts +15 -15
- package/lib/stack/stack.js +52 -1
- package/lib/stack/stack.js.map +1 -1
- package/lib/switch-field/index.d.ts +1 -1
- package/lib/switch-field/switch-field.d.ts +19 -19
- package/lib/switch-field/switch-field.js +74 -1
- package/lib/switch-field/switch-field.js.map +1 -1
- package/lib/switch-field/switch-field.module.css.js +7 -1
- package/lib/switch-field/switch-field.module.css.js.map +1 -1
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/tabs.d.ts +125 -125
- package/lib/tabs/tabs.js +177 -1
- package/lib/tabs/tabs.js.map +1 -1
- package/lib/tabs/tabs.module.css.js +7 -1
- package/lib/tabs/tabs.module.css.js.map +1 -1
- package/lib/text/index.d.ts +1 -1
- package/lib/text/text.d.ts +47 -47
- package/lib/text/text.js +49 -1
- package/lib/text/text.js.map +1 -1
- package/lib/text/text.module.css.js +7 -1
- package/lib/text/text.module.css.js.map +1 -1
- package/lib/text-area/index.d.ts +1 -1
- package/lib/text-area/text-area.d.ts +39 -39
- package/lib/text-area/text-area.js +92 -1
- package/lib/text-area/text-area.js.map +1 -1
- package/lib/text-area/text-area.module.css.js +7 -1
- package/lib/text-area/text-area.module.css.js.map +1 -1
- package/lib/text-field/index.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +18 -18
- package/lib/text-field/text-field.js +63 -1
- package/lib/text-field/text-field.js.map +1 -1
- package/lib/text-field/text-field.module.css.js +7 -1
- package/lib/text-field/text-field.module.css.js.map +1 -1
- package/lib/text-link/index.d.ts +1 -1
- package/lib/text-link/text-link.d.ts +9 -9
- package/lib/text-link/text-link.js +41 -1
- package/lib/text-link/text-link.js.map +1 -1
- package/lib/text-link/text-link.module.css.js +7 -1
- package/lib/text-link/text-link.module.css.js.map +1 -1
- package/lib/toast/index.d.ts +4 -4
- package/lib/toast/static-toast.d.ts +63 -63
- package/lib/toast/static-toast.js +59 -1
- package/lib/toast/static-toast.js.map +1 -1
- package/lib/toast/toast-animation.d.ts +50 -50
- package/lib/toast/toast-animation.js +141 -1
- package/lib/toast/toast-animation.js.map +1 -1
- package/lib/toast/toast.module.css.js +7 -1
- package/lib/toast/toast.module.css.js.map +1 -1
- package/lib/toast/use-toasts.d.ts +132 -132
- package/lib/toast/use-toasts.js +166 -1
- package/lib/toast/use-toasts.js.map +1 -1
- package/lib/tooltip/index.d.ts +2 -2
- package/lib/tooltip/tooltip.d.ts +72 -72
- package/lib/tooltip/tooltip.js +67 -1
- package/lib/tooltip/tooltip.js.map +1 -1
- package/lib/tooltip/tooltip.module.css.js +7 -1
- package/lib/tooltip/tooltip.module.css.js.map +1 -1
- package/lib/utils/common-helpers.d.ts +2 -2
- package/lib/utils/common-helpers.js +44 -1
- package/lib/utils/common-helpers.js.map +1 -1
- package/lib/utils/common-types.d.ts +42 -42
- package/lib/utils/polymorphism.d.ts +135 -135
- package/lib/utils/polymorphism.js +39 -1
- package/lib/utils/polymorphism.js.map +1 -1
- package/lib/utils/responsive-props.d.ts +44 -44
- package/lib/utils/responsive-props.js +70 -1
- package/lib/utils/responsive-props.js.map +1 -1
- package/lib/utils/storybook-helper.d.ts +55 -0
- package/lib/utils/test-helpers.d.ts +22 -22
- package/package.json +14 -18
- package/styles/avatar.css +2 -2
- package/styles/avatar.module.css.css +1 -1
- package/styles/badge.css +2 -2
- package/styles/badge.module.css.css +1 -1
- package/styles/banner.css +6 -6
- package/styles/banner.module.css.css +1 -1
- package/styles/base-field.css +4 -4
- package/styles/base-field.module.css.css +1 -1
- package/styles/box.css +1 -1
- package/styles/box.module.css.css +1 -1
- package/styles/button.css +4 -4
- package/styles/button.module.css.css +1 -1
- package/styles/checkbox-field.css +3 -3
- package/styles/checkbox-field.module.css.css +1 -1
- package/styles/columns.css +1 -1
- package/styles/divider.css +1 -1
- package/styles/heading.css +2 -2
- package/styles/heading.module.css.css +1 -1
- package/styles/hidden-visually.css +2 -2
- package/styles/hidden-visually.module.css.css +1 -1
- package/styles/hidden.css +1 -1
- package/styles/index.css +4 -4
- package/styles/loading.css +2 -2
- package/styles/menu.css +1 -1
- package/styles/modal.css +5 -5
- package/styles/modal.module.css.css +1 -1
- package/styles/notice.css +1 -1
- package/styles/password-field.css +7 -7
- package/styles/progress-bar.module.css.css +1 -1
- package/styles/prose.css +2 -2
- package/styles/prose.module.css.css +1 -1
- package/styles/reactist.css +30 -30
- package/styles/select-field.css +5 -5
- package/styles/select-field.module.css.css +1 -1
- package/styles/spinner.css +1 -1
- package/styles/static-toast.css +6 -6
- package/styles/switch-field.css +6 -6
- package/styles/switch-field.module.css.css +1 -1
- package/styles/tabs.css +2 -2
- package/styles/tabs.module.css.css +1 -1
- package/styles/text-area.css +5 -5
- package/styles/text-area.module.css.css +1 -1
- package/styles/text-field.css +5 -5
- package/styles/text-field.module.css.css +1 -1
- package/styles/text-link.css +2 -2
- package/styles/text-link.module.css.css +1 -1
- package/styles/text.css +2 -2
- package/styles/text.module.css.css +1 -1
- package/styles/toast.module.css.css +1 -1
- package/styles/tooltip.css +2 -2
- package/styles/tooltip.module.css.css +1 -1
- package/styles/use-toasts.css +6 -6
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -91
- package/es/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
- package/lib/_virtual/_rollupPluginBabelHelpers.js +0 -2
- package/lib/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
package/lib/tabs/tabs.js
CHANGED
|
@@ -1,2 +1,178 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var classNames = require('classnames');
|
|
8
|
+
var react = require('@ariakit/react');
|
|
9
|
+
var box = require('../box/box.js');
|
|
10
|
+
var inline = require('../inline/inline.js');
|
|
11
|
+
var tabs_module = require('./tabs.module.css.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
function _interopNamespace(e) {
|
|
16
|
+
if (e && e.__esModule) return e;
|
|
17
|
+
var n = Object.create(null);
|
|
18
|
+
if (e) {
|
|
19
|
+
Object.keys(e).forEach(function (k) {
|
|
20
|
+
if (k !== 'default') {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return e[k]; }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
n["default"] = e;
|
|
30
|
+
return Object.freeze(n);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
34
|
+
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
35
|
+
|
|
36
|
+
var TabsContext = React__namespace.createContext(null);
|
|
37
|
+
/**
|
|
38
|
+
* Used to group components that compose a set of tabs. There can only be one active tab within the same `<Tabs>` group.
|
|
39
|
+
*/
|
|
40
|
+
function Tabs(_a) {
|
|
41
|
+
var children = _a.children, selectedId = _a.selectedId, defaultSelectedId = _a.defaultSelectedId, _b = _a.variant, variant = _b === void 0 ? 'neutral' : _b, onSelectedIdChange = _a.onSelectedIdChange;
|
|
42
|
+
var tabStore = react.useTabStore({
|
|
43
|
+
defaultSelectedId: defaultSelectedId,
|
|
44
|
+
selectedId: selectedId,
|
|
45
|
+
setSelectedId: onSelectedIdChange
|
|
46
|
+
});
|
|
47
|
+
var actualSelectedId = tabStore.useState('selectedId');
|
|
48
|
+
var memoizedTabState = React__namespace.useMemo(function () { var _a; return ({ tabStore: tabStore, variant: variant, selectedId: (_a = selectedId !== null && selectedId !== void 0 ? selectedId : actualSelectedId) !== null && _a !== void 0 ? _a : null }); }, [variant, tabStore, selectedId, actualSelectedId]);
|
|
49
|
+
return React__namespace.createElement(TabsContext.Provider, { value: memoizedTabState }, children);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Represents the individual tab elements within the group. Each `<Tab>` must have a corresponding `<TabPanel>` component.
|
|
53
|
+
*/
|
|
54
|
+
var Tab = React__namespace.forwardRef(function Tab(_a, ref) {
|
|
55
|
+
var children = _a.children, id = _a.id, disabled = _a.disabled, exceptionallySetClassName = _a.exceptionallySetClassName, render = _a.render, onClick = _a.onClick;
|
|
56
|
+
var tabContextValue = React__namespace.useContext(TabsContext);
|
|
57
|
+
if (!tabContextValue)
|
|
58
|
+
return null;
|
|
59
|
+
var variant = tabContextValue.variant, tabStore = tabContextValue.tabStore;
|
|
60
|
+
var className = classNames__default["default"](exceptionallySetClassName, tabs_module["default"].tab, tabs_module["default"]["tab-".concat(variant)]);
|
|
61
|
+
return (React__namespace.createElement(react.Tab, { id: id, ref: ref, disabled: disabled, store: tabStore, render: render, className: className, onClick: onClick }, children));
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* A component used to group `<Tab>` elements together.
|
|
65
|
+
*/
|
|
66
|
+
function TabList(_a) {
|
|
67
|
+
var children = _a.children, space = _a.space, _b = _a.width, width = _b === void 0 ? 'maxContent' : _b, _c = _a.align, align = _c === void 0 ? 'start' : _c, exceptionallySetClassName = _a.exceptionallySetClassName, props = tslib.__rest(_a, ["children", "space", "width", "align", "exceptionallySetClassName"]);
|
|
68
|
+
var tabListRef = React__namespace.useRef(null);
|
|
69
|
+
var tabListPrevWidthRef = React__namespace.useRef(0);
|
|
70
|
+
var tabContextValue = React__namespace.useContext(TabsContext);
|
|
71
|
+
var _d = React__namespace.useState(null), selectedTabElement = _d[0], setSelectedTabElement = _d[1];
|
|
72
|
+
var _e = React__namespace.useState({}), selectedTabStyle = _e[0], setSelectedTabStyle = _e[1];
|
|
73
|
+
var selectedId = tabContextValue === null || tabContextValue === void 0 ? void 0 : tabContextValue.tabStore.useState('selectedId');
|
|
74
|
+
var updateSelectedTabPosition = React__namespace.useCallback(function updateSelectedTabPositionCallback() {
|
|
75
|
+
if (!selectedId || !tabListRef.current) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
var tabs = tabListRef.current.querySelectorAll('[role="tab"]');
|
|
79
|
+
var selectedTab = Array.from(tabs).find(function (tab) { return tab.getAttribute('id') === selectedId; });
|
|
80
|
+
if (selectedTab) {
|
|
81
|
+
setSelectedTabElement(selectedTab);
|
|
82
|
+
setSelectedTabStyle({
|
|
83
|
+
left: "".concat(selectedTab.offsetLeft, "px"),
|
|
84
|
+
width: "".concat(selectedTab.offsetWidth, "px")
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}, [selectedId]);
|
|
88
|
+
React__namespace.useEffect(function updateSelectedTabPositionOnTabChange() {
|
|
89
|
+
updateSelectedTabPosition();
|
|
90
|
+
},
|
|
91
|
+
// `selectedId` is a dependency to ensure the effect runs when the selected tab changes
|
|
92
|
+
[selectedId, updateSelectedTabPosition]);
|
|
93
|
+
React__namespace.useEffect(function observeTabListWidthChange() {
|
|
94
|
+
var animationFrameId = null;
|
|
95
|
+
var tabListObserver = new ResizeObserver(function (_a) {
|
|
96
|
+
var entry = _a[0];
|
|
97
|
+
var width = entry === null || entry === void 0 ? void 0 : entry.contentRect.width;
|
|
98
|
+
if (width && tabListPrevWidthRef.current !== width) {
|
|
99
|
+
tabListPrevWidthRef.current = width;
|
|
100
|
+
if (animationFrameId !== null) {
|
|
101
|
+
cancelAnimationFrame(animationFrameId);
|
|
102
|
+
}
|
|
103
|
+
animationFrameId = requestAnimationFrame(function () {
|
|
104
|
+
updateSelectedTabPosition();
|
|
105
|
+
animationFrameId = null;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
if (tabListRef.current) {
|
|
110
|
+
tabListObserver.observe(tabListRef.current);
|
|
111
|
+
}
|
|
112
|
+
return function cleanupResizeObserver() {
|
|
113
|
+
if (animationFrameId) {
|
|
114
|
+
cancelAnimationFrame(animationFrameId);
|
|
115
|
+
}
|
|
116
|
+
tabListObserver.disconnect();
|
|
117
|
+
};
|
|
118
|
+
}, [updateSelectedTabPosition]);
|
|
119
|
+
if (!tabContextValue) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
var tabStore = tabContextValue.tabStore, variant = tabContextValue.variant;
|
|
123
|
+
var justifyContentAlignMap = {
|
|
124
|
+
start: 'flexStart',
|
|
125
|
+
end: 'flexEnd',
|
|
126
|
+
center: 'center'
|
|
127
|
+
};
|
|
128
|
+
return (
|
|
129
|
+
// This extra <Box> not only provides alignment for the tabs, but also prevents <Inline>'s
|
|
130
|
+
// negative margins from collapsing when used in a flex container which will render the
|
|
131
|
+
// track with the wrong height
|
|
132
|
+
React__namespace.createElement(box.Box, { display: "flex", justifyContent: width === 'full' ? 'center' : justifyContentAlignMap[align] },
|
|
133
|
+
React__namespace.createElement(react.TabList, tslib.__assign({ store: tabStore, render: React__namespace.createElement(box.Box, { position: "relative", width: width, className: exceptionallySetClassName }), ref: tabListRef }, props),
|
|
134
|
+
React__namespace.createElement(box.Box, { className: [tabs_module["default"].track, tabs_module["default"]["track-".concat(variant)]] }),
|
|
135
|
+
selectedTabElement ? (React__namespace.createElement(box.Box, { className: [tabs_module["default"].selected, tabs_module["default"]["selected-".concat(variant)]], style: selectedTabStyle })) : null,
|
|
136
|
+
React__namespace.createElement(inline.Inline, { space: space, exceptionallySetClassName: classNames__default["default"](width === 'full' ? tabs_module["default"].fullTabList : null) }, children))));
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Used to define the content to be rendered when a tab is active. Each `<TabPanel>` must have a
|
|
140
|
+
* corresponding `<Tab>` component.
|
|
141
|
+
*/
|
|
142
|
+
var TabPanel = React__namespace.forwardRef(function TabPanel(_a, ref) {
|
|
143
|
+
var children = _a.children, id = _a.id, _b = _a.renderMode, renderMode = _b === void 0 ? 'always' : _b, props = tslib.__rest(_a, ["children", "id", "renderMode"]);
|
|
144
|
+
var tabContextValue = React__namespace.useContext(TabsContext);
|
|
145
|
+
var _c = React__namespace.useState(false), tabRendered = _c[0], setTabRendered = _c[1];
|
|
146
|
+
var selectedId = tabContextValue === null || tabContextValue === void 0 ? void 0 : tabContextValue.tabStore.useState('selectedId');
|
|
147
|
+
var tabIsActive = selectedId === id;
|
|
148
|
+
React__namespace.useEffect(function trackTabRenderedState() {
|
|
149
|
+
if (!tabRendered && tabIsActive) {
|
|
150
|
+
setTabRendered(true);
|
|
151
|
+
}
|
|
152
|
+
}, [tabRendered, tabIsActive]);
|
|
153
|
+
if (!tabContextValue) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
var tabStore = tabContextValue.tabStore;
|
|
157
|
+
var shouldRender = renderMode === 'always' ||
|
|
158
|
+
(renderMode === 'active' && tabIsActive) ||
|
|
159
|
+
(renderMode === 'lazy' && (tabIsActive || tabRendered));
|
|
160
|
+
return shouldRender ? (React__namespace.createElement(react.TabPanel, tslib.__assign({}, props, { tabId: id, store: tabStore, ref: ref }), children)) : null;
|
|
161
|
+
});
|
|
162
|
+
/**
|
|
163
|
+
* Allows content to be rendered based on the current tab being selected while outside of the
|
|
164
|
+
* TabPanel component. Can be placed freely within the main `<Tabs>` component.
|
|
165
|
+
*/
|
|
166
|
+
function TabAwareSlot(_a) {
|
|
167
|
+
var children = _a.children;
|
|
168
|
+
var tabContextValue = React__namespace.useContext(TabsContext);
|
|
169
|
+
var selectedId = tabContextValue === null || tabContextValue === void 0 ? void 0 : tabContextValue.tabStore.useState('selectedId');
|
|
170
|
+
return tabContextValue ? children({ selectedId: selectedId }) : null;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
exports.Tab = Tab;
|
|
174
|
+
exports.TabAwareSlot = TabAwareSlot;
|
|
175
|
+
exports.TabList = TabList;
|
|
176
|
+
exports.TabPanel = TabPanel;
|
|
177
|
+
exports.Tabs = Tabs;
|
|
2
178
|
//# sourceMappingURL=tabs.js.map
|
package/lib/tabs/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sources":["../../src/tabs/tabs.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\nimport {\n useTabStore,\n Tab as BaseTab,\n TabProps as BaseTabProps,\n TabList as BaseTabList,\n TabPanel as BaseTabPanel,\n TabPanelProps as BaseTabPanelProps,\n TabStore,\n} from '@ariakit/react'\nimport { Box, BoxJustifyContent } from '../box'\nimport { Inline } from '../inline'\n\nimport type { ObfuscatedClassName, Space } from '../utils/common-types'\n\nimport styles from './tabs.module.css'\n\ntype TabsContextValue = Required<Pick<TabsProps, 'variant'>> & {\n tabStore: TabStore\n}\n\nconst TabsContext = React.createContext<TabsContextValue | null>(null)\n\ninterface TabsProps {\n /**\n * The `<Tabs>` component must be composed from a `<TabList>` and corresponding `<TabPanel>`\n * components\n */\n children: React.ReactNode\n\n /**\n * Determines the look and feel of the tabs\n */\n variant?: 'themed' | 'neutral'\n\n /**\n * The id of the selected tab. Assigning a value makes this a controlled component\n */\n selectedId?: string | null\n\n /**\n * The tab to initially select. This can be used if the component should not\n * be a controlled component but needs to have a tab selected\n */\n defaultSelectedId?: string | null\n\n /**\n * Called with the tab id when a tab is selected\n */\n onSelectedIdChange?: (selectedId: string | null | undefined) => void\n}\n\n/**\n * Used to group components that compose a set of tabs. There can only be one active tab within the same `<Tabs>` group.\n */\nfunction Tabs({\n children,\n selectedId,\n defaultSelectedId,\n variant = 'neutral',\n onSelectedIdChange,\n}: TabsProps): React.ReactElement {\n const tabStore = useTabStore({\n defaultSelectedId,\n selectedId,\n setSelectedId: onSelectedIdChange,\n })\n const actualSelectedId = tabStore.useState('selectedId')\n\n const memoizedTabState = React.useMemo(\n () => ({ tabStore, variant, selectedId: selectedId ?? actualSelectedId ?? null }),\n [variant, tabStore, selectedId, actualSelectedId],\n )\n return <TabsContext.Provider value={memoizedTabState}>{children}</TabsContext.Provider>\n}\n\ninterface TabProps\n extends ObfuscatedClassName,\n Omit<BaseTabProps, 'store' | 'className' | 'children' | 'id'> {\n /**\n * The content to render inside of the tab button\n */\n children: React.ReactNode\n\n /**\n * The tab's identifier. This must match its corresponding `<TabPanel>`'s id\n */\n id: string\n\n /**\n * Defines wether or not the tab is disabled.\n */\n disabled?: boolean\n}\n\n/**\n * Represents the individual tab elements within the group. Each `<Tab>` must have a corresponding `<TabPanel>` component.\n */\nconst Tab = React.forwardRef<HTMLButtonElement, TabProps>(function Tab(\n { children, id, disabled, exceptionallySetClassName, render, onClick },\n ref,\n): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n if (!tabContextValue) return null\n\n const { variant, tabStore } = tabContextValue\n const className = classNames(exceptionallySetClassName, styles.tab, styles[`tab-${variant}`])\n\n return (\n <BaseTab\n id={id}\n ref={ref}\n disabled={disabled}\n store={tabStore}\n render={render}\n className={className}\n onClick={onClick}\n >\n {children}\n </BaseTab>\n )\n})\n\ntype TabListProps = (\n | {\n /** Labels the tab list for assistive technologies. This must be provided if `aria-labelledby` is omitted. */\n 'aria-label': string\n }\n | {\n /**\n * One or more element IDs used to label the tab list for assistive technologies. Required if\n * `aria-label` is omitted.\n */\n 'aria-labelledby': string\n }\n | {\n /**\n * For cases where multiple instances of the tab list exists, the duplicates may be marked as aria-hidden\n */\n 'aria-hidden': boolean\n }\n) & {\n /**\n * A list of `<Tab>` elements\n */\n children: React.ReactNode\n\n /**\n * Controls the spacing between tabs\n */\n space?: Space\n\n /**\n * The width of the tab list.\n *\n * - `'maxContent'`: Each tab will be as wide as its content.\n * - `'full'`: Each tab will be as wide as the tab list.\n *\n * @default 'maxContent'\n */\n width?: 'maxContent' | 'full'\n\n /**\n * How to align the tabs within the tab list.\n *\n * @default 'start'\n */\n align?: 'start' | 'center' | 'end'\n} & ObfuscatedClassName\n\n/**\n * A component used to group `<Tab>` elements together.\n */\nfunction TabList({\n children,\n space,\n width = 'maxContent',\n align = 'start',\n exceptionallySetClassName,\n ...props\n}: TabListProps): React.ReactElement | null {\n const tabListRef = React.useRef<HTMLDivElement | null>(null)\n const tabListPrevWidthRef = React.useRef(0)\n\n const tabContextValue = React.useContext(TabsContext)\n\n const [selectedTabElement, setSelectedTabElement] = React.useState<HTMLElement | null>(null)\n const [selectedTabStyle, setSelectedTabStyle] = React.useState<React.CSSProperties>({})\n\n const selectedId = tabContextValue?.tabStore.useState('selectedId')\n\n const updateSelectedTabPosition = React.useCallback(\n function updateSelectedTabPositionCallback() {\n if (!selectedId || !tabListRef.current) {\n return\n }\n\n const tabs = tabListRef.current.querySelectorAll('[role=\"tab\"]')\n\n const selectedTab = Array.from(tabs).find(\n (tab) => tab.getAttribute('id') === selectedId,\n ) as HTMLElement | undefined\n\n if (selectedTab) {\n setSelectedTabElement(selectedTab)\n setSelectedTabStyle({\n left: `${selectedTab.offsetLeft}px`,\n width: `${selectedTab.offsetWidth}px`,\n })\n }\n },\n [selectedId],\n )\n\n React.useEffect(\n function updateSelectedTabPositionOnTabChange() {\n updateSelectedTabPosition()\n },\n // `selectedId` is a dependency to ensure the effect runs when the selected tab changes\n [selectedId, updateSelectedTabPosition],\n )\n\n React.useEffect(\n function observeTabListWidthChange() {\n let animationFrameId: number | null = null\n\n const tabListObserver = new ResizeObserver(([entry]) => {\n const width = entry?.contentRect.width\n\n if (width && tabListPrevWidthRef.current !== width) {\n tabListPrevWidthRef.current = width\n\n if (animationFrameId !== null) {\n cancelAnimationFrame(animationFrameId)\n }\n\n animationFrameId = requestAnimationFrame(() => {\n updateSelectedTabPosition()\n animationFrameId = null\n })\n }\n })\n\n if (tabListRef.current) {\n tabListObserver.observe(tabListRef.current)\n }\n\n return function cleanupResizeObserver() {\n if (animationFrameId) {\n cancelAnimationFrame(animationFrameId)\n }\n\n tabListObserver.disconnect()\n }\n },\n [updateSelectedTabPosition],\n )\n\n if (!tabContextValue) {\n return null\n }\n\n const { tabStore, variant } = tabContextValue\n\n const justifyContentAlignMap: Record<typeof align, BoxJustifyContent> = {\n start: 'flexStart',\n end: 'flexEnd',\n center: 'center',\n }\n\n return (\n // This extra <Box> not only provides alignment for the tabs, but also prevents <Inline>'s\n // negative margins from collapsing when used in a flex container which will render the\n // track with the wrong height\n <Box\n display=\"flex\"\n justifyContent={width === 'full' ? 'center' : justifyContentAlignMap[align]}\n >\n <BaseTabList\n store={tabStore}\n render={\n <Box position=\"relative\" width={width} className={exceptionallySetClassName} />\n }\n ref={tabListRef}\n {...props}\n >\n <Box className={[styles.track, styles[`track-${variant}`]]} />\n {selectedTabElement ? (\n <Box\n className={[styles.selected, styles[`selected-${variant}`]]}\n style={selectedTabStyle}\n />\n ) : null}\n <Inline\n space={space}\n exceptionallySetClassName={classNames(\n width === 'full' ? styles.fullTabList : null,\n )}\n >\n {children}\n </Inline>\n </BaseTabList>\n </Box>\n )\n}\n\ninterface TabPanelProps\n extends React.HTMLAttributes<HTMLDivElement>,\n Pick<BaseTabPanelProps, 'render'> {\n /** The content to be rendered inside the tab */\n children?: React.ReactNode\n\n /** The tabPanel's identifier. This must match its corresponding `<Tab>`'s id */\n id: string\n\n /**\n * By default, the tab panel's content is always rendered even when they are not active. This\n * behaviour can be changed to 'active', which renders only when the tab is active, and 'lazy',\n * meaning while inactive tab panels will not be rendered initially, they will remain mounted\n * once they are active until the entire Tabs tree is unmounted.\n */\n renderMode?: 'always' | 'active' | 'lazy'\n}\n\n/**\n * Used to define the content to be rendered when a tab is active. Each `<TabPanel>` must have a\n * corresponding `<Tab>` component.\n */\nconst TabPanel = React.forwardRef<HTMLDivElement, TabPanelProps>(function TabPanel(\n { children, id, renderMode = 'always', ...props },\n ref,\n): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n const [tabRendered, setTabRendered] = React.useState(false)\n const selectedId = tabContextValue?.tabStore.useState('selectedId')\n const tabIsActive = selectedId === id\n\n React.useEffect(\n function trackTabRenderedState() {\n if (!tabRendered && tabIsActive) {\n setTabRendered(true)\n }\n },\n [tabRendered, tabIsActive],\n )\n\n if (!tabContextValue) {\n return null\n }\n\n const { tabStore } = tabContextValue\n const shouldRender =\n renderMode === 'always' ||\n (renderMode === 'active' && tabIsActive) ||\n (renderMode === 'lazy' && (tabIsActive || tabRendered))\n\n return shouldRender ? (\n <BaseTabPanel {...props} tabId={id} store={tabStore} ref={ref}>\n {children}\n </BaseTabPanel>\n ) : null\n})\n\ntype TabAwareSlotProps = {\n /**\n * Render prop used to provide the content to be rendered inside the slot. The render prop will\n * be called with the current `selectedId`\n */\n children: (provided: { selectedId?: string | null }) => React.ReactElement | null\n}\n\n/**\n * Allows content to be rendered based on the current tab being selected while outside of the\n * TabPanel component. Can be placed freely within the main `<Tabs>` component.\n */\nfunction TabAwareSlot({ children }: TabAwareSlotProps): React.ReactElement | null {\n const tabContextValue = React.useContext(TabsContext)\n const selectedId = tabContextValue?.tabStore.useState('selectedId')\n return tabContextValue ? children({ selectedId }) : null\n}\n\nexport { Tab, Tabs, TabList, TabPanel, TabAwareSlot }\n"],"names":["TabsContext","React","createContext","Tab","forwardRef","children","id","disabled","exceptionallySetClassName","render","onClick","ref","tabContextValue","useContext","variant","tabStore","className","classNames","styles","tab","createElement","BaseTab","store","TabPanel","renderMode","_ref2","props","_objectWithoutProperties","objectWithoutProperties","_excluded2","tabRendered","setTabRendered","useState","tabIsActive","useEffect","BaseTabPanel","tabId","selectedId","_ref","space","width","align","_excluded","tabListRef","useRef","tabListPrevWidthRef","selectedTabElement","setSelectedTabElement","selectedTabStyle","setSelectedTabStyle","updateSelectedTabPosition","useCallback","current","tabs","querySelectorAll","selectedTab","Array","from","find","getAttribute","left","offsetLeft","offsetWidth","animationFrameId","tabListObserver","ResizeObserver","entry","contentRect","cancelAnimationFrame","requestAnimationFrame","observe","disconnect","Box","display","justifyContent","start","end","center","BaseTabList","TabList","_objectSpread","position","track","selected","style","Inline","fullTabList","defaultSelectedId","onSelectedIdChange","useTabStore","setSelectedId","actualSelectedId","memoizedTabState","useMemo","Provider","value"],"mappings":"uvBAsBMA,EAAcC,EAAMC,cAAuC,MA6E3DC,EAAMF,EAAMG,YAAwC,UACtDC,SAAEA,EAAFC,GAAYA,EAAZC,SAAgBA,EAAhBC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C,IAErExC,EAAAmB,cAAC0D,EAADC,QAAAC,gBAAA,CACI1D,MAAOP,EACPN,OACIR,EAACmB,cAAAoD,MAAI,CAAAS,SAAS,WAAWzC,MAAOA,EAAOxB,UAAWR,IAEtDG,IAAKgC,GACDjB,GAEJzB,EAAAmB,cAACoD,EAAAA,IAAI,CAAAxD,UAAW,CAACE,EAAM,QAACgE,MAAOhE,EAAAA,QAAgB,SAAAJ,MAC9CgC,EACG7C,EAACmB,cAAAoD,EAAAA,IACG,CAAAxD,UAAW,CAACE,EAAM,QAACiE,SAAUjE,EAAAA,QAAO,YAAYJ,IAChDsE,MAAOpC,IAEX,KACJ/C,EAAAmB,cAACiE,EAAAA,OAAM,CACH9C,MAAOA,EACP/B,0BAA2BS,EAAU,QACvB,SAAVuB,EAAmBtB,EAAM,QAACoE,YAAc,OAG3CjF,sCApPrB,UAAcA,SACVA,EADUgC,WAEVA,EAFUkD,kBAGVA,EAHUzE,QAIVA,EAAU,UAJA0E,mBAKVA,IAEA,MAAMzE,EAAW0E,EAAAA,YAAY,CACzBF,kBAAAA,EACAlD,WAAAA,EACAqD,cAAeF,IAEbG,EAAmB5E,EAASiB,SAAS,cAErC4D,EAAmB3F,EAAM4F,QAC3B,KAAO,CAAE9E,SAAAA,EAAUD,QAAAA,EAASuB,WAAYA,GAAcsD,GAAoB,OAC1E,CAAC7E,EAASC,EAAUsB,EAAYsD,IAEpC,OAAO1F,EAAAmB,cAACpB,EAAY8F,SAAQ,CAACC,MAAOH,GAAmBvF"}
|
|
1
|
+
{"version":3,"file":"tabs.js","sources":["../../src/tabs/tabs.tsx"],"sourcesContent":[null],"names":["React","useTabStore","classNames","styles","BaseTab","__rest","Box","BaseTabList","__assign","Inline","BaseTabPanel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAM,WAAW,GAAGA,gBAAK,CAAC,aAAa,CAA0B,IAAI,CAAC,CAAA;AA+BtE;;AAEG;AACH,SAAS,IAAI,CAAC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{"tab":"_33c9c271","fullTabList":"_479349aa","track":"_2862a4ba","selected":"_1161c811","tab-neutral":"_9502e79a","tab-themed":"c39f1053","track-neutral":"b3554a83","track-themed":"_511b0be0","selected-neutral":"c81dc609","selected-themed":"_87552972"};
|
|
6
|
+
|
|
7
|
+
exports["default"] = modules_40c67f5b;
|
|
2
8
|
//# sourceMappingURL=tabs.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"tabs.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/lib/text/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './text';
|
|
1
|
+
export * from './text';
|
package/lib/text/text.d.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { Tone } from '../utils/common-types';
|
|
3
|
-
import type { BoxProps } from '../box';
|
|
4
|
-
type TextProps = {
|
|
5
|
-
children: React.ReactNode;
|
|
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
|
-
*/
|
|
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
|
-
*/
|
|
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'];
|
|
44
|
-
};
|
|
45
|
-
declare const Text: import("../utils/polymorphism").PolymorphicComponent<"div", TextProps, "obfuscateClassName">;
|
|
46
|
-
export type { TextProps };
|
|
47
|
-
export { Text };
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Tone } from '../utils/common-types';
|
|
3
|
+
import type { BoxProps } from '../box';
|
|
4
|
+
type TextProps = {
|
|
5
|
+
children: React.ReactNode;
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
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'];
|
|
44
|
+
};
|
|
45
|
+
declare const Text: import("../utils/polymorphism").PolymorphicComponent<"div", TextProps, "obfuscateClassName">;
|
|
46
|
+
export type { TextProps };
|
|
47
|
+
export { Text };
|
package/lib/text/text.js
CHANGED
|
@@ -1,2 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var responsiveProps = require('../utils/responsive-props.js');
|
|
8
|
+
var box = require('../box/box.js');
|
|
9
|
+
var polymorphism = require('../utils/polymorphism.js');
|
|
10
|
+
var text_module = require('./text.module.css.js');
|
|
11
|
+
|
|
12
|
+
function _interopNamespace(e) {
|
|
13
|
+
if (e && e.__esModule) return e;
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n["default"] = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
31
|
+
|
|
32
|
+
var Text = polymorphism.polymorphicComponent(function Text(_a, ref) {
|
|
33
|
+
var as = _a.as, _b = _a.size, size = _b === void 0 ? 'body' : _b, _c = _a.weight, weight = _c === void 0 ? 'regular' : _c, _d = _a.tone, tone = _d === void 0 ? 'normal' : _d, align = _a.align, children = _a.children, lineClamp = _a.lineClamp, exceptionallySetClassName = _a.exceptionallySetClassName, props = tslib.__rest(_a, ["as", "size", "weight", "tone", "align", "children", "lineClamp", "exceptionallySetClassName"]);
|
|
34
|
+
var lineClampMultipleLines = typeof lineClamp === 'string' ? Number(lineClamp) > 1 : (lineClamp !== null && lineClamp !== void 0 ? lineClamp : 1) > 1;
|
|
35
|
+
return (React__namespace.createElement(box.Box, tslib.__assign({}, props, { as: as, className: [
|
|
36
|
+
exceptionallySetClassName,
|
|
37
|
+
text_module["default"].text,
|
|
38
|
+
size !== 'body' ? responsiveProps.getClassNames(text_module["default"], 'size', size) : null,
|
|
39
|
+
weight !== 'regular' ? responsiveProps.getClassNames(text_module["default"], 'weight', weight) : null,
|
|
40
|
+
tone !== 'normal' ? responsiveProps.getClassNames(text_module["default"], 'tone', tone) : null,
|
|
41
|
+
lineClampMultipleLines ? text_module["default"].lineClampMultipleLines : null,
|
|
42
|
+
lineClamp ? responsiveProps.getClassNames(text_module["default"], 'lineClamp', lineClamp.toString()) : null,
|
|
43
|
+
], textAlign: align,
|
|
44
|
+
// Prevents emojis from being cut-off
|
|
45
|
+
// See https://github.com/Doist/reactist/pull/528
|
|
46
|
+
paddingRight: lineClamp ? 'xsmall' : undefined, ref: ref }), children));
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
exports.Text = Text;
|
|
2
50
|
//# sourceMappingURL=text.js.map
|
package/lib/text/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sources":["../../src/text/text.tsx"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"text.js","sources":["../../src/text/text.tsx"],"sourcesContent":[null],"names":["polymorphicComponent","__rest","React","Box","__assign","styles","getClassNames"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDM,IAAA,IAAI,GAAGA,iCAAoB,CAAmB,SAAS,IAAI,CAC7D,EAUC,EACD,GAAG,EAAA;AAVC,IAAA,IAAA,EAAE,GAAA,EAAA,CAAA,EAAA,EACF,EAAa,GAAA,EAAA,CAAA,IAAA,EAAb,IAAI,GAAG,EAAA,KAAA,KAAA,CAAA,GAAA,MAAM,GAAA,EAAA,EACb,cAAkB,EAAlB,MAAM,mBAAG,SAAS,GAAA,EAAA,EAClB,EAAe,GAAA,EAAA,CAAA,IAAA,EAAf,IAAI,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAQ,GAAA,EAAA,EACf,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,yBAAyB,GAAA,EAAA,CAAA,yBAAA,EACtB,KAAK,GAAAC,YAAA,CAAA,EAAA,EATZ,+FAUC,CADW,CAAA;AAIZ,IAAA,IAAM,sBAAsB,GACxB,OAAO,SAAS,KAAK,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,KAAT,IAAA,IAAA,SAAS,KAAT,KAAA,CAAA,GAAA,SAAS,GAAI,CAAC,IAAI,CAAC,CAAA;IAEhF,QACIC,gBAAC,CAAA,aAAA,CAAAC,OAAG,EACIC,cAAA,CAAA,EAAA,EAAA,KAAK,EACT,EAAA,EAAE,EAAE,EAAE,EACN,SAAS,EAAE;YACP,yBAAyB;AACzB,YAAAC,sBAAM,CAAC,IAAI;AACX,YAAA,IAAI,KAAK,MAAM,GAAGC,6BAAa,CAACD,sBAAM,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI;AAC5D,YAAA,MAAM,KAAK,SAAS,GAAGC,6BAAa,CAACD,sBAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,IAAI;AACrE,YAAA,IAAI,KAAK,QAAQ,GAAGC,6BAAa,CAACD,sBAAM,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI;YAC9D,sBAAsB,GAAGA,sBAAM,CAAC,sBAAsB,GAAG,IAAI;AAC7D,YAAA,SAAS,GAAGC,6BAAa,CAACD,sBAAM,EAAE,WAAW,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI;SAC9E,EACD,SAAS,EAAE,KAAK;;;AAGhB,QAAA,YAAY,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,EAC9C,GAAG,EAAE,GAAG,KAEP,QAAQ,CACP,EACT;AACL,CAAC;;;;"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var modules_a9637dd3 = {"text":"a83bd4e0","size-caption":"_266d6623","size-copy":"a8d37c6e","size-subtitle":"_39f4eb1f","weight-semibold":"_7be5c531","weight-bold":"e214ff2e","tone-secondary":"_6a3e5ade","tone-danger":"_8f5b5f2b","tone-positive":"_9ae47ae4","lineClampMultipleLines":"_969f18f7","lineClamp-1":"_2f303ac3","lineClamp-2":"d3e04245","lineClamp-3":"_33411704","lineClamp-4":"bfc32640","lineClamp-5":"f813c82f"};
|
|
6
|
+
|
|
7
|
+
exports["default"] = modules_a9637dd3;
|
|
2
8
|
//# sourceMappingURL=text.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"text.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/lib/text-area/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './text-area';
|
|
1
|
+
export * from './text-area';
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { BaseFieldVariantProps, FieldComponentProps } from '../base-field';
|
|
3
|
-
interface TextAreaProps extends Omit<FieldComponentProps<HTMLTextAreaElement>, 'characterCountPosition'>, Omit<BaseFieldVariantProps, 'supportsStartAndEndSlots' | 'endSlot' | 'endSlotPosition' | 'value'> {
|
|
4
|
-
/**
|
|
5
|
-
* The value of the text area.
|
|
6
|
-
*
|
|
7
|
-
* If this prop is not specified, the text area will be uncontrolled and the component will
|
|
8
|
-
* manage its own state.
|
|
9
|
-
*/
|
|
10
|
-
value?: string;
|
|
11
|
-
/**
|
|
12
|
-
* The number of visible text lines for the text area.
|
|
13
|
-
*
|
|
14
|
-
* If it is specified, it must be a positive integer. If it is not specified, the default
|
|
15
|
-
* value is 2 (set by the browser).
|
|
16
|
-
*
|
|
17
|
-
* When `autoExpand` is true, this value serves the purpose of specifying the minimum number
|
|
18
|
-
* of rows that the textarea will shrink to when the content is not large enough to make it
|
|
19
|
-
* expand.
|
|
20
|
-
*
|
|
21
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows
|
|
22
|
-
*/
|
|
23
|
-
rows?: number;
|
|
24
|
-
/**
|
|
25
|
-
* If `true`, the textarea will be automatically resized to fit the content, and the ability to
|
|
26
|
-
* manually resize the textarea will be disabled.
|
|
27
|
-
*/
|
|
28
|
-
autoExpand?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* If `true`, the ability to manually resize the textarea will be disabled.
|
|
31
|
-
*
|
|
32
|
-
* When `autoExpand` is true, this property serves no purpose, because the ability to manually
|
|
33
|
-
* resize the textarea is always disabled when `autoExpand` is true.
|
|
34
|
-
*/
|
|
35
|
-
disableResize?: boolean;
|
|
36
|
-
}
|
|
37
|
-
declare const TextArea: React.ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
38
|
-
export { TextArea };
|
|
39
|
-
export type { TextAreaProps };
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BaseFieldVariantProps, FieldComponentProps } from '../base-field';
|
|
3
|
+
interface TextAreaProps extends Omit<FieldComponentProps<HTMLTextAreaElement>, 'characterCountPosition'>, Omit<BaseFieldVariantProps, 'supportsStartAndEndSlots' | 'endSlot' | 'endSlotPosition' | 'value'> {
|
|
4
|
+
/**
|
|
5
|
+
* The value of the text area.
|
|
6
|
+
*
|
|
7
|
+
* If this prop is not specified, the text area will be uncontrolled and the component will
|
|
8
|
+
* manage its own state.
|
|
9
|
+
*/
|
|
10
|
+
value?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The number of visible text lines for the text area.
|
|
13
|
+
*
|
|
14
|
+
* If it is specified, it must be a positive integer. If it is not specified, the default
|
|
15
|
+
* value is 2 (set by the browser).
|
|
16
|
+
*
|
|
17
|
+
* When `autoExpand` is true, this value serves the purpose of specifying the minimum number
|
|
18
|
+
* of rows that the textarea will shrink to when the content is not large enough to make it
|
|
19
|
+
* expand.
|
|
20
|
+
*
|
|
21
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows
|
|
22
|
+
*/
|
|
23
|
+
rows?: number;
|
|
24
|
+
/**
|
|
25
|
+
* If `true`, the textarea will be automatically resized to fit the content, and the ability to
|
|
26
|
+
* manually resize the textarea will be disabled.
|
|
27
|
+
*/
|
|
28
|
+
autoExpand?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* If `true`, the ability to manually resize the textarea will be disabled.
|
|
31
|
+
*
|
|
32
|
+
* When `autoExpand` is true, this property serves no purpose, because the ability to manually
|
|
33
|
+
* resize the textarea is always disabled when `autoExpand` is true.
|
|
34
|
+
*/
|
|
35
|
+
disableResize?: boolean;
|
|
36
|
+
}
|
|
37
|
+
declare const TextArea: React.ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
38
|
+
export { TextArea };
|
|
39
|
+
export type { TextAreaProps };
|