@doist/reactist 28.7.2 → 28.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/reactist.cjs.development.js +2091 -3811
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/avatar/avatar.js +35 -30
- package/es/avatar/avatar.js.map +1 -1
- package/es/avatar/utils.js +19 -22
- package/es/avatar/utils.js.map +1 -1
- package/es/badge/badge.js +5 -16
- package/es/badge/badge.js.map +1 -1
- package/es/banner/banner.js +39 -115
- package/es/banner/banner.js.map +1 -1
- package/es/banner/banner.module.css.js +1 -1
- package/es/base-field/base-field.js +80 -162
- package/es/base-field/base-field.js.map +1 -1
- package/es/base-field/base-field.module.css.js +1 -1
- package/es/box/box.js +61 -137
- package/es/box/box.js.map +1 -1
- package/es/button/button.js +42 -95
- package/es/button/button.js.map +1 -1
- package/es/checkbox-field/checkbox-field.js +46 -73
- package/es/checkbox-field/checkbox-field.js.map +1 -1
- package/es/checkbox-field/checkbox-field.module.css.js +1 -1
- package/es/checkbox-field/checkbox-icon.js +28 -55
- package/es/checkbox-field/checkbox-icon.js.map +1 -1
- package/es/checkbox-field/use-fork-ref.js +29 -25
- package/es/checkbox-field/use-fork-ref.js.map +1 -1
- package/es/columns/columns.js +22 -46
- package/es/columns/columns.js.map +1 -1
- package/es/columns/columns.module.css.js +1 -1
- package/es/components/color-picker/color-picker.js +45 -66
- package/es/components/color-picker/color-picker.js.map +1 -1
- package/es/components/deprecated-button/deprecated-button.js +11 -34
- package/es/components/deprecated-button/deprecated-button.js.map +1 -1
- package/es/components/deprecated-dropdown/dropdown.js +136 -197
- package/es/components/deprecated-dropdown/dropdown.js.map +1 -1
- package/es/components/deprecated-input/input.js +6 -10
- package/es/components/deprecated-input/input.js.map +1 -1
- package/es/components/deprecated-select/select.js +7 -31
- package/es/components/deprecated-select/select.js.map +1 -1
- package/es/components/key-capturer/key-capturer.js +130 -171
- package/es/components/key-capturer/key-capturer.js.map +1 -1
- package/es/components/keyboard-shortcut/keyboard-shortcut.js +48 -79
- package/es/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/es/components/progress-bar/progress-bar.js +8 -20
- package/es/components/progress-bar/progress-bar.js.map +1 -1
- package/es/components/time/time-utils.js +52 -64
- package/es/components/time/time-utils.js.map +1 -1
- package/es/components/time/time.js +90 -114
- package/es/components/time/time.js.map +1 -1
- package/es/divider/divider.js +4 -13
- package/es/divider/divider.js.map +1 -1
- package/es/heading/heading.js +19 -28
- package/es/heading/heading.js.map +1 -1
- package/es/hidden/hidden.js +36 -45
- package/es/hidden/hidden.js.map +1 -1
- package/es/hidden-visually/hidden-visually.js +7 -13
- package/es/hidden-visually/hidden-visually.js.map +1 -1
- package/es/icons/alert-icon.js +18 -64
- package/es/icons/alert-icon.js.map +1 -1
- package/es/icons/banner-icon.js +25 -97
- package/es/icons/banner-icon.js.map +1 -1
- package/es/icons/close-icon.js +3 -9
- package/es/icons/close-icon.js.map +1 -1
- package/es/icons/password-hidden-icon.js +6 -23
- package/es/icons/password-hidden-icon.js.map +1 -1
- package/es/icons/password-visible-icon.js +5 -16
- package/es/icons/password-visible-icon.js.map +1 -1
- package/es/inline/inline.js +8 -23
- package/es/inline/inline.js.map +1 -1
- package/es/loading/loading.js +17 -28
- package/es/loading/loading.js.map +1 -1
- package/es/menu/menu.js +127 -260
- package/es/menu/menu.js.map +1 -1
- package/es/modal/modal.js +143 -272
- package/es/modal/modal.js.map +1 -1
- package/es/modal/modal.module.css.js +1 -1
- package/es/notice/notice.js +8 -21
- package/es/notice/notice.js.map +1 -1
- package/es/notice/notice.module.css.js +1 -1
- package/es/password-field/password-field.js +10 -24
- package/es/password-field/password-field.js.map +1 -1
- package/es/prose/prose.js +10 -15
- package/es/prose/prose.js.map +1 -1
- package/es/select-field/select-field.js +14 -51
- package/es/select-field/select-field.js.map +1 -1
- package/es/spinner/spinner.js +6 -20
- package/es/spinner/spinner.js.map +1 -1
- package/es/stack/stack.js +15 -27
- package/es/stack/stack.js.map +1 -1
- package/es/switch-field/switch-field.js +38 -73
- package/es/switch-field/switch-field.js.map +1 -1
- package/es/switch-field/switch-field.module.css.js +1 -1
- package/es/tabs/tabs.js +120 -207
- package/es/tabs/tabs.js.map +1 -1
- package/es/text/text.js +16 -25
- package/es/text/text.js.map +1 -1
- package/es/text-area/text-area.js +54 -111
- package/es/text-area/text-area.js.map +1 -1
- package/es/text-field/text-field.js +30 -84
- package/es/text-field/text-field.js.map +1 -1
- package/es/text-link/text-link.js +9 -20
- package/es/text-link/text-link.js.map +1 -1
- package/es/text-link/text-link.module.css.js +1 -1
- package/es/toast/static-toast.js +35 -70
- package/es/toast/static-toast.js.map +1 -1
- package/es/toast/toast-animation.js +121 -159
- package/es/toast/toast-animation.js.map +1 -1
- package/es/toast/use-toasts.js +134 -197
- package/es/toast/use-toasts.js.map +1 -1
- package/es/tooltip/tooltip.js +31 -69
- package/es/tooltip/tooltip.js.map +1 -1
- package/es/utils/common-helpers.js +9 -13
- package/es/utils/common-helpers.js.map +1 -1
- package/es/utils/polymorphism.js +7 -8
- package/es/utils/polymorphism.js.map +1 -1
- package/es/utils/responsive-props.js +57 -66
- package/es/utils/responsive-props.js.map +1 -1
- package/lib/avatar/avatar.d.ts +21 -21
- package/lib/avatar/avatar.js +69 -1
- package/lib/avatar/avatar.js.map +1 -1
- package/lib/avatar/avatar.module.css.js +7 -1
- package/lib/avatar/avatar.module.css.js.map +1 -1
- package/lib/avatar/index.d.ts +1 -1
- package/lib/avatar/utils.d.ts +3 -3
- package/lib/avatar/utils.js +30 -1
- package/lib/avatar/utils.js.map +1 -1
- package/lib/badge/badge.d.ts +15 -15
- package/lib/badge/badge.js +36 -1
- package/lib/badge/badge.js.map +1 -1
- package/lib/badge/badge.module.css.js +7 -1
- package/lib/badge/badge.module.css.js.map +1 -1
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +87 -87
- package/lib/banner/banner.js +79 -1
- package/lib/banner/banner.js.map +1 -1
- package/lib/banner/banner.module.css.js +7 -1
- package/lib/banner/banner.module.css.js.map +1 -1
- package/lib/banner/index.d.ts +2 -2
- package/lib/banner/story-promo-image.d.ts +4 -4
- package/lib/base-field/base-field.d.ts +139 -139
- package/lib/base-field/base-field.js +127 -1
- package/lib/base-field/base-field.js.map +1 -1
- package/lib/base-field/base-field.module.css.js +7 -1
- package/lib/base-field/base-field.module.css.js.map +1 -1
- package/lib/base-field/index.d.ts +1 -1
- package/lib/box/box.d.ts +73 -73
- package/lib/box/box.js +103 -1
- package/lib/box/box.js.map +1 -1
- package/lib/box/box.module.css.js +7 -1
- package/lib/box/box.module.css.js.map +1 -1
- package/lib/box/gap.module.css.js +7 -1
- package/lib/box/gap.module.css.js.map +1 -1
- package/lib/box/index.d.ts +1 -1
- package/lib/box/margin.module.css.js +7 -1
- package/lib/box/margin.module.css.js.map +1 -1
- package/lib/box/padding.module.css.js +7 -1
- package/lib/box/padding.module.css.js.map +1 -1
- package/lib/box/width.module.css.js +7 -1
- package/lib/box/width.module.css.js.map +1 -1
- package/lib/button/button.d.ts +127 -127
- package/lib/button/button.js +86 -1
- package/lib/button/button.js.map +1 -1
- package/lib/button/button.module.css.js +7 -1
- package/lib/button/button.module.css.js.map +1 -1
- package/lib/button/index.d.ts +1 -1
- package/lib/checkbox-field/checkbox-field.d.ts +40 -40
- package/lib/checkbox-field/checkbox-field.js +82 -1
- package/lib/checkbox-field/checkbox-field.js.map +1 -1
- package/lib/checkbox-field/checkbox-field.module.css.js +7 -1
- package/lib/checkbox-field/checkbox-field.module.css.js.map +1 -1
- package/lib/checkbox-field/checkbox-icon.d.ts +8 -8
- package/lib/checkbox-field/checkbox-icon.js +59 -1
- package/lib/checkbox-field/checkbox-icon.js.map +1 -1
- package/lib/checkbox-field/index.d.ts +1 -1
- package/lib/checkbox-field/use-fork-ref.d.ts +11 -11
- package/lib/checkbox-field/use-fork-ref.js +42 -1
- package/lib/checkbox-field/use-fork-ref.js.map +1 -1
- package/lib/columns/columns.d.ts +20 -20
- package/lib/columns/columns.js +57 -1
- package/lib/columns/columns.js.map +1 -1
- package/lib/columns/columns.module.css.js +7 -1
- package/lib/columns/columns.module.css.js.map +1 -1
- package/lib/columns/index.d.ts +1 -1
- package/lib/components/color-picker/color-picker.d.ts +29 -29
- package/lib/components/color-picker/color-picker.js +86 -1
- package/lib/components/color-picker/color-picker.js.map +1 -1
- package/lib/components/color-picker/index.d.ts +3 -3
- package/lib/components/color-picker/index.js +11 -1
- package/lib/components/color-picker/index.js.map +1 -1
- package/lib/components/deprecated-button/deprecated-button.d.ts +54 -54
- package/lib/components/deprecated-button/deprecated-button.js +49 -1
- package/lib/components/deprecated-button/deprecated-button.js.map +1 -1
- package/lib/components/deprecated-button/index.d.ts +4 -4
- package/lib/components/deprecated-button/index.js +9 -1
- package/lib/components/deprecated-button/index.js.map +1 -1
- package/lib/components/deprecated-dropdown/dropdown.d.ts +55 -55
- package/lib/components/deprecated-dropdown/dropdown.js +182 -1
- package/lib/components/deprecated-dropdown/dropdown.js.map +1 -1
- package/lib/components/deprecated-dropdown/index.d.ts +2 -2
- package/lib/components/deprecated-dropdown/index.js +9 -1
- package/lib/components/deprecated-dropdown/index.js.map +1 -1
- package/lib/components/deprecated-input/index.d.ts +2 -2
- package/lib/components/deprecated-input/index.js +9 -1
- package/lib/components/deprecated-input/index.js.map +1 -1
- package/lib/components/deprecated-input/input.d.ts +10 -10
- package/lib/components/deprecated-input/input.js +41 -1
- package/lib/components/deprecated-input/input.js.map +1 -1
- package/lib/components/deprecated-select/index.d.ts +2 -2
- package/lib/components/deprecated-select/index.js +9 -1
- package/lib/components/deprecated-select/index.js.map +1 -1
- package/lib/components/deprecated-select/select.d.ts +33 -33
- package/lib/components/deprecated-select/select.js +43 -1
- package/lib/components/deprecated-select/select.js.map +1 -1
- package/lib/components/icons/CloseIcon.svg.d.ts +3 -3
- package/lib/components/icons/ThinQuestionMarkIcon.svg.d.ts +3 -3
- package/lib/components/icons/ThreeDotsIcon.svg.d.ts +12 -12
- package/lib/components/key-capturer/index.d.ts +3 -3
- package/lib/components/key-capturer/index.js +11 -1
- package/lib/components/key-capturer/index.js.map +1 -1
- package/lib/components/key-capturer/key-capturer.d.ts +40 -40
- package/lib/components/key-capturer/key-capturer.js +171 -1
- package/lib/components/key-capturer/key-capturer.js.map +1 -1
- package/lib/components/keyboard-shortcut/index.d.ts +2 -2
- package/lib/components/keyboard-shortcut/index.js +9 -1
- package/lib/components/keyboard-shortcut/index.js.map +1 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.d.ts +44 -44
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js +97 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/lib/components/progress-bar/index.d.ts +2 -2
- package/lib/components/progress-bar/index.js +9 -1
- package/lib/components/progress-bar/index.js.map +1 -1
- package/lib/components/progress-bar/progress-bar.d.ts +14 -14
- package/lib/components/progress-bar/progress-bar.js +44 -1
- package/lib/components/progress-bar/progress-bar.js.map +1 -1
- package/lib/components/progress-bar/progress-bar.module.css.js +7 -1
- package/lib/components/progress-bar/progress-bar.module.css.js.map +1 -1
- package/lib/components/time/index.d.ts +2 -2
- package/lib/components/time/index.js +9 -1
- package/lib/components/time/index.js.map +1 -1
- package/lib/components/time/time-utils.d.ts +19 -19
- package/lib/components/time/time-utils.js +69 -1
- package/lib/components/time/time-utils.js.map +1 -1
- package/lib/components/time/time.d.ts +39 -39
- package/lib/components/time/time.js +124 -1
- package/lib/components/time/time.js.map +1 -1
- package/lib/divider/divider.d.ts +8 -8
- package/lib/divider/divider.js +36 -1
- package/lib/divider/divider.js.map +1 -1
- package/lib/divider/divider.module.css.js +7 -1
- package/lib/divider/divider.module.css.js.map +1 -1
- package/lib/divider/index.d.ts +1 -1
- package/lib/heading/heading.d.ts +112 -112
- package/lib/heading/heading.js +51 -1
- package/lib/heading/heading.js.map +1 -1
- package/lib/heading/heading.module.css.js +7 -1
- package/lib/heading/heading.module.css.js.map +1 -1
- package/lib/heading/index.d.ts +1 -1
- package/lib/hidden/hidden.d.ts +49 -49
- package/lib/hidden/hidden.js +70 -1
- package/lib/hidden/hidden.js.map +1 -1
- package/lib/hidden/hidden.module.css.js +7 -1
- package/lib/hidden/hidden.module.css.js.map +1 -1
- package/lib/hidden/index.d.ts +1 -1
- package/lib/hidden-visually/hidden-visually.d.ts +11 -11
- package/lib/hidden-visually/hidden-visually.js +40 -1
- package/lib/hidden-visually/hidden-visually.js.map +1 -1
- package/lib/hidden-visually/hidden-visually.module.css.js +7 -1
- package/lib/hidden-visually/hidden-visually.module.css.js.map +1 -1
- package/lib/hidden-visually/index.d.ts +1 -1
- package/lib/hooks/use-previous/index.d.ts +1 -1
- package/lib/hooks/use-previous/use-previous.d.ts +15 -15
- package/lib/icons/alert-icon.d.ts +6 -6
- package/lib/icons/alert-icon.js +56 -1
- package/lib/icons/alert-icon.js.map +1 -1
- package/lib/icons/banner-icon.d.ts +6 -6
- package/lib/icons/banner-icon.js +68 -1
- package/lib/icons/banner-icon.js.map +1 -1
- package/lib/icons/banner-icon.module.css.js +7 -1
- package/lib/icons/banner-icon.module.css.js.map +1 -1
- package/lib/icons/close-icon.d.ts +3 -3
- package/lib/icons/close-icon.js +33 -1
- package/lib/icons/close-icon.js.map +1 -1
- package/lib/icons/password-hidden-icon.d.ts +3 -3
- package/lib/icons/password-hidden-icon.js +36 -1
- package/lib/icons/password-hidden-icon.js.map +1 -1
- package/lib/icons/password-visible-icon.d.ts +3 -3
- package/lib/icons/password-visible-icon.js +35 -1
- package/lib/icons/password-visible-icon.js.map +1 -1
- package/lib/index.d.ts +38 -38
- package/lib/index.js +106 -1
- package/lib/index.js.map +1 -1
- package/lib/inline/index.d.ts +1 -1
- package/lib/inline/inline.d.ts +12 -12
- package/lib/inline/inline.js +40 -1
- package/lib/inline/inline.js.map +1 -1
- package/lib/loading/index.d.ts +1 -1
- package/lib/loading/loading.d.ts +26 -26
- package/lib/loading/loading.js +49 -1
- package/lib/loading/loading.js.map +1 -1
- package/lib/menu/index.d.ts +2 -2
- package/lib/menu/menu.d.ts +128 -128
- package/lib/menu/menu.js +179 -1
- package/lib/menu/menu.js.map +1 -1
- package/lib/modal/index.d.ts +1 -1
- package/lib/modal/modal-stories-components.d.ts +47 -47
- package/lib/modal/modal.d.ts +185 -185
- package/lib/modal/modal.js +209 -1
- package/lib/modal/modal.js.map +1 -1
- package/lib/modal/modal.module.css.js +7 -1
- package/lib/modal/modal.module.css.js.map +1 -1
- package/lib/notice/index.d.ts +1 -1
- package/lib/notice/notice.d.ts +10 -10
- package/lib/notice/notice.js +42 -1
- package/lib/notice/notice.js.map +1 -1
- package/lib/notice/notice.module.css.js +7 -1
- package/lib/notice/notice.module.css.js.map +1 -1
- package/lib/password-field/index.d.ts +1 -1
- package/lib/password-field/password-field.d.ts +10 -10
- package/lib/password-field/password-field.js +43 -1
- package/lib/password-field/password-field.js.map +1 -1
- package/lib/prose/index.d.ts +2 -2
- package/lib/prose/prose-example.d.ts +1 -1
- package/lib/prose/prose.d.ts +44 -44
- package/lib/prose/prose.js +42 -1
- package/lib/prose/prose.js.map +1 -1
- package/lib/prose/prose.module.css.js +7 -1
- package/lib/prose/prose.module.css.js.map +1 -1
- package/lib/select-field/index.d.ts +1 -1
- package/lib/select-field/select-field.d.ts +7 -7
- package/lib/select-field/select-field.js +48 -1
- package/lib/select-field/select-field.js.map +1 -1
- package/lib/select-field/select-field.module.css.js +7 -1
- package/lib/select-field/select-field.module.css.js.map +1 -1
- package/lib/spinner/index.d.ts +1 -1
- package/lib/spinner/spinner.d.ts +5 -5
- package/lib/spinner/spinner.js +36 -1
- package/lib/spinner/spinner.js.map +1 -1
- package/lib/spinner/spinner.module.css.js +7 -1
- package/lib/spinner/spinner.module.css.js.map +1 -1
- package/lib/stack/index.d.ts +1 -1
- package/lib/stack/stack.d.ts +15 -15
- package/lib/stack/stack.js +52 -1
- package/lib/stack/stack.js.map +1 -1
- package/lib/switch-field/index.d.ts +1 -1
- package/lib/switch-field/switch-field.d.ts +19 -19
- package/lib/switch-field/switch-field.js +74 -1
- package/lib/switch-field/switch-field.js.map +1 -1
- package/lib/switch-field/switch-field.module.css.js +7 -1
- package/lib/switch-field/switch-field.module.css.js.map +1 -1
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/tabs.d.ts +125 -125
- package/lib/tabs/tabs.js +177 -1
- package/lib/tabs/tabs.js.map +1 -1
- package/lib/tabs/tabs.module.css.js +7 -1
- package/lib/tabs/tabs.module.css.js.map +1 -1
- package/lib/text/index.d.ts +1 -1
- package/lib/text/text.d.ts +47 -47
- package/lib/text/text.js +49 -1
- package/lib/text/text.js.map +1 -1
- package/lib/text/text.module.css.js +7 -1
- package/lib/text/text.module.css.js.map +1 -1
- package/lib/text-area/index.d.ts +1 -1
- package/lib/text-area/text-area.d.ts +39 -39
- package/lib/text-area/text-area.js +92 -1
- package/lib/text-area/text-area.js.map +1 -1
- package/lib/text-area/text-area.module.css.js +7 -1
- package/lib/text-area/text-area.module.css.js.map +1 -1
- package/lib/text-field/index.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +18 -18
- package/lib/text-field/text-field.js +63 -1
- package/lib/text-field/text-field.js.map +1 -1
- package/lib/text-field/text-field.module.css.js +7 -1
- package/lib/text-field/text-field.module.css.js.map +1 -1
- package/lib/text-link/index.d.ts +1 -1
- package/lib/text-link/text-link.d.ts +9 -9
- package/lib/text-link/text-link.js +41 -1
- package/lib/text-link/text-link.js.map +1 -1
- package/lib/text-link/text-link.module.css.js +7 -1
- package/lib/text-link/text-link.module.css.js.map +1 -1
- package/lib/toast/index.d.ts +4 -4
- package/lib/toast/static-toast.d.ts +63 -63
- package/lib/toast/static-toast.js +59 -1
- package/lib/toast/static-toast.js.map +1 -1
- package/lib/toast/toast-animation.d.ts +50 -50
- package/lib/toast/toast-animation.js +141 -1
- package/lib/toast/toast-animation.js.map +1 -1
- package/lib/toast/toast.module.css.js +7 -1
- package/lib/toast/toast.module.css.js.map +1 -1
- package/lib/toast/use-toasts.d.ts +132 -132
- package/lib/toast/use-toasts.js +166 -1
- package/lib/toast/use-toasts.js.map +1 -1
- package/lib/tooltip/index.d.ts +2 -2
- package/lib/tooltip/tooltip.d.ts +72 -72
- package/lib/tooltip/tooltip.js +67 -1
- package/lib/tooltip/tooltip.js.map +1 -1
- package/lib/tooltip/tooltip.module.css.js +7 -1
- package/lib/tooltip/tooltip.module.css.js.map +1 -1
- package/lib/utils/common-helpers.d.ts +2 -2
- package/lib/utils/common-helpers.js +44 -1
- package/lib/utils/common-helpers.js.map +1 -1
- package/lib/utils/common-types.d.ts +42 -42
- package/lib/utils/polymorphism.d.ts +135 -135
- package/lib/utils/polymorphism.js +39 -1
- package/lib/utils/polymorphism.js.map +1 -1
- package/lib/utils/responsive-props.d.ts +44 -44
- package/lib/utils/responsive-props.js +70 -1
- package/lib/utils/responsive-props.js.map +1 -1
- package/lib/utils/storybook-helper.d.ts +55 -0
- package/lib/utils/test-helpers.d.ts +22 -22
- package/package.json +14 -18
- package/styles/avatar.css +2 -2
- package/styles/avatar.module.css.css +1 -1
- package/styles/badge.css +2 -2
- package/styles/badge.module.css.css +1 -1
- package/styles/banner.css +6 -6
- package/styles/banner.module.css.css +1 -1
- package/styles/base-field.css +4 -4
- package/styles/base-field.module.css.css +1 -1
- package/styles/box.css +1 -1
- package/styles/box.module.css.css +1 -1
- package/styles/button.css +4 -4
- package/styles/button.module.css.css +1 -1
- package/styles/checkbox-field.css +3 -3
- package/styles/checkbox-field.module.css.css +1 -1
- package/styles/columns.css +1 -1
- package/styles/divider.css +1 -1
- package/styles/heading.css +2 -2
- package/styles/heading.module.css.css +1 -1
- package/styles/hidden-visually.css +2 -2
- package/styles/hidden-visually.module.css.css +1 -1
- package/styles/hidden.css +1 -1
- package/styles/index.css +4 -4
- package/styles/loading.css +2 -2
- package/styles/menu.css +1 -1
- package/styles/modal.css +5 -5
- package/styles/modal.module.css.css +1 -1
- package/styles/notice.css +1 -1
- package/styles/password-field.css +7 -7
- package/styles/progress-bar.module.css.css +1 -1
- package/styles/prose.css +2 -2
- package/styles/prose.module.css.css +1 -1
- package/styles/reactist.css +30 -30
- package/styles/select-field.css +5 -5
- package/styles/select-field.module.css.css +1 -1
- package/styles/spinner.css +1 -1
- package/styles/static-toast.css +6 -6
- package/styles/switch-field.css +6 -6
- package/styles/switch-field.module.css.css +1 -1
- package/styles/tabs.css +2 -2
- package/styles/tabs.module.css.css +1 -1
- package/styles/text-area.css +5 -5
- package/styles/text-area.module.css.css +1 -1
- package/styles/text-field.css +5 -5
- package/styles/text-field.module.css.css +1 -1
- package/styles/text-link.css +2 -2
- package/styles/text-link.module.css.css +1 -1
- package/styles/text.css +2 -2
- package/styles/text.module.css.css +1 -1
- package/styles/toast.module.css.css +1 -1
- package/styles/tooltip.css +2 -2
- package/styles/tooltip.module.css.css +1 -1
- package/styles/use-toasts.css +6 -6
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -91
- package/es/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
- package/lib/_virtual/_rollupPluginBabelHelpers.js +0 -2
- package/lib/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
|
@@ -1,2 +1,60 @@
|
|
|
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 closeIcon = require('../icons/close-icon.js');
|
|
8
|
+
var box = require('../box/box.js');
|
|
9
|
+
var button = require('../button/button.js');
|
|
10
|
+
var stack = require('../stack/stack.js');
|
|
11
|
+
var text = require('../text/text.js');
|
|
12
|
+
var toast_module = require('./toast.module.css.js');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A toast that shows a message, and an optional action associated with it.
|
|
20
|
+
*
|
|
21
|
+
* This component is generally not meant to be used directly. Most of the time you'll want to use
|
|
22
|
+
* toasts generated via `useToasts` instead. However, this component is available in case you need
|
|
23
|
+
* to take control of rendering a toast under different circumstances than that of notification-like
|
|
24
|
+
* floating toasts.
|
|
25
|
+
*
|
|
26
|
+
* This component makes no assumptions outwardly about how it is positioned on the screen. That is,
|
|
27
|
+
* it will not be shown floating or fixed to the viewport edges, as toasts normally show up. It only
|
|
28
|
+
* provides the toast look and feel, but you are responsible for positioning it as you want.
|
|
29
|
+
*
|
|
30
|
+
* @see useToasts
|
|
31
|
+
*/
|
|
32
|
+
var StaticToast = React__default["default"].forwardRef(function Toast(_a, ref) {
|
|
33
|
+
var message = _a.message, description = _a.description, icon = _a.icon, action = _a.action, onDismiss = _a.onDismiss, _b = _a.dismissLabel, dismissLabel = _b === void 0 ? 'Close' : _b, props = tslib.__rest(_a, ["message", "description", "icon", "action", "onDismiss", "dismissLabel"]);
|
|
34
|
+
return (React__default["default"].createElement(box.Box, tslib.__assign({ ref: ref, role: "alert", "aria-live": "polite", borderRadius: "full", width: "fitContent", background: "toast", display: "flex", padding: "large", alignItems: "center", className: toast_module["default"].toastContainer }, props),
|
|
35
|
+
icon ? React__default["default"].createElement(ToastContentSlot, null, icon) : null,
|
|
36
|
+
React__default["default"].createElement(box.Box, { flexGrow: 1, maxWidth: "small" }, description ? (React__default["default"].createElement(stack.Stack, { space: "small" },
|
|
37
|
+
React__default["default"].createElement(text.Text, { weight: "bold" },
|
|
38
|
+
message,
|
|
39
|
+
" "),
|
|
40
|
+
React__default["default"].createElement(text.Text, null, description))) : (React__default["default"].createElement(text.Text, null, message))),
|
|
41
|
+
action ? (React__default["default"].createElement(ToastContentSlot, null, isActionObject(action) ? (React__default["default"].createElement(button.Button, { variant: "tertiary", size: "small", onClick: action.onClick }, action.label)) : (action))) : null,
|
|
42
|
+
onDismiss ? (React__default["default"].createElement(ToastContentSlot, null,
|
|
43
|
+
React__default["default"].createElement(button.IconButton, { variant: "quaternary", size: "small", onClick: onDismiss, "aria-label": dismissLabel, icon: React__default["default"].createElement(closeIcon.CloseIcon, null) }))) : null));
|
|
44
|
+
});
|
|
45
|
+
function isActionObject(action) {
|
|
46
|
+
return (action != null &&
|
|
47
|
+
typeof action === 'object' &&
|
|
48
|
+
'label' in action &&
|
|
49
|
+
'onClick' in action &&
|
|
50
|
+
typeof action.label === 'string' &&
|
|
51
|
+
typeof action.onClick === 'function');
|
|
52
|
+
}
|
|
53
|
+
function ToastContentSlot(_a) {
|
|
54
|
+
var children = _a.children;
|
|
55
|
+
return (React__default["default"].createElement(box.Box, { display: "flex", alignItems: "center", justifyContent: "center", marginX: "-xsmall", marginY: "-medium", className: toast_module["default"].slot }, children));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
exports.StaticToast = StaticToast;
|
|
59
|
+
exports.isActionObject = isActionObject;
|
|
2
60
|
//# sourceMappingURL=static-toast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-toast.js","sources":["../../src/toast/static-toast.tsx"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"static-toast.js","sources":["../../src/toast/static-toast.tsx"],"sourcesContent":[null],"names":["React","__rest","Box","__assign","styles","Stack","Text","Button","IconButton","CloseIcon"],"mappings":";;;;;;;;;;;;;;;;;AA6DA;;;;;;;;;;;;;AAaG;AACG,IAAA,WAAW,GAAGA,yBAAK,CAAC,UAAU,CAAmC,SAAS,KAAK,CACjF,EAAmF,EACnF,GAAG,EAAA;IADD,IAAA,OAAO,GAAA,EAAA,CAAA,OAAA,EAAE,WAAW,GAAA,EAAA,CAAA,WAAA,EAAE,IAAI,GAAA,EAAA,CAAA,IAAA,EAAE,MAAM,GAAA,EAAA,CAAA,MAAA,EAAE,SAAS,GAAA,EAAA,CAAA,SA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AC,UAAU,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,MAAM,CAAC,OAAO,EAC1D,EAAA,MAAM,CAAC,KAAK,CACR,KAET,MAAM,CACT,CACc,IACnB,IAAI;AAEP,QAAA,SAAS,IACNP,wCAAC,gBAAgB,EAAA,IAAA;AACb,YAAAA,yBAAA,CAAA,aAAA,CAACQ,iBAAU,EAAA,EACP,OAAO,EAAC,YAAY,EACpB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,SAAS,EACN,YAAA,EAAA,YAAY,EACxB,IAAI,EAAER,yBAAA,CAAA,aAAA,CAACS,mBAAS,EAAA,IAAA,CAAG,EACrB,CAAA,CACa,IACnB,IAAI,CACN,EACT;AACL,CAAC,EAAC;AAEF,SAAS,cAAc,CAAC,MAAkC,EAAA;IACtD,QACI,MAAM,IAAI,IAAI;QACd,OAAO,MAAM,KAAK,QAAQ;AAC1B,QAAA,OAAO,IAAI,MAAM;AACjB,QAAA,SAAS,IAAI,MAAM;AACnB,QAAA,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ;AAChC,QAAA,OAAO,MAAM,CAAC,OAAO,KAAK,UAAU,EACvC;AACL,CAAC;AAED,SAAS,gBAAgB,CAAC,EAA2C,EAAA;AAAzC,IAAA,IAAA,QAAQ,GAAA,EAAA,CAAA,QAAA,CAAA;AAChC,IAAA,QACIT,yBAAA,CAAA,aAAA,CAACE,OAAG,EAAA,EACA,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,cAAc,EAAC,QAAQ,EACvB,OAAO,EAAC,SAAS,EACjB,OAAO,EAAC,SAAS,EACjB,SAAS,EAAEE,uBAAM,CAAC,IAAI,EAAA,EAErB,QAAQ,CACP,EACT;AACL;;;;;"}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted with minor changes from https://github.com/seek-oss/braid-design-system/blob/7a5ebccb/packages/braid-design-system/lib/components/useToast/useFlipList.ts
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2018 SEEK
|
|
7
|
-
*
|
|
8
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
* in the Software without restriction, including without limitation the rights
|
|
11
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
* furnished to do so, subject to the following conditions:
|
|
14
|
-
*
|
|
15
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
-
* copies or substantial portions of the Software.
|
|
17
|
-
*
|
|
18
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
-
* SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
declare const ANIMATION_TIMEOUT = 400;
|
|
27
|
-
type ToastsAnimationToolkit = {
|
|
28
|
-
/**
|
|
29
|
-
* Used for gathering all the active stacked toast elements. Should be used by passing
|
|
30
|
-
* `ref={mappedRef(toastId)}` to the stacked toasts.
|
|
31
|
-
*/
|
|
32
|
-
mappedRef: (toastId: string) => (ref: HTMLElement | null) => void;
|
|
33
|
-
/**
|
|
34
|
-
* The stacked toasts view should use this callback when it needs to remove a toast, instead of
|
|
35
|
-
* removing it right away. The actual removal from the state (and consequently, from the DOM)
|
|
36
|
-
* should happen in the `onAnimationDone` instead.
|
|
37
|
-
*/
|
|
38
|
-
animateRemove: (toastId: string, onAnimationDone: () => void) => void;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Provides the functionality of animating the stacked toasts when they appear and before they
|
|
42
|
-
* disappear.
|
|
43
|
-
*
|
|
44
|
-
* It works by keeping a mapping from toast IDs to the toast elements, and keeping a mapping from
|
|
45
|
-
* toast IDs to their top position. Then, on every single re-render, it compares the new DOM
|
|
46
|
-
* situation with the previously stored one in these mappings. With this information, it applies
|
|
47
|
-
* animations that smoothly transitions between both states.
|
|
48
|
-
*/
|
|
49
|
-
declare function useToastsAnimation(): ToastsAnimationToolkit;
|
|
50
|
-
export { ANIMATION_TIMEOUT, useToastsAnimation };
|
|
1
|
+
/**
|
|
2
|
+
* Adapted with minor changes from https://github.com/seek-oss/braid-design-system/blob/7a5ebccb/packages/braid-design-system/lib/components/useToast/useFlipList.ts
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2018 SEEK
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
26
|
+
declare const ANIMATION_TIMEOUT = 400;
|
|
27
|
+
type ToastsAnimationToolkit = {
|
|
28
|
+
/**
|
|
29
|
+
* Used for gathering all the active stacked toast elements. Should be used by passing
|
|
30
|
+
* `ref={mappedRef(toastId)}` to the stacked toasts.
|
|
31
|
+
*/
|
|
32
|
+
mappedRef: (toastId: string) => (ref: HTMLElement | null) => void;
|
|
33
|
+
/**
|
|
34
|
+
* The stacked toasts view should use this callback when it needs to remove a toast, instead of
|
|
35
|
+
* removing it right away. The actual removal from the state (and consequently, from the DOM)
|
|
36
|
+
* should happen in the `onAnimationDone` instead.
|
|
37
|
+
*/
|
|
38
|
+
animateRemove: (toastId: string, onAnimationDone: () => void) => void;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Provides the functionality of animating the stacked toasts when they appear and before they
|
|
42
|
+
* disappear.
|
|
43
|
+
*
|
|
44
|
+
* It works by keeping a mapping from toast IDs to the toast elements, and keeping a mapping from
|
|
45
|
+
* toast IDs to their top position. Then, on every single re-render, it compares the new DOM
|
|
46
|
+
* situation with the previously stored one in these mappings. With this information, it applies
|
|
47
|
+
* animations that smoothly transitions between both states.
|
|
48
|
+
*/
|
|
49
|
+
declare function useToastsAnimation(): ToastsAnimationToolkit;
|
|
50
|
+
export { ANIMATION_TIMEOUT, useToastsAnimation };
|
|
@@ -1,2 +1,142 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Adapted with minor changes from https://github.com/seek-oss/braid-design-system/blob/7a5ebccb/packages/braid-design-system/lib/components/useToast/useFlipList.ts
|
|
9
|
+
*
|
|
10
|
+
* MIT License
|
|
11
|
+
*
|
|
12
|
+
* Copyright (c) 2018 SEEK
|
|
13
|
+
*
|
|
14
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
* in the Software without restriction, including without limitation the rights
|
|
17
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
* furnished to do so, subject to the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
* copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
+
* SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
var ANIMATION_TIMEOUT = 400;
|
|
33
|
+
var ENTRANCE_TRANSITION = 'transform 0.3s ease, opacity 0.3s ease';
|
|
34
|
+
var EXIT_TRANSITION = 'opacity 0.2s ease';
|
|
35
|
+
/**
|
|
36
|
+
* Applies the "from" value of given CSS properties, and also sets a transition CSS property. Then
|
|
37
|
+
* it waits an animation frame before setting the same CSS properties to the target "to" value. This
|
|
38
|
+
* triggers the browser to perform the CSS transition on them.
|
|
39
|
+
*
|
|
40
|
+
* At the end of the animation, it cleans up, unsetting all the CSS properties (including the
|
|
41
|
+
* transition), and calls the "done" callback, if given.
|
|
42
|
+
*/
|
|
43
|
+
function animate(_a) {
|
|
44
|
+
var element = _a.element, transforms = _a.transforms, transition = _a.transition, done = _a.done;
|
|
45
|
+
var fallbackTimeout = setTimeout(function () {
|
|
46
|
+
done === null || done === void 0 ? void 0 : done();
|
|
47
|
+
}, ANIMATION_TIMEOUT);
|
|
48
|
+
transforms.forEach(function (_a) {
|
|
49
|
+
var property = _a.property, _b = _a.from, from = _b === void 0 ? '' : _b;
|
|
50
|
+
element.style.setProperty(property, from);
|
|
51
|
+
});
|
|
52
|
+
element.style.setProperty('transition', '');
|
|
53
|
+
function transitionEndHandler(event) {
|
|
54
|
+
if (event.target !== element) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
element.style.setProperty('transition', '');
|
|
58
|
+
done === null || done === void 0 ? void 0 : done();
|
|
59
|
+
element.removeEventListener('transitionend', transitionEndHandler);
|
|
60
|
+
clearTimeout(fallbackTimeout);
|
|
61
|
+
}
|
|
62
|
+
element.addEventListener('transitionend', transitionEndHandler);
|
|
63
|
+
// Call requestAnimationFrame twice to make sure we have a full animation frame at our disposal
|
|
64
|
+
window.requestAnimationFrame(function () {
|
|
65
|
+
window.requestAnimationFrame(function () {
|
|
66
|
+
element.style.setProperty('transition', transition);
|
|
67
|
+
transforms.forEach(function (_a) {
|
|
68
|
+
var property = _a.property, _b = _a.to, to = _b === void 0 ? '' : _b;
|
|
69
|
+
element.style.setProperty(property, to);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Provides the functionality of animating the stacked toasts when they appear and before they
|
|
76
|
+
* disappear.
|
|
77
|
+
*
|
|
78
|
+
* It works by keeping a mapping from toast IDs to the toast elements, and keeping a mapping from
|
|
79
|
+
* toast IDs to their top position. Then, on every single re-render, it compares the new DOM
|
|
80
|
+
* situation with the previously stored one in these mappings. With this information, it applies
|
|
81
|
+
* animations that smoothly transitions between both states.
|
|
82
|
+
*/
|
|
83
|
+
function useToastsAnimation() {
|
|
84
|
+
var refs = React.useMemo(function () { return new Map(); }, []);
|
|
85
|
+
var positions = React.useMemo(function () { return new Map(); }, []);
|
|
86
|
+
React.useLayoutEffect(function () {
|
|
87
|
+
var animations = [];
|
|
88
|
+
Array.from(refs.entries()).forEach(function (_a) {
|
|
89
|
+
var id = _a[0], element = _a[1];
|
|
90
|
+
if (!element) {
|
|
91
|
+
refs["delete"](id);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
var prevTop = positions.get(id);
|
|
95
|
+
var _b = element.getBoundingClientRect(), top = _b.top, height = _b.height;
|
|
96
|
+
if (typeof prevTop === 'number' && prevTop !== top) {
|
|
97
|
+
// Move animation
|
|
98
|
+
animations.push({
|
|
99
|
+
element: element,
|
|
100
|
+
transition: ENTRANCE_TRANSITION,
|
|
101
|
+
transforms: [{ property: 'transform', from: "translateY(".concat(prevTop - top, "px)") }]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
else if (typeof prevTop !== 'number') {
|
|
105
|
+
// Enter animation
|
|
106
|
+
animations.push({
|
|
107
|
+
element: element,
|
|
108
|
+
transition: ENTRANCE_TRANSITION,
|
|
109
|
+
transforms: [
|
|
110
|
+
{ property: 'transform', from: "translateY(".concat(height, "px)") },
|
|
111
|
+
{ property: 'opacity', from: '0' },
|
|
112
|
+
]
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
positions.set(id, element.getBoundingClientRect().top);
|
|
116
|
+
});
|
|
117
|
+
animations.forEach(function (_a) {
|
|
118
|
+
var element = _a.element, transforms = _a.transforms, transition = _a.transition;
|
|
119
|
+
animate({ element: element, transforms: transforms, transition: transition });
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
var animateRemove = React.useCallback(function animateRemove(id, onAnimationDone) {
|
|
123
|
+
var element = refs.get(id);
|
|
124
|
+
if (element) {
|
|
125
|
+
// Removal animation
|
|
126
|
+
animate({
|
|
127
|
+
element: element,
|
|
128
|
+
transforms: [{ property: 'opacity', to: '0' }],
|
|
129
|
+
transition: EXIT_TRANSITION,
|
|
130
|
+
done: onAnimationDone
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}, [refs]);
|
|
134
|
+
var mappedRef = React.useCallback(function (id) { return function (ref) {
|
|
135
|
+
refs.set(id, ref);
|
|
136
|
+
}; }, [refs]);
|
|
137
|
+
return { mappedRef: mappedRef, animateRemove: animateRemove };
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
exports.ANIMATION_TIMEOUT = ANIMATION_TIMEOUT;
|
|
141
|
+
exports.useToastsAnimation = useToastsAnimation;
|
|
2
142
|
//# sourceMappingURL=toast-animation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-animation.js","sources":["../../src/toast/toast-animation.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"toast-animation.js","sources":["../../src/toast/toast-animation.ts"],"sourcesContent":[null],"names":["useMemo","useLayoutEffect","useCallback"],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AAIG,IAAA,iBAAiB,GAAG,IAAG;AAC7B,IAAM,mBAAmB,GAAG,wCAAwC,CAAA;AACpE,IAAM,eAAe,GAAG,mBAAmB,CAAA;AAQ3C;;;;;;;AAOG;AACH,SAAS,OAAO,CAAC,EAUhB,EAAA;QATG,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,IAAI,GAAA,EAAA,CAAA,IAAA,CA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E,CAAC,CAAA;AAC5B,QAAA,IAAI,OAAO,EAAE;;AAET,YAAA,OAAO,CAAC;AACJ,gBAAA,OAAO,EAAA,OAAA;gBACP,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC;AAC9C,gBAAA,UAAU,EAAE,eAAe;AAC3B,gBAAA,IAAI,EAAE,eAAe;AACxB,aAAA,CAAC,CAAA;AACL,SAAA;AACL,KAAC,EACD,CAAC,IAAI,CAAC,CACT,CAAA;IAED,IAAM,SAAS,GAAGA,iBAAW,CACzB,UAAC,EAAU,EAAA,EAAK,OAAA,UAAC,GAAuB,EAAA;AACpC,QAAA,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;AACrB,KAAC,GAAA,EACD,CAAC,IAAI,CAAC,CACT,CAAA;AAED,IAAA,OAAO,EAAE,SAAS,EAAA,SAAA,EAAE,aAAa,EAAA,aAAA,EAAE,CAAA;AACvC;;;;;"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var modules_d11e18f0 = {"stackedToastsView":"_616cc3f3","toastContainer":"_1b5f8e86","slot":"ce2e3476"};
|
|
6
|
+
|
|
7
|
+
exports["default"] = modules_d11e18f0;
|
|
2
8
|
//# sourceMappingURL=toast.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"toast.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|