@wordpress/components 27.4.0 → 27.6.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 +47 -1
- package/build/alignment-matrix-control/icon.js +2 -2
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/index.js +5 -3
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +8 -8
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build/alignment-matrix-control/utils.js +6 -2
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/angle-picker-control/index.js +2 -2
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/animate/index.js +4 -4
- package/build/animate/index.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +5 -3
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/index.js +21 -7
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/hooks.js +1 -4
- package/build/base-control/hooks.js.map +1 -1
- package/build/base-control/index.js +2 -2
- package/build/base-control/index.js.map +1 -1
- package/build/base-control/types.js.map +1 -1
- package/build/border-control/types.js.map +1 -1
- package/build/button/index.js +2 -2
- package/build/button/index.js.map +1 -1
- package/build/button-group/index.js +2 -2
- package/build/button-group/index.js.map +1 -1
- package/build/checkbox-control/index.js +11 -4
- package/build/checkbox-control/index.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-actions.js +3 -3
- package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-option-group.js +2 -2
- package/build/circular-option-picker/circular-option-picker-option-group.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-option.js +2 -2
- package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker.js +2 -2
- package/build/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build/clipboard-button/index.js +2 -2
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-indicator/index.js +2 -2
- package/build/color-indicator/index.js.map +1 -1
- package/build/color-palette/index.js +2 -2
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/hex-input.js +3 -1
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/hue-picker.native.js +6 -2
- package/build/color-picker/hue-picker.native.js.map +1 -1
- package/build/color-picker/index.native.js +9 -3
- package/build/color-picker/index.native.js.map +1 -1
- package/build/color-picker/saturation-picker.native.js +6 -2
- package/build/color-picker/saturation-picker.native.js.map +1 -1
- package/build/color-picker/use-deprecated-props.js +9 -3
- package/build/color-picker/use-deprecated-props.js.map +1 -1
- package/build/combobox-control/index.js +7 -2
- package/build/combobox-control/index.js.map +1 -1
- package/build/combobox-control/types.js.map +1 -1
- package/build/context/context-connect.js +6 -2
- package/build/context/context-connect.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js +3 -3
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/index.js +2 -2
- package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-select-control/index.js +3 -3
- package/build/custom-select-control/index.js.map +1 -1
- package/build/custom-select-control-v2/legacy-component/index.js +3 -1
- package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
- package/build/dimension-control/index.js +2 -2
- package/build/dimension-control/index.js.map +1 -1
- package/build/drop-zone/index.js +74 -66
- package/build/drop-zone/index.js.map +1 -1
- package/build/dropdown/index.js +2 -2
- package/build/dropdown/index.js.map +1 -1
- package/build/dropdown/styles.js +5 -3
- package/build/dropdown/styles.js.map +1 -1
- package/build/dropdown-menu/index.js +5 -5
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu/index.native.js +4 -4
- package/build/dropdown-menu/index.native.js.map +1 -1
- package/build/duotone-picker/utils.js +3 -1
- package/build/duotone-picker/utils.js.map +1 -1
- package/build/elevation/hook.js +5 -6
- package/build/elevation/hook.js.map +1 -1
- package/build/external-link/index.js +2 -2
- package/build/external-link/index.js.map +1 -1
- package/build/focal-point-picker/controls.js +3 -1
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/focal-point.js +2 -2
- package/build/focal-point-picker/focal-point.js.map +1 -1
- package/build/focal-point-picker/index.js +23 -9
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-picker-style.js +12 -12
- package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build/focal-point-picker/tooltip/index.native.js +3 -8
- package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build/focal-point-picker/utils.js +3 -1
- package/build/focal-point-picker/utils.js.map +1 -1
- package/build/font-size-picker/index.js +3 -2
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/types.js.map +1 -1
- package/build/form-toggle/index.js +2 -2
- package/build/form-toggle/index.js.map +1 -1
- package/build/form-token-field/index.js +3 -3
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +9 -5
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/form-token-field/token-input.js +2 -2
- package/build/form-token-field/token-input.js.map +1 -1
- package/build/form-token-field/token.js +2 -2
- package/build/form-token-field/token.js.map +1 -1
- package/build/guide/index.js +2 -2
- package/build/guide/index.js.map +1 -1
- package/build/input-control/index.js +3 -6
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-field.js +3 -1
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/label.js +3 -1
- package/build/input-control/label.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +31 -23
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/input-control/utils.js +8 -4
- package/build/input-control/utils.js.map +1 -1
- package/build/item-group/item/hook.js +0 -4
- package/build/item-group/item/hook.js.map +1 -1
- package/build/menu-group/index.js +2 -2
- package/build/menu-group/index.js.map +1 -1
- package/build/menu-item/index.js +3 -3
- package/build/menu-item/index.js.map +1 -1
- package/build/mobile/color-settings/utils.native.js +1 -1
- package/build/mobile/color-settings/utils.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js +3 -1
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.android.js +9 -3
- package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.ios.js +15 -13
- package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/shared.native.js +33 -0
- package/build/mobile/keyboard-aware-flat-list/shared.native.js.map +1 -0
- package/build/modal/aria-helper.js +9 -3
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +10 -6
- package/build/modal/index.js.map +1 -1
- package/build/navigation/back-button/index.js +2 -2
- package/build/navigation/back-button/index.js.map +1 -1
- package/build/navigation/group/index.js +2 -2
- package/build/navigation/group/index.js.map +1 -1
- package/build/navigation/index.js +3 -3
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/item/base.js +2 -2
- package/build/navigation/item/base.js.map +1 -1
- package/build/navigation/item/index.js +2 -2
- package/build/navigation/item/index.js.map +1 -1
- package/build/navigation/menu/index.js +2 -2
- package/build/navigation/menu/index.js.map +1 -1
- package/build/navigation/styles/navigation-styles.js +12 -12
- package/build/navigation/styles/navigation-styles.js.map +1 -1
- package/build/notice/index.js +3 -3
- package/build/notice/index.js.map +1 -1
- package/build/notice/list.js +2 -2
- package/build/notice/list.js.map +1 -1
- package/build/number-control/index.js +2 -2
- package/build/number-control/index.js.map +1 -1
- package/build/palette-edit/index.js +5 -5
- package/build/palette-edit/index.js.map +1 -1
- package/build/palette-edit/styles.js +14 -15
- package/build/palette-edit/styles.js.map +1 -1
- package/build/panel/body.js +5 -3
- package/build/panel/body.js.map +1 -1
- package/build/panel/index.js +2 -2
- package/build/panel/index.js.map +1 -1
- package/build/panel/row.js +2 -2
- package/build/panel/row.js.map +1 -1
- package/build/placeholder/index.js +3 -3
- package/build/placeholder/index.js.map +1 -1
- package/build/popover/index.js +5 -3
- package/build/popover/index.js.map +1 -1
- package/build/popover/overlay-middlewares.js +3 -1
- package/build/popover/overlay-middlewares.js.map +1 -1
- package/build/query-controls/author-select.js +3 -1
- package/build/query-controls/author-select.js.map +1 -1
- package/build/radio-control/index.js +2 -2
- package/build/radio-control/index.js.map +1 -1
- package/build/range-control/index.js +3 -3
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/mark.js +3 -3
- package/build/range-control/mark.js.map +1 -1
- package/build/range-control/rail.js +1 -1
- package/build/range-control/rail.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +29 -29
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/range-control/tooltip.js +2 -2
- package/build/range-control/tooltip.js.map +1 -1
- package/build/resizable-box/index.js +10 -10
- package/build/resizable-box/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/index.js +5 -3
- package/build/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/label.js +3 -1
- package/build/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js +12 -4
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/responsive-wrapper/index.js +2 -2
- package/build/responsive-wrapper/index.js.map +1 -1
- package/build/search-control/index.js +2 -2
- package/build/search-control/index.js.map +1 -1
- package/build/select-control/index.js +5 -3
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +8 -6
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js +3 -3
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +3 -3
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/use-slot-fills.js +2 -2
- package/build/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/use-slot.js +2 -2
- package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build/slot-fill/types.js.map +1 -1
- package/build/snackbar/index.js +3 -3
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js +2 -2
- package/build/snackbar/list.js.map +1 -1
- package/build/spinner/index.js +2 -2
- package/build/spinner/index.js.map +1 -1
- package/build/tab-panel/index.js +2 -2
- package/build/tab-panel/index.js.map +1 -1
- package/build/text/get-line-height.js +6 -2
- package/build/text/get-line-height.js.map +1 -1
- package/build/text/utils.js +6 -2
- package/build/text/utils.js.map +1 -1
- package/build/text-control/index.js +2 -2
- package/build/text-control/index.js.map +1 -1
- package/build/theme/color-algorithms.js +6 -2
- package/build/theme/color-algorithms.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +3 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build/toolbar/toolbar/index.js +2 -2
- package/build/toolbar/toolbar/index.js.map +1 -1
- package/build/toolbar/toolbar-button/index.js +3 -3
- package/build/toolbar/toolbar-button/index.js.map +1 -1
- package/build/toolbar/toolbar-group/index.js +2 -2
- package/build/toolbar/toolbar-group/index.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +5 -6
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +6 -8
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tools-panel/types.js.map +1 -1
- package/build/tree-grid/roving-tab-index-item.js +3 -1
- package/build/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build/truncate/hook.js +1 -1
- package/build/truncate/hook.js.map +1 -1
- package/build/unit-control/index.js +5 -3
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/unit-select-control.js +2 -2
- package/build/unit-control/unit-select-control.js.map +1 -1
- package/build/utils/colors.js +21 -7
- package/build/utils/colors.js.map +1 -1
- package/build/utils/font-size.js +3 -1
- package/build/utils/font-size.js.map +1 -1
- package/build/utils/get-valid-children.js +3 -1
- package/build/utils/get-valid-children.js.map +1 -1
- package/build/utils/input/base.js +2 -3
- package/build/utils/input/base.js.map +1 -1
- package/build/utils/strings.js +11 -57
- package/build/utils/strings.js.map +1 -1
- package/build/utils/use-responsive-value.js +3 -1
- package/build/utils/use-responsive-value.js.map +1 -1
- package/build/view/component.js +26 -8
- package/build/view/component.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js +2 -2
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +5 -3
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js +6 -2
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/index.js +2 -2
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/animate/index.js +4 -4
- package/build-module/animate/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +5 -3
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/index.js +21 -7
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/hooks.js +1 -4
- package/build-module/base-control/hooks.js.map +1 -1
- package/build-module/base-control/index.js +2 -2
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/base-control/types.js.map +1 -1
- package/build-module/border-control/types.js.map +1 -1
- package/build-module/button/index.js +2 -2
- package/build-module/button/index.js.map +1 -1
- package/build-module/button-group/index.js +2 -2
- package/build-module/button-group/index.js.map +1 -1
- package/build-module/checkbox-control/index.js +11 -4
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-actions.js +3 -3
- package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option-group.js +2 -2
- package/build-module/circular-option-picker/circular-option-picker-option-group.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +2 -2
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker.js +2 -2
- package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build-module/clipboard-button/index.js +2 -2
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-indicator/index.js +2 -2
- package/build-module/color-indicator/index.js.map +1 -1
- package/build-module/color-palette/index.js +2 -2
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/hex-input.js +3 -1
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/hue-picker.native.js +6 -2
- package/build-module/color-picker/hue-picker.native.js.map +1 -1
- package/build-module/color-picker/index.native.js +9 -3
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/color-picker/saturation-picker.native.js +6 -2
- package/build-module/color-picker/saturation-picker.native.js.map +1 -1
- package/build-module/color-picker/use-deprecated-props.js +9 -3
- package/build-module/color-picker/use-deprecated-props.js.map +1 -1
- package/build-module/combobox-control/index.js +7 -2
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/combobox-control/types.js.map +1 -1
- package/build-module/context/context-connect.js +6 -2
- package/build-module/context/context-connect.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +3 -3
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/index.js +2 -2
- package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-select-control/index.js +3 -3
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/custom-select-control-v2/legacy-component/index.js +3 -1
- package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
- package/build-module/dimension-control/index.js +2 -2
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/drop-zone/index.js +74 -66
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/dropdown/index.js +2 -2
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/dropdown/styles.js +5 -3
- package/build-module/dropdown/styles.js.map +1 -1
- package/build-module/dropdown-menu/index.js +5 -5
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +4 -4
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/duotone-picker/utils.js +3 -1
- package/build-module/duotone-picker/utils.js.map +1 -1
- package/build-module/elevation/hook.js +6 -7
- package/build-module/elevation/hook.js.map +1 -1
- package/build-module/external-link/index.js +2 -2
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +3 -1
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.js +2 -2
- package/build-module/focal-point-picker/focal-point.js.map +1 -1
- package/build-module/focal-point-picker/index.js +23 -9
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js +13 -13
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build-module/focal-point-picker/tooltip/index.native.js +3 -8
- package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build-module/focal-point-picker/utils.js +3 -1
- package/build-module/focal-point-picker/utils.js.map +1 -1
- package/build-module/font-size-picker/index.js +3 -2
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/types.js.map +1 -1
- package/build-module/form-toggle/index.js +2 -2
- package/build-module/form-toggle/index.js.map +1 -1
- package/build-module/form-token-field/index.js +3 -3
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +9 -5
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/form-token-field/token-input.js +2 -2
- package/build-module/form-token-field/token-input.js.map +1 -1
- package/build-module/form-token-field/token.js +2 -2
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/guide/index.js +2 -2
- package/build-module/guide/index.js.map +1 -1
- package/build-module/input-control/index.js +3 -6
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-field.js +3 -1
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/label.js +3 -1
- package/build-module/input-control/label.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +31 -23
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/input-control/utils.js +8 -4
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/item-group/item/hook.js +0 -4
- package/build-module/item-group/item/hook.js.map +1 -1
- package/build-module/menu-group/index.js +2 -2
- package/build-module/menu-group/index.js.map +1 -1
- package/build-module/menu-item/index.js +3 -3
- package/build-module/menu-item/index.js.map +1 -1
- package/build-module/mobile/color-settings/utils.native.js +1 -1
- package/build-module/mobile/color-settings/utils.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js +3 -1
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js +9 -3
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +16 -15
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/shared.native.js +27 -0
- package/build-module/mobile/keyboard-aware-flat-list/shared.native.js.map +1 -0
- package/build-module/modal/aria-helper.js +9 -3
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +10 -6
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigation/back-button/index.js +2 -2
- package/build-module/navigation/back-button/index.js.map +1 -1
- package/build-module/navigation/group/index.js +2 -2
- package/build-module/navigation/group/index.js.map +1 -1
- package/build-module/navigation/index.js +3 -3
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/item/base.js +2 -2
- package/build-module/navigation/item/base.js.map +1 -1
- package/build-module/navigation/item/index.js +2 -2
- package/build-module/navigation/item/index.js.map +1 -1
- package/build-module/navigation/menu/index.js +2 -2
- package/build-module/navigation/menu/index.js.map +1 -1
- package/build-module/navigation/styles/navigation-styles.js +13 -13
- package/build-module/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/notice/index.js +3 -3
- package/build-module/notice/index.js.map +1 -1
- package/build-module/notice/list.js +2 -2
- package/build-module/notice/list.js.map +1 -1
- package/build-module/number-control/index.js +2 -2
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/palette-edit/index.js +6 -6
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/palette-edit/styles.js +13 -14
- package/build-module/palette-edit/styles.js.map +1 -1
- package/build-module/panel/body.js +5 -3
- package/build-module/panel/body.js.map +1 -1
- package/build-module/panel/index.js +2 -2
- package/build-module/panel/index.js.map +1 -1
- package/build-module/panel/row.js +2 -2
- package/build-module/panel/row.js.map +1 -1
- package/build-module/placeholder/index.js +3 -3
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/popover/index.js +5 -3
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/overlay-middlewares.js +3 -1
- package/build-module/popover/overlay-middlewares.js.map +1 -1
- package/build-module/query-controls/author-select.js +3 -1
- package/build-module/query-controls/author-select.js.map +1 -1
- package/build-module/radio-control/index.js +2 -2
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/range-control/index.js +3 -3
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/mark.js +3 -3
- package/build-module/range-control/mark.js.map +1 -1
- package/build-module/range-control/rail.js +1 -1
- package/build-module/range-control/rail.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +30 -30
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/range-control/tooltip.js +2 -2
- package/build-module/range-control/tooltip.js.map +1 -1
- package/build-module/resizable-box/index.js +10 -10
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +5 -3
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/label.js +3 -1
- package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js +12 -4
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/responsive-wrapper/index.js +2 -2
- package/build-module/responsive-wrapper/index.js.map +1 -1
- package/build-module/search-control/index.js +2 -2
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/select-control/index.js +5 -3
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +8 -6
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +2 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build-module/slot-fill/types.js.map +1 -1
- package/build-module/snackbar/index.js +3 -3
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +2 -2
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/spinner/index.js +2 -2
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/tab-panel/index.js +2 -2
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/text/get-line-height.js +6 -2
- package/build-module/text/get-line-height.js.map +1 -1
- package/build-module/text/utils.js +6 -2
- package/build-module/text/utils.js.map +1 -1
- package/build-module/text-control/index.js +2 -2
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/theme/color-algorithms.js +6 -2
- package/build-module/theme/color-algorithms.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +3 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +10 -10
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build-module/toolbar/toolbar/index.js +2 -2
- package/build-module/toolbar/toolbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar-button/index.js +3 -3
- package/build-module/toolbar/toolbar-button/index.js.map +1 -1
- package/build-module/toolbar/toolbar-group/index.js +2 -2
- package/build-module/toolbar/toolbar-group/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +5 -6
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +6 -8
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tools-panel/types.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-item.js +3 -1
- package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build-module/truncate/hook.js +1 -1
- package/build-module/truncate/hook.js.map +1 -1
- package/build-module/unit-control/index.js +5 -3
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/unit-select-control.js +2 -2
- package/build-module/unit-control/unit-select-control.js.map +1 -1
- package/build-module/utils/colors.js +21 -7
- package/build-module/utils/colors.js.map +1 -1
- package/build-module/utils/font-size.js +3 -1
- package/build-module/utils/font-size.js.map +1 -1
- package/build-module/utils/get-valid-children.js +3 -1
- package/build-module/utils/get-valid-children.js.map +1 -1
- package/build-module/utils/input/base.js +2 -3
- package/build-module/utils/input/base.js.map +1 -1
- package/build-module/utils/strings.js +12 -57
- package/build-module/utils/strings.js.map +1 -1
- package/build-module/utils/use-responsive-value.js +3 -1
- package/build-module/utils/use-responsive-value.js.map +1 -1
- package/build-module/view/component.js +26 -8
- package/build-module/view/component.js.map +1 -1
- package/build-style/style-rtl.css +56 -55
- package/build-style/style.css +56 -55
- package/build-types/alignment-matrix-control/cell.d.ts +1 -1
- package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/icon.d.ts +1 -1
- package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/index.d.ts +1 -1
- package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/stories/index.story.d.ts +2 -2
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +4 -4
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts +4 -4
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/utils.d.ts.map +1 -1
- package/build-types/angle-picker-control/angle-circle.d.ts +1 -1
- package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
- package/build-types/angle-picker-control/index.d.ts +1 -1
- package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +4 -4
- package/build-types/animate/index.d.ts.map +1 -1
- package/build-types/autocomplete/autocompleter-ui.d.ts +1 -1
- package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts +3 -3
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/base-control/hooks.d.ts +1 -0
- package/build-types/base-control/hooks.d.ts.map +1 -1
- package/build-types/base-control/index.d.ts +2 -2
- package/build-types/base-control/index.d.ts.map +1 -1
- package/build-types/base-control/styles/base-control-styles.d.ts +5 -5
- package/build-types/base-control/types.d.ts +1 -2
- package/build-types/base-control/types.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +69 -59
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +70 -61
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +69 -59
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +69 -59
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-box-control/stories/index.story.d.ts +1 -1
- package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +1 -0
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +70 -59
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +69 -59
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/component.d.ts +1 -1
- package/build-types/border-control/stories/index.story.d.ts +12 -6
- package/build-types/border-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +4 -0
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/box-control/all-input-control.d.ts +1 -1
- package/build-types/box-control/all-input-control.d.ts.map +1 -1
- package/build-types/box-control/axial-input-controls.d.ts +1 -1
- package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
- package/build-types/box-control/icon.d.ts +1 -1
- package/build-types/box-control/icon.d.ts.map +1 -1
- package/build-types/box-control/index.d.ts +1 -1
- package/build-types/box-control/index.d.ts.map +1 -1
- package/build-types/box-control/input-controls.d.ts +1 -1
- package/build-types/box-control/input-controls.d.ts.map +1 -1
- package/build-types/box-control/linked-button.d.ts +1 -1
- package/build-types/box-control/linked-button.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts +439 -390
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-icon-styles.d.ts +6 -6
- package/build-types/box-control/styles/box-control-styles.d.ts +5 -5
- package/build-types/button/deprecated.d.ts +5 -51
- package/build-types/button/deprecated.d.ts.map +1 -1
- package/build-types/button/index.d.ts +1 -1
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts +1 -1
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/button-group/index.d.ts +1 -1
- package/build-types/button-group/index.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +69 -59
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/card-body/hook.d.ts +69 -59
- package/build-types/card/card-body/hook.d.ts.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +69 -59
- package/build-types/card/card-divider/hook.d.ts.map +1 -1
- package/build-types/card/card-footer/hook.d.ts +69 -59
- package/build-types/card/card-footer/hook.d.ts.map +1 -1
- package/build-types/card/card-header/hook.d.ts +69 -59
- package/build-types/card/card-header/hook.d.ts.map +1 -1
- package/build-types/card/card-media/hook.d.ts +69 -59
- package/build-types/card/card-media/hook.d.ts.map +1 -1
- package/build-types/card/stories/index.story.d.ts +2 -2
- package/build-types/checkbox-control/index.d.ts +1 -1
- package/build-types/checkbox-control/index.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-actions.d.ts +2 -2
- package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option.d.ts +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker.d.ts +1 -1
- package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
- package/build-types/clipboard-button/index.d.ts +1 -1
- package/build-types/clipboard-button/index.d.ts.map +1 -1
- package/build-types/color-indicator/index.d.ts +1 -1
- package/build-types/color-indicator/index.d.ts.map +1 -1
- package/build-types/color-palette/index.d.ts +1 -1
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +1 -1
- package/build-types/color-picker/color-copy-button.d.ts +1 -1
- package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
- package/build-types/color-picker/color-input.d.ts +1 -1
- package/build-types/color-picker/color-input.d.ts.map +1 -1
- package/build-types/color-picker/component.d.ts +2 -2
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/hex-input.d.ts +1 -1
- package/build-types/color-picker/hex-input.d.ts.map +1 -1
- package/build-types/color-picker/hsl-input.d.ts +1 -1
- package/build-types/color-picker/hsl-input.d.ts.map +1 -1
- package/build-types/color-picker/input-with-slider.d.ts +1 -1
- package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
- package/build-types/color-picker/legacy-adapter.d.ts +1 -1
- package/build-types/color-picker/legacy-adapter.d.ts.map +1 -1
- package/build-types/color-picker/picker.d.ts +1 -1
- package/build-types/color-picker/picker.d.ts.map +1 -1
- package/build-types/color-picker/rgb-input.d.ts +1 -1
- package/build-types/color-picker/rgb-input.d.ts.map +1 -1
- package/build-types/color-picker/stories/index.story.d.ts +1 -1
- package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +6 -6
- package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
- package/build-types/combobox-control/index.d.ts +3 -1
- package/build-types/combobox-control/index.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts +22 -2
- package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/combobox-control/styles.d.ts +1 -1
- package/build-types/combobox-control/types.d.ts +1 -0
- package/build-types/combobox-control/types.d.ts.map +1 -1
- package/build-types/composite/current/stories/utils.d.ts +1 -1
- package/build-types/composite/current/stories/utils.d.ts.map +1 -1
- package/build-types/composite/legacy/stories/utils.d.ts +1 -1
- package/build-types/composite/legacy/stories/utils.d.ts.map +1 -1
- package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
- package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/context/context-connect.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +2 -2
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/index.d.ts +1 -1
- package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +2 -2
- package/build-types/custom-select-control/index.d.ts +2 -2
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/custom-select.d.ts +1 -1
- package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/default-component/index.d.ts +1 -1
- package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/item.d.ts +1 -1
- package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/legacy-component/index.d.ts +1 -1
- package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/default.story.d.ts +3 -3
- package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/styles.d.ts +8 -8
- package/build-types/dashicon/index.d.ts +1 -1
- package/build-types/dashicon/index.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts +1 -1
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +5 -5
- package/build-types/date-time/date-time/styles.d.ts +1 -1
- package/build-types/date-time/time/index.d.ts +1 -1
- package/build-types/date-time/time/index.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +10 -10
- package/build-types/date-time/time/timezone.d.ts +1 -1
- package/build-types/date-time/time/timezone.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts +1 -1
- package/build-types/dimension-control/index.d.ts.map +1 -1
- package/build-types/disabled/index.d.ts +1 -1
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/disclosure/index.d.ts +1 -1
- package/build-types/disclosure/index.d.ts.map +1 -1
- package/build-types/divider/styles.d.ts +1 -1
- package/build-types/draggable/index.d.ts +1 -1
- package/build-types/draggable/index.d.ts.map +1 -1
- package/build-types/drop-zone/index.d.ts +1 -1
- package/build-types/drop-zone/index.d.ts.map +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown/index.d.ts +1 -1
- package/build-types/dropdown/index.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.story.d.ts +4 -4
- package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown/styles.d.ts +1 -1
- package/build-types/dropdown/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu/index.d.ts +1 -1
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
- package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/index.d.ts +7 -7
- package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/styles.d.ts +12 -12
- package/build-types/duotone-picker/color-list-picker/index.d.ts +1 -1
- package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
- package/build-types/duotone-picker/custom-duotone-bar.d.ts +1 -1
- package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -1
- package/build-types/duotone-picker/duotone-picker.d.ts +1 -1
- package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
- package/build-types/duotone-picker/duotone-swatch.d.ts +1 -1
- package/build-types/duotone-picker/duotone-swatch.d.ts.map +1 -1
- package/build-types/duotone-picker/utils.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +68 -58
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/flex/flex/hook.d.ts +69 -59
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/flex-block/hook.d.ts +69 -59
- package/build-types/flex/flex-block/hook.d.ts.map +1 -1
- package/build-types/flex/flex-item/hook.d.ts +69 -59
- package/build-types/flex/flex-item/hook.d.ts.map +1 -1
- package/build-types/focal-point-picker/controls.d.ts +1 -1
- package/build-types/focal-point-picker/controls.d.ts.map +1 -1
- package/build-types/focal-point-picker/focal-point.d.ts +1 -1
- package/build-types/focal-point-picker/focal-point.d.ts.map +1 -1
- package/build-types/focal-point-picker/grid.d.ts +1 -1
- package/build-types/focal-point-picker/grid.d.ts.map +1 -1
- package/build-types/focal-point-picker/index.d.ts +1 -1
- package/build-types/focal-point-picker/index.d.ts.map +1 -1
- package/build-types/focal-point-picker/media.d.ts +1 -1
- package/build-types/focal-point-picker/media.d.ts.map +1 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts +8 -8
- package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +9 -9
- 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 -1
- package/build-types/focal-point-picker/test/index.d.ts +2 -0
- package/build-types/focal-point-picker/test/index.d.ts.map +1 -0
- package/build-types/focal-point-picker/test/media.d.ts +2 -0
- package/build-types/focal-point-picker/test/media.d.ts.map +1 -0
- package/build-types/focal-point-picker/utils.d.ts.map +1 -1
- package/build-types/focusable-iframe/index.d.ts +1 -1
- package/build-types/focusable-iframe/index.d.ts.map +1 -1
- package/build-types/font-size-picker/font-size-picker-select.d.ts +1 -1
- package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
- package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts +1 -1
- package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts +4 -4
- package/build-types/font-size-picker/types.d.ts +2 -0
- package/build-types/font-size-picker/types.d.ts.map +1 -1
- package/build-types/form-file-upload/index.d.ts +1 -1
- package/build-types/form-file-upload/index.d.ts.map +1 -1
- package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
- package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
- package/build-types/form-toggle/index.d.ts +2 -2
- package/build-types/form-toggle/index.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/styles.d.ts +1 -1
- package/build-types/form-token-field/suggestions-list.d.ts +2 -1
- package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
- package/build-types/form-token-field/token-input.d.ts +2 -2
- package/build-types/form-token-field/token-input.d.ts.map +1 -1
- package/build-types/form-token-field/token.d.ts +1 -1
- package/build-types/form-token-field/token.d.ts.map +1 -1
- package/build-types/gradient-picker/index.d.ts +1 -1
- package/build-types/gradient-picker/index.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +69 -59
- package/build-types/grid/hook.d.ts.map +1 -1
- package/build-types/guide/icons.d.ts +1 -1
- package/build-types/guide/icons.d.ts.map +1 -1
- package/build-types/guide/index.d.ts +1 -1
- package/build-types/guide/index.d.ts.map +1 -1
- package/build-types/guide/page-control.d.ts +1 -1
- package/build-types/guide/page-control.d.ts.map +1 -1
- package/build-types/guide/page.d.ts +1 -1
- package/build-types/guide/page.d.ts.map +1 -1
- package/build-types/h-stack/hook.d.ts +69 -59
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts +69 -59
- package/build-types/heading/hook.d.ts.map +1 -1
- package/build-types/higher-order/navigate-regions/index.d.ts +1 -1
- package/build-types/higher-order/with-constrained-tabbing/index.d.ts +1 -1
- package/build-types/higher-order/with-constrained-tabbing/index.d.ts.map +1 -1
- package/build-types/higher-order/with-fallback-styles/index.d.ts +1 -1
- package/build-types/higher-order/with-filters/index.d.ts +2 -2
- package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
- package/build-types/higher-order/with-notices/index.d.ts +2 -2
- package/build-types/higher-order/with-spoken-messages/index.d.ts +1 -1
- package/build-types/icon/index.d.ts +1 -1
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/input-control/backdrop.d.ts +1 -1
- package/build-types/input-control/backdrop.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 +1 -1
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/label.d.ts +1 -1
- package/build-types/input-control/label.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts +2 -1
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +8 -8
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/utils.d.ts.map +1 -1
- package/build-types/isolated-event-container/index.d.ts +1 -1
- package/build-types/isolated-event-container/index.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +70 -60
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/hook.d.ts +69 -59
- package/build-types/item-group/item-group/hook.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/index.d.ts +1 -1
- package/build-types/keyboard-shortcuts/index.d.ts.map +1 -1
- package/build-types/menu-group/index.d.ts +1 -1
- package/build-types/menu-group/index.d.ts.map +1 -1
- package/build-types/menu-item/index.d.ts +1 -1
- package/build-types/menu-item/index.d.ts.map +1 -1
- package/build-types/menu-item/stories/index.story.d.ts +4 -4
- package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-items-choice/index.d.ts +1 -1
- package/build-types/menu-items-choice/index.d.ts.map +1 -1
- package/build-types/modal/aria-helper.d.ts.map +1 -1
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/navigable-container/container.d.ts +1 -1
- package/build-types/navigable-container/menu.d.ts +2 -2
- package/build-types/navigable-container/menu.d.ts.map +1 -1
- package/build-types/navigable-container/tabbable.d.ts +2 -2
- package/build-types/navigable-container/tabbable.d.ts.map +1 -1
- package/build-types/navigation/back-button/index.d.ts.map +1 -1
- package/build-types/navigation/group/index.d.ts +1 -1
- package/build-types/navigation/group/index.d.ts.map +1 -1
- package/build-types/navigation/index.d.ts +1 -1
- package/build-types/navigation/index.d.ts.map +1 -1
- package/build-types/navigation/item/base-content.d.ts +1 -1
- package/build-types/navigation/item/base-content.d.ts.map +1 -1
- package/build-types/navigation/item/base.d.ts +1 -1
- package/build-types/navigation/item/base.d.ts.map +1 -1
- package/build-types/navigation/item/index.d.ts +1 -1
- package/build-types/navigation/item/index.d.ts.map +1 -1
- package/build-types/navigation/menu/index.d.ts +1 -1
- package/build-types/navigation/menu/index.d.ts.map +1 -1
- package/build-types/navigation/menu/menu-title-search.d.ts +1 -1
- package/build-types/navigation/menu/menu-title.d.ts +1 -1
- package/build-types/navigation/menu/menu-title.d.ts.map +1 -1
- package/build-types/navigation/menu/search-no-results-found.d.ts +1 -1
- package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +11 -11
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +70 -61
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +70 -61
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/notice/index.d.ts +1 -1
- package/build-types/notice/index.d.ts.map +1 -1
- package/build-types/notice/list.d.ts +1 -1
- package/build-types/notice/list.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +1 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +1 -1
- package/build-types/number-control/stories/index.story.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts +1 -1
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/palette-edit/styles.d.ts +1009 -19
- package/build-types/palette-edit/styles.d.ts.map +1 -1
- package/build-types/panel/body.d.ts +1 -1
- package/build-types/panel/body.d.ts.map +1 -1
- package/build-types/panel/header.d.ts +1 -1
- package/build-types/panel/header.d.ts.map +1 -1
- package/build-types/placeholder/index.d.ts +1 -1
- package/build-types/placeholder/index.d.ts.map +1 -1
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/overlay-middlewares.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.story.d.ts +2 -2
- package/build-types/popover/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/test/utils/index.d.ts +1 -1
- package/build-types/popover/test/utils/index.d.ts.map +1 -1
- package/build-types/progress-bar/index.d.ts +1 -1
- package/build-types/progress-bar/index.d.ts.map +1 -1
- package/build-types/progress-bar/styles.d.ts +3 -3
- package/build-types/query-controls/author-select.d.ts +1 -1
- package/build-types/query-controls/author-select.d.ts.map +1 -1
- package/build-types/query-controls/category-select.d.ts +1 -1
- package/build-types/query-controls/category-select.d.ts.map +1 -1
- package/build-types/query-controls/index.d.ts +1 -1
- package/build-types/query-controls/index.d.ts.map +1 -1
- package/build-types/radio-control/index.d.ts +1 -1
- package/build-types/radio-control/index.d.ts.map +1 -1
- package/build-types/radio-group/index.d.ts +1 -1
- package/build-types/radio-group/index.d.ts.map +1 -1
- package/build-types/radio-group/radio.d.ts +1 -1
- package/build-types/radio-group/radio.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts +1 -1
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/input-range.d.ts +1 -1
- package/build-types/range-control/mark.d.ts +1 -1
- package/build-types/range-control/mark.d.ts.map +1 -1
- package/build-types/range-control/rail.d.ts +1 -1
- package/build-types/range-control/rail.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +15 -15
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/range-control/tooltip.d.ts +1 -1
- package/build-types/range-control/tooltip.d.ts.map +1 -1
- package/build-types/resizable-box/index.d.ts +3 -3
- package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +4 -4
- package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts +6 -6
- package/build-types/responsive-wrapper/index.d.ts +1 -1
- package/build-types/responsive-wrapper/index.d.ts.map +1 -1
- package/build-types/sandbox/index.d.ts +1 -1
- package/build-types/sandbox/index.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +69 -59
- package/build-types/scrollable/hook.d.ts.map +1 -1
- package/build-types/search-control/index.d.ts.map +1 -1
- package/build-types/search-control/styles.d.ts +1 -1
- package/build-types/select-control/chevron-down.d.ts +1 -1
- package/build-types/select-control/chevron-down.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts +3 -3
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/shortcut/index.d.ts +1 -1
- package/build-types/shortcut/index.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
- package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
- package/build-types/slot-fill/index.d.ts +7 -7
- package/build-types/slot-fill/index.d.ts.map +1 -1
- package/build-types/slot-fill/provider.d.ts +1 -1
- package/build-types/slot-fill/provider.d.ts.map +1 -1
- package/build-types/slot-fill/slot.d.ts +1 -1
- package/build-types/slot-fill/slot.d.ts.map +1 -1
- package/build-types/slot-fill/types.d.ts +2 -2
- package/build-types/slot-fill/types.d.ts.map +1 -1
- package/build-types/snackbar/index.d.ts +2 -2
- package/build-types/snackbar/index.d.ts.map +1 -1
- package/build-types/snackbar/list.d.ts +1 -1
- package/build-types/snackbar/list.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +69 -59
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/spinner/index.d.ts +2 -2
- package/build-types/spinner/index.d.ts.map +1 -1
- package/build-types/spinner/styles.d.ts +3 -3
- package/build-types/style-provider/index.d.ts +1 -1
- package/build-types/style-provider/index.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +69 -59
- package/build-types/surface/hook.d.ts.map +1 -1
- 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/stories/index.story.d.ts +4 -4
- package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts +2 -2
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts +3 -3
- package/build-types/tabs/tablist.d.ts +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/text/get-line-height.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +68 -59
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/text/stories/index.story.d.ts +3 -3
- package/build-types/text/utils.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +3 -3
- package/build-types/text-control/index.d.ts.map +1 -1
- package/build-types/text-highlight/index.d.ts +1 -1
- package/build-types/text-highlight/index.d.ts.map +1 -1
- package/build-types/textarea-control/index.d.ts +2 -2
- package/build-types/textarea-control/index.d.ts.map +1 -1
- package/build-types/textarea-control/styles/textarea-control-styles.d.ts +1 -1
- package/build-types/theme/color-algorithms.d.ts.map +1 -1
- 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.story.d.ts +1 -1
- package/build-types/theme/styles.d.ts +1 -1
- package/build-types/tip/index.d.ts +1 -1
- package/build-types/tip/index.d.ts.map +1 -1
- package/build-types/toggle-control/index.d.ts +2 -2
- package/build-types/toggle-control/index.d.ts.map +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts +2 -2
- package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +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/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
- package/build-types/toolbar/stories/index.story.d.ts +3 -3
- package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/index.d.ts +1 -1
- package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/toolbar-container.d.ts +1 -1
- package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts +5 -51
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +1 -1
- package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-group/index.d.ts +1 -1
- package/build-types/toolbar/toolbar-group/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts +1 -1
- package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts +1 -1
- package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts.map +1 -1
- package/build-types/tools-panel/styles.d.ts +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +71 -61
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +70 -60
- package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +69 -59
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +1 -1
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/tree-grid/index.d.ts +1 -1
- package/build-types/tree-grid/index.d.ts.map +1 -1
- package/build-types/tree-grid/item.d.ts +1 -1
- package/build-types/tree-grid/item.d.ts.map +1 -1
- package/build-types/tree-grid/roving-tab-index-item.d.ts +1 -1
- package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -1
- package/build-types/tree-grid/roving-tab-index.d.ts +1 -1
- package/build-types/tree-grid/roving-tab-index.d.ts.map +1 -1
- package/build-types/tree-grid/row.d.ts +1 -1
- package/build-types/tree-grid/row.d.ts.map +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts +1 -1
- package/build-types/tree-select/index.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +69 -59
- package/build-types/truncate/hook.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +3 -3
- package/build-types/unit-control/unit-select-control.d.ts +1 -1
- package/build-types/utils/colors.d.ts.map +1 -1
- package/build-types/utils/font-size.d.ts.map +1 -1
- package/build-types/utils/get-valid-children.d.ts.map +1 -1
- package/build-types/utils/input/base.d.ts.map +1 -1
- package/build-types/utils/strings.d.ts.map +1 -1
- package/build-types/utils/use-responsive-value.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +69 -59
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.story.d.ts +1 -1
- package/build-types/view/component.d.ts +255 -7
- package/build-types/view/component.d.ts.map +1 -1
- package/build-types/z-stack/styles.d.ts +2 -2
- package/package.json +22 -22
- package/src/alignment-matrix-control/icon.tsx +2 -2
- package/src/alignment-matrix-control/index.tsx +5 -6
- package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +4 -3
- package/src/alignment-matrix-control/utils.tsx +6 -2
- package/src/angle-picker-control/index.tsx +2 -2
- package/src/animate/index.tsx +4 -7
- package/src/autocomplete/autocompleter-ui.tsx +5 -3
- package/src/autocomplete/index.tsx +21 -7
- package/src/autocomplete/style.scss +10 -4
- package/src/base-control/README.md +1 -1
- package/src/base-control/hooks.ts +1 -5
- package/src/base-control/index.tsx +2 -5
- package/src/base-control/test/index.tsx +3 -3
- package/src/base-control/types.ts +1 -2
- package/src/border-control/types.ts +4 -0
- package/src/box-control/test/index.tsx +22 -0
- package/src/button/index.tsx +2 -2
- package/src/button/style.scss +4 -6
- package/src/button-group/index.tsx +2 -2
- package/src/card/test/__snapshots__/index.tsx.snap +44 -47
- package/src/checkbox-control/index.tsx +46 -37
- package/src/checkbox-control/style.scss +12 -1
- package/src/checkbox-control/test/__snapshots__/index.tsx.snap +27 -26
- package/src/checkbox-control/test/index.tsx +5 -0
- package/src/circular-option-picker/circular-option-picker-actions.tsx +3 -3
- package/src/circular-option-picker/circular-option-picker-option-group.tsx +2 -2
- package/src/circular-option-picker/circular-option-picker-option.tsx +2 -2
- package/src/circular-option-picker/circular-option-picker.tsx +2 -5
- package/src/circular-option-picker/style.scss +1 -2
- package/src/clipboard-button/index.tsx +2 -2
- package/src/color-indicator/index.tsx +2 -2
- package/src/color-palette/index.tsx +2 -2
- package/src/color-picker/hex-input.tsx +3 -1
- package/src/color-picker/hue-picker.native.js +6 -2
- package/src/color-picker/index.native.js +9 -3
- package/src/color-picker/saturation-picker.native.js +6 -2
- package/src/color-picker/use-deprecated-props.ts +9 -3
- package/src/combobox-control/README.md +1 -1
- package/src/combobox-control/index.tsx +8 -5
- package/src/combobox-control/stories/index.story.tsx +28 -0
- package/src/combobox-control/types.ts +1 -0
- package/src/context/context-connect.ts +6 -2
- package/src/custom-gradient-picker/gradient-bar/control-points.tsx +3 -3
- package/src/custom-gradient-picker/gradient-bar/index.tsx +2 -2
- package/src/custom-gradient-picker/index.tsx +2 -2
- package/src/custom-select-control/index.js +3 -6
- package/src/custom-select-control-v2/README.md +0 -4
- package/src/custom-select-control-v2/legacy-component/index.tsx +3 -1
- package/src/custom-select-control-v2/stories/default.story.tsx +1 -1
- package/src/custom-select-control-v2/stories/legacy.story.tsx +1 -1
- package/src/dimension-control/index.tsx +2 -5
- package/src/drop-zone/index.tsx +68 -68
- package/src/dropdown/index.tsx +2 -2
- package/src/dropdown/styles.ts +3 -1
- package/src/dropdown-menu/index.native.js +6 -12
- package/src/dropdown-menu/index.tsx +9 -16
- package/src/duotone-picker/utils.ts +3 -1
- package/src/elevation/hook.ts +6 -3
- package/src/elevation/test/__snapshots__/index.tsx.snap +18 -24
- package/src/external-link/index.tsx +2 -2
- package/src/flex/test/__snapshots__/index.tsx.snap +4 -4
- package/src/focal-point-picker/controls.tsx +3 -1
- package/src/focal-point-picker/focal-point.tsx +2 -4
- package/src/focal-point-picker/index.tsx +22 -12
- package/src/focal-point-picker/styles/focal-point-picker-style.ts +4 -3
- package/src/focal-point-picker/test/{index.js → index.tsx} +44 -17
- package/src/focal-point-picker/test/{media.js → media.tsx} +18 -13
- package/src/focal-point-picker/tooltip/index.native.js +1 -7
- package/src/focal-point-picker/utils.ts +3 -1
- package/src/font-size-picker/README.md +1 -0
- package/src/font-size-picker/index.tsx +4 -2
- package/src/font-size-picker/stories/index.story.tsx +0 -1
- package/src/font-size-picker/types.ts +2 -0
- package/src/form-toggle/index.tsx +2 -2
- package/src/form-token-field/index.tsx +10 -8
- package/src/form-token-field/style.scss +9 -0
- package/src/form-token-field/suggestions-list.tsx +16 -10
- package/src/form-token-field/token-input.tsx +2 -2
- package/src/form-token-field/token.tsx +2 -2
- package/src/guide/index.tsx +2 -2
- package/src/higher-order/navigate-regions/style.scss +3 -3
- package/src/input-control/index.tsx +3 -6
- package/src/input-control/input-field.tsx +3 -1
- package/src/input-control/label.tsx +3 -1
- package/src/input-control/stories/index.story.tsx +31 -1
- package/src/input-control/styles/input-control-styles.tsx +12 -4
- package/src/input-control/test/index.js +10 -6
- package/src/input-control/utils.ts +3 -2
- package/src/item-group/item/hook.ts +1 -10
- package/src/item-group/test/__snapshots__/index.js.snap +16 -16
- package/src/menu-group/index.tsx +2 -2
- package/src/menu-item/index.tsx +3 -3
- package/src/mobile/color-settings/utils.native.js +1 -1
- package/src/mobile/gradient/index.native.js +3 -1
- package/src/mobile/keyboard-aware-flat-list/index.android.js +11 -2
- package/src/mobile/keyboard-aware-flat-list/index.ios.js +30 -19
- package/src/mobile/keyboard-aware-flat-list/shared.native.js +26 -0
- package/src/mobile/keyboard-aware-flat-list/styles.native.scss +8 -0
- package/src/modal/aria-helper.ts +8 -3
- package/src/modal/index.tsx +10 -6
- package/src/modal/test/index.tsx +11 -4
- package/src/navigation/back-button/index.tsx +2 -5
- package/src/navigation/group/index.tsx +2 -2
- package/src/navigation/index.tsx +3 -3
- package/src/navigation/item/base.tsx +2 -2
- package/src/navigation/item/index.tsx +2 -2
- package/src/navigation/menu/index.tsx +2 -2
- package/src/navigation/styles/navigation-styles.tsx +4 -3
- package/src/notice/index.tsx +5 -10
- package/src/notice/list.tsx +2 -2
- package/src/number-control/index.tsx +2 -2
- package/src/palette-edit/index.tsx +10 -8
- package/src/palette-edit/styles.ts +2 -3
- package/src/panel/body.tsx +5 -3
- package/src/panel/index.tsx +2 -2
- package/src/panel/row.tsx +2 -2
- package/src/panel/style.scss +1 -0
- package/src/placeholder/index.tsx +3 -3
- package/src/placeholder/style.scss +12 -35
- package/src/popover/index.tsx +4 -3
- package/src/popover/overlay-middlewares.tsx +3 -1
- package/src/popover/stories/index.story.tsx +0 -2
- package/src/query-controls/author-select.tsx +3 -1
- package/src/radio-control/index.tsx +2 -2
- package/src/range-control/index.tsx +3 -3
- package/src/range-control/mark.tsx +3 -3
- package/src/range-control/rail.tsx +1 -1
- package/src/range-control/styles/range-control-styles.ts +5 -3
- package/src/range-control/tooltip.tsx +2 -2
- package/src/resizable-box/index.tsx +10 -10
- package/src/resizable-box/resize-tooltip/index.tsx +5 -3
- package/src/resizable-box/resize-tooltip/label.tsx +3 -1
- package/src/resizable-box/resize-tooltip/utils.ts +12 -4
- package/src/responsive-wrapper/index.tsx +2 -2
- package/src/search-control/index.tsx +2 -5
- package/src/select-control/index.tsx +5 -3
- package/src/select-control/styles/select-control-styles.ts +3 -1
- package/src/slot-fill/bubbles-virtually/slot-fill-context.ts +2 -1
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +1 -1
- package/src/slot-fill/bubbles-virtually/use-slot-fills.ts +1 -1
- package/src/slot-fill/bubbles-virtually/use-slot.ts +1 -1
- package/src/slot-fill/types.ts +2 -2
- package/src/snackbar/index.tsx +5 -8
- package/src/snackbar/list.tsx +2 -2
- package/src/spinner/index.tsx +2 -2
- package/src/surface/test/__snapshots__/index.tsx.snap +10 -10
- package/src/tab-panel/index.tsx +2 -2
- package/src/text/get-line-height.ts +6 -2
- package/src/text/utils.ts +6 -2
- package/src/text-control/index.tsx +2 -2
- package/src/theme/color-algorithms.ts +6 -2
- package/src/theme/stories/index.story.tsx +1 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +18 -26
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +3 -1
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +7 -6
- package/src/toolbar/toolbar/index.tsx +2 -2
- package/src/toolbar/toolbar/style.scss +2 -14
- package/src/toolbar/toolbar-button/index.tsx +3 -3
- package/src/toolbar/toolbar-group/index.tsx +2 -2
- package/src/tools-panel/tools-panel/hook.ts +9 -6
- package/src/tools-panel/tools-panel-item/hook.ts +12 -8
- package/src/tools-panel/types.ts +1 -0
- package/src/tree-grid/roving-tab-index-item.tsx +3 -1
- package/src/truncate/hook.ts +1 -1
- package/src/unit-control/index.tsx +7 -3
- package/src/unit-control/unit-select-control.tsx +2 -2
- package/src/utils/colors.js +21 -7
- package/src/utils/font-size.ts +3 -1
- package/src/utils/get-valid-children.ts +3 -1
- package/src/utils/input/base.js +4 -3
- package/src/utils/strings.ts +11 -59
- package/src/utils/test/strings.js +62 -0
- package/src/utils/theme-variables.scss +4 -0
- package/src/utils/use-responsive-value.ts +2 -1
- package/src/view/component.tsx +18 -11
- package/tsconfig.json +1 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/build/slot-fill/bubbles-virtually/observable-map.js +0 -68
- package/build/slot-fill/bubbles-virtually/observable-map.js.map +0 -1
- package/build/view/types.js +0 -6
- package/build/view/types.js.map +0 -1
- package/build-module/slot-fill/bubbles-virtually/observable-map.js +0 -60
- package/build-module/slot-fill/bubbles-virtually/observable-map.js.map +0 -1
- package/build-module/view/types.js +0 -2
- package/build-module/view/types.js.map +0 -1
- package/build-types/slot-fill/bubbles-virtually/observable-map.d.ts +0 -19
- package/build-types/slot-fill/bubbles-virtually/observable-map.d.ts.map +0 -1
- package/build-types/view/types.d.ts +0 -8
- package/build-types/view/types.d.ts.map +0 -1
- package/src/slot-fill/bubbles-virtually/observable-map.ts +0 -79
- package/src/slot-fill/test/observable-map.js +0 -83
- package/src/utils/hooks/stories/use-cx.js +0 -157
- package/src/view/types.ts +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_controlPoints","_utils","_constants","customGradientBarReducer","state","action","type","id","insertPosition","customGradientBarReducerInitialState","CustomGradientBar","background","hasGradient","value","controlPoints","onChange","disableInserter","disableAlpha","__experimentalIsRenderedInSidebar","gradientMarkersContainerDomRef","useRef","gradientBarState","gradientBarStateDispatch","useReducer","onMouseEnterAndMove","event","current","getHorizontalRelativeGradientPosition","clientX","some","position","Math","abs","MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT","onMouseLeave","isMovingInserter","isInsertingControlPoint","_react","createElement","className","classnames","onMouseEnter","onMouseMove","style","opacity","ref","default","InsertPoint","onOpenInserter","onCloseInserter","disableRemove","gradientPickerDomRef","ignoreMarkerPosition","undefined","onStartControlPointChange","onStopControlPointChange"],"sources":["@wordpress/components/src/custom-gradient-picker/gradient-bar/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useReducer } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ControlPoints from './control-points';\nimport { getHorizontalRelativeGradientPosition } from './utils';\nimport { MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT } from './constants';\nimport type {\n\tCustomGradientBarProps,\n\tCustomGradientBarReducerState,\n\tCustomGradientBarReducerAction,\n\tCustomGradientBarIdleState,\n} from '../types';\nimport type { MouseEventHandler } from 'react';\n\nconst customGradientBarReducer = (\n\tstate: CustomGradientBarReducerState,\n\taction: CustomGradientBarReducerAction\n): CustomGradientBarReducerState => {\n\tswitch ( action.type ) {\n\t\tcase 'MOVE_INSERTER':\n\t\t\tif ( state.id === 'IDLE' || state.id === 'MOVING_INSERTER' ) {\n\t\t\t\treturn {\n\t\t\t\t\tid: 'MOVING_INSERTER',\n\t\t\t\t\tinsertPosition: action.insertPosition,\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'STOP_INSERTER_MOVE':\n\t\t\tif ( state.id === 'MOVING_INSERTER' ) {\n\t\t\t\treturn {\n\t\t\t\t\tid: 'IDLE',\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'OPEN_INSERTER':\n\t\t\tif ( state.id === 'MOVING_INSERTER' ) {\n\t\t\t\treturn {\n\t\t\t\t\tid: 'INSERTING_CONTROL_POINT',\n\t\t\t\t\tinsertPosition: state.insertPosition,\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'CLOSE_INSERTER':\n\t\t\tif ( state.id === 'INSERTING_CONTROL_POINT' ) {\n\t\t\t\treturn {\n\t\t\t\t\tid: 'IDLE',\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'START_CONTROL_CHANGE':\n\t\t\tif ( state.id === 'IDLE' ) {\n\t\t\t\treturn {\n\t\t\t\t\tid: 'MOVING_CONTROL_POINT',\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'STOP_CONTROL_CHANGE':\n\t\t\tif ( state.id === 'MOVING_CONTROL_POINT' ) {\n\t\t\t\treturn {\n\t\t\t\t\tid: 'IDLE',\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn state;\n};\nconst customGradientBarReducerInitialState: CustomGradientBarIdleState = {\n\tid: 'IDLE',\n};\n\nexport default function CustomGradientBar( {\n\tbackground,\n\thasGradient,\n\tvalue: controlPoints,\n\tonChange,\n\tdisableInserter = false,\n\tdisableAlpha = false,\n\t__experimentalIsRenderedInSidebar = false,\n}: CustomGradientBarProps ) {\n\tconst gradientMarkersContainerDomRef = useRef< HTMLDivElement >( null );\n\n\tconst [ gradientBarState, gradientBarStateDispatch ] = useReducer(\n\t\tcustomGradientBarReducer,\n\t\tcustomGradientBarReducerInitialState\n\t);\n\tconst onMouseEnterAndMove: MouseEventHandler< HTMLDivElement > = (\n\t\tevent\n\t) => {\n\t\tif ( ! gradientMarkersContainerDomRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst insertPosition = getHorizontalRelativeGradientPosition(\n\t\t\tevent.clientX,\n\t\t\tgradientMarkersContainerDomRef.current\n\t\t);\n\n\t\t// If the insert point is close to an existing control point don't show it.\n\t\tif (\n\t\t\tcontrolPoints.some( ( { position } ) => {\n\t\t\t\treturn (\n\t\t\t\t\tMath.abs( insertPosition - position ) <\n\t\t\t\t\tMINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT\n\t\t\t\t);\n\t\t\t} )\n\t\t) {\n\t\t\tif ( gradientBarState.id === 'MOVING_INSERTER' ) {\n\t\t\t\tgradientBarStateDispatch( { type: 'STOP_INSERTER_MOVE' } );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tgradientBarStateDispatch( { type: 'MOVE_INSERTER', insertPosition } );\n\t};\n\n\tconst onMouseLeave = () => {\n\t\tgradientBarStateDispatch( { type: 'STOP_INSERTER_MOVE' } );\n\t};\n\n\tconst isMovingInserter = gradientBarState.id === 'MOVING_INSERTER';\n\tconst isInsertingControlPoint =\n\t\tgradientBarState.id === 'INSERTING_CONTROL_POINT';\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-custom-gradient-picker__gradient-bar',\n\t\t\t\t{ 'has-gradient': hasGradient }\n\t\t\t) }\n\t\t\tonMouseEnter={ onMouseEnterAndMove }\n\t\t\tonMouseMove={ onMouseEnterAndMove }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"components-custom-gradient-picker__gradient-bar-background\"\n\t\t\t\tstyle={ {\n\t\t\t\t\tbackground,\n\t\t\t\t\topacity: hasGradient ? 1 : 0.4,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tref={ gradientMarkersContainerDomRef }\n\t\t\t\tclassName=\"components-custom-gradient-picker__markers-container\"\n\t\t\t>\n\t\t\t\t{ ! disableInserter &&\n\t\t\t\t\t( isMovingInserter || isInsertingControlPoint ) && (\n\t\t\t\t\t\t<ControlPoints.InsertPoint\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisableAlpha={ disableAlpha }\n\t\t\t\t\t\t\tinsertPosition={ gradientBarState.insertPosition }\n\t\t\t\t\t\t\tvalue={ controlPoints }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonOpenInserter={ () => {\n\t\t\t\t\t\t\t\tgradientBarStateDispatch( {\n\t\t\t\t\t\t\t\t\ttype: 'OPEN_INSERTER',\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonCloseInserter={ () => {\n\t\t\t\t\t\t\t\tgradientBarStateDispatch( {\n\t\t\t\t\t\t\t\t\ttype: 'CLOSE_INSERTER',\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<ControlPoints\n\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t}\n\t\t\t\t\tdisableAlpha={ disableAlpha }\n\t\t\t\t\tdisableRemove={ disableInserter }\n\t\t\t\t\tgradientPickerDomRef={ gradientMarkersContainerDomRef }\n\t\t\t\t\tignoreMarkerPosition={\n\t\t\t\t\t\tisInsertingControlPoint\n\t\t\t\t\t\t\t? gradientBarState.insertPosition\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tvalue={ controlPoints }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tonStartControlPointChange={ () => {\n\t\t\t\t\t\tgradientBarStateDispatch( {\n\t\t\t\t\t\t\ttype: 'START_CONTROL_CHANGE',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tonStopControlPointChange={ () => {\n\t\t\t\t\t\tgradientBarStateDispatch( {\n\t\t\t\t\t\t\ttype: 'STOP_CONTROL_CHANGE',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,cAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAYA,MAAMK,wBAAwB,GAAGA,CAChCC,KAAoC,EACpCC,MAAsC,KACH;EACnC,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,eAAe;MACnB,IAAKF,KAAK,CAACG,EAAE,KAAK,MAAM,IAAIH,KAAK,CAACG,EAAE,KAAK,iBAAiB,EAAG;QAC5D,OAAO;UACNA,EAAE,EAAE,iBAAiB;UACrBC,cAAc,EAAEH,MAAM,CAACG;QACxB,CAAC;MACF;MACA;IACD,KAAK,oBAAoB;MACxB,I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AC,aAAA,EAACtC,cAAA,CAAA8C,OAAa,CAACC,WAAW;IACzB7B,iCAAiC,EAChCA,iCACA;IACDD,YAAY,EAAGA,YAAc;IAC7BT,cAAc,EAAGa,gBAAgB,CAACb,cAAgB;IAClDK,KAAK,EAAGC,aAAe;IACvBC,QAAQ,EAAGA,QAAU;IACrBiC,cAAc,EAAGA,CAAA,KAAM;MACtB1B,wBAAwB,CAAE;QACzBhB,IAAI,EAAE;MACP,CAAE,CAAC;IACJ,CAAG;IACH2C,eAAe,EAAGA,CAAA,KAAM;MACvB3B,wBAAwB,CAAE;QACzBhB,IAAI,EAAE;MACP,CAAE,CAAC;IACJ;EAAG,CACH,CACD,EACF,IAAA+B,MAAA,CAAAC,aAAA,EAACtC,cAAA,CAAA8C,OAAa;IACb5B,iCAAiC,EAChCA,iCACA;IACDD,YAAY,EAAGA,YAAc;IAC7BiC,aAAa,EAAGlC,eAAiB;IACjCmC,oBAAoB,EAAGhC,8BAAgC;IACvDiC,oBAAoB,EACnBhB,uBAAuB,GACpBf,gBAAgB,CAACb,cAAc,GAC/B6C,SACH;IACDxC,KAAK,EAAGC,aAAe;IACvBC,QAAQ,EAAGA,QAAU;IACrBuC,yBAAyB,EAAGA,CAAA,KAAM;MACjChC,wBAAwB,CAAE;QACzBhB,IAAI,EAAE;MACP,CAAE,CAAC;IACJ,CAAG;IACHiD,wBAAwB,EAAGA,CAAA,KAAM;MAChCjC,wBAAwB,CAAE;QACzBhB,IAAI,EAAE;MACP,CAAE,CAAC;IACJ;EAAG,CACH,CACG,CACD,CAAC;AAER","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_controlPoints","_utils","_constants","customGradientBarReducer","state","action","type","id","insertPosition","customGradientBarReducerInitialState","CustomGradientBar","background","hasGradient","value","controlPoints","onChange","disableInserter","disableAlpha","__experimentalIsRenderedInSidebar","gradientMarkersContainerDomRef","useRef","gradientBarState","gradientBarStateDispatch","useReducer","onMouseEnterAndMove","event","current","getHorizontalRelativeGradientPosition","clientX","some","position","Math","abs","MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT","onMouseLeave","isMovingInserter","isInsertingControlPoint","_react","createElement","className","clsx","onMouseEnter","onMouseMove","style","opacity","ref","default","InsertPoint","onOpenInserter","onCloseInserter","disableRemove","gradientPickerDomRef","ignoreMarkerPosition","undefined","onStartControlPointChange","onStopControlPointChange"],"sources":["@wordpress/components/src/custom-gradient-picker/gradient-bar/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useReducer } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ControlPoints from './control-points';\nimport { getHorizontalRelativeGradientPosition } from './utils';\nimport { MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT } from './constants';\nimport type {\n\tCustomGradientBarProps,\n\tCustomGradientBarReducerState,\n\tCustomGradientBarReducerAction,\n\tCustomGradientBarIdleState,\n} from '../types';\nimport type { MouseEventHandler } from 'react';\n\nconst customGradientBarReducer = (\n\tstate: CustomGradientBarReducerState,\n\taction: CustomGradientBarReducerAction\n): CustomGradientBarReducerState => {\n\tswitch ( action.type ) {\n\t\tcase 'MOVE_INSERTER':\n\t\t\tif ( state.id === 'IDLE' || state.id === 'MOVING_INSERTER' ) {\n\t\t\t\treturn {\n\t\t\t\t\tid: 'MOVING_INSERTER',\n\t\t\t\t\tinsertPosition: action.insertPosition,\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'STOP_INSERTER_MOVE':\n\t\t\tif ( state.id === 'MOVING_INSERTER' ) {\n\t\t\t\treturn {\n\t\t\t\t\tid: 'IDLE',\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'OPEN_INSERTER':\n\t\t\tif ( state.id === 'MOVING_INSERTER' ) {\n\t\t\t\treturn {\n\t\t\t\t\tid: 'INSERTING_CONTROL_POINT',\n\t\t\t\t\tinsertPosition: state.insertPosition,\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'CLOSE_INSERTER':\n\t\t\tif ( state.id === 'INSERTING_CONTROL_POINT' ) {\n\t\t\t\treturn {\n\t\t\t\t\tid: 'IDLE',\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'START_CONTROL_CHANGE':\n\t\t\tif ( state.id === 'IDLE' ) {\n\t\t\t\treturn {\n\t\t\t\t\tid: 'MOVING_CONTROL_POINT',\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'STOP_CONTROL_CHANGE':\n\t\t\tif ( state.id === 'MOVING_CONTROL_POINT' ) {\n\t\t\t\treturn {\n\t\t\t\t\tid: 'IDLE',\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn state;\n};\nconst customGradientBarReducerInitialState: CustomGradientBarIdleState = {\n\tid: 'IDLE',\n};\n\nexport default function CustomGradientBar( {\n\tbackground,\n\thasGradient,\n\tvalue: controlPoints,\n\tonChange,\n\tdisableInserter = false,\n\tdisableAlpha = false,\n\t__experimentalIsRenderedInSidebar = false,\n}: CustomGradientBarProps ) {\n\tconst gradientMarkersContainerDomRef = useRef< HTMLDivElement >( null );\n\n\tconst [ gradientBarState, gradientBarStateDispatch ] = useReducer(\n\t\tcustomGradientBarReducer,\n\t\tcustomGradientBarReducerInitialState\n\t);\n\tconst onMouseEnterAndMove: MouseEventHandler< HTMLDivElement > = (\n\t\tevent\n\t) => {\n\t\tif ( ! gradientMarkersContainerDomRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst insertPosition = getHorizontalRelativeGradientPosition(\n\t\t\tevent.clientX,\n\t\t\tgradientMarkersContainerDomRef.current\n\t\t);\n\n\t\t// If the insert point is close to an existing control point don't show it.\n\t\tif (\n\t\t\tcontrolPoints.some( ( { position } ) => {\n\t\t\t\treturn (\n\t\t\t\t\tMath.abs( insertPosition - position ) <\n\t\t\t\t\tMINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT\n\t\t\t\t);\n\t\t\t} )\n\t\t) {\n\t\t\tif ( gradientBarState.id === 'MOVING_INSERTER' ) {\n\t\t\t\tgradientBarStateDispatch( { type: 'STOP_INSERTER_MOVE' } );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tgradientBarStateDispatch( { type: 'MOVE_INSERTER', insertPosition } );\n\t};\n\n\tconst onMouseLeave = () => {\n\t\tgradientBarStateDispatch( { type: 'STOP_INSERTER_MOVE' } );\n\t};\n\n\tconst isMovingInserter = gradientBarState.id === 'MOVING_INSERTER';\n\tconst isInsertingControlPoint =\n\t\tgradientBarState.id === 'INSERTING_CONTROL_POINT';\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-custom-gradient-picker__gradient-bar',\n\t\t\t\t{ 'has-gradient': hasGradient }\n\t\t\t) }\n\t\t\tonMouseEnter={ onMouseEnterAndMove }\n\t\t\tonMouseMove={ onMouseEnterAndMove }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"components-custom-gradient-picker__gradient-bar-background\"\n\t\t\t\tstyle={ {\n\t\t\t\t\tbackground,\n\t\t\t\t\topacity: hasGradient ? 1 : 0.4,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tref={ gradientMarkersContainerDomRef }\n\t\t\t\tclassName=\"components-custom-gradient-picker__markers-container\"\n\t\t\t>\n\t\t\t\t{ ! disableInserter &&\n\t\t\t\t\t( isMovingInserter || isInsertingControlPoint ) && (\n\t\t\t\t\t\t<ControlPoints.InsertPoint\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisableAlpha={ disableAlpha }\n\t\t\t\t\t\t\tinsertPosition={ gradientBarState.insertPosition }\n\t\t\t\t\t\t\tvalue={ controlPoints }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonOpenInserter={ () => {\n\t\t\t\t\t\t\t\tgradientBarStateDispatch( {\n\t\t\t\t\t\t\t\t\ttype: 'OPEN_INSERTER',\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonCloseInserter={ () => {\n\t\t\t\t\t\t\t\tgradientBarStateDispatch( {\n\t\t\t\t\t\t\t\t\ttype: 'CLOSE_INSERTER',\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<ControlPoints\n\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t}\n\t\t\t\t\tdisableAlpha={ disableAlpha }\n\t\t\t\t\tdisableRemove={ disableInserter }\n\t\t\t\t\tgradientPickerDomRef={ gradientMarkersContainerDomRef }\n\t\t\t\t\tignoreMarkerPosition={\n\t\t\t\t\t\tisInsertingControlPoint\n\t\t\t\t\t\t\t? gradientBarState.insertPosition\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tvalue={ controlPoints }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tonStartControlPointChange={ () => {\n\t\t\t\t\t\tgradientBarStateDispatch( {\n\t\t\t\t\t\t\ttype: 'START_CONTROL_CHANGE',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tonStopControlPointChange={ () => {\n\t\t\t\t\t\tgradientBarStateDispatch( {\n\t\t\t\t\t\t\ttype: 'STOP_CONTROL_CHANGE',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA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GA,CAAA,KAAM;MACjChC,wBAAwB,CAAE;QACzBhB,IAAI,EAAE;MACP,CAAE,CAAC;IACJ,CAAG;IACHiD,wBAAwB,EAAGA,CAAA,KAAM;MAChCjC,wBAAwB,CAAE;QACzBhB,IAAI,EAAE;MACP,CAAE,CAAC;IACJ;EAAG,CACH,CACG,CACD,CAAC;AAER","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_anglePickerControl","_interopRequireDefault","_gradientBar","_flex","_selectControl","_vStack","_utils","_serializer","_constants","_customGradientPickerStyles","GradientAnglePicker","gradientAST","hasGradient","onChange","_gradientAST$orientat","angle","orientation","value","DEFAULT_LINEAR_GRADIENT_ANGLE","onAngleChange","newAngle","serializeGradient","type","_react","createElement","default","GradientTypePicker","onSetLinearGradient","undefined","HORIZONTAL_GRADIENT_ORIENTATION","onSetRadialGradient","restGradientAST","handleOnChange","next","__nextHasNoMarginBottom","className","label","__","labelPosition","options","GRADIENT_OPTIONS","size","CustomGradientPicker","__experimentalIsRenderedInSidebar","getGradientAstWithDefault","background","getLinearGradientRepresentation","controlPoints","colorStops","map","colorStop","color","getStopCssColor","position","parseInt","length","VStack","spacing","newControlPoints","getGradientAstWithControlPoints","Flex","gap","SelectWrapper","AccessoryWrapper","_default","exports"],"sources":["@wordpress/components/src/custom-gradient-picker/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type gradientParser from 'gradient-parser';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AnglePickerControl from '../angle-picker-control';\nimport CustomGradientBar from './gradient-bar';\nimport { Flex } from '../flex';\nimport SelectControl from '../select-control';\nimport { VStack } from '../v-stack';\nimport {\n\tgetGradientAstWithDefault,\n\tgetLinearGradientRepresentation,\n\tgetGradientAstWithControlPoints,\n\tgetStopCssColor,\n} from './utils';\nimport { serializeGradient } from './serializer';\nimport {\n\tDEFAULT_LINEAR_GRADIENT_ANGLE,\n\tHORIZONTAL_GRADIENT_ORIENTATION,\n\tGRADIENT_OPTIONS,\n} from './constants';\nimport {\n\tAccessoryWrapper,\n\tSelectWrapper,\n} from './styles/custom-gradient-picker-styles';\nimport type {\n\tCustomGradientPickerProps,\n\tGradientAnglePickerProps,\n\tGradientTypePickerProps,\n} from './types';\n\nconst GradientAnglePicker = ( {\n\tgradientAST,\n\thasGradient,\n\tonChange,\n}: GradientAnglePickerProps ) => {\n\tconst angle =\n\t\tgradientAST?.orientation?.value ?? DEFAULT_LINEAR_GRADIENT_ANGLE;\n\tconst onAngleChange = ( newAngle: number ) => {\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...gradientAST,\n\t\t\t\torientation: {\n\t\t\t\t\ttype: 'angular',\n\t\t\t\t\tvalue: `${ newAngle }`,\n\t\t\t\t},\n\t\t\t} )\n\t\t);\n\t};\n\treturn (\n\t\t<AnglePickerControl\n\t\t\tonChange={ onAngleChange }\n\t\t\tvalue={ hasGradient ? angle : '' }\n\t\t/>\n\t);\n};\n\nconst GradientTypePicker = ( {\n\tgradientAST,\n\thasGradient,\n\tonChange,\n}: GradientTypePickerProps ) => {\n\tconst { type } = gradientAST;\n\n\tconst onSetLinearGradient = () => {\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...gradientAST,\n\t\t\t\torientation: gradientAST.orientation\n\t\t\t\t\t? undefined\n\t\t\t\t\t: HORIZONTAL_GRADIENT_ORIENTATION,\n\t\t\t\ttype: 'linear-gradient',\n\t\t\t} as gradientParser.LinearGradientNode )\n\t\t);\n\t};\n\n\tconst onSetRadialGradient = () => {\n\t\tconst { orientation, ...restGradientAST } = gradientAST;\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...restGradientAST,\n\t\t\t\ttype: 'radial-gradient',\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst handleOnChange = ( next: string ) => {\n\t\tif ( next === 'linear-gradient' ) {\n\t\t\tonSetLinearGradient();\n\t\t}\n\t\tif ( next === 'radial-gradient' ) {\n\t\t\tonSetRadialGradient();\n\t\t}\n\t};\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"components-custom-gradient-picker__type-picker\"\n\t\t\tlabel={ __( 'Type' ) }\n\t\t\tlabelPosition=\"top\"\n\t\t\tonChange={ handleOnChange }\n\t\t\toptions={ GRADIENT_OPTIONS }\n\t\t\tsize=\"__unstable-large\"\n\t\t\tvalue={ hasGradient ? type : undefined }\n\t\t/>\n\t);\n};\n\n/**\n * CustomGradientPicker is a React component that renders a UI for specifying\n * linear or radial gradients. Radial gradients are displayed in the picker as\n * a slice of the gradient from the center to the outside.\n *\n * ```jsx\n * import { CustomGradientPicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyCustomGradientPicker = () => {\n * const [ gradient, setGradient ] = useState();\n *\n * return (\n * <CustomGradientPicker\n *\t\t\tvalue={ gradient }\n *\t\t\tonChange={ setGradient }\n * />\n * );\n * };\n * ```\n */\nexport function CustomGradientPicker( {\n\tvalue,\n\tonChange,\n\t__experimentalIsRenderedInSidebar = false,\n}: CustomGradientPickerProps ) {\n\tconst { gradientAST, hasGradient } = getGradientAstWithDefault( value );\n\n\t// On radial gradients the bar should display a linear gradient.\n\t// On radial gradients the bar represents a slice of the gradient from the center until the outside.\n\t// On liner gradients the bar represents the color stops from left to right independently of the angle.\n\tconst background = getLinearGradientRepresentation( gradientAST );\n\n\t// Control points color option may be hex from presets, custom colors will be rgb.\n\t// The position should always be a percentage.\n\tconst controlPoints = gradientAST.colorStops.map( ( colorStop ) => {\n\t\treturn {\n\t\t\tcolor: getStopCssColor( colorStop ),\n\t\t\t// Although it's already been checked by `hasUnsupportedLength` in `getGradientAstWithDefault`,\n\t\t\t// TypeScript doesn't know that `colorStop.length` is not undefined here.\n\t\t\t// @ts-expect-error\n\t\t\tposition: parseInt( colorStop.length.value ),\n\t\t};\n\t} );\n\n\treturn (\n\t\t<VStack spacing={ 4 } className=\"components-custom-gradient-picker\">\n\t\t\t<CustomGradientBar\n\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t}\n\t\t\t\tbackground={ background }\n\t\t\t\thasGradient={ hasGradient }\n\t\t\t\tvalue={ controlPoints }\n\t\t\t\tonChange={ ( newControlPoints ) => {\n\t\t\t\t\tonChange(\n\t\t\t\t\t\tserializeGradient(\n\t\t\t\t\t\t\tgetGradientAstWithControlPoints(\n\t\t\t\t\t\t\t\tgradientAST,\n\t\t\t\t\t\t\t\tnewControlPoints\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/>\n\t\t\t<Flex\n\t\t\t\tgap={ 3 }\n\t\t\t\tclassName=\"components-custom-gradient-picker__ui-line\"\n\t\t\t>\n\t\t\t\t<SelectWrapper>\n\t\t\t\t\t<GradientTypePicker\n\t\t\t\t\t\tgradientAST={ gradientAST }\n\t\t\t\t\t\thasGradient={ hasGradient }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t</SelectWrapper>\n\t\t\t\t<AccessoryWrapper>\n\t\t\t\t\t{ gradientAST.type === 'linear-gradient' && (\n\t\t\t\t\t\t<GradientAnglePicker\n\t\t\t\t\t\t\tgradientAST={ gradientAST }\n\t\t\t\t\t\t\thasGradient={ hasGradient }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</AccessoryWrapper>\n\t\t\t</Flex>\n\t\t</VStack>\n\t);\n}\n\nexport default CustomGradientPicker;\n"],"mappings":";;;;;;;;;AAQA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK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OAAA,GAEciB,oBAAoB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_anglePickerControl","_interopRequireDefault","_gradientBar","_flex","_selectControl","_vStack","_utils","_serializer","_constants","_customGradientPickerStyles","GradientAnglePicker","gradientAST","hasGradient","onChange","_gradientAST$orientat","angle","orientation","value","DEFAULT_LINEAR_GRADIENT_ANGLE","onAngleChange","newAngle","serializeGradient","type","_react","createElement","default","GradientTypePicker","onSetLinearGradient","undefined","HORIZONTAL_GRADIENT_ORIENTATION","onSetRadialGradient","restGradientAST","handleOnChange","next","__nextHasNoMarginBottom","className","label","__","labelPosition","options","GRADIENT_OPTIONS","size","CustomGradientPicker","__experimentalIsRenderedInSidebar","getGradientAstWithDefault","background","getLinearGradientRepresentation","controlPoints","colorStops","map","colorStop","color","getStopCssColor","position","parseInt","length","VStack","spacing","newControlPoints","getGradientAstWithControlPoints","Flex","gap","SelectWrapper","AccessoryWrapper","_default","exports"],"sources":["@wordpress/components/src/custom-gradient-picker/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { type LinearGradientNode } from 'gradient-parser';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AnglePickerControl from '../angle-picker-control';\nimport CustomGradientBar from './gradient-bar';\nimport { Flex } from '../flex';\nimport SelectControl from '../select-control';\nimport { VStack } from '../v-stack';\nimport {\n\tgetGradientAstWithDefault,\n\tgetLinearGradientRepresentation,\n\tgetGradientAstWithControlPoints,\n\tgetStopCssColor,\n} from './utils';\nimport { serializeGradient } from './serializer';\nimport {\n\tDEFAULT_LINEAR_GRADIENT_ANGLE,\n\tHORIZONTAL_GRADIENT_ORIENTATION,\n\tGRADIENT_OPTIONS,\n} from './constants';\nimport {\n\tAccessoryWrapper,\n\tSelectWrapper,\n} from './styles/custom-gradient-picker-styles';\nimport type {\n\tCustomGradientPickerProps,\n\tGradientAnglePickerProps,\n\tGradientTypePickerProps,\n} from './types';\n\nconst GradientAnglePicker = ( {\n\tgradientAST,\n\thasGradient,\n\tonChange,\n}: GradientAnglePickerProps ) => {\n\tconst angle =\n\t\tgradientAST?.orientation?.value ?? DEFAULT_LINEAR_GRADIENT_ANGLE;\n\tconst onAngleChange = ( newAngle: number ) => {\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...gradientAST,\n\t\t\t\torientation: {\n\t\t\t\t\ttype: 'angular',\n\t\t\t\t\tvalue: `${ newAngle }`,\n\t\t\t\t},\n\t\t\t} )\n\t\t);\n\t};\n\treturn (\n\t\t<AnglePickerControl\n\t\t\tonChange={ onAngleChange }\n\t\t\tvalue={ hasGradient ? angle : '' }\n\t\t/>\n\t);\n};\n\nconst GradientTypePicker = ( {\n\tgradientAST,\n\thasGradient,\n\tonChange,\n}: GradientTypePickerProps ) => {\n\tconst { type } = gradientAST;\n\n\tconst onSetLinearGradient = () => {\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...gradientAST,\n\t\t\t\torientation: gradientAST.orientation\n\t\t\t\t\t? undefined\n\t\t\t\t\t: HORIZONTAL_GRADIENT_ORIENTATION,\n\t\t\t\ttype: 'linear-gradient',\n\t\t\t} satisfies LinearGradientNode )\n\t\t);\n\t};\n\n\tconst onSetRadialGradient = () => {\n\t\tconst { orientation, ...restGradientAST } = gradientAST;\n\t\tonChange(\n\t\t\tserializeGradient( {\n\t\t\t\t...restGradientAST,\n\t\t\t\ttype: 'radial-gradient',\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst handleOnChange = ( next: string ) => {\n\t\tif ( next === 'linear-gradient' ) {\n\t\t\tonSetLinearGradient();\n\t\t}\n\t\tif ( next === 'radial-gradient' ) {\n\t\t\tonSetRadialGradient();\n\t\t}\n\t};\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"components-custom-gradient-picker__type-picker\"\n\t\t\tlabel={ __( 'Type' ) }\n\t\t\tlabelPosition=\"top\"\n\t\t\tonChange={ handleOnChange }\n\t\t\toptions={ GRADIENT_OPTIONS }\n\t\t\tsize=\"__unstable-large\"\n\t\t\tvalue={ hasGradient ? type : undefined }\n\t\t/>\n\t);\n};\n\n/**\n * CustomGradientPicker is a React component that renders a UI for specifying\n * linear or radial gradients. Radial gradients are displayed in the picker as\n * a slice of the gradient from the center to the outside.\n *\n * ```jsx\n * import { CustomGradientPicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyCustomGradientPicker = () => {\n * const [ gradient, setGradient ] = useState();\n *\n * return (\n * <CustomGradientPicker\n *\t\t\tvalue={ gradient }\n *\t\t\tonChange={ setGradient }\n * />\n * );\n * };\n * ```\n */\nexport function CustomGradientPicker( {\n\tvalue,\n\tonChange,\n\t__experimentalIsRenderedInSidebar = false,\n}: CustomGradientPickerProps ) {\n\tconst { gradientAST, hasGradient } = getGradientAstWithDefault( value );\n\n\t// On radial gradients the bar should display a linear gradient.\n\t// On radial gradients the bar represents a slice of the gradient from the center until the outside.\n\t// On liner gradients the bar represents the color stops from left to right independently of the angle.\n\tconst background = getLinearGradientRepresentation( gradientAST );\n\n\t// Control points color option may be hex from presets, custom colors will be rgb.\n\t// The position should always be a percentage.\n\tconst controlPoints = gradientAST.colorStops.map( ( colorStop ) => {\n\t\treturn {\n\t\t\tcolor: getStopCssColor( colorStop ),\n\t\t\t// Although it's already been checked by `hasUnsupportedLength` in `getGradientAstWithDefault`,\n\t\t\t// TypeScript doesn't know that `colorStop.length` is not undefined here.\n\t\t\t// @ts-expect-error\n\t\t\tposition: parseInt( colorStop.length.value ),\n\t\t};\n\t} );\n\n\treturn (\n\t\t<VStack spacing={ 4 } className=\"components-custom-gradient-picker\">\n\t\t\t<CustomGradientBar\n\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t}\n\t\t\t\tbackground={ background }\n\t\t\t\thasGradient={ hasGradient }\n\t\t\t\tvalue={ controlPoints }\n\t\t\t\tonChange={ ( newControlPoints ) => {\n\t\t\t\t\tonChange(\n\t\t\t\t\t\tserializeGradient(\n\t\t\t\t\t\t\tgetGradientAstWithControlPoints(\n\t\t\t\t\t\t\t\tgradientAST,\n\t\t\t\t\t\t\t\tnewControlPoints\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/>\n\t\t\t<Flex\n\t\t\t\tgap={ 3 }\n\t\t\t\tclassName=\"components-custom-gradient-picker__ui-line\"\n\t\t\t>\n\t\t\t\t<SelectWrapper>\n\t\t\t\t\t<GradientTypePicker\n\t\t\t\t\t\tgradientAST={ gradientAST }\n\t\t\t\t\t\thasGradient={ hasGradient }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t</SelectWrapper>\n\t\t\t\t<AccessoryWrapper>\n\t\t\t\t\t{ gradientAST.type === 'linear-gradient' && (\n\t\t\t\t\t\t<GradientAnglePicker\n\t\t\t\t\t\t\tgradientAST={ gradientAST }\n\t\t\t\t\t\t\thasGradient={ hasGradient }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</AccessoryWrapper>\n\t\t\t</Flex>\n\t\t</VStack>\n\t);\n}\n\nexport default CustomGradientPicker;\n"],"mappings":";;;;;;;;;AAQA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAMA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAKA,IAAAU,2BAAA,GAAAV,OAAA;AA9BA;AACA;AACA;;AA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ACC,OAAO,EAAG,CAAG;IAACtB,SAAS,EAAC;EAAmC,GAClE,IAAAZ,MAAA,CAAAC,aAAA,EAACtB,YAAA,CAAAuB,OAAiB;IACjBkB,iCAAiC,EAChCA,iCACA;IACDE,UAAU,EAAGA,UAAY;IACzBjC,WAAW,EAAGA,WAAa;IAC3BK,KAAK,EAAG8B,aAAe;IACvBlC,QAAQ,EAAK6C,gBAAgB,IAAM;MAClC7C,QAAQ,CACP,IAAAQ,6BAAiB,EAChB,IAAAsC,sCAA+B,EAC9BhD,WAAW,EACX+C,gBACD,CACD,CACD,CAAC;IACF;EAAG,CACH,CAAC,EACF,IAAAnC,MAAA,CAAAC,aAAA,EAACrB,KAAA,CAAAyD,IAAI;IACJC,GAAG,EAAG,CAAG;IACT1B,SAAS,EAAC;EAA4C,GAEtD,IAAAZ,MAAA,CAAAC,aAAA,EAACf,2BAAA,CAAAqD,aAAa,QACb,IAAAvC,MAAA,CAAAC,aAAA,EAACE,kBAAkB;IAClBf,WAAW,EAAGA,WAAa;IAC3BC,WAAW,EAAGA,WAAa;IAC3BC,QAAQ,EAAGA;EAAU,CACrB,CACa,CAAC,EAChB,IAAAU,MAAA,CAAAC,aAAA,EAACf,2BAAA,CAAAsD,gBAAgB,QACdpD,WAAW,CAACW,IAAI,KAAK,iBAAiB,IACvC,IAAAC,MAAA,CAAAC,aAAA,EAACd,mBAAmB;IACnBC,WAAW,EAAGA,WAAa;IAC3BC,WAAW,EAAGA,WAAa;IAC3BC,QAAQ,EAAGA;EAAU,CACrB,CAEe,CACb,CACC,CAAC;AAEX;AAAC,IAAAmD,QAAA,GAAAC,OAAA,CAAAxC,OAAA,GAEciB,oBAAoB","ignoreList":[]}
|
|
@@ -8,7 +8,7 @@ exports.StableCustomSelectControl = StableCustomSelectControl;
|
|
|
8
8
|
exports.default = CustomSelectControl;
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _downshift = require("downshift");
|
|
11
|
-
var
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
12
|
var _icons = require("@wordpress/icons");
|
|
13
13
|
var _i18n = require("@wordpress/i18n");
|
|
14
14
|
var _element = require("@wordpress/element");
|
|
@@ -124,7 +124,7 @@ function CustomSelectControl(props) {
|
|
|
124
124
|
delete menuProps['aria-activedescendant'];
|
|
125
125
|
}
|
|
126
126
|
return (0, _react.createElement)("div", {
|
|
127
|
-
className: (0,
|
|
127
|
+
className: (0, _clsx.default)('components-custom-select-control', className)
|
|
128
128
|
}, hideLabelFromVision ? (0, _react.createElement)(_visuallyHidden.VisuallyHidden, {
|
|
129
129
|
as: "label",
|
|
130
130
|
...getLabelProps()
|
|
@@ -166,7 +166,7 @@ function CustomSelectControl(props) {
|
|
|
166
166
|
item,
|
|
167
167
|
index,
|
|
168
168
|
key: item.key,
|
|
169
|
-
className: (0,
|
|
169
|
+
className: (0, _clsx.default)(item.className, 'components-custom-select-control__item', {
|
|
170
170
|
'is-highlighted': index === highlightedIndex,
|
|
171
171
|
'has-hint': !!item.__experimentalHint,
|
|
172
172
|
'is-next-40px-default-size': __next40pxDefaultSize
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_downshift","require","_classnames","_interopRequireDefault","_icons","_i18n","_element","_visuallyHidden","_selectControlStyles","_chevronDown","_baseControlStyles","_useDeprecatedProps","_inputBase","itemToString","item","name","stateReducer","selectedItem","type","changes","props","items","useSelect","stateChangeTypes","ToggleButtonKeyDownArrowDown","Math","min","indexOf","length","ToggleButtonKeyDownArrowUp","max","CustomSelectControl","__next40pxDefaultSize","className","hideLabelFromVision","label","describedBy","options","onChange","onSelectedItemChange","size","value","_selectedItem","onMouseOver","onMouseOut","onFocus","onBlur","__experimentalShowSelectedHint","useDeprecated36pxDefaultSizeProp","getLabelProps","getToggleButtonProps","getMenuProps","getItemProps","isOpen","highlightedIndex","initialSelectedItem","undefined","getDescribedBy","__","sprintf","menuProps","onKeyDownHandler","useCallback","e","stopPropagation","onKeyDown","startsWith","_react","createElement","classnames","VisuallyHidden","as","StyledLabel","default","suffix","Select","selectSize","__experimentalHint","map","index","key","style","Icon","icon","check","StableCustomSelectControl"],"sources":["@wordpress/components/src/custom-select-control/index.js"],"sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport { useSelect } from 'downshift';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Icon, check } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport { Select as SelectControlSelect } from '../select-control/styles/select-control-styles';\nimport SelectControlChevronDown from '../select-control/chevron-down';\nimport { StyledLabel } from '../base-control/styles/base-control-styles';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport InputBase from '../input-control/input-base';\n\nconst itemToString = ( item ) => item?.name;\n// This is needed so that in Windows, where\n// the menu does not necessarily open on\n// key up/down, you can still switch between\n// options with the menu closed.\nconst stateReducer = (\n\t{ selectedItem },\n\t{ type, changes, props: { items } }\n) => {\n\tswitch ( type ) {\n\t\tcase useSelect.stateChangeTypes.ToggleButtonKeyDownArrowDown:\n\t\t\t// If we already have a selected item, try to select the next one,\n\t\t\t// without circular navigation. Otherwise, select the first item.\n\t\t\treturn {\n\t\t\t\tselectedItem:\n\t\t\t\t\titems[\n\t\t\t\t\t\tselectedItem\n\t\t\t\t\t\t\t? Math.min(\n\t\t\t\t\t\t\t\t\titems.indexOf( selectedItem ) + 1,\n\t\t\t\t\t\t\t\t\titems.length - 1\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: 0\n\t\t\t\t\t],\n\t\t\t};\n\t\tcase useSelect.stateChangeTypes.ToggleButtonKeyDownArrowUp:\n\t\t\t// If we already have a selected item, try to select the previous one,\n\t\t\t// without circular navigation. Otherwise, select the last item.\n\t\t\treturn {\n\t\t\t\tselectedItem:\n\t\t\t\t\titems[\n\t\t\t\t\t\tselectedItem\n\t\t\t\t\t\t\t? Math.max( items.indexOf( selectedItem ) - 1, 0 )\n\t\t\t\t\t\t\t: items.length - 1\n\t\t\t\t\t],\n\t\t\t};\n\t\tdefault:\n\t\t\treturn changes;\n\t}\n};\n\nexport default function CustomSelectControl( props ) {\n\tconst {\n\t\t/** Start opting into the larger default height that will become the default size in a future version. */\n\t\t__next40pxDefaultSize = false,\n\t\tclassName,\n\t\thideLabelFromVision,\n\t\tlabel,\n\t\tdescribedBy,\n\t\toptions: items,\n\t\tonChange: onSelectedItemChange,\n\t\t/** @type {import('../select-control/types').SelectControlProps.size} */\n\t\tsize = 'default',\n\t\tvalue: _selectedItem,\n\t\tonMouseOver,\n\t\tonMouseOut,\n\t\tonFocus,\n\t\tonBlur,\n\t\t__experimentalShowSelectedHint = false,\n\t} = useDeprecated36pxDefaultSizeProp( props );\n\n\tconst {\n\t\tgetLabelProps,\n\t\tgetToggleButtonProps,\n\t\tgetMenuProps,\n\t\tgetItemProps,\n\t\tisOpen,\n\t\thighlightedIndex,\n\t\tselectedItem,\n\t} = useSelect( {\n\t\tinitialSelectedItem: items[ 0 ],\n\t\titems,\n\t\titemToString,\n\t\tonSelectedItemChange,\n\t\t...( typeof _selectedItem !== 'undefined' && _selectedItem !== null\n\t\t\t? { selectedItem: _selectedItem }\n\t\t\t: undefined ),\n\t\tstateReducer,\n\t} );\n\n\tfunction getDescribedBy() {\n\t\tif ( describedBy ) {\n\t\t\treturn describedBy;\n\t\t}\n\n\t\tif ( ! selectedItem ) {\n\t\t\treturn __( 'No selection' );\n\t\t}\n\n\t\t// translators: %s: The selected option.\n\t\treturn sprintf( __( 'Currently selected: %s' ), selectedItem.name );\n\t}\n\n\tconst menuProps = getMenuProps( {\n\t\tclassName: 'components-custom-select-control__menu',\n\t\t'aria-hidden': ! isOpen,\n\t} );\n\n\tconst onKeyDownHandler = useCallback(\n\t\t( e ) => {\n\t\t\te.stopPropagation();\n\t\t\tmenuProps?.onKeyDown?.( e );\n\t\t},\n\t\t[ menuProps ]\n\t);\n\n\t// We need this here, because the null active descendant is not fully ARIA compliant.\n\tif (\n\t\tmenuProps[ 'aria-activedescendant' ]?.startsWith( 'downshift-null' )\n\t) {\n\t\tdelete menuProps[ 'aria-activedescendant' ];\n\t}\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-custom-select-control',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ hideLabelFromVision ? (\n\t\t\t\t<VisuallyHidden as=\"label\" { ...getLabelProps() }>\n\t\t\t\t\t{ label }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) : (\n\t\t\t\t/* eslint-disable-next-line jsx-a11y/label-has-associated-control, jsx-a11y/label-has-for */\n\t\t\t\t<StyledLabel\n\t\t\t\t\t{ ...getLabelProps( {\n\t\t\t\t\t\tclassName: 'components-custom-select-control__label',\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</StyledLabel>\n\t\t\t) }\n\t\t\t<InputBase\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\tsize={ size }\n\t\t\t\tsuffix={ <SelectControlChevronDown /> }\n\t\t\t>\n\t\t\t\t<SelectControlSelect\n\t\t\t\t\tonMouseOver={ onMouseOver }\n\t\t\t\t\tonMouseOut={ onMouseOut }\n\t\t\t\t\tas=\"button\"\n\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\tonBlur={ onBlur }\n\t\t\t\t\tselectSize={ size }\n\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t{ ...getToggleButtonProps( {\n\t\t\t\t\t\t// This is needed because some speech recognition software don't support `aria-labelledby`.\n\t\t\t\t\t\t'aria-label': label,\n\t\t\t\t\t\t'aria-labelledby': undefined,\n\t\t\t\t\t\tclassName: 'components-custom-select-control__button',\n\t\t\t\t\t\tdescribedBy: getDescribedBy(),\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ itemToString( selectedItem ) }\n\t\t\t\t\t{ __experimentalShowSelectedHint &&\n\t\t\t\t\t\tselectedItem.__experimentalHint && (\n\t\t\t\t\t\t\t<span className=\"components-custom-select-control__hint\">\n\t\t\t\t\t\t\t\t{ selectedItem.__experimentalHint }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t) }\n\t\t\t\t</SelectControlSelect>\n\t\t\t\t<div className=\"components-custom-select-control__menu-wrapper\">\n\t\t\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t\t\t<ul { ...menuProps } onKeyDown={ onKeyDownHandler }>\n\t\t\t\t\t\t{ isOpen &&\n\t\t\t\t\t\t\titems.map( ( item, index ) => (\n\t\t\t\t\t\t\t\t// eslint-disable-next-line react/jsx-key\n\t\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t\t{ ...getItemProps( {\n\t\t\t\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\tkey: item.key,\n\t\t\t\t\t\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t\t\t\t\t\titem.className,\n\t\t\t\t\t\t\t\t\t\t\t'components-custom-select-control__item',\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t'is-highlighted':\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex === highlightedIndex,\n\t\t\t\t\t\t\t\t\t\t\t\t'has-hint':\n\t\t\t\t\t\t\t\t\t\t\t\t\t!! item.__experimentalHint,\n\t\t\t\t\t\t\t\t\t\t\t\t'is-next-40px-default-size':\n\t\t\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize,\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\tstyle: item.style,\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\t\t{ item.name }\n\t\t\t\t\t\t\t\t\t{ item.__experimentalHint && (\n\t\t\t\t\t\t\t\t\t\t<span className=\"components-custom-select-control__item-hint\">\n\t\t\t\t\t\t\t\t\t\t\t{ item.__experimentalHint }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ item === selectedItem && (\n\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-custom-select-control__item-icon\"\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</li>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</InputBase>\n\t\t</div>\n\t);\n}\n\nexport function StableCustomSelectControl( props ) {\n\treturn (\n\t\t<CustomSelectControl\n\t\t\t{ ...props }\n\t\t\t__experimentalShowSelectedHint={ false }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,kBAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAT,sBAAA,CAAAF,OAAA;AAtBA;AACA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;;AAQA,MAAMY,YAAY,GAAKC,IAAI,IAAMA,IAAI,EAAEC,IAAI;AAC3C;AACA;AACA;AACA;AACA,MAAMC,YAAY,GA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ACLC,GAAG,EAAElE,IAAI,CAACkE,GAAG;MACb/C,SAAS,EAAE,IAAAoC,mBAAU,EACpBvD,IAAI,CAACmB,SAAS,EACd,wCAAwC,EACxC;QACC,gBAAgB,EACf8C,KAAK,KAAKzB,gBAAgB;QAC3B,UAAU,EACT,CAAC,CAAExC,IAAI,CAAC+D,kBAAkB;QAC3B,2BAA2B,EAC1B7C;MACF,CACD,CAAC;MACDiD,KAAK,EAAEnE,IAAI,CAACmE;IACb,CAAE;EAAC,GAEDnE,IAAI,CAACC,IAAI,EACTD,IAAI,CAAC+D,kBAAkB,IACxB,IAAAV,MAAA,CAAAC,aAAA;IAAMnC,SAAS,EAAC;EAA6C,GAC1DnB,IAAI,CAAC+D,kBACF,CACN,EACC/D,IAAI,KAAKG,YAAY,IACtB,IAAAkD,MAAA,CAAAC,aAAA,EAAChE,MAAA,CAAA8E,IAAI;IACJC,IAAI,EAAGC,YAAO;IACdnD,SAAS,EAAC;EAA6C,CACvD,CAEC,CACH,CACA,CACA,CACK,CACP,CAAC;AAER;AAEO,SAASoD,yBAAyBA,CAAEjE,KAAK,EAAG;EAClD,OACC,IAAA+C,MAAA,CAAAC,aAAA,EAACrC,mBAAmB;IAAA,GACdX,KAAK;IACV2B,8BAA8B,EAAG;EAAO,CACxC,CAAC;AAEJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_downshift","require","_clsx","_interopRequireDefault","_icons","_i18n","_element","_visuallyHidden","_selectControlStyles","_chevronDown","_baseControlStyles","_useDeprecatedProps","_inputBase","itemToString","item","name","stateReducer","selectedItem","type","changes","props","items","useSelect","stateChangeTypes","ToggleButtonKeyDownArrowDown","Math","min","indexOf","length","ToggleButtonKeyDownArrowUp","max","CustomSelectControl","__next40pxDefaultSize","className","hideLabelFromVision","label","describedBy","options","onChange","onSelectedItemChange","size","value","_selectedItem","onMouseOver","onMouseOut","onFocus","onBlur","__experimentalShowSelectedHint","useDeprecated36pxDefaultSizeProp","getLabelProps","getToggleButtonProps","getMenuProps","getItemProps","isOpen","highlightedIndex","initialSelectedItem","undefined","getDescribedBy","__","sprintf","menuProps","onKeyDownHandler","useCallback","e","stopPropagation","onKeyDown","startsWith","_react","createElement","clsx","VisuallyHidden","as","StyledLabel","default","suffix","Select","selectSize","__experimentalHint","map","index","key","style","Icon","icon","check","StableCustomSelectControl"],"sources":["@wordpress/components/src/custom-select-control/index.js"],"sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport { useSelect } from 'downshift';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Icon, check } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport { Select as SelectControlSelect } from '../select-control/styles/select-control-styles';\nimport SelectControlChevronDown from '../select-control/chevron-down';\nimport { StyledLabel } from '../base-control/styles/base-control-styles';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport InputBase from '../input-control/input-base';\n\nconst itemToString = ( item ) => item?.name;\n// This is needed so that in Windows, where\n// the menu does not necessarily open on\n// key up/down, you can still switch between\n// options with the menu closed.\nconst stateReducer = (\n\t{ selectedItem },\n\t{ type, changes, props: { items } }\n) => {\n\tswitch ( type ) {\n\t\tcase useSelect.stateChangeTypes.ToggleButtonKeyDownArrowDown:\n\t\t\t// If we already have a selected item, try to select the next one,\n\t\t\t// without circular navigation. Otherwise, select the first item.\n\t\t\treturn {\n\t\t\t\tselectedItem:\n\t\t\t\t\titems[\n\t\t\t\t\t\tselectedItem\n\t\t\t\t\t\t\t? Math.min(\n\t\t\t\t\t\t\t\t\titems.indexOf( selectedItem ) + 1,\n\t\t\t\t\t\t\t\t\titems.length - 1\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: 0\n\t\t\t\t\t],\n\t\t\t};\n\t\tcase useSelect.stateChangeTypes.ToggleButtonKeyDownArrowUp:\n\t\t\t// If we already have a selected item, try to select the previous one,\n\t\t\t// without circular navigation. Otherwise, select the last item.\n\t\t\treturn {\n\t\t\t\tselectedItem:\n\t\t\t\t\titems[\n\t\t\t\t\t\tselectedItem\n\t\t\t\t\t\t\t? Math.max( items.indexOf( selectedItem ) - 1, 0 )\n\t\t\t\t\t\t\t: items.length - 1\n\t\t\t\t\t],\n\t\t\t};\n\t\tdefault:\n\t\t\treturn changes;\n\t}\n};\n\nexport default function CustomSelectControl( props ) {\n\tconst {\n\t\t/** Start opting into the larger default height that will become the default size in a future version. */\n\t\t__next40pxDefaultSize = false,\n\t\tclassName,\n\t\thideLabelFromVision,\n\t\tlabel,\n\t\tdescribedBy,\n\t\toptions: items,\n\t\tonChange: onSelectedItemChange,\n\t\t/** @type {import('../select-control/types').SelectControlProps.size} */\n\t\tsize = 'default',\n\t\tvalue: _selectedItem,\n\t\tonMouseOver,\n\t\tonMouseOut,\n\t\tonFocus,\n\t\tonBlur,\n\t\t__experimentalShowSelectedHint = false,\n\t} = useDeprecated36pxDefaultSizeProp( props );\n\n\tconst {\n\t\tgetLabelProps,\n\t\tgetToggleButtonProps,\n\t\tgetMenuProps,\n\t\tgetItemProps,\n\t\tisOpen,\n\t\thighlightedIndex,\n\t\tselectedItem,\n\t} = useSelect( {\n\t\tinitialSelectedItem: items[ 0 ],\n\t\titems,\n\t\titemToString,\n\t\tonSelectedItemChange,\n\t\t...( typeof _selectedItem !== 'undefined' && _selectedItem !== null\n\t\t\t? { selectedItem: _selectedItem }\n\t\t\t: undefined ),\n\t\tstateReducer,\n\t} );\n\n\tfunction getDescribedBy() {\n\t\tif ( describedBy ) {\n\t\t\treturn describedBy;\n\t\t}\n\n\t\tif ( ! selectedItem ) {\n\t\t\treturn __( 'No selection' );\n\t\t}\n\n\t\t// translators: %s: The selected option.\n\t\treturn sprintf( __( 'Currently selected: %s' ), selectedItem.name );\n\t}\n\n\tconst menuProps = getMenuProps( {\n\t\tclassName: 'components-custom-select-control__menu',\n\t\t'aria-hidden': ! isOpen,\n\t} );\n\n\tconst onKeyDownHandler = useCallback(\n\t\t( e ) => {\n\t\t\te.stopPropagation();\n\t\t\tmenuProps?.onKeyDown?.( e );\n\t\t},\n\t\t[ menuProps ]\n\t);\n\n\t// We need this here, because the null active descendant is not fully ARIA compliant.\n\tif (\n\t\tmenuProps[ 'aria-activedescendant' ]?.startsWith( 'downshift-null' )\n\t) {\n\t\tdelete menuProps[ 'aria-activedescendant' ];\n\t}\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'components-custom-select-control', className ) }\n\t\t>\n\t\t\t{ hideLabelFromVision ? (\n\t\t\t\t<VisuallyHidden as=\"label\" { ...getLabelProps() }>\n\t\t\t\t\t{ label }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) : (\n\t\t\t\t/* eslint-disable-next-line jsx-a11y/label-has-associated-control, jsx-a11y/label-has-for */\n\t\t\t\t<StyledLabel\n\t\t\t\t\t{ ...getLabelProps( {\n\t\t\t\t\t\tclassName: 'components-custom-select-control__label',\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</StyledLabel>\n\t\t\t) }\n\t\t\t<InputBase\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\tsize={ size }\n\t\t\t\tsuffix={ <SelectControlChevronDown /> }\n\t\t\t>\n\t\t\t\t<SelectControlSelect\n\t\t\t\t\tonMouseOver={ onMouseOver }\n\t\t\t\t\tonMouseOut={ onMouseOut }\n\t\t\t\t\tas=\"button\"\n\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\tonBlur={ onBlur }\n\t\t\t\t\tselectSize={ size }\n\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t{ ...getToggleButtonProps( {\n\t\t\t\t\t\t// This is needed because some speech recognition software don't support `aria-labelledby`.\n\t\t\t\t\t\t'aria-label': label,\n\t\t\t\t\t\t'aria-labelledby': undefined,\n\t\t\t\t\t\tclassName: 'components-custom-select-control__button',\n\t\t\t\t\t\tdescribedBy: getDescribedBy(),\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ itemToString( selectedItem ) }\n\t\t\t\t\t{ __experimentalShowSelectedHint &&\n\t\t\t\t\t\tselectedItem.__experimentalHint && (\n\t\t\t\t\t\t\t<span className=\"components-custom-select-control__hint\">\n\t\t\t\t\t\t\t\t{ selectedItem.__experimentalHint }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t) }\n\t\t\t\t</SelectControlSelect>\n\t\t\t\t<div className=\"components-custom-select-control__menu-wrapper\">\n\t\t\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t\t\t<ul { ...menuProps } onKeyDown={ onKeyDownHandler }>\n\t\t\t\t\t\t{ isOpen &&\n\t\t\t\t\t\t\titems.map( ( item, index ) => (\n\t\t\t\t\t\t\t\t// eslint-disable-next-line react/jsx-key\n\t\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t\t{ ...getItemProps( {\n\t\t\t\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\tkey: item.key,\n\t\t\t\t\t\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t\t\t\t\t\titem.className,\n\t\t\t\t\t\t\t\t\t\t\t'components-custom-select-control__item',\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t'is-highlighted':\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex === highlightedIndex,\n\t\t\t\t\t\t\t\t\t\t\t\t'has-hint':\n\t\t\t\t\t\t\t\t\t\t\t\t\t!! item.__experimentalHint,\n\t\t\t\t\t\t\t\t\t\t\t\t'is-next-40px-default-size':\n\t\t\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize,\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\tstyle: item.style,\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\t\t{ item.name }\n\t\t\t\t\t\t\t\t\t{ item.__experimentalHint && (\n\t\t\t\t\t\t\t\t\t\t<span className=\"components-custom-select-control__item-hint\">\n\t\t\t\t\t\t\t\t\t\t\t{ item.__experimentalHint }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ item === selectedItem && (\n\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-custom-select-control__item-icon\"\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</li>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</InputBase>\n\t\t</div>\n\t);\n}\n\nexport function StableCustomSelectControl( props ) {\n\treturn (\n\t\t<CustomSelectControl\n\t\t\t{ ...props }\n\t\t\t__experimentalShowSelectedHint={ false }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,kBAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAT,sBAAA,CAAAF,OAAA;AAtBA;AACA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;;AAQA,MAAM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ACvB;EACA,IAAAZ,MAAA,CAAAC,aAAA;IAAA,GACMhB,YAAY,CAAE;MAClBtC,IAAI;MACJiE,KAAK;MACLC,GAAG,EAAElE,IAAI,CAACkE,GAAG;MACb/C,SAAS,EAAE,IAAAoC,aAAI,EACdvD,IAAI,CAACmB,SAAS,EACd,wCAAwC,EACxC;QACC,gBAAgB,EACf8C,KAAK,KAAKzB,gBAAgB;QAC3B,UAAU,EACT,CAAC,CAAExC,IAAI,CAAC+D,kBAAkB;QAC3B,2BAA2B,EAC1B7C;MACF,CACD,CAAC;MACDiD,KAAK,EAAEnE,IAAI,CAACmE;IACb,CAAE;EAAC,GAEDnE,IAAI,CAACC,IAAI,EACTD,IAAI,CAAC+D,kBAAkB,IACxB,IAAAV,MAAA,CAAAC,aAAA;IAAMnC,SAAS,EAAC;EAA6C,GAC1DnB,IAAI,CAAC+D,kBACF,CACN,EACC/D,IAAI,KAAKG,YAAY,IACtB,IAAAkD,MAAA,CAAAC,aAAA,EAAChE,MAAA,CAAA8E,IAAI;IACJC,IAAI,EAAGC,YAAO;IACdnD,SAAS,EAAC;EAA6C,CACvD,CAEC,CACH,CACA,CACA,CACK,CACP,CAAC;AAER;AAEO,SAASoD,yBAAyBA,CAAEjE,KAAK,EAAG;EAClD,OACC,IAAA+C,MAAA,CAAAC,aAAA,EAACrC,mBAAmB;IAAA,GACdX,KAAK;IACV2B,8BAA8B,EAAG;EAAO,CACxC,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -41,7 +41,9 @@ function CustomSelectControl(props) {
|
|
|
41
41
|
// Forward props + store from v2 implementation
|
|
42
42
|
const store = Ariakit.useSelectStore({
|
|
43
43
|
async setValue(nextValue) {
|
|
44
|
-
if (!onChange)
|
|
44
|
+
if (!onChange) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
45
47
|
|
|
46
48
|
// Executes the logic in a microtask after the popup is closed.
|
|
47
49
|
// This is simply to ensure the isOpen state matches that in Downshift.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_customSelect","_interopRequireDefault","_item","Styled","_context","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CustomSelectControl","props","__experimentalShowSelectedHint","__next40pxDefaultSize","options","onChange","size","value","restProps","store","useSelectStore","setValue","nextValue","Promise","resolve","state","getState","changeObject","highlightedIndex","renderedItems","findIndex","item","inputValue","isOpen","open","selectedItem","name","key","type","children","map","__experimentalHint","rest","withHint","_react","createElement","WithHintWrapper","ExperimentalHintItem","className","renderSelectedValueHint","currentValue","currentHint","find","Fragment","SelectedExperimentalHintItem","contextSystemValue","useMemo","selectedSize","CustomSelectControlButton","_overrides","translatedProps","describedBy","renderSelectedValue","undefined","ContextSystemProvider","_default","exports"],"sources":["@wordpress/components/src/custom-select-control-v2/legacy-component/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport _CustomSelect from '../custom-select';\nimport CustomSelectItem from '../item';\nimport type { LegacyCustomSelectProps } from '../types';\nimport * as Styled from '../styles';\nimport { ContextSystemProvider } from '../../context';\n\nfunction CustomSelectControl( props: LegacyCustomSelectProps ) {\n\tconst {\n\t\t__experimentalShowSelectedHint,\n\t\t__next40pxDefaultSize = false,\n\t\toptions,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tvalue,\n\t\t...restProps\n\t} = props;\n\n\t// Forward props + store from v2 implementation\n\tconst store = Ariakit.useSelectStore( {\n\t\tasync setValue( nextValue ) {\n\t\t\tif ( ! onChange )
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_customSelect","_interopRequireDefault","_item","Styled","_context","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CustomSelectControl","props","__experimentalShowSelectedHint","__next40pxDefaultSize","options","onChange","size","value","restProps","store","useSelectStore","setValue","nextValue","Promise","resolve","state","getState","changeObject","highlightedIndex","renderedItems","findIndex","item","inputValue","isOpen","open","selectedItem","name","key","type","children","map","__experimentalHint","rest","withHint","_react","createElement","WithHintWrapper","ExperimentalHintItem","className","renderSelectedValueHint","currentValue","currentHint","find","Fragment","SelectedExperimentalHintItem","contextSystemValue","useMemo","selectedSize","CustomSelectControlButton","_overrides","translatedProps","describedBy","renderSelectedValue","undefined","ContextSystemProvider","_default","exports"],"sources":["@wordpress/components/src/custom-select-control-v2/legacy-component/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport _CustomSelect from '../custom-select';\nimport CustomSelectItem from '../item';\nimport type { LegacyCustomSelectProps } from '../types';\nimport * as Styled from '../styles';\nimport { ContextSystemProvider } from '../../context';\n\nfunction CustomSelectControl( props: LegacyCustomSelectProps ) {\n\tconst {\n\t\t__experimentalShowSelectedHint,\n\t\t__next40pxDefaultSize = false,\n\t\toptions,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tvalue,\n\t\t...restProps\n\t} = props;\n\n\t// Forward props + store from v2 implementation\n\tconst store = Ariakit.useSelectStore( {\n\t\tasync setValue( nextValue ) {\n\t\t\tif ( ! onChange ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Executes the logic in a microtask after the popup is closed.\n\t\t\t// This is simply to ensure the isOpen state matches that in Downshift.\n\t\t\tawait Promise.resolve();\n\t\t\tconst state = store.getState();\n\n\t\t\tconst changeObject = {\n\t\t\t\thighlightedIndex: state.renderedItems.findIndex(\n\t\t\t\t\t( item ) => item.value === nextValue\n\t\t\t\t),\n\t\t\t\tinputValue: '',\n\t\t\t\tisOpen: state.open,\n\t\t\t\tselectedItem: {\n\t\t\t\t\tname: nextValue as string,\n\t\t\t\t\tkey: nextValue as string,\n\t\t\t\t},\n\t\t\t\ttype: '',\n\t\t\t};\n\t\t\tonChange( changeObject );\n\t\t},\n\t} );\n\n\tconst children = options.map(\n\t\t( { name, key, __experimentalHint, ...rest } ) => {\n\t\t\tconst withHint = (\n\t\t\t\t<Styled.WithHintWrapper>\n\t\t\t\t\t<span>{ name }</span>\n\t\t\t\t\t<Styled.ExperimentalHintItem className=\"components-custom-select-control__item-hint\">\n\t\t\t\t\t\t{ __experimentalHint }\n\t\t\t\t\t</Styled.ExperimentalHintItem>\n\t\t\t\t</Styled.WithHintWrapper>\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\t<CustomSelectItem\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvalue={ name }\n\t\t\t\t\tchildren={ __experimentalHint ? withHint : name }\n\t\t\t\t\t{ ...rest }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t);\n\n\tconst renderSelectedValueHint = () => {\n\t\tconst { value: currentValue } = store.getState();\n\n\t\tconst currentHint = options?.find(\n\t\t\t( { name } ) => currentValue === name\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ currentValue }\n\t\t\t\t<Styled.SelectedExperimentalHintItem className=\"components-custom-select-control__hint\">\n\t\t\t\t\t{ currentHint?.__experimentalHint }\n\t\t\t\t</Styled.SelectedExperimentalHintItem>\n\t\t\t</>\n\t\t);\n\t};\n\n\t// translate legacy button sizing\n\tconst contextSystemValue = useMemo( () => {\n\t\tlet selectedSize;\n\n\t\tif (\n\t\t\t( __next40pxDefaultSize && size === 'default' ) ||\n\t\t\tsize === '__unstable-large'\n\t\t) {\n\t\t\tselectedSize = 'default';\n\t\t} else if ( ! __next40pxDefaultSize && size === 'default' ) {\n\t\t\tselectedSize = 'compact';\n\t\t} else {\n\t\t\tselectedSize = size;\n\t\t}\n\n\t\treturn {\n\t\t\tCustomSelectControlButton: { _overrides: { size: selectedSize } },\n\t\t};\n\t}, [ __next40pxDefaultSize, size ] );\n\n\tconst translatedProps = {\n\t\t'aria-describedby': props.describedBy,\n\t\tchildren,\n\t\trenderSelectedValue: __experimentalShowSelectedHint\n\t\t\t? renderSelectedValueHint\n\t\t\t: undefined,\n\t\t...restProps,\n\t};\n\n\treturn (\n\t\t<ContextSystemProvider value={ contextSystemValue }>\n\t\t\t<_CustomSelect { ...translatedProps } store={ store } />\n\t\t</ContextSystemProvider>\n\t);\n}\n\nexport default CustomSelectControl;\n"],"mappings":";;;;;;;;AAIA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAD,OAAA;AAIA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AAEA,IAAAK,MAAA,GAAAN,uBAAA,CAAAC,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAAsD,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAA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AAC,gBAAO,EAAE,MAAM;IACzC,IAAIC,YAAY;IAEhB,IACG5C,qBAAqB,IAAIG,IAAI,KAAK,SAAS,IAC7CA,IAAI,KAAK,kBAAkB,EAC1B;MACDyC,YAAY,GAAG,SAAS;IACzB,CAAC,MAAM,IAAK,CAAE5C,qBAAqB,IAAIG,IAAI,KAAK,SAAS,EAAG;MAC3DyC,YAAY,GAAG,SAAS;IACzB,CAAC,MAAM;MACNA,YAAY,GAAGzC,IAAI;IACpB;IAEA,OAAO;MACN0C,yBAAyB,EAAE;QAAEC,UAAU,EAAE;UAAE3C,IAAI,EAAEyC;QAAa;MAAE;IACjE,CAAC;EACF,CAAC,EAAE,CAAE5C,qBAAqB,EAAEG,IAAI,CAAG,CAAC;EAEpC,MAAM4C,eAAe,GAAG;IACvB,kBAAkB,EAAEjD,KAAK,CAACkD,WAAW;IACrCtB,QAAQ;IACRuB,mBAAmB,EAAElD,8BAA8B,GAChDqC,uBAAuB,GACvBc,SAAS;IACZ,GAAG7C;EACJ,CAAC;EAED,OACC,IAAA0B,MAAA,CAAAC,aAAA,EAACxD,QAAA,CAAA2E,qBAAqB;IAAC/C,KAAK,EAAGsC;EAAoB,GAClD,IAAAX,MAAA,CAAAC,aAAA,EAAC5D,aAAA,CAAAW,OAAa;IAAA,GAAMgE,eAAe;IAAGzC,KAAK,EAAGA;EAAO,CAAE,CACjC,CAAC;AAE1B;AAAC,IAAA8C,QAAA,GAAAC,OAAA,CAAAtE,OAAA,GAEcc,mBAAmB","ignoreList":[]}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.DimensionControl = DimensionControl;
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = require("react");
|
|
10
|
-
var
|
|
10
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
12
12
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
13
13
|
var _selectControl = _interopRequireDefault(require("../select-control"));
|
|
@@ -85,7 +85,7 @@ function DimensionControl(props) {
|
|
|
85
85
|
}), label);
|
|
86
86
|
return (0, _react.createElement)(_selectControl.default, {
|
|
87
87
|
__next40pxDefaultSize: __next40pxDefaultSize,
|
|
88
|
-
className: (0,
|
|
88
|
+
className: (0, _clsx.default)(className, 'block-editor-dimension-control'),
|
|
89
89
|
label: selectLabel,
|
|
90
90
|
hideLabelFromVision: false,
|
|
91
91
|
value: value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_icon","_selectControl","_sizes","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DimensionControl","props","__next40pxDefaultSize","label","value","sizes","sizesTable","icon","onChange","className","onChangeSpacingSize","val","theSize","findSizeBySlug","slug","undefined","formatSizesAsOptions","theSizes","options","map","name","__","selectLabel","_react","createElement","Fragment","clsx","hideLabelFromVision","_default","exports"],"sources":["@wordpress/components/src/dimension-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Icon from '../icon';\nimport SelectControl from '../select-control';\nimport sizesTable, { findSizeBySlug } from './sizes';\nimport type { DimensionControlProps, Size } from './types';\nimport type { SelectControlSingleSelectionProps } from '../select-control/types';\n\n/**\n * `DimensionControl` is a component designed to provide a UI to control spacing and/or dimensions.\n *\n * This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.\n *\n * ```jsx\n * import { __experimentalDimensionControl as DimensionControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * export default function MyCustomDimensionControl() {\n * \tconst [ paddingSize, setPaddingSize ] = useState( '' );\n *\n * \treturn (\n * \t\t<DimensionControl\n * \t\t\tlabel={ 'Padding' }\n * \t\t\ticon={ 'desktop' }\n * \t\t\tonChange={ ( value ) => setPaddingSize( value ) }\n * \t\t\tvalue={ paddingSize }\n * \t\t/>\n * \t);\n * }\n * ```\n */\nexport function DimensionControl( props: DimensionControlProps ) {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\tlabel,\n\t\tvalue,\n\t\tsizes = sizesTable,\n\t\ticon,\n\t\tonChange,\n\t\tclassName = '',\n\t} = props;\n\n\tconst onChangeSpacingSize: SelectControlSingleSelectionProps[ 'onChange' ] =\n\t\t( val ) => {\n\t\t\tconst theSize = findSizeBySlug( sizes, val );\n\n\t\t\tif ( ! theSize || value === theSize.slug ) {\n\t\t\t\tonChange?.( undefined );\n\t\t\t} else if ( typeof onChange === 'function' ) {\n\t\t\t\tonChange( theSize.slug );\n\t\t\t}\n\t\t};\n\n\tconst formatSizesAsOptions = ( theSizes: Size[] ) => {\n\t\tconst options = theSizes.map( ( { name, slug } ) => ( {\n\t\t\tlabel: name,\n\t\t\tvalue: slug,\n\t\t} ) );\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: __( 'Default' ),\n\t\t\t\tvalue: '',\n\t\t\t},\n\t\t\t...options,\n\t\t];\n\t};\n\n\tconst selectLabel = (\n\t\t<>\n\t\t\t{ icon && <Icon icon={ icon } /> }\n\t\t\t{ label }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tclassName={ clsx( className, 'block-editor-dimension-control' ) }\n\t\t\tlabel={ selectLabel }\n\t\t\thideLabelFromVision={ false }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChangeSpacingSize }\n\t\t\toptions={ formatSizesAsOptions( sizes ) }\n\t\t/>\n\t);\n}\n\nexport default DimensionControl;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,O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,CACF;EAED,OACC,IAAAoB,MAAA,CAAAC,aAAA,EAAC/C,cAAA,CAAAS,OAAa;IACbgB,qBAAqB,EAAGA,qBAAuB;IAC/CO,SAAS,EAAG,IAAAiB,aAAI,EAAEjB,SAAS,EAAE,gCAAiC,CAAG;IACjEN,KAAK,EAAGmB,WAAa;IACrBK,mBAAmB,EAAG,KAAO;IAC7BvB,KAAK,EAAGA,KAAO;IACfI,QAAQ,EAAGE,mBAAqB;IAChCQ,OAAO,EAAGF,oBAAoB,CAAEX,KAAM;EAAG,CACzC,CAAC;AAEJ;AAAC,IAAAuB,QAAA,GAAAC,OAAA,CAAA3C,OAAA,GAEcc,gBAAgB","ignoreList":[]}
|
package/build/drop-zone/index.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.DropZoneComponent = DropZoneComponent;
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = require("react");
|
|
10
|
-
var
|
|
10
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
12
12
|
var _element = require("@wordpress/element");
|
|
13
13
|
var _icons = require("@wordpress/icons");
|
|
@@ -26,6 +26,75 @@ var _animation = require("../animation");
|
|
|
26
26
|
* Internal dependencies
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
+
const backdrop = {
|
|
30
|
+
hidden: {
|
|
31
|
+
opacity: 0
|
|
32
|
+
},
|
|
33
|
+
show: {
|
|
34
|
+
opacity: 1,
|
|
35
|
+
transition: {
|
|
36
|
+
type: 'tween',
|
|
37
|
+
duration: 0.2,
|
|
38
|
+
delay: 0,
|
|
39
|
+
delayChildren: 0.1
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
exit: {
|
|
43
|
+
opacity: 0,
|
|
44
|
+
transition: {
|
|
45
|
+
duration: 0.2,
|
|
46
|
+
delayChildren: 0
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const foreground = {
|
|
51
|
+
hidden: {
|
|
52
|
+
opacity: 0,
|
|
53
|
+
scale: 0.9
|
|
54
|
+
},
|
|
55
|
+
show: {
|
|
56
|
+
opacity: 1,
|
|
57
|
+
scale: 1,
|
|
58
|
+
transition: {
|
|
59
|
+
duration: 0.1
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
exit: {
|
|
63
|
+
opacity: 0,
|
|
64
|
+
scale: 0.9
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
function DropIndicator({
|
|
68
|
+
label
|
|
69
|
+
}) {
|
|
70
|
+
const disableMotion = (0, _compose.useReducedMotion)();
|
|
71
|
+
const children = (0, _react.createElement)(_animation.__unstableMotion.div, {
|
|
72
|
+
variants: backdrop,
|
|
73
|
+
initial: disableMotion ? 'show' : 'hidden',
|
|
74
|
+
animate: "show",
|
|
75
|
+
exit: disableMotion ? 'show' : 'exit',
|
|
76
|
+
className: "components-drop-zone__content"
|
|
77
|
+
// Without this, when this div is shown,
|
|
78
|
+
// Safari calls a onDropZoneLeave causing a loop because of this bug
|
|
79
|
+
// https://bugs.webkit.org/show_bug.cgi?id=66547
|
|
80
|
+
,
|
|
81
|
+
style: {
|
|
82
|
+
pointerEvents: 'none'
|
|
83
|
+
}
|
|
84
|
+
}, (0, _react.createElement)(_animation.__unstableMotion.div, {
|
|
85
|
+
variants: foreground
|
|
86
|
+
}, (0, _react.createElement)(_icons.Icon, {
|
|
87
|
+
icon: _icons.upload,
|
|
88
|
+
className: "components-drop-zone__content-icon"
|
|
89
|
+
}), (0, _react.createElement)("span", {
|
|
90
|
+
className: "components-drop-zone__content-text"
|
|
91
|
+
}, label ? label : (0, _i18n.__)('Drop files to upload'))));
|
|
92
|
+
if (disableMotion) {
|
|
93
|
+
return children;
|
|
94
|
+
}
|
|
95
|
+
return (0, _react.createElement)(_animation.__unstableAnimatePresence, null, children);
|
|
96
|
+
}
|
|
97
|
+
|
|
29
98
|
/**
|
|
30
99
|
* `DropZone` is a component creating a drop zone area taking the full size of its parent element. It supports dropping files, HTML content or any other HTML drop event.
|
|
31
100
|
*
|
|
@@ -106,70 +175,7 @@ function DropZoneComponent({
|
|
|
106
175
|
setIsDraggingOverElement(false);
|
|
107
176
|
}
|
|
108
177
|
});
|
|
109
|
-
const
|
|
110
|
-
let children;
|
|
111
|
-
const backdrop = {
|
|
112
|
-
hidden: {
|
|
113
|
-
opacity: 0
|
|
114
|
-
},
|
|
115
|
-
show: {
|
|
116
|
-
opacity: 1,
|
|
117
|
-
transition: {
|
|
118
|
-
type: 'tween',
|
|
119
|
-
duration: 0.2,
|
|
120
|
-
delay: 0,
|
|
121
|
-
delayChildren: 0.1
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
exit: {
|
|
125
|
-
opacity: 0,
|
|
126
|
-
transition: {
|
|
127
|
-
duration: 0.2,
|
|
128
|
-
delayChildren: 0
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
const foreground = {
|
|
133
|
-
hidden: {
|
|
134
|
-
opacity: 0,
|
|
135
|
-
scale: 0.9
|
|
136
|
-
},
|
|
137
|
-
show: {
|
|
138
|
-
opacity: 1,
|
|
139
|
-
scale: 1,
|
|
140
|
-
transition: {
|
|
141
|
-
duration: 0.1
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
exit: {
|
|
145
|
-
opacity: 0,
|
|
146
|
-
scale: 0.9
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
if (isDraggingOverElement) {
|
|
150
|
-
children = (0, _react.createElement)(_animation.__unstableMotion.div, {
|
|
151
|
-
variants: backdrop,
|
|
152
|
-
initial: disableMotion ? 'show' : 'hidden',
|
|
153
|
-
animate: "show",
|
|
154
|
-
exit: disableMotion ? 'show' : 'exit',
|
|
155
|
-
className: "components-drop-zone__content"
|
|
156
|
-
// Without this, when this div is shown,
|
|
157
|
-
// Safari calls a onDropZoneLeave causing a loop because of this bug
|
|
158
|
-
// https://bugs.webkit.org/show_bug.cgi?id=66547
|
|
159
|
-
,
|
|
160
|
-
style: {
|
|
161
|
-
pointerEvents: 'none'
|
|
162
|
-
}
|
|
163
|
-
}, (0, _react.createElement)(_animation.__unstableMotion.div, {
|
|
164
|
-
variants: foreground
|
|
165
|
-
}, (0, _react.createElement)(_icons.Icon, {
|
|
166
|
-
icon: _icons.upload,
|
|
167
|
-
className: "components-drop-zone__content-icon"
|
|
168
|
-
}), (0, _react.createElement)("span", {
|
|
169
|
-
className: "components-drop-zone__content-text"
|
|
170
|
-
}, label ? label : (0, _i18n.__)('Drop files to upload'))));
|
|
171
|
-
}
|
|
172
|
-
const classes = (0, _classnames.default)('components-drop-zone', className, {
|
|
178
|
+
const classes = (0, _clsx.default)('components-drop-zone', className, {
|
|
173
179
|
'is-active': (isDraggingOverDocument || isDraggingOverElement) && (type === 'file' && onFilesDrop || type === 'html' && onHTMLDrop || type === 'default' && onDrop),
|
|
174
180
|
'is-dragging-over-document': isDraggingOverDocument,
|
|
175
181
|
'is-dragging-over-element': isDraggingOverElement,
|
|
@@ -179,7 +185,9 @@ function DropZoneComponent({
|
|
|
179
185
|
...restProps,
|
|
180
186
|
ref: ref,
|
|
181
187
|
className: classes
|
|
182
|
-
},
|
|
188
|
+
}, isDraggingOverElement && (0, _react.createElement)(DropIndicator, {
|
|
189
|
+
label: label
|
|
190
|
+
}));
|
|
183
191
|
}
|
|
184
192
|
var _default = exports.default = DropZoneComponent;
|
|
185
193
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_element","_icons","_dom","_compose","_animation","DropZoneComponent","className","label","onFilesDrop","onHTMLDrop","onDrop","restProps","isDraggingOverDocument","setIsDraggingOverDocument","useState","isDraggingOverElement","setIsDraggingOverElement","type","setType","ref","useDropZone","event","files","dataTransfer","getFilesFromDataTransfer","html","getData","length","onDragStart","_type","types","includes","onDragEnd","undefined","onDragEnter","onDragLeave","disableMotion","useReducedMotion","children","backdrop","hidden","opacity","show","transition","duration","delay","delayChildren","exit","foreground","scale","_react","createElement","__unstableMotion","div","variants","initial","animate","style","pointerEvents","Icon","icon","upload","__","classes","classnames","__unstableAnimatePresence","_default","exports","default"],"sources":["@wordpress/components/src/drop-zone/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { upload, Icon } from '@wordpress/icons';\nimport { getFilesFromDataTransfer } from '@wordpress/dom';\nimport {\n\t__experimentalUseDropZone as useDropZone,\n\tuseReducedMotion,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '../animation';\nimport type { DropType, DropZoneProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\n/**\n * `DropZone` is a component creating a drop zone area taking the full size of its parent element. It supports dropping files, HTML content or any other HTML drop event.\n *\n * ```jsx\n * import { DropZone } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyDropZone = () => {\n * const [ hasDropped, setHasDropped ] = useState( false );\n *\n * return (\n * <div>\n * { hasDropped ? 'Dropped!' : 'Drop something here' }\n * <DropZone\n * onFilesDrop={ () => setHasDropped( true ) }\n * onHTMLDrop={ () => setHasDropped( true ) }\n * onDrop={ () => setHasDropped( true ) }\n * />\n * </div>\n * );\n * }\n * ```\n */\nexport function DropZoneComponent( {\n\tclassName,\n\tlabel,\n\tonFilesDrop,\n\tonHTMLDrop,\n\tonDrop,\n\t...restProps\n}: WordPressComponentProps< DropZoneProps, 'div', false > ) {\n\tconst [ isDraggingOverDocument, setIsDraggingOverDocument ] =\n\t\tuseState< boolean >();\n\tconst [ isDraggingOverElement, setIsDraggingOverElement ] =\n\t\tuseState< boolean >();\n\tconst [ type, setType ] = useState< DropType >();\n\tconst ref = useDropZone( {\n\t\tonDrop( event ) {\n\t\t\tconst files = event.dataTransfer\n\t\t\t\t? getFilesFromDataTransfer( event.dataTransfer )\n\t\t\t\t: [];\n\t\t\tconst html = event.dataTransfer?.getData( 'text/html' );\n\n\t\t\t/**\n\t\t\t * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.\n\t\t\t * The order of the checks is important to recognise the HTML drop.\n\t\t\t */\n\t\t\tif ( html && onHTMLDrop ) {\n\t\t\t\tonHTMLDrop( html );\n\t\t\t} else if ( files.length && onFilesDrop ) {\n\t\t\t\tonFilesDrop( files );\n\t\t\t} else if ( onDrop ) {\n\t\t\t\tonDrop( event );\n\t\t\t}\n\t\t},\n\t\tonDragStart( event ) {\n\t\t\tsetIsDraggingOverDocument( true );\n\n\t\t\tlet _type: DropType = 'default';\n\n\t\t\t/**\n\t\t\t * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.\n\t\t\t * The order of the checks is important to recognise the HTML drop.\n\t\t\t */\n\t\t\tif ( event.dataTransfer?.types.includes( 'text/html' ) ) {\n\t\t\t\t_type = 'html';\n\t\t\t} else if (\n\t\t\t\t// Check for the types because sometimes the files themselves\n\t\t\t\t// are only available on drop.\n\t\t\t\tevent.dataTransfer?.types.includes( 'Files' ) ||\n\t\t\t\t( event.dataTransfer\n\t\t\t\t\t? getFilesFromDataTransfer( event.dataTransfer )\n\t\t\t\t\t: []\n\t\t\t\t).length > 0\n\t\t\t) {\n\t\t\t\t_type = 'file';\n\t\t\t}\n\n\t\t\tsetType( _type );\n\t\t},\n\t\tonDragEnd() {\n\t\t\tsetIsDraggingOverDocument( false );\n\t\t\tsetType( undefined );\n\t\t},\n\t\tonDragEnter() {\n\t\t\tsetIsDraggingOverElement( true );\n\t\t},\n\t\tonDragLeave() {\n\t\t\tsetIsDraggingOverElement( false );\n\t\t},\n\t} );\n\tconst disableMotion = useReducedMotion();\n\n\tlet children;\n\tconst backdrop = {\n\t\thidden: { opacity: 0 },\n\t\tshow: {\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\ttype: 'tween',\n\t\t\t\tduration: 0.2,\n\t\t\t\tdelay: 0,\n\t\t\t\tdelayChildren: 0.1,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\topacity: 0,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.2,\n\t\t\t\tdelayChildren: 0,\n\t\t\t},\n\t\t},\n\t};\n\n\tconst foreground = {\n\t\thidden: { opacity: 0, scale: 0.9 },\n\t\tshow: {\n\t\t\topacity: 1,\n\t\t\tscale: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.1,\n\t\t\t},\n\t\t},\n\t\texit: { opacity: 0, scale: 0.9 },\n\t};\n\n\tif ( isDraggingOverElement ) {\n\t\tchildren = (\n\t\t\t<motion.div\n\t\t\t\tvariants={ backdrop }\n\t\t\t\tinitial={ disableMotion ? 'show' : 'hidden' }\n\t\t\t\tanimate=\"show\"\n\t\t\t\texit={ disableMotion ? 'show' : 'exit' }\n\t\t\t\tclassName=\"components-drop-zone__content\"\n\t\t\t\t// Without this, when this div is shown,\n\t\t\t\t// Safari calls a onDropZoneLeave causing a loop because of this bug\n\t\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=66547\n\t\t\t\tstyle={ { pointerEvents: 'none' } }\n\t\t\t>\n\t\t\t\t<motion.div variants={ foreground }>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\tclassName=\"components-drop-zone__content-icon\"\n\t\t\t\t\t/>\n\t\t\t\t\t<span className=\"components-drop-zone__content-text\">\n\t\t\t\t\t\t{ label ? label : __( 'Drop files to upload' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</motion.div>\n\t\t\t</motion.div>\n\t\t);\n\t}\n\n\tconst classes = classnames( 'components-drop-zone', className, {\n\t\t'is-active':\n\t\t\t( isDraggingOverDocument || isDraggingOverElement ) &&\n\t\t\t( ( type === 'file' && onFilesDrop ) ||\n\t\t\t\t( type === 'html' && onHTMLDrop ) ||\n\t\t\t\t( type === 'default' && onDrop ) ),\n\t\t'is-dragging-over-document': isDraggingOverDocument,\n\t\t'is-dragging-over-element': isDraggingOverElement,\n\t\t[ `is-dragging-${ type }` ]: !! type,\n\t} );\n\n\treturn (\n\t\t<div { ...restProps } ref={ ref } className={ classes }>\n\t\t\t{ disableMotion ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<AnimatePresence>{ children }</AnimatePresence>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default DropZoneComponent;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAQA,IAAAM,UAAA,GAAAN,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,iBAAiBA,CAAE;EAClCC,SAAS;EACTC,KAAK;EACLC,WAAW;EACXC,UAAU;EACVC,MAAM;EACN,GAAGC;AACoD,CAAC,EAAG;EAC3D,MAAM,CAAEC,sBAAsB,EAAEC,yBAAyB,CAAE,GAC1D,IAAAC,iBAAQ,EAAY,CAAC;EACtB,MAAM,CAAEC,qBAAqB,EAAEC,wBAAwB,CAAE,GACxD,IAAAF,iBAAQ,EAAY,CAAC;EACtB,MAAM,CAAEG,IAAI,EAAEC,OAAO,CAAE,GAAG,IAAAJ,iBAAQ,EAAa,CAAC;EAChD,MAAMK,GAAG,GAAG,IAAAC,kCAAW,EAAE;IACxBV,MAAMA,CAAEW,KAAK,EAAG;MACf,MAAMC,KAAK,GAAGD,KAAK,CAACE,YAAY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AA,CAAA0D,IAAI;MACJC,IAAI,EAAGC,aAAQ;MACfvD,SAAS,EAAC;IAAoC,CAC9C,CAAC,EACF,IAAA4C,MAAA,CAAAC,aAAA;MAAM7C,SAAS,EAAC;IAAoC,GACjDC,KAAK,GAAGA,KAAK,GAAG,IAAAuD,QAAE,EAAE,sBAAuB,CACxC,CACK,CACD,CACZ;EACF;EAEA,MAAMC,OAAO,GAAG,IAAAC,mBAAU,EAAE,sBAAsB,EAAE1D,SAAS,EAAE;IAC9D,WAAW,EACV,CAAEM,sBAAsB,IAAIG,qBAAqB,MAC7CE,IAAI,KAAK,MAAM,IAAIT,WAAW,IAC/BS,IAAI,KAAK,MAAM,IAAIR,UAAY,IAC/BQ,IAAI,KAAK,SAAS,IAAIP,MAAQ,CAAE;IACpC,2BAA2B,EAAEE,sBAAsB;IACnD,0BAA0B,EAAEG,qBAAqB;IACjD,CAAG,eAAeE,IAAM,EAAC,GAAI,CAAC,CAAEA;EACjC,CAAE,CAAC;EAEH,OACC,IAAAiC,MAAA,CAAAC,aAAA;IAAA,GAAUxC,SAAS;IAAGQ,GAAG,EAAGA,GAAK;IAACb,SAAS,EAAGyD;EAAS,GACpD3B,aAAa,GACdE,QAAQ,GAER,IAAAY,MAAA,CAAAC,aAAA,EAAC/C,UAAA,CAAA6D,yBAAe,QAAG3B,QAA2B,CAE3C,CAAC;AAER;AAAC,IAAA4B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc/D,iBAAiB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_icons","_dom","_compose","_animation","backdrop","hidden","opacity","show","transition","type","duration","delay","delayChildren","exit","foreground","scale","DropIndicator","label","disableMotion","useReducedMotion","children","_react","createElement","__unstableMotion","div","variants","initial","animate","className","style","pointerEvents","Icon","icon","upload","__","__unstableAnimatePresence","DropZoneComponent","onFilesDrop","onHTMLDrop","onDrop","restProps","isDraggingOverDocument","setIsDraggingOverDocument","useState","isDraggingOverElement","setIsDraggingOverElement","setType","ref","useDropZone","event","files","dataTransfer","getFilesFromDataTransfer","html","getData","length","onDragStart","_type","types","includes","onDragEnd","undefined","onDragEnter","onDragLeave","classes","clsx","_default","exports","default"],"sources":["@wordpress/components/src/drop-zone/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { upload, Icon } from '@wordpress/icons';\nimport { getFilesFromDataTransfer } from '@wordpress/dom';\nimport {\n\t__experimentalUseDropZone as useDropZone,\n\tuseReducedMotion,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '../animation';\nimport type { DropType, DropZoneProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nconst backdrop = {\n\thidden: { opacity: 0 },\n\tshow: {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\ttype: 'tween',\n\t\t\tduration: 0.2,\n\t\t\tdelay: 0,\n\t\t\tdelayChildren: 0.1,\n\t\t},\n\t},\n\texit: {\n\t\topacity: 0,\n\t\ttransition: {\n\t\t\tduration: 0.2,\n\t\t\tdelayChildren: 0,\n\t\t},\n\t},\n};\n\nconst foreground = {\n\thidden: { opacity: 0, scale: 0.9 },\n\tshow: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\ttransition: {\n\t\t\tduration: 0.1,\n\t\t},\n\t},\n\texit: { opacity: 0, scale: 0.9 },\n};\n\nfunction DropIndicator( { label }: { label?: string } ) {\n\tconst disableMotion = useReducedMotion();\n\tconst children = (\n\t\t<motion.div\n\t\t\tvariants={ backdrop }\n\t\t\tinitial={ disableMotion ? 'show' : 'hidden' }\n\t\t\tanimate=\"show\"\n\t\t\texit={ disableMotion ? 'show' : 'exit' }\n\t\t\tclassName=\"components-drop-zone__content\"\n\t\t\t// Without this, when this div is shown,\n\t\t\t// Safari calls a onDropZoneLeave causing a loop because of this bug\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=66547\n\t\t\tstyle={ { pointerEvents: 'none' } }\n\t\t>\n\t\t\t<motion.div variants={ foreground }>\n\t\t\t\t<Icon\n\t\t\t\t\ticon={ upload }\n\t\t\t\t\tclassName=\"components-drop-zone__content-icon\"\n\t\t\t\t/>\n\t\t\t\t<span className=\"components-drop-zone__content-text\">\n\t\t\t\t\t{ label ? label : __( 'Drop files to upload' ) }\n\t\t\t\t</span>\n\t\t\t</motion.div>\n\t\t</motion.div>\n\t);\n\n\tif ( disableMotion ) {\n\t\treturn children;\n\t}\n\n\treturn <AnimatePresence>{ children }</AnimatePresence>;\n}\n\n/**\n * `DropZone` is a component creating a drop zone area taking the full size of its parent element. It supports dropping files, HTML content or any other HTML drop event.\n *\n * ```jsx\n * import { DropZone } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyDropZone = () => {\n * const [ hasDropped, setHasDropped ] = useState( false );\n *\n * return (\n * <div>\n * { hasDropped ? 'Dropped!' : 'Drop something here' }\n * <DropZone\n * onFilesDrop={ () => setHasDropped( true ) }\n * onHTMLDrop={ () => setHasDropped( true ) }\n * onDrop={ () => setHasDropped( true ) }\n * />\n * </div>\n * );\n * }\n * ```\n */\nexport function DropZoneComponent( {\n\tclassName,\n\tlabel,\n\tonFilesDrop,\n\tonHTMLDrop,\n\tonDrop,\n\t...restProps\n}: WordPressComponentProps< DropZoneProps, 'div', false > ) {\n\tconst [ isDraggingOverDocument, setIsDraggingOverDocument ] =\n\t\tuseState< boolean >();\n\tconst [ isDraggingOverElement, setIsDraggingOverElement ] =\n\t\tuseState< boolean >();\n\tconst [ type, setType ] = useState< DropType >();\n\tconst ref = useDropZone( {\n\t\tonDrop( event ) {\n\t\t\tconst files = event.dataTransfer\n\t\t\t\t? getFilesFromDataTransfer( event.dataTransfer )\n\t\t\t\t: [];\n\t\t\tconst html = event.dataTransfer?.getData( 'text/html' );\n\n\t\t\t/**\n\t\t\t * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.\n\t\t\t * The order of the checks is important to recognise the HTML drop.\n\t\t\t */\n\t\t\tif ( html && onHTMLDrop ) {\n\t\t\t\tonHTMLDrop( html );\n\t\t\t} else if ( files.length && onFilesDrop ) {\n\t\t\t\tonFilesDrop( files );\n\t\t\t} else if ( onDrop ) {\n\t\t\t\tonDrop( event );\n\t\t\t}\n\t\t},\n\t\tonDragStart( event ) {\n\t\t\tsetIsDraggingOverDocument( true );\n\n\t\t\tlet _type: DropType = 'default';\n\n\t\t\t/**\n\t\t\t * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.\n\t\t\t * The order of the checks is important to recognise the HTML drop.\n\t\t\t */\n\t\t\tif ( event.dataTransfer?.types.includes( 'text/html' ) ) {\n\t\t\t\t_type = 'html';\n\t\t\t} else if (\n\t\t\t\t// Check for the types because sometimes the files themselves\n\t\t\t\t// are only available on drop.\n\t\t\t\tevent.dataTransfer?.types.includes( 'Files' ) ||\n\t\t\t\t( event.dataTransfer\n\t\t\t\t\t? getFilesFromDataTransfer( event.dataTransfer )\n\t\t\t\t\t: []\n\t\t\t\t).length > 0\n\t\t\t) {\n\t\t\t\t_type = 'file';\n\t\t\t}\n\n\t\t\tsetType( _type );\n\t\t},\n\t\tonDragEnd() {\n\t\t\tsetIsDraggingOverDocument( false );\n\t\t\tsetType( undefined );\n\t\t},\n\t\tonDragEnter() {\n\t\t\tsetIsDraggingOverElement( true );\n\t\t},\n\t\tonDragLeave() {\n\t\t\tsetIsDraggingOverElement( false );\n\t\t},\n\t} );\n\tconst classes = clsx( 'components-drop-zone', className, {\n\t\t'is-active':\n\t\t\t( isDraggingOverDocument || isDraggingOverElement ) &&\n\t\t\t( ( type === 'file' && onFilesDrop ) ||\n\t\t\t\t( type === 'html' && onHTMLDrop ) ||\n\t\t\t\t( type === 'default' && onDrop ) ),\n\t\t'is-dragging-over-document': isDraggingOverDocument,\n\t\t'is-dragging-over-element': isDraggingOverElement,\n\t\t[ `is-dragging-${ type }` ]: !! type,\n\t} );\n\n\treturn (\n\t\t<div { ...restProps } ref={ ref } className={ classes }>\n\t\t\t{ isDraggingOverElement && <DropIndicator label={ label } /> }\n\t\t</div>\n\t);\n}\n\nexport default DropZoneComponent;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAQA,IAAAM,UAAA,GAAAN,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAQA,MAAMO,QAAQ,GAAG;EAChBC,MAAM,EAAE;IAAEC,OAAO,EAAE;EAAE,CAAC;EACtBC,IAAI,EAAE;IACLD,OAAO,EAAE,CAAC;IACVE,UAAU,EAAE;MACXC,IAAI,EAAE,OAAO;MACbC,QAAQ,EAAE,GAAG;MACbC,KAAK,EAAE,CAAC;MACRC,aAAa,EAAE;IAChB;EACD,CAAC;EACDC,IAAI,EAAE;IACLP,OAAO,EAAE,CAAC;IACVE,UAAU,EAAE;MACXE,QAAQ,EAAE,GAAG;MACbE,aAAa,EAAE;IAChB;EACD;AACD,CAAC;AAED,MAAME,UAAU,GAAG;EAClBT,MAAM,EAAE;IAAEC,OAAO,EAAE,CAAC;IAAES,KAAK,EAAE;EAAI,CAAC;EAClCR,IAAI,EAAE;IACLD,OAAO,EAAE,CAAC;IACVS,KAAK,EAAE,CAAC;IACRP,UAAU,EAAE;MACXE,QAAQ,EAAE;IACX;EACD,CAAC;EACDG,IAAI,EAAE;IAAEP,OAAO,EAAE,CAAC;IAAES,KAAK,EAAE;EAAI;AAChC,CAAC;AAED,SAASC,aAAaA,CAAE;EAAEC;AAA0B,CAAC,EAAG;EACvD,MAAMC,aAAa,GA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yB,CAAE,KAAM,CAAC;MAClCI,OAAO,CAAEe,SAAU,CAAC;IACrB,CAAC;IACDC,WAAWA,CAAA,EAAG;MACbjB,wBAAwB,CAAE,IAAK,CAAC;IACjC,CAAC;IACDkB,WAAWA,CAAA,EAAG;MACblB,wBAAwB,CAAE,KAAM,CAAC;IAClC;EACD,CAAE,CAAC;EACH,MAAMmB,OAAO,GAAG,IAAAC,aAAI,EAAE,sBAAsB,EAAErC,SAAS,EAAE;IACxD,WAAW,EACV,CAAEa,sBAAsB,IAAIG,qBAAqB,MAC7CnC,IAAI,KAAK,MAAM,IAAI4B,WAAW,IAC/B5B,IAAI,KAAK,MAAM,IAAI6B,UAAY,IAC/B7B,IAAI,KAAK,SAAS,IAAI8B,MAAQ,CAAE;IACpC,2BAA2B,EAAEE,sBAAsB;IACnD,0BAA0B,EAAEG,qBAAqB;IACjD,CAAG,eAAenC,IAAM,EAAC,GAAI,CAAC,CAAEA;EACjC,CAAE,CAAC;EAEH,OACC,IAAAY,MAAA,CAAAC,aAAA;IAAA,GAAUkB,SAAS;IAAGO,GAAG,EAAGA,GAAK;IAACnB,SAAS,EAAGoC;EAAS,GACpDpB,qBAAqB,IAAI,IAAAvB,MAAA,CAAAC,aAAA,EAACN,aAAa;IAACC,KAAK,EAAGA;EAAO,CAAE,CACvD,CAAC;AAER;AAAC,IAAAiD,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEchC,iBAAiB","ignoreList":[]}
|
package/build/dropdown/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.Dropdown = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
var _compose = require("@wordpress/compose");
|
|
12
12
|
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
@@ -117,7 +117,7 @@ const UnconnectedDropdown = (props, forwardedRef) => {
|
|
|
117
117
|
anchor: !popoverPropsHaveAnchor ? fallbackPopoverAnchor : undefined,
|
|
118
118
|
variant: variant,
|
|
119
119
|
...popoverProps,
|
|
120
|
-
className: (0,
|
|
120
|
+
className: (0, _clsx.default)('components-dropdown__content', popoverProps?.className, contentClassName)
|
|
121
121
|
}, renderContent(args)));
|
|
122
122
|
};
|
|
123
123
|
|