@wordpress/components 19.5.0 → 19.6.1
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
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { Text } from '../../text';
|
|
10
|
+
import { Divider } from '..';
|
|
11
|
+
|
|
12
|
+
const meta: ComponentMeta< typeof Divider > = {
|
|
13
|
+
component: Divider,
|
|
14
|
+
title: 'Components (Experimental)/Divider',
|
|
15
|
+
argTypes: {
|
|
16
|
+
margin: {
|
|
17
|
+
control: { type: 'number' },
|
|
18
|
+
},
|
|
19
|
+
marginStart: {
|
|
20
|
+
control: { type: 'number' },
|
|
21
|
+
},
|
|
22
|
+
marginEnd: {
|
|
23
|
+
control: { type: 'number' },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
parameters: {
|
|
27
|
+
controls: { expanded: true },
|
|
28
|
+
docs: { source: { state: 'open' } },
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
export default meta;
|
|
32
|
+
|
|
33
|
+
const HorizontalTemplate: ComponentStory< typeof Divider > = ( args ) => (
|
|
34
|
+
<div>
|
|
35
|
+
<Text>Some text before the divider</Text>
|
|
36
|
+
<Divider { ...args } />
|
|
37
|
+
<Text>Some text after the divider</Text>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const VerticalTemplate: ComponentStory< typeof Divider > = ( args ) => {
|
|
42
|
+
const styles = {
|
|
43
|
+
display: 'flex',
|
|
44
|
+
alignItems: 'stretch',
|
|
45
|
+
justifyContent: 'start',
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div style={ styles }>
|
|
50
|
+
<Text>Some text before the divider</Text>
|
|
51
|
+
<Divider { ...args } />
|
|
52
|
+
<Text>Some text after the divider</Text>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const Horizontal: ComponentStory<
|
|
58
|
+
typeof Divider
|
|
59
|
+
> = HorizontalTemplate.bind( {} );
|
|
60
|
+
Horizontal.args = {
|
|
61
|
+
margin: 2,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const Vertical: ComponentStory< typeof Divider > = VerticalTemplate.bind(
|
|
65
|
+
{}
|
|
66
|
+
);
|
|
67
|
+
Vertical.args = {
|
|
68
|
+
...Horizontal.args,
|
|
69
|
+
orientation: 'vertical',
|
|
70
|
+
};
|
package/src/divider/types.ts
CHANGED
package/src/draggable/index.js
CHANGED
|
@@ -143,7 +143,7 @@ export default function Draggable( {
|
|
|
143
143
|
y = elementTopOffset - clonePadding;
|
|
144
144
|
cloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;
|
|
145
145
|
|
|
146
|
-
// Hack: Remove iFrames as it's causing the embeds drag clone to freeze
|
|
146
|
+
// Hack: Remove iFrames as it's causing the embeds drag clone to freeze.
|
|
147
147
|
Array.from(
|
|
148
148
|
clone.querySelectorAll( 'iframe' )
|
|
149
149
|
).forEach( ( child ) => child.parentNode.removeChild( child ) );
|
|
@@ -162,7 +162,7 @@ export default function Draggable( {
|
|
|
162
162
|
* @param {import('react').DragEvent<Element>} e
|
|
163
163
|
*/
|
|
164
164
|
function over( e ) {
|
|
165
|
-
//Skip doing any work if mouse has not moved.
|
|
165
|
+
// Skip doing any work if mouse has not moved.
|
|
166
166
|
if ( cursorLeft === e.clientX && cursorTop === e.clientY ) {
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
@@ -199,7 +199,7 @@ export default function Draggable( {
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
cleanup.current = () => {
|
|
202
|
-
// Remove drag clone
|
|
202
|
+
// Remove drag clone.
|
|
203
203
|
if ( cloneWrapper && cloneWrapper.parentNode ) {
|
|
204
204
|
cloneWrapper.parentNode.removeChild( cloneWrapper );
|
|
205
205
|
}
|
|
@@ -30,7 +30,7 @@ const Box = ( props ) => {
|
|
|
30
30
|
const DraggalbeExample = () => {
|
|
31
31
|
const [ isDragging, setDragging ] = useState( false );
|
|
32
32
|
|
|
33
|
-
// Allow for the use of ID in the example
|
|
33
|
+
// Allow for the use of ID in the example.
|
|
34
34
|
/* eslint-disable no-restricted-syntax */
|
|
35
35
|
return (
|
|
36
36
|
<div>
|
|
@@ -9,7 +9,7 @@ This feature is still experimental. “Experimental” means this is an early im
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
11
|
```jsx
|
|
12
|
-
import { Button, __experimentalFlyout as Flyout, __experimentalText as } from '@wordpress/components';
|
|
12
|
+
import { Button, __experimentalFlyout as Flyout, __experimentalText as Text } from '@wordpress/components';
|
|
13
13
|
|
|
14
14
|
function Example() {
|
|
15
15
|
return (
|
package/src/flyout/test/index.js
CHANGED
|
@@ -44,7 +44,7 @@ describe( 'props', () => {
|
|
|
44
44
|
|
|
45
45
|
const flyouts = screen.getAllByRole( 'dialog' );
|
|
46
46
|
const trigger = screen.getByText( invisibleFlyoutTriggerContent );
|
|
47
|
-
//
|
|
47
|
+
// Assert only the base flyout rendered.
|
|
48
48
|
expect( flyouts ).toHaveLength( 1 );
|
|
49
49
|
expect( flyouts[ 0 ].id ).toBe( baseFlyoutId );
|
|
50
50
|
expect( trigger ).not.toBeUndefined();
|
|
@@ -27,7 +27,7 @@ import { isVideoType } from './utils';
|
|
|
27
27
|
|
|
28
28
|
const MIN_POSITION_VALUE = 0;
|
|
29
29
|
const MAX_POSITION_VALUE = 100;
|
|
30
|
-
const FOCAL_POINT_UNITS = [ { default:
|
|
30
|
+
const FOCAL_POINT_UNITS = [ { default: 50, label: '%', value: '%' } ];
|
|
31
31
|
|
|
32
32
|
function FocalPointPicker( props ) {
|
|
33
33
|
const { focalPoint, onChange, shouldEnableBottomSheetScroll, url } = props;
|
|
@@ -53,7 +53,7 @@ function FocalPointPicker( props ) {
|
|
|
53
53
|
} );
|
|
54
54
|
}, [] );
|
|
55
55
|
|
|
56
|
-
// Animated coordinates for drag handle
|
|
56
|
+
// Animated coordinates for drag handle.
|
|
57
57
|
const pan = useRef( new Animated.ValueXY() ).current;
|
|
58
58
|
|
|
59
59
|
/**
|
|
@@ -69,7 +69,7 @@ function FocalPointPicker( props ) {
|
|
|
69
69
|
}
|
|
70
70
|
}, [ focalPoint, containerSize ] );
|
|
71
71
|
|
|
72
|
-
// Pan responder to manage drag handle interactivity
|
|
72
|
+
// Pan responder to manage drag handle interactivity.
|
|
73
73
|
const panResponder = useMemo(
|
|
74
74
|
() =>
|
|
75
75
|
PanResponder.create( {
|
|
@@ -88,17 +88,17 @@ function FocalPointPicker( props ) {
|
|
|
88
88
|
} = event.nativeEvent;
|
|
89
89
|
locationPageOffsetX = pageX - x;
|
|
90
90
|
locationPageOffsetY = pageY - y;
|
|
91
|
-
pan.setValue( { x, y } ); // Set cursor to tap location
|
|
92
|
-
pan.extractOffset(); // Set offset to current value
|
|
91
|
+
pan.setValue( { x, y } ); // Set cursor to tap location.
|
|
92
|
+
pan.extractOffset(); // Set offset to current value.
|
|
93
93
|
},
|
|
94
|
-
// Move cursor to match delta drag
|
|
94
|
+
// Move cursor to match delta drag.
|
|
95
95
|
onPanResponderMove: Animated.event(
|
|
96
96
|
[ null, { dx: pan.x, dy: pan.y } ],
|
|
97
97
|
{ useNativeDriver: false }
|
|
98
98
|
),
|
|
99
99
|
onPanResponderRelease: ( event ) => {
|
|
100
100
|
shouldEnableBottomSheetScroll( true );
|
|
101
|
-
pan.flattenOffset(); // Flatten offset into value
|
|
101
|
+
pan.flattenOffset(); // Flatten offset into value.
|
|
102
102
|
const { pageX, pageY } = event.nativeEvent;
|
|
103
103
|
// Ideally, x and y below are merely locationX and locationY from the
|
|
104
104
|
// nativeEvent. However, we are required to compute these relative
|
|
@@ -79,7 +79,7 @@ function Label( { align, text, xOffset, yOffset } ) {
|
|
|
79
79
|
} ).start();
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
// Transforms rely upon onLayout to enable custom offsets additions
|
|
82
|
+
// Transforms rely upon onLayout to enable custom offsets additions.
|
|
83
83
|
let tooltipTransforms;
|
|
84
84
|
if ( dimensions ) {
|
|
85
85
|
tooltipTransforms = [
|
|
@@ -100,8 +100,7 @@ If `true`, the UI will contain a slider, instead of a numeric text input field.
|
|
|
100
100
|
|
|
101
101
|
### withReset
|
|
102
102
|
|
|
103
|
-
If `true`, a reset button will be displayed alongside the
|
|
104
|
-
font size fields.
|
|
103
|
+
If `true`, a reset button will be displayed alongside the input field when a custom font size is active. Has no effect when `disableCustomFontSizes` or `withSlider` is `true`.
|
|
105
104
|
|
|
106
105
|
- Type: `Boolean`
|
|
107
106
|
- Required: no
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { number, object, boolean } from '@storybook/addon-knobs';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -16,14 +11,30 @@ import FontSizePicker from '../';
|
|
|
16
11
|
export default {
|
|
17
12
|
title: 'Components/FontSizePicker',
|
|
18
13
|
component: FontSizePicker,
|
|
14
|
+
argTypes: {
|
|
15
|
+
initialValue: { table: { disable: true } }, // hide prop because it's not actually part of FontSizePicker
|
|
16
|
+
fallbackFontSize: {
|
|
17
|
+
description:
|
|
18
|
+
'If no value exists, this prop defines the starting position for the font size picker slider. Only relevant if `withSlider` is `true`.',
|
|
19
|
+
},
|
|
20
|
+
withReset: {
|
|
21
|
+
description:
|
|
22
|
+
'If `true`, a reset button will be displayed alongside the input field when a custom font size is active. Has no effect when `disableCustomFontSizes` or `withSlider` is `true`.',
|
|
23
|
+
control: { type: 'boolean' },
|
|
24
|
+
table: {
|
|
25
|
+
type: 'boolean',
|
|
26
|
+
defaultValue: { summary: true },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
19
30
|
parameters: {
|
|
20
|
-
|
|
31
|
+
controls: { expanded: true },
|
|
32
|
+
docs: { source: { state: 'open' } },
|
|
21
33
|
},
|
|
22
34
|
};
|
|
23
35
|
|
|
24
36
|
const FontSizePickerWithState = ( { initialValue, ...props } ) => {
|
|
25
|
-
const [ fontSize, setFontSize ] = useState( initialValue
|
|
26
|
-
|
|
37
|
+
const [ fontSize, setFontSize ] = useState( initialValue );
|
|
27
38
|
return (
|
|
28
39
|
<FontSizePicker
|
|
29
40
|
{ ...props }
|
|
@@ -33,57 +44,25 @@ const FontSizePickerWithState = ( { initialValue, ...props } ) => {
|
|
|
33
44
|
);
|
|
34
45
|
};
|
|
35
46
|
|
|
36
|
-
|
|
37
|
-
const fontSizes = object( 'Font Sizes', [
|
|
38
|
-
{
|
|
39
|
-
name: 'Small',
|
|
40
|
-
slug: 'small',
|
|
41
|
-
size: 12,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: 'Normal',
|
|
45
|
-
slug: 'normal',
|
|
46
|
-
size: 16,
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: 'Big',
|
|
50
|
-
slug: 'big',
|
|
51
|
-
size: 26,
|
|
52
|
-
},
|
|
53
|
-
] );
|
|
54
|
-
return <FontSizePickerWithState fontSizes={ fontSizes } />;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const withSlider = () => {
|
|
58
|
-
const fontSizes = object( 'Font Sizes', [
|
|
59
|
-
{
|
|
60
|
-
name: 'Small',
|
|
61
|
-
slug: 'small',
|
|
62
|
-
size: 12,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: 'Normal',
|
|
66
|
-
slug: 'normal',
|
|
67
|
-
size: 16,
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'Big',
|
|
71
|
-
slug: 'big',
|
|
72
|
-
size: 26,
|
|
73
|
-
},
|
|
74
|
-
] );
|
|
75
|
-
const fallbackFontSize = number( 'Fallback Font Size - Slider Only', 16 );
|
|
47
|
+
const TwoFontSizePickersWithState = ( { fontSizes, ...props } ) => {
|
|
76
48
|
return (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
49
|
+
<>
|
|
50
|
+
<h2>Fewer font sizes</h2>
|
|
51
|
+
<FontSizePickerWithState
|
|
52
|
+
{ ...props }
|
|
53
|
+
fontSizes={ fontSizes.slice( 0, 4 ) }
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
<h2>More font sizes</h2>
|
|
57
|
+
<FontSizePickerWithState { ...props } fontSizes={ fontSizes } />
|
|
58
|
+
</>
|
|
82
59
|
);
|
|
83
60
|
};
|
|
84
61
|
|
|
85
|
-
export const
|
|
86
|
-
|
|
62
|
+
export const Default = FontSizePickerWithState.bind( {} );
|
|
63
|
+
Default.args = {
|
|
64
|
+
disableCustomFontSizes: false,
|
|
65
|
+
fontSizes: [
|
|
87
66
|
{
|
|
88
67
|
name: 'Small',
|
|
89
68
|
slug: 'small',
|
|
@@ -99,17 +78,36 @@ export const withoutCustomSizes = () => {
|
|
|
99
78
|
slug: 'big',
|
|
100
79
|
size: 26,
|
|
101
80
|
},
|
|
102
|
-
]
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
81
|
+
],
|
|
82
|
+
initialValue: 16,
|
|
83
|
+
withSlider: false,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const WithSlider = FontSizePickerWithState.bind( {} );
|
|
87
|
+
WithSlider.args = {
|
|
88
|
+
...Default.args,
|
|
89
|
+
fallbackFontSize: 16,
|
|
90
|
+
initialValue: undefined,
|
|
91
|
+
withSlider: true,
|
|
109
92
|
};
|
|
110
93
|
|
|
111
|
-
|
|
112
|
-
|
|
94
|
+
/**
|
|
95
|
+
* With custom font sizes disabled via the `disableCustomFontSizes` prop, the user will
|
|
96
|
+
* only be able to pick one of the predefined sizes passed in `fontSizes`.
|
|
97
|
+
*/
|
|
98
|
+
export const WithCustomSizesDisabled = FontSizePickerWithState.bind( {} );
|
|
99
|
+
WithCustomSizesDisabled.args = {
|
|
100
|
+
...Default.args,
|
|
101
|
+
disableCustomFontSizes: true,
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* When there are more than 5 font size options, the UI is no longer a toggle group.
|
|
106
|
+
*/
|
|
107
|
+
export const WithMoreFontSizes = FontSizePickerWithState.bind( {} );
|
|
108
|
+
WithMoreFontSizes.args = {
|
|
109
|
+
...Default.args,
|
|
110
|
+
fontSizes: [
|
|
113
111
|
{
|
|
114
112
|
name: 'Tiny',
|
|
115
113
|
slug: 'tiny',
|
|
@@ -140,29 +138,36 @@ export const differentControlBySize = () => {
|
|
|
140
138
|
slug: 'huge',
|
|
141
139
|
size: 36,
|
|
142
140
|
},
|
|
143
|
-
]
|
|
144
|
-
|
|
141
|
+
],
|
|
142
|
+
initialValue: 8,
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* When units like `px` are specified explicitly, it will be shown as a label hint.
|
|
147
|
+
*/
|
|
148
|
+
export const WithUnits = TwoFontSizePickersWithState.bind( {} );
|
|
149
|
+
WithUnits.args = {
|
|
150
|
+
...WithMoreFontSizes.args,
|
|
151
|
+
fontSizes: WithMoreFontSizes.args.fontSizes.map( ( option ) => ( {
|
|
145
152
|
...option,
|
|
146
153
|
size: `${ option.size }px`,
|
|
147
|
-
} ) )
|
|
148
|
-
|
|
149
|
-
const addUnitsToSizes = boolean( 'Add units to font sizes', false );
|
|
150
|
-
const _options = addUnitsToSizes ? optionsWithUnits : options;
|
|
151
|
-
const fontSizes = _options.slice(
|
|
152
|
-
0,
|
|
153
|
-
showMoreFontSizes ? _options.length : 4
|
|
154
|
-
);
|
|
155
|
-
return (
|
|
156
|
-
<FontSizePickerWithState fontSizes={ fontSizes } initialValue={ 8 } />
|
|
157
|
-
);
|
|
154
|
+
} ) ),
|
|
155
|
+
initialValue: '8px',
|
|
158
156
|
};
|
|
159
157
|
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
/**
|
|
159
|
+
* The label hint will not be shown if it is a complex CSS value. Some examples of complex CSS values
|
|
160
|
+
* in this context are CSS functions like `calc()`, `clamp()`, and `var()`.
|
|
161
|
+
*/
|
|
162
|
+
export const WithComplexCSSValues = TwoFontSizePickersWithState.bind( {} );
|
|
163
|
+
WithComplexCSSValues.args = {
|
|
164
|
+
...Default.args,
|
|
165
|
+
fontSizes: [
|
|
162
166
|
{
|
|
163
167
|
name: 'Small',
|
|
164
168
|
slug: 'small',
|
|
165
|
-
|
|
169
|
+
// Adding just one complex css value is enough
|
|
170
|
+
size: 'clamp(1.75rem, 3vw, 2.25rem)',
|
|
166
171
|
},
|
|
167
172
|
{
|
|
168
173
|
name: 'Medium',
|
|
@@ -189,32 +194,6 @@ export const withComplexCSSValues = () => {
|
|
|
189
194
|
slug: 'huge',
|
|
190
195
|
size: '2.8rem',
|
|
191
196
|
},
|
|
192
|
-
]
|
|
193
|
-
|
|
194
|
-
const addComplexCssValues = boolean(
|
|
195
|
-
'Add some complex css values(calc, var, etc..)',
|
|
196
|
-
true
|
|
197
|
-
);
|
|
198
|
-
|
|
199
|
-
const _options = options.map( ( option, index ) => {
|
|
200
|
-
const _option = { ...option };
|
|
201
|
-
// Adding just one complex css value is enough (first element);
|
|
202
|
-
if ( addComplexCssValues && ! index ) {
|
|
203
|
-
_option.size = 'clamp(1.75rem, 3vw, 2.25rem)';
|
|
204
|
-
}
|
|
205
|
-
return _option;
|
|
206
|
-
} );
|
|
207
|
-
|
|
208
|
-
const fontSizes = _options.slice(
|
|
209
|
-
0,
|
|
210
|
-
showMoreFontSizes ? _options.length : 5
|
|
211
|
-
);
|
|
212
|
-
return (
|
|
213
|
-
<div style={ { maxWidth: '248px' } }>
|
|
214
|
-
<FontSizePickerWithState
|
|
215
|
-
fontSizes={ fontSizes }
|
|
216
|
-
initialValue={ '1.125rem' }
|
|
217
|
-
/>
|
|
218
|
-
</div>
|
|
219
|
-
);
|
|
197
|
+
],
|
|
198
|
+
initialValue: '1.125rem',
|
|
220
199
|
};
|
|
@@ -203,7 +203,6 @@ describe( 'FontSizePicker', () => {
|
|
|
203
203
|
);
|
|
204
204
|
const element = screen.getByLabelText( 'Large' );
|
|
205
205
|
expect( element ).toBeInTheDocument();
|
|
206
|
-
expect( element.children ).toHaveLength( 2 );
|
|
207
206
|
expect( element.children[ 0 ].textContent ).toBe( '1.7' );
|
|
208
207
|
} );
|
|
209
208
|
it( 'should use incremental sequence of numbers as labels if we have complex css', () => {
|
|
@@ -223,7 +222,6 @@ describe( 'FontSizePicker', () => {
|
|
|
223
222
|
);
|
|
224
223
|
const element = screen.getByLabelText( 'Large' );
|
|
225
224
|
expect( element ).toBeInTheDocument();
|
|
226
|
-
expect( element.children ).toHaveLength( 2 );
|
|
227
225
|
expect( element.children[ 0 ].textContent ).toBe( '3' );
|
|
228
226
|
} );
|
|
229
227
|
} );
|
|
@@ -191,7 +191,7 @@ class FormTokenField extends Component {
|
|
|
191
191
|
onKeyPress( event ) {
|
|
192
192
|
let preventDefault = false;
|
|
193
193
|
switch ( event.charCode ) {
|
|
194
|
-
case 44: //
|
|
194
|
+
case 44: // Comma.
|
|
195
195
|
preventDefault = this.handleCommaKey();
|
|
196
196
|
break;
|
|
197
197
|
default:
|
|
@@ -294,7 +294,7 @@ class FormTokenField extends Component {
|
|
|
294
294
|
selectedSuggestionScroll: true,
|
|
295
295
|
} ) );
|
|
296
296
|
|
|
297
|
-
return true; //
|
|
297
|
+
return true; // PreventDefault.
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
handleDownArrowKey() {
|
|
@@ -311,7 +311,7 @@ class FormTokenField extends Component {
|
|
|
311
311
|
selectedSuggestionScroll: true,
|
|
312
312
|
} ) );
|
|
313
313
|
|
|
314
|
-
return true; //
|
|
314
|
+
return true; // PreventDefault.
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
handleEscapeKey( event ) {
|
|
@@ -321,7 +321,7 @@ class FormTokenField extends Component {
|
|
|
321
321
|
selectedSuggestionIndex: -1,
|
|
322
322
|
selectedSuggestionScroll: false,
|
|
323
323
|
} );
|
|
324
|
-
return true; //
|
|
324
|
+
return true; // PreventDefault.
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
handleCommaKey() {
|
|
@@ -329,7 +329,7 @@ class FormTokenField extends Component {
|
|
|
329
329
|
this.addNewToken( this.state.incompleteTokenValue );
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
return true; //
|
|
332
|
+
return true; // PreventDefault.
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
moveInputToIndex( index ) {
|
|
@@ -366,7 +366,7 @@ class FormTokenField extends Component {
|
|
|
366
366
|
|
|
367
367
|
if ( index < this.props.value.length ) {
|
|
368
368
|
this.deleteToken( this.props.value[ index ] );
|
|
369
|
-
//
|
|
369
|
+
// Update input offset since it's the offset from the last token.
|
|
370
370
|
this.moveInputToIndex( index );
|
|
371
371
|
}
|
|
372
372
|
}
|
|
@@ -14,7 +14,7 @@ import { withSafeTimeout, useRefEffect } from '@wordpress/compose';
|
|
|
14
14
|
const emptyList = Object.freeze( [] );
|
|
15
15
|
|
|
16
16
|
const handleMouseDown = ( e ) => {
|
|
17
|
-
// By preventing default here, we will not lose focus of <input> when clicking a suggestion
|
|
17
|
+
// By preventing default here, we will not lose focus of <input> when clicking a suggestion.
|
|
18
18
|
e.preventDefault();
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -34,7 +34,7 @@ function SuggestionsList( {
|
|
|
34
34
|
const listRef = useRefEffect(
|
|
35
35
|
( listNode ) => {
|
|
36
36
|
// only have to worry about scrolling selected suggestion into view
|
|
37
|
-
// when already expanded
|
|
37
|
+
// when already expanded.
|
|
38
38
|
if (
|
|
39
39
|
selectedIndex > -1 &&
|
|
40
40
|
scrollIntoView &&
|
|
@@ -75,7 +75,7 @@ describe( 'FormTokenField', () => {
|
|
|
75
75
|
|
|
76
76
|
// This suggestion is part of a partial match; return up to three
|
|
77
77
|
// sections of the suggestion (before match, match, and after
|
|
78
|
-
// match)
|
|
78
|
+
// match).
|
|
79
79
|
const div = document.createElement( 'div' );
|
|
80
80
|
div.innerHTML = node.querySelector( 'span' ).outerHTML;
|
|
81
81
|
return map(
|
|
@@ -247,21 +247,21 @@ describe( 'FormTokenField', () => {
|
|
|
247
247
|
fixtures.matchingSuggestions.th
|
|
248
248
|
);
|
|
249
249
|
expect( getSelectedSuggestion() ).toBe( null );
|
|
250
|
-
sendKeyDown( keyCodes.downArrow ); // 'the'
|
|
250
|
+
sendKeyDown( keyCodes.downArrow ); // 'the'.
|
|
251
251
|
expect( getSelectedSuggestion() ).toEqual( [ 'th', 'e' ] );
|
|
252
|
-
sendKeyDown( keyCodes.downArrow ); // 'that'
|
|
252
|
+
sendKeyDown( keyCodes.downArrow ); // 'that'.
|
|
253
253
|
expect( getSelectedSuggestion() ).toEqual( [ 'th', 'at' ] );
|
|
254
254
|
|
|
255
255
|
const hoverSuggestion = wrapperElement().querySelectorAll(
|
|
256
256
|
'.components-form-token-field__suggestion'
|
|
257
|
-
)[ 3 ]; // 'with'
|
|
257
|
+
)[ 3 ]; // 'with'.
|
|
258
258
|
expect( getSuggestionNodeText( hoverSuggestion ) ).toEqual( [
|
|
259
259
|
'wi',
|
|
260
260
|
'th',
|
|
261
261
|
] );
|
|
262
262
|
|
|
263
|
-
//
|
|
264
|
-
// SuggestionList#_scrollingIntoView to become false
|
|
263
|
+
// Before sending a hover event, we need to wait for
|
|
264
|
+
// SuggestionList#_scrollingIntoView to become false.
|
|
265
265
|
act( () => {
|
|
266
266
|
jest.advanceTimersByTime( 100 );
|
|
267
267
|
} );
|
|
@@ -10,7 +10,7 @@ import { contextConnect, WordPressComponentProps } from '../ui/context';
|
|
|
10
10
|
import { View } from '../view';
|
|
11
11
|
import { useHeading, HeadingProps } from './hook';
|
|
12
12
|
|
|
13
|
-
function
|
|
13
|
+
function UnconnectedHeading(
|
|
14
14
|
props: WordPressComponentProps< HeadingProps, 'h1' >,
|
|
15
15
|
forwardedRef: ForwardedRef< any >
|
|
16
16
|
) {
|
|
@@ -24,13 +24,13 @@ function Heading(
|
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* ```jsx
|
|
27
|
-
* import { Heading } from
|
|
27
|
+
* import { __experimentalHeading as Heading } from "@wordpress/components";
|
|
28
28
|
*
|
|
29
29
|
* function Example() {
|
|
30
30
|
* return <Heading>Code is Poetry</Heading>;
|
|
31
31
|
* }
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
const
|
|
34
|
+
export const Heading = contextConnect( UnconnectedHeading, 'Heading' );
|
|
35
35
|
|
|
36
|
-
export default
|
|
36
|
+
export default Heading;
|
package/src/heading/hook.ts
CHANGED
|
@@ -63,7 +63,7 @@ export function useHeading(
|
|
|
63
63
|
'aria-level'?: number;
|
|
64
64
|
} = {};
|
|
65
65
|
if ( typeof as === 'string' && as[ 0 ] !== 'h' ) {
|
|
66
|
-
//
|
|
66
|
+
// If not a semantic `h` element, add a11y props:
|
|
67
67
|
a11yProps.role = 'heading';
|
|
68
68
|
a11yProps[ 'aria-level' ] =
|
|
69
69
|
typeof level === 'string' ? parseInt( level ) : level;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { Heading } from '..';
|
|
10
|
+
|
|
11
|
+
const meta: ComponentMeta< typeof Heading > = {
|
|
12
|
+
component: Heading,
|
|
13
|
+
title: 'Components (Experimental)/Heading',
|
|
14
|
+
argTypes: {
|
|
15
|
+
adjustLineHeightForInnerControls: { control: { type: 'text' } },
|
|
16
|
+
as: { control: { type: 'text' } },
|
|
17
|
+
color: { control: { type: 'color' } },
|
|
18
|
+
display: { control: { type: 'text' } },
|
|
19
|
+
letterSpacing: { control: { type: 'text' } },
|
|
20
|
+
lineHeight: { control: { type: 'text' } },
|
|
21
|
+
optimizeReadabilityFor: { control: { type: 'color' } },
|
|
22
|
+
variant: { control: { type: 'radio' }, options: [ 'muted' ] },
|
|
23
|
+
weight: { control: { type: 'text' } },
|
|
24
|
+
},
|
|
25
|
+
parameters: {
|
|
26
|
+
controls: { expanded: true },
|
|
27
|
+
docs: { source: { state: 'open' } },
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export default meta;
|
|
31
|
+
|
|
32
|
+
export const Default: ComponentStory< typeof Heading > = ( props ) => (
|
|
33
|
+
<Heading { ...props } />
|
|
34
|
+
);
|
|
35
|
+
Default.args = {
|
|
36
|
+
children: 'Heading',
|
|
37
|
+
};
|