@wordpress/components 19.5.0 → 19.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -5
- package/build/alignment-matrix-control/utils.js +1 -1
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js +1 -1
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/animation/index.js +0 -6
- package/build/animation/index.js.map +1 -1
- package/build/autocomplete/get-default-use-items.js +3 -3
- package/build/autocomplete/get-default-use-items.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/icon.js +1 -1
- package/build/box-control/icon.js.map +1 -1
- package/build/box-control/index.js +4 -4
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/utils.js +12 -8
- package/build/box-control/utils.js.map +1 -1
- package/build/button/index.js +5 -5
- package/build/button/index.js.map +1 -1
- package/build/button/index.native.js +7 -7
- package/build/button/index.native.js.map +1 -1
- package/build/color-picker/color-display.js +1 -1
- package/build/color-picker/color-display.js.map +1 -1
- package/build/color-picker/styles.js +8 -8
- package/build/color-picker/styles.js.map +1 -1
- package/build/combobox-control/index.js +1 -1
- package/build/combobox-control/index.js.map +1 -1
- package/build/confirm-dialog/component.js +4 -2
- package/build/confirm-dialog/component.js.map +1 -1
- package/build/date-time/time.js +7 -4
- package/build/date-time/time.js.map +1 -1
- package/build/divider/component.js +5 -4
- package/build/divider/component.js.map +1 -1
- package/build/draggable/index.js +3 -3
- package/build/draggable/index.js.map +1 -1
- package/build/focal-point-picker/index.native.js +7 -7
- package/build/focal-point-picker/index.native.js.map +1 -1
- package/build/focal-point-picker/tooltip/index.native.js +1 -1
- package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build/font-size-picker/index.js +1 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/form-token-field/index.js +6 -6
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +2 -2
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/heading/component.js +6 -5
- package/build/heading/component.js.map +1 -1
- package/build/heading/hook.js +1 -1
- package/build/heading/hook.js.map +1 -1
- package/build/higher-order/with-notices/index.js +1 -1
- package/build/higher-order/with-notices/index.js.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/index.native.js.map +1 -1
- package/build/input-control/input-base.js +1 -1
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/input-field.js +12 -10
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +25 -25
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/isolated-event-container/index.js +1 -1
- package/build/isolated-event-container/index.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
- 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 +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +1 -1
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/index.native.js +11 -11
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/link-cell.native.js +1 -1
- package/build/mobile/bottom-sheet/link-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
- package/build/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +10 -10
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/mobile/gradient/index.native.js +2 -2
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/html-text-input/container.ios.js +3 -3
- package/build/mobile/html-text-input/container.ios.js.map +1 -1
- package/build/mobile/html-text-input/index.native.js +1 -1
- package/build/mobile/html-text-input/index.native.js.map +1 -1
- package/build/mobile/image/index.native.js +1 -1
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.android.js +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
- package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +3 -3
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-results.native.js +8 -8
- package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
- package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
- package/build/mobile/link-settings/index.native.js +1 -1
- package/build/mobile/link-settings/index.native.js.map +1 -1
- package/build/modal/aria-helper.js +1 -1
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +2 -2
- package/build/modal/index.js.map +1 -1
- package/build/navigable-container/container.js +2 -2
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigable-container/tabbable.js +1 -1
- package/build/navigable-container/tabbable.js.map +1 -1
- package/build/navigation/item/index.js +1 -1
- package/build/navigation/item/index.js.map +1 -1
- package/build/navigation/menu/index.js +1 -1
- package/build/navigation/menu/index.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +2 -2
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +1 -1
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/number-control/index.js +1 -1
- package/build/number-control/index.js.map +1 -1
- package/build/panel/body.js +2 -2
- package/build/panel/body.js.map +1 -1
- package/build/popover/index.js +3 -3
- package/build/popover/index.js.map +1 -1
- package/build/popover/utils.js +6 -6
- package/build/popover/utils.js.map +1 -1
- package/build/radio-group/index.js +1 -1
- package/build/radio-group/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/sandbox/index.js +5 -5
- package/build/sandbox/index.js.map +1 -1
- package/build/sandbox/index.native.js +1 -1
- package/build/sandbox/index.native.js.map +1 -1
- package/build/select-control/index.js +1 -1
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +5 -5
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build/slot-fill/fill.js +1 -1
- package/build/slot-fill/fill.js.map +1 -1
- package/build/slot-fill/provider.js +1 -1
- package/build/slot-fill/provider.js.map +1 -1
- package/build/snackbar/index.js +1 -1
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js +1 -1
- package/build/snackbar/list.js.map +1 -1
- package/build/style-provider/index.js +2 -2
- package/build/style-provider/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +2 -2
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option/component.js +1 -4
- 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 +12 -19
- package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
- package/build/toolbar/index.js +1 -1
- package/build/toolbar/index.js.map +1 -1
- package/build/tooltip/index.js +3 -3
- package/build/tooltip/index.js.map +1 -1
- package/build/tooltip/index.native.js +7 -7
- package/build/tooltip/index.native.js.map +1 -1
- package/build/tree-grid/index.js +4 -1
- package/build/tree-grid/index.js.map +1 -1
- package/build/truncate/utils.js +1 -1
- package/build/truncate/utils.js.map +1 -1
- package/build/ui/context/context-connect.js +8 -15
- package/build/ui/context/context-connect.js.map +1 -1
- package/build/ui/context/context-system-provider.js +2 -2
- package/build/ui/context/context-system-provider.js.map +1 -1
- package/build/ui/context/index.js.map +1 -1
- package/build/ui/utils/colors.js +2 -2
- package/build/ui/utils/colors.js.map +1 -1
- package/build/ui/utils/space.js +2 -2
- package/build/ui/utils/space.js.map +1 -1
- package/build/unit-control/index.js +38 -29
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/index.native.js +4 -2
- package/build/unit-control/index.native.js.map +1 -1
- package/build/unit-control/unit-select-control.js +1 -1
- package/build/unit-control/unit-select-control.js.map +1 -1
- package/build/unit-control/utils.js +96 -104
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/breakpoint-values.js +1 -1
- package/build/utils/breakpoint-values.js.map +1 -1
- package/build/utils/colors-values.js +1 -1
- package/build/utils/colors-values.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js +1 -1
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js +1 -1
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/animation/index.js +1 -1
- package/build-module/animation/index.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js +3 -3
- package/build-module/autocomplete/get-default-use-items.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/icon.js +1 -1
- package/build-module/box-control/icon.js.map +1 -1
- package/build-module/box-control/index.js +5 -5
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/utils.js +13 -9
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/button/index.js +5 -5
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/index.native.js +7 -7
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/color-picker/color-display.js +1 -1
- package/build-module/color-picker/color-display.js.map +1 -1
- package/build-module/color-picker/styles.js +8 -8
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +1 -1
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/confirm-dialog/component.js +4 -5
- package/build-module/confirm-dialog/component.js.map +1 -1
- package/build-module/date-time/time.js +7 -4
- package/build-module/date-time/time.js.map +1 -1
- package/build-module/divider/component.js +3 -3
- package/build-module/divider/component.js.map +1 -1
- package/build-module/draggable/index.js +3 -3
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/focal-point-picker/index.native.js +7 -7
- package/build-module/focal-point-picker/index.native.js.map +1 -1
- package/build-module/focal-point-picker/tooltip/index.native.js +1 -1
- package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build-module/font-size-picker/index.js +1 -1
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/form-token-field/index.js +6 -6
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +2 -2
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/heading/component.js +4 -4
- package/build-module/heading/component.js.map +1 -1
- package/build-module/heading/hook.js +1 -1
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/higher-order/with-notices/index.js +1 -1
- package/build-module/higher-order/with-notices/index.js.map +1 -1
- package/build-module/index.js +4 -4
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +4 -4
- package/build-module/index.native.js.map +1 -1
- package/build-module/input-control/input-base.js +1 -1
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/input-field.js +13 -10
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +25 -25
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/isolated-event-container/index.js +1 -1
- package/build-module/isolated-event-container/index.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
- 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 +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/index.native.js +11 -11
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-cell.native.js +1 -1
- package/build-module/mobile/bottom-sheet/link-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
- package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +10 -10
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js +2 -2
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/html-text-input/container.ios.js +3 -3
- package/build-module/mobile/html-text-input/container.ios.js.map +1 -1
- package/build-module/mobile/html-text-input/index.native.js +1 -1
- package/build-module/mobile/html-text-input/index.native.js.map +1 -1
- package/build-module/mobile/image/index.native.js +1 -1
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +3 -3
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js +8 -8
- package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build-module/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
- package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +1 -1
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/modal/aria-helper.js +1 -1
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +2 -2
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigable-container/container.js +2 -2
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigable-container/tabbable.js +1 -1
- package/build-module/navigable-container/tabbable.js.map +1 -1
- package/build-module/navigation/item/index.js +1 -1
- package/build-module/navigation/item/index.js.map +1 -1
- package/build-module/navigation/menu/index.js +1 -1
- package/build-module/navigation/menu/index.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +2 -2
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +1 -1
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/number-control/index.js +1 -1
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/panel/body.js +2 -2
- package/build-module/panel/body.js.map +1 -1
- package/build-module/popover/index.js +3 -3
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/utils.js +6 -6
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/radio-group/index.js +1 -1
- package/build-module/radio-group/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/sandbox/index.js +5 -5
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/index.native.js +1 -1
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/select-control/index.js +1 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +5 -5
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build-module/slot-fill/fill.js +1 -1
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/slot-fill/provider.js +1 -1
- package/build-module/slot-fill/provider.js.map +1 -1
- package/build-module/snackbar/index.js +1 -1
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +1 -1
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/style-provider/index.js +2 -2
- package/build-module/style-provider/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +2 -2
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option/component.js +1 -4
- 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 +11 -17
- package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
- package/build-module/toolbar/index.js +1 -1
- package/build-module/toolbar/index.js.map +1 -1
- package/build-module/tooltip/index.js +3 -3
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tooltip/index.native.js +7 -7
- package/build-module/tooltip/index.native.js.map +1 -1
- package/build-module/tree-grid/index.js +4 -1
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/truncate/utils.js +1 -1
- package/build-module/truncate/utils.js.map +1 -1
- package/build-module/ui/context/context-connect.js +9 -16
- package/build-module/ui/context/context-connect.js.map +1 -1
- package/build-module/ui/context/context-system-provider.js +2 -2
- package/build-module/ui/context/context-system-provider.js.map +1 -1
- package/build-module/ui/context/index.js.map +1 -1
- package/build-module/ui/utils/colors.js +2 -2
- package/build-module/ui/utils/colors.js.map +1 -1
- package/build-module/ui/utils/space.js +2 -2
- package/build-module/ui/utils/space.js.map +1 -1
- package/build-module/unit-control/index.js +39 -30
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/index.native.js +5 -3
- package/build-module/unit-control/index.native.js.map +1 -1
- package/build-module/unit-control/unit-select-control.js +1 -1
- package/build-module/unit-control/unit-select-control.js.map +1 -1
- package/build-module/unit-control/utils.js +92 -100
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/breakpoint-values.js +1 -1
- package/build-module/utils/breakpoint-values.js.map +1 -1
- package/build-module/utils/colors-values.js +1 -1
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-style/style-rtl.css +8 -0
- package/build-style/style.css +8 -0
- package/build-types/base-field/hook.d.ts +2 -1
- package/build-types/base-field/hook.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +2 -1
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/card-body/hook.d.ts +2 -1
- package/build-types/card/card-body/hook.d.ts.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +2 -2
- package/build-types/card/card-footer/hook.d.ts +2 -1
- package/build-types/card/card-footer/hook.d.ts.map +1 -1
- package/build-types/card/card-header/hook.d.ts +2 -1
- package/build-types/card/card-header/hook.d.ts.map +1 -1
- package/build-types/card/card-media/hook.d.ts +2 -1
- package/build-types/card/card-media/hook.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +2 -2
- package/build-types/confirm-dialog/component.d.ts +8 -0
- package/build-types/confirm-dialog/component.d.ts.map +1 -1
- package/build-types/confirm-dialog/types.d.ts +2 -0
- package/build-types/confirm-dialog/types.d.ts.map +1 -1
- package/build-types/divider/component.d.ts +2 -2
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/divider/stories/index.d.ts +10 -0
- package/build-types/divider/stories/index.d.ts.map +1 -0
- package/build-types/divider/types.d.ts +1 -1
- package/build-types/divider/types.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +2 -1
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/flex/flex/hook.d.ts +2 -1
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/flex-block/hook.d.ts +2 -1
- package/build-types/flex/flex-block/hook.d.ts.map +1 -1
- package/build-types/flex/flex-item/hook.d.ts +2 -1
- package/build-types/flex/flex-item/hook.d.ts.map +1 -1
- package/build-types/flyout/flyout/hook.d.ts +2 -1
- package/build-types/flyout/flyout/hook.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +2 -1
- package/build-types/grid/hook.d.ts.map +1 -1
- package/build-types/h-stack/hook.d.ts +3 -2
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/heading/component.d.ts +3 -3
- package/build-types/heading/component.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts +2 -1
- package/build-types/heading/hook.d.ts.map +1 -1
- package/build-types/heading/stories/index.d.ts +12 -0
- package/build-types/heading/stories/index.d.ts.map +1 -0
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +2 -1
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/hook.d.ts +2 -1
- package/build-types/item-group/item-group/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +2 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +2 -1
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/scrollable/hook.d.ts +2 -1
- package/build-types/scrollable/hook.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +1 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +2 -1
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +2 -1
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +2 -1
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/text/types.d.ts +1 -2
- package/build-types/text/types.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 +0 -4
- package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +2 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +2 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +2 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +2 -1
- package/build-types/truncate/hook.d.ts.map +1 -1
- package/build-types/ui/context/context-connect.d.ts +18 -16
- package/build-types/ui/context/context-connect.d.ts.map +1 -1
- package/build-types/ui/context/index.d.ts +4 -4
- package/build-types/ui/context/index.d.ts.map +1 -1
- package/build-types/ui/context/wordpress-component.d.ts +1 -0
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/ui/control-group/hook.d.ts +2 -1
- package/build-types/ui/control-group/hook.d.ts.map +1 -1
- package/build-types/ui/control-label/hook.d.ts +2 -1
- package/build-types/ui/control-label/hook.d.ts.map +1 -1
- package/build-types/ui/form-group/use-form-group.d.ts +6 -4
- package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +3 -3
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +4 -6
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/unit-control/utils.d.ts +47 -38
- package/build-types/unit-control/utils.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +2 -1
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/package.json +18 -18
- package/src/alignment-matrix-control/utils.js +1 -1
- package/src/angle-picker-control/angle-circle.js +1 -1
- package/src/animation/index.js +0 -1
- package/src/autocomplete/get-default-use-items.js +3 -3
- package/src/base-field/hook.js +1 -1
- package/src/box-control/icon.js +1 -1
- package/src/box-control/index.js +5 -5
- package/src/box-control/test/index.js +27 -7
- package/src/box-control/utils.js +13 -9
- package/src/button/index.js +5 -5
- package/src/button/index.native.js +7 -7
- package/src/button/style.scss +1 -0
- package/src/color-palette/style.scss +1 -0
- package/src/color-picker/color-display.tsx +1 -1
- package/src/color-picker/styles.ts +1 -1
- package/src/color-picker/test/index.js +1 -1
- package/src/combobox-control/index.js +1 -1
- package/src/combobox-control/style.scss +1 -0
- package/src/confirm-dialog/README.md +56 -45
- package/src/confirm-dialog/component.tsx +4 -2
- package/src/confirm-dialog/stories/index.js +19 -0
- package/src/confirm-dialog/test/index.js +28 -0
- package/src/confirm-dialog/types.ts +2 -0
- package/src/date-time/style.scss +4 -0
- package/src/date-time/time.js +16 -5
- package/src/dimension-control/test/index.test.js +1 -1
- package/src/disabled/test/index.js +1 -1
- package/src/divider/component.tsx +3 -3
- package/src/divider/stories/index.tsx +70 -0
- package/src/divider/types.ts +3 -1
- package/src/draggable/index.js +3 -3
- package/src/draggable/stories/index.js +1 -1
- package/src/flyout/flyout/README.md +1 -1
- package/src/flyout/test/index.js +1 -1
- package/src/focal-point-picker/index.native.js +7 -7
- package/src/focal-point-picker/tooltip/index.native.js +1 -1
- package/src/font-size-picker/README.md +1 -2
- package/src/font-size-picker/index.js +1 -1
- package/src/font-size-picker/stories/index.js +87 -108
- package/src/font-size-picker/test/index.js +0 -2
- package/src/form-token-field/index.js +6 -6
- package/src/form-token-field/style.scss +1 -0
- package/src/form-token-field/suggestions-list.js +2 -2
- package/src/form-token-field/test/index.js +6 -6
- package/src/heading/component.tsx +4 -4
- package/src/heading/hook.ts +1 -1
- package/src/heading/stories/index.tsx +37 -0
- package/src/higher-order/with-filters/test/index.js +1 -1
- package/src/higher-order/with-focus-outside/test/index.js +1 -1
- package/src/higher-order/with-notices/index.js +1 -1
- package/src/higher-order/with-notices/test/index.js +3 -3
- package/src/index.js +4 -4
- package/src/index.native.js +4 -4
- package/src/input-control/input-base.tsx +1 -1
- package/src/input-control/input-field.tsx +12 -9
- package/src/input-control/styles/input-control-styles.tsx +1 -0
- package/src/input-control/test/index.js +4 -4
- package/src/isolated-event-container/index.js +1 -1
- package/src/item-group/test/index.js +0 -1
- package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
- package/src/mobile/bottom-sheet/cell.native.js +1 -1
- package/src/mobile/bottom-sheet/index.native.js +11 -11
- package/src/mobile/bottom-sheet/link-cell.native.js +1 -1
- package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
- package/src/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
- package/src/mobile/global-styles-context/utils.native.js +10 -10
- package/src/mobile/gradient/index.native.js +2 -2
- package/src/mobile/html-text-input/container.ios.js +3 -3
- package/src/mobile/html-text-input/index.native.js +1 -1
- package/src/mobile/html-text-input/test/index.native.js +14 -14
- package/src/mobile/image/index.native.js +1 -1
- package/src/mobile/image/style.native.scss +1 -0
- package/src/mobile/keyboard-aware-flat-list/index.android.js +1 -1
- package/src/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
- package/src/mobile/link-picker/index.native.js +3 -3
- package/src/mobile/link-picker/link-picker-results.native.js +8 -8
- package/src/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
- package/src/mobile/link-settings/index.native.js +1 -2
- package/src/mobile/link-settings/test/edit.native.js +15 -15
- package/src/modal/aria-helper.js +1 -1
- package/src/modal/index.js +2 -2
- package/src/navigable-container/container.js +2 -2
- package/src/navigable-container/tabbable.js +1 -1
- package/src/navigable-container/test/menu.js +5 -5
- package/src/navigable-container/test/tabbable.js +2 -2
- package/src/navigation/item/index.js +1 -1
- package/src/navigation/menu/index.js +1 -1
- package/src/navigation/stories/controlled-state.js +2 -2
- package/src/navigator/navigator-provider/component.tsx +1 -1
- package/src/navigator/navigator-screen/component.tsx +2 -2
- package/src/navigator/test/index.js +18 -19
- package/src/navigator/types.ts +1 -1
- package/src/number-control/index.js +1 -1
- package/src/panel/body.js +2 -2
- package/src/popover/index.js +3 -3
- package/src/popover/utils.js +6 -6
- package/src/radio-group/index.js +1 -1
- package/src/range-control/stories/index.js +1 -1
- package/src/range-control/styles/range-control-styles.js +1 -1
- package/src/range-control/test/index.js +2 -2
- package/src/sandbox/index.js +5 -5
- package/src/sandbox/index.native.js +1 -1
- package/src/select-control/index.tsx +1 -1
- package/src/select-control/styles/select-control-styles.ts +1 -0
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/src/slot-fill/bubbles-virtually/slot.js +1 -2
- package/src/slot-fill/fill.js +1 -1
- package/src/slot-fill/provider.js +1 -1
- package/src/snackbar/index.js +1 -1
- package/src/snackbar/list.js +1 -1
- package/src/style-provider/index.js +2 -2
- package/src/tab-panel/test/index.js +1 -1
- package/src/text/test/index.js +2 -2
- package/src/text/types.ts +6 -8
- package/src/text-highlight/test/index.js +4 -4
- package/src/toggle-control/test/index.js +3 -3
- package/src/toggle-group-control/test/__snapshots__/index.js.snap +1 -27
- package/src/toggle-group-control/toggle-group-control/component.tsx +2 -2
- package/src/toggle-group-control/toggle-group-control-option/component.tsx +1 -4
- package/src/toggle-group-control/toggle-group-control-option/styles.ts +1 -12
- package/src/toolbar/index.js +1 -1
- package/src/toolbar-group/test/index.js +2 -2
- package/src/tooltip/index.js +3 -3
- package/src/tooltip/index.native.js +7 -7
- package/src/tooltip/test/index.js +2 -2
- package/src/tooltip/test/index.native.js +2 -2
- package/src/tree-grid/README.md +1 -1
- package/src/tree-grid/index.js +4 -0
- package/src/tree-grid/test/__snapshots__/index.js.snap +1 -1
- package/src/tree-grid/test/index.js +128 -52
- package/src/truncate/utils.js +1 -1
- package/src/ui/context/{context-connect.js → context-connect.ts} +27 -16
- package/src/ui/context/context-system-provider.js +2 -2
- package/src/ui/context/{index.js → index.ts} +0 -0
- package/src/ui/context/wordpress-component.ts +1 -0
- package/src/ui/tooltip/test/index.js +4 -4
- package/src/ui/utils/colors.js +2 -2
- package/src/ui/utils/space.ts +2 -2
- package/src/unit-control/README.md +1 -1
- package/src/unit-control/index.native.js +5 -3
- package/src/unit-control/index.tsx +64 -35
- package/src/unit-control/test/index.js +102 -3
- package/src/unit-control/test/utils.js +56 -15
- package/src/unit-control/types.ts +5 -8
- package/src/unit-control/unit-select-control.tsx +1 -1
- package/src/unit-control/utils.ts +128 -125
- package/src/utils/breakpoint-values.js +1 -1
- package/src/utils/colors-values.js +1 -1
- package/src/utils/hooks/test/use-controlled-state.js +1 -1
- package/src/utils/hooks/test/use-controlled-value.js +3 -3
- package/src/utils/hooks/test/use-latest-ref.js +1 -1
- package/src/utils/test/math.js +2 -2
- package/src/utils/test/rtl.js +12 -12
- package/tsconfig.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/src/divider/stories/index.js +0 -64
- package/src/heading/stories/index.js +0 -24
package/src/base-field/hook.js
CHANGED
package/src/box-control/icon.js
CHANGED
|
@@ -34,7 +34,7 @@ export default function BoxControlIcon( {
|
|
|
34
34
|
const bottom = hasSide( 'bottom' ) || hasSide( 'vertical' );
|
|
35
35
|
const left = hasSide( 'left' ) || hasSide( 'horizontal' );
|
|
36
36
|
|
|
37
|
-
// Simulates SVG Icon scaling
|
|
37
|
+
// Simulates SVG Icon scaling.
|
|
38
38
|
const scale = size / BASE_ICON_SIZE;
|
|
39
39
|
|
|
40
40
|
return (
|
package/src/box-control/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
Header,
|
|
28
28
|
HeaderControlWrapper,
|
|
29
29
|
} from './styles/box-control-styles';
|
|
30
|
-
import {
|
|
30
|
+
import { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';
|
|
31
31
|
import {
|
|
32
32
|
DEFAULT_VALUES,
|
|
33
33
|
DEFAULT_VISUALIZER_VALUES,
|
|
@@ -79,10 +79,10 @@ export default function BoxControl( {
|
|
|
79
79
|
// only values from being saved while maintaining preexisting unit selection
|
|
80
80
|
// behaviour. Filtering CSS only values prevents invalid style values.
|
|
81
81
|
const [ selectedUnits, setSelectedUnits ] = useState( {
|
|
82
|
-
top:
|
|
83
|
-
right:
|
|
84
|
-
bottom:
|
|
85
|
-
left:
|
|
82
|
+
top: parseQuantityAndUnitFromRawValue( valuesProp?.top )[ 1 ],
|
|
83
|
+
right: parseQuantityAndUnitFromRawValue( valuesProp?.right )[ 1 ],
|
|
84
|
+
bottom: parseQuantityAndUnitFromRawValue( valuesProp?.bottom )[ 1 ],
|
|
85
|
+
left: parseQuantityAndUnitFromRawValue( valuesProp?.left )[ 1 ],
|
|
86
86
|
} );
|
|
87
87
|
|
|
88
88
|
const id = useUniqueId( idProp );
|
|
@@ -99,7 +99,7 @@ describe( 'BoxControl', () => {
|
|
|
99
99
|
if ( next.top ) {
|
|
100
100
|
setState( next );
|
|
101
101
|
} else {
|
|
102
|
-
// This reverts it to being uncontrolled
|
|
102
|
+
// This reverts it to being uncontrolled.
|
|
103
103
|
setState( undefined );
|
|
104
104
|
}
|
|
105
105
|
} }
|
|
@@ -124,6 +124,26 @@ describe( 'BoxControl', () => {
|
|
|
124
124
|
expect( input.value ).toBe( '' );
|
|
125
125
|
expect( unitSelect.value ).toBe( 'px' );
|
|
126
126
|
} );
|
|
127
|
+
|
|
128
|
+
it( 'should persist cleared value when focus changes', () => {
|
|
129
|
+
render( <BoxControl /> );
|
|
130
|
+
const input = screen.getByLabelText( 'Box Control', {
|
|
131
|
+
selector: 'input',
|
|
132
|
+
} );
|
|
133
|
+
const unitSelect = screen.getByLabelText( 'Select unit' );
|
|
134
|
+
|
|
135
|
+
input.focus();
|
|
136
|
+
fireEvent.change( input, { target: { value: '100%' } } );
|
|
137
|
+
fireEvent.keyDown( input, { keyCode: ENTER } );
|
|
138
|
+
|
|
139
|
+
expect( input.value ).toBe( '100' );
|
|
140
|
+
expect( unitSelect.value ).toBe( '%' );
|
|
141
|
+
|
|
142
|
+
fireEvent.change( input, { target: { value: '' } } );
|
|
143
|
+
fireEvent.blur( input );
|
|
144
|
+
|
|
145
|
+
expect( input.value ).toBe( '' );
|
|
146
|
+
} );
|
|
127
147
|
} );
|
|
128
148
|
|
|
129
149
|
describe( 'Unlinked Sides', () => {
|
|
@@ -195,15 +215,15 @@ describe( 'BoxControl', () => {
|
|
|
195
215
|
|
|
196
216
|
describe( 'Unit selections', () => {
|
|
197
217
|
it( 'should update unlinked controls unit selection based on all input control', () => {
|
|
198
|
-
// Render control
|
|
218
|
+
// Render control.
|
|
199
219
|
render( <BoxControl /> );
|
|
200
220
|
|
|
201
|
-
// Make unit selection on all input control
|
|
221
|
+
// Make unit selection on all input control.
|
|
202
222
|
const allUnitSelect = screen.getByLabelText( 'Select unit' );
|
|
203
223
|
allUnitSelect.focus();
|
|
204
224
|
fireEvent.change( allUnitSelect, { target: { value: 'em' } } );
|
|
205
225
|
|
|
206
|
-
// Unlink the controls
|
|
226
|
+
// Unlink the controls.
|
|
207
227
|
const unlink = screen.getByLabelText( /Unlink Sides/ );
|
|
208
228
|
fireEvent.click( unlink );
|
|
209
229
|
|
|
@@ -213,15 +233,15 @@ describe( 'BoxControl', () => {
|
|
|
213
233
|
} );
|
|
214
234
|
|
|
215
235
|
it( 'should use individual side attribute unit when available', () => {
|
|
216
|
-
// Render control
|
|
236
|
+
// Render control.
|
|
217
237
|
const { rerender } = render( <BoxControl /> );
|
|
218
238
|
|
|
219
|
-
// Make unit selection on all input control
|
|
239
|
+
// Make unit selection on all input control.
|
|
220
240
|
const allUnitSelect = screen.getByLabelText( 'Select unit' );
|
|
221
241
|
allUnitSelect.focus();
|
|
222
242
|
fireEvent.change( allUnitSelect, { target: { value: 'vw' } } );
|
|
223
243
|
|
|
224
|
-
// Unlink the controls
|
|
244
|
+
// Unlink the controls.
|
|
225
245
|
const unlink = screen.getByLabelText( /Unlink Sides/ );
|
|
226
246
|
fireEvent.click( unlink );
|
|
227
247
|
|
package/src/box-control/utils.js
CHANGED
|
@@ -11,7 +11,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
14
|
+
import { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';
|
|
15
15
|
|
|
16
16
|
export const LABELS = {
|
|
17
17
|
all: __( 'All' ),
|
|
@@ -25,10 +25,10 @@ export const LABELS = {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export const DEFAULT_VALUES = {
|
|
28
|
-
top:
|
|
29
|
-
right:
|
|
30
|
-
bottom:
|
|
31
|
-
left:
|
|
28
|
+
top: undefined,
|
|
29
|
+
right: undefined,
|
|
30
|
+
bottom: undefined,
|
|
31
|
+
left: undefined,
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
export const DEFAULT_VISUALIZER_VALUES = {
|
|
@@ -67,9 +67,13 @@ function mode( arr ) {
|
|
|
67
67
|
*/
|
|
68
68
|
export function getAllValue( values = {}, availableSides = ALL_SIDES ) {
|
|
69
69
|
const sides = normalizeSides( availableSides );
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
const parsedQuantitiesAndUnits = sides.map( ( side ) =>
|
|
71
|
+
parseQuantityAndUnitFromRawValue( values[ side ] )
|
|
72
|
+
);
|
|
73
|
+
const allValues = parsedQuantitiesAndUnits.map(
|
|
74
|
+
( value ) => value[ 0 ] ?? ''
|
|
75
|
+
);
|
|
76
|
+
const allUnits = parsedQuantitiesAndUnits.map( ( value ) => value[ 1 ] );
|
|
73
77
|
|
|
74
78
|
const value = allValues.every( ( v ) => v === allValues[ 0 ] )
|
|
75
79
|
? allValues[ 0 ]
|
|
@@ -85,7 +89,7 @@ export function getAllValue( values = {}, availableSides = ALL_SIDES ) {
|
|
|
85
89
|
* isNumber() is more specific for these cases, rather than relying on a
|
|
86
90
|
* simple truthy check.
|
|
87
91
|
*/
|
|
88
|
-
const allValue = isNumber( value ) ? `${ value }${ unit }` :
|
|
92
|
+
const allValue = isNumber( value ) ? `${ value }${ unit }` : undefined;
|
|
89
93
|
|
|
90
94
|
return allValue;
|
|
91
95
|
}
|
package/src/button/index.js
CHANGED
|
@@ -133,16 +133,16 @@ export function Button( props, ref ) {
|
|
|
133
133
|
// Should show the tooltip if...
|
|
134
134
|
const shouldShowTooltip =
|
|
135
135
|
! trulyDisabled &&
|
|
136
|
-
//
|
|
136
|
+
// An explicit tooltip is passed or...
|
|
137
137
|
( ( showTooltip && label ) ||
|
|
138
|
-
//
|
|
138
|
+
// There's a shortcut or...
|
|
139
139
|
shortcut ||
|
|
140
|
-
//
|
|
140
|
+
// There's a label and...
|
|
141
141
|
( !! label &&
|
|
142
|
-
//
|
|
142
|
+
// The children are empty and...
|
|
143
143
|
( ! children ||
|
|
144
144
|
( isArray( children ) && ! children.length ) ) &&
|
|
145
|
-
//
|
|
145
|
+
// The tooltip is not explicitly disabled.
|
|
146
146
|
false !== showTooltip ) );
|
|
147
147
|
|
|
148
148
|
const descriptionId = describedBy ? instanceId : null;
|
|
@@ -55,7 +55,7 @@ const styles = StyleSheet.create( {
|
|
|
55
55
|
backgroundColor: '#2e4453',
|
|
56
56
|
},
|
|
57
57
|
subscriptInactive: {
|
|
58
|
-
color: '#7b9ab1', // $toolbar-button
|
|
58
|
+
color: '#7b9ab1', // $toolbar-button.
|
|
59
59
|
fontWeight: 'bold',
|
|
60
60
|
fontSize: 13,
|
|
61
61
|
alignSelf: 'flex-end',
|
|
@@ -63,7 +63,7 @@ const styles = StyleSheet.create( {
|
|
|
63
63
|
marginBottom,
|
|
64
64
|
},
|
|
65
65
|
subscriptInactiveDark: {
|
|
66
|
-
color: '#a7aaad', // $gray_20
|
|
66
|
+
color: '#a7aaad', // $gray_20.
|
|
67
67
|
},
|
|
68
68
|
subscriptActive: {
|
|
69
69
|
color: 'white',
|
|
@@ -144,16 +144,16 @@ export function Button( props ) {
|
|
|
144
144
|
// Should show the tooltip if...
|
|
145
145
|
const shouldShowTooltip =
|
|
146
146
|
! isDisabled &&
|
|
147
|
-
//
|
|
147
|
+
// An explicit tooltip is passed or...
|
|
148
148
|
( ( showTooltip && label ) ||
|
|
149
|
-
//
|
|
149
|
+
// There's a shortcut or...
|
|
150
150
|
shortcut ||
|
|
151
|
-
//
|
|
151
|
+
// There's a label and...
|
|
152
152
|
( !! label &&
|
|
153
|
-
//
|
|
153
|
+
// The children are empty and...
|
|
154
154
|
( ! children ||
|
|
155
155
|
( isArray( children ) && ! children.length ) ) &&
|
|
156
|
-
//
|
|
156
|
+
// The tooltip is not explicitly disabled.
|
|
157
157
|
false !== showTooltip ) );
|
|
158
158
|
|
|
159
159
|
const newIcon = icon
|
package/src/button/style.scss
CHANGED
|
@@ -50,7 +50,7 @@ const inputHeightStyle = `
|
|
|
50
50
|
height: 40px;
|
|
51
51
|
}`;
|
|
52
52
|
|
|
53
|
-
// Make the Hue circle picker not go out of the bar
|
|
53
|
+
// Make the Hue circle picker not go out of the bar.
|
|
54
54
|
const interactiveHueStyles = `
|
|
55
55
|
.react-colorful__interactive {
|
|
56
56
|
width: calc( 100% - ${ space( 2 ) } );
|
|
@@ -15,61 +15,58 @@ The dialog is confirmed by clicking the _confirm_ button or by pressing the `Ent
|
|
|
15
15
|
### Uncontrolled mode
|
|
16
16
|
|
|
17
17
|
Allows the component to be used standalone, just by declaring it as part of another React's component render method:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
|
|
19
|
+
- It will be automatically open (displayed) upon mounting;
|
|
20
|
+
- It will be automatically closed when when clicking the _cancel_ button, by pressing the `ESC` key, or by clicking outside the dialog focus (i.e, the overlay);
|
|
21
|
+
- `onCancel` is not mandatory but can be passed. Even if passed, the dialog will still be able to close itself.
|
|
21
22
|
|
|
22
23
|
Activating this mode is as simple as omitting the `isOpen` prop. The only mandatory prop, in this case, is the `onConfirm` callback. The message is passed as the `children`. You can pass any JSX you'd like, which allows to further format the message or include sub-component if you'd like:
|
|
23
24
|
|
|
24
25
|
```jsx
|
|
25
|
-
import {
|
|
26
|
-
__experimentalConfirmDialog as ConfirmDialog
|
|
27
|
-
} from '@wordpress/components';
|
|
26
|
+
import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
|
|
28
27
|
|
|
29
28
|
function Example() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
return (
|
|
30
|
+
<ConfirmDialog onConfirm={ () => console.debug( ' Confirmed! ' ) }>
|
|
31
|
+
Are you sure? <strong>This action cannot be undone!</strong>
|
|
32
|
+
</ConfirmDialog>
|
|
33
|
+
);
|
|
35
34
|
}
|
|
36
35
|
```
|
|
37
36
|
|
|
38
37
|
### Controlled mode
|
|
39
38
|
|
|
40
39
|
Let the parent component control when the dialog is open/closed. It's activated when a boolean value is passed to `isOpen`:
|
|
41
|
-
* It will not be automatically closed. You need to let it know when to open/close by updating the value of the `isOpen` prop;
|
|
42
|
-
* Both `onConfirm` and the `onCancel` callbacks are mandatory props in this mode;
|
|
43
|
-
* You'll want to update the state that controls `isOpen` by updating it from the `onCancel` and `onConfirm` callbacks.
|
|
44
40
|
|
|
41
|
+
- It will not be automatically closed. You need to let it know when to open/close by updating the value of the `isOpen` prop;
|
|
42
|
+
- Both `onConfirm` and the `onCancel` callbacks are mandatory props in this mode;
|
|
43
|
+
- You'll want to update the state that controls `isOpen` by updating it from the `onCancel` and `onConfirm` callbacks.
|
|
45
44
|
|
|
46
45
|
```jsx
|
|
47
|
-
import {
|
|
48
|
-
__experimentalConfirmDialog as ConfirmDialog
|
|
49
|
-
} from '@wordpress/components';
|
|
46
|
+
import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
|
|
50
47
|
|
|
51
48
|
function Example() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
49
|
+
const [ isOpen, setIsOpen ] = useState( true );
|
|
50
|
+
|
|
51
|
+
const handleConfirm = () => {
|
|
52
|
+
console.debug( 'Confirmed!' );
|
|
53
|
+
setIsOpen( false );
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const handleCancel = () => {
|
|
57
|
+
console.debug( 'Cancelled!' );
|
|
58
|
+
setIsOpen( false );
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<ConfirmDialog
|
|
63
|
+
isOpen={ isOpen }
|
|
64
|
+
onConfirm={ handleConfirm }
|
|
65
|
+
onCancel={ handleCancel }
|
|
66
|
+
>
|
|
67
|
+
Are you sure? <strong>This action cannot be undone!</strong>
|
|
68
|
+
</ConfirmDialog>
|
|
69
|
+
);
|
|
73
70
|
}
|
|
74
71
|
```
|
|
75
72
|
|
|
@@ -82,47 +79,61 @@ Multiple `ConfirmDialog's is an edge case that's currently not officially suppor
|
|
|
82
79
|
```ts
|
|
83
80
|
type DialogInputEvent =
|
|
84
81
|
| KeyboardEvent< HTMLDivElement >
|
|
85
|
-
| MouseEvent< HTMLButtonElement
|
|
82
|
+
| MouseEvent< HTMLButtonElement >;
|
|
86
83
|
```
|
|
87
84
|
|
|
88
85
|
## Props
|
|
89
86
|
|
|
90
87
|
### `title`: `string`
|
|
91
88
|
|
|
92
|
-
-
|
|
89
|
+
- Required: No
|
|
93
90
|
|
|
94
91
|
An optional `title` for the dialog. Setting a title will render it in a title bar at the top of the dialog, making it a bit taller. The bar will also include an `x` close button at the top-right corner.
|
|
95
92
|
|
|
96
93
|
### `children`: `React.ReactNode`
|
|
97
94
|
|
|
98
|
-
-
|
|
95
|
+
- Required: Yes
|
|
99
96
|
|
|
100
97
|
The actual message for the dialog. It's passed as children and any valid `ReactNode` is accepted:
|
|
101
98
|
|
|
102
99
|
```jsx
|
|
103
100
|
<ConfirmDialog>
|
|
104
|
-
|
|
101
|
+
Are you sure? <strong>This action cannot be undone!</strong>
|
|
105
102
|
</ConfirmDialog>
|
|
106
103
|
```
|
|
107
104
|
|
|
108
105
|
### `isOpen`: `boolean`
|
|
109
106
|
|
|
110
|
-
-
|
|
107
|
+
- Required: No
|
|
111
108
|
|
|
112
109
|
Defines if the dialog is open (displayed) or closed (not rendered/displayed). It also implicitly toggles the controlled mode if set or the uncontrolled mode if it's not set.
|
|
113
110
|
|
|
114
111
|
### `onConfirm`: `( event: DialogInputEvent ) => void`
|
|
115
112
|
|
|
116
|
-
-
|
|
113
|
+
- Required: Yes
|
|
117
114
|
|
|
118
115
|
The callback that's called when the user confirms. A confirmation can happen when the `OK` button is clicked or when `Enter` is pressed.
|
|
119
116
|
|
|
120
117
|
### `onCancel`: `( event: DialogInputEvent ) => void`
|
|
121
118
|
|
|
122
|
-
-
|
|
119
|
+
- Required: Only if `isOpen` is not set
|
|
123
120
|
|
|
124
121
|
The callback that's called when the user cancels. A cancellation can happen when the `Cancel` button is clicked, when the `ESC` key is pressed, or when a click outside of the dialog focus is detected (i.e. in the overlay).
|
|
125
122
|
|
|
126
123
|
It's not required if `isOpen` is not set (uncontrolled mode), as the component will take care of closing itself, but you can still pass a callback if something must be done upon cancelling (the component will still close itself in this case).
|
|
127
124
|
|
|
128
125
|
If `isOpen` is set (controlled mode), then it's required, and you need to set the state that defines `isOpen` to `false` as part of this callback if you want the dialog to close when the user cancels.
|
|
126
|
+
|
|
127
|
+
### `confirmButtonText`: `string`
|
|
128
|
+
|
|
129
|
+
- Required: No
|
|
130
|
+
- Default: "OK"
|
|
131
|
+
|
|
132
|
+
The optional custom text to display as the confirmation button's label
|
|
133
|
+
|
|
134
|
+
### `cancelButtonText`: `string`
|
|
135
|
+
|
|
136
|
+
- Required: No
|
|
137
|
+
- Default: "Cancel"
|
|
138
|
+
|
|
139
|
+
The optional custom text to display as the cancelation button's label
|
|
@@ -35,6 +35,8 @@ function ConfirmDialog(
|
|
|
35
35
|
onConfirm,
|
|
36
36
|
onCancel,
|
|
37
37
|
children,
|
|
38
|
+
confirmButtonText,
|
|
39
|
+
cancelButtonText,
|
|
38
40
|
...otherProps
|
|
39
41
|
} = useContextSystem( props, 'ConfirmDialog' );
|
|
40
42
|
|
|
@@ -75,8 +77,8 @@ function ConfirmDialog(
|
|
|
75
77
|
[ handleEvent, onConfirm ]
|
|
76
78
|
);
|
|
77
79
|
|
|
78
|
-
const cancelLabel = __( 'Cancel' );
|
|
79
|
-
const confirmLabel = __( 'OK' );
|
|
80
|
+
const cancelLabel = cancelButtonText ?? __( 'Cancel' );
|
|
81
|
+
const confirmLabel = confirmButtonText ?? __( 'OK' );
|
|
80
82
|
|
|
81
83
|
return (
|
|
82
84
|
<>
|
|
@@ -25,6 +25,8 @@ export default {
|
|
|
25
25
|
|
|
26
26
|
const daText = () =>
|
|
27
27
|
text( 'message', 'Would you like to privately publish the post now?' );
|
|
28
|
+
const daCancelText = () => text( 'cancel button', 'No thanks' );
|
|
29
|
+
const daConfirmText = () => text( 'confirm button', 'Yes please!' );
|
|
28
30
|
|
|
29
31
|
// Simplest usage: just declare the component with the required `onConfirm` prop.
|
|
30
32
|
export const _default = () => {
|
|
@@ -40,6 +42,23 @@ export const _default = () => {
|
|
|
40
42
|
);
|
|
41
43
|
};
|
|
42
44
|
|
|
45
|
+
export const WithCustomButtonLabels = () => {
|
|
46
|
+
const [ confirmVal, setConfirmVal ] = useState( "Hasn't confirmed yet" );
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<>
|
|
50
|
+
<ConfirmDialog
|
|
51
|
+
onConfirm={ () => setConfirmVal( 'Confirmed!' ) }
|
|
52
|
+
cancelButtonText={ daCancelText() }
|
|
53
|
+
confirmButtonText={ daConfirmText() }
|
|
54
|
+
>
|
|
55
|
+
{ daText() }
|
|
56
|
+
</ConfirmDialog>
|
|
57
|
+
<Heading level={ 1 }>{ confirmVal }</Heading>
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
43
62
|
export const WithJSXMessage = () => {
|
|
44
63
|
const [ confirmVal, setConfirmVal ] = useState( "Hasn't confirmed yet" );
|
|
45
64
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
render,
|
|
6
|
+
screen,
|
|
6
7
|
fireEvent,
|
|
7
8
|
waitForElementToBeRemoved,
|
|
8
9
|
} from '@testing-library/react';
|
|
@@ -34,6 +35,33 @@ describe( 'Confirm', () => {
|
|
|
34
35
|
expect( el ).toBeInTheDocument();
|
|
35
36
|
} );
|
|
36
37
|
} );
|
|
38
|
+
it( 'should render correctly with custom button labels', () => {
|
|
39
|
+
const cancelButtonText = 'No thanks';
|
|
40
|
+
const confirmButtonText = 'Yes please!';
|
|
41
|
+
render(
|
|
42
|
+
<ConfirmDialog
|
|
43
|
+
onConfirm={ noop }
|
|
44
|
+
onCancel={ noop }
|
|
45
|
+
cancelButtonText={ cancelButtonText }
|
|
46
|
+
confirmButtonText={ confirmButtonText }
|
|
47
|
+
>
|
|
48
|
+
Are you sure?
|
|
49
|
+
</ConfirmDialog>
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const dialog = screen.getByRole( 'dialog' );
|
|
53
|
+
const elementsTexts = [ confirmButtonText, cancelButtonText ];
|
|
54
|
+
|
|
55
|
+
expect( dialog ).toBeInTheDocument();
|
|
56
|
+
expect(
|
|
57
|
+
screen.getByText( 'Are you sure?' )
|
|
58
|
+
).toBeInTheDocument();
|
|
59
|
+
|
|
60
|
+
elementsTexts.forEach( ( txt ) => {
|
|
61
|
+
const el = screen.getByRole( 'button', { name: txt } );
|
|
62
|
+
expect( el ).toBeInTheDocument();
|
|
63
|
+
} );
|
|
64
|
+
} );
|
|
37
65
|
} );
|
|
38
66
|
|
|
39
67
|
describe( 'When uncontrolled', () => {
|
package/src/date-time/style.scss
CHANGED
|
@@ -237,6 +237,10 @@
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
.components-datetime__time-field-integer-field {
|
|
241
|
+
font-family: inherit;
|
|
242
|
+
}
|
|
243
|
+
|
|
240
244
|
.components-datetime__time-field-hours-input,
|
|
241
245
|
.components-datetime__time-field-minutes-input,
|
|
242
246
|
.components-datetime__time-field-day-input {
|
package/src/date-time/time.js
CHANGED
|
@@ -36,12 +36,19 @@ function from12hTo24h( hours, isPm ) {
|
|
|
36
36
|
* <UpdateOnBlurAsIntegerField>
|
|
37
37
|
* A shared component to parse, validate, and handle remounting of the underlying form field element like <input> and <select>.
|
|
38
38
|
*
|
|
39
|
-
* @param {Object} props
|
|
40
|
-
* @param {string} props.as
|
|
41
|
-
* @param {number|string} props.value
|
|
42
|
-
* @param {Function} props.onUpdate
|
|
39
|
+
* @param {Object} props Component props.
|
|
40
|
+
* @param {string} props.as Render the component as specific element tag, defaults to "input".
|
|
41
|
+
* @param {number|string} props.value The default value of the component which will be parsed to integer.
|
|
42
|
+
* @param {Function} props.onUpdate Call back when blurred and validated.
|
|
43
|
+
* @param {string} [props.className]
|
|
43
44
|
*/
|
|
44
|
-
function UpdateOnBlurAsIntegerField( {
|
|
45
|
+
function UpdateOnBlurAsIntegerField( {
|
|
46
|
+
as,
|
|
47
|
+
value,
|
|
48
|
+
onUpdate,
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
} ) {
|
|
45
52
|
function handleBlur( event ) {
|
|
46
53
|
const { target } = event;
|
|
47
54
|
|
|
@@ -70,6 +77,10 @@ function UpdateOnBlurAsIntegerField( { as, value, onUpdate, ...props } ) {
|
|
|
70
77
|
key: value,
|
|
71
78
|
defaultValue: value,
|
|
72
79
|
onBlur: handleBlur,
|
|
80
|
+
className: classnames(
|
|
81
|
+
'components-datetime__time-field-integer-field',
|
|
82
|
+
className
|
|
83
|
+
),
|
|
73
84
|
...props,
|
|
74
85
|
} );
|
|
75
86
|
}
|
|
@@ -132,7 +132,7 @@ describe( 'DimensionControl', () => {
|
|
|
132
132
|
.at( 0 )
|
|
133
133
|
.simulate( 'change', {
|
|
134
134
|
target: {
|
|
135
|
-
value: '', //
|
|
135
|
+
value: '', // This happens when you select the "default" <option />
|
|
136
136
|
},
|
|
137
137
|
} );
|
|
138
138
|
|
|
@@ -65,7 +65,7 @@ describe( 'Disabled', () => {
|
|
|
65
65
|
</form>
|
|
66
66
|
);
|
|
67
67
|
|
|
68
|
-
//
|
|
68
|
+
// This is needed because TestUtils does not accept a stateless component.
|
|
69
69
|
class DisabledComponent extends Component {
|
|
70
70
|
render() {
|
|
71
71
|
const { children, isDisabled } = this.props;
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import { DividerView } from './styles';
|
|
17
17
|
import type { Props } from './types';
|
|
18
18
|
|
|
19
|
-
function
|
|
19
|
+
function UnconnectedDivider(
|
|
20
20
|
props: WordPressComponentProps< Props, 'hr', false >,
|
|
21
21
|
forwardedRef: ForwardedRef< any >
|
|
22
22
|
) {
|
|
@@ -53,6 +53,6 @@ function Divider(
|
|
|
53
53
|
* }
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
|
-
const
|
|
56
|
+
export const Divider = contextConnect( UnconnectedDivider, 'Divider' );
|
|
57
57
|
|
|
58
|
-
export default
|
|
58
|
+
export default Divider;
|