@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,40 +1,40 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
type Key = 'ArrowUp' | 'ArrowRight' | 'ArrowDown' | 'ArrowLeft' | 'Enter' | 'Backspace' | 'Escape';
|
|
3
|
-
declare const SUPPORTED_KEYS: Record<string, Key>;
|
|
4
|
-
declare const KeyCapturerResolver: {
|
|
5
|
-
resolveByKey(eventKey: string): Key | null;
|
|
6
|
-
resolveByKeyCode(keyCode: number): Key | null;
|
|
7
|
-
};
|
|
8
|
-
type EventHandler = (event: React.SyntheticEvent) => void;
|
|
9
|
-
type EventHandlerProps = {
|
|
10
|
-
onArrowUp?: EventHandler;
|
|
11
|
-
onArrowDown?: EventHandler;
|
|
12
|
-
onArrowLeft?: EventHandler;
|
|
13
|
-
onArrowRight?: EventHandler;
|
|
14
|
-
onEnter?: EventHandler;
|
|
15
|
-
onBackspace?: EventHandler;
|
|
16
|
-
onEscape?: EventHandler;
|
|
17
|
-
};
|
|
18
|
-
type PropagateProps = {
|
|
19
|
-
propagateArrowUp?: boolean;
|
|
20
|
-
propagateArrowDown?: boolean;
|
|
21
|
-
propagateArrowLeft?: boolean;
|
|
22
|
-
propagateArrowRight?: boolean;
|
|
23
|
-
propagateEnter?: boolean;
|
|
24
|
-
propagateBackspace?: boolean;
|
|
25
|
-
propagateEscape?: boolean;
|
|
26
|
-
};
|
|
27
|
-
type KeyCapturerProps = EventHandlerProps & PropagateProps & {
|
|
28
|
-
eventName?: 'onKeyDown' | 'onKeyDownCapture' | 'onKeyUp' | 'onKeyUpCapture';
|
|
29
|
-
children: React.ReactElement<unknown>;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Use this component to wrap anything you want to handle key events for (e.g. an input).
|
|
33
|
-
* You can specify the `eventName` to capture (defaults to `onKeyDown`).
|
|
34
|
-
* Check the SUPPORTED_KEYS map to see which keys are supported and supply the respective
|
|
35
|
-
* `on${Key}` prop (i.e. `onEnter` or `onArrowDown`).
|
|
36
|
-
* If you want the default behaviour to be preserved (i.e. only want to hook into the event
|
|
37
|
-
* instead of replacing it) set the `propagate${Key}` prop (e.g. propagateBackspace).
|
|
38
|
-
*/
|
|
39
|
-
declare function KeyCapturer(props: KeyCapturerProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
40
|
-
export { KeyCapturer, KeyCapturerResolver, SUPPORTED_KEYS };
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type Key = 'ArrowUp' | 'ArrowRight' | 'ArrowDown' | 'ArrowLeft' | 'Enter' | 'Backspace' | 'Escape';
|
|
3
|
+
declare const SUPPORTED_KEYS: Record<string, Key>;
|
|
4
|
+
declare const KeyCapturerResolver: {
|
|
5
|
+
resolveByKey(eventKey: string): Key | null;
|
|
6
|
+
resolveByKeyCode(keyCode: number): Key | null;
|
|
7
|
+
};
|
|
8
|
+
type EventHandler = (event: React.SyntheticEvent) => void;
|
|
9
|
+
type EventHandlerProps = {
|
|
10
|
+
onArrowUp?: EventHandler;
|
|
11
|
+
onArrowDown?: EventHandler;
|
|
12
|
+
onArrowLeft?: EventHandler;
|
|
13
|
+
onArrowRight?: EventHandler;
|
|
14
|
+
onEnter?: EventHandler;
|
|
15
|
+
onBackspace?: EventHandler;
|
|
16
|
+
onEscape?: EventHandler;
|
|
17
|
+
};
|
|
18
|
+
type PropagateProps = {
|
|
19
|
+
propagateArrowUp?: boolean;
|
|
20
|
+
propagateArrowDown?: boolean;
|
|
21
|
+
propagateArrowLeft?: boolean;
|
|
22
|
+
propagateArrowRight?: boolean;
|
|
23
|
+
propagateEnter?: boolean;
|
|
24
|
+
propagateBackspace?: boolean;
|
|
25
|
+
propagateEscape?: boolean;
|
|
26
|
+
};
|
|
27
|
+
type KeyCapturerProps = EventHandlerProps & PropagateProps & {
|
|
28
|
+
eventName?: 'onKeyDown' | 'onKeyDownCapture' | 'onKeyUp' | 'onKeyUpCapture';
|
|
29
|
+
children: React.ReactElement<unknown>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Use this component to wrap anything you want to handle key events for (e.g. an input).
|
|
33
|
+
* You can specify the `eventName` to capture (defaults to `onKeyDown`).
|
|
34
|
+
* Check the SUPPORTED_KEYS map to see which keys are supported and supply the respective
|
|
35
|
+
* `on${Key}` prop (i.e. `onEnter` or `onArrowDown`).
|
|
36
|
+
* If you want the default behaviour to be preserved (i.e. only want to hook into the event
|
|
37
|
+
* instead of replacing it) set the `propagate${Key}` prop (e.g. propagateBackspace).
|
|
38
|
+
*/
|
|
39
|
+
declare function KeyCapturer(props: KeyCapturerProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
40
|
+
export { KeyCapturer, KeyCapturerResolver, SUPPORTED_KEYS };
|
|
@@ -1,2 +1,172 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n["default"] = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
+
|
|
28
|
+
var SUPPORTED_KEYS = {
|
|
29
|
+
ARROW_UP: 'ArrowUp',
|
|
30
|
+
ARROW_RIGHT: 'ArrowRight',
|
|
31
|
+
ARROW_DOWN: 'ArrowDown',
|
|
32
|
+
ARROW_LEFT: 'ArrowLeft',
|
|
33
|
+
ENTER: 'Enter',
|
|
34
|
+
BACKSPACE: 'Backspace',
|
|
35
|
+
ESCAPE: 'Escape'
|
|
36
|
+
};
|
|
37
|
+
var KeyCapturerResolver = {
|
|
38
|
+
resolveByKey: function (eventKey) {
|
|
39
|
+
switch (eventKey) {
|
|
40
|
+
case 'Left': // IE specific
|
|
41
|
+
case 'ArrowLeft': {
|
|
42
|
+
return 'ArrowLeft';
|
|
43
|
+
}
|
|
44
|
+
case 'Up': // IE specific
|
|
45
|
+
case 'ArrowUp': {
|
|
46
|
+
return 'ArrowUp';
|
|
47
|
+
}
|
|
48
|
+
case 'Right': // IE specific
|
|
49
|
+
case 'ArrowRight': {
|
|
50
|
+
return 'ArrowRight';
|
|
51
|
+
}
|
|
52
|
+
case 'Down': // IE specific
|
|
53
|
+
case 'ArrowDown': {
|
|
54
|
+
return 'ArrowDown';
|
|
55
|
+
}
|
|
56
|
+
case 'Enter': {
|
|
57
|
+
return 'Enter';
|
|
58
|
+
}
|
|
59
|
+
case 'Backspace': {
|
|
60
|
+
return 'Backspace';
|
|
61
|
+
}
|
|
62
|
+
case 'Esc': // IE specific
|
|
63
|
+
case 'Escape': {
|
|
64
|
+
return 'Escape';
|
|
65
|
+
}
|
|
66
|
+
default: {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
resolveByKeyCode: function (keyCode) {
|
|
72
|
+
switch (keyCode) {
|
|
73
|
+
case 37: {
|
|
74
|
+
return 'ArrowLeft';
|
|
75
|
+
}
|
|
76
|
+
case 38: {
|
|
77
|
+
return 'ArrowUp';
|
|
78
|
+
}
|
|
79
|
+
case 39: {
|
|
80
|
+
return 'ArrowRight';
|
|
81
|
+
}
|
|
82
|
+
case 40: {
|
|
83
|
+
return 'ArrowDown';
|
|
84
|
+
}
|
|
85
|
+
case 13: {
|
|
86
|
+
return 'Enter';
|
|
87
|
+
}
|
|
88
|
+
case 8: {
|
|
89
|
+
return 'Backspace';
|
|
90
|
+
}
|
|
91
|
+
case 27: {
|
|
92
|
+
return 'Escape';
|
|
93
|
+
}
|
|
94
|
+
default: {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var keyEventHandlerMapping = {
|
|
101
|
+
ArrowUp: 'onArrowUp',
|
|
102
|
+
ArrowDown: 'onArrowDown',
|
|
103
|
+
ArrowLeft: 'onArrowLeft',
|
|
104
|
+
ArrowRight: 'onArrowRight',
|
|
105
|
+
Enter: 'onEnter',
|
|
106
|
+
Backspace: 'onBackspace',
|
|
107
|
+
Escape: 'onEscape'
|
|
108
|
+
};
|
|
109
|
+
var keyPropagatePropMapping = {
|
|
110
|
+
ArrowUp: 'propagateArrowUp',
|
|
111
|
+
ArrowDown: 'propagateArrowDown',
|
|
112
|
+
ArrowLeft: 'propagateArrowLeft',
|
|
113
|
+
ArrowRight: 'propagateArrowRight',
|
|
114
|
+
Enter: 'propagateEnter',
|
|
115
|
+
Backspace: 'propagateBackspace',
|
|
116
|
+
Escape: 'propagateEscape'
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Use this component to wrap anything you want to handle key events for (e.g. an input).
|
|
120
|
+
* You can specify the `eventName` to capture (defaults to `onKeyDown`).
|
|
121
|
+
* Check the SUPPORTED_KEYS map to see which keys are supported and supply the respective
|
|
122
|
+
* `on${Key}` prop (i.e. `onEnter` or `onArrowDown`).
|
|
123
|
+
* If you want the default behaviour to be preserved (i.e. only want to hook into the event
|
|
124
|
+
* instead of replacing it) set the `propagate${Key}` prop (e.g. propagateBackspace).
|
|
125
|
+
*/
|
|
126
|
+
function KeyCapturer(props) {
|
|
127
|
+
var _a;
|
|
128
|
+
var children = props.children, _b = props.eventName, eventName = _b === void 0 ? 'onKeyDown' : _b;
|
|
129
|
+
var composingRef = React__namespace.useRef(false);
|
|
130
|
+
var composingEventHandlers = props.onEnter
|
|
131
|
+
? {
|
|
132
|
+
onCompositionStart: function () {
|
|
133
|
+
composingRef.current = true;
|
|
134
|
+
},
|
|
135
|
+
onCompositionEnd: function () {
|
|
136
|
+
composingRef.current = false;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
: undefined;
|
|
140
|
+
function handleKeyEvent(event) {
|
|
141
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
|
|
142
|
+
var key = event.key !== undefined
|
|
143
|
+
? KeyCapturerResolver.resolveByKey(event.key)
|
|
144
|
+
: KeyCapturerResolver.resolveByKeyCode(event.keyCode);
|
|
145
|
+
if (!key)
|
|
146
|
+
return;
|
|
147
|
+
var propagateEvent = props[keyPropagatePropMapping[key]] || false;
|
|
148
|
+
var eventHandler = props[keyEventHandlerMapping[key]];
|
|
149
|
+
if (key === 'Enter' && eventHandler) {
|
|
150
|
+
if (composingRef.current ||
|
|
151
|
+
// Safari fires the onCompositionEnd event before the keydown event, so we
|
|
152
|
+
// have to rely on the 229 keycode, which is Enter when fired from an IME
|
|
153
|
+
// https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode
|
|
154
|
+
(event.keyCode || event.which) === 229) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (eventHandler) {
|
|
159
|
+
eventHandler(event);
|
|
160
|
+
if (!propagateEvent) {
|
|
161
|
+
event.preventDefault();
|
|
162
|
+
event.stopPropagation();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return React__namespace.cloneElement(children, tslib.__assign((_a = {}, _a[eventName] = handleKeyEvent, _a), composingEventHandlers));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
exports.KeyCapturer = KeyCapturer;
|
|
170
|
+
exports.KeyCapturerResolver = KeyCapturerResolver;
|
|
171
|
+
exports.SUPPORTED_KEYS = SUPPORTED_KEYS;
|
|
2
172
|
//# sourceMappingURL=key-capturer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-capturer.js","sources":["../../../src/components/key-capturer/key-capturer.tsx"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"key-capturer.js","sources":["../../../src/components/key-capturer/key-capturer.tsx"],"sourcesContent":[null],"names":["React","__assign"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAM,cAAc,GAAwB;AACxC,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,WAAW,EAAE,YAAY;AACzB,IAAA,UAAU,EAAE,WAAW;AACvB,IAAA,UAAU,EAAE,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,GAAG,KAAK,CAAA;aAC/B;AACJ,SAAA;UACD,SAAS,CAAA;IAEf,SAAS,cAAc,CAAC,KAA4C,EAAA;;AAEhE,QAAA,IAAM,GAAG,GACL,KAAK,CAAC,GAAG,KAAK,SAAS;cACjB,mBAAmB,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC;cAC3C,mBAAmB,CAAC,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;AAE7D,QAAA,IAAI,CAAC,GAAG;YAAE,OAAM;QAChB,IAAM,cAAc,GAAG,KAAK,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAA;QACnE,IAAM,YAAY,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAA;AAEvD,QAAA,IAAI,GAAG,KAAK,OAAO,IAAI,YAAY,EAAE;YACjC,IACI,YAAY,CAAC,OAAO;;;;gBAIpB,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,KAAK,MAAM,GAAG,EACxC;gBACE,OAAM;AACT,aAAA;AACJ,SAAA;AAED,QAAA,IAAI,YAAY,EAAE;YACd,YAAY,CAAC,KAAK,CAAC,CAAA;YACnB,IAAI,CAAC,cAAc,EAAE;gBACjB,KAAK,CAAC,cAAc,EAAE,CAAA;gBACtB,KAAK,CAAC,eAAe,EAAE,CAAA;AAC1B,aAAA;AACJ,SAAA;KACJ;AAED,IAAA,OAAOA,gBAAK,CAAC,YAAY,CAAC,QAAQ,EAAAC,cAAA,EAAA,EAAA,GAAA,EAAA,EAAA,EAAA,CAC7B,SAAS,CAAA,GAAG,cAAc,EAAA,EAAA,GACxB,sBAAsB,CAAA,CAC3B,CAAA;AACN;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { KeyboardShortcut } from './keyboard-shortcut';
|
|
2
|
-
export default KeyboardShortcut;
|
|
1
|
+
import { KeyboardShortcut } from './keyboard-shortcut';
|
|
2
|
+
export default KeyboardShortcut;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var keyboardShortcut = require('./keyboard-shortcut.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports["default"] = keyboardShortcut.KeyboardShortcut;
|
|
2
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
declare let globalTranslateKey: (key: string) => string;
|
|
3
|
-
type TranslateKey = typeof globalTranslateKey;
|
|
4
|
-
type NativeSpanProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
|
|
5
|
-
type Props = Omit<NativeSpanProps, 'children'> & {
|
|
6
|
-
/**
|
|
7
|
-
* The shortcut to be represented as markup. It supports an intuitive syntax where you can
|
|
8
|
-
* combine modifiers (cmd, ctrl, shift, alt) with single keys all concatenated with plus signs.
|
|
9
|
-
* You can also pass various shortcuts as an array, which will be depicted separated by commas.
|
|
10
|
-
*/
|
|
11
|
-
children: string | string[];
|
|
12
|
-
/**
|
|
13
|
-
* A function that allows you to change how some key names are represented. This may be useful,
|
|
14
|
-
* for instance, to translate modifier names that are expressed differently in other languages
|
|
15
|
-
* (e.g. `Ctrl` is named `Strg` in German).
|
|
16
|
-
*
|
|
17
|
-
* It defaults to a global version that leaves the key as is. You can pass your version as a
|
|
18
|
-
* prop, or you can also set your own version of this global default one, so you don't need to
|
|
19
|
-
* pass your own on each invocation of this component.
|
|
20
|
-
*
|
|
21
|
-
* ```js
|
|
22
|
-
* import { KeyboardShortcut } from '@doist/reactist'
|
|
23
|
-
* KeyboardShortcut.setTranslateKey = key => { ... }
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* Note: When the component detects the macOS operating system it bypasses key translation for
|
|
27
|
-
* most modifiers and uses macOS-specific symbols. See the `isMac` prop for details.
|
|
28
|
-
*/
|
|
29
|
-
translateKey?: TranslateKey;
|
|
30
|
-
/**
|
|
31
|
-
* This prop is not meant to be passed. The component will automatically initialize it to `true`
|
|
32
|
-
* if it detects that the current browser / operating system is on macOS, in which case modifier
|
|
33
|
-
* keys are represented using macOS' notation (e.g. ⌘ ⌃ ⌥ ⇧).
|
|
34
|
-
*
|
|
35
|
-
* Though it is discouraged, if you don't want this special treatment in macOS, you can pass
|
|
36
|
-
* `isMac={false}` in all invocations of this component.
|
|
37
|
-
*/
|
|
38
|
-
isMac?: boolean;
|
|
39
|
-
};
|
|
40
|
-
declare function KeyboardShortcut({ children, className, translateKey, isMac, ...props }: Props): React.JSX.Element;
|
|
41
|
-
declare namespace KeyboardShortcut {
|
|
42
|
-
var setTranslateKey: (tr: (key: string) => string) => void;
|
|
43
|
-
}
|
|
44
|
-
export { KeyboardShortcut };
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare let globalTranslateKey: (key: string) => string;
|
|
3
|
+
type TranslateKey = typeof globalTranslateKey;
|
|
4
|
+
type NativeSpanProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
|
|
5
|
+
type Props = Omit<NativeSpanProps, 'children'> & {
|
|
6
|
+
/**
|
|
7
|
+
* The shortcut to be represented as markup. It supports an intuitive syntax where you can
|
|
8
|
+
* combine modifiers (cmd, ctrl, shift, alt) with single keys all concatenated with plus signs.
|
|
9
|
+
* You can also pass various shortcuts as an array, which will be depicted separated by commas.
|
|
10
|
+
*/
|
|
11
|
+
children: string | string[];
|
|
12
|
+
/**
|
|
13
|
+
* A function that allows you to change how some key names are represented. This may be useful,
|
|
14
|
+
* for instance, to translate modifier names that are expressed differently in other languages
|
|
15
|
+
* (e.g. `Ctrl` is named `Strg` in German).
|
|
16
|
+
*
|
|
17
|
+
* It defaults to a global version that leaves the key as is. You can pass your version as a
|
|
18
|
+
* prop, or you can also set your own version of this global default one, so you don't need to
|
|
19
|
+
* pass your own on each invocation of this component.
|
|
20
|
+
*
|
|
21
|
+
* ```js
|
|
22
|
+
* import { KeyboardShortcut } from '@doist/reactist'
|
|
23
|
+
* KeyboardShortcut.setTranslateKey = key => { ... }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Note: When the component detects the macOS operating system it bypasses key translation for
|
|
27
|
+
* most modifiers and uses macOS-specific symbols. See the `isMac` prop for details.
|
|
28
|
+
*/
|
|
29
|
+
translateKey?: TranslateKey;
|
|
30
|
+
/**
|
|
31
|
+
* This prop is not meant to be passed. The component will automatically initialize it to `true`
|
|
32
|
+
* if it detects that the current browser / operating system is on macOS, in which case modifier
|
|
33
|
+
* keys are represented using macOS' notation (e.g. ⌘ ⌃ ⌥ ⇧).
|
|
34
|
+
*
|
|
35
|
+
* Though it is discouraged, if you don't want this special treatment in macOS, you can pass
|
|
36
|
+
* `isMac={false}` in all invocations of this component.
|
|
37
|
+
*/
|
|
38
|
+
isMac?: boolean;
|
|
39
|
+
};
|
|
40
|
+
declare function KeyboardShortcut({ children, className, translateKey, isMac, ...props }: Props): React.JSX.Element;
|
|
41
|
+
declare namespace KeyboardShortcut {
|
|
42
|
+
var setTranslateKey: (tr: (key: string) => string) => void;
|
|
43
|
+
}
|
|
44
|
+
export { KeyboardShortcut };
|
|
@@ -1,2 +1,98 @@
|
|
|
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
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
function _interopNamespace(e) {
|
|
12
|
+
if (e && e.__esModule) return e;
|
|
13
|
+
var n = Object.create(null);
|
|
14
|
+
if (e) {
|
|
15
|
+
Object.keys(e).forEach(function (k) {
|
|
16
|
+
if (k !== 'default') {
|
|
17
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return e[k]; }
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
n["default"] = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
|
+
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
31
|
+
|
|
32
|
+
//
|
|
33
|
+
// Support for setting up how to translate modifiers globally.
|
|
34
|
+
//
|
|
35
|
+
var globalTranslateKey = function (key) { return key; };
|
|
36
|
+
KeyboardShortcut.setTranslateKey = function (tr) {
|
|
37
|
+
globalTranslateKey = tr;
|
|
38
|
+
};
|
|
39
|
+
function translateKeyMac(key) {
|
|
40
|
+
switch (key.toLowerCase()) {
|
|
41
|
+
case 'cmd':
|
|
42
|
+
case 'mod':
|
|
43
|
+
return '⌘';
|
|
44
|
+
case 'control':
|
|
45
|
+
case 'ctrl':
|
|
46
|
+
return '⌃';
|
|
47
|
+
case 'alt':
|
|
48
|
+
return '⌥';
|
|
49
|
+
case 'shift':
|
|
50
|
+
return '⇧';
|
|
51
|
+
case 'space':
|
|
52
|
+
return '␣';
|
|
53
|
+
default:
|
|
54
|
+
return key;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//
|
|
58
|
+
// Some helpers
|
|
59
|
+
//
|
|
60
|
+
function capitalize(str) {
|
|
61
|
+
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
62
|
+
}
|
|
63
|
+
function hasModifiers(str) {
|
|
64
|
+
return /\b(mod|cmd|ctrl|control|alt|shift)\b/i.test(str);
|
|
65
|
+
}
|
|
66
|
+
function isSpecialKey(str) {
|
|
67
|
+
return /^(mod|cmd|ctrl|control|alt|shift|space|super)$/i.test(str);
|
|
68
|
+
}
|
|
69
|
+
function parseKeys(shortcut, isMac, translateKey) {
|
|
70
|
+
var t = isMac ? translateKeyMac : translateKey;
|
|
71
|
+
var _hasModifiers = hasModifiers(shortcut);
|
|
72
|
+
function mapIndividualKey(str) {
|
|
73
|
+
if (isSpecialKey(str)) {
|
|
74
|
+
return capitalize(t(str));
|
|
75
|
+
}
|
|
76
|
+
if (_hasModifiers && str.length === 1) {
|
|
77
|
+
return str.toUpperCase();
|
|
78
|
+
}
|
|
79
|
+
return str;
|
|
80
|
+
}
|
|
81
|
+
if (!isMac) {
|
|
82
|
+
shortcut = shortcut.replace(/\b(mod|cmd)\b/i, 'ctrl');
|
|
83
|
+
}
|
|
84
|
+
return shortcut.split(/\s*\+\s*/).map(mapIndividualKey);
|
|
85
|
+
}
|
|
86
|
+
function KeyboardShortcut(_a) {
|
|
87
|
+
var _b, _c;
|
|
88
|
+
var children = _a.children, className = _a.className, _d = _a.translateKey, translateKey = _d === void 0 ? globalTranslateKey : _d, _e = _a.isMac, isMac = _e === void 0 ? (_c = (_b = navigator.platform) === null || _b === void 0 ? void 0 : _b.toUpperCase().includes('MAC')) !== null && _c !== void 0 ? _c : false : _e, props = tslib.__rest(_a, ["children", "className", "translateKey", "isMac"]);
|
|
89
|
+
var shortcuts = typeof children === 'string' ? [children] : children;
|
|
90
|
+
return (React__namespace.createElement("span", tslib.__assign({ className: classNames__default["default"]('reactist_keyboard_shortcut', className, {
|
|
91
|
+
'reactist_keyboard_shortcut--macos': isMac
|
|
92
|
+
}) }, props), shortcuts.map(function (shortcut, i) { return (React__namespace.createElement(React__namespace.Fragment, { key: i },
|
|
93
|
+
i === 0 ? null : ', ',
|
|
94
|
+
React__namespace.createElement("kbd", null, parseKeys(shortcut, isMac, translateKey).map(function (key, j) { return (React__namespace.createElement("kbd", { key: j }, key)); })))); })));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
exports.KeyboardShortcut = KeyboardShortcut;
|
|
2
98
|
//# sourceMappingURL=keyboard-shortcut.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-shortcut.js","sources":["../../../src/components/keyboard-shortcut/keyboard-shortcut.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"keyboard-shortcut.js","sources":["../../../src/components/keyboard-shortcut/keyboard-shortcut.tsx"],"sourcesContent":[null],"names":["__rest","React","classNames"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;AAEA,IAAI,kBAAkB,GAAG,UAAC,GAAW,IAAK,OAAA,GAAG,CAAH,EAAG,CAAA;AAI7C,gBAAgB,CAAC,eAAe,GAAG,UAAC,EAAgB,EAAA;IAChD,kBAAkB,GAAG,EAAE,CAAA;AAC3B,CAAC,CAAA;AAED,SAAS,eAAe,CAAC,GAAW,EAAA;AAChC,IAAA,QAAQ,GAAG,CAAC,WAAW,EAAE;AACrB,QAAA,KAAK,KAAK,CAAC;AACX,QAAA,KAAK,KAAK;AACN,YAAA,OAAO,GAAG,CAAA;AACd,QAAA,KAAK,SAAS,CAAC;AACf,QAAA,KAAK,MAAM;AACP,YAAA,OAAO,GAAG,CAAA;AACd,QAAA,KAAK,KAAK;AACN,YAAA,OAAO,GAAG,CAAA;AACd,QAAA,KAAK,OAAO;AACR,YAAA,OAAO,GAAG,CAAA;AACd,QAAA,KAAK,OAAO;AACR,YAAA,OAAO,GAAG,CAAA;AACd,QAAA;AACI,YAAA,OAAO,GAAG,CAAA;AACjB,KAAA;AACL,CAAC;AAED;AACA;AACA;AAEA,SAAS,UAAU,CAAC,GAAW,EAAA;AAC3B,IAAA,OAAO,GAAG,CAAC,MAAM,CAAC,CA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
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ProgressBar } from './progress-bar';
|
|
2
|
-
export default ProgressBar;
|
|
1
|
+
import { ProgressBar } from './progress-bar';
|
|
2
|
+
export default ProgressBar;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var progressBar = require('./progress-bar.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports["default"] = progressBar.ProgressBar;
|
|
2
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
type Props = {
|
|
3
|
-
/** Additional css class applied to the progress bar. */
|
|
4
|
-
className?: string;
|
|
5
|
-
/** How much of the progress bar should be filled. Number between 0 and 100 inclusive. */
|
|
6
|
-
fillPercentage?: number;
|
|
7
|
-
/** Defines the human readable text alternative for assitive technologies. */
|
|
8
|
-
'aria-valuetext'?: string;
|
|
9
|
-
};
|
|
10
|
-
declare function ProgressBar({ fillPercentage, className, 'aria-valuetext': ariaValuetext }: Props): React.JSX.Element;
|
|
11
|
-
declare namespace ProgressBar {
|
|
12
|
-
var displayName: string;
|
|
13
|
-
}
|
|
14
|
-
export { ProgressBar };
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** Additional css class applied to the progress bar. */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** How much of the progress bar should be filled. Number between 0 and 100 inclusive. */
|
|
6
|
+
fillPercentage?: number;
|
|
7
|
+
/** Defines the human readable text alternative for assitive technologies. */
|
|
8
|
+
'aria-valuetext'?: string;
|
|
9
|
+
};
|
|
10
|
+
declare function ProgressBar({ fillPercentage, className, 'aria-valuetext': ariaValuetext }: Props): React.JSX.Element;
|
|
11
|
+
declare namespace ProgressBar {
|
|
12
|
+
var displayName: string;
|
|
13
|
+
}
|
|
14
|
+
export { ProgressBar };
|