@wordpress/components 22.1.0 → 23.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/CONTRIBUTING.md +0 -21
- package/build/alignment-matrix-control/cell.js.map +1 -1
- package/build/alignment-matrix-control/icon.js +4 -2
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/index.js +25 -1
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +13 -13
- package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +16 -16
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build/alignment-matrix-control/types.js +6 -0
- package/build/alignment-matrix-control/types.js.map +1 -0
- package/build/alignment-matrix-control/utils.js +9 -8
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/angle-picker-control/styles/angle-picker-control-styles.js +9 -9
- package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build/autocomplete/index.js +39 -12
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/hooks.js +52 -0
- package/build/base-control/hooks.js.map +1 -0
- package/build/base-control/index.js +24 -7
- package/build/base-control/index.js.map +1 -1
- package/build/base-field/hook.js +0 -14
- package/build/base-field/hook.js.map +1 -1
- package/build/base-field/index.js.map +1 -1
- package/build/base-field/styles.js +5 -5
- package/build/base-field/styles.js.map +1 -1
- package/build/base-field/types.js +6 -0
- package/build/base-field/types.js.map +1 -0
- package/build/border-box-control/border-box-control/component.js +0 -3
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js +0 -2
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js +0 -2
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/hook.js +0 -2
- package/build/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
- package/build/border-control/border-control/component.js +1 -2
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js +0 -2
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +6 -11
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/hook.js +0 -2
- package/build/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build/border-control/styles.js +16 -16
- package/build/border-control/styles.js.map +1 -1
- package/build/box-control/linked-button.js +3 -4
- package/build/box-control/linked-button.js.map +1 -1
- package/build/color-palette/index.js +7 -15
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/input-with-slider.js +1 -0
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/color-picker/styles.js +8 -8
- package/build/color-picker/styles.js.map +1 -1
- package/build/custom-select-control/index.js +14 -2
- package/build/custom-select-control/index.js.map +1 -1
- package/build/dashicon/index.js +1 -4
- package/build/dashicon/index.js.map +1 -1
- package/build/date-time/date-time/index.js +4 -4
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/dimension-control/index.js.map +1 -1
- package/build/dropdown/index.js +45 -10
- package/build/dropdown/index.js.map +1 -1
- package/build/duotone-picker/duotone-picker.js +2 -2
- package/build/duotone-picker/duotone-picker.js.map +1 -1
- package/build/gradient-picker/index.js +4 -11
- package/build/gradient-picker/index.js.map +1 -1
- package/build/higher-order/navigate-regions/index.js +4 -3
- package/build/higher-order/navigate-regions/index.js.map +1 -1
- package/build/higher-order/with-fallback-styles/index.js +2 -2
- package/build/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build/index.js +13 -9
- package/build/index.js.map +1 -1
- package/build/input-control/index.js +17 -5
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js +2 -0
- package/build/input-control/input-base.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +1 -1
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/picker-cell.native.js +1 -9
- package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/switch-cell.native.js +1 -3
- package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build/mobile/global-styles-context/index.native.js +8 -8
- package/build/mobile/global-styles-context/index.native.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +30 -12
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.ios.js +4 -2
- package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build/modal/index.js +8 -0
- package/build/modal/index.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +12 -8
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/number-control/styles/number-control-styles.js +8 -8
- package/build/number-control/styles/number-control-styles.js.map +1 -1
- package/build/palette-edit/index.js +72 -33
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +10 -2
- package/build/popover/index.js.map +1 -1
- package/build/query-controls/index.js +1 -0
- package/build/query-controls/index.js.map +1 -1
- package/build/snackbar/index.js +35 -24
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js +14 -19
- package/build/snackbar/list.js.map +1 -1
- package/build/snackbar/types.js +6 -0
- package/build/snackbar/types.js.map +1 -0
- package/build/tab-panel/index.js +15 -9
- package/build/tab-panel/index.js.map +1 -1
- package/build/theme/color-algorithms.js +118 -0
- package/build/theme/color-algorithms.js.map +1 -0
- package/build/theme/index.js +21 -18
- package/build/theme/index.js.map +1 -1
- package/build/theme/styles.js +10 -7
- package/build/theme/styles.js.map +1 -1
- package/build/toggle-control/index.js +5 -2
- package/build/toggle-control/index.js.map +1 -1
- package/build/ui/context/context-system-provider.js +3 -1
- package/build/ui/context/context-system-provider.js.map +1 -1
- package/build/unit-control/index.js +5 -2
- package/build/unit-control/index.js.map +1 -1
- package/build/utils/colors-values.js +1 -1
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/config-values.js +0 -2
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/hooks/use-controlled-value.js.map +1 -1
- package/build-module/alignment-matrix-control/cell.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js +4 -2
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +23 -1
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +13 -13
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +16 -16
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build-module/alignment-matrix-control/types.js +2 -0
- package/build-module/alignment-matrix-control/types.js.map +1 -0
- package/build-module/alignment-matrix-control/utils.js +13 -8
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +9 -9
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build-module/autocomplete/index.js +39 -11
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/hooks.js +41 -0
- package/build-module/base-control/hooks.js.map +1 -0
- package/build-module/base-control/index.js +18 -8
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/base-field/hook.js +0 -14
- package/build-module/base-field/hook.js.map +1 -1
- package/build-module/base-field/index.js.map +1 -1
- package/build-module/base-field/styles.js +5 -5
- package/build-module/base-field/styles.js.map +1 -1
- package/build-module/base-field/types.js +2 -0
- package/build-module/base-field/types.js.map +1 -0
- package/build-module/border-box-control/border-box-control/component.js +0 -3
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control/hook.js +0 -2
- package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +0 -2
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/hook.js +0 -2
- package/build-module/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
- package/build-module/border-control/border-control/component.js +1 -2
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js +0 -2
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +6 -11
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/hook.js +0 -2
- package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build-module/border-control/styles.js +17 -17
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/box-control/linked-button.js +3 -4
- package/build-module/box-control/linked-button.js.map +1 -1
- package/build-module/color-palette/index.js +7 -15
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +1 -0
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/color-picker/styles.js +8 -8
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/custom-select-control/index.js +14 -2
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/dashicon/index.js +1 -4
- package/build-module/dashicon/index.js.map +1 -1
- package/build-module/date-time/date-time/index.js +4 -4
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/dimension-control/index.js +1 -2
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/dropdown/index.js +44 -10
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/duotone-picker/duotone-picker.js +2 -2
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/gradient-picker/index.js +4 -10
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/higher-order/navigate-regions/index.js +4 -3
- package/build-module/higher-order/navigate-regions/index.js.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.js +2 -2
- package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build-module/index.js +2 -3
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/index.js +16 -5
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +2 -0
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/picker-cell.native.js +1 -8
- package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/switch-cell.native.js +1 -2
- package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/index.native.js +8 -7
- package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +31 -13
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build-module/modal/index.js +8 -0
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +12 -8
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/number-control/styles/number-control-styles.js +8 -10
- package/build-module/number-control/styles/number-control-styles.js.map +1 -1
- package/build-module/palette-edit/index.js +73 -34
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/popover/index.js +10 -2
- package/build-module/popover/index.js.map +1 -1
- package/build-module/query-controls/index.js +1 -0
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/snackbar/index.js +33 -23
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +14 -22
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/snackbar/types.js +2 -0
- package/build-module/snackbar/types.js.map +1 -0
- package/build-module/tab-panel/index.js +15 -8
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/theme/color-algorithms.js +105 -0
- package/build-module/theme/color-algorithms.js.map +1 -0
- package/build-module/theme/index.js +21 -17
- package/build-module/theme/index.js.map +1 -1
- package/build-module/theme/styles.js +8 -6
- package/build-module/theme/styles.js.map +1 -1
- package/build-module/toggle-control/index.js +4 -2
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/ui/context/context-system-provider.js +3 -2
- package/build-module/ui/context/context-system-provider.js.map +1 -1
- package/build-module/unit-control/index.js +5 -2
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/utils/colors-values.js +1 -1
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/config-values.js +0 -2
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/hooks/use-controlled-value.js.map +1 -1
- package/build-style/style-rtl.css +108 -104
- package/build-style/style.css +108 -104
- package/build-types/alignment-matrix-control/cell.d.ts +5 -0
- package/build-types/alignment-matrix-control/cell.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/icon.d.ts +6 -0
- package/build-types/alignment-matrix-control/icon.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/index.d.ts +30 -0
- package/build-types/alignment-matrix-control/index.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/stories/index.d.ts +14 -0
- package/build-types/alignment-matrix-control/stories/index.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +19 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts +23 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/test/index.d.ts +2 -0
- package/build-types/alignment-matrix-control/test/index.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/types.d.ts +39 -0
- package/build-types/alignment-matrix-control/types.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/utils.d.ts +33 -0
- package/build-types/alignment-matrix-control/utils.d.ts.map +1 -0
- package/build-types/base-control/hooks.d.ts +23 -0
- package/build-types/base-control/hooks.d.ts.map +1 -0
- package/build-types/base-control/index.d.ts +17 -7
- package/build-types/base-control/index.d.ts.map +1 -1
- package/build-types/base-control/stories/index.d.ts.map +1 -1
- package/build-types/base-control/test/index.d.ts +2 -0
- package/build-types/base-control/test/index.d.ts.map +1 -0
- package/build-types/base-control/types.d.ts +8 -2
- package/build-types/base-control/types.d.ts.map +1 -1
- package/build-types/base-field/hook.d.ts +7 -31
- package/build-types/base-field/hook.d.ts.map +1 -1
- package/build-types/base-field/index.d.ts +1 -1
- package/build-types/base-field/index.d.ts.map +1 -1
- package/build-types/base-field/styles.d.ts +5 -5
- package/build-types/base-field/styles.d.ts.map +1 -1
- package/build-types/base-field/test/index.d.ts +2 -0
- package/build-types/base-field/test/index.d.ts.map +1 -0
- package/build-types/base-field/types.d.ts +29 -0
- package/build-types/base-field/types.d.ts.map +1 -0
- package/build-types/border-box-control/border-box-control/component.d.ts +1 -1
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +2 -3
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +2 -2
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +2 -3
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +2 -2
- package/build-types/border-box-control/stories/index.d.ts +1 -1
- package/build-types/border-control/border-control/component.d.ts +1 -1
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +2 -3
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +2 -3
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/hook.d.ts +2 -2
- package/build-types/border-control/stories/index.d.ts +6 -6
- package/build-types/border-control/stories/index.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +1 -1
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +2 -2
- package/build-types/card/card-body/hook.d.ts +2 -2
- package/build-types/card/card-divider/hook.d.ts +2 -2
- package/build-types/card/card-footer/hook.d.ts +2 -2
- package/build-types/card/card-header/hook.d.ts +2 -2
- package/build-types/card/card-media/hook.d.ts +2 -2
- package/build-types/color-palette/index.d.ts +3 -4
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.d.ts +6 -14
- package/build-types/color-palette/stories/index.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +1 -1
- package/build-types/color-palette/types.d.ts +4 -17
- package/build-types/color-palette/types.d.ts.map +1 -1
- package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +5 -5
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/dashicon/index.d.ts +6 -20
- package/build-types/dashicon/index.d.ts.map +1 -1
- package/build-types/dashicon/types.d.ts +14 -0
- package/build-types/dashicon/types.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +3 -3
- package/build-types/date-time/date-time/styles.d.ts +3 -3
- package/build-types/date-time/time/styles.d.ts +8 -8
- package/build-types/disabled/stories/index.d.ts.map +1 -1
- package/build-types/dropdown/index.d.ts +29 -1
- package/build-types/dropdown/index.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.d.ts +23 -0
- package/build-types/dropdown/stories/index.d.ts.map +1 -0
- package/build-types/dropdown/test/index.d.ts +2 -0
- package/build-types/dropdown/test/index.d.ts.map +1 -0
- package/build-types/dropdown/types.d.ts +101 -0
- package/build-types/dropdown/types.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +2 -2
- package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
- package/build-types/flex/flex/hook.d.ts +2 -2
- package/build-types/flex/flex-block/hook.d.ts +2 -2
- package/build-types/flex/flex-item/hook.d.ts +2 -2
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -5
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +2 -2
- package/build-types/h-stack/component.d.ts +1 -1
- package/build-types/h-stack/hook.d.ts +2 -2
- package/build-types/heading/hook.d.ts +2 -2
- package/build-types/icon/stories/index.d.ts +22 -0
- package/build-types/icon/stories/index.d.ts.map +1 -0
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/stories/index.d.ts +1 -0
- package/build-types/input-control/stories/index.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +2 -1
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +2 -2
- package/build-types/item-group/item-group/hook.d.ts +2 -2
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/modal/stories/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +3 -3
- package/build-types/navigator/navigator-button/hook.d.ts +3 -3
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +2 -2
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.d.ts +25 -0
- package/build-types/number-control/stories/index.d.ts.map +1 -0
- package/build-types/number-control/styles/number-control-styles.d.ts +6 -6
- package/build-types/number-control/styles/number-control-styles.d.ts.map +1 -1
- package/build-types/number-control/test/index.d.ts +2 -0
- package/build-types/number-control/test/index.d.ts.map +1 -0
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.d.ts +1 -1
- package/build-types/range-control/index.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +2 -2
- package/build-types/resizable-box/resize-tooltip/index.d.ts +15 -19
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts +4 -3
- package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +2 -2
- package/build-types/search-control/index.d.ts +1 -1
- package/build-types/search-control/stories/index.d.ts +2 -2
- package/build-types/snackbar/index.d.ts +19 -0
- package/build-types/snackbar/index.d.ts.map +1 -0
- package/build-types/snackbar/list.d.ts +18 -0
- package/build-types/snackbar/list.d.ts.map +1 -0
- package/build-types/snackbar/stories/index.d.ts +16 -0
- package/build-types/snackbar/stories/index.d.ts.map +1 -0
- package/build-types/snackbar/stories/list.d.ts +12 -0
- package/build-types/snackbar/stories/list.d.ts.map +1 -0
- package/build-types/snackbar/types.d.ts +111 -0
- package/build-types/snackbar/types.d.ts.map +1 -0
- package/build-types/spacer/hook.d.ts +2 -2
- package/build-types/spinner/index.d.ts +1 -1
- package/build-types/surface/hook.d.ts +2 -2
- package/build-types/tab-panel/index.d.ts +1 -1
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/tab-panel/types.d.ts +19 -1
- package/build-types/tab-panel/types.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +2 -2
- package/build-types/text-control/index.d.ts +2 -2
- package/build-types/text-control/stories/index.d.ts.map +1 -1
- package/build-types/text-control/types.d.ts +1 -5
- package/build-types/text-control/types.d.ts.map +1 -1
- package/build-types/theme/color-algorithms.d.ts +20 -0
- package/build-types/theme/color-algorithms.d.ts.map +1 -0
- package/build-types/theme/index.d.ts +1 -1
- package/build-types/theme/index.d.ts.map +1 -1
- package/build-types/theme/stories/index.d.ts +4 -0
- package/build-types/theme/stories/index.d.ts.map +1 -1
- package/build-types/theme/styles.d.ts +3 -2
- package/build-types/theme/styles.d.ts.map +1 -1
- package/build-types/theme/test/color-algorithms.d.ts +2 -0
- package/build-types/theme/test/color-algorithms.d.ts.map +1 -0
- package/build-types/theme/types.d.ts +41 -3
- package/build-types/theme/types.d.ts.map +1 -1
- package/build-types/toggle-control/index.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +2 -2
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +2 -2
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +2 -2
- package/build-types/truncate/hook.d.ts +2 -2
- package/build-types/ui/context/context-system-provider.d.ts.map +1 -1
- package/build-types/ui/control-group/hook.d.ts +2 -2
- package/build-types/ui/control-label/hook.d.ts +2 -2
- package/build-types/ui/form-group/form-group.d.ts +2 -2
- package/build-types/ui/form-group/use-form-group.d.ts +5 -5
- package/build-types/unit-control/index.d.ts +2 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -2
- package/build-types/unit-control/types.d.ts +4 -0
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +0 -2
- package/build-types/utils/hooks/use-controlled-value.d.ts +2 -1
- package/build-types/utils/hooks/use-controlled-value.d.ts.map +1 -1
- package/build-types/v-stack/component.d.ts +2 -2
- package/build-types/v-stack/hook.d.ts +2 -2
- package/build-types/v-stack/stories/index.d.ts +2 -2
- package/package.json +21 -20
- package/src/alignment-matrix-control/README.md +7 -7
- package/src/alignment-matrix-control/{cell.js → cell.tsx} +7 -1
- package/src/alignment-matrix-control/{icon.js → icon.tsx} +6 -3
- package/src/alignment-matrix-control/{index.js → index.tsx} +31 -4
- package/src/alignment-matrix-control/stories/{index.js → index.tsx} +17 -9
- package/src/alignment-matrix-control/styles/{alignment-matrix-control-icon-styles.js → alignment-matrix-control-icon-styles.ts} +11 -3
- package/src/alignment-matrix-control/styles/{alignment-matrix-control-styles.js → alignment-matrix-control-styles.ts} +13 -3
- package/src/alignment-matrix-control/test/{index.js → index.tsx} +5 -5
- package/src/alignment-matrix-control/types.ts +54 -0
- package/src/alignment-matrix-control/{utils.js → utils.tsx} +24 -14
- package/src/angle-picker-control/styles/angle-picker-control-styles.js +4 -0
- package/src/autocomplete/index.js +44 -15
- package/src/autocomplete/test/index.js +2 -0
- package/src/base-control/README.md +21 -12
- package/src/base-control/hooks.ts +45 -0
- package/src/base-control/index.tsx +18 -7
- package/src/base-control/stories/index.tsx +8 -10
- package/src/base-control/test/index.tsx +53 -0
- package/src/base-control/types.ts +8 -2
- package/src/base-field/README.md +21 -22
- package/src/base-field/{hook.js → hook.ts} +5 -15
- package/src/base-field/{index.js → index.ts} +0 -0
- package/src/base-field/{styles.js → styles.ts} +2 -2
- package/src/base-field/test/__snapshots__/{index.js.snap → index.tsx.snap} +4 -4
- package/src/base-field/test/{index.js → index.tsx} +10 -5
- package/src/base-field/types.ts +29 -0
- package/src/border-box-control/border-box-control/README.md +1 -0
- package/src/border-box-control/border-box-control/component.tsx +0 -7
- package/src/border-box-control/border-box-control/hook.ts +0 -2
- package/src/border-box-control/border-box-control-split-controls/component.tsx +0 -2
- package/src/border-box-control/border-box-control-split-controls/hook.ts +0 -2
- package/src/border-box-control/test/index.js +5 -1
- package/src/border-control/border-control/component.tsx +1 -4
- package/src/border-control/border-control/hook.ts +0 -2
- package/src/border-control/border-control-dropdown/component.tsx +11 -17
- package/src/border-control/border-control-dropdown/hook.ts +0 -2
- package/src/border-control/stories/index.tsx +0 -1
- package/src/border-control/styles.ts +1 -10
- package/src/border-control/test/index.js +70 -67
- package/src/border-control/types.ts +1 -4
- package/src/box-control/linked-button.js +8 -11
- package/src/box-control/test/index.js +207 -134
- package/src/button/stories/index.js +30 -0
- package/src/button/style.scss +17 -14
- package/src/button/test/index.js +32 -15
- package/src/card/test/index.tsx +32 -20
- package/src/checkbox-control/test/index.tsx +2 -0
- package/src/circular-option-picker/style.scss +1 -0
- package/src/color-palette/index.tsx +16 -18
- package/src/color-palette/stories/index.tsx +1 -18
- package/src/color-palette/test/__snapshots__/index.tsx.snap +4 -4
- package/src/color-palette/test/index.tsx +86 -36
- package/src/color-palette/types.ts +4 -18
- package/src/color-picker/README.md +1 -0
- package/src/color-picker/input-with-slider.tsx +1 -0
- package/src/color-picker/styles.ts +0 -4
- package/src/color-picker/test/index.js +2 -0
- package/src/combobox-control/test/index.js +2 -0
- package/src/confirm-dialog/README.md +3 -2
- package/src/confirm-dialog/test/index.js +2 -0
- package/src/custom-select-control/README.md +14 -0
- package/src/custom-select-control/index.js +14 -2
- package/src/dashicon/{index.js → index.tsx} +10 -4
- package/src/dashicon/types.ts +17 -0
- package/src/date-time/date/test/index.tsx +2 -0
- package/src/date-time/date-time/index.tsx +2 -2
- package/src/date-time/time/test/index.tsx +2 -0
- package/src/dimension-control/index.js +2 -3
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -8
- package/src/dimension-control/test/index.test.js +2 -0
- package/src/disabled/stories/index.tsx +6 -2
- package/src/disabled/test/index.tsx +23 -11
- package/src/dropdown/README.md +41 -46
- package/src/dropdown/{index.js → index.tsx} +57 -13
- package/src/dropdown/stories/{index.js → index.tsx} +21 -8
- package/src/dropdown/test/index.tsx +88 -0
- package/src/dropdown/types.ts +107 -0
- package/src/dropdown-menu/README.md +2 -3
- package/src/dropdown-menu/test/index.js +20 -12
- package/src/duotone-picker/duotone-picker.js +2 -2
- package/src/external-link/test/index.tsx +2 -0
- package/src/focal-point-picker/test/index.js +2 -0
- package/src/focal-point-picker/test/media.js +26 -21
- package/src/font-size-picker/test/index.tsx +2 -0
- package/src/form-file-upload/test/index.tsx +2 -0
- package/src/form-toggle/test/index.tsx +2 -0
- package/src/form-token-field/style.scss +1 -1
- package/src/form-token-field/test/index.tsx +3 -0
- package/src/gradient-picker/index.js +6 -10
- package/src/gradient-picker/stories/index.js +0 -1
- package/src/grid/test/grid.tsx +31 -31
- package/src/guide/test/index.js +2 -0
- package/src/higher-order/navigate-regions/index.js +5 -2
- package/src/higher-order/navigate-regions/style.scss +13 -59
- package/src/higher-order/with-fallback-styles/index.js +4 -2
- package/src/higher-order/with-filters/test/index.js +32 -43
- package/src/higher-order/with-focus-outside/test/index.js +2 -0
- package/src/higher-order/with-focus-return/test/index.js +3 -4
- package/src/higher-order/with-notices/test/index.js +1 -0
- package/src/icon/stories/index.tsx +103 -0
- package/src/index.js +2 -3
- package/src/input-control/index.tsx +42 -28
- package/src/input-control/input-base.tsx +8 -1
- package/src/input-control/stories/index.tsx +6 -0
- package/src/input-control/test/index.js +21 -0
- package/src/input-control/types.ts +2 -0
- package/src/isolated-event-container/test/index.js +2 -0
- package/src/mobile/bottom-sheet/cell.native.js +1 -1
- package/src/mobile/bottom-sheet/picker-cell.native.js +1 -6
- package/src/mobile/bottom-sheet/switch-cell.native.js +2 -2
- package/src/mobile/global-styles-context/index.native.js +9 -11
- package/src/mobile/global-styles-context/utils.native.js +17 -16
- package/src/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
- package/src/mobile/link-settings/test/edit.native.js +68 -124
- package/src/modal/index.tsx +11 -0
- package/src/modal/stories/index.tsx +3 -0
- package/src/modal/test/index.tsx +13 -0
- package/src/navigable-container/test/navigable-menu.js +2 -0
- package/src/navigable-container/test/tababble-container.js +2 -0
- package/src/navigation/stories/index.js +6 -6
- package/src/navigation/stories/{controlled-state.js → utils/controlled-state.js} +3 -3
- package/src/navigation/stories/{default.js → utils/default.js} +3 -3
- package/src/navigation/stories/{group.js → utils/group.js} +4 -4
- package/src/navigation/stories/{hide-if-empty.js → utils/hide-if-empty.js} +3 -3
- package/src/navigation/stories/{more-examples.js → utils/more-examples.js} +4 -4
- package/src/navigation/stories/{search.js → utils/search.js} +5 -5
- package/src/navigation/test/index.js +2 -0
- package/src/navigator/navigator-provider/component.tsx +13 -10
- package/src/navigator/test/index.tsx +2 -0
- package/src/notice/test/index.js +8 -3
- package/src/notice/test/list.js +8 -5
- package/src/number-control/stories/{index.js → index.tsx} +24 -7
- package/src/number-control/styles/{number-control-styles.js → number-control-styles.ts} +5 -3
- package/src/number-control/test/index.tsx +602 -0
- package/src/palette-edit/index.js +88 -39
- package/src/palette-edit/test/index.js +25 -1
- package/src/panel/test/__snapshots__/body.js.snap +9 -0
- package/src/panel/test/body.js +71 -62
- package/src/placeholder/test/index.tsx +3 -0
- package/src/popover/index.tsx +10 -2
- package/src/popover/style.scss +12 -11
- package/src/popover/test/index.tsx +25 -15
- package/src/query-controls/index.js +1 -0
- package/src/range-control/test/index.tsx +57 -60
- package/src/resizable-box/style.scss +1 -0
- package/src/sandbox/test/index.js +13 -11
- package/src/search-control/style.scss +4 -0
- package/src/select-control/test/select-control.tsx +2 -0
- package/src/snackbar/README.md +63 -8
- package/src/snackbar/{index.js → index.tsx} +46 -28
- package/src/snackbar/{list.js → list.tsx} +20 -21
- package/src/snackbar/stories/index.tsx +96 -0
- package/src/snackbar/stories/list.tsx +98 -0
- package/src/snackbar/types.ts +116 -0
- package/src/tab-panel/README.md +9 -0
- package/src/tab-panel/index.tsx +15 -5
- package/src/tab-panel/style.scss +46 -34
- package/src/tab-panel/test/index.tsx +113 -0
- package/src/tab-panel/types.ts +20 -1
- package/src/text/test/__snapshots__/index.tsx.snap +1 -0
- package/src/text/test/index.tsx +98 -46
- package/src/text-control/stories/index.tsx +0 -1
- package/src/text-control/types.ts +1 -6
- package/src/text-highlight/test/index.tsx +1 -0
- package/src/theme/README.md +32 -2
- package/src/theme/color-algorithms.ts +138 -0
- package/src/theme/index.tsx +23 -16
- package/src/theme/stories/index.tsx +67 -0
- package/src/theme/styles.ts +22 -17
- package/src/theme/test/color-algorithms.ts +100 -0
- package/src/theme/test/index.tsx +68 -35
- package/src/theme/types.ts +43 -3
- package/src/toggle-control/index.tsx +4 -2
- package/src/toggle-group-control/test/index.tsx +15 -2
- package/src/toolbar/style.scss +1 -1
- package/src/toolbar-group/test/index.js +10 -6
- package/src/tools-panel/stories/index.js +1 -1
- package/src/tools-panel/stories/{tools-panel-with-item-group-slot.js → utils/tools-panel-with-item-group-slot.js} +14 -11
- package/src/tools-panel/test/index.js +20 -14
- package/src/tooltip/README.md +7 -0
- package/src/tooltip/stories/index.js +68 -78
- package/src/tooltip/style.scss +2 -2
- package/src/tooltip/test/index.js +111 -18
- package/src/ui/context/context-system-provider.js +3 -2
- package/src/ui/context/test/context-system-provider.js +5 -4
- package/src/ui/control-label/test/index.js +3 -5
- package/src/unit-control/README.md +9 -1
- package/src/unit-control/index.tsx +3 -0
- package/src/unit-control/test/index.tsx +4 -0
- package/src/unit-control/types.ts +4 -0
- package/src/utils/colors-values.js +1 -1
- package/src/utils/config-values.js +0 -2
- package/src/utils/hooks/test/use-latest-ref.js +2 -0
- package/src/utils/hooks/use-controlled-value.ts +2 -2
- package/src/utils/theme-variables.scss +20 -0
- package/tsconfig.json +2 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/src/dropdown/test/index.js +0 -98
- package/src/icon/stories/index.js +0 -128
- package/src/number-control/test/index.js +0 -478
- package/src/snackbar/stories/index.js +0 -89
package/src/theme/styles.ts
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { colord } from 'colord';
|
|
5
4
|
import styled from '@emotion/styled';
|
|
6
5
|
import { css } from '@emotion/react';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* Internal dependencies
|
|
10
9
|
*/
|
|
11
|
-
import type {
|
|
10
|
+
import type { ThemeOutputValues } from './types';
|
|
12
11
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
--wp-components-color-accent-darker-10: ${ colord( accent )
|
|
18
|
-
.darken( 0.1 )
|
|
19
|
-
.toHex() };
|
|
20
|
-
--wp-components-color-accent-darker-20: ${ colord( accent )
|
|
21
|
-
.darken( 0.2 )
|
|
22
|
-
.toHex() };
|
|
23
|
-
`
|
|
24
|
-
: undefined;
|
|
12
|
+
export const colorVariables = ( { colors }: ThemeOutputValues ) => {
|
|
13
|
+
const shades = Object.entries( colors.gray || {} )
|
|
14
|
+
.map( ( [ k, v ] ) => `--wp-components-color-gray-${ k }: ${ v };` )
|
|
15
|
+
.join( '' );
|
|
25
16
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
return [
|
|
18
|
+
css`
|
|
19
|
+
--wp-components-color-accent: ${ colors.accent };
|
|
20
|
+
--wp-components-color-accent-darker-10: ${ colors.accentDarker10 };
|
|
21
|
+
--wp-components-color-accent-darker-20: ${ colors.accentDarker20 };
|
|
22
|
+
--wp-components-color-accent-inverted: ${ colors.accentInverted };
|
|
23
|
+
|
|
24
|
+
--wp-components-color-background: ${ colors.background };
|
|
25
|
+
--wp-components-color-foreground: ${ colors.foreground };
|
|
26
|
+
--wp-components-color-foreground-inverted: ${ colors.foregroundInverted };
|
|
27
|
+
|
|
28
|
+
${ shades }
|
|
29
|
+
`,
|
|
30
|
+
];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Wrapper = styled.div``;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { colord } from 'colord';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { COLORS } from '../../utils';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import { generateShades, generateThemeVariables } from '../color-algorithms';
|
|
15
|
+
|
|
16
|
+
describe( 'Theme color algorithms', () => {
|
|
17
|
+
describe( 'generateThemeVariables', () => {
|
|
18
|
+
it( 'should allow explicitly undefined values', () => {
|
|
19
|
+
generateThemeVariables( {
|
|
20
|
+
accent: undefined,
|
|
21
|
+
background: undefined,
|
|
22
|
+
} );
|
|
23
|
+
expect( console ).not.toHaveWarned();
|
|
24
|
+
} );
|
|
25
|
+
|
|
26
|
+
it( 'should warn if invalid colors are passed', () => {
|
|
27
|
+
generateThemeVariables( { accent: 'var(--invalid)' } );
|
|
28
|
+
expect( console ).toHaveWarned();
|
|
29
|
+
} );
|
|
30
|
+
|
|
31
|
+
it( 'should warn if standard foreground colors are not readable against background', () => {
|
|
32
|
+
generateThemeVariables( { background: '#777' } );
|
|
33
|
+
expect( console ).toHaveWarnedWith(
|
|
34
|
+
'wp.components.Theme: The background color provided ("#777") does not have sufficient contrast against the standard foreground colors.'
|
|
35
|
+
);
|
|
36
|
+
} );
|
|
37
|
+
|
|
38
|
+
it( 'should warn if accent color is not readable against background', () => {
|
|
39
|
+
generateThemeVariables( { background: '#fefefe' } );
|
|
40
|
+
expect( console ).not.toHaveWarned();
|
|
41
|
+
|
|
42
|
+
generateThemeVariables( {
|
|
43
|
+
accent: '#000',
|
|
44
|
+
background: '#fff',
|
|
45
|
+
} );
|
|
46
|
+
expect( console ).not.toHaveWarned();
|
|
47
|
+
|
|
48
|
+
generateThemeVariables( {
|
|
49
|
+
accent: '#111',
|
|
50
|
+
background: '#000',
|
|
51
|
+
} );
|
|
52
|
+
expect( console ).toHaveWarnedWith(
|
|
53
|
+
'wp.components.Theme: The background color ("#000") does not have sufficient contrast against the accent color ("#111").'
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
generateThemeVariables( { background: '#eee' } );
|
|
57
|
+
expect( console ).toHaveWarnedWith(
|
|
58
|
+
'wp.components.Theme: The background color ("#eee") does not have sufficient contrast against the accent color ("#007cba").'
|
|
59
|
+
);
|
|
60
|
+
} );
|
|
61
|
+
|
|
62
|
+
it( 'should warn if a readable grayscale cannot be generated', () => {
|
|
63
|
+
generateThemeVariables( { background: '#ddd' } );
|
|
64
|
+
expect( console ).toHaveWarnedWith(
|
|
65
|
+
'wp.components.Theme: The background color provided ("#ddd") cannot generate a set of grayscale foreground colors with sufficient contrast. Try adjusting the color to be lighter or darker.'
|
|
66
|
+
);
|
|
67
|
+
} );
|
|
68
|
+
} );
|
|
69
|
+
|
|
70
|
+
describe( 'generateShades', () => {
|
|
71
|
+
it( 'should generate the default WP shades when the default WP background/foreground colors are given', () => {
|
|
72
|
+
const shades = generateShades( '#fff', '#1e1e1e' );
|
|
73
|
+
|
|
74
|
+
Object.entries( shades ).forEach( ( [ k, color ] ) => {
|
|
75
|
+
const key = parseInt( k, 10 ) as keyof typeof shades;
|
|
76
|
+
const normalizedExpectedColor = colord(
|
|
77
|
+
COLORS.gray[ key ]
|
|
78
|
+
).toHex();
|
|
79
|
+
|
|
80
|
+
expect( color ).toBe( normalizedExpectedColor );
|
|
81
|
+
} );
|
|
82
|
+
} );
|
|
83
|
+
|
|
84
|
+
it.each( [
|
|
85
|
+
[ '#000', '#fff' ], // wide delta
|
|
86
|
+
[ '#fff', '#000' ], // flipped
|
|
87
|
+
[ '#eee', '#fff' ], // narrow delta
|
|
88
|
+
] )( 'should generate unique shades (bg: %s, fg: %s)', ( bg, fg ) => {
|
|
89
|
+
const shades = generateShades( bg, fg );
|
|
90
|
+
|
|
91
|
+
// The darkest and lightest shades should be different from the fg/bg colors
|
|
92
|
+
expect( colord( shades[ 100 ] ).isEqual( bg ) ).toBe( false );
|
|
93
|
+
expect( colord( shades[ 800 ] ).isEqual( fg ) ).toBe( false );
|
|
94
|
+
|
|
95
|
+
// The shades should be unique
|
|
96
|
+
const shadeValues = Object.values( shades );
|
|
97
|
+
expect( shadeValues ).toHaveLength( new Set( shadeValues ).size );
|
|
98
|
+
} );
|
|
99
|
+
} );
|
|
100
|
+
} );
|
package/src/theme/test/index.tsx
CHANGED
|
@@ -28,59 +28,93 @@ describe( 'Theme', () => {
|
|
|
28
28
|
describe( 'accent color', () => {
|
|
29
29
|
it( 'it does not define the accent color (and its variations) as a CSS variable when the `accent` prop is undefined', () => {
|
|
30
30
|
render(
|
|
31
|
-
<Theme>
|
|
31
|
+
<Theme data-testid="theme">
|
|
32
32
|
<MyThemableComponent>Inner</MyThemableComponent>
|
|
33
33
|
</Theme>
|
|
34
34
|
);
|
|
35
35
|
|
|
36
|
-
const inner = screen.getByText( 'Inner' );
|
|
37
|
-
|
|
38
|
-
if ( inner?.parentElement === null ) {
|
|
39
|
-
throw new Error(
|
|
40
|
-
'Somehow the `Theme` component does not render a DOM element?'
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
36
|
const innerElementStyles = window.getComputedStyle(
|
|
45
|
-
|
|
37
|
+
screen.getByTestId( 'theme' )
|
|
46
38
|
);
|
|
47
39
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
).toBe( '' );
|
|
59
|
-
|
|
60
|
-
expect(
|
|
61
|
-
innerElementStyles.getPropertyValue(
|
|
62
|
-
'--wp-components-color-accent-darker-20'
|
|
63
|
-
)
|
|
64
|
-
).toBe( '' );
|
|
40
|
+
[
|
|
41
|
+
'--wp-components-color-accent',
|
|
42
|
+
'--wp-components-color-accent-darker-10',
|
|
43
|
+
'--wp-components-color-accent-darker-20',
|
|
44
|
+
'--wp-components-color-accent-inverted',
|
|
45
|
+
].forEach( ( cssVariable ) => {
|
|
46
|
+
expect(
|
|
47
|
+
innerElementStyles.getPropertyValue( cssVariable )
|
|
48
|
+
).toBe( '' );
|
|
49
|
+
} );
|
|
65
50
|
} );
|
|
66
51
|
|
|
67
52
|
it( 'it defines the accent color (and its variations) as a CSS variable', () => {
|
|
68
53
|
render(
|
|
69
|
-
<Theme accent="#123abc">
|
|
54
|
+
<Theme accent="#123abc" data-testid="theme">
|
|
70
55
|
<MyThemableComponent>Inner</MyThemableComponent>
|
|
71
56
|
</Theme>
|
|
72
57
|
);
|
|
73
58
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
expect( inner?.parentElement ).toHaveStyle( {
|
|
59
|
+
expect( screen.getByTestId( 'theme' ) ).toHaveStyle( {
|
|
77
60
|
'--wp-components-color-accent': '#123abc',
|
|
78
61
|
'--wp-components-color-accent-darker-10': '#0e2c8d',
|
|
79
62
|
'--wp-components-color-accent-darker-20': '#091d5f',
|
|
63
|
+
'--wp-components-color-accent-inverted': '#fff',
|
|
64
|
+
} );
|
|
65
|
+
} );
|
|
66
|
+
} );
|
|
67
|
+
|
|
68
|
+
describe( 'background color', () => {
|
|
69
|
+
it( 'it does not define the background color (and its dependent colors) as a CSS variable when the `background` prop is undefined', () => {
|
|
70
|
+
render(
|
|
71
|
+
<Theme data-testid="theme">
|
|
72
|
+
<MyThemableComponent>Inner</MyThemableComponent>
|
|
73
|
+
</Theme>
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const innerElementStyles = window.getComputedStyle(
|
|
77
|
+
screen.getByTestId( 'theme' )
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
[
|
|
81
|
+
'--wp-components-color-background',
|
|
82
|
+
'--wp-components-color-foreground',
|
|
83
|
+
'--wp-components-color-foreground-inverted',
|
|
84
|
+
...[ '100', '200', '300', '400', '600', '700', '800' ].map(
|
|
85
|
+
( shade ) => `--wp-components-color-gray-${ shade }`
|
|
86
|
+
),
|
|
87
|
+
].forEach( ( cssVariable ) => {
|
|
88
|
+
expect(
|
|
89
|
+
innerElementStyles.getPropertyValue( cssVariable )
|
|
90
|
+
).toBe( '' );
|
|
91
|
+
} );
|
|
92
|
+
} );
|
|
93
|
+
|
|
94
|
+
it( 'it defines the background color (and its dependent colors) as a CSS variable', () => {
|
|
95
|
+
render(
|
|
96
|
+
<Theme background="#ffffff" data-testid="theme">
|
|
97
|
+
<MyThemableComponent>Inner</MyThemableComponent>
|
|
98
|
+
</Theme>
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
expect( screen.getByTestId( 'theme' ) ).toHaveStyle( {
|
|
102
|
+
'--wp-components-color-background': '#ffffff',
|
|
103
|
+
'--wp-components-color-foreground': '#1e1e1e',
|
|
104
|
+
'--wp-components-color-foreground-inverted': '#fff',
|
|
105
|
+
'--wp-components-color-gray-100': '#f0f0f0',
|
|
106
|
+
'--wp-components-color-gray-200': '#e0e0e0',
|
|
107
|
+
'--wp-components-color-gray-300': '#dddddd',
|
|
108
|
+
'--wp-components-color-gray-400': '#cccccc',
|
|
109
|
+
'--wp-components-color-gray-600': '#949494',
|
|
110
|
+
'--wp-components-color-gray-700': '#757575',
|
|
111
|
+
'--wp-components-color-gray-800': '#2f2f2f',
|
|
80
112
|
} );
|
|
81
113
|
} );
|
|
114
|
+
} );
|
|
82
115
|
|
|
83
|
-
|
|
116
|
+
describe( 'unsupported values', () => {
|
|
117
|
+
describe.each( [ 'accent', 'background' ] )( '%s', ( propName ) => {
|
|
84
118
|
it.each( [
|
|
85
119
|
// Keywords
|
|
86
120
|
'currentcolor',
|
|
@@ -91,9 +125,8 @@ describe( 'Theme', () => {
|
|
|
91
125
|
'unset',
|
|
92
126
|
// CSS Custom properties
|
|
93
127
|
'var( --my-variable )',
|
|
94
|
-
] )( 'should warn when the value is "%s"', (
|
|
95
|
-
render( <Theme
|
|
96
|
-
|
|
128
|
+
] )( 'should warn when the value is "%s"', ( value ) => {
|
|
129
|
+
render( <Theme { ...{ [ propName ]: value } } /> );
|
|
97
130
|
expect( console ).toHaveWarned();
|
|
98
131
|
} );
|
|
99
132
|
} );
|
package/src/theme/types.ts
CHANGED
|
@@ -3,17 +3,57 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { ReactNode } from 'react';
|
|
5
5
|
|
|
6
|
-
export type
|
|
6
|
+
export type ThemeInputValues = {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* The accent color (used by components as the primary color).
|
|
9
9
|
*
|
|
10
10
|
* If an accent color is not defined, the default fallback value is the original
|
|
11
|
-
* WP Admin main theme color.
|
|
11
|
+
* WP Admin main theme color. Not all valid CSS color syntaxes are supported —
|
|
12
12
|
* in particular, keywords (like `'currentcolor'`, `'inherit'`, `'initial'`,
|
|
13
13
|
* `'revert'`, `'unset'`...) and CSS custom properties (e.g.
|
|
14
14
|
* `var(--my-custom-property)`) are _not_ supported values for this property.
|
|
15
15
|
*/
|
|
16
16
|
accent?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The background color.
|
|
19
|
+
*
|
|
20
|
+
* If a component explicitly has a background, it will be this color.
|
|
21
|
+
* Otherwise, this color will simply be used to determine what the foreground colors should be.
|
|
22
|
+
* The actual background color will need to be set on the component's container element.
|
|
23
|
+
*
|
|
24
|
+
* If a background color is not defined, the default fallback value is #fff.
|
|
25
|
+
* Not all valid CSS color syntaxes are supported —
|
|
26
|
+
* in particular, keywords (like `'currentcolor'`, `'inherit'`, `'initial'`,
|
|
27
|
+
* `'revert'`, `'unset'`...) and CSS custom properties (e.g.
|
|
28
|
+
* `var(--my-custom-property)`) are _not_ supported values for this property.
|
|
29
|
+
*/
|
|
30
|
+
background?: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type ThemeOutputValues = {
|
|
34
|
+
colors: Partial< {
|
|
35
|
+
accent: string;
|
|
36
|
+
accentDarker10: string;
|
|
37
|
+
accentDarker20: string;
|
|
38
|
+
/** Foreground color to use when accent color is the background. */
|
|
39
|
+
accentInverted: string;
|
|
40
|
+
background: string;
|
|
41
|
+
foreground: string;
|
|
42
|
+
/** Foreground color to use when foreground color is the background. */
|
|
43
|
+
foregroundInverted: string;
|
|
44
|
+
gray: {
|
|
45
|
+
100: string;
|
|
46
|
+
200: string;
|
|
47
|
+
300: string;
|
|
48
|
+
400: string;
|
|
49
|
+
600: string;
|
|
50
|
+
700: string;
|
|
51
|
+
800: string;
|
|
52
|
+
};
|
|
53
|
+
} >;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type ThemeProps = ThemeInputValues & {
|
|
17
57
|
/**
|
|
18
58
|
* The children elements.
|
|
19
59
|
*/
|
|
@@ -12,6 +12,7 @@ import { useInstanceId } from '@wordpress/compose';
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
+
import { FlexBlock } from '../flex';
|
|
15
16
|
import FormToggle from '../form-toggle';
|
|
16
17
|
import BaseControl from '../base-control';
|
|
17
18
|
import type { WordPressComponentProps } from '../ui/context/wordpress-component';
|
|
@@ -94,12 +95,13 @@ export function ToggleControl( {
|
|
|
94
95
|
aria-describedby={ describedBy }
|
|
95
96
|
disabled={ disabled }
|
|
96
97
|
/>
|
|
97
|
-
<
|
|
98
|
+
<FlexBlock
|
|
99
|
+
as="label"
|
|
98
100
|
htmlFor={ id }
|
|
99
101
|
className="components-toggle-control__label"
|
|
100
102
|
>
|
|
101
103
|
{ label }
|
|
102
|
-
</
|
|
104
|
+
</FlexBlock>
|
|
103
105
|
</HStack>
|
|
104
106
|
</BaseControl>
|
|
105
107
|
);
|
|
@@ -18,6 +18,12 @@ import {
|
|
|
18
18
|
ToggleGroupControlOptionIcon,
|
|
19
19
|
} from '../index';
|
|
20
20
|
|
|
21
|
+
jest.useFakeTimers();
|
|
22
|
+
|
|
23
|
+
function getWrappingPopoverElement( element: HTMLElement ) {
|
|
24
|
+
return element.closest( '.components-popover' );
|
|
25
|
+
}
|
|
26
|
+
|
|
21
27
|
describe( 'ToggleGroupControl', () => {
|
|
22
28
|
const options = (
|
|
23
29
|
<>
|
|
@@ -51,6 +57,7 @@ describe( 'ToggleGroupControl', () => {
|
|
|
51
57
|
|
|
52
58
|
expect( container ).toMatchSnapshot();
|
|
53
59
|
} );
|
|
60
|
+
|
|
54
61
|
it( 'with icons', () => {
|
|
55
62
|
const { container } = render(
|
|
56
63
|
<ToggleGroupControl
|
|
@@ -110,11 +117,17 @@ describe( 'ToggleGroupControl', () => {
|
|
|
110
117
|
|
|
111
118
|
await user.hover( firstRadio );
|
|
112
119
|
|
|
120
|
+
const tooltip = await screen.findByText(
|
|
121
|
+
'Click for Delicious Gnocchi'
|
|
122
|
+
);
|
|
123
|
+
|
|
113
124
|
await waitFor( () =>
|
|
114
125
|
expect(
|
|
115
|
-
|
|
116
|
-
).
|
|
126
|
+
getWrappingPopoverElement( tooltip )
|
|
127
|
+
).toBePositionedPopover()
|
|
117
128
|
);
|
|
129
|
+
|
|
130
|
+
expect( tooltip ).toBeVisible();
|
|
118
131
|
} );
|
|
119
132
|
|
|
120
133
|
it( 'should not render tooltip', async () => {
|
package/src/toolbar/style.scss
CHANGED
|
@@ -76,15 +76,19 @@ describe( 'ToolbarGroup', () => {
|
|
|
76
76
|
],
|
|
77
77
|
];
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
<ToolbarGroup controls={ controls } />
|
|
81
|
-
);
|
|
79
|
+
render( <ToolbarGroup controls={ controls } /> );
|
|
82
80
|
|
|
83
81
|
const buttons = screen.getAllByRole( 'button' );
|
|
82
|
+
|
|
84
83
|
expect( buttons ).toHaveLength( 2 );
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
// eslint-disable-next-line testing-library/no-node-access
|
|
85
|
+
expect( buttons[ 0 ].parentElement ).not.toHaveClass(
|
|
86
|
+
'has-left-divider'
|
|
87
|
+
);
|
|
88
|
+
// eslint-disable-next-line testing-library/no-node-access
|
|
89
|
+
expect( buttons[ 1 ].parentElement ).toHaveClass(
|
|
90
|
+
'has-left-divider'
|
|
91
|
+
);
|
|
88
92
|
} );
|
|
89
93
|
|
|
90
94
|
it( 'should call the clickHandler on click.', () => {
|
|
@@ -494,7 +494,7 @@ export const WithConditionallyRenderedControl = () => {
|
|
|
494
494
|
);
|
|
495
495
|
};
|
|
496
496
|
|
|
497
|
-
export { ToolsPanelWithItemGroupSlot } from './tools-panel-with-item-group-slot';
|
|
497
|
+
export { ToolsPanelWithItemGroupSlot } from './utils/tools-panel-with-item-group-slot';
|
|
498
498
|
|
|
499
499
|
const PanelWrapperView = styled.div`
|
|
500
500
|
font-size: 13px;
|
|
@@ -12,17 +12,20 @@ import { useContext, useState } from '@wordpress/element';
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
-
import Button from '
|
|
16
|
-
import ColorIndicator from '
|
|
17
|
-
import ColorPalette from '
|
|
18
|
-
import Dropdown from '
|
|
19
|
-
import Panel from '
|
|
20
|
-
import { FlexItem } from '
|
|
21
|
-
import { HStack } from '
|
|
22
|
-
import { Item, ItemGroup } from '
|
|
23
|
-
import { ToolsPanel, ToolsPanelItem, ToolsPanelContext } from '
|
|
24
|
-
import {
|
|
25
|
-
|
|
15
|
+
import Button from '../../../button';
|
|
16
|
+
import ColorIndicator from '../../../color-indicator';
|
|
17
|
+
import ColorPalette from '../../../color-palette';
|
|
18
|
+
import Dropdown from '../../../dropdown';
|
|
19
|
+
import Panel from '../../../panel';
|
|
20
|
+
import { FlexItem } from '../../../flex';
|
|
21
|
+
import { HStack } from '../../../h-stack';
|
|
22
|
+
import { Item, ItemGroup } from '../../../item-group';
|
|
23
|
+
import { ToolsPanel, ToolsPanelItem, ToolsPanelContext } from '../..';
|
|
24
|
+
import {
|
|
25
|
+
createSlotFill,
|
|
26
|
+
Provider as SlotFillProvider,
|
|
27
|
+
} from '../../../slot-fill';
|
|
28
|
+
import { useCx } from '../../../utils';
|
|
26
29
|
|
|
27
30
|
// Available border colors.
|
|
28
31
|
const colors = [
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { render, screen, fireEvent, within } from '@testing-library/react';
|
|
5
|
+
import { act } from 'react-test-renderer';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
@@ -170,9 +171,10 @@ const getMenuButton = () => {
|
|
|
170
171
|
*
|
|
171
172
|
* @return {HTMLElement} The menuButton.
|
|
172
173
|
*/
|
|
173
|
-
const openDropdownMenu = () => {
|
|
174
|
+
const openDropdownMenu = async () => {
|
|
174
175
|
const menuButton = getMenuButton();
|
|
175
176
|
fireEvent.click( menuButton );
|
|
177
|
+
await act( () => Promise.resolve() );
|
|
176
178
|
return menuButton;
|
|
177
179
|
};
|
|
178
180
|
|
|
@@ -240,16 +242,16 @@ describe( 'ToolsPanel', () => {
|
|
|
240
242
|
expect( menu ).not.toBeInTheDocument();
|
|
241
243
|
} );
|
|
242
244
|
|
|
243
|
-
it( 'should render panel menu when at least one panel item', () => {
|
|
245
|
+
it( 'should render panel menu when at least one panel item', async () => {
|
|
244
246
|
renderPanel();
|
|
245
247
|
|
|
246
|
-
const menuButton = openDropdownMenu();
|
|
248
|
+
const menuButton = await openDropdownMenu();
|
|
247
249
|
expect( menuButton ).toBeInTheDocument();
|
|
248
250
|
} );
|
|
249
251
|
|
|
250
252
|
it( 'should render reset all item in menu', async () => {
|
|
251
253
|
renderPanel();
|
|
252
|
-
openDropdownMenu();
|
|
254
|
+
await openDropdownMenu();
|
|
253
255
|
|
|
254
256
|
const resetAllItem = await screen.findByRole( 'menuitem' );
|
|
255
257
|
|
|
@@ -258,7 +260,7 @@ describe( 'ToolsPanel', () => {
|
|
|
258
260
|
|
|
259
261
|
it( 'should render panel menu items correctly', async () => {
|
|
260
262
|
renderPanel();
|
|
261
|
-
openDropdownMenu();
|
|
263
|
+
await openDropdownMenu();
|
|
262
264
|
|
|
263
265
|
const menuItems = await screen.findAllByRole( 'menuitemcheckbox' );
|
|
264
266
|
|
|
@@ -355,7 +357,7 @@ describe( 'ToolsPanel', () => {
|
|
|
355
357
|
</ToolsPanelItem>
|
|
356
358
|
</ToolsPanel>
|
|
357
359
|
);
|
|
358
|
-
openDropdownMenu();
|
|
360
|
+
await openDropdownMenu();
|
|
359
361
|
|
|
360
362
|
const menuGroups = screen.getAllByRole( 'group' );
|
|
361
363
|
|
|
@@ -419,7 +421,7 @@ describe( 'ToolsPanel', () => {
|
|
|
419
421
|
let linkedItem = screen.queryByText( 'Linked control' );
|
|
420
422
|
expect( linkedItem ).not.toBeInTheDocument();
|
|
421
423
|
|
|
422
|
-
openDropdownMenu();
|
|
424
|
+
await openDropdownMenu();
|
|
423
425
|
|
|
424
426
|
// The linked control should initially appear in the optional controls
|
|
425
427
|
// menu group. There should be three menu groups: default controls,
|
|
@@ -503,7 +505,7 @@ describe( 'ToolsPanel', () => {
|
|
|
503
505
|
|
|
504
506
|
// The conditional control should not yet appear in the default controls
|
|
505
507
|
// menu group.
|
|
506
|
-
openDropdownMenu();
|
|
508
|
+
await openDropdownMenu();
|
|
507
509
|
let menuGroups = screen.getAllByRole( 'group' );
|
|
508
510
|
let defaultItem = within( menuGroups[ 0 ] ).queryByText(
|
|
509
511
|
'Conditional'
|
|
@@ -735,7 +737,7 @@ describe( 'ToolsPanel', () => {
|
|
|
735
737
|
|
|
736
738
|
it( 'should render grouped items within the menu', async () => {
|
|
737
739
|
renderGroupedItemsInPanel();
|
|
738
|
-
openDropdownMenu();
|
|
740
|
+
await openDropdownMenu();
|
|
739
741
|
|
|
740
742
|
const defaultItem = screen.getByText( 'Nested Control 1' );
|
|
741
743
|
const defaultMenuItem = screen.getByRole( 'menuitem', {
|
|
@@ -771,9 +773,9 @@ describe( 'ToolsPanel', () => {
|
|
|
771
773
|
expect( altItem ).not.toBeInTheDocument();
|
|
772
774
|
} );
|
|
773
775
|
|
|
774
|
-
it( 'should render wrapped items within the menu', () => {
|
|
776
|
+
it( 'should render wrapped items within the menu', async () => {
|
|
775
777
|
renderWrappedItemInPanel();
|
|
776
|
-
openDropdownMenu();
|
|
778
|
+
await openDropdownMenu();
|
|
777
779
|
|
|
778
780
|
const defaultItem = screen.getByText( 'Nested Control 1' );
|
|
779
781
|
const defaultMenuItem = screen.getByRole( 'menuitem', {
|
|
@@ -1073,7 +1075,10 @@ describe( 'ToolsPanel', () => {
|
|
|
1073
1075
|
<ToolsPanelItem { ...altControlProps }>
|
|
1074
1076
|
<div>Item 1</div>
|
|
1075
1077
|
</ToolsPanelItem>
|
|
1076
|
-
<ToolsPanelItem
|
|
1078
|
+
<ToolsPanelItem
|
|
1079
|
+
{ ...controlProps }
|
|
1080
|
+
data-testid="item-2"
|
|
1081
|
+
>
|
|
1077
1082
|
<div>Item 2</div>
|
|
1078
1083
|
</ToolsPanelItem>
|
|
1079
1084
|
</ToolsPanelItems>
|
|
@@ -1081,6 +1086,7 @@ describe( 'ToolsPanel', () => {
|
|
|
1081
1086
|
<ToolsPanelItem
|
|
1082
1087
|
{ ...altControlProps }
|
|
1083
1088
|
label="Item 3"
|
|
1089
|
+
data-testid="item-3"
|
|
1084
1090
|
isShownByDefault={ true }
|
|
1085
1091
|
>
|
|
1086
1092
|
<div>Item 3</div>
|
|
@@ -1111,8 +1117,8 @@ describe( 'ToolsPanel', () => {
|
|
|
1111
1117
|
expect( item3 ).toBeInTheDocument();
|
|
1112
1118
|
expect( screen.queryByText( 'Item 4' ) ).not.toBeInTheDocument();
|
|
1113
1119
|
|
|
1114
|
-
expect(
|
|
1115
|
-
expect(
|
|
1120
|
+
expect( screen.getByTestId( 'item-2' ) ).toHaveClass( 'first' );
|
|
1121
|
+
expect( screen.getByTestId( 'item-3' ) ).toHaveClass( 'last' );
|
|
1116
1122
|
} );
|
|
1117
1123
|
} );
|
|
1118
1124
|
} );
|
package/src/tooltip/README.md
CHANGED
|
@@ -46,6 +46,13 @@ The tooltip text to show on focus or hover.
|
|
|
46
46
|
- Type: `String`
|
|
47
47
|
- Required: No
|
|
48
48
|
|
|
49
|
+
### shortcut (web only)
|
|
50
|
+
|
|
51
|
+
- Type: `string` or `object`
|
|
52
|
+
- Required: No
|
|
53
|
+
|
|
54
|
+
If shortcut is a string, it is expecting the display text. If shortcut is an object, it will accept the properties of `display` (string) and `ariaLabel` (string).
|
|
55
|
+
|
|
49
56
|
### delay (web only)
|
|
50
57
|
|
|
51
58
|
Time in milliseconds to wait before showing tooltip after the tooltip's visibility is toggled. This prop is currently only available for the web platforms.
|