@wordpress/components 19.12.0 → 19.15.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 +116 -3
- package/CONTRIBUTING.md +94 -12
- package/build/alignment-matrix-control/index.js +3 -3
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/alignment-matrix-control/utils.js +1 -7
- 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/autocomplete/autocompleter-ui.js +4 -2
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.native.js +9 -3
- package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build/autocomplete/get-default-use-items.js +5 -1
- package/build/autocomplete/get-default-use-items.js.map +1 -1
- package/build/autocomplete/index.js +9 -3
- package/build/autocomplete/index.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +2 -1
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js +2 -1
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-box-control/utils.js.map +1 -1
- package/build/border-control/border-control/component.js +40 -4
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/box-control/all-input-control.js +6 -10
- package/build/box-control/all-input-control.js.map +1 -1
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/index.js +4 -8
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js +6 -10
- package/build/box-control/input-controls.js.map +1 -1
- package/build/box-control/unit-control.js +4 -4
- package/build/box-control/unit-control.js.map +1 -1
- package/build/box-control/utils.js +3 -3
- package/build/box-control/utils.js.map +1 -1
- package/build/button/index.native.js +1 -3
- package/build/button/index.native.js.map +1 -1
- package/build/checkbox-control/index.js.map +1 -1
- package/build/color-indicator/index.js +27 -10
- package/build/color-indicator/index.js.map +1 -1
- package/build/color-indicator/types.js +6 -0
- package/build/color-indicator/types.js.map +1 -0
- package/build/color-palette/index.js +2 -1
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/component.js +6 -9
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/hex-input.js +5 -4
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/index.native.js +35 -34
- package/build/color-picker/index.native.js.map +1 -1
- package/build/color-picker/input-with-slider.js +4 -3
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/color-picker/styles.js +42 -36
- package/build/color-picker/styles.js.map +1 -1
- package/build/color-picker/use-deprecated-props.js +22 -31
- package/build/color-picker/use-deprecated-props.js.map +1 -1
- package/build/combobox-control/index.js +18 -8
- package/build/combobox-control/index.js.map +1 -1
- package/build/combobox-control/styles.js +39 -0
- package/build/combobox-control/styles.js.map +1 -0
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/custom-gradient-bar/constants.js +1 -3
- package/build/custom-gradient-bar/constants.js.map +1 -1
- package/build/custom-gradient-bar/control-points.js +15 -8
- package/build/custom-gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-bar/index.js +5 -5
- package/build/custom-gradient-bar/index.js.map +1 -1
- package/build/custom-gradient-bar/utils.js +5 -7
- package/build/custom-gradient-bar/utils.js.map +1 -1
- package/build/custom-gradient-picker/index.js +8 -8
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-gradient-picker/index.native.js +8 -9
- package/build/custom-gradient-picker/index.native.js.map +1 -1
- package/build/custom-gradient-picker/serializer.js +4 -7
- package/build/custom-gradient-picker/serializer.js.map +1 -1
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/custom-select-control/index.js.map +1 -1
- package/build/date-time/date/index.js +7 -5
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/date-time/index.js +6 -4
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/dimension-control/index.js +1 -3
- package/build/dimension-control/index.js.map +1 -1
- package/build/divider/styles.js +5 -5
- package/build/divider/styles.js.map +1 -1
- package/build/draggable/index.js.map +1 -1
- package/build/draggable/index.native.js +6 -1
- package/build/draggable/index.native.js.map +1 -1
- package/build/drop-zone/provider.js.map +1 -1
- package/build/dropdown/index.js +2 -2
- package/build/dropdown/index.js.map +1 -1
- package/build/dropdown-menu/index.js +16 -5
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu/index.native.js +17 -6
- package/build/dropdown-menu/index.native.js.map +1 -1
- package/build/duotone-picker/duotone-picker.js +42 -29
- package/build/duotone-picker/duotone-picker.js.map +1 -1
- package/build/elevation/hook.js +14 -14
- package/build/elevation/hook.js.map +1 -1
- package/build/external-link/index.js +20 -10
- package/build/external-link/index.js.map +1 -1
- package/build/external-link/styles/external-link-styles.js +3 -3
- package/build/external-link/styles/external-link-styles.js.map +1 -1
- package/build/external-link/types.js +6 -0
- package/build/external-link/types.js.map +1 -0
- package/build/flex/flex/hook.js +9 -5
- package/build/flex/flex/hook.js.map +1 -1
- package/build/focal-point-picker/controls.js +3 -7
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/grid.js +2 -7
- package/build/focal-point-picker/grid.js.map +1 -1
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/index.native.js +12 -12
- package/build/focal-point-picker/index.native.js.map +1 -1
- package/build/focal-point-picker/media.js +4 -8
- package/build/focal-point-picker/media.js.map +1 -1
- package/build/focal-point-picker/tooltip/index.native.js +11 -12
- package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build/font-size-picker/index.js +1 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/form-toggle/index.js +34 -9
- package/build/form-toggle/index.js.map +1 -1
- package/build/form-toggle/types.js +6 -0
- package/build/form-toggle/types.js.map +1 -0
- package/build/form-token-field/index.js +344 -360
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/styles.js +40 -0
- package/build/form-token-field/styles.js.map +1 -0
- package/build/form-token-field/suggestions-list.js +22 -21
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/form-token-field/token-input.js +39 -53
- package/build/form-token-field/token-input.js.map +1 -1
- package/build/form-token-field/token.js +3 -3
- package/build/form-token-field/token.js.map +1 -1
- package/build/form-token-field/types.js +6 -0
- package/build/form-token-field/types.js.map +1 -0
- package/build/gradient-picker/index.js.map +1 -1
- package/build/grid/component.js +7 -8
- package/build/grid/component.js.map +1 -1
- package/build/grid/hook.js +1 -5
- package/build/grid/hook.js.map +1 -1
- package/build/grid/index.js.map +1 -1
- package/build/grid/utils.js +4 -7
- package/build/grid/utils.js.map +1 -1
- package/build/h-stack/component.js +5 -9
- package/build/h-stack/component.js.map +1 -1
- package/build/h-stack/hook.js +8 -10
- package/build/h-stack/hook.js.map +1 -1
- package/build/h-stack/index.js.map +1 -1
- package/build/h-stack/utils.js +8 -19
- package/build/h-stack/utils.js.map +1 -1
- package/build/heading/component.js +0 -1
- package/build/heading/component.js.map +1 -1
- package/build/heading/hook.js.map +1 -1
- package/build/heading/types.js +6 -0
- package/build/heading/types.js.map +1 -0
- package/build/higher-order/navigate-regions/index.js.map +1 -1
- package/build/higher-order/with-focus-return/index.js.map +1 -1
- package/build/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build/icon/index.js.map +1 -1
- package/build/input-control/index.js +5 -5
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-field.js +10 -10
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/utils.js +1 -1
- package/build/input-control/utils.js.map +1 -1
- package/build/menu-item/index.js +1 -3
- package/build/menu-item/index.js.map +1 -1
- package/build/menu-items-choice/index.js +3 -7
- package/build/menu-items-choice/index.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -7
- package/build/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -1
- package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
- package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/focal-point-settings-panel/index.native.js +1 -1
- package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
- package/build/mobile/global-styles-context/index.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/html-text-input/index.native.js.map +1 -1
- package/build/mobile/image/index.native.js +4 -2
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/inserter-button/index.native.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +4 -4
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
- package/build/mobile/media-edit/index.native.js.map +1 -1
- package/build/mobile/segmented-control/index.native.js +3 -5
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/modal/index.js +18 -4
- package/build/modal/index.js.map +1 -1
- package/build/navigable-container/container.js +4 -2
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigation/context.js +12 -16
- package/build/navigation/context.js.map +1 -1
- package/build/navigation/group/index.js +4 -7
- package/build/navigation/group/index.js.map +1 -1
- package/build/navigation/index.js +7 -4
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/item/base.js +6 -3
- package/build/navigation/item/base.js.map +1 -1
- package/build/navigation/item/index.js +3 -3
- package/build/navigation/item/index.js.map +1 -1
- package/build/navigation/item/use-navigation-tree-item.js +2 -1
- package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +1 -7
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/search-no-results-found.js +1 -7
- package/build/navigation/menu/search-no-results-found.js.map +1 -1
- package/build/navigation/use-navigation-tree-nodes.js +18 -10
- package/build/navigation/use-navigation-tree-nodes.js.map +1 -1
- package/build/navigation/utils.js +4 -2
- package/build/navigation/utils.js.map +1 -1
- package/build/navigator/navigator-back-button/hook.js.map +1 -1
- package/build/navigator/navigator-button/hook.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +1 -1
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +1 -1
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/notice/index.js +5 -5
- package/build/notice/index.js.map +1 -1
- package/build/notice/list.js +4 -2
- package/build/notice/list.js.map +1 -1
- package/build/panel/body.js +3 -3
- package/build/panel/body.js.map +1 -1
- package/build/placeholder/index.js +26 -12
- package/build/placeholder/index.js.map +1 -1
- package/build/popover/index.js +4 -4
- package/build/popover/index.js.map +1 -1
- package/build/radio-control/index.js +43 -7
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-control/types.js +6 -0
- package/build/radio-control/types.js.map +1 -0
- package/build/range-control/index.js +63 -47
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/input-range.js +11 -17
- package/build/range-control/input-range.js.map +1 -1
- package/build/range-control/mark.js +5 -7
- package/build/range-control/mark.js.map +1 -1
- package/build/range-control/rail.js +10 -16
- package/build/range-control/rail.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +62 -62
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/range-control/tooltip.js +5 -7
- package/build/range-control/tooltip.js.map +1 -1
- package/build/range-control/types.js +6 -0
- package/build/range-control/types.js.map +1 -0
- package/build/range-control/utils.js +27 -36
- package/build/range-control/utils.js.map +1 -1
- package/build/resizable-box/resize-tooltip/index.js +3 -3
- package/build/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js +5 -13
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/responsive-wrapper/index.js.map +1 -1
- package/build/scrollable/component.js +7 -8
- package/build/scrollable/component.js.map +1 -1
- package/build/scrollable/hook.js +0 -8
- package/build/scrollable/hook.js.map +1 -1
- package/build/scrollable/index.js.map +1 -1
- package/build/scrollable/styles.js +7 -7
- package/build/scrollable/styles.js.map +1 -1
- package/build/select-control/index.js +5 -3
- package/build/select-control/index.js.map +1 -1
- package/build/shortcut/index.js +2 -8
- package/build/shortcut/index.js.map +1 -1
- package/build/slot-fill/fill.js +1 -7
- package/build/slot-fill/fill.js.map +1 -1
- package/build/slot-fill/index.native.js +6 -8
- package/build/slot-fill/index.native.js.map +1 -1
- package/build/slot-fill/provider.js +4 -8
- package/build/slot-fill/provider.js.map +1 -1
- package/build/slot-fill/slot.js +17 -10
- package/build/slot-fill/slot.js.map +1 -1
- package/build/snackbar/index.js +7 -7
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js +3 -1
- package/build/snackbar/list.js.map +1 -1
- package/build/spacer/component.js +5 -5
- package/build/spacer/component.js.map +1 -1
- package/build/spacer/hook.js +2 -2
- package/build/spacer/hook.js.map +1 -1
- package/build/spacer/index.js.map +1 -1
- package/build/spinner/index.js +26 -13
- package/build/spinner/index.js.map +1 -1
- package/build/spinner/styles.js +10 -10
- package/build/spinner/styles.js.map +1 -1
- package/build/tab-panel/index.js +3 -1
- package/build/tab-panel/index.js.map +1 -1
- package/build/text/hook.js +4 -4
- package/build/text/hook.js.map +1 -1
- package/build/text/utils.js.map +1 -1
- package/build/text-highlight/index.js +22 -5
- package/build/text-highlight/index.js.map +1 -1
- package/build/text-highlight/types.js +6 -0
- package/build/text-highlight/types.js.map +1 -0
- package/build/tip/index.js +5 -11
- package/build/tip/index.js.map +1 -1
- package/build/tip/types.js +6 -0
- package/build/tip/types.js.map +1 -0
- package/build/toggle-control/index.js +1 -3
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-control/index.native.js +1 -7
- package/build/toggle-control/index.native.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build/toolbar/index.js.map +1 -1
- package/build/toolbar-group/index.js +3 -3
- package/build/toolbar-group/index.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build/tooltip/index.js +2 -1
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build/tree-select/index.js +59 -6
- package/build/tree-select/index.js.map +1 -1
- package/build/tree-select/types.js +6 -0
- package/build/tree-select/types.js.map +1 -0
- package/build/truncate/component.js +7 -8
- package/build/truncate/component.js.map +1 -1
- package/build/truncate/hook.js +3 -10
- package/build/truncate/hook.js.map +1 -1
- package/build/truncate/index.js.map +1 -1
- package/build/truncate/styles.js +1 -1
- package/build/truncate/styles.js.map +1 -1
- package/build/truncate/utils.js +3 -16
- package/build/truncate/utils.js.map +1 -1
- package/build/ui/form-group/form-group-content.js.map +1 -1
- package/build/ui/utils/get-valid-children.js.map +1 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/utils/math.js +17 -7
- package/build/utils/math.js.map +1 -1
- package/build/utils/unit-values.js.map +1 -1
- package/build/utils/values.js.map +1 -1
- package/build/v-stack/component.js +9 -9
- package/build/v-stack/component.js.map +1 -1
- package/build/v-stack/hook.js +0 -5
- package/build/v-stack/hook.js.map +1 -1
- package/build/v-stack/index.js.map +1 -1
- package/build/visually-hidden/component.js +12 -13
- package/build/visually-hidden/component.js.map +1 -1
- package/build/visually-hidden/index.js.map +1 -1
- package/build/visually-hidden/styles.js +3 -1
- package/build/visually-hidden/styles.js.map +1 -1
- package/build/visually-hidden/types.js +6 -0
- package/build/visually-hidden/types.js.map +1 -0
- package/build/z-stack/component.js +22 -3
- package/build/z-stack/component.js.map +1 -1
- package/build/z-stack/types.js +6 -0
- package/build/z-stack/types.js.map +1 -0
- package/build-module/alignment-matrix-control/index.js +2 -1
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js +1 -6
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/index.js +1 -1
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +4 -2
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.native.js +9 -3
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js +3 -2
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/autocomplete/index.js +7 -4
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +2 -1
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +2 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-box-control/utils.js.map +1 -1
- package/build-module/border-control/border-control/component.js +38 -3
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/box-control/all-input-control.js +3 -5
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/index.js +3 -6
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +3 -5
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/box-control/unit-control.js +3 -1
- package/build-module/box-control/unit-control.js.map +1 -1
- package/build-module/box-control/utils.js +4 -4
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/button/index.native.js +1 -2
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/color-indicator/index.js +29 -8
- package/build-module/color-indicator/index.js.map +1 -1
- package/build-module/color-indicator/types.js +2 -0
- package/build-module/color-indicator/types.js.map +1 -0
- package/build-module/color-palette/index.js +2 -1
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/component.js +7 -8
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/hex-input.js +4 -3
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/index.native.js +36 -35
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +4 -3
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/color-picker/styles.js +28 -31
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/color-picker/use-deprecated-props.js +22 -31
- package/build-module/color-picker/use-deprecated-props.js.map +1 -1
- package/build-module/combobox-control/index.js +18 -8
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/combobox-control/styles.js +27 -0
- package/build-module/combobox-control/styles.js.map +1 -0
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/custom-gradient-bar/constants.js +0 -1
- package/build-module/custom-gradient-bar/constants.js.map +1 -1
- package/build-module/custom-gradient-bar/control-points.js +16 -9
- package/build-module/custom-gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-bar/index.js +6 -6
- package/build-module/custom-gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-bar/utils.js +6 -8
- package/build-module/custom-gradient-bar/utils.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +8 -7
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.native.js +8 -8
- package/build-module/custom-gradient-picker/index.native.js.map +1 -1
- package/build-module/custom-gradient-picker/serializer.js +4 -6
- package/build-module/custom-gradient-picker/serializer.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/date-time/date/index.js +7 -4
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date-time/index.js +5 -2
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/dimension-control/index.js +1 -2
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/divider/styles.js +5 -5
- package/build-module/divider/styles.js.map +1 -1
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/draggable/index.native.js +6 -1
- package/build-module/draggable/index.native.js.map +1 -1
- package/build-module/drop-zone/provider.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-menu/index.js +16 -4
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +16 -4
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/duotone-picker/duotone-picker.js +42 -29
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/elevation/hook.js +13 -13
- package/build-module/elevation/hook.js.map +1 -1
- package/build-module/external-link/index.js +22 -8
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/external-link/styles/external-link-styles.js +3 -3
- package/build-module/external-link/styles/external-link-styles.js.map +1 -1
- package/build-module/external-link/types.js +2 -0
- package/build-module/external-link/types.js.map +1 -0
- package/build-module/flex/flex/hook.js +7 -5
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +3 -5
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/grid.js +2 -6
- package/build-module/focal-point-picker/grid.js.map +1 -1
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/index.native.js +9 -9
- package/build-module/focal-point-picker/index.native.js.map +1 -1
- package/build-module/focal-point-picker/media.js +3 -5
- package/build-module/focal-point-picker/media.js.map +1 -1
- package/build-module/focal-point-picker/tooltip/index.native.js +11 -12
- package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build-module/font-size-picker/index.js +1 -1
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/form-toggle/index.js +31 -7
- package/build-module/form-toggle/index.js.map +1 -1
- package/build-module/form-toggle/types.js +2 -0
- package/build-module/form-toggle/types.js.map +1 -0
- package/build-module/form-token-field/index.js +345 -363
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/styles.js +28 -0
- package/build-module/form-token-field/styles.js.map +1 -0
- package/build-module/form-token-field/suggestions-list.js +27 -23
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/form-token-field/token-input.js +43 -58
- package/build-module/form-token-field/token-input.js.map +1 -1
- package/build-module/form-token-field/token.js +3 -1
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/form-token-field/types.js +2 -0
- package/build-module/form-token-field/types.js.map +1 -0
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/grid/component.js +7 -8
- package/build-module/grid/component.js.map +1 -1
- package/build-module/grid/hook.js +1 -5
- package/build-module/grid/hook.js.map +1 -1
- package/build-module/grid/index.js.map +1 -1
- package/build-module/grid/utils.js +3 -8
- package/build-module/grid/utils.js.map +1 -1
- package/build-module/h-stack/component.js +3 -7
- package/build-module/h-stack/component.js.map +1 -1
- package/build-module/h-stack/hook.js +10 -12
- package/build-module/h-stack/hook.js.map +1 -1
- package/build-module/h-stack/index.js.map +1 -1
- package/build-module/h-stack/utils.js +8 -20
- package/build-module/h-stack/utils.js.map +1 -1
- package/build-module/heading/component.js +0 -1
- package/build-module/heading/component.js.map +1 -1
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/heading/types.js +2 -0
- package/build-module/heading/types.js.map +1 -0
- package/build-module/higher-order/navigate-regions/index.js.map +1 -1
- package/build-module/higher-order/with-focus-return/index.js.map +1 -1
- package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build-module/icon/index.js.map +1 -1
- package/build-module/input-control/index.js +2 -1
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-field.js +2 -1
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/utils.js +1 -1
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/menu-item/index.js +1 -2
- package/build-module/menu-item/index.js.map +1 -1
- package/build-module/menu-items-choice/index.js +3 -5
- package/build-module/menu-items-choice/index.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -6
- package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -1
- package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/focal-point-settings-panel/index.native.js +2 -2
- package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/html-text-input/index.native.js.map +1 -1
- package/build-module/mobile/image/index.native.js +3 -2
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/inserter-button/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +4 -3
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
- package/build-module/mobile/media-edit/index.native.js.map +1 -1
- package/build-module/mobile/segmented-control/index.native.js +3 -4
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/modal/index.js +20 -6
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigable-container/container.js +5 -2
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigation/context.js +3 -5
- package/build-module/navigation/context.js.map +1 -1
- package/build-module/navigation/group/index.js +3 -6
- package/build-module/navigation/group/index.js.map +1 -1
- package/build-module/navigation/index.js +7 -2
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/item/base.js +5 -2
- package/build-module/navigation/item/base.js.map +1 -1
- package/build-module/navigation/item/index.js +3 -1
- package/build-module/navigation/item/index.js.map +1 -1
- package/build-module/navigation/item/use-navigation-tree-item.js +2 -1
- package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +1 -6
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/search-no-results-found.js +1 -6
- package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
- package/build-module/navigation/use-navigation-tree-nodes.js +18 -9
- package/build-module/navigation/use-navigation-tree-nodes.js.map +1 -1
- package/build-module/navigation/utils.js +2 -2
- package/build-module/navigation/utils.js.map +1 -1
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +1 -1
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +1 -1
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/notice/index.js +2 -1
- package/build-module/notice/index.js.map +1 -1
- package/build-module/notice/list.js +4 -1
- package/build-module/notice/list.js.map +1 -1
- package/build-module/panel/body.js +3 -1
- package/build-module/panel/body.js.map +1 -1
- package/build-module/placeholder/index.js +24 -11
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/popover/index.js +4 -4
- package/build-module/popover/index.js.map +1 -1
- package/build-module/radio-control/index.js +40 -7
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-control/types.js +2 -0
- package/build-module/radio-control/types.js.map +1 -0
- package/build-module/range-control/index.js +57 -41
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/input-range.js +7 -11
- package/build-module/range-control/input-range.js.map +1 -1
- package/build-module/range-control/mark.js +5 -6
- package/build-module/range-control/mark.js.map +1 -1
- package/build-module/range-control/rail.js +10 -15
- package/build-module/range-control/rail.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +62 -64
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/range-control/tooltip.js +5 -6
- package/build-module/range-control/tooltip.js.map +1 -1
- package/build-module/range-control/types.js +2 -0
- package/build-module/range-control/types.js.map +1 -0
- package/build-module/range-control/utils.js +24 -32
- package/build-module/range-control/utils.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +2 -1
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js +5 -11
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/responsive-wrapper/index.js.map +1 -1
- package/build-module/scrollable/component.js +7 -8
- package/build-module/scrollable/component.js.map +1 -1
- package/build-module/scrollable/hook.js +0 -8
- package/build-module/scrollable/hook.js.map +1 -1
- package/build-module/scrollable/index.js.map +1 -1
- package/build-module/scrollable/styles.js +7 -7
- package/build-module/scrollable/styles.js.map +1 -1
- package/build-module/select-control/index.js +3 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/shortcut/index.js +2 -7
- package/build-module/shortcut/index.js.map +1 -1
- package/build-module/slot-fill/fill.js +1 -6
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/slot-fill/index.native.js +6 -7
- package/build-module/slot-fill/index.native.js.map +1 -1
- package/build-module/slot-fill/provider.js +4 -7
- package/build-module/slot-fill/provider.js.map +1 -1
- package/build-module/slot-fill/slot.js +15 -8
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/snackbar/index.js +3 -1
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +4 -1
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/spacer/component.js +3 -4
- package/build-module/spacer/component.js.map +1 -1
- package/build-module/spacer/hook.js +2 -2
- package/build-module/spacer/hook.js.map +1 -1
- package/build-module/spacer/index.js.map +1 -1
- package/build-module/spinner/index.js +22 -13
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/spinner/styles.js +10 -10
- package/build-module/spinner/styles.js.map +1 -1
- package/build-module/tab-panel/index.js +3 -1
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/text/hook.js +4 -4
- package/build-module/text/hook.js.map +1 -1
- package/build-module/text/utils.js.map +1 -1
- package/build-module/text-highlight/index.js +23 -6
- package/build-module/text-highlight/index.js.map +1 -1
- package/build-module/text-highlight/types.js +2 -0
- package/build-module/text-highlight/types.js.map +1 -0
- package/build-module/tip/index.js +6 -10
- package/build-module/tip/index.js.map +1 -1
- package/build-module/tip/types.js +2 -0
- package/build-module/tip/types.js.map +1 -0
- package/build-module/toggle-control/index.js +1 -2
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/toggle-control/index.native.js +1 -6
- package/build-module/toggle-control/index.native.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build-module/toolbar/index.js.map +1 -1
- package/build-module/toolbar-group/index.js +3 -2
- package/build-module/toolbar-group/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build-module/tooltip/index.js +2 -1
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build-module/tree-select/index.js +56 -6
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/tree-select/types.js +2 -0
- package/build-module/tree-select/types.js.map +1 -0
- package/build-module/truncate/component.js +7 -8
- package/build-module/truncate/component.js.map +1 -1
- package/build-module/truncate/hook.js +3 -10
- package/build-module/truncate/hook.js.map +1 -1
- package/build-module/truncate/index.js.map +1 -1
- package/build-module/truncate/styles.js +1 -1
- package/build-module/truncate/styles.js.map +1 -1
- package/build-module/truncate/utils.js +3 -16
- package/build-module/truncate/utils.js.map +1 -1
- package/build-module/ui/form-group/form-group-content.js.map +1 -1
- package/build-module/ui/utils/get-valid-children.js.map +1 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/utils/math.js +15 -6
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/unit-values.js.map +1 -1
- package/build-module/utils/values.js.map +1 -1
- package/build-module/v-stack/component.js +9 -9
- package/build-module/v-stack/component.js.map +1 -1
- package/build-module/v-stack/hook.js +0 -5
- package/build-module/v-stack/hook.js.map +1 -1
- package/build-module/v-stack/index.js.map +1 -1
- package/build-module/visually-hidden/component.js +12 -13
- package/build-module/visually-hidden/component.js.map +1 -1
- package/build-module/visually-hidden/index.js.map +1 -1
- package/build-module/visually-hidden/styles.js +3 -1
- package/build-module/visually-hidden/styles.js.map +1 -1
- package/build-module/visually-hidden/types.js +2 -0
- package/build-module/visually-hidden/types.js.map +1 -0
- package/build-module/z-stack/component.js +21 -2
- package/build-module/z-stack/component.js.map +1 -1
- package/build-module/z-stack/types.js +2 -0
- package/build-module/z-stack/types.js.map +1 -0
- package/build-style/style-rtl.css +61 -22
- package/build-style/style.css +61 -23
- package/build-types/base-control/stories/index.d.ts.map +1 -1
- package/build-types/base-field/hook.d.ts +0 -1
- package/build-types/base-field/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +0 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +0 -1
- 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/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +0 -1
- 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 +0 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-box-control/utils.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +36 -2
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +1 -2
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +0 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/hook.d.ts +0 -1
- package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -1
- package/build-types/border-control/stories/index.d.ts +33 -0
- package/build-types/border-control/stories/index.d.ts.map +1 -0
- 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 +0 -1
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/card-body/hook.d.ts +0 -1
- package/build-types/card/card-body/hook.d.ts.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +0 -1
- package/build-types/card/card-divider/hook.d.ts.map +1 -1
- package/build-types/card/card-footer/hook.d.ts +0 -1
- package/build-types/card/card-footer/hook.d.ts.map +1 -1
- package/build-types/card/card-header/hook.d.ts +0 -1
- package/build-types/card/card-header/hook.d.ts.map +1 -1
- package/build-types/card/card-media/hook.d.ts +0 -1
- package/build-types/card/card-media/hook.d.ts.map +1 -1
- package/build-types/checkbox-control/index.d.ts.map +1 -1
- package/build-types/checkbox-control/stories/index.d.ts.map +1 -1
- package/build-types/color-indicator/index.d.ts +16 -5
- package/build-types/color-indicator/index.d.ts.map +1 -1
- package/build-types/color-indicator/stories/index.d.ts +12 -0
- package/build-types/color-indicator/stories/index.d.ts.map +1 -0
- package/build-types/color-indicator/test/index.d.ts +2 -0
- package/build-types/color-indicator/test/index.d.ts.map +1 -0
- package/build-types/color-indicator/types.d.ts +12 -0
- package/build-types/color-indicator/types.d.ts.map +1 -0
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +4 -2
- package/build-types/color-palette/styles.d.ts.map +1 -1
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/hex-input.d.ts.map +1 -1
- package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +48 -32
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
- package/build-types/confirm-dialog/component.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-time/index.d.ts.map +1 -1
- package/build-types/date-time/stories/date-time.d.ts.map +1 -1
- package/build-types/date-time/stories/date.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +1 -1
- package/build-types/date-time/types.d.ts +6 -0
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/divider/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +0 -1
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/external-link/index.d.ts +17 -0
- package/build-types/external-link/index.d.ts.map +1 -0
- package/build-types/external-link/stories/index.d.ts +12 -0
- package/build-types/external-link/stories/index.d.ts.map +1 -0
- package/build-types/external-link/styles/external-link-styles.d.ts +10 -0
- package/build-types/external-link/styles/external-link-styles.d.ts.map +1 -0
- package/build-types/external-link/types.d.ts +15 -0
- package/build-types/external-link/types.d.ts.map +1 -0
- package/build-types/flex/flex/hook.d.ts +0 -1
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/flex-block/hook.d.ts +0 -1
- package/build-types/flex/flex-block/hook.d.ts.map +1 -1
- package/build-types/flex/flex-item/hook.d.ts +0 -1
- package/build-types/flex/flex-item/hook.d.ts.map +1 -1
- package/build-types/form-toggle/index.d.ts +29 -0
- package/build-types/form-toggle/index.d.ts.map +1 -0
- package/build-types/form-toggle/stories/index.d.ts +12 -0
- package/build-types/form-toggle/stories/index.d.ts.map +1 -0
- package/build-types/form-toggle/test/index.d.ts +2 -0
- package/build-types/form-toggle/test/index.d.ts.map +1 -0
- package/build-types/form-toggle/types.d.ts +22 -0
- package/build-types/form-toggle/types.d.ts.map +1 -0
- package/build-types/form-token-field/index.d.ts +15 -0
- package/build-types/form-token-field/index.d.ts.map +1 -0
- package/build-types/form-token-field/stories/index.d.ts +13 -0
- package/build-types/form-token-field/stories/index.d.ts.map +1 -0
- package/build-types/form-token-field/styles.d.ts +14 -0
- package/build-types/form-token-field/styles.d.ts.map +1 -0
- package/build-types/form-token-field/suggestions-list.d.ts +10 -0
- package/build-types/form-token-field/suggestions-list.d.ts.map +1 -0
- package/build-types/form-token-field/test/lib/fixtures.d.ts +26 -0
- package/build-types/form-token-field/test/lib/fixtures.d.ts.map +1 -0
- package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +21 -0
- package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +1 -0
- package/build-types/form-token-field/token-input.d.ts +12 -0
- package/build-types/form-token-field/token-input.d.ts.map +1 -0
- package/build-types/form-token-field/token.d.ts +4 -0
- package/build-types/form-token-field/token.d.ts.map +1 -0
- package/build-types/form-token-field/types.d.ts +183 -0
- package/build-types/form-token-field/types.d.ts.map +1 -0
- package/build-types/grid/component.d.ts +3 -3
- package/build-types/grid/component.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +5 -3
- package/build-types/grid/hook.d.ts.map +1 -1
- package/build-types/grid/index.d.ts +2 -2
- package/build-types/grid/index.d.ts.map +1 -1
- package/build-types/grid/stories/index.d.ts +9 -0
- package/build-types/grid/stories/index.d.ts.map +1 -0
- package/build-types/grid/test/grid.d.ts +2 -0
- package/build-types/grid/test/grid.d.ts.map +1 -0
- package/build-types/grid/types.d.ts +16 -15
- package/build-types/grid/types.d.ts.map +1 -1
- package/build-types/grid/utils.d.ts +50 -69
- package/build-types/grid/utils.d.ts.map +1 -1
- package/build-types/h-stack/component.d.ts +3 -2
- package/build-types/h-stack/component.d.ts.map +1 -1
- package/build-types/h-stack/hook.d.ts +5 -4
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/h-stack/index.d.ts +2 -2
- package/build-types/h-stack/index.d.ts.map +1 -1
- package/build-types/h-stack/stories/index.d.ts +9 -0
- package/build-types/h-stack/stories/index.d.ts.map +1 -0
- package/build-types/h-stack/test/index.d.ts +2 -0
- package/build-types/h-stack/test/index.d.ts.map +1 -0
- package/build-types/h-stack/utils.d.ts +8 -4
- package/build-types/h-stack/utils.d.ts.map +1 -1
- package/build-types/heading/component.d.ts +1 -2
- package/build-types/heading/component.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts +1 -29
- package/build-types/heading/hook.d.ts.map +1 -1
- package/build-types/heading/stories/index.d.ts.map +1 -1
- package/build-types/heading/test/index.d.ts +2 -0
- package/build-types/heading/test/index.d.ts.map +1 -0
- package/build-types/heading/types.d.ts +16 -0
- package/build-types/heading/types.d.ts.map +1 -0
- package/build-types/higher-order/with-focus-outside/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/index.d.ts +1 -1
- package/build-types/input-control/index.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/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/stories/index.d.ts +5 -5
- package/build-types/input-control/stories/index.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +0 -1
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/hook.d.ts +0 -1
- package/build-types/item-group/item-group/hook.d.ts.map +1 -1
- package/build-types/menu-item/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +0 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +0 -1
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/radio-control/index.d.ts +31 -0
- package/build-types/radio-control/index.d.ts.map +1 -0
- package/build-types/radio-control/stories/index.d.ts +12 -0
- package/build-types/radio-control/stories/index.d.ts.map +1 -0
- package/build-types/radio-control/types.d.ts +29 -0
- package/build-types/radio-control/types.d.ts.map +1 -0
- package/build-types/range-control/index.d.ts +54 -29
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/input-range.d.ts +7 -10
- package/build-types/range-control/input-range.d.ts.map +1 -1
- package/build-types/range-control/mark.d.ts +4 -7
- package/build-types/range-control/mark.d.ts.map +1 -1
- package/build-types/range-control/rail.d.ts +4 -9
- package/build-types/range-control/rail.d.ts.map +1 -1
- package/build-types/range-control/stories/index.d.ts +48 -0
- package/build-types/range-control/stories/index.d.ts.map +1 -0
- package/build-types/range-control/styles/range-control-styles.d.ts +32 -40
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/range-control/test/index.d.ts +2 -0
- package/build-types/range-control/test/index.d.ts.map +1 -0
- package/build-types/range-control/tooltip.d.ts +4 -11
- package/build-types/range-control/tooltip.d.ts.map +1 -1
- package/build-types/range-control/types.d.ts +302 -0
- package/build-types/range-control/types.d.ts.map +1 -0
- package/build-types/range-control/utils.d.ts +15 -33
- package/build-types/range-control/utils.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
- package/build-types/scrollable/component.d.ts +3 -3
- package/build-types/scrollable/component.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +5 -3
- package/build-types/scrollable/hook.d.ts.map +1 -1
- package/build-types/scrollable/index.d.ts +2 -2
- package/build-types/scrollable/index.d.ts.map +1 -1
- package/build-types/scrollable/stories/index.d.ts +9 -0
- package/build-types/scrollable/stories/index.d.ts.map +1 -0
- package/build-types/scrollable/styles.d.ts +7 -7
- package/build-types/scrollable/styles.d.ts.map +1 -1
- package/build-types/scrollable/test/index.d.ts +2 -0
- package/build-types/scrollable/test/index.d.ts.map +1 -0
- package/build-types/scrollable/types.d.ts +9 -6
- package/build-types/scrollable/types.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +1 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.d.ts +3 -3
- package/build-types/select-control/stories/index.d.ts.map +1 -1
- package/build-types/shortcut/index.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/provider.d.ts.map +1 -1
- package/build-types/slot-fill/slot.d.ts.map +1 -1
- package/build-types/spacer/component.d.ts +3 -4
- package/build-types/spacer/component.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +2 -3
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/spacer/index.d.ts +1 -1
- package/build-types/spacer/index.d.ts.map +1 -1
- package/build-types/spacer/stories/index.d.ts +12 -0
- package/build-types/spacer/stories/index.d.ts.map +1 -0
- package/build-types/spacer/test/index.d.ts +2 -0
- package/build-types/spacer/test/index.d.ts.map +1 -0
- package/build-types/spacer/types.d.ts +41 -29
- package/build-types/spacer/types.d.ts.map +1 -1
- package/build-types/spinner/index.d.ts +16 -15
- package/build-types/spinner/index.d.ts.map +1 -1
- package/build-types/spinner/stories/index.d.ts +13 -0
- package/build-types/spinner/stories/index.d.ts.map +1 -0
- package/build-types/spinner/styles.d.ts +4 -3
- package/build-types/spinner/styles.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +0 -1
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +0 -1
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/text/types.d.ts +1 -1
- package/build-types/text/types.d.ts.map +1 -1
- package/build-types/text/utils.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +1 -1
- package/build-types/text-control/index.d.ts.map +1 -1
- package/build-types/text-control/stories/index.d.ts.map +1 -1
- package/build-types/text-highlight/index.d.ts +23 -0
- package/build-types/text-highlight/index.d.ts.map +1 -0
- package/build-types/text-highlight/stories/index.d.ts +12 -0
- package/build-types/text-highlight/stories/index.d.ts.map +1 -0
- package/build-types/text-highlight/test/index.d.ts +2 -0
- package/build-types/text-highlight/test/index.d.ts.map +1 -0
- package/build-types/text-highlight/types.d.ts +17 -0
- package/build-types/text-highlight/types.d.ts.map +1 -0
- package/build-types/tip/index.d.ts +5 -14
- package/build-types/tip/index.d.ts.map +1 -1
- package/build-types/tip/stories/index.d.ts +12 -0
- package/build-types/tip/stories/index.d.ts.map +1 -0
- package/build-types/tip/types.d.ts +11 -0
- package/build-types/tip/types.d.ts.map +1 -0
- package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +0 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +0 -1
- 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 +0 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts +53 -0
- package/build-types/tree-select/index.d.ts.map +1 -0
- package/build-types/tree-select/stories/index.d.ts +12 -0
- package/build-types/tree-select/stories/index.d.ts.map +1 -0
- package/build-types/tree-select/types.d.ts +30 -0
- package/build-types/tree-select/types.d.ts.map +1 -0
- package/build-types/truncate/component.d.ts +3 -3
- package/build-types/truncate/component.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +5 -3
- package/build-types/truncate/hook.d.ts.map +1 -1
- package/build-types/truncate/index.d.ts +2 -2
- package/build-types/truncate/index.d.ts.map +1 -1
- package/build-types/truncate/stories/index.d.ts +13 -0
- package/build-types/truncate/stories/index.d.ts.map +1 -0
- package/build-types/truncate/styles.d.ts +1 -1
- package/build-types/truncate/styles.d.ts.map +1 -1
- package/build-types/truncate/test/index.d.ts +2 -0
- package/build-types/truncate/test/index.d.ts.map +1 -0
- package/build-types/truncate/types.d.ts +22 -11
- package/build-types/truncate/types.d.ts.map +1 -1
- package/build-types/truncate/utils.d.ts +17 -28
- package/build-types/truncate/utils.d.ts.map +1 -1
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/ui/control-group/hook.d.ts +0 -1
- package/build-types/ui/control-group/hook.d.ts.map +1 -1
- package/build-types/ui/control-label/hook.d.ts +0 -1
- package/build-types/ui/control-label/hook.d.ts.map +1 -1
- package/build-types/ui/form-group/form-group.d.ts +1 -1
- package/build-types/ui/form-group/types.d.ts +1 -1
- package/build-types/ui/form-group/types.d.ts.map +1 -1
- package/build-types/ui/form-group/use-form-group.d.ts +5 -7
- package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
- package/build-types/ui/utils/get-valid-children.d.ts +2 -2
- package/build-types/ui/utils/get-valid-children.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/stories/index.d.ts.map +1 -1
- package/build-types/utils/math.d.ts +10 -0
- package/build-types/utils/math.d.ts.map +1 -1
- package/build-types/utils/unit-values.d.ts.map +1 -1
- package/build-types/utils/values.d.ts.map +1 -1
- package/build-types/v-stack/component.d.ts +5 -4
- package/build-types/v-stack/component.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +5 -4
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/build-types/v-stack/index.d.ts +2 -2
- package/build-types/v-stack/index.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.d.ts +9 -0
- package/build-types/v-stack/stories/index.d.ts.map +1 -0
- package/build-types/v-stack/test/index.d.ts +2 -0
- package/build-types/v-stack/test/index.d.ts.map +1 -0
- package/build-types/v-stack/types.d.ts +21 -1
- package/build-types/v-stack/types.d.ts.map +1 -1
- package/build-types/visually-hidden/component.d.ts +8 -10
- package/build-types/visually-hidden/component.d.ts.map +1 -1
- package/build-types/visually-hidden/index.d.ts +1 -1
- package/build-types/visually-hidden/index.d.ts.map +1 -1
- package/build-types/visually-hidden/stories/index.d.ts +14 -0
- package/build-types/visually-hidden/stories/index.d.ts.map +1 -0
- package/build-types/visually-hidden/styles.d.ts +5 -2
- package/build-types/visually-hidden/styles.d.ts.map +1 -1
- package/build-types/visually-hidden/test/index.d.ts +2 -0
- package/build-types/visually-hidden/test/index.d.ts.map +1 -0
- package/build-types/visually-hidden/types.d.ts +11 -0
- package/build-types/visually-hidden/types.d.ts.map +1 -0
- package/build-types/z-stack/component.d.ts +18 -28
- package/build-types/z-stack/component.d.ts.map +1 -1
- package/build-types/z-stack/stories/index.d.ts +6 -0
- package/build-types/z-stack/stories/index.d.ts.map +1 -0
- package/build-types/z-stack/types.d.ts +33 -0
- package/build-types/z-stack/types.d.ts.map +1 -0
- package/package.json +18 -17
- package/src/alignment-matrix-control/index.js +2 -1
- package/src/alignment-matrix-control/utils.js +1 -6
- package/src/angle-picker-control/index.js +1 -1
- package/src/autocomplete/autocompleter-ui.js +4 -1
- package/src/autocomplete/autocompleter-ui.native.js +8 -2
- package/src/autocomplete/get-default-use-items.js +3 -2
- package/src/autocomplete/index.js +7 -10
- package/src/base-control/stories/index.tsx +2 -3
- package/src/border-box-control/border-box-control/component.tsx +1 -0
- package/src/border-box-control/border-box-control-linked-button/component.tsx +2 -5
- package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -0
- package/src/border-box-control/utils.ts +5 -2
- package/src/border-control/border-control/component.tsx +41 -4
- package/src/border-control/border-control/hook.ts +3 -4
- package/src/border-control/stories/index.tsx +150 -0
- package/src/box-control/all-input-control.js +2 -4
- package/src/box-control/axial-input-controls.js +4 -6
- package/src/box-control/index.js +3 -6
- package/src/box-control/input-controls.js +33 -36
- package/src/box-control/unit-control.js +2 -1
- package/src/box-control/utils.js +4 -4
- package/src/button/README.md +1 -1
- package/src/button/index.native.js +1 -2
- package/src/card/stories/index.js +10 -5
- package/src/checkbox-control/index.tsx +2 -3
- package/src/checkbox-control/stories/index.tsx +2 -3
- package/src/checkbox-control/test/index.tsx +2 -1
- package/src/color-indicator/README.md +7 -9
- package/src/color-indicator/index.tsx +47 -0
- package/src/color-indicator/stories/index.tsx +37 -0
- package/src/color-indicator/test/__snapshots__/index.tsx.snap +11 -0
- package/src/color-indicator/test/{index.js → index.tsx} +4 -4
- package/src/color-indicator/types.ts +12 -0
- package/src/color-palette/index.js +5 -1
- package/src/color-picker/component.tsx +12 -11
- package/src/color-picker/hex-input.tsx +3 -2
- package/src/color-picker/index.native.js +27 -31
- package/src/color-picker/input-with-slider.tsx +4 -2
- package/src/color-picker/styles.ts +20 -6
- package/src/color-picker/use-deprecated-props.ts +24 -43
- package/src/combobox-control/index.js +18 -8
- package/src/combobox-control/stories/index.js +3 -2
- package/src/combobox-control/style.scss +1 -1
- package/src/combobox-control/styles.ts +27 -0
- package/src/confirm-dialog/component.tsx +7 -8
- package/src/custom-gradient-bar/constants.js +2 -2
- package/src/custom-gradient-bar/control-points.js +20 -16
- package/src/custom-gradient-bar/index.js +11 -11
- package/src/custom-gradient-bar/test/utils.js +79 -0
- package/src/custom-gradient-bar/utils.js +6 -18
- package/src/custom-gradient-picker/index.js +4 -11
- package/src/custom-gradient-picker/index.native.js +3 -11
- package/src/custom-gradient-picker/serializer.js +5 -11
- package/src/custom-gradient-picker/style.scss +1 -3
- package/src/custom-gradient-picker/utils.js +4 -3
- package/src/custom-select-control/index.js +2 -1
- package/src/custom-select-control/stories/index.js +1 -2
- package/src/date-time/README.md +7 -0
- package/src/date-time/date/index.tsx +4 -2
- package/src/date-time/date/style.scss +10 -0
- package/src/date-time/date/test/index.tsx +1 -1
- package/src/date-time/date-time/index.tsx +8 -8
- package/src/date-time/stories/date-time.tsx +4 -6
- package/src/date-time/stories/date.tsx +2 -3
- package/src/date-time/time/test/index.tsx +12 -12
- package/src/date-time/types.ts +7 -0
- package/src/dimension-control/README.md +5 -2
- package/src/dimension-control/index.js +1 -2
- package/src/dimension-control/test/index.test.js +7 -7
- package/src/divider/styles.ts +2 -3
- package/src/draggable/index.js +3 -3
- package/src/draggable/index.native.js +12 -4
- package/src/drop-zone/provider.js +1 -2
- package/src/dropdown/index.js +2 -2
- package/src/dropdown-menu/index.js +13 -4
- package/src/dropdown-menu/index.native.js +13 -5
- package/src/duotone-picker/duotone-picker.js +58 -37
- package/src/duotone-picker/style.scss +19 -0
- package/src/elevation/hook.js +11 -11
- package/src/external-link/README.md +18 -0
- package/src/external-link/{index.js → index.tsx} +35 -9
- package/src/external-link/stories/index.tsx +36 -0
- package/src/external-link/styles/{external-link-styles.js → external-link-styles.ts} +0 -0
- package/src/external-link/types.ts +15 -0
- package/src/flex/flex/README.md +5 -10
- package/src/flex/flex/hook.js +4 -1
- package/src/flex/flex-item/README.md +1 -1
- package/src/focal-point-picker/controls.js +1 -5
- package/src/focal-point-picker/grid.js +2 -5
- package/src/focal-point-picker/index.js +2 -8
- package/src/focal-point-picker/index.native.js +9 -9
- package/src/focal-point-picker/media.js +2 -5
- package/src/focal-point-picker/tooltip/index.native.js +10 -11
- package/src/font-size-picker/index.js +3 -1
- package/src/form-toggle/README.md +10 -11
- package/src/form-toggle/index.tsx +71 -0
- package/src/form-toggle/stories/index.tsx +52 -0
- package/src/form-toggle/test/__snapshots__/index.tsx.snap +54 -0
- package/src/form-toggle/test/index.tsx +102 -0
- package/src/form-toggle/types.ts +22 -0
- package/src/form-token-field/index.tsx +715 -0
- package/src/form-token-field/stories/index.tsx +103 -0
- package/src/form-token-field/style.scss +4 -8
- package/src/form-token-field/styles.ts +32 -0
- package/src/form-token-field/{suggestions-list.js → suggestions-list.tsx} +43 -29
- package/src/form-token-field/test/index.js +70 -40
- package/src/form-token-field/test/lib/token-field-wrapper.tsx +71 -0
- package/src/form-token-field/token-input.tsx +76 -0
- package/src/form-token-field/{token.js → token.tsx} +4 -2
- package/src/form-token-field/types.ts +185 -0
- package/src/gradient-picker/index.js +4 -3
- package/src/grid/README.md +33 -19
- package/src/grid/{component.js → component.tsx} +13 -9
- package/src/grid/{hook.js → hook.ts} +5 -5
- package/src/grid/{index.js → index.ts} +0 -0
- package/src/grid/stories/index.tsx +72 -0
- package/src/grid/test/{grid.js → grid.tsx} +4 -4
- package/src/grid/types.ts +16 -17
- package/src/grid/{utils.js → utils.ts} +9 -7
- package/src/guide/style.scss +1 -0
- package/src/h-stack/{component.js → component.tsx} +8 -8
- package/src/h-stack/{hook.js → hook.tsx} +21 -16
- package/src/h-stack/{index.js → index.ts} +0 -0
- package/src/h-stack/stories/index.tsx +92 -0
- package/src/h-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/h-stack/test/{index.js → index.tsx} +0 -0
- package/src/h-stack/{utils.js → utils.ts} +16 -16
- package/src/heading/README.md +4 -3
- package/src/heading/component.tsx +2 -2
- package/src/heading/hook.ts +6 -46
- package/src/heading/stories/index.tsx +5 -1
- package/src/heading/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/heading/test/index.tsx +68 -0
- package/src/heading/types.ts +29 -0
- package/src/higher-order/navigate-regions/README.md +4 -1
- package/src/higher-order/navigate-regions/index.js +7 -5
- package/src/higher-order/with-filters/test/index.js +43 -36
- package/src/higher-order/with-focus-return/index.js +14 -13
- package/src/higher-order/with-spoken-messages/index.js +8 -7
- package/src/higher-order/with-spoken-messages/test/index.js +1 -1
- package/src/icon/index.tsx +3 -3
- package/src/input-control/index.tsx +2 -1
- package/src/input-control/input-field.tsx +2 -1
- package/src/input-control/reducer/reducer.ts +23 -21
- package/src/input-control/test/index.js +106 -31
- package/src/input-control/utils.ts +1 -1
- package/src/item-group/stories/index.js +2 -1
- package/src/menu-item/index.js +1 -2
- package/src/menu-item/test/index.js +2 -1
- package/src/menu-items-choice/index.js +2 -5
- package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +2 -4
- package/src/mobile/bottom-sheet/cell.native.js +2 -3
- package/src/mobile/bottom-sheet/cycle-picker-cell.native.js +3 -5
- package/src/mobile/bottom-sheet/index.native.js +14 -17
- package/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js +2 -7
- package/src/mobile/bottom-sheet/picker-cell.native.js +2 -7
- package/src/mobile/bottom-sheet/stepper-cell/index.native.js +4 -6
- package/src/mobile/color-settings/index.native.js +2 -4
- package/src/mobile/focal-point-settings-panel/index.native.js +2 -2
- package/src/mobile/global-styles-context/index.native.js +8 -7
- package/src/mobile/gradient/index.native.js +12 -9
- package/src/mobile/gradient/test/index.native.js +1 -3
- package/src/mobile/html-text-input/index.native.js +2 -3
- package/src/mobile/image/index.native.js +3 -2
- package/src/mobile/inserter-button/index.native.js +2 -6
- package/src/mobile/link-picker/index.native.js +2 -3
- package/src/mobile/link-settings/image-link-destinations-screen.native.js +6 -2
- package/src/mobile/media-edit/index.native.js +2 -3
- package/src/mobile/segmented-control/index.native.js +9 -9
- package/src/mobile/utils/test/index.native.js +3 -12
- package/src/modal/index.js +22 -3
- package/src/modal/stories/index.js +17 -1
- package/src/modal/style.scss +9 -18
- package/src/navigable-container/container.js +3 -2
- package/src/navigable-container/test/menu.js +1 -2
- package/src/navigable-container/test/tabbable.js +1 -2
- package/src/navigation/context.js +2 -5
- package/src/navigation/group/index.js +8 -3
- package/src/navigation/index.js +5 -1
- package/src/navigation/item/base.js +5 -3
- package/src/navigation/item/index.js +2 -1
- package/src/navigation/item/use-navigation-tree-item.js +2 -0
- package/src/navigation/menu/menu-title-search.js +3 -6
- package/src/navigation/menu/search-no-results-found.js +3 -6
- package/src/navigation/stories/controlled-state.js +1 -1
- package/src/navigation/stories/more-examples.js +2 -3
- package/src/navigation/test/index.js +252 -52
- package/src/navigation/use-navigation-tree-nodes.js +11 -10
- package/src/navigation/utils.js +2 -2
- package/src/navigator/navigator-back-button/hook.ts +14 -12
- package/src/navigator/navigator-button/hook.ts +14 -13
- package/src/navigator/navigator-provider/component.tsx +2 -6
- package/src/navigator/navigator-screen/component.tsx +3 -3
- package/src/notice/index.js +2 -1
- package/src/notice/list.js +3 -1
- package/src/number-control/stories/index.js +24 -24
- package/src/panel/body.js +2 -1
- package/src/placeholder/README.md +7 -6
- package/src/placeholder/index.js +27 -10
- package/src/placeholder/style.scss +23 -0
- package/src/popover/README.md +2 -2
- package/src/popover/index.js +7 -4
- package/src/radio-control/README.md +17 -23
- package/src/radio-control/index.tsx +107 -0
- package/src/radio-control/stories/index.tsx +72 -0
- package/src/radio-control/types.ts +32 -0
- package/src/range-control/README.md +107 -79
- package/src/range-control/{index.js → index.tsx} +81 -49
- package/src/range-control/{input-range.js → input-range.tsx} +13 -12
- package/src/range-control/{mark.js → mark.tsx} +15 -9
- package/src/range-control/{rail.js → rail.tsx} +40 -23
- package/src/range-control/stories/index.tsx +244 -0
- package/src/range-control/styles/{range-control-styles.js → range-control-styles.ts} +28 -24
- package/src/range-control/test/index.tsx +311 -0
- package/src/range-control/{tooltip.js → tooltip.tsx} +19 -14
- package/src/range-control/types.ts +326 -0
- package/src/range-control/utils.ts +132 -0
- package/src/resizable-box/resize-tooltip/index.tsx +2 -1
- package/src/resizable-box/resize-tooltip/utils.ts +3 -8
- package/src/responsive-wrapper/index.js +2 -4
- package/src/sandbox/test/index.js +4 -6
- package/src/scrollable/README.md +14 -8
- package/src/scrollable/{component.js → component.tsx} +13 -10
- package/src/scrollable/{hook.js → hook.ts} +5 -7
- package/src/scrollable/{index.js → index.ts} +0 -0
- package/src/scrollable/stories/{index.js → index.tsx} +29 -34
- package/src/scrollable/{styles.js → styles.ts} +0 -0
- package/src/scrollable/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
- package/src/scrollable/test/index.tsx +34 -0
- package/src/scrollable/types.ts +10 -5
- package/src/select-control/index.tsx +3 -1
- package/src/select-control/stories/index.tsx +3 -4
- package/src/select-control/test/select-control.tsx +22 -15
- package/src/shortcut/index.js +2 -7
- package/src/slot-fill/fill.js +1 -5
- package/src/slot-fill/index.native.js +2 -7
- package/src/slot-fill/provider.js +3 -7
- package/src/slot-fill/slot.js +31 -24
- package/src/slot-fill/test/slot.js +2 -3
- package/src/snackbar/index.js +1 -1
- package/src/snackbar/list.js +2 -1
- package/src/spacer/README.md +43 -37
- package/src/spacer/component.tsx +5 -6
- package/src/spacer/hook.ts +4 -2
- package/src/spacer/index.ts +1 -1
- package/src/spacer/stories/index.tsx +70 -0
- package/src/spacer/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
- package/src/spacer/test/index.tsx +149 -0
- package/src/spacer/types.ts +41 -29
- package/src/spinner/{index.js → index.tsx} +23 -9
- package/src/spinner/stories/index.tsx +32 -0
- package/src/spinner/{styles.js → styles.ts} +0 -0
- package/src/style.scss +1 -0
- package/src/tab-panel/README.md +1 -1
- package/src/tab-panel/index.js +3 -1
- package/src/text/hook.js +4 -1
- package/src/text/types.ts +1 -1
- package/src/text/utils.js +2 -3
- package/src/text-control/stories/index.tsx +4 -6
- package/src/text-highlight/README.md +6 -6
- package/src/text-highlight/index.tsx +49 -0
- package/src/text-highlight/stories/index.tsx +33 -0
- package/src/text-highlight/test/index.tsx +93 -0
- package/src/text-highlight/types.ts +16 -0
- package/src/tip/index.tsx +22 -0
- package/src/tip/stories/index.tsx +33 -0
- package/src/tip/types.ts +11 -0
- package/src/toggle-control/index.js +1 -2
- package/src/toggle-control/index.native.js +2 -6
- package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +2 -4
- package/src/toolbar/index.js +1 -2
- package/src/toolbar-group/index.js +1 -2
- package/src/tools-panel/tools-panel/hook.ts +2 -4
- package/src/tools-panel/tools-panel-header/hook.ts +2 -5
- package/src/tooltip/index.js +1 -0
- package/src/tree-grid/roving-tab-index-item.js +2 -4
- package/src/tree-grid/test/index.js +2 -3
- package/src/tree-select/README.md +2 -2
- package/src/tree-select/index.tsx +99 -0
- package/src/tree-select/stories/index.tsx +80 -0
- package/src/tree-select/types.ts +35 -0
- package/src/truncate/README.md +16 -12
- package/src/truncate/{component.js → component.tsx} +13 -9
- package/src/truncate/{hook.js → hook.ts} +8 -10
- package/src/truncate/{index.js → index.ts} +0 -0
- package/src/truncate/stories/index.tsx +49 -0
- package/src/truncate/{styles.js → styles.ts} +0 -0
- package/src/truncate/test/{index.js → index.tsx} +4 -4
- package/src/truncate/types.ts +28 -10
- package/src/truncate/{utils.js → utils.ts} +19 -19
- package/src/ui/context/wordpress-component.ts +4 -5
- package/src/ui/form-group/form-group-content.js +4 -4
- package/src/ui/form-group/types.ts +1 -1
- package/src/ui/utils/get-valid-children.ts +4 -2
- package/src/unit-control/index.tsx +7 -9
- package/src/unit-control/stories/index.tsx +8 -12
- package/src/unit-control/test/index.tsx +4 -7
- package/src/utils/hooks/stories/use-cx.js +8 -7
- package/src/utils/hooks/test/use-controlled-state.js +2 -1
- package/src/utils/math.js +14 -5
- package/src/utils/test/math.js +22 -1
- package/src/utils/unit-values.ts +2 -1
- package/src/utils/values.js +2 -3
- package/src/v-stack/README.md +6 -18
- package/src/v-stack/{component.js → component.tsx} +15 -10
- package/src/v-stack/{hook.js → hook.ts} +5 -6
- package/src/v-stack/{index.js → index.ts} +0 -0
- package/src/v-stack/stories/index.tsx +41 -0
- package/src/v-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/v-stack/test/{index.js → index.tsx} +0 -0
- package/src/v-stack/types.ts +21 -1
- package/src/visually-hidden/{component.js → component.tsx} +23 -15
- package/src/visually-hidden/{index.js → index.ts} +0 -0
- package/src/visually-hidden/stories/index.tsx +66 -0
- package/src/visually-hidden/{styles.js → styles.ts} +6 -2
- package/src/visually-hidden/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/visually-hidden/test/index.tsx +17 -0
- package/src/visually-hidden/types.ts +11 -0
- package/src/z-stack/README.md +14 -3
- package/src/z-stack/component.tsx +24 -29
- package/src/z-stack/stories/index.tsx +76 -0
- package/src/z-stack/types.ts +33 -0
- package/tsconfig.json +7 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/src/border-control/stories/index.js +0 -119
- package/src/color-indicator/index.js +0 -16
- package/src/color-indicator/stories/index.js +0 -22
- package/src/color-indicator/test/__snapshots__/index.js.snap +0 -13
- package/src/external-link/stories/index.js +0 -23
- package/src/form-toggle/index.js +0 -37
- package/src/form-toggle/stories/index.js +0 -28
- package/src/form-toggle/test/index.js +0 -75
- package/src/form-token-field/index.js +0 -725
- package/src/form-token-field/stories/index.js +0 -102
- package/src/form-token-field/test/lib/token-field-wrapper.js +0 -56
- package/src/form-token-field/token-input.js +0 -81
- package/src/grid/stories/index.js +0 -49
- package/src/h-stack/stories/index.js +0 -22
- package/src/heading/test/index.js +0 -67
- package/src/radio-control/index.js +0 -69
- package/src/radio-control/stories/index.js +0 -41
- package/src/range-control/stories/index.js +0 -180
- package/src/range-control/test/index.js +0 -320
- package/src/range-control/utils.js +0 -132
- package/src/scrollable/test/index.js +0 -31
- package/src/spacer/stories/index.js +0 -59
- package/src/spacer/test/index.js +0 -146
- package/src/spinner/stories/index.js +0 -43
- package/src/text-highlight/index.js +0 -28
- package/src/text-highlight/stories/index.js +0 -28
- package/src/text-highlight/test/index.js +0 -120
- package/src/tip/index.js +0 -24
- package/src/tip/stories/index.js +0 -26
- package/src/tree-select/index.js +0 -48
- package/src/tree-select/stories/index.js +0 -80
- package/src/truncate/stories/index.js +0 -38
- package/src/visually-hidden/stories/index.js +0 -42
- package/src/visually-hidden/test/index.js +0 -19
- package/src/z-stack/stories/index.js +0 -70
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"names":["animationEnterDelay","animationEnterDuration","animationExitDuration","animationExitDelay","NavigatorScreen","props","forwardedRef","children","className","path","otherProps","prefersReducedMotion","location","NavigatorContext","isMatch","wrapperRef","previousLocation","cx","classes","isInitialLocation","isInitial","isBack","current","elementToFocus","focusTargetSelector","querySelector","firstTabbable","focus","tabbable","find","mergedWrapperRef","animate","opacity","transition","delay","duration","ease","x","initial","exit","animatedProps","ConnectedNavigatorScreen"],"mappings":";;;;;;;;;AAYA;;;;AAPA;;AACA;;AAKA;;AAEA;;AAKA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;;;AAGA,MAAMA,mBAAmB,GAAG,CAA5B;AACA,MAAMC,sBAAsB,GAAG,IAA/B;AACA,MAAMC,qBAAqB,GAAG,IAA9B;AACA,MAAMC,kBAAkB,GAAG,CAA3B,C,CAEA;AACA;;;;;;;;;;;;AAMA,SAASC,eAAT,CAA0BC,KAA1B,EAAwCC,YAAxC,EAA4E;AAC3E,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,IAAvB;AAA6B,OAAGC;AAAhC,MAA+C,+BACpDL,KADoD,EAEpD,iBAFoD,CAArD;AAKA,QAAMM,oBAAoB,GAAG,gCAA7B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAe,yBAAYC,0BAAZ,CAArB;AACA,QAAMC,OAAO,GAAGF,QAAQ,CAACH,IAAT,KAAkB,iCAAiBA,IAAjB,CAAlC;AACA,QAAMM,UAAU,GAAG,qBAA0B,IAA1B,CAAnB;AAEA,QAAMC,gBAAgB,GAAG,0BAAaJ,QAAb,CAAzB;AAEA,QAAMK,EAAE,GAAG,mBAAX;AACA,QAAMC,OAAO,GAAG,sBACf,MACCD,EAAE,OAODT,SAPC,CAFY,EAWf,CAAEA,SAAF,EAAaS,EAAb,CAXe,CAAhB,CAd2E,CA4B3E;;AACA,QAAME,iBAAiB,GAAGP,QAAQ,CAACQ,SAAT,IAAsB,CAAER,QAAQ,CAACS,MAA3D;AACA,0BAAW,MAAM;AAChB;AACA;AACA;AACA;AACA,QAAKF,iBAAiB,IAAI,CAAEL,OAAvB,IAAkC,CAAEC,UAAU,CAACO,OAApD,EAA8D;AAC7D;AACA;;AAED,QAAIC,cAAkC,GAAG,IAAzC,CATgB,CAWhB;AACA;;AACA,QAAKX,QAAQ,CAACS,MAAT,IAAmBL,gBAAnB,aAAmBA,gBAAnB,eAAmBA,gBAAgB,CAAEQ,mBAA1C,EAAgE;AAC/DD,MAAAA,cAAc,GAAGR,UAAU,CAACO,OAAX,CAAmBG,aAAnB,CAChBT,gBAAgB,CAACQ,mBADD,CAAjB;AAGA,KAjBe,CAmBhB;AACA;;;AACA,QAAK,CAAED,cAAP,EAAwB;AACvB,YAAMG,aAAa,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"names":["animationEnterDelay","animationEnterDuration","animationExitDuration","animationExitDelay","NavigatorScreen","props","forwardedRef","children","className","path","otherProps","prefersReducedMotion","location","NavigatorContext","isMatch","wrapperRef","previousLocation","cx","classes","isInitialLocation","isInitial","isBack","current","elementToFocus","focusTargetSelector","querySelector","firstTabbable","focus","tabbable","find","mergedWrapperRef","animate","opacity","transition","delay","duration","ease","x","initial","exit","animatedProps","ConnectedNavigatorScreen"],"mappings":";;;;;;;;;AAYA;;;;AAPA;;AACA;;AAKA;;AAEA;;AAKA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;;;AAGA,MAAMA,mBAAmB,GAAG,CAA5B;AACA,MAAMC,sBAAsB,GAAG,IAA/B;AACA,MAAMC,qBAAqB,GAAG,IAA9B;AACA,MAAMC,kBAAkB,GAAG,CAA3B,C,CAEA;AACA;;;;;;;;;;;;AAMA,SAASC,eAAT,CAA0BC,KAA1B,EAAwCC,YAAxC,EAA4E;AAC3E,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,IAAvB;AAA6B,OAAGC;AAAhC,MAA+C,+BACpDL,KADoD,EAEpD,iBAFoD,CAArD;AAKA,QAAMM,oBAAoB,GAAG,gCAA7B;AACA,QA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IM8B,aAJN,GAMGjC,QANH,CADD;AAUA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMkC,wBAAwB,GAAG,6BAChCrC,eADgC,EAEhC,iBAFgC,CAAjC;eAKeqC,wB","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion, MotionProps } from 'framer-motion';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { useContext, useEffect, useMemo, useRef } from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseMergeRefs,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type { NavigatorScreenProps } from '../types';\n\nconst animationEnterDelay = 0;\nconst animationEnterDuration = 0.14;\nconst animationExitDuration = 0.14;\nconst animationExitDelay = 0;\n\n// Props specific to `framer-motion` can't be currently passed to `NavigatorScreen`,\n// as some of them would overlap with HTML props (e.g. `onAnimationStart`, ...)\ntype Props = Omit<\n\tWordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tkeyof MotionProps\n>;\n\nfunction NavigatorScreen( props: Props, forwardedRef: ForwardedRef< any > ) {\n\tconst { children, className, path, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'NavigatorScreen'\n\t);\n\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst { location } = useContext( NavigatorContext );\n\tconst isMatch = location.path === escapeAttribute( path );\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\n\tconst previousLocation = usePrevious( location );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tcss( {\n\t\t\t\t\t// Ensures horizontal overflow is visually accessible.\n\t\t\t\t\toverflowX: 'auto',\n\t\t\t\t\t// In case the root has a height, it should not be exceeded.\n\t\t\t\t\tmaxHeight: '100%',\n\t\t\t\t} ),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx ]\n\t);\n\n\t// Focus restoration\n\tconst isInitialLocation = location.isInitial && ! location.isBack;\n\tuseEffect( () => {\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\tif ( isInitialLocation || ! isMatch || ! wrapperRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( location.isBack && previousLocation?.focusTargetSelector ) {\n\t\t\telementToFocus = wrapperRef.current.querySelector(\n\t\t\t\tpreviousLocation.focusTargetSelector\n\t\t\t);\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst firstTabbable = (\n\t\t\t\tfocus.tabbable.find( wrapperRef.current ) as HTMLElement[]\n\t\t\t )[ 0 ];\n\n\t\t\telementToFocus = firstTabbable ?? wrapperRef.current;\n\t\t}\n\n\t\telementToFocus.focus();\n\t}, [ isInitialLocation, isMatch ] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\tif ( ! isMatch ) {\n\t\treturn null;\n\t}\n\n\tif ( prefersReducedMotion ) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tref={ mergedWrapperRef }\n\t\t\t\tclassName={ classes }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst animate = {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tdelay: animationEnterDelay,\n\t\t\tduration: animationEnterDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t\tx: 0,\n\t};\n\tconst initial = {\n\t\topacity: 0,\n\t\tx:\n\t\t\t( isRTL() && location.isBack ) || ( ! isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t};\n\tconst exit = {\n\t\tdelay: animationExitDelay,\n\t\topacity: 0,\n\t\tx:\n\t\t\t( ! isRTL() && location.isBack ) || ( isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t\ttransition: {\n\t\t\tduration: animationExitDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t};\n\n\tconst animatedProps = {\n\t\tanimate,\n\t\texit,\n\t\tinitial,\n\t};\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...otherProps }\n\t\t\t{ ...animatedProps }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n}\n\n/**\n * The `NavigatorScreen` component represents a single view/screen/panel and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorButton` and the `NavigatorBackButton` components (or the `useNavigator`\n * hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nconst ConnectedNavigatorScreen = contextConnect(\n\tNavigatorScreen,\n\t'NavigatorScreen'\n);\n\nexport default ConnectedNavigatorScreen;\n"]}
|
package/build/notice/index.js
CHANGED
|
@@ -9,8 +9,6 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
-
var _lodash = require("lodash");
|
|
13
|
-
|
|
14
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
13
|
|
|
16
14
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -34,7 +32,7 @@ var _ = require("../");
|
|
|
34
32
|
*/
|
|
35
33
|
|
|
36
34
|
/** @typedef {import('@wordpress/element').WPElement} WPElement */
|
|
37
|
-
|
|
35
|
+
const noop = () => {};
|
|
38
36
|
/**
|
|
39
37
|
* Custom hook which announces the message with the given politeness, if a
|
|
40
38
|
* valid message is provided.
|
|
@@ -42,6 +40,8 @@ var _ = require("../");
|
|
|
42
40
|
* @param {string|WPElement} [message] Message to announce.
|
|
43
41
|
* @param {'polite'|'assertive'} politeness Politeness to announce.
|
|
44
42
|
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
45
|
function useSpokenMessage(message, politeness) {
|
|
46
46
|
const spokenMessage = typeof message === 'string' ? message : (0, _element.renderToString)(message);
|
|
47
47
|
(0, _element.useEffect)(() => {
|
|
@@ -79,7 +79,7 @@ function Notice(_ref) {
|
|
|
79
79
|
status = 'info',
|
|
80
80
|
children,
|
|
81
81
|
spokenMessage = children,
|
|
82
|
-
onRemove =
|
|
82
|
+
onRemove = noop,
|
|
83
83
|
isDismissible = true,
|
|
84
84
|
actions = [],
|
|
85
85
|
politeness = getDefaultPoliteness(status),
|
|
@@ -87,7 +87,7 @@ function Notice(_ref) {
|
|
|
87
87
|
// onDismiss is a callback executed when the notice is dismissed.
|
|
88
88
|
// It is distinct from onRemove, which _looks_ like a callback but is
|
|
89
89
|
// actually the function to call to remove the notice from the UI.
|
|
90
|
-
onDismiss =
|
|
90
|
+
onDismiss = noop
|
|
91
91
|
} = _ref;
|
|
92
92
|
useSpokenMessage(spokenMessage, politeness);
|
|
93
93
|
const classes = (0, _classnames.default)(className, 'components-notice', 'is-' + status, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/notice/index.js"],"names":["useSpokenMessage","message","politeness","spokenMessage","getDefaultPoliteness","status","Notice","className","children","onRemove","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/notice/index.js"],"names":["noop","useSpokenMessage","message","politeness","spokenMessage","getDefaultPoliteness","status","Notice","className","children","onRemove","isDismissible","actions","__unstableHTML","onDismiss","classes","onDismissNotice","event","preventDefault","map","index","buttonCustomClasses","label","isPrimary","variant","noDefaultClasses","onClick","url","computedVariant","undefined","close"],"mappings":";;;;;;;;;AASA;;AANA;;AAKA;;AAEA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AAEA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,gBAAT,CAA2BC,OAA3B,EAAoCC,UAApC,EAAiD;AAChD,QAAMC,aAAa,GAClB,OAAOF,OAAP,KAAmB,QAAnB,GAA8BA,OAA9B,GAAwC,6BAAgBA,OAAhB,CADzC;AAGA,0BAAW,MAAM;AAChB,QAAKE,aAAL,EAAqB;AACpB,uBAAOA,aAAP,EAAsBD,UAAtB;AACA;AACD,GAJD,EAIG,CAAEC,aAAF,EAAiBD,UAAjB,CAJH;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASE,oBAAT,CAA+BC,MAA/B,EAAwC;AACvC,UAASA,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AAKCC,MAAAA,gBAAgB,GAAG,KALpB;AAMCC,MAAAA,OAND;AAOCC,MAAAA;AAPD,KAUI;AACJ,QAAIC,eAAe,GAAGJ,OAAtB;;AACA,QAAKA,OAAO,KAAK,SAAZ,IAAyB,CAAEC,gBAAhC,EAAmD;AAClDG,MAAAA,eAAe,GAAG,CAAED,GAAF,GAAQ,WAAR,GAAsB,MAAxC;AACA;;AACD,QACC,OAAOC,eAAP,KAA2B,WAA3B,IACAL,SAFD,EAGE;AACDK,MAAAA,eAAe,GAAG,SAAlB;AACA;;AAED,WACC,4BAAC,QAAD;AACC,MAAA,GAAG,EAAGR,KADP;AAEC,MAAA,IAAI,EAAGO,GAFR;AAGC,MAAA,OAAO,EAAGC,eAHX;AAIC,MAAA,OAAO,EAAGD,GAAG,GAAGE,SAAH,GAAeH,OAJ7B;AAKC,MAAA,SAAS,EAAG,yBACX,2BADW,EAEXL,mBAFW;AALb,OAUGC,KAVH,CADD;AAcA,GAtCA,CADH,CAFD,CADD,EA8CGX,aAAa,IACd,4BAAC,QAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,IAAI,EAAGmB,YAFR;AAGC,IAAA,KAAK,EAAG,cAAI,qBAAJ,CAHT;AAIC,IAAA,OAAO,EAAGd,eAJX;AAKC,IAAA,WAAW,EAAG;AALf,IA/CF,CADD;AA0DA;;eAEcT,M","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { RawHTML, useEffect, renderToString } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { Button } from '../';\n\n/** @typedef {import('@wordpress/element').WPElement} WPElement */\n\nconst noop = () => {};\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n *\n * @param {string|WPElement} [message] Message to announce.\n * @param {'polite'|'assertive'} politeness Politeness to announce.\n */\nfunction useSpokenMessage( message, politeness ) {\n\tconst spokenMessage =\n\t\ttypeof message === 'string' ? message : renderToString( message );\n\n\tuseEffect( () => {\n\t\tif ( spokenMessage ) {\n\t\t\tspeak( spokenMessage, politeness );\n\t\t}\n\t}, [ spokenMessage, politeness ] );\n}\n\n/**\n * Given a notice status, returns an assumed default politeness for the status.\n * Defaults to 'assertive'.\n *\n * @param {string} [status] Notice status.\n *\n * @return {'polite'|'assertive'} Notice politeness.\n */\nfunction getDefaultPoliteness( status ) {\n\tswitch ( status ) {\n\t\tcase 'success':\n\t\tcase 'warning':\n\t\tcase 'info':\n\t\t\treturn 'polite';\n\n\t\tcase 'error':\n\t\tdefault:\n\t\t\treturn 'assertive';\n\t}\n}\n\nfunction Notice( {\n\tclassName,\n\tstatus = 'info',\n\tchildren,\n\tspokenMessage = children,\n\tonRemove = noop,\n\tisDismissible = true,\n\tactions = [],\n\tpoliteness = getDefaultPoliteness( status ),\n\t__unstableHTML,\n\t// onDismiss is a callback executed when the notice is dismissed.\n\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t// actually the function to call to remove the notice from the UI.\n\tonDismiss = noop,\n} ) {\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\tconst classes = classnames(\n\t\tclassName,\n\t\t'components-notice',\n\t\t'is-' + status,\n\t\t{\n\t\t\t'is-dismissible': isDismissible,\n\t\t}\n\t);\n\n\tif ( __unstableHTML ) {\n\t\tchildren = <RawHTML>{ children }</RawHTML>;\n\t}\n\n\tconst onDismissNotice = ( event ) => {\n\t\tevent?.preventDefault?.();\n\t\tonDismiss();\n\t\tonRemove();\n\t};\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t<div className=\"components-notice__content\">\n\t\t\t\t{ children }\n\t\t\t\t<div className=\"components-notice__actions\">\n\t\t\t\t\t{ actions.map(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclassName: buttonCustomClasses,\n\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\tisPrimary,\n\t\t\t\t\t\t\t\tvariant,\n\t\t\t\t\t\t\t\tnoDefaultClasses = false,\n\t\t\t\t\t\t\t\tonClick,\n\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\tlet computedVariant = variant;\n\t\t\t\t\t\t\tif ( variant !== 'primary' && ! noDefaultClasses ) {\n\t\t\t\t\t\t\t\tcomputedVariant = ! url ? 'secondary' : 'link';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\ttypeof computedVariant === 'undefined' &&\n\t\t\t\t\t\t\t\tisPrimary\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcomputedVariant = 'primary';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\t\t\tvariant={ computedVariant }\n\t\t\t\t\t\t\t\t\tonClick={ url ? undefined : onClick }\n\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'components-notice__action',\n\t\t\t\t\t\t\t\t\t\tbuttonCustomClasses\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{ isDismissible && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"components-notice__dismiss\"\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tlabel={ __( 'Dismiss this notice' ) }\n\t\t\t\t\tonClick={ onDismissNotice }\n\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default Notice;\n"]}
|
package/build/notice/list.js
CHANGED
|
@@ -24,7 +24,7 @@ var _ = _interopRequireDefault(require("./"));
|
|
|
24
24
|
/**
|
|
25
25
|
* Internal dependencies
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
const noop = () => {};
|
|
28
28
|
/**
|
|
29
29
|
* Renders a list of notices.
|
|
30
30
|
*
|
|
@@ -36,10 +36,12 @@ var _ = _interopRequireDefault(require("./"));
|
|
|
36
36
|
*
|
|
37
37
|
* @return {Object} The rendered notices list.
|
|
38
38
|
*/
|
|
39
|
+
|
|
40
|
+
|
|
39
41
|
function NoticeList(_ref) {
|
|
40
42
|
let {
|
|
41
43
|
notices,
|
|
42
|
-
onRemove =
|
|
44
|
+
onRemove = noop,
|
|
43
45
|
className,
|
|
44
46
|
children
|
|
45
47
|
} = _ref;
|
package/build/notice/list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/notice/list.js"],"names":["NoticeList","notices","onRemove","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/notice/list.js"],"names":["noop","NoticeList","notices","onRemove","className","children","removeNotice","id","reverse","map","notice","content"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,UAAT,OAAyE;AAAA,MAApD;AAAEC,IAAAA,OAAF;AAAWC,IAAAA,QAAQ,GAAGH,IAAtB;AAA4BI,IAAAA,SAA5B;AAAuCC,IAAAA;AAAvC,GAAoD;;AACxE,QAAMC,YAAY,GAAKC,EAAF,IAAU,MAAMJ,QAAQ,CAAEI,EAAF,CAA7C;;AAEAH,EAAAA,SAAS,GAAG,yBAAY,wBAAZ,EAAsCA,SAAtC,CAAZ;AAEA,SACC;AAAK,IAAA,SAAS,EAAGA;AAAjB,KACGC,QADH,EAEG,CAAE,GAAGH,OAAL,EAAeM,OAAf,GAAyBC,GAAzB,CAAgCC,MAAF,IAC/B,4BAAC,SAAD,6BACM,kBAAMA,MAAN,EAAc,CAAE,SAAF,CAAd,CADN;AAEC,IAAA,GAAG,EAAGA,MAAM,CAACH,EAFd;AAGC,IAAA,QAAQ,EAAGD,YAAY,CAAEI,MAAM,CAACH,EAAT;AAHxB,MAKGG,MAAM,CAACC,OALV,CADC,CAFH,CADD;AAcA;;eAEcV,U","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { omit } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport Notice from './';\n\nconst noop = () => {};\n\n/**\n * Renders a list of notices.\n *\n * @param {Object} $0 Props passed to the component.\n * @param {Array} $0.notices Array of notices to render.\n * @param {Function} $0.onRemove Function called when a notice should be removed / dismissed.\n * @param {Object} $0.className Name of the class used by the component.\n * @param {Object} $0.children Array of children to be rendered inside the notice list.\n *\n * @return {Object} The rendered notices list.\n */\nfunction NoticeList( { notices, onRemove = noop, className, children } ) {\n\tconst removeNotice = ( id ) => () => onRemove( id );\n\n\tclassName = classnames( 'components-notice-list', className );\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t{ children }\n\t\t\t{ [ ...notices ].reverse().map( ( notice ) => (\n\t\t\t\t<Notice\n\t\t\t\t\t{ ...omit( notice, [ 'content' ] ) }\n\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\tonRemove={ removeNotice( notice.id ) }\n\t\t\t\t>\n\t\t\t\t\t{ notice.content }\n\t\t\t\t</Notice>\n\t\t\t) ) }\n\t\t</div>\n\t);\n}\n\nexport default NoticeList;\n"]}
|
package/build/panel/body.js
CHANGED
|
@@ -14,8 +14,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
14
14
|
|
|
15
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
16
|
|
|
17
|
-
var _lodash = require("lodash");
|
|
18
|
-
|
|
19
17
|
var _compose = require("@wordpress/compose");
|
|
20
18
|
|
|
21
19
|
var _icons = require("@wordpress/icons");
|
|
@@ -37,6 +35,8 @@ var _utils = require("../utils");
|
|
|
37
35
|
/**
|
|
38
36
|
* Internal dependencies
|
|
39
37
|
*/
|
|
38
|
+
const noop = () => {};
|
|
39
|
+
|
|
40
40
|
function PanelBody(_ref, ref) {
|
|
41
41
|
let {
|
|
42
42
|
buttonProps = {},
|
|
@@ -44,7 +44,7 @@ function PanelBody(_ref, ref) {
|
|
|
44
44
|
className,
|
|
45
45
|
icon,
|
|
46
46
|
initialOpen,
|
|
47
|
-
onToggle =
|
|
47
|
+
onToggle = noop,
|
|
48
48
|
opened,
|
|
49
49
|
title,
|
|
50
50
|
scrollAfterOpen = true
|
package/build/panel/body.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/panel/body.js"],"names":["PanelBody","ref","buttonProps","children","className","icon","initialOpen","onToggle","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/panel/body.js"],"names":["noop","PanelBody","ref","buttonProps","children","className","icon","initialOpen","onToggle","opened","title","scrollAfterOpen","isOpened","setIsOpened","initial","undefined","nodeRef","scrollBehavior","handleOnToggle","event","preventDefault","next","scrollAfterOpenRef","current","scrollIntoView","inline","block","behavior","classes","PanelBodyTitle","props","chevronUp","chevronDown","ForwardedComponent","displayName"],"mappings":";;;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAKA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEO,SAASC,SAAT,OAYNC,GAZM,EAaL;AAAA,MAZD;AACCC,IAAAA,WAAW,GAAG,EADf;AAECC,IAAAA,QAFD;AAGCC,IAAAA,SAHD;AAICC,IAAAA,IAJD;AAKCC,IAAAA,WALD;AAMCC,I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AAG,2BAAc,CAAEZ,OAAF,EAAWd,GAAX,CAAd;AAAjC,KACC,4BAAC,cAAD;AACC,IAAA,IAAI,EAAGI,IADR;AAEC,IAAA,QAAQ,EAAGM,QAFZ;AAGC,IAAA,OAAO,EAAGM,cAHX;AAIC,IAAA,KAAK,EAAGR;AAJT,KAKMP,WALN,EADD,EAQG,OAAOC,QAAP,KAAoB,UAApB,GACCA,QAAQ,CAAE;AAAEK,IAAAA,MAAM,EAAEG;AAAV,GAAF,CADT,GAECA,QAAQ,IAAIR,QAVhB,CADD;AAcA;;AAED,MAAMyB,cAAc,GAAG,yBACtB,QAAuC3B,GAAvC,KAAgD;AAAA,MAA9C;AAAEU,IAAAA,QAAF;AAAYN,IAAAA,IAAZ;AAAkBI,IAAAA,KAAlB;AAAyB,OAAGoB;AAA5B,GAA8C;AAC/C,MAAK,CAAEpB,KAAP,EAAe,OAAO,IAAP;AAEf,SACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACC,4BAAC,eAAD;AACC,IAAA,SAAS,EAAC,+BADX;AAEC,qBAAgBE,QAFjB;AAGC,IAAA,GAAG,EAAGV;AAHP,KAIM4B,KAJN,GAUC;AAAM,mBAAY;AAAlB,KACC,4BAAC,aAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,IAAI,EAAGlB,QAAQ,GAAGmB,gBAAH,GAAeC;AAF/B,IADD,CAVD,EAgBGtB,KAhBH,EAiBGJ,IAAI,IACL,4BAAC,aAAD;AACC,IAAA,IAAI,EAAGA,IADR;AAEC,IAAA,SAAS,EAAC,wBAFX;AAGC,IAAA,IAAI,EAAG;AAHR,IAlBF,CADD,CADD;AA6BA,CAjCqB,CAAvB;AAoCA,MAAM2B,kBAAkB,GAAG,yBAAYhC,SAAZ,CAA3B;AACAgC,kBAAkB,CAACC,WAAnB,GAAiC,WAAjC;eAEeD,kB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { chevronUp, chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\n\nconst noop = () => {};\n\nexport function PanelBody(\n\t{\n\t\tbuttonProps = {},\n\t\tchildren,\n\t\tclassName,\n\t\ticon,\n\t\tinitialOpen,\n\t\tonToggle = noop,\n\t\topened,\n\t\ttitle,\n\t\tscrollAfterOpen = true,\n\t},\n\tref\n) {\n\tconst [ isOpened, setIsOpened ] = useControlledState( opened, {\n\t\tinitial: initialOpen === undefined ? true : initialOpen,\n\t} );\n\tconst nodeRef = useRef();\n\n\t// Defaults to 'smooth' scrolling\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView\n\tconst scrollBehavior = useReducedMotion() ? 'auto' : 'smooth';\n\n\tconst handleOnToggle = ( event ) => {\n\t\tevent.preventDefault();\n\t\tconst next = ! isOpened;\n\t\tsetIsOpened( next );\n\t\tonToggle( next );\n\t};\n\n\t// Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.\n\tconst scrollAfterOpenRef = useRef();\n\tscrollAfterOpenRef.current = scrollAfterOpen;\n\t// Runs after initial render.\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\tisOpened &&\n\t\t\tscrollAfterOpenRef.current &&\n\t\t\tnodeRef.current?.scrollIntoView\n\t\t) {\n\t\t\t/*\n\t\t\t * Scrolls the content into view when visible.\n\t\t\t * This improves the UX when there are multiple stacking <PanelBody />\n\t\t\t * components in a scrollable container.\n\t\t\t */\n\t\t\tnodeRef.current.scrollIntoView( {\n\t\t\t\tinline: 'nearest',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tbehavior: scrollBehavior,\n\t\t\t} );\n\t\t}\n\t}, [ isOpened, scrollBehavior ] );\n\n\tconst classes = classnames( 'components-panel__body', className, {\n\t\t'is-opened': isOpened,\n\t} );\n\n\treturn (\n\t\t<div className={ classes } ref={ useMergeRefs( [ nodeRef, ref ] ) }>\n\t\t\t<PanelBodyTitle\n\t\t\t\ticon={ icon }\n\t\t\t\tisOpened={ isOpened }\n\t\t\t\tonClick={ handleOnToggle }\n\t\t\t\ttitle={ title }\n\t\t\t\t{ ...buttonProps }\n\t\t\t/>\n\t\t\t{ typeof children === 'function'\n\t\t\t\t? children( { opened: isOpened } )\n\t\t\t\t: isOpened && children }\n\t\t</div>\n\t);\n}\n\nconst PanelBodyTitle = forwardRef(\n\t( { isOpened, icon, title, ...props }, ref ) => {\n\t\tif ( ! title ) return null;\n\n\t\treturn (\n\t\t\t<h2 className=\"components-panel__body-title\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"components-panel__body-toggle\"\n\t\t\t\t\taria-expanded={ isOpened }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ /*\n\t\t\t\t\tFirefox + NVDA don't announce aria-expanded because the browser\n\t\t\t\t\trepaints the whole element, so this wrapping span hides that.\n\t\t\t\t*/ }\n\t\t\t\t\t<span aria-hidden=\"true\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-panel__arrow\"\n\t\t\t\t\t\t\ticon={ isOpened ? chevronUp : chevronDown }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ title }\n\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tclassName=\"components-panel__icon\"\n\t\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Button>\n\t\t\t</h2>\n\t\t);\n\t}\n);\n\nconst ForwardedComponent = forwardRef( PanelBody );\nForwardedComponent.displayName = 'PanelBody';\n\nexport default ForwardedComponent;\n"]}
|
|
@@ -15,6 +15,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
15
15
|
|
|
16
16
|
var _compose = require("@wordpress/compose");
|
|
17
17
|
|
|
18
|
+
var _primitives = require("@wordpress/primitives");
|
|
19
|
+
|
|
18
20
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
19
21
|
|
|
20
22
|
/**
|
|
@@ -28,22 +30,33 @@ var _icon = _interopRequireDefault(require("../icon"));
|
|
|
28
30
|
/**
|
|
29
31
|
* Internal dependencies
|
|
30
32
|
*/
|
|
31
|
-
|
|
33
|
+
const PlaceholderIllustration = (0, _element.createElement)(_primitives.SVG, {
|
|
34
|
+
className: "components-placeholder__illustration",
|
|
35
|
+
fill: "none",
|
|
36
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37
|
+
viewBox: "0 0 60 60",
|
|
38
|
+
preserveAspectRatio: "none"
|
|
39
|
+
}, (0, _element.createElement)(_primitives.Path, {
|
|
40
|
+
vectorEffect: "non-scaling-stroke",
|
|
41
|
+
d: "M60 60 0 0"
|
|
42
|
+
}));
|
|
32
43
|
/**
|
|
33
44
|
* Renders a placeholder. Normally used by blocks to render their empty state.
|
|
34
45
|
*
|
|
35
|
-
* @param {Object} props
|
|
36
|
-
* @param {WPIcon} props.icon
|
|
37
|
-
* @param {WPElement} props.children
|
|
38
|
-
* @param {string} props.label
|
|
39
|
-
* @param {string} props.instructions
|
|
40
|
-
* @param {string} props.className
|
|
41
|
-
* @param {Object} props.notices
|
|
42
|
-
* @param {Object} props.preview
|
|
43
|
-
* @param {boolean} props.isColumnLayout
|
|
46
|
+
* @param {Object} props The component props.
|
|
47
|
+
* @param {WPIcon} props.icon An icon rendered before the label.
|
|
48
|
+
* @param {WPElement} props.children Children to be rendered.
|
|
49
|
+
* @param {string} props.label Title of the placeholder.
|
|
50
|
+
* @param {string} props.instructions Instructions of the placeholder.
|
|
51
|
+
* @param {string} props.className Class to set on the container div.
|
|
52
|
+
* @param {Object} props.notices A rendered notices list.
|
|
53
|
+
* @param {Object} props.preview Preview to be rendered in the placeholder.
|
|
54
|
+
* @param {boolean} props.isColumnLayout Whether a column layout should be used.
|
|
55
|
+
* @param {boolean} props.withIllustration Whether to add an illustration to the placeholder.
|
|
44
56
|
*
|
|
45
57
|
* @return {Object} The rendered placeholder.
|
|
46
58
|
*/
|
|
59
|
+
|
|
47
60
|
function Placeholder(_ref) {
|
|
48
61
|
let {
|
|
49
62
|
icon,
|
|
@@ -54,6 +67,7 @@ function Placeholder(_ref) {
|
|
|
54
67
|
notices,
|
|
55
68
|
preview,
|
|
56
69
|
isColumnLayout,
|
|
70
|
+
withIllustration,
|
|
57
71
|
...additionalProps
|
|
58
72
|
} = _ref;
|
|
59
73
|
const [resizeListener, {
|
|
@@ -71,13 +85,13 @@ function Placeholder(_ref) {
|
|
|
71
85
|
};
|
|
72
86
|
}
|
|
73
87
|
|
|
74
|
-
const classes = (0, _classnames.default)('components-placeholder', className, modifierClassNames);
|
|
88
|
+
const classes = (0, _classnames.default)('components-placeholder', className, modifierClassNames, withIllustration ? 'has-illustration' : null);
|
|
75
89
|
const fieldsetClasses = (0, _classnames.default)('components-placeholder__fieldset', {
|
|
76
90
|
'is-column-layout': isColumnLayout
|
|
77
91
|
});
|
|
78
92
|
return (0, _element.createElement)("div", (0, _extends2.default)({}, additionalProps, {
|
|
79
93
|
className: classes
|
|
80
|
-
}), resizeListener, notices, preview && (0, _element.createElement)("div", {
|
|
94
|
+
}), withIllustration ? PlaceholderIllustration : null, resizeListener, notices, preview && (0, _element.createElement)("div", {
|
|
81
95
|
className: "components-placeholder__preview"
|
|
82
96
|
}, preview), (0, _element.createElement)("div", {
|
|
83
97
|
className: "components-placeholder__label"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/placeholder/index.js"],"names":["Placeholder","icon","children","label","instructions","className","notices","preview","isColumnLayout","additionalProps","resizeListener","width","modifierClassNames","classes","fieldsetClasses"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/placeholder/index.js"],"names":["PlaceholderIllustration","Placeholder","icon","children","label","instructions","className","notices","preview","isColumnLayout","withIllustration","additionalProps","resizeListener","width","modifierClassNames","classes","fieldsetClasses"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,uBAAuB,GAC5B,4BAAC,eAAD;AACC,EAAA,SAAS,EAAC,sCADX;AAEC,EAAA,IAAI,EAAC,MAFN;AAGC,EAAA,KAAK,EAAC,4BAHP;AAIC,EAAA,OAAO,EAAC,WAJT;AAKC,EAAA,mBAAmB,EAAC;AALrB,GAOC,4BAAC,gBAAD;AAAM,EAAA,YAAY,EAAC,oBAAnB;AAAwC,EAAA,CAAC,EAAC;AAA1C,EAPD,CADD;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,WAAT,OAWI;AAAA,MAXkB;AACrBC,IAAAA,IADqB;AAErBC,IAAAA,QAFqB;AAGrBC,IAAAA,KAHqB;AAIrBC,IAAAA,YAJqB;AAKrBC,IAAAA,SALqB;AAMrBC,IAAAA,OANqB;AAOrBC,IAAAA,OAPqB;AAQrBC,IAAAA,cARqB;AASrBC,IAAAA,gBATqB;AAUrB,OAAGC;AAVkB,GAWlB;AACH,QAAM,CAAEC,cAAF,EAAkB;AAAEC,IAAAA;AAAF,GAAlB,IAAgC,iCAAtC,CADG,CAGH;AACA;;AACA,MAAIC,kBAAJ;;AACA,MAAK,OAAOD,KAAP,KAAiB,QAAtB,EAAiC;AAChCC,IAAAA,kBAAkB,GAAG;AACpB,kBAAYD,KAAK,IAAI,GADD;AAEpB,mBAAaA,KAAK,IAAI,GAAT,IAAgBA,KAAK,GAAG,GAFjB;AAGpB,kBAAYA,KAAK,GAAG;AAHA,KAArB;AAKA;;AAED,QAAME,OAAO,GAAG,yBACf,wBADe,EAEfT,SAFe,EAGfQ,kBAHe,EAIfJ,gBAAgB,GAAG,kBAAH,GAAwB,IAJzB,CAAhB;AAMA,QAAMM,eAAe,GAAG,yBAAY,kCAAZ,EAAgD;AACvE,wBAAoBP;AADmD,GAAhD,CAAxB;AAGA,SACC,8DAAUE,eAAV;AAA4B,IAAA,SAAS,EAAGI;AAAxC,MACGL,gBAAgB,GAAGV,uBAAH,GAA6B,IADhD,EAEGY,cAFH,EAGGL,OAHH,EAIGC,OAAO,IACR;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,OADH,CALF,EASC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,aAAD;AAAM,IAAA,IAAI,EAAGN;AAAb,IADD,EAEGE,KAFH,CATD,EAaC;AAAU,IAAA,SAAS,EAAGY;AAAtB,KACG,CAAC,CAAEX,YAAH,IACD;AAAQ,IAAA,SAAS,EAAC;AAAlB,KACGA,YADH,CAFF,EAMGF,QANH,CAbD,CADD;AAwBA;;eAEcF,W","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useResizeObserver } from '@wordpress/compose';\nimport { SVG, Path } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport Icon from '../icon';\n\nconst PlaceholderIllustration = (\n\t<SVG\n\t\tclassName=\"components-placeholder__illustration\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 60 60\"\n\t\tpreserveAspectRatio=\"none\"\n\t>\n\t\t<Path vectorEffect=\"non-scaling-stroke\" d=\"M60 60 0 0\" />\n\t</SVG>\n);\n\n/**\n * Renders a placeholder. Normally used by blocks to render their empty state.\n *\n * @param {Object} props The component props.\n * @param {WPIcon} props.icon An icon rendered before the label.\n * @param {WPElement} props.children Children to be rendered.\n * @param {string} props.label Title of the placeholder.\n * @param {string} props.instructions Instructions of the placeholder.\n * @param {string} props.className Class to set on the container div.\n * @param {Object} props.notices A rendered notices list.\n * @param {Object} props.preview Preview to be rendered in the placeholder.\n * @param {boolean} props.isColumnLayout Whether a column layout should be used.\n * @param {boolean} props.withIllustration Whether to add an illustration to the placeholder.\n *\n * @return {Object} The rendered placeholder.\n */\nfunction Placeholder( {\n\ticon,\n\tchildren,\n\tlabel,\n\tinstructions,\n\tclassName,\n\tnotices,\n\tpreview,\n\tisColumnLayout,\n\twithIllustration,\n\t...additionalProps\n} ) {\n\tconst [ resizeListener, { width } ] = useResizeObserver();\n\n\t// Since `useResizeObserver` will report a width of `null` until after the\n\t// first render, avoid applying any modifier classes until width is known.\n\tlet modifierClassNames;\n\tif ( typeof width === 'number' ) {\n\t\tmodifierClassNames = {\n\t\t\t'is-large': width >= 480,\n\t\t\t'is-medium': width >= 160 && width < 480,\n\t\t\t'is-small': width < 160,\n\t\t};\n\t}\n\n\tconst classes = classnames(\n\t\t'components-placeholder',\n\t\tclassName,\n\t\tmodifierClassNames,\n\t\twithIllustration ? 'has-illustration' : null\n\t);\n\tconst fieldsetClasses = classnames( 'components-placeholder__fieldset', {\n\t\t'is-column-layout': isColumnLayout,\n\t} );\n\treturn (\n\t\t<div { ...additionalProps } className={ classes }>\n\t\t\t{ withIllustration ? PlaceholderIllustration : null }\n\t\t\t{ resizeListener }\n\t\t\t{ notices }\n\t\t\t{ preview && (\n\t\t\t\t<div className=\"components-placeholder__preview\">\n\t\t\t\t\t{ preview }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-placeholder__label\">\n\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t{ label }\n\t\t\t</div>\n\t\t\t<fieldset className={ fieldsetClasses }>\n\t\t\t\t{ !! instructions && (\n\t\t\t\t\t<legend className=\"components-placeholder__instructions\">\n\t\t\t\t\t\t{ instructions }\n\t\t\t\t\t</legend>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t</fieldset>\n\t\t</div>\n\t);\n}\n\nexport default Placeholder;\n"]}
|
package/build/popover/index.js
CHANGED
|
@@ -132,6 +132,7 @@ const Popover = (_ref, ref) => {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
const arrowRef = (0, _element.useRef)(null);
|
|
135
|
+
const anchorRefFallback = (0, _element.useRef)(null);
|
|
135
136
|
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
136
137
|
const isExpanded = expandOnMobile && isMobileViewport;
|
|
137
138
|
const hasArrow = !isExpanded && !noArrow;
|
|
@@ -151,13 +152,13 @@ const Popover = (_ref, ref) => {
|
|
|
151
152
|
} else if (getAnchorRect) {
|
|
152
153
|
var _getAnchorRect$ownerD, _getAnchorRect;
|
|
153
154
|
|
|
154
|
-
return (_getAnchorRect$ownerD = (_getAnchorRect = getAnchorRect()) === null || _getAnchorRect === void 0 ? void 0 : _getAnchorRect.ownerDocument) !== null && _getAnchorRect$ownerD !== void 0 ? _getAnchorRect$ownerD : document;
|
|
155
|
+
return (_getAnchorRect$ownerD = (_getAnchorRect = getAnchorRect(anchorRefFallback.current)) === null || _getAnchorRect === void 0 ? void 0 : _getAnchorRect.ownerDocument) !== null && _getAnchorRect$ownerD !== void 0 ? _getAnchorRect$ownerD : document;
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
return document;
|
|
158
159
|
}, [anchorRef, anchorRect, getAnchorRect]);
|
|
159
160
|
/**
|
|
160
|
-
* Offsets the
|
|
161
|
+
* Offsets the position of the popover when the anchor is inside an iframe.
|
|
161
162
|
*/
|
|
162
163
|
|
|
163
164
|
const frameOffset = (0, _element.useMemo)(() => {
|
|
@@ -210,7 +211,6 @@ const Popover = (_ref, ref) => {
|
|
|
210
211
|
}) : undefined, hasArrow ? (0, _reactDom.arrow)({
|
|
211
212
|
element: arrowRef
|
|
212
213
|
}) : undefined].filter(m => !!m);
|
|
213
|
-
const anchorRefFallback = (0, _element.useRef)(null);
|
|
214
214
|
|
|
215
215
|
const slotName = (0, _element.useContext)(slotNameContext) || __unstableSlotName;
|
|
216
216
|
|
|
@@ -284,7 +284,7 @@ const Popover = (_ref, ref) => {
|
|
|
284
284
|
getBoundingClientRect() {
|
|
285
285
|
var _rect$x, _rect$y, _rect$width, _rect$height;
|
|
286
286
|
|
|
287
|
-
const rect = getAnchorRect();
|
|
287
|
+
const rect = getAnchorRect(anchorRefFallback.current);
|
|
288
288
|
return new window.DOMRect((_rect$x = rect.x) !== null && _rect$x !== void 0 ? _rect$x : rect.left, (_rect$y = rect.y) !== null && _rect$y !== void 0 ? _rect$y : rect.top, (_rect$width = rect.width) !== null && _rect$width !== void 0 ? _rect$width : rect.right - rect.left, (_rect$height = rect.height) !== null && _rect$height !== void 0 ? _rect$height : rect.bottom - rect.top);
|
|
289
289
|
}
|
|
290
290
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/popover/index.js"],"names":["SLOT_NAME","slotNameContext","positionToPlacement","position","x","y","z","split","includes","suffix","placementToAnimationOrigin","placement","a","b","Popover","ref","range","animate","headerTitle","onClose","children","className","noArrow","isAlternate","offset","focusOnMount","anchorRef","anchorRect","getAnchorRect","expandOnMobile","onFocusOutside","__unstableSlotName","__unstableObserveElement","__unstableForcePosition","__unstableShift","contentProps","since","version","arrowRef","isMobileViewport","isExpanded","hasArrow","usedPlacement","ownerDocument","top","startContainer","current","document","frameOffset","defaultView","frameElement","undefined","iframeRect","getBoundingClientRect","name","fn","left","middlewares","apply","sizeProps","height","refs","floating","Object","assign","firstChild","style","maxHeight","overflow","crossAxis","limiter","padding","element","filter","m","anchorRefFallback","slotName","slot","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","reference","strategy","update","placementData","middlewareData","arrow","arrowData","middleware","staticSide","right","bottom","mergedRefs","usedRef","topRect","bottomRect","window","DOMRect","width","rect","observer","MutationObserver","observe","attributes","disconnect","addEventListener","removeEventListener","animateClassName","origin","content","Number","isNaN","close","PopoverContainer","PopoverSlot","Slot","__unstableSlotNameProvider","Provider"],"mappings":";;;;;;;;;AAmBA;;;;AAfA;;AACA;;A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A,GAAG,EAAGvC;AAJP,IADD;AAQA;;AAEDqG,gBAAgB,CAACE,IAAjB,GAAwB,yBAAYD,WAAZ,CAAxB;AACAD,gBAAgB,CAACG,0BAAjB,GAA8CtH,eAAe,CAACuH,QAA9D;eAEeJ,gB","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport {\n\tuseFloating,\n\tflip,\n\tshift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tlimitShift,\n\tsize,\n} from '@floating-ui/react-dom';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n} from '@wordpress/element';\nimport {\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport { getAnimateClassName } from '../animate';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nconst SLOT_NAME = 'Popover';\n\nconst slotNameContext = createContext();\n\nconst positionToPlacement = ( position ) => {\n\tconst [ x, y, z ] = position.split( ' ' );\n\n\tif ( [ 'top', 'bottom' ].includes( x ) ) {\n\t\tlet suffix = '';\n\t\tif ( ( !! z && z === 'left' ) || y === 'right' ) {\n\t\t\tsuffix = '-start';\n\t\t} else if ( ( !! z && z === 'right' ) || y === 'left' ) {\n\t\t\tsuffix = '-end';\n\t\t}\n\t\treturn x + suffix;\n\t}\n\n\treturn y;\n};\n\nconst placementToAnimationOrigin = ( placement ) => {\n\tconst [ a, b ] = placement.split( '-' );\n\n\tlet x, y;\n\tif ( a === 'top' || a === 'bottom' ) {\n\t\tx = a === 'top' ? 'bottom' : 'top';\n\t\ty = 'middle';\n\t\tif ( b === 'start' ) {\n\t\t\ty = 'left';\n\t\t} else if ( b === 'end' ) {\n\t\t\ty = 'right';\n\t\t}\n\t}\n\n\tif ( a === 'left' || a === 'right' ) {\n\t\tx = 'center';\n\t\ty = a === 'left' ? 'right' : 'left';\n\t\tif ( b === 'start' ) {\n\t\t\tx = 'top';\n\t\t} else if ( b === 'end' ) {\n\t\t\tx = 'bottom';\n\t\t}\n\t}\n\n\treturn x + ' ' + y;\n};\n\nconst Popover = (\n\t{\n\t\trange,\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tisAlternate,\n\t\tposition,\n\t\tplacement = 'bottom-start',\n\t\toffset,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\t__unstableObserveElement,\n\t\t__unstableForcePosition,\n\t\t__unstableShift = false,\n\t\t...contentProps\n\t},\n\tref\n) => {\n\tif ( range ) {\n\t\tdeprecated( 'range prop in Popover component', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef( null );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst usedPlacement = position\n\t\t? positionToPlacement( position )\n\t\t: placement;\n\n\tconst ownerDocument = useMemo( () => {\n\t\tif ( anchorRef?.top ) {\n\t\t\treturn anchorRef?.top.ownerDocument;\n\t\t} else if ( anchorRef?.startContainer ) {\n\t\t\treturn anchorRef.startContainer.ownerDocument;\n\t\t} else if ( anchorRef?.current ) {\n\t\t\treturn anchorRef.current.ownerDocument;\n\t\t} else if ( anchorRef ) {\n\t\t\t// This one should be deprecated.\n\t\t\treturn anchorRef.ownerDocument;\n\t\t} else if ( anchorRect && anchorRect?.ownerDocument ) {\n\t\t\treturn anchorRect.ownerDocument;\n\t\t} else if ( getAnchorRect ) {\n\t\t\treturn getAnchorRect()?.ownerDocument ?? document;\n\t\t}\n\n\t\treturn document;\n\t}, [ anchorRef, anchorRect, getAnchorRect ] );\n\n\t/**\n\t * Offsets the the position of the popover when the anchor is inside an iframe.\n\t */\n\tconst frameOffset = useMemo( () => {\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst { frameElement } = defaultView;\n\n\t\tif ( ! frameElement || ownerDocument === document ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst iframeRect = frameElement.getBoundingClientRect();\n\t\treturn {\n\t\t\tname: 'iframeOffset',\n\t\t\tfn( { x, y } ) {\n\t\t\t\treturn {\n\t\t\t\t\tx: x + iframeRect.left,\n\t\t\t\t\ty: y + iframeRect.top,\n\t\t\t\t};\n\t\t\t},\n\t\t};\n\t}, [ ownerDocument ] );\n\n\tconst middlewares = [\n\t\tframeOffset,\n\t\toffset ? offsetMiddleware( offset ) : undefined,\n\t\t__unstableForcePosition ? undefined : flip(),\n\t\t__unstableForcePosition\n\t\t\t? undefined\n\t\t\t: size( {\n\t\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\t\tconst { height } = sizeProps;\n\t\t\t\t\t\tif ( ! refs.floating.current ) return;\n\t\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\t\tObject.assign( refs.floating.current.firstChild.style, {\n\t\t\t\t\t\t\tmaxHeight: `${ height }px`,\n\t\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t } ),\n\t\t__unstableShift\n\t\t\t? shift( {\n\t\t\t\t\tcrossAxis: true,\n\t\t\t\t\tlimiter: limitShift(),\n\t\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t } )\n\t\t\t: undefined,\n\t\thasArrow ? arrow( { element: arrowRef } ) : undefined,\n\t].filter( ( m ) => !! m );\n\tconst anchorRefFallback = useRef( null );\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tconst onDialogClose = ( type, event ) => {\n\t\t// Ideally the popover should have just a single onClose prop and\n\t\t// not three props that potentially do the same thing.\n\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\tonFocusOutside( event );\n\t\t} else if ( onClose ) {\n\t\t\tonClose();\n\t\t}\n\t};\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\tx,\n\t\ty,\n\t\treference,\n\t\tfloating,\n\t\tstrategy,\n\t\trefs,\n\t\tupdate,\n\t\tplacement: placementData,\n\t\tmiddlewareData: { arrow: arrowData = {} },\n\t} = useFloating( {\n\t\tplacement: usedPlacement,\n\t\tmiddleware: middlewares,\n\t} );\n\tconst staticSide = {\n\t\ttop: 'bottom',\n\t\tright: 'left',\n\t\tbottom: 'top',\n\t\tleft: 'right',\n\t}[ placementData.split( '-' )[ 0 ] ];\n\tconst mergedRefs = useMergeRefs( [ floating, dialogRef, ref ] );\n\n\t// Updates references\n\tuseLayoutEffect( () => {\n\t\t// No ref or position have been passed\n\t\tlet usedRef;\n\t\tif ( anchorRef?.top ) {\n\t\t\tusedRef = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\tconst topRect = anchorRef.top.getBoundingClientRect();\n\t\t\t\t\tconst bottomRect = anchorRef.bottom.getBoundingClientRect();\n\t\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\t\ttopRect.x,\n\t\t\t\t\t\ttopRect.y,\n\t\t\t\t\t\ttopRect.width,\n\t\t\t\t\t\tbottomRect.bottom - topRect.top\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t};\n\t\t} else if ( anchorRef?.current ) {\n\t\t\tusedRef = anchorRef.current;\n\t\t} else if ( anchorRef ) {\n\t\t\tusedRef = anchorRef;\n\t\t} else if ( anchorRect ) {\n\t\t\tusedRef = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn anchorRect;\n\t\t\t\t},\n\t\t\t};\n\t\t} else if ( getAnchorRect ) {\n\t\t\tusedRef = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\tconst rect = getAnchorRect();\n\t\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\t\trect.x ?? rect.left,\n\t\t\t\t\t\trect.y ?? rect.top,\n\t\t\t\t\t\trect.width ?? rect.right - rect.left,\n\t\t\t\t\t\trect.height ?? rect.bottom - rect.top\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t};\n\t\t} else if ( anchorRefFallback.current ) {\n\t\t\tusedRef = anchorRefFallback.current;\n\t\t}\n\n\t\tif ( ! usedRef ) {\n\t\t\treturn;\n\t\t}\n\n\t\treference( usedRef );\n\n\t\tif ( ! refs.floating.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn autoUpdate( usedRef, refs.floating.current, update );\n\t}, [ anchorRef, anchorRect, getAnchorRect ] );\n\n\t// This is only needed for a smoth transition when moving blocks.\n\tuseLayoutEffect( () => {\n\t\tif ( ! __unstableObserveElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( update );\n\t\tobserver.observe( __unstableObserveElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ __unstableObserveElement ] );\n\n\t// If we're using getAnchorRect, we need to update the position as we scroll the iframe.\n\tuseLayoutEffect( () => {\n\t\tif ( ownerDocument === document ) {\n\t\t\treturn;\n\t\t}\n\n\t\townerDocument.addEventListener( 'scroll', update );\n\t\treturn () => ownerDocument.removeEventListener( 'scroll', update );\n\t}, [ ownerDocument ] );\n\n\t/** @type {false | string} */\n\tconst animateClassName =\n\t\t!! animate &&\n\t\tgetAnimateClassName( {\n\t\t\ttype: 'appear',\n\t\t\torigin: placementToAnimationOrigin( placementData ),\n\t\t} );\n\n\t// Disable reason: We care to capture the _bubbled_ events from inputs\n\t// within popover as inferring close intent.\n\n\tlet content = (\n\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-popover',\n\t\t\t\tclassName,\n\t\t\t\tanimateClassName,\n\t\t\t\t{\n\t\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t\t'is-alternate': isAlternate,\n\t\t\t\t}\n\t\t\t) }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedRefs }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex=\"-1\"\n\t\t\tstyle={\n\t\t\t\tisExpanded\n\t\t\t\t\t? undefined\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tposition: strategy,\n\t\t\t\t\t\t\tleft: Number.isNaN( x ) ? 0 : x,\n\t\t\t\t\t\t\ttop: Number.isNaN( y ) ? 0 : y,\n\t\t\t\t\t }\n\t\t\t}\n\t\t>\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"components-popover__arrow\"\n\t\t\t\t\tref={ arrowRef }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\t! arrowData?.x || Number.isNaN( arrowData?.x )\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: arrowData.x,\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\t! arrowData?.y || Number.isNaN( arrowData?.y )\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: arrowData.y,\n\t\t\t\t\t\tright: undefined,\n\t\t\t\t\t\tbottom: undefined,\n\t\t\t\t\t\t[ staticSide ]: '-4px',\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n\n\tif ( slot.ref ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t}\n\n\tif ( anchorRef || anchorRect ) {\n\t\treturn content;\n\t}\n\n\treturn <span ref={ anchorRefFallback }>{ content }</span>;\n};\n\nconst PopoverContainer = forwardRef( Popover );\n\nfunction PopoverSlot( { name = SLOT_NAME }, ref ) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\nPopoverContainer.Slot = forwardRef( PopoverSlot );\nPopoverContainer.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default PopoverContainer;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/popover/index.js"],"names":["SLOT_NAME","slotNameContext","positionToPlacement","position","x","y","z","split","includes","suffix","placementToAnimationOrigin","placement","a","b","Popover","ref","range","animate","headerTitle","onClose","children","className","noArrow","isAlternate","offset","focusOnMount","anchorRef","anchorRect","getAnchorRect","expandOnMobile","onFocusOutside","__unstableSlotName","__unstableObserveElement","__unstableForcePosition","__unstableShift","contentProps","since","version","arrowRef","anchorRefFallback","isMobileViewport","isExpanded","hasArrow","usedPlacement","ownerDocument","top","startContainer","current","document","frameOffset","defaultView","frameElement","undefined","iframeRect","getBoundingClientRect","name","fn","left","middlewares","apply","sizeProps","height","refs","floating","Object","assign","firstChild","style","maxHeight","overflow","crossAxis","limiter","padding","element","filter","m","slotName","slot","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","reference","strategy","update","placementData","middlewareData","arrow","arrowData","middleware","staticSide","right","bottom","mergedRefs","usedRef","topRect","bottomRect","window","DOMRect","width","rect","observer","MutationObserver","observe","attributes","disconnect","addEventListener","removeEventListener","animateClassName","origin","content","Number","isNaN","close","PopoverContainer","PopoverSlot","Slot","__unstableSlotNameProvider","Provider"],"mappings":";;;;;;;;;AAmBA;;;;AAfA;;AACA;;AAsBA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAzCA;;AACA;AACA;AACA;;AAaA;AACA;AACA;;AAiBA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA,MAAMA,SAAS,GAAG,SAAlB;AAEA,MAAMC,eAAe,GAAG,6BAAxB;;AAEA,MAAMC,mBAAmB,GAAKC,QAAF,IAAgB;AAC3C,QAAM,CAAEC,CAAF,EAAKC,CAAL,EAAQC,CAAR,IAAcH,QAAQ,CAACI,KAAT,CAAgB,GAAhB,CAApB;;AAEA,MAAK,CAAE,KAAF,EAAS,QAAT,EAAoBC,QAApB,CAA8BJ,CAA9B,CAAL,EAAyC;AACxC,QAAIK,MAAM,GAAG,EAAb;;AACA,QAAO,CAAC,CAAEH,CAAH,IAAQA,CAAC,KAAK,MAAhB,IAA4BD,CAAC,KAAK,OAAvC,EAAiD;AAChDI,MAAAA,MAAM,GAAG,QAAT;AACA,KAFD,MAEO,IAAO,CAAC,CAAEH,CAAH,IAAQA,CAAC,KAAK,OAAhB,IAA6BD,CAAC,KAAK,MAAxC,EAAiD;AACvDI,MAAAA,MAAM,GAAG,MAAT;AACA;;AACD,WAAOL,CAAC,GAAGK,MAAX;AACA;;AAED,SAAOJ,CAAP;AACA,CAdD;;AAgBA,MAAMK,0BAA0B,GAAKC,SAAF,IAAiB;AACnD,QAAM,CAAEC,CAAF,EAAKC,CAAL,IAAWF,SAAS,CAACJ,KAAV,CAAiB,GAAjB,CAAjB;AAEA,MAAIH,CAAJ,EAAOC,CAAP;;AACA,MAAKO,C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,KAAkCyE,OAAlC,CAAP;AACA,CA7TD;;AA+TA,MAAMI,gBAAgB,GAAG,yBAAYtG,OAAZ,CAAzB;;AAEA,SAASuG,WAAT,QAA4CtG,GAA5C,EAAkD;AAAA,MAA5B;AAAEwC,IAAAA,IAAI,GAAGvD;AAAT,GAA4B;AACjD,SACC,4BAAC,cAAD;AACC,IAAA,gBAAgB,MADjB;AAEC,IAAA,IAAI,EAAGuD,IAFR;AAGC,IAAA,SAAS,EAAC,cAHX;AAIC,IAAA,GAAG,EAAGxC;AAJP,IADD;AAQA;;AAEDqG,gBAAgB,CAACE,IAAjB,GAAwB,yBAAYD,WAAZ,CAAxB;AACAD,gBAAgB,CAACG,0BAAjB,GAA8CtH,eAAe,CAACuH,QAA9D;eAEeJ,gB","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport {\n\tuseFloating,\n\tflip,\n\tshift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tlimitShift,\n\tsize,\n} from '@floating-ui/react-dom';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n} from '@wordpress/element';\nimport {\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport { getAnimateClassName } from '../animate';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nconst SLOT_NAME = 'Popover';\n\nconst slotNameContext = createContext();\n\nconst positionToPlacement = ( position ) => {\n\tconst [ x, y, z ] = position.split( ' ' );\n\n\tif ( [ 'top', 'bottom' ].includes( x ) ) {\n\t\tlet suffix = '';\n\t\tif ( ( !! z && z === 'left' ) || y === 'right' ) {\n\t\t\tsuffix = '-start';\n\t\t} else if ( ( !! z && z === 'right' ) || y === 'left' ) {\n\t\t\tsuffix = '-end';\n\t\t}\n\t\treturn x + suffix;\n\t}\n\n\treturn y;\n};\n\nconst placementToAnimationOrigin = ( placement ) => {\n\tconst [ a, b ] = placement.split( '-' );\n\n\tlet x, y;\n\tif ( a === 'top' || a === 'bottom' ) {\n\t\tx = a === 'top' ? 'bottom' : 'top';\n\t\ty = 'middle';\n\t\tif ( b === 'start' ) {\n\t\t\ty = 'left';\n\t\t} else if ( b === 'end' ) {\n\t\t\ty = 'right';\n\t\t}\n\t}\n\n\tif ( a === 'left' || a === 'right' ) {\n\t\tx = 'center';\n\t\ty = a === 'left' ? 'right' : 'left';\n\t\tif ( b === 'start' ) {\n\t\t\tx = 'top';\n\t\t} else if ( b === 'end' ) {\n\t\t\tx = 'bottom';\n\t\t}\n\t}\n\n\treturn x + ' ' + y;\n};\n\nconst Popover = (\n\t{\n\t\trange,\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tisAlternate,\n\t\tposition,\n\t\tplacement = 'bottom-start',\n\t\toffset,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\t__unstableObserveElement,\n\t\t__unstableForcePosition,\n\t\t__unstableShift = false,\n\t\t...contentProps\n\t},\n\tref\n) => {\n\tif ( range ) {\n\t\tdeprecated( 'range prop in Popover component', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef( null );\n\tconst anchorRefFallback = useRef( null );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst usedPlacement = position\n\t\t? positionToPlacement( position )\n\t\t: placement;\n\n\tconst ownerDocument = useMemo( () => {\n\t\tif ( anchorRef?.top ) {\n\t\t\treturn anchorRef?.top.ownerDocument;\n\t\t} else if ( anchorRef?.startContainer ) {\n\t\t\treturn anchorRef.startContainer.ownerDocument;\n\t\t} else if ( anchorRef?.current ) {\n\t\t\treturn anchorRef.current.ownerDocument;\n\t\t} else if ( anchorRef ) {\n\t\t\t// This one should be deprecated.\n\t\t\treturn anchorRef.ownerDocument;\n\t\t} else if ( anchorRect && anchorRect?.ownerDocument ) {\n\t\t\treturn anchorRect.ownerDocument;\n\t\t} else if ( getAnchorRect ) {\n\t\t\treturn (\n\t\t\t\tgetAnchorRect( anchorRefFallback.current )?.ownerDocument ??\n\t\t\t\tdocument\n\t\t\t);\n\t\t}\n\n\t\treturn document;\n\t}, [ anchorRef, anchorRect, getAnchorRect ] );\n\n\t/**\n\t * Offsets the position of the popover when the anchor is inside an iframe.\n\t */\n\tconst frameOffset = useMemo( () => {\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst { frameElement } = defaultView;\n\n\t\tif ( ! frameElement || ownerDocument === document ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst iframeRect = frameElement.getBoundingClientRect();\n\t\treturn {\n\t\t\tname: 'iframeOffset',\n\t\t\tfn( { x, y } ) {\n\t\t\t\treturn {\n\t\t\t\t\tx: x + iframeRect.left,\n\t\t\t\t\ty: y + iframeRect.top,\n\t\t\t\t};\n\t\t\t},\n\t\t};\n\t}, [ ownerDocument ] );\n\n\tconst middlewares = [\n\t\tframeOffset,\n\t\toffset ? offsetMiddleware( offset ) : undefined,\n\t\t__unstableForcePosition ? undefined : flip(),\n\t\t__unstableForcePosition\n\t\t\t? undefined\n\t\t\t: size( {\n\t\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\t\tconst { height } = sizeProps;\n\t\t\t\t\t\tif ( ! refs.floating.current ) return;\n\t\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\t\tObject.assign( refs.floating.current.firstChild.style, {\n\t\t\t\t\t\t\tmaxHeight: `${ height }px`,\n\t\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t } ),\n\t\t__unstableShift\n\t\t\t? shift( {\n\t\t\t\t\tcrossAxis: true,\n\t\t\t\t\tlimiter: limitShift(),\n\t\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t } )\n\t\t\t: undefined,\n\t\thasArrow ? arrow( { element: arrowRef } ) : undefined,\n\t].filter( ( m ) => !! m );\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tconst onDialogClose = ( type, event ) => {\n\t\t// Ideally the popover should have just a single onClose prop and\n\t\t// not three props that potentially do the same thing.\n\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\tonFocusOutside( event );\n\t\t} else if ( onClose ) {\n\t\t\tonClose();\n\t\t}\n\t};\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\tx,\n\t\ty,\n\t\treference,\n\t\tfloating,\n\t\tstrategy,\n\t\trefs,\n\t\tupdate,\n\t\tplacement: placementData,\n\t\tmiddlewareData: { arrow: arrowData = {} },\n\t} = useFloating( {\n\t\tplacement: usedPlacement,\n\t\tmiddleware: middlewares,\n\t} );\n\tconst staticSide = {\n\t\ttop: 'bottom',\n\t\tright: 'left',\n\t\tbottom: 'top',\n\t\tleft: 'right',\n\t}[ placementData.split( '-' )[ 0 ] ];\n\tconst mergedRefs = useMergeRefs( [ floating, dialogRef, ref ] );\n\n\t// Updates references\n\tuseLayoutEffect( () => {\n\t\t// No ref or position have been passed\n\t\tlet usedRef;\n\t\tif ( anchorRef?.top ) {\n\t\t\tusedRef = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\tconst topRect = anchorRef.top.getBoundingClientRect();\n\t\t\t\t\tconst bottomRect = anchorRef.bottom.getBoundingClientRect();\n\t\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\t\ttopRect.x,\n\t\t\t\t\t\ttopRect.y,\n\t\t\t\t\t\ttopRect.width,\n\t\t\t\t\t\tbottomRect.bottom - topRect.top\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t};\n\t\t} else if ( anchorRef?.current ) {\n\t\t\tusedRef = anchorRef.current;\n\t\t} else if ( anchorRef ) {\n\t\t\tusedRef = anchorRef;\n\t\t} else if ( anchorRect ) {\n\t\t\tusedRef = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\treturn anchorRect;\n\t\t\t\t},\n\t\t\t};\n\t\t} else if ( getAnchorRect ) {\n\t\t\tusedRef = {\n\t\t\t\tgetBoundingClientRect() {\n\t\t\t\t\tconst rect = getAnchorRect( anchorRefFallback.current );\n\t\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\t\trect.x ?? rect.left,\n\t\t\t\t\t\trect.y ?? rect.top,\n\t\t\t\t\t\trect.width ?? rect.right - rect.left,\n\t\t\t\t\t\trect.height ?? rect.bottom - rect.top\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t};\n\t\t} else if ( anchorRefFallback.current ) {\n\t\t\tusedRef = anchorRefFallback.current;\n\t\t}\n\n\t\tif ( ! usedRef ) {\n\t\t\treturn;\n\t\t}\n\n\t\treference( usedRef );\n\n\t\tif ( ! refs.floating.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn autoUpdate( usedRef, refs.floating.current, update );\n\t}, [ anchorRef, anchorRect, getAnchorRect ] );\n\n\t// This is only needed for a smoth transition when moving blocks.\n\tuseLayoutEffect( () => {\n\t\tif ( ! __unstableObserveElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( update );\n\t\tobserver.observe( __unstableObserveElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ __unstableObserveElement ] );\n\n\t// If we're using getAnchorRect, we need to update the position as we scroll the iframe.\n\tuseLayoutEffect( () => {\n\t\tif ( ownerDocument === document ) {\n\t\t\treturn;\n\t\t}\n\n\t\townerDocument.addEventListener( 'scroll', update );\n\t\treturn () => ownerDocument.removeEventListener( 'scroll', update );\n\t}, [ ownerDocument ] );\n\n\t/** @type {false | string} */\n\tconst animateClassName =\n\t\t!! animate &&\n\t\tgetAnimateClassName( {\n\t\t\ttype: 'appear',\n\t\t\torigin: placementToAnimationOrigin( placementData ),\n\t\t} );\n\n\t// Disable reason: We care to capture the _bubbled_ events from inputs\n\t// within popover as inferring close intent.\n\n\tlet content = (\n\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-popover',\n\t\t\t\tclassName,\n\t\t\t\tanimateClassName,\n\t\t\t\t{\n\t\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t\t'is-alternate': isAlternate,\n\t\t\t\t}\n\t\t\t) }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedRefs }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex=\"-1\"\n\t\t\tstyle={\n\t\t\t\tisExpanded\n\t\t\t\t\t? undefined\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tposition: strategy,\n\t\t\t\t\t\t\tleft: Number.isNaN( x ) ? 0 : x,\n\t\t\t\t\t\t\ttop: Number.isNaN( y ) ? 0 : y,\n\t\t\t\t\t }\n\t\t\t}\n\t\t>\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"components-popover__arrow\"\n\t\t\t\t\tref={ arrowRef }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\t! arrowData?.x || Number.isNaN( arrowData?.x )\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: arrowData.x,\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\t! arrowData?.y || Number.isNaN( arrowData?.y )\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: arrowData.y,\n\t\t\t\t\t\tright: undefined,\n\t\t\t\t\t\tbottom: undefined,\n\t\t\t\t\t\t[ staticSide ]: '-4px',\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n\n\tif ( slot.ref ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t}\n\n\tif ( anchorRef || anchorRect ) {\n\t\treturn content;\n\t}\n\n\treturn <span ref={ anchorRefFallback }>{ content }</span>;\n};\n\nconst PopoverContainer = forwardRef( Popover );\n\nfunction PopoverSlot( { name = SLOT_NAME }, ref ) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\nPopoverContainer.Slot = forwardRef( PopoverSlot );\nPopoverContainer.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default PopoverContainer;\n"]}
|
|
@@ -5,7 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.RadioControl = RadioControl;
|
|
9
|
+
exports.default = void 0;
|
|
9
10
|
|
|
10
11
|
var _element = require("@wordpress/element");
|
|
11
12
|
|
|
@@ -30,8 +31,36 @@ var _baseControl = _interopRequireDefault(require("../base-control"));
|
|
|
30
31
|
/**
|
|
31
32
|
* Internal dependencies
|
|
32
33
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Render a user interface to select the user type using radio inputs.
|
|
37
|
+
*
|
|
38
|
+
* ```jsx
|
|
39
|
+
* import { RadioControl } from '@wordpress/components';
|
|
40
|
+
* import { useState } from '@wordpress/element';
|
|
41
|
+
*
|
|
42
|
+
* const MyRadioControl = () => {
|
|
43
|
+
* const [ option, setOption ] = useState( 'a' );
|
|
44
|
+
*
|
|
45
|
+
* return (
|
|
46
|
+
* <RadioControl
|
|
47
|
+
* label="User type"
|
|
48
|
+
* help="The type of the current user"
|
|
49
|
+
* selected={ option }
|
|
50
|
+
* options={ [
|
|
51
|
+
* { label: 'Author', value: 'a' },
|
|
52
|
+
* { label: 'Editor', value: 'e' },
|
|
53
|
+
* ] }
|
|
54
|
+
* onChange={ ( value ) => setOption( value ) }
|
|
55
|
+
* />
|
|
56
|
+
* );
|
|
57
|
+
* };
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
function RadioControl( // ref is omitted until we have `WordPressComponentPropsWithoutRef` or add
|
|
61
|
+
// ref forwarding to RadioControl.
|
|
62
|
+
props) {
|
|
63
|
+
const {
|
|
35
64
|
label,
|
|
36
65
|
className,
|
|
37
66
|
selected,
|
|
@@ -39,14 +68,18 @@ function RadioControl(_ref) {
|
|
|
39
68
|
onChange,
|
|
40
69
|
hideLabelFromVision,
|
|
41
70
|
options = [],
|
|
42
|
-
...
|
|
43
|
-
} =
|
|
71
|
+
...additionalProps
|
|
72
|
+
} = props;
|
|
44
73
|
const instanceId = (0, _compose.useInstanceId)(RadioControl);
|
|
45
74
|
const id = `inspector-radio-control-${instanceId}`;
|
|
46
75
|
|
|
47
76
|
const onChangeValue = event => onChange(event.target.value);
|
|
48
77
|
|
|
49
|
-
|
|
78
|
+
if ((0, _lodash.isEmpty)(options)) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return (0, _element.createElement)(_baseControl.default, {
|
|
50
83
|
label: label,
|
|
51
84
|
id: id,
|
|
52
85
|
hideLabelFromVision: hideLabelFromVision,
|
|
@@ -64,8 +97,11 @@ function RadioControl(_ref) {
|
|
|
64
97
|
onChange: onChangeValue,
|
|
65
98
|
checked: option.value === selected,
|
|
66
99
|
"aria-describedby": !!help ? `${id}__help` : undefined
|
|
67
|
-
},
|
|
100
|
+
}, additionalProps)), (0, _element.createElement)("label", {
|
|
68
101
|
htmlFor: `${id}-${index}`
|
|
69
102
|
}, option.label))));
|
|
70
103
|
}
|
|
104
|
+
|
|
105
|
+
var _default = RadioControl;
|
|
106
|
+
exports.default = _default;
|
|
71
107
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/radio-control/index.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/radio-control/index.tsx"],"names":["RadioControl","props","label","className","selected","help","onChange","hideLabelFromVision","options","additionalProps","instanceId","id","onChangeValue","event","target","value","map","option","index","undefined"],"mappings":";;;;;;;;;;;;;;AAGA;;AACA;;AAMA;;AAKA;;AAfA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,YAAT,EACN;AACA;AACAC,KAHM,EAOL;AACD,QAAM;AACLC,IAAAA,KADK;AAELC,IAAAA,SAFK;AAGLC,IAAAA,QAHK;AAILC,IAAAA,IAJK;AAKL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n * External dependencies\n */\nimport { isEmpty } from 'lodash';\nimport classnames from 'classnames';\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { RadioControlProps } from './types';\n\n/**\n * Render a user interface to select the user type using radio inputs.\n *\n * ```jsx\n * import { RadioControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyRadioControl = () => {\n * const [ option, setOption ] = useState( 'a' );\n *\n * return (\n * <RadioControl\n * label=\"User type\"\n * help=\"The type of the current user\"\n * selected={ option }\n * options={ [\n * { label: 'Author', value: 'a' },\n * { label: 'Editor', value: 'e' },\n * ] }\n * onChange={ ( value ) => setOption( value ) }\n * />\n * );\n * };\n * ```\n */\nexport function RadioControl(\n\t// ref is omitted until we have `WordPressComponentPropsWithoutRef` or add\n\t// ref forwarding to RadioControl.\n\tprops: Omit<\n\t\tWordPressComponentProps< RadioControlProps, 'input', false >,\n\t\t'ref'\n\t>\n) {\n\tconst {\n\t\tlabel,\n\t\tclassName,\n\t\tselected,\n\t\thelp,\n\t\tonChange,\n\t\thideLabelFromVision,\n\t\toptions = [],\n\t\t...additionalProps\n\t} = props;\n\tconst instanceId = useInstanceId( RadioControl );\n\tconst id = `inspector-radio-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.value );\n\n\tif ( isEmpty( options ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BaseControl\n\t\t\tlabel={ label }\n\t\t\tid={ id }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\thelp={ help }\n\t\t\tclassName={ classnames( className, 'components-radio-control' ) }\n\t\t>\n\t\t\t{ options.map( ( option, index ) => (\n\t\t\t\t<div\n\t\t\t\t\tkey={ `${ id }-${ index }` }\n\t\t\t\t\tclassName=\"components-radio-control__option\"\n\t\t\t\t>\n\t\t\t\t\t<input\n\t\t\t\t\t\tid={ `${ id }-${ index }` }\n\t\t\t\t\t\tclassName=\"components-radio-control__input\"\n\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\tname={ id }\n\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\tonChange={ onChangeValue }\n\t\t\t\t\t\tchecked={ option.value === selected }\n\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t!! help ? `${ id }__help` : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\t/>\n\t\t\t\t\t<label htmlFor={ `${ id }-${ index }` }>\n\t\t\t\t\t\t{ option.label }\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t) ) }\n\t\t</BaseControl>\n\t);\n}\n\nexport default RadioControl;\n"]}
|