@doist/reactist 28.7.0 → 28.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/reactist.cjs.development.js +2093 -3829
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/avatar/avatar.js +35 -30
- package/es/avatar/avatar.js.map +1 -1
- package/es/avatar/utils.js +19 -22
- package/es/avatar/utils.js.map +1 -1
- package/es/badge/badge.js +5 -16
- package/es/badge/badge.js.map +1 -1
- package/es/banner/banner.js +39 -115
- package/es/banner/banner.js.map +1 -1
- package/es/banner/banner.module.css.js +1 -1
- package/es/base-field/base-field.js +80 -162
- package/es/base-field/base-field.js.map +1 -1
- package/es/base-field/base-field.module.css.js +1 -1
- package/es/box/box.js +61 -139
- package/es/box/box.js.map +1 -1
- package/es/button/button.js +42 -95
- package/es/button/button.js.map +1 -1
- package/es/checkbox-field/checkbox-field.js +46 -75
- package/es/checkbox-field/checkbox-field.js.map +1 -1
- package/es/checkbox-field/checkbox-field.module.css.js +1 -1
- package/es/checkbox-field/checkbox-icon.js +28 -55
- package/es/checkbox-field/checkbox-icon.js.map +1 -1
- package/es/checkbox-field/use-fork-ref.js +29 -25
- package/es/checkbox-field/use-fork-ref.js.map +1 -1
- package/es/columns/columns.js +22 -46
- package/es/columns/columns.js.map +1 -1
- package/es/columns/columns.module.css.js +1 -1
- package/es/components/color-picker/color-picker.js +45 -66
- package/es/components/color-picker/color-picker.js.map +1 -1
- package/es/components/deprecated-button/deprecated-button.js +11 -34
- package/es/components/deprecated-button/deprecated-button.js.map +1 -1
- package/es/components/deprecated-dropdown/dropdown.js +136 -197
- package/es/components/deprecated-dropdown/dropdown.js.map +1 -1
- package/es/components/deprecated-input/input.js +6 -10
- package/es/components/deprecated-input/input.js.map +1 -1
- package/es/components/deprecated-select/select.js +7 -31
- package/es/components/deprecated-select/select.js.map +1 -1
- package/es/components/key-capturer/key-capturer.js +130 -171
- package/es/components/key-capturer/key-capturer.js.map +1 -1
- package/es/components/keyboard-shortcut/keyboard-shortcut.js +48 -79
- package/es/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/es/components/progress-bar/progress-bar.js +8 -20
- package/es/components/progress-bar/progress-bar.js.map +1 -1
- package/es/components/time/time-utils.js +52 -64
- package/es/components/time/time-utils.js.map +1 -1
- package/es/components/time/time.js +90 -114
- package/es/components/time/time.js.map +1 -1
- package/es/divider/divider.js +4 -13
- package/es/divider/divider.js.map +1 -1
- package/es/heading/heading.js +19 -28
- package/es/heading/heading.js.map +1 -1
- package/es/hidden/hidden.js +36 -45
- package/es/hidden/hidden.js.map +1 -1
- package/es/hidden-visually/hidden-visually.js +7 -13
- package/es/hidden-visually/hidden-visually.js.map +1 -1
- package/es/icons/alert-icon.js +18 -64
- package/es/icons/alert-icon.js.map +1 -1
- package/es/icons/banner-icon.js +25 -97
- package/es/icons/banner-icon.js.map +1 -1
- package/es/icons/close-icon.js +3 -9
- package/es/icons/close-icon.js.map +1 -1
- package/es/icons/password-hidden-icon.js +6 -23
- package/es/icons/password-hidden-icon.js.map +1 -1
- package/es/icons/password-visible-icon.js +5 -16
- package/es/icons/password-visible-icon.js.map +1 -1
- package/es/inline/inline.js +8 -23
- package/es/inline/inline.js.map +1 -1
- package/es/loading/loading.js +17 -30
- package/es/loading/loading.js.map +1 -1
- package/es/menu/menu.js +127 -260
- package/es/menu/menu.js.map +1 -1
- package/es/modal/modal.js +143 -272
- package/es/modal/modal.js.map +1 -1
- package/es/modal/modal.module.css.js +1 -1
- package/es/notice/notice.js +8 -21
- package/es/notice/notice.js.map +1 -1
- package/es/notice/notice.module.css.js +1 -1
- package/es/password-field/password-field.js +10 -24
- package/es/password-field/password-field.js.map +1 -1
- package/es/prose/prose.js +10 -15
- package/es/prose/prose.js.map +1 -1
- package/es/select-field/select-field.js +14 -51
- package/es/select-field/select-field.js.map +1 -1
- package/es/spinner/spinner.js +6 -20
- package/es/spinner/spinner.js.map +1 -1
- package/es/stack/stack.js +15 -27
- package/es/stack/stack.js.map +1 -1
- package/es/switch-field/switch-field.js +38 -75
- package/es/switch-field/switch-field.js.map +1 -1
- package/es/switch-field/switch-field.module.css.js +1 -1
- package/es/tabs/tabs.js +120 -211
- package/es/tabs/tabs.js.map +1 -1
- package/es/text/text.js +16 -25
- package/es/text/text.js.map +1 -1
- package/es/text-area/text-area.js +54 -111
- package/es/text-area/text-area.js.map +1 -1
- package/es/text-field/text-field.js +30 -84
- package/es/text-field/text-field.js.map +1 -1
- package/es/text-link/text-link.js +9 -20
- package/es/text-link/text-link.js.map +1 -1
- package/es/text-link/text-link.module.css.js +1 -1
- package/es/toast/static-toast.js +35 -70
- package/es/toast/static-toast.js.map +1 -1
- package/es/toast/toast-animation.js +121 -159
- package/es/toast/toast-animation.js.map +1 -1
- package/es/toast/use-toasts.js +134 -201
- package/es/toast/use-toasts.js.map +1 -1
- package/es/tooltip/tooltip.js +31 -69
- package/es/tooltip/tooltip.js.map +1 -1
- package/es/utils/common-helpers.js +9 -13
- package/es/utils/common-helpers.js.map +1 -1
- package/es/utils/polymorphism.js +7 -8
- package/es/utils/polymorphism.js.map +1 -1
- package/es/utils/responsive-props.js +57 -66
- package/es/utils/responsive-props.js.map +1 -1
- package/lib/avatar/avatar.d.ts +21 -21
- package/lib/avatar/avatar.js +69 -1
- package/lib/avatar/avatar.js.map +1 -1
- package/lib/avatar/avatar.module.css.js +7 -1
- package/lib/avatar/avatar.module.css.js.map +1 -1
- package/lib/avatar/index.d.ts +1 -1
- package/lib/avatar/utils.d.ts +3 -3
- package/lib/avatar/utils.js +30 -1
- package/lib/avatar/utils.js.map +1 -1
- package/lib/badge/badge.d.ts +15 -15
- package/lib/badge/badge.js +36 -1
- package/lib/badge/badge.js.map +1 -1
- package/lib/badge/badge.module.css.js +7 -1
- package/lib/badge/badge.module.css.js.map +1 -1
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +87 -87
- package/lib/banner/banner.js +79 -1
- package/lib/banner/banner.js.map +1 -1
- package/lib/banner/banner.module.css.js +7 -1
- package/lib/banner/banner.module.css.js.map +1 -1
- package/lib/banner/index.d.ts +2 -2
- package/lib/banner/story-promo-image.d.ts +4 -4
- package/lib/base-field/base-field.d.ts +139 -139
- package/lib/base-field/base-field.js +127 -1
- package/lib/base-field/base-field.js.map +1 -1
- package/lib/base-field/base-field.module.css.js +7 -1
- package/lib/base-field/base-field.module.css.js.map +1 -1
- package/lib/base-field/index.d.ts +1 -1
- package/lib/box/box.d.ts +73 -73
- package/lib/box/box.js +103 -1
- package/lib/box/box.js.map +1 -1
- package/lib/box/box.module.css.js +7 -1
- package/lib/box/box.module.css.js.map +1 -1
- package/lib/box/gap.module.css.js +7 -1
- package/lib/box/gap.module.css.js.map +1 -1
- package/lib/box/index.d.ts +1 -1
- package/lib/box/margin.module.css.js +7 -1
- package/lib/box/margin.module.css.js.map +1 -1
- package/lib/box/padding.module.css.js +7 -1
- package/lib/box/padding.module.css.js.map +1 -1
- package/lib/box/width.module.css.js +7 -1
- package/lib/box/width.module.css.js.map +1 -1
- package/lib/button/button.d.ts +127 -127
- package/lib/button/button.js +86 -1
- package/lib/button/button.js.map +1 -1
- package/lib/button/button.module.css.js +7 -1
- package/lib/button/button.module.css.js.map +1 -1
- package/lib/button/index.d.ts +1 -1
- package/lib/checkbox-field/checkbox-field.d.ts +40 -40
- package/lib/checkbox-field/checkbox-field.js +82 -1
- package/lib/checkbox-field/checkbox-field.js.map +1 -1
- package/lib/checkbox-field/checkbox-field.module.css.js +7 -1
- package/lib/checkbox-field/checkbox-field.module.css.js.map +1 -1
- package/lib/checkbox-field/checkbox-icon.d.ts +8 -8
- package/lib/checkbox-field/checkbox-icon.js +59 -1
- package/lib/checkbox-field/checkbox-icon.js.map +1 -1
- package/lib/checkbox-field/index.d.ts +1 -1
- package/lib/checkbox-field/use-fork-ref.d.ts +11 -11
- package/lib/checkbox-field/use-fork-ref.js +42 -1
- package/lib/checkbox-field/use-fork-ref.js.map +1 -1
- package/lib/columns/columns.d.ts +20 -20
- package/lib/columns/columns.js +57 -1
- package/lib/columns/columns.js.map +1 -1
- package/lib/columns/columns.module.css.js +7 -1
- package/lib/columns/columns.module.css.js.map +1 -1
- package/lib/columns/index.d.ts +1 -1
- package/lib/components/color-picker/color-picker.d.ts +29 -29
- package/lib/components/color-picker/color-picker.js +86 -1
- package/lib/components/color-picker/color-picker.js.map +1 -1
- package/lib/components/color-picker/index.d.ts +3 -3
- package/lib/components/color-picker/index.js +11 -1
- package/lib/components/color-picker/index.js.map +1 -1
- package/lib/components/deprecated-button/deprecated-button.d.ts +54 -54
- package/lib/components/deprecated-button/deprecated-button.js +49 -1
- package/lib/components/deprecated-button/deprecated-button.js.map +1 -1
- package/lib/components/deprecated-button/index.d.ts +4 -4
- package/lib/components/deprecated-button/index.js +9 -1
- package/lib/components/deprecated-button/index.js.map +1 -1
- package/lib/components/deprecated-dropdown/dropdown.d.ts +55 -55
- package/lib/components/deprecated-dropdown/dropdown.js +182 -1
- package/lib/components/deprecated-dropdown/dropdown.js.map +1 -1
- package/lib/components/deprecated-dropdown/index.d.ts +2 -2
- package/lib/components/deprecated-dropdown/index.js +9 -1
- package/lib/components/deprecated-dropdown/index.js.map +1 -1
- package/lib/components/deprecated-input/index.d.ts +2 -2
- package/lib/components/deprecated-input/index.js +9 -1
- package/lib/components/deprecated-input/index.js.map +1 -1
- package/lib/components/deprecated-input/input.d.ts +10 -10
- package/lib/components/deprecated-input/input.js +41 -1
- package/lib/components/deprecated-input/input.js.map +1 -1
- package/lib/components/deprecated-select/index.d.ts +2 -2
- package/lib/components/deprecated-select/index.js +9 -1
- package/lib/components/deprecated-select/index.js.map +1 -1
- package/lib/components/deprecated-select/select.d.ts +33 -33
- package/lib/components/deprecated-select/select.js +43 -1
- package/lib/components/deprecated-select/select.js.map +1 -1
- package/lib/components/icons/CloseIcon.svg.d.ts +3 -3
- package/lib/components/icons/ThinQuestionMarkIcon.svg.d.ts +3 -3
- package/lib/components/icons/ThreeDotsIcon.svg.d.ts +12 -12
- package/lib/components/key-capturer/index.d.ts +3 -3
- package/lib/components/key-capturer/index.js +11 -1
- package/lib/components/key-capturer/index.js.map +1 -1
- package/lib/components/key-capturer/key-capturer.d.ts +40 -40
- package/lib/components/key-capturer/key-capturer.js +171 -1
- package/lib/components/key-capturer/key-capturer.js.map +1 -1
- package/lib/components/keyboard-shortcut/index.d.ts +2 -2
- package/lib/components/keyboard-shortcut/index.js +9 -1
- package/lib/components/keyboard-shortcut/index.js.map +1 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.d.ts +44 -44
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js +97 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/lib/components/progress-bar/index.d.ts +2 -2
- package/lib/components/progress-bar/index.js +9 -1
- package/lib/components/progress-bar/index.js.map +1 -1
- package/lib/components/progress-bar/progress-bar.d.ts +14 -14
- package/lib/components/progress-bar/progress-bar.js +44 -1
- package/lib/components/progress-bar/progress-bar.js.map +1 -1
- package/lib/components/progress-bar/progress-bar.module.css.js +7 -1
- package/lib/components/progress-bar/progress-bar.module.css.js.map +1 -1
- package/lib/components/time/index.d.ts +2 -2
- package/lib/components/time/index.js +9 -1
- package/lib/components/time/index.js.map +1 -1
- package/lib/components/time/time-utils.d.ts +19 -19
- package/lib/components/time/time-utils.js +69 -1
- package/lib/components/time/time-utils.js.map +1 -1
- package/lib/components/time/time.d.ts +39 -39
- package/lib/components/time/time.js +124 -1
- package/lib/components/time/time.js.map +1 -1
- package/lib/divider/divider.d.ts +8 -8
- package/lib/divider/divider.js +36 -1
- package/lib/divider/divider.js.map +1 -1
- package/lib/divider/divider.module.css.js +7 -1
- package/lib/divider/divider.module.css.js.map +1 -1
- package/lib/divider/index.d.ts +1 -1
- package/lib/heading/heading.d.ts +112 -112
- package/lib/heading/heading.js +51 -1
- package/lib/heading/heading.js.map +1 -1
- package/lib/heading/heading.module.css.js +7 -1
- package/lib/heading/heading.module.css.js.map +1 -1
- package/lib/heading/index.d.ts +1 -1
- package/lib/hidden/hidden.d.ts +49 -49
- package/lib/hidden/hidden.js +70 -1
- package/lib/hidden/hidden.js.map +1 -1
- package/lib/hidden/hidden.module.css.js +7 -1
- package/lib/hidden/hidden.module.css.js.map +1 -1
- package/lib/hidden/index.d.ts +1 -1
- package/lib/hidden-visually/hidden-visually.d.ts +11 -11
- package/lib/hidden-visually/hidden-visually.js +40 -1
- package/lib/hidden-visually/hidden-visually.js.map +1 -1
- package/lib/hidden-visually/hidden-visually.module.css.js +7 -1
- package/lib/hidden-visually/hidden-visually.module.css.js.map +1 -1
- package/lib/hidden-visually/index.d.ts +1 -1
- package/lib/hooks/use-previous/index.d.ts +1 -1
- package/lib/hooks/use-previous/use-previous.d.ts +15 -15
- package/lib/icons/alert-icon.d.ts +6 -6
- package/lib/icons/alert-icon.js +56 -1
- package/lib/icons/alert-icon.js.map +1 -1
- package/lib/icons/banner-icon.d.ts +6 -6
- package/lib/icons/banner-icon.js +68 -1
- package/lib/icons/banner-icon.js.map +1 -1
- package/lib/icons/banner-icon.module.css.js +7 -1
- package/lib/icons/banner-icon.module.css.js.map +1 -1
- package/lib/icons/close-icon.d.ts +3 -3
- package/lib/icons/close-icon.js +33 -1
- package/lib/icons/close-icon.js.map +1 -1
- package/lib/icons/password-hidden-icon.d.ts +3 -3
- package/lib/icons/password-hidden-icon.js +36 -1
- package/lib/icons/password-hidden-icon.js.map +1 -1
- package/lib/icons/password-visible-icon.d.ts +3 -3
- package/lib/icons/password-visible-icon.js +35 -1
- package/lib/icons/password-visible-icon.js.map +1 -1
- package/lib/index.d.ts +38 -38
- package/lib/index.js +106 -1
- package/lib/index.js.map +1 -1
- package/lib/inline/index.d.ts +1 -1
- package/lib/inline/inline.d.ts +12 -12
- package/lib/inline/inline.js +40 -1
- package/lib/inline/inline.js.map +1 -1
- package/lib/loading/index.d.ts +1 -1
- package/lib/loading/loading.d.ts +26 -26
- package/lib/loading/loading.js +49 -1
- package/lib/loading/loading.js.map +1 -1
- package/lib/menu/index.d.ts +2 -2
- package/lib/menu/menu.d.ts +128 -128
- package/lib/menu/menu.js +179 -1
- package/lib/menu/menu.js.map +1 -1
- package/lib/modal/index.d.ts +1 -1
- package/lib/modal/modal-stories-components.d.ts +47 -47
- package/lib/modal/modal.d.ts +185 -185
- package/lib/modal/modal.js +209 -1
- package/lib/modal/modal.js.map +1 -1
- package/lib/modal/modal.module.css.js +7 -1
- package/lib/modal/modal.module.css.js.map +1 -1
- package/lib/notice/index.d.ts +1 -1
- package/lib/notice/notice.d.ts +10 -10
- package/lib/notice/notice.js +42 -1
- package/lib/notice/notice.js.map +1 -1
- package/lib/notice/notice.module.css.js +7 -1
- package/lib/notice/notice.module.css.js.map +1 -1
- package/lib/password-field/index.d.ts +1 -1
- package/lib/password-field/password-field.d.ts +10 -10
- package/lib/password-field/password-field.js +43 -1
- package/lib/password-field/password-field.js.map +1 -1
- package/lib/prose/index.d.ts +2 -2
- package/lib/prose/prose-example.d.ts +1 -1
- package/lib/prose/prose.d.ts +44 -44
- package/lib/prose/prose.js +42 -1
- package/lib/prose/prose.js.map +1 -1
- package/lib/prose/prose.module.css.js +7 -1
- package/lib/prose/prose.module.css.js.map +1 -1
- package/lib/select-field/index.d.ts +1 -1
- package/lib/select-field/select-field.d.ts +7 -7
- package/lib/select-field/select-field.js +48 -1
- package/lib/select-field/select-field.js.map +1 -1
- package/lib/select-field/select-field.module.css.js +7 -1
- package/lib/select-field/select-field.module.css.js.map +1 -1
- package/lib/spinner/index.d.ts +1 -1
- package/lib/spinner/spinner.d.ts +5 -5
- package/lib/spinner/spinner.js +36 -1
- package/lib/spinner/spinner.js.map +1 -1
- package/lib/spinner/spinner.module.css.js +7 -1
- package/lib/spinner/spinner.module.css.js.map +1 -1
- package/lib/stack/index.d.ts +1 -1
- package/lib/stack/stack.d.ts +15 -15
- package/lib/stack/stack.js +52 -1
- package/lib/stack/stack.js.map +1 -1
- package/lib/switch-field/index.d.ts +1 -1
- package/lib/switch-field/switch-field.d.ts +19 -19
- package/lib/switch-field/switch-field.js +74 -1
- package/lib/switch-field/switch-field.js.map +1 -1
- package/lib/switch-field/switch-field.module.css.js +7 -1
- package/lib/switch-field/switch-field.module.css.js.map +1 -1
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/tabs.d.ts +125 -125
- package/lib/tabs/tabs.js +177 -1
- package/lib/tabs/tabs.js.map +1 -1
- package/lib/tabs/tabs.module.css.js +7 -1
- package/lib/tabs/tabs.module.css.js.map +1 -1
- package/lib/text/index.d.ts +1 -1
- package/lib/text/text.d.ts +47 -47
- package/lib/text/text.js +49 -1
- package/lib/text/text.js.map +1 -1
- package/lib/text/text.module.css.js +7 -1
- package/lib/text/text.module.css.js.map +1 -1
- package/lib/text-area/index.d.ts +1 -1
- package/lib/text-area/text-area.d.ts +39 -39
- package/lib/text-area/text-area.js +92 -1
- package/lib/text-area/text-area.js.map +1 -1
- package/lib/text-area/text-area.module.css.js +7 -1
- package/lib/text-area/text-area.module.css.js.map +1 -1
- package/lib/text-field/index.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +18 -18
- package/lib/text-field/text-field.js +63 -1
- package/lib/text-field/text-field.js.map +1 -1
- package/lib/text-field/text-field.module.css.js +7 -1
- package/lib/text-field/text-field.module.css.js.map +1 -1
- package/lib/text-link/index.d.ts +1 -1
- package/lib/text-link/text-link.d.ts +9 -9
- package/lib/text-link/text-link.js +41 -1
- package/lib/text-link/text-link.js.map +1 -1
- package/lib/text-link/text-link.module.css.js +7 -1
- package/lib/text-link/text-link.module.css.js.map +1 -1
- package/lib/toast/index.d.ts +4 -4
- package/lib/toast/static-toast.d.ts +63 -63
- package/lib/toast/static-toast.js +59 -1
- package/lib/toast/static-toast.js.map +1 -1
- package/lib/toast/toast-animation.d.ts +50 -50
- package/lib/toast/toast-animation.js +141 -1
- package/lib/toast/toast-animation.js.map +1 -1
- package/lib/toast/toast.module.css.js +7 -1
- package/lib/toast/toast.module.css.js.map +1 -1
- package/lib/toast/use-toasts.d.ts +132 -132
- package/lib/toast/use-toasts.js +166 -1
- package/lib/toast/use-toasts.js.map +1 -1
- package/lib/tooltip/index.d.ts +2 -2
- package/lib/tooltip/tooltip.d.ts +72 -72
- package/lib/tooltip/tooltip.js +67 -1
- package/lib/tooltip/tooltip.js.map +1 -1
- package/lib/tooltip/tooltip.module.css.js +7 -1
- package/lib/tooltip/tooltip.module.css.js.map +1 -1
- package/lib/utils/common-helpers.d.ts +2 -2
- package/lib/utils/common-helpers.js +44 -1
- package/lib/utils/common-helpers.js.map +1 -1
- package/lib/utils/common-types.d.ts +42 -42
- package/lib/utils/polymorphism.d.ts +135 -135
- package/lib/utils/polymorphism.js +39 -1
- package/lib/utils/polymorphism.js.map +1 -1
- package/lib/utils/responsive-props.d.ts +44 -44
- package/lib/utils/responsive-props.js +70 -1
- package/lib/utils/responsive-props.js.map +1 -1
- package/lib/utils/storybook-helper.d.ts +55 -0
- package/lib/utils/test-helpers.d.ts +22 -22
- package/package.json +16 -23
- package/styles/avatar.css +3 -3
- package/styles/avatar.module.css.css +1 -1
- package/styles/badge.css +3 -3
- package/styles/badge.module.css.css +1 -1
- package/styles/banner.css +7 -7
- package/styles/banner.module.css.css +1 -1
- package/styles/base-field.css +5 -5
- package/styles/base-field.module.css.css +1 -1
- package/styles/box.css +2 -2
- package/styles/box.module.css.css +1 -1
- package/styles/button.css +5 -5
- package/styles/button.module.css.css +1 -1
- package/styles/checkbox-field.css +4 -4
- package/styles/checkbox-field.module.css.css +1 -1
- package/styles/columns.css +2 -2
- package/styles/divider.css +2 -2
- package/styles/heading.css +3 -3
- package/styles/heading.module.css.css +1 -1
- package/styles/hidden-visually.css +3 -3
- package/styles/hidden-visually.module.css.css +1 -1
- package/styles/hidden.css +2 -2
- package/styles/index.css +5 -5
- package/styles/loading.css +3 -3
- package/styles/menu.css +1 -1
- package/styles/modal.css +6 -6
- package/styles/modal.module.css.css +1 -1
- package/styles/notice.css +2 -2
- package/styles/password-field.css +8 -8
- package/styles/progress-bar.module.css.css +1 -1
- package/styles/prose.css +3 -3
- package/styles/prose.module.css.css +1 -1
- package/styles/reactist.css +31 -31
- package/styles/select-field.css +6 -6
- package/styles/select-field.module.css.css +1 -1
- package/styles/spinner.css +1 -1
- package/styles/static-toast.css +7 -7
- package/styles/switch-field.css +7 -7
- package/styles/switch-field.module.css.css +1 -1
- package/styles/tabs.css +3 -3
- package/styles/tabs.module.css.css +1 -1
- package/styles/text-area.css +6 -6
- package/styles/text-area.module.css.css +1 -1
- package/styles/text-field.css +6 -6
- package/styles/text-field.module.css.css +1 -1
- package/styles/text-link.css +3 -3
- package/styles/text-link.module.css.css +1 -1
- package/styles/text.css +3 -3
- package/styles/text.module.css.css +1 -1
- package/styles/toast.module.css.css +1 -1
- package/styles/tooltip.css +3 -3
- package/styles/tooltip.module.css.css +1 -1
- package/styles/use-toasts.css +7 -7
- package/styles/width.module.css.css +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -91
- package/es/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
- package/lib/_virtual/_rollupPluginBabelHelpers.js +0 -2
- package/lib/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
package/lib/banner/banner.d.ts
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ButtonProps } from '../button';
|
|
3
|
-
import { TextLink } from '../text-link';
|
|
4
|
-
/**
|
|
5
|
-
* Represents the type of a banner.
|
|
6
|
-
* 'neutral' accepts a custom icon, the rest do not.
|
|
7
|
-
* @default 'neutral'
|
|
8
|
-
*/
|
|
9
|
-
export type BannerType = 'neutral' | SystemBannerType;
|
|
10
|
-
/**
|
|
11
|
-
* Predefined system types for banners.
|
|
12
|
-
* Each type has its own preset icon.
|
|
13
|
-
*/
|
|
14
|
-
export type SystemBannerType = 'info' | 'upgrade' | 'experiment' | 'warning' | 'error' | 'success';
|
|
15
|
-
type BaseAction = {
|
|
16
|
-
variant: 'primary' | 'tertiary';
|
|
17
|
-
label: string;
|
|
18
|
-
} & Pick<ButtonProps, 'loading' | 'disabled'>;
|
|
19
|
-
type ActionButton = BaseAction & {
|
|
20
|
-
type: 'button';
|
|
21
|
-
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className'>;
|
|
22
|
-
type ActionLink = BaseAction & {
|
|
23
|
-
type: 'link';
|
|
24
|
-
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'className'>;
|
|
25
|
-
/**
|
|
26
|
-
* Represents an action that can be taken from the banner.
|
|
27
|
-
* Can be either a button or a link, sharing common properties from BaseAction.
|
|
28
|
-
*/
|
|
29
|
-
type Action = ActionButton | ActionLink;
|
|
30
|
-
/**
|
|
31
|
-
* Configuration for inline links within the banner description.
|
|
32
|
-
* Extends TextLink component props with a required label.
|
|
33
|
-
*/
|
|
34
|
-
type InlineLink = {
|
|
35
|
-
label: string;
|
|
36
|
-
} & React.ComponentProps<typeof TextLink>;
|
|
37
|
-
type WithCloseButton = {
|
|
38
|
-
closeLabel?: string;
|
|
39
|
-
onClose: () => void;
|
|
40
|
-
};
|
|
41
|
-
type WithoutCloseButton = {
|
|
42
|
-
closeLabel?: never;
|
|
43
|
-
onClose?: never;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Controls the close button behavior.
|
|
47
|
-
* If none is provided, the banner will not have a close button.
|
|
48
|
-
*/
|
|
49
|
-
type CloseButton = WithCloseButton | WithoutCloseButton;
|
|
50
|
-
type BaseBanner = {
|
|
51
|
-
id?: string;
|
|
52
|
-
title?: React.ReactNode;
|
|
53
|
-
description: Exclude<React.ReactNode, null | undefined | boolean>;
|
|
54
|
-
action?: Action | React.ReactNode;
|
|
55
|
-
inlineLinks?: InlineLink[];
|
|
56
|
-
} & CloseButton;
|
|
57
|
-
/**
|
|
58
|
-
* Configuration for neutral banners.
|
|
59
|
-
* Can include either an image, an icon, or neither, but never both.
|
|
60
|
-
*/
|
|
61
|
-
type NeutralBanner = BaseBanner & {
|
|
62
|
-
type: Extract<BannerType, 'neutral'>;
|
|
63
|
-
} & ({
|
|
64
|
-
image: React.ReactElement;
|
|
65
|
-
icon?: never;
|
|
66
|
-
} | {
|
|
67
|
-
icon: React.ReactElement;
|
|
68
|
-
image?: never;
|
|
69
|
-
} | {
|
|
70
|
-
image?: never;
|
|
71
|
-
icon?: never;
|
|
72
|
-
});
|
|
73
|
-
/**
|
|
74
|
-
* Configuration for system banners.
|
|
75
|
-
* Cannot include custom images or icons as they use preset ones.
|
|
76
|
-
*/
|
|
77
|
-
type SystemBanner = BaseBanner & {
|
|
78
|
-
type: SystemBannerType;
|
|
79
|
-
image?: never;
|
|
80
|
-
icon?: never;
|
|
81
|
-
};
|
|
82
|
-
type BannerProps = NeutralBanner | SystemBanner;
|
|
83
|
-
declare const Banner: React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLDivElement>>;
|
|
84
|
-
declare function ActionButton({ type, label, ...props }: ActionButton): React.JSX.Element;
|
|
85
|
-
declare function ActionLink({ type, label, variant, ...props }: ActionLink): React.JSX.Element;
|
|
86
|
-
export { Banner };
|
|
87
|
-
export type { BannerProps };
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ButtonProps } from '../button';
|
|
3
|
+
import { TextLink } from '../text-link';
|
|
4
|
+
/**
|
|
5
|
+
* Represents the type of a banner.
|
|
6
|
+
* 'neutral' accepts a custom icon, the rest do not.
|
|
7
|
+
* @default 'neutral'
|
|
8
|
+
*/
|
|
9
|
+
export type BannerType = 'neutral' | SystemBannerType;
|
|
10
|
+
/**
|
|
11
|
+
* Predefined system types for banners.
|
|
12
|
+
* Each type has its own preset icon.
|
|
13
|
+
*/
|
|
14
|
+
export type SystemBannerType = 'info' | 'upgrade' | 'experiment' | 'warning' | 'error' | 'success';
|
|
15
|
+
type BaseAction = {
|
|
16
|
+
variant: 'primary' | 'tertiary';
|
|
17
|
+
label: string;
|
|
18
|
+
} & Pick<ButtonProps, 'loading' | 'disabled'>;
|
|
19
|
+
type ActionButton = BaseAction & {
|
|
20
|
+
type: 'button';
|
|
21
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className'>;
|
|
22
|
+
type ActionLink = BaseAction & {
|
|
23
|
+
type: 'link';
|
|
24
|
+
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'className'>;
|
|
25
|
+
/**
|
|
26
|
+
* Represents an action that can be taken from the banner.
|
|
27
|
+
* Can be either a button or a link, sharing common properties from BaseAction.
|
|
28
|
+
*/
|
|
29
|
+
type Action = ActionButton | ActionLink;
|
|
30
|
+
/**
|
|
31
|
+
* Configuration for inline links within the banner description.
|
|
32
|
+
* Extends TextLink component props with a required label.
|
|
33
|
+
*/
|
|
34
|
+
type InlineLink = {
|
|
35
|
+
label: string;
|
|
36
|
+
} & React.ComponentProps<typeof TextLink>;
|
|
37
|
+
type WithCloseButton = {
|
|
38
|
+
closeLabel?: string;
|
|
39
|
+
onClose: () => void;
|
|
40
|
+
};
|
|
41
|
+
type WithoutCloseButton = {
|
|
42
|
+
closeLabel?: never;
|
|
43
|
+
onClose?: never;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Controls the close button behavior.
|
|
47
|
+
* If none is provided, the banner will not have a close button.
|
|
48
|
+
*/
|
|
49
|
+
type CloseButton = WithCloseButton | WithoutCloseButton;
|
|
50
|
+
type BaseBanner = {
|
|
51
|
+
id?: string;
|
|
52
|
+
title?: React.ReactNode;
|
|
53
|
+
description: Exclude<React.ReactNode, null | undefined | boolean>;
|
|
54
|
+
action?: Action | React.ReactNode;
|
|
55
|
+
inlineLinks?: InlineLink[];
|
|
56
|
+
} & CloseButton;
|
|
57
|
+
/**
|
|
58
|
+
* Configuration for neutral banners.
|
|
59
|
+
* Can include either an image, an icon, or neither, but never both.
|
|
60
|
+
*/
|
|
61
|
+
type NeutralBanner = BaseBanner & {
|
|
62
|
+
type: Extract<BannerType, 'neutral'>;
|
|
63
|
+
} & ({
|
|
64
|
+
image: React.ReactElement;
|
|
65
|
+
icon?: never;
|
|
66
|
+
} | {
|
|
67
|
+
icon: React.ReactElement;
|
|
68
|
+
image?: never;
|
|
69
|
+
} | {
|
|
70
|
+
image?: never;
|
|
71
|
+
icon?: never;
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Configuration for system banners.
|
|
75
|
+
* Cannot include custom images or icons as they use preset ones.
|
|
76
|
+
*/
|
|
77
|
+
type SystemBanner = BaseBanner & {
|
|
78
|
+
type: SystemBannerType;
|
|
79
|
+
image?: never;
|
|
80
|
+
icon?: never;
|
|
81
|
+
};
|
|
82
|
+
type BannerProps = NeutralBanner | SystemBanner;
|
|
83
|
+
declare const Banner: React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLDivElement>>;
|
|
84
|
+
declare function ActionButton({ type, label, ...props }: ActionButton): React.JSX.Element;
|
|
85
|
+
declare function ActionLink({ type, label, variant, ...props }: ActionLink): React.JSX.Element;
|
|
86
|
+
export { Banner };
|
|
87
|
+
export type { BannerProps };
|
package/lib/banner/banner.js
CHANGED
|
@@ -1,2 +1,80 @@
|
|
|
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 box = require('../box/box.js');
|
|
8
|
+
var commonHelpers = require('../utils/common-helpers.js');
|
|
9
|
+
var banner_module = require('./banner.module.css.js');
|
|
10
|
+
var button = require('../button/button.js');
|
|
11
|
+
var closeIcon = require('../icons/close-icon.js');
|
|
12
|
+
var bannerIcon = require('../icons/banner-icon.js');
|
|
13
|
+
var textLink = require('../text-link/text-link.js');
|
|
14
|
+
|
|
15
|
+
function _interopNamespace(e) {
|
|
16
|
+
if (e && e.__esModule) return e;
|
|
17
|
+
var n = Object.create(null);
|
|
18
|
+
if (e) {
|
|
19
|
+
Object.keys(e).forEach(function (k) {
|
|
20
|
+
if (k !== 'default') {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return e[k]; }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
n["default"] = e;
|
|
30
|
+
return Object.freeze(n);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Type guard to check if the action is an Action object (button or link)
|
|
37
|
+
*/
|
|
38
|
+
function isActionObject(action) {
|
|
39
|
+
return (typeof action === 'object' &&
|
|
40
|
+
action !== null &&
|
|
41
|
+
'type' in action &&
|
|
42
|
+
(action.type === 'button' || action.type === 'link'));
|
|
43
|
+
}
|
|
44
|
+
var Banner = React__namespace.forwardRef(function Banner(_a, ref) {
|
|
45
|
+
var id = _a.id, type = _a.type, title = _a.title, description = _a.description, action = _a.action, icon = _a.icon, image = _a.image, inlineLinks = _a.inlineLinks, closeLabel = _a.closeLabel, onClose = _a.onClose, props = tslib.__rest(_a, ["id", "type", "title", "description", "action", "icon", "image", "inlineLinks", "closeLabel", "onClose"]);
|
|
46
|
+
var titleId = commonHelpers.useId();
|
|
47
|
+
var descriptionId = commonHelpers.useId();
|
|
48
|
+
var closeButton = onClose ? (React__namespace.createElement(button.IconButton, { exceptionallySetClassName: banner_module["default"].closeButton, variant: "quaternary", onClick: onClose, icon: React__namespace.createElement(closeIcon.CloseIcon, null), "aria-label": closeLabel !== null && closeLabel !== void 0 ? closeLabel : 'Close banner' })) : null;
|
|
49
|
+
return (React__namespace.createElement(box.Box, tslib.__assign({}, props, { ref: ref, id: id, display: "flex", flexDirection: "column", justifyContent: "center", role: "status", "aria-labelledby": title ? titleId : descriptionId, "aria-describedby": title ? descriptionId : undefined, "aria-live": "polite", tabIndex: 0, borderRadius: "full", className: banner_module["default"].banner }),
|
|
50
|
+
image ? React__namespace.createElement(box.Box, { className: banner_module["default"].image }, image) : null,
|
|
51
|
+
React__namespace.createElement(box.Box, { className: banner_module["default"].content, display: "flex", gap: "small", alignItems: "center" },
|
|
52
|
+
React__namespace.createElement(box.Box, { className: banner_module["default"].staticContent, display: "flex", gap: "small", flexGrow: 1 },
|
|
53
|
+
React__namespace.createElement(box.Box, { className: banner_module["default"].icon },
|
|
54
|
+
type === 'neutral' ? icon : React__namespace.createElement(bannerIcon.BannerIcon, { type: type }),
|
|
55
|
+
closeButton),
|
|
56
|
+
React__namespace.createElement(box.Box, { className: banner_module["default"].copy, display: "flex", flexDirection: "column" },
|
|
57
|
+
title ? (React__namespace.createElement(box.Box, { id: titleId, className: banner_module["default"].title }, title)) : null,
|
|
58
|
+
React__namespace.createElement(box.Box, { id: descriptionId, className: [banner_module["default"].description, title ? banner_module["default"].secondary : null] },
|
|
59
|
+
description, inlineLinks === null || inlineLinks === void 0 ? void 0 :
|
|
60
|
+
inlineLinks.map(function (_a, index) {
|
|
61
|
+
var label = _a.label, props = tslib.__rest(_a, ["label"]);
|
|
62
|
+
return (React__namespace.createElement(React__namespace.Fragment, { key: index },
|
|
63
|
+
React__namespace.createElement(textLink.TextLink, tslib.__assign({}, props, { exceptionallySetClassName: banner_module["default"].inlineLink }), label),
|
|
64
|
+
index < inlineLinks.length - 1 ? React__namespace.createElement("span", null, " \u00B7 ") : ''));
|
|
65
|
+
})))),
|
|
66
|
+
action || closeButton ? (React__namespace.createElement(box.Box, { className: banner_module["default"].actions, display: "flex", gap: "small" },
|
|
67
|
+
action ? (isActionObject(action) ? (action.type === 'button' ? (React__namespace.createElement(ActionButton, tslib.__assign({}, action))) : (React__namespace.createElement(ActionLink, tslib.__assign({}, action)))) : (action)) : null,
|
|
68
|
+
closeButton)) : null)));
|
|
69
|
+
});
|
|
70
|
+
function ActionButton(_a) {
|
|
71
|
+
_a.type; var label = _a.label, props = tslib.__rest(_a, ["type", "label"]);
|
|
72
|
+
return React__namespace.createElement(button.Button, tslib.__assign({}, props), label);
|
|
73
|
+
}
|
|
74
|
+
function ActionLink(_a) {
|
|
75
|
+
_a.type; var label = _a.label, variant = _a.variant, props = tslib.__rest(_a, ["type", "label", "variant"]);
|
|
76
|
+
return (React__namespace.createElement(button.Button, { variant: variant, render: React__namespace.createElement("a", tslib.__assign({ rel: "noopener noreferrer", target: "_blank" }, props)) }, label));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
exports.Banner = Banner;
|
|
2
80
|
//# sourceMappingURL=banner.js.map
|
package/lib/banner/banner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sources":["../../src/banner/banner.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport { useId } from '../utils/common-helpers'\n\nimport styles from './banner.module.css'\nimport { Button, ButtonProps, IconButton } from '../button'\nimport { CloseIcon } from '../icons/close-icon'\nimport { BannerIcon } from '../icons/banner-icon'\nimport { TextLink } from '../text-link'\n\n/**\n * Represents the type of a banner.\n * 'neutral' accepts a custom icon, the rest do not.\n * @default 'neutral'\n */\nexport type BannerType = 'neutral' | SystemBannerType\n\n/**\n * Predefined system types for banners.\n * Each type has its own preset icon.\n */\nexport type SystemBannerType = 'info' | 'upgrade' | 'experiment' | 'warning' | 'error' | 'success'\n\ntype BaseAction = {\n variant: 'primary' | 'tertiary'\n label: string\n} & Pick<ButtonProps, 'loading' | 'disabled'>\ntype ActionButton = BaseAction & { type: 'button' } & Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'className'\n >\ntype ActionLink = BaseAction & { type: 'link' } & Omit<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n 'className'\n >\n/**\n * Represents an action that can be taken from the banner.\n * Can be either a button or a link, sharing common properties from BaseAction.\n */\ntype Action = ActionButton | ActionLink\n\n/**\n * Configuration for inline links within the banner description.\n * Extends TextLink component props with a required label.\n */\ntype InlineLink = { label: string } & React.ComponentProps<typeof TextLink>\n\ntype WithCloseButton = {\n closeLabel?: string\n onClose: () => void\n}\ntype WithoutCloseButton = {\n closeLabel?: never\n onClose?: never\n}\n/**\n * Controls the close button behavior.\n * If none is provided, the banner will not have a close button.\n */\ntype CloseButton = WithCloseButton | WithoutCloseButton\n\ntype BaseBanner = {\n id?: string\n title?: React.ReactNode\n description: Exclude<React.ReactNode, null | undefined | boolean>\n action?: Action | React.ReactNode\n inlineLinks?: InlineLink[]\n} & CloseButton\n\n/**\n * Configuration for neutral banners.\n * Can include either an image, an icon, or neither, but never both.\n */\ntype NeutralBanner = BaseBanner & {\n type: Extract<BannerType, 'neutral'>\n} & (\n | { image: React.ReactElement; icon?: never }\n | { icon: React.ReactElement; image?: never }\n | { image?: never; icon?: never }\n )\n\n/**\n * Configuration for system banners.\n * Cannot include custom images or icons as they use preset ones.\n */\ntype SystemBanner = BaseBanner & {\n type: SystemBannerType\n image?: never\n icon?: never\n}\n\ntype BannerProps = NeutralBanner | SystemBanner\n\n/**\n * Type guard to check if the action is an Action object (button or link)\n */\nfunction isActionObject(action: Action | React.ReactNode): action is Action {\n return (\n typeof action === 'object' &&\n action !== null &&\n 'type' in action &&\n (action.type === 'button' || action.type === 'link')\n )\n}\n\nconst Banner = React.forwardRef<HTMLDivElement, BannerProps>(function Banner(\n {\n id,\n type,\n title,\n description,\n action,\n icon,\n image,\n inlineLinks,\n closeLabel,\n onClose,\n ...props\n }: BannerProps,\n ref,\n) {\n const titleId = useId()\n const descriptionId = useId()\n\n const closeButton = onClose ? (\n <IconButton\n exceptionallySetClassName={styles.closeButton}\n variant=\"quaternary\"\n onClick={onClose}\n icon={<CloseIcon />}\n aria-label={closeLabel ?? 'Close banner'}\n />\n ) : null\n\n return (\n <Box\n {...props}\n ref={ref}\n id={id}\n display=\"flex\"\n flexDirection=\"column\"\n justifyContent=\"center\"\n role=\"status\"\n aria-labelledby={title ? titleId : descriptionId}\n aria-describedby={title ? descriptionId : undefined}\n aria-live=\"polite\"\n tabIndex={0}\n borderRadius=\"full\"\n className={styles.banner}\n >\n {image ? <Box className={styles.image}>{image}</Box> : null}\n\n <Box className={styles.content} display=\"flex\" gap=\"small\" alignItems=\"center\">\n <Box className={styles.staticContent} display=\"flex\" gap=\"small\" flexGrow={1}>\n <Box className={styles.icon}>\n {type === 'neutral' ? icon : <BannerIcon type={type} />}\n {closeButton}\n </Box>\n\n <Box className={styles.copy} display=\"flex\" flexDirection=\"column\">\n {title ? (\n <Box id={titleId} className={styles.title}>\n {title}\n </Box>\n ) : null}\n <Box\n id={descriptionId}\n className={[styles.description, title ? styles.secondary : null]}\n >\n {description}\n {inlineLinks?.map(({ label, ...props }, index) => {\n return (\n <React.Fragment key={index}>\n <TextLink\n {...props}\n exceptionallySetClassName={styles.inlineLink}\n >\n {label}\n </TextLink>\n {index < inlineLinks.length - 1 ? <span> · </span> : ''}\n </React.Fragment>\n )\n })}\n </Box>\n </Box>\n </Box>\n\n {action || closeButton ? (\n <Box className={styles.actions} display=\"flex\" gap=\"small\">\n {action ? (\n isActionObject(action) ? (\n action.type === 'button' ? (\n <ActionButton {...action} />\n ) : (\n <ActionLink {...action} />\n )\n ) : (\n action\n )\n ) : null}\n {closeButton}\n </Box>\n ) : null}\n </Box>\n </Box>\n )\n})\n\nfunction ActionButton({ type, label, ...props }: ActionButton) {\n return <Button {...props}>{label}</Button>\n}\n\nfunction ActionLink({ type, label, variant, ...props }: ActionLink) {\n return (\n <Button\n variant={variant}\n render={<a rel=\"noopener noreferrer\" target=\"_blank\" {...props} />}\n >\n {label}\n </Button>\n )\n}\n\nexport { Banner }\nexport type { BannerProps }\n"],"names":["ActionButton","_ref3","label","props","_objectWithoutProperties","objectWithoutProperties","_excluded3","React","Button","ActionLink","_ref4","variant","_excluded4","createElement","render","_objectSpread","rel","target","forwardRef","ref","id","type","title","description","action","icon","image","inlineLinks","closeLabel","onClose","_ref","_excluded","titleId","useId","descriptionId","closeButton","IconButton","exceptionallySetClassName","styles","onClick","CloseIcon","aria-label","Box","display","flexDirection","justifyContent","role","aria-describedby","undefined","aria-live","tabIndex","borderRadius","className","banner","content","gap","alignItems","staticContent","flexGrow","BannerIcon","copy","secondary","map","index","_ref2","_excluded2","Fragment","key","TextLink","inlineLink","length","actions","isActionObject","objectSpread2"],"mappings":"y0BAgNA,SAASA,EAAoDC,GAAA,IAAvCC,MAAQA,GAA+BD,EAArBE,EAAqBC,EAAAC,wBAAAJ,EAAAK,GACzD,OAAOC,gBAACC,SAAWL,EAAAA,cAAAA,GAAAA,GAAQD,GAG/B,SAASO,EAAyDC,GAAA,IAA9CR,MAAQA,EAARS,QAAeA,GAA+BD,EAAnBP,EAAmBC,EAAAC,wBAAAK,EAAAE,GAC9D,OACIL,EAACM,cAAAL,SACG,CAAAG,QAASA,EACTG,OAAQP,EAAGM,cAAA,IAAHE,EAAAA,cAAA,CAAGC,IAAI,sBAAsBC,OAAO,UAAad,KAExDD,kBAjHEK,EAAMW,YAAwC,SAczDC,EAAAA,GAAG,IAbHC,GACIA,EADJC,KAEIA,EAFJC,MAGIA,EAHJC,YAIIA,EAJJC,OAKIA,EALJC,KAMIA,EANJC,MAOIA,EAPJC,YAQIA,EARJC,WASIA,EATJC,QAUIA,GAGDC,EAFI3B,EAEJC,EAAAC,wBAAAyB,EAAAC,GAEH,MAAMC,EAAUC,EAAAA,QACVC,EAAgBD,EAAAA,QAEhBE,EAAcN,EAChBtB,EAAAM,cAACuB,EAAAA,WAAU,CACPC,0BAA2BC,EAAM,QAACH,YAClCxB,QAAQ,aACR4B,QAASV,EACTJ,KAAMlB,EAAAM,cAAC2B,EAAAA,UAAY,MAAAC,aACPb,MAAAA,EAAAA,EAAc,iBAE9B,KAEJ,OACIrB,EAAAM,cAAC6B,yCACOvC,GADR,GAAA,CAEIgB,IAAKA,EACLC,GAAIA,EACJuB,QAAQ,OACRC,cAAc,SACdC,eAAe,SACfC,K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U,UAAWd,EAAM,QAACiC,QAAS5B,QAAQ,OAAOY,IAAI,SAC9C/B,EA7FzB,SAAwBA,GACpB,MACsB,iBAAXA,GACI,OAAXA,GACA,SAAUA,IACO,WAAhBA,EAAOH,MAAqC,SAAhBG,EAAOH,MAyFhBmD,CAAehD,GAEPjB,EAAAM,cADY,WAAhBW,EAAOH,KACFrB,EAEAS,EAFDM,EAAA0D,cAAA,GAAkBjD,IAKtBA,EAEJ,KACHW,GAEL"}
|
|
1
|
+
{"version":3,"file":"banner.js","sources":["../../src/banner/banner.tsx"],"sourcesContent":[null],"names":["React","__rest","useId","IconButton","styles","CloseIcon","Box","__assign","BannerIcon","TextLink","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA;;AAEG;AACH,SAAS,cAAc,CAAC,MAAgC,EAAA;AACpD,IAAA,QACI,OAAO,MAAM,KAAK,QAAQ;AAC1B,QAAA,MAAM,KAAK,IAAI;AACf,QAAA,MAAM,IAAI,MAAM;AAChB,SAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,EACvD;AACL,CAAC;AAEK,IAAA,MAAM,GAAGA,gBAAK,CAAC,UAAU,CAA8B,SAAS,MAAM,CACxE,EAYc,EACd,GAAG,EAAA;AAZC,IAAA,IAAA,EAAE,GAAA,EAAA,CAAA,EAAA,EACF,IAAI,UAAA,EACJ,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,MAAM,YAAA,EACN,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,WAAW,iBAAA,EACX,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,OAAO,GAAA,EAAA,CAAA,OAAA,EACJ,KAAK,GAAAC,YAAA,CAAA,EAAA,EAXZ,yGAYC,CADW,CAAA;AAIZ,IAAA,IAAM,OAAO,GAAGC,mBAAK,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AAA,EAAA,SAAA,CAAkC,EAAF;IAChD,QACID,gBAAC,CAAA,aAAA,CAAAU,aAAM,EACH,EAAA,OAAO,EAAE,OAAO,EAChB,MAAM,EAAEV,gBAAG,CAAA,aAAA,CAAA,GAAA,EAAAO,cAAA,CAAA,EAAA,GAAG,EAAC,qBAAqB,EAAC,MAAM,EAAC,QAAQ,EAAA,EAAK,KAAK,CAAA,CAAI,EAEjE,EAAA,KAAK,CACD,EACZ;AACL;;;;"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var modules_afa80466 = {"banner":"e1b2ef74","image":"_8d3ff024","title":"_9ad57971","description":"_99daf106","secondary":"_59ea31f7","icon":"b1ae548b","closeButton":"c2e4ec08","copy":"cd270dad","inlineLink":"cbbd2929","staticContent":"d3bd2674","actions":"_1a63a5e1","content":"_1705b6ee"};
|
|
6
|
+
|
|
7
|
+
exports["default"] = modules_afa80466;
|
|
2
8
|
//# sourceMappingURL=banner.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"banner.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/lib/banner/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Banner } from './banner';
|
|
2
|
-
export type { BannerProps } from './banner';
|
|
1
|
+
export { Banner } from './banner';
|
|
2
|
+
export type { BannerProps } from './banner';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare function PromoImage({ theme }: {
|
|
3
|
-
theme?: 'light' | 'dark';
|
|
4
|
-
}): React.JSX.Element;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function PromoImage({ theme }: {
|
|
3
|
+
theme?: 'light' | 'dark';
|
|
4
|
+
}): React.JSX.Element;
|
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { BoxProps } from '../box';
|
|
3
|
-
import type { WithEnhancedClassName } from '../utils/common-types';
|
|
4
|
-
type FieldTone = 'neutral' | 'success' | 'error' | 'loading';
|
|
5
|
-
type FieldMessageProps = {
|
|
6
|
-
id: string;
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
tone: FieldTone;
|
|
9
|
-
};
|
|
10
|
-
declare function FieldMessage({ id, children, tone }: FieldMessageProps): React.JSX.Element;
|
|
11
|
-
type ChildrenRenderProps = {
|
|
12
|
-
id: string;
|
|
13
|
-
value?: React.InputHTMLAttributes<unknown>['value'];
|
|
14
|
-
'aria-describedby'?: string;
|
|
15
|
-
'aria-invalid'?: true;
|
|
16
|
-
onChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>;
|
|
17
|
-
characterCountElement?: React.ReactNode | null;
|
|
18
|
-
};
|
|
19
|
-
type HtmlInputProps<T extends HTMLElement> = React.DetailedHTMLProps<React.InputHTMLAttributes<T>, T>;
|
|
20
|
-
type BaseFieldVariant = 'default' | 'bordered';
|
|
21
|
-
type BaseFieldVariantProps = {
|
|
22
|
-
/**
|
|
23
|
-
* Provides alternative visual layouts or modes that the field can be rendered in.
|
|
24
|
-
*
|
|
25
|
-
* Namely, there are two variants supported:
|
|
26
|
-
*
|
|
27
|
-
* - the default one
|
|
28
|
-
* - a "bordered" variant, where the border of the field surrounds also the labels, instead
|
|
29
|
-
* of just surrounding the actual field element
|
|
30
|
-
*
|
|
31
|
-
* In both cases, the message and description texts for the field lie outside the bordered
|
|
32
|
-
* area.
|
|
33
|
-
*/
|
|
34
|
-
variant?: BaseFieldVariant;
|
|
35
|
-
};
|
|
36
|
-
export type BaseFieldProps = WithEnhancedClassName & Pick<HtmlInputProps<HTMLInputElement>, 'id' | 'hidden' | 'maxLength' | 'aria-describedby'> & {
|
|
37
|
-
/**
|
|
38
|
-
* The main label for this field element.
|
|
39
|
-
*
|
|
40
|
-
* This prop is not optional. Consumers of field components must be explicit about not
|
|
41
|
-
* wanting a label by passing `label=""` or `label={null}`. In those situations, consumers
|
|
42
|
-
* should make sure that fields are properly labelled semantically by other means (e.g using
|
|
43
|
-
* `aria-labelledby`, or rendering a `<label />` element referencing the field by id).
|
|
44
|
-
*
|
|
45
|
-
* Avoid providing interactive elements in the label. Prefer `auxiliaryLabel` for that.
|
|
46
|
-
*
|
|
47
|
-
* @see BaseFieldProps['auxiliaryLabel']
|
|
48
|
-
*/
|
|
49
|
-
label: React.ReactNode;
|
|
50
|
-
/**
|
|
51
|
-
* The initial value for this field element.
|
|
52
|
-
*
|
|
53
|
-
* This prop is used to calculate the character count for the initial value, and is then
|
|
54
|
-
* passed to the underlying child element.
|
|
55
|
-
*/
|
|
56
|
-
value?: React.InputHTMLAttributes<unknown>['value'];
|
|
57
|
-
/**
|
|
58
|
-
* An optional extra element to be placed to the right of the main label.
|
|
59
|
-
*
|
|
60
|
-
* This extra element is not included in the accessible name of the field element. Its only
|
|
61
|
-
* purpose is either visual, or functional (if you include interactive elements in it).
|
|
62
|
-
*
|
|
63
|
-
* @see BaseFieldProps['label']
|
|
64
|
-
*
|
|
65
|
-
* @deprecated The usage of this element is discouraged given that it was removed from the
|
|
66
|
-
* latest form field spec revision.
|
|
67
|
-
*/
|
|
68
|
-
auxiliaryLabel?: React.ReactNode;
|
|
69
|
-
/**
|
|
70
|
-
* A message associated with the field. It is rendered below the field, and with an
|
|
71
|
-
* appearance that conveys the tone of the field (e.g. coloured red for errors, green for
|
|
72
|
-
* success, etc).
|
|
73
|
-
*
|
|
74
|
-
* The message element is associated to the field via the `aria-describedby` attribute.
|
|
75
|
-
*
|
|
76
|
-
* In the future, when `aria-errormessage` gets better user agent support, we should use it
|
|
77
|
-
* to associate the filed with a message when tone is `"error"`.
|
|
78
|
-
*
|
|
79
|
-
* @see BaseFieldProps['tone']
|
|
80
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-errormessage
|
|
81
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-invalid
|
|
82
|
-
*/
|
|
83
|
-
message?: React.ReactNode;
|
|
84
|
-
/**
|
|
85
|
-
* The tone with which the message, if any, is presented.
|
|
86
|
-
*
|
|
87
|
-
* If the tone is `"error"`, the field border turns red, and the message, if any, is also
|
|
88
|
-
* red.
|
|
89
|
-
*
|
|
90
|
-
* When the tone is `"loading"`, it is recommended that you also disable the field. However,
|
|
91
|
-
* this is not enforced by the component. It is only a recommendation.
|
|
92
|
-
*
|
|
93
|
-
* @see BaseFieldProps['message']
|
|
94
|
-
* @see BaseFieldProps['hint']
|
|
95
|
-
*/
|
|
96
|
-
tone?: FieldTone;
|
|
97
|
-
/**
|
|
98
|
-
* The maximum width that the input field can expand to.
|
|
99
|
-
*/
|
|
100
|
-
maxWidth?: BoxProps['maxWidth'];
|
|
101
|
-
/**
|
|
102
|
-
* The maximum number of characters that the input field can accept.
|
|
103
|
-
* When this limit is reached, the input field will not accept any more characters.
|
|
104
|
-
* The counter element will turn red when the number of characters is within 10 of the maximum limit.
|
|
105
|
-
*/
|
|
106
|
-
maxLength?: number;
|
|
107
|
-
/**
|
|
108
|
-
* Used internally by components composed using `BaseField`. It is not exposed as part of
|
|
109
|
-
* the public props of such components.
|
|
110
|
-
*/
|
|
111
|
-
children: (props: ChildrenRenderProps) => React.ReactNode;
|
|
112
|
-
/**
|
|
113
|
-
* The position of the character count element.
|
|
114
|
-
* It can be shown below the field or inline with the field.
|
|
115
|
-
*
|
|
116
|
-
* @default 'below'
|
|
117
|
-
*/
|
|
118
|
-
characterCountPosition?: 'below' | 'inline' | 'hidden';
|
|
119
|
-
} & ({
|
|
120
|
-
supportsStartAndEndSlots?: false;
|
|
121
|
-
endSlot?: never;
|
|
122
|
-
endSlotPosition?: never;
|
|
123
|
-
} | {
|
|
124
|
-
supportsStartAndEndSlots: true;
|
|
125
|
-
endSlot?: React.ReactElement | string | number;
|
|
126
|
-
/**
|
|
127
|
-
* This is solely for `bordered` variants of TextField. When set to `bottom` (the default),
|
|
128
|
-
* the endSlot will be placed inline with the input field. When set to `fullHeight`, the endSlot
|
|
129
|
-
* will be placed to the side of both the input field and the label.
|
|
130
|
-
*/
|
|
131
|
-
endSlotPosition?: 'bottom' | 'fullHeight';
|
|
132
|
-
});
|
|
133
|
-
type FieldComponentProps<T extends HTMLElement> = Omit<BaseFieldProps, 'children' | 'className' | 'fieldRef' | 'variant'> & Omit<HtmlInputProps<T>, 'className' | 'style'>;
|
|
134
|
-
/**
|
|
135
|
-
* BaseField is a base component that provides a consistent structure for form fields.
|
|
136
|
-
*/
|
|
137
|
-
declare function BaseField({ variant, label, value, auxiliaryLabel, message, tone, className, children, maxWidth, maxLength, hidden, 'aria-describedby': originalAriaDescribedBy, id: originalId, characterCountPosition, endSlot, endSlotPosition, }: BaseFieldProps & BaseFieldVariantProps & WithEnhancedClassName): React.JSX.Element;
|
|
138
|
-
export { BaseField, FieldMessage };
|
|
139
|
-
export type { BaseFieldVariant, BaseFieldVariantProps, FieldComponentProps };
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BoxProps } from '../box';
|
|
3
|
+
import type { WithEnhancedClassName } from '../utils/common-types';
|
|
4
|
+
type FieldTone = 'neutral' | 'success' | 'error' | 'loading';
|
|
5
|
+
type FieldMessageProps = {
|
|
6
|
+
id: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
tone: FieldTone;
|
|
9
|
+
};
|
|
10
|
+
declare function FieldMessage({ id, children, tone }: FieldMessageProps): React.JSX.Element;
|
|
11
|
+
type ChildrenRenderProps = {
|
|
12
|
+
id: string;
|
|
13
|
+
value?: React.InputHTMLAttributes<unknown>['value'];
|
|
14
|
+
'aria-describedby'?: string;
|
|
15
|
+
'aria-invalid'?: true;
|
|
16
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>;
|
|
17
|
+
characterCountElement?: React.ReactNode | null;
|
|
18
|
+
};
|
|
19
|
+
type HtmlInputProps<T extends HTMLElement> = React.DetailedHTMLProps<React.InputHTMLAttributes<T>, T>;
|
|
20
|
+
type BaseFieldVariant = 'default' | 'bordered';
|
|
21
|
+
type BaseFieldVariantProps = {
|
|
22
|
+
/**
|
|
23
|
+
* Provides alternative visual layouts or modes that the field can be rendered in.
|
|
24
|
+
*
|
|
25
|
+
* Namely, there are two variants supported:
|
|
26
|
+
*
|
|
27
|
+
* - the default one
|
|
28
|
+
* - a "bordered" variant, where the border of the field surrounds also the labels, instead
|
|
29
|
+
* of just surrounding the actual field element
|
|
30
|
+
*
|
|
31
|
+
* In both cases, the message and description texts for the field lie outside the bordered
|
|
32
|
+
* area.
|
|
33
|
+
*/
|
|
34
|
+
variant?: BaseFieldVariant;
|
|
35
|
+
};
|
|
36
|
+
export type BaseFieldProps = WithEnhancedClassName & Pick<HtmlInputProps<HTMLInputElement>, 'id' | 'hidden' | 'maxLength' | 'aria-describedby'> & {
|
|
37
|
+
/**
|
|
38
|
+
* The main label for this field element.
|
|
39
|
+
*
|
|
40
|
+
* This prop is not optional. Consumers of field components must be explicit about not
|
|
41
|
+
* wanting a label by passing `label=""` or `label={null}`. In those situations, consumers
|
|
42
|
+
* should make sure that fields are properly labelled semantically by other means (e.g using
|
|
43
|
+
* `aria-labelledby`, or rendering a `<label />` element referencing the field by id).
|
|
44
|
+
*
|
|
45
|
+
* Avoid providing interactive elements in the label. Prefer `auxiliaryLabel` for that.
|
|
46
|
+
*
|
|
47
|
+
* @see BaseFieldProps['auxiliaryLabel']
|
|
48
|
+
*/
|
|
49
|
+
label: React.ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* The initial value for this field element.
|
|
52
|
+
*
|
|
53
|
+
* This prop is used to calculate the character count for the initial value, and is then
|
|
54
|
+
* passed to the underlying child element.
|
|
55
|
+
*/
|
|
56
|
+
value?: React.InputHTMLAttributes<unknown>['value'];
|
|
57
|
+
/**
|
|
58
|
+
* An optional extra element to be placed to the right of the main label.
|
|
59
|
+
*
|
|
60
|
+
* This extra element is not included in the accessible name of the field element. Its only
|
|
61
|
+
* purpose is either visual, or functional (if you include interactive elements in it).
|
|
62
|
+
*
|
|
63
|
+
* @see BaseFieldProps['label']
|
|
64
|
+
*
|
|
65
|
+
* @deprecated The usage of this element is discouraged given that it was removed from the
|
|
66
|
+
* latest form field spec revision.
|
|
67
|
+
*/
|
|
68
|
+
auxiliaryLabel?: React.ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* A message associated with the field. It is rendered below the field, and with an
|
|
71
|
+
* appearance that conveys the tone of the field (e.g. coloured red for errors, green for
|
|
72
|
+
* success, etc).
|
|
73
|
+
*
|
|
74
|
+
* The message element is associated to the field via the `aria-describedby` attribute.
|
|
75
|
+
*
|
|
76
|
+
* In the future, when `aria-errormessage` gets better user agent support, we should use it
|
|
77
|
+
* to associate the filed with a message when tone is `"error"`.
|
|
78
|
+
*
|
|
79
|
+
* @see BaseFieldProps['tone']
|
|
80
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-errormessage
|
|
81
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-invalid
|
|
82
|
+
*/
|
|
83
|
+
message?: React.ReactNode;
|
|
84
|
+
/**
|
|
85
|
+
* The tone with which the message, if any, is presented.
|
|
86
|
+
*
|
|
87
|
+
* If the tone is `"error"`, the field border turns red, and the message, if any, is also
|
|
88
|
+
* red.
|
|
89
|
+
*
|
|
90
|
+
* When the tone is `"loading"`, it is recommended that you also disable the field. However,
|
|
91
|
+
* this is not enforced by the component. It is only a recommendation.
|
|
92
|
+
*
|
|
93
|
+
* @see BaseFieldProps['message']
|
|
94
|
+
* @see BaseFieldProps['hint']
|
|
95
|
+
*/
|
|
96
|
+
tone?: FieldTone;
|
|
97
|
+
/**
|
|
98
|
+
* The maximum width that the input field can expand to.
|
|
99
|
+
*/
|
|
100
|
+
maxWidth?: BoxProps['maxWidth'];
|
|
101
|
+
/**
|
|
102
|
+
* The maximum number of characters that the input field can accept.
|
|
103
|
+
* When this limit is reached, the input field will not accept any more characters.
|
|
104
|
+
* The counter element will turn red when the number of characters is within 10 of the maximum limit.
|
|
105
|
+
*/
|
|
106
|
+
maxLength?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Used internally by components composed using `BaseField`. It is not exposed as part of
|
|
109
|
+
* the public props of such components.
|
|
110
|
+
*/
|
|
111
|
+
children: (props: ChildrenRenderProps) => React.ReactNode;
|
|
112
|
+
/**
|
|
113
|
+
* The position of the character count element.
|
|
114
|
+
* It can be shown below the field or inline with the field.
|
|
115
|
+
*
|
|
116
|
+
* @default 'below'
|
|
117
|
+
*/
|
|
118
|
+
characterCountPosition?: 'below' | 'inline' | 'hidden';
|
|
119
|
+
} & ({
|
|
120
|
+
supportsStartAndEndSlots?: false;
|
|
121
|
+
endSlot?: never;
|
|
122
|
+
endSlotPosition?: never;
|
|
123
|
+
} | {
|
|
124
|
+
supportsStartAndEndSlots: true;
|
|
125
|
+
endSlot?: React.ReactElement | string | number;
|
|
126
|
+
/**
|
|
127
|
+
* This is solely for `bordered` variants of TextField. When set to `bottom` (the default),
|
|
128
|
+
* the endSlot will be placed inline with the input field. When set to `fullHeight`, the endSlot
|
|
129
|
+
* will be placed to the side of both the input field and the label.
|
|
130
|
+
*/
|
|
131
|
+
endSlotPosition?: 'bottom' | 'fullHeight';
|
|
132
|
+
});
|
|
133
|
+
type FieldComponentProps<T extends HTMLElement> = Omit<BaseFieldProps, 'children' | 'className' | 'fieldRef' | 'variant'> & Omit<HtmlInputProps<T>, 'className' | 'style'>;
|
|
134
|
+
/**
|
|
135
|
+
* BaseField is a base component that provides a consistent structure for form fields.
|
|
136
|
+
*/
|
|
137
|
+
declare function BaseField({ variant, label, value, auxiliaryLabel, message, tone, className, children, maxWidth, maxLength, hidden, 'aria-describedby': originalAriaDescribedBy, id: originalId, characterCountPosition, endSlot, endSlotPosition, }: BaseFieldProps & BaseFieldVariantProps & WithEnhancedClassName): React.JSX.Element;
|
|
138
|
+
export { BaseField, FieldMessage };
|
|
139
|
+
export type { BaseFieldVariant, BaseFieldVariantProps, FieldComponentProps };
|