@wordpress/components 23.9.0 → 25.0.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 +62 -0
- package/CONTRIBUTING.md +75 -1
- package/README.md +1 -3
- package/build/autocomplete/autocompleter-ui.js +0 -2
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/index.js +2 -0
- package/build/autocomplete/index.js.map +1 -1
- package/build/button/index.js +2 -0
- package/build/button/index.js.map +1 -1
- package/build/card/card-media/component.js +2 -1
- package/build/card/card-media/component.js.map +1 -1
- package/build/color-picker/styles.js +8 -8
- package/build/color-picker/styles.js.map +1 -1
- package/build/combobox-control/index.js +7 -5
- package/build/combobox-control/index.js.map +1 -1
- package/build/combobox-control/styles.js +3 -3
- package/build/combobox-control/styles.js.map +1 -1
- package/build/date-time/date-time/index.js +3 -84
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/date-time/date-time/styles.js +4 -19
- package/build/date-time/date-time/styles.js.map +1 -1
- package/build/dimension-control/index.js +1 -1
- package/build/dimension-control/index.js.map +1 -1
- package/build/draggable/index.js +2 -7
- package/build/draggable/index.js.map +1 -1
- package/build/dropdown-menu/index.js +87 -11
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu/types.js +6 -0
- package/build/dropdown-menu/types.js.map +1 -0
- package/build/dropdown-menu-v2/index.js +195 -0
- package/build/dropdown-menu-v2/index.js.map +1 -0
- package/build/dropdown-menu-v2/styles.js +176 -0
- package/build/dropdown-menu-v2/styles.js.map +1 -0
- package/build/dropdown-menu-v2/types.js +6 -0
- package/build/dropdown-menu-v2/types.js.map +1 -0
- package/build/form-token-field/index.js +5 -3
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/styles.js +3 -3
- package/build/form-token-field/styles.js.map +1 -1
- package/build/index.native.js +0 -9
- package/build/index.native.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +30 -23
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +16 -8
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js +3 -2
- package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js +4 -2
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/switch-cell.native.js +8 -2
- package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet-select-control/index.native.js +4 -2
- package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet-text-control/index.native.js +4 -2
- package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build/mobile/global-styles-context/index.native.js +13 -1
- package/build/mobile/global-styles-context/index.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-results.native.js +3 -1
- package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build/navigable-container/container.js +39 -19
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigable-container/index.js.map +1 -1
- package/build/navigable-container/menu.js +37 -5
- package/build/navigable-container/menu.js.map +1 -1
- package/build/navigable-container/tabbable.js +45 -4
- package/build/navigable-container/tabbable.js.map +1 -1
- package/build/navigable-container/types.js +6 -0
- package/build/navigable-container/types.js.map +1 -0
- package/build/palette-edit/index.js +34 -12
- package/build/palette-edit/index.js.map +1 -1
- package/build/private-apis.js +13 -1
- package/build/private-apis.js.map +1 -1
- package/build/range-control/index.native.js +5 -2
- package/build/range-control/index.native.js.map +1 -1
- package/build/sandbox/index.native.js +6 -2
- package/build/sandbox/index.native.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +2 -1
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +45 -35
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/use-slot.js +11 -26
- package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build/slot-fill/fill.js +7 -31
- package/build/slot-fill/fill.js.map +1 -1
- package/build/slot-fill/index.js.map +1 -1
- package/build/slot-fill/provider.js +0 -6
- package/build/slot-fill/provider.js.map +1 -1
- package/build/slot-fill/slot.js +0 -5
- package/build/slot-fill/slot.js.map +1 -1
- package/build/snackbar/list.js +0 -2
- package/build/snackbar/list.js.map +1 -1
- package/build/tab-panel/index.js.map +1 -1
- package/build/theme/color-algorithms.js +1 -1
- package/build/theme/color-algorithms.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toolbar/toolbar-button/index.js +1 -2
- package/build/toolbar/toolbar-button/index.js.map +1 -1
- package/build/toolbar/toolbar-item/index.js +4 -2
- package/build/toolbar/toolbar-item/index.js.map +1 -1
- package/build/utils/colors-values.js +3 -3
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/use-deprecated-props.js +35 -0
- package/build/utils/use-deprecated-props.js.map +1 -0
- package/build-module/autocomplete/autocompleter-ui.js +1 -3
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/index.js +3 -3
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/button/index.js +2 -0
- package/build-module/button/index.js.map +1 -1
- package/build-module/card/card-media/component.js +2 -1
- package/build-module/card/card-media/component.js.map +1 -1
- package/build-module/color-picker/styles.js +8 -8
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +6 -5
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/combobox-control/styles.js +3 -3
- package/build-module/combobox-control/styles.js.map +1 -1
- package/build-module/date-time/date-time/index.js +6 -81
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/date-time/date-time/styles.js +3 -17
- package/build-module/date-time/date-time/styles.js.map +1 -1
- package/build-module/dimension-control/index.js +1 -1
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/draggable/index.js +2 -7
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/dropdown-menu/index.js +87 -10
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/types.js +2 -0
- package/build-module/dropdown-menu/types.js.map +1 -0
- package/build-module/dropdown-menu-v2/index.js +149 -0
- package/build-module/dropdown-menu-v2/index.js.map +1 -0
- package/build-module/dropdown-menu-v2/styles.js +153 -0
- package/build-module/dropdown-menu-v2/styles.js.map +1 -0
- package/build-module/dropdown-menu-v2/types.js +2 -0
- package/build-module/dropdown-menu-v2/types.js.map +1 -0
- package/build-module/form-token-field/index.js +4 -3
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/styles.js +3 -3
- package/build-module/form-token-field/styles.js.map +1 -1
- package/build-module/index.native.js +0 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +30 -23
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +16 -8
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js +3 -2
- package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +4 -2
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/switch-cell.native.js +7 -2
- package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +4 -2
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-text-control/index.native.js +4 -2
- package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/index.native.js +13 -1
- package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js +3 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build-module/navigable-container/container.js +43 -19
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigable-container/index.js +0 -2
- package/build-module/navigable-container/index.js.map +1 -1
- package/build-module/navigable-container/menu.js +36 -4
- package/build-module/navigable-container/menu.js.map +1 -1
- package/build-module/navigable-container/tabbable.js +44 -3
- package/build-module/navigable-container/tabbable.js.map +1 -1
- package/build-module/navigable-container/types.js +2 -0
- package/build-module/navigable-container/types.js.map +1 -0
- package/build-module/palette-edit/index.js +34 -13
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/private-apis.js +12 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/range-control/index.native.js +5 -2
- package/build-module/range-control/index.native.js.map +1 -1
- package/build-module/sandbox/index.native.js +6 -2
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +2 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +46 -36
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot.js +12 -27
- package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build-module/slot-fill/fill.js +7 -31
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/slot-fill/index.js +1 -2
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/slot-fill/provider.js +0 -6
- package/build-module/slot-fill/provider.js.map +1 -1
- package/build-module/slot-fill/slot.js +0 -5
- package/build-module/slot-fill/slot.js.map +1 -1
- package/build-module/snackbar/list.js +0 -2
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/theme/color-algorithms.js +1 -1
- package/build-module/theme/color-algorithms.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toolbar/toolbar-button/index.js +1 -2
- package/build-module/toolbar/toolbar-button/index.js.map +1 -1
- package/build-module/toolbar/toolbar-item/index.js +5 -2
- package/build-module/toolbar/toolbar-item/index.js.map +1 -1
- package/build-module/utils/colors-values.js +3 -3
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/use-deprecated-props.js +25 -0
- package/build-module/utils/use-deprecated-props.js.map +1 -0
- package/build-style/style-rtl.css +67 -67
- package/build-style/style.css +67 -67
- package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/autocomplete/types.d.ts +2 -18
- package/build-types/autocomplete/types.d.ts.map +1 -1
- package/build-types/button/deprecated.d.ts +6 -0
- package/build-types/button/deprecated.d.ts.map +1 -1
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/button/types.d.ts +7 -0
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/card/card-media/component.d.ts +2 -1
- package/build-types/card/card-media/component.d.ts.map +1 -1
- package/build-types/card/stories/index.d.ts +21 -1
- package/build-types/card/stories/index.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/index.d.ts +1 -1
- package/build-types/combobox-control/index.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.d.ts.map +1 -1
- package/build-types/combobox-control/styles.d.ts +1 -1
- package/build-types/combobox-control/types.d.ts +8 -1
- package/build-types/combobox-control/types.d.ts.map +1 -1
- package/build-types/date-time/date-time/index.d.ts +3 -4
- package/build-types/date-time/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/date-time/styles.d.ts +0 -4
- package/build-types/date-time/date-time/styles.d.ts.map +1 -1
- package/build-types/date-time/stories/date-time.d.ts.map +1 -1
- package/build-types/date-time/types.d.ts +0 -14
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts +1 -1
- package/build-types/draggable/index.d.ts.map +1 -1
- package/build-types/dropdown-menu/index.d.ts +83 -1
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/dropdown-menu/stories/index.d.ts +13 -0
- package/build-types/dropdown-menu/stories/index.d.ts.map +1 -0
- package/build-types/dropdown-menu/test/index.d.ts +2 -0
- package/build-types/dropdown-menu/test/index.d.ts.map +1 -0
- package/build-types/dropdown-menu/types.d.ts +134 -0
- package/build-types/dropdown-menu/types.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/index.d.ts +17 -0
- package/build-types/dropdown-menu-v2/index.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/stories/index.d.ts +13 -0
- package/build-types/dropdown-menu-v2/stories/index.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/styles.d.ts +41 -0
- package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/test/index.d.ts +2 -0
- package/build-types/dropdown-menu-v2/test/index.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/types.d.ts +242 -0
- package/build-types/dropdown-menu-v2/types.d.ts.map +1 -0
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/styles.d.ts +1 -1
- package/build-types/form-token-field/types.d.ts +8 -1
- package/build-types/form-token-field/types.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/navigable-container/container.d.ts +20 -1
- package/build-types/navigable-container/container.d.ts.map +1 -1
- package/build-types/navigable-container/index.d.ts +5 -2
- package/build-types/navigable-container/index.d.ts.map +1 -1
- package/build-types/navigable-container/menu.d.ts +45 -11
- package/build-types/navigable-container/menu.d.ts.map +1 -1
- package/build-types/navigable-container/stories/navigable-menu.d.ts +12 -0
- package/build-types/navigable-container/stories/navigable-menu.d.ts.map +1 -0
- package/build-types/navigable-container/stories/tabbable-container.d.ts +12 -0
- package/build-types/navigable-container/stories/tabbable-container.d.ts.map +1 -0
- package/build-types/navigable-container/tabbable.d.ts +52 -9
- package/build-types/navigable-container/tabbable.d.ts.map +1 -1
- package/build-types/navigable-container/test/navigable-menu.d.ts +2 -0
- package/build-types/navigable-container/test/navigable-menu.d.ts.map +1 -0
- package/build-types/navigable-container/test/tababble-container.d.ts +2 -0
- package/build-types/navigable-container/test/tababble-container.d.ts.map +1 -0
- package/build-types/navigable-container/types.d.ts +61 -0
- package/build-types/navigable-container/types.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/component.d.ts +1 -0
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +1 -0
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +1 -0
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +1 -0
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -0
- package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts +1 -1
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/palette-edit/stories/index.d.ts.map +1 -1
- package/build-types/palette-edit/types.d.ts +8 -0
- package/build-types/palette-edit/types.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts +4 -2
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/index.d.ts +1 -2
- package/build-types/slot-fill/index.d.ts.map +1 -1
- package/build-types/slot-fill/provider.d.ts +0 -2
- package/build-types/slot-fill/provider.d.ts.map +1 -1
- package/build-types/slot-fill/slot.d.ts.map +1 -1
- package/build-types/snackbar/list.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/toolbar/stories/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts +6 -0
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-item/index.d.ts +6 -4
- package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
- package/build-types/tree-grid/types.d.ts +7 -0
- package/build-types/tree-grid/types.d.ts.map +1 -1
- package/build-types/ui/context/get-styled-class-name-from-key.d.ts +1 -10
- package/build-types/ui/context/get-styled-class-name-from-key.d.ts.map +1 -1
- package/build-types/utils/use-deprecated-props.d.ts +9 -0
- package/build-types/utils/use-deprecated-props.d.ts.map +1 -0
- package/package.json +21 -20
- package/src/autocomplete/README.md +78 -52
- package/src/autocomplete/autocompleter-ui.tsx +0 -2
- package/src/autocomplete/index.tsx +1 -2
- package/src/autocomplete/types.ts +3 -19
- package/src/button/index.tsx +2 -0
- package/src/button/style.scss +18 -18
- package/src/button/types.ts +7 -0
- package/src/card/card-media/README.md +1 -1
- package/src/card/card-media/component.tsx +2 -1
- package/src/card/stories/index.tsx +47 -26
- package/src/checkbox-control/style.scss +1 -4
- package/src/color-picker/styles.ts +7 -2
- package/src/combobox-control/index.tsx +24 -18
- package/src/combobox-control/stories/index.tsx +0 -1
- package/src/combobox-control/styles.ts +4 -4
- package/src/combobox-control/types.ts +8 -1
- package/src/custom-gradient-picker/style.scss +2 -2
- package/src/date-time/README.md +0 -16
- package/src/date-time/date-time/index.tsx +17 -155
- package/src/date-time/date-time/styles.ts +0 -4
- package/src/date-time/stories/date-time.tsx +0 -4
- package/src/date-time/types.ts +0 -16
- package/src/dimension-control/index.tsx +1 -1
- package/src/draggable/index.tsx +1 -9
- package/src/dropdown-menu/README.md +12 -22
- package/src/dropdown-menu/{index.js → index.tsx} +111 -25
- package/src/dropdown-menu/stories/{index.js → index.tsx} +14 -22
- package/src/dropdown-menu/test/{index.js → index.tsx} +6 -5
- package/src/dropdown-menu/types.ts +143 -0
- package/src/dropdown-menu-v2/README.md +392 -0
- package/src/dropdown-menu-v2/index.tsx +241 -0
- package/src/dropdown-menu-v2/stories/index.tsx +193 -0
- package/src/dropdown-menu-v2/styles.ts +263 -0
- package/src/dropdown-menu-v2/test/index.tsx +816 -0
- package/src/dropdown-menu-v2/types.ts +250 -0
- package/src/form-toggle/style.scss +1 -5
- package/src/form-token-field/index.tsx +7 -3
- package/src/form-token-field/styles.ts +4 -4
- package/src/form-token-field/types.ts +8 -1
- package/src/index.native.js +0 -1
- package/src/input-control/styles/input-control-styles.tsx +7 -0
- package/src/mobile/bottom-sheet/cell.native.js +26 -5
- package/src/mobile/bottom-sheet/range-cell.native.js +2 -1
- package/src/mobile/bottom-sheet/stepper-cell/index.native.js +2 -0
- package/src/mobile/bottom-sheet/styles.native.scss +13 -1
- package/src/mobile/bottom-sheet/switch-cell.native.js +10 -2
- package/src/mobile/bottom-sheet-select-control/index.native.js +2 -0
- package/src/mobile/bottom-sheet-text-control/index.native.js +2 -0
- package/src/mobile/global-styles-context/index.native.js +12 -1
- package/src/mobile/link-picker/link-picker-results.native.js +3 -0
- package/src/modal/style.scss +1 -1
- package/src/navigable-container/README.md +24 -13
- package/src/navigable-container/{container.js → container.tsx} +57 -27
- package/src/navigable-container/{index.js → index.tsx} +0 -1
- package/src/navigable-container/menu.tsx +100 -0
- package/src/navigable-container/stories/{navigable-menu.js → navigable-menu.tsx} +15 -10
- package/src/navigable-container/stories/{tabbable-container.js → tabbable-container.tsx} +15 -6
- package/src/navigable-container/tabbable.tsx +92 -0
- package/src/navigable-container/test/{navigable-menu.js → navigable-menu.tsx} +3 -1
- package/src/navigable-container/test/{tababble-container.js → tababble-container.tsx} +53 -24
- package/src/navigable-container/types.ts +76 -0
- package/src/palette-edit/index.tsx +45 -7
- package/src/palette-edit/stories/index.tsx +4 -0
- package/src/palette-edit/types.ts +11 -0
- package/src/private-apis.ts +22 -0
- package/src/range-control/index.native.js +3 -0
- package/src/sandbox/index.native.js +4 -0
- package/src/search-control/style.scss +2 -0
- package/src/slot-fill/bubbles-virtually/fill.js +2 -1
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +46 -60
- package/src/slot-fill/bubbles-virtually/use-slot.js +14 -41
- package/src/slot-fill/fill.js +4 -26
- package/src/slot-fill/index.js +1 -3
- package/src/slot-fill/provider.js +0 -6
- package/src/slot-fill/slot.js +0 -5
- package/src/snackbar/list.tsx +0 -1
- package/src/style.scss +6 -0
- package/src/tab-panel/index.tsx +1 -1
- package/src/theme/color-algorithms.ts +1 -1
- package/src/theme/stories/index.tsx +1 -1
- package/src/theme/test/color-algorithms.ts +2 -2
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +10 -6
- package/src/toggle-group-control/toggle-group-control/styles.ts +6 -1
- package/src/toolbar/stories/index.tsx +25 -26
- package/src/toolbar/toolbar-button/index.tsx +10 -13
- package/src/toolbar/toolbar-item/{index.js → index.tsx} +12 -3
- package/src/tooltip/style.scss +2 -2
- package/src/tree-grid/README.md +18 -0
- package/src/tree-grid/types.ts +7 -0
- package/src/utils/colors-values.js +3 -3
- package/src/utils/theme-variables.scss +4 -4
- package/src/utils/use-deprecated-props.ts +29 -0
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/mobile/readable-content-view/index.native.js +0 -97
- package/build/mobile/readable-content-view/index.native.js.map +0 -1
- package/build-module/mobile/readable-content-view/index.native.js +0 -81
- package/build-module/mobile/readable-content-view/index.native.js.map +0 -1
- package/src/CONTRIBUTING.md +0 -78
- package/src/README.md +0 -20
- package/src/mobile/readable-content-view/index.native.js +0 -85
- package/src/mobile/readable-content-view/style.native.scss +0 -30
- package/src/navigable-container/menu.js +0 -62
- package/src/navigable-container/tabbable.js +0 -46
|
@@ -152,57 +152,83 @@ Whether to apply debouncing for the autocompleter. Set to true to enable debounc
|
|
|
152
152
|
|
|
153
153
|
## Usage
|
|
154
154
|
|
|
155
|
-
The
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
155
|
+
The `Autocomplete` component is not currently intended to be used as a standalone component. It is used by other packages to provide autocompletion support for the block editor.
|
|
156
|
+
|
|
157
|
+
The block editor provides a separate, wrapped version of `Autocomplete` that supports the addition of custom completers via a filter.
|
|
158
|
+
|
|
159
|
+
To implement your own completer in the block editor you will:
|
|
160
|
+
1. Define the completer
|
|
161
|
+
2. Write a callback that will add your completer to the list of existing completers
|
|
162
|
+
3. Add a filter to the `editor.Autocomplete.completers` hook that will call your callback
|
|
163
|
+
|
|
164
|
+
The following example will add a contrived "fruits" autocompleter to the block editor. Note that in the callback it's possible to limit this new completer to a specific block type. In this case, our "fruits" completer will only be available from the "core/paragraph" block type.
|
|
165
|
+
|
|
166
|
+
```js
|
|
167
|
+
( function () {
|
|
168
|
+
// Define the completer
|
|
169
|
+
const fruits = {
|
|
170
|
+
name: 'fruit',
|
|
171
|
+
// The prefix that triggers this completer
|
|
172
|
+
triggerPrefix: '~',
|
|
173
|
+
// The option data
|
|
174
|
+
options: [
|
|
175
|
+
{ visual: '🍎', name: 'Apple', id: 1 },
|
|
176
|
+
{ visual: '🍊', name: 'Orange', id: 2 },
|
|
177
|
+
{ visual: '🍇', name: 'Grapes', id: 3 },
|
|
178
|
+
{ visual: '🥭', name: 'Mango', id: 4 },
|
|
179
|
+
{ visual: '🍓', name: 'Strawberry', id: 5 },
|
|
180
|
+
{ visual: '🫐', name: 'Blueberry', id: 6 },
|
|
181
|
+
{ visual: '🍒', name: 'Cherry', id: 7 },
|
|
182
|
+
],
|
|
183
|
+
// Returns a label for an option like "🍊 Orange"
|
|
184
|
+
getOptionLabel: ( option ) => `${ option.visual } ${ option.name }`,
|
|
185
|
+
// Declares that options should be matched by their name
|
|
186
|
+
getOptionKeywords: ( option ) => [ option.name ],
|
|
187
|
+
// Declares that the Grapes option is disabled
|
|
188
|
+
isOptionDisabled: ( option ) => option.name === 'Grapes',
|
|
189
|
+
// Declares completions should be inserted as abbreviations
|
|
190
|
+
getOptionCompletion: ( option ) => option.visual,
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
// Define a callback that will add the custom completer to the list of completers
|
|
194
|
+
function appendTestCompleters( completers, blockName ) {
|
|
195
|
+
return blockName === 'core/paragraph'
|
|
196
|
+
? [ ...completers, fruits ]
|
|
197
|
+
: completers;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Trigger our callback on the `editor.Autocomplete.completers` hook
|
|
201
|
+
wp.hooks.addFilter(
|
|
202
|
+
'editor.Autocomplete.completers',
|
|
203
|
+
'fruit-test/fruits',
|
|
204
|
+
appendTestCompleters,
|
|
205
|
+
11
|
|
206
206
|
);
|
|
207
|
-
};
|
|
207
|
+
} )();
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Finally, enqueue your JavaScript file as you would any other, as in the following plugin example:
|
|
211
|
+
|
|
212
|
+
```php
|
|
213
|
+
<?php
|
|
214
|
+
/**
|
|
215
|
+
* Plugin Name: Fruit Autocompleter
|
|
216
|
+
* Plugin URI: https://github.com/WordPress/gutenberg
|
|
217
|
+
* Author: Gutenberg Team
|
|
218
|
+
*/
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Registers a custom script for the plugin.
|
|
222
|
+
*/
|
|
223
|
+
function enqueue_fruit_autocompleter_plugin_script() {
|
|
224
|
+
wp_enqueue_script(
|
|
225
|
+
'fruit-autocompleter',
|
|
226
|
+
plugins_url( '/index.js', __FILE__ ),
|
|
227
|
+
array(
|
|
228
|
+
'wp-hooks',
|
|
229
|
+
),
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
add_action( 'init', 'enqueue_fruit_autocompleter_plugin_script' );
|
|
208
234
|
```
|
|
@@ -12,8 +12,6 @@ import {
|
|
|
12
12
|
useEffect,
|
|
13
13
|
useState,
|
|
14
14
|
} from '@wordpress/element';
|
|
15
|
-
// Error expected because `@wordpress/rich-text` is not yet fully typed.
|
|
16
|
-
// @ts-expect-error
|
|
17
15
|
import { useAnchor } from '@wordpress/rich-text';
|
|
18
16
|
import { useMergeRefs, useRefEffect } from '@wordpress/compose';
|
|
19
17
|
|
|
@@ -26,8 +26,6 @@ import {
|
|
|
26
26
|
insert,
|
|
27
27
|
isCollapsed,
|
|
28
28
|
getTextContent,
|
|
29
|
-
// Error expected because `@wordpress/rich-text` is not yet fully typed.
|
|
30
|
-
// @ts-expect-error
|
|
31
29
|
} from '@wordpress/rich-text';
|
|
32
30
|
import { speak } from '@wordpress/a11y';
|
|
33
31
|
|
|
@@ -241,6 +239,7 @@ export function useAutocomplete( {
|
|
|
241
239
|
if ( isCollapsed( record ) ) {
|
|
242
240
|
return getTextContent( slice( record, 0 ) );
|
|
243
241
|
}
|
|
242
|
+
return '';
|
|
244
243
|
}, [ record ] );
|
|
245
244
|
|
|
246
245
|
useEffect( () => {
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import type { WPElement } from '@wordpress/element';
|
|
5
|
+
import type { RichTextValue } from '@wordpress/rich-text';
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Internal dependencies
|
|
7
9
|
*/
|
|
@@ -157,24 +159,6 @@ export type CancelablePromise< T = void > = Promise< T > & {
|
|
|
157
159
|
canceled?: boolean;
|
|
158
160
|
};
|
|
159
161
|
|
|
160
|
-
/**
|
|
161
|
-
* When `@wordpress/rich-text` is fully typed, the following
|
|
162
|
-
* types should be moved to and imported from there
|
|
163
|
-
*
|
|
164
|
-
* @see /packages/rich-text/src/create.js
|
|
165
|
-
*/
|
|
166
|
-
type RichTextFormat = {
|
|
167
|
-
type: string;
|
|
168
|
-
};
|
|
169
|
-
type RichTextFormatList = Array< RichTextFormat >;
|
|
170
|
-
type RichTextValue = {
|
|
171
|
-
text: string;
|
|
172
|
-
formats?: Array< RichTextFormatList >;
|
|
173
|
-
replacements?: Array< RichTextFormat >;
|
|
174
|
-
start: number | undefined;
|
|
175
|
-
end: number | undefined;
|
|
176
|
-
};
|
|
177
|
-
|
|
178
162
|
export type UseAutocompleteProps = {
|
|
179
163
|
/**
|
|
180
164
|
* The rich text value object the autocompleter is being applied to.
|
|
@@ -187,7 +171,7 @@ export type UseAutocompleteProps = {
|
|
|
187
171
|
* A function to be called when an option is selected to insert into the
|
|
188
172
|
* existing text.
|
|
189
173
|
*/
|
|
190
|
-
onChange: ( value:
|
|
174
|
+
onChange: ( value: RichTextValue ) => void;
|
|
191
175
|
/**
|
|
192
176
|
* A function to be called when an option is selected to replace the
|
|
193
177
|
* existing text.
|
package/src/button/index.tsx
CHANGED
|
@@ -75,6 +75,7 @@ export function UnforwardedButton(
|
|
|
75
75
|
ref: ForwardedRef< any >
|
|
76
76
|
) {
|
|
77
77
|
const {
|
|
78
|
+
__next40pxDefaultSize,
|
|
78
79
|
isSmall,
|
|
79
80
|
isPressed,
|
|
80
81
|
isBusy,
|
|
@@ -115,6 +116,7 @@ export function UnforwardedButton(
|
|
|
115
116
|
children?.[ 0 ]?.props?.className !== 'components-tooltip' );
|
|
116
117
|
|
|
117
118
|
const classes = classnames( 'components-button', className, {
|
|
119
|
+
'is-next-40px-default-size': __next40pxDefaultSize,
|
|
118
120
|
'is-secondary': variant === 'secondary',
|
|
119
121
|
'is-primary': variant === 'primary',
|
|
120
122
|
'is-small': isSmall,
|
package/src/button/style.scss
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
border-radius: $radius-block-ui;
|
|
19
19
|
color: $components-color-foreground;
|
|
20
20
|
|
|
21
|
+
&.is-next-40px-default-size {
|
|
22
|
+
height: $button-size-next-default-40px;
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
&[aria-expanded="true"],
|
|
22
26
|
&:hover {
|
|
23
27
|
color: $components-color-accent;
|
|
@@ -114,21 +118,14 @@
|
|
|
114
118
|
outline: 1px solid transparent;
|
|
115
119
|
|
|
116
120
|
&:active:not(:disabled) {
|
|
117
|
-
background: $components-color-gray-300;
|
|
118
|
-
color: $components-color-accent-darker-10;
|
|
119
121
|
box-shadow: none;
|
|
120
122
|
}
|
|
121
123
|
|
|
122
|
-
&:hover:not(:disabled) {
|
|
123
|
-
color: $components-color-accent-darker-10;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
124
|
&:disabled,
|
|
127
125
|
&[aria-disabled="true"],
|
|
128
126
|
&[aria-disabled="true"]:hover {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
background: lighten($gray-300, 5%);
|
|
127
|
+
color: $gray-600;
|
|
128
|
+
background: transparent;
|
|
132
129
|
transform: none;
|
|
133
130
|
opacity: 1;
|
|
134
131
|
box-shadow: none;
|
|
@@ -160,13 +157,14 @@
|
|
|
160
157
|
white-space: nowrap;
|
|
161
158
|
color: $components-color-accent;
|
|
162
159
|
background: transparent;
|
|
163
|
-
padding: $grid-unit-15 * 0.5; // This reduces the horizontal padding on tertiary/text buttons, so as to space them optically.
|
|
164
160
|
|
|
165
|
-
&:hover:not(:disabled) {
|
|
161
|
+
&:hover:not(:disabled, [aria-disabled="true"]) {
|
|
162
|
+
// TODO: Prepare for theming (https://github.com/WordPress/gutenberg/pull/45466/files#r1030872724)
|
|
166
163
|
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
|
|
167
164
|
}
|
|
168
165
|
|
|
169
|
-
&:active:not(:disabled) {
|
|
166
|
+
&:active:not(:disabled, [aria-disabled="true"]) {
|
|
167
|
+
// TODO: Prepare for theming (https://github.com/WordPress/gutenberg/pull/45466/files#r1030872724)
|
|
170
168
|
background: rgba(var(--wp-admin-theme-color--rgb), 0.08);
|
|
171
169
|
}
|
|
172
170
|
|
|
@@ -234,7 +232,7 @@
|
|
|
234
232
|
}
|
|
235
233
|
}
|
|
236
234
|
|
|
237
|
-
&:not([aria-disabled="true"]):active {
|
|
235
|
+
&:not(:disabled, [aria-disabled="true"]):active {
|
|
238
236
|
color: $components-color-foreground;
|
|
239
237
|
}
|
|
240
238
|
|
|
@@ -284,6 +282,10 @@
|
|
|
284
282
|
min-width: $button-size;
|
|
285
283
|
justify-content: center;
|
|
286
284
|
|
|
285
|
+
&.is-next-40px-default-size {
|
|
286
|
+
min-width: $button-size-next-default-40px;
|
|
287
|
+
}
|
|
288
|
+
|
|
287
289
|
.dashicon {
|
|
288
290
|
display: inline-block;
|
|
289
291
|
flex: 0 0 auto;
|
|
@@ -293,11 +295,9 @@
|
|
|
293
295
|
|
|
294
296
|
&.has-text {
|
|
295
297
|
justify-content: start;
|
|
296
|
-
padding-right:
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
&.has-text svg {
|
|
300
|
-
margin-right: $grid-unit-10;
|
|
298
|
+
padding-right: $grid-unit-15;
|
|
299
|
+
padding-left: $grid-unit-10;
|
|
300
|
+
gap: $grid-unit-05;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
&.has-text .dashicon {
|
package/src/button/types.ts
CHANGED
|
@@ -18,6 +18,13 @@ export type ButtonAsButtonProps = BaseButtonProps & _ButtonProps;
|
|
|
18
18
|
export type ButtonAsAnchorProps = BaseButtonProps & AnchorProps;
|
|
19
19
|
|
|
20
20
|
type BaseButtonProps = {
|
|
21
|
+
/**
|
|
22
|
+
* Start opting into the larger default height that will become the
|
|
23
|
+
* default size in a future version.
|
|
24
|
+
*
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
__next40pxDefaultSize?: boolean;
|
|
21
28
|
/**
|
|
22
29
|
* The button's children.
|
|
23
30
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CardMedia
|
|
2
2
|
|
|
3
|
-
`CardMedia` provides a container for
|
|
3
|
+
`CardMedia` provides a container for full-bleed content within a [`Card`](/packages/components/src/card/card/README.md), such as images, video, or even just a background color.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -21,7 +21,8 @@ function UnconnectedCardMedia(
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* `CardMedia` provides a container for
|
|
24
|
+
* `CardMedia` provides a container for full-bleed content within a `Card`,
|
|
25
|
+
* such as images, video, or even just a background color.
|
|
25
26
|
*
|
|
26
27
|
* @example
|
|
27
28
|
* ```jsx
|
|
@@ -41,31 +41,52 @@ const meta: ComponentMeta< typeof Card > = {
|
|
|
41
41
|
export default meta;
|
|
42
42
|
|
|
43
43
|
const Template: ComponentStory< typeof Card > = ( args ) => (
|
|
44
|
-
<Card { ...args }
|
|
45
|
-
<CardHeader>
|
|
46
|
-
<Heading>CardHeader</Heading>
|
|
47
|
-
</CardHeader>
|
|
48
|
-
<CardBody>
|
|
49
|
-
<Text>CardBody</Text>
|
|
50
|
-
</CardBody>
|
|
51
|
-
<CardBody>
|
|
52
|
-
<Text>CardBody (before CardDivider)</Text>
|
|
53
|
-
</CardBody>
|
|
54
|
-
<CardDivider />
|
|
55
|
-
<CardBody>
|
|
56
|
-
<Text>CardBody (after CardDivider)</Text>
|
|
57
|
-
</CardBody>
|
|
58
|
-
<CardMedia>
|
|
59
|
-
<img
|
|
60
|
-
alt="Card Media"
|
|
61
|
-
src="https://images.unsplash.com/photo-1566125882500-87e10f726cdc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1867&q=80"
|
|
62
|
-
/>
|
|
63
|
-
</CardMedia>
|
|
64
|
-
<CardFooter>
|
|
65
|
-
<Text>CardFooter</Text>
|
|
66
|
-
<Button variant="secondary">Action Button</Button>
|
|
67
|
-
</CardFooter>
|
|
68
|
-
</Card>
|
|
44
|
+
<Card { ...args } />
|
|
69
45
|
);
|
|
70
46
|
|
|
71
|
-
export const Default
|
|
47
|
+
export const Default = Template.bind( {} );
|
|
48
|
+
Default.args = {
|
|
49
|
+
children: (
|
|
50
|
+
<>
|
|
51
|
+
<CardHeader>
|
|
52
|
+
<Heading>CardHeader</Heading>
|
|
53
|
+
</CardHeader>
|
|
54
|
+
<CardBody>
|
|
55
|
+
<Text>CardBody</Text>
|
|
56
|
+
</CardBody>
|
|
57
|
+
<CardBody>
|
|
58
|
+
<Text>CardBody (before CardDivider)</Text>
|
|
59
|
+
</CardBody>
|
|
60
|
+
<CardDivider />
|
|
61
|
+
<CardBody>
|
|
62
|
+
<Text>CardBody (after CardDivider)</Text>
|
|
63
|
+
</CardBody>
|
|
64
|
+
<CardMedia>
|
|
65
|
+
<img
|
|
66
|
+
alt="Card Media"
|
|
67
|
+
src="https://images.unsplash.com/photo-1566125882500-87e10f726cdc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1867&q=80"
|
|
68
|
+
/>
|
|
69
|
+
</CardMedia>
|
|
70
|
+
<CardFooter>
|
|
71
|
+
<Text>CardFooter</Text>
|
|
72
|
+
<Button variant="secondary">Action Button</Button>
|
|
73
|
+
</CardFooter>
|
|
74
|
+
</>
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* `CardMedia` provides a container for full-bleed content within a `Card`,
|
|
80
|
+
* such as images, video, or even just a background color. The corners will be rounded if necessary.
|
|
81
|
+
*/
|
|
82
|
+
export const FullBleedContent = Template.bind( {} );
|
|
83
|
+
FullBleedContent.args = {
|
|
84
|
+
...Default.args,
|
|
85
|
+
children: (
|
|
86
|
+
<CardMedia>
|
|
87
|
+
<div style={ { padding: 16, background: 'beige' } }>
|
|
88
|
+
Some full bleed content
|
|
89
|
+
</div>
|
|
90
|
+
</CardMedia>
|
|
91
|
+
),
|
|
92
|
+
};
|
|
@@ -27,10 +27,7 @@ $checkbox-input-size-sm: 24px; // Width & height for small viewports.
|
|
|
27
27
|
@include reduce-motion("transition");
|
|
28
28
|
|
|
29
29
|
&:focus {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// Only visible in Windows High Contrast mode.
|
|
33
|
-
outline: 2px solid transparent;
|
|
30
|
+
@include button-style-outset__focus(var(--wp-admin-theme-color));
|
|
34
31
|
}
|
|
35
32
|
|
|
36
33
|
&:checked,
|
|
@@ -29,8 +29,13 @@ export const NumberControlWrapper = styled( NumberControl )`
|
|
|
29
29
|
export const SelectControl = styled( InnerSelectControl )`
|
|
30
30
|
margin-left: ${ space( -2 ) };
|
|
31
31
|
width: 5em;
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
/*
|
|
33
|
+
* Remove border, but preserve focus styles
|
|
34
|
+
* TODO: this override should be removed,
|
|
35
|
+
* see https://github.com/WordPress/gutenberg/pull/50609
|
|
36
|
+
*/
|
|
37
|
+
select:not( :focus ) ~ ${ BackdropUI }${ BackdropUI }${ BackdropUI } {
|
|
38
|
+
border-color: transparent;
|
|
34
39
|
}
|
|
35
40
|
`;
|
|
36
41
|
|
|
@@ -32,6 +32,7 @@ import { useControlledValue } from '../utils/hooks';
|
|
|
32
32
|
import { normalizeTextString } from '../utils/strings';
|
|
33
33
|
import type { ComboboxControlOption, ComboboxControlProps } from './types';
|
|
34
34
|
import type { TokenInputProps } from '../form-token-field/types';
|
|
35
|
+
import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';
|
|
35
36
|
|
|
36
37
|
const noop = () => {};
|
|
37
38
|
|
|
@@ -104,23 +105,28 @@ const getIndexOfMatchingSuggestion = (
|
|
|
104
105
|
* }
|
|
105
106
|
* ```
|
|
106
107
|
*/
|
|
107
|
-
function ComboboxControl( {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
function ComboboxControl( props: ComboboxControlProps ) {
|
|
109
|
+
const {
|
|
110
|
+
__nextHasNoMarginBottom = false,
|
|
111
|
+
__next40pxDefaultSize = false,
|
|
112
|
+
value: valueProp,
|
|
113
|
+
label,
|
|
114
|
+
options,
|
|
115
|
+
onChange: onChangeProp,
|
|
116
|
+
onFilterValueChange = noop,
|
|
117
|
+
hideLabelFromVision,
|
|
118
|
+
help,
|
|
119
|
+
allowReset = true,
|
|
120
|
+
className,
|
|
121
|
+
messages = {
|
|
122
|
+
selected: __( 'Item selected.' ),
|
|
123
|
+
},
|
|
124
|
+
__experimentalRenderItem,
|
|
125
|
+
} = useDeprecated36pxDefaultSizeProp< ComboboxControlProps >(
|
|
126
|
+
props,
|
|
127
|
+
'wp.components.ComboboxControl'
|
|
128
|
+
);
|
|
129
|
+
|
|
124
130
|
const [ value, setValue ] = useControlledValue( {
|
|
125
131
|
value: valueProp,
|
|
126
132
|
onChange: onChangeProp,
|
|
@@ -314,7 +320,7 @@ function ComboboxControl( {
|
|
|
314
320
|
onKeyDown={ onKeyDown }
|
|
315
321
|
>
|
|
316
322
|
<InputWrapperFlex
|
|
317
|
-
|
|
323
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
318
324
|
>
|
|
319
325
|
<FlexBlock>
|
|
320
326
|
<TokenInput
|
|
@@ -12,9 +12,9 @@ import { space } from '../ui/utils/space';
|
|
|
12
12
|
import type { ComboboxControlProps } from './types';
|
|
13
13
|
|
|
14
14
|
const deprecatedDefaultSize = ( {
|
|
15
|
-
|
|
16
|
-
}: Pick< ComboboxControlProps, '
|
|
17
|
-
!
|
|
15
|
+
__next40pxDefaultSize,
|
|
16
|
+
}: Pick< ComboboxControlProps, '__next40pxDefaultSize' > ) =>
|
|
17
|
+
! __next40pxDefaultSize &&
|
|
18
18
|
css`
|
|
19
19
|
height: 28px; // 30px - 2px vertical borders on parent container
|
|
20
20
|
padding-left: ${ space( 1 ) };
|
|
@@ -22,7 +22,7 @@ const deprecatedDefaultSize = ( {
|
|
|
22
22
|
`;
|
|
23
23
|
|
|
24
24
|
export const InputWrapperFlex = styled( Flex )`
|
|
25
|
-
height:
|
|
25
|
+
height: 38px; // 40px - 2px vertical borders on parent container
|
|
26
26
|
padding-left: ${ space( 2 ) };
|
|
27
27
|
padding-right: ${ space( 2 ) };
|
|
28
28
|
|
|
@@ -26,11 +26,18 @@ export type ComboboxControlProps = Pick<
|
|
|
26
26
|
item: ComboboxControlOption;
|
|
27
27
|
} ) => React.ReactNode;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Deprecated. Use `__next40pxDefaultSize` instead.
|
|
30
30
|
*
|
|
31
31
|
* @default false
|
|
32
|
+
* @deprecated
|
|
32
33
|
*/
|
|
33
34
|
__next36pxDefaultSize?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Start opting into the larger default height that will become the default size in a future version.
|
|
37
|
+
*
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
__next40pxDefaultSize?: boolean;
|
|
34
41
|
/**
|
|
35
42
|
* Show a reset button to clear the input.
|
|
36
43
|
*
|
|
@@ -76,14 +76,14 @@ $components-custom-gradient-picker__padding: $grid-unit-20; // 48px container, 1
|
|
|
76
76
|
padding: 0;
|
|
77
77
|
|
|
78
78
|
// Shadow and stroke.
|
|
79
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $white, 0 0 $border-width-focus 0 rgba($black, 0.25);
|
|
79
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $white, 0 0 $border-width-focus-fallback 0 rgba($black, 0.25);
|
|
80
80
|
|
|
81
81
|
// Windows High Contrast mode will show this outline, but not the box-shadow.
|
|
82
82
|
outline: 2px solid transparent;
|
|
83
83
|
|
|
84
84
|
&:focus,
|
|
85
85
|
&.is-active {
|
|
86
|
-
box-shadow: inset 0 0 0 calc(var(--wp-admin-border-width-focus) * 2) $white, 0 0 $border-width-focus 0 rgba($black, 0.25);
|
|
86
|
+
box-shadow: inset 0 0 0 calc(var(--wp-admin-border-width-focus) * 2) $white, 0 0 $border-width-focus-fallback 0 rgba($black, 0.25);
|
|
87
87
|
|
|
88
88
|
// Windows High Contrast mode will show this outline, but not the box-shadow.
|
|
89
89
|
outline: $border-width-tab solid transparent;
|
package/src/date-time/README.md
CHANGED
|
@@ -26,8 +26,6 @@ const MyDateTimePicker = () => {
|
|
|
26
26
|
currentDate={ date }
|
|
27
27
|
onChange={ ( newDate ) => setDate( newDate ) }
|
|
28
28
|
is12Hour={ true }
|
|
29
|
-
__nextRemoveHelpButton
|
|
30
|
-
__nextRemoveResetButton
|
|
31
29
|
/>
|
|
32
30
|
);
|
|
33
31
|
};
|
|
@@ -83,17 +81,3 @@ The day that the week should start on. 0 for Sunday, 1 for Monday, etc.
|
|
|
83
81
|
|
|
84
82
|
- Required: No
|
|
85
83
|
- Default: 0
|
|
86
|
-
|
|
87
|
-
### `__nextRemoveHelpButton`: `boolean`
|
|
88
|
-
|
|
89
|
-
Start opting in to not displaying a Help button which will become the default in a future version.
|
|
90
|
-
|
|
91
|
-
- Required: No
|
|
92
|
-
- Default: `false`
|
|
93
|
-
|
|
94
|
-
### `__nextRemoveResetButton`: `boolean`
|
|
95
|
-
|
|
96
|
-
Start opting in to not displaying a Reset button which will become the default in a future version.
|
|
97
|
-
|
|
98
|
-
- Required: No
|
|
99
|
-
- Default: `false`
|