@doist/reactist 28.7.2 → 28.7.4
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/CHANGELOG.md +1457 -0
- package/CODE_OF_CONDUCT.md +83 -0
- package/CONTRIBUTING.md +46 -0
- 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 +32 -26
- 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
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __assign } from 'tslib';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
function PasswordVisibleIcon(props) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, props), /*#__PURE__*/React.createElement("g", {
|
|
10
|
-
fill: "none",
|
|
11
|
-
fillRule: "evenodd",
|
|
12
|
-
stroke: "gray"
|
|
13
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
d: "M21.358 12C17.825 7.65 14.692 5.5 12 5.5c-2.624 0-5.67 2.043-9.097 6.181a.5.5 0 0 0 0 .638C6.331 16.457 9.376 18.5 12 18.5c2.692 0 5.825-2.15 9.358-6.5z"
|
|
15
|
-
}), /*#__PURE__*/React.createElement("circle", {
|
|
16
|
-
cx: "12",
|
|
17
|
-
cy: "12",
|
|
18
|
-
r: "3.5"
|
|
19
|
-
})));
|
|
5
|
+
return (React.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24" }, props),
|
|
6
|
+
React.createElement("g", { fill: "none", fillRule: "evenodd", stroke: "gray" },
|
|
7
|
+
React.createElement("path", { d: "M21.358 12C17.825 7.65 14.692 5.5 12 5.5c-2.624 0-5.67 2.043-9.097 6.181a.5.5 0 0 0 0 .638C6.331 16.457 9.376 18.5 12 18.5c2.692 0 5.825-2.15 9.358-6.5z" }),
|
|
8
|
+
React.createElement("circle", { cx: "12", cy: "12", r: "3.5" }))));
|
|
20
9
|
}
|
|
21
10
|
|
|
22
11
|
export { PasswordVisibleIcon };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-visible-icon.js","sources":["../../src/icons/password-visible-icon.tsx"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"password-visible-icon.js","sources":["../../src/icons/password-visible-icon.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;AAEA,SAAS,mBAAmB,CAAC,KAAmC,EAAA;AAC5D,IAAA,QACI,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,QAAA,CAAA,EAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,IAAK,KAAK,CAAA;QACpE,KAAG,CAAA,aAAA,CAAA,GAAA,EAAA,EAAA,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,SAAS,EAAC,MAAM,EAAC,MAAM,EAAA;YAC3C,KAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,CAAC,EAAC,0JAA0J,EAAG,CAAA;AACrK,YAAA,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,EAAA,CAAG,CAClC,CACF,EACT;AACL;;;;"}
|
package/es/inline/inline.js
CHANGED
|
@@ -1,31 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { polymorphicComponent } from '../utils/polymorphism.js';
|
|
4
4
|
import { mapResponsiveProp } from '../utils/responsive-props.js';
|
|
5
5
|
import { Box } from '../box/box.js';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
children,
|
|
15
|
-
exceptionallySetClassName
|
|
16
|
-
} = _ref,
|
|
17
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
-
|
|
19
|
-
return /*#__PURE__*/React.createElement(Box, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
20
|
-
as: as,
|
|
21
|
-
display: "flex",
|
|
22
|
-
flexWrap: "wrap",
|
|
23
|
-
gap: space,
|
|
24
|
-
className: exceptionallySetClassName,
|
|
25
|
-
ref: ref,
|
|
26
|
-
alignItems: mapResponsiveProp(alignY, alignY => alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : 'center'),
|
|
27
|
-
justifyContent: mapResponsiveProp(align, align => align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : 'center')
|
|
28
|
-
}), children);
|
|
7
|
+
var Inline = polymorphicComponent(function Inline(_a, ref) {
|
|
8
|
+
var as = _a.as, space = _a.space, _b = _a.align, align = _b === void 0 ? 'left' : _b, _c = _a.alignY, alignY = _c === void 0 ? 'center' : _c, children = _a.children, exceptionallySetClassName = _a.exceptionallySetClassName, props = __rest(_a, ["as", "space", "align", "alignY", "children", "exceptionallySetClassName"]);
|
|
9
|
+
return (React.createElement(Box, __assign({}, props, { as: as, display: "flex", flexWrap: "wrap", gap: space, className: exceptionallySetClassName, ref: ref, alignItems: mapResponsiveProp(alignY, function (alignY) {
|
|
10
|
+
return alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : 'center';
|
|
11
|
+
}), justifyContent: mapResponsiveProp(align, function (align) {
|
|
12
|
+
return align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : 'center';
|
|
13
|
+
}) }), children));
|
|
29
14
|
});
|
|
30
15
|
|
|
31
16
|
export { Inline };
|
package/es/inline/inline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.js","sources":["../../src/inline/inline.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"inline.js","sources":["../../src/inline/inline.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAiBM,IAAA,MAAM,GAAG,oBAAoB,CAAqB,SAAS,MAAM,CACnE,EAA+F,EAC/F,GAAG,EAAA;AADD,IAAA,IAAA,EAAE,GAAA,EAAA,CAAA,EAAA,EAAE,KAAK,GAAA,EAAA,CAAA,KAAA,EAAE,EAAc,GAAA,EAAA,CAAA,KAAA,EAAd,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,MAAM,GAAA,EAAA,EAAE,EAAA,GAAA,EAAA,CAAA,MAAiB,EAAjB,MAAM,GAAG,EAAA,KAAA,KAAA,CAAA,GAAA,QAAQ,GAAA,EAAA,EAAE,QAAQ,GAAA,EAAA,CAAA,QAAA,EAAE,yBAAyB,GAAA,EAAA,CAAA,yBAAA,EAAK,KAAK,GAAA,MAAA,CAAA,EAAA,EAA7F,2EAA+F,CAAF,CAAA;AAG7F,IAAA,QACI,KAAC,CAAA,aAAA,CAAA,GAAG,EACI,QAAA,CAAA,EAAA,EAAA,KAAK,IACT,EAAE,EAAE,EAAE,EACN,OAAO,EAAC,MAAM,EACd,QAAQ,EAAC,MAAM,EACf,GAAG,EAAE,KAAK,EACV,SAAS,EAAE,yBAAyB,EACpC,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,iBAAiB,CAAC,MAAM,EAAE,UAAC,MAAM,EAAA;YACzC,OAAA,MAAM,KAAK,KAAK,GAAG,WAAW,GAAG,MAAM,KAAK,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAA;SAAA,CAC9E,EACD,cAAc,EAAE,iBAAiB,CAAC,KAAK,EAAE,UAAC,KAAK,EAAA;YAC3C,OAAA,KAAK,KAAK,MAAM,GAAG,WAAW,GAAG,KAAK,KAAK,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAA;AAAzE,SAAyE,CAC5E,EAAA,CAAA,EAEA,QAAQ,CACP,EACT;AACL,CAAC;;;;"}
|
package/es/loading/loading.js
CHANGED
|
@@ -1,36 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Box } from '../box/box.js';
|
|
4
4
|
import { Spinner } from '../spinner/spinner.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
large: 48
|
|
6
|
+
var sizeMapping = {
|
|
7
|
+
xsmall: 16,
|
|
8
|
+
small: 24,
|
|
9
|
+
medium: 36,
|
|
10
|
+
large: 48
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"aria-label": ariaLabel,
|
|
25
|
-
className: exceptionallySetClassName,
|
|
26
|
-
display: "flex",
|
|
27
|
-
alignItems: "center",
|
|
28
|
-
justifyContent: "center",
|
|
29
|
-
role: "progressbar"
|
|
30
|
-
}), /*#__PURE__*/React.createElement(Spinner, {
|
|
31
|
-
size: numericSize,
|
|
32
|
-
"aria-hidden": true
|
|
33
|
-
}));
|
|
12
|
+
function Loading(_a) {
|
|
13
|
+
var _b;
|
|
14
|
+
var _c = _a.size, size = _c === void 0 ? 'small' : _c, exceptionallySetClassName = _a.exceptionallySetClassName, props = __rest(_a, ["size", "exceptionallySetClassName"]);
|
|
15
|
+
var numericSize = (_b = sizeMapping[size]) !== null && _b !== void 0 ? _b : sizeMapping.small;
|
|
16
|
+
var ariaLabel = props['aria-label']
|
|
17
|
+
? props['aria-label']
|
|
18
|
+
: !props['aria-labelledby']
|
|
19
|
+
? 'Loading…'
|
|
20
|
+
: undefined;
|
|
21
|
+
return (React.createElement(Box, __assign({}, props, { "aria-label": ariaLabel, className: exceptionallySetClassName, display: "flex", alignItems: "center", justifyContent: "center", role: "progressbar" }),
|
|
22
|
+
React.createElement(Spinner, { size: numericSize, "aria-hidden": true })));
|
|
34
23
|
}
|
|
35
24
|
|
|
36
25
|
export { Loading };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.js","sources":["../../src/loading/loading.tsx"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"loading.js","sources":["../../src/loading/loading.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAqCA,IAAM,WAAW,GAAyB;AACtC,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,KAAK,EAAE,EAAE;CACZ,CAAA;AAED,SAAS,OAAO,CAAC,EAAqE,EAAA;;AAAnE,IAAA,IAAA,EAAc,GAAA,EAAA,CAAA,IAAA,EAAd,IAAI,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,OAAO,GAAA,EAAA,EAAE,yBAAyB,GAAA,EAAA,CAAA,yBAAA,EAAK,KAAK,GAAA,MAAA,CAAA,EAAA,EAArD,qCAAuD,CAAF,CAAA;IAClE,IAAM,WAAW,GAAG,CAAA,EAAA,GAAA,WAAW,CAAC,IAAI,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,WAAW,CAAC,KAAK,CAAA;AAC1D,IAAA,IAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAC;AACjC,UAAE,KAAK,CAAC,YAAY,CAAC;AACrB,UAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC;AAC3B,cAAE,UAAU;cACV,SAAS,CAAA;IAEf,QACI,KAAC,CAAA,aAAA,CAAA,GAAG,EACI,QAAA,CAAA,EAAA,EAAA,KAAK,EACG,EAAA,YAAA,EAAA,SAAS,EACrB,SAAS,EAAE,yBAAyB,EACpC,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,cAAc,EAAC,QAAQ,EACvB,IAAI,EAAC,aAAa,EAAA,CAAA;QAElB,KAAC,CAAA,aAAA,CAAA,OAAO,IAAC,IAAI,EAAE,WAAW,EAAgB,aAAA,EAAA,IAAA,EAAA,CAAA,CACxC,EACT;AACL;;;;"}
|
package/es/menu/menu.js
CHANGED
|
@@ -1,279 +1,146 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import {
|
|
4
|
+
import { MenuButton as MenuButton$1, Role, Portal, Menu as Menu$1, MenuItem as MenuItem$1, MenuGroup as MenuGroup$1, useMenuStore } from '@ariakit/react';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
_excluded6 = ["label", "children", "exceptionallySetClassName"];
|
|
12
|
-
const MenuContext = /*#__PURE__*/React.createContext({
|
|
13
|
-
menuStore: null,
|
|
14
|
-
handleItemSelect: () => undefined,
|
|
15
|
-
getAnchorRect: null,
|
|
16
|
-
setAnchorRect: () => undefined
|
|
6
|
+
var MenuContext = React.createContext({
|
|
7
|
+
menuStore: null,
|
|
8
|
+
handleItemSelect: function () { return undefined; },
|
|
9
|
+
getAnchorRect: null,
|
|
10
|
+
setAnchorRect: function () { return undefined; }
|
|
17
11
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* Wrapper component to control a menu. It does not render anything, only providing the state
|
|
23
|
-
* management for the menu components inside it.
|
|
12
|
+
var SubMenuContext = React.createContext({ isSubMenu: false });
|
|
13
|
+
/**
|
|
14
|
+
* Wrapper component to control a menu. It does not render anything, only providing the state
|
|
15
|
+
* management for the menu components inside it.
|
|
24
16
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const [anchorRect, setAnchorRect] = React.useState(null);
|
|
34
|
-
const getAnchorRect = React.useMemo(() => anchorRect ? () => anchorRect : null, [anchorRect]);
|
|
35
|
-
const menuStore = useMenuStore(_objectSpread2({
|
|
36
|
-
focusLoop: true
|
|
37
|
-
}, props));
|
|
38
|
-
const value = React.useMemo(() => ({
|
|
39
|
-
menuStore,
|
|
40
|
-
handleItemSelect: onItemSelect,
|
|
41
|
-
getAnchorRect,
|
|
42
|
-
setAnchorRect
|
|
43
|
-
}), [menuStore, onItemSelect, getAnchorRect, setAnchorRect]);
|
|
44
|
-
return /*#__PURE__*/React.createElement(MenuContext.Provider, {
|
|
45
|
-
value: value
|
|
46
|
-
}, children);
|
|
17
|
+
function Menu(_a) {
|
|
18
|
+
var children = _a.children, onItemSelect = _a.onItemSelect, props = __rest(_a, ["children", "onItemSelect"]);
|
|
19
|
+
var _b = React.useState(null), anchorRect = _b[0], setAnchorRect = _b[1];
|
|
20
|
+
var getAnchorRect = React.useMemo(function () { return (anchorRect ? function () { return anchorRect; } : null); }, [anchorRect]);
|
|
21
|
+
var menuStore = useMenuStore(__assign({ focusLoop: true }, props));
|
|
22
|
+
var value = React.useMemo(function () { return ({ menuStore: menuStore, handleItemSelect: onItemSelect, getAnchorRect: getAnchorRect, setAnchorRect: setAnchorRect }); }, [menuStore, onItemSelect, getAnchorRect, setAnchorRect]);
|
|
23
|
+
return React.createElement(MenuContext.Provider, { value: value }, children);
|
|
47
24
|
}
|
|
48
|
-
/**
|
|
49
|
-
* A button to toggle a dropdown menu open or closed.
|
|
25
|
+
/**
|
|
26
|
+
* A button to toggle a dropdown menu open or closed.
|
|
50
27
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const {
|
|
60
|
-
menuStore
|
|
61
|
-
} = React.useContext(MenuContext);
|
|
62
|
-
|
|
63
|
-
if (!menuStore) {
|
|
64
|
-
throw new Error('MenuButton must be wrapped in <Menu/>');
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return /*#__PURE__*/React.createElement(MenuButton$1, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
68
|
-
store: menuStore,
|
|
69
|
-
ref: ref,
|
|
70
|
-
className: classNames('reactist_menubutton', exceptionallySetClassName)
|
|
71
|
-
}));
|
|
28
|
+
var MenuButton = React.forwardRef(function MenuButton(_a, ref) {
|
|
29
|
+
var exceptionallySetClassName = _a.exceptionallySetClassName, props = __rest(_a, ["exceptionallySetClassName"]);
|
|
30
|
+
var menuStore = React.useContext(MenuContext).menuStore;
|
|
31
|
+
if (!menuStore) {
|
|
32
|
+
throw new Error('MenuButton must be wrapped in <Menu/>');
|
|
33
|
+
}
|
|
34
|
+
return (React.createElement(MenuButton$1, __assign({}, props, { store: menuStore, ref: ref, className: classNames('reactist_menubutton', exceptionallySetClassName) })));
|
|
72
35
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
setAnchorRect({
|
|
91
|
-
x: event.clientX,
|
|
92
|
-
y: event.clientY
|
|
93
|
-
});
|
|
94
|
-
menuStore.show();
|
|
95
|
-
}, [setAnchorRect, menuStore]);
|
|
96
|
-
const isOpen = menuStore.useState('open');
|
|
97
|
-
React.useEffect(() => {
|
|
98
|
-
if (!isOpen) setAnchorRect(null);
|
|
99
|
-
}, [isOpen, setAnchorRect]);
|
|
100
|
-
return /*#__PURE__*/React.createElement(Role.div, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
101
|
-
onContextMenu: handleContextMenu,
|
|
102
|
-
ref: ref,
|
|
103
|
-
render: render
|
|
104
|
-
}));
|
|
36
|
+
var ContextMenuTrigger = React.forwardRef(function ContextMenuTrigger(_a, ref) {
|
|
37
|
+
var render = _a.render, props = __rest(_a, ["render"]);
|
|
38
|
+
var _b = React.useContext(MenuContext), setAnchorRect = _b.setAnchorRect, menuStore = _b.menuStore;
|
|
39
|
+
if (!menuStore) {
|
|
40
|
+
throw new Error('ContextMenuTrigger must be wrapped in <Menu/>');
|
|
41
|
+
}
|
|
42
|
+
var handleContextMenu = React.useCallback(function handleContextMenu(event) {
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
setAnchorRect({ x: event.clientX, y: event.clientY });
|
|
45
|
+
menuStore.show();
|
|
46
|
+
}, [setAnchorRect, menuStore]);
|
|
47
|
+
var isOpen = menuStore.useState('open');
|
|
48
|
+
React.useEffect(function () {
|
|
49
|
+
if (!isOpen)
|
|
50
|
+
setAnchorRect(null);
|
|
51
|
+
}, [isOpen, setAnchorRect]);
|
|
52
|
+
return React.createElement(Role.div, __assign({}, props, { onContextMenu: handleContextMenu, ref: ref, render: render }));
|
|
105
53
|
});
|
|
106
|
-
/**
|
|
107
|
-
* The dropdown menu itself, containing a list of menu items.
|
|
54
|
+
/**
|
|
55
|
+
* The dropdown menu itself, containing a list of menu items.
|
|
108
56
|
*/
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
menuStore,
|
|
120
|
-
getAnchorRect
|
|
121
|
-
} = React.useContext(MenuContext);
|
|
122
|
-
|
|
123
|
-
if (!menuStore) {
|
|
124
|
-
throw new Error('MenuList must be wrapped in <Menu/>');
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const {
|
|
128
|
-
isSubMenu
|
|
129
|
-
} = React.useContext(SubMenuContext);
|
|
130
|
-
const isOpen = menuStore.useState('open');
|
|
131
|
-
return isOpen ? /*#__PURE__*/React.createElement(Portal, {
|
|
132
|
-
preserveTabOrder: true
|
|
133
|
-
}, /*#__PURE__*/React.createElement(Menu$1, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
134
|
-
store: menuStore,
|
|
135
|
-
gutter: 8,
|
|
136
|
-
shift: 4,
|
|
137
|
-
ref: ref,
|
|
138
|
-
className: classNames('reactist_menulist', exceptionallySetClassName),
|
|
139
|
-
getAnchorRect: getAnchorRect ?? undefined,
|
|
140
|
-
modal: modal,
|
|
141
|
-
flip: flip ?? (isSubMenu ? 'left bottom' : undefined)
|
|
142
|
-
}))) : null;
|
|
57
|
+
var MenuList = React.forwardRef(function MenuList(_a, ref) {
|
|
58
|
+
var exceptionallySetClassName = _a.exceptionallySetClassName, _b = _a.modal, modal = _b === void 0 ? true : _b, flip = _a.flip, props = __rest(_a, ["exceptionallySetClassName", "modal", "flip"]);
|
|
59
|
+
var _c = React.useContext(MenuContext), menuStore = _c.menuStore, getAnchorRect = _c.getAnchorRect;
|
|
60
|
+
if (!menuStore) {
|
|
61
|
+
throw new Error('MenuList must be wrapped in <Menu/>');
|
|
62
|
+
}
|
|
63
|
+
var isSubMenu = React.useContext(SubMenuContext).isSubMenu;
|
|
64
|
+
var isOpen = menuStore.useState('open');
|
|
65
|
+
return isOpen ? (React.createElement(Portal, { preserveTabOrder: true },
|
|
66
|
+
React.createElement(Menu$1, __assign({}, props, { store: menuStore, gutter: 8, shift: 4, ref: ref, className: classNames('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;
|
|
143
67
|
});
|
|
144
|
-
/**
|
|
145
|
-
* A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`
|
|
146
|
-
* callback.
|
|
68
|
+
/**
|
|
69
|
+
* A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`
|
|
70
|
+
* callback.
|
|
147
71
|
*/
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if (!menuStore) {
|
|
166
|
-
throw new Error('MenuItem must be wrapped in <Menu/>');
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const {
|
|
170
|
-
hide
|
|
171
|
-
} = menuStore;
|
|
172
|
-
const handleClick = React.useCallback(function handleClick(event) {
|
|
173
|
-
onClick == null ? void 0 : onClick(event);
|
|
174
|
-
const onSelectResult = onSelect && !event.defaultPrevented ? onSelect() : undefined;
|
|
175
|
-
const shouldClose = onSelectResult !== false && hideOnSelect;
|
|
176
|
-
handleItemSelect == null ? void 0 : handleItemSelect(value);
|
|
177
|
-
if (shouldClose) hide();
|
|
178
|
-
}, [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value]);
|
|
179
|
-
return /*#__PURE__*/React.createElement(MenuItem$1, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
180
|
-
store: menuStore,
|
|
181
|
-
ref: ref,
|
|
182
|
-
onClick: handleClick,
|
|
183
|
-
className: exceptionallySetClassName,
|
|
184
|
-
hideOnClick: false
|
|
185
|
-
}), children);
|
|
72
|
+
var MenuItem = React.forwardRef(function MenuItem(_a, ref) {
|
|
73
|
+
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 = __rest(_a, ["value", "children", "onSelect", "hideOnSelect", "onClick", "exceptionallySetClassName"]);
|
|
74
|
+
var _c = React.useContext(MenuContext), handleItemSelect = _c.handleItemSelect, menuStore = _c.menuStore;
|
|
75
|
+
if (!menuStore) {
|
|
76
|
+
throw new Error('MenuItem must be wrapped in <Menu/>');
|
|
77
|
+
}
|
|
78
|
+
var hide = menuStore.hide;
|
|
79
|
+
var handleClick = React.useCallback(function handleClick(event) {
|
|
80
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
81
|
+
var onSelectResult = onSelect && !event.defaultPrevented ? onSelect() : undefined;
|
|
82
|
+
var shouldClose = onSelectResult !== false && hideOnSelect;
|
|
83
|
+
handleItemSelect === null || handleItemSelect === void 0 ? void 0 : handleItemSelect(value);
|
|
84
|
+
if (shouldClose)
|
|
85
|
+
hide();
|
|
86
|
+
}, [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value]);
|
|
87
|
+
return (React.createElement(MenuItem$1, __assign({}, props, { store: menuStore, ref: ref, onClick: handleClick, className: exceptionallySetClassName, hideOnClick: false }), children));
|
|
186
88
|
});
|
|
187
|
-
/**
|
|
188
|
-
* This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have
|
|
189
|
-
* a sub-menu.
|
|
190
|
-
*
|
|
191
|
-
* Its children are expected to have the structure of a first level menu (a `MenuButton` and a
|
|
192
|
-
* `MenuList`).
|
|
193
|
-
*
|
|
194
|
-
* ```jsx
|
|
195
|
-
* <MenuItem label="Edit profile" />
|
|
196
|
-
* <SubMenu>
|
|
197
|
-
* <MenuButton>More options</MenuButton>
|
|
198
|
-
* <MenuList>
|
|
199
|
-
* <MenuItem label="Preferences" />
|
|
200
|
-
* <MenuItem label="Sign out" />
|
|
201
|
-
* </MenuList>
|
|
202
|
-
* </SubMenu>
|
|
203
|
-
* ```
|
|
204
|
-
*
|
|
205
|
-
* The `MenuButton` will become a menu item in the current menu items list, and it will lead to
|
|
206
|
-
* opening a sub-menu with the menu items list below it.
|
|
89
|
+
/**
|
|
90
|
+
* This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have
|
|
91
|
+
* a sub-menu.
|
|
92
|
+
*
|
|
93
|
+
* Its children are expected to have the structure of a first level menu (a `MenuButton` and a
|
|
94
|
+
* `MenuList`).
|
|
95
|
+
*
|
|
96
|
+
* ```jsx
|
|
97
|
+
* <MenuItem label="Edit profile" />
|
|
98
|
+
* <SubMenu>
|
|
99
|
+
* <MenuButton>More options</MenuButton>
|
|
100
|
+
* <MenuList>
|
|
101
|
+
* <MenuItem label="Preferences" />
|
|
102
|
+
* <MenuItem label="Sign out" />
|
|
103
|
+
* </MenuList>
|
|
104
|
+
* </SubMenu>
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* The `MenuButton` will become a menu item in the current menu items list, and it will lead to
|
|
108
|
+
* opening a sub-menu with the menu items list below it.
|
|
207
109
|
*/
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
onItemSelect == null ? void 0 : onItemSelect(value);
|
|
227
|
-
parentMenuItemSelect == null ? void 0 : parentMenuItemSelect(value);
|
|
228
|
-
parentMenuHide();
|
|
229
|
-
}, [parentMenuHide, parentMenuItemSelect, onItemSelect]);
|
|
230
|
-
const [button, list] = React.Children.toArray(children);
|
|
231
|
-
const buttonElement = button;
|
|
232
|
-
const subMenuContextValue = React.useMemo(() => ({
|
|
233
|
-
isSubMenu: true
|
|
234
|
-
}), []);
|
|
235
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
236
|
-
onItemSelect: handleSubItemSelect
|
|
237
|
-
}, /*#__PURE__*/React.createElement(MenuItem$1, {
|
|
238
|
-
store: menuStore,
|
|
239
|
-
ref: ref,
|
|
240
|
-
hideOnClick: false,
|
|
241
|
-
render: buttonElement
|
|
242
|
-
}, buttonElement.props.children), /*#__PURE__*/React.createElement(SubMenuContext.Provider, {
|
|
243
|
-
value: subMenuContextValue
|
|
244
|
-
}, list));
|
|
110
|
+
var SubMenu = React.forwardRef(function SubMenu(_a, ref) {
|
|
111
|
+
var children = _a.children, onItemSelect = _a.onItemSelect;
|
|
112
|
+
var _b = React.useContext(MenuContext), parentMenuItemSelect = _b.handleItemSelect, menuStore = _b.menuStore;
|
|
113
|
+
if (!menuStore) {
|
|
114
|
+
throw new Error('SubMenu must be wrapped in <Menu/>');
|
|
115
|
+
}
|
|
116
|
+
var parentMenuHide = menuStore.hide;
|
|
117
|
+
var handleSubItemSelect = React.useCallback(function handleSubItemSelect(value) {
|
|
118
|
+
onItemSelect === null || onItemSelect === void 0 ? void 0 : onItemSelect(value);
|
|
119
|
+
parentMenuItemSelect === null || parentMenuItemSelect === void 0 ? void 0 : parentMenuItemSelect(value);
|
|
120
|
+
parentMenuHide();
|
|
121
|
+
}, [parentMenuHide, parentMenuItemSelect, onItemSelect]);
|
|
122
|
+
var _c = React.Children.toArray(children), button = _c[0], list = _c[1];
|
|
123
|
+
var buttonElement = button;
|
|
124
|
+
var subMenuContextValue = React.useMemo(function () { return ({ isSubMenu: true }); }, []);
|
|
125
|
+
return (React.createElement(Menu, { onItemSelect: handleSubItemSelect },
|
|
126
|
+
React.createElement(MenuItem$1, { store: menuStore, ref: ref, hideOnClick: false, render: buttonElement }, buttonElement.props.children),
|
|
127
|
+
React.createElement(SubMenuContext.Provider, { value: subMenuContextValue }, list)));
|
|
245
128
|
});
|
|
246
|
-
/**
|
|
247
|
-
* A way to semantically group some menu items.
|
|
248
|
-
*
|
|
249
|
-
* This group does not add any visual separator. You can do that yourself adding `<hr />` elements
|
|
250
|
-
* before and/or after the group if you so wish.
|
|
129
|
+
/**
|
|
130
|
+
* A way to semantically group some menu items.
|
|
131
|
+
*
|
|
132
|
+
* This group does not add any visual separator. You can do that yourself adding `<hr />` elements
|
|
133
|
+
* before and/or after the group if you so wish.
|
|
251
134
|
*/
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
const {
|
|
262
|
-
menuStore
|
|
263
|
-
} = React.useContext(MenuContext);
|
|
264
|
-
|
|
265
|
-
if (!menuStore) {
|
|
266
|
-
throw new Error('MenuGroup must be wrapped in <Menu/>');
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
return /*#__PURE__*/React.createElement(MenuGroup$1, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
270
|
-
ref: ref,
|
|
271
|
-
store: menuStore,
|
|
272
|
-
className: exceptionallySetClassName
|
|
273
|
-
}), label ? /*#__PURE__*/React.createElement("div", {
|
|
274
|
-
role: "presentation",
|
|
275
|
-
className: "reactist_menugroup__label"
|
|
276
|
-
}, label) : null, children);
|
|
135
|
+
var MenuGroup = React.forwardRef(function MenuGroup(_a, ref) {
|
|
136
|
+
var label = _a.label, children = _a.children, exceptionallySetClassName = _a.exceptionallySetClassName, props = __rest(_a, ["label", "children", "exceptionallySetClassName"]);
|
|
137
|
+
var menuStore = React.useContext(MenuContext).menuStore;
|
|
138
|
+
if (!menuStore) {
|
|
139
|
+
throw new Error('MenuGroup must be wrapped in <Menu/>');
|
|
140
|
+
}
|
|
141
|
+
return (React.createElement(MenuGroup$1, __assign({}, props, { ref: ref, store: menuStore, className: exceptionallySetClassName }),
|
|
142
|
+
label ? (React.createElement("div", { role: "presentation", className: "reactist_menugroup__label" }, label)) : null,
|
|
143
|
+
children));
|
|
277
144
|
});
|
|
278
145
|
|
|
279
146
|
export { ContextMenuTrigger, Menu, MenuButton, MenuGroup, MenuItem, MenuList, SubMenu };
|