@wordpress/components 19.2.1-next.33ec3857e2.0 → 19.4.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 +54 -1
- package/CONTRIBUTING.md +1 -1
- package/LICENSE.md +1 -1
- package/README.md +8 -4
- package/build/base-control/index.js +2 -3
- package/build/base-control/index.js.map +1 -1
- package/build/base-control/styles/base-control-styles.js +23 -13
- package/build/base-control/styles/base-control-styles.js.map +1 -1
- package/build/base-field/hook.js +1 -1
- package/build/base-field/hook.js.map +1 -1
- package/build/box-control/styles/box-control-styles.js +9 -9
- package/build/box-control/styles/box-control-styles.js.map +1 -1
- package/build/button/deprecated.js +2 -1
- package/build/button/deprecated.js.map +1 -1
- package/build/button/index.js +2 -1
- package/build/button/index.js.map +1 -1
- package/build/card/card/component.js +1 -1
- package/build/card/card/component.js.map +1 -1
- package/build/card/card/hook.js +1 -1
- package/build/card/card/hook.js.map +1 -1
- package/build/card/card-body/hook.js +1 -1
- package/build/card/card-body/hook.js.map +1 -1
- package/build/card/card-divider/hook.js +1 -1
- package/build/card/card-divider/hook.js.map +1 -1
- package/build/card/card-footer/hook.js +1 -1
- package/build/card/card-footer/hook.js.map +1 -1
- package/build/card/card-header/hook.js +1 -1
- package/build/card/card-header/hook.js.map +1 -1
- package/build/card/card-media/hook.js +1 -1
- package/build/card/card-media/hook.js.map +1 -1
- package/build/circular-option-picker/index.js +2 -0
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/color-indicator/index.js +2 -0
- package/build/color-indicator/index.js.map +1 -1
- package/build/color-palette/index.js +4 -7
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +4 -2
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/color-display.js.map +1 -1
- package/build/color-picker/color-input.js.map +1 -1
- package/build/color-picker/component.js +2 -5
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/use-deprecated-props.js +2 -0
- package/build/color-picker/use-deprecated-props.js.map +1 -1
- package/build/confirm-dialog/component.js +10 -6
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/confirm-dialog/styles.js +30 -0
- package/build/confirm-dialog/styles.js.map +1 -0
- package/build/custom-gradient-bar/control-points.js +1 -2
- package/build/custom-gradient-bar/control-points.js.map +1 -1
- package/build/custom-select-control/index.js +10 -2
- package/build/custom-select-control/index.js.map +1 -1
- package/build/date-time/time.js +1 -1
- package/build/date-time/time.js.map +1 -1
- package/build/divider/component.js.map +1 -1
- package/build/dropdown/index.js +3 -3
- package/build/dropdown/index.js.map +1 -1
- package/build/elevation/hook.js +5 -5
- package/build/elevation/hook.js.map +1 -1
- package/build/external-link/styles/external-link-styles.js +5 -5
- package/build/external-link/styles/external-link-styles.js.map +1 -1
- package/build/flex/flex/hook.js +4 -4
- package/build/flex/flex/hook.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +75 -81
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/grid/hook.js +2 -2
- package/build/grid/hook.js.map +1 -1
- package/build/heading/component.js +0 -1
- package/build/heading/component.js.map +1 -1
- package/build/icon/index.js +0 -1
- package/build/icon/index.js.map +1 -1
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js +0 -1
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/reducer/actions.js +0 -1
- package/build/input-control/reducer/actions.js.map +1 -1
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/reducer/state.js +0 -1
- package/build/input-control/reducer/state.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +32 -30
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/item-group/item/component.js +0 -1
- package/build/item-group/item/component.js.map +1 -1
- package/build/item-group/item/hook.js +1 -2
- package/build/item-group/item/hook.js.map +1 -1
- package/build/item-group/item-group/component.js +0 -1
- package/build/item-group/item-group/component.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-context.native.js +3 -1
- package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +4 -12
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +23 -5
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +3 -5
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js +16 -16
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-text-input.native.js +2 -3
- package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js +2 -0
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +5 -0
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/mobile/color-settings/utils.native.js +9 -3
- package/build/mobile/color-settings/utils.native.js.map +1 -1
- package/build/mobile/keyboard-avoiding-view/index.ios.js +6 -8
- package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +3 -1
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-screen.native.js +18 -5
- package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
- package/build/mobile/link-settings/index.native.js +3 -1
- package/build/mobile/link-settings/index.native.js.map +1 -1
- package/build/mobile/readable-content-view/index.native.js +2 -2
- package/build/mobile/readable-content-view/index.native.js.map +1 -1
- package/build/mobile/utils/use-is-floating-keyboard.native.js +2 -2
- package/build/mobile/utils/use-is-floating-keyboard.native.js.map +1 -1
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js +7 -3
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build/modal/index.js +1 -12
- package/build/modal/index.js.map +1 -1
- package/build/navigator/context.js +5 -1
- package/build/navigator/context.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +42 -22
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +57 -29
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/use-navigator.js +8 -8
- package/build/navigator/use-navigator.js.map +1 -1
- package/build/notice/index.native.js +2 -2
- package/build/notice/index.native.js.map +1 -1
- package/build/palette-edit/index.js +39 -30
- package/build/palette-edit/index.js.map +1 -1
- package/build/palette-edit/styles.js +11 -13
- package/build/palette-edit/styles.js.map +1 -1
- package/build/placeholder/index.js +4 -4
- package/build/placeholder/index.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +29 -29
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/resizable-box/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/label.js +0 -1
- package/build/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build/sandbox/index.native.js +5 -5
- package/build/sandbox/index.native.js.map +1 -1
- package/build/scrollable/hook.js +1 -1
- package/build/scrollable/hook.js.map +1 -1
- package/build/select-control/index.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +11 -2
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/spacer/component.js +0 -1
- package/build/spacer/component.js.map +1 -1
- package/build/spinner/index.js +44 -5
- package/build/spinner/index.js.map +1 -1
- package/build/spinner/index.native.js +4 -2
- package/build/spinner/index.native.js.map +1 -1
- package/build/spinner/styles.js +56 -0
- package/build/spinner/styles.js.map +1 -0
- package/build/surface/hook.js +1 -1
- package/build/surface/hook.js.map +1 -1
- package/build/text/get-line-height.js +0 -1
- package/build/text/get-line-height.js.map +1 -1
- package/build/text/hook.js +5 -5
- package/build/text/hook.js.map +1 -1
- package/build/tip/index.js +4 -8
- package/build/tip/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +2 -12
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +3 -14
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/component.js +0 -1
- package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/styles.js +8 -8
- package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
- package/build/tools-panel/styles.js +10 -10
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +0 -1
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +51 -44
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +0 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/hook.js +3 -3
- package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-item/component.js +0 -1
- package/build/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +17 -9
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tree-grid/index.js +19 -10
- package/build/tree-grid/index.js.map +1 -1
- package/build/truncate/hook.js +2 -2
- package/build/truncate/hook.js.map +1 -1
- package/build/ui/shortcut/component.js +0 -1
- package/build/ui/shortcut/component.js.map +1 -1
- package/build/ui/utils/font-size.js +0 -1
- package/build/ui/utils/font-size.js.map +1 -1
- package/build/ui/utils/get-valid-children.js +0 -1
- package/build/ui/utils/get-valid-children.js.map +1 -1
- package/build/unit-control/index.js +0 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/unit-select-control.js.map +1 -1
- package/build/utils/colors-values.js +6 -3
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/config-values.js +1 -4
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/hooks/use-combined-ref.js.map +1 -1
- package/build/utils/hooks/use-latest-ref.js +0 -1
- package/build/utils/hooks/use-latest-ref.js.map +1 -1
- package/build/z-stack/component.js +0 -1
- package/build/z-stack/component.js.map +1 -1
- package/build-module/base-control/index.js +3 -4
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/base-control/styles/base-control-styles.js +20 -12
- package/build-module/base-control/styles/base-control-styles.js.map +1 -1
- package/build-module/base-field/hook.js +1 -1
- package/build-module/base-field/hook.js.map +1 -1
- package/build-module/box-control/styles/box-control-styles.js +9 -9
- package/build-module/box-control/styles/box-control-styles.js.map +1 -1
- package/build-module/button/deprecated.js +2 -1
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/index.js +2 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/card/card/component.js +1 -1
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/card/hook.js +1 -1
- package/build-module/card/card/hook.js.map +1 -1
- package/build-module/card/card-body/hook.js +1 -1
- package/build-module/card/card-body/hook.js.map +1 -1
- package/build-module/card/card-divider/hook.js +1 -1
- package/build-module/card/card-divider/hook.js.map +1 -1
- package/build-module/card/card-footer/hook.js +1 -1
- package/build-module/card/card-footer/hook.js.map +1 -1
- package/build-module/card/card-header/hook.js +1 -1
- package/build-module/card/card-header/hook.js.map +1 -1
- package/build-module/card/card-media/hook.js +1 -1
- package/build-module/card/card-media/hook.js.map +1 -1
- package/build-module/circular-option-picker/index.js +1 -0
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/color-indicator/index.js +1 -0
- package/build-module/color-indicator/index.js.map +1 -1
- package/build-module/color-palette/index.js +4 -8
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +4 -2
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/color-display.js.map +1 -1
- package/build-module/color-picker/color-input.js.map +1 -1
- package/build-module/color-picker/component.js +2 -4
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/use-deprecated-props.js +3 -2
- package/build-module/color-picker/use-deprecated-props.js.map +1 -1
- package/build-module/confirm-dialog/component.js +6 -3
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/confirm-dialog/styles.js +25 -0
- package/build-module/confirm-dialog/styles.js.map +1 -0
- package/build-module/custom-gradient-bar/control-points.js +2 -3
- package/build-module/custom-gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-select-control/index.js +11 -2
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/date-time/time.js +1 -1
- package/build-module/date-time/time.js.map +1 -1
- package/build-module/divider/component.js +1 -1
- package/build-module/divider/component.js.map +1 -1
- package/build-module/dropdown/index.js +3 -3
- package/build-module/dropdown/index.js.map +1 -1
- package/build-module/elevation/hook.js +5 -5
- package/build-module/elevation/hook.js.map +1 -1
- package/build-module/external-link/styles/external-link-styles.js +5 -5
- package/build-module/external-link/styles/external-link-styles.js.map +1 -1
- package/build-module/flex/flex/hook.js +4 -4
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +73 -79
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/grid/hook.js +2 -2
- package/build-module/grid/hook.js.map +1 -1
- package/build-module/heading/component.js +0 -1
- package/build-module/heading/component.js.map +1 -1
- package/build-module/icon/index.js +0 -1
- package/build-module/icon/index.js.map +1 -1
- package/build-module/input-control/index.js +1 -1
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +0 -1
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/input-field.js +1 -1
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/reducer/actions.js +0 -1
- package/build-module/input-control/reducer/actions.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +1 -1
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/reducer/state.js +0 -1
- package/build-module/input-control/reducer/state.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +32 -30
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/item-group/item/component.js +0 -1
- package/build-module/item-group/item/component.js.map +1 -1
- package/build-module/item-group/item/hook.js +1 -2
- package/build-module/item-group/item/hook.js.map +1 -1
- package/build-module/item-group/item-group/component.js +0 -1
- package/build-module/item-group/item-group/component.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js +3 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +5 -13
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +23 -5
- 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 +3 -3
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js +16 -13
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-text-input.native.js +2 -2
- package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +2 -0
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +5 -0
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/color-settings/utils.native.js +7 -3
- package/build-module/mobile/color-settings/utils.native.js.map +1 -1
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js +6 -6
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +2 -1
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-screen.native.js +13 -5
- package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +2 -1
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/mobile/readable-content-view/index.native.js +2 -2
- package/build-module/mobile/readable-content-view/index.native.js.map +1 -1
- package/build-module/mobile/utils/use-is-floating-keyboard.native.js +2 -2
- package/build-module/mobile/utils/use-is-floating-keyboard.native.js.map +1 -1
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +7 -3
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build-module/modal/index.js +1 -11
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigator/context.js +5 -1
- package/build-module/navigator/context.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +43 -24
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +57 -32
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/use-navigator.js +8 -8
- package/build-module/navigator/use-navigator.js.map +1 -1
- package/build-module/notice/index.native.js +2 -2
- package/build-module/notice/index.native.js.map +1 -1
- package/build-module/palette-edit/index.js +38 -30
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/palette-edit/styles.js +11 -12
- package/build-module/palette-edit/styles.js.map +1 -1
- package/build-module/placeholder/index.js +4 -4
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +29 -29
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/resizable-box/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +3 -3
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/label.js +0 -1
- package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build-module/sandbox/index.native.js +5 -5
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/scrollable/hook.js +1 -1
- package/build-module/scrollable/hook.js.map +1 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +11 -2
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/spacer/component.js +0 -1
- package/build-module/spacer/component.js.map +1 -1
- package/build-module/spinner/index.js +40 -5
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/spinner/index.native.js +4 -2
- package/build-module/spinner/index.native.js.map +1 -1
- package/build-module/spinner/styles.js +49 -0
- package/build-module/spinner/styles.js.map +1 -0
- package/build-module/surface/hook.js +1 -1
- package/build-module/surface/hook.js.map +1 -1
- package/build-module/text/get-line-height.js +0 -1
- package/build-module/text/get-line-height.js.map +1 -1
- package/build-module/text/hook.js +5 -5
- package/build-module/text/hook.js.map +1 -1
- package/build-module/tip/index.js +4 -8
- package/build-module/tip/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +2 -10
- 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 +3 -11
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/component.js +0 -1
- package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/styles.js +8 -8
- package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
- package/build-module/tools-panel/styles.js +10 -10
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +0 -1
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +52 -45
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +0 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/hook.js +3 -3
- package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/component.js +0 -1
- package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +17 -9
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tree-grid/index.js +18 -10
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/truncate/hook.js +2 -2
- package/build-module/truncate/hook.js.map +1 -1
- package/build-module/ui/shortcut/component.js +0 -1
- package/build-module/ui/shortcut/component.js.map +1 -1
- package/build-module/ui/utils/font-size.js +0 -1
- package/build-module/ui/utils/font-size.js.map +1 -1
- package/build-module/ui/utils/get-valid-children.js +0 -1
- package/build-module/ui/utils/get-valid-children.js.map +1 -1
- package/build-module/unit-control/index.js +0 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/unit-select-control.js +1 -2
- package/build-module/unit-control/unit-select-control.js.map +1 -1
- package/build-module/utils/colors-values.js +6 -3
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/config-values.js +1 -4
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/hooks/use-combined-ref.js +0 -1
- package/build-module/utils/hooks/use-combined-ref.js.map +1 -1
- package/build-module/utils/hooks/use-latest-ref.js +0 -1
- package/build-module/utils/hooks/use-latest-ref.js.map +1 -1
- package/build-module/z-stack/component.js +0 -1
- package/build-module/z-stack/component.js.map +1 -1
- package/build-style/style-rtl.css +22 -6
- package/build-style/style.css +22 -6
- package/build-types/base-control/index.d.ts.map +1 -1
- package/build-types/base-control/styles/base-control-styles.d.ts +4 -0
- package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/card/types.d.ts.map +1 -1
- package/build-types/circular-option-picker/index.d.ts +31 -0
- package/build-types/circular-option-picker/index.d.ts.map +1 -0
- package/build-types/color-palette/index.d.ts +16 -0
- package/build-types/color-palette/index.d.ts.map +1 -0
- package/build-types/color-palette/styles.d.ts +8 -0
- package/build-types/color-palette/styles.d.ts.map +1 -0
- package/build-types/color-picker/color-display.d.ts +14 -0
- package/build-types/color-picker/color-display.d.ts.map +1 -0
- package/build-types/color-picker/color-input.d.ts +14 -0
- package/build-types/color-picker/color-input.d.ts.map +1 -0
- package/build-types/color-picker/component.d.ts +11 -0
- package/build-types/color-picker/component.d.ts.map +1 -0
- package/build-types/color-picker/hex-input.d.ts +13 -0
- package/build-types/color-picker/hex-input.d.ts.map +1 -0
- package/build-types/color-picker/hsl-input.d.ts +13 -0
- package/build-types/color-picker/hsl-input.d.ts.map +1 -0
- package/build-types/color-picker/index.d.ts +5 -0
- package/build-types/color-picker/index.d.ts.map +1 -0
- package/build-types/color-picker/input-with-slider.d.ts +12 -0
- package/build-types/color-picker/input-with-slider.d.ts.map +1 -0
- package/build-types/color-picker/legacy-adapter.d.ts +6 -0
- package/build-types/color-picker/legacy-adapter.d.ts.map +1 -0
- package/build-types/color-picker/picker.d.ts +10 -0
- package/build-types/color-picker/picker.d.ts.map +1 -0
- package/build-types/color-picker/rgb-input.d.ts +13 -0
- package/build-types/color-picker/rgb-input.d.ts.map +1 -0
- package/build-types/color-picker/styles.d.ts +76 -0
- package/build-types/color-picker/styles.d.ts.map +1 -0
- package/build-types/color-picker/types.d.ts +2 -0
- package/build-types/color-picker/types.d.ts.map +1 -0
- package/build-types/color-picker/use-deprecated-props.d.ts +49 -0
- package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -0
- package/build-types/confirm-dialog/component.d.ts +11 -14
- package/build-types/confirm-dialog/component.d.ts.map +1 -1
- package/build-types/confirm-dialog/styles.d.ts +10 -0
- package/build-types/confirm-dialog/styles.d.ts.map +1 -0
- package/build-types/confirm-dialog/types.d.ts.map +1 -1
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/dropdown/index.d.ts +1 -13
- package/build-types/dropdown/index.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/elevation/types.d.ts.map +1 -1
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/types.d.ts.map +1 -1
- package/build-types/flyout/types.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts.map +1 -1
- package/build-types/grid/types.d.ts.map +1 -1
- package/build-types/h-stack/hook.d.ts +1 -1
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/h-stack/types.d.ts.map +1 -1
- package/build-types/heading/component.d.ts.map +1 -1
- package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/reducer/actions.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/reducer/state.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/component.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/component.d.ts.map +1 -1
- package/build-types/navigator/context.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts +16 -17
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +16 -16
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/types.d.ts +10 -9
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/resizable-box/index.d.ts +1 -1
- package/build-types/resizable-box/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +3 -2
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
- package/build-types/spacer/component.d.ts.map +1 -1
- package/build-types/spacer/types.d.ts.map +1 -1
- package/build-types/spinner/index.d.ts +18 -1
- package/build-types/spinner/index.d.ts.map +1 -1
- package/build-types/spinner/styles.d.ts +13 -0
- package/build-types/spinner/styles.d.ts.map +1 -0
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/text/get-line-height.d.ts.map +1 -1
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/text/types.d.ts.map +1 -1
- package/build-types/tip/index.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 +0 -5
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +1 -7
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/tools-panel/styles.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +8 -4
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +14 -0
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/ui/control-group/types.d.ts.map +1 -1
- package/build-types/ui/form-group/types.d.ts.map +1 -1
- package/build-types/ui/shortcut/component.d.ts.map +1 -1
- package/build-types/ui/tooltip/types.d.ts.map +1 -1
- package/build-types/ui/utils/font-size.d.ts.map +1 -1
- package/build-types/ui/utils/get-valid-children.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +3 -2
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +2 -1
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/unit-control/unit-select-control.d.ts.map +1 -1
- package/build-types/utils/colors-values.d.ts +1 -0
- package/build-types/utils/colors-values.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +1 -5
- package/build-types/utils/config-values.d.ts.map +1 -1
- package/build-types/utils/hooks/use-combined-ref.d.ts.map +1 -1
- package/build-types/utils/hooks/use-latest-ref.d.ts.map +1 -1
- package/build-types/v-stack/types.d.ts.map +1 -1
- package/build-types/z-stack/component.d.ts.map +1 -1
- package/package.json +20 -17
- package/src/base-control/index.js +11 -2
- package/src/base-control/styles/base-control-styles.js +10 -1
- package/src/base-field/hook.js +1 -1
- package/src/box-control/styles/box-control-styles.js +1 -1
- package/src/button/deprecated.js +1 -0
- package/src/button/index.js +1 -0
- package/src/card/card/component.js +1 -1
- package/src/card/card/hook.js +1 -1
- package/src/card/card-body/hook.js +1 -1
- package/src/card/card-divider/hook.js +1 -1
- package/src/card/card-footer/hook.js +1 -1
- package/src/card/card-header/hook.js +1 -1
- package/src/card/card-media/hook.js +1 -1
- package/src/card/types.ts +0 -1
- package/src/circular-option-picker/index.js +1 -0
- package/src/color-indicator/README.md +28 -0
- package/src/color-indicator/index.js +2 -0
- package/src/color-indicator/style.scss +1 -1
- package/src/color-palette/index.js +7 -8
- package/src/color-palette/index.native.js +2 -0
- package/src/color-palette/style.scss +11 -3
- package/src/color-palette/test/__snapshots__/index.js.snap +0 -1
- package/src/color-picker/README.md +1 -1
- package/src/color-picker/color-display.tsx +1 -1
- package/src/color-picker/color-input.tsx +1 -1
- package/src/color-picker/component.tsx +3 -4
- package/src/color-picker/use-deprecated-props.ts +2 -1
- package/src/combobox-control/stories/index.js +6 -2
- package/src/combobox-control/style.scss +2 -2
- package/src/confirm-dialog/component.tsx +7 -4
- package/src/confirm-dialog/stories/index.js +5 -2
- package/src/confirm-dialog/styles.ts +18 -0
- package/src/confirm-dialog/types.ts +0 -1
- package/src/custom-gradient-bar/control-points.js +2 -3
- package/src/custom-gradient-picker/style.scss +0 -1
- package/src/custom-select-control/index.js +13 -1
- package/src/custom-select-control/stories/index.js +27 -0
- package/src/custom-select-control/test/index.js +46 -0
- package/src/date-time/README.md +4 -4
- package/src/date-time/test/time.js +2 -2
- package/src/date-time/time.js +2 -2
- package/src/dimension-control/README.md +2 -0
- package/src/divider/component.tsx +0 -1
- package/src/dropdown/index.js +14 -13
- package/src/elevation/hook.js +1 -0
- package/src/elevation/types.ts +0 -1
- package/src/external-link/styles/external-link-styles.js +3 -3
- package/src/flex/flex/hook.js +1 -0
- package/src/flex/types.ts +0 -1
- package/src/flyout/types.ts +0 -1
- package/src/form-token-field/style.scss +1 -1
- package/src/form-token-field/suggestions-list.js +109 -120
- package/src/form-token-field/test/index.js +4 -2
- package/src/gradient-picker/README.md +94 -0
- package/src/grid/hook.js +1 -0
- package/src/grid/types.ts +0 -1
- package/src/h-stack/types.ts +0 -1
- package/src/heading/component.tsx +0 -1
- package/src/icon/index.tsx +0 -1
- package/src/input-control/index.tsx +0 -1
- package/src/input-control/input-base.tsx +0 -1
- package/src/input-control/input-field.tsx +0 -1
- package/src/input-control/reducer/actions.ts +0 -1
- package/src/input-control/reducer/reducer.ts +0 -1
- package/src/input-control/reducer/state.ts +0 -1
- package/src/input-control/styles/input-control-styles.tsx +7 -7
- package/src/input-control/types.ts +0 -1
- package/src/item-group/item/component.tsx +0 -1
- package/src/item-group/item/hook.ts +1 -2
- package/src/item-group/item-group/component.tsx +0 -1
- package/src/item-group/stories/index.js +2 -2
- package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +2 -0
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +8 -14
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +33 -3
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +162 -0
- package/src/mobile/bottom-sheet/cell.native.js +8 -6
- package/src/mobile/bottom-sheet/index.native.js +24 -14
- package/src/mobile/bottom-sheet/link-suggestion-styles.native.scss +3 -0
- package/src/mobile/bottom-sheet/range-text-input.native.js +5 -2
- package/src/mobile/bottom-sheet/styles.native.scss +4 -0
- package/src/mobile/bottom-sheet/test/index.native.js +24 -0
- package/src/mobile/color-settings/index.native.js +2 -0
- package/src/mobile/color-settings/palette.screen.native.js +5 -0
- package/src/mobile/color-settings/utils.native.js +8 -3
- package/src/mobile/html-text-input/test/index.native.js +34 -35
- package/src/mobile/keyboard-avoiding-view/index.ios.js +12 -9
- package/src/mobile/link-picker/index.native.js +2 -1
- package/src/mobile/link-picker/link-picker-screen.native.js +13 -5
- package/src/mobile/link-settings/index.native.js +2 -1
- package/src/mobile/link-settings/test/edit.native.js +172 -236
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +97 -0
- package/src/mobile/readable-content-view/index.native.js +5 -2
- package/src/mobile/utils/use-is-floating-keyboard.native.js +2 -5
- package/src/mobile/utils/use-unit-converter-to-mobile.native.js +11 -3
- package/src/modal/index.js +1 -10
- package/src/navigator/context.ts +5 -1
- package/src/navigator/navigator-provider/README.md +30 -20
- package/src/navigator/navigator-provider/component.tsx +69 -25
- package/src/navigator/navigator-screen/component.tsx +71 -34
- package/src/navigator/stories/index.js +26 -13
- package/src/navigator/test/index.js +167 -32
- package/src/navigator/types.ts +11 -11
- package/src/navigator/use-navigator.ts +4 -4
- package/src/notice/index.native.js +5 -2
- package/src/palette-edit/index.js +115 -75
- package/src/palette-edit/styles.js +22 -3
- package/src/placeholder/index.js +8 -6
- package/src/placeholder/style.scss +12 -0
- package/src/placeholder/test/index.js +18 -1
- package/src/range-control/styles/range-control-styles.js +1 -1
- package/src/resizable-box/index.tsx +0 -1
- package/src/resizable-box/resize-tooltip/index.tsx +1 -2
- package/src/resizable-box/resize-tooltip/label.tsx +0 -1
- package/src/sandbox/index.native.js +8 -5
- package/src/scrollable/hook.js +1 -1
- package/src/scrollable/stories/index.js +6 -3
- package/src/select-control/README.md +2 -2
- package/src/select-control/index.tsx +3 -2
- package/src/select-control/stories/index.js +1 -1
- package/src/slot-fill/bubbles-virtually/fill.js +12 -1
- package/src/spacer/component.tsx +0 -1
- package/src/spacer/types.ts +0 -1
- package/src/spinner/README.md +10 -10
- package/src/spinner/index.js +42 -3
- package/src/spinner/index.native.js +7 -2
- package/src/spinner/stories/index.js +36 -3
- package/src/spinner/styles.js +47 -0
- package/src/surface/hook.js +1 -0
- package/src/text/get-line-height.ts +0 -1
- package/src/text/hook.js +1 -0
- package/src/text/types.ts +0 -1
- package/src/tip/index.js +2 -4
- package/src/toggle-group-control/test/__snapshots__/index.js.snap +25 -27
- package/src/toggle-group-control/toggle-group-control/component.tsx +1 -12
- package/src/toggle-group-control/toggle-group-control/styles.ts +0 -14
- package/src/toggle-group-control/toggle-group-control-option/component.tsx +0 -1
- package/src/toggle-group-control/toggle-group-control-option/styles.ts +1 -3
- package/src/toggle-group-control/types.ts +1 -9
- package/src/tools-panel/stories/index.js +21 -1
- package/src/tools-panel/stories/tools-panel-with-item-group-slot.js +244 -0
- package/src/tools-panel/styles.ts +1 -3
- package/src/tools-panel/test/__snapshots__/index.js.snap +219 -0
- package/src/tools-panel/test/index.js +218 -20
- package/src/tools-panel/tools-panel/README.md +3 -2
- package/src/tools-panel/tools-panel/component.tsx +0 -1
- package/src/tools-panel/tools-panel/hook.ts +164 -97
- package/src/tools-panel/tools-panel-header/component.tsx +0 -1
- package/src/tools-panel/tools-panel-header/hook.ts +3 -3
- package/src/tools-panel/tools-panel-item/component.tsx +0 -1
- package/src/tools-panel/tools-panel-item/hook.ts +39 -8
- package/src/tools-panel/types.ts +14 -1
- package/src/tooltip/test/index.native.js +3 -1
- package/src/tree-grid/index.js +157 -126
- package/src/truncate/hook.js +1 -1
- package/src/ui/README.md +1 -1
- package/src/ui/context/wordpress-component.ts +0 -1
- package/src/ui/control-group/types.ts +0 -1
- package/src/ui/form-group/types.ts +0 -1
- package/src/ui/shortcut/component.tsx +0 -1
- package/src/ui/tooltip/types.ts +0 -1
- package/src/ui/utils/font-size.ts +0 -1
- package/src/ui/utils/get-valid-children.ts +0 -1
- package/src/unit-control/index.tsx +0 -1
- package/src/unit-control/types.ts +2 -2
- package/src/unit-control/unit-select-control.tsx +0 -1
- package/src/utils/colors-values.js +4 -3
- package/src/utils/config-values.js +1 -5
- package/src/utils/hooks/stories/use-cx.js +121 -44
- package/src/utils/hooks/use-combined-ref.ts +0 -1
- package/src/utils/hooks/use-latest-ref.ts +0 -1
- package/src/v-stack/types.ts +0 -1
- package/src/z-stack/component.tsx +0 -1
- package/tsconfig.json +3 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/spinner/styles/spinner-styles.js +0 -40
- package/build/spinner/styles/spinner-styles.js.map +0 -1
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +0 -90
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +0 -1
- package/build-module/spinner/styles/spinner-styles.js +0 -28
- package/build-module/spinner/styles/spinner-styles.js.map +0 -1
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +0 -86
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +0 -1
- package/build-types/spinner/styles/spinner-styles.d.ts +0 -5
- package/build-types/spinner/styles/spinner-styles.d.ts.map +0 -1
- package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts +0 -9
- package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +0 -1
- package/src/spinner/styles/spinner-styles.js +0 -47
- package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +0 -86
- package/src/ui/visually-hidden/README.md +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/index.js"],"names":["getRowFocusables","rowElement","focusablesInRow","focus","focusable","find","sequential","length","filter","closest","TreeGrid","ref","children","onExpandRow","onCollapseRow","props","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","shiftKey","hasModifierKeyPressed","UP","DOWN","LEFT","RIGHT","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","nextIndex","Math","max","min","ariaExpanded","preventDefault","level","parseInt","ariaLevel","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","focusableItems","nextRowIndex","focusablesInNextRow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AAKA;;AAsMA;;AACA;;AACA;;AAvNA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAT,CAA2BC,UAA3B,EAAwC;AACvC,QAAMC,eAAe,GAAGC,WAAMC,SAAN,CAAgBC,IAAhB,CAAsBJ,UAAtB,EAAkC;AACzDK,IAAAA,UAAU,EAAE;AAD6C,GAAlC,CAAxB;;AAIA,MAAK,CAAEJ,eAAF,IAAqB,CAAEA,eAAe,CAACK,MAA5C,EAAqD;AACpD;AACA;;AAED,SAAOL,eAAe,CAACM,MAAhB,CAA0BJ,SAAF,IAAiB;AAC/C,WAAOA,SAAS,CAACK,OAAV,CAAmB,cAAnB,MAAwCR,UAA/C;AACA,GAFM,CAAP;AAGA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASS,QAAT,OAECC,GAFD,EAGE;AAAA,MAFD;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,WAAW,GAAG,MAAM,CAAE,CAAlC;AAAoCC,IAAAA,aAAa,GAAG,MAAM,CAAE,CAA5D;AAA8D,OAAGC;AAAjE,GAEC;AACD,QAAMC,SAAS,GAAG,0BAAeC,KAAF,IAAa;AAC3C,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA,OAAX;AAAoBC,MAAAA,OAApB;AAA6BC,MAAAA,MAA7B;AAAqCC,MAAAA;AAArC,QAAkDL,KAAxD;AAEA,UAAMM,qBAAqB,GAAGJ,OAAO,I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,IAAI,CAACE,GAAL,CACjBL,kBADiB,EAEjBoB,mBAAmB,CAAChD,MAApB,GAA6B,CAFZ,CAAlB;AAIAgD,MAAAA,mBAAmB,CAAElB,SAAF,CAAnB,CAAiClC,KAAjC,GA1C+C,CA4C/C;AACA;;AACAc,MAAAA,KAAK,CAACyB,cAAN;AACA;AACD,GA5IiB,EA4If,EA5Ie,CAAlB;AA8IA;;AACA;;AACA,SACC,4BAAC,uBAAD,QACC,gEACM3B,KADN;AAEC,IAAA,IAAI,EAAC,UAFN;AAGC,IAAA,SAAS,EAAGC,SAHb;AAIC,IAAA,GAAG,EAAGL;AAJP,MAMC,2CAASC,QAAT,CAND,CADD,CADD;AAYA;AACA;;eAEc,yBAAYF,QAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport { includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param {Element} rowElement The DOM element representing the row.\n *\n * @return {?Array} The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\tif ( ! focusablesInRow || ! focusablesInRow.length ) {\n\t\treturn;\n\t}\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md\n * @param {Object} props Component props.\n * @param {WPElement} props.children Children to be rendered.\n * @param {Function} props.onExpandRow Callback to fire when row is expanded.\n * @param {Function} props.onCollapseRow Callback to fire when row is collapsed.\n * @param {Object} ref A ref to the underlying DOM table element.\n */\nfunction TreeGrid(\n\t{ children, onExpandRow = () => {}, onCollapseRow = () => {}, ...props },\n\tref\n) {\n\tconst onKeyDown = useCallback( ( event ) => {\n\t\tconst { keyCode, metaKey, ctrlKey, altKey, shiftKey } = event;\n\n\t\tconst hasModifierKeyPressed = metaKey || ctrlKey || altKey || shiftKey;\n\n\t\tif (\n\t\t\thasModifierKeyPressed ||\n\t\t\t! includes( [ UP, DOWN, LEFT, RIGHT ], keyCode )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// The event will be handled, stop propagation.\n\t\tevent.stopPropagation();\n\n\t\tconst { activeElement } = document;\n\t\tconst { currentTarget: treeGridElement } = event;\n\t\tif ( ! treeGridElement.contains( activeElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Calculate the columnIndex of the active element.\n\t\tconst activeRow = activeElement.closest( '[role=\"row\"]' );\n\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\tconst currentColumnIndex = focusablesInRow.indexOf( activeElement );\n\n\t\tif ( includes( [ LEFT, RIGHT ], keyCode ) ) {\n\t\t\t// Calculate to the next element.\n\t\t\tlet nextIndex;\n\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t} else {\n\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Focus is either at the left or right edge of the grid.\n\t\t\tif ( nextIndex === currentColumnIndex ) {\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t// Left:\n\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\tif ( activeRow?.ariaExpanded === 'true' ) {\n\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\tparseInt( activeRow?.ariaLevel ?? 1, 10 ) - 1,\n\t\t\t\t\t\t1\n\t\t\t\t\t);\n\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t\t);\n\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\tif ( parseInt( rows[ i ].ariaLevel, 10 ) === level ) {\n\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t} else {\n\t\t\t\t\t// Right:\n\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\tif ( activeRow?.ariaExpanded === 'false' ) {\n\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// If a row is focused, and it is expanded, focuses the rightmost cell in the row.\n\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\tfocusableItems[ focusableItems.length - 1 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t// keys.\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Focus the next element.\n\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t// doesn't try to handle key navigation.\n\t\t\tevent.preventDefault();\n\t\t} else if ( includes( [ UP, DOWN ], keyCode ) ) {\n\t\t\t// Calculate the rowIndex of the next row.\n\t\t\tconst rows = Array.from(\n\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t);\n\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\tlet nextRowIndex;\n\n\t\t\tif ( keyCode === UP ) {\n\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t} else {\n\t\t\t\tnextRowIndex = Math.min( currentRowIndex + 1, rows.length - 1 );\n\t\t\t}\n\n\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t// bounds of a table.\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get the focusables in the next row.\n\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\trows[ nextRowIndex ]\n\t\t\t);\n\n\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\tconst nextIndex = Math.min(\n\t\t\t\tcurrentColumnIndex,\n\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t);\n\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t// doesn't try to handle key navigation.\n\t\t\tevent.preventDefault();\n\t\t}\n\t}, [] );\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t<table\n\t\t\t\t{ ...props }\n\t\t\t\trole=\"treegrid\"\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t</table>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\nexport default forwardRef( TreeGrid );\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/index.js"],"names":["getRowFocusables","rowElement","focusablesInRow","focus","focusable","find","sequential","length","filter","closest","TreeGrid","ref","children","onExpandRow","onCollapseRow","props","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","shiftKey","hasModifierKeyPressed","UP","DOWN","LEFT","RIGHT","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","focusableItems","nextRowIndex","focusablesInNextRow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AAKA;;AAqOA;;AACA;;AACA;;AAtPA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAT,CAA2BC,UAA3B,EAAwC;AACvC,QAAMC,eAAe,GAAGC,WAAMC,SAAN,CAAgBC,IAAhB,CAAsBJ,UAAtB,EAAkC;AACzDK,IAAAA,UAAU,EAAE;AAD6C,GAAlC,CAAxB;;AAIA,MAAK,CAAEJ,eAAF,IAAqB,CAAEA,eAAe,CAACK,MA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AACA;;eAEc,yBAAYF,QAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport { includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param {Element} rowElement The DOM element representing the row.\n *\n * @return {?Array} The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\tif ( ! focusablesInRow || ! focusablesInRow.length ) {\n\t\treturn;\n\t}\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md\n * @param {Object} props Component props.\n * @param {WPElement} props.children Children to be rendered.\n * @param {Function} props.onExpandRow Callback to fire when row is expanded.\n * @param {Function} props.onCollapseRow Callback to fire when row is collapsed.\n * @param {Object} ref A ref to the underlying DOM table element.\n */\nfunction TreeGrid(\n\t{ children, onExpandRow = () => {}, onCollapseRow = () => {}, ...props },\n\tref\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey, shiftKey } = event;\n\n\t\t\tconst hasModifierKeyPressed =\n\t\t\t\tmetaKey || ctrlKey || altKey || shiftKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! includes( [ UP, DOWN, LEFT, RIGHT ], keyCode )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\t\t\tif ( ! treeGridElement.contains( activeElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow = activeElement.closest( '[role=\"row\"]' );\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf( activeElement );\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( includes( [ LEFT, RIGHT ], keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? 1,\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' ),\n\t\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t\t) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the rightmost cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[\n\t\t\t\t\t\t\t\tfocusableItems.length - 1\n\t\t\t\t\t\t\t]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( includes( [ UP, DOWN ], keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t<table\n\t\t\t\t{ ...props }\n\t\t\t\trole=\"treegrid\"\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t</table>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\nexport default forwardRef( TreeGrid );\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
|
package/build/truncate/hook.js
CHANGED
|
@@ -58,9 +58,9 @@ function useTruncate(props) {
|
|
|
58
58
|
const shouldTruncate = ellipsizeMode === _utils.TRUNCATE_TYPE.auto;
|
|
59
59
|
const classes = (0, _element.useMemo)(() => {
|
|
60
60
|
const sx = {};
|
|
61
|
-
sx.numberOfLines = /*#__PURE__*/(0, _react.css)("-webkit-box-orient:vertical;-webkit-line-clamp:", numberOfLines, ";display:-webkit-box;overflow:hidden;" + (process.env.NODE_ENV === "production" ? "" : ";label:sx-numberOfLines;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdHJ1bmNhdGUvaG9vay5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpRHdCIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdHJ1bmNhdGUvaG9vay5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLyoqXG4gKiBXb3JkUHJlc3MgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IHVzZU1lbW8gfSBmcm9tICdAd29yZHByZXNzL2VsZW1lbnQnO1xuXG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyB1c2VDb250ZXh0U3lzdGVtIH0gZnJvbSAnLi4vdWkvY29udGV4dCc7XG5pbXBvcnQgKiBhcyBzdHlsZXMgZnJvbSAnLi9zdHlsZXMnO1xuaW1wb3J0IHsgVFJVTkNBVEVfRUxMSVBTSVMsIFRSVU5DQVRFX1RZUEUsIHRydW5jYXRlQ29udGVudCB9IGZyb20gJy4vdXRpbHMnO1xuaW1wb3J0IHsgdXNlQ3ggfSBmcm9tICcuLi91dGlscy9ob29rcy91c2UtY3gnO1xuXG4vKipcbiAqIEBwYXJhbSB7aW1wb3J0KCcuLi91aS9jb250ZXh0JykuV29yZFByZXNzQ29tcG9uZW50UHJvcHM8aW1wb3J0KCcuL3R5cGVzJykuUHJvcHMsICdzcGFuJz59IHByb3BzXG4gKi9cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHVzZVRydW5jYXRlKCBwcm9wcyApIHtcblx0Y29uc3Qge1xuXHRcdGNsYXNzTmFtZSxcblx0XHRjaGlsZHJlbixcblx0XHRlbGxpcHNpcyA9IFRSVU5DQVRFX0VMTElQU0lTLFxuXHRcdGVsbGlwc2l6ZU1vZGUgPSBUUlVOQ0FURV9UWVBFLmF1dG8sXG5cdFx0bGltaXQgPSAwLFxuXHRcdG51bWJlck9mTGluZXMgPSAwLFxuXHRcdC4uLm90aGVyUHJvcHNcblx0fSA9IHVzZUNvbnRleHRTeXN0ZW0oIHByb3BzLCAnVHJ1bmNhdGUnICk7XG5cblx0Y29uc3QgY3ggPSB1c2VDeCgpO1xuXG5cdGNvbnN0IHRydW5jYXRlZENvbnRlbnQgPSB0cnVuY2F0ZUNvbnRlbnQoXG5cdFx0dHlwZW9mIGNoaWxkcmVuID09PSAnc3RyaW5nJyA/
|
|
61
|
+
sx.numberOfLines = /*#__PURE__*/(0, _react.css)("-webkit-box-orient:vertical;-webkit-line-clamp:", numberOfLines, ";display:-webkit-box;overflow:hidden;" + (process.env.NODE_ENV === "production" ? "" : ";label:sx-numberOfLines;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdHJ1bmNhdGUvaG9vay5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpRHdCIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdHJ1bmNhdGUvaG9vay5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLyoqXG4gKiBXb3JkUHJlc3MgZGVwZW5kZW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AdHlwZSB7c3RyaW5nfSAqLyAoIGNoaWxkcmVuICkgOiAnJyxcblx0XHR7XG5cdFx0XHRlbGxpcHNpcyxcblx0XHRcdGVsbGlwc2l6ZU1vZGUsXG5cdFx0XHRsaW1pdCxcblx0XHRcdG51bWJlck9mTGluZXMsXG5cdFx0fVxuXHQpO1xuXG5cdGNvbnN0IHNob3VsZFRydW5jYXRlID0gZWxsaXBzaXplTW9kZSA9PT0gVFJVTkNBVEVfVFlQRS5hdXRvO1xuXG5cdGNvbnN0IGNsYXNzZXMgPSB1c2VNZW1vKCAoKSA9PiB7XG5cdFx0Y29uc3Qgc3ggPSB7fTtcblxuXHRcdHN4Lm51bWJlck9mTGluZXMgPSBjc3NgXG5cdFx0XHQtd2Via2l0LWJveC1vcmllbnQ6IHZlcnRpY2FsO1xuXHRcdFx0LXdlYmtpdC1saW5lLWNsYW1wOiAkeyBudW1iZXJPZkxpbmVzIH07XG5cdFx0XHRkaXNwbGF5OiAtd2Via2l0LWJveDtcblx0XHRcdG92ZXJmbG93OiBoaWRkZW47XG5cdFx0YDtcblxuXHRcdHJldHVybiBjeChcblx0XHRcdHNob3VsZFRydW5jYXRlICYmICEgbnVtYmVyT2ZMaW5lcyAmJiBzdHlsZXMuVHJ1bmNhdGUsXG5cdFx0XHRzaG91bGRUcnVuY2F0ZSAmJiAhISBudW1iZXJPZkxpbmVzICYmIHN4Lm51bWJlck9mTGluZXMsXG5cdFx0XHRjbGFzc05hbWVcblx0XHQpO1xuXHR9LCBbIGNsYXNzTmFtZSwgY3gsIG51bWJlck9mTGluZXMsIHNob3VsZFRydW5jYXRlIF0gKTtcblxuXHRyZXR1cm4geyAuLi5vdGhlclByb3BzLCBjbGFzc05hbWU6IGNsYXNzZXMsIGNoaWxkcmVuOiB0cnVuY2F0ZWRDb250ZW50IH07XG59XG4iXX0= */");
|
|
62
62
|
return cx(shouldTruncate && !numberOfLines && styles.Truncate, shouldTruncate && !!numberOfLines && sx.numberOfLines, className);
|
|
63
|
-
}, [className, numberOfLines, shouldTruncate]);
|
|
63
|
+
}, [className, cx, numberOfLines, shouldTruncate]);
|
|
64
64
|
return { ...otherProps,
|
|
65
65
|
className: classes,
|
|
66
66
|
children: truncatedContent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/truncate/hook.js"],"names":["useTruncate","props","className","children","ellipsis","TRUNCATE_ELLIPSIS","ellipsizeMode","TRUNCATE_TYPE","auto","limit","numberOfLines","otherProps","cx","truncatedContent","shouldTruncate","classes","sx","css","styles","Truncate"],"mappings":";;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACe,SAASA,WAAT,CAAsBC,KAAtB,EAA8B;AAC5C,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,QAFK;AAGLC,IAAAA,QAAQ,GAAGC,wBAHN;AAILC,IAAAA,aAAa,GAAGC,qBAAcC,IAJzB;AAKLC,IAAAA,KAAK,GAAG,CALH;AAMLC,IAAAA,aAAa,GAAG,CANX;AAOL,OAAGC;AAPE,MAQF,+BAAkBV,KAAlB,EAAyB,UAAzB,CARJ;AAUA,QAAMW,EAAE,GAAG,mBAAX;AAEA,QAAMC,gBAAgB,GAAG,4BACxB,OAAOV,QAAP,KAAoB,QAApB;AAA+B;AAAwBA,EAAAA,QAAvD,GAAoE,EAD5C,EAExB;AACCC,IAAAA,QADD;AAECE,IAAAA,aAFD;AAGCG,IAAAA,KAHD;AAICC,IAAAA;AAJD,GAFwB,CAAzB;AAUA,QAAMI,cAAc,GAAGR,aAAa,KAAKC,qBAAcC,IAAvD;AAEA,QAAMO,OAAO,GAAG,sBAAS,MAAM;AAC9B,UAAMC,EAAE,GAAG,EAAX;AAEAA,IAAAA,EAAE,CAACN,aAAH,oBAAmBO,UAAnB,qDAEwBP,aAFxB;AAOA,WAAOE,EAAE,CACRE,cAAc,IAAI,CAAEJ,aAApB,IAAqCQ,MAAM,CAACC,QADpC,EAERL,cAAc,IAAI,CAAC,CAAEJ,aAArB,IAAsCM,EAAE,CAACN,aAFjC,EAGRR,SAHQ,CAAT;AAKA,GAfe,EAeb,CAAEA,SAAF,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/truncate/hook.js"],"names":["useTruncate","props","className","children","ellipsis","TRUNCATE_ELLIPSIS","ellipsizeMode","TRUNCATE_TYPE","auto","limit","numberOfLines","otherProps","cx","truncatedContent","shouldTruncate","classes","sx","css","styles","Truncate"],"mappings":";;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACe,SAASA,WAAT,CAAsBC,KAAtB,EAA8B;AAC5C,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,QAFK;AAGLC,IAAAA,QAAQ,GAAGC,wBAHN;AAILC,IAAAA,aAAa,GAAGC,qBAAcC,IAJzB;AAKLC,IAAAA,KAAK,GAAG,CALH;AAMLC,IAAAA,aAAa,GAAG,CANX;AAOL,OAAGC;AAPE,MAQF,+BAAkBV,KAAlB,EAAyB,UAAzB,CARJ;AAUA,QAAMW,EAAE,GAAG,mBAAX;AAEA,QAAMC,gBAAgB,GAAG,4BACxB,OAAOV,QAAP,KAAoB,QAApB;AAA+B;AAAwBA,EAAAA,QAAvD,GAAoE,EAD5C,EAExB;AACCC,IAAAA,QADD;AAECE,IAAAA,aAFD;AAGCG,IAAAA,KAHD;AAICC,IAAAA;AAJD,GAFwB,CAAzB;AAUA,QAAMI,cAAc,GAAGR,aAAa,KAAKC,qBAAcC,IAAvD;AAEA,QAAMO,OAAO,GAAG,sBAAS,MAAM;AAC9B,UAAMC,EAAE,GAAG,EAAX;AAEAA,IAAAA,EAAE,CAACN,aAAH,oBAAmBO,UAAnB,qDAEwBP,aAFxB;AAOA,WAAOE,EAAE,CACRE,cAAc,IAAI,CAAEJ,aAApB,IAAqCQ,MAAM,CAACC,QADpC,EAERL,cAAc,IAAI,CAAC,CAAEJ,aAArB,IAAsCM,EAAE,CAACN,aAFjC,EAGRR,SAHQ,CAAT;AAKA,GAfe,EAeb,CAAEA,SAAF,EAAaU,EAAb,EAAiBF,aAAjB,EAAgCI,cAAhC,CAfa,CAAhB;AAiBA,SAAO,EAAE,GAAGH,UAAL;AAAiBT,IAAAA,SAAS,EAAEa,OAA5B;AAAqCZ,IAAAA,QAAQ,EAAEU;AAA/C,GAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem } from '../ui/context';\nimport * as styles from './styles';\nimport { TRUNCATE_ELLIPSIS, TRUNCATE_TYPE, truncateContent } from './utils';\nimport { useCx } from '../utils/hooks/use-cx';\n\n/**\n * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props\n */\nexport default function useTruncate( props ) {\n\tconst {\n\t\tclassName,\n\t\tchildren,\n\t\tellipsis = TRUNCATE_ELLIPSIS,\n\t\tellipsizeMode = TRUNCATE_TYPE.auto,\n\t\tlimit = 0,\n\t\tnumberOfLines = 0,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Truncate' );\n\n\tconst cx = useCx();\n\n\tconst truncatedContent = truncateContent(\n\t\ttypeof children === 'string' ? /** @type {string} */ ( children ) : '',\n\t\t{\n\t\t\tellipsis,\n\t\t\tellipsizeMode,\n\t\t\tlimit,\n\t\t\tnumberOfLines,\n\t\t}\n\t);\n\n\tconst shouldTruncate = ellipsizeMode === TRUNCATE_TYPE.auto;\n\n\tconst classes = useMemo( () => {\n\t\tconst sx = {};\n\n\t\tsx.numberOfLines = css`\n\t\t\t-webkit-box-orient: vertical;\n\t\t\t-webkit-line-clamp: ${ numberOfLines };\n\t\t\tdisplay: -webkit-box;\n\t\t\toverflow: hidden;\n\t\t`;\n\n\t\treturn cx(\n\t\t\tshouldTruncate && ! numberOfLines && styles.Truncate,\n\t\t\tshouldTruncate && !! numberOfLines && sx.numberOfLines,\n\t\t\tclassName\n\t\t);\n\t}, [ className, cx, numberOfLines, shouldTruncate ] );\n\n\treturn { ...otherProps, className: classes, children: truncatedContent };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/shortcut/component.tsx"],"names":["Shortcut","props","forwardedRef","as","asProp","shortcut","className","otherProps","displayText","ariaLabel","display","ConnectedShortcut"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/shortcut/component.tsx"],"names":["Shortcut","props","forwardedRef","as","asProp","shortcut","className","otherProps","displayText","ariaLabel","display","ConnectedShortcut"],"mappings":";;;;;;;;;;;;;AAQA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;AAkBA,SAASA,QAAT,CACCC,KADD,EAECC,YAFD,EAGsB;AACrB,QAAM;AACLC,IAAAA,EAAE,EAAEC,MAAM,GAAG,MADR;AAELC,IAAAA,QAFK;AAGLC,IAAAA,SAHK;AAIL,OAAGC;AAJE,MAKF,+BAAkBN,KAAlB,EAAyB,UAAzB,CALJ;;AAMA,MAAK,CAAEI,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,MAAIG,WAAJ;AACA,MAAIC,SAAJ;;AAEA,MAAK,OAAOJ,QAAP,KAAoB,QAAzB,EAAoC;AACnCG,IAAAA,WAAW,GAAGH,QAAd;AACA,GAFD,MAEO;AACNG,IAAAA,WAAW,GAAGH,QAAQ,CAACK,OAAvB;AACAD,IAAAA,SAAS,GAAGJ,QAAQ,CAACI,SAArB;AACA;;AAED,SACC,4BAAC,UAAD;AACC,IAAA,EAAE,EAAGL,MADN;AAEC,IAAA,SAAS,EAAGE,SAFb;AAGC,kBAAaG,SAHd;AAIC,IAAA,GAAG,EAAGP;AAJP,KAKMK,UALN,GAOGC,WAPH,CADD;AAWA;;AAED,MAAMG,iBAAiB,GAAG,6BAAgBX,QAAhB,EAA0B,UAA1B,CAA1B;eAEeW,iB","sourcesContent":["/**\n * External dependencies\n */\nimport type { Ref } from 'react';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseContextSystem,\n\tcontextConnect,\n\tWordPressComponentProps,\n} from '../context';\nimport { View } from '../../view';\n\nexport interface ShortcutDescription {\n\tdisplay: string;\n\tariaLabel: string;\n}\n\nexport interface Props {\n\tshortcut?: ShortcutDescription | string;\n\tclassName?: string;\n}\n\nfunction Shortcut(\n\tprops: WordPressComponentProps< Props, 'span' >,\n\tforwardedRef: Ref< any >\n): JSX.Element | null {\n\tconst {\n\t\tas: asProp = 'span',\n\t\tshortcut,\n\t\tclassName,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Shortcut' );\n\tif ( ! shortcut ) {\n\t\treturn null;\n\t}\n\n\tlet displayText: string;\n\tlet ariaLabel: string | undefined;\n\n\tif ( typeof shortcut === 'string' ) {\n\t\tdisplayText = shortcut;\n\t} else {\n\t\tdisplayText = shortcut.display;\n\t\tariaLabel = shortcut.ariaLabel;\n\t}\n\n\treturn (\n\t\t<View\n\t\t\tas={ asProp }\n\t\t\tclassName={ className }\n\t\t\taria-label={ ariaLabel }\n\t\t\tref={ forwardedRef }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t{ displayText }\n\t\t</View>\n\t);\n}\n\nconst ConnectedShortcut = contextConnect( Shortcut, 'Shortcut' );\n\nexport default ConnectedShortcut;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/utils/font-size.ts"],"names":["BASE_FONT_SIZE","PRESET_FONT_SIZES","body","caption","footnote","largeTitle","subheadline","title","HEADING_FONT_SIZES","flatMap","n","toString","getFontSize","size","parsed","parseFloat","Number","isNaN","ratio","CONFIG","fontSize","getHeadingFontSize","includes","headingSize"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/utils/font-size.ts"],"names":["BASE_FONT_SIZE","PRESET_FONT_SIZES","body","caption","footnote","largeTitle","subheadline","title","HEADING_FONT_SIZES","flatMap","n","toString","getFontSize","size","parsed","parseFloat","Number","isNaN","ratio","CONFIG","fontSize","getHeadingFontSize","includes","headingSize"],"mappings":";;;;;;;;;;;AAQA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAiBO,MAAMA,cAAc,GAAG,EAAvB;;AAEA,MAAMC,iBAAiB,GAAG;AAChCC,EAAAA,IAAI,EAAEF,cAD0B;AAEhCG,EAAAA,OAAO,EAAE,EAFuB;AAGhCC,EAAAA,QAAQ,EAAE,EAHsB;AAIhCC,EAAAA,UAAU,EAAE,EAJoB;AAKhCC,EAAAA,WAAW,EAAE,EALmB;AAMhCC,EAAAA,KAAK,EAAE;AANyB,CAA1B;;AASA,MAAMC,kBAAkB,GAAG,CAAE,CAAF,EAAK,CAAL,EAAQ,CAAR,EAAW,CAAX,EAAc,CAAd,EAAiB,CAAjB,EAAqBC,OAArB,CAAgCC,CAAF,IAAS,CACxEA,CADwE,EAExEA,CAAC,CAACC,QAAF,EAFwE,CAAvC,CAA3B;;;AAKA,SAASC,WAAT,GAIG;AAAA,MAHTC,IAGS,uEAD2Bb,cAC3B;;AACT,MAAKa,IAAI,IAAIZ,iBAAb,EAAiC;AAChC,WAAOW,WAAW,CACjBX,iBAAiB,CAAEY,IAAF,CADA,CAAlB;AAGA;;AAED,MAAK,OAAOA,IAAP,KAAgB,QAArB,EAAgC;AAC/B,UAAMC,MAAM,GAAGC,UAAU,CAAEF,IAAF,CAAzB;AACA,QAAKG,MAAM,CAACC,KAAP,CAAcH,MAAd,CAAL,EAA8B,OAAOD,IAAP;AAC9BA,IAAAA,IAAI,GAAGC,MAAP;AACA;;AAED,QAAMI,KAAK,GAAI,IAAIL,IAAM,MAAMb,cAAgB,GAA/C;AACA,SAAQ,QAAQkB,KAAO,MAAMC,sBAAOC,QAAU,GAA9C;AACA;;AAEM,SAASC,kBAAT,GAA2D;AAAA,MAA9BR,IAA8B,uEAAZ,CAAY;;AACjE,MAAK,CAAEL,kBAAkB,CAACc,QAAnB,CAA6BT,IAA7B,CAAP,EAA4D;AAC3D,WAAOD,WAAW,CAAEC,IAAF,CAAlB;AACA;;AAED,QAAMU,WAAW,GAAI,YAAYV,IAAM,EAAvC;AACA,SAAOM,sBAAQI,WAAR,CAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties, ReactText } from 'react';\n\n/**\n * Internal dependencies\n */\nimport CONFIG from '../../utils/config-values';\n\nexport type HeadingSize =\n\t| 1\n\t| 2\n\t| 3\n\t| 4\n\t| 5\n\t| 6\n\t| '1'\n\t| '2'\n\t| '3'\n\t| '4'\n\t| '5'\n\t| '6';\n\nexport const BASE_FONT_SIZE = 13;\n\nexport const PRESET_FONT_SIZES = {\n\tbody: BASE_FONT_SIZE,\n\tcaption: 10,\n\tfootnote: 11,\n\tlargeTitle: 28,\n\tsubheadline: 12,\n\ttitle: 20,\n};\n\nexport const HEADING_FONT_SIZES = [ 1, 2, 3, 4, 5, 6 ].flatMap( ( n ) => [\n\tn as HeadingSize,\n\tn.toString() as HeadingSize,\n] );\n\nexport function getFontSize(\n\tsize:\n\t\t| CSSProperties[ 'fontSize' ]\n\t\t| keyof typeof PRESET_FONT_SIZES = BASE_FONT_SIZE\n): string {\n\tif ( size in PRESET_FONT_SIZES ) {\n\t\treturn getFontSize(\n\t\t\tPRESET_FONT_SIZES[ size as keyof typeof PRESET_FONT_SIZES ]\n\t\t);\n\t}\n\n\tif ( typeof size !== 'number' ) {\n\t\tconst parsed = parseFloat( size );\n\t\tif ( Number.isNaN( parsed ) ) return size;\n\t\tsize = parsed;\n\t}\n\n\tconst ratio = `(${ size } / ${ BASE_FONT_SIZE })`;\n\treturn `calc(${ ratio } * ${ CONFIG.fontSize })`;\n}\n\nexport function getHeadingFontSize( size: ReactText = 3 ): string {\n\tif ( ! HEADING_FONT_SIZES.includes( size as HeadingSize ) ) {\n\t\treturn getFontSize( size );\n\t}\n\n\tconst headingSize = `fontSizeH${ size }` as `fontSizeH${ HeadingSize }`;\n\treturn CONFIG[ headingSize ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/utils/get-valid-children.ts"],"names":["getValidChildren","children","Children","toArray","filter","child"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/ui/utils/get-valid-children.ts"],"names":["getValidChildren","children","Children","toArray","filter","child"],"mappings":";;;;;;;AAQA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,CAA2BC,QAA3B,EAAiE;AACvE,MAAK,OAAOA,QAAP,KAAoB,QAAzB,EAAoC,OAAO,CAAEA,QAAF,CAAP;AAEpC,SAAOC,kBAASC,OAAT,CAAkBF,QAAlB,EAA6BG,MAA7B,CAAuCC,KAAF,IAC3C,6BAAgBA,KAAhB,CADM,CAAP;AAGA","sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, ReactNodeArray } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Children, isValidElement } from '@wordpress/element';\n\n/**\n * Gets a collection of available children elements from a React component's children prop.\n *\n * @param children\n *\n * @return An array of available children.\n */\nexport function getValidChildren( children: ReactNode ): ReactNodeArray {\n\tif ( typeof children === 'string' ) return [ children ];\n\n\treturn Children.toArray( children ).filter( ( child ) =>\n\t\tisValidElement( child )\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/unit-control/index.tsx"],"names":["UnitControl","forwardedRef","__unstableStateReducer","stateReducer","state","autoComplete","className","disabled","disableUnits","isPressEnterToChange","isResetValueOnUnitChange","isUnitSelectTabbable","label","onChange","noop","onUnitChange","size","style","unit","unitProp","units","unitsProp","CSS_UNITS","value","valueProp","props","initialUnit","setUnit","initial","fallback","refParsedValue","classes","handleOnChange","next","changeProps","join","handleOnUnitChange","data","nextValue","default","undefined","mayUpdateUnit","event","isNaN","Number","currentTarget","current","parsedValue","parsedUnit","toString","Array","isArray","find","option","handleOnBlur","handleOnKeyDown","keyCode","ENTER","unitControlStateReducer","action","type","inputControlActionTypes","COMMIT","inputSuffix","step","activeUnit","ForwardedUnitControl"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgBA;;;;AANA;;AACA;;AAMA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAMA;;;;;;AAlCA;AACA;AACA;AACA;;AAUA;AACA;AACA;AAuBA,SAASA,WAAT,OAoBCC,YApBD,EAqBE;AAAA,MApBD;AACCC,IAAAA,sBAAsB,EAAEC,YAAY,GAAKC,KAAF,IAAaA,KADrD;AAECC,IAAAA,YAAY,GAAG,KAFhB;AAGCC,IAAAA,SAHD;AAICC,IAAAA,QAAQ,GAAG,KAJZ;AAKCC,IAAAA,YAAY,GAAG,KALhB;AAMCC,IAAAA,oBAAoB,GAAG,KANxB;AAOCC,IAAAA,wBAAwB,GAAG,KAP5B;AAQCC,IAAAA,oBAAoB,GAAG,IARxB;AASCC,IAAAA,KATD;AAUCC,IAAAA,QAAQ,GAAGC,YAVZ;AAWCC,IAAAA,YAAY,GAAGD,YAXhB;AAYCE,IAAAA,IAAI,GAAG,SAZR;AAaCC,IAAAA,KAbD;AAcCC,IAAAA,IAAI,EAAEC,QAdP;AAeCC,IAAAA,KAAK,EAAEC,SAAS,GAAGC,gBAfpB;AAgBCC,IAAAA,KAAK,EAAEC,SAhBR;AAiBC,OAAGC;AAjBJ,GAoBC;AACD,QAAML,KAAK,GAAG,sBACb,MAAM,oCAAyBI,SAAzB,EAAoCL,QAApC,EAA8CE,SAA9C,CADO,EAEb,CAAEG,SAAF,EAAaL,QAAb,EAAuBE,SAAvB,CAFa,CAAd;AAIA,QAAM,CAAEE,KAAF,EAASG,WAAT,IAAyB,2BAAgBF,SAAhB,EAA2BL,Q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,IAAA,QAAQ,EAAGxB,QANZ;AAOC,IAAA,YAAY,EAAGC,YAPhB;AAQC,IAAA,oBAAoB,EAAGC,oBARxB;AASC,IAAA,KAAK,EAAGG,KATT;AAUC,IAAA,MAAM,EAAG0C,YAVV;AAWC,IAAA,SAAS,EAAGC,eAXb;AAYC,IAAA,QAAQ,EAAGvB,cAZZ;AAaC,IAAA,GAAG,EAAG/B,YAbP;AAcC,IAAA,IAAI,EAAGe,IAdR;AAeC,IAAA,MAAM,EAAG+C,WAfV;AAgBC,IAAA,KAAK,EAAGxC,KAhBT;AAiBC,IAAA,IAAI,EAAGyC,IAjBR;AAkBC,IAAA,sBAAsB,EAAG,mCACxBN,uBADwB,EAExBvD,YAFwB;AAlB1B,KADD,CADD;AA2BA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAM+D,oBAAoB,GAAG,yBAAYlE,WAAZ,CAA7B;eAGekE,oB","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type {\n\tFocusEventHandler,\n\tKeyboardEvent,\n\tRef,\n\tSyntheticEvent,\n} from 'react';\nimport { noop, omit } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useMemo, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { ENTER } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { composeStateReducers } from '../input-control/reducer/reducer';\nimport { Root, ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport {\n\tCSS_UNITS,\n\tgetParsedValue,\n\tgetUnitsWithCurrentUnit,\n\tgetValidParsedUnit,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport type { UnitControlProps, UnitControlOnChangeCallback } from './types';\nimport type { StateReducer } from '../input-control/reducer/state';\n\nfunction UnitControl(\n\t{\n\t\t__unstableStateReducer: stateReducer = ( state ) => state,\n\t\tautoComplete = 'off',\n\t\tclassName,\n\t\tdisabled = false,\n\t\tdisableUnits = false,\n\t\tisPressEnterToChange = false,\n\t\tisResetValueOnUnitChange = false,\n\t\tisUnitSelectTabbable = true,\n\t\tlabel,\n\t\tonChange = noop,\n\t\tonUnitChange = noop,\n\t\tsize = 'default',\n\t\tstyle,\n\t\tunit: unitProp,\n\t\tunits: unitsProp = CSS_UNITS,\n\t\tvalue: valueProp,\n\t\t...props\n\t}: WordPressComponentProps< UnitControlProps, 'input', false >,\n\tforwardedRef: Ref< any >\n) {\n\tconst units = useMemo(\n\t\t() => getUnitsWithCurrentUnit( valueProp, unitProp, unitsProp ),\n\t\t[ valueProp, unitProp, unitsProp ]\n\t);\n\tconst [ value, initialUnit ] = getParsedValue( valueProp, unitProp, units );\n\tconst [ unit, setUnit ] = useControlledState< string | undefined >(\n\t\tunitProp,\n\t\t{\n\t\t\tinitial: initialUnit,\n\t\t\tfallback: '',\n\t\t}\n\t);\n\n\t// Stores parsed value for hand-off in state reducer\n\tconst refParsedValue = useRef< string | null >( null );\n\n\tconst classes = classnames( 'components-unit-control', className );\n\n\tconst handleOnChange: UnitControlOnChangeCallback = (\n\t\tnext,\n\t\tchangeProps\n\t) => {\n\t\tif ( next === '' ) {\n\t\t\tonChange( '', changeProps );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Customizing the onChange callback.\n\t\t * This allows as to broadcast a combined value+unit to onChange.\n\t\t */\n\t\tnext = getValidParsedUnit( next, units, value, unit ).join( '' );\n\n\t\tonChange( next, changeProps );\n\t};\n\n\tconst handleOnUnitChange: UnitControlOnChangeCallback = (\n\t\tnext,\n\t\tchangeProps\n\t) => {\n\t\tconst { data } = changeProps;\n\n\t\tlet nextValue = `${ value }${ next }`;\n\n\t\tif ( isResetValueOnUnitChange && data?.default !== undefined ) {\n\t\t\tnextValue = `${ data.default }${ next }`;\n\t\t}\n\n\t\tonChange( nextValue, changeProps );\n\t\tonUnitChange( next, changeProps );\n\n\t\tsetUnit( next );\n\t};\n\n\tconst mayUpdateUnit = ( event: SyntheticEvent< HTMLInputElement > ) => {\n\t\tif ( ! isNaN( Number( event.currentTarget.value ) ) ) {\n\t\t\trefParsedValue.current = null;\n\t\t\treturn;\n\t\t}\n\t\tconst [ parsedValue, parsedUnit ] = getValidParsedUnit(\n\t\t\tevent.currentTarget.value,\n\t\t\tunits,\n\t\t\tvalue,\n\t\t\tunit\n\t\t);\n\n\t\trefParsedValue.current = parsedValue.toString();\n\n\t\tif ( isPressEnterToChange && parsedUnit !== unit ) {\n\t\t\tconst data = Array.isArray( units )\n\t\t\t\t? units.find( ( option ) => option.value === parsedUnit )\n\t\t\t\t: undefined;\n\t\t\tconst changeProps = { event, data };\n\n\t\t\tonChange( `${ parsedValue }${ parsedUnit }`, changeProps );\n\t\t\tonUnitChange( parsedUnit, changeProps );\n\n\t\t\tsetUnit( parsedUnit );\n\t\t}\n\t};\n\n\tconst handleOnBlur: FocusEventHandler< HTMLInputElement > = mayUpdateUnit;\n\n\tconst handleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\tconst { keyCode } = event;\n\t\tif ( keyCode === ENTER ) {\n\t\t\tmayUpdateUnit( event );\n\t\t}\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @param state State from InputControl\n\t * @param action Action triggering state change\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst unitControlStateReducer: StateReducer = ( state, action ) => {\n\t\t/*\n\t\t * On commits (when pressing ENTER and on blur if\n\t\t * isPressEnterToChange is true), if a parse has been performed\n\t\t * then use that result to update the state.\n\t\t */\n\t\tif ( action.type === inputControlActionTypes.COMMIT ) {\n\t\t\tif ( refParsedValue.current !== null ) {\n\t\t\t\tstate.value = refParsedValue.current;\n\t\t\t\trefParsedValue.current = null;\n\t\t\t}\n\t\t}\n\n\t\treturn state;\n\t};\n\n\tconst inputSuffix = ! disableUnits ? (\n\t\t<UnitSelectControl\n\t\t\taria-label={ __( 'Select unit' ) }\n\t\t\tdisabled={ disabled }\n\t\t\tisUnitSelectTabbable={ isUnitSelectTabbable }\n\t\t\tonChange={ handleOnUnitChange }\n\t\t\tsize={ size }\n\t\t\tunit={ unit }\n\t\t\tunits={ units }\n\t\t/>\n\t) : null;\n\n\tlet step = props.step;\n\n\t/*\n\t * If no step prop has been passed, lookup the active unit and\n\t * try to get step from `units`, or default to a value of `1`\n\t */\n\tif ( ! step && units ) {\n\t\tconst activeUnit = units.find( ( option ) => option.value === unit );\n\t\tstep = activeUnit?.step ?? 1;\n\t}\n\n\treturn (\n\t\t<Root className=\"components-unit-control-wrapper\" style={ style }>\n\t\t\t<ValueInput\n\t\t\t\taria-label={ label }\n\t\t\t\ttype={ isPressEnterToChange ? 'text' : 'number' }\n\t\t\t\t{ ...omit( props, [ 'children' ] ) }\n\t\t\t\tautoComplete={ autoComplete }\n\t\t\t\tclassName={ classes }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tdisableUnits={ disableUnits }\n\t\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\t\tlabel={ label }\n\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\t\tonChange={ handleOnChange }\n\t\t\t\tref={ forwardedRef }\n\t\t\t\tsize={ size }\n\t\t\t\tsuffix={ inputSuffix }\n\t\t\t\tvalue={ value }\n\t\t\t\tstep={ step }\n\t\t\t\t__unstableStateReducer={ composeStateReducers(\n\t\t\t\t\tunitControlStateReducer,\n\t\t\t\t\tstateReducer\n\t\t\t\t) }\n\t\t\t/>\n\t\t</Root>\n\t);\n}\n\n/**\n * `UnitControl` allows the user to set a value as well as a unit (e.g. `px`).\n *\n *\n * @example\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nconst ForwardedUnitControl = forwardRef( UnitControl );\n\nexport { parseUnit, useCustomUnits } from './utils';\nexport default ForwardedUnitControl;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/unit-control/index.tsx"],"names":["UnitControl","forwardedRef","__unstableStateReducer","stateReducer","state","autoComplete","className","disabled","disableUnits","isPressEnterToChange","isResetValueOnUnitChange","isUnitSelectTabbable","label","onChange","noop","onUnitChange","size","style","unit","unitProp","units","unitsProp","CSS_UNITS","value","valueProp","props","initialUnit","setUnit","initial","fallback","refParsedValue","classes","handleOnChange","next","changeProps","join","handleOnUnitChange","data","nextValue","default","undefined","mayUpdateUnit","event","isNaN","Number","currentTarget","current","parsedValue","parsedUnit","toString","Array","isArray","find","option","handleOnBlur","handleOnKeyDown","keyCode","ENTER","unitControlStateReducer","action","type","inputControlActionTypes","COMMIT","inputSuffix","step","activeUnit","ForwardedUnitControl"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA;;;;AANA;;AACA;;AAMA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAMA;;;;;;AAjCA;AACA;AACA;;AAUA;AACA;AACA;AAuBA,SAASA,WAAT,OAoBCC,YApBD,EAqBE;AAAA,MApBD;AACCC,IAAAA,sBAAsB,EAAEC,YAAY,GAAKC,KAAF,IAAaA,KADrD;AAECC,IAAAA,YAAY,GAAG,KAFhB;AAGCC,IAAAA,SAHD;AAICC,IAAAA,QAAQ,GAAG,KAJZ;AAKCC,IAAAA,YAAY,GAAG,KALhB;AAMCC,IAAAA,oBAAoB,GAAG,KANxB;AAOCC,IAAAA,wBAAwB,GAAG,KAP5B;AAQCC,IAAAA,oBAAoB,GAAG,IARxB;AASCC,IAAAA,KATD;AAUCC,IAAAA,QAAQ,GAAGC,YAVZ;AAWCC,IAAAA,YAA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B,KAAP,KAAiBL,IAA3C,CAAnB;AACA8C,IAAAA,IAAI,uBAAGC,UAAH,aAAGA,UAAH,uBAAGA,UAAU,CAAED,IAAf,+DAAuB,CAA3B;AACA;;AAED,SACC,4BAAC,uBAAD;AAAM,IAAA,SAAS,EAAC,iCAAhB;AAAkD,IAAA,KAAK,EAAG/C;AAA1D,KACC,4BAAC,6BAAD;AACC,kBAAaL,KADd;AAEC,IAAA,IAAI,EAAGH,oBAAoB,GAAG,MAAH,GAAY;AAFxC,KAGM,kBAAMgB,KAAN,EAAa,CAAE,UAAF,CAAb,CAHN;AAIC,IAAA,YAAY,EAAGpB,YAJhB;AAKC,IAAA,SAAS,EAAG0B,OALb;AAMC,IAAA,QAAQ,EAAGxB,QANZ;AAOC,IAAA,YAAY,EAAGC,YAPhB;AAQC,IAAA,oBAAoB,EAAGC,oBARxB;AASC,IAAA,KAAK,EAAGG,KATT;AAUC,IAAA,MAAM,EAAG0C,YAVV;AAWC,IAAA,SAAS,EAAGC,eAXb;AAYC,IAAA,QAAQ,EAAGvB,cAZZ;AAaC,IAAA,GAAG,EAAG/B,YAbP;AAcC,IAAA,IAAI,EAAGe,IAdR;AAeC,IAAA,MAAM,EAAG+C,WAfV;AAgBC,IAAA,KAAK,EAAGxC,KAhBT;AAiBC,IAAA,IAAI,EAAGyC,IAjBR;AAkBC,IAAA,sBAAsB,EAAG,mCACxBN,uBADwB,EAExBvD,YAFwB;AAlB1B,KADD,CADD;AA2BA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAM+D,oBAAoB,GAAG,yBAAYlE,WAAZ,CAA7B;eAGekE,oB","sourcesContent":["/**\n * External dependencies\n */\nimport type {\n\tFocusEventHandler,\n\tKeyboardEvent,\n\tRef,\n\tSyntheticEvent,\n} from 'react';\nimport { noop, omit } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useMemo, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { ENTER } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { composeStateReducers } from '../input-control/reducer/reducer';\nimport { Root, ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport {\n\tCSS_UNITS,\n\tgetParsedValue,\n\tgetUnitsWithCurrentUnit,\n\tgetValidParsedUnit,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport type { UnitControlProps, UnitControlOnChangeCallback } from './types';\nimport type { StateReducer } from '../input-control/reducer/state';\n\nfunction UnitControl(\n\t{\n\t\t__unstableStateReducer: stateReducer = ( state ) => state,\n\t\tautoComplete = 'off',\n\t\tclassName,\n\t\tdisabled = false,\n\t\tdisableUnits = false,\n\t\tisPressEnterToChange = false,\n\t\tisResetValueOnUnitChange = false,\n\t\tisUnitSelectTabbable = true,\n\t\tlabel,\n\t\tonChange = noop,\n\t\tonUnitChange = noop,\n\t\tsize = 'default',\n\t\tstyle,\n\t\tunit: unitProp,\n\t\tunits: unitsProp = CSS_UNITS,\n\t\tvalue: valueProp,\n\t\t...props\n\t}: WordPressComponentProps< UnitControlProps, 'input', false >,\n\tforwardedRef: Ref< any >\n) {\n\tconst units = useMemo(\n\t\t() => getUnitsWithCurrentUnit( valueProp, unitProp, unitsProp ),\n\t\t[ valueProp, unitProp, unitsProp ]\n\t);\n\tconst [ value, initialUnit ] = getParsedValue( valueProp, unitProp, units );\n\tconst [ unit, setUnit ] = useControlledState< string | undefined >(\n\t\tunitProp,\n\t\t{\n\t\t\tinitial: initialUnit,\n\t\t\tfallback: '',\n\t\t}\n\t);\n\n\t// Stores parsed value for hand-off in state reducer\n\tconst refParsedValue = useRef< string | null >( null );\n\n\tconst classes = classnames( 'components-unit-control', className );\n\n\tconst handleOnChange: UnitControlOnChangeCallback = (\n\t\tnext,\n\t\tchangeProps\n\t) => {\n\t\tif ( next === '' ) {\n\t\t\tonChange( '', changeProps );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Customizing the onChange callback.\n\t\t * This allows as to broadcast a combined value+unit to onChange.\n\t\t */\n\t\tnext = getValidParsedUnit( next, units, value, unit ).join( '' );\n\n\t\tonChange( next, changeProps );\n\t};\n\n\tconst handleOnUnitChange: UnitControlOnChangeCallback = (\n\t\tnext,\n\t\tchangeProps\n\t) => {\n\t\tconst { data } = changeProps;\n\n\t\tlet nextValue = `${ value }${ next }`;\n\n\t\tif ( isResetValueOnUnitChange && data?.default !== undefined ) {\n\t\t\tnextValue = `${ data.default }${ next }`;\n\t\t}\n\n\t\tonChange( nextValue, changeProps );\n\t\tonUnitChange( next, changeProps );\n\n\t\tsetUnit( next );\n\t};\n\n\tconst mayUpdateUnit = ( event: SyntheticEvent< HTMLInputElement > ) => {\n\t\tif ( ! isNaN( Number( event.currentTarget.value ) ) ) {\n\t\t\trefParsedValue.current = null;\n\t\t\treturn;\n\t\t}\n\t\tconst [ parsedValue, parsedUnit ] = getValidParsedUnit(\n\t\t\tevent.currentTarget.value,\n\t\t\tunits,\n\t\t\tvalue,\n\t\t\tunit\n\t\t);\n\n\t\trefParsedValue.current = parsedValue.toString();\n\n\t\tif ( isPressEnterToChange && parsedUnit !== unit ) {\n\t\t\tconst data = Array.isArray( units )\n\t\t\t\t? units.find( ( option ) => option.value === parsedUnit )\n\t\t\t\t: undefined;\n\t\t\tconst changeProps = { event, data };\n\n\t\t\tonChange( `${ parsedValue }${ parsedUnit }`, changeProps );\n\t\t\tonUnitChange( parsedUnit, changeProps );\n\n\t\t\tsetUnit( parsedUnit );\n\t\t}\n\t};\n\n\tconst handleOnBlur: FocusEventHandler< HTMLInputElement > = mayUpdateUnit;\n\n\tconst handleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\tconst { keyCode } = event;\n\t\tif ( keyCode === ENTER ) {\n\t\t\tmayUpdateUnit( event );\n\t\t}\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @param state State from InputControl\n\t * @param action Action triggering state change\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst unitControlStateReducer: StateReducer = ( state, action ) => {\n\t\t/*\n\t\t * On commits (when pressing ENTER and on blur if\n\t\t * isPressEnterToChange is true), if a parse has been performed\n\t\t * then use that result to update the state.\n\t\t */\n\t\tif ( action.type === inputControlActionTypes.COMMIT ) {\n\t\t\tif ( refParsedValue.current !== null ) {\n\t\t\t\tstate.value = refParsedValue.current;\n\t\t\t\trefParsedValue.current = null;\n\t\t\t}\n\t\t}\n\n\t\treturn state;\n\t};\n\n\tconst inputSuffix = ! disableUnits ? (\n\t\t<UnitSelectControl\n\t\t\taria-label={ __( 'Select unit' ) }\n\t\t\tdisabled={ disabled }\n\t\t\tisUnitSelectTabbable={ isUnitSelectTabbable }\n\t\t\tonChange={ handleOnUnitChange }\n\t\t\tsize={ size }\n\t\t\tunit={ unit }\n\t\t\tunits={ units }\n\t\t/>\n\t) : null;\n\n\tlet step = props.step;\n\n\t/*\n\t * If no step prop has been passed, lookup the active unit and\n\t * try to get step from `units`, or default to a value of `1`\n\t */\n\tif ( ! step && units ) {\n\t\tconst activeUnit = units.find( ( option ) => option.value === unit );\n\t\tstep = activeUnit?.step ?? 1;\n\t}\n\n\treturn (\n\t\t<Root className=\"components-unit-control-wrapper\" style={ style }>\n\t\t\t<ValueInput\n\t\t\t\taria-label={ label }\n\t\t\t\ttype={ isPressEnterToChange ? 'text' : 'number' }\n\t\t\t\t{ ...omit( props, [ 'children' ] ) }\n\t\t\t\tautoComplete={ autoComplete }\n\t\t\t\tclassName={ classes }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tdisableUnits={ disableUnits }\n\t\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\t\tlabel={ label }\n\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\t\tonChange={ handleOnChange }\n\t\t\t\tref={ forwardedRef }\n\t\t\t\tsize={ size }\n\t\t\t\tsuffix={ inputSuffix }\n\t\t\t\tvalue={ value }\n\t\t\t\tstep={ step }\n\t\t\t\t__unstableStateReducer={ composeStateReducers(\n\t\t\t\t\tunitControlStateReducer,\n\t\t\t\t\tstateReducer\n\t\t\t\t) }\n\t\t\t/>\n\t\t</Root>\n\t);\n}\n\n/**\n * `UnitControl` allows the user to set a value as well as a unit (e.g. `px`).\n *\n *\n * @example\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nconst ForwardedUnitControl = forwardRef( UnitControl );\n\nexport { parseUnit, useCustomUnits } from './utils';\nexport default ForwardedUnitControl;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/unit-control/unit-select-control.tsx"],"names":["UnitSelectControl","className","isUnitSelectTabbable","isTabbable","onChange","noop","size","unit","units","CSS_UNITS","props","length","handleOnChange","event","value","unitValue","target","data","find","option","classes","undefined","map","label"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/unit-control/unit-select-control.tsx"],"names":["UnitSelectControl","className","isUnitSelectTabbable","isTabbable","onChange","noop","size","unit","units","CSS_UNITS","props","length","handleOnChange","event","value","unitValue","target","data","find","option","classes","undefined","map","label"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAOA;;AACA;;AAZA;AACA;AACA;AAae,SAASA,iBAAT,OAQyD;AAAA,MAR7B;AAC1CC,IAAAA,SAD0C;AAE1CC,IAAAA,oBAAoB,EAAEC,UAAU,GAAG,IAFO;AAG1CC,IAAAA,QAAQ,GAAGC,YAH+B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lodash';\nimport classnames from 'classnames';\nimport type { ChangeEvent } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport { UnitSelect, UnitLabel } from './styles/unit-control-styles';\nimport { CSS_UNITS, hasUnits } from './utils';\nimport type { UnitSelectControlProps } from './types';\n\nexport default function UnitSelectControl( {\n\tclassName,\n\tisUnitSelectTabbable: isTabbable = true,\n\tonChange = noop,\n\tsize = 'default',\n\tunit = 'px',\n\tunits = CSS_UNITS,\n\t...props\n}: WordPressComponentProps< UnitSelectControlProps, 'select', false > ) {\n\tif ( ! units || ! hasUnits( units ) || units?.length === 1 ) {\n\t\treturn (\n\t\t\t<UnitLabel\n\t\t\t\tclassName=\"components-unit-control__unit-label\"\n\t\t\t\tselectSize={ size }\n\t\t\t>\n\t\t\t\t{ unit }\n\t\t\t</UnitLabel>\n\t\t);\n\t}\n\n\tconst handleOnChange = ( event: ChangeEvent< HTMLSelectElement > ) => {\n\t\tconst { value: unitValue } = event.target;\n\t\tconst data = units.find( ( option ) => option.value === unitValue );\n\n\t\tonChange( unitValue, { event, data } );\n\t};\n\n\tconst classes = classnames( 'components-unit-control__select', className );\n\n\treturn (\n\t\t<UnitSelect\n\t\t\tclassName={ classes }\n\t\t\tonChange={ handleOnChange }\n\t\t\tselectSize={ size }\n\t\t\ttabIndex={ isTabbable ? undefined : -1 }\n\t\t\tvalue={ unit }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ units.map( ( option ) => (\n\t\t\t\t<option value={ option.value } key={ option.value }>\n\t\t\t\t\t{ option.label }\n\t\t\t\t</option>\n\t\t\t) ) }\n\t\t</UnitSelect>\n\t);\n}\n"]}
|
|
@@ -42,9 +42,12 @@ const G2 = {
|
|
|
42
42
|
600: '#949494',
|
|
43
43
|
// Meets 3:1 UI or large text contrast against white.
|
|
44
44
|
400: '#ccc',
|
|
45
|
-
|
|
45
|
+
300: '#ddd',
|
|
46
46
|
// Used for most borders.
|
|
47
|
-
|
|
47
|
+
200: '#e0e0e0',
|
|
48
|
+
// Used sparingly for light borders.
|
|
49
|
+
100: '#f0f0f0' // Used for light gray backgrounds.
|
|
50
|
+
|
|
48
51
|
},
|
|
49
52
|
darkGray: {
|
|
50
53
|
primary: '#1e1e1e',
|
|
@@ -174,7 +177,7 @@ const UI = {
|
|
|
174
177
|
borderHover: G2.gray[700],
|
|
175
178
|
borderFocus: ADMIN.themeDark10,
|
|
176
179
|
borderDisabled: G2.gray[400],
|
|
177
|
-
borderLight: G2.gray[
|
|
180
|
+
borderLight: G2.gray[300],
|
|
178
181
|
label: DARK_GRAY[500],
|
|
179
182
|
textDisabled: DARK_GRAY[150],
|
|
180
183
|
textDark: BASE.white,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/utils/colors-values.js"],"names":["BASE","black","white","G2","blue","medium","focus","focusDark","gray","darkGray","primary","heading","mediumGray","text","lightGray","ui","secondary","tertiary","DARK_GRAY","placeholder","DARK_OPACITY","backgroundFill","DARK_OPACITY_LIGHT","LIGHT_GRAY","LIGHT_OPACITY_LIGHT","BLUE","wordpress","dark","highlight","ALERT","yellow","red","green","ADMIN","theme","themeDark10","UI","background","backgroundDisabled","border","borderHover","borderFocus","borderDisabled","borderLight","label","textDisabled","textDark","textLight","COLORS","darkOpacity","darkOpacityLight","lightGrayLight","alert","admin"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGO,MAAMA,IAAI,GAAG;AACnBC,EAAAA,KAAK,EAAE,MADY;AAEnBC,EAAAA,KAAK,EAAE;AAFY,CAAb;AAKP;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMC,EAAE,GAAG;AACjBC,EAAAA,IAAI,EAAE;AACLC,IAAAA,MAAM,EAAE;AACPC,MAAAA,KAAK,EAAE,SADA;AAEPC,MAAAA,SAAS,EAAE;AAFJ;AADH,GADW;AAOjBC,EAAAA,IAAI,EAAE;AACL,SAAK,SADA;AAEL,SAAK,SAFA;AAEW;AAChB,SAAK,SAHA;AAGW;AAChB,SAAK,MAJA;AAKL,SAAK,MALA;AAKQ;AACb,SAAK;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/utils/colors-values.js"],"names":["BASE","black","white","G2","blue","medium","focus","focusDark","gray","darkGray","primary","heading","mediumGray","text","lightGray","ui","secondary","tertiary","DARK_GRAY","placeholder","DARK_OPACITY","backgroundFill","DARK_OPACITY_LIGHT","LIGHT_GRAY","LIGHT_OPACITY_LIGHT","BLUE","wordpress","dark","highlight","ALERT","yellow","red","green","ADMIN","theme","themeDark10","UI","background","backgroundDisabled","border","borderHover","borderFocus","borderDisabled","borderLight","label","textDisabled","textDark","textLight","COLORS","darkOpacity","darkOpacityLight","lightGrayLight","alert","admin"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGO,MAAMA,IAAI,GAAG;AACnBC,EAAAA,KAAK,EAAE,MADY;AAEnBC,EAAAA,KAAK,EAAE;AAFY,CAAb;AAKP;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMC,EAAE,GAAG;AACjBC,EAAAA,IAAI,EAAE;AACLC,IAAAA,MAAM,EAAE;AACPC,MAAAA,KAAK,EAAE,SADA;AAEPC,MAAAA,SAAS,EAAE;AAFJ;AADH,GADW;AAOjBC,EAAAA,IAAI,EAAE;AACL,SAAK,SADA;AAEL,SAAK,SAFA;AAEW;AAChB,SAAK,SAHA;AAGW;AAChB,SAAK,MAJA;AAKL,SAAK,MALA;AAKQ;AACb,SAAK,SANA;AAMW;AAChB,SAAK,SAPA,CAOW;;AAPX,GAPW;AAgBjBC,EAAAA,QAAQ,EAAE;AACTC,IAAAA,OAAO,EAAE,SADA;AAETC,IAAAA,OAAO,EAAE;AAFA,GAhBO;AAoBjBC,EAAAA,UAAU,EAAE;AACXC,IAAAA,IAAI,EAAE;AADK,GApBK;AAuBjBC,EAAAA,SAAS,EAAE;AACVC,IAAAA,EAAE,EAAE,SAD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,SAAS,CAAE,GAAF,CAVN;AAWjB4B,EAAAA,QAAQ,EAAE9C,IAAI,CAACE,KAXE;AAYjB6C,EAAAA,SAAS,EAAE/C,IAAI,CAACC;AAZC,CAAX;;AAeA,MAAM+C,MAAM,GAAG,EACrB,GAAGhD,IADkB;AAErBS,EAAAA,QAAQ,EAAE,mBAAO,EAAP,EAAWS,SAAX,EAAsBf,EAAE,CAACM,QAAzB,CAFW;AAGrBwC,EAAAA,WAAW,EAAE7B,YAHQ;AAIrB8B,EAAAA,gBAAgB,EAAE5B,kBAJG;AAKrBV,EAAAA,UAAU,EAAET,EAAE,CAACS,UALM;AAMrBJ,EAAAA,IAAI,EAAEL,EAAE,CAACK,IANY;AAOrBM,EAAAA,SAAS,EAAE,mBAAO,EAAP,EAAWS,UAAX,EAAuBpB,EAAE,CAACW,SAA1B,CAPU;AAQrBqC,EAAAA,cAAc,EAAE3B,mBARK;AASrBpB,EAAAA,IAAI,EAAE,mBAAO,EAAP,EAAWqB,IAAX,EAAiBtB,EAAE,CAACC,IAApB,CATe;AAUrBgD,EAAAA,KAAK,EAAEvB,KAVc;AAWrBwB,EAAAA,KAAK,EAAEpB,KAXc;AAYrBlB,EAAAA,EAAE,EAAEqB;AAZiB,CAAf;;eAeQY,M","sourcesContent":["/**\n * External dependencies\n */\nimport { merge } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport { rgba } from './colors';\n\nexport const BASE = {\n\tblack: '#000',\n\twhite: '#fff',\n};\n\n/**\n * TODO: Continue to update values as \"G2\" design evolves.\n *\n * \"G2\" refers to the movement to advance the interface of the block editor.\n * https://github.com/WordPress/gutenberg/issues/18667\n */\nexport const G2 = {\n\tblue: {\n\t\tmedium: {\n\t\t\tfocus: '#007cba',\n\t\t\tfocusDark: '#fff',\n\t\t},\n\t},\n\tgray: {\n\t\t900: '#1e1e1e',\n\t\t700: '#757575', // Meets 4.6:1 text contrast against white.\n\t\t600: '#949494', // Meets 3:1 UI or large text contrast against white.\n\t\t400: '#ccc',\n\t\t300: '#ddd', // Used for most borders.\n\t\t200: '#e0e0e0', // Used sparingly for light borders.\n\t\t100: '#f0f0f0', // Used for light gray backgrounds.\n\t},\n\tdarkGray: {\n\t\tprimary: '#1e1e1e',\n\t\theading: '#050505',\n\t},\n\tmediumGray: {\n\t\ttext: '#757575',\n\t},\n\tlightGray: {\n\t\tui: '#949494',\n\t\tsecondary: '#ccc',\n\t\ttertiary: '#e7e8e9',\n\t},\n};\n\nexport const DARK_GRAY = {\n\t900: '#191e23',\n\t800: '#23282d',\n\t700: '#32373c',\n\t600: '#40464d',\n\t500: '#555d66', // Use this most of the time for dark items.\n\t400: '#606a73',\n\t300: '#6c7781', // Lightest gray that can be used for AA text contrast.\n\t200: '#7e8993',\n\t150: '#8d96a0', // Lightest gray that can be used for AA non-text contrast.\n\t100: '#8f98a1',\n\tplaceholder: rgba( G2.gray[ 900 ], 0.62 ),\n};\n\nexport const DARK_OPACITY = {\n\t900: rgba( '#000510', 0.9 ),\n\t800: rgba( '#00000a', 0.85 ),\n\t700: rgba( '#06060b', 0.8 ),\n\t600: rgba( '#000913', 0.75 ),\n\t500: rgba( '#0a1829', 0.7 ),\n\t400: rgba( '#0a1829', 0.65 ),\n\t300: rgba( '#0e1c2e', 0.62 ),\n\t200: rgba( '#162435', 0.55 ),\n\t100: rgba( '#223443', 0.5 ),\n\tbackgroundFill: rgba( DARK_GRAY[ 700 ], 0.7 ),\n};\n\nexport const DARK_OPACITY_LIGHT = {\n\t900: rgba( '#304455', 0.45 ),\n\t800: rgba( '#425863', 0.4 ),\n\t700: rgba( '#667886', 0.35 ),\n\t600: rgba( '#7b86a2', 0.3 ),\n\t500: rgba( '#9197a2', 0.25 ),\n\t400: rgba( '#95959c', 0.2 ),\n\t300: rgba( '#829493', 0.15 ),\n\t200: rgba( '#8b8b96', 0.1 ),\n\t100: rgba( '#747474', 0.05 ),\n};\n\nexport const LIGHT_GRAY = {\n\t900: '#a2aab2',\n\t800: '#b5bcc2',\n\t700: '#ccd0d4',\n\t600: '#d7dade',\n\t500: '#e2e4e7', // Good for \"grayed\" items and borders.\n\t400: '#e8eaeb', // Good for \"readonly\" input fields and special text selection.\n\t300: '#edeff0',\n\t200: '#f3f4f5',\n\t100: '#f8f9f9',\n\tplaceholder: rgba( BASE.white, 0.65 ),\n};\n\nexport const LIGHT_OPACITY_LIGHT = {\n\t900: rgba( BASE.white, 0.5 ),\n\t800: rgba( BASE.white, 0.45 ),\n\t700: rgba( BASE.white, 0.4 ),\n\t600: rgba( BASE.white, 0.35 ),\n\t500: rgba( BASE.white, 0.3 ),\n\t400: rgba( BASE.white, 0.25 ),\n\t300: rgba( BASE.white, 0.2 ),\n\t200: rgba( BASE.white, 0.15 ),\n\t100: rgba( BASE.white, 0.1 ),\n\tbackgroundFill: rgba( LIGHT_GRAY[ 300 ], 0.8 ),\n};\n\n// Additional colors.\n// Some are from https://make.wordpress.org/design/handbook/foundations/colors/.\n\nexport const BLUE = {\n\twordpress: {\n\t\t700: '#00669b',\n\t},\n\tdark: {\n\t\t900: '#0071a1',\n\t},\n\tmedium: {\n\t\t900: '#006589',\n\t\t800: '#00739c',\n\t\t700: '#007fac',\n\t\t600: '#008dbe',\n\t\t500: '#00a0d2',\n\t\t400: '#33b3db',\n\t\t300: '#66c6e4',\n\t\t200: '#bfe7f3',\n\t\t100: '#e5f5fa',\n\t\thighlight: '#b3e7fe',\n\t\tfocus: '#007cba',\n\t},\n};\n\nexport const ALERT = {\n\tyellow: '#f0b849',\n\tred: '#d94f4f',\n\tgreen: '#4ab866',\n};\n\nexport const ADMIN = {\n\ttheme: `var( --wp-admin-theme-color, ${ BLUE.wordpress[ 700 ] })`,\n\tthemeDark10: `var( --wp-admin-theme-color-darker-10, ${ BLUE.medium.focus })`,\n};\n\n// Namespaced values for raw colors hex codes\nexport const UI = {\n\ttheme: ADMIN.theme,\n\tbackground: BASE.white,\n\tbackgroundDisabled: LIGHT_GRAY[ 200 ],\n\tborder: G2.gray[ 700 ],\n\tborderHover: G2.gray[ 700 ],\n\tborderFocus: ADMIN.themeDark10,\n\tborderDisabled: G2.gray[ 400 ],\n\tborderLight: G2.gray[ 300 ],\n\tlabel: DARK_GRAY[ 500 ],\n\ttextDisabled: DARK_GRAY[ 150 ],\n\ttextDark: BASE.white,\n\ttextLight: BASE.black,\n};\n\nexport const COLORS = {\n\t...BASE,\n\tdarkGray: merge( {}, DARK_GRAY, G2.darkGray ),\n\tdarkOpacity: DARK_OPACITY,\n\tdarkOpacityLight: DARK_OPACITY_LIGHT,\n\tmediumGray: G2.mediumGray,\n\tgray: G2.gray,\n\tlightGray: merge( {}, LIGHT_GRAY, G2.lightGray ),\n\tlightGrayLight: LIGHT_OPACITY_LIGHT,\n\tblue: merge( {}, BLUE, G2.blue ),\n\talert: ALERT,\n\tadmin: ADMIN,\n\tui: UI,\n};\n\nexport default COLORS;\n"]}
|
|
@@ -36,9 +36,6 @@ const CONTROL_PROPS = {
|
|
|
36
36
|
const TOGGLE_GROUP_CONTROL_PROPS = {
|
|
37
37
|
toggleGroupControlBackgroundColor: CONTROL_PROPS.controlBackgroundColor,
|
|
38
38
|
toggleGroupControlBorderColor: _colorsValues.COLORS.ui.border,
|
|
39
|
-
toggleGroupControlBackdropBackgroundColor: CONTROL_PROPS.controlSurfaceColor,
|
|
40
|
-
toggleGroupControlBackdropBorderColor: _colorsValues.COLORS.ui.border,
|
|
41
|
-
toggleGroupControlBackdropBoxShadow: 'transparent',
|
|
42
39
|
toggleGroupControlButtonColorActive: CONTROL_PROPS.controlBackgroundColor
|
|
43
40
|
};
|
|
44
41
|
var _default = { ...CONTROL_PROPS,
|
|
@@ -52,7 +49,7 @@ var _default = { ...CONTROL_PROPS,
|
|
|
52
49
|
borderWidth: '1px',
|
|
53
50
|
borderWidthFocus: '1.5px',
|
|
54
51
|
borderWidthTab: '4px',
|
|
55
|
-
spinnerSize:
|
|
52
|
+
spinnerSize: 16,
|
|
56
53
|
fontSize: '13px',
|
|
57
54
|
fontSizeH1: 'calc(2.44 * 13px)',
|
|
58
55
|
fontSizeH2: 'calc(1.95 * 13px)',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/utils/config-values.js"],"names":["CONTROL_HEIGHT","CONTROL_PADDING_X","CONTROL_PROPS","controlSurfaceColor","COLORS","white","controlTextActiveColor","ui","theme","controlPaddingX","controlPaddingXLarge","controlPaddingXSmall","controlBackgroundColor","controlBorderRadius","controlBorderColor","gray","controlBoxShadow","controlBorderColorHover","controlBoxShadowFocus","admin","controlDestructiveBorderColor","alert","red","controlHeight","controlHeightXSmall","controlHeightSmall","controlHeightLarge","controlHeightXLarge","TOGGLE_GROUP_CONTROL_PROPS","toggleGroupControlBackgroundColor","toggleGroupControlBorderColor","border","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/utils/config-values.js"],"names":["CONTROL_HEIGHT","CONTROL_PADDING_X","CONTROL_PROPS","controlSurfaceColor","COLORS","white","controlTextActiveColor","ui","theme","controlPaddingX","controlPaddingXLarge","controlPaddingXSmall","controlBackgroundColor","controlBorderRadius","controlBorderColor","gray","controlBoxShadow","controlBorderColorHover","controlBoxShadowFocus","admin","controlDestructiveBorderColor","alert","red","controlHeight","controlHeightXSmall","controlHeightSmall","controlHeightLarge","controlHeightXLarge","TOGGLE_GROUP_CONTROL_PROPS","toggleGroupControlBackgroundColor","toggleGroupControlBorderColor","border","toggleGroupControlButtonColorActive","colorDivider","colorScrollbarThumb","colorScrollbarThumbHover","colorScrollbarTrack","elevationIntensity","radiusBlockUi","borderWidth","borderWidthFocus","borderWidthTab","spinnerSize","fontSize","fontSizeH1","fontSizeH2","fontSizeH3","fontSizeH4","fontSizeH5","fontSizeH6","fontSizeInputMobile","fontSizeMobile","fontSizeSmall","fontSizeXSmall","fontLineHeightBase","fontWeight","fontWeightHeading","gridBase","cardBorderRadius","cardPaddingXSmall","cardPaddingSmall","cardPaddingMedium","cardPaddingLarge","surfaceBackgroundColor","surfaceBackgroundSubtleColor","surfaceBackgroundTintColor","surfaceBorderColor","surfaceBorderBoldColor","surfaceBorderSubtleColor","surfaceBackgroundTertiaryColor","surfaceColor","transitionDuration","transitionDurationFast","transitionDurationFaster","transitionDurationFastest","transitionTimingFunction","transitionTimingFunctionControl"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,cAAc,GAAG,MAAvB;AACA,MAAMC,iBAAiB,GAAG,MAA1B;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,mBAAmB,EAAEC,qBAAOC,KADP;AAErBC,EAAAA,sBAAsB,EAAEF,qBAAOG,EAAP,CAAUC,KAFb;AAGrBC,EAAAA,eAAe,EAAER,iBAHI;AAIrBS,EAAAA,oBAAoB,EAAG,QAAQT,iBAAmB,YAJ7B;AAKrBU,EAAAA,oBAAoB,EAAG,QAAQV,iBAAmB,YAL7B;AAMrBW,EAAAA,sBAAsB,EAAER,qBAAOC,KANV;AAOrBQ,EAAAA,mBAAmB,EAAE,KAPA;AAQrBC,EAAAA,kBAAkB,EAAEV,qBAAOW,IAAP,CAAa,GAAb,CARC;AASrBC,EAAAA,gBAAgB,EAAE,aATG;AAUrBC,EAAAA,uBAAuB,EAAEb,qBAAOW,IAAP,CAAa,GAAb,CAVJ;AAWrBG,EAAAA,qBAAqB,EAAG,eAAed,qBAAOe,KAAP,CAAaX,KAAO,EAXtC;AAYrBY,EAAAA,6BAA6B,EAAEhB,qBAAOiB,KAAP,CAAaC,GAZvB;AAarBC,EAAAA,aAAa,EAAEvB,cAbM;AAcrBwB,EAAAA,mBAAmB,EAAG,SAASxB,cAAgB,UAd1B;AAerByB,EAAAA,kBAAkB,EAAG,SAASzB,cAAgB,UAfzB;AAgBrB0B,EAAAA,kBAAkB,EAAG,SAAS1B,cAAgB,UAhBzB;AAiBrB2B,EAAAA,mBAAmB,EAAG,SAAS3B,cAAgB;AAjB1B,CAAtB;AAmBA,MAAM4B,0BAA0B,GAAG;AAClCC,EAAAA,iCAAiC,EAAE3B,aAA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AiB,EAAG,GAAG,kBAAO,CAAP,CAAY,IAAI,kBAAO,CAAP,CAAY,EA/BrC;AAgCdC,EAAAA,gBAAgB,EAAG,GAAG,kBAAO,CAAP,CAAY,IAAI,kBAAO,CAAP,CAAY,EAhCpC;AAiCdC,EAAAA,sBAAsB,EAAE3D,qBAAOC,KAjCjB;AAkCd2D,EAAAA,4BAA4B,EAAE,SAlChB;AAmCdC,EAAAA,0BAA0B,EAAE,SAnCd;AAoCdC,EAAAA,kBAAkB,EAAE,oBApCN;AAqCdC,EAAAA,sBAAsB,EAAE,qBArCV;AAsCdC,EAAAA,wBAAwB,EAAE,qBAtCZ;AAuCdC,EAAAA,8BAA8B,EAAEjE,qBAAOC,KAvCzB;AAwCdiE,EAAAA,YAAY,EAAElE,qBAAOC,KAxCP;AAyCdkE,EAAAA,kBAAkB,EAAE,OAzCN;AA0CdC,EAAAA,sBAAsB,EAAE,OA1CV;AA2CdC,EAAAA,wBAAwB,EAAE,OA3CZ;AA4CdC,EAAAA,yBAAyB,EAAE,OA5Cb;AA6CdC,EAAAA,wBAAwB,EAAE,mCA7CZ;AA8CdC,EAAAA,+BAA+B,EAAE;AA9CnB,C","sourcesContent":["/**\n * Internal dependencies\n */\nimport { space } from '../ui/utils/space';\nimport { COLORS } from './colors-values';\n\nconst CONTROL_HEIGHT = '36px';\nconst CONTROL_PADDING_X = '12px';\n\nconst CONTROL_PROPS = {\n\tcontrolSurfaceColor: COLORS.white,\n\tcontrolTextActiveColor: COLORS.ui.theme,\n\tcontrolPaddingX: CONTROL_PADDING_X,\n\tcontrolPaddingXLarge: `calc(${ CONTROL_PADDING_X } * 1.3334)`,\n\tcontrolPaddingXSmall: `calc(${ CONTROL_PADDING_X } / 1.3334)`,\n\tcontrolBackgroundColor: COLORS.white,\n\tcontrolBorderRadius: '2px',\n\tcontrolBorderColor: COLORS.gray[ 700 ],\n\tcontrolBoxShadow: 'transparent',\n\tcontrolBorderColorHover: COLORS.gray[ 700 ],\n\tcontrolBoxShadowFocus: `0 0 0 0.5px ${ COLORS.admin.theme }`,\n\tcontrolDestructiveBorderColor: COLORS.alert.red,\n\tcontrolHeight: CONTROL_HEIGHT,\n\tcontrolHeightXSmall: `calc( ${ CONTROL_HEIGHT } * 0.6 )`,\n\tcontrolHeightSmall: `calc( ${ CONTROL_HEIGHT } * 0.8 )`,\n\tcontrolHeightLarge: `calc( ${ CONTROL_HEIGHT } * 1.2 )`,\n\tcontrolHeightXLarge: `calc( ${ CONTROL_HEIGHT } * 1.4 )`,\n};\nconst TOGGLE_GROUP_CONTROL_PROPS = {\n\ttoggleGroupControlBackgroundColor: CONTROL_PROPS.controlBackgroundColor,\n\ttoggleGroupControlBorderColor: COLORS.ui.border,\n\ttoggleGroupControlButtonColorActive: CONTROL_PROPS.controlBackgroundColor,\n};\n\nexport default {\n\t...CONTROL_PROPS,\n\t...TOGGLE_GROUP_CONTROL_PROPS,\n\tcolorDivider: 'rgba(0, 0, 0, 0.1)',\n\tcolorScrollbarThumb: 'rgba(0, 0, 0, 0.2)',\n\tcolorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)',\n\tcolorScrollbarTrack: 'rgba(0, 0, 0, 0.04)',\n\televationIntensity: 1,\n\tradiusBlockUi: '2px',\n\tborderWidth: '1px',\n\tborderWidthFocus: '1.5px',\n\tborderWidthTab: '4px',\n\tspinnerSize: 16,\n\tfontSize: '13px',\n\tfontSizeH1: 'calc(2.44 * 13px)',\n\tfontSizeH2: 'calc(1.95 * 13px)',\n\tfontSizeH3: 'calc(1.56 * 13px)',\n\tfontSizeH4: 'calc(1.25 * 13px)',\n\tfontSizeH5: '13px',\n\tfontSizeH6: 'calc(0.8 * 13px)',\n\tfontSizeInputMobile: '16px',\n\tfontSizeMobile: '15px',\n\tfontSizeSmall: 'calc(0.92 * 13px)',\n\tfontSizeXSmall: 'calc(0.75 * 13px)',\n\tfontLineHeightBase: '1.2',\n\tfontWeight: 'normal',\n\tfontWeightHeading: '600',\n\tgridBase: '4px',\n\tcardBorderRadius: '2px',\n\tcardPaddingXSmall: `${ space( 2 ) }`,\n\tcardPaddingSmall: `${ space( 4 ) }`,\n\tcardPaddingMedium: `${ space( 4 ) } ${ space( 6 ) }`,\n\tcardPaddingLarge: `${ space( 6 ) } ${ space( 8 ) }`,\n\tsurfaceBackgroundColor: COLORS.white,\n\tsurfaceBackgroundSubtleColor: '#F3F3F3',\n\tsurfaceBackgroundTintColor: '#F5F5F5',\n\tsurfaceBorderColor: 'rgba(0, 0, 0, 0.1)',\n\tsurfaceBorderBoldColor: 'rgba(0, 0, 0, 0.15)',\n\tsurfaceBorderSubtleColor: 'rgba(0, 0, 0, 0.05)',\n\tsurfaceBackgroundTertiaryColor: COLORS.white,\n\tsurfaceColor: COLORS.white,\n\ttransitionDuration: '200ms',\n\ttransitionDurationFast: '160ms',\n\ttransitionDurationFaster: '120ms',\n\ttransitionDurationFastest: '100ms',\n\ttransitionTimingFunction: 'cubic-bezier(0.08, 0.52, 0.52, 1)',\n\ttransitionTimingFunctionControl: 'cubic-bezier(0.12, 0.8, 0.32, 1)',\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/utils/hooks/use-combined-ref.ts"],"names":["useCombinedRef","refs","targetRef","forEach","ref","current"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/utils/hooks/use-combined-ref.ts"],"names":["useCombinedRef","refs","targetRef","forEach","ref","current"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AASO,SAASA,cAAT,GAAwE;AAAA,oCAAnBC,IAAmB;AAAnBA,IAAAA,IAAmB;AAAA;;AAC9E,QAAMC,SAAS,GAAG,qBAAQ,IAAR,CAAlB;AAEA,0BAAW,MAAM;AAChBD,IAAAA,IAAI,CAACE,OAAL,CAAgBC,GAAF,IAAW;AACxB,UAAK,CAAEA,GAAP,EAAa;;AAEb,UAAK,OAAOA,GAAP,KAAe,UAApB,EAAiC;AAChCA,QAAAA,GAAG,CAAEF,SAAS,CAACG,OAAZ,CAAH;AACA,OAFD,MAEO;AACND,QAAAA,GAAG,CAACC,OAAJ,GAAcH,SAAS,CAACG,OAAxB;AACA;AACD,KARD;AASA,GAVD,EAUG,CAAEJ,IAAF,CAVH;AAYA,SAAOC,SAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\n/**\n * External dependencies\n */\nimport type { MutableRefObject, RefCallback } from 'react';\n\ntype Ref< T > = MutableRefObject< T | null > | RefCallback< T | null >;\n\nexport function useCombinedRef< T extends HTMLElement >( ...refs: Ref< T >[] ) {\n\tconst targetRef = useRef( null );\n\n\tuseEffect( () => {\n\t\trefs.forEach( ( ref ) => {\n\t\t\tif ( ! ref ) return;\n\n\t\t\tif ( typeof ref === 'function' ) {\n\t\t\t\tref( targetRef.current );\n\t\t\t} else {\n\t\t\t\tref.current = targetRef.current;\n\t\t\t}\n\t\t} );\n\t}, [ refs ] );\n\n\treturn targetRef;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/utils/hooks/use-latest-ref.ts"],"names":["useLatestRef","value","ref","current"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/utils/hooks/use-latest-ref.ts"],"names":["useLatestRef","value","ref","current"],"mappings":";;;;;;;AAQA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,YAAT,CAA4BC,KAA5B,EAAuD;AAC7D,QAAMC,GAAG,GAAG,qBAAQD,KAAR,CAAZ;AAEA,0CAA2B,MAAM;AAChCC,IAAAA,GAAG,CAACC,OAAJ,GAAcF,KAAd;AACA,GAFD;AAIA,SAAOC,GAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport type { RefObject } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\nimport { useIsomorphicLayoutEffect } from '@wordpress/compose';\n\n/**\n * Creates a reference for a prop. This is useful for preserving dependency\n * memoization for hooks like useCallback.\n *\n * @see https://codesandbox.io/s/uselatestref-mlj3i?file=/src/App.tsx\n *\n * @param value The value to reference\n * @return The prop reference.\n */\nexport function useLatestRef< T >( value: T ): RefObject< T > {\n\tconst ref = useRef( value );\n\n\tuseIsomorphicLayoutEffect( () => {\n\t\tref.current = value;\n\t} );\n\n\treturn ref;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/z-stack/component.tsx"],"names":["ZStack","props","forwardedRef","children","className","isLayered","isReversed","offset","otherProps","validChildren","childrenLastIndex","length","clonedChildren","map","child","index","zIndex","offsetAmount","key"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/z-stack/component.tsx"],"names":["ZStack","props","forwardedRef","children","className","isLayered","isReversed","offset","otherProps","validChildren","childrenLastIndex","length","clonedChildren","map","child","index","zIndex","offsetAmount","key"],"mappings":";;;;;;;;;AAQA;;;;AAKA;;AACA;;AAEA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AA+BA,SAASA,MAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,SAFK;AAGLC,IAAAA,SAAS,GAAG,IAHP;AAILC,IAAAA,UAAU,GAAG,KAJR;AAKLC,IAAAA,MAAM,GAAG,CALJ;AAML,OAAGC;AANE,MAOF,+BAAkBP,KAAlB,EAAyB,QAAzB,CAPJ;AASA,QAAMQ,aAAa,GAAG,wCAAkBN,QAAlB,CAAtB;AACA,QAAMO,iBAAiB,GAAGD,aAAa,CAACE,MAAd,GAAuB,CAAjD;AAEA,QAAMC,cAAc,GAAGH,aAAa,CAACI,GAAd,CAAmB,CAAEC,KAAF,EAASC,KAAT,KAAoB;AAC7D,UAAMC,MAAM,GAAGV,UAAU,GAAGI,iBAAiB,GAAGK,KAAvB,GAA+BA,KAAxD;AACA,UAAME,YAAY,GAAGV,MAAM,GAAGQ,KAA9B;AAEA,UAAMG,GAAG,GAAG,6BAAgBJ,KAAhB,IAA0BA,KAAK,CAACI,GAAhC,GAAsCH,KAAlD;AAEA,WACC,4BAAC,uBAAD;AACC,MAAA,SAAS,EAAGV,SADb;AAEC,MAAA,YAAY,EAAGY,YAFhB;AAGC,MAAA,MAAM,EAAGD,MAHV;AAIC,MAAA,GAAG,EAAGE;AAJP,OAMGJ,KANH,CADD;AAUA,GAhBsB,CAAvB;AAkBA,SACC,4BAAC,kBAAD,6BACMN,UADN;AAEC,IAAA,SAAS,EAAGJ,SAFb;AAGC,IAAA,GAAG,EAAGF;AAHP,MAKGU,cALH,CADD;AASA;;eAEc,6BAAgBZ,MAAhB,EAAwB,QAAxB,C","sourcesContent":["/**\n * External dependencies\n */\nimport type { Ref, ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { isValidElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { getValidChildren } from '../ui/utils/get-valid-children';\nimport { contextConnect, useContextSystem } from '../ui/context';\nimport type { WordPressComponentProps } from '../ui/context';\nimport { ZStackView, ZStackChildView } from './styles';\n\nexport interface ZStackProps {\n\t/**\n\t * Layers children elements on top of each other (first: highest z-index, last: lowest z-index).\n\t *\n\t * @default true\n\t */\n\tisLayered?: boolean;\n\t/**\n\t * Reverse the layer ordering (first: lowest z-index, last: highest z-index).\n\t *\n\t * @default false\n\t */\n\tisReversed?: boolean;\n\t/**\n\t * The amount of offset between each child element. The amount of space between each child element. Defaults to `0`. Its value is automatically inverted (i.e. from positive to negative, and viceversa) when switching from LTR to RTL.\n\t *\n\t * @default 0\n\t */\n\toffset?: number;\n\t/**\n\t * Child elements.\n\t */\n\tchildren: ReactNode;\n}\n\nfunction ZStack(\n\tprops: WordPressComponentProps< ZStackProps, 'div' >,\n\tforwardedRef: Ref< any >\n) {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tisLayered = true,\n\t\tisReversed = false,\n\t\toffset = 0,\n\t\t...otherProps\n\t} = useContextSystem( props, 'ZStack' );\n\n\tconst validChildren = getValidChildren( children );\n\tconst childrenLastIndex = validChildren.length - 1;\n\n\tconst clonedChildren = validChildren.map( ( child, index ) => {\n\t\tconst zIndex = isReversed ? childrenLastIndex - index : index;\n\t\tconst offsetAmount = offset * index;\n\n\t\tconst key = isValidElement( child ) ? child.key : index;\n\n\t\treturn (\n\t\t\t<ZStackChildView\n\t\t\t\tisLayered={ isLayered }\n\t\t\t\toffsetAmount={ offsetAmount }\n\t\t\t\tzIndex={ zIndex }\n\t\t\t\tkey={ key }\n\t\t\t>\n\t\t\t\t{ child }\n\t\t\t</ZStackChildView>\n\t\t);\n\t} );\n\n\treturn (\n\t\t<ZStackView\n\t\t\t{ ...otherProps }\n\t\t\tclassName={ className }\n\t\t\tref={ forwardedRef }\n\t\t>\n\t\t\t{ clonedChildren }\n\t\t</ZStackView>\n\t);\n}\n\nexport default contextConnect( ZStack, 'ZStack' );\n"]}
|
|
@@ -9,7 +9,7 @@ import classnames from 'classnames';
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { VisuallyHidden } from '../visually-hidden';
|
|
12
|
-
import { Wrapper, StyledField, StyledLabel, StyledHelp } from './styles/base-control-styles';
|
|
12
|
+
import { Wrapper, StyledField, StyledLabel, StyledHelp, StyledVisualLabel } from './styles/base-control-styles';
|
|
13
13
|
/**
|
|
14
14
|
* @typedef Props
|
|
15
15
|
* @property {string} [id] The id of the element to which labels and help text are being generated.
|
|
@@ -74,9 +74,8 @@ BaseControl.VisualLabel = _ref2 => {
|
|
|
74
74
|
className,
|
|
75
75
|
children
|
|
76
76
|
} = _ref2;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
className: className
|
|
77
|
+
return createElement(StyledVisualLabel, {
|
|
78
|
+
className: classnames('components-base-control__label', className)
|
|
80
79
|
}, children);
|
|
81
80
|
};
|
|
82
81
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/base-control/index.js"],"names":["classnames","VisuallyHidden","Wrapper","StyledField","StyledLabel","StyledHelp","BaseControl","id","label","hideLabelFromVision","help","className","children","undefined","VisualLabel"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,cAAT,QAA+B,oBAA/B;AACA,SACCC,OADD,EAECC,WAFD,EAGCC,WAHD,EAICC,UAJD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/base-control/index.js"],"names":["classnames","VisuallyHidden","Wrapper","StyledField","StyledLabel","StyledHelp","StyledVisualLabel","BaseControl","id","label","hideLabelFromVision","help","className","children","undefined","VisualLabel"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,cAAT,QAA+B,oBAA/B;AACA,SACCC,OADD,EAECC,WAFD,EAGCC,WAHD,EAICC,UAJD,EAKCC,iBALD,QAMO,8BANP;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AACA,SAASC,WAAT,OAOI;AAAA,MAPkB;AACrBC,IAAAA,EADqB;AAErBC,IAAAA,KAFqB;AAGrBC,IAAAA,mBAHqB;AAIrBC,IAAAA,IAJqB;AAKrBC,IAAAA,SALqB;AAMrBC,IAAAA;AANqB,GAOlB;AACH,SACC,cAAC,OAAD;AACC,IAAA,SAAS,EAAGb,UAAU,CAAE,yBAAF,EAA6BY,SAA7B;AADvB,KAGC,cAAC,WAAD;AAAa,IAAA,SAAS,EAAC;AAAvB,KACGH,KAAK,IACND,EADC,KAECE,mBAAmB,GACpB,cAAC,cAAD;AAAgB,IAAA,EAAE,EAAC,OAAnB;AAA2B,IAAA,OAAO,EAAGF;AAArC,KACGC,KADH,CADoB,GAKpB,cAAC,WAAD;AACC,IAAA,SAAS,EAAC,gCADX;AAEC,IAAA,OAAO,EAAGD;AAFX,KAIGC,KAJH,CAPA,CADH,EAeGA,KAAK,IACN,CAAED,EADD,KAECE,mBAAmB,GACpB,cAAC,cAAD;AAAgB,IAAA,EAAE,EAAC;AAAnB,KAA6BD,KAA7B,CADoB,GAGpB,cAAC,WAAD,CAAa,WAAb,QACGA,KADH,CALA,CAfH,EAwBGI,QAxBH,CAHD,EA6BG,CAAC,CAAEF,IAAH,IACD,cAAC,UAAD;AACC,IAAA,EAAE,EAAGH,EAAE,GAAGA,EAAE,GAAG,QAAR,GAAmBM,SAD3B;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGH,IAJH,CA9BF,CADD;AAwCA;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AACAJ,WAAW,CAACQ,WAAZ,GAA0B,SAA+B;AAAA,MAA7B;AAAEH,IAAAA,SAAF;AAAaC,IAAAA;AAAb,GAA6B;AACxD,SACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAGb,UAAU,CACrB,gCADqB,EAErBY,SAFqB;AADvB,KAMGC,QANH,CADD;AAUA,CAXD;;AAaA,eAAeN,WAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport {\n\tWrapper,\n\tStyledField,\n\tStyledLabel,\n\tStyledHelp,\n\tStyledVisualLabel,\n} from './styles/base-control-styles';\n\n/**\n * @typedef Props\n * @property {string} [id] The id of the element to which labels and help text are being generated.\n * That element should be passed as a child.\n * @property {import('react').ReactNode} help If this property is added, a help text will be\n * generated using help property as the content.\n * @property {import('react').ReactNode} [label] If this property is added, a label will be generated\n * using label property as the content.\n * @property {boolean} [hideLabelFromVision] If true, the label will only be visible to screen readers.\n * @property {string} [className] The class that will be added with \"components-base-control\" to the\n * classes of the wrapper div. If no className is passed only\n * components-base-control is used.\n * @property {import('react').ReactNode} [children] The content to be displayed within\n * the BaseControl.\n */\n\n/**\n * @param {Props} props\n * @return {JSX.Element} Element\n */\nfunction BaseControl( {\n\tid,\n\tlabel,\n\thideLabelFromVision,\n\thelp,\n\tclassName,\n\tchildren,\n} ) {\n\treturn (\n\t\t<Wrapper\n\t\t\tclassName={ classnames( 'components-base-control', className ) }\n\t\t>\n\t\t\t<StyledField className=\"components-base-control__field\">\n\t\t\t\t{ label &&\n\t\t\t\t\tid &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\" htmlFor={ id }>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<StyledLabel\n\t\t\t\t\t\t\tclassName=\"components-base-control__label\"\n\t\t\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</StyledLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ label &&\n\t\t\t\t\t! id &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ children }\n\t\t\t</StyledField>\n\t\t\t{ !! help && (\n\t\t\t\t<StyledHelp\n\t\t\t\t\tid={ id ? id + '__help' : undefined }\n\t\t\t\t\tclassName=\"components-base-control__help\"\n\t\t\t\t>\n\t\t\t\t\t{ help }\n\t\t\t\t</StyledHelp>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n\n/**\n * @typedef VisualLabelProps\n * @property {string} [className] Class name\n * @property {import('react').ReactNode} [children] Children\n */\n\n/**\n * @param {VisualLabelProps} Props\n * @return {JSX.Element} Element\n */\nBaseControl.VisualLabel = ( { className, children } ) => {\n\treturn (\n\t\t<StyledVisualLabel\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-base-control__label',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledVisualLabel>\n\t);\n};\n\nexport default BaseControl;\n"]}
|