@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":["removeAccents","renderToString","useEffect","useState","useRef","useMemo","useInstanceId","useMergeRefs","useRefEffect","create","slice","insert","isCollapsed","getTextContent","speak","isAppleOS","getAutoCompleterUI","escapeRegExp","withIgnoreIMEEvents","getNodeText","node","toString","Array","map","join","props","children","EMPTY_FILTERED_OPTIONS","useAutocomplete","record","onChange","onReplace","completers","contentRef","instanceId","selectedIndex","setSelectedIndex","filteredOptions","setFilteredOptions","filterValue","setFilterValue","autocompleter","setAutocompleter","AutocompleterUI","setAutocompleterUI","backspacing","insertCompletion","replacement","end","start","triggerPrefix","length","toInsert","html","select","option","getOptionCompletion","isDisabled","completion","value","isCompletionObject","obj","action","undefined","completionObject","reset","onChangeOptions","options","handleKeyDown","event","current","key","defaultPrevented","newIndex","label","preventDefault","textContent","completer","reduce","lastTrigger","currentCompleter","triggerIndex","lastIndexOf","lastTriggerIndex","allowContext","textWithoutTrigger","tooDistantFromTrigger","mismatch","wordsFromTrigger","split","hasOneTriggerWord","matchingWhileBackspacing","textAfterSelection","test","safeTrigger","text","match","RegExp","query","selectedKey","className","isExpanded","listBoxId","activeId","hasSelection","onKeyDown","popover","createElement","onSelect","useLastDifferentValue","history","Set","add","size","delete","from","useAutocompleteProps","ref","onKeyDownRef","previousRecord","mergedRefs","element","_onKeyDown","addEventListener","removeEventListener","didUserInput","Autocomplete","isSelected","Fragment"],"sources":["@wordpress/components/src/autocomplete/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n\tuseMemo,\n} from '@wordpress/element';\nimport { __, _n } from '@wordpress/i18n';\nimport { useInstanceId, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport {\n\tcreate,\n\tslice,\n\tinsert,\n\tisCollapsed,\n\tgetTextContent,\n} from '@wordpress/rich-text';\nimport { speak } from '@wordpress/a11y';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { getAutoCompleterUI } from './autocompleter-ui';\nimport { escapeRegExp } from '../utils/strings';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport type {\n\tAutocompleteProps,\n\tAutocompleterUIProps,\n\tInsertOption,\n\tKeyedOption,\n\tOptionCompletion,\n\tReplaceOption,\n\tUseAutocompleteProps,\n\tWPCompleter,\n} from './types';\n\nconst getNodeText = ( node: React.ReactNode ): string => {\n\tif ( node === null ) {\n\t\treturn '';\n\t}\n\n\tswitch ( typeof node ) {\n\t\tcase 'string':\n\t\tcase 'number':\n\t\t\treturn node.toString();\n\t\t\tbreak;\n\t\tcase 'boolean':\n\t\t\treturn '';\n\t\t\tbreak;\n\t\tcase 'object': {\n\t\t\tif ( node instanceof Array ) {\n\t\t\t\treturn node.map( getNodeText ).join( '' );\n\t\t\t}\n\t\t\tif ( 'props' in node ) {\n\t\t\t\treturn getNodeText( node.props.children );\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\treturn '';\n\t}\n\n\treturn '';\n};\n\nconst EMPTY_FILTERED_OPTIONS: KeyedOption[] = [];\n\nexport function useAutocomplete( {\n\trecord,\n\tonChange,\n\tonReplace,\n\tcompleters,\n\tcontentRef,\n}: UseAutocompleteProps ) {\n\tconst instanceId = useInstanceId( useAutocomplete );\n\tconst [ selectedIndex, setSelectedIndex ] = useState( 0 );\n\n\tconst [ filteredOptions, setFilteredOptions ] = useState<\n\t\tArray< KeyedOption >\n\t>( EMPTY_FILTERED_OPTIONS );\n\tconst [ filterValue, setFilterValue ] =\n\t\tuseState< AutocompleterUIProps[ 'filterValue' ] >( '' );\n\tconst [ autocompleter, setAutocompleter ] = useState< WPCompleter | null >(\n\t\tnull\n\t);\n\tconst [ AutocompleterUI, setAutocompleterUI ] = useState<\n\t\t( ( props: AutocompleterUIProps ) => JSX.Element | null ) | null\n\t>( null );\n\n\tconst backspacing = useRef( false );\n\n\tfunction insertCompletion( replacement: React.ReactNode ) {\n\t\tif ( autocompleter === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst end = record.start;\n\t\tconst start =\n\t\t\tend - autocompleter.triggerPrefix.length - filterValue.length;\n\t\tconst toInsert = create( { html: renderToString( replacement ) } );\n\n\t\tonChange( insert( record, toInsert, start, end ) );\n\t}\n\n\tfunction select( option: KeyedOption ) {\n\t\tconst { getOptionCompletion } = autocompleter || {};\n\n\t\tif ( option.isDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( getOptionCompletion ) {\n\t\t\tconst completion = getOptionCompletion( option.value, filterValue );\n\n\t\t\tconst isCompletionObject = (\n\t\t\t\tobj: OptionCompletion\n\t\t\t): obj is InsertOption | ReplaceOption => {\n\t\t\t\treturn (\n\t\t\t\t\tobj !== null &&\n\t\t\t\t\ttypeof obj === 'object' &&\n\t\t\t\t\t'action' in obj &&\n\t\t\t\t\tobj.action !== undefined &&\n\t\t\t\t\t'value' in obj &&\n\t\t\t\t\tobj.value !== undefined\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst completionObject = isCompletionObject( completion )\n\t\t\t\t? completion\n\t\t\t\t: ( {\n\t\t\t\t\t\taction: 'insert-at-caret',\n\t\t\t\t\t\tvalue: completion,\n\t\t\t\t } as InsertOption );\n\n\t\t\tif ( 'replace' === completionObject.action ) {\n\t\t\t\tonReplace( [ completionObject.value ] );\n\t\t\t\t// When replacing, the component will unmount, so don't reset\n\t\t\t\t// state (below) on an unmounted component.\n\t\t\t\treturn;\n\t\t\t} else if ( 'insert-at-caret' === completionObject.action ) {\n\t\t\t\tinsertCompletion( completionObject.value );\n\t\t\t}\n\t\t}\n\n\t\t// Reset autocomplete state after insertion rather than before\n\t\t// so insertion events don't cause the completion menu to redisplay.\n\t\treset();\n\t}\n\n\tfunction reset() {\n\t\tsetSelectedIndex( 0 );\n\t\tsetFilteredOptions( EMPTY_FILTERED_OPTIONS );\n\t\tsetFilterValue( '' );\n\t\tsetAutocompleter( null );\n\t\tsetAutocompleterUI( null );\n\t}\n\n\t/**\n\t * Load options for an autocompleter.\n\t *\n\t * @param {Array} options\n\t */\n\tfunction onChangeOptions( options: Array< KeyedOption > ) {\n\t\tsetSelectedIndex(\n\t\t\toptions.length === filteredOptions.length ? selectedIndex : 0\n\t\t);\n\t\tsetFilteredOptions( options );\n\t}\n\n\tfunction handleKeyDown( event: KeyboardEvent ) {\n\t\tbackspacing.current = event.key === 'Backspace';\n\n\t\tif ( ! autocompleter ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( filteredOptions.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( event.key ) {\n\t\t\tcase 'ArrowUp': {\n\t\t\t\tconst newIndex =\n\t\t\t\t\t( selectedIndex === 0\n\t\t\t\t\t\t? filteredOptions.length\n\t\t\t\t\t\t: selectedIndex ) - 1;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\t// See the related PR as to why this is necessary: https://github.com/WordPress/gutenberg/pull/54902.\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'ArrowDown': {\n\t\t\t\tconst newIndex = ( selectedIndex + 1 ) % filteredOptions.length;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'Escape':\n\t\t\t\tsetAutocompleter( null );\n\t\t\t\tsetAutocompleterUI( null );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tbreak;\n\n\t\t\tcase 'Enter':\n\t\t\t\tselect( filteredOptions[ selectedIndex ] );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrowLeft':\n\t\t\tcase 'ArrowRight':\n\t\t\t\treset();\n\t\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\t// Any handled key should prevent original behavior. This relies on\n\t\t// the early return in the default case.\n\t\tevent.preventDefault();\n\t}\n\n\t// textContent is a primitive (string), memoizing is not strictly necessary\n\t// but this is a preemptive performance improvement, since the autocompleter\n\t// is a potential bottleneck for the editor type metric.\n\tconst textContent = useMemo( () => {\n\t\tif ( isCollapsed( record ) ) {\n\t\t\treturn getTextContent( slice( record, 0 ) );\n\t\t}\n\t\treturn '';\n\t}, [ record ] );\n\n\tuseEffect( () => {\n\t\tif ( ! textContent ) {\n\t\t\tif ( autocompleter ) reset();\n\t\t\treturn;\n\t\t}\n\n\t\t// Find the completer with the highest triggerPrefix index in the\n\t\t// textContent.\n\t\tconst completer = completers.reduce< WPCompleter | null >(\n\t\t\t( lastTrigger, currentCompleter ) => {\n\t\t\t\tconst triggerIndex = textContent.lastIndexOf(\n\t\t\t\t\tcurrentCompleter.triggerPrefix\n\t\t\t\t);\n\t\t\t\tconst lastTriggerIndex =\n\t\t\t\t\tlastTrigger !== null\n\t\t\t\t\t\t? textContent.lastIndexOf( lastTrigger.triggerPrefix )\n\t\t\t\t\t\t: -1;\n\n\t\t\t\treturn triggerIndex > lastTriggerIndex\n\t\t\t\t\t? currentCompleter\n\t\t\t\t\t: lastTrigger;\n\t\t\t},\n\t\t\tnull\n\t\t);\n\n\t\tif ( ! completer ) {\n\t\t\tif ( autocompleter ) reset();\n\t\t\treturn;\n\t\t}\n\n\t\tconst { allowContext, triggerPrefix } = completer;\n\t\tconst triggerIndex = textContent.lastIndexOf( triggerPrefix );\n\t\tconst textWithoutTrigger = textContent.slice(\n\t\t\ttriggerIndex + triggerPrefix.length\n\t\t);\n\n\t\tconst tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.\n\t\t// This is a final barrier to prevent the effect from completing with\n\t\t// an extremely long string, which causes the editor to slow-down\n\t\t// significantly. This could happen, for example, if `matchingWhileBackspacing`\n\t\t// is true and one of the \"words\" end up being too long. If that's the case,\n\t\t// it will be caught by this guard.\n\t\tif ( tooDistantFromTrigger ) return;\n\n\t\tconst mismatch = filteredOptions.length === 0;\n\t\tconst wordsFromTrigger = textWithoutTrigger.split( /\\s/ );\n\t\t// We need to allow the effect to run when not backspacing and if there\n\t\t// was a mismatch. i.e when typing a trigger + the match string or when\n\t\t// clicking in an existing trigger word on the page. We do that if we\n\t\t// detect that we have one word from trigger in the current textual context.\n\t\t//\n\t\t// Ex.: \"Some text @a\" <-- \"@a\" will be detected as the trigger word and\n\t\t// allow the effect to run. It will run until there's a mismatch.\n\t\tconst hasOneTriggerWord = wordsFromTrigger.length === 1;\n\t\t// This is used to allow the effect to run when backspacing and if\n\t\t// \"touching\" a word that \"belongs\" to a trigger. We consider a \"trigger\n\t\t// word\" any word up to the limit of 3 from the trigger character.\n\t\t// Anything beyond that is ignored if there's a mismatch. This allows\n\t\t// us to \"escape\" a mismatch when backspacing, but still imposing some\n\t\t// sane limits.\n\t\t//\n\t\t// Ex: \"Some text @marcelo sekkkk\" <--- \"kkkk\" caused a mismatch, but\n\t\t// if the user presses backspace here, it will show the completion popup again.\n\t\tconst matchingWhileBackspacing =\n\t\t\tbackspacing.current && wordsFromTrigger.length <= 3;\n\n\t\tif ( mismatch && ! ( matchingWhileBackspacing || hasOneTriggerWord ) ) {\n\t\t\tif ( autocompleter ) reset();\n\t\t\treturn;\n\t\t}\n\n\t\tconst textAfterSelection = getTextContent(\n\t\t\tslice( record, undefined, getTextContent( record ).length )\n\t\t);\n\n\t\tif (\n\t\t\tallowContext &&\n\t\t\t! allowContext(\n\t\t\t\ttextContent.slice( 0, triggerIndex ),\n\t\t\t\ttextAfterSelection\n\t\t\t)\n\t\t) {\n\t\t\tif ( autocompleter ) reset();\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t/^\\s/.test( textWithoutTrigger ) ||\n\t\t\t/\\s\\s+$/.test( textWithoutTrigger )\n\t\t) {\n\t\t\tif ( autocompleter ) reset();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! /[\\u0000-\\uFFFF]*$/.test( textWithoutTrigger ) ) {\n\t\t\tif ( autocompleter ) reset();\n\t\t\treturn;\n\t\t}\n\n\t\tconst safeTrigger = escapeRegExp( completer.triggerPrefix );\n\t\tconst text = removeAccents( textContent );\n\t\tconst match = text\n\t\t\t.slice( text.lastIndexOf( completer.triggerPrefix ) )\n\t\t\t.match( new RegExp( `${ safeTrigger }([\\u0000-\\uFFFF]*)$` ) );\n\t\tconst query = match && match[ 1 ];\n\n\t\tsetAutocompleter( completer );\n\t\tsetAutocompleterUI( () =>\n\t\t\tcompleter !== autocompleter\n\t\t\t\t? getAutoCompleterUI( completer )\n\t\t\t\t: AutocompleterUI\n\t\t);\n\t\tsetFilterValue( query === null ? '' : query );\n\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ textContent ] );\n\n\tconst { key: selectedKey = '' } = filteredOptions[ selectedIndex ] || {};\n\tconst { className } = autocompleter || {};\n\tconst isExpanded = !! autocompleter && filteredOptions.length > 0;\n\tconst listBoxId = isExpanded\n\t\t? `components-autocomplete-listbox-${ instanceId }`\n\t\t: undefined;\n\tconst activeId = isExpanded\n\t\t? `components-autocomplete-item-${ instanceId }-${ selectedKey }`\n\t\t: null;\n\tconst hasSelection = record.start !== undefined;\n\n\treturn {\n\t\tlistBoxId,\n\t\tactiveId,\n\t\tonKeyDown: withIgnoreIMEEvents( handleKeyDown ),\n\t\tpopover: hasSelection && AutocompleterUI && (\n\t\t\t<AutocompleterUI\n\t\t\t\tclassName={ className }\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tinstanceId={ instanceId }\n\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\tonChangeOptions={ onChangeOptions }\n\t\t\t\tonSelect={ select }\n\t\t\t\tvalue={ record }\n\t\t\t\tcontentRef={ contentRef }\n\t\t\t\treset={ reset }\n\t\t\t/>\n\t\t),\n\t};\n}\n\nfunction useLastDifferentValue( value: UseAutocompleteProps[ 'record' ] ) {\n\tconst history = useRef< Set< typeof value > >( new Set() );\n\n\thistory.current.add( value );\n\n\t// Keep the history size to 2.\n\tif ( history.current.size > 2 ) {\n\t\thistory.current.delete( Array.from( history.current )[ 0 ] );\n\t}\n\n\treturn Array.from( history.current )[ 0 ];\n}\n\nexport function useAutocompleteProps( options: UseAutocompleteProps ) {\n\tconst ref = useRef< HTMLElement >( null );\n\tconst onKeyDownRef = useRef< ( event: KeyboardEvent ) => void >();\n\tconst { record } = options;\n\tconst previousRecord = useLastDifferentValue( record );\n\tconst { popover, listBoxId, activeId, onKeyDown } = useAutocomplete( {\n\t\t...options,\n\t\tcontentRef: ref,\n\t} );\n\tonKeyDownRef.current = onKeyDown;\n\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tuseRefEffect( ( element: HTMLElement ) => {\n\t\t\tfunction _onKeyDown( event: KeyboardEvent ) {\n\t\t\t\tonKeyDownRef.current?.( event );\n\t\t\t}\n\t\t\telement.addEventListener( 'keydown', _onKeyDown );\n\t\t\treturn () => {\n\t\t\t\telement.removeEventListener( 'keydown', _onKeyDown );\n\t\t\t};\n\t\t}, [] ),\n\t] );\n\n\t// We only want to show the popover if the user has typed something.\n\tconst didUserInput = record.text !== previousRecord?.text;\n\n\tif ( ! didUserInput ) {\n\t\treturn { ref: mergedRefs };\n\t}\n\n\treturn {\n\t\tref: mergedRefs,\n\t\tchildren: popover,\n\t\t'aria-autocomplete': listBoxId ? 'list' : undefined,\n\t\t'aria-owns': listBoxId,\n\t\t'aria-activedescendant': activeId,\n\t};\n}\n\nexport default function Autocomplete( {\n\tchildren,\n\tisSelected,\n\t...options\n}: AutocompleteProps ) {\n\tconst { popover, ...props } = useAutocomplete( options );\n\treturn (\n\t\t<>\n\t\t\t{ children( props ) }\n\t\t\t{ isSelected && popover }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,gBAAgB;;AAE1C;AACA;AACA;AACA,SACCC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,OAAO,QACD,oBAAoB;AAE3B,SAASC,aAAa,EAAEC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC9E,SACCC,MAAM,EACNC,KAAK,EACLC,MAAM,EACNC,WAAW,EACXC,cAAc,QACR,sBAAsB;AAC7B,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,SAAS,QAAQ,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,mBAAmB,QAAQ,iCAAiC;AAYrE,MAAMC,WAAW,GAAKC,IAAqB,IA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G,QAAQ;EACRqG,UAAU;EACV,GAAG5D;AACe,CAAC,EAAG;EACtB,MAAM;IAAEuC,OAAO;IAAE,GAAGjF;EAAM,CAAC,GAAGG,eAAe,CAAEuC,OAAQ,CAAC;EACxD,OACCwC,aAAA,CAAAqB,QAAA,QACGtG,QAAQ,CAAED,KAAM,CAAC,EACjBsG,UAAU,IAAIrB,OACf,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["removeAccents","renderToString","useEffect","useState","useRef","useMemo","useInstanceId","useMergeRefs","useRefEffect","create","slice","insert","isCollapsed","getTextContent","speak","isAppleOS","getAutoCompleterUI","escapeRegExp","withIgnoreIMEEvents","getNodeText","node","toString","Array","map","join","props","children","EMPTY_FILTERED_OPTIONS","useAutocomplete","record","onChange","onReplace","completers","contentRef","instanceId","selectedIndex","setSelectedIndex","filteredOptions","setFilteredOptions","filterValue","setFilterValue","autocompleter","setAutocompleter","AutocompleterUI","setAutocompleterUI","backspacing","insertCompletion","replacement","end","start","triggerPrefix","length","toInsert","html","select","option","getOptionCompletion","isDisabled","completion","value","isCompletionObject","obj","action","undefined","completionObject","reset","onChangeOptions","options","handleKeyDown","event","current","key","defaultPrevented","newIndex","label","preventDefault","textContent","completer","reduce","lastTrigger","currentCompleter","triggerIndex","lastIndexOf","lastTriggerIndex","allowContext","textWithoutTrigger","tooDistantFromTrigger","mismatch","wordsFromTrigger","split","hasOneTriggerWord","matchingWhileBackspacing","textAfterSelection","test","safeTrigger","text","match","RegExp","query","selectedKey","className","isExpanded","listBoxId","activeId","hasSelection","onKeyDown","popover","createElement","onSelect","useLastDifferentValue","history","Set","add","size","delete","from","useAutocompleteProps","ref","onKeyDownRef","previousRecord","mergedRefs","element","_onKeyDown","addEventListener","removeEventListener","didUserInput","Autocomplete","isSelected","Fragment"],"sources":["@wordpress/components/src/autocomplete/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n\tuseMemo,\n} from '@wordpress/element';\nimport { __, _n } from '@wordpress/i18n';\nimport { useInstanceId, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport {\n\tcreate,\n\tslice,\n\tinsert,\n\tisCollapsed,\n\tgetTextContent,\n} from '@wordpress/rich-text';\nimport { speak } from '@wordpress/a11y';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { getAutoCompleterUI } from './autocompleter-ui';\nimport { escapeRegExp } from '../utils/strings';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport type {\n\tAutocompleteProps,\n\tAutocompleterUIProps,\n\tInsertOption,\n\tKeyedOption,\n\tOptionCompletion,\n\tReplaceOption,\n\tUseAutocompleteProps,\n\tWPCompleter,\n} from './types';\n\nconst getNodeText = ( node: React.ReactNode ): string => {\n\tif ( node === null ) {\n\t\treturn '';\n\t}\n\n\tswitch ( typeof node ) {\n\t\tcase 'string':\n\t\tcase 'number':\n\t\t\treturn node.toString();\n\t\t\tbreak;\n\t\tcase 'boolean':\n\t\t\treturn '';\n\t\t\tbreak;\n\t\tcase 'object': {\n\t\t\tif ( node instanceof Array ) {\n\t\t\t\treturn node.map( getNodeText ).join( '' );\n\t\t\t}\n\t\t\tif ( 'props' in node ) {\n\t\t\t\treturn getNodeText( node.props.children );\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\treturn '';\n\t}\n\n\treturn '';\n};\n\nconst EMPTY_FILTERED_OPTIONS: KeyedOption[] = [];\n\nexport function useAutocomplete( {\n\trecord,\n\tonChange,\n\tonReplace,\n\tcompleters,\n\tcontentRef,\n}: UseAutocompleteProps ) {\n\tconst instanceId = useInstanceId( useAutocomplete );\n\tconst [ selectedIndex, setSelectedIndex ] = useState( 0 );\n\n\tconst [ filteredOptions, setFilteredOptions ] = useState<\n\t\tArray< KeyedOption >\n\t>( EMPTY_FILTERED_OPTIONS );\n\tconst [ filterValue, setFilterValue ] =\n\t\tuseState< AutocompleterUIProps[ 'filterValue' ] >( '' );\n\tconst [ autocompleter, setAutocompleter ] = useState< WPCompleter | null >(\n\t\tnull\n\t);\n\tconst [ AutocompleterUI, setAutocompleterUI ] = useState<\n\t\t( ( props: AutocompleterUIProps ) => JSX.Element | null ) | null\n\t>( null );\n\n\tconst backspacing = useRef( false );\n\n\tfunction insertCompletion( replacement: React.ReactNode ) {\n\t\tif ( autocompleter === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst end = record.start;\n\t\tconst start =\n\t\t\tend - autocompleter.triggerPrefix.length - filterValue.length;\n\t\tconst toInsert = create( { html: renderToString( replacement ) } );\n\n\t\tonChange( insert( record, toInsert, start, end ) );\n\t}\n\n\tfunction select( option: KeyedOption ) {\n\t\tconst { getOptionCompletion } = autocompleter || {};\n\n\t\tif ( option.isDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( getOptionCompletion ) {\n\t\t\tconst completion = getOptionCompletion( option.value, filterValue );\n\n\t\t\tconst isCompletionObject = (\n\t\t\t\tobj: OptionCompletion\n\t\t\t): obj is InsertOption | ReplaceOption => {\n\t\t\t\treturn (\n\t\t\t\t\tobj !== null &&\n\t\t\t\t\ttypeof obj === 'object' &&\n\t\t\t\t\t'action' in obj &&\n\t\t\t\t\tobj.action !== undefined &&\n\t\t\t\t\t'value' in obj &&\n\t\t\t\t\tobj.value !== undefined\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst completionObject = isCompletionObject( completion )\n\t\t\t\t? completion\n\t\t\t\t: ( {\n\t\t\t\t\t\taction: 'insert-at-caret',\n\t\t\t\t\t\tvalue: completion,\n\t\t\t\t } as InsertOption );\n\n\t\t\tif ( 'replace' === completionObject.action ) {\n\t\t\t\tonReplace( [ completionObject.value ] );\n\t\t\t\t// When replacing, the component will unmount, so don't reset\n\t\t\t\t// state (below) on an unmounted component.\n\t\t\t\treturn;\n\t\t\t} else if ( 'insert-at-caret' === completionObject.action ) {\n\t\t\t\tinsertCompletion( completionObject.value );\n\t\t\t}\n\t\t}\n\n\t\t// Reset autocomplete state after insertion rather than before\n\t\t// so insertion events don't cause the completion menu to redisplay.\n\t\treset();\n\t}\n\n\tfunction reset() {\n\t\tsetSelectedIndex( 0 );\n\t\tsetFilteredOptions( EMPTY_FILTERED_OPTIONS );\n\t\tsetFilterValue( '' );\n\t\tsetAutocompleter( null );\n\t\tsetAutocompleterUI( null );\n\t}\n\n\t/**\n\t * Load options for an autocompleter.\n\t *\n\t * @param {Array} options\n\t */\n\tfunction onChangeOptions( options: Array< KeyedOption > ) {\n\t\tsetSelectedIndex(\n\t\t\toptions.length === filteredOptions.length ? selectedIndex : 0\n\t\t);\n\t\tsetFilteredOptions( options );\n\t}\n\n\tfunction handleKeyDown( event: KeyboardEvent ) {\n\t\tbackspacing.current = event.key === 'Backspace';\n\n\t\tif ( ! autocompleter ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( filteredOptions.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( event.key ) {\n\t\t\tcase 'ArrowUp': {\n\t\t\t\tconst newIndex =\n\t\t\t\t\t( selectedIndex === 0\n\t\t\t\t\t\t? filteredOptions.length\n\t\t\t\t\t\t: selectedIndex ) - 1;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\t// See the related PR as to why this is necessary: https://github.com/WordPress/gutenberg/pull/54902.\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'ArrowDown': {\n\t\t\t\tconst newIndex = ( selectedIndex + 1 ) % filteredOptions.length;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'Escape':\n\t\t\t\tsetAutocompleter( null );\n\t\t\t\tsetAutocompleterUI( null );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tbreak;\n\n\t\t\tcase 'Enter':\n\t\t\t\tselect( filteredOptions[ selectedIndex ] );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrowLeft':\n\t\t\tcase 'ArrowRight':\n\t\t\t\treset();\n\t\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\t// Any handled key should prevent original behavior. This relies on\n\t\t// the early return in the default case.\n\t\tevent.preventDefault();\n\t}\n\n\t// textContent is a primitive (string), memoizing is not strictly necessary\n\t// but this is a preemptive performance improvement, since the autocompleter\n\t// is a potential bottleneck for the editor type metric.\n\tconst textContent = useMemo( () => {\n\t\tif ( isCollapsed( record ) ) {\n\t\t\treturn getTextContent( slice( record, 0 ) );\n\t\t}\n\t\treturn '';\n\t}, [ record ] );\n\n\tuseEffect( () => {\n\t\tif ( ! textContent ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Find the completer with the highest triggerPrefix index in the\n\t\t// textContent.\n\t\tconst completer = completers.reduce< WPCompleter | null >(\n\t\t\t( lastTrigger, currentCompleter ) => {\n\t\t\t\tconst triggerIndex = textContent.lastIndexOf(\n\t\t\t\t\tcurrentCompleter.triggerPrefix\n\t\t\t\t);\n\t\t\t\tconst lastTriggerIndex =\n\t\t\t\t\tlastTrigger !== null\n\t\t\t\t\t\t? textContent.lastIndexOf( lastTrigger.triggerPrefix )\n\t\t\t\t\t\t: -1;\n\n\t\t\t\treturn triggerIndex > lastTriggerIndex\n\t\t\t\t\t? currentCompleter\n\t\t\t\t\t: lastTrigger;\n\t\t\t},\n\t\t\tnull\n\t\t);\n\n\t\tif ( ! completer ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst { allowContext, triggerPrefix } = completer;\n\t\tconst triggerIndex = textContent.lastIndexOf( triggerPrefix );\n\t\tconst textWithoutTrigger = textContent.slice(\n\t\t\ttriggerIndex + triggerPrefix.length\n\t\t);\n\n\t\tconst tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.\n\t\t// This is a final barrier to prevent the effect from completing with\n\t\t// an extremely long string, which causes the editor to slow-down\n\t\t// significantly. This could happen, for example, if `matchingWhileBackspacing`\n\t\t// is true and one of the \"words\" end up being too long. If that's the case,\n\t\t// it will be caught by this guard.\n\t\tif ( tooDistantFromTrigger ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst mismatch = filteredOptions.length === 0;\n\t\tconst wordsFromTrigger = textWithoutTrigger.split( /\\s/ );\n\t\t// We need to allow the effect to run when not backspacing and if there\n\t\t// was a mismatch. i.e when typing a trigger + the match string or when\n\t\t// clicking in an existing trigger word on the page. We do that if we\n\t\t// detect that we have one word from trigger in the current textual context.\n\t\t//\n\t\t// Ex.: \"Some text @a\" <-- \"@a\" will be detected as the trigger word and\n\t\t// allow the effect to run. It will run until there's a mismatch.\n\t\tconst hasOneTriggerWord = wordsFromTrigger.length === 1;\n\t\t// This is used to allow the effect to run when backspacing and if\n\t\t// \"touching\" a word that \"belongs\" to a trigger. We consider a \"trigger\n\t\t// word\" any word up to the limit of 3 from the trigger character.\n\t\t// Anything beyond that is ignored if there's a mismatch. This allows\n\t\t// us to \"escape\" a mismatch when backspacing, but still imposing some\n\t\t// sane limits.\n\t\t//\n\t\t// Ex: \"Some text @marcelo sekkkk\" <--- \"kkkk\" caused a mismatch, but\n\t\t// if the user presses backspace here, it will show the completion popup again.\n\t\tconst matchingWhileBackspacing =\n\t\t\tbackspacing.current && wordsFromTrigger.length <= 3;\n\n\t\tif ( mismatch && ! ( matchingWhileBackspacing || hasOneTriggerWord ) ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst textAfterSelection = getTextContent(\n\t\t\tslice( record, undefined, getTextContent( record ).length )\n\t\t);\n\n\t\tif (\n\t\t\tallowContext &&\n\t\t\t! allowContext(\n\t\t\t\ttextContent.slice( 0, triggerIndex ),\n\t\t\t\ttextAfterSelection\n\t\t\t)\n\t\t) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t/^\\s/.test( textWithoutTrigger ) ||\n\t\t\t/\\s\\s+$/.test( textWithoutTrigger )\n\t\t) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! /[\\u0000-\\uFFFF]*$/.test( textWithoutTrigger ) ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst safeTrigger = escapeRegExp( completer.triggerPrefix );\n\t\tconst text = removeAccents( textContent );\n\t\tconst match = text\n\t\t\t.slice( text.lastIndexOf( completer.triggerPrefix ) )\n\t\t\t.match( new RegExp( `${ safeTrigger }([\\u0000-\\uFFFF]*)$` ) );\n\t\tconst query = match && match[ 1 ];\n\n\t\tsetAutocompleter( completer );\n\t\tsetAutocompleterUI( () =>\n\t\t\tcompleter !== autocompleter\n\t\t\t\t? getAutoCompleterUI( completer )\n\t\t\t\t: AutocompleterUI\n\t\t);\n\t\tsetFilterValue( query === null ? '' : query );\n\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ textContent ] );\n\n\tconst { key: selectedKey = '' } = filteredOptions[ selectedIndex ] || {};\n\tconst { className } = autocompleter || {};\n\tconst isExpanded = !! autocompleter && filteredOptions.length > 0;\n\tconst listBoxId = isExpanded\n\t\t? `components-autocomplete-listbox-${ instanceId }`\n\t\t: undefined;\n\tconst activeId = isExpanded\n\t\t? `components-autocomplete-item-${ instanceId }-${ selectedKey }`\n\t\t: null;\n\tconst hasSelection = record.start !== undefined;\n\n\treturn {\n\t\tlistBoxId,\n\t\tactiveId,\n\t\tonKeyDown: withIgnoreIMEEvents( handleKeyDown ),\n\t\tpopover: hasSelection && AutocompleterUI && (\n\t\t\t<AutocompleterUI\n\t\t\t\tclassName={ className }\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tinstanceId={ instanceId }\n\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\tonChangeOptions={ onChangeOptions }\n\t\t\t\tonSelect={ select }\n\t\t\t\tvalue={ record }\n\t\t\t\tcontentRef={ contentRef }\n\t\t\t\treset={ reset }\n\t\t\t/>\n\t\t),\n\t};\n}\n\nfunction useLastDifferentValue( value: UseAutocompleteProps[ 'record' ] ) {\n\tconst history = useRef< Set< typeof value > >( new Set() );\n\n\thistory.current.add( value );\n\n\t// Keep the history size to 2.\n\tif ( history.current.size > 2 ) {\n\t\thistory.current.delete( Array.from( history.current )[ 0 ] );\n\t}\n\n\treturn Array.from( history.current )[ 0 ];\n}\n\nexport function useAutocompleteProps( options: UseAutocompleteProps ) {\n\tconst ref = useRef< HTMLElement >( null );\n\tconst onKeyDownRef = useRef< ( event: KeyboardEvent ) => void >();\n\tconst { record } = options;\n\tconst previousRecord = useLastDifferentValue( record );\n\tconst { popover, listBoxId, activeId, onKeyDown } = useAutocomplete( {\n\t\t...options,\n\t\tcontentRef: ref,\n\t} );\n\tonKeyDownRef.current = onKeyDown;\n\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tuseRefEffect( ( element: HTMLElement ) => {\n\t\t\tfunction _onKeyDown( event: KeyboardEvent ) {\n\t\t\t\tonKeyDownRef.current?.( event );\n\t\t\t}\n\t\t\telement.addEventListener( 'keydown', _onKeyDown );\n\t\t\treturn () => {\n\t\t\t\telement.removeEventListener( 'keydown', _onKeyDown );\n\t\t\t};\n\t\t}, [] ),\n\t] );\n\n\t// We only want to show the popover if the user has typed something.\n\tconst didUserInput = record.text !== previousRecord?.text;\n\n\tif ( ! didUserInput ) {\n\t\treturn { ref: mergedRefs };\n\t}\n\n\treturn {\n\t\tref: mergedRefs,\n\t\tchildren: popover,\n\t\t'aria-autocomplete': listBoxId ? 'list' : undefined,\n\t\t'aria-owns': listBoxId,\n\t\t'aria-activedescendant': activeId,\n\t};\n}\n\nexport default function Autocomplete( {\n\tchildren,\n\tisSelected,\n\t...options\n}: AutocompleteProps ) {\n\tconst { popover, ...props } = useAutocomplete( options );\n\treturn (\n\t\t<>\n\t\t\t{ children( props ) }\n\t\t\t{ isSelected && popover }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,gBAAgB;;AAE1C;AACA;AACA;AACA,SACCC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,OAAO,QACD,oBAAoB;AAE3B,SAASC,aAAa,EAAEC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC9E,SACCC,MAAM,EACNC,KAAK,EACLC,MAAM,EACNC,WAAW,EACXC,cAAc,QACR,sBAAsB;AAC7B,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,SAAS,QAAQ,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,mBAAmB,QAAQ,iCAAiC;AAYrE,MAAMC,WAAW,GAAKC,IAAqB,IAAc;EACxD,IAAKA,IAAI,KAAK,IAAI,EAAG;IACpB,OAAO,EAAE;EACV;EAEA,QAAS,OAAOA,I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EACV,GAAG5D;AACe,CAAC,EAAG;EACtB,MAAM;IAAEuC,OAAO;IAAE,GAAGjF;EAAM,CAAC,GAAGG,eAAe,CAAEuC,OAAQ,CAAC;EACxD,OACCwC,aAAA,CAAAqB,QAAA,QACGtG,QAAQ,CAAED,KAAM,CAAC,EACjBsG,UAAU,IAAIrB,OACf,CAAC;AAEL","ignoreList":[]}
|
|
@@ -21,9 +21,6 @@ export function useBaseControlProps(props) {
|
|
|
21
21
|
...restProps
|
|
22
22
|
} = props;
|
|
23
23
|
const uniqueId = useInstanceId(BaseControl, 'wp-components-base-control', preferredId);
|
|
24
|
-
|
|
25
|
-
// ARIA descriptions can only contain plain text, so fall back to aria-details if not.
|
|
26
|
-
const helpPropName = typeof help === 'string' ? 'aria-describedby' : 'aria-details';
|
|
27
24
|
return {
|
|
28
25
|
baseControlProps: {
|
|
29
26
|
id: uniqueId,
|
|
@@ -33,7 +30,7 @@ export function useBaseControlProps(props) {
|
|
|
33
30
|
controlProps: {
|
|
34
31
|
id: uniqueId,
|
|
35
32
|
...(!!help ? {
|
|
36
|
-
|
|
33
|
+
'aria-describedby': `${uniqueId}__help`
|
|
37
34
|
} : {})
|
|
38
35
|
}
|
|
39
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useInstanceId","BaseControl","useBaseControlProps","props","help","id","preferredId","restProps","uniqueId","
|
|
1
|
+
{"version":3,"names":["useInstanceId","BaseControl","useBaseControlProps","props","help","id","preferredId","restProps","uniqueId","baseControlProps","controlProps"],"sources":["@wordpress/components/src/base-control/hooks.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '.';\nimport type { BaseControlProps } from './types';\n\n/**\n * Generate props for the `BaseControl` and the inner control itself.\n *\n * Namely, it takes care of generating a unique `id`, properly associating it with the `label` and `help` elements.\n *\n * @param props\n */\nexport function useBaseControlProps(\n\tprops: Omit< BaseControlProps, 'children' >\n) {\n\tconst { help, id: preferredId, ...restProps } = props;\n\n\tconst uniqueId = useInstanceId(\n\t\tBaseControl,\n\t\t'wp-components-base-control',\n\t\tpreferredId\n\t);\n\n\treturn {\n\t\tbaseControlProps: {\n\t\t\tid: uniqueId,\n\t\t\thelp,\n\t\t\t...restProps,\n\t\t},\n\t\tcontrolProps: {\n\t\t\tid: uniqueId,\n\t\t\t...( !! help ? { 'aria-describedby': `${ uniqueId }__help` } : {} ),\n\t\t},\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,GAAG;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAClCC,KAA2C,EAC1C;EACD,MAAM;IAAEC,IAAI;IAAEC,EAAE,EAAEC,WAAW;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAErD,MAAMK,QAAQ,GAAGR,aAAa,CAC7BC,WAAW,EACX,4BAA4B,EAC5BK,WACD,CAAC;EAED,OAAO;IACNG,gBAAgB,EAAE;MACjBJ,EAAE,EAAEG,QAAQ;MACZJ,IAAI;MACJ,GAAGG;IACJ,CAAC;IACDG,YAAY,EAAE;MACbL,EAAE,EAAEG,QAAQ;MACZ,IAAK,CAAC,CAAEJ,IAAI,GAAG;QAAE,kBAAkB,EAAG,GAAGI,QAAU;MAAQ,CAAC,GAAG,CAAC,CAAC;IAClE;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import { createElement } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -91,7 +91,7 @@ export const VisualLabel = ({
|
|
|
91
91
|
}) => {
|
|
92
92
|
return createElement(StyledVisualLabel, {
|
|
93
93
|
...props,
|
|
94
|
-
className:
|
|
94
|
+
className: clsx('components-base-control__label', className)
|
|
95
95
|
}, children);
|
|
96
96
|
};
|
|
97
97
|
export const BaseControl = Object.assign(contextConnectWithoutRef(UnconnectedBaseControl, 'BaseControl'), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["clsx","VisuallyHidden","Wrapper","StyledField","StyledLabel","StyledHelp","StyledVisualLabel","contextConnectWithoutRef","useContextSystem","useBaseControlProps","UnconnectedBaseControl","props","__nextHasNoMarginBottom","id","label","hideLabelFromVision","help","className","children","createElement","as","htmlFor","VisualLabel","undefined","BaseControl","Object","assign"],"sources":["@wordpress/components/src/base-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { BaseControlProps, BaseControlVisualLabelProps } from './types';\nimport {\n\tWrapper,\n\tStyledField,\n\tStyledLabel,\n\tStyledHelp,\n\tStyledVisualLabel,\n} from './styles/base-control-styles';\nimport type { WordPressComponentProps } from '../context';\nimport { contextConnectWithoutRef, useContextSystem } from '../context';\n\nexport { useBaseControlProps } from './hooks';\n\n/**\n * `BaseControl` is a component used to generate labels and help text for components handling user inputs.\n *\n * ```jsx\n * import { BaseControl, useBaseControlProps } from '@wordpress/components';\n *\n * // Render a `BaseControl` for a textarea input\n * const MyCustomTextareaControl = ({ children, ...baseProps }) => (\n * \t// `useBaseControlProps` is a convenience hook to get the props for the `BaseControl`\n * \t// and the inner control itself. Namely, it takes care of generating a unique `id`,\n * \t// properly associating it with the `label` and `help` elements.\n * \tconst { baseControlProps, controlProps } = useBaseControlProps( baseProps );\n *\n * \treturn (\n * \t\t<BaseControl { ...baseControlProps } __nextHasNoMarginBottom={ true }>\n * \t\t\t<textarea { ...controlProps }>\n * \t\t\t { children }\n * \t\t\t</textarea>\n * \t\t</BaseControl>\n * \t);\n * );\n * ```\n */\nconst UnconnectedBaseControl = (\n\tprops: WordPressComponentProps< BaseControlProps, null >\n) => {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tid,\n\t\tlabel,\n\t\thideLabelFromVision = false,\n\t\thelp,\n\t\tclassName,\n\t\tchildren,\n\t} = useContextSystem( props, 'BaseControl' );\n\n\treturn (\n\t\t<Wrapper className={ className }>\n\t\t\t<StyledField\n\t\t\t\tclassName=\"components-base-control__field\"\n\t\t\t\t// TODO: Official deprecation for this should start after all internal usages have been migrated\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t>\n\t\t\t\t{ label &&\n\t\t\t\t\tid &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\" htmlFor={ id }>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<StyledLabel\n\t\t\t\t\t\t\tclassName=\"components-base-control__label\"\n\t\t\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</StyledLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ label &&\n\t\t\t\t\t! id &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<VisualLabel>{ label }</VisualLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ children }\n\t\t\t</StyledField>\n\t\t\t{ !! help && (\n\t\t\t\t<StyledHelp\n\t\t\t\t\tid={ id ? id + '__help' : undefined }\n\t\t\t\t\tclassName=\"components-base-control__help\"\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t>\n\t\t\t\t\t{ help }\n\t\t\t\t</StyledHelp>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n};\n\n/**\n * `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.\n *\n * It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled,\n * e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would\n * otherwise use if the `label` prop was passed.\n *\n * @example\n * import { BaseControl } from '@wordpress/components';\n *\n * const MyBaseControl = () => (\n * \t<BaseControl help=\"This button is already accessibly labeled.\">\n * \t\t<BaseControl.VisualLabel>Author</BaseControl.VisualLabel>\n * \t\t<Button>Select an author</Button>\n * \t</BaseControl>\n * );\n */\nexport const VisualLabel = ( {\n\tclassName,\n\tchildren,\n\t...props\n}: WordPressComponentProps< BaseControlVisualLabelProps, 'span' > ) => {\n\treturn (\n\t\t<StyledVisualLabel\n\t\t\t{ ...props }\n\t\t\tclassName={ clsx( 'components-base-control__label', className ) }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledVisualLabel>\n\t);\n};\n\nexport const BaseControl = Object.assign(\n\tcontextConnectWithoutRef( UnconnectedBaseControl, 'BaseControl' ),\n\t{ VisualLabel }\n);\n\nexport default BaseControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SACCC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,UAAU,EACVC,iBAAiB,QACX,8BAA8B;AAErC,SAASC,wBAAwB,EAAEC,gBAAgB,QAAQ,YAAY;AAEvE,SAASC,mBAAmB,QAAQ,SAAS;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAC3BC,KAAwD,IACpD;EACJ,MAAM;IACLC,uBAAuB,GAAG,KAAK;IAC/BC,EAAE;IACFC,KAAK;IACLC,mBAAmB,GAAG,KAAK;IAC3BC,IAAI;IACJC,SAAS;I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,CAAEG,sBAAsB,EAAE,aAAc,CAAC,EACjE;EAAEY;AAAY,CACf,CAAC;AAED,eAAeE,WAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/base-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type BaseControlProps = {\n\t/**\n\t * Start opting into the new margin-free styles that will become the default in a future version.\n\t *\n\t * @default false\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * The HTML `id` of the control element (passed in as a child to `BaseControl`) to which labels and help text are being generated.\n\t * This is necessary to accessibly associate the label with that element.\n\t *\n\t * The recommended way is to use the `useBaseControlProps` hook, which takes care of generating a unique `id` for you.\n\t * Otherwise, if you choose to pass an explicit `id` to this prop, you are responsible for ensuring the uniqueness of the `id`.\n\t */\n\tid?: string;\n\t/**\n\t * Additional description for the control.\n\t *\n\t *
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/base-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type BaseControlProps = {\n\t/**\n\t * Start opting into the new margin-free styles that will become the default in a future version.\n\t *\n\t * @default false\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * The HTML `id` of the control element (passed in as a child to `BaseControl`) to which labels and help text are being generated.\n\t * This is necessary to accessibly associate the label with that element.\n\t *\n\t * The recommended way is to use the `useBaseControlProps` hook, which takes care of generating a unique `id` for you.\n\t * Otherwise, if you choose to pass an explicit `id` to this prop, you are responsible for ensuring the uniqueness of the `id`.\n\t */\n\tid?: string;\n\t/**\n\t * Additional description for the control.\n\t *\n\t * The element containing the description will be programmatically associated to the BaseControl by the means of an `aria-describedby` attribute.\n\t */\n\thelp?: ReactNode;\n\t/**\n\t * If this property is added, a label will be generated using label property as the content.\n\t */\n\tlabel?: ReactNode;\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default false\n\t */\n\thideLabelFromVision?: boolean;\n\tclassName?: string;\n\t/**\n\t * The content to be displayed within the `BaseControl`.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type BaseControlVisualLabelProps = {\n\tchildren: ReactNode;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/border-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ColorPaletteProps } from '../color-palette/types';\nimport type { PopoverProps } from '../popover/types';\nimport type { ToggleGroupControlProps } from '../toggle-group-control/types';\n\nexport type Border = {\n\tcolor?: CSSProperties[ 'borderColor' ];\n\tstyle?: CSSProperties[ 'borderStyle' ];\n\twidth?: CSSProperties[ 'borderWidth' ];\n};\n\nexport type ColorProps = Pick<\n\tColorPaletteProps,\n\t'colors' | 'enableAlpha' | '__experimentalIsRenderedInSidebar'\n> & {\n\t/**\n\t * This toggles the ability to choose custom colors.\n\t */\n\tdisableCustomColors?: boolean;\n};\n\nexport type LabelProps = {\n\t/**\n\t * Provides control over whether the label will only be visible to\n\t * screen readers.\n\t */\n\thideLabelFromVision?: boolean;\n\t/**\n\t * If provided, a label will be generated using this as the content.\n\t */\n\tlabel?: string;\n};\n\nexport type BorderControlProps = ColorProps &\n\tLabelProps & {\n\t\t/**\n\t\t * This controls whether unit selection should be disabled.\n\t\t */\n\t\tdisableUnits?: boolean;\n\t\t/**\n\t\t * This controls whether to support border style selection.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tenableStyle?: boolean;\n\t\t/**\n\t\t * This flags the `BorderControl` to render with a more compact\n\t\t * appearance. It restricts the width of the control and prevents it\n\t\t * from expanding to take up additional space.\n\t\t */\n\t\tisCompact?: boolean;\n\t\t/**\n\t\t * A callback function invoked when the border value is changed via an\n\t\t * interaction that selects or clears, border color, style, or width.\n\t\t */\n\t\tonChange: ( value?: Border ) => void;\n\t\t/**\n\t\t * An internal prop used to control the visibility of the dropdown.\n\t\t */\n\t\t__unstablePopoverProps?: Omit< PopoverProps, 'children' >;\n\t\t/**\n\t\t * If opted into, sanitizing the border means that if no width or color\n\t\t * have been selected, the border style is also cleared and `undefined`\n\t\t * is returned as the new border value.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tshouldSanitizeBorder?: boolean;\n\t\t/**\n\t\t * Whether or not to show the header for the border color and style\n\t\t * picker dropdown. The header includes a label for the color picker\n\t\t * and a close button.\n\t\t */\n\t\tshowDropdownHeader?: boolean;\n\t\t/**\n\t\t * Size of the control.\n\t\t *\n\t\t * @default 'default'\n\t\t */\n\t\tsize?: 'default' | '__unstable-large';\n\t\t/**\n\t\t * An object representing a border or `undefined`. Used to set the\n\t\t * current border configuration for this component.\n\t\t */\n\t\tvalue?: Border;\n\t\t/**\n\t\t * Controls the visual width of the `BorderControl`. It has no effect if\n\t\t * the `isCompact` prop is set to `true`.\n\t\t */\n\t\twidth?: CSSProperties[ 'width' ];\n\t\t/**\n\t\t * Flags whether this `BorderControl` should also render a\n\t\t * `RangeControl` for additional control over a border's width.\n\t\t */\n\t\twithSlider?: boolean;\n\t\t/**\n\t\t * Start opting into the larger default height that will become the default size in a future version.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\t__next40pxDefaultSize?: boolean;\n\t};\n\nexport type DropdownProps = ColorProps &\n\tPick< BorderControlProps, 'enableStyle' | 'size' > & {\n\t\t/**\n\t\t * An object representing a border or `undefined`. This component will\n\t\t * extract the border color and style selections from this object to use as\n\t\t * values for its popover controls.\n\t\t */\n\t\tborder?: Border;\n\t\t/**\n\t\t * Whether a border style can be set, based on the border sanitization settings.\n\t\t */\n\t\tisStyleSettable: boolean;\n\t\t/**\n\t\t * An internal prop used to control the visibility of the dropdown.\n\t\t */\n\t\t__unstablePopoverProps?: Omit< PopoverProps, 'children' >;\n\t\t/**\n\t\t * A callback invoked when the border color or style selections change.\n\t\t */\n\t\tonChange: ( newBorder?: Border ) => void;\n\t\t/**\n\t\t * Any previous style selection made by the user. This can be used to\n\t\t * reapply that previous selection when, for example, a zero border width is\n\t\t * to a non-zero value.\n\t\t */\n\t\tpreviousStyleSelection?: string;\n\t\t/**\n\t\t * Whether or not to render a header for the border color and style picker\n\t\t * dropdown. The header includes a label for the color picker and a\n\t\t * close button.\n\t\t */\n\t\tshowDropdownHeader?: boolean;\n\t};\n\nexport type StylePickerProps = Omit<\n\tToggleGroupControlProps,\n\t'value' | 'onChange' | 'children'\n> & {\n\t/**\n\t * A callback function invoked when a border style is selected or cleared.\n\t */\n\tonChange: ( style?: string ) => void;\n\t/**\n\t * The currently selected border style if there is one. Styles available via\n\t * this control are `solid`, `dashed` & `dotted`, however the possibility\n\t * to store other valid CSS values is maintained e.g. `none`, `inherit` etc.\n\t */\n\tvalue?: string;\n};\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/border-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ColorPaletteProps } from '../color-palette/types';\nimport type { PopoverProps } from '../popover/types';\nimport type { ToggleGroupControlProps } from '../toggle-group-control/types';\n\nexport type Border = {\n\tcolor?: CSSProperties[ 'borderColor' ];\n\tstyle?: CSSProperties[ 'borderStyle' ];\n\twidth?: CSSProperties[ 'borderWidth' ];\n};\n\nexport type ColorProps = Pick<\n\tColorPaletteProps,\n\t'colors' | 'enableAlpha' | '__experimentalIsRenderedInSidebar'\n> & {\n\t/**\n\t * This toggles the ability to choose custom colors.\n\t */\n\tdisableCustomColors?: boolean;\n};\n\nexport type LabelProps = {\n\t/**\n\t * Provides control over whether the label will only be visible to\n\t * screen readers.\n\t */\n\thideLabelFromVision?: boolean;\n\t/**\n\t * If provided, a label will be generated using this as the content.\n\t */\n\tlabel?: string;\n};\n\nexport type BorderControlProps = ColorProps &\n\tLabelProps & {\n\t\t/**\n\t\t * This controls whether unit selection should be disabled.\n\t\t */\n\t\tdisableUnits?: boolean;\n\t\t/**\n\t\t * This controls whether to support border style selection.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tenableStyle?: boolean;\n\t\t/**\n\t\t * This flags the `BorderControl` to render with a more compact\n\t\t * appearance. It restricts the width of the control and prevents it\n\t\t * from expanding to take up additional space.\n\t\t */\n\t\tisCompact?: boolean;\n\t\t/**\n\t\t * A callback function invoked when the border value is changed via an\n\t\t * interaction that selects or clears, border color, style, or width.\n\t\t */\n\t\tonChange: ( value?: Border ) => void;\n\t\t/**\n\t\t * Placeholder text for the number input.\n\t\t */\n\t\tplaceholder?: HTMLInputElement[ 'placeholder' ];\n\t\t/**\n\t\t * An internal prop used to control the visibility of the dropdown.\n\t\t */\n\t\t__unstablePopoverProps?: Omit< PopoverProps, 'children' >;\n\t\t/**\n\t\t * If opted into, sanitizing the border means that if no width or color\n\t\t * have been selected, the border style is also cleared and `undefined`\n\t\t * is returned as the new border value.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tshouldSanitizeBorder?: boolean;\n\t\t/**\n\t\t * Whether or not to show the header for the border color and style\n\t\t * picker dropdown. The header includes a label for the color picker\n\t\t * and a close button.\n\t\t */\n\t\tshowDropdownHeader?: boolean;\n\t\t/**\n\t\t * Size of the control.\n\t\t *\n\t\t * @default 'default'\n\t\t */\n\t\tsize?: 'default' | '__unstable-large';\n\t\t/**\n\t\t * An object representing a border or `undefined`. Used to set the\n\t\t * current border configuration for this component.\n\t\t */\n\t\tvalue?: Border;\n\t\t/**\n\t\t * Controls the visual width of the `BorderControl`. It has no effect if\n\t\t * the `isCompact` prop is set to `true`.\n\t\t */\n\t\twidth?: CSSProperties[ 'width' ];\n\t\t/**\n\t\t * Flags whether this `BorderControl` should also render a\n\t\t * `RangeControl` for additional control over a border's width.\n\t\t */\n\t\twithSlider?: boolean;\n\t\t/**\n\t\t * Start opting into the larger default height that will become the default size in a future version.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\t__next40pxDefaultSize?: boolean;\n\t};\n\nexport type DropdownProps = ColorProps &\n\tPick< BorderControlProps, 'enableStyle' | 'size' > & {\n\t\t/**\n\t\t * An object representing a border or `undefined`. This component will\n\t\t * extract the border color and style selections from this object to use as\n\t\t * values for its popover controls.\n\t\t */\n\t\tborder?: Border;\n\t\t/**\n\t\t * Whether a border style can be set, based on the border sanitization settings.\n\t\t */\n\t\tisStyleSettable: boolean;\n\t\t/**\n\t\t * An internal prop used to control the visibility of the dropdown.\n\t\t */\n\t\t__unstablePopoverProps?: Omit< PopoverProps, 'children' >;\n\t\t/**\n\t\t * A callback invoked when the border color or style selections change.\n\t\t */\n\t\tonChange: ( newBorder?: Border ) => void;\n\t\t/**\n\t\t * Any previous style selection made by the user. This can be used to\n\t\t * reapply that previous selection when, for example, a zero border width is\n\t\t * to a non-zero value.\n\t\t */\n\t\tpreviousStyleSelection?: string;\n\t\t/**\n\t\t * Whether or not to render a header for the border color and style picker\n\t\t * dropdown. The header includes a label for the color picker and a\n\t\t * close button.\n\t\t */\n\t\tshowDropdownHeader?: boolean;\n\t};\n\nexport type StylePickerProps = Omit<\n\tToggleGroupControlProps,\n\t'value' | 'onChange' | 'children'\n> & {\n\t/**\n\t * A callback function invoked when a border style is selected or cleared.\n\t */\n\tonChange: ( style?: string ) => void;\n\t/**\n\t * The currently selected border style if there is one. Styles available via\n\t * this control are `solid`, `dashed` & `dotted`, however the possibility\n\t * to store other valid CSS values is maintained e.g. `none`, `inherit` etc.\n\t */\n\tvalue?: string;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
@@ -110,7 +110,7 @@ export function UnforwardedButton(props, ref) {
|
|
|
110
110
|
// Tooltip should not considered as a child
|
|
111
111
|
children?.[0]?.props?.className !== 'components-tooltip';
|
|
112
112
|
const truthyAriaPressedValues = [true, 'true', 'mixed'];
|
|
113
|
-
const classes =
|
|
113
|
+
const classes = clsx('components-button', className, {
|
|
114
114
|
'is-next-40px-default-size': __next40pxDefaultSize,
|
|
115
115
|
'is-secondary': variant === 'secondary',
|
|
116
116
|
'is-primary': variant === 'primary',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","deprecated","forwardRef","useInstanceId","Tooltip","Icon","VisuallyHidden","positionToPlacement","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isPressed","isSmall","size","variant","otherProps","computedSize","computedVariant","newProps","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","since","alternative","_computedVariant5","UnforwardedButton","props","ref","__next40pxDefaultSize","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","buttonOrAnchorProps","href","target","ariaChecked","ariaPressed","ariaSelected","additionalProps","undefined","instanceId","Button","hasChildren","Array","isArray","truthyAriaPressedValues","classes","includes","trulyDisabled","Tag","buttonProps","type","anchorProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","createElement","Fragment","element","tooltipProps","placement","id"],"sources":["@wordpress/components/src/button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type {\n\tComponentPropsWithoutRef,\n\tForwardedRef,\n\tHTMLAttributes,\n\tMouseEvent,\n\tReactElement,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { ButtonProps, DeprecatedButtonProps } from './types';\nimport { positionToPlacement } from '../popover/utils';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ] as const;\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tisPressed,\n\tisSmall,\n\tsize,\n\tvariant,\n\t...otherProps\n}: ButtonProps & DeprecatedButtonProps ): ButtonProps {\n\tlet computedSize = size;\n\tlet computedVariant = variant;\n\n\tconst newProps: { 'aria-pressed'?: boolean } = {\n\t\t// @todo Mark `isPressed` as deprecated\n\t\t'aria-pressed': isPressed,\n\t};\n\n\tif ( isSmall ) {\n\t\tcomputedSize ??= 'small';\n\t}\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'wp.components.Button `isDefault` prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...newProps,\n\t\t...otherProps,\n\t\tsize: computedSize,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function UnforwardedButton(\n\tprops: ButtonProps & DeprecatedButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\tsize = 'default',\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...buttonOrAnchorProps\n\t} = useDeprecatedProps( props );\n\n\tconst {\n\t\thref,\n\t\ttarget,\n\t\t'aria-checked': ariaChecked,\n\t\t'aria-pressed': ariaPressed,\n\t\t'aria-selected': ariaSelected,\n\t\t...additionalProps\n\t} = 'href' in buttonOrAnchorProps\n\t\t? buttonOrAnchorProps\n\t\t: { href: undefined, target: undefined, ...buttonOrAnchorProps };\n\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst hasChildren =\n\t\t( 'string' === typeof children && !! children ) ||\n\t\t( Array.isArray( children ) &&\n\t\t\tchildren?.[ 0 ] &&\n\t\t\tchildren[ 0 ] !== null &&\n\t\t\t// Tooltip should not considered as a child\n\t\t\tchildren?.[ 0 ]?.props?.className !== 'components-tooltip' );\n\n\tconst truthyAriaPressedValues: ( typeof ariaPressed )[] = [\n\t\ttrue,\n\t\t'true',\n\t\t'mixed',\n\t];\n\n\tconst classes = classnames( 'components-button', className, {\n\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': size === 'small',\n\t\t'is-compact': size === 'compact',\n\t\t'is-tertiary': variant === 'tertiary',\n\n\t\t'is-pressed': truthyAriaPressedValues.includes( ariaPressed ),\n\t\t'is-pressed-mixed': ariaPressed === 'mixed',\n\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && ( hasChildren || text ),\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst buttonProps: ComponentPropsWithoutRef< 'button' > =\n\t\tTag === 'button'\n\t\t\t? {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-checked': ariaChecked,\n\t\t\t\t\t'aria-pressed': ariaPressed,\n\t\t\t\t\t'aria-selected': ariaSelected,\n\t\t\t }\n\t\t\t: {};\n\tconst anchorProps: ComponentPropsWithoutRef< 'a' > =\n\t\tTag === 'a' ? { href, target } : {};\n\n\tif ( disabled && isFocusable ) {\n\t\t// In this case, the button will be disabled, but still focusable and\n\t\t// perceivable by screen reader users.\n\t\tbuttonProps[ 'aria-disabled' ] = true;\n\t\tanchorProps[ 'aria-disabled' ] = true;\n\n\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tadditionalProps[ disabledEvent ] = ( event: MouseEvent ) => {\n\t\t\t\tif ( event ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! trulyDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && !! label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\t!! shortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t! ( children as string | ReactElement[] )?.length &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst descriptionId = describedBy ? instanceId : undefined;\n\n\tconst describedById =\n\t\tadditionalProps[ 'aria-describedby' ] || descriptionId;\n\n\tconst commonProps = {\n\t\tclassName: classes,\n\t\t'aria-label': additionalProps[ 'aria-label' ] || label,\n\t\t'aria-describedby': describedById,\n\t\tref,\n\t};\n\n\tconst elementChildren = (\n\t\t<>\n\t\t\t{ icon && iconPosition === 'left' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ text && <>{ text }</> }\n\t\t\t{ children }\n\t\t\t{ icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t</>\n\t);\n\n\tconst element =\n\t\tTag === 'a' ? (\n\t\t\t<a\n\t\t\t\t{ ...anchorProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLAnchorElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</a>\n\t\t) : (\n\t\t\t<button\n\t\t\t\t{ ...buttonProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLButtonElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</button>\n\t\t);\n\n\t// In order to avoid some React reconciliation issues, we are always rendering\n\t// the `Tooltip` component even when `shouldShowTooltip` is `false`.\n\t// In order to make sure that the tooltip doesn't show when it shouldn't,\n\t// we don't pass the props to the `Tooltip` component.\n\tconst tooltipProps = shouldShowTooltip\n\t\t? {\n\t\t\t\ttext:\n\t\t\t\t\t( children as string | ReactElement[] )?.length &&\n\t\t\t\t\tdescribedBy\n\t\t\t\t\t\t? describedBy\n\t\t\t\t\t\t: label,\n\t\t\t\tshortcut,\n\t\t\t\tplacement:\n\t\t\t\t\ttooltipPosition &&\n\t\t\t\t\t// Convert legacy `position` values to be used with the new `placement` prop\n\t\t\t\t\tpositionToPlacement( tooltipPosition ),\n\t\t }\n\t\t: {};\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip { ...tooltipProps }>{ element }</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef( UnforwardedButton );\nexport default Button;\n"],"mappings":";AAAA;AACA;A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CACvC,EACCM,IAAI,IAAImC,aAAA,CAAAC,QAAA,QAAIpC,IAAQ,CAAC,EACrBD,QAAQ,EACRP,IAAI,IAAIC,YAAY,KAAK,OAAO,IACjC0C,aAAA,CAAC7E,IAAI;IAACkC,IAAI,EAAGA,IAAM;IAACtB,IAAI,EAAGwB;EAAU,CAAE,CAEvC,CACF;EAED,MAAM2C,OAAO,GACZhB,GAAG,KAAK,GAAG,GACVc,aAAA;IAAA,GACMX,WAAW;IAAA,GACTd,eAAe;IAAA,GACjBuB;EAAW,GAEdC,eACA,CAAC,GAEJC,aAAA;IAAA,GACMb,WAAW;IAAA,GACTZ,eAAe;IAAA,GACjBuB;EAAW,GAEdC,eACK,CACR;;EAEF;EACA;EACA;EACA;EACA,MAAMI,YAAY,GAAGT,iBAAiB,GACnC;IACA7B,IAAI,EACDD,QAAQ,EAA+B+B,MAAM,IAC/C3B,WAAW,GACRA,WAAW,GACXL,KAAK;IACTD,QAAQ;IACR0C,SAAS,EACR3C,eAAe;IACf;IACApC,mBAAmB,CAAEoC,eAAgB;EACtC,CAAC,GACD,CAAC,CAAC;EAEL,OACCuC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAAC9E,OAAO;IAAA,GAAMiF;EAAY,GAAKD,OAAkB,CAAC,EAChDlC,WAAW,IACZgC,aAAA,CAAC5E,cAAc,QACd4E,aAAA;IAAMK,EAAE,EAAGT;EAAe,GAAG5B,WAAmB,CACjC,CAEhB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMU,MAAM,GAAG1D,UAAU,CAAE6B,iBAAkB,CAAC;AACrD,eAAe6B,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","deprecated","forwardRef","useInstanceId","Tooltip","Icon","VisuallyHidden","positionToPlacement","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isPressed","isSmall","size","variant","otherProps","computedSize","computedVariant","newProps","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","since","alternative","_computedVariant5","UnforwardedButton","props","ref","__next40pxDefaultSize","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","buttonOrAnchorProps","href","target","ariaChecked","ariaPressed","ariaSelected","additionalProps","undefined","instanceId","Button","hasChildren","Array","isArray","truthyAriaPressedValues","classes","includes","trulyDisabled","Tag","buttonProps","type","anchorProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","createElement","Fragment","element","tooltipProps","placement","id"],"sources":["@wordpress/components/src/button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type {\n\tComponentPropsWithoutRef,\n\tForwardedRef,\n\tHTMLAttributes,\n\tMouseEvent,\n\tReactElement,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { ButtonProps, DeprecatedButtonProps } from './types';\nimport { positionToPlacement } from '../popover/utils';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ] as const;\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tisPressed,\n\tisSmall,\n\tsize,\n\tvariant,\n\t...otherProps\n}: ButtonProps & DeprecatedButtonProps ): ButtonProps {\n\tlet computedSize = size;\n\tlet computedVariant = variant;\n\n\tconst newProps: { 'aria-pressed'?: boolean } = {\n\t\t// @todo Mark `isPressed` as deprecated\n\t\t'aria-pressed': isPressed,\n\t};\n\n\tif ( isSmall ) {\n\t\tcomputedSize ??= 'small';\n\t}\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'wp.components.Button `isDefault` prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...newProps,\n\t\t...otherProps,\n\t\tsize: computedSize,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function UnforwardedButton(\n\tprops: ButtonProps & DeprecatedButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\tsize = 'default',\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...buttonOrAnchorProps\n\t} = useDeprecatedProps( props );\n\n\tconst {\n\t\thref,\n\t\ttarget,\n\t\t'aria-checked': ariaChecked,\n\t\t'aria-pressed': ariaPressed,\n\t\t'aria-selected': ariaSelected,\n\t\t...additionalProps\n\t} = 'href' in buttonOrAnchorProps\n\t\t? buttonOrAnchorProps\n\t\t: { href: undefined, target: undefined, ...buttonOrAnchorProps };\n\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst hasChildren =\n\t\t( 'string' === typeof children && !! children ) ||\n\t\t( Array.isArray( children ) &&\n\t\t\tchildren?.[ 0 ] &&\n\t\t\tchildren[ 0 ] !== null &&\n\t\t\t// Tooltip should not considered as a child\n\t\t\tchildren?.[ 0 ]?.props?.className !== 'components-tooltip' );\n\n\tconst truthyAriaPressedValues: ( typeof ariaPressed )[] = [\n\t\ttrue,\n\t\t'true',\n\t\t'mixed',\n\t];\n\n\tconst classes = clsx( 'components-button', className, {\n\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': size === 'small',\n\t\t'is-compact': size === 'compact',\n\t\t'is-tertiary': variant === 'tertiary',\n\n\t\t'is-pressed': truthyAriaPressedValues.includes( ariaPressed ),\n\t\t'is-pressed-mixed': ariaPressed === 'mixed',\n\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && ( hasChildren || text ),\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst buttonProps: ComponentPropsWithoutRef< 'button' > =\n\t\tTag === 'button'\n\t\t\t? {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-checked': ariaChecked,\n\t\t\t\t\t'aria-pressed': ariaPressed,\n\t\t\t\t\t'aria-selected': ariaSelected,\n\t\t\t }\n\t\t\t: {};\n\tconst anchorProps: ComponentPropsWithoutRef< 'a' > =\n\t\tTag === 'a' ? { href, target } : {};\n\n\tif ( disabled && isFocusable ) {\n\t\t// In this case, the button will be disabled, but still focusable and\n\t\t// perceivable by screen reader users.\n\t\tbuttonProps[ 'aria-disabled' ] = true;\n\t\tanchorProps[ 'aria-disabled' ] = true;\n\n\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tadditionalProps[ disabledEvent ] = ( event: MouseEvent ) => {\n\t\t\t\tif ( event ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! trulyDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && !! label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\t!! shortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t! ( children as string | ReactElement[] )?.length &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst descriptionId = describedBy ? instanceId : undefined;\n\n\tconst describedById =\n\t\tadditionalProps[ 'aria-describedby' ] || descriptionId;\n\n\tconst commonProps = {\n\t\tclassName: classes,\n\t\t'aria-label': additionalProps[ 'aria-label' ] || label,\n\t\t'aria-describedby': describedById,\n\t\tref,\n\t};\n\n\tconst elementChildren = (\n\t\t<>\n\t\t\t{ icon && iconPosition === 'left' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ text && <>{ text }</> }\n\t\t\t{ children }\n\t\t\t{ icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t</>\n\t);\n\n\tconst element =\n\t\tTag === 'a' ? (\n\t\t\t<a\n\t\t\t\t{ ...anchorProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLAnchorElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</a>\n\t\t) : (\n\t\t\t<button\n\t\t\t\t{ ...buttonProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLButtonElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</button>\n\t\t);\n\n\t// In order to avoid some React reconciliation issues, we are always rendering\n\t// the `Tooltip` component even when `shouldShowTooltip` is `false`.\n\t// In order to make sure that the tooltip doesn't show when it shouldn't,\n\t// we don't pass the props to the `Tooltip` component.\n\tconst tooltipProps = shouldShowTooltip\n\t\t? {\n\t\t\t\ttext:\n\t\t\t\t\t( children as string | ReactElement[] )?.length &&\n\t\t\t\t\tdescribedBy\n\t\t\t\t\t\t? describedBy\n\t\t\t\t\t\t: label,\n\t\t\t\tshortcut,\n\t\t\t\tplacement:\n\t\t\t\t\ttooltipPosition &&\n\t\t\t\t\t// Convert legacy `position` values to be used with the new `placement` prop\n\t\t\t\t\tpositionToPlacement( tooltipPosition ),\n\t\t }\n\t\t: {};\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip { ...tooltipProps }>{ element }</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef( UnforwardedButton );\nexport default Button;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AASvB;AACA;AACA;AACA,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SAASC,mBAAmB,QAAQ,kBAAkB;AAEtD,MAAMC,8BAA8B,GAAG,CAAE,aAAa,EAAE,SAAS,CAAW;AAE5E,SAASC,kBAAkBA,CAAE;EAC5BC,SAAS;EACTC,SAAS;EACTC,WAAW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eACK,CACR;;EAEF;EACA;EACA;EACA;EACA,MAAMI,YAAY,GAAGT,iBAAiB,GACnC;IACA7B,IAAI,EACDD,QAAQ,EAA+B+B,MAAM,IAC/C3B,WAAW,GACRA,WAAW,GACXL,KAAK;IACTD,QAAQ;IACR0C,SAAS,EACR3C,eAAe;IACf;IACApC,mBAAmB,CAAEoC,eAAgB;EACtC,CAAC,GACD,CAAC,CAAC;EAEL,OACCuC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAAC9E,OAAO;IAAA,GAAMiF;EAAY,GAAKD,OAAkB,CAAC,EAChDlC,WAAW,IACZgC,aAAA,CAAC5E,cAAc,QACd4E,aAAA;IAAMK,EAAE,EAAGT;EAAe,GAAG5B,WAAmB,CACjC,CAEhB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMU,MAAM,GAAG1D,UAAU,CAAE6B,iBAAkB,CAAC;AACrD,eAAe6B,MAAM","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import { createElement } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
@@ -17,7 +17,7 @@ function UnforwardedButtonGroup(props, ref) {
|
|
|
17
17
|
className,
|
|
18
18
|
...restProps
|
|
19
19
|
} = props;
|
|
20
|
-
const classes =
|
|
20
|
+
const classes = clsx('components-button-group', className);
|
|
21
21
|
return createElement("div", {
|
|
22
22
|
ref: ref,
|
|
23
23
|
role: "group",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["clsx","forwardRef","UnforwardedButtonGroup","props","ref","className","restProps","classes","createElement","role","ButtonGroup"],"sources":["@wordpress/components/src/button-group/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ButtonGroupProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nfunction UnforwardedButtonGroup(\n\tprops: WordPressComponentProps< ButtonGroupProps, 'div', false >,\n\tref: ForwardedRef< HTMLDivElement >\n) {\n\tconst { className, ...restProps } = props;\n\tconst classes = clsx( 'components-button-group', className );\n\n\treturn (\n\t\t<div ref={ ref } role=\"group\" className={ classes } { ...restProps } />\n\t);\n}\n\n/**\n * ButtonGroup can be used to group any related buttons together. To emphasize\n * related buttons, a group should share a common container.\n *\n * ```jsx\n * import { Button, ButtonGroup } from '@wordpress/components';\n *\n * const MyButtonGroup = () => (\n * <ButtonGroup>\n * <Button variant=\"primary\">Button 1</Button>\n * <Button variant=\"primary\">Button 2</Button>\n * </ButtonGroup>\n * );\n * ```\n */\nexport const ButtonGroup = forwardRef( UnforwardedButtonGroup );\n\nexport default ButtonGroup;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAIA,SAASC,sBAAsBA,CAC9BC,KAAgE,EAChEC,GAAmC,EAClC;EACD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EACzC,MAAMI,OAAO,GAAGP,IAAI,CAAE,yBAAyB,EAAEK,SAAU,CAAC;EAE5D,OACCG,aAAA;IAAKJ,GAAG,EAAGA,GAAK;IAACK,IAAI,EAAC,OAAO;IAACJ,SAAS,EAAGE,OAAS;IAAA,GAAMD;EAAS,CAAI,CAAC;AAEzE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,WAAW,GAAGT,UAAU,CAAEC,sBAAuB,CAAC;AAE/D,eAAeQ,WAAW","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import { createElement } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
@@ -15,6 +15,7 @@ import { Icon, check, reset } from '@wordpress/icons';
|
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
17
|
import BaseControl from '../base-control';
|
|
18
|
+
import { HStack } from '../h-stack';
|
|
18
19
|
/**
|
|
19
20
|
* Checkboxes allow the user to select one or more items from a set.
|
|
20
21
|
*
|
|
@@ -75,8 +76,14 @@ export function CheckboxControl(props) {
|
|
|
75
76
|
__nextHasNoMarginBottom: __nextHasNoMarginBottom,
|
|
76
77
|
label: heading,
|
|
77
78
|
id: id,
|
|
78
|
-
help: help,
|
|
79
|
-
|
|
79
|
+
help: help && createElement("span", {
|
|
80
|
+
className: "components-checkbox-control__help"
|
|
81
|
+
}, help),
|
|
82
|
+
className: clsx('components-checkbox-control', className)
|
|
83
|
+
}, createElement(HStack, {
|
|
84
|
+
spacing: 0,
|
|
85
|
+
justify: "start",
|
|
86
|
+
alignment: "top"
|
|
80
87
|
}, createElement("span", {
|
|
81
88
|
className: "components-checkbox-control__input-container"
|
|
82
89
|
}, createElement("input", {
|
|
@@ -100,7 +107,7 @@ export function CheckboxControl(props) {
|
|
|
100
107
|
}) : null), label && createElement("label", {
|
|
101
108
|
className: "components-checkbox-control__label",
|
|
102
109
|
htmlFor: id
|
|
103
|
-
}, label));
|
|
110
|
+
}, label)));
|
|
104
111
|
}
|
|
105
112
|
export default CheckboxControl;
|
|
106
113
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["clsx","useState","useInstanceId","useRefEffect","deprecated","Icon","check","reset","BaseControl","HStack","CheckboxControl","props","__nextHasNoMarginBottom","label","className","heading","checked","indeterminate","help","id","idProp","onChange","additionalProps","alternative","since","showCheckedIcon","setShowCheckedIcon","showIndeterminateIcon","setShowIndeterminateIcon","ref","node","matches","onChangeValue","event","target","createElement","spacing","justify","alignment","type","value","undefined","icon","role","htmlFor"],"sources":["@wordpress/components/src/checkbox-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useInstanceId, useRefEffect } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\nimport { Icon, check, reset } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport { HStack } from '../h-stack';\nimport type { CheckboxControlProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\n/**\n * Checkboxes allow the user to select one or more items from a set.\n *\n * ```jsx\n * import { CheckboxControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyCheckboxControl = () => {\n * const [ isChecked, setChecked ] = useState( true );\n * return (\n * <CheckboxControl\n * label=\"Is author\"\n * help=\"Is the user a author or not?\"\n * checked={ isChecked }\n * onChange={ setChecked }\n * />\n * );\n * };\n * ```\n */\nexport function CheckboxControl(\n\tprops: WordPressComponentProps< CheckboxControlProps, 'input', false >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom,\n\t\tlabel,\n\t\tclassName,\n\t\theading,\n\t\tchecked,\n\t\tindeterminate,\n\t\thelp,\n\t\tid: idProp,\n\t\tonChange,\n\t\t...additionalProps\n\t} = props;\n\n\tif ( heading ) {\n\t\tdeprecated( '`heading` prop in `CheckboxControl`', {\n\t\t\talternative: 'a separate element to implement a heading',\n\t\t\tsince: '5.8',\n\t\t} );\n\t}\n\n\tconst [ showCheckedIcon, setShowCheckedIcon ] = useState( false );\n\tconst [ showIndeterminateIcon, setShowIndeterminateIcon ] =\n\t\tuseState( false );\n\n\t// Run the following callback every time the `ref` (and the additional\n\t// dependencies) change.\n\tconst ref = useRefEffect< HTMLInputElement >(\n\t\t( node ) => {\n\t\t\tif ( ! node ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// It cannot be set using an HTML attribute.\n\t\t\tnode.indeterminate = !! indeterminate;\n\n\t\t\tsetShowCheckedIcon( node.matches( ':checked' ) );\n\t\t\tsetShowIndeterminateIcon( node.matches( ':indeterminate' ) );\n\t\t},\n\t\t[ checked, indeterminate ]\n\t);\n\tconst id = useInstanceId(\n\t\tCheckboxControl,\n\t\t'inspector-checkbox-control',\n\t\tidProp\n\t);\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.checked );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tlabel={ heading }\n\t\t\tid={ id }\n\t\t\thelp={\n\t\t\t\thelp && (\n\t\t\t\t\t<span className=\"components-checkbox-control__help\">\n\t\t\t\t\t\t{ help }\n\t\t\t\t\t</span>\n\t\t\t\t)\n\t\t\t}\n\t\t\tclassName={ clsx( 'components-checkbox-control', className ) }\n\t\t>\n\t\t\t<HStack spacing={ 0 } justify=\"start\" alignment=\"top\">\n\t\t\t\t<span className=\"components-checkbox-control__input-container\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tid={ id }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__input\"\n\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\tvalue=\"1\"\n\t\t\t\t\t\tonChange={ onChangeValue }\n\t\t\t\t\t\tchecked={ checked }\n\t\t\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\t/>\n\t\t\t\t\t{ showIndeterminateIcon ? (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ reset }\n\t\t\t\t\t\t\tclassName=\"components-checkbox-control__indeterminate\"\n\t\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null }\n\t\t\t\t\t{ showCheckedIcon ? (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\t\tclassName=\"components-checkbox-control__checked\"\n\t\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null }\n\t\t\t\t</span>\n\t\t\t\t{ label && (\n\t\t\t\t\t<label\n\t\t\t\t\t\tclassName=\"components-checkbox-control__label\"\n\t\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</label>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</BaseControl>\n\t);\n}\n\nexport default CheckboxControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,aAAa,EAAEC,YAAY,QAAQ,oBAAoB;AAChE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,IAAI,EAAEC,KAAK,EAAEC,KAAK,QAAQ,kBAAkB;;AAErD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAASC,MAAM,QAAQ,YAAY;AAInC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC9BC,KAAsE,EACrE;EACD,MAAM;IACLC,uBAAuB;IACvBC,KAAK;IACLC,SAAS;IACTC,OAAO;IACPC,OAAO;IACPC,aAAa;IACbC,IAAI;IACJC,EAAE,EAAEC,MAAM;IACVC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGX,KAAK;EAET,IAAKI,OAAO,EAAG;IAC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GAAK;IACXV,EAAE,EAAGA,EAAI;IACTL,SAAS,EAAC,oCAAoC;IAC9CyB,IAAI,EAAC,UAAU;IACfC,KAAK,EAAC,GAAG;IACTnB,QAAQ,EAAGW,aAAe;IAC1BhB,OAAO,EAAGA,OAAS;IACnB,oBAAmB,CAAC,CAAEE,IAAI,GAAGC,EAAE,GAAG,QAAQ,GAAGsB,SAAW;IAAA,GACnDnB;EAAe,CACpB,CAAC,EACAK,qBAAqB,GACtBQ,aAAA,CAAC9B,IAAI;IACJqC,IAAI,EAAGnC,KAAO;IACdO,SAAS,EAAC,4CAA4C;IACtD6B,IAAI,EAAC;EAAc,CACnB,CAAC,GACC,IAAI,EACNlB,eAAe,GAChBU,aAAA,CAAC9B,IAAI;IACJqC,IAAI,EAAGpC,KAAO;IACdQ,SAAS,EAAC,sCAAsC;IAChD6B,IAAI,EAAC;EAAc,CACnB,CAAC,GACC,IACC,CAAC,EACL9B,KAAK,IACNsB,aAAA;IACCrB,SAAS,EAAC,oCAAoC;IAC9C8B,OAAO,EAAGzB;EAAI,GAEZN,KACI,CAED,CACI,CAAC;AAEhB;AAEA,eAAeH,eAAe","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import { createElement } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -16,7 +16,7 @@ export function DropdownLinkAction({
|
|
|
16
16
|
linkText
|
|
17
17
|
}) {
|
|
18
18
|
return createElement(Dropdown, {
|
|
19
|
-
className:
|
|
19
|
+
className: clsx('components-circular-option-picker__dropdown-link-action', className),
|
|
20
20
|
renderToggle: ({
|
|
21
21
|
isOpen,
|
|
22
22
|
onToggle
|
|
@@ -36,7 +36,7 @@ export function ButtonAction({
|
|
|
36
36
|
...additionalProps
|
|
37
37
|
}) {
|
|
38
38
|
return createElement(Button, {
|
|
39
|
-
className:
|
|
39
|
+
className: clsx('components-circular-option-picker__clear', className),
|
|
40
40
|
variant: "tertiary",
|
|
41
41
|
...additionalProps
|
|
42
42
|
}, children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["clsx","Button","Dropdown","DropdownLinkAction","buttonProps","className","dropdownProps","linkText","createElement","renderToggle","isOpen","onToggle","onClick","variant","ButtonAction","children","additionalProps"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-actions.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport type { DropdownLinkActionProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport function DropdownLinkAction( {\n\tbuttonProps,\n\tclassName,\n\tdropdownProps,\n\tlinkText,\n}: DropdownLinkActionProps ) {\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__dropdown-link-action',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t{ ...buttonProps }\n\t\t\t\t>\n\t\t\t\t\t{ linkText }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t{ ...dropdownProps }\n\t\t/>\n\t);\n}\n\nexport function ButtonAction( {\n\tclassName,\n\tchildren,\n\t...additionalProps\n}: WordPressComponentProps< ButtonAsButtonProps, 'button', false > ) {\n\treturn (\n\t\t<Button\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__clear',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tvariant=\"tertiary\"\n\t\t\t{ ...additionalProps }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,QAAQ,MAAM,aAAa;AAKlC,OAAO,SAASC,kBAAkBA,CAAE;EACnCC,WAAW;EACXC,SAAS;EACTC,aAAa;EACbC;AACwB,CAAC,EAAG;EAC5B,OACCC,aAAA,CAACN,QAAQ;IACRG,SAAS,EAAGL,IAAI,CACf,yDAAyD,EACzDK,SACD,CAAG;IACHI,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,KACpCH,aAAA,CAACP,MAAM;MACN,iBAAgBS,MAAQ;MACxB,iBAAc,MAAM;MACpBE,OAAO,EAAGD,QAAU;MACpBE,OAAO,EAAC,MAAM;MAAA,GACTT;IAAW,GAEdG,QACK,CACN;IAAA,GACED;EAAa,CAClB,CAAC;AAEJ;AAEA,OAAO,SAASQ,YAAYA,CAAE;EAC7BT,SAAS;EACTU,QAAQ;EACR,GAAGC;AAC6D,CAAC,EAAG;EACpE,OACCR,aAAA,CAACP,MAAM;IACNI,SAAS,EAAGL,IAAI,CACf,0CAA0C,EAC1CK,SACD,CAAG;IACHQ,OAAO,EAAC,UAAU;IAAA,GACbG;EAAe,GAElBD,QACK,CAAC;AAEX","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import { createElement } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -17,7 +17,7 @@ export function OptionGroup({
|
|
|
17
17
|
return createElement("div", {
|
|
18
18
|
...additionalProps,
|
|
19
19
|
role: role,
|
|
20
|
-
className:
|
|
20
|
+
className: clsx('components-circular-option-picker__option-group', 'components-circular-option-picker__swatches', className)
|
|
21
21
|
}, options);
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=circular-option-picker-option-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["clsx","OptionGroup","className","options","additionalProps","role","undefined","createElement"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-option-group.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport type { OptionGroupProps } from './types';\n\nexport function OptionGroup( {\n\tclassName,\n\toptions,\n\t...additionalProps\n}: OptionGroupProps ) {\n\tconst role =\n\t\t'aria-label' in additionalProps || 'aria-labelledby' in additionalProps\n\t\t\t? 'group'\n\t\t\t: undefined;\n\n\treturn (\n\t\t<div\n\t\t\t{ ...additionalProps }\n\t\t\trole={ role }\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__option-group',\n\t\t\t\t'components-circular-option-picker__swatches',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ options }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;;AAGA,OAAO,SAASC,WAAWA,CAAE;EAC5BC,SAAS;EACTC,OAAO;EACP,GAAGC;AACc,CAAC,EAAG;EACrB,MAAMC,IAAI,GACT,YAAY,IAAID,eAAe,IAAI,iBAAiB,IAAIA,eAAe,GACpE,OAAO,GACPE,SAAS;EAEb,OACCC,aAAA;IAAA,GACMH,eAAe;IACpBC,IAAI,EAAGA,IAAM;IACbH,SAAS,EAAGF,IAAI,CACf,iDAAiD,EACjD,6CAA6C,EAC7CE,SACD;EAAG,GAEDC,OACE,CAAC;AAER","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import { createElement } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
@@ -78,7 +78,7 @@ export function Option({
|
|
|
78
78
|
isPressed: isSelected
|
|
79
79
|
});
|
|
80
80
|
return createElement("div", {
|
|
81
|
-
className:
|
|
81
|
+
className: clsx(className, 'components-circular-option-picker__option-wrapper')
|
|
82
82
|
}, tooltipText ? createElement(Tooltip, {
|
|
83
83
|
text: tooltipText
|
|
84
84
|
}, optionControl) : optionControl, isSelected && createElement(Icon, {
|