@wordpress/components 22.0.0 → 23.0.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 +99 -0
- 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/index.js +3 -1
- package/build/angle-picker-control/index.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 +45 -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 +1 -1
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js +13 -1
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/hook.js +11 -1
- package/build/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
- package/build/border-control/border-control/component.js +3 -2
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js +11 -1
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +1 -1
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/hook.js +10 -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 +3 -8
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/input-with-slider.js +18 -3
- 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 +19 -4
- package/build/custom-select-control/index.js.map +1 -1
- package/build/dashicon/index.js +18 -6
- 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/draggable/index.js +58 -38
- package/build/draggable/index.js.map +1 -1
- package/build/draggable/types.js +6 -0
- package/build/draggable/types.js.map +1 -0
- package/build/duotone-picker/duotone-picker.js +2 -2
- package/build/duotone-picker/duotone-picker.js.map +1 -1
- package/build/flex/flex/hook.js +2 -3
- package/build/flex/flex/hook.js.map +1 -1
- package/build/focal-point-picker/focal-point.js +2 -12
- package/build/focal-point-picker/focal-point.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-style.js +11 -51
- package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build/font-size-picker/constants.js +41 -0
- package/build/font-size-picker/constants.js.map +1 -0
- package/build/font-size-picker/font-size-picker-select.js +97 -0
- package/build/font-size-picker/font-size-picker-select.js.map +1 -0
- package/build/font-size-picker/font-size-picker-toggle-group.js +50 -0
- package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -0
- package/build/font-size-picker/index.js +39 -76
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/utils.js +17 -89
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/form-token-field/index.js +9 -6
- package/build/form-token-field/index.js.map +1 -1
- package/build/gradient-picker/index.js +3 -9
- package/build/gradient-picker/index.js.map +1 -1
- package/build/higher-order/navigate-regions/index.js +3 -0
- 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/icon/index.js +3 -2
- package/build/icon/index.js.map +1 -1
- package/build/index.js +21 -1
- 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/menu-group/index.js +17 -3
- package/build/menu-group/index.js.map +1 -1
- package/build/menu-group/types.js +6 -0
- package/build/menu-group/types.js.map +1 -0
- 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/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/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/navigator/navigator-screen/component.js +9 -5
- package/build/navigator/navigator-screen/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 +75 -34
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +18 -6
- 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/range-control/styles/range-control-styles.js +47 -57
- package/build/range-control/styles/range-control-styles.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/spinner/styles.js +4 -4
- package/build/spinner/styles.js.map +1 -1
- package/build/tab-panel/index.js +12 -8
- 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/toggle-group-control/toggle-group-control/component.js +1 -0
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +11 -6
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/tools-panel/styles.js +14 -14
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +9 -5
- package/build/tools-panel/tools-panel-item/hook.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 +4 -3
- 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/utils/input/base.js +2 -2
- package/build/utils/input/base.js.map +1 -1
- package/build/view/index.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/index.js +2 -1
- package/build-module/angle-picker-control/index.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 +45 -12
- 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 +1 -1
- 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 +13 -1
- 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/hook.js +11 -1
- 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 +3 -2
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js +11 -1
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +1 -1
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/hook.js +10 -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 +3 -8
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +18 -3
- 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 +19 -4
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/dashicon/index.js +18 -6
- 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/draggable/index.js +59 -38
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/draggable/types.js +2 -0
- package/build-module/draggable/types.js.map +1 -0
- package/build-module/duotone-picker/duotone-picker.js +2 -2
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/flex/flex/hook.js +2 -3
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.js +3 -13
- package/build-module/focal-point-picker/focal-point.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-style.js +6 -52
- package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build-module/font-size-picker/constants.js +31 -0
- package/build-module/font-size-picker/constants.js.map +1 -0
- package/build-module/font-size-picker/font-size-picker-select.js +83 -0
- package/build-module/font-size-picker/font-size-picker-select.js.map +1 -0
- package/build-module/font-size-picker/font-size-picker-toggle-group.js +40 -0
- package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -0
- package/build-module/font-size-picker/index.js +38 -76
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/utils.js +15 -86
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/form-token-field/index.js +9 -6
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/gradient-picker/index.js +3 -8
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/higher-order/navigate-regions/index.js +3 -0
- 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/icon/index.js +3 -2
- package/build-module/icon/index.js.map +1 -1
- package/build-module/index.js +3 -2
- 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/menu-group/index.js +20 -2
- package/build-module/menu-group/index.js.map +1 -1
- package/build-module/menu-group/types.js +2 -0
- package/build-module/menu-group/types.js.map +1 -0
- 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/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/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/navigator/navigator-screen/component.js +9 -5
- package/build-module/navigator/navigator-screen/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 +76 -35
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/popover/index.js +18 -6
- 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/range-control/styles/range-control-styles.js +47 -57
- package/build-module/range-control/styles/range-control-styles.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/spinner/styles.js +4 -4
- package/build-module/spinner/styles.js.map +1 -1
- package/build-module/tab-panel/index.js +13 -9
- 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/toggle-group-control/toggle-group-control/component.js +1 -0
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +12 -6
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/tools-panel/styles.js +14 -14
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +9 -5
- package/build-module/tools-panel/tools-panel-item/hook.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 +4 -3
- 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-module/utils/input/base.js +2 -2
- package/build-module/utils/input/base.js.map +1 -1
- package/build-module/view/index.js.map +1 -1
- package/build-style/style-rtl.css +145 -100
- package/build-style/style.css +145 -100
- 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 +4 -4
- 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 +8 -8
- 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/component.d.ts +4 -2
- package/build-types/border-box-control/border-box-control-linked-button/component.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 +3 -3
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +7 -7
- 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/component.d.ts +3 -2
- package/build-types/border-box-control/border-box-control-visualizer/component.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 +3 -3
- package/build-types/border-box-control/types.d.ts +5 -38
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +4 -2
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +7 -7
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts +3 -3
- 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 +7 -7
- 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 +24 -12
- 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 +10 -51
- 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 +16 -2
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.d.ts +30 -2
- 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 +14 -10
- 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 +7 -16
- 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/date-time/types.d.ts +0 -16
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/draggable/index.d.ts +42 -66
- package/build-types/draggable/index.d.ts.map +1 -1
- package/build-types/draggable/stories/index.d.ts +12 -0
- package/build-types/draggable/stories/index.d.ts.map +1 -0
- package/build-types/draggable/types.d.ts +58 -0
- package/build-types/draggable/types.d.ts.map +1 -0
- 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/hook.d.ts.map +1 -1
- 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/focal-point.d.ts.map +1 -1
- 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/focal-point-picker/styles/focal-point-style.d.ts +1 -12
- package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
- package/build-types/font-size-picker/constants.d.ts +15 -0
- package/build-types/font-size-picker/constants.d.ts.map +1 -0
- package/build-types/font-size-picker/font-size-picker-select.d.ts +5 -0
- package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -0
- package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts +5 -0
- package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -0
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/types.d.ts +13 -13
- package/build-types/font-size-picker/types.d.ts.map +1 -1
- package/build-types/font-size-picker/utils.d.ts +6 -18
- package/build-types/font-size-picker/utils.d.ts.map +1 -1
- package/build-types/form-token-field/index.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/index.d.ts +1 -1
- package/build-types/icon/index.d.ts.map +1 -1
- 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/menu-group/index.d.ts +21 -1
- package/build-types/menu-group/index.d.ts.map +1 -1
- package/build-types/menu-group/test/index.d.ts +2 -0
- package/build-types/menu-group/test/index.d.ts.map +1 -0
- package/build-types/menu-group/types.d.ts +23 -0
- package/build-types/menu-group/types.d.ts.map +1 -0
- 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/navigator/navigator-screen/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/stories/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/styles.d.ts +1 -2
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- 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/toggle-group-control/types.d.ts +2 -1
- package/build-types/toggle-group-control/types.d.ts.map +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/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- 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/colors-values.d.ts +1 -0
- package/build-types/utils/colors-values.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/build-types/view/index.d.ts +1 -1
- package/build-types/view/index.d.ts.map +1 -1
- 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/index.js +2 -1
- package/src/angle-picker-control/styles/angle-picker-control-styles.js +4 -0
- package/src/autocomplete/index.js +55 -15
- package/src/autocomplete/style.scss +1 -1
- 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 +52 -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} +13 -11
- package/src/base-field/test/index.tsx +84 -0
- package/src/base-field/types.ts +29 -0
- package/src/border-box-control/border-box-control/README.md +6 -17
- package/src/border-box-control/border-box-control/component.tsx +1 -1
- package/src/border-box-control/border-box-control/hook.ts +18 -4
- package/src/border-box-control/border-box-control-split-controls/hook.ts +10 -0
- package/src/border-box-control/test/index.js +3 -1
- package/src/border-box-control/types.ts +32 -58
- package/src/border-control/border-control/README.md +4 -17
- package/src/border-control/border-control/component.tsx +3 -2
- package/src/border-control/border-control/hook.ts +10 -0
- package/src/border-control/border-control-dropdown/component.tsx +7 -6
- package/src/border-control/border-control-dropdown/hook.ts +9 -1
- package/src/border-control/styles.ts +1 -10
- package/src/border-control/types.ts +43 -80
- package/src/box-control/linked-button.js +8 -11
- package/src/box-control/test/index.js +206 -135
- 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/__snapshots__/index.tsx.snap +64 -368
- package/src/card/test/index.tsx +34 -22
- package/src/checkbox-control/style.scss +3 -3
- package/src/circular-option-picker/style.scss +1 -0
- package/src/color-palette/README.md +12 -16
- package/src/color-palette/index.tsx +5 -7
- package/src/color-palette/stories/index.tsx +1 -5
- package/src/color-palette/style.scss +1 -1
- package/src/color-palette/test/__snapshots__/index.tsx.snap +4 -4
- package/src/color-palette/test/index.tsx +84 -36
- package/src/color-palette/types.ts +14 -10
- package/src/color-picker/README.md +1 -0
- package/src/color-picker/input-with-slider.tsx +14 -2
- package/src/color-picker/styles.ts +0 -4
- package/src/confirm-dialog/README.md +3 -2
- package/src/custom-select-control/README.md +14 -0
- package/src/custom-select-control/index.js +21 -2
- package/src/custom-select-control/stories/index.js +1 -0
- package/src/custom-select-control/style.scss +6 -1
- package/src/custom-select-control/test/index.js +39 -0
- package/src/dashicon/index.tsx +51 -0
- package/src/dashicon/types.ts +17 -0
- package/src/date-time/date/test/index.tsx +2 -2
- package/src/date-time/date-time/index.tsx +2 -2
- package/src/date-time/types.ts +0 -19
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -8
- package/src/disabled/test/index.tsx +21 -11
- package/src/divider/test/index.tsx +4 -4
- package/src/draggable/README.md +13 -18
- package/src/draggable/{index.js → index.tsx} +71 -47
- package/src/draggable/stories/index.tsx +83 -0
- package/src/draggable/types.ts +58 -0
- package/src/drop-zone/style.scss +1 -1
- package/src/dropdown/test/index.js +39 -49
- package/src/dropdown-menu/test/index.js +18 -12
- package/src/duotone-picker/duotone-picker.js +2 -2
- package/src/flex/flex/hook.ts +0 -3
- package/src/flex/test/index.tsx +29 -3
- package/src/focal-point-picker/focal-point.tsx +2 -24
- package/src/focal-point-picker/styles/focal-point-style.ts +8 -32
- package/src/focal-point-picker/test/media.js +26 -21
- package/src/font-size-picker/constants.ts +37 -0
- package/src/font-size-picker/font-size-picker-select.tsx +98 -0
- package/src/font-size-picker/font-size-picker-toggle-group.tsx +41 -0
- package/src/font-size-picker/index.tsx +55 -118
- package/src/font-size-picker/test/index.tsx +253 -44
- package/src/font-size-picker/test/utils.ts +58 -98
- package/src/font-size-picker/types.ts +25 -16
- package/src/font-size-picker/utils.ts +16 -102
- package/src/form-toggle/style.scss +3 -3
- package/src/form-token-field/index.tsx +13 -5
- package/src/form-token-field/style.scss +3 -3
- package/src/form-token-field/test/index.tsx +6 -6
- package/src/gradient-picker/index.js +5 -8
- package/src/grid/test/grid.tsx +31 -31
- package/src/higher-order/navigate-regions/index.js +4 -0
- package/src/higher-order/navigate-regions/style.scss +52 -20
- package/src/higher-order/with-fallback-styles/index.js +4 -2
- package/src/higher-order/with-filters/test/index.js +94 -101
- package/src/higher-order/with-focus-return/test/index.js +1 -4
- package/src/higher-order/with-notices/test/index.js +1 -1
- package/src/icon/index.tsx +3 -2
- package/src/icon/test/index.js +10 -0
- package/src/index.js +3 -2
- 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 +18 -0
- package/src/input-control/types.ts +2 -0
- package/src/item-group/stories/index.js +1 -1
- package/src/menu-group/{index.js → index.tsx} +22 -3
- package/src/menu-group/test/{index.js → index.tsx} +0 -0
- package/src/menu-group/types.ts +23 -0
- package/src/menu-item/style.scss +1 -1
- package/src/mobile/bottom-sheet/cell.native.js +1 -1
- package/src/mobile/bottom-sheet/switch-cell.native.js +2 -2
- package/src/mobile/bottom-sheet/test/range-cell.native.js +4 -4
- package/src/mobile/global-styles-context/index.native.js +9 -11
- package/src/mobile/html-text-input/test/index.native.js +2 -2
- package/src/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
- package/src/mobile/link-settings/test/edit.native.js +70 -126
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +5 -5
- package/src/modal/index.tsx +11 -0
- package/src/modal/stories/index.tsx +3 -0
- package/src/modal/test/index.tsx +15 -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/navigator/navigator-provider/component.tsx +13 -10
- package/src/navigator/navigator-screen/component.tsx +8 -3
- package/src/notice/README.md +2 -1
- package/src/notice/style.scss +1 -1
- 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 +600 -0
- package/src/palette-edit/index.js +91 -39
- package/src/palette-edit/test/index.js +25 -1
- package/src/panel/style.scss +1 -1
- package/src/popover/index.tsx +28 -9
- 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/styles/range-control-styles.ts +2 -2
- package/src/range-control/test/index.tsx +57 -60
- package/src/resizable-box/style.scss +3 -2
- package/src/sandbox/test/index.js +13 -11
- package/src/scrollable/test/index.tsx +7 -3
- package/src/search-control/style.scss +5 -1
- 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/style.scss +2 -2
- package/src/snackbar/types.ts +116 -0
- package/src/spacer/test/index.tsx +33 -3
- package/src/spinner/styles.ts +1 -1
- package/src/surface/test/index.tsx +12 -12
- package/src/tab-panel/README.md +9 -0
- package/src/tab-panel/index.tsx +23 -9
- package/src/tab-panel/style.scss +46 -35
- package/src/tab-panel/test/index.tsx +111 -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 +100 -48
- package/src/text-control/stories/index.tsx +0 -1
- package/src/text-control/types.ts +1 -6
- 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/stories/index.tsx +2 -0
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +6 -8
- package/src/toggle-group-control/test/index.tsx +40 -17
- package/src/toggle-group-control/toggle-group-control/README.md +8 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +1 -1
- package/src/toggle-group-control/toggle-group-control/styles.ts +22 -16
- package/src/toggle-group-control/types.ts +2 -1
- package/src/toolbar-group/test/index.js +8 -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/styles.ts +1 -1
- package/src/tools-panel/test/index.js +20 -14
- package/src/tools-panel/tools-panel-item/hook.ts +6 -1
- package/src/tooltip/README.md +7 -0
- package/src/tooltip/style.scss +2 -2
- package/src/tooltip/test/index.js +109 -18
- package/src/tree-grid/test/index.js +12 -12
- package/src/truncate/test/index.tsx +9 -9
- 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/ui/form-group/test/index.js +16 -17
- package/src/unit-control/README.md +9 -1
- package/src/unit-control/index.tsx +3 -0
- package/src/unit-control/test/index.tsx +1 -0
- package/src/unit-control/types.ts +4 -0
- package/src/utils/colors-values.js +5 -3
- package/src/utils/config-values.js +0 -2
- package/src/utils/hooks/stories/use-cx.js +1 -1
- package/src/utils/hooks/use-controlled-value.ts +2 -2
- package/src/utils/input/base.js +2 -2
- package/src/utils/theme-variables.scss +20 -0
- package/src/view/{index.js → index.ts} +0 -0
- package/tsconfig.json +2 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/src/base-field/test/index.js +0 -67
- package/src/dashicon/index.js +0 -26
- package/src/draggable/stories/index.js +0 -72
- package/src/number-control/test/index.js +0 -478
- package/src/snackbar/stories/index.js +0 -89
|
@@ -4,7 +4,7 @@ import { createElement } from "@wordpress/element";
|
|
|
4
4
|
/**
|
|
5
5
|
* Internal dependencies
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { PointerCircle } from './styles/focal-point-style';
|
|
8
8
|
/**
|
|
9
9
|
* External dependencies
|
|
10
10
|
*/
|
|
@@ -21,19 +21,9 @@ export default function FocalPoint(_ref) {
|
|
|
21
21
|
left,
|
|
22
22
|
top
|
|
23
23
|
};
|
|
24
|
-
return createElement(
|
|
24
|
+
return createElement(PointerCircle, _extends({}, props, {
|
|
25
25
|
className: classes,
|
|
26
26
|
style: style
|
|
27
|
-
})
|
|
28
|
-
className: "components-focal-point-picker__icon",
|
|
29
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
30
|
-
viewBox: "0 0 30 30"
|
|
31
|
-
}, createElement(PointerIconPathOutline, {
|
|
32
|
-
className: "components-focal-point-picker__icon-outline",
|
|
33
|
-
d: "M15 1C7.3 1 1 7.3 1 15s6.3 14 14 14 14-6.3 14-14S22.7 1 15 1zm0 22c-4.4 0-8-3.6-8-8s3.6-8 8-8 8 3.6 8 8-3.6 8-8 8z"
|
|
34
|
-
}), createElement(PointerIconPathFill, {
|
|
35
|
-
className: "components-focal-point-picker__icon-fill",
|
|
36
|
-
d: "M15 3C8.4 3 3 8.4 3 15s5.4 12 12 12 12-5.4 12-12S21.6 3 15 3zm0 22C9.5 25 5 20.5 5 15S9.5 5 15 5s10 4.5 10 10-4.5 10-10 10z"
|
|
37
|
-
})));
|
|
27
|
+
}));
|
|
38
28
|
}
|
|
39
29
|
//# sourceMappingURL=focal-point.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/focal-point-picker/focal-point.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/focal-point-picker/focal-point.tsx"],"names":["PointerCircle","classnames","FocalPoint","left","top","props","classes","style"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,4BAA9B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAIA,eAAe,SAASC,UAAT,OAIwC;AAAA,MAJnB;AACnCC,IAAAA,IAAI,GAAG,KAD4B;AAEnCC,IAAAA,GAAG,GAAG,KAF6B;AAGnC,OAAGC;AAHgC,GAImB;AACtD,QAAMC,OAAO,GAAGL,UAAU,CACzB,+CADyB,CAA1B;AAIA,QAAMM,KAAK,GAAG;AAAEJ,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAd;AAEA,SAAO,cAAC,aAAD,eAAoBC,KAApB;AAA4B,IAAA,SAAS,EAAGC,OAAxC;AAAkD,IAAA,KAAK,EAAGC;AAA1D,KAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { PointerCircle } from './styles/focal-point-style';\n\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { FocalPointProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\nexport default function FocalPoint( {\n\tleft = '50%',\n\ttop = '50%',\n\t...props\n}: WordPressComponentProps< FocalPointProps, 'div' > ) {\n\tconst classes = classnames(\n\t\t'components-focal-point-picker__icon_container'\n\t);\n\n\tconst style = { left, top };\n\n\treturn <PointerCircle { ...props } className={ classes } style={ style } />;\n}\n"]}
|
|
@@ -1,63 +1,17 @@
|
|
|
1
1
|
import _styled from "@emotion/styled/base";
|
|
2
2
|
|
|
3
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* External dependencies
|
|
7
5
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* WordPress dependencies
|
|
11
|
-
*/
|
|
12
|
-
import { Path, SVG } from '@wordpress/primitives';
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { COLORS } from '../../utils';
|
|
18
|
-
export const FocalPointWrapper = _styled("div", process.env.NODE_ENV === "production" ? {
|
|
19
|
-
target: "e19snlhg3"
|
|
6
|
+
export const PointerCircle = _styled("div", process.env.NODE_ENV === "production" ? {
|
|
7
|
+
target: "e19snlhg0"
|
|
20
8
|
} : {
|
|
21
|
-
target: "
|
|
22
|
-
label: "
|
|
23
|
-
})("background-color:transparent;cursor:grab;height:
|
|
9
|
+
target: "e19snlhg0",
|
|
10
|
+
label: "PointerCircle"
|
|
11
|
+
})("background-color:transparent;cursor:grab;height:48px;margin:-24px 0 0 -24px;position:absolute;user-select:none;width:48px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.6 );border-radius:50%;backdrop-filter:blur( 4px );box-shadow:rgb( 0 0 0 / 20% ) 0px 0px 10px;", _ref => {
|
|
24
12
|
let {
|
|
25
13
|
isDragging
|
|
26
14
|
} = _ref;
|
|
27
15
|
return isDragging && 'cursor: grabbing;';
|
|
28
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
29
|
-
export const PointerIconSVG = /*#__PURE__*/_styled(SVG, process.env.NODE_ENV === "production" ? {
|
|
30
|
-
target: "e19snlhg2"
|
|
31
|
-
} : {
|
|
32
|
-
target: "e19snlhg2",
|
|
33
|
-
label: "PointerIconSVG"
|
|
34
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
35
|
-
name: "qkx60y",
|
|
36
|
-
styles: "display:block;height:100%;left:0;position:absolute;top:0;width:100%"
|
|
37
|
-
} : {
|
|
38
|
-
name: "qkx60y",
|
|
39
|
-
styles: "display:block;height:100%;left:0;position:absolute;top:0;width:100%",
|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pc0RyYWdnaW5nOiBib29sZWFuIH0gKSA9PlxuXHRcdGlzRHJhZ2dpbmcgJiYgJ2N1cnNvcjogZ3JhYmJpbmc7JyB9XG5gO1xuXG5leHBvcnQgY29uc3QgUG9pbnRlckljb25TVkcgPSBzdHlsZWQoIFNWRyApYFxuXHRkaXNwbGF5OiBibG9jaztcblx0aGVpZ2h0OiAxMDAlO1xuXHRsZWZ0OiAwO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHRvcDogMDtcblx0d2lkdGg6IDEwMCU7XG5gO1xuXG5leHBvcnQgY29uc3QgUG9pbnRlckljb25QYXRoT3V0bGluZSA9IHN0eWxlZCggUGF0aCApYFxuXHRmaWxsOiB3aGl0ZTtcbmA7XG5cbmV4cG9ydCBjb25zdCBQb2ludGVySWNvblBhdGhGaWxsID0gc3R5bGVkKCBQYXRoIClgXG5cdGZpbGw6ICR7IENPTE9SUy51aS50aGVtZSB9O1xuYDtcbiJdfQ== */",
|
|
41
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
42
|
-
});
|
|
43
|
-
export const PointerIconPathOutline = /*#__PURE__*/_styled(Path, process.env.NODE_ENV === "production" ? {
|
|
44
|
-
target: "e19snlhg1"
|
|
45
|
-
} : {
|
|
46
|
-
target: "e19snlhg1",
|
|
47
|
-
label: "PointerIconPathOutline"
|
|
48
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
49
|
-
name: "1b3qpiw",
|
|
50
|
-
styles: "fill:white"
|
|
51
|
-
} : {
|
|
52
|
-
name: "1b3qpiw",
|
|
53
|
-
styles: "fill:white",
|
|
54
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZm9jYWwtcG9pbnQtcGlja2VyL3N0eWxlcy9mb2NhbC1wb2ludC1zdHlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjo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1xuXHRsZWZ0OiAwO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHRvcDogMDtcblx0d2lkdGg6IDEwMCU7XG5gO1xuXG5leHBvcnQgY29uc3QgUG9pbnRlckljb25QYXRoT3V0bGluZSA9IHN0eWxlZCggUGF0aCApYFxuXHRmaWxsOiB3aGl0ZTtcbmA7XG5cbmV4cG9ydCBjb25zdCBQb2ludGVySWNvblBhdGhGaWxsID0gc3R5bGVkKCBQYXRoIClgXG5cdGZpbGw6ICR7IENPTE9SUy51aS50aGVtZSB9O1xuYDtcbiJdfQ== */",
|
|
55
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
56
|
-
});
|
|
57
|
-
export const PointerIconPathFill = /*#__PURE__*/_styled(Path, process.env.NODE_ENV === "production" ? {
|
|
58
|
-
target: "e19snlhg0"
|
|
59
|
-
} : {
|
|
60
|
-
target: "e19snlhg0",
|
|
61
|
-
label: "PointerIconPathFill"
|
|
62
|
-
})("fill:", COLORS.ui.theme, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZm9jYWwtcG9pbnQtcGlja2VyL3N0eWxlcy9mb2NhbC1wb2ludC1zdHlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0Q2lEIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZm9jYWwtcG9pbnQtcGlja2VyL3N0eWxlcy9mb2NhbC1wb2ludC1zdHlsZS50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuLyoqXG4gKiBXb3JkUHJlc3MgZGVwZW5kZW5jaWVzXG4gKi9cbmlt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uYDtcbiJdfQ== */"));
|
|
16
|
+
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvZm9jYWwtcG9pbnQtcGlja2VyL3N0eWxlcy9mb2NhbC1wb2ludC1zdHlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLdUMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9mb2NhbC1wb2ludC1waWNrZXIvc3R5bGVzL2ZvY2FsLXBvaW50LXN0eWxlLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5leHBvcnQgY29uc3QgUG9pbnRlckNpcmNsZSA9IHN0eWxlZC5kaXZgXG5cdGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50O1xuXHRjdXJzb3I6IGdyYWI7XG5cdGhlaWdodDogNDhweDtcblx0bWFyZ2luOiAtMjRweCAwIDAgLTI0cHg7XG5cdHBvc2l0aW9uOiBhYnNvbHV0ZTtcblx0dXNlci1zZWxlY3Q6IG5vbmU7XG5cdHdpZHRoOiA0OHB4O1xuXHR3aWxsLWNoYW5nZTogdHJhbnNmb3JtO1xuXHR6LWluZGV4OiAxMDAwMDtcblx0YmFja2dyb3VuZDogcmdiYSggMjU1LCAyNTUsIDI1NSwgMC42ICk7XG5cdGJvcmRlci1yYWRpdXM6IDUwJTtcblx0YmFja2Ryb3AtZmlsdGVyOiBibHVyKCA0cHggKTtcblx0Ym94LXNoYWRvdzogcmdiKCAwIDAgMCAvIDIwJSApIDBweCAwcHggMTBweDtcblxuXHQkeyAoIHsgaXNEcmFnZ2luZyB9OiB7IGlzRHJhZ2dpbmc6IGJvb2xlYW4gfSApID0+XG5cdFx0aXNEcmFnZ2luZyAmJiAnY3Vyc29yOiBncmFiYmluZzsnIH1cbmA7XG4iXX0= */"));
|
|
63
17
|
//# sourceMappingURL=focal-point-style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/focal-point-picker/styles/focal-point-style.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/focal-point-picker/styles/focal-point-style.ts"],"names":["PointerCircle","isDragging"],"mappings":";;AAAA;AACA;AACA;AAGA,OAAO,MAAMA,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,oSAetB;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACFA,UAAU,IAAI,mBADZ;AAAA,CAfsB,6qCAAnB","sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n\nexport const PointerCircle = styled.div`\n\tbackground-color: transparent;\n\tcursor: grab;\n\theight: 48px;\n\tmargin: -24px 0 0 -24px;\n\tposition: absolute;\n\tuser-select: none;\n\twidth: 48px;\n\twill-change: transform;\n\tz-index: 10000;\n\tbackground: rgba( 255, 255, 255, 0.6 );\n\tborder-radius: 50%;\n\tbackdrop-filter: blur( 4px );\n\tbox-shadow: rgb( 0 0 0 / 20% ) 0px 0px 10px;\n\n\t${ ( { isDragging }: { isDragging: boolean } ) =>\n\t\tisDragging && 'cursor: grabbing;' }\n`;\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
/**
|
|
6
|
+
* List of T-shirt abbreviations.
|
|
7
|
+
*
|
|
8
|
+
* When there are 5 font sizes or fewer, we assume that the font sizes are
|
|
9
|
+
* ordered by size and show T-shirt labels.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export const T_SHIRT_ABBREVIATIONS = [
|
|
13
|
+
/* translators: S stands for 'small' and is a size label. */
|
|
14
|
+
__('S'),
|
|
15
|
+
/* translators: M stands for 'medium' and is a size label. */
|
|
16
|
+
__('M'),
|
|
17
|
+
/* translators: L stands for 'large' and is a size label. */
|
|
18
|
+
__('L'),
|
|
19
|
+
/* translators: XL stands for 'extra large' and is a size label. */
|
|
20
|
+
__('XL'),
|
|
21
|
+
/* translators: XXL stands for 'extra extra large' and is a size label. */
|
|
22
|
+
__('XXL')];
|
|
23
|
+
/**
|
|
24
|
+
* List of T-shirt names.
|
|
25
|
+
*
|
|
26
|
+
* When there are 5 font sizes or fewer, we assume that the font sizes are
|
|
27
|
+
* ordered by size and show T-shirt labels.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
export const T_SHIRT_NAMES = [__('Small'), __('Medium'), __('Large'), __('Extra Large'), __('Extra Extra Large')];
|
|
31
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/font-size-picker/constants.ts"],"names":["__","T_SHIRT_ABBREVIATIONS","T_SHIRT_NAMES"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,qBAAqB,GAAG;AACpC;AACAD,EAAE,CAAE,GAAF,CAFkC;AAGpC;AACAA,EAAE,CAAE,GAAF,CAJkC;AAKpC;AACAA,EAAE,CAAE,GAAF,CANkC;AAOpC;AACAA,EAAE,CAAE,IAAF,CARkC;AASpC;AACAA,EAAE,CAAE,KAAF,CAVkC,CAA9B;AAaP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAME,aAAa,GAAG,CAC5BF,EAAE,CAAE,OAAF,CAD0B,EAE5BA,EAAE,CAAE,QAAF,CAF0B,EAG5BA,EAAE,CAAE,OAAF,CAH0B,EAI5BA,EAAE,CAAE,aAAF,CAJ0B,EAK5BA,EAAE,CAAE,mBAAF,CAL0B,CAAtB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * List of T-shirt abbreviations.\n *\n * When there are 5 font sizes or fewer, we assume that the font sizes are\n * ordered by size and show T-shirt labels.\n */\nexport const T_SHIRT_ABBREVIATIONS = [\n\t/* translators: S stands for 'small' and is a size label. */\n\t__( 'S' ),\n\t/* translators: M stands for 'medium' and is a size label. */\n\t__( 'M' ),\n\t/* translators: L stands for 'large' and is a size label. */\n\t__( 'L' ),\n\t/* translators: XL stands for 'extra large' and is a size label. */\n\t__( 'XL' ),\n\t/* translators: XXL stands for 'extra extra large' and is a size label. */\n\t__( 'XXL' ),\n];\n\n/**\n * List of T-shirt names.\n *\n * When there are 5 font sizes or fewer, we assume that the font sizes are\n * ordered by size and show T-shirt labels.\n */\nexport const T_SHIRT_NAMES = [\n\t__( 'Small' ),\n\t__( 'Medium' ),\n\t__( 'Large' ),\n\t__( 'Extra Large' ),\n\t__( 'Extra Extra Large' ),\n];\n"]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import CustomSelectControl from '../custom-select-control';
|
|
12
|
+
import { parseQuantityAndUnitFromRawValue } from '../unit-control';
|
|
13
|
+
import { getCommonSizeUnit, isSimpleCssValue } from './utils';
|
|
14
|
+
const DEFAULT_OPTION = {
|
|
15
|
+
key: 'default',
|
|
16
|
+
name: __('Default'),
|
|
17
|
+
value: undefined
|
|
18
|
+
};
|
|
19
|
+
const CUSTOM_OPTION = {
|
|
20
|
+
key: 'custom',
|
|
21
|
+
name: __('Custom')
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const FontSizePickerSelect = props => {
|
|
25
|
+
var _options$find;
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
fontSizes,
|
|
29
|
+
value,
|
|
30
|
+
disableCustomFontSizes,
|
|
31
|
+
size,
|
|
32
|
+
onChange,
|
|
33
|
+
onSelectCustom
|
|
34
|
+
} = props;
|
|
35
|
+
const areAllSizesSameUnit = !!getCommonSizeUnit(fontSizes);
|
|
36
|
+
const options = [DEFAULT_OPTION, ...fontSizes.map(fontSize => {
|
|
37
|
+
let hint;
|
|
38
|
+
|
|
39
|
+
if (areAllSizesSameUnit) {
|
|
40
|
+
const [quantity] = parseQuantityAndUnitFromRawValue(fontSize.size);
|
|
41
|
+
|
|
42
|
+
if (quantity !== undefined) {
|
|
43
|
+
hint = String(quantity);
|
|
44
|
+
}
|
|
45
|
+
} else if (isSimpleCssValue(fontSize.size)) {
|
|
46
|
+
hint = String(fontSize.size);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
key: fontSize.slug,
|
|
51
|
+
name: fontSize.name || fontSize.slug,
|
|
52
|
+
value: fontSize.size,
|
|
53
|
+
__experimentalHint: hint
|
|
54
|
+
};
|
|
55
|
+
}), ...(disableCustomFontSizes ? [] : [CUSTOM_OPTION])];
|
|
56
|
+
const selectedOption = value ? (_options$find = options.find(option => option.value === value)) !== null && _options$find !== void 0 ? _options$find : CUSTOM_OPTION : DEFAULT_OPTION;
|
|
57
|
+
return createElement(CustomSelectControl, {
|
|
58
|
+
__nextUnconstrainedWidth: true,
|
|
59
|
+
className: "components-font-size-picker__select",
|
|
60
|
+
label: __('Font size'),
|
|
61
|
+
hideLabelFromVision: true,
|
|
62
|
+
describedBy: sprintf( // translators: %s: Currently selected font size.
|
|
63
|
+
__('Currently selected font size: %s'), selectedOption.name),
|
|
64
|
+
options: options,
|
|
65
|
+
value: selectedOption,
|
|
66
|
+
__experimentalShowSelectedHint: true,
|
|
67
|
+
onChange: _ref => {
|
|
68
|
+
let {
|
|
69
|
+
selectedItem
|
|
70
|
+
} = _ref;
|
|
71
|
+
|
|
72
|
+
if (selectedItem === CUSTOM_OPTION) {
|
|
73
|
+
onSelectCustom();
|
|
74
|
+
} else {
|
|
75
|
+
onChange(selectedItem.value);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
size: size
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default FontSizePickerSelect;
|
|
83
|
+
//# sourceMappingURL=font-size-picker-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/font-size-picker/font-size-picker-select.tsx"],"names":["__","sprintf","CustomSelectControl","parseQuantityAndUnitFromRawValue","getCommonSizeUnit","isSimpleCssValue","DEFAULT_OPTION","key","name","value","undefined","CUSTOM_OPTION","FontSizePickerSelect","props","fontSizes","disableCustomFontSizes","size","onChange","onSelectCustom","areAllSizesSameUnit","options","map","fontSize","hint","quantity","String","slug","__experimentalHint","selectedOption","find","option","selectedItem"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,SAASC,gCAAT,QAAiD,iBAAjD;AAKA,SAASC,iBAAT,EAA4BC,gBAA5B,QAAoD,SAApD;AAEA,MAAMC,cAA0C,GAAG;AAClDC,EAAAA,GAAG,EAAE,SAD6C;AAElDC,EAAAA,IAAI,EAAER,EAAE,CAAE,SAAF,CAF0C;AAGlDS,EAAAA,KAAK,EAAEC;AAH2C,CAAnD;AAMA,MAAMC,aAAyC,GAAG;AACjDJ,EAAAA,GAAG,EAAE,QAD4C;AAEjDC,EAAAA,IAAI,EAAER,EAAE,CAAE,QAAF;AAFyC,CAAlD;;AAKA,MAAMY,oBAAoB,GAAKC,KAAF,IAAwC;AAAA;;AACpE,QAAM;AACLC,IAAAA,SADK;AAELL,IAAAA,KAFK;AAGLM,IAAAA,sBAHK;AAILC,IAAAA,IAJK;AAKLC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,IAAA,WAAW,EAAGC,OAAO,EACpB;AACAD,IAAAA,EAAE,CAAE,kCAAF,CAFkB,EAGpB4B,cAAc,CAACpB,IAHK,CALtB;AAUC,IAAA,OAAO,EAAGY,OAVX;AAWC,IAAA,KAAK,EAAGQ,cAXT;AAYC,IAAA,8BAA8B,MAZ/B;AAaC,IAAA,QAAQ,EAAG,QAIJ;AAAA,UAJM;AACZG,QAAAA;AADY,OAIN;;AACN,UAAKA,YAAY,KAAKpB,aAAtB,EAAsC;AACrCO,QAAAA,cAAc;AACd,OAFD,MAEO;AACND,QAAAA,QAAQ,CAAEc,YAAY,CAACtB,KAAf,CAAR;AACA;AACD,KAvBF;AAwBC,IAAA,IAAI,EAAGO;AAxBR,IADD;AA4BA,CApED;;AAsEA,eAAeJ,oBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CustomSelectControl from '../custom-select-control';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control';\nimport type {\n\tFontSizePickerSelectProps,\n\tFontSizePickerSelectOption,\n} from './types';\nimport { getCommonSizeUnit, isSimpleCssValue } from './utils';\n\nconst DEFAULT_OPTION: FontSizePickerSelectOption = {\n\tkey: 'default',\n\tname: __( 'Default' ),\n\tvalue: undefined,\n};\n\nconst CUSTOM_OPTION: FontSizePickerSelectOption = {\n\tkey: 'custom',\n\tname: __( 'Custom' ),\n};\n\nconst FontSizePickerSelect = ( props: FontSizePickerSelectProps ) => {\n\tconst {\n\t\tfontSizes,\n\t\tvalue,\n\t\tdisableCustomFontSizes,\n\t\tsize,\n\t\tonChange,\n\t\tonSelectCustom,\n\t} = props;\n\n\tconst areAllSizesSameUnit = !! getCommonSizeUnit( fontSizes );\n\n\tconst options: FontSizePickerSelectOption[] = [\n\t\tDEFAULT_OPTION,\n\t\t...fontSizes.map( ( fontSize ) => {\n\t\t\tlet hint;\n\t\t\tif ( areAllSizesSameUnit ) {\n\t\t\t\tconst [ quantity ] = parseQuantityAndUnitFromRawValue(\n\t\t\t\t\tfontSize.size\n\t\t\t\t);\n\t\t\t\tif ( quantity !== undefined ) {\n\t\t\t\t\thint = String( quantity );\n\t\t\t\t}\n\t\t\t} else if ( isSimpleCssValue( fontSize.size ) ) {\n\t\t\t\thint = String( fontSize.size );\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tkey: fontSize.slug,\n\t\t\t\tname: fontSize.name || fontSize.slug,\n\t\t\t\tvalue: fontSize.size,\n\t\t\t\t__experimentalHint: hint,\n\t\t\t};\n\t\t} ),\n\t\t...( disableCustomFontSizes ? [] : [ CUSTOM_OPTION ] ),\n\t];\n\n\tconst selectedOption = value\n\t\t? options.find( ( option ) => option.value === value ) ?? CUSTOM_OPTION\n\t\t: DEFAULT_OPTION;\n\n\treturn (\n\t\t<CustomSelectControl\n\t\t\t__nextUnconstrainedWidth\n\t\t\tclassName=\"components-font-size-picker__select\"\n\t\t\tlabel={ __( 'Font size' ) }\n\t\t\thideLabelFromVision\n\t\t\tdescribedBy={ sprintf(\n\t\t\t\t// translators: %s: Currently selected font size.\n\t\t\t\t__( 'Currently selected font size: %s' ),\n\t\t\t\tselectedOption.name\n\t\t\t) }\n\t\t\toptions={ options }\n\t\t\tvalue={ selectedOption }\n\t\t\t__experimentalShowSelectedHint\n\t\t\tonChange={ ( {\n\t\t\t\tselectedItem,\n\t\t\t}: {\n\t\t\t\tselectedItem: FontSizePickerSelectOption;\n\t\t\t} ) => {\n\t\t\t\tif ( selectedItem === CUSTOM_OPTION ) {\n\t\t\t\t\tonSelectCustom();\n\t\t\t\t} else {\n\t\t\t\t\tonChange( selectedItem.value );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t/>\n\t);\n};\n\nexport default FontSizePickerSelect;\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { ToggleGroupControl, ToggleGroupControlOption } from '../toggle-group-control';
|
|
12
|
+
import { T_SHIRT_ABBREVIATIONS, T_SHIRT_NAMES } from './constants';
|
|
13
|
+
|
|
14
|
+
const FontSizePickerToggleGroup = props => {
|
|
15
|
+
const {
|
|
16
|
+
fontSizes,
|
|
17
|
+
value,
|
|
18
|
+
__nextHasNoMarginBottom,
|
|
19
|
+
size,
|
|
20
|
+
onChange
|
|
21
|
+
} = props;
|
|
22
|
+
return createElement(ToggleGroupControl, {
|
|
23
|
+
__nextHasNoMarginBottom: __nextHasNoMarginBottom,
|
|
24
|
+
label: __('Font size'),
|
|
25
|
+
hideLabelFromVision: true,
|
|
26
|
+
value: value,
|
|
27
|
+
onChange: onChange,
|
|
28
|
+
isBlock: true,
|
|
29
|
+
size: size
|
|
30
|
+
}, fontSizes.map((fontSize, index) => createElement(ToggleGroupControlOption, {
|
|
31
|
+
key: fontSize.slug,
|
|
32
|
+
value: fontSize.size,
|
|
33
|
+
label: T_SHIRT_ABBREVIATIONS[index],
|
|
34
|
+
"aria-label": fontSize.name || T_SHIRT_NAMES[index],
|
|
35
|
+
showTooltip: true
|
|
36
|
+
})));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default FontSizePickerToggleGroup;
|
|
40
|
+
//# sourceMappingURL=font-size-picker-toggle-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/font-size-picker/font-size-picker-toggle-group.tsx"],"names":["__","ToggleGroupControl","ToggleGroupControlOption","T_SHIRT_ABBREVIATIONS","T_SHIRT_NAMES","FontSizePickerToggleGroup","props","fontSizes","value","__nextHasNoMarginBottom","size","onChange","map","fontSize","index","slug","name"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SACCC,kBADD,EAECC,wBAFD,QAGO,yBAHP;AAIA,SAASC,qBAAT,EAAgCC,aAAhC,QAAqD,aAArD;;AAGA,MAAMC,yBAAyB,GAAKC,KAAF,IAA6C;AAC9E,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,KAAb;AAAoBC,IAAAA,uBAApB;AAA6CC,IAAAA,IAA7C;AAAmDC,IAAAA;AAAnD,MAAgEL,KAAtE;AACA,SACC,cAAC,kBAAD;AACC,IAAA,uBAAuB,EAAGG,uBAD3B;AAEC,IAAA,KAAK,EAAGT,EAAE,CAAE,WAAF,CAFX;AAGC,IAAA,mBAAmB,MAHpB;AAIC,IAAA,KAAK,EAAGQ,KAJT;AAKC,IAAA,QAAQ,EAAGG,QALZ;AAMC,IAAA,OAAO,MANR;AAOC,IAAA,IAAI,EAAGD;AAPR,KASGH,SAAS,CAACK,GAAV,CAAe,CAAEC,QAAF,EAAYC,KAAZ,KAChB,cAAC,wBAAD;AACC,IAAA,GAAG,EAAGD,QAAQ,CAACE,IADhB;AAEC,IAAA,KAAK,EAAGF,QAAQ,CAACH,IAFlB;AAGC,IAAA,KAAK,EAAGP,qBAAqB,CAAEW,KAAF,CAH9B;AAIC,kBAAaD,QAAQ,CAACG,IAAT,IAAiBZ,aAAa,CAAEU,KAAF,CAJ5C;AAKC,IAAA,WAAW;AALZ,IADC,CATH,CADD;AAqBA,CAvBD;;AAyBA,eAAeT,yBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tToggleGroupControl,\n\tToggleGroupControlOption,\n} from '../toggle-group-control';\nimport { T_SHIRT_ABBREVIATIONS, T_SHIRT_NAMES } from './constants';\nimport type { FontSizePickerToggleGroupProps } from './types';\n\nconst FontSizePickerToggleGroup = ( props: FontSizePickerToggleGroupProps ) => {\n\tconst { fontSizes, value, __nextHasNoMarginBottom, size, onChange } = props;\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tlabel={ __( 'Font size' ) }\n\t\t\thideLabelFromVision\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tisBlock\n\t\t\tsize={ size }\n\t\t>\n\t\t\t{ fontSizes.map( ( fontSize, index ) => (\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey={ fontSize.slug }\n\t\t\t\t\tvalue={ fontSize.size }\n\t\t\t\t\tlabel={ T_SHIRT_ABBREVIATIONS[ index ] }\n\t\t\t\t\taria-label={ fontSize.name || T_SHIRT_NAMES[ index ] }\n\t\t\t\t\tshowTooltip\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ToggleGroupControl>\n\t);\n};\n\nexport default FontSizePickerToggleGroup;\n"]}
|
|
@@ -8,7 +8,7 @@ import { createElement } from "@wordpress/element";
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
import deprecated from '@wordpress/deprecated';
|
|
11
|
-
import { __
|
|
11
|
+
import { __ } from '@wordpress/i18n';
|
|
12
12
|
import { settings } from '@wordpress/icons';
|
|
13
13
|
import { useState, useMemo, forwardRef } from '@wordpress/element';
|
|
14
14
|
/**
|
|
@@ -19,13 +19,14 @@ import Button from '../button';
|
|
|
19
19
|
import RangeControl from '../range-control';
|
|
20
20
|
import { Flex, FlexItem } from '../flex';
|
|
21
21
|
import { default as UnitControl, parseQuantityAndUnitFromRawValue, useCustomUnits } from '../unit-control';
|
|
22
|
-
import CustomSelectControl from '../custom-select-control';
|
|
23
22
|
import { VisuallyHidden } from '../visually-hidden';
|
|
24
|
-
import {
|
|
25
|
-
import { getFontSizeOptions, getSelectedOption, isSimpleCssValue, CUSTOM_FONT_SIZE } from './utils';
|
|
23
|
+
import { getCommonSizeUnit } from './utils';
|
|
26
24
|
import { HStack } from '../h-stack';
|
|
27
25
|
import { Container, HeaderHint, HeaderLabel, Controls, ResetButton } from './styles';
|
|
28
26
|
import { Spacer } from '../spacer';
|
|
27
|
+
import FontSizePickerSelect from './font-size-picker-select';
|
|
28
|
+
import FontSizePickerToggleGroup from './font-size-picker-toggle-group';
|
|
29
|
+
import { T_SHIRT_NAMES } from './constants';
|
|
29
30
|
|
|
30
31
|
const UnforwardedFontSizePicker = (props, ref) => {
|
|
31
32
|
var _fontSizes$;
|
|
@@ -54,59 +55,39 @@ const UnforwardedFontSizePicker = (props, ref) => {
|
|
|
54
55
|
const units = useCustomUnits({
|
|
55
56
|
availableUnits: ['px', 'em', 'rem']
|
|
56
57
|
});
|
|
57
|
-
/**
|
|
58
|
-
* The main font size UI displays a toggle group when the presets are less
|
|
59
|
-
* than six and a select control when they are more.
|
|
60
|
-
*/
|
|
61
|
-
|
|
62
|
-
const fontSizesContainComplexValues = fontSizes.some(_ref => {
|
|
63
|
-
let {
|
|
64
|
-
size: sizeArg
|
|
65
|
-
} = _ref;
|
|
66
|
-
return !isSimpleCssValue(sizeArg);
|
|
67
|
-
});
|
|
68
58
|
const shouldUseSelectControl = fontSizes.length > 5;
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const isCustomValue = selectedOption.slug === CUSTOM_FONT_SIZE;
|
|
59
|
+
const selectedFontSize = fontSizes.find(fontSize => fontSize.size === value);
|
|
60
|
+
const isCustomValue = !!value && !selectedFontSize;
|
|
72
61
|
const [showCustomValueControl, setShowCustomValueControl] = useState(!disableCustomFontSizes && isCustomValue);
|
|
73
62
|
const headerHint = useMemo(() => {
|
|
74
63
|
if (showCustomValueControl) {
|
|
75
|
-
return
|
|
76
|
-
} // If we have a custom value that is not available in the font sizes,
|
|
77
|
-
// show it as a hint as long as it's a simple CSS value.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (isCustomValue) {
|
|
81
|
-
return value !== undefined && isSimpleCssValue(value) && `(${value})`;
|
|
64
|
+
return __('Custom');
|
|
82
65
|
}
|
|
83
66
|
|
|
84
|
-
if (shouldUseSelectControl) {
|
|
85
|
-
|
|
86
|
-
|
|
67
|
+
if (!shouldUseSelectControl) {
|
|
68
|
+
if (selectedFontSize) {
|
|
69
|
+
return selectedFontSize.name || T_SHIRT_NAMES[fontSizes.indexOf(selectedFontSize)];
|
|
70
|
+
}
|
|
87
71
|
|
|
72
|
+
return '';
|
|
73
|
+
}
|
|
88
74
|
|
|
89
|
-
|
|
75
|
+
const commonUnit = getCommonSizeUnit(fontSizes);
|
|
90
76
|
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
hint += `(${unit})`;
|
|
77
|
+
if (commonUnit) {
|
|
78
|
+
return `(${commonUnit})`;
|
|
94
79
|
}
|
|
95
80
|
|
|
96
|
-
return
|
|
97
|
-
}, [showCustomValueControl,
|
|
81
|
+
return '';
|
|
82
|
+
}, [showCustomValueControl, shouldUseSelectControl, selectedFontSize, fontSizes]);
|
|
98
83
|
|
|
99
|
-
if (
|
|
84
|
+
if (fontSizes.length === 0 && disableCustomFontSizes) {
|
|
100
85
|
return null;
|
|
101
|
-
} //
|
|
102
|
-
// for ToggleGroupControl.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const currentFontSizeSR = sprintf( // translators: %s: Currently selected font size.
|
|
106
|
-
__('Currently selected font size: %s'), selectedOption.name); // If neither the value or first font size is a string, then FontSizePicker
|
|
86
|
+
} // If neither the value or first font size is a string, then FontSizePicker
|
|
107
87
|
// operates in a legacy "unitless" mode where UnitControl can only be used
|
|
108
88
|
// to select px values and onChange() is always called with number values.
|
|
109
89
|
|
|
90
|
+
|
|
110
91
|
const hasUnits = typeof value === 'string' || typeof ((_fontSizes$ = fontSizes[0]) === null || _fontSizes$ === void 0 ? void 0 : _fontSizes$.size) === 'string';
|
|
111
92
|
const [valueQuantity, valueUnit] = parseQuantityAndUnitFromRawValue(value, units);
|
|
112
93
|
const isValueUnitRelative = !!valueUnit && ['em', 'rem'].includes(valueUnit);
|
|
@@ -132,51 +113,32 @@ const UnforwardedFontSizePicker = (props, ref) => {
|
|
|
132
113
|
}))), createElement(Controls, {
|
|
133
114
|
className: "components-font-size-picker__controls",
|
|
134
115
|
__nextHasNoMarginBottom: __nextHasNoMarginBottom
|
|
135
|
-
}, !!fontSizes.length && shouldUseSelectControl && !showCustomValueControl && createElement(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
value: options.find(option => option.key === selectedOption.slug),
|
|
143
|
-
onChange: _ref2 => {
|
|
144
|
-
let {
|
|
145
|
-
selectedItem
|
|
146
|
-
} = _ref2;
|
|
147
|
-
|
|
148
|
-
if (selectedItem.size === undefined) {
|
|
116
|
+
}, !!fontSizes.length && shouldUseSelectControl && !showCustomValueControl && createElement(FontSizePickerSelect, {
|
|
117
|
+
fontSizes: fontSizes,
|
|
118
|
+
value: value,
|
|
119
|
+
disableCustomFontSizes: disableCustomFontSizes,
|
|
120
|
+
size: size,
|
|
121
|
+
onChange: newValue => {
|
|
122
|
+
if (newValue === undefined) {
|
|
149
123
|
onChange === null || onChange === void 0 ? void 0 : onChange(undefined);
|
|
150
124
|
} else {
|
|
151
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(hasUnits ?
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (selectedItem.key === CUSTOM_FONT_SIZE) {
|
|
155
|
-
setShowCustomValueControl(true);
|
|
125
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(hasUnits ? newValue : Number(newValue), fontSizes.find(fontSize => fontSize.size === newValue));
|
|
156
126
|
}
|
|
157
127
|
},
|
|
158
|
-
|
|
159
|
-
}), !shouldUseSelectControl && !showCustomValueControl && createElement(
|
|
160
|
-
|
|
161
|
-
label: __('Font size'),
|
|
162
|
-
hideLabelFromVision: true,
|
|
128
|
+
onSelectCustom: () => setShowCustomValueControl(true)
|
|
129
|
+
}), !shouldUseSelectControl && !showCustomValueControl && createElement(FontSizePickerToggleGroup, {
|
|
130
|
+
fontSizes: fontSizes,
|
|
163
131
|
value: value,
|
|
132
|
+
__nextHasNoMarginBottom: __nextHasNoMarginBottom,
|
|
133
|
+
size: size,
|
|
164
134
|
onChange: newValue => {
|
|
165
135
|
if (newValue === undefined) {
|
|
166
136
|
onChange === null || onChange === void 0 ? void 0 : onChange(undefined);
|
|
167
137
|
} else {
|
|
168
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(hasUnits ? newValue : Number(newValue));
|
|
138
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(hasUnits ? newValue : Number(newValue), fontSizes.find(fontSize => fontSize.size === newValue));
|
|
169
139
|
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
size: size
|
|
173
|
-
}, options.map(option => createElement(ToggleGroupControlOption, {
|
|
174
|
-
key: option.key,
|
|
175
|
-
value: option.value,
|
|
176
|
-
label: option.label,
|
|
177
|
-
"aria-label": option.name,
|
|
178
|
-
showTooltip: true
|
|
179
|
-
}))), !disableCustomFontSizes && showCustomValueControl && createElement(Flex, {
|
|
140
|
+
}
|
|
141
|
+
}), !disableCustomFontSizes && showCustomValueControl && createElement(Flex, {
|
|
180
142
|
className: "components-font-size-picker__custom-size-control"
|
|
181
143
|
}, createElement(FlexItem, {
|
|
182
144
|
isBlock: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/font-size-picker/index.tsx"],"names":["deprecated","__","sprintf","settings","useState","useMemo","forwardRef","Button","RangeControl","Flex","FlexItem","default","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits","CustomSelectControl","VisuallyHidden","ToggleGroupControl","ToggleGroupControlOption","getFontSizeOptions","getSelectedOption","isSimpleCssValue","CUSTOM_FONT_SIZE","HStack","Container","HeaderHint","HeaderLabel","Controls","ResetButton","Spacer","UnforwardedFontSizePicker","props","ref","__nextHasNoMarginBottom","fallbackFontSize","fontSizes","disableCustomFontSizes","onChange","size","value","withSlider","withReset","since","version","hint","units","availableUnits","fontSizesContainComplexValues","some","sizeArg","shouldUseSelectControl","length","options","selectedOption","isCustomValue","slug","showCustomValueControl","setShowCustomValueControl","headerHint","undefined","name","unit","currentFontSizeSR","hasUnits","valueQuantity","valueUnit","isValueUnitRelative","includes","find","option","key","selectedItem","Number","newValue","map","label","parseInt","FontSizePicker"],"mappings":";;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,uBAAvB;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,QAAT,EAAmBC,OAAnB,EAA4BC,UAA5B,QAA8C,oBAA9C;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,SAASC,IAAT,EAAeC,QAAf,QAA+B,SAA/B;AACA,SACCC,OAAO,IAAIC,WADZ,EAECC,gCAFD,EAGCC,cAHD,QAIO,iBAJP;AAKA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,SAASC,cAAT,QAA+B,oBAA/B;AACA,SACCC,kBADD,EAECC,wBAFD,QAGO,yBAHP;AAIA,SACCC,kBADD,EAECC,iBAFD,EAGCC,gBAHD,EAICC,gBAJD,QAKO,SALP;AAMA,SAASC,MAAT,QAAuB,YAAvB;AAMA,SACCC,SADD,EAECC,UAFD,EAGCC,WAHD,EAICC,QAJD,EAKCC,WALD,QAMO,UANP;AAOA,SAASC,MAAT,QAAuB,WAAvB;;AAEA,MAAMC,yBAAyB,GAAG,CACjCC,KADiC,EAEjCC,GAFiC,KAG7B;AAAA;;AACJ,QAAM;AACL;AACAC,IAAAA,uBAAuB,GAAG,KAFrB;AAGLC,IAAAA,gBAHK;AAILC,IAAAA,SAAS,GAAG,EAJP;AAKLC,IAAAA,sBAAsB,GAAG,KALpB;AAMLC,IAAAA,QANK;AAOLC,IAAAA,IAAI,GAAG,SAPF;AAQLC,IAAAA,KARK;AASLC,IAAAA,UAAU,GAAG,KATR;AAULC,IAAAA,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AQ,WAAR,YAAAA,QAAQ,CAAIsB,SAAJ,CAAR;AACA,KAJF;AAKC,IAAA,OAAO,MALR;AAMC,IAAA,OAAO,EAAC,WANT;AAOC,IAAA,IAAI,EAAGrB;AAPR,KASGrC,EAAE,CAAE,OAAF,CATL,CADD,CAxDF,CAtEF,CAjCD,CADD;AAmLA,CA3SD;;AA6SA,OAAO,MAAM4E,cAAc,GAAGvE,UAAU,CAAEwB,yBAAF,CAAjC;AAEP,eAAe+C,cAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\nimport { useState, useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport RangeControl from '../range-control';\nimport { Flex, FlexItem } from '../flex';\nimport {\n\tdefault as UnitControl,\n\tparseQuantityAndUnitFromRawValue,\n\tuseCustomUnits,\n} from '../unit-control';\nimport CustomSelectControl from '../custom-select-control';\nimport { VisuallyHidden } from '../visually-hidden';\nimport {\n\tToggleGroupControl,\n\tToggleGroupControlOption,\n} from '../toggle-group-control';\nimport {\n\tgetFontSizeOptions,\n\tgetSelectedOption,\n\tisSimpleCssValue,\n\tCUSTOM_FONT_SIZE,\n} from './utils';\nimport { HStack } from '../h-stack';\nimport type {\n\tFontSizePickerProps,\n\tFontSizeSelectOption,\n\tFontSizeToggleGroupOption,\n} from './types';\nimport {\n\tContainer,\n\tHeaderHint,\n\tHeaderLabel,\n\tControls,\n\tResetButton,\n} from './styles';\nimport { Spacer } from '../spacer';\n\nconst UnforwardedFontSizePicker = (\n\tprops: FontSizePickerProps,\n\tref: ForwardedRef< any >\n) => {\n\tconst {\n\t\t/** Start opting into the new margin-free styles that will become the default in a future version. */\n\t\t__nextHasNoMarginBottom = false,\n\t\tfallbackFontSize,\n\t\tfontSizes = [],\n\t\tdisableCustomFontSizes = false,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tvalue,\n\t\twithSlider = false,\n\t\twithReset = true,\n\t} = props;\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\tdeprecated( 'Bottom margin styles for wp.components.FontSizePicker', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.4',\n\t\t\thint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.',\n\t\t} );\n\t}\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: [ 'px', 'em', 'rem' ],\n\t} );\n\n\t/**\n\t * The main font size UI displays a toggle group when the presets are less\n\t * than six and a select control when they are more.\n\t */\n\tconst fontSizesContainComplexValues = fontSizes.some(\n\t\t( { size: sizeArg } ) => ! isSimpleCssValue( sizeArg )\n\t);\n\tconst shouldUseSelectControl = fontSizes.length > 5;\n\tconst options = useMemo(\n\t\t() =>\n\t\t\tgetFontSizeOptions(\n\t\t\t\tshouldUseSelectControl,\n\t\t\t\tfontSizes,\n\t\t\t\tdisableCustomFontSizes\n\t\t\t),\n\t\t[ shouldUseSelectControl, fontSizes, disableCustomFontSizes ]\n\t);\n\tconst selectedOption = getSelectedOption( fontSizes, value );\n\tconst isCustomValue = selectedOption.slug === CUSTOM_FONT_SIZE;\n\tconst [ showCustomValueControl, setShowCustomValueControl ] = useState(\n\t\t! disableCustomFontSizes && isCustomValue\n\t);\n\tconst headerHint = useMemo( () => {\n\t\tif ( showCustomValueControl ) {\n\t\t\treturn `(${ __( 'Custom' ) })`;\n\t\t}\n\n\t\t// If we have a custom value that is not available in the font sizes,\n\t\t// show it as a hint as long as it's a simple CSS value.\n\t\tif ( isCustomValue ) {\n\t\t\treturn (\n\t\t\t\tvalue !== undefined &&\n\t\t\t\tisSimpleCssValue( value ) &&\n\t\t\t\t`(${ value })`\n\t\t\t);\n\t\t}\n\t\tif ( shouldUseSelectControl ) {\n\t\t\treturn (\n\t\t\t\tselectedOption?.size !== undefined &&\n\t\t\t\tisSimpleCssValue( selectedOption?.size ) &&\n\t\t\t\t`(${ selectedOption?.size })`\n\t\t\t);\n\t\t}\n\n\t\t// Calculate the `hint` for toggle group control.\n\t\tlet hint = selectedOption?.name || selectedOption.slug;\n\t\tif (\n\t\t\t! fontSizesContainComplexValues &&\n\t\t\ttypeof selectedOption.size === 'string'\n\t\t) {\n\t\t\tconst [ , unit ] = parseQuantityAndUnitFromRawValue(\n\t\t\t\tselectedOption.size,\n\t\t\t\tunits\n\t\t\t);\n\t\t\thint += `(${ unit })`;\n\t\t}\n\t\treturn hint;\n\t}, [\n\t\tshowCustomValueControl,\n\t\tselectedOption?.name,\n\t\tselectedOption?.size,\n\t\tvalue,\n\t\tisCustomValue,\n\t\tshouldUseSelectControl,\n\t\tfontSizesContainComplexValues,\n\t] );\n\n\tif ( ! options ) {\n\t\treturn null;\n\t}\n\n\t// This is used for select control only. We need to add support\n\t// for ToggleGroupControl.\n\tconst currentFontSizeSR = sprintf(\n\t\t// translators: %s: Currently selected font size.\n\t\t__( 'Currently selected font size: %s' ),\n\t\tselectedOption.name\n\t);\n\n\t// If neither the value or first font size is a string, then FontSizePicker\n\t// operates in a legacy \"unitless\" mode where UnitControl can only be used\n\t// to select px values and onChange() is always called with number values.\n\tconst hasUnits =\n\t\ttypeof value === 'string' || typeof fontSizes[ 0 ]?.size === 'string';\n\n\tconst [ valueQuantity, valueUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tvalue,\n\t\tunits\n\t);\n\tconst isValueUnitRelative =\n\t\t!! valueUnit && [ 'em', 'rem' ].includes( valueUnit );\n\n\treturn (\n\t\t<Container ref={ ref } className=\"components-font-size-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Font size' ) }</VisuallyHidden>\n\t\t\t<Spacer>\n\t\t\t\t<HStack className=\"components-font-size-picker__header\">\n\t\t\t\t\t<HeaderLabel\n\t\t\t\t\t\taria-label={ `${ __( 'Size' ) } ${ headerHint || '' }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Size' ) }\n\t\t\t\t\t\t{ headerHint && (\n\t\t\t\t\t\t\t<HeaderHint className=\"components-font-size-picker__header__hint\">\n\t\t\t\t\t\t\t\t{ headerHint }\n\t\t\t\t\t\t\t</HeaderHint>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HeaderLabel>\n\t\t\t\t\t{ ! disableCustomFontSizes && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tshowCustomValueControl\n\t\t\t\t\t\t\t\t\t? __( 'Use size preset' )\n\t\t\t\t\t\t\t\t\t: __( 'Set custom size' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ settings }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetShowCustomValueControl(\n\t\t\t\t\t\t\t\t\t! showCustomValueControl\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisPressed={ showCustomValueControl }\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t</Spacer>\n\t\t\t<Controls\n\t\t\t\tclassName=\"components-font-size-picker__controls\"\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t>\n\t\t\t\t{ !! fontSizes.length &&\n\t\t\t\t\tshouldUseSelectControl &&\n\t\t\t\t\t! showCustomValueControl && (\n\t\t\t\t\t\t<CustomSelectControl\n\t\t\t\t\t\t\t__nextUnconstrainedWidth\n\t\t\t\t\t\t\tclassName=\"components-font-size-picker__select\"\n\t\t\t\t\t\t\tlabel={ __( 'Font size' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tdescribedBy={ currentFontSizeSR }\n\t\t\t\t\t\t\toptions={ options as FontSizeSelectOption[] }\n\t\t\t\t\t\t\tvalue={ ( options as FontSizeSelectOption[] ).find(\n\t\t\t\t\t\t\t\t( option ) => option.key === selectedOption.slug\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonChange={ ( {\n\t\t\t\t\t\t\t\tselectedItem,\n\t\t\t\t\t\t\t}: {\n\t\t\t\t\t\t\t\tselectedItem: FontSizeSelectOption;\n\t\t\t\t\t\t\t} ) => {\n\t\t\t\t\t\t\t\tif ( selectedItem.size === undefined ) {\n\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t? selectedItem.size\n\t\t\t\t\t\t\t\t\t\t\t: Number( selectedItem.size )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( selectedItem.key === CUSTOM_FONT_SIZE ) {\n\t\t\t\t\t\t\t\t\tsetShowCustomValueControl( true );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t{ ! shouldUseSelectControl && ! showCustomValueControl && (\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t\t\tlabel={ __( 'Font size' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\thasUnits ? newValue : Number( newValue )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( options as FontSizeToggleGroupOption[] ).map(\n\t\t\t\t\t\t\t( option ) => (\n\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\tkey={ option.key }\n\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\tlabel={ option.label }\n\t\t\t\t\t\t\t\t\taria-label={ option.name }\n\t\t\t\t\t\t\t\t\tshowTooltip={ true }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t) }\n\t\t\t\t{ ! disableCustomFontSizes && showCustomValueControl && (\n\t\t\t\t\t<Flex className=\"components-font-size-picker__custom-size-control\">\n\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t\t: parseInt( newValue, 10 )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\tunits={ hasUnits ? units : [] }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t{ withSlider && (\n\t\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t\t<Spacer marginX={ 2 } marginBottom={ 0 }>\n\t\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom={\n\t\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tclassName=\"components-font-size-picker__custom-input\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Custom Size' ) }\n\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\tvalue={ valueQuantity }\n\t\t\t\t\t\t\t\t\t\tinitialPosition={ fallbackFontSize }\n\t\t\t\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t\t\t} else if ( hasUnits ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewValue +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( valueUnit ?? 'px' )\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( newValue );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\t\tmax={ isValueUnitRelative ? 10 : 100 }\n\t\t\t\t\t\t\t\t\t\tstep={ isValueUnitRelative ? 0.1 : 1 }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ withReset && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<ResetButton\n\t\t\t\t\t\t\t\t\tdisabled={ value === undefined }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t</ResetButton>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Flex>\n\t\t\t\t) }\n\t\t\t</Controls>\n\t\t</Container>\n\t);\n};\n\nexport const FontSizePicker = forwardRef( UnforwardedFontSizePicker );\n\nexport default FontSizePicker;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/font-size-picker/index.tsx"],"names":["deprecated","__","settings","useState","useMemo","forwardRef","Button","RangeControl","Flex","FlexItem","default","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits","VisuallyHidden","getCommonSizeUnit","HStack","Container","HeaderHint","HeaderLabel","Controls","ResetButton","Spacer","FontSizePickerSelect","FontSizePickerToggleGroup","T_SHIRT_NAMES","UnforwardedFontSizePicker","props","ref","__nextHasNoMarginBottom","fallbackFontSize","fontSizes","disableCustomFontSizes","onChange","size","value","withSlider","withReset","since","version","hint","units","availableUnits","shouldUseSelectControl","length","selectedFontSize","find","fontSize","isCustomValue","showCustomValueControl","setShowCustomValueControl","headerHint","name","indexOf","commonUnit","hasUnits","valueQuantity","valueUnit","isValueUnitRelative","includes","newValue","undefined","Number","parseInt","FontSizePicker"],"mappings":";;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,Q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AAAA,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CACP2B,QAAQ,IACLH,SADK,aACLA,SADK,cACLA,SADK,GACQ,IADR,CADD,CAAR;AAIA,OALM,MAKA;AACNxB,QAAAA,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAI2B,QAAJ,CAAR;AACA;AACD,KArBF;AAsBC,IAAA,GAAG,EAAG,CAtBP;AAuBC,IAAA,GAAG,EAAGF,mBAAmB,GAAG,EAAH,GAAQ,GAvBlC;AAwBC,IAAA,IAAI,EAAGA,mBAAmB,GAAG,GAAH,GAAS;AAxBpC,IADD,CADD,CAxBF,EAuDGrB,SAAS,IACV,cAAC,QAAD,QACC,cAAC,WAAD;AACC,IAAA,QAAQ,EAAGF,KAAK,KAAK0B,SADtB;AAEC,IAAA,OAAO,EAAG,MAAM;AACf5B,MAAAA,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAI4B,SAAJ,CAAR;AACA,KAJF;AAKC,IAAA,OAAO,MALR;AAMC,IAAA,OAAO,EAAC,WANT;AAOC,IAAA,IAAI,EAAG3B;AAPR,KASGjC,EAAE,CAAE,OAAF,CATL,CADD,CAxDF,CAtDF,CAjCD,CADD;AAmKA,CAvPD;;AAyPA,OAAO,MAAM+D,cAAc,GAAG3D,UAAU,CAAEqB,yBAAF,CAAjC;AAEP,eAAesC,cAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { __ } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\nimport { useState, useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport RangeControl from '../range-control';\nimport { Flex, FlexItem } from '../flex';\nimport {\n\tdefault as UnitControl,\n\tparseQuantityAndUnitFromRawValue,\n\tuseCustomUnits,\n} from '../unit-control';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { getCommonSizeUnit } from './utils';\nimport { HStack } from '../h-stack';\nimport type { FontSizePickerProps } from './types';\nimport {\n\tContainer,\n\tHeaderHint,\n\tHeaderLabel,\n\tControls,\n\tResetButton,\n} from './styles';\nimport { Spacer } from '../spacer';\nimport FontSizePickerSelect from './font-size-picker-select';\nimport FontSizePickerToggleGroup from './font-size-picker-toggle-group';\nimport { T_SHIRT_NAMES } from './constants';\n\nconst UnforwardedFontSizePicker = (\n\tprops: FontSizePickerProps,\n\tref: ForwardedRef< any >\n) => {\n\tconst {\n\t\t/** Start opting into the new margin-free styles that will become the default in a future version. */\n\t\t__nextHasNoMarginBottom = false,\n\t\tfallbackFontSize,\n\t\tfontSizes = [],\n\t\tdisableCustomFontSizes = false,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tvalue,\n\t\twithSlider = false,\n\t\twithReset = true,\n\t} = props;\n\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\tdeprecated( 'Bottom margin styles for wp.components.FontSizePicker', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.4',\n\t\t\thint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.',\n\t\t} );\n\t}\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: [ 'px', 'em', 'rem' ],\n\t} );\n\n\tconst shouldUseSelectControl = fontSizes.length > 5;\n\tconst selectedFontSize = fontSizes.find(\n\t\t( fontSize ) => fontSize.size === value\n\t);\n\tconst isCustomValue = !! value && ! selectedFontSize;\n\n\tconst [ showCustomValueControl, setShowCustomValueControl ] = useState(\n\t\t! disableCustomFontSizes && isCustomValue\n\t);\n\n\tconst headerHint = useMemo( () => {\n\t\tif ( showCustomValueControl ) {\n\t\t\treturn __( 'Custom' );\n\t\t}\n\n\t\tif ( ! shouldUseSelectControl ) {\n\t\t\tif ( selectedFontSize ) {\n\t\t\t\treturn (\n\t\t\t\t\tselectedFontSize.name ||\n\t\t\t\t\tT_SHIRT_NAMES[ fontSizes.indexOf( selectedFontSize ) ]\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\tconst commonUnit = getCommonSizeUnit( fontSizes );\n\t\tif ( commonUnit ) {\n\t\t\treturn `(${ commonUnit })`;\n\t\t}\n\n\t\treturn '';\n\t}, [\n\t\tshowCustomValueControl,\n\t\tshouldUseSelectControl,\n\t\tselectedFontSize,\n\t\tfontSizes,\n\t] );\n\n\tif ( fontSizes.length === 0 && disableCustomFontSizes ) {\n\t\treturn null;\n\t}\n\n\t// If neither the value or first font size is a string, then FontSizePicker\n\t// operates in a legacy \"unitless\" mode where UnitControl can only be used\n\t// to select px values and onChange() is always called with number values.\n\tconst hasUnits =\n\t\ttypeof value === 'string' || typeof fontSizes[ 0 ]?.size === 'string';\n\n\tconst [ valueQuantity, valueUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tvalue,\n\t\tunits\n\t);\n\tconst isValueUnitRelative =\n\t\t!! valueUnit && [ 'em', 'rem' ].includes( valueUnit );\n\n\treturn (\n\t\t<Container ref={ ref } className=\"components-font-size-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Font size' ) }</VisuallyHidden>\n\t\t\t<Spacer>\n\t\t\t\t<HStack className=\"components-font-size-picker__header\">\n\t\t\t\t\t<HeaderLabel\n\t\t\t\t\t\taria-label={ `${ __( 'Size' ) } ${ headerHint || '' }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Size' ) }\n\t\t\t\t\t\t{ headerHint && (\n\t\t\t\t\t\t\t<HeaderHint className=\"components-font-size-picker__header__hint\">\n\t\t\t\t\t\t\t\t{ headerHint }\n\t\t\t\t\t\t\t</HeaderHint>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HeaderLabel>\n\t\t\t\t\t{ ! disableCustomFontSizes && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tshowCustomValueControl\n\t\t\t\t\t\t\t\t\t? __( 'Use size preset' )\n\t\t\t\t\t\t\t\t\t: __( 'Set custom size' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ settings }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetShowCustomValueControl(\n\t\t\t\t\t\t\t\t\t! showCustomValueControl\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisPressed={ showCustomValueControl }\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t</Spacer>\n\t\t\t<Controls\n\t\t\t\tclassName=\"components-font-size-picker__controls\"\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t>\n\t\t\t\t{ !! fontSizes.length &&\n\t\t\t\t\tshouldUseSelectControl &&\n\t\t\t\t\t! showCustomValueControl && (\n\t\t\t\t\t\t<FontSizePickerSelect\n\t\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t: Number( newValue ),\n\t\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonSelectCustom={ () =>\n\t\t\t\t\t\t\t\tsetShowCustomValueControl( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t{ ! shouldUseSelectControl && ! showCustomValueControl && (\n\t\t\t\t\t<FontSizePickerToggleGroup\n\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\thasUnits ? newValue : Number( newValue ),\n\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! disableCustomFontSizes && showCustomValueControl && (\n\t\t\t\t\t<Flex className=\"components-font-size-picker__custom-size-control\">\n\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t\t: parseInt( newValue, 10 )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\tunits={ hasUnits ? units : [] }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t{ withSlider && (\n\t\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t\t<Spacer marginX={ 2 } marginBottom={ 0 }>\n\t\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom={\n\t\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tclassName=\"components-font-size-picker__custom-input\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Custom Size' ) }\n\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\tvalue={ valueQuantity }\n\t\t\t\t\t\t\t\t\t\tinitialPosition={ fallbackFontSize }\n\t\t\t\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t\t\t} else if ( hasUnits ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewValue +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( valueUnit ?? 'px' )\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( newValue );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\t\tmax={ isValueUnitRelative ? 10 : 100 }\n\t\t\t\t\t\t\t\t\t\tstep={ isValueUnitRelative ? 0.1 : 1 }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ withReset && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<ResetButton\n\t\t\t\t\t\t\t\t\tdisabled={ value === undefined }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t</ResetButton>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Flex>\n\t\t\t\t) }\n\t\t\t</Controls>\n\t\t</Container>\n\t);\n};\n\nexport const FontSizePicker = forwardRef( UnforwardedFontSizePicker );\n\nexport default FontSizePicker;\n"]}
|