@wordpress/components 25.13.0 → 25.15.1-next.79a6196f.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 +89 -1
- package/CONTRIBUTING.md +57 -115
- package/LICENSE.md +1 -1
- package/build/base-control/index.js +17 -13
- package/build/base-control/index.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/component.js +1 -1
- package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +4 -2
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/hook.js +3 -2
- package/build/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build/border-control/border-control-style-picker/component.js +1 -1
- package/build/border-control/border-control-style-picker/component.js.map +1 -1
- package/build/border-control/styles.js +17 -17
- package/build/border-control/styles.js.map +1 -1
- package/build/box-control/index.js +1 -1
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/linked-button.js +1 -1
- package/build/box-control/linked-button.js.map +1 -1
- package/build/button/index.js +1 -1
- package/build/button/index.js.map +1 -1
- package/build/checkbox-control/index.js +1 -1
- package/build/checkbox-control/index.js.map +1 -1
- package/build/checkbox-control/types.js.map +1 -1
- package/build/color-palette/index.native.js +11 -7
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/color-copy-button.js +1 -1
- package/build/color-picker/color-copy-button.js.map +1 -1
- package/build/context/wordpress-component.js.map +1 -1
- package/build/custom-select-control-v2/index.js +11 -10
- package/build/custom-select-control-v2/index.js.map +1 -1
- package/build/date-time/date/styles.js +8 -8
- package/build/date-time/date/styles.js.map +1 -1
- package/build/date-time/time/timezone.js +11 -2
- package/build/date-time/time/timezone.js.map +1 -1
- package/build/dimension-control/index.js +2 -0
- package/build/dimension-control/index.js.map +1 -1
- package/build/dimension-control/types.js.map +1 -1
- package/build/dropdown-menu-v2/index.js +205 -159
- package/build/dropdown-menu-v2/index.js.map +1 -1
- package/build/dropdown-menu-v2/styles.js +86 -77
- package/build/dropdown-menu-v2/styles.js.map +1 -1
- package/build/dropdown-menu-v2/types.js.map +1 -1
- package/build/duotone-picker/duotone-picker.js +4 -3
- package/build/duotone-picker/duotone-picker.js.map +1 -1
- package/build/focal-point-picker/controls.js +5 -1
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/index.js +2 -0
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-picker-style.js +15 -15
- package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build/focal-point-picker/types.js.map +1 -1
- package/build/font-size-picker/font-size-picker-select.js +2 -0
- package/build/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build/font-size-picker/font-size-picker-toggle-group.js +2 -0
- package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
- package/build/font-size-picker/index.js +10 -3
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/index.native.js +6 -3
- package/build/font-size-picker/index.native.js.map +1 -1
- package/build/font-size-picker/types.js.map +1 -1
- package/build/form-token-field/index.js +10 -5
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/token.js +1 -0
- package/build/form-token-field/token.js.map +1 -1
- package/build/gradient-picker/index.js +3 -2
- package/build/gradient-picker/index.js.map +1 -1
- package/build/index.native.js +20 -19
- package/build/index.native.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +32 -29
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/input-control/types.js.map +1 -1
- package/build/lock-unlock.js +18 -0
- package/build/lock-unlock.js.map +1 -0
- package/build/mobile/bottom-sheet/index.native.js +8 -0
- package/build/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +8 -4
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +39 -13
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/mobile/image/constants.js +12 -0
- package/build/mobile/image/constants.js.map +1 -0
- package/build/mobile/image/index.native.js +26 -18
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.android.js +40 -8
- package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.ios.js +44 -68
- package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/use-scroll-to-element.native.js +39 -0
- package/build/mobile/keyboard-aware-flat-list/use-scroll-to-element.native.js.map +1 -0
- package/build/mobile/keyboard-aware-flat-list/{use-scroll-to-text-input.native.js → use-scroll-to-section.native.js} +22 -29
- package/build/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js.map +1 -0
- package/build/mobile/keyboard-aware-flat-list/use-scroll.native.js +93 -0
- package/build/mobile/keyboard-aware-flat-list/use-scroll.native.js.map +1 -0
- package/build/mobile/utils/get-px-from-css-unit.native.js +302 -0
- package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -0
- package/build/modal/index.js +18 -13
- package/build/modal/index.js.map +1 -1
- package/build/navigation/menu/menu-title.js +1 -1
- package/build/navigation/menu/menu-title.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +13 -15
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +23 -63
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/styles.js +52 -0
- package/build/navigator/styles.js.map +1 -0
- package/build/number-control/index.js +4 -8
- package/build/number-control/index.js.map +1 -1
- package/build/number-control/types.js.map +1 -1
- package/build/palette-edit/index.js +15 -34
- package/build/palette-edit/index.js.map +1 -1
- package/build/private-apis.js +11 -26
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +21 -0
- package/build/private-apis.native.js.map +1 -0
- package/build/query-controls/author-select.js +3 -1
- package/build/query-controls/author-select.js.map +1 -1
- package/build/query-controls/category-select.js +3 -1
- package/build/query-controls/category-select.js.map +1 -1
- package/build/query-controls/index.js +6 -1
- package/build/query-controls/index.js.map +1 -1
- package/build/query-controls/types.js.map +1 -1
- package/build/radio-control/index.js +1 -0
- package/build/radio-control/index.js.map +1 -1
- package/build/range-control/index.js +1 -1
- package/build/range-control/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +15 -25
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/slot-fill/index.js +3 -2
- package/build/slot-fill/index.js.map +1 -1
- package/build/slot-fill/types.js.map +1 -1
- package/build/snackbar/types.js.map +1 -1
- package/build/tabs/index.js +18 -1
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/styles.js +3 -3
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tab.js +2 -2
- package/build/tabs/tab.js.map +1 -1
- package/build/tabs/tabpanel.js +11 -8
- package/build/tabs/tabpanel.js.map +1 -1
- package/build/tabs/types.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +4 -4
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +29 -15
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/utils.js +17 -17
- package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +3 -1
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +9 -8
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +11 -11
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tools-panel/types.js.map +1 -1
- package/build/tooltip/index.js +34 -10
- package/build/tooltip/index.js.map +1 -1
- package/build/tooltip/types.js.map +1 -1
- package/build/truncate/hook.js +10 -4
- package/build/truncate/hook.js.map +1 -1
- package/build/truncate/types.js.map +1 -1
- package/build/unit-control/index.js +1 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/utils/strings.js +34 -3
- package/build/utils/strings.js.map +1 -1
- package/build-module/base-control/index.js +16 -12
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/component.js +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +4 -2
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/hook.js +3 -2
- package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build-module/border-control/border-control-style-picker/component.js +1 -1
- package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
- package/build-module/border-control/styles.js +17 -17
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/box-control/index.js +1 -1
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/linked-button.js +1 -1
- package/build-module/box-control/linked-button.js.map +1 -1
- package/build-module/button/index.js +1 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/checkbox-control/index.js +1 -1
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/checkbox-control/types.js.map +1 -1
- package/build-module/color-palette/index.native.js +11 -7
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/color-copy-button.js +1 -1
- package/build-module/color-picker/color-copy-button.js.map +1 -1
- package/build-module/context/wordpress-component.js.map +1 -1
- package/build-module/custom-select-control-v2/index.js +11 -10
- package/build-module/custom-select-control-v2/index.js.map +1 -1
- package/build-module/date-time/date/styles.js +8 -8
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/date-time/time/timezone.js +11 -2
- package/build-module/date-time/time/timezone.js.map +1 -1
- package/build-module/dimension-control/index.js +2 -0
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/dimension-control/types.js.map +1 -1
- package/build-module/dropdown-menu-v2/index.js +201 -154
- package/build-module/dropdown-menu-v2/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/styles.js +68 -61
- package/build-module/dropdown-menu-v2/styles.js.map +1 -1
- package/build-module/dropdown-menu-v2/types.js.map +1 -1
- package/build-module/duotone-picker/duotone-picker.js +4 -3
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +5 -1
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/index.js +2 -0
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js +15 -15
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build-module/focal-point-picker/types.js.map +1 -1
- package/build-module/font-size-picker/font-size-picker-select.js +2 -0
- package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
- package/build-module/font-size-picker/font-size-picker-toggle-group.js +2 -0
- package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
- package/build-module/font-size-picker/index.js +10 -3
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/index.native.js +5 -2
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/font-size-picker/types.js.map +1 -1
- package/build-module/form-token-field/index.js +10 -5
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/token.js +1 -0
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/gradient-picker/index.js +3 -2
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/index.native.js +6 -3
- package/build-module/index.native.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +31 -29
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/input-control/types.js.map +1 -1
- package/build-module/lock-unlock.js +9 -0
- package/build-module/lock-unlock.js.map +1 -0
- package/build-module/mobile/bottom-sheet/index.native.js +9 -1
- package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +8 -4
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +38 -13
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/mobile/image/constants.js +5 -0
- package/build-module/mobile/image/constants.js.map +1 -0
- package/build-module/mobile/image/index.native.js +25 -16
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js +40 -6
- 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 +46 -68
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/use-scroll-to-element.native.js +33 -0
- package/build-module/mobile/keyboard-aware-flat-list/use-scroll-to-element.native.js.map +1 -0
- package/build-module/mobile/keyboard-aware-flat-list/{use-scroll-to-text-input.native.js → use-scroll-to-section.native.js} +21 -27
- package/build-module/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js.map +1 -0
- package/build-module/mobile/keyboard-aware-flat-list/use-scroll.native.js +86 -0
- package/build-module/mobile/keyboard-aware-flat-list/use-scroll.native.js.map +1 -0
- package/build-module/mobile/utils/get-px-from-css-unit.native.js +294 -0
- package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -0
- package/build-module/modal/index.js +18 -13
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigation/menu/menu-title.js +1 -1
- package/build-module/navigation/menu/menu-title.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +3 -16
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +16 -70
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/styles.js +47 -0
- package/build-module/navigator/styles.js.map +1 -0
- package/build-module/number-control/index.js +4 -8
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/number-control/types.js.map +1 -1
- package/build-module/palette-edit/index.js +14 -33
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/private-apis.js +10 -23
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +14 -0
- package/build-module/private-apis.native.js.map +1 -0
- package/build-module/query-controls/author-select.js +3 -1
- package/build-module/query-controls/author-select.js.map +1 -1
- package/build-module/query-controls/category-select.js +3 -1
- package/build-module/query-controls/category-select.js.map +1 -1
- package/build-module/query-controls/index.js +6 -1
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/query-controls/types.js.map +1 -1
- package/build-module/radio-control/index.js +1 -0
- package/build-module/radio-control/index.js.map +1 -1
- package/build-module/range-control/index.js +1 -1
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +15 -25
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/slot-fill/index.js +3 -2
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/slot-fill/types.js.map +1 -1
- package/build-module/snackbar/types.js.map +1 -1
- package/build-module/tabs/index.js +18 -1
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/styles.js +3 -3
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tab.js +2 -2
- package/build-module/tabs/tab.js.map +1 -1
- package/build-module/tabs/tabpanel.js +11 -8
- package/build-module/tabs/tabpanel.js.map +1 -1
- package/build-module/tabs/types.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +4 -4
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +29 -15
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/utils.js +17 -17
- package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +3 -1
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +9 -8
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +11 -11
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tools-panel/types.js.map +1 -1
- package/build-module/tooltip/index.js +34 -12
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tooltip/types.js.map +1 -1
- package/build-module/truncate/hook.js +10 -4
- package/build-module/truncate/hook.js.map +1 -1
- package/build-module/truncate/types.js.map +1 -1
- package/build-module/unit-control/index.js +1 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/utils/strings.js +32 -2
- package/build-module/utils/strings.js.map +1 -1
- package/build-style/style-rtl.css +30 -6
- package/build-style/style.css +30 -6
- package/build-types/base-control/index.d.ts +3 -27
- package/build-types/base-control/index.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts +4 -1
- package/build-types/base-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +4 -4
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +6 -6
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +4 -4
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +4 -4
- package/build-types/border-box-control/stories/index.story.d.ts +1 -1
- package/build-types/border-control/border-control/hook.d.ts +4 -4
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +5 -4
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/hook.d.ts +4 -4
- package/build-types/border-control/stories/index.story.d.ts +6 -6
- package/build-types/border-control/styles.d.ts +1 -1
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts +42 -42
- package/build-types/box-control/styles/box-control-styles.d.ts +1 -1
- package/build-types/button/deprecated.d.ts +3 -3
- package/build-types/card/card/hook.d.ts +4 -4
- package/build-types/card/card-body/hook.d.ts +4 -4
- package/build-types/card/card-divider/hook.d.ts +4 -4
- package/build-types/card/card-footer/hook.d.ts +4 -4
- package/build-types/card/card-header/hook.d.ts +4 -4
- package/build-types/card/card-media/hook.d.ts +4 -4
- package/build-types/checkbox-control/index.d.ts.map +1 -1
- package/build-types/checkbox-control/types.d.ts +3 -2
- package/build-types/checkbox-control/types.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +2 -2
- package/build-types/color-picker/component.d.ts +2 -2
- package/build-types/color-picker/stories/index.story.d.ts +1 -1
- package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +3 -3
- package/build-types/composite/test/index.d.ts.map +1 -0
- package/build-types/context/wordpress-component.d.ts +3 -3
- package/build-types/context/wordpress-component.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/index.d.ts +3 -2
- package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/index.story.d.ts +4 -3
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +3 -3
- package/build-types/date-time/date-time/styles.d.ts +1 -1
- package/build-types/date-time/time/styles.d.ts +4 -4
- package/build-types/date-time/time/timezone.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts.map +1 -1
- package/build-types/dimension-control/types.d.ts +6 -0
- package/build-types/dimension-control/types.d.ts.map +1 -1
- package/build-types/dropdown/index.d.ts +1 -1
- package/build-types/dropdown/index.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.story.d.ts +3 -3
- package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu/index.d.ts +1 -1
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
- package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/index.d.ts +18 -15
- package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts +7 -2
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/styles.d.ts +77 -23
- package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/types.d.ts +89 -173
- package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
- package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +4 -4
- package/build-types/flex/flex/hook.d.ts +4 -4
- package/build-types/flex/flex-block/hook.d.ts +4 -4
- package/build-types/flex/flex-item/hook.d.ts +4 -4
- package/build-types/focal-point-picker/controls.d.ts +1 -1
- package/build-types/focal-point-picker/controls.d.ts.map +1 -1
- package/build-types/focal-point-picker/index.d.ts +1 -1
- package/build-types/focal-point-picker/index.d.ts.map +1 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts +8 -4
- package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
- package/build-types/focal-point-picker/types.d.ts +7 -0
- package/build-types/focal-point-picker/types.d.ts.map +1 -1
- package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
- package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts +1 -1
- package/build-types/font-size-picker/types.d.ts +8 -1
- package/build-types/font-size-picker/types.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/token.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +4 -4
- package/build-types/h-stack/hook.d.ts +4 -4
- package/build-types/heading/component.d.ts +1 -1
- package/build-types/heading/hook.d.ts +4 -4
- package/build-types/input-control/styles/input-control-styles.d.ts +11 -0
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +1 -1
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +4 -4
- package/build-types/item-group/item-group/hook.d.ts +4 -4
- package/build-types/lock-unlock.d.ts +3 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/build-types/menu-item/index.d.ts +1 -1
- package/build-types/menu-item/stories/index.story.d.ts +4 -4
- package/build-types/mobile/image/constants.d.ts +5 -0
- package/build-types/mobile/image/constants.d.ts.map +1 -0
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +3 -3
- package/build-types/navigator/navigator-back-button/hook.d.ts +6 -6
- package/build-types/navigator/navigator-button/hook.d.ts +6 -6
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +1 -7
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/styles.d.ts +9 -0
- package/build-types/navigator/styles.d.ts.map +1 -0
- package/build-types/number-control/index.d.ts +1 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +1 -1
- package/build-types/number-control/types.d.ts +1 -1
- package/build-types/palette-edit/index.d.ts +2 -2
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/palette-edit/styles.d.ts +3 -3
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
- package/build-types/private-apis.d.ts +0 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/query-controls/author-select.d.ts +1 -1
- package/build-types/query-controls/author-select.d.ts.map +1 -1
- package/build-types/query-controls/category-select.d.ts +1 -1
- package/build-types/query-controls/category-select.d.ts.map +1 -1
- package/build-types/query-controls/index.d.ts +1 -1
- package/build-types/query-controls/index.d.ts.map +1 -1
- package/build-types/query-controls/types.d.ts +9 -0
- package/build-types/query-controls/types.d.ts.map +1 -1
- package/build-types/radio-control/index.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
- package/build-types/resizable-box/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts +2 -2
- package/build-types/scrollable/hook.d.ts +4 -4
- package/build-types/search-control/index.d.ts +1 -1
- package/build-types/search-control/stories/index.story.d.ts +2 -2
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/slot-fill/index.d.ts +1 -1
- package/build-types/slot-fill/index.d.ts.map +1 -1
- package/build-types/slot-fill/types.d.ts +4 -0
- package/build-types/slot-fill/types.d.ts.map +1 -1
- package/build-types/snackbar/index.d.ts +2 -2
- package/build-types/snackbar/stories/index.story.d.ts +0 -3
- package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
- package/build-types/snackbar/types.d.ts +1 -1
- package/build-types/snackbar/types.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +4 -4
- package/build-types/surface/hook.d.ts +4 -4
- package/build-types/tabs/index.d.ts +2 -2
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tab.d.ts +2 -1
- package/build-types/tabs/tab.d.ts.map +1 -1
- package/build-types/tabs/tabpanel.d.ts +3 -2
- package/build-types/tabs/tabpanel.d.ts.map +1 -1
- package/build-types/tabs/types.d.ts +8 -3
- package/build-types/tabs/types.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +4 -4
- package/build-types/text-control/index.d.ts +1 -1
- package/build-types/textarea-control/index.d.ts +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/utils.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts +3 -3
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +5 -4
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +5 -4
- 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 +4 -4
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +9 -0
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tooltip/stories/index.story.d.ts +10 -1
- package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/types.d.ts +3 -0
- package/build-types/tooltip/types.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +5 -5
- package/build-types/truncate/hook.d.ts.map +1 -1
- package/build-types/truncate/types.d.ts +4 -0
- package/build-types/truncate/types.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
- package/build-types/utils/strings.d.ts +14 -2
- package/build-types/utils/strings.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +4 -4
- package/build-types/v-stack/stories/index.story.d.ts +1 -1
- package/package.json +20 -21
- package/src/alignment-matrix-control/test/index.tsx +10 -16
- package/src/base-control/index.tsx +21 -16
- package/src/border-box-control/border-box-control-linked-button/component.tsx +1 -1
- package/src/border-control/border-control-dropdown/component.tsx +3 -1
- package/src/border-control/border-control-dropdown/hook.ts +3 -2
- package/src/border-control/border-control-style-picker/component.tsx +1 -1
- package/src/border-control/styles.ts +2 -9
- package/src/box-control/index.tsx +1 -1
- package/src/box-control/linked-button.tsx +1 -1
- package/src/button/README.md +32 -6
- package/src/button/index.tsx +1 -1
- package/src/button-group/README.md +0 -6
- package/src/card/card/README.md +1 -1
- package/src/checkbox-control/README.md +3 -10
- package/src/checkbox-control/index.tsx +8 -6
- package/src/checkbox-control/test/__snapshots__/index.tsx.snap +3 -8
- package/src/checkbox-control/test/index.tsx +7 -0
- package/src/checkbox-control/types.ts +3 -2
- package/src/color-palette/index.native.js +18 -7
- package/src/color-picker/color-copy-button.tsx +1 -1
- package/src/combobox-control/README.md +0 -6
- package/src/composite/test/index.tsx +576 -0
- package/src/context/wordpress-component.ts +11 -6
- package/src/custom-select-control/README.md +0 -6
- package/src/custom-select-control/test/index.js +367 -35
- package/src/custom-select-control-v2/index.tsx +13 -12
- package/src/date-time/date/styles.ts +3 -3
- package/src/date-time/time/timezone.tsx +15 -3
- package/src/dimension-control/index.tsx +2 -0
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +2 -2
- package/src/dimension-control/types.ts +6 -0
- package/src/dropdown-menu/README.md +0 -5
- package/src/dropdown-menu-v2/README.md +75 -136
- package/src/dropdown-menu-v2/index.tsx +321 -231
- package/src/dropdown-menu-v2/stories/index.story.tsx +522 -126
- package/src/dropdown-menu-v2/styles.ts +226 -151
- package/src/dropdown-menu-v2/test/index.tsx +480 -188
- package/src/dropdown-menu-v2/types.ts +98 -184
- package/src/duotone-picker/duotone-picker.tsx +7 -3
- package/src/focal-point-picker/controls.tsx +4 -0
- package/src/focal-point-picker/index.tsx +2 -0
- package/src/focal-point-picker/styles/focal-point-picker-style.ts +1 -1
- package/src/focal-point-picker/types.ts +7 -0
- package/src/font-size-picker/font-size-picker-select.tsx +2 -0
- package/src/font-size-picker/font-size-picker-toggle-group.tsx +9 -1
- package/src/font-size-picker/index.native.js +8 -2
- package/src/font-size-picker/index.tsx +15 -5
- package/src/font-size-picker/types.ts +8 -1
- package/src/form-toggle/README.md +0 -6
- package/src/form-toggle/style.scss +4 -2
- package/src/form-token-field/index.tsx +11 -7
- package/src/form-token-field/test/index.tsx +97 -0
- package/src/form-token-field/token.tsx +1 -0
- package/src/gradient-picker/index.tsx +2 -2
- package/src/index.native.js +6 -3
- package/src/input-control/styles/input-control-styles.tsx +10 -8
- package/src/input-control/types.ts +1 -1
- package/src/lock-unlock.js +10 -0
- package/src/menu-group/README.md +0 -8
- package/src/menu-items-choice/README.md +0 -7
- package/src/mobile/bottom-sheet/index.native.js +15 -1
- package/src/mobile/color-settings/palette.screen.native.js +7 -5
- package/src/mobile/global-styles-context/test/fixtures/theme.native.js +0 -20
- package/src/mobile/global-styles-context/test/utils.native.js +22 -0
- package/src/mobile/global-styles-context/utils.native.js +42 -19
- package/src/mobile/image/constants.js +1 -0
- package/src/mobile/image/index.native.js +55 -18
- package/src/mobile/image/style.native.scss +35 -9
- package/src/mobile/keyboard-aware-flat-list/index.android.js +50 -5
- package/src/mobile/keyboard-aware-flat-list/index.ios.js +65 -91
- package/src/mobile/keyboard-aware-flat-list/test/{use-scroll-to-text-input.native.js → use-scroll-to-section.native.js} +27 -25
- package/src/mobile/keyboard-aware-flat-list/test/use-scroll.native.js +71 -0
- package/src/mobile/keyboard-aware-flat-list/use-scroll-to-element.native.js +41 -0
- package/src/mobile/keyboard-aware-flat-list/{use-scroll-to-text-input.native.js → use-scroll-to-section.native.js} +22 -27
- package/src/mobile/keyboard-aware-flat-list/use-scroll.native.js +100 -0
- package/src/mobile/link-settings/style.native.scss +0 -17
- package/src/mobile/utils/get-px-from-css-unit.native.js +329 -0
- package/src/mobile/utils/test/get-px-from-css-unit.native.js +172 -0
- package/src/modal/README.md +0 -6
- package/src/modal/index.tsx +18 -16
- package/src/modal/test/index.tsx +90 -1
- package/src/navigation/menu/menu-title.tsx +1 -1
- package/src/navigator/navigator-provider/component.tsx +3 -4
- package/src/navigator/navigator-screen/component.tsx +15 -93
- package/src/navigator/styles.ts +71 -0
- package/src/navigator/test/index.tsx +0 -64
- package/src/notice/README.md +0 -6
- package/src/number-control/README.md +2 -2
- package/src/number-control/index.tsx +4 -8
- package/src/number-control/types.ts +1 -1
- package/src/palette-edit/index.tsx +14 -43
- package/src/palette-edit/style.scss +2 -2
- package/src/panel/README.md +0 -6
- package/src/private-apis.native.js +13 -0
- package/src/private-apis.ts +12 -37
- package/src/query-controls/author-select.tsx +2 -0
- package/src/query-controls/category-select.tsx +2 -0
- package/src/query-controls/index.tsx +6 -1
- package/src/query-controls/types.ts +9 -0
- package/src/radio-control/README.md +0 -6
- package/src/radio-control/index.tsx +4 -1
- package/src/radio-control/style.scss +29 -2
- package/src/radio-group/README.md +0 -6
- package/src/range-control/README.md +1 -9
- package/src/range-control/index.tsx +1 -1
- package/src/search-control/README.md +1 -5
- package/src/select-control/README.md +0 -6
- package/src/select-control/styles/select-control-styles.ts +10 -28
- package/src/slot-fill/index.tsx +5 -2
- package/src/slot-fill/types.ts +5 -0
- package/src/snackbar/README.md +0 -6
- package/src/snackbar/stories/index.story.tsx +7 -5
- package/src/snackbar/style.scss +4 -3
- package/src/snackbar/types.ts +2 -1
- package/src/spacer/README.md +0 -2
- package/src/spinner/README.md +2 -0
- package/src/tab-panel/README.md +0 -5
- package/src/tab-panel/test/index.tsx +39 -56
- package/src/tabs/README.md +4 -4
- package/src/tabs/index.tsx +22 -1
- package/src/tabs/stories/index.story.tsx +48 -48
- package/src/tabs/styles.ts +7 -1
- package/src/tabs/tab.tsx +3 -3
- package/src/tabs/tabpanel.tsx +13 -8
- package/src/tabs/test/index.tsx +236 -106
- package/src/tabs/types.ts +8 -3
- package/src/text-control/README.md +0 -6
- package/src/textarea-control/README.md +0 -6
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +12 -16
- package/src/toggle-group-control/test/index.tsx +107 -41
- package/src/toggle-group-control/toggle-group-control/component.tsx +5 -4
- package/src/toggle-group-control/toggle-group-control/styles.ts +13 -19
- package/src/toggle-group-control/toggle-group-control/utils.ts +15 -20
- package/src/toggle-group-control/toggle-group-control-option/README.md +1 -1
- package/src/toggle-group-control/toggle-group-control-option-base/README.md +1 -1
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +3 -2
- package/src/toggle-group-control/toggle-group-control-option-icon/README.md +1 -1
- package/src/toolbar/toolbar/README.md +0 -6
- package/src/tools-panel/test/index.tsx +12 -20
- package/src/tools-panel/tools-panel/README.md +7 -0
- package/src/tools-panel/tools-panel/component.tsx +2 -0
- package/src/tools-panel/tools-panel-header/README.md +7 -0
- package/src/tools-panel/tools-panel-header/component.tsx +20 -13
- package/src/tools-panel/tools-panel-item/hook.ts +10 -21
- package/src/tools-panel/types.ts +9 -0
- package/src/tooltip/README.md +4 -0
- package/src/tooltip/index.tsx +48 -10
- package/src/tooltip/stories/index.story.tsx +18 -1
- package/src/tooltip/test/index.tsx +404 -254
- package/src/tooltip/types.ts +4 -0
- package/src/tree-grid/README.md +0 -4
- package/src/truncate/README.md +8 -0
- package/src/truncate/hook.ts +17 -10
- package/src/truncate/test/index.tsx +54 -27
- package/src/truncate/types.ts +4 -0
- package/src/unit-control/index.tsx +1 -1
- package/src/utils/strings.ts +30 -2
- package/src/utils/test/strings.js +96 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/dropdown-menu-v2-ariakit/index.js +0 -256
- package/build/dropdown-menu-v2-ariakit/index.js.map +0 -1
- package/build/dropdown-menu-v2-ariakit/styles.js +0 -180
- package/build/dropdown-menu-v2-ariakit/styles.js.map +0 -1
- package/build/dropdown-menu-v2-ariakit/types.js +0 -6
- package/build/dropdown-menu-v2-ariakit/types.js.map +0 -1
- package/build/mobile/inserter-button/index.native.js +0 -98
- package/build/mobile/inserter-button/index.native.js.map +0 -1
- package/build/mobile/inserter-button/sparkles.js +0 -23
- package/build/mobile/inserter-button/sparkles.js.map +0 -1
- package/build/mobile/keyboard-aware-flat-list/use-scroll-to-text-input.native.js.map +0 -1
- package/build/mobile/link-settings/image-link-destinations-screen.native.js +0 -119
- package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +0 -1
- package/build-module/dropdown-menu-v2-ariakit/index.js +0 -237
- package/build-module/dropdown-menu-v2-ariakit/index.js.map +0 -1
- package/build-module/dropdown-menu-v2-ariakit/styles.js +0 -165
- package/build-module/dropdown-menu-v2-ariakit/styles.js.map +0 -1
- package/build-module/dropdown-menu-v2-ariakit/types.js +0 -2
- package/build-module/dropdown-menu-v2-ariakit/types.js.map +0 -1
- package/build-module/mobile/inserter-button/index.native.js +0 -89
- package/build-module/mobile/inserter-button/index.native.js.map +0 -1
- package/build-module/mobile/inserter-button/sparkles.js +0 -15
- package/build-module/mobile/inserter-button/sparkles.js.map +0 -1
- package/build-module/mobile/keyboard-aware-flat-list/use-scroll-to-text-input.native.js.map +0 -1
- package/build-module/mobile/link-settings/image-link-destinations-screen.native.js +0 -110
- package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +0 -1
- package/build-types/dropdown-menu-v2-ariakit/index.d.ts +0 -20
- package/build-types/dropdown-menu-v2-ariakit/index.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts +0 -16
- package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2-ariakit/styles.d.ts +0 -96
- package/build-types/dropdown-menu-v2-ariakit/styles.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2-ariakit/test/index.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2-ariakit/types.d.ts +0 -168
- package/build-types/dropdown-menu-v2-ariakit/types.d.ts.map +0 -1
- package/build-types/mobile/inserter-button/sparkles.d.ts +0 -3
- package/build-types/mobile/inserter-button/sparkles.d.ts.map +0 -1
- package/src/dropdown-menu-v2-ariakit/README.md +0 -331
- package/src/dropdown-menu-v2-ariakit/index.tsx +0 -383
- package/src/dropdown-menu-v2-ariakit/stories/index.story.tsx +0 -617
- package/src/dropdown-menu-v2-ariakit/styles.ts +0 -333
- package/src/dropdown-menu-v2-ariakit/test/index.tsx +0 -1108
- package/src/dropdown-menu-v2-ariakit/types.ts +0 -179
- package/src/mobile/inserter-button/README.md +0 -62
- package/src/mobile/inserter-button/index.native.js +0 -116
- package/src/mobile/inserter-button/sparkles.js +0 -15
- package/src/mobile/inserter-button/style.native.scss +0 -72
- package/src/mobile/link-settings/image-link-destinations-screen.native.js +0 -152
- /package/build-types/{dropdown-menu-v2-ariakit → composite}/test/index.d.ts +0 -0
|
@@ -1,24 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
// eslint-disable-next-line no-restricted-imports
|
|
5
|
+
import type * as Ariakit from '@ariakit/react';
|
|
6
|
+
import type { Placement } from '@floating-ui/react-dom';
|
|
5
7
|
|
|
6
|
-
export
|
|
8
|
+
export interface DropdownMenuContext {
|
|
9
|
+
/**
|
|
10
|
+
* The ariakit store shared across all DropdownMenu subcomponents.
|
|
11
|
+
*/
|
|
12
|
+
store: Ariakit.MenuStore;
|
|
13
|
+
/**
|
|
14
|
+
* The variant used by the underlying menu popover.
|
|
15
|
+
*/
|
|
16
|
+
variant?: 'toolbar';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface DropdownMenuProps {
|
|
20
|
+
/**
|
|
21
|
+
* The trigger button.
|
|
22
|
+
*/
|
|
23
|
+
trigger: React.ReactElement;
|
|
24
|
+
/**
|
|
25
|
+
* The contents of the dropdown.
|
|
26
|
+
*/
|
|
27
|
+
children?: React.ReactNode;
|
|
7
28
|
/**
|
|
8
29
|
* The open state of the dropdown menu when it is initially rendered. Use when
|
|
9
|
-
*
|
|
30
|
+
* not wanting to control its open state.
|
|
10
31
|
*
|
|
32
|
+
* @default false
|
|
11
33
|
*/
|
|
12
|
-
defaultOpen?:
|
|
34
|
+
defaultOpen?: boolean;
|
|
13
35
|
/**
|
|
14
36
|
* The controlled open state of the dropdown menu. Must be used in conjunction
|
|
15
37
|
* with `onOpenChange`.
|
|
16
38
|
*/
|
|
17
|
-
open?:
|
|
39
|
+
open?: boolean;
|
|
18
40
|
/**
|
|
19
41
|
* Event handler called when the open state of the dropdown menu changes.
|
|
20
42
|
*/
|
|
21
|
-
onOpenChange?:
|
|
43
|
+
onOpenChange?: ( open: boolean ) => void;
|
|
22
44
|
/**
|
|
23
45
|
* The modality of the dropdown menu. When set to true, interaction with
|
|
24
46
|
* outside elements will be disabled and only menu content will be visible to
|
|
@@ -26,240 +48,132 @@ export type DropdownMenuProps = {
|
|
|
26
48
|
*
|
|
27
49
|
* @default true
|
|
28
50
|
*/
|
|
29
|
-
modal?:
|
|
51
|
+
modal?: boolean;
|
|
30
52
|
/**
|
|
31
|
-
* The
|
|
32
|
-
* Will be reversed when collisions occur and avoidCollisions is enabled.
|
|
53
|
+
* The placement of the dropdown menu popover.
|
|
33
54
|
*
|
|
34
|
-
* @default 'bottom'
|
|
55
|
+
* @default 'bottom-start' for root-level menus, 'right-start' for nested menus
|
|
35
56
|
*/
|
|
36
|
-
|
|
57
|
+
placement?: Placement;
|
|
37
58
|
/**
|
|
38
|
-
* The distance
|
|
59
|
+
* The distance between the popover and the anchor element.
|
|
39
60
|
*
|
|
40
|
-
* @default
|
|
61
|
+
* @default 8 for root-level menus, 16 for nested menus
|
|
41
62
|
*/
|
|
42
|
-
|
|
63
|
+
gutter?: number;
|
|
43
64
|
/**
|
|
44
|
-
* The
|
|
45
|
-
*
|
|
65
|
+
* The skidding of the popover along the anchor element. Can be set to
|
|
66
|
+
* negative values to make the popover shift to the opposite side.
|
|
46
67
|
*
|
|
47
|
-
* @default
|
|
68
|
+
* @default 0 for root-level menus, -8 for nested menus
|
|
48
69
|
*/
|
|
49
|
-
|
|
70
|
+
shift?: number;
|
|
50
71
|
/**
|
|
51
|
-
*
|
|
72
|
+
* Determines whether the menu popover will be hidden when the user presses
|
|
73
|
+
* the Escape key.
|
|
52
74
|
*
|
|
53
|
-
* @default
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
75
|
+
* @default `( event ) => { event.preventDefault(); return true; }`
|
|
76
|
+
*/
|
|
77
|
+
hideOnEscape?:
|
|
78
|
+
| boolean
|
|
79
|
+
| ( (
|
|
80
|
+
event: KeyboardEvent | React.KeyboardEvent< Element >
|
|
81
|
+
) => boolean );
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface DropdownMenuGroupProps {
|
|
60
85
|
/**
|
|
61
|
-
* The contents of the dropdown
|
|
86
|
+
* The contents of the dropdown menu group.
|
|
62
87
|
*/
|
|
63
88
|
children: React.ReactNode;
|
|
64
|
-
}
|
|
89
|
+
}
|
|
65
90
|
|
|
66
|
-
export
|
|
91
|
+
export interface DropdownMenuItemProps {
|
|
67
92
|
/**
|
|
68
|
-
* The contents of the item.
|
|
93
|
+
* The contents of the menu item.
|
|
69
94
|
*/
|
|
70
95
|
children: React.ReactNode;
|
|
71
96
|
/**
|
|
72
|
-
* The contents of the item's prefix.
|
|
97
|
+
* The contents of the menu item's prefix.
|
|
73
98
|
*/
|
|
74
99
|
prefix?: React.ReactNode;
|
|
75
100
|
/**
|
|
76
|
-
* The contents of the item's suffix.
|
|
77
|
-
*
|
|
78
|
-
* @default The standard chevron icon for a submenu trigger.
|
|
101
|
+
* The contents of the menu item's suffix.
|
|
79
102
|
*/
|
|
80
103
|
suffix?: React.ReactNode;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export type DropdownSubMenuProps = {
|
|
84
104
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
|
|
88
|
-
defaultOpen?: DropdownMenuPrimitive.DropdownMenuSubProps[ 'defaultOpen' ];
|
|
89
|
-
/**
|
|
90
|
-
* The controlled open state of the submenu. Must be used in conjunction with
|
|
91
|
-
* `onOpenChange`.
|
|
92
|
-
*/
|
|
93
|
-
open?: DropdownMenuPrimitive.DropdownMenuSubProps[ 'open' ];
|
|
94
|
-
/**
|
|
95
|
-
* Event handler called when the open state of the submenu changes.
|
|
96
|
-
*/
|
|
97
|
-
onOpenChange?: DropdownMenuPrimitive.DropdownMenuSubProps[ 'onOpenChange' ];
|
|
98
|
-
/**
|
|
99
|
-
* When `true`, prevents the user from interacting with the item.
|
|
100
|
-
*/
|
|
101
|
-
disabled?: DropdownMenuPrimitive.DropdownMenuSubTriggerProps[ 'disabled' ];
|
|
102
|
-
/**
|
|
103
|
-
* Optional text used for typeahead purposes for the trigger. By default the typeahead
|
|
104
|
-
* behavior will use the `.textContent` of the trigger. Use this when the content
|
|
105
|
-
* is complex, or you have non-textual content inside.
|
|
106
|
-
*/
|
|
107
|
-
textValue?: DropdownMenuPrimitive.DropdownMenuSubTriggerProps[ 'textValue' ];
|
|
108
|
-
/**
|
|
109
|
-
* The contents rendered inside the trigger. The trigger should be
|
|
110
|
-
* an instance of the `DropdownSubMenuTriggerProps` component.
|
|
105
|
+
* Whether to hide the parent menu when the item is clicked.
|
|
106
|
+
*
|
|
107
|
+
* @default true
|
|
111
108
|
*/
|
|
112
|
-
|
|
109
|
+
hideOnClick?: boolean;
|
|
113
110
|
/**
|
|
114
|
-
*
|
|
111
|
+
* Determines if the element is disabled.
|
|
115
112
|
*/
|
|
116
|
-
|
|
117
|
-
}
|
|
113
|
+
disabled?: boolean;
|
|
114
|
+
}
|
|
118
115
|
|
|
119
|
-
export
|
|
116
|
+
export interface DropdownMenuCheckboxItemProps
|
|
117
|
+
extends Omit< DropdownMenuItemProps, 'prefix' | 'hideOnClick' > {
|
|
120
118
|
/**
|
|
121
|
-
*
|
|
119
|
+
* Whether to hide the dropdown menu when the item is clicked.
|
|
122
120
|
*
|
|
123
121
|
* @default false
|
|
124
122
|
*/
|
|
125
|
-
|
|
123
|
+
hideOnClick?: boolean;
|
|
126
124
|
/**
|
|
127
|
-
*
|
|
128
|
-
* Calling `event.preventDefault` in this handler will prevent the dropdown
|
|
129
|
-
* menu from closing when selecting that item.
|
|
125
|
+
* The checkbox menu item's name.
|
|
130
126
|
*/
|
|
131
|
-
|
|
127
|
+
name: string;
|
|
132
128
|
/**
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* is complex, or you have non-textual content inside.
|
|
129
|
+
* The checkbox item's value, useful when using multiple checkbox menu items
|
|
130
|
+
* associated to the same `name`.
|
|
136
131
|
*/
|
|
137
|
-
|
|
132
|
+
value?: string;
|
|
138
133
|
/**
|
|
139
|
-
* The
|
|
134
|
+
* The controlled checked state of the checkbox menu item.
|
|
140
135
|
*/
|
|
141
|
-
|
|
136
|
+
checked?: boolean;
|
|
142
137
|
/**
|
|
143
|
-
* The
|
|
138
|
+
* The checked state of the checkbox menu item when it is initially rendered.
|
|
139
|
+
* Use when not wanting to control its checked state.
|
|
144
140
|
*/
|
|
145
|
-
|
|
141
|
+
defaultChecked?: boolean;
|
|
146
142
|
/**
|
|
147
|
-
*
|
|
143
|
+
* Event handler called when the checked state of the checkbox menu item changes.
|
|
148
144
|
*/
|
|
149
|
-
|
|
150
|
-
}
|
|
145
|
+
onChange?: ( event: React.ChangeEvent< HTMLInputElement > ) => void;
|
|
146
|
+
}
|
|
151
147
|
|
|
152
|
-
export
|
|
148
|
+
export interface DropdownMenuRadioItemProps
|
|
149
|
+
extends Omit< DropdownMenuItemProps, 'prefix' | 'hideOnClick' > {
|
|
153
150
|
/**
|
|
154
|
-
*
|
|
155
|
-
* Must be used in conjunction with `onCheckedChange`.
|
|
151
|
+
* Whether to hide the dropdown menu when the item is clicked.
|
|
156
152
|
*
|
|
157
153
|
* @default false
|
|
158
154
|
*/
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Event handler called when the checked state changes.
|
|
162
|
-
*/
|
|
163
|
-
onCheckedChange?: DropdownMenuPrimitive.DropdownMenuCheckboxItemProps[ 'onCheckedChange' ];
|
|
155
|
+
hideOnClick?: boolean;
|
|
164
156
|
/**
|
|
165
|
-
*
|
|
157
|
+
* The radio item's name.
|
|
166
158
|
*/
|
|
167
|
-
|
|
159
|
+
name: string;
|
|
168
160
|
/**
|
|
169
|
-
*
|
|
170
|
-
* Calling `event.preventDefault` in this handler will prevent the dropdown
|
|
171
|
-
* menu from closing when selecting that item.
|
|
161
|
+
* The radio item's value.
|
|
172
162
|
*/
|
|
173
|
-
|
|
163
|
+
value: string | number;
|
|
174
164
|
/**
|
|
175
|
-
*
|
|
176
|
-
* behavior will use the `.textContent` of the item. Use this when the content
|
|
177
|
-
* is complex, or you have non-textual content inside.
|
|
165
|
+
* The controlled checked state of the radio menu item.
|
|
178
166
|
*/
|
|
179
|
-
|
|
167
|
+
checked?: boolean;
|
|
180
168
|
/**
|
|
181
|
-
* The
|
|
169
|
+
* The checked state of the radio menu item when it is initially rendered.
|
|
170
|
+
* Use when not wanting to control its checked state.
|
|
182
171
|
*/
|
|
183
|
-
|
|
172
|
+
defaultChecked?: boolean;
|
|
184
173
|
/**
|
|
185
|
-
*
|
|
174
|
+
* Event handler called when the checked radio menu item changes.
|
|
186
175
|
*/
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export type DropdownMenuRadioGroupProps = {
|
|
191
|
-
/**
|
|
192
|
-
* The value of the selected item in the group.
|
|
193
|
-
*/
|
|
194
|
-
value?: DropdownMenuPrimitive.DropdownMenuRadioGroupProps[ 'value' ];
|
|
195
|
-
/**
|
|
196
|
-
* Event handler called when the value changes.
|
|
197
|
-
*/
|
|
198
|
-
onValueChange?: DropdownMenuPrimitive.DropdownMenuRadioGroupProps[ 'onValueChange' ];
|
|
199
|
-
/**
|
|
200
|
-
* The contents of the radio group
|
|
201
|
-
*/
|
|
202
|
-
children: React.ReactNode;
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
export type DropdownMenuRadioItemProps = {
|
|
206
|
-
/**
|
|
207
|
-
* The unique value of the item.
|
|
208
|
-
*/
|
|
209
|
-
value: DropdownMenuPrimitive.DropdownMenuRadioItemProps[ 'value' ];
|
|
210
|
-
/**
|
|
211
|
-
* When `true`, prevents the user from interacting with the item.
|
|
212
|
-
*/
|
|
213
|
-
disabled?: DropdownMenuPrimitive.DropdownMenuRadioItemProps[ 'disabled' ];
|
|
214
|
-
/**
|
|
215
|
-
* Event handler called when the user selects an item (via mouse or keyboard).
|
|
216
|
-
* Calling `event.preventDefault` in this handler will prevent the dropdown
|
|
217
|
-
* menu from closing when selecting that item.
|
|
218
|
-
*/
|
|
219
|
-
onSelect?: DropdownMenuPrimitive.DropdownMenuRadioItemProps[ 'onSelect' ];
|
|
220
|
-
/**
|
|
221
|
-
* Optional text used for typeahead purposes. By default the typeahead
|
|
222
|
-
* behavior will use the `.textContent` of the item. Use this when the content
|
|
223
|
-
* is complex, or you have non-textual content inside.
|
|
224
|
-
*/
|
|
225
|
-
textValue?: DropdownMenuPrimitive.DropdownMenuRadioItemProps[ 'textValue' ];
|
|
226
|
-
/**
|
|
227
|
-
* The contents of the radio item
|
|
228
|
-
*/
|
|
229
|
-
children: React.ReactNode;
|
|
230
|
-
/**
|
|
231
|
-
* The contents of the radio item's suffix
|
|
232
|
-
*/
|
|
233
|
-
suffix?: React.ReactNode;
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
export type DropdownMenuLabelProps = {
|
|
237
|
-
/**
|
|
238
|
-
* The contents of the label
|
|
239
|
-
*/
|
|
240
|
-
children: React.ReactNode;
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
export type DropdownMenuGroupProps = {
|
|
244
|
-
/**
|
|
245
|
-
* The contents of the group
|
|
246
|
-
*/
|
|
247
|
-
children: React.ReactNode;
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
export type DropdownMenuSeparatorProps = {};
|
|
251
|
-
|
|
252
|
-
export type DropdownMenuInternalContext = {
|
|
253
|
-
/**
|
|
254
|
-
* This variant can be used to change the appearance of the component in
|
|
255
|
-
* specific contexts, ie. when rendered inside the `Toolbar` component.
|
|
256
|
-
*/
|
|
257
|
-
variant?: 'toolbar';
|
|
258
|
-
};
|
|
176
|
+
onChange?: ( event: React.ChangeEvent< HTMLInputElement > ) => void;
|
|
177
|
+
}
|
|
259
178
|
|
|
260
|
-
export
|
|
261
|
-
DropdownMenuInternalContext,
|
|
262
|
-
'variant'
|
|
263
|
-
> & {
|
|
264
|
-
portalContainer?: HTMLElement | null;
|
|
265
|
-
};
|
|
179
|
+
export interface DropdownMenuSeparatorProps {}
|
|
@@ -91,7 +91,7 @@ function DuotonePicker( {
|
|
|
91
91
|
/>
|
|
92
92
|
);
|
|
93
93
|
|
|
94
|
-
const
|
|
94
|
+
const duotoneOptions = duotonePalette.map( ( { colors, slug, name } ) => {
|
|
95
95
|
const style = {
|
|
96
96
|
background: getGradientFromCSSColors( colors, '135deg' ),
|
|
97
97
|
color: 'transparent',
|
|
@@ -155,11 +155,15 @@ function DuotonePicker( {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
const options = unsetable
|
|
159
|
+
? [ unsetOption, ...duotoneOptions ]
|
|
160
|
+
: duotoneOptions;
|
|
161
|
+
|
|
158
162
|
return (
|
|
159
163
|
<CircularOptionPicker
|
|
160
164
|
{ ...otherProps }
|
|
161
165
|
{ ...metaProps }
|
|
162
|
-
options={
|
|
166
|
+
options={ options }
|
|
163
167
|
actions={
|
|
164
168
|
!! clearable && (
|
|
165
169
|
<CircularOptionPicker.ButtonAction
|
|
@@ -170,7 +174,7 @@ function DuotonePicker( {
|
|
|
170
174
|
)
|
|
171
175
|
}
|
|
172
176
|
>
|
|
173
|
-
<Spacer paddingTop={ 4 }>
|
|
177
|
+
<Spacer paddingTop={ options.length === 0 ? 0 : 4 }>
|
|
174
178
|
<VStack spacing={ 3 }>
|
|
175
179
|
{ ! disableCustomColors && ! disableCustomDuotone && (
|
|
176
180
|
<CustomDuotoneBar
|
|
@@ -23,6 +23,7 @@ const noop = () => {};
|
|
|
23
23
|
|
|
24
24
|
export default function FocalPointPickerControls( {
|
|
25
25
|
__nextHasNoMarginBottom,
|
|
26
|
+
__next40pxDefaultSize,
|
|
26
27
|
hasHelpText,
|
|
27
28
|
onChange = noop,
|
|
28
29
|
point = {
|
|
@@ -51,8 +52,10 @@ export default function FocalPointPickerControls( {
|
|
|
51
52
|
className="focal-point-picker__controls"
|
|
52
53
|
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
53
54
|
hasHelpText={ hasHelpText }
|
|
55
|
+
gap={ 4 }
|
|
54
56
|
>
|
|
55
57
|
<FocalPointUnitControl
|
|
58
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
56
59
|
label={ __( 'Left' ) }
|
|
57
60
|
aria-label={ __( 'Focal point left position' ) }
|
|
58
61
|
value={ [ valueX, '%' ].join( '' ) }
|
|
@@ -66,6 +69,7 @@ export default function FocalPointPickerControls( {
|
|
|
66
69
|
dragDirection="e"
|
|
67
70
|
/>
|
|
68
71
|
<FocalPointUnitControl
|
|
72
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
69
73
|
label={ __( 'Top' ) }
|
|
70
74
|
aria-label={ __( 'Focal point top position' ) }
|
|
71
75
|
value={ [ valueY, '%' ].join( '' ) }
|
|
@@ -84,6 +84,7 @@ const GRID_OVERLAY_TIMEOUT = 600;
|
|
|
84
84
|
*/
|
|
85
85
|
export function FocalPointPicker( {
|
|
86
86
|
__nextHasNoMarginBottom,
|
|
87
|
+
__next40pxDefaultSize = false,
|
|
87
88
|
autoPlay = true,
|
|
88
89
|
className,
|
|
89
90
|
help,
|
|
@@ -273,6 +274,7 @@ export function FocalPointPicker( {
|
|
|
273
274
|
</MediaWrapper>
|
|
274
275
|
<Controls
|
|
275
276
|
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
277
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
276
278
|
hasHelpText={ !! help }
|
|
277
279
|
point={ { x, y } }
|
|
278
280
|
onChange={ ( value ) => {
|
|
@@ -26,6 +26,12 @@ export type FocalPointPickerProps = Pick<
|
|
|
26
26
|
* @default false
|
|
27
27
|
*/
|
|
28
28
|
__nextHasNoMarginBottom?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Start opting into the larger default height that will become the default size in a future version.
|
|
31
|
+
*
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
__next40pxDefaultSize?: boolean;
|
|
29
35
|
/**
|
|
30
36
|
* Autoplays HTML5 video. This only applies to video sources (`url`).
|
|
31
37
|
*
|
|
@@ -62,6 +68,7 @@ export type FocalPointPickerProps = Pick<
|
|
|
62
68
|
|
|
63
69
|
export type FocalPointPickerControlsProps = {
|
|
64
70
|
__nextHasNoMarginBottom?: boolean;
|
|
71
|
+
__next40pxDefaultSize?: boolean;
|
|
65
72
|
/**
|
|
66
73
|
* A bit of extra bottom margin will be added if a `help` text
|
|
67
74
|
* needs to be rendered under it.
|
|
@@ -27,6 +27,7 @@ const CUSTOM_OPTION: FontSizePickerSelectOption = {
|
|
|
27
27
|
|
|
28
28
|
const FontSizePickerSelect = ( props: FontSizePickerSelectProps ) => {
|
|
29
29
|
const {
|
|
30
|
+
__next40pxDefaultSize,
|
|
30
31
|
fontSizes,
|
|
31
32
|
value,
|
|
32
33
|
disableCustomFontSizes,
|
|
@@ -67,6 +68,7 @@ const FontSizePickerSelect = ( props: FontSizePickerSelectProps ) => {
|
|
|
67
68
|
|
|
68
69
|
return (
|
|
69
70
|
<CustomSelectControl
|
|
71
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
70
72
|
__nextUnconstrainedWidth
|
|
71
73
|
className="components-font-size-picker__select"
|
|
72
74
|
label={ __( 'Font size' ) }
|
|
@@ -14,10 +14,18 @@ import { T_SHIRT_ABBREVIATIONS, T_SHIRT_NAMES } from './constants';
|
|
|
14
14
|
import type { FontSizePickerToggleGroupProps } from './types';
|
|
15
15
|
|
|
16
16
|
const FontSizePickerToggleGroup = ( props: FontSizePickerToggleGroupProps ) => {
|
|
17
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
fontSizes,
|
|
19
|
+
value,
|
|
20
|
+
__nextHasNoMarginBottom,
|
|
21
|
+
__next40pxDefaultSize,
|
|
22
|
+
size,
|
|
23
|
+
onChange,
|
|
24
|
+
} = props;
|
|
18
25
|
return (
|
|
19
26
|
<ToggleGroupControl
|
|
20
27
|
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
28
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
21
29
|
label={ __( 'Font size' ) }
|
|
22
30
|
hideLabelFromVision
|
|
23
31
|
value={ value }
|
|
@@ -11,11 +11,11 @@ import { useState } from '@wordpress/element';
|
|
|
11
11
|
import { Icon, chevronRight, check } from '@wordpress/icons';
|
|
12
12
|
import { __, sprintf } from '@wordpress/i18n';
|
|
13
13
|
import { BottomSheet } from '@wordpress/components';
|
|
14
|
-
import { getPxFromCssUnit } from '@wordpress/block-editor';
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* Internal dependencies
|
|
18
17
|
*/
|
|
18
|
+
import { default as getPxFromCssUnit } from '../mobile/utils/get-px-from-css-unit';
|
|
19
19
|
import { default as UnitControl, useCustomUnits } from '../unit-control';
|
|
20
20
|
import styles from './style.scss';
|
|
21
21
|
|
|
@@ -62,6 +62,12 @@ function FontSizePicker( {
|
|
|
62
62
|
availableUnits: [ 'px', 'em', 'rem' ],
|
|
63
63
|
} );
|
|
64
64
|
|
|
65
|
+
const accessibilityLabel = sprintf(
|
|
66
|
+
// translators: %1$s: Font size name e.g. Small
|
|
67
|
+
__( 'Font Size, %1$s' ),
|
|
68
|
+
selectedOption.name
|
|
69
|
+
);
|
|
70
|
+
|
|
65
71
|
return (
|
|
66
72
|
<BottomSheet.SubSheet
|
|
67
73
|
navigationButton={
|
|
@@ -80,7 +86,7 @@ function FontSizePicker( {
|
|
|
80
86
|
}
|
|
81
87
|
onPress={ openSubSheet }
|
|
82
88
|
accessibilityRole={ 'button' }
|
|
83
|
-
accessibilityLabel={
|
|
89
|
+
accessibilityLabel={ accessibilityLabel }
|
|
84
90
|
accessibilityHint={ sprintf(
|
|
85
91
|
// translators: %s: Select control button label e.g. Small
|
|
86
92
|
__( 'Navigates to select %s' ),
|
|
@@ -45,6 +45,7 @@ const UnforwardedFontSizePicker = (
|
|
|
45
45
|
const {
|
|
46
46
|
/** Start opting into the new margin-free styles that will become the default in a future version. */
|
|
47
47
|
__nextHasNoMarginBottom = false,
|
|
48
|
+
__next40pxDefaultSize = false,
|
|
48
49
|
fallbackFontSize,
|
|
49
50
|
fontSizes = [],
|
|
50
51
|
disableCustomFontSizes = false,
|
|
@@ -122,6 +123,7 @@ const UnforwardedFontSizePicker = (
|
|
|
122
123
|
);
|
|
123
124
|
const isValueUnitRelative =
|
|
124
125
|
!! valueUnit && [ 'em', 'rem' ].includes( valueUnit );
|
|
126
|
+
const isDisabled = value === undefined;
|
|
125
127
|
|
|
126
128
|
return (
|
|
127
129
|
<Container ref={ ref } className="components-font-size-picker">
|
|
@@ -152,7 +154,7 @@ const UnforwardedFontSizePicker = (
|
|
|
152
154
|
);
|
|
153
155
|
} }
|
|
154
156
|
isPressed={ showCustomValueControl }
|
|
155
|
-
|
|
157
|
+
size="small"
|
|
156
158
|
/>
|
|
157
159
|
) }
|
|
158
160
|
</Header>
|
|
@@ -165,6 +167,7 @@ const UnforwardedFontSizePicker = (
|
|
|
165
167
|
shouldUseSelectControl &&
|
|
166
168
|
! showCustomValueControl && (
|
|
167
169
|
<FontSizePickerSelect
|
|
170
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
168
171
|
fontSizes={ fontSizes }
|
|
169
172
|
value={ value }
|
|
170
173
|
disableCustomFontSizes={ disableCustomFontSizes }
|
|
@@ -194,6 +197,7 @@ const UnforwardedFontSizePicker = (
|
|
|
194
197
|
fontSizes={ fontSizes }
|
|
195
198
|
value={ value }
|
|
196
199
|
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
200
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
197
201
|
size={ size }
|
|
198
202
|
onChange={ ( newValue ) => {
|
|
199
203
|
if ( newValue === undefined ) {
|
|
@@ -214,6 +218,7 @@ const UnforwardedFontSizePicker = (
|
|
|
214
218
|
<Flex className="components-font-size-picker__custom-size-control">
|
|
215
219
|
<FlexItem isBlock>
|
|
216
220
|
<UnitControl
|
|
221
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
217
222
|
label={ __( 'Custom' ) }
|
|
218
223
|
labelPosition="top"
|
|
219
224
|
hideLabelFromVision
|
|
@@ -241,6 +246,9 @@ const UnforwardedFontSizePicker = (
|
|
|
241
246
|
__nextHasNoMarginBottom={
|
|
242
247
|
__nextHasNoMarginBottom
|
|
243
248
|
}
|
|
249
|
+
__next40pxDefaultSize={
|
|
250
|
+
__next40pxDefaultSize
|
|
251
|
+
}
|
|
244
252
|
className="components-font-size-picker__custom-input"
|
|
245
253
|
label={ __( 'Custom Size' ) }
|
|
246
254
|
hideLabelFromVision
|
|
@@ -269,16 +277,18 @@ const UnforwardedFontSizePicker = (
|
|
|
269
277
|
{ withReset && (
|
|
270
278
|
<FlexItem>
|
|
271
279
|
<Button
|
|
272
|
-
disabled={
|
|
280
|
+
disabled={ isDisabled }
|
|
281
|
+
__experimentalIsFocusable
|
|
273
282
|
onClick={ () => {
|
|
274
283
|
onChange?.( undefined );
|
|
275
284
|
} }
|
|
276
285
|
variant="secondary"
|
|
277
286
|
__next40pxDefaultSize
|
|
278
287
|
size={
|
|
279
|
-
size
|
|
280
|
-
|
|
281
|
-
|
|
288
|
+
size === '__unstable-large' ||
|
|
289
|
+
props.__next40pxDefaultSize
|
|
290
|
+
? 'default'
|
|
291
|
+
: 'small'
|
|
282
292
|
}
|
|
283
293
|
>
|
|
284
294
|
{ __( 'Reset' ) }
|
|
@@ -57,6 +57,12 @@ export type FontSizePickerProps = {
|
|
|
57
57
|
* @default false
|
|
58
58
|
*/
|
|
59
59
|
__nextHasNoMarginBottom?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Start opting into the larger default height that will become the default size in a future version.
|
|
62
|
+
*
|
|
63
|
+
* @default false
|
|
64
|
+
*/
|
|
65
|
+
__next40pxDefaultSize?: boolean;
|
|
60
66
|
/**
|
|
61
67
|
* Size of the control.
|
|
62
68
|
*
|
|
@@ -93,6 +99,7 @@ export type FontSizePickerSelectProps = Pick<
|
|
|
93
99
|
>;
|
|
94
100
|
onChange: NonNullable< FontSizePickerProps[ 'onChange' ] >;
|
|
95
101
|
onSelectCustom: () => void;
|
|
102
|
+
__next40pxDefaultSize: boolean;
|
|
96
103
|
};
|
|
97
104
|
|
|
98
105
|
export type FontSizePickerSelectOption = {
|
|
@@ -104,7 +111,7 @@ export type FontSizePickerSelectOption = {
|
|
|
104
111
|
|
|
105
112
|
export type FontSizePickerToggleGroupProps = Pick<
|
|
106
113
|
FontSizePickerProps,
|
|
107
|
-
'value' | 'size' | '__nextHasNoMarginBottom'
|
|
114
|
+
'value' | 'size' | '__nextHasNoMarginBottom' | '__next40pxDefaultSize'
|
|
108
115
|
> & {
|
|
109
116
|
fontSizes: NonNullable< FontSizePickerProps[ 'fontSizes' ] >;
|
|
110
117
|
onChange: NonNullable< FontSizePickerProps[ 'onChange' ] >;
|
|
@@ -4,12 +4,6 @@ FormToggle switches a single setting on or off.
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
## Table of contents
|
|
8
|
-
|
|
9
|
-
1. [Design guidelines](#design-guidelines)
|
|
10
|
-
2. [Development guidelines](#development-guidelines)
|
|
11
|
-
3. [Related components](#related-components)
|
|
12
|
-
|
|
13
7
|
## Design guidelines
|
|
14
8
|
|
|
15
9
|
### Usage
|