@wordpress/components 28.8.6 → 28.10.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 +44 -5
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/types.js.map +1 -1
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +3 -3
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/get-default-use-items.js.map +1 -1
- package/build/autocomplete/index.js +5 -1
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/hooks.js.map +1 -1
- package/build/base-control/index.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +3 -14
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-box-control/styles.js.map +1 -1
- package/build/border-box-control/utils.js.map +1 -1
- package/build/border-control/border-control/component.js +1 -2
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +2 -14
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/styles.js +13 -13
- package/build/border-control/styles.js.map +1 -1
- package/build/border-control/types.js.map +1 -1
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/icon.js.map +1 -1
- package/build/box-control/index.js +4 -4
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js.map +1 -1
- package/build/box-control/types.js.map +1 -1
- package/build/button/index.native.js +1 -1
- package/build/button/index.native.js.map +1 -1
- package/build/card/card/component.js +1 -1
- package/build/card/card/component.js.map +1 -1
- package/build/card/styles.js.map +1 -1
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +2 -1
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/styles.js.map +1 -1
- package/build/combobox-control/index.js +1 -1
- package/build/combobox-control/index.js.map +1 -1
- package/build/composite/legacy/index.js.map +1 -1
- package/build/context/context-connect.js +1 -0
- package/build/context/context-connect.js.map +1 -1
- package/build/context/context-system-provider.js +1 -1
- package/build/context/context-system-provider.js.map +1 -1
- package/build/context/get-styled-class-name-from-key.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-picker/index.js.map +1 -1
- 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-v2/styles.js.map +1 -1
- package/build/dashicon/index.js.map +1 -1
- package/build/date-time/date/styles.js.map +1 -1
- package/build/date-time/time/timezone.js.map +1 -1
- package/build/draggable/index.js.map +1 -1
- package/build/drop-zone/index.js.map +1 -1
- package/build/dropdown-menu-v2/styles.js.map +1 -1
- package/build/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build/duotone-picker/utils.js.map +1 -1
- package/build/elevation/hook.js.map +1 -1
- package/build/external-link/index.js +20 -23
- package/build/external-link/index.js.map +1 -1
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/index.native.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/form-token-field/index.js +2 -1
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/form-token-field/token-input.js.map +1 -1
- package/build/form-token-field/token.js +1 -1
- package/build/form-token-field/token.js.map +1 -1
- package/build/gradient-picker/index.js.map +1 -1
- package/build/grid/hook.js.map +1 -1
- package/build/guide/page-control.js +1 -1
- package/build/guide/page-control.js.map +1 -1
- package/build/h-stack/hook.js.map +1 -1
- package/build/heading/hook.js.map +1 -1
- package/build/index.js +36 -5
- package/build/index.js.map +1 -1
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/item-group/styles.js.map +1 -1
- package/build/menu-group/index.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +4 -4
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/switch-cell.native.js +4 -4
- package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build/mobile/cycle-select-control/index.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +1 -1
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build/mobile/picker/index.android.js.map +1 -1
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build/modal/aria-helper.js +2 -1
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +2 -1
- package/build/modal/index.js.map +1 -1
- package/build/modal/use-modal-exit-animation.js.map +1 -1
- package/build/navigation/group/index.js.map +1 -1
- package/build/navigation/item/base.js.map +1 -1
- package/build/navigation/menu/index.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +2 -2
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/menu-title.js.map +1 -1
- package/build/navigation/styles/navigation-styles.js.map +1 -1
- package/build/navigator/index.js +128 -32
- package/build/navigator/index.js.map +1 -1
- package/build/navigator/legacy.js +179 -0
- package/build/navigator/legacy.js.map +1 -0
- package/build/navigator/{navigator-provider → navigator}/component.js +5 -40
- package/build/navigator/navigator/component.js.map +1 -0
- package/build/navigator/navigator-back-button/component.js +2 -38
- package/build/navigator/navigator-back-button/component.js.map +1 -1
- package/build/navigator/navigator-back-button/hook.js +1 -1
- package/build/navigator/navigator-back-button/hook.js.map +1 -1
- package/build/navigator/navigator-button/component.js +2 -37
- package/build/navigator/navigator-button/component.js.map +1 -1
- package/build/navigator/navigator-button/hook.js +1 -1
- package/build/navigator/navigator-button/hook.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +40 -62
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/navigator-screen/use-screen-animate-presence.js +114 -0
- package/build/navigator/navigator-screen/use-screen-animate-presence.js.map +1 -0
- package/build/navigator/navigator-to-parent-button/component.js +3 -7
- package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
- package/build/navigator/styles.js +78 -35
- package/build/navigator/styles.js.map +1 -1
- package/build/navigator/types.js.map +1 -1
- package/build/navigator/use-navigator.js +4 -1
- package/build/navigator/use-navigator.js.map +1 -1
- package/build/number-control/styles/number-control-styles.js.map +1 -1
- package/build/palette-edit/index.js +1 -1
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +1 -1
- package/build/popover/index.js.map +1 -1
- package/build/popover/overlay-middlewares.js.map +1 -1
- package/build/popover/utils.js.map +1 -1
- package/build/progress-bar/index.js.map +1 -1
- package/build/progress-bar/styles.js.map +1 -1
- package/build/query-controls/index.js.map +1 -1
- package/build/query-controls/index.native.js.map +1 -1
- package/build/radio-control/index.js.map +1 -1
- package/build/radio-control/index.native.js.map +1 -1
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/index.native.js.map +1 -1
- package/build/range-control/rail.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +32 -32
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/range-control/tooltip.js +1 -1
- package/build/range-control/tooltip.js.map +1 -1
- package/build/range-control/utils.js.map +1 -1
- package/build/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/responsive-wrapper/index.js.map +1 -1
- package/build/sandbox/index.js.map +1 -1
- package/build/sandbox/index.native.js.map +1 -1
- package/build/search-control/index.js +11 -2
- package/build/search-control/index.js.map +1 -1
- package/build/search-control/index.native.js.map +1 -1
- package/build/search-control/types.js.map +1 -1
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/index.native.js.map +1 -1
- package/build/slot-fill/index.js.map +1 -1
- package/build/spinner/styles.js.map +1 -1
- package/build/style-provider/index.js +1 -0
- package/build/style-provider/index.js.map +1 -1
- package/build/surface/hook.js.map +1 -1
- package/build/surface/styles.js.map +1 -1
- package/build/tab-panel/index.js.map +1 -1
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/styles.js +30 -12
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tab.js +7 -2
- package/build/tabs/tab.js.map +1 -1
- package/build/tabs/tablist.js +71 -39
- package/build/tabs/tablist.js.map +1 -1
- package/build/tabs/tabpanel.js.map +1 -1
- package/build/tabs/use-track-overflow.js +73 -0
- package/build/tabs/use-track-overflow.js.map +1 -0
- package/build/text/get-line-height.js.map +1 -1
- package/build/text/styles/text-mixins.native.js.map +1 -1
- package/build/text/utils.js.map +1 -1
- package/build/text-control/index.native.js.map +1 -1
- package/build/text-highlight/index.js.map +1 -1
- package/build/textarea-control/index.js.map +1 -1
- package/build/theme/color-algorithms.js.map +1 -1
- package/build/theme/styles.js.map +1 -1
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-control/index.native.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-button-group.js +4 -2
- package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +13 -2
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +15 -8
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +13 -20
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js +8 -9
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build/toggle-group-control/types.js.map +1 -1
- package/build/toolbar/toolbar/index.js.map +1 -1
- package/build/tools-panel/styles.js.map +1 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/breakpoint.js.map +1 -1
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/element-rect.js +22 -13
- package/build/utils/element-rect.js.map +1 -1
- package/build/utils/font-size.js.map +1 -1
- package/build/utils/hooks/use-animated-offset-rect.js +80 -0
- package/build/utils/hooks/use-animated-offset-rect.js.map +1 -0
- package/build/utils/hooks/use-cx.js.map +1 -1
- package/build/utils/hooks/use-on-value-update.js +3 -7
- package/build/utils/hooks/use-on-value-update.js.map +1 -1
- package/build/utils/math.js +2 -2
- package/build/utils/math.js.map +1 -1
- package/build/utils/space.js.map +1 -1
- package/build/utils/unit-values.js.map +1 -1
- package/build/utils/use-responsive-value.js.map +1 -1
- package/build-module/alignment-matrix-control/cell.js +1 -2
- package/build-module/alignment-matrix-control/cell.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/types.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/angle-picker-control/index.js +1 -2
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +4 -6
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.native.js +1 -2
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/autocomplete/index.js +6 -4
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/hooks.js.map +1 -1
- package/build-module/base-control/index.js +1 -2
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/base-control/index.native.js +1 -2
- package/build-module/base-control/index.native.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +4 -16
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +1 -2
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-box-control/styles.js.map +1 -1
- package/build-module/border-box-control/utils.js.map +1 -1
- package/build-module/border-control/border-control/component.js +2 -4
- 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/border-control/border-control-dropdown/component.js +3 -17
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/styles.js +13 -13
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/border-control/types.js.map +1 -1
- package/build-module/box-control/all-input-control.js +1 -3
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js +1 -3
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/icon.js +1 -2
- package/build-module/box-control/icon.js.map +1 -1
- package/build-module/box-control/index.js +5 -6
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +1 -3
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/box-control/types.js.map +1 -1
- package/build-module/button/index.js +1 -3
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/index.native.js +2 -3
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/card/card/component.js +2 -3
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/styles.js.map +1 -1
- package/build-module/checkbox-control/index.js +1 -2
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +1 -2
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker.js +1 -2
- package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build-module/color-indicator/index.native.js +1 -2
- package/build-module/color-indicator/index.native.js.map +1 -1
- package/build-module/color-palette/index.js +1 -2
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +3 -4
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/component.js +1 -2
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/hsl-input.js +1 -3
- package/build-module/color-picker/hsl-input.js.map +1 -1
- package/build-module/color-picker/hsv-color-picker.native.js +1 -2
- package/build-module/color-picker/hsv-color-picker.native.js.map +1 -1
- package/build-module/color-picker/hue-picker.native.js +1 -2
- package/build-module/color-picker/hue-picker.native.js.map +1 -1
- package/build-module/color-picker/index.native.js +1 -3
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +1 -2
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/color-picker/rgb-input.js +1 -3
- package/build-module/color-picker/rgb-input.js.map +1 -1
- package/build-module/color-picker/saturation-picker.native.js +1 -2
- package/build-module/color-picker/saturation-picker.native.js.map +1 -1
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +2 -3
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/composite/legacy/index.js.map +1 -1
- package/build-module/confirm-dialog/component.js +1 -3
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/context/context-connect.js +1 -0
- package/build-module/context/context-connect.js.map +1 -1
- package/build-module/context/context-system-provider.js +1 -1
- package/build-module/context/context-system-provider.js.map +1 -1
- package/build-module/context/get-styled-class-name-from-key.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -3
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -2
- package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +1 -2
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.native.js +1 -3
- package/build-module/custom-gradient-picker/index.native.js.map +1 -1
- 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 +1 -3
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/custom-select-control-v2/custom-select.js +1 -2
- package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
- package/build-module/custom-select-control-v2/item.js +1 -2
- package/build-module/custom-select-control-v2/item.js.map +1 -1
- package/build-module/custom-select-control-v2/styles.js.map +1 -1
- package/build-module/dashicon/index.js.map +1 -1
- package/build-module/date-time/date/index.js +1 -2
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/date-time/date-time/index.js +1 -3
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/date-time/time/index.js +1 -2
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/date-time/time/time-input/index.js +1 -2
- package/build-module/date-time/time/time-input/index.js.map +1 -1
- package/build-module/date-time/time/timezone.js.map +1 -1
- package/build-module/dimension-control/index.js +1 -3
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/draggable/index.js +1 -3
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/drop-zone/index.js +1 -2
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/dropdown/index.js +1 -2
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/dropdown/index.native.js +1 -2
- package/build-module/dropdown/index.native.js.map +1 -1
- package/build-module/dropdown-menu/index.js +1 -2
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +1 -2
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/dropdown-menu-v2/checkbox-item.js +1 -2
- package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -1
- package/build-module/dropdown-menu-v2/index.js +1 -3
- package/build-module/dropdown-menu-v2/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/item.js +1 -2
- package/build-module/dropdown-menu-v2/item.js.map +1 -1
- package/build-module/dropdown-menu-v2/radio-item.js +1 -2
- package/build-module/dropdown-menu-v2/radio-item.js.map +1 -1
- package/build-module/dropdown-menu-v2/styles.js.map +1 -1
- package/build-module/duotone-picker/color-list-picker/index.js +1 -3
- package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
- package/build-module/duotone-picker/duotone-picker.js +1 -2
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/duotone-picker/utils.js.map +1 -1
- package/build-module/elevation/hook.js.map +1 -1
- package/build-module/external-link/index.js +21 -25
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/external-link/index.native.js +1 -2
- package/build-module/external-link/index.native.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +1 -2
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.native.js +1 -2
- package/build-module/focal-point-picker/focal-point.native.js.map +1 -1
- package/build-module/focal-point-picker/grid.js +1 -2
- package/build-module/focal-point-picker/grid.js.map +1 -1
- package/build-module/focal-point-picker/index.js +1 -2
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/index.native.js +1 -2
- package/build-module/focal-point-picker/index.native.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build-module/focal-point-picker/tooltip/index.native.js +1 -2
- package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build-module/font-size-picker/index.js +1 -2
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/index.native.js +1 -3
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/form-file-upload/index.js +1 -2
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/form-toggle/index.js +1 -2
- package/build-module/form-toggle/index.js.map +1 -1
- package/build-module/form-token-field/index.js +3 -3
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +1 -2
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/form-token-field/token-input.js.map +1 -1
- package/build-module/form-token-field/token.js +2 -3
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/gradient-picker/index.js +1 -2
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/grid/hook.js.map +1 -1
- package/build-module/guide/index.js +1 -2
- package/build-module/guide/index.js.map +1 -1
- package/build-module/guide/page-control.js +1 -1
- package/build-module/guide/page-control.js.map +1 -1
- package/build-module/h-stack/hook.js.map +1 -1
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.js +3 -4
- package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build-module/index.js +14 -4
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +1 -2
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/item-group/styles.js.map +1 -1
- package/build-module/keyboard-shortcuts/index.js +1 -3
- package/build-module/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/menu-group/index.js +1 -2
- package/build-module/menu-group/index.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 +1 -2
- package/build-module/menu-items-choice/index.js.map +1 -1
- package/build-module/mobile/badge/index.native.js +1 -3
- package/build-module/mobile/badge/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -2
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +5 -6
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/color-cell.native.js +1 -2
- package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js +1 -3
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -2
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -2
- package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js +2 -3
- package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-text-input.native.js +1 -2
- package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +2 -3
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js +1 -2
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js +1 -2
- package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
- package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
- package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/switch-cell.native.js +4 -4
- package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -3
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-text-control/index.native.js +1 -3
- package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/gradient-picker-screen.native.js +1 -2
- package/build-module/mobile/color-settings/gradient-picker-screen.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +1 -2
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +1 -3
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/cycle-select-control/index.native.js.map +1 -1
- package/build-module/mobile/focal-point-settings-panel/index.native.js +1 -2
- package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js +1 -2
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/html-text-input/index.native.js +1 -2
- package/build-module/mobile/html-text-input/index.native.js.map +1 -1
- package/build-module/mobile/image/icon-retry.native.js +1 -2
- package/build-module/mobile/image/icon-retry.native.js.map +1 -1
- package/build-module/mobile/image/image-editing-button.native.js +1 -2
- package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
- package/build-module/mobile/image/index.native.js +1 -3
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js +1 -2
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +2 -3
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +1 -3
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -2
- package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
- package/build-module/mobile/picker/index.android.js +1 -2
- package/build-module/mobile/picker/index.android.js.map +1 -1
- package/build-module/mobile/segmented-control/index.native.js +1 -2
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build-module/modal/aria-helper.js +2 -1
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +3 -4
- package/build-module/modal/index.js.map +1 -1
- package/build-module/modal/use-modal-exit-animation.js.map +1 -1
- package/build-module/navigation/back-button/index.js +1 -2
- package/build-module/navigation/back-button/index.js.map +1 -1
- package/build-module/navigation/group/index.js +1 -2
- package/build-module/navigation/group/index.js.map +1 -1
- package/build-module/navigation/item/base-content.js +1 -3
- package/build-module/navigation/item/base-content.js.map +1 -1
- package/build-module/navigation/item/base.js.map +1 -1
- package/build-module/navigation/item/index.js +1 -2
- package/build-module/navigation/item/index.js.map +1 -1
- package/build-module/navigation/menu/index.js +1 -2
- package/build-module/navigation/menu/index.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +2 -2
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/menu-title.js +1 -2
- package/build-module/navigation/menu/menu-title.js.map +1 -1
- package/build-module/navigation/menu/search-no-results-found.js +1 -2
- package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
- package/build-module/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/navigator/index.js +130 -5
- package/build-module/navigator/index.js.map +1 -1
- package/build-module/navigator/legacy.js +167 -0
- package/build-module/navigator/legacy.js.map +1 -0
- package/build-module/navigator/{navigator-provider → navigator}/component.js +4 -39
- package/build-module/navigator/navigator/component.js.map +1 -0
- package/build-module/navigator/navigator-back-button/component.js +1 -37
- package/build-module/navigator/navigator-back-button/component.js.map +1 -1
- package/build-module/navigator/navigator-back-button/hook.js +1 -1
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-button/component.js +1 -36
- package/build-module/navigator/navigator-button/component.js.map +1 -1
- package/build-module/navigator/navigator-button/hook.js +1 -1
- package/build-module/navigator/navigator-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +39 -61
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/use-screen-animate-presence.js +106 -0
- package/build-module/navigator/navigator-screen/use-screen-animate-presence.js.map +1 -0
- package/build-module/navigator/navigator-to-parent-button/component.js +2 -6
- package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
- package/build-module/navigator/styles.js +77 -33
- package/build-module/navigator/styles.js.map +1 -1
- package/build-module/navigator/types.js.map +1 -1
- package/build-module/navigator/use-navigator.js +4 -1
- package/build-module/navigator/use-navigator.js.map +1 -1
- package/build-module/notice/index.js +1 -2
- package/build-module/notice/index.js.map +1 -1
- package/build-module/notice/index.native.js +1 -3
- package/build-module/notice/index.native.js.map +1 -1
- package/build-module/number-control/index.js +1 -3
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/number-control/styles/number-control-styles.js.map +1 -1
- package/build-module/palette-edit/index.js +2 -4
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/panel/actions.native.js +1 -2
- package/build-module/panel/actions.native.js.map +1 -1
- package/build-module/panel/body.js +1 -2
- package/build-module/panel/body.js.map +1 -1
- package/build-module/panel/body.native.js +1 -2
- package/build-module/panel/body.native.js.map +1 -1
- package/build-module/panel/header.js +1 -2
- package/build-module/panel/header.js.map +1 -1
- package/build-module/panel/index.js +1 -2
- package/build-module/panel/index.js.map +1 -1
- package/build-module/placeholder/index.js +1 -2
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/popover/index.js +2 -4
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/overlay-middlewares.js.map +1 -1
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/progress-bar/index.js +1 -2
- package/build-module/progress-bar/index.js.map +1 -1
- package/build-module/progress-bar/styles.js.map +1 -1
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/query-controls/index.native.js +1 -3
- package/build-module/query-controls/index.native.js.map +1 -1
- package/build-module/radio-control/index.js +1 -2
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/radio-control/index.native.js +1 -2
- package/build-module/radio-control/index.native.js.map +1 -1
- package/build-module/range-control/index.js +1 -2
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/index.native.js.map +1 -1
- package/build-module/range-control/mark.js +1 -3
- package/build-module/range-control/mark.js.map +1 -1
- package/build-module/range-control/rail.js +1 -3
- package/build-module/range-control/rail.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +32 -32
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/range-control/tooltip.js +1 -1
- package/build-module/range-control/tooltip.js.map +1 -1
- package/build-module/range-control/utils.js.map +1 -1
- package/build-module/resizable-box/index.js +1 -2
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +1 -2
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
- 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/sandbox/index.js +1 -2
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/index.native.js +1 -2
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/search-control/index.js +11 -2
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/search-control/index.native.js +1 -2
- package/build-module/search-control/index.native.js.map +1 -1
- package/build-module/search-control/types.js.map +1 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/index.native.js.map +1 -1
- package/build-module/slot-fill/index.js +1 -3
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/slot-fill/slot.js +1 -2
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/snackbar/index.js +1 -2
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +1 -2
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/spinner/index.js +1 -2
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/spinner/styles.js.map +1 -1
- package/build-module/style-provider/index.js +1 -0
- package/build-module/style-provider/index.js.map +1 -1
- package/build-module/surface/hook.js.map +1 -1
- package/build-module/surface/styles.js.map +1 -1
- package/build-module/tab-panel/index.js +1 -2
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/styles.js +28 -6
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tab.js +9 -4
- package/build-module/tabs/tab.js.map +1 -1
- package/build-module/tabs/tablist.js +72 -40
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/tabs/tabpanel.js.map +1 -1
- package/build-module/tabs/use-track-overflow.js +67 -0
- package/build-module/tabs/use-track-overflow.js.map +1 -0
- package/build-module/text/get-line-height.js.map +1 -1
- package/build-module/text/styles/text-mixins.native.js.map +1 -1
- package/build-module/text/utils.js.map +1 -1
- package/build-module/text-control/index.native.js.map +1 -1
- package/build-module/text-highlight/index.js +1 -2
- package/build-module/text-highlight/index.js.map +1 -1
- package/build-module/textarea-control/index.js.map +1 -1
- package/build-module/theme/color-algorithms.js.map +1 -1
- package/build-module/theme/styles.js.map +1 -1
- package/build-module/tip/index.js +1 -2
- package/build-module/tip/index.js.map +1 -1
- 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.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +4 -2
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +14 -3
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +17 -12
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +16 -25
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +7 -8
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build-module/toggle-group-control/types.js.map +1 -1
- package/build-module/toolbar/toolbar/index.js.map +1 -1
- package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js +2 -2
- package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js.map +1 -1
- package/build-module/toolbar/toolbar-group/index.js +1 -2
- package/build-module/toolbar/toolbar-group/index.js.map +1 -1
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +1 -2
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +1 -3
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tooltip/index.js +1 -2
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tooltip/index.native.js +1 -3
- package/build-module/tooltip/index.native.js.map +1 -1
- package/build-module/tree-grid/cell.js +1 -2
- package/build-module/tree-grid/cell.js.map +1 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/index.native.js +1 -3
- package/build-module/unit-control/index.native.js.map +1 -1
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/breakpoint.js.map +1 -1
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/element-rect.js +22 -12
- package/build-module/utils/element-rect.js.map +1 -1
- package/build-module/utils/font-size.js.map +1 -1
- package/build-module/utils/hooks/use-animated-offset-rect.js +74 -0
- package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -0
- package/build-module/utils/hooks/use-cx.js.map +1 -1
- package/build-module/utils/hooks/use-on-value-update.js +3 -6
- package/build-module/utils/hooks/use-on-value-update.js.map +1 -1
- package/build-module/utils/math.js +2 -2
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/space.js.map +1 -1
- package/build-module/utils/unit-values.js.map +1 -1
- package/build-module/utils/use-responsive-value.js.map +1 -1
- package/build-style/style-rtl.css +30 -14
- package/build-style/style.css +30 -14
- package/build-types/alignment-matrix-control/types.d.ts +2 -0
- package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/component.d.ts +5 -15
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +2 -1
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
- package/build-types/border-box-control/stories/index.story.d.ts +3 -2
- package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +3 -2
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts +2 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
- package/build-types/border-control/stories/index.story.d.ts +15 -30
- package/build-types/border-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +12 -7
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/box-control/index.d.ts +4 -4
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +3 -3
- package/build-types/composite/stories/index.story.d.ts +22 -0
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
- package/build-types/index.d.ts +23 -4
- package/build-types/index.d.ts.map +1 -1
- package/build-types/modal/aria-helper.d.ts.map +1 -1
- package/build-types/navigator/index.d.ts +171 -5
- package/build-types/navigator/index.d.ts.map +1 -1
- package/build-types/navigator/legacy.d.ts +226 -0
- package/build-types/navigator/legacy.d.ts.map +1 -0
- package/build-types/navigator/navigator/component.d.ts +3 -0
- package/build-types/navigator/navigator/component.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/component.d.ts +0 -35
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +0 -34
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +0 -35
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/use-screen-animate-presence.d.ts +16 -0
- package/build-types/navigator/navigator-screen/use-screen-animate-presence.d.ts.map +1 -0
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +0 -4
- package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
- package/build-types/navigator/stories/index.story.d.ts +5 -5
- package/build-types/navigator/stories/index.story.d.ts.map +1 -1
- package/build-types/navigator/styles.d.ts +20 -7
- package/build-types/navigator/styles.d.ts.map +1 -1
- package/build-types/navigator/types.d.ts +19 -1
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/navigator/use-navigator.d.ts +4 -1
- package/build-types/navigator/use-navigator.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/search-control/index.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts +0 -8
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/types.d.ts +3 -0
- package/build-types/search-control/types.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts +7 -0
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts +2 -1
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts +7 -0
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tab.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/tabs/use-track-overflow.d.ts +17 -0
- package/build-types/tabs/use-track-overflow.d.ts.map +1 -0
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +0 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +2 -1
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/utils/element-rect.d.ts +8 -0
- package/build-types/utils/element-rect.d.ts.map +1 -1
- package/build-types/utils/hooks/use-animated-offset-rect.d.ts +62 -0
- package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -0
- package/build-types/utils/hooks/use-on-value-update.d.ts.map +1 -1
- package/package.json +20 -20
- package/schemas/docs-manifest.json +38 -0
- package/src/alignment-matrix-control/README.md +46 -36
- package/src/alignment-matrix-control/docs-manifest.json +12 -0
- package/src/alignment-matrix-control/types.ts +2 -0
- package/src/angle-picker-control/README.md +36 -23
- package/src/angle-picker-control/docs-manifest.json +5 -0
- package/src/autocomplete/index.tsx +4 -1
- package/src/border-box-control/border-box-control/README.md +22 -26
- package/src/border-box-control/border-box-control/component.tsx +3 -14
- package/src/border-box-control/stories/index.story.tsx +2 -1
- package/src/border-control/border-control/README.md +26 -36
- package/src/border-control/border-control/component.tsx +1 -2
- package/src/border-control/border-control-dropdown/component.tsx +1 -15
- package/src/border-control/stories/index.story.tsx +4 -10
- package/src/border-control/styles.ts +0 -1
- package/src/border-control/test/index.js +2 -15
- package/src/border-control/types.ts +12 -7
- package/src/box-control/README.md +9 -12
- package/src/box-control/index.tsx +4 -4
- package/src/box-control/stories/index.story.tsx +1 -1
- package/src/box-control/types.ts +3 -3
- package/src/button/style.scss +5 -1
- package/src/composite/legacy/test/index.tsx +22 -21
- package/src/composite/stories/index.story.tsx +42 -0
- package/src/composite/test/index.tsx +629 -38
- package/src/dropdown/stories/index.story.tsx +1 -0
- package/src/dropdown/style.scss +10 -13
- package/src/dropdown-menu/stories/index.story.tsx +3 -0
- package/src/index.ts +19 -1
- package/src/menu-group/style.scss +4 -1
- package/src/menu-items-choice/style.scss +2 -0
- package/src/modal/aria-helper.ts +1 -0
- package/src/navigator/README.md +176 -0
- package/src/navigator/index.tsx +131 -0
- package/src/navigator/legacy.ts +169 -0
- package/src/navigator/{navigator-provider → navigator}/component.tsx +6 -44
- package/src/navigator/navigator-back-button/component.tsx +1 -37
- package/src/navigator/navigator-back-button/hook.ts +1 -1
- package/src/navigator/navigator-button/component.tsx +1 -36
- package/src/navigator/navigator-button/hook.ts +1 -1
- package/src/navigator/navigator-screen/component.tsx +48 -76
- package/src/navigator/navigator-screen/use-screen-animate-presence.ts +177 -0
- package/src/navigator/navigator-to-parent-button/component.tsx +2 -7
- package/src/navigator/stories/index.story.tsx +55 -54
- package/src/navigator/styles.ts +112 -41
- package/src/navigator/test/index.tsx +47 -47
- package/src/navigator/types.ts +19 -1
- package/src/navigator/use-navigator.ts +4 -1
- package/src/range-control/styles/range-control-styles.ts +19 -10
- package/src/range-control/tooltip.tsx +1 -1
- package/src/search-control/README.md +2 -0
- package/src/search-control/index.tsx +9 -2
- package/src/search-control/stories/index.story.tsx +0 -15
- package/src/search-control/test/index.tsx +4 -1
- package/src/search-control/types.ts +3 -0
- package/src/select-control/stories/index.story.tsx +14 -1
- package/src/tabs/stories/index.story.tsx +106 -0
- package/src/tabs/styles.ts +161 -58
- package/src/tabs/tab.tsx +8 -2
- package/src/tabs/tablist.tsx +72 -39
- package/src/tabs/use-track-overflow.ts +76 -0
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +208 -44
- package/src/toggle-group-control/test/index.tsx +26 -0
- package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +18 -10
- package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +30 -12
- package/src/toggle-group-control/toggle-group-control/component.tsx +19 -6
- package/src/toggle-group-control/toggle-group-control/styles.ts +41 -0
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +15 -28
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +0 -11
- package/src/toggle-group-control/types.ts +3 -1
- package/src/tools-panel/tools-panel/README.md +10 -10
- package/src/utils/element-rect.ts +32 -15
- package/src/utils/hooks/use-animated-offset-rect.ts +107 -0
- package/src/utils/hooks/use-on-value-update.ts +3 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/build/navigator/navigator-provider/component.js.map +0 -1
- package/build/utils/hooks/use-event.js +0 -41
- package/build/utils/hooks/use-event.js.map +0 -1
- package/build-module/navigator/navigator-provider/component.js.map +0 -1
- package/build-module/utils/hooks/use-event.js +0 -35
- package/build-module/utils/hooks/use-event.js.map +0 -1
- package/build-types/navigator/navigator-provider/component.d.ts +0 -37
- package/build-types/navigator/navigator-provider/component.d.ts.map +0 -1
- package/build-types/utils/hooks/use-event.d.ts +0 -20
- package/build-types/utils/hooks/use-event.d.ts.map +0 -1
- package/src/navigator/index.ts +0 -6
- package/src/navigator/navigator-back-button/README.md +0 -15
- package/src/navigator/navigator-button/README.md +0 -38
- package/src/navigator/navigator-provider/README.md +0 -94
- package/src/navigator/navigator-screen/README.md +0 -33
- package/src/navigator/navigator-to-parent-button/README.md +0 -17
- package/src/utils/hooks/use-event.ts +0 -38
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useInstanceId","useMergeRefs","__","Icon","search","closeSmall","forwardRef","useMemo","useRef","Button","ContextSystemProvider","StyledInputControl","SuffixItemWrapper","jsx","_jsx","SuffixItem","searchRef","value","onChange","onClose","icon","onReset","current","focus","size","label","onClick","UnforwardedSearchControl","__nextHasNoMarginBottom","className","placeholder","hideLabelFromVision","restProps","forwardedRef","disabled","instanceId","SearchControl","contextValue","BaseControl","_overrides","__associatedWPComponentName","InputBase","isBorderless","children","__next40pxDefaultSize","id","ref","type","nextValue","autoComplete","suffix"],"sources":["@wordpress/components/src/search-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, search, closeSmall } from '@wordpress/icons';\nimport { forwardRef, useMemo, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { SearchControlProps, SuffixItemProps } from './types';\nimport type { ForwardedRef } from 'react';\nimport { ContextSystemProvider } from '../context';\nimport { StyledInputControl, SuffixItemWrapper } from './styles';\n\nfunction SuffixItem( {\n\tsearchRef,\n\tvalue,\n\tonChange,\n\tonClose,\n}: SuffixItemProps ) {\n\tif ( ! onClose && ! value ) {\n\t\treturn <Icon icon={ search } />;\n\t}\n\n\tconst onReset = () => {\n\t\tonChange( '' );\n\t\tsearchRef.current?.focus();\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\tsize=\"small\"\n\t\t\ticon={ closeSmall }\n\t\t\tlabel={ onClose ? __( 'Close search' ) : __( 'Reset search' ) }\n\t\t\tonClick={ onClose ?? onReset }\n\t\t/>\n\t);\n}\n\nfunction UnforwardedSearchControl(\n\t{\n\t\t__nextHasNoMarginBottom = false,\n\t\tclassName,\n\t\tonChange,\n\t\tvalue,\n\t\tlabel = __( 'Search' ),\n\t\tplaceholder = __( 'Search' ),\n\t\thideLabelFromVision = true,\n\t\tonClose,\n\t\tsize = 'default',\n\t\t...restProps\n\t}: Omit<\n\t\tWordPressComponentProps< SearchControlProps, 'input', false >,\n\t\t// TODO: Background styling currently doesn't support a disabled state. Needs design work.\n\t\t'disabled'\n\t>,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\t// @ts-expect-error The `disabled` prop is not yet supported in the SearchControl component.\n\t// Work with the design team (@WordPress/gutenberg-design) if you need this feature.\n\
|
|
1
|
+
{"version":3,"names":["clsx","useInstanceId","useMergeRefs","__","Icon","search","closeSmall","forwardRef","useMemo","useRef","deprecated","Button","ContextSystemProvider","StyledInputControl","SuffixItemWrapper","jsx","_jsx","SuffixItem","searchRef","value","onChange","onClose","icon","since","onReset","current","focus","size","label","onClick","UnforwardedSearchControl","__nextHasNoMarginBottom","className","placeholder","hideLabelFromVision","restProps","forwardedRef","disabled","filteredRestProps","instanceId","SearchControl","contextValue","BaseControl","_overrides","__associatedWPComponentName","InputBase","isBorderless","children","__next40pxDefaultSize","id","ref","type","nextValue","autoComplete","suffix"],"sources":["@wordpress/components/src/search-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, search, closeSmall } from '@wordpress/icons';\nimport { forwardRef, useMemo, useRef } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { SearchControlProps, SuffixItemProps } from './types';\nimport type { ForwardedRef } from 'react';\nimport { ContextSystemProvider } from '../context';\nimport { StyledInputControl, SuffixItemWrapper } from './styles';\n\nfunction SuffixItem( {\n\tsearchRef,\n\tvalue,\n\tonChange,\n\tonClose,\n}: SuffixItemProps ) {\n\tif ( ! onClose && ! value ) {\n\t\treturn <Icon icon={ search } />;\n\t}\n\n\tif ( onClose ) {\n\t\tdeprecated( '`onClose` prop in wp.components.SearchControl', {\n\t\t\tsince: '6.8',\n\t\t} );\n\t}\n\n\tconst onReset = () => {\n\t\tonChange( '' );\n\t\tsearchRef.current?.focus();\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\tsize=\"small\"\n\t\t\ticon={ closeSmall }\n\t\t\tlabel={ onClose ? __( 'Close search' ) : __( 'Reset search' ) }\n\t\t\tonClick={ onClose ?? onReset }\n\t\t/>\n\t);\n}\n\nfunction UnforwardedSearchControl(\n\t{\n\t\t__nextHasNoMarginBottom = false,\n\t\tclassName,\n\t\tonChange,\n\t\tvalue,\n\t\tlabel = __( 'Search' ),\n\t\tplaceholder = __( 'Search' ),\n\t\thideLabelFromVision = true,\n\t\tonClose,\n\t\tsize = 'default',\n\t\t...restProps\n\t}: Omit<\n\t\tWordPressComponentProps< SearchControlProps, 'input', false >,\n\t\t// TODO: Background styling currently doesn't support a disabled state. Needs design work.\n\t\t'disabled'\n\t>,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\t// @ts-expect-error The `disabled` prop is not yet supported in the SearchControl component.\n\t// Work with the design team (@WordPress/gutenberg-design) if you need this feature.\n\tconst { disabled, ...filteredRestProps } = restProps;\n\n\tconst searchRef = useRef< HTMLInputElement >( null );\n\tconst instanceId = useInstanceId(\n\t\tSearchControl,\n\t\t'components-search-control'\n\t);\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tBaseControl: {\n\t\t\t\t// Overrides the underlying BaseControl `__nextHasNoMarginBottom` via the context system\n\t\t\t\t// to provide backwards compatibile margin for SearchControl.\n\t\t\t\t// (In a standard InputControl, the BaseControl `__nextHasNoMarginBottom` is always set to true.)\n\t\t\t\t_overrides: { __nextHasNoMarginBottom },\n\t\t\t\t__associatedWPComponentName: 'SearchControl',\n\t\t\t},\n\t\t\t// `isBorderless` is still experimental and not a public prop for InputControl yet.\n\t\t\tInputBase: { isBorderless: true },\n\t\t} ),\n\t\t[ __nextHasNoMarginBottom ]\n\t);\n\n\treturn (\n\t\t<ContextSystemProvider value={ contextValue }>\n\t\t\t<StyledInputControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tid={ instanceId }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tlabel={ label }\n\t\t\t\tref={ useMergeRefs( [ searchRef, forwardedRef ] ) }\n\t\t\t\ttype=\"search\"\n\t\t\t\tsize={ size }\n\t\t\t\tclassName={ clsx( 'components-search-control', className ) }\n\t\t\t\tonChange={ ( nextValue?: string ) =>\n\t\t\t\t\tonChange( nextValue ?? '' )\n\t\t\t\t}\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tvalue={ value ?? '' }\n\t\t\t\tsuffix={\n\t\t\t\t\t<SuffixItemWrapper size={ size }>\n\t\t\t\t\t\t<SuffixItem\n\t\t\t\t\t\t\tsearchRef={ searchRef }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</SuffixItemWrapper>\n\t\t\t\t}\n\t\t\t\t{ ...filteredRestProps }\n\t\t\t/>\n\t\t</ContextSystemProvider>\n\t);\n}\n\n/**\n * SearchControl components let users display a search control.\n *\n * ```jsx\n * import { SearchControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function MySearchControl( { className, setState } ) {\n * const [ searchInput, setSearchInput ] = useState( '' );\n *\n * return (\n * <SearchControl\n * __nextHasNoMarginBottom\n * value={ searchInput }\n * onChange={ setSearchInput }\n * />\n * );\n * }\n * ```\n */\nexport const SearchControl = forwardRef( UnforwardedSearchControl );\n\nexport default SearchControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,EAAEC,YAAY,QAAQ,oBAAoB;AAChE,SAASC,EAAE,QAAQ,iBAAiB;AAC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AI,EAAGA,IAAM;QAAAoB,QAAA,eAC/B/B,IAAA,CAACC,UAAU;UACVC,SAAS,EAAGA,SAAW;UACvBC,KAAK,EAAGA,KAAO;UACfC,QAAQ,EAAGA,QAAU;UACrBC,OAAO,EAAGA;QAAS,CACnB;MAAC,CACgB,CACnB;MAAA,GACIiB;IAAiB,CACtB;EAAC,CACoB,CAAC;AAE1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,aAAa,GAAGjC,UAAU,CAAEuB,wBAAyB,CAAC;AAEnE,eAAeU,aAAa","ignoreList":[]}
|
|
@@ -19,8 +19,7 @@ import Button from '../button';
|
|
|
19
19
|
import Gridicons from '../mobile/gridicons';
|
|
20
20
|
|
|
21
21
|
// Merge platform specific styles with the default styles.
|
|
22
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
23
|
const baseStyles = {
|
|
25
24
|
...allStyles
|
|
26
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TextInput","Text","View","TouchableOpacity","Platform","useColorScheme","Keyboard","useState","useRef","useMemo","useEffect","useCallback","__","Icon","cancelCircleFilled","cancelCircleFilledIcon","arrowLeft","arrowLeftIcon","close","closeIcon","allStyles","platformStyles","Button","Gridicons","jsx","_jsx","jsxs","_jsxs","baseStyles","selector","selectModifiedStyles","styles","modifier","modifierMatcher","RegExp","modifierSelectors","Object","keys","filter","match","reduce","modifiedStyles","modifierSelector","blockElementSelector","split","mergeStyles","updateStyles","selectors","forEach","SearchControl","value","onChange","placeholder","isActive","setIsActive","currentStyles","setCurrentStyles","isDark","inputRef","onCancelTimer","isIOS","OS","darkStyles","activeStyles","activeDarkStyles","futureStyles","mergeFutureStyles","shouldUseConditions","shouldUseModified","every","should","updatedStyles","clearInput","onPress","current","focus","onFocus","onCancel","clearTimeout","setTimeout","blur","onKeyboardDidHide","keyboardHideSubscription","addListener","remove","containerStyle","innerContainerStyle","inputContainerStyle","formInputStyle","placeholderStyle","inputButtonStyle","inputButtonLeftStyle","inputButtonRightStyle","cancelButtonStyle","cancelButtonTextStyle","iconStyle","rightIconStyle","renderLeftButton","button","label","icon","onClick","style","search","fill","color","children","renderRightButton","renderCancel","accessible","accessibilityRole","accessibilityLabel","accessibilityHint","activeOpacity","ref","placeholderTextColor","onChangeText"],"sources":["@wordpress/components/src/search-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tTextInput,\n\tText,\n\tView,\n\tTouchableOpacity,\n\tPlatform,\n\tuseColorScheme,\n\tKeyboard,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseRef,\n\tuseMemo,\n\tuseEffect,\n\tuseCallback,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tIcon,\n\tcancelCircleFilled as cancelCircleFilledIcon,\n\tarrowLeft as arrowLeftIcon,\n\tclose as closeIcon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport allStyles from './style.scss';\nimport platformStyles from './platform-style.scss';\nimport Button from '../button';\nimport Gridicons from '../mobile/gridicons';\n\n// Merge platform specific styles with the default styles.\nconst baseStyles = { ...allStyles };\nfor ( const selector in platformStyles ) {\n\tbaseStyles[ selector ] = {\n\t\t...baseStyles[ selector ],\n\t\t...platformStyles[ selector ],\n\t};\n}\n\nfunction selectModifiedStyles( styles, modifier ) {\n\tconst modifierMatcher = new RegExp( `--${ modifier }$` );\n\tconst modifierSelectors = Object.keys( styles ).filter( ( selector ) =>\n\t\tselector.match( modifierMatcher )\n\t);\n\n\treturn modifierSelectors.reduce( ( modifiedStyles, modifierSelector ) => {\n\t\tconst blockElementSelector = modifierSelector.split( '--' )[ 0 ];\n\t\tmodifiedStyles[ blockElementSelector ] = styles[ modifierSelector ];\n\t\treturn modifiedStyles;\n\t}, {} );\n}\n\nfunction mergeStyles( styles, updateStyles, selectors ) {\n\tselectors.forEach( ( selector ) => {\n\t\tstyles[ selector ] = {\n\t\t\t...styles[ selector ],\n\t\t\t...updateStyles[ selector ],\n\t\t};\n\t} );\n\n\treturn styles;\n}\n\nfunction SearchControl( {\n\tvalue,\n\tonChange,\n\tplaceholder = __( 'Search blocks' ),\n} ) {\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst [ currentStyles, setCurrentStyles ] = useState( baseStyles );\n\n\tconst isDark = useColorScheme() === 'dark';\n\tconst inputRef = useRef();\n\tconst onCancelTimer = useRef();\n\n\tconst isIOS = Platform.OS === 'ios';\n\n\tconst darkStyles = useMemo( () => {\n\t\treturn selectModifiedStyles( baseStyles, 'dark' );\n\t}, [] );\n\n\tconst activeStyles = useMemo( () => {\n\t\treturn selectModifiedStyles( baseStyles, 'active' );\n\t}, [] );\n\n\tconst activeDarkStyles = useMemo( () => {\n\t\treturn selectModifiedStyles( baseStyles, 'active-dark' );\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tlet futureStyles = { ...baseStyles };\n\n\t\tfunction mergeFutureStyles( modifiedStyles, shouldUseConditions ) {\n\t\t\tconst shouldUseModified = shouldUseConditions.every(\n\t\t\t\t( should ) => should\n\t\t\t);\n\n\t\t\tconst updatedStyles = shouldUseModified\n\t\t\t\t? modifiedStyles\n\t\t\t\t: futureStyles;\n\n\t\t\tconst selectors = Object.keys( modifiedStyles );\n\n\t\t\tfutureStyles = mergeStyles(\n\t\t\t\tfutureStyles,\n\t\t\t\tupdatedStyles,\n\t\t\t\tselectors\n\t\t\t);\n\t\t}\n\n\t\tmergeFutureStyles( activeStyles, [ isActive ] );\n\t\tmergeFutureStyles( darkStyles, [ isDark ] );\n\t\tmergeFutureStyles( activeDarkStyles, [ isActive, isDark ] );\n\n\t\tsetCurrentStyles( futureStyles );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ isActive, isDark ] );\n\n\tconst clearInput = useCallback( () => {\n\t\tonChange( '' );\n\t}, [ onChange ] );\n\n\tconst onPress = useCallback( () => {\n\t\tsetIsActive( true );\n\t\tinputRef.current?.focus();\n\t}, [] );\n\n\tconst onFocus = useCallback( () => {\n\t\tsetIsActive( true );\n\t}, [] );\n\n\tconst onCancel = useCallback( () => {\n\t\tclearTimeout( onCancelTimer.current );\n\t\tonCancelTimer.current = setTimeout( () => {\n\t\t\tinputRef.current?.blur();\n\t\t\tclearInput();\n\t\t\tsetIsActive( false );\n\t\t}, 0 );\n\t}, [ clearInput ] );\n\n\tconst onKeyboardDidHide = useCallback( () => {\n\t\tif ( ! isIOS ) {\n\t\t\tonCancel();\n\t\t}\n\t}, [ isIOS, onCancel ] );\n\n\tuseEffect( () => {\n\t\tconst keyboardHideSubscription = Keyboard.addListener(\n\t\t\t'keyboardDidHide',\n\t\t\tonKeyboardDidHide\n\t\t);\n\t\treturn () => {\n\t\t\tclearTimeout( onCancelTimer.current );\n\t\t\tkeyboardHideSubscription.remove();\n\t\t};\n\t}, [ onKeyboardDidHide ] );\n\n\tconst {\n\t\t'search-control__container': containerStyle,\n\t\t'search-control__inner-container': innerContainerStyle,\n\t\t'search-control__input-container': inputContainerStyle,\n\t\t'search-control__form-input': formInputStyle,\n\t\t'search-control__form-input-placeholder': placeholderStyle,\n\t\t'search-control__input-button': inputButtonStyle,\n\t\t'search-control__input-button-left': inputButtonLeftStyle,\n\t\t'search-control__input-button-right': inputButtonRightStyle,\n\t\t'search-control__cancel-button': cancelButtonStyle,\n\t\t'search-control__cancel-button-text': cancelButtonTextStyle,\n\t\t'search-control__icon': iconStyle,\n\t\t'search-control__right-icon': rightIconStyle,\n\t} = currentStyles;\n\n\tfunction renderLeftButton() {\n\t\tconst button =\n\t\t\t! isIOS && isActive ? (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ __( 'Cancel search' ) }\n\t\t\t\t\ticon={ arrowLeftIcon }\n\t\t\t\t\tonClick={ onCancel }\n\t\t\t\t\tstyle={ iconStyle }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Icon icon={ Gridicons.search } fill={ iconStyle?.color } />\n\t\t\t);\n\n\t\treturn (\n\t\t\t<View style={ [ inputButtonStyle, inputButtonLeftStyle ] }>\n\t\t\t\t{ button }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tfunction renderRightButton() {\n\t\tlet button;\n\n\t\t// Add a View element to properly center the input placeholder via flexbox.\n\t\tif ( isIOS && ! isActive ) {\n\t\t\tbutton = <View />;\n\t\t}\n\n\t\tif ( !! value ) {\n\t\t\tbutton = (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ __( 'Clear search' ) }\n\t\t\t\t\ticon={ isIOS ? cancelCircleFilledIcon : closeIcon }\n\t\t\t\t\tonClick={ clearInput }\n\t\t\t\t\tstyle={ [ iconStyle, rightIconStyle ] }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<View style={ [ inputButtonStyle, inputButtonRightStyle ] }>\n\t\t\t\t{ button }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tfunction renderCancel() {\n\t\tif ( ! isIOS ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View style={ cancelButtonStyle }>\n\t\t\t\t<Text\n\t\t\t\t\tonPress={ onCancel }\n\t\t\t\t\tstyle={ cancelButtonTextStyle }\n\t\t\t\t\taccessible\n\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\taccessibilityLabel={ __( 'Cancel search' ) }\n\t\t\t\t\taccessibilityHint={ __( 'Cancel search' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</Text>\n\t\t\t</View>\n\t\t);\n\t}\n\n\treturn (\n\t\t<TouchableOpacity\n\t\t\tstyle={ containerStyle }\n\t\t\tonPress={ onPress }\n\t\t\tactiveOpacity={ 1 }\n\t\t>\n\t\t\t<View style={ innerContainerStyle }>\n\t\t\t\t<View style={ inputContainerStyle }>\n\t\t\t\t\t{ renderLeftButton() }\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tref={ inputRef }\n\t\t\t\t\t\tstyle={ formInputStyle }\n\t\t\t\t\t\tplaceholderTextColor={ placeholderStyle?.color }\n\t\t\t\t\t\tonChangeText={ onChange }\n\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\t/>\n\t\t\t\t\t{ renderRightButton() }\n\t\t\t\t</View>\n\t\t\t\t{ isActive && renderCancel() }\n\t\t\t</View>\n\t\t</TouchableOpacity>\n\t);\n}\n\nexport default SearchControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,SAAS,EACTC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,QAAQ,EACRC,cAAc,EACdC,QAAQ,QACF,cAAc;;AAErB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,WAAW,QACL,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,IAAI,EACJC,kBAAkB,IAAIC,sBAAsB,EAC5CC,SAAS,IAAIC,aAAa,EAC1BC,KAAK,IAAIC,SAAS,QACZ,kBAAkB;;AAEzB;AACA;AACA;AACA,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,cAAc,MAAM,uBAAuB;AAClD,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,SAAS,MAAM,qBAAqB;;AAE3C;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,UAAU,GAAG;EAAE,GAAGR;AAAU,CAAC;AACnC,KAAM,MAAMS,QAAQ,IAAIR,cAAc,EAAG;EACxCO,UA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;UAChDW,YAAY,EAAGjE,QAAU;UACzByB,OAAO,EAAGA,OAAS;UACnB1B,KAAK,EAAGA,KAAO;UACfE,WAAW,EAAGA;QAAa,CAC3B,CAAC,EACAuD,iBAAiB,CAAC,CAAC;MAAA,CAChB,CAAC,EACLtD,QAAQ,IAAIuD,YAAY,CAAC,CAAC;IAAA,CACvB;EAAC,CACU,CAAC;AAErB;AAEA,eAAe3D,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["TextInput","Text","View","TouchableOpacity","Platform","useColorScheme","Keyboard","useState","useRef","useMemo","useEffect","useCallback","__","Icon","cancelCircleFilled","cancelCircleFilledIcon","arrowLeft","arrowLeftIcon","close","closeIcon","allStyles","platformStyles","Button","Gridicons","jsx","_jsx","jsxs","_jsxs","baseStyles","selector","selectModifiedStyles","styles","modifier","modifierMatcher","RegExp","modifierSelectors","Object","keys","filter","match","reduce","modifiedStyles","modifierSelector","blockElementSelector","split","mergeStyles","updateStyles","selectors","forEach","SearchControl","value","onChange","placeholder","isActive","setIsActive","currentStyles","setCurrentStyles","isDark","inputRef","onCancelTimer","isIOS","OS","darkStyles","activeStyles","activeDarkStyles","futureStyles","mergeFutureStyles","shouldUseConditions","shouldUseModified","every","should","updatedStyles","clearInput","onPress","current","focus","onFocus","onCancel","clearTimeout","setTimeout","blur","onKeyboardDidHide","keyboardHideSubscription","addListener","remove","containerStyle","innerContainerStyle","inputContainerStyle","formInputStyle","placeholderStyle","inputButtonStyle","inputButtonLeftStyle","inputButtonRightStyle","cancelButtonStyle","cancelButtonTextStyle","iconStyle","rightIconStyle","renderLeftButton","button","label","icon","onClick","style","search","fill","color","children","renderRightButton","renderCancel","accessible","accessibilityRole","accessibilityLabel","accessibilityHint","activeOpacity","ref","placeholderTextColor","onChangeText"],"sources":["@wordpress/components/src/search-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tTextInput,\n\tText,\n\tView,\n\tTouchableOpacity,\n\tPlatform,\n\tuseColorScheme,\n\tKeyboard,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseRef,\n\tuseMemo,\n\tuseEffect,\n\tuseCallback,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tIcon,\n\tcancelCircleFilled as cancelCircleFilledIcon,\n\tarrowLeft as arrowLeftIcon,\n\tclose as closeIcon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport allStyles from './style.scss';\nimport platformStyles from './platform-style.scss';\nimport Button from '../button';\nimport Gridicons from '../mobile/gridicons';\n\n// Merge platform specific styles with the default styles.\nconst baseStyles = { ...allStyles };\nfor ( const selector in platformStyles ) {\n\tbaseStyles[ selector ] = {\n\t\t...baseStyles[ selector ],\n\t\t...platformStyles[ selector ],\n\t};\n}\n\nfunction selectModifiedStyles( styles, modifier ) {\n\tconst modifierMatcher = new RegExp( `--${ modifier }$` );\n\tconst modifierSelectors = Object.keys( styles ).filter( ( selector ) =>\n\t\tselector.match( modifierMatcher )\n\t);\n\n\treturn modifierSelectors.reduce( ( modifiedStyles, modifierSelector ) => {\n\t\tconst blockElementSelector = modifierSelector.split( '--' )[ 0 ];\n\t\tmodifiedStyles[ blockElementSelector ] = styles[ modifierSelector ];\n\t\treturn modifiedStyles;\n\t}, {} );\n}\n\nfunction mergeStyles( styles, updateStyles, selectors ) {\n\tselectors.forEach( ( selector ) => {\n\t\tstyles[ selector ] = {\n\t\t\t...styles[ selector ],\n\t\t\t...updateStyles[ selector ],\n\t\t};\n\t} );\n\n\treturn styles;\n}\n\nfunction SearchControl( {\n\tvalue,\n\tonChange,\n\tplaceholder = __( 'Search blocks' ),\n} ) {\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst [ currentStyles, setCurrentStyles ] = useState( baseStyles );\n\n\tconst isDark = useColorScheme() === 'dark';\n\tconst inputRef = useRef();\n\tconst onCancelTimer = useRef();\n\n\tconst isIOS = Platform.OS === 'ios';\n\n\tconst darkStyles = useMemo( () => {\n\t\treturn selectModifiedStyles( baseStyles, 'dark' );\n\t}, [] );\n\n\tconst activeStyles = useMemo( () => {\n\t\treturn selectModifiedStyles( baseStyles, 'active' );\n\t}, [] );\n\n\tconst activeDarkStyles = useMemo( () => {\n\t\treturn selectModifiedStyles( baseStyles, 'active-dark' );\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tlet futureStyles = { ...baseStyles };\n\n\t\tfunction mergeFutureStyles( modifiedStyles, shouldUseConditions ) {\n\t\t\tconst shouldUseModified = shouldUseConditions.every(\n\t\t\t\t( should ) => should\n\t\t\t);\n\n\t\t\tconst updatedStyles = shouldUseModified\n\t\t\t\t? modifiedStyles\n\t\t\t\t: futureStyles;\n\n\t\t\tconst selectors = Object.keys( modifiedStyles );\n\n\t\t\tfutureStyles = mergeStyles(\n\t\t\t\tfutureStyles,\n\t\t\t\tupdatedStyles,\n\t\t\t\tselectors\n\t\t\t);\n\t\t}\n\n\t\tmergeFutureStyles( activeStyles, [ isActive ] );\n\t\tmergeFutureStyles( darkStyles, [ isDark ] );\n\t\tmergeFutureStyles( activeDarkStyles, [ isActive, isDark ] );\n\n\t\tsetCurrentStyles( futureStyles );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ isActive, isDark ] );\n\n\tconst clearInput = useCallback( () => {\n\t\tonChange( '' );\n\t}, [ onChange ] );\n\n\tconst onPress = useCallback( () => {\n\t\tsetIsActive( true );\n\t\tinputRef.current?.focus();\n\t}, [] );\n\n\tconst onFocus = useCallback( () => {\n\t\tsetIsActive( true );\n\t}, [] );\n\n\tconst onCancel = useCallback( () => {\n\t\tclearTimeout( onCancelTimer.current );\n\t\tonCancelTimer.current = setTimeout( () => {\n\t\t\tinputRef.current?.blur();\n\t\t\tclearInput();\n\t\t\tsetIsActive( false );\n\t\t}, 0 );\n\t}, [ clearInput ] );\n\n\tconst onKeyboardDidHide = useCallback( () => {\n\t\tif ( ! isIOS ) {\n\t\t\tonCancel();\n\t\t}\n\t}, [ isIOS, onCancel ] );\n\n\tuseEffect( () => {\n\t\tconst keyboardHideSubscription = Keyboard.addListener(\n\t\t\t'keyboardDidHide',\n\t\t\tonKeyboardDidHide\n\t\t);\n\t\treturn () => {\n\t\t\tclearTimeout( onCancelTimer.current );\n\t\t\tkeyboardHideSubscription.remove();\n\t\t};\n\t}, [ onKeyboardDidHide ] );\n\n\tconst {\n\t\t'search-control__container': containerStyle,\n\t\t'search-control__inner-container': innerContainerStyle,\n\t\t'search-control__input-container': inputContainerStyle,\n\t\t'search-control__form-input': formInputStyle,\n\t\t'search-control__form-input-placeholder': placeholderStyle,\n\t\t'search-control__input-button': inputButtonStyle,\n\t\t'search-control__input-button-left': inputButtonLeftStyle,\n\t\t'search-control__input-button-right': inputButtonRightStyle,\n\t\t'search-control__cancel-button': cancelButtonStyle,\n\t\t'search-control__cancel-button-text': cancelButtonTextStyle,\n\t\t'search-control__icon': iconStyle,\n\t\t'search-control__right-icon': rightIconStyle,\n\t} = currentStyles;\n\n\tfunction renderLeftButton() {\n\t\tconst button =\n\t\t\t! isIOS && isActive ? (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ __( 'Cancel search' ) }\n\t\t\t\t\ticon={ arrowLeftIcon }\n\t\t\t\t\tonClick={ onCancel }\n\t\t\t\t\tstyle={ iconStyle }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Icon icon={ Gridicons.search } fill={ iconStyle?.color } />\n\t\t\t);\n\n\t\treturn (\n\t\t\t<View style={ [ inputButtonStyle, inputButtonLeftStyle ] }>\n\t\t\t\t{ button }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tfunction renderRightButton() {\n\t\tlet button;\n\n\t\t// Add a View element to properly center the input placeholder via flexbox.\n\t\tif ( isIOS && ! isActive ) {\n\t\t\tbutton = <View />;\n\t\t}\n\n\t\tif ( !! value ) {\n\t\t\tbutton = (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ __( 'Clear search' ) }\n\t\t\t\t\ticon={ isIOS ? cancelCircleFilledIcon : closeIcon }\n\t\t\t\t\tonClick={ clearInput }\n\t\t\t\t\tstyle={ [ iconStyle, rightIconStyle ] }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<View style={ [ inputButtonStyle, inputButtonRightStyle ] }>\n\t\t\t\t{ button }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tfunction renderCancel() {\n\t\tif ( ! isIOS ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View style={ cancelButtonStyle }>\n\t\t\t\t<Text\n\t\t\t\t\tonPress={ onCancel }\n\t\t\t\t\tstyle={ cancelButtonTextStyle }\n\t\t\t\t\taccessible\n\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\taccessibilityLabel={ __( 'Cancel search' ) }\n\t\t\t\t\taccessibilityHint={ __( 'Cancel search' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</Text>\n\t\t\t</View>\n\t\t);\n\t}\n\n\treturn (\n\t\t<TouchableOpacity\n\t\t\tstyle={ containerStyle }\n\t\t\tonPress={ onPress }\n\t\t\tactiveOpacity={ 1 }\n\t\t>\n\t\t\t<View style={ innerContainerStyle }>\n\t\t\t\t<View style={ inputContainerStyle }>\n\t\t\t\t\t{ renderLeftButton() }\n\t\t\t\t\t<TextInput\n\t\t\t\t\t\tref={ inputRef }\n\t\t\t\t\t\tstyle={ formInputStyle }\n\t\t\t\t\t\tplaceholderTextColor={ placeholderStyle?.color }\n\t\t\t\t\t\tonChangeText={ onChange }\n\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\t/>\n\t\t\t\t\t{ renderRightButton() }\n\t\t\t\t</View>\n\t\t\t\t{ isActive && renderCancel() }\n\t\t\t</View>\n\t\t</T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eAChCjF,IAAA,CAACxB,IAAI;QACJwE,OAAO,EAAGI,QAAU;QACpByB,KAAK,EAAGR,qBAAuB;QAC/Be,UAAU;QACVC,iBAAiB,EAAC,QAAQ;QAC1BC,kBAAkB,EAAGnG,EAAE,CAAE,eAAgB,CAAG;QAC5CoG,iBAAiB,EAAGpG,EAAE,CAAE,eAAgB,CAAG;QAAA8F,QAAA,EAEzC9F,EAAE,CAAE,QAAS;MAAC,CACX;IAAC,CACF,CAAC;EAET;EAEA,oBACCa,IAAA,CAACtB,gBAAgB;IAChBmG,KAAK,EAAGjB,cAAgB;IACxBZ,OAAO,EAAGA,OAAS;IACnBwC,aAAa,EAAG,CAAG;IAAAP,QAAA,eAEnB/E,KAAA,CAACzB,IAAI;MAACoG,KAAK,EAAGhB,mBAAqB;MAAAoB,QAAA,gBAClC/E,KAAA,CAACzB,IAAI;QAACoG,KAAK,EAAGf,mBAAqB;QAAAmB,QAAA,GAChCT,gBAAgB,CAAC,CAAC,eACpBxE,IAAA,CAACzB,SAAS;UACTkH,GAAG,EAAGxD,QAAU;UAChB4C,KAAK,EAAGd,cAAgB;UACxB2B,oBAAoB,EAAG1B,gBAAgB,EAAEgB,KAAO;UAChDW,YAAY,EAAGjE,QAAU;UACzByB,OAAO,EAAGA,OAAS;UACnB1B,KAAK,EAAGA,KAAO;UACfE,WAAW,EAAGA;QAAa,CAC3B,CAAC,EACAuD,iBAAiB,CAAC,CAAC;MAAA,CAChB,CAAC,EACLtD,QAAQ,IAAIuD,YAAY,CAAC,CAAC;IAAA,CACvB;EAAC,CACU,CAAC;AAErB;AAEA,eAAe3D,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/search-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { InputControlProps } from '../input-control/types';\n\nexport type SearchControlProps = Pick< InputControlProps, 'help' | 'value' > & {\n\t/**\n\t * @deprecated This is now the default.\n\t * @ignore\n\t */\n\t__next40pxDefaultSize?: InputControlProps[ '__next40pxDefaultSize' ];\n\t/**\n\t * Start opting into the new margin-free styles that will become the default in a future version.\n\t *\n\t * @default false\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default true\n\t */\n\thideLabelFromVision?: InputControlProps[ 'hideLabelFromVision' ];\n\t/**\n\t * The accessible label for the input.\n\t *\n\t * A label should always be provided as an accessibility best practice,\n\t * even when a placeholder is defined and `hideLabelFromVision` is `true`.\n\t *\n\t * @default 'Search'\n\t */\n\tlabel?: string;\n\t/**\n\t * A function that receives the value of the input when the value is changed.\n\t */\n\tonChange: ( value: string ) => void;\n\t/**\n\t * When an `onClose` callback is provided, the search control will render a close button\n\t * that will trigger the given callback.\n\t *\n\t * Use this if you want the button to trigger your own logic to close the search field entirely,\n\t * rather than just clearing the input value.\n\t */\n\tonClose?: () => void;\n\t/** @ignore */\n\tonDrag?: InputControlProps[ 'onDrag' ];\n\t/** @ignore */\n\tonDragStart?: InputControlProps[ 'onDragStart' ];\n\t/** @ignore */\n\tonDragEnd?: InputControlProps[ 'onDragEnd' ];\n\t/**\n\t * A placeholder for the input.\n\t *\n\t * @default 'Search'\n\t */\n\tplaceholder?: InputControlProps[ 'placeholder' ];\n\t/**\n\t * The size of the component\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | 'compact';\n};\n\nexport type SuffixItemProps = Pick<\n\tSearchControlProps,\n\t'value' | 'onChange' | 'onClose'\n> & {\n\tsearchRef: React.RefObject< HTMLInputElement >;\n};\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/search-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { InputControlProps } from '../input-control/types';\n\nexport type SearchControlProps = Pick< InputControlProps, 'help' | 'value' > & {\n\t/**\n\t * @deprecated This is now the default.\n\t * @ignore\n\t */\n\t__next40pxDefaultSize?: InputControlProps[ '__next40pxDefaultSize' ];\n\t/**\n\t * Start opting into the new margin-free styles that will become the default in a future version.\n\t *\n\t * @default false\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default true\n\t */\n\thideLabelFromVision?: InputControlProps[ 'hideLabelFromVision' ];\n\t/**\n\t * The accessible label for the input.\n\t *\n\t * A label should always be provided as an accessibility best practice,\n\t * even when a placeholder is defined and `hideLabelFromVision` is `true`.\n\t *\n\t * @default 'Search'\n\t */\n\tlabel?: string;\n\t/**\n\t * A function that receives the value of the input when the value is changed.\n\t */\n\tonChange: ( value: string ) => void;\n\t/**\n\t * When an `onClose` callback is provided, the search control will render a close button\n\t * that will trigger the given callback.\n\t *\n\t * Use this if you want the button to trigger your own logic to close the search field entirely,\n\t * rather than just clearing the input value.\n\t *\n\t * @deprecated\n\t * @ignore\n\t */\n\tonClose?: () => void;\n\t/** @ignore */\n\tonDrag?: InputControlProps[ 'onDrag' ];\n\t/** @ignore */\n\tonDragStart?: InputControlProps[ 'onDragStart' ];\n\t/** @ignore */\n\tonDragEnd?: InputControlProps[ 'onDragEnd' ];\n\t/**\n\t * A placeholder for the input.\n\t *\n\t * @default 'Search'\n\t */\n\tplaceholder?: InputControlProps[ 'placeholder' ];\n\t/**\n\t * The size of the component\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | 'compact';\n};\n\nexport type SuffixItemProps = Pick<\n\tSearchControlProps,\n\t'value' | 'onChange' | 'onClose'\n> & {\n\tsearchRef: React.RefObject< HTMLInputElement >;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useInstanceId","forwardRef","BaseControl","Select","StyledInputBase","SelectControlChevronDown","useDeprecated36pxDefaultSizeProp","jsx","_jsx","useUniqueId","idProp","instanceId","SelectControl","id","SelectOptions","options","map","label","value","optionProps","index","key","children","UnforwardedSelectControl","props","ref","className","disabled","help","hideLabelFromVision","multiple","onChange","size","valueProp","labelPosition","prefix","suffix","variant","__next40pxDefaultSize","__nextHasNoMarginBottom","restProps","helpId","undefined","length","handleOnChange","event","selectedOptions","Array","from","target","filter","selected","newValues","classes","__associatedWPComponentName","isBorderless","__unstableInputWidth","selectSize"],"sources":["@wordpress/components/src/select-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport { Select, StyledInputBase } from './styles/select-control-styles';\nimport type { WordPressComponentProps } from '../context';\nimport type { SelectControlProps } from './types';\nimport SelectControlChevronDown from './chevron-down';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( SelectControl );\n\tconst id = `inspector-select-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\nfunction SelectOptions( {\n\toptions,\n}: {\n\toptions: NonNullable< SelectControlProps[ 'options' ] >;\n} ) {\n\treturn options.map( ( { id, label, value, ...optionProps }, index ) => {\n\t\tconst key = id || `${ label }-${ value }-${ index }`;\n\n\t\treturn (\n\t\t\t<option key={ key } value={ value } { ...optionProps }>\n\t\t\t\t{ label }\n\t\t\t</option>\n\t\t);\n\t} );\n}\n\nfunction UnforwardedSelectControl< V extends string >(\n\tprops: WordPressComponentProps< SelectControlProps< V >, 'select', false >,\n\tref: React.ForwardedRef< HTMLSelectElement >\n) {\n\tconst {\n\t\tclassName,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision,\n\t\tid: idProp,\n\t\tlabel,\n\t\tmultiple = false,\n\t\tonChange,\n\t\toptions = [],\n\t\tsize = 'default',\n\t\tvalue: valueProp,\n\t\tlabelPosition = 'top',\n\t\tchildren,\n\t\tprefix,\n\t\tsuffix,\n\t\tvariant = 'default',\n\t\t__next40pxDefaultSize = false,\n\t\t__nextHasNoMarginBottom = false,\n\t\t...restProps\n\t} = useDeprecated36pxDefaultSizeProp( props );\n\tconst id = useUniqueId( idProp );\n\tconst helpId = help ? `${ id }__help` : undefined;\n\n\t// Disable reason: A select with an onchange throws a warning.\n\tif ( ! options?.length && ! children ) {\n\t\treturn null;\n\t}\n\n\tconst handleOnChange = (\n\t\tevent: React.ChangeEvent< HTMLSelectElement >\n\t) => {\n\t\tif ( props.multiple ) {\n\t\t\tconst selectedOptions = Array.from( event.target.options ).filter(\n\t\t\t\t( { selected } ) => selected\n\t\t\t);\n\t\t\tconst newValues = selectedOptions.map(\n\t\t\t\t( { value } ) => value as V\n\t\t\t);\n\t\t\tprops.onChange?.( newValues, { event } );\n\t\t\treturn;\n\t\t}\n\n\t\tprops.onChange?.( event.target.value as V, { event } );\n\t};\n\n\tconst classes = clsx( 'components-select-control', className );\n\n\treturn (\n\t\t<BaseControl\n\t\t\thelp={ help }\n\t\t\tid={ id }\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"SelectControl\"\n\t\t>\n\t\t\t<StyledInputBase\n\t\t\t\tclassName={ classes }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\tisBorderless={ variant === 'minimal' }\n\t\t\t\tlabel={ label }\n\t\t\t\tsize={ size }\n\t\t\t\tsuffix={\n\t\t\t\t\tsuffix || ( ! multiple && <SelectControlChevronDown /> )\n\t\t\t\t}\n\t\t\t\tprefix={ prefix }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\t__unstableInputWidth={\n\t\t\t\t\tvariant === 'minimal' ? 'auto' : undefined\n\t\t\t\t}\n\t\t\t\tvariant={ variant }\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t>\n\t\t\t\t<Select\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\taria-describedby={ helpId }\n\t\t\t\t\tclassName=\"components-select-control__input\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tmultiple={ multiple }\n\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tselectSize={ size }\n\t\t\t\t\tvalue={ valueProp }\n\t\t\t\t\tvariant={ variant }\n\t\t\t\t>\n\t\t\t\t\t{ children || <SelectOptions options={ options } /> }\n\t\t\t\t</Select>\n\t\t\t</StyledInputBase>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * `SelectControl` allows users to select from a single or multiple option menu.\n * It functions as a wrapper around the browser's native `<select>` element.\n *\n * ```jsx\n * import { SelectControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MySelectControl = () => {\n * const [ size, setSize ] = useState( '50%' );\n *\n * return (\n * <SelectControl\n * __nextHasNoMarginBottom\n * label=\"Size\"\n * value={ size }\n * options={ [\n * { label: 'Big', value: '100%' },\n * { label: 'Medium', value: '50%' },\n * { label: 'Small', value: '25%' },\n * ] }\n * onChange={ setSize }\n * />\n * );\n * };\n * ```\n */\nexport const SelectControl = forwardRef( UnforwardedSelectControl ) as <\n\tV extends string,\n>(\n\tprops: WordPressComponentProps<\n\t\tSelectControlProps< V >,\n\t\t'select',\n\t\tfalse\n\t> & { ref?: React.Ref< HTMLSelectElement > }\n) => React.JSX.Element | null;\n\nexport default SelectControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAASC,MAAM,EAAEC,eAAe,QAAQ,gCAAgC;AAGxE,OAAOC,wBAAwB,MAAM,gBAAgB;AACrD,SAASC,gCAAgC,QAAQ,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjF,SAASC,WAAWA,CAAEC,MAAe,EAAG;EACvC,MAAMC,UAAU,GAAGX,aAAa,CAAEY,aAAc,CAAC;EACjD,MAAMC,EAAE,
|
|
1
|
+
{"version":3,"names":["clsx","useInstanceId","forwardRef","BaseControl","Select","StyledInputBase","SelectControlChevronDown","useDeprecated36pxDefaultSizeProp","jsx","_jsx","useUniqueId","idProp","instanceId","SelectControl","id","SelectOptions","options","map","label","value","optionProps","index","key","children","UnforwardedSelectControl","props","ref","className","disabled","help","hideLabelFromVision","multiple","onChange","size","valueProp","labelPosition","prefix","suffix","variant","__next40pxDefaultSize","__nextHasNoMarginBottom","restProps","helpId","undefined","length","handleOnChange","event","selectedOptions","Array","from","target","filter","selected","newValues","classes","__associatedWPComponentName","isBorderless","__unstableInputWidth","selectSize"],"sources":["@wordpress/components/src/select-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport { Select, StyledInputBase } from './styles/select-control-styles';\nimport type { WordPressComponentProps } from '../context';\nimport type { SelectControlProps } from './types';\nimport SelectControlChevronDown from './chevron-down';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( SelectControl );\n\tconst id = `inspector-select-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\nfunction SelectOptions( {\n\toptions,\n}: {\n\toptions: NonNullable< SelectControlProps[ 'options' ] >;\n} ) {\n\treturn options.map( ( { id, label, value, ...optionProps }, index ) => {\n\t\tconst key = id || `${ label }-${ value }-${ index }`;\n\n\t\treturn (\n\t\t\t<option key={ key } value={ value } { ...optionProps }>\n\t\t\t\t{ label }\n\t\t\t</option>\n\t\t);\n\t} );\n}\n\nfunction UnforwardedSelectControl< V extends string >(\n\tprops: WordPressComponentProps< SelectControlProps< V >, 'select', false >,\n\tref: React.ForwardedRef< HTMLSelectElement >\n) {\n\tconst {\n\t\tclassName,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision,\n\t\tid: idProp,\n\t\tlabel,\n\t\tmultiple = false,\n\t\tonChange,\n\t\toptions = [],\n\t\tsize = 'default',\n\t\tvalue: valueProp,\n\t\tlabelPosition = 'top',\n\t\tchildren,\n\t\tprefix,\n\t\tsuffix,\n\t\tvariant = 'default',\n\t\t__next40pxDefaultSize = false,\n\t\t__nextHasNoMarginBottom = false,\n\t\t...restProps\n\t} = useDeprecated36pxDefaultSizeProp( props );\n\tconst id = useUniqueId( idProp );\n\tconst helpId = help ? `${ id }__help` : undefined;\n\n\t// Disable reason: A select with an onchange throws a warning.\n\tif ( ! options?.length && ! children ) {\n\t\treturn null;\n\t}\n\n\tconst handleOnChange = (\n\t\tevent: React.ChangeEvent< HTMLSelectElement >\n\t) => {\n\t\tif ( props.multiple ) {\n\t\t\tconst selectedOptions = Array.from( event.target.options ).filter(\n\t\t\t\t( { selected } ) => selected\n\t\t\t);\n\t\t\tconst newValues = selectedOptions.map(\n\t\t\t\t( { value } ) => value as V\n\t\t\t);\n\t\t\tprops.onChange?.( newValues, { event } );\n\t\t\treturn;\n\t\t}\n\n\t\tprops.onChange?.( event.target.value as V, { event } );\n\t};\n\n\tconst classes = clsx( 'components-select-control', className );\n\n\treturn (\n\t\t<BaseControl\n\t\t\thelp={ help }\n\t\t\tid={ id }\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"SelectControl\"\n\t\t>\n\t\t\t<StyledInputBase\n\t\t\t\tclassName={ classes }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\tisBorderless={ variant === 'minimal' }\n\t\t\t\tlabel={ label }\n\t\t\t\tsize={ size }\n\t\t\t\tsuffix={\n\t\t\t\t\tsuffix || ( ! multiple && <SelectControlChevronDown /> )\n\t\t\t\t}\n\t\t\t\tprefix={ prefix }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\t__unstableInputWidth={\n\t\t\t\t\tvariant === 'minimal' ? 'auto' : undefined\n\t\t\t\t}\n\t\t\t\tvariant={ variant }\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t>\n\t\t\t\t<Select\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\taria-describedby={ helpId }\n\t\t\t\t\tclassName=\"components-select-control__input\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tmultiple={ multiple }\n\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tselectSize={ size }\n\t\t\t\t\tvalue={ valueProp }\n\t\t\t\t\tvariant={ variant }\n\t\t\t\t>\n\t\t\t\t\t{ children || <SelectOptions options={ options } /> }\n\t\t\t\t</Select>\n\t\t\t</StyledInputBase>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * `SelectControl` allows users to select from a single or multiple option menu.\n * It functions as a wrapper around the browser's native `<select>` element.\n *\n * ```jsx\n * import { SelectControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MySelectControl = () => {\n * const [ size, setSize ] = useState( '50%' );\n *\n * return (\n * <SelectControl\n * __nextHasNoMarginBottom\n * label=\"Size\"\n * value={ size }\n * options={ [\n * { label: 'Big', value: '100%' },\n * { label: 'Medium', value: '50%' },\n * { label: 'Small', value: '25%' },\n * ] }\n * onChange={ setSize }\n * />\n * );\n * };\n * ```\n */\nexport const SelectControl = forwardRef( UnforwardedSelectControl ) as <\n\tV extends string,\n>(\n\tprops: WordPressComponentProps<\n\t\tSelectControlProps< V >,\n\t\t'select',\n\t\tfalse\n\t> & { ref?: React.Ref< HTMLSelectElement > }\n) => React.JSX.Element | null;\n\nexport default SelectControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAASC,MAAM,EAAEC,eAAe,QAAQ,gCAAgC;AAGxE,OAAOC,wBAAwB,MAAM,gBAAgB;AACrD,SAASC,gCAAgC,QAAQ,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjF,SAASC,WAAWA,CAAEC,MAAe,EAAG;EACvC,MAAMC,UAAU,GAAGX,aAAa,CAAEY,aAAc,CAAC;EACjD,MAAMC,EAAE,GAAG,4BAA6BF,UAAU,EAAG;EAErD,OAAOD,MAAM,IAAIG,EAAE;AACpB;AAEA,SAASC,aAAaA,CAAE;EACvBC;AAGD,CAAC,EAAG;EACH,OAAOA,OAAO,CAACC,GAAG,CAAE,CAAE;IAAEH,EAAE;IAAEI,KAAK;IAAEC,KAAK;IAAE,GAAGC;EAAY,CAAC,EAAEC,KAAK,KAAM;IACtE,MAAMC,GAAG,GAAGR,EAAE,IAAI,GAAII,KAAK,IAAMC,KAAK,IAAME,KAAK,EAAG;IAEpD,oBACCZ,IAAA;MAAoBU,KAAK,EAAGA,KAAO;MAAA,GAAMC,WAAW;MAAAG,QAAA,EACjDL;IAAK,GADMI,GAEN,CAAC;EAEX,CAAE,CAAC;AACJ;AAEA,SAASE,wBAAwBA,CAChCC,KAA0E,EAC1EC,GAA4C,EAC3C;EACD,MAAM;IACLC,SAAS;IACTC,QAAQ,GAAG,KAAK;IAChBC,IAAI;IACJC,mBAAmB;IACnBhB,EAAE,EAAEH,MAAM;IACVO,KAAK;IACLa,QAAQ,GAAG,KAAK;IAChBC,QAAQ;IACRhB,OAAO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aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","PickerCell","jsx","_jsx","SelectControl","help","instanceId","label","multiple","onChange","options","className","hideLabelFromVision","props","id","onChangeValue","undefined"],"sources":["@wordpress/components/src/select-control/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport PickerCell from '../mobile/bottom-sheet/picker-cell';\n\nexport const SelectControl = memo(\n\t( {\n\t\thelp,\n\t\tinstanceId,\n\t\tlabel,\n\t\tmultiple = false,\n\t\tonChange,\n\t\toptions = [],\n\t\tclassName,\n\t\thideLabelFromVision,\n\t\t...props\n\t} ) => {\n\t\tconst id = `inspector-select-control-${ instanceId }`;\n\n\t\treturn (\n\t\t\t<PickerCell\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\thelp={ help }\n\t\t\t\tclassName={ className }\n\t\t\t\tonChangeValue={ onChange }\n\t\t\t\taria-describedby={ !! help ? `${ id }__help` : undefined }\n\t\t\t\tmultiple={ multiple }\n\t\t\t\toptions={ options }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport default SelectControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,oBAAoB;AACzC;AACA;AACA;AACA,OAAOC,UAAU,MAAM,oCAAoC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,OAAO,MAAMC,aAAa,GAAGJ,IAAI,CAChC,CAAE;EACDK,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,QAAQ,GAAG,KAAK;EAChBC,QAAQ;EACRC,OAAO,GAAG,EAAE;EACZC,SAAS;EACTC,mBAAmB;EACnB,GAAGC;AACJ,CAAC,KAAM;EACN,MAAMC,EAAE,
|
|
1
|
+
{"version":3,"names":["memo","PickerCell","jsx","_jsx","SelectControl","help","instanceId","label","multiple","onChange","options","className","hideLabelFromVision","props","id","onChangeValue","undefined"],"sources":["@wordpress/components/src/select-control/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport PickerCell from '../mobile/bottom-sheet/picker-cell';\n\nexport const SelectControl = memo(\n\t( {\n\t\thelp,\n\t\tinstanceId,\n\t\tlabel,\n\t\tmultiple = false,\n\t\tonChange,\n\t\toptions = [],\n\t\tclassName,\n\t\thideLabelFromVision,\n\t\t...props\n\t} ) => {\n\t\tconst id = `inspector-select-control-${ instanceId }`;\n\n\t\treturn (\n\t\t\t<PickerCell\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\thelp={ help }\n\t\t\t\tclassName={ className }\n\t\t\t\tonChangeValue={ onChange }\n\t\t\t\taria-describedby={ !! help ? `${ id }__help` : undefined }\n\t\t\t\tmultiple={ multiple }\n\t\t\t\toptions={ options }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport default SelectControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,oBAAoB;AACzC;AACA;AACA;AACA,OAAOC,UAAU,MAAM,oCAAoC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,OAAO,MAAMC,aAAa,GAAGJ,IAAI,CAChC,CAAE;EACDK,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,QAAQ,GAAG,KAAK;EAChBC,QAAQ;EACRC,OAAO,GAAG,EAAE;EACZC,SAAS;EACTC,mBAAmB;EACnB,GAAGC;AACJ,CAAC,KAAM;EACN,MAAMC,EAAE,GAAG,4BAA6BR,UAAU,EAAG;EAErD,oBACCH,IAAA,CAACF,UAAU;IACVM,KAAK,EAAGA,KAAO;IACfK,mBAAmB,EAAGA,mBAAqB;IAC3CE,EAAE,EAAGA,EAAI;IACTT,IAAI,EAAGA,IAAM;IACbM,SAAS,EAAGA,SAAW;IACvBI,aAAa,EAAGN,QAAU;IAC1B,oBAAmB,CAAC,CAAEJ,IAAI,GAAG,GAAIS,EAAE,QAAS,GAAGE,SAAW;IAC1DR,QAAQ,EAAGA,QAAU;IACrBE,OAAO,EAAGA,OAAS;IAAA,GACdG;EAAK,CACV,CAAC;AAEJ,CACD,CAAC;AAED,eAAeT,aAAa","ignoreList":[]}
|
|
@@ -17,9 +17,7 @@ import BubblesVirtuallySlot from './bubbles-virtually/slot';
|
|
|
17
17
|
import BubblesVirtuallySlotFillProvider from './bubbles-virtually/slot-fill-provider';
|
|
18
18
|
import SlotFillProvider from './provider';
|
|
19
19
|
import SlotFillContext from './bubbles-virtually/slot-fill-context';
|
|
20
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
21
|
export { default as useSlot } from './bubbles-virtually/use-slot';
|
|
24
22
|
export { default as useSlotFills } from './bubbles-virtually/use-slot-fills';
|
|
25
23
|
export function Fill(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","useContext","BaseFill","BaseSlot","BubblesVirtuallyFill","BubblesVirtuallySlot","BubblesVirtuallySlotFillProvider","SlotFillProvider","SlotFillContext","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","default","useSlot","useSlotFills","Fill","props","children","UnforwardedSlot","ref","bubblesVirtually","restProps","Slot","Provider","passthrough","parent","isDefault","displayName","createSlotFill","key","baseName","description","FillComponent","name","SlotComponent","__unstableName","createPrivateSlotFill","privateKey","Symbol","privateSlotFill"],"sources":["@wordpress/components/src/slot-fill/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseFill from './fill';\nimport BaseSlot from './slot';\nimport BubblesVirtuallyFill from './bubbles-virtually/fill';\nimport BubblesVirtuallySlot from './bubbles-virtually/slot';\nimport BubblesVirtuallySlotFillProvider from './bubbles-virtually/slot-fill-provider';\nimport SlotFillProvider from './provider';\nimport SlotFillContext from './bubbles-virtually/slot-fill-context';\nimport type { WordPressComponentProps } from '../context';\n\nexport { default as useSlot } from './bubbles-virtually/use-slot';\nexport { default as useSlotFills } from './bubbles-virtually/use-slot-fills';\nimport type {\n\tDistributiveOmit,\n\tFillComponentProps,\n\tSlotComponentProps,\n\tSlotFillProviderProps,\n\tSlotKey,\n} from './types';\n\nexport function Fill( props: FillComponentProps ) {\n\t// We're adding both Fills here so they can register themselves before\n\t// their respective slot has been registered. Only the Fill that has a slot\n\t// will render. The other one will return null.\n\treturn (\n\t\t<>\n\t\t\t<BaseFill { ...props } />\n\t\t\t<BubblesVirtuallyFill { ...props } />\n\t\t</>\n\t);\n}\n\nexport function UnforwardedSlot(\n\tprops: SlotComponentProps &\n\t\tOmit< WordPressComponentProps< {}, 'div' >, 'className' >,\n\tref: ForwardedRef< any >\n) {\n\tconst { bubblesVirtually, ...restProps } = props;\n\tif ( bubblesVirtually ) {\n\t\treturn <BubblesVirtuallySlot { ...restProps } ref={ ref } />;\n\t}\n\treturn <BaseSlot { ...restProps } />;\n}\nexport const Slot = forwardRef( UnforwardedSlot );\n\nexport function Provider( {\n\tchildren,\n\tpassthrough = false,\n}: SlotFillProviderProps ) {\n\tconst parent = useContext( SlotFillContext );\n\tif ( ! parent.isDefault && passthrough ) {\n\t\treturn <>{ children }</>;\n\t}\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<BubblesVirtuallySlotFillProvider>\n\t\t\t\t{ children }\n\t\t\t</BubblesVirtuallySlotFillProvider>\n\t\t</SlotFillProvider>\n\t);\n}\nProvider.displayName = 'SlotFillProvider';\n\nexport function createSlotFill( key: SlotKey ) {\n\tconst baseName = typeof key === 'symbol' ? key.description : key;\n\tconst FillComponent = ( props: Omit< FillComponentProps, 'name' > ) => (\n\t\t<Fill name={ key } { ...props } />\n\t);\n\tFillComponent.displayName = `${ baseName }Fill`;\n\n\tconst SlotComponent = (\n\t\tprops: DistributiveOmit< SlotComponentProps, 'name' >\n\t) => <Slot name={ key } { ...props } />;\n\tSlotComponent.displayName = `${ baseName }Slot`;\n\tSlotComponent.__unstableName = key;\n\n\treturn {\n\t\tFill: FillComponent,\n\t\tSlot: SlotComponent,\n\t};\n}\n\nexport const createPrivateSlotFill = ( name: string ) => {\n\tconst privateKey = Symbol( name );\n\tconst privateSlotFill = createSlotFill( privateKey );\n\n\treturn { privateKey, ...privateSlotFill };\n};\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,QAAQ;AAC7B,OAAOC,QAAQ,MAAM,QAAQ;AAC7B,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,gCAAgC,MAAM,wCAAwC;AACrF,OAAOC,gBAAgB,MAAM,YAAY;AACzC,OAAOC,eAAe,MAAM,uCAAuC;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["forwardRef","useContext","BaseFill","BaseSlot","BubblesVirtuallyFill","BubblesVirtuallySlot","BubblesVirtuallySlotFillProvider","SlotFillProvider","SlotFillContext","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","default","useSlot","useSlotFills","Fill","props","children","UnforwardedSlot","ref","bubblesVirtually","restProps","Slot","Provider","passthrough","parent","isDefault","displayName","createSlotFill","key","baseName","description","FillComponent","name","SlotComponent","__unstableName","createPrivateSlotFill","privateKey","Symbol","privateSlotFill"],"sources":["@wordpress/components/src/slot-fill/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseFill from './fill';\nimport BaseSlot from './slot';\nimport BubblesVirtuallyFill from './bubbles-virtually/fill';\nimport BubblesVirtuallySlot from './bubbles-virtually/slot';\nimport BubblesVirtuallySlotFillProvider from './bubbles-virtually/slot-fill-provider';\nimport SlotFillProvider from './provider';\nimport SlotFillContext from './bubbles-virtually/slot-fill-context';\nimport type { WordPressComponentProps } from '../context';\n\nexport { default as useSlot } from './bubbles-virtually/use-slot';\nexport { default as useSlotFills } from './bubbles-virtually/use-slot-fills';\nimport type {\n\tDistributiveOmit,\n\tFillComponentProps,\n\tSlotComponentProps,\n\tSlotFillProviderProps,\n\tSlotKey,\n} from './types';\n\nexport function Fill( props: FillComponentProps ) {\n\t// We're adding both Fills here so they can register themselves before\n\t// their respective slot has been registered. Only the Fill that has a slot\n\t// will render. The other one will return null.\n\treturn (\n\t\t<>\n\t\t\t<BaseFill { ...props } />\n\t\t\t<BubblesVirtuallyFill { ...props } />\n\t\t</>\n\t);\n}\n\nexport function UnforwardedSlot(\n\tprops: SlotComponentProps &\n\t\tOmit< WordPressComponentProps< {}, 'div' >, 'className' >,\n\tref: ForwardedRef< any >\n) {\n\tconst { bubblesVirtually, ...restProps } = props;\n\tif ( bubblesVirtually ) {\n\t\treturn <BubblesVirtuallySlot { ...restProps } ref={ ref } />;\n\t}\n\treturn <BaseSlot { ...restProps } />;\n}\nexport const Slot = forwardRef( UnforwardedSlot );\n\nexport function Provider( {\n\tchildren,\n\tpassthrough = false,\n}: SlotFillProviderProps ) {\n\tconst parent = useContext( SlotFillContext );\n\tif ( ! parent.isDefault && passthrough ) {\n\t\treturn <>{ children }</>;\n\t}\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<BubblesVirtuallySlotFillProvider>\n\t\t\t\t{ children }\n\t\t\t</BubblesVirtuallySlotFillProvider>\n\t\t</SlotFillProvider>\n\t);\n}\nProvider.displayName = 'SlotFillProvider';\n\nexport function createSlotFill( key: SlotKey ) {\n\tconst baseName = typeof key === 'symbol' ? key.description : key;\n\tconst FillComponent = ( props: Omit< FillComponentProps, 'name' > ) => (\n\t\t<Fill name={ key } { ...props } />\n\t);\n\tFillComponent.displayName = `${ baseName }Fill`;\n\n\tconst SlotComponent = (\n\t\tprops: DistributiveOmit< SlotComponentProps, 'name' >\n\t) => <Slot name={ key } { ...props } />;\n\tSlotComponent.displayName = `${ baseName }Slot`;\n\tSlotComponent.__unstableName = key;\n\n\treturn {\n\t\tFill: FillComponent,\n\t\tSlot: SlotComponent,\n\t};\n}\n\nexport const createPrivateSlotFill = ( name: string ) => {\n\tconst privateKey = Symbol( name );\n\tconst privateSlotFill = createSlotFill( privateKey );\n\n\treturn { privateKey, ...privateSlotFill };\n};\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,QAAQ;AAC7B,OAAOC,QAAQ,MAAM,QAAQ;AAC7B,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,gCAAgC,MAAM,wCAAwC;AACrF,OAAOC,gBAAgB,MAAM,YAAY;AACzC,OAAOC,eAAe,MAAM,uCAAuC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAGpE,SAASC,OAAO,IAAIC,OAAO,QAAQ,8BAA8B;AACjE,SAASD,OAAO,IAAIE,YAAY,QAAQ,oCAAoC;AAS5E,OAAO,SAASC,IAAIA,CAAEC,KAAyB,EAAG;EACjD;EACA;EACA;EACA,oBACCL,KAAA,CAAAF,SAAA;IAAAQ,QAAA,gBACCV,IAAA,CAACR,QAAQ;MAAA,GAAMi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G,GAAIG,QAAQ,MAAO;EAE/C,MAAMI,aAAa,GAClBlB,KAAqD,iBACjDT,IAAA,CAACe,IAAI;IAACW,IAAI,EAAGJ,GAAK;IAAA,GAAMb;EAAK,CAAI,CAAC;EACvCkB,aAAa,CAACP,WAAW,GAAG,GAAIG,QAAQ,MAAO;EAC/CI,aAAa,CAACC,cAAc,GAAGN,GAAG;EAElC,OAAO;IACNd,IAAI,EAAEiB,aAAa;IACnBV,IAAI,EAAEY;EACP,CAAC;AACF;AAEA,OAAO,MAAME,qBAAqB,GAAKH,IAAY,IAAM;EACxD,MAAMI,UAAU,GAAGC,MAAM,CAAEL,IAAK,CAAC;EACjC,MAAMM,eAAe,GAAGX,cAAc,CAAES,UAAW,CAAC;EAEpD,OAAO;IAAEA,UAAU;IAAE,GAAGE;EAAgB,CAAC;AAC1C,CAAC","ignoreList":[]}
|
|
@@ -11,8 +11,7 @@ import { Children, Component, cloneElement, isEmptyElement } from '@wordpress/el
|
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
13
|
import SlotFillContext from './context';
|
|
14
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
16
15
|
/**
|
|
17
16
|
* Whether the argument is a function.
|
|
18
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","Component","cloneElement","isEmptyElement","SlotFillContext","Fragment","_Fragment","jsx","_jsx","isFunction","maybeFunc","SlotComponent","constructor","props","isUnmounted","componentDidMount","registerSlot","name","componentWillUnmount","unregisterSlot","componentDidUpdate","prevProps","forceUpdate","render","_getFills","children","fillProps","getFills","fills","map","fill","fillChildren","child","childIndex","childKey","key","filter","element","Slot","Consumer"],"sources":["@wordpress/components/src/slot-fill/slot.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, ReactNode, Key } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tChildren,\n\tComponent,\n\tcloneElement,\n\tisEmptyElement,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './context';\nimport type { BaseSlotComponentProps, SlotComponentProps } from './types';\n\n/**\n * Whether the argument is a function.\n *\n * @param maybeFunc The argument to check.\n * @return True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc: any ): maybeFunc is Function {\n\treturn typeof maybeFunc === 'function';\n}\n\nclass SlotComponent extends Component< BaseSlotComponentProps > {\n\tprivate isUnmounted: boolean;\n\n\tconstructor( props: BaseSlotComponentProps ) {\n\t\tsuper( props );\n\n\t\tthis.isUnmounted = false;\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { registerSlot } = this.props;\n\t\tthis.isUnmounted = false;\n\t\tregisterSlot( this.props.name, this );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tconst { unregisterSlot } = this.props;\n\t\tthis.isUnmounted = true;\n\t\tunregisterSlot( this.props.name, this );\n\t}\n\n\tcomponentDidUpdate( prevProps: BaseSlotComponentProps ) {\n\t\tconst { name, unregisterSlot, registerSlot } = this.props;\n\n\t\tif ( prevProps.name !== name ) {\n\t\t\tunregisterSlot( prevProps.name, this );\n\t\t\tregisterSlot( name, this );\n\t\t}\n\t}\n\n\tforceUpdate() {\n\t\tif ( this.isUnmounted ) {\n\t\t\treturn;\n\t\t}\n\t\tsuper.forceUpdate();\n\t}\n\n\trender() {\n\t\tconst { children, name, fillProps = {}, getFills } = this.props;\n\t\tconst fills: ReactNode[] = ( getFills( name, this ) ?? [] )\n\t\t\t.map( ( fill ) => {\n\t\t\t\tconst fillChildren = isFunction( fill.children )\n\t\t\t\t\t? fill.children( fillProps )\n\t\t\t\t\t: fill.children;\n\t\t\t\treturn Children.map( fillChildren, ( child, childIndex ) => {\n\t\t\t\t\tif ( ! child || typeof child === 'string' ) {\n\t\t\t\t\t\treturn child;\n\t\t\t\t\t}\n\t\t\t\t\tlet childKey: Key = childIndex;\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof child === 'object' &&\n\t\t\t\t\t\t'key' in child &&\n\t\t\t\t\t\tchild?.key\n\t\t\t\t\t) {\n\t\t\t\t\t\tchildKey = child.key;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn cloneElement( child as ReactElement, {\n\t\t\t\t\t\tkey: childKey,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t} )\n\t\t\t.filter(\n\t\t\t\t// In some cases fills are rendered only when some conditions apply.\n\t\t\t\t// This ensures that we only use non-empty fills when rendering, i.e.,\n\t\t\t\t// it allows us to render wrappers only when the fills are actually present.\n\t\t\t\t( element ) => ! isEmptyElement( element )\n\t\t\t);\n\n\t\treturn <>{ isFunction( children ) ? children( fills ) : fills }</>;\n\t}\n}\n\nconst Slot = ( props: Omit< SlotComponentProps, 'bubblesVirtually' > ) => (\n\t<SlotFillContext.Consumer>\n\t\t{ ( { registerSlot, unregisterSlot, getFills } ) => (\n\t\t\t<SlotComponent\n\t\t\t\t{ ...props }\n\t\t\t\tregisterSlot={ registerSlot }\n\t\t\t\tunregisterSlot={ unregisterSlot }\n\t\t\t\tgetFills={ getFills }\n\t\t\t/>\n\t\t) }\n\t</SlotFillContext.Consumer>\n);\n\nexport default Slot;\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SACCA,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZC,cAAc,QACR,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,eAAe,MAAM,WAAW;AAAC,SAAAC,QAAA,IAAAC,SAAA
|
|
1
|
+
{"version":3,"names":["Children","Component","cloneElement","isEmptyElement","SlotFillContext","Fragment","_Fragment","jsx","_jsx","isFunction","maybeFunc","SlotComponent","constructor","props","isUnmounted","componentDidMount","registerSlot","name","componentWillUnmount","unregisterSlot","componentDidUpdate","prevProps","forceUpdate","render","_getFills","children","fillProps","getFills","fills","map","fill","fillChildren","child","childIndex","childKey","key","filter","element","Slot","Consumer"],"sources":["@wordpress/components/src/slot-fill/slot.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, ReactNode, Key } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tChildren,\n\tComponent,\n\tcloneElement,\n\tisEmptyElement,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './context';\nimport type { BaseSlotComponentProps, SlotComponentProps } from './types';\n\n/**\n * Whether the argument is a function.\n *\n * @param maybeFunc The argument to check.\n * @return True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc: any ): maybeFunc is Function {\n\treturn typeof maybeFunc === 'function';\n}\n\nclass SlotComponent extends Component< BaseSlotComponentProps > {\n\tprivate isUnmounted: boolean;\n\n\tconstructor( props: BaseSlotComponentProps ) {\n\t\tsuper( props );\n\n\t\tthis.isUnmounted = false;\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { registerSlot } = this.props;\n\t\tthis.isUnmounted = false;\n\t\tregisterSlot( this.props.name, this );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tconst { unregisterSlot } = this.props;\n\t\tthis.isUnmounted = true;\n\t\tunregisterSlot( this.props.name, this );\n\t}\n\n\tcomponentDidUpdate( prevProps: BaseSlotComponentProps ) {\n\t\tconst { name, unregisterSlot, registerSlot } = this.props;\n\n\t\tif ( prevProps.name !== name ) {\n\t\t\tunregisterSlot( prevProps.name, this );\n\t\t\tregisterSlot( name, this );\n\t\t}\n\t}\n\n\tforceUpdate() {\n\t\tif ( this.isUnmounted ) {\n\t\t\treturn;\n\t\t}\n\t\tsuper.forceUpdate();\n\t}\n\n\trender() {\n\t\tconst { children, name, fillProps = {}, getFills } = this.props;\n\t\tconst fills: ReactNode[] = ( getFills( name, this ) ?? [] )\n\t\t\t.map( ( fill ) => {\n\t\t\t\tconst fillChildren = isFunction( fill.children )\n\t\t\t\t\t? fill.children( fillProps )\n\t\t\t\t\t: fill.children;\n\t\t\t\treturn Children.map( fillChildren, ( child, childIndex ) => {\n\t\t\t\t\tif ( ! child || typeof child === 'string' ) {\n\t\t\t\t\t\treturn child;\n\t\t\t\t\t}\n\t\t\t\t\tlet childKey: Key = childIndex;\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof child === 'object' &&\n\t\t\t\t\t\t'key' in child &&\n\t\t\t\t\t\tchild?.key\n\t\t\t\t\t) {\n\t\t\t\t\t\tchildKey = child.key;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn cloneElement( child as ReactElement, {\n\t\t\t\t\t\tkey: childKey,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t} )\n\t\t\t.filter(\n\t\t\t\t// In some cases fills are rendered only when some conditions apply.\n\t\t\t\t// This ensures that we only use non-empty fills when rendering, i.e.,\n\t\t\t\t// it allows us to render wrappers only when the fills are actually present.\n\t\t\t\t( element ) => ! isEmptyElement( element )\n\t\t\t);\n\n\t\treturn <>{ isFunction( children ) ? children( fills ) : fills }</>;\n\t}\n}\n\nconst Slot = ( props: Omit< SlotComponentProps, 'bubblesVirtually' > ) => (\n\t<SlotFillContext.Consumer>\n\t\t{ ( { registerSlot, unregisterSlot, getFills } ) => (\n\t\t\t<SlotComponent\n\t\t\t\t{ ...props }\n\t\t\t\tregisterSlot={ registerSlot }\n\t\t\t\tunregisterSlot={ unregisterSlot }\n\t\t\t\tgetFills={ getFills }\n\t\t\t/>\n\t\t) }\n\t</SlotFillContext.Consumer>\n);\n\nexport default Slot;\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SACCA,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZC,cAAc,QACR,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,eAAe,MAAM,WAAW;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAGxC;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAAEC,SAAc,EAA0B;EAC5D,OAAO,OAAOA,SAAS,K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+16,7 @@ import warning from '@wordpress/warning';
|
|
|
16
16
|
* Internal dependencies
|
|
17
17
|
*/
|
|
18
18
|
import Button from '../button';
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
20
|
const NOTICE_TIMEOUT = 10000;
|
|
22
21
|
|
|
23
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","speak","useEffect","useLayoutEffect","useRef","forwardRef","renderToString","__","warning","Button","jsx","_jsx","jsxs","_jsxs","NOTICE_TIMEOUT","useSpokenMessage","message","politeness","spokenMessage","UnforwardedSnackbar","className","children","actions","onRemove","icon","explicitDismiss","onDismiss","listRef","ref","dismissMe","event","preventDefault","current","focus","onActionClick","onClick","stopPropagation","callbacksRef","timeoutHandle","setTimeout","clearTimeout","classes","length","globalThis","SCRIPT_DEBUG","snackbarContentClassnames","undefined","tabIndex","role","onKeyPress","map","label","url","index","href","variant","Snackbar"],"sources":["@wordpress/components/src/snackbar/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport {\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tforwardRef,\n\trenderToString,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { SnackbarProps } from './types';\nimport type { NoticeAction } from '../notice/types';\nimport type { WordPressComponentProps } from '../context';\n\nconst NOTICE_TIMEOUT = 10000;\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n *\n * @param message Message to announce.\n * @param politeness Politeness to announce.\n */\nfunction useSpokenMessage(\n\tmessage: SnackbarProps[ 'spokenMessage' ],\n\tpoliteness: NonNullable< SnackbarProps[ 'politeness' ] >\n) {\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\nfunction UnforwardedSnackbar(\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\tspokenMessage = children,\n\t\tpoliteness = 'polite',\n\t\tactions = [],\n\t\tonRemove,\n\t\ticon = null,\n\t\texplicitDismiss = false,\n\t\t// onDismiss is a callback executed when the snackbar is dismissed.\n\t\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t\t// actually the function to call to remove the snackbar from the UI.\n\t\tonDismiss,\n\t\tlistRef,\n\t}: WordPressComponentProps< SnackbarProps, 'div' >,\n\tref: ForwardedRef< any >\n) {\n\tfunction dismissMe( event: KeyboardEvent | MouseEvent ) {\n\t\tif ( event && event.preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t// Prevent focus loss by moving it to the list element.\n\t\tlistRef?.current?.focus();\n\n\t\tonDismiss?.();\n\t\tonRemove?.();\n\t}\n\n\tfunction onActionClick(\n\t\tevent: MouseEvent< HTMLButtonElement >,\n\t\tonClick: NoticeAction[ 'onClick' ]\n\t) {\n\t\tevent.stopPropagation();\n\n\t\tonRemove?.();\n\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\t// The `onDismiss/onRemove` can have unstable references,\n\t// trigger side-effect cleanup, and reset timers.\n\tconst callbacksRef = useRef( { onDismiss, onRemove } );\n\tuseLayoutEffect( () => {\n\t\tcallbacksRef.current = { onDismiss, onRemove };\n\t} );\n\n\tuseEffect( () => {\n\t\t// Only set up the timeout dismiss if we're not explicitly dismissing.\n\t\tconst timeoutHandle = setTimeout( () => {\n\t\t\tif ( ! explicitDismiss ) {\n\t\t\t\tcallbacksRef.current.onDismiss?.();\n\t\t\t\tcallbacksRef.current.onRemove?.();\n\t\t\t}\n\t\t}, NOTICE_TIMEOUT );\n\n\t\treturn () => clearTimeout( timeoutHandle );\n\t}, [ explicitDismiss ] );\n\n\tconst classes = clsx( className, 'components-snackbar', {\n\t\t'components-snackbar-explicit-dismiss': !! explicitDismiss,\n\t} );\n\tif ( actions && actions.length > 1 ) {\n\t\t// We need to inform developers that snackbar only accepts 1 action.\n\t\twarning(\n\t\t\t'Snackbar can only have one action. Use Notice if your message requires many actions.'\n\t\t);\n\t\t// return first element only while keeping it inside an array\n\t\tactions = [ actions[ 0 ] ];\n\t}\n\n\tconst snackbarContentClassnames = clsx( 'components-snackbar__content', {\n\t\t'components-snackbar__content-with-icon': !! icon,\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ classes }\n\t\t\tonClick={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\ttabIndex={ 0 }\n\t\t\trole={ ! explicitDismiss ? 'button' : undefined }\n\t\t\tonKeyPress={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\taria-label={\n\t\t\t\t! explicitDismiss ? __( 'Dismiss this notice' ) : undefined\n\t\t\t}\n\t\t\tdata-testid=\"snackbar\"\n\t\t>\n\t\t\t<div className={ snackbarContentClassnames }>\n\t\t\t\t{ icon && (\n\t\t\t\t\t<div className=\"components-snackbar__icon\">{ icon }</div>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ actions.map( ( { label, onClick, url }, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ (\n\t\t\t\t\t\t\t\tevent: MouseEvent< HTMLButtonElement >\n\t\t\t\t\t\t\t) => onActionClick( event, onClick ) }\n\t\t\t\t\t\t\tclassName=\"components-snackbar__action\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t{ explicitDismiss && (\n\t\t\t\t\t<span\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label={ __( 'Dismiss this notice' ) }\n\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\tclassName=\"components-snackbar__dismiss-button\"\n\t\t\t\t\t\tonClick={ dismissMe }\n\t\t\t\t\t\tonKeyPress={ dismissMe }\n\t\t\t\t\t>\n\t\t\t\t\t\t✕\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * A Snackbar displays a succinct message that is cleared out after a small delay.\n *\n * It can also offer the user options, like viewing a published post.\n * But these options should also be available elsewhere in the UI.\n *\n * ```jsx\n * const MySnackbarNotice = () => (\n * <Snackbar>Post published successfully.</Snackbar>\n * );\n * ```\n */\nexport const Snackbar = forwardRef( UnforwardedSnackbar );\n\nexport default Snackbar;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SACCC,SAAS,EACTC,eAAe,EACfC,MAAM,EACNC,UAAU,EACVC,cAAc,QACR,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["clsx","speak","useEffect","useLayoutEffect","useRef","forwardRef","renderToString","__","warning","Button","jsx","_jsx","jsxs","_jsxs","NOTICE_TIMEOUT","useSpokenMessage","message","politeness","spokenMessage","UnforwardedSnackbar","className","children","actions","onRemove","icon","explicitDismiss","onDismiss","listRef","ref","dismissMe","event","preventDefault","current","focus","onActionClick","onClick","stopPropagation","callbacksRef","timeoutHandle","setTimeout","clearTimeout","classes","length","globalThis","SCRIPT_DEBUG","snackbarContentClassnames","undefined","tabIndex","role","onKeyPress","map","label","url","index","href","variant","Snackbar"],"sources":["@wordpress/components/src/snackbar/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport {\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tforwardRef,\n\trenderToString,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { SnackbarProps } from './types';\nimport type { NoticeAction } from '../notice/types';\nimport type { WordPressComponentProps } from '../context';\n\nconst NOTICE_TIMEOUT = 10000;\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n *\n * @param message Message to announce.\n * @param politeness Politeness to announce.\n */\nfunction useSpokenMessage(\n\tmessage: SnackbarProps[ 'spokenMessage' ],\n\tpoliteness: NonNullable< SnackbarProps[ 'politeness' ] >\n) {\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\nfunction UnforwardedSnackbar(\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\tspokenMessage = children,\n\t\tpoliteness = 'polite',\n\t\tactions = [],\n\t\tonRemove,\n\t\ticon = null,\n\t\texplicitDismiss = false,\n\t\t// onDismiss is a callback executed when the snackbar is dismissed.\n\t\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t\t// actually the function to call to remove the snackbar from the UI.\n\t\tonDismiss,\n\t\tlistRef,\n\t}: WordPressComponentProps< SnackbarProps, 'div' >,\n\tref: ForwardedRef< any >\n) {\n\tfunction dismissMe( event: KeyboardEvent | MouseEvent ) {\n\t\tif ( event && event.preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t// Prevent focus loss by moving it to the list element.\n\t\tlistRef?.current?.focus();\n\n\t\tonDismiss?.();\n\t\tonRemove?.();\n\t}\n\n\tfunction onActionClick(\n\t\tevent: MouseEvent< HTMLButtonElement >,\n\t\tonClick: NoticeAction[ 'onClick' ]\n\t) {\n\t\tevent.stopPropagation();\n\n\t\tonRemove?.();\n\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\t// The `onDismiss/onRemove` can have unstable references,\n\t// trigger side-effect cleanup, and reset timers.\n\tconst callbacksRef = useRef( { onDismiss, onRemove } );\n\tuseLayoutEffect( () => {\n\t\tcallbacksRef.current = { onDismiss, onRemove };\n\t} );\n\n\tuseEffect( () => {\n\t\t// Only set up the timeout dismiss if we're not explicitly dismissing.\n\t\tconst timeoutHandle = setTimeout( () => {\n\t\t\tif ( ! explicitDismiss ) {\n\t\t\t\tcallbacksRef.current.onDismiss?.();\n\t\t\t\tcallbacksRef.current.onRemove?.();\n\t\t\t}\n\t\t}, NOTICE_TIMEOUT );\n\n\t\treturn () => clearTimeout( timeoutHandle );\n\t}, [ explicitDismiss ] );\n\n\tconst classes = clsx( className, 'components-snackbar', {\n\t\t'components-snackbar-explicit-dismiss': !! explicitDismiss,\n\t} );\n\tif ( actions && actions.length > 1 ) {\n\t\t// We need to inform developers that snackbar only accepts 1 action.\n\t\twarning(\n\t\t\t'Snackbar can only have one action. Use Notice if your message requires many actions.'\n\t\t);\n\t\t// return first element only while keeping it inside an array\n\t\tactions = [ actions[ 0 ] ];\n\t}\n\n\tconst snackbarContentClassnames = clsx( 'components-snackbar__content', {\n\t\t'components-snackbar__content-with-icon': !! icon,\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ classes }\n\t\t\tonClick={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\ttabIndex={ 0 }\n\t\t\trole={ ! explicitDismiss ? 'button' : undefined }\n\t\t\tonKeyPress={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\taria-label={\n\t\t\t\t! explicitDismiss ? __( 'Dismiss this notice' ) : undefined\n\t\t\t}\n\t\t\tdata-testid=\"snackbar\"\n\t\t>\n\t\t\t<div className={ snackbarContentClassnames }>\n\t\t\t\t{ icon && (\n\t\t\t\t\t<div className=\"components-snackbar__icon\">{ icon }</div>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ actions.map( ( { label, onClick, url }, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ (\n\t\t\t\t\t\t\t\tevent: MouseEvent< HTMLButtonElement >\n\t\t\t\t\t\t\t) => onActionClick( event, onClick ) }\n\t\t\t\t\t\t\tclassName=\"components-snackbar__action\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t{ explicitDismiss && (\n\t\t\t\t\t<span\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label={ __( 'Dismiss this notice' ) }\n\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\tclassName=\"components-snackbar__dismiss-button\"\n\t\t\t\t\t\tonClick={ dismissMe }\n\t\t\t\t\t\tonKeyPress={ dismissMe }\n\t\t\t\t\t>\n\t\t\t\t\t\t✕\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * A Snackbar displays a succinct message that is cleared out after a small delay.\n *\n * It can also offer the user options, like viewing a published post.\n * But these options should also be available elsewhere in the UI.\n *\n * ```jsx\n * const MySnackbarNotice = () => (\n * <Snackbar>Post published successfully.</Snackbar>\n * );\n * ```\n */\nexport const Snackbar = forwardRef( UnforwardedSnackbar );\n\nexport default Snackbar;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SACCC,SAAS,EACTC,eAAe,EACfC,MAAM,EACNC,UAAU,EACVC,cAAc,QACR,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAK/B,MAAMC,cAAc,GAAG,KAAK;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CACxBC,OAAyC,EACzCC,UAAwD,EACvD;EACD,MAAMC,aAAa,GAClB,OAAOF,OAAO,KAAK,QAAQ,GAAGA,OAAO,GAAGV,cAAc,CAAEU,OAAQ,CAAC;EAElEd,SAAS,CAAE,MAAM;IAChB,IAAKgB,aAAa,EAAG;MACpBjB,KAAK,CAAEiB,aAAa,EAAED,UAAW,CAAC;IACnC;EACD,CAAC,EAAE,CAAEC,aAAa,EAAED,UAAU,CAAG,CAAC;AACnC;AAEA,SAASE,mBAAmBA,CAC3B;EACCC,SAAS;EACTC,QAAQ;EACRH,aAAa,GAAGG,QAAQ;EACxBJ,UAAU,GAAG,QAAQ;EACrBK,OAAO,GAAG,EAAE;EACZC,QAAQ;EACRC,IAAI,GAAG,IAAI;EACXC,eAAe,GAAG,KAAK;EACvB;EACA;EACA;EACAC,SAAS;EACTC;AACgD,CAAC,EAClDC,GAAwB,EACvB;EACD,SAASC,SAASA,CAAEC,KAAiC,EAAG;IACvD,IAAKA,KAAK,IAAIA,KAAK,CAACC,cAAc,EAA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,SAAW;QAAAR,QAAA,EACxB;MAED,CAAM,CACN;IAAA,CACG;EAAC,CACF,CAAC;AAER;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMmC,QAAQ,GAAGnD,UAAU,CAAEc,mBAAoB,CAAC;AAEzD,eAAeqC,QAAQ","ignoreList":[]}
|
|
@@ -14,8 +14,7 @@ import { useRef } from '@wordpress/element';
|
|
|
14
14
|
*/
|
|
15
15
|
import Snackbar from '.';
|
|
16
16
|
import { __unstableMotion as motion, __unstableAnimatePresence as AnimatePresence } from '../animation';
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
18
|
const SNACKBAR_VARIANTS = {
|
|
20
19
|
init: {
|
|
21
20
|
height: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useReducedMotion","useRef","Snackbar","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","jsx","_jsx","jsxs","_jsxs","SNACKBAR_VARIANTS","init","height","opacity","open","transition","type","duration","ease","delay","exit","SnackbarList","notices","className","children","onRemove","listRef","isReducedMotion","removeNotice","notice","id","tabIndex","ref","map","content","restNotice","div","layout","initial","animate","variants","undefined"],"sources":["@wordpress/components/src/snackbar/list.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion } from '@wordpress/compose';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Snackbar from '.';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '../animation';\nimport type { SnackbarListProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nconst SNACKBAR_VARIANTS = {\n\tinit: {\n\t\theight: 0,\n\t\topacity: 0,\n\t},\n\topen: {\n\t\theight: 'auto',\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\theight: { type: 'tween', duration: 0.3, ease: [ 0, 0, 0.2, 1 ] },\n\t\t\topacity: {\n\t\t\t\ttype: 'tween',\n\t\t\t\tduration: 0.25,\n\t\t\t\tdelay: 0.05,\n\t\t\t\tease: [ 0, 0, 0.2, 1 ],\n\t\t\t},\n\t\t},\n\t},\n\texit: {\n\t\topacity: 0,\n\t\ttransition: {\n\t\t\ttype: 'tween',\n\t\t\tduration: 0.1,\n\t\t\tease: [ 0, 0, 0.2, 1 ],\n\t\t},\n\t},\n};\n\n/**\n * Renders a list of notices.\n *\n * ```jsx\n * const MySnackbarListNotice = () => (\n * <SnackbarList\n * notices={ notices }\n * onRemove={ removeNotice }\n * />\n * );\n * ```\n */\nexport function SnackbarList( {\n\tnotices,\n\tclassName,\n\tchildren,\n\tonRemove,\n}: WordPressComponentProps< SnackbarListProps, 'div' > ) {\n\tconst listRef = useRef< HTMLDivElement | null >( null );\n\tconst isReducedMotion = useReducedMotion();\n\tclassName = clsx( 'components-snackbar-list', className );\n\tconst removeNotice =\n\t\t( notice: SnackbarListProps[ 'notices' ][ number ] ) => () =>\n\t\t\tonRemove?.( notice.id );\n\treturn (\n\t\t<div\n\t\t\tclassName={ className }\n\t\t\ttabIndex={ -1 }\n\t\t\tref={ listRef }\n\t\t\tdata-testid=\"snackbar-list\"\n\t\t>\n\t\t\t{ children }\n\t\t\t<AnimatePresence>\n\t\t\t\t{ notices.map( ( notice ) => {\n\t\t\t\t\tconst { content, ...restNotice } = notice;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tlayout={ ! isReducedMotion } // See https://www.framer.com/docs/animation/#layout-animations\n\t\t\t\t\t\t\tinitial=\"init\"\n\t\t\t\t\t\t\tanimate=\"open\"\n\t\t\t\t\t\t\texit=\"exit\"\n\t\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\t\tvariants={\n\t\t\t\t\t\t\t\tisReducedMotion ? undefined : SNACKBAR_VARIANTS\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"components-snackbar-list__notice-container\">\n\t\t\t\t\t\t\t\t<Snackbar\n\t\t\t\t\t\t\t\t\t{ ...restNotice }\n\t\t\t\t\t\t\t\t\tonRemove={ removeNotice( notice ) }\n\t\t\t\t\t\t\t\t\tlistRef={ listRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ notice.content }\n\t\t\t\t\t\t\t\t</Snackbar>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</AnimatePresence>\n\t\t</div>\n\t);\n}\n\nexport default SnackbarList;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,MAAM,QAAQ,oBAAoB;;AAE3C;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,GAAG;AACxB,SACCC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["clsx","useReducedMotion","useRef","Snackbar","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","jsx","_jsx","jsxs","_jsxs","SNACKBAR_VARIANTS","init","height","opacity","open","transition","type","duration","ease","delay","exit","SnackbarList","notices","className","children","onRemove","listRef","isReducedMotion","removeNotice","notice","id","tabIndex","ref","map","content","restNotice","div","layout","initial","animate","variants","undefined"],"sources":["@wordpress/components/src/snackbar/list.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion } from '@wordpress/compose';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Snackbar from '.';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '../animation';\nimport type { SnackbarListProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nconst SNACKBAR_VARIANTS = {\n\tinit: {\n\t\theight: 0,\n\t\topacity: 0,\n\t},\n\topen: {\n\t\theight: 'auto',\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\theight: { type: 'tween', duration: 0.3, ease: [ 0, 0, 0.2, 1 ] },\n\t\t\topacity: {\n\t\t\t\ttype: 'tween',\n\t\t\t\tduration: 0.25,\n\t\t\t\tdelay: 0.05,\n\t\t\t\tease: [ 0, 0, 0.2, 1 ],\n\t\t\t},\n\t\t},\n\t},\n\texit: {\n\t\topacity: 0,\n\t\ttransition: {\n\t\t\ttype: 'tween',\n\t\t\tduration: 0.1,\n\t\t\tease: [ 0, 0, 0.2, 1 ],\n\t\t},\n\t},\n};\n\n/**\n * Renders a list of notices.\n *\n * ```jsx\n * const MySnackbarListNotice = () => (\n * <SnackbarList\n * notices={ notices }\n * onRemove={ removeNotice }\n * />\n * );\n * ```\n */\nexport function SnackbarList( {\n\tnotices,\n\tclassName,\n\tchildren,\n\tonRemove,\n}: WordPressComponentProps< SnackbarListProps, 'div' > ) {\n\tconst listRef = useRef< HTMLDivElement | null >( null );\n\tconst isReducedMotion = useReducedMotion();\n\tclassName = clsx( 'components-snackbar-list', className );\n\tconst removeNotice =\n\t\t( notice: SnackbarListProps[ 'notices' ][ number ] ) => () =>\n\t\t\tonRemove?.( notice.id );\n\treturn (\n\t\t<div\n\t\t\tclassName={ className }\n\t\t\ttabIndex={ -1 }\n\t\t\tref={ listRef }\n\t\t\tdata-testid=\"snackbar-list\"\n\t\t>\n\t\t\t{ children }\n\t\t\t<AnimatePresence>\n\t\t\t\t{ notices.map( ( notice ) => {\n\t\t\t\t\tconst { content, ...restNotice } = notice;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tlayout={ ! isReducedMotion } // See https://www.framer.com/docs/animation/#layout-animations\n\t\t\t\t\t\t\tinitial=\"init\"\n\t\t\t\t\t\t\tanimate=\"open\"\n\t\t\t\t\t\t\texit=\"exit\"\n\t\t\t\t\t\t\tkey={ notice.id }\n\t\t\t\t\t\t\tvariants={\n\t\t\t\t\t\t\t\tisReducedMotion ? undefined : SNACKBAR_VARIANTS\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"components-snackbar-list__notice-container\">\n\t\t\t\t\t\t\t\t<Snackbar\n\t\t\t\t\t\t\t\t\t{ ...restNotice }\n\t\t\t\t\t\t\t\t\tonRemove={ removeNotice( notice ) }\n\t\t\t\t\t\t\t\t\tlistRef={ listRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ notice.content }\n\t\t\t\t\t\t\t\t</Snackbar>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</AnimatePresence>\n\t\t</div>\n\t);\n}\n\nexport default SnackbarList;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,MAAM,QAAQ,oBAAoB;;AAE3C;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,GAAG;AACxB,SACCC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAItB,MAAMC,iBAAiB,GAAG;EACzBC,IAAI,EAAE;IACLC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACLF,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE,CAAC;IACVE,UAAU,EAAE;MACXH,MAAM,EAAE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AA,CAACJ,MAAM,CAACiC,GAAG;UACVC,MAAM,EAAG,CAAEV,eAAiB,CAAC;UAAA;UAC7BW,OAAO,EAAC,MAAM;UACdC,OAAO,EAAC,MAAM;UACdnB,IAAI,EAAC,MAAM;UAEXoB,QAAQ,EACPb,eAAe,GAAGc,SAAS,GAAG/B,iBAC9B;UAAAc,QAAA,eAEDjB,IAAA;YAAKgB,SAAS,EAAC,4CAA4C;YAAAC,QAAA,eAC1DjB,IAAA,CAACN,QAAQ;cAAA,GACHkC,UAAU;cACfV,QAAQ,EAAGG,YAAY,CAAEC,MAAO,CAAG;cACnCH,OAAO,EAAGA,OAAS;cAAAF,QAAA,EAEjBK,MAAM,CAACK;YAAO,CACP;UAAC,CACP;QAAC,GAbAL,MAAM,CAACC,EAcF,CAAC;MAEf,CAAE;IAAC,CACa,CAAC;EAAA,CACd,CAAC;AAER;AAEA,eAAeT,YAAY","ignoreList":[]}
|
|
@@ -10,8 +10,7 @@ import { StyledSpinner, SpinnerTrack, SpinnerIndicator } from './styles';
|
|
|
10
10
|
* WordPress dependencies
|
|
11
11
|
*/
|
|
12
12
|
import { forwardRef } from '@wordpress/element';
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
14
|
export function UnforwardedSpinner({
|
|
16
15
|
className,
|
|
17
16
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","StyledSpinner","SpinnerTrack","SpinnerIndicator","forwardRef","jsx","_jsx","jsxs","_jsxs","UnforwardedSpinner","className","props","forwardedRef","viewBox","width","height","xmlns","role","focusable","ref","children","cx","cy","r","vectorEffect","d","Spinner"],"sources":["@wordpress/components/src/spinner/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { StyledSpinner, SpinnerTrack, SpinnerIndicator } from './styles';\nimport type { WordPressComponentProps } from '../context';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\nexport function UnforwardedSpinner(\n\t{ className, ...props }: WordPressComponentProps< {}, 'svg', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\treturn (\n\t\t<StyledSpinner\n\t\t\tclassName={ clsx( 'components-spinner', className ) }\n\t\t\tviewBox=\"0 0 100 100\"\n\t\t\twidth=\"16\"\n\t\t\theight=\"16\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\trole=\"presentation\"\n\t\t\tfocusable=\"false\"\n\t\t\t{ ...props }\n\t\t\tref={ forwardedRef }\n\t\t>\n\t\t\t{ /* Gray circular background */ }\n\t\t\t<SpinnerTrack\n\t\t\t\tcx=\"50\"\n\t\t\t\tcy=\"50\"\n\t\t\t\tr=\"50\"\n\t\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t\t/>\n\n\t\t\t{ /* Theme-colored arc */ }\n\t\t\t<SpinnerIndicator\n\t\t\t\td=\"m 50 0 a 50 50 0 0 1 50 50\"\n\t\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t\t/>\n\t\t</StyledSpinner>\n\t);\n}\n/**\n * `Spinner` is a component used to notify users that their action is being processed.\n *\n * ```js\n * import { Spinner } from '@wordpress/components';\n *\n * function Example() {\n * return <Spinner />;\n * }\n * ```\n */\nexport const Spinner = forwardRef( UnforwardedSpinner );\nexport default Spinner;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,aAAa,EAAEC,YAAY,EAAEC,gBAAgB,QAAQ,UAAU;AAGxE;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["clsx","StyledSpinner","SpinnerTrack","SpinnerIndicator","forwardRef","jsx","_jsx","jsxs","_jsxs","UnforwardedSpinner","className","props","forwardedRef","viewBox","width","height","xmlns","role","focusable","ref","children","cx","cy","r","vectorEffect","d","Spinner"],"sources":["@wordpress/components/src/spinner/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { StyledSpinner, SpinnerTrack, SpinnerIndicator } from './styles';\nimport type { WordPressComponentProps } from '../context';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\nexport function UnforwardedSpinner(\n\t{ className, ...props }: WordPressComponentProps< {}, 'svg', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\treturn (\n\t\t<StyledSpinner\n\t\t\tclassName={ clsx( 'components-spinner', className ) }\n\t\t\tviewBox=\"0 0 100 100\"\n\t\t\twidth=\"16\"\n\t\t\theight=\"16\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\trole=\"presentation\"\n\t\t\tfocusable=\"false\"\n\t\t\t{ ...props }\n\t\t\tref={ forwardedRef }\n\t\t>\n\t\t\t{ /* Gray circular background */ }\n\t\t\t<SpinnerTrack\n\t\t\t\tcx=\"50\"\n\t\t\t\tcy=\"50\"\n\t\t\t\tr=\"50\"\n\t\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t\t/>\n\n\t\t\t{ /* Theme-colored arc */ }\n\t\t\t<SpinnerIndicator\n\t\t\t\td=\"m 50 0 a 50 50 0 0 1 50 50\"\n\t\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t\t/>\n\t\t</StyledSpinner>\n\t);\n}\n/**\n * `Spinner` is a component used to notify users that their action is being processed.\n *\n * ```js\n * import { Spinner } from '@wordpress/components';\n *\n * function Example() {\n * return <Spinner />;\n * }\n * ```\n */\nexport const Spinner = forwardRef( UnforwardedSpinner );\nexport default Spinner;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,aAAa,EAAEC,YAAY,EAAEC,gBAAgB,QAAQ,UAAU;AAGxE;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhD,OAAO,SAASC,kBAAkBA,CACjC;EAAEC,SAAS;EAAE,GAAGC;AAAmD,CAAC,EACpEC,YAAiC,EAChC;EACD,oBACCJ,KAAA,CAACP,aAAa;IACbS,SAAS,EAAGV,IAAI,CAAE,oBAAoB,EAAEU,SAAU,CAAG;IACrDG,OAAO,EAAC,aAAa;IACrBC,KAAK,EAAC,IAAI;IACVC,MAAM,EAAC,IAAI;IACXC,KAAK,EAAC,4BAA4B;IAClCC,IAAI,EAAC,cAAc;IACnBC,SAAS,EAAC,OAAO;IAAA,GACZP,KAAK;IACVQ,GAAG,EAAGP,YAAc;IAAAQ,QAAA,gBAGpBd,IAAA,CAACJ,YAAY;MACZmB,EAAE,EAAC,IAAI;MACPC,EAAE,EAAC,IAAI;MACPC,CAAC,EAAC,IAAI;MACNC,YAAY,EAAC;IAAoB,CACjC,CAAC,eAGFlB,IAAA,CAACH,gBAAgB;MAChBsB,CAAC,EAAC,4BAA4B;MAC9BD,YAAY,EAAC;IAAoB,CACjC,CAAC;EAAA,CACY,CAAC;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,OAAO,GAAGtB,UAAU,CAAEK,kBAAmB,CAAC;AACvD,eAAeiB,OAAO","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["css","keyframes","COLORS","CONFIG","spinAnimation","StyledSpinner","_styled","process","env","NODE_ENV","target","label","spinnerSize","theme","accent","commonPathProps","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","SpinnerTrack","gray","SpinnerIndicator"],"sources":["@wordpress/components/src/spinner/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport { css, keyframes } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\n\nconst spinAnimation = keyframes`\n\tfrom {\n\t\ttransform: rotate(0deg);\n\t}\n\tto {\n\t\ttransform: rotate(360deg);\n\t}\n `;\n\nexport const StyledSpinner = styled.svg`\n\twidth: ${ CONFIG.spinnerSize }px;\n\theight: ${ CONFIG.spinnerSize }px;\n\tdisplay: inline-block;\n\tmargin: 5px 11px 0;\n\tposition: relative;\n\tcolor: ${ COLORS.theme.accent };\n\toverflow: visible;\n\topacity: 1;\n\tbackground-color: transparent;\n`;\n\nconst commonPathProps = css`\n\tfill: transparent;\n\tstroke-width: 1.5px;\n`;\n\nexport const SpinnerTrack = styled.circle`\n\t${ commonPathProps };\n\tstroke: ${ COLORS.gray[ 300 ] };\n`;\n\nexport const SpinnerIndicator = styled.path`\n\t${ commonPathProps };\n\tstroke: currentColor;\n\tstroke-linecap: round;\n\ttransform-origin: 50% 50%;\n\tanimation: 1.4s linear infinite both ${ spinAnimation };\n`;\n"],"mappings":";;AAAA;AACA;AACA;;AAEA,SAASA,GAAG,EAAEC,SAAS,QAAQ,gBAAgB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,EAAEC,MAAM,QAAQ,UAAU;AAEzC,MAAMC,aAAa,GAAGH,
|
|
1
|
+
{"version":3,"names":["css","keyframes","COLORS","CONFIG","spinAnimation","StyledSpinner","_styled","process","env","NODE_ENV","target","label","spinnerSize","theme","accent","commonPathProps","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","SpinnerTrack","gray","SpinnerIndicator"],"sources":["@wordpress/components/src/spinner/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport { css, keyframes } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\n\nconst spinAnimation = keyframes`\n\tfrom {\n\t\ttransform: rotate(0deg);\n\t}\n\tto {\n\t\ttransform: rotate(360deg);\n\t}\n `;\n\nexport const StyledSpinner = styled.svg`\n\twidth: ${ CONFIG.spinnerSize }px;\n\theight: ${ CONFIG.spinnerSize }px;\n\tdisplay: inline-block;\n\tmargin: 5px 11px 0;\n\tposition: relative;\n\tcolor: ${ COLORS.theme.accent };\n\toverflow: visible;\n\topacity: 1;\n\tbackground-color: transparent;\n`;\n\nconst commonPathProps = css`\n\tfill: transparent;\n\tstroke-width: 1.5px;\n`;\n\nexport const SpinnerTrack = styled.circle`\n\t${ commonPathProps };\n\tstroke: ${ COLORS.gray[ 300 ] };\n`;\n\nexport const SpinnerIndicator = styled.path`\n\t${ commonPathProps };\n\tstroke: currentColor;\n\tstroke-linecap: round;\n\ttransform-origin: 50% 50%;\n\tanimation: 1.4s linear infinite both ${ spinAnimation };\n`;\n"],"mappings":";;AAAA;AACA;AACA;;AAEA,SAASA,GAAG,EAAEC,SAAS,QAAQ,gBAAgB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,EAAEC,MAAM,QAAQ,UAAU;AAEzC,MAAMC,aAAa,GAAGH,SAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AAEF,OAAO,MAAMI,aAAa,gBAAAC,OAAA,QAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,aACfR,MAAM,CAACS,WAAW,gBACjBT,MAAM,CAACS,WAAW,wEAInBV,MAAM,CAACW,KAAK,CAACC,MAAM,iEAAAP,OAAA,CAAAC,GAAA,CAAAC,QAAA,wsDAI7B;AAED,MAAMM,eAAe,GAAAR,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAO,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,CAGpB;AAED,OAAO,MAAMC,YAAY,gBAAAf,OAAA,WAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GACrBI,eAAe,cACPb,MAAM,CAACoB,IAAI,CAAE,GAAG,CAAE,SAAAf,OAAA,CAAAC,GAAA,CAAAC,QAAA,wsDAC7B;AAED,OAAO,MAAMc,gBAAgB,gBAAAjB,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GACzBI,eAAe,6GAIsBX,aAAa,SAAAG,OAAA,CAAAC,GAAA,CAAAC,QAAA,wsDACrD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CacheProvider","createCache","uuid","jsx","_jsx","uuidCache","Set","containerCacheMap","WeakMap","memoizedCreateCacheWithContainer","container","has","get","key","v4","replace","add","cache","set","StyleProvider","props","children","document","head","value"],"sources":["@wordpress/components/src/style-provider/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\nimport * as uuid from 'uuid';\n\n/**\n * Internal dependencies\n */\nimport type { StyleProviderProps } from './types';\n\nconst uuidCache = new Set();\n// Use a weak map so that when the container is detached it's automatically\n// dereferenced to avoid memory leak.\nconst containerCacheMap = new WeakMap();\n\nconst memoizedCreateCacheWithContainer = ( container: HTMLElement ) => {\n\tif ( containerCacheMap.has( container ) ) {\n\t\treturn containerCacheMap.get( container );\n\t}\n\n\t// Emotion only accepts alphabetical and hyphenated keys so we just\n\t// strip the numbers from the UUID. It _should_ be fine.\n\tlet key = uuid.v4().replace( /[0-9]/g, '' );\n\twhile ( uuidCache.has( key ) ) {\n\t\tkey = uuid.v4().replace( /[0-9]/g, '' );\n\t}\n\tuuidCache.add( key );\n\n\tconst cache = createCache( { container, key } );\n\tcontainerCacheMap.set( container, cache );\n\treturn cache;\n};\n\nexport function StyleProvider( props: StyleProviderProps ) {\n\tconst { children, document } = props;\n\n\tif ( ! document ) {\n\t\treturn null;\n\t}\n\n\tconst cache = memoizedCreateCacheWithContainer( document.head );\n\n\treturn <CacheProvider value={ cache }>{ children }</CacheProvider>;\n}\n\nexport default StyleProvider;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,gBAAgB;AAC9C,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAO,KAAKC,IAAI,MAAM,MAAM;;AAE5B;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAKA,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAC,CAAC;AAC3B;AACA;AACA,MAAMC,iBAAiB,GAAG,IAAIC,OAAO,CAAC,CAAC;AAEvC,MAAMC,gCAAgC,GAAKC,SAAsB,IAAM;EACtE,IAAKH,iBAAiB,CAACI,GAAG,CAAED,SAAU,CAAC,EAAG;IACzC,OAAOH,iBAAiB,CAACK,GAAG,CAAEF,SAAU,CAAC;EAC1C;;EAEA;EACA;EACA,IAAIG,GAAG,GAAGX,IAAI,CAACY,EAAE,CAAC,CAAC,CAACC,OAAO,CAAE,QAAQ,EAAE,EAAG,CAAC;EAC3C,OAAQV,SAAS,CAACM,GAAG,CAAEE,GAAI,CAAC,EAAG;IAC9BA,GAAG,GAAGX,IAAI,CAACY,EAAE,CAAC,CAAC,CAACC,OAAO,CAAE,QAAQ,EAAE,EAAG,CAAC;EACxC;EACAV,SAAS,CAACW,GAAG,CAAEH,GAAI,CAAC;EAEpB,MAAMI,KAAK,GAAGhB,WAAW,CAAE;IAAES,SAAS;IAAEG;EAAI,CAAE,CAAC;EAC/CN,iBAAiB,CAACW,GAAG,CAAER,SAAS,EAAEO,KAAM,CAAC;EACzC,OAAOA,KAAK;AACb,CAAC;AAED,OAAO,SAASE,aAAaA,CAAEC,KAAyB,EAAG;EAC1D,MAAM;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGF,KAAK;EAEpC,IAAK,CAAEE,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,MAAML,KAAK,GAAGR,gCAAgC,CAAEa,QAAQ,CAACC,IAAK,CAAC;EAE/D,oBAAOnB,IAAA,CAACJ,aAAa;IAACwB,KAAK,EAAGP,KAAO;IAAAI,QAAA,EAAGA;EAAQ,CAAiB,CAAC;AACnE;AAEA,eAAeF,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["CacheProvider","createCache","uuid","jsx","_jsx","uuidCache","Set","containerCacheMap","WeakMap","memoizedCreateCacheWithContainer","container","has","get","key","v4","replace","add","cache","set","StyleProvider","props","children","document","head","value"],"sources":["@wordpress/components/src/style-provider/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\nimport * as uuid from 'uuid';\n\n/**\n * Internal dependencies\n */\nimport type { StyleProviderProps } from './types';\n\nconst uuidCache = new Set();\n// Use a weak map so that when the container is detached it's automatically\n// dereferenced to avoid memory leak.\nconst containerCacheMap = new WeakMap();\n\nconst memoizedCreateCacheWithContainer = ( container: HTMLElement ) => {\n\tif ( containerCacheMap.has( container ) ) {\n\t\treturn containerCacheMap.get( container );\n\t}\n\n\t// Emotion only accepts alphabetical and hyphenated keys so we just\n\t// strip the numbers from the UUID. It _should_ be fine.\n\tlet key = uuid.v4().replace( /[0-9]/g, '' );\n\twhile ( uuidCache.has( key ) ) {\n\t\tkey = uuid.v4().replace( /[0-9]/g, '' );\n\t}\n\tuuidCache.add( key );\n\n\tconst cache = createCache( { container, key } );\n\tcontainerCacheMap.set( container, cache );\n\treturn cache;\n};\n\nexport function StyleProvider( props: StyleProviderProps ) {\n\tconst { children, document } = props;\n\n\tif ( ! document ) {\n\t\treturn null;\n\t}\n\n\tconst cache = memoizedCreateCacheWithContainer( document.head );\n\n\treturn <CacheProvider value={ cache }>{ children }</CacheProvider>;\n}\n\nexport default StyleProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,gBAAgB;AAC9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ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","useContextSystem","styles","useCx","useSurface","props","backgroundSize","borderBottom","borderLeft","borderRight","borderTop","className","variant","otherProps","cx","classes","sx","borders","getBorders","Surface","getVariant"],"sources":["@wordpress/components/src/surface/hook.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem } from '../context';\nimport * as styles from './styles';\nimport { useCx } from '../utils/hooks/use-cx';\nimport type { SurfaceProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport function useSurface(\n\tprops: WordPressComponentProps< SurfaceProps, 'div' >\n) {\n\tconst {\n\t\tbackgroundSize = 12,\n\t\tborderBottom = false,\n\t\tborderLeft = false,\n\t\tborderRight = false,\n\t\tborderTop = false,\n\t\tclassName,\n\t\tvariant = 'primary',\n\t\t...otherProps\n\t} = useContextSystem( props, 'Surface' );\n\n\tconst cx = useCx();\n\n\tconst classes = useMemo( () => {\n\t\tconst sx = {\n\t\t\tborders: styles.getBorders( {\n\t\t\t\tborderBottom,\n\t\t\t\tborderLeft,\n\t\t\t\tborderRight,\n\t\t\t\tborderTop,\n\t\t\t} ),\n\t\t};\n\n\t\treturn cx(\n\t\t\tstyles.Surface,\n\t\t\tsx.borders,\n\t\t\tstyles.getVariant(\n\t\t\t\tvariant,\n\t\t\t\t`${ backgroundSize }px`,\n\t\t\t\t`${ backgroundSize - 1 }px`\n\t\t\t),\n\t\t\tclassName\n\t\t);\n\t}, [\n\t\tbackgroundSize,\n\t\tborderBottom,\n\t\tborderLeft,\n\t\tborderRight,\n\t\tborderTop,\n\t\tclassName,\n\t\tcx,\n\t\tvariant,\n\t] );\n\n\treturn { ...otherProps, className: classes };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,OAAO,KAAKC,MAAM,MAAM,UAAU;AAClC,SAASC,KAAK,QAAQ,uBAAuB;AAI7C,OAAO,SAASC,UAAUA,CACzBC,KAAqD,EACpD;EACD,MAAM;IACLC,cAAc,GAAG,EAAE;IACnBC,YAAY,GAAG,KAAK;IACpBC,UAAU,GAAG,KAAK;IAClBC,WAAW,GAAG,KAAK;IACnBC,SAAS,GAAG,KAAK;IACjBC,SAAS;IACTC,OAAO,GAAG,SAAS;IACnB,GAAGC;EACJ,CAAC,GAAGZ,gBAAgB,CAAEI,KAAK,EAAE,SAAU,CAAC;EAExC,MAAMS,EAAE,GAAGX,KAAK,CAAC,CAAC;EAElB,MAAMY,OAAO,GAAGf,OAAO,CAAE,MAAM;IAC9B,MAAMgB,EAAE,GAAG;MACVC,OAAO,EAAEf,MAAM,CAACgB,UAAU,CAAE;QAC3BX,YAAY;QACZC,UAAU;QACVC,WAAW;QACXC;MACD,CAAE;IACH,CAAC;IAED,OAAOI,EAAE,CACRZ,MAAM,CAACiB,OAAO,EACdH,EAAE,CAACC,OAAO,EACVf,MAAM,CAACkB,UAAU,CAChBR,OAAO,
|
|
1
|
+
{"version":3,"names":["useMemo","useContextSystem","styles","useCx","useSurface","props","backgroundSize","borderBottom","borderLeft","borderRight","borderTop","className","variant","otherProps","cx","classes","sx","borders","getBorders","Surface","getVariant"],"sources":["@wordpress/components/src/surface/hook.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem } from '../context';\nimport * as styles from './styles';\nimport { useCx } from '../utils/hooks/use-cx';\nimport type { SurfaceProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport function useSurface(\n\tprops: WordPressComponentProps< SurfaceProps, 'div' >\n) {\n\tconst {\n\t\tbackgroundSize = 12,\n\t\tborderBottom = false,\n\t\tborderLeft = false,\n\t\tborderRight = false,\n\t\tborderTop = false,\n\t\tclassName,\n\t\tvariant = 'primary',\n\t\t...otherProps\n\t} = useContextSystem( props, 'Surface' );\n\n\tconst cx = useCx();\n\n\tconst classes = useMemo( () => {\n\t\tconst sx = {\n\t\t\tborders: styles.getBorders( {\n\t\t\t\tborderBottom,\n\t\t\t\tborderLeft,\n\t\t\t\tborderRight,\n\t\t\t\tborderTop,\n\t\t\t} ),\n\t\t};\n\n\t\treturn cx(\n\t\t\tstyles.Surface,\n\t\t\tsx.borders,\n\t\t\tstyles.getVariant(\n\t\t\t\tvariant,\n\t\t\t\t`${ backgroundSize }px`,\n\t\t\t\t`${ backgroundSize - 1 }px`\n\t\t\t),\n\t\t\tclassName\n\t\t);\n\t}, [\n\t\tbackgroundSize,\n\t\tborderBottom,\n\t\tborderLeft,\n\t\tborderRight,\n\t\tborderTop,\n\t\tclassName,\n\t\tcx,\n\t\tvariant,\n\t] );\n\n\treturn { ...otherProps, className: classes };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,OAAO,KAAKC,MAAM,MAAM,UAAU;AAClC,SAASC,KAAK,QAAQ,uBAAuB;AAI7C,OAAO,SAASC,UAAUA,CACzBC,KAAqD,EACpD;EACD,MAAM;IACLC,cAAc,GAAG,EAAE;IACnBC,YAAY,GAAG,KAAK;IACpBC,UAAU,GAAG,KAAK;IAClBC,WAAW,GAAG,KAAK;IACnBC,SAAS,GAAG,KAAK;IACjBC,SAAS;IACTC,OAAO,GAAG,SAAS;IACnB,GAAGC;EACJ,CAAC,GAAGZ,gBAAgB,CAAEI,KAAK,EAAE,SAAU,CAAC;EAExC,MAAMS,EAAE,GAAGX,KAAK,CAAC,CAAC;EAElB,MAAMY,OAAO,GAAGf,OAAO,CAAE,MAAM;IAC9B,MAAMgB,EAAE,GAAG;MACVC,OAAO,EAAEf,MAAM,CAACgB,UAAU,CAAE;QAC3BX,YAAY;QACZC,UAAU;QACVC,WAAW;QACXC;MACD,CAAE;IACH,CAAC;IAED,OAAOI,EAAE,CACRZ,MAAM,CAACiB,OAAO,EACdH,EAAE,CAACC,OAAO,EACVf,MAAM,CAACkB,UAAU,CAChBR,OAAO,EACP,GAAIN,cAAc,IAAK,EACvB,GAAIA,cAAc,GAAG,CAAC,IACvB,CAAC,EACDK,SACD,CAAC;EACF,CAAC,EAAE,CACFL,cAAc,EACdC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,SAAS,EACTG,EAAE,EACFF,OAAO,CACN,CAAC;EAEH,OAAO;IAAE,GAAGC,UAAU;IAAEF,SAAS,EAAEI;EAAQ,CAAC;AAC7C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["css","CONFIG","COLORS","Surface","surfaceColor","gray","process","env","NODE_ENV","background","surfaceBackgroundColor","getBorders","borderBottom","borderLeft","borderRight","borderTop","borderStyle","surfaceBorderColor","undefined","primary","secondary","surfaceBackgroundTintColor","tertiary","surfaceBackgroundTertiaryColor","customBackgroundSize","surfaceBackgroundSize","join","dottedBackground1","surfaceBackgroundSizeDotted","dottedBackground2","dottedBackgroundCombined","surfaceBorderBoldColor","getDotted","gridBackground1","surfaceBorderSubtleColor","gridBackground2","gridBackgroundCombined","getGrid","getVariant","variant"],"sources":["@wordpress/components/src/surface/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { CONFIG, COLORS } from '../utils';\nimport type { SurfaceVariant, SurfaceProps } from './types';\n\nexport const Surface = css`\n\tbackground-color: ${ CONFIG.surfaceColor };\n\tcolor: ${ COLORS.gray[ 900 ] };\n\tposition: relative;\n`;\n\nexport const background = css`\n\tbackground-color: ${ CONFIG.surfaceBackgroundColor };\n`;\n\nexport function getBorders( {\n\tborderBottom,\n\tborderLeft,\n\tborderRight,\n\tborderTop,\n}: Pick<\n\tSurfaceProps,\n\t'borderBottom' | 'borderLeft' | 'borderRight' | 'borderTop'\n> ) {\n\tconst borderStyle = `1px solid ${ CONFIG.surfaceBorderColor }`;\n\n\treturn css( {\n\t\tborderBottom: borderBottom ? borderStyle : undefined,\n\t\tborderLeft: borderLeft ? borderStyle : undefined,\n\t\tborderRight: borderRight ? borderStyle : undefined,\n\t\tborderTop: borderTop ? borderStyle : undefined,\n\t} );\n}\n\nexport const primary = css``;\n\nexport const secondary = css`\n\tbackground: ${ CONFIG.surfaceBackgroundTintColor };\n`;\n\nexport const tertiary = css`\n\tbackground: ${ CONFIG.surfaceBackgroundTertiaryColor };\n`;\n\nconst customBackgroundSize = ( surfaceBackgroundSize: string ) =>\n\t[ surfaceBackgroundSize, surfaceBackgroundSize ].join( ' ' );\n\nconst dottedBackground1 = ( surfaceBackgroundSizeDotted: string ) =>\n\t[\n\t\t'90deg',\n\t\t[ CONFIG.surfaceBackgroundColor, surfaceBackgroundSizeDotted ].join(\n\t\t\t' '\n\t\t),\n\t\t'transparent 1%',\n\t].join( ',' );\n\nconst dottedBackground2 = ( surfaceBackgroundSizeDotted: string ) =>\n\t[\n\t\t[ CONFIG.surfaceBackgroundColor, surfaceBackgroundSizeDotted ].join(\n\t\t\t' '\n\t\t),\n\t\t'transparent 1%',\n\t].join( ',' );\n\nconst dottedBackgroundCombined = ( surfaceBackgroundSizeDotted: string ) =>\n\t[\n\t\t`linear-gradient( ${ dottedBackground1(\n\t\t\tsurfaceBackgroundSizeDotted\n\t\t) } ) center`,\n\t\t`linear-gradient( ${ dottedBackground2(\n\t\t\tsurfaceBackgroundSizeDotted\n\t\t) } ) center`,\n\t\tCONFIG.surfaceBorderBoldColor,\n\t].join( ',' );\n\nexport const getDotted = (\n\tsurfaceBackgroundSize: string,\n\tsurfaceBackgroundSizeDotted: string\n) => css`\n\tbackground: ${ dottedBackgroundCombined( surfaceBackgroundSizeDotted ) };\n\tbackground-size: ${ customBackgroundSize( surfaceBackgroundSize ) };\n`;\n\nconst gridBackground1 = [\n\t`${ CONFIG.surfaceBorderSubtleColor } 1px`,\n\t'transparent 1px',\n].join( ',' );\n\nconst gridBackground2 = [\n\t'90deg',\n\t`${ CONFIG.surfaceBorderSubtleColor } 1px`,\n\t'transparent 1px',\n].join( ',' );\n\nconst gridBackgroundCombined = [\n\t`linear-gradient( ${ gridBackground1 } )`,\n\t`linear-gradient( ${ gridBackground2 } )`,\n].join( ',' );\n\nexport const getGrid = ( surfaceBackgroundSize: string ) => {\n\treturn css`\n\t\tbackground: ${ CONFIG.surfaceBackgroundColor };\n\t\tbackground-image: ${ gridBackgroundCombined };\n\t\tbackground-size: ${ customBackgroundSize( surfaceBackgroundSize ) };\n\t`;\n};\n\nexport const getVariant = (\n\tvariant: SurfaceVariant,\n\tsurfaceBackgroundSize: string,\n\tsurfaceBackgroundSizeDotted: string\n) => {\n\tswitch ( variant ) {\n\t\tcase 'dotted': {\n\t\t\treturn getDotted(\n\t\t\t\tsurfaceBackgroundSize,\n\t\t\t\tsurfaceBackgroundSizeDotted\n\t\t\t);\n\t\t}\n\t\tcase 'grid': {\n\t\t\treturn getGrid( surfaceBackgroundSize );\n\t\t}\n\t\tcase 'primary': {\n\t\t\treturn primary;\n\t\t}\n\t\tcase 'secondary': {\n\t\t\treturn secondary;\n\t\t}\n\t\tcase 'tertiary': {\n\t\t\treturn tertiary;\n\t\t}\n\t}\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAG,QAAQ,gBAAgB;;AAEpC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,MAAM,QAAQ,UAAU;AAGzC,OAAO,MAAMC,OAAO,gBAAGH,GAAG,sBACJC,MAAM,CAACG,YAAY,aAC9BF,MAAM,CAACG,IAAI,CAAE,GAAG,CAAE,2BAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,6CAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,u9JAE5B;AAED,OAAO,MAAMC,UAAU,gBAAGT,GAAG,sBACPC,MAAM,CAACS,sBAAsB,SAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,gDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,u9JAClD;AAED,OAAO,SAASG,UAAUA,CAAE;EAC3BC,YAAY;EACZC,UAAU;EACVC,WAAW;EACXC;AAID,CAAC,EAAG;EACH,MAAMC,WAAW,
|
|
1
|
+
{"version":3,"names":["css","CONFIG","COLORS","Surface","surfaceColor","gray","process","env","NODE_ENV","background","surfaceBackgroundColor","getBorders","borderBottom","borderLeft","borderRight","borderTop","borderStyle","surfaceBorderColor","undefined","primary","secondary","surfaceBackgroundTintColor","tertiary","surfaceBackgroundTertiaryColor","customBackgroundSize","surfaceBackgroundSize","join","dottedBackground1","surfaceBackgroundSizeDotted","dottedBackground2","dottedBackgroundCombined","surfaceBorderBoldColor","getDotted","gridBackground1","surfaceBorderSubtleColor","gridBackground2","gridBackgroundCombined","getGrid","getVariant","variant"],"sources":["@wordpress/components/src/surface/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { CONFIG, COLORS } from '../utils';\nimport type { SurfaceVariant, SurfaceProps } from './types';\n\nexport const Surface = css`\n\tbackground-color: ${ CONFIG.surfaceColor };\n\tcolor: ${ COLORS.gray[ 900 ] };\n\tposition: relative;\n`;\n\nexport const background = css`\n\tbackground-color: ${ CONFIG.surfaceBackgroundColor };\n`;\n\nexport function getBorders( {\n\tborderBottom,\n\tborderLeft,\n\tborderRight,\n\tborderTop,\n}: Pick<\n\tSurfaceProps,\n\t'borderBottom' | 'borderLeft' | 'borderRight' | 'borderTop'\n> ) {\n\tconst borderStyle = `1px solid ${ CONFIG.surfaceBorderColor }`;\n\n\treturn css( {\n\t\tborderBottom: borderBottom ? borderStyle : undefined,\n\t\tborderLeft: borderLeft ? borderStyle : undefined,\n\t\tborderRight: borderRight ? borderStyle : undefined,\n\t\tborderTop: borderTop ? borderStyle : undefined,\n\t} );\n}\n\nexport const primary = css``;\n\nexport const secondary = css`\n\tbackground: ${ CONFIG.surfaceBackgroundTintColor };\n`;\n\nexport const tertiary = css`\n\tbackground: ${ CONFIG.surfaceBackgroundTertiaryColor };\n`;\n\nconst customBackgroundSize = ( surfaceBackgroundSize: string ) =>\n\t[ surfaceBackgroundSize, surfaceBackgroundSize ].join( ' ' );\n\nconst dottedBackground1 = ( surfaceBackgroundSizeDotted: string ) =>\n\t[\n\t\t'90deg',\n\t\t[ CONFIG.surfaceBackgroundColor, surfaceBackgroundSizeDotted ].join(\n\t\t\t' '\n\t\t),\n\t\t'transparent 1%',\n\t].join( ',' );\n\nconst dottedBackground2 = ( surfaceBackgroundSizeDotted: string ) =>\n\t[\n\t\t[ CONFIG.surfaceBackgroundColor, surfaceBackgroundSizeDotted ].join(\n\t\t\t' '\n\t\t),\n\t\t'transparent 1%',\n\t].join( ',' );\n\nconst dottedBackgroundCombined = ( surfaceBackgroundSizeDotted: string ) =>\n\t[\n\t\t`linear-gradient( ${ dottedBackground1(\n\t\t\tsurfaceBackgroundSizeDotted\n\t\t) } ) center`,\n\t\t`linear-gradient( ${ dottedBackground2(\n\t\t\tsurfaceBackgroundSizeDotted\n\t\t) } ) center`,\n\t\tCONFIG.surfaceBorderBoldColor,\n\t].join( ',' );\n\nexport const getDotted = (\n\tsurfaceBackgroundSize: string,\n\tsurfaceBackgroundSizeDotted: string\n) => css`\n\tbackground: ${ dottedBackgroundCombined( surfaceBackgroundSizeDotted ) };\n\tbackground-size: ${ customBackgroundSize( surfaceBackgroundSize ) };\n`;\n\nconst gridBackground1 = [\n\t`${ CONFIG.surfaceBorderSubtleColor } 1px`,\n\t'transparent 1px',\n].join( ',' );\n\nconst gridBackground2 = [\n\t'90deg',\n\t`${ CONFIG.surfaceBorderSubtleColor } 1px`,\n\t'transparent 1px',\n].join( ',' );\n\nconst gridBackgroundCombined = [\n\t`linear-gradient( ${ gridBackground1 } )`,\n\t`linear-gradient( ${ gridBackground2 } )`,\n].join( ',' );\n\nexport const getGrid = ( surfaceBackgroundSize: string ) => {\n\treturn css`\n\t\tbackground: ${ CONFIG.surfaceBackgroundColor };\n\t\tbackground-image: ${ gridBackgroundCombined };\n\t\tbackground-size: ${ customBackgroundSize( surfaceBackgroundSize ) };\n\t`;\n};\n\nexport const getVariant = (\n\tvariant: SurfaceVariant,\n\tsurfaceBackgroundSize: string,\n\tsurfaceBackgroundSizeDotted: string\n) => {\n\tswitch ( variant ) {\n\t\tcase 'dotted': {\n\t\t\treturn getDotted(\n\t\t\t\tsurfaceBackgroundSize,\n\t\t\t\tsurfaceBackgroundSizeDotted\n\t\t\t);\n\t\t}\n\t\tcase 'grid': {\n\t\t\treturn getGrid( surfaceBackgroundSize );\n\t\t}\n\t\tcase 'primary': {\n\t\t\treturn primary;\n\t\t}\n\t\tcase 'secondary': {\n\t\t\treturn secondary;\n\t\t}\n\t\tcase 'tertiary': {\n\t\t\treturn tertiary;\n\t\t}\n\t}\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAG,QAAQ,gBAAgB;;AAEpC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,MAAM,QAAQ,UAAU;AAGzC,OAAO,MAAMC,OAAO,gBAAGH,GAAG,sBACJC,MAAM,CAACG,YAAY,aAC9BF,MAAM,CAACG,IAAI,CAAE,GAAG,CAAE,2BAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,6CAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,u9JAE5B;AAED,OAAO,MAAMC,UAAU,gBAAGT,GAAG,sBACPC,MAAM,CAACS,sBAAsB,SAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,gDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,u9JAClD;AAED,OAAO,SAASG,UAAUA,CAAE;EAC3BC,YAAY;EACZC,UAAU;EACVC,WAAW;EACXC;AAID,CAAC,EAAG;EACH,MAAMC,WAAW,GAAG,aAAcf,MAAM,CAACgB,kBAAkB,EAAG;EAE9D,oBAAOjB,GAAG,CAAE;IACXY,YAAY,EAAEA,YAAY,GAAG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ACrBG,2BACD,CAAC;MACF;IACA,KAAK,MAAM;MAAE;QACZ,OAAOS,OAAO,CAAEZ,qBAAsB,CAAC;MACxC;IACA,KAAK,SAAS;MAAE;QACf,OAAON,OAAO;MACf;IACA,KAAK,WAAW;MAAE;QACjB,OAAOC,SAAS;MACjB;IACA,KAAK,UAAU;MAAE;QAChB,OAAOE,QAAQ;MAChB;EACD;AACD,CAAC","ignoreList":[]}
|
|
@@ -15,8 +15,7 @@ import { useInstanceId, usePrevious } from '@wordpress/compose';
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import Button from '../button';
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
// Separate the actual tab name from the instance ID. This is
|
|
21
20
|
// necessary because Ariakit internally uses the element ID when
|
|
22
21
|
// a new tab is selected, but our implementation looks specifically
|