@doist/reactist 28.7.0 → 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 +2093 -3829
- 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 -139
- 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 -75
- 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 -30
- 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 -75
- 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 -211
- 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 -201
- 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 +16 -23
- package/styles/avatar.css +3 -3
- package/styles/avatar.module.css.css +1 -1
- package/styles/badge.css +3 -3
- package/styles/badge.module.css.css +1 -1
- package/styles/banner.css +7 -7
- package/styles/banner.module.css.css +1 -1
- package/styles/base-field.css +5 -5
- package/styles/base-field.module.css.css +1 -1
- package/styles/box.css +2 -2
- package/styles/box.module.css.css +1 -1
- package/styles/button.css +5 -5
- package/styles/button.module.css.css +1 -1
- package/styles/checkbox-field.css +4 -4
- package/styles/checkbox-field.module.css.css +1 -1
- package/styles/columns.css +2 -2
- package/styles/divider.css +2 -2
- package/styles/heading.css +3 -3
- package/styles/heading.module.css.css +1 -1
- package/styles/hidden-visually.css +3 -3
- package/styles/hidden-visually.module.css.css +1 -1
- package/styles/hidden.css +2 -2
- package/styles/index.css +5 -5
- package/styles/loading.css +3 -3
- package/styles/menu.css +1 -1
- package/styles/modal.css +6 -6
- package/styles/modal.module.css.css +1 -1
- package/styles/notice.css +2 -2
- package/styles/password-field.css +8 -8
- package/styles/progress-bar.module.css.css +1 -1
- package/styles/prose.css +3 -3
- package/styles/prose.module.css.css +1 -1
- package/styles/reactist.css +31 -31
- package/styles/select-field.css +6 -6
- package/styles/select-field.module.css.css +1 -1
- package/styles/spinner.css +1 -1
- package/styles/static-toast.css +7 -7
- package/styles/switch-field.css +7 -7
- package/styles/switch-field.module.css.css +1 -1
- package/styles/tabs.css +3 -3
- package/styles/tabs.module.css.css +1 -1
- package/styles/text-area.css +6 -6
- package/styles/text-area.module.css.css +1 -1
- package/styles/text-field.css +6 -6
- package/styles/text-field.module.css.css +1 -1
- package/styles/text-link.css +3 -3
- package/styles/text-link.module.css.css +1 -1
- package/styles/text.css +3 -3
- package/styles/text.module.css.css +1 -1
- package/styles/toast.module.css.css +1 -1
- package/styles/tooltip.css +3 -3
- package/styles/tooltip.module.css.css +1 -1
- package/styles/use-toasts.css +7 -7
- package/styles/width.module.css.css +1 -1
- 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/menu/menu.js
CHANGED
|
@@ -1,2 +1,180 @@
|
|
|
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
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
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
|
+
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
32
|
+
|
|
33
|
+
var MenuContext = React__namespace.createContext({
|
|
34
|
+
menuStore: null,
|
|
35
|
+
handleItemSelect: function () { return undefined; },
|
|
36
|
+
getAnchorRect: null,
|
|
37
|
+
setAnchorRect: function () { return undefined; }
|
|
38
|
+
});
|
|
39
|
+
var SubMenuContext = React__namespace.createContext({ isSubMenu: false });
|
|
40
|
+
/**
|
|
41
|
+
* Wrapper component to control a menu. It does not render anything, only providing the state
|
|
42
|
+
* management for the menu components inside it.
|
|
43
|
+
*/
|
|
44
|
+
function Menu(_a) {
|
|
45
|
+
var children = _a.children, onItemSelect = _a.onItemSelect, props = tslib.__rest(_a, ["children", "onItemSelect"]);
|
|
46
|
+
var _b = React__namespace.useState(null), anchorRect = _b[0], setAnchorRect = _b[1];
|
|
47
|
+
var getAnchorRect = React__namespace.useMemo(function () { return (anchorRect ? function () { return anchorRect; } : null); }, [anchorRect]);
|
|
48
|
+
var menuStore = react.useMenuStore(tslib.__assign({ focusLoop: true }, props));
|
|
49
|
+
var value = React__namespace.useMemo(function () { return ({ menuStore: menuStore, handleItemSelect: onItemSelect, getAnchorRect: getAnchorRect, setAnchorRect: setAnchorRect }); }, [menuStore, onItemSelect, getAnchorRect, setAnchorRect]);
|
|
50
|
+
return React__namespace.createElement(MenuContext.Provider, { value: value }, children);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A button to toggle a dropdown menu open or closed.
|
|
54
|
+
*/
|
|
55
|
+
var MenuButton = React__namespace.forwardRef(function MenuButton(_a, ref) {
|
|
56
|
+
var exceptionallySetClassName = _a.exceptionallySetClassName, props = tslib.__rest(_a, ["exceptionallySetClassName"]);
|
|
57
|
+
var menuStore = React__namespace.useContext(MenuContext).menuStore;
|
|
58
|
+
if (!menuStore) {
|
|
59
|
+
throw new Error('MenuButton must be wrapped in <Menu/>');
|
|
60
|
+
}
|
|
61
|
+
return (React__namespace.createElement(react.MenuButton, tslib.__assign({}, props, { store: menuStore, ref: ref, className: classNames__default["default"]('reactist_menubutton', exceptionallySetClassName) })));
|
|
62
|
+
});
|
|
63
|
+
var ContextMenuTrigger = React__namespace.forwardRef(function ContextMenuTrigger(_a, ref) {
|
|
64
|
+
var render = _a.render, props = tslib.__rest(_a, ["render"]);
|
|
65
|
+
var _b = React__namespace.useContext(MenuContext), setAnchorRect = _b.setAnchorRect, menuStore = _b.menuStore;
|
|
66
|
+
if (!menuStore) {
|
|
67
|
+
throw new Error('ContextMenuTrigger must be wrapped in <Menu/>');
|
|
68
|
+
}
|
|
69
|
+
var handleContextMenu = React__namespace.useCallback(function handleContextMenu(event) {
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
setAnchorRect({ x: event.clientX, y: event.clientY });
|
|
72
|
+
menuStore.show();
|
|
73
|
+
}, [setAnchorRect, menuStore]);
|
|
74
|
+
var isOpen = menuStore.useState('open');
|
|
75
|
+
React__namespace.useEffect(function () {
|
|
76
|
+
if (!isOpen)
|
|
77
|
+
setAnchorRect(null);
|
|
78
|
+
}, [isOpen, setAnchorRect]);
|
|
79
|
+
return React__namespace.createElement(react.Role.div, tslib.__assign({}, props, { onContextMenu: handleContextMenu, ref: ref, render: render }));
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* The dropdown menu itself, containing a list of menu items.
|
|
83
|
+
*/
|
|
84
|
+
var MenuList = React__namespace.forwardRef(function MenuList(_a, ref) {
|
|
85
|
+
var exceptionallySetClassName = _a.exceptionallySetClassName, _b = _a.modal, modal = _b === void 0 ? true : _b, flip = _a.flip, props = tslib.__rest(_a, ["exceptionallySetClassName", "modal", "flip"]);
|
|
86
|
+
var _c = React__namespace.useContext(MenuContext), menuStore = _c.menuStore, getAnchorRect = _c.getAnchorRect;
|
|
87
|
+
if (!menuStore) {
|
|
88
|
+
throw new Error('MenuList must be wrapped in <Menu/>');
|
|
89
|
+
}
|
|
90
|
+
var isSubMenu = React__namespace.useContext(SubMenuContext).isSubMenu;
|
|
91
|
+
var isOpen = menuStore.useState('open');
|
|
92
|
+
return isOpen ? (React__namespace.createElement(react.Portal, { preserveTabOrder: true },
|
|
93
|
+
React__namespace.createElement(react.Menu, tslib.__assign({}, props, { store: menuStore, gutter: 8, shift: 4, ref: ref, className: classNames__default["default"]('reactist_menulist', exceptionallySetClassName), getAnchorRect: getAnchorRect !== null && getAnchorRect !== void 0 ? getAnchorRect : undefined, modal: modal, flip: flip !== null && flip !== void 0 ? flip : (isSubMenu ? 'left bottom' : undefined) })))) : null;
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`
|
|
97
|
+
* callback.
|
|
98
|
+
*/
|
|
99
|
+
var MenuItem = React__namespace.forwardRef(function MenuItem(_a, ref) {
|
|
100
|
+
var value = _a.value, children = _a.children, onSelect = _a.onSelect, _b = _a.hideOnSelect, hideOnSelect = _b === void 0 ? true : _b, onClick = _a.onClick, exceptionallySetClassName = _a.exceptionallySetClassName, props = tslib.__rest(_a, ["value", "children", "onSelect", "hideOnSelect", "onClick", "exceptionallySetClassName"]);
|
|
101
|
+
var _c = React__namespace.useContext(MenuContext), handleItemSelect = _c.handleItemSelect, menuStore = _c.menuStore;
|
|
102
|
+
if (!menuStore) {
|
|
103
|
+
throw new Error('MenuItem must be wrapped in <Menu/>');
|
|
104
|
+
}
|
|
105
|
+
var hide = menuStore.hide;
|
|
106
|
+
var handleClick = React__namespace.useCallback(function handleClick(event) {
|
|
107
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
108
|
+
var onSelectResult = onSelect && !event.defaultPrevented ? onSelect() : undefined;
|
|
109
|
+
var shouldClose = onSelectResult !== false && hideOnSelect;
|
|
110
|
+
handleItemSelect === null || handleItemSelect === void 0 ? void 0 : handleItemSelect(value);
|
|
111
|
+
if (shouldClose)
|
|
112
|
+
hide();
|
|
113
|
+
}, [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value]);
|
|
114
|
+
return (React__namespace.createElement(react.MenuItem, tslib.__assign({}, props, { store: menuStore, ref: ref, onClick: handleClick, className: exceptionallySetClassName, hideOnClick: false }), children));
|
|
115
|
+
});
|
|
116
|
+
/**
|
|
117
|
+
* This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have
|
|
118
|
+
* a sub-menu.
|
|
119
|
+
*
|
|
120
|
+
* Its children are expected to have the structure of a first level menu (a `MenuButton` and a
|
|
121
|
+
* `MenuList`).
|
|
122
|
+
*
|
|
123
|
+
* ```jsx
|
|
124
|
+
* <MenuItem label="Edit profile" />
|
|
125
|
+
* <SubMenu>
|
|
126
|
+
* <MenuButton>More options</MenuButton>
|
|
127
|
+
* <MenuList>
|
|
128
|
+
* <MenuItem label="Preferences" />
|
|
129
|
+
* <MenuItem label="Sign out" />
|
|
130
|
+
* </MenuList>
|
|
131
|
+
* </SubMenu>
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
* The `MenuButton` will become a menu item in the current menu items list, and it will lead to
|
|
135
|
+
* opening a sub-menu with the menu items list below it.
|
|
136
|
+
*/
|
|
137
|
+
var SubMenu = React__namespace.forwardRef(function SubMenu(_a, ref) {
|
|
138
|
+
var children = _a.children, onItemSelect = _a.onItemSelect;
|
|
139
|
+
var _b = React__namespace.useContext(MenuContext), parentMenuItemSelect = _b.handleItemSelect, menuStore = _b.menuStore;
|
|
140
|
+
if (!menuStore) {
|
|
141
|
+
throw new Error('SubMenu must be wrapped in <Menu/>');
|
|
142
|
+
}
|
|
143
|
+
var parentMenuHide = menuStore.hide;
|
|
144
|
+
var handleSubItemSelect = React__namespace.useCallback(function handleSubItemSelect(value) {
|
|
145
|
+
onItemSelect === null || onItemSelect === void 0 ? void 0 : onItemSelect(value);
|
|
146
|
+
parentMenuItemSelect === null || parentMenuItemSelect === void 0 ? void 0 : parentMenuItemSelect(value);
|
|
147
|
+
parentMenuHide();
|
|
148
|
+
}, [parentMenuHide, parentMenuItemSelect, onItemSelect]);
|
|
149
|
+
var _c = React__namespace.Children.toArray(children), button = _c[0], list = _c[1];
|
|
150
|
+
var buttonElement = button;
|
|
151
|
+
var subMenuContextValue = React__namespace.useMemo(function () { return ({ isSubMenu: true }); }, []);
|
|
152
|
+
return (React__namespace.createElement(Menu, { onItemSelect: handleSubItemSelect },
|
|
153
|
+
React__namespace.createElement(react.MenuItem, { store: menuStore, ref: ref, hideOnClick: false, render: buttonElement }, buttonElement.props.children),
|
|
154
|
+
React__namespace.createElement(SubMenuContext.Provider, { value: subMenuContextValue }, list)));
|
|
155
|
+
});
|
|
156
|
+
/**
|
|
157
|
+
* A way to semantically group some menu items.
|
|
158
|
+
*
|
|
159
|
+
* This group does not add any visual separator. You can do that yourself adding `<hr />` elements
|
|
160
|
+
* before and/or after the group if you so wish.
|
|
161
|
+
*/
|
|
162
|
+
var MenuGroup = React__namespace.forwardRef(function MenuGroup(_a, ref) {
|
|
163
|
+
var label = _a.label, children = _a.children, exceptionallySetClassName = _a.exceptionallySetClassName, props = tslib.__rest(_a, ["label", "children", "exceptionallySetClassName"]);
|
|
164
|
+
var menuStore = React__namespace.useContext(MenuContext).menuStore;
|
|
165
|
+
if (!menuStore) {
|
|
166
|
+
throw new Error('MenuGroup must be wrapped in <Menu/>');
|
|
167
|
+
}
|
|
168
|
+
return (React__namespace.createElement(react.MenuGroup, tslib.__assign({}, props, { ref: ref, store: menuStore, className: exceptionallySetClassName }),
|
|
169
|
+
label ? (React__namespace.createElement("div", { role: "presentation", className: "reactist_menugroup__label" }, label)) : null,
|
|
170
|
+
children));
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
exports.ContextMenuTrigger = ContextMenuTrigger;
|
|
174
|
+
exports.Menu = Menu;
|
|
175
|
+
exports.MenuButton = MenuButton;
|
|
176
|
+
exports.MenuGroup = MenuGroup;
|
|
177
|
+
exports.MenuItem = MenuItem;
|
|
178
|
+
exports.MenuList = MenuList;
|
|
179
|
+
exports.SubMenu = SubMenu;
|
|
2
180
|
//# sourceMappingURL=menu.js.map
|
package/lib/menu/menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sources":["../../src/menu/menu.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\n\nimport {\n Portal,\n MenuStore,\n MenuStoreProps,\n useMenuStore,\n MenuProps as AriakitMenuProps,\n Menu as AriakitMenu,\n MenuGroup as AriakitMenuGroup,\n MenuItem as AriakitMenuItem,\n MenuItemProps as AriakitMenuItemProps,\n MenuButton as AriakitMenuButton,\n MenuButtonProps as AriakitMenuButtonProps,\n Role,\n RoleProps,\n} from '@ariakit/react'\n\nimport './menu.less'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\ntype MenuContextState = {\n menuStore: MenuStore | null\n handleItemSelect?: (value: string | null | undefined) => void\n getAnchorRect: (() => { x: number; y: number }) | null\n setAnchorRect: (rect: { x: number; y: number } | null) => void\n}\n\nconst MenuContext = React.createContext<MenuContextState>({\n menuStore: null,\n handleItemSelect: () => undefined,\n getAnchorRect: null,\n setAnchorRect: () => undefined,\n})\n\nconst SubMenuContext = React.createContext<{ isSubMenu: boolean }>({ isSubMenu: false })\n\n//\n// Menu\n//\n\ninterface MenuProps extends Omit<MenuStoreProps, 'visible'> {\n /**\n * The `Menu` must contain a `MenuList` that defines the menu options. It must also contain a\n * `MenuButton` that triggers the menu to be opened or closed.\n */\n children: React.ReactNode\n\n /**\n * An optional callback that will be called back whenever a menu item is selected. It receives\n * the `value` of the selected `MenuItem`.\n *\n * If you pass down this callback, it is recommended that you properly memoize it so it does not\n * change on every render.\n */\n onItemSelect?: (value: string | null | undefined) => void\n}\n\n/**\n * Wrapper component to control a menu. It does not render anything, only providing the state\n * management for the menu components inside it.\n */\nfunction Menu({ children, onItemSelect, ...props }: MenuProps) {\n const [anchorRect, setAnchorRect] = React.useState<{ x: number; y: number } | null>(null)\n const getAnchorRect = React.useMemo(() => (anchorRect ? () => anchorRect : null), [anchorRect])\n const menuStore = useMenuStore({ focusLoop: true, ...props })\n\n const value: MenuContextState = React.useMemo(\n () => ({ menuStore, handleItemSelect: onItemSelect, getAnchorRect, setAnchorRect }),\n [menuStore, onItemSelect, getAnchorRect, setAnchorRect],\n )\n\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>\n}\n\n//\n// MenuButton\n//\n\ninterface MenuButtonProps\n extends Omit<AriakitMenuButtonProps, 'store' | 'className' | 'as'>,\n ObfuscatedClassName {}\n\n/**\n * A button to toggle a dropdown menu open or closed.\n */\nconst MenuButton = React.forwardRef<HTMLButtonElement, MenuButtonProps>(function MenuButton(\n { exceptionallySetClassName, ...props },\n ref,\n) {\n const { menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuButton must be wrapped in <Menu/>')\n }\n return (\n <AriakitMenuButton\n {...props}\n store={menuStore}\n ref={ref}\n className={classNames('reactist_menubutton', exceptionallySetClassName)}\n />\n )\n})\n\n//\n// ContextMenuTrigger\n//\n\ninterface ContextMenuTriggerProps\n extends ObfuscatedClassName,\n React.HTMLAttributes<HTMLDivElement>,\n Pick<RoleProps, 'render'> {}\n\nconst ContextMenuTrigger = React.forwardRef<HTMLDivElement, ContextMenuTriggerProps>(\n function ContextMenuTrigger({ render, ...props }, ref) {\n const { setAnchorRect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('ContextMenuTrigger must be wrapped in <Menu/>')\n }\n\n const handleContextMenu = React.useCallback(\n function handleContextMenu(event: React.MouseEvent) {\n event.preventDefault()\n setAnchorRect({ x: event.clientX, y: event.clientY })\n menuStore.show()\n },\n [setAnchorRect, menuStore],\n )\n\n const isOpen = menuStore.useState('open')\n React.useEffect(() => {\n if (!isOpen) setAnchorRect(null)\n }, [isOpen, setAnchorRect])\n\n return <Role.div {...props} onContextMenu={handleContextMenu} ref={ref} render={render} />\n },\n)\n\n//\n// MenuList\n//\n\ninterface MenuListProps\n extends Omit<AriakitMenuProps, 'store' | 'className'>,\n ObfuscatedClassName {}\n\n/**\n * The dropdown menu itself, containing a list of menu items.\n */\nconst MenuList = React.forwardRef<HTMLDivElement, MenuListProps>(function MenuList(\n { exceptionallySetClassName, modal = true, flip, ...props },\n ref,\n) {\n const { menuStore, getAnchorRect } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuList must be wrapped in <Menu/>')\n }\n\n const { isSubMenu } = React.useContext(SubMenuContext)\n\n const isOpen = menuStore.useState('open')\n\n return isOpen ? (\n <Portal preserveTabOrder>\n <AriakitMenu\n {...props}\n store={menuStore}\n gutter={8}\n shift={4}\n ref={ref}\n className={classNames('reactist_menulist', exceptionallySetClassName)}\n getAnchorRect={getAnchorRect ?? undefined}\n modal={modal}\n flip={flip ?? (isSubMenu ? 'left bottom' : undefined)}\n />\n </Portal>\n ) : null\n})\n\n//\n// MenuItem\n//\n\ninterface MenuItemProps extends AriakitMenuItemProps, ObfuscatedClassName {\n /**\n * An optional value given to this menu item. It is passed on to the parent `Menu`'s\n * `onItemSelect` when you provide that instead of (or alongside) providing individual\n * `onSelect` callbacks to each menu item.\n */\n value?: string\n\n /**\n * When `true` the menu item is disabled and won't be selectable or be part of the keyboard\n * navigation across the menu options.\n *\n * @default true\n */\n disabled?: boolean\n\n /**\n * When `true` the menu will close when the menu item is selected, in addition to performing the\n * action that the menu item is set out to do.\n *\n * Set this to `false` to make sure that a given menu item does not auto-closes the menu when\n * selected. This should be the exception and not the norm, as the default is to auto-close.\n *\n * @default true\n */\n hideOnSelect?: boolean\n\n /**\n * The action to perform when the menu item is selected.\n *\n * If you return `false` from this function, the menu will not auto-close when this menu item\n * is selected. Though you should use `hideOnSelect` for this purpose, this allows you to\n * achieve the same effect conditionally and dynamically deciding at run time.\n */\n onSelect?: () => unknown\n\n /**\n * The event handler called when the menu item is clicked.\n *\n * This is similar to `onSelect`, but a bit different. You can certainly use it to trigger the\n * action that the menu item represents. But in general you should prefer `onSelect` for that.\n *\n * The main use for this handler is to get access to the click event. This can be used, for\n * example, to call `event.preventDefault()`, which will effectively prevent the rest of the\n * consequences of the click, including preventing `onSelect` from being called. In particular,\n * this is useful in menu items that are links, and you want the click to not trigger navigation\n * under some circumstances.\n */\n onClick?: (event: React.MouseEvent) => void\n}\n\n/**\n * A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`\n * callback.\n */\nconst MenuItem = React.forwardRef<HTMLDivElement, MenuItemProps>(function MenuItem(\n {\n value,\n children,\n onSelect,\n hideOnSelect = true,\n onClick,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const { handleItemSelect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuItem must be wrapped in <Menu/>')\n }\n\n const { hide } = menuStore\n const handleClick = React.useCallback(\n function handleClick(event: React.MouseEvent) {\n onClick?.(event)\n const onSelectResult: unknown =\n onSelect && !event.defaultPrevented ? onSelect() : undefined\n const shouldClose = onSelectResult !== false && hideOnSelect\n handleItemSelect?.(value)\n if (shouldClose) hide()\n },\n [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value],\n )\n\n return (\n <AriakitMenuItem\n {...props}\n store={menuStore}\n ref={ref}\n onClick={handleClick}\n className={exceptionallySetClassName}\n hideOnClick={false}\n >\n {children}\n </AriakitMenuItem>\n )\n})\n\n//\n// SubMenu\n//\n\ntype SubMenuProps = Pick<MenuProps, 'children' | 'onItemSelect'>\n\n/**\n * This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have\n * a sub-menu.\n *\n * Its children are expected to have the structure of a first level menu (a `MenuButton` and a\n * `MenuList`).\n *\n * ```jsx\n * <MenuItem label=\"Edit profile\" />\n * <SubMenu>\n * <MenuButton>More options</MenuButton>\n * <MenuList>\n * <MenuItem label=\"Preferences\" />\n * <MenuItem label=\"Sign out\" />\n * </MenuList>\n * </SubMenu>\n * ```\n *\n * The `MenuButton` will become a menu item in the current menu items list, and it will lead to\n * opening a sub-menu with the menu items list below it.\n */\nconst SubMenu = React.forwardRef<HTMLDivElement, SubMenuProps>(function SubMenu(\n { children, onItemSelect },\n ref,\n) {\n const { handleItemSelect: parentMenuItemSelect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('SubMenu must be wrapped in <Menu/>')\n }\n\n const { hide: parentMenuHide } = menuStore\n const handleSubItemSelect = React.useCallback(\n function handleSubItemSelect(value: string | null | undefined) {\n onItemSelect?.(value)\n parentMenuItemSelect?.(value)\n parentMenuHide()\n },\n [parentMenuHide, parentMenuItemSelect, onItemSelect],\n )\n\n const [button, list] = React.Children.toArray(children)\n const buttonElement = button as React.ReactElement<MenuButtonProps>\n const subMenuContextValue = React.useMemo(() => ({ isSubMenu: true }), [])\n\n return (\n <Menu onItemSelect={handleSubItemSelect}>\n <AriakitMenuItem store={menuStore} ref={ref} hideOnClick={false} render={buttonElement}>\n {buttonElement.props.children}\n </AriakitMenuItem>\n <SubMenuContext.Provider value={subMenuContextValue}>{list}</SubMenuContext.Provider>\n </Menu>\n )\n})\n\n//\n// MenuGroup\n//\n\ninterface MenuGroupProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'className'>,\n ObfuscatedClassName {\n /**\n * A label to be shown visually and also used to semantically label the group.\n */\n label: string\n}\n\n/**\n * A way to semantically group some menu items.\n *\n * This group does not add any visual separator. You can do that yourself adding `<hr />` elements\n * before and/or after the group if you so wish.\n */\nconst MenuGroup = React.forwardRef<HTMLDivElement, MenuGroupProps>(function MenuGroup(\n { label, children, exceptionallySetClassName, ...props },\n ref,\n) {\n const { menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuGroup must be wrapped in <Menu/>')\n }\n\n return (\n <AriakitMenuGroup\n {...props}\n ref={ref}\n store={menuStore}\n className={exceptionallySetClassName}\n >\n {label ? (\n <div role=\"presentation\" className=\"reactist_menugroup__label\">\n {label}\n </div>\n ) : null}\n {children}\n </AriakitMenuGroup>\n )\n})\n\nexport { ContextMenuTrigger, Menu, MenuButton, MenuList, MenuItem, SubMenu, MenuGroup }\nexport type { MenuButtonProps, MenuListProps, MenuItemProps, MenuGroupProps }\n"],"names":["MenuContext","React","createContext","menuStore","handleItemSelect","getAnchorRect","setAnchorRect","SubMenuContext","isSubMenu","Menu","_ref","children","onItemSelect","props","_objectWithoutProperties","objectWithoutProperties","_excluded","anchorRect","useState","useMemo","useMenuStore","_objectSpread","focusLoop","value","createElement","Provider","MenuButton","forwardRef","ref","exceptionallySetClassName","_ref2","_excluded2","useContext","Error","AriakitMenuButton","store","className","classNames","ContextMenuTrigger","render","_ref3","_excluded3","handleContextMenu","useCallback","event","preventDefault","x","clientX","y","clientY","show","isOpen","useEffect","Role","div","onContextMenu","MenuList","modal","flip","_ref4","_excluded4","Portal","preserveTabOrder","AriakitMenu","gutter","shift","undefined","MenuItem","onSelect","hideOnSelect","onClick","_ref5","_excluded5","hide","handleClick","shouldClose","defaultPrevented","AriakitMenuItem","hideOnClick","SubMenu","parentMenuItemSelect","parentMenuHide","handleSubItemSelect","button","list","Children","toArray","buttonElement","subMenuContextValue","MenuGroup","label","_ref6","_excluded6","AriakitMenuGroup","role"],"mappings":"yzBA6BMA,EAAcC,EAAMC,cAAgC,CACtDC,UAAW,KACXC,iBAAkB,OAClBC,cAAe,KACfC,cAAe,SAGbC,EAAiBN,EAAMC,cAAsC,CAAEM,WAAW,IA2BhF,SAASC,EAAoDC,GAAA,IAA/CC,SAAEA,EAAFC,aAAYA,GAAmCF,EAAlBG,EAAk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MAAA,CAAAsE,KAAK,eAAe1D,UAAU,6BAC9BsD,GAEL,KACH/E"}
|
|
1
|
+
{"version":3,"file":"menu.js","sources":["../../src/menu/menu.tsx"],"sourcesContent":[null],"names":["React","__rest","useMenuStore","__assign","AriakitMenuButton","classNames","Role","Portal","AriakitMenu","AriakitMenuItem","AriakitMenuGroup"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAM,WAAW,GAAGA,gBAAK,CAAC,aAAa,CAAmB;AACtD,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,gBAAgB,EAAE,YAAA,EAAM,OAAA,SAAS,GAAA;AACjC,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,aAAa,EAAE,YAAA,EAAM,OAAA,SAAS,GAAA;AACjC,CAAA,CAAC,CAAA;AAEF,IAAM,cAAc,GAAGA,gBAAK,CAAC,aAAa,CAAyB,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAA;AAuBxF;;;AAGG;AACH,SAAS,IAAI,CAAC,EAA+C,EAAA;IAA7C,IAAA,QAAQ,cAAA,EAAE,YAAY,kBAAA,EAAK,KAAK,GAAlCC,YAAA,CAAA,EAAA,EAAA,CAAA,UAAA,EAAA,cAAA,CAAoC,CAAF,CAAA;AACtC,IAAA,IAAA,EAA8B,GAAAD,gBAAK,CAAC,QAAQ,CAAkC,IAAI,CAAC,EAAlF,UAAU,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,aAAa,QAAyD,CAAA;AACzF,IAAA,IAAM,aAAa,GAAGA,gBAAK,CAAC,OAAO,CAAC,YAAM,EAAA,QAAC,UAAU,GAAG,YAAM,EAAA,OAAA,UAAU,CAAA,EAAA,GAAG,IAAI,EAArC,EAAsC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;IAC/F,IAAM,SAAS,GAAGE,kBAAY,CAAGC,cAAA,CAAA,EAAA,SAAS,EAAE,IAAI,EAAA,EAAK,KAAK,CAAA,CAAG,CAAA;AAE7D,I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ACZ,QAAA,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;AAC1D,KAAA;AAED,IAAA,QACIA,gBAAC,CAAA,aAAA,CAAAU,eAAgB,EACTP,cAAA,CAAA,EAAA,EAAA,KAAK,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,yBAAyB,EAAA,CAAA;AAEnC,QAAA,KAAK,IACFH,gBAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,IAAI,EAAC,cAAc,EAAC,SAAS,EAAC,2BAA2B,IACzD,KAAK,CACJ,IACN,IAAI;QACP,QAAQ,CACM,EACtB;AACL,CAAC;;;;;;;;;;"}
|
package/lib/modal/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './modal';
|
|
1
|
+
export * from './modal';
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as ModalComponents from './modal';
|
|
3
|
-
import type { ModalProps, ModalHeaderProps, ModalFooterProps } from './modal';
|
|
4
|
-
declare function Link({ children, ...props }: JSX.IntrinsicElements['a']): React.JSX.Element;
|
|
5
|
-
type ModalStoryState = Pick<ModalProps, 'width' | 'height'> & {
|
|
6
|
-
button: 'true' | 'false' | 'custom';
|
|
7
|
-
hideOn: 'escapeAndOverlay' | 'escape' | 'overlay';
|
|
8
|
-
withScrollableContent: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare function ModalStoryStateProvider({ initialState, children, }: {
|
|
11
|
-
initialState?: Partial<ModalStoryState>;
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
}): React.JSX.Element;
|
|
14
|
-
declare function ScrollableContent({ label, count }: {
|
|
15
|
-
label?: string;
|
|
16
|
-
count?: number;
|
|
17
|
-
}): React.JSX.Element;
|
|
18
|
-
declare function ModalOptionsForm({ title }: {
|
|
19
|
-
title?: React.ReactNode;
|
|
20
|
-
}): React.JSX.Element;
|
|
21
|
-
declare function ModalButton({ variant, size, children, action, }: {
|
|
22
|
-
variant: 'primary' | 'secondary' | 'danger';
|
|
23
|
-
action?: 'open' | 'close';
|
|
24
|
-
size?: 'small';
|
|
25
|
-
children: NonNullable<React.ReactNode>;
|
|
26
|
-
}): React.JSX.Element;
|
|
27
|
-
declare namespace ModalButton {
|
|
28
|
-
var displayName: string;
|
|
29
|
-
}
|
|
30
|
-
type WithOptionals<Props, Keys extends keyof Props> = Omit<Props, Keys> & Partial<Pick<Props, Keys>>;
|
|
31
|
-
declare function Modal(props: WithOptionals<ModalProps, 'isOpen' | 'onDismiss' | 'width' | 'height'>): React.JSX.Element;
|
|
32
|
-
declare function ModalHeader(props: WithOptionals<ModalHeaderProps, 'withDivider' | 'button'>): React.JSX.Element;
|
|
33
|
-
declare const ModalBody: React.ForwardRefExoticComponent<Omit<ModalComponents.ModalBodyProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
-
declare function ModalFooter(props: WithOptionals<ModalFooterProps, 'withDivider'>): React.JSX.Element;
|
|
35
|
-
declare function ModalActions(props: WithOptionals<ModalFooterProps, 'withDivider'>): React.JSX.Element;
|
|
36
|
-
/**
|
|
37
|
-
* Used by stories in storybooks to programmatically open the modal on each story.
|
|
38
|
-
*
|
|
39
|
-
* Not only that, but it also serves the purpose of testing that the modal actually opens.
|
|
40
|
-
*
|
|
41
|
-
* @see https://storybook.js.org/docs/react/writing-tests/interaction-testing
|
|
42
|
-
*/
|
|
43
|
-
export declare function openModal({ canvasElement }: {
|
|
44
|
-
canvasElement: HTMLElement;
|
|
45
|
-
}): Promise<void>;
|
|
46
|
-
export { Link, ModalStoryStateProvider, ModalOptionsForm, ModalButton as Button, ScrollableContent };
|
|
47
|
-
export { Modal, ModalHeader, ModalBody, ModalFooter, ModalActions };
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ModalComponents from './modal';
|
|
3
|
+
import type { ModalProps, ModalHeaderProps, ModalFooterProps } from './modal';
|
|
4
|
+
declare function Link({ children, ...props }: JSX.IntrinsicElements['a']): React.JSX.Element;
|
|
5
|
+
type ModalStoryState = Pick<ModalProps, 'width' | 'height'> & {
|
|
6
|
+
button: 'true' | 'false' | 'custom';
|
|
7
|
+
hideOn: 'escapeAndOverlay' | 'escape' | 'overlay';
|
|
8
|
+
withScrollableContent: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare function ModalStoryStateProvider({ initialState, children, }: {
|
|
11
|
+
initialState?: Partial<ModalStoryState>;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
declare function ScrollableContent({ label, count }: {
|
|
15
|
+
label?: string;
|
|
16
|
+
count?: number;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
declare function ModalOptionsForm({ title }: {
|
|
19
|
+
title?: React.ReactNode;
|
|
20
|
+
}): React.JSX.Element;
|
|
21
|
+
declare function ModalButton({ variant, size, children, action, }: {
|
|
22
|
+
variant: 'primary' | 'secondary' | 'danger';
|
|
23
|
+
action?: 'open' | 'close';
|
|
24
|
+
size?: 'small';
|
|
25
|
+
children: NonNullable<React.ReactNode>;
|
|
26
|
+
}): React.JSX.Element;
|
|
27
|
+
declare namespace ModalButton {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
30
|
+
type WithOptionals<Props, Keys extends keyof Props> = Omit<Props, Keys> & Partial<Pick<Props, Keys>>;
|
|
31
|
+
declare function Modal(props: WithOptionals<ModalProps, 'isOpen' | 'onDismiss' | 'width' | 'height'>): React.JSX.Element;
|
|
32
|
+
declare function ModalHeader(props: WithOptionals<ModalHeaderProps, 'withDivider' | 'button'>): React.JSX.Element;
|
|
33
|
+
declare const ModalBody: React.ForwardRefExoticComponent<Omit<ModalComponents.ModalBodyProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
declare function ModalFooter(props: WithOptionals<ModalFooterProps, 'withDivider'>): React.JSX.Element;
|
|
35
|
+
declare function ModalActions(props: WithOptionals<ModalFooterProps, 'withDivider'>): React.JSX.Element;
|
|
36
|
+
/**
|
|
37
|
+
* Used by stories in storybooks to programmatically open the modal on each story.
|
|
38
|
+
*
|
|
39
|
+
* Not only that, but it also serves the purpose of testing that the modal actually opens.
|
|
40
|
+
*
|
|
41
|
+
* @see https://storybook.js.org/docs/react/writing-tests/interaction-testing
|
|
42
|
+
*/
|
|
43
|
+
export declare function openModal({ canvasElement }: {
|
|
44
|
+
canvasElement: HTMLElement;
|
|
45
|
+
}): Promise<void>;
|
|
46
|
+
export { Link, ModalStoryStateProvider, ModalOptionsForm, ModalButton as Button, ScrollableContent };
|
|
47
|
+
export { Modal, ModalHeader, ModalBody, ModalFooter, ModalActions };
|