@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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
|
-
`ToggleGroupControlOptionIcon` is a form component which is meant to be used as a child of [`ToggleGroupControl`]
|
|
7
|
+
`ToggleGroupControlOptionIcon` is a form component which is meant to be used as a child of [`ToggleGroupControl`](/packages/components/src/toggle-group-control/toggle-group-control/README.md) and displays an icon.
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
@@ -4,12 +4,6 @@ Toolbar can be used to group related options. To emphasize groups of related ico
|
|
|
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
|
|
@@ -455,8 +455,8 @@ describe( 'ToolsPanel', () => {
|
|
|
455
455
|
|
|
456
456
|
const menuGroups = screen.getAllByRole( 'group' );
|
|
457
457
|
|
|
458
|
-
//
|
|
459
|
-
expect( menuGroups.length ).toEqual(
|
|
458
|
+
// There are now only two groups controls & reset all.
|
|
459
|
+
expect( menuGroups.length ).toEqual( 2 );
|
|
460
460
|
} );
|
|
461
461
|
|
|
462
462
|
it( 'should not render contents of items when in placeholder state', () => {
|
|
@@ -517,15 +517,11 @@ describe( 'ToolsPanel', () => {
|
|
|
517
517
|
|
|
518
518
|
await openDropdownMenu();
|
|
519
519
|
|
|
520
|
-
// The linked control should initially appear in the optional controls
|
|
521
|
-
// menu group. There should be three menu groups: default controls,
|
|
522
|
-
// optional controls, and the group to reset all options.
|
|
523
520
|
let menuGroups = screen.getAllByRole( 'group' );
|
|
524
|
-
expect( menuGroups.length ).toEqual( 3 );
|
|
525
521
|
|
|
526
|
-
// The linked control should be in the
|
|
522
|
+
// The linked control should be in the first group of controls.
|
|
527
523
|
expect(
|
|
528
|
-
within( menuGroups[
|
|
524
|
+
within( menuGroups[ 0 ] ).getByText( 'Linked' )
|
|
529
525
|
).toBeInTheDocument();
|
|
530
526
|
|
|
531
527
|
// Simulate the main control having a value set which should
|
|
@@ -540,22 +536,18 @@ describe( 'ToolsPanel', () => {
|
|
|
540
536
|
linkedItem = screen.getByText( 'Linked control' );
|
|
541
537
|
expect( linkedItem ).toBeInTheDocument();
|
|
542
538
|
|
|
543
|
-
// The linked control should
|
|
544
|
-
// menu group
|
|
539
|
+
// The linked control should still appear in the controls
|
|
540
|
+
// menu group but as a default control.
|
|
545
541
|
menuGroups = screen.getAllByRole( 'group' );
|
|
546
542
|
|
|
547
|
-
//
|
|
548
|
-
//
|
|
549
|
-
expect( menuGroups.length ).toEqual( 2 );
|
|
550
|
-
|
|
551
|
-
// The new default control item for the Linked control should be
|
|
552
|
-
// within the first menu group.
|
|
543
|
+
// The new default control item for the Linked control should still
|
|
544
|
+
// be within the first menu group.
|
|
553
545
|
const defaultItem = within( menuGroups[ 0 ] ).getByText( 'Linked' );
|
|
554
546
|
expect( defaultItem ).toBeInTheDocument();
|
|
555
547
|
|
|
556
548
|
// Optional controls have an additional aria-label. This can be used
|
|
557
|
-
// to confirm the conditional default control
|
|
558
|
-
//
|
|
549
|
+
// to confirm the conditional default control is now being treated
|
|
550
|
+
// as default control.
|
|
559
551
|
expect(
|
|
560
552
|
screen.queryByRole( 'menuitemcheckbox', {
|
|
561
553
|
name: 'Show Linked',
|
|
@@ -599,7 +591,7 @@ describe( 'ToolsPanel', () => {
|
|
|
599
591
|
let conditionalItem = screen.queryByText( 'Conditional control' );
|
|
600
592
|
expect( conditionalItem ).not.toBeInTheDocument();
|
|
601
593
|
|
|
602
|
-
// The conditional control should not yet appear in the
|
|
594
|
+
// The conditional control should not yet appear in the controls
|
|
603
595
|
// menu group.
|
|
604
596
|
await openDropdownMenu();
|
|
605
597
|
let menuGroups = screen.getAllByRole( 'group' );
|
|
@@ -619,7 +611,7 @@ describe( 'ToolsPanel', () => {
|
|
|
619
611
|
conditionalItem = screen.getByText( 'Conditional control' );
|
|
620
612
|
expect( conditionalItem ).toBeInTheDocument();
|
|
621
613
|
|
|
622
|
-
// The conditional control should now appear in the
|
|
614
|
+
// The conditional control should now appear in the controls
|
|
623
615
|
// menu group.
|
|
624
616
|
menuGroups = screen.getAllByRole( 'group' );
|
|
625
617
|
|
|
@@ -157,6 +157,13 @@ wrapper element allowing the panel to lay them out accordingly.
|
|
|
157
157
|
- Required: No
|
|
158
158
|
- Default: `false`
|
|
159
159
|
|
|
160
|
+
### `dropdownMenuProps`: `{}`
|
|
161
|
+
|
|
162
|
+
The popover props to configure panel's `DropdownMenu`.
|
|
163
|
+
|
|
164
|
+
- Type: `DropdownMenuProps`
|
|
165
|
+
- Required: No
|
|
166
|
+
|
|
160
167
|
### `headingLevel`: `1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6'`
|
|
161
168
|
|
|
162
169
|
The heading level of the panel's header.
|
|
@@ -25,6 +25,7 @@ const UnconnectedToolsPanel = (
|
|
|
25
25
|
resetAllItems,
|
|
26
26
|
toggleItem,
|
|
27
27
|
headingLevel,
|
|
28
|
+
dropdownMenuProps,
|
|
28
29
|
...toolsPanelProps
|
|
29
30
|
} = useToolsPanel( props );
|
|
30
31
|
|
|
@@ -36,6 +37,7 @@ const UnconnectedToolsPanel = (
|
|
|
36
37
|
resetAll={ resetAllItems }
|
|
37
38
|
toggleItem={ toggleItem }
|
|
38
39
|
headingLevel={ headingLevel }
|
|
40
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
39
41
|
/>
|
|
40
42
|
{ children }
|
|
41
43
|
</ToolsPanelContext.Provider>
|
|
@@ -18,6 +18,13 @@ This component is generated automatically by its parent
|
|
|
18
18
|
|
|
19
19
|
## Props
|
|
20
20
|
|
|
21
|
+
### `dropdownMenuProps`: `{}`
|
|
22
|
+
|
|
23
|
+
The dropdown menu props to configure the panel's `DropdownMenu`.
|
|
24
|
+
|
|
25
|
+
- Type: `DropdownMenuProps`
|
|
26
|
+
- Required: No
|
|
27
|
+
|
|
21
28
|
### `headingLevel`: `1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6'`
|
|
22
29
|
|
|
23
30
|
The heading level of the panel's header.
|
|
@@ -39,7 +39,7 @@ const DefaultControlsGroup = ( {
|
|
|
39
39
|
const resetSuffix = <ResetLabel aria-hidden>{ __( 'Reset' ) }</ResetLabel>;
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
|
-
|
|
42
|
+
<>
|
|
43
43
|
{ items.map( ( [ label, hasValue ] ) => {
|
|
44
44
|
if ( hasValue ) {
|
|
45
45
|
return (
|
|
@@ -73,6 +73,7 @@ const DefaultControlsGroup = ( {
|
|
|
73
73
|
return (
|
|
74
74
|
<MenuItem
|
|
75
75
|
key={ label }
|
|
76
|
+
icon={ check }
|
|
76
77
|
className={ itemClassName }
|
|
77
78
|
role="menuitemcheckbox"
|
|
78
79
|
isSelected
|
|
@@ -82,7 +83,7 @@ const DefaultControlsGroup = ( {
|
|
|
82
83
|
</MenuItem>
|
|
83
84
|
);
|
|
84
85
|
} ) }
|
|
85
|
-
|
|
86
|
+
</>
|
|
86
87
|
);
|
|
87
88
|
};
|
|
88
89
|
|
|
@@ -95,7 +96,7 @@ const OptionalControlsGroup = ( {
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
return (
|
|
98
|
-
|
|
99
|
+
<>
|
|
99
100
|
{ items.map( ( [ label, isSelected ] ) => {
|
|
100
101
|
const itemLabel = isSelected
|
|
101
102
|
? sprintf(
|
|
@@ -143,7 +144,7 @@ const OptionalControlsGroup = ( {
|
|
|
143
144
|
</MenuItem>
|
|
144
145
|
);
|
|
145
146
|
} ) }
|
|
146
|
-
|
|
147
|
+
</>
|
|
147
148
|
);
|
|
148
149
|
};
|
|
149
150
|
|
|
@@ -162,6 +163,7 @@ const ToolsPanelHeader = (
|
|
|
162
163
|
menuItems,
|
|
163
164
|
resetAll,
|
|
164
165
|
toggleItem,
|
|
166
|
+
dropdownMenuProps,
|
|
165
167
|
...headerProps
|
|
166
168
|
} = useToolsPanelHeader( props );
|
|
167
169
|
|
|
@@ -192,6 +194,7 @@ const ToolsPanelHeader = (
|
|
|
192
194
|
</Heading>
|
|
193
195
|
{ hasMenuItems && (
|
|
194
196
|
<DropdownMenu
|
|
197
|
+
{ ...dropdownMenuProps }
|
|
195
198
|
icon={ dropDownMenuIcon }
|
|
196
199
|
label={ dropDownMenuLabelText }
|
|
197
200
|
menuProps={ { className: dropdownMenuClassName } }
|
|
@@ -202,15 +205,19 @@ const ToolsPanelHeader = (
|
|
|
202
205
|
>
|
|
203
206
|
{ () => (
|
|
204
207
|
<>
|
|
205
|
-
<
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
208
|
+
<MenuGroup label={ labelText }>
|
|
209
|
+
<DefaultControlsGroup
|
|
210
|
+
items={ defaultItems }
|
|
211
|
+
toggleItem={ toggleItem }
|
|
212
|
+
itemClassName={
|
|
213
|
+
defaultControlsItemClassName
|
|
214
|
+
}
|
|
215
|
+
/>
|
|
216
|
+
<OptionalControlsGroup
|
|
217
|
+
items={ optionalItems }
|
|
218
|
+
toggleItem={ toggleItem }
|
|
219
|
+
/>
|
|
220
|
+
</MenuGroup>
|
|
214
221
|
<MenuGroup>
|
|
215
222
|
<MenuItem
|
|
216
223
|
aria-disabled={ ! canResetAll }
|
|
@@ -52,11 +52,14 @@ export function useToolsPanelItem(
|
|
|
52
52
|
__experimentalLastVisibleItemClass,
|
|
53
53
|
} = useToolsPanelContext();
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
// hasValue is a new function on every render, so do not add it as a
|
|
56
|
+
// dependency to the useCallback hook! If needed, we should use a ref.
|
|
57
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
58
|
+
const hasValueCallback = useCallback( hasValue, [ panelId ] );
|
|
59
|
+
// resetAllFilter is a new function on every render, so do not add it as a
|
|
60
|
+
// dependency to the useCallback hook! If needed, we should use a ref.
|
|
61
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
|
+
const resetAllFilterCallback = useCallback( resetAllFilter, [ panelId ] );
|
|
60
63
|
const previousPanelId = usePrevious( currentPanelId );
|
|
61
64
|
|
|
62
65
|
const hasMatchingPanel =
|
|
@@ -126,27 +129,13 @@ export function useToolsPanelItem(
|
|
|
126
129
|
const newValueSet = isValueSet && ! wasValueSet;
|
|
127
130
|
|
|
128
131
|
// Notify the panel when an item's value has been set.
|
|
129
|
-
//
|
|
130
|
-
// 1. For default controls, this is so "reset" appears beside its menu item.
|
|
131
|
-
// 2. For optional controls, when the panel ID is `null`, it allows the
|
|
132
|
-
// panel to ensure the item is toggled on for display in the menu, given the
|
|
133
|
-
// value has been set external to the control.
|
|
134
132
|
useEffect( () => {
|
|
135
133
|
if ( ! newValueSet ) {
|
|
136
134
|
return;
|
|
137
135
|
}
|
|
138
136
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
}, [
|
|
143
|
-
currentPanelId,
|
|
144
|
-
newValueSet,
|
|
145
|
-
isShownByDefault,
|
|
146
|
-
menuGroup,
|
|
147
|
-
label,
|
|
148
|
-
flagItemCustomization,
|
|
149
|
-
] );
|
|
137
|
+
flagItemCustomization( label, menuGroup );
|
|
138
|
+
}, [ newValueSet, menuGroup, label, flagItemCustomization ] );
|
|
150
139
|
|
|
151
140
|
// Determine if the panel item's corresponding menu is being toggled and
|
|
152
141
|
// trigger appropriate callback if it is.
|
package/src/tools-panel/types.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { ReactNode } from 'react';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import type { HeadingSize } from '../heading/types';
|
|
10
|
+
import type { DropdownMenu } from '../dropdown-menu';
|
|
10
11
|
|
|
11
12
|
export type ResetAllFilter = ( attributes?: any ) => any;
|
|
12
13
|
type ResetAll = ( filters?: ResetAllFilter[] ) => void;
|
|
@@ -16,6 +17,10 @@ export type ToolsPanelProps = {
|
|
|
16
17
|
* The child elements.
|
|
17
18
|
*/
|
|
18
19
|
children: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The dropdown menu props to configure the panel's `DropdownMenu`.
|
|
22
|
+
*/
|
|
23
|
+
dropdownMenuProps?: React.ComponentProps< typeof DropdownMenu >;
|
|
19
24
|
/**
|
|
20
25
|
* Flags that the items in this ToolsPanel will be contained within an inner
|
|
21
26
|
* wrapper element allowing the panel to lay them out accordingly.
|
|
@@ -69,6 +74,10 @@ export type ToolsPanelProps = {
|
|
|
69
74
|
};
|
|
70
75
|
|
|
71
76
|
export type ToolsPanelHeaderProps = {
|
|
77
|
+
/**
|
|
78
|
+
* The dropdown menu props to configure the panel's `DropdownMenu`.
|
|
79
|
+
*/
|
|
80
|
+
dropdownMenuProps?: React.ComponentProps< typeof DropdownMenu >;
|
|
72
81
|
/**
|
|
73
82
|
* The heading level of the panel's header.
|
|
74
83
|
*
|
package/src/tooltip/README.md
CHANGED
|
@@ -16,6 +16,10 @@ const MyTooltip = () => (
|
|
|
16
16
|
);
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
### Nested tooltips
|
|
20
|
+
|
|
21
|
+
In case one or more `Tooltip` components are rendered inside another `Tooltip` component, only the tooltip associated to the outermost `Tooltip` component will be rendered in the browser and shown to the user appropriately. The rest of the nested `Tooltip` components will simply no-op and pass-through their anchor.
|
|
22
|
+
|
|
19
23
|
## Props
|
|
20
24
|
|
|
21
25
|
The component accepts the following props:
|
package/src/tooltip/index.tsx
CHANGED
|
@@ -8,22 +8,37 @@ import * as Ariakit from '@ariakit/react';
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { useInstanceId } from '@wordpress/compose';
|
|
11
|
-
import { Children } from '@wordpress/element';
|
|
11
|
+
import { Children, cloneElement } from '@wordpress/element';
|
|
12
12
|
import deprecated from '@wordpress/deprecated';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
|
-
import type { TooltipProps } from './types';
|
|
17
|
+
import type { TooltipProps, TooltipInternalContext } from './types';
|
|
18
18
|
import Shortcut from '../shortcut';
|
|
19
19
|
import { positionToPlacement } from '../popover/utils';
|
|
20
|
+
import {
|
|
21
|
+
contextConnect,
|
|
22
|
+
useContextSystem,
|
|
23
|
+
ContextSystemProvider,
|
|
24
|
+
} from '../context';
|
|
25
|
+
import type { WordPressComponentProps } from '../context';
|
|
20
26
|
|
|
21
27
|
/**
|
|
22
28
|
* Time over anchor to wait before showing tooltip
|
|
23
29
|
*/
|
|
24
30
|
export const TOOLTIP_DELAY = 700;
|
|
25
31
|
|
|
26
|
-
|
|
32
|
+
const CONTEXT_VALUE = {
|
|
33
|
+
Tooltip: {
|
|
34
|
+
isNestedInTooltip: true,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
function UnconnectedTooltip(
|
|
39
|
+
props: WordPressComponentProps< TooltipProps, 'div', false >,
|
|
40
|
+
ref: React.ForwardedRef< any >
|
|
41
|
+
) {
|
|
27
42
|
const {
|
|
28
43
|
children,
|
|
29
44
|
delay = TOOLTIP_DELAY,
|
|
@@ -32,7 +47,15 @@ function Tooltip( props: TooltipProps ) {
|
|
|
32
47
|
position,
|
|
33
48
|
shortcut,
|
|
34
49
|
text,
|
|
35
|
-
|
|
50
|
+
|
|
51
|
+
// From Internal Context system
|
|
52
|
+
isNestedInTooltip,
|
|
53
|
+
|
|
54
|
+
...restProps
|
|
55
|
+
} = useContextSystem< typeof props & TooltipInternalContext >(
|
|
56
|
+
props,
|
|
57
|
+
'Tooltip'
|
|
58
|
+
);
|
|
36
59
|
|
|
37
60
|
const baseId = useInstanceId( Tooltip, 'tooltip' );
|
|
38
61
|
const describedById = text || shortcut ? baseId : undefined;
|
|
@@ -43,7 +66,7 @@ function Tooltip( props: TooltipProps ) {
|
|
|
43
66
|
if ( 'development' === process.env.NODE_ENV ) {
|
|
44
67
|
// eslint-disable-next-line no-console
|
|
45
68
|
console.error(
|
|
46
|
-
'Tooltip should be called with only a single child element.'
|
|
69
|
+
'wp-components.Tooltip should be called with only a single child element.'
|
|
47
70
|
);
|
|
48
71
|
}
|
|
49
72
|
}
|
|
@@ -64,24 +87,37 @@ function Tooltip( props: TooltipProps ) {
|
|
|
64
87
|
}
|
|
65
88
|
computedPlacement = computedPlacement || 'bottom';
|
|
66
89
|
|
|
67
|
-
|
|
90
|
+
// Removing the `Ariakit` namespace from the hook name allows ESLint to
|
|
91
|
+
// properly identify the hook, and apply the correct linting rules.
|
|
92
|
+
const useAriakitTooltipStore = Ariakit.useTooltipStore;
|
|
93
|
+
const tooltipStore = useAriakitTooltipStore( {
|
|
68
94
|
placement: computedPlacement,
|
|
69
|
-
|
|
95
|
+
showTimeout: delay,
|
|
70
96
|
} );
|
|
71
97
|
|
|
98
|
+
if ( isNestedInTooltip ) {
|
|
99
|
+
return isOnlyChild
|
|
100
|
+
? cloneElement( children, {
|
|
101
|
+
...restProps,
|
|
102
|
+
ref,
|
|
103
|
+
} )
|
|
104
|
+
: children;
|
|
105
|
+
}
|
|
106
|
+
|
|
72
107
|
return (
|
|
73
|
-
|
|
108
|
+
<ContextSystemProvider value={ CONTEXT_VALUE }>
|
|
74
109
|
<Ariakit.TooltipAnchor
|
|
75
110
|
onClick={ hideOnClick ? tooltipStore.hide : undefined }
|
|
76
111
|
store={ tooltipStore }
|
|
77
112
|
render={ isOnlyChild ? children : undefined }
|
|
113
|
+
ref={ ref }
|
|
78
114
|
>
|
|
79
115
|
{ isOnlyChild ? undefined : children }
|
|
80
116
|
</Ariakit.TooltipAnchor>
|
|
81
117
|
{ isOnlyChild && ( text || shortcut ) && (
|
|
82
118
|
<Ariakit.Tooltip
|
|
119
|
+
{ ...restProps }
|
|
83
120
|
unmountOnHide
|
|
84
|
-
className="components-tooltip"
|
|
85
121
|
gutter={ 4 }
|
|
86
122
|
id={ describedById }
|
|
87
123
|
overflowPadding={ 0.5 }
|
|
@@ -98,8 +134,10 @@ function Tooltip( props: TooltipProps ) {
|
|
|
98
134
|
) }
|
|
99
135
|
</Ariakit.Tooltip>
|
|
100
136
|
) }
|
|
101
|
-
|
|
137
|
+
</ContextSystemProvider>
|
|
102
138
|
);
|
|
103
139
|
}
|
|
104
140
|
|
|
141
|
+
export const Tooltip = contextConnect( UnconnectedTooltip, 'Tooltip' );
|
|
142
|
+
|
|
105
143
|
export default Tooltip;
|
|
@@ -30,7 +30,7 @@ const meta: Meta< typeof Tooltip > = {
|
|
|
30
30
|
'bottom right',
|
|
31
31
|
],
|
|
32
32
|
},
|
|
33
|
-
shortcut: { control: { type: '
|
|
33
|
+
shortcut: { control: { type: 'object' } },
|
|
34
34
|
},
|
|
35
35
|
parameters: {
|
|
36
36
|
controls: { expanded: true },
|
|
@@ -57,3 +57,20 @@ KeyboardShortcut.args = {
|
|
|
57
57
|
ariaLabel: shortcutAriaLabel.primaryShift( ',' ),
|
|
58
58
|
},
|
|
59
59
|
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* In case one or more `Tooltip` components are rendered inside another
|
|
63
|
+
* `Tooltip` component, only the tooltip associated to the outermost `Tooltip`
|
|
64
|
+
* component will be rendered in the browser and shown to the user
|
|
65
|
+
* appropriately. The rest of the nested `Tooltip` components will simply no-op
|
|
66
|
+
* and pass-through their anchor.
|
|
67
|
+
*/
|
|
68
|
+
export const Nested: StoryFn< typeof Tooltip > = Template.bind( {} );
|
|
69
|
+
Nested.args = {
|
|
70
|
+
children: (
|
|
71
|
+
<Tooltip text="Nested tooltip text (that will never show)">
|
|
72
|
+
<Button variant="primary">Tooltip Anchor</Button>
|
|
73
|
+
</Tooltip>
|
|
74
|
+
),
|
|
75
|
+
text: 'Outer tooltip text',
|
|
76
|
+
};
|