@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
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
5
|
+
|
|
6
|
+
export type DropdownMenuProps = {
|
|
7
|
+
/**
|
|
8
|
+
* The open state of the dropdown menu when it is initially rendered. Use when
|
|
9
|
+
* you do not need to control its open state.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
defaultOpen?: DropdownMenuPrimitive.DropdownMenuProps[ 'defaultOpen' ];
|
|
13
|
+
/**
|
|
14
|
+
* The controlled open state of the dropdown menu. Must be used in conjunction
|
|
15
|
+
* with `onOpenChange`.
|
|
16
|
+
*/
|
|
17
|
+
open?: DropdownMenuPrimitive.DropdownMenuProps[ 'open' ];
|
|
18
|
+
/**
|
|
19
|
+
* Event handler called when the open state of the dropdown menu changes.
|
|
20
|
+
*/
|
|
21
|
+
onOpenChange?: DropdownMenuPrimitive.DropdownMenuProps[ 'onOpenChange' ];
|
|
22
|
+
/**
|
|
23
|
+
* The modality of the dropdown menu. When set to true, interaction with
|
|
24
|
+
* outside elements will be disabled and only menu content will be visible to
|
|
25
|
+
* screen readers.
|
|
26
|
+
*
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
modal?: DropdownMenuPrimitive.DropdownMenuProps[ 'modal' ];
|
|
30
|
+
/**
|
|
31
|
+
* The preferred side of the trigger to render against when open.
|
|
32
|
+
* Will be reversed when collisions occur and avoidCollisions is enabled.
|
|
33
|
+
*
|
|
34
|
+
* @default 'bottom'
|
|
35
|
+
*/
|
|
36
|
+
side?: DropdownMenuPrimitive.DropdownMenuContentProps[ 'side' ];
|
|
37
|
+
/**
|
|
38
|
+
* The distance in pixels from the trigger.
|
|
39
|
+
*
|
|
40
|
+
* @default 0
|
|
41
|
+
*/
|
|
42
|
+
sideOffset?: DropdownMenuPrimitive.DropdownMenuContentProps[ 'sideOffset' ];
|
|
43
|
+
/**
|
|
44
|
+
* The preferred alignment against the trigger.
|
|
45
|
+
* May change when collisions occur.
|
|
46
|
+
*
|
|
47
|
+
* @default 'center'
|
|
48
|
+
*/
|
|
49
|
+
align?: DropdownMenuPrimitive.DropdownMenuContentProps[ 'align' ];
|
|
50
|
+
/**
|
|
51
|
+
* An offset in pixels from the "start" or "end" alignment options.
|
|
52
|
+
*
|
|
53
|
+
* @default 0
|
|
54
|
+
*/
|
|
55
|
+
alignOffset?: DropdownMenuPrimitive.DropdownMenuContentProps[ 'alignOffset' ];
|
|
56
|
+
/**
|
|
57
|
+
* The trigger button.
|
|
58
|
+
*/
|
|
59
|
+
trigger: React.ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* The contents of the dropdown
|
|
62
|
+
*/
|
|
63
|
+
children: React.ReactNode;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type DropdownSubMenuTriggerProps = {
|
|
67
|
+
/**
|
|
68
|
+
* The contents of the item.
|
|
69
|
+
*/
|
|
70
|
+
children: React.ReactNode;
|
|
71
|
+
/**
|
|
72
|
+
* The contents of the item's prefix.
|
|
73
|
+
*/
|
|
74
|
+
prefix?: React.ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* The contents of the item's suffix.
|
|
77
|
+
*
|
|
78
|
+
* @default The standard chevron icon for a submenu trigger.
|
|
79
|
+
*/
|
|
80
|
+
suffix?: React.ReactNode;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export type DropdownSubMenuProps = {
|
|
84
|
+
/**
|
|
85
|
+
* The open state of the submenu when it is initially rendered. Use when you
|
|
86
|
+
* do not need to control its open state.
|
|
87
|
+
*/
|
|
88
|
+
defaultOpen?: DropdownMenuPrimitive.DropdownMenuSubProps[ 'defaultOpen' ];
|
|
89
|
+
/**
|
|
90
|
+
* The controlled open state of the submenu. Must be used in conjunction with
|
|
91
|
+
* `onOpenChange`.
|
|
92
|
+
*/
|
|
93
|
+
open?: DropdownMenuPrimitive.DropdownMenuSubProps[ 'open' ];
|
|
94
|
+
/**
|
|
95
|
+
* Event handler called when the open state of the submenu changes.
|
|
96
|
+
*/
|
|
97
|
+
onOpenChange?: DropdownMenuPrimitive.DropdownMenuSubProps[ 'onOpenChange' ];
|
|
98
|
+
/**
|
|
99
|
+
* When `true`, prevents the user from interacting with the item.
|
|
100
|
+
*/
|
|
101
|
+
disabled?: DropdownMenuPrimitive.DropdownMenuSubTriggerProps[ 'disabled' ];
|
|
102
|
+
/**
|
|
103
|
+
* Optional text used for typeahead purposes for the trigger. By default the typeahead
|
|
104
|
+
* behavior will use the `.textContent` of the trigger. Use this when the content
|
|
105
|
+
* is complex, or you have non-textual content inside.
|
|
106
|
+
*/
|
|
107
|
+
textValue?: DropdownMenuPrimitive.DropdownMenuSubTriggerProps[ 'textValue' ];
|
|
108
|
+
/**
|
|
109
|
+
* The contents rendered inside the trigger. The trigger should be
|
|
110
|
+
* an instance of the `DropdownSubMenuTriggerProps` component.
|
|
111
|
+
*/
|
|
112
|
+
trigger: React.ReactNode;
|
|
113
|
+
/**
|
|
114
|
+
* The contents of the dropdown sub menu
|
|
115
|
+
*/
|
|
116
|
+
children: React.ReactNode;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export type DropdownMenuItemProps = {
|
|
120
|
+
/**
|
|
121
|
+
* When true, prevents the user from interacting with the item.
|
|
122
|
+
*
|
|
123
|
+
* @default false
|
|
124
|
+
*/
|
|
125
|
+
disabled?: DropdownMenuPrimitive.DropdownMenuItemProps[ 'disabled' ];
|
|
126
|
+
/**
|
|
127
|
+
* Event handler called when the user selects an item (via mouse or keyboard).
|
|
128
|
+
* Calling `event.preventDefault` in this handler will prevent the dropdown
|
|
129
|
+
* menu from closing when selecting that item.
|
|
130
|
+
*/
|
|
131
|
+
onSelect?: DropdownMenuPrimitive.DropdownMenuItemProps[ 'onSelect' ];
|
|
132
|
+
/**
|
|
133
|
+
* Optional text used for typeahead purposes. By default the typeahead
|
|
134
|
+
* behavior will use the `.textContent` of the item. Use this when the content
|
|
135
|
+
* is complex, or you have non-textual content inside.
|
|
136
|
+
*/
|
|
137
|
+
textValue?: DropdownMenuPrimitive.DropdownMenuItemProps[ 'textValue' ];
|
|
138
|
+
/**
|
|
139
|
+
* The contents of the item
|
|
140
|
+
*/
|
|
141
|
+
children: React.ReactNode;
|
|
142
|
+
/**
|
|
143
|
+
* The contents of the item's prefix
|
|
144
|
+
*/
|
|
145
|
+
prefix?: React.ReactNode;
|
|
146
|
+
/**
|
|
147
|
+
* The contents of the item's suffix
|
|
148
|
+
*/
|
|
149
|
+
suffix?: React.ReactNode;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export type DropdownMenuCheckboxItemProps = {
|
|
153
|
+
/**
|
|
154
|
+
* The controlled checked state of the item.
|
|
155
|
+
* Must be used in conjunction with `onCheckedChange`.
|
|
156
|
+
*
|
|
157
|
+
* @default false
|
|
158
|
+
*/
|
|
159
|
+
checked?: DropdownMenuPrimitive.DropdownMenuCheckboxItemProps[ 'checked' ];
|
|
160
|
+
/**
|
|
161
|
+
* Event handler called when the checked state changes.
|
|
162
|
+
*/
|
|
163
|
+
onCheckedChange?: DropdownMenuPrimitive.DropdownMenuCheckboxItemProps[ 'onCheckedChange' ];
|
|
164
|
+
/**
|
|
165
|
+
* When `true`, prevents the user from interacting with the item.
|
|
166
|
+
*/
|
|
167
|
+
disabled?: DropdownMenuPrimitive.DropdownMenuCheckboxItemProps[ 'disabled' ];
|
|
168
|
+
/**
|
|
169
|
+
* Event handler called when the user selects an item (via mouse or keyboard).
|
|
170
|
+
* Calling `event.preventDefault` in this handler will prevent the dropdown
|
|
171
|
+
* menu from closing when selecting that item.
|
|
172
|
+
*/
|
|
173
|
+
onSelect?: DropdownMenuPrimitive.DropdownMenuCheckboxItemProps[ 'onSelect' ];
|
|
174
|
+
/**
|
|
175
|
+
* Optional text used for typeahead purposes. By default the typeahead
|
|
176
|
+
* behavior will use the `.textContent` of the item. Use this when the content
|
|
177
|
+
* is complex, or you have non-textual content inside.
|
|
178
|
+
*/
|
|
179
|
+
textValue?: DropdownMenuPrimitive.DropdownMenuCheckboxItemProps[ 'textValue' ];
|
|
180
|
+
/**
|
|
181
|
+
* The contents of the checkbox item
|
|
182
|
+
*/
|
|
183
|
+
children: React.ReactNode;
|
|
184
|
+
/**
|
|
185
|
+
* The contents of the checkbox item's suffix
|
|
186
|
+
*/
|
|
187
|
+
suffix?: React.ReactNode;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export type DropdownMenuRadioGroupProps = {
|
|
191
|
+
/**
|
|
192
|
+
* The value of the selected item in the group.
|
|
193
|
+
*/
|
|
194
|
+
value?: DropdownMenuPrimitive.DropdownMenuRadioGroupProps[ 'value' ];
|
|
195
|
+
/**
|
|
196
|
+
* Event handler called when the value changes.
|
|
197
|
+
*/
|
|
198
|
+
onValueChange?: DropdownMenuPrimitive.DropdownMenuRadioGroupProps[ 'onValueChange' ];
|
|
199
|
+
/**
|
|
200
|
+
* The contents of the radio group
|
|
201
|
+
*/
|
|
202
|
+
children: React.ReactNode;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export type DropdownMenuRadioItemProps = {
|
|
206
|
+
/**
|
|
207
|
+
* The unique value of the item.
|
|
208
|
+
*/
|
|
209
|
+
value: DropdownMenuPrimitive.DropdownMenuRadioItemProps[ 'value' ];
|
|
210
|
+
/**
|
|
211
|
+
* When `true`, prevents the user from interacting with the item.
|
|
212
|
+
*/
|
|
213
|
+
disabled?: DropdownMenuPrimitive.DropdownMenuRadioItemProps[ 'disabled' ];
|
|
214
|
+
/**
|
|
215
|
+
* Event handler called when the user selects an item (via mouse or keyboard).
|
|
216
|
+
* Calling `event.preventDefault` in this handler will prevent the dropdown
|
|
217
|
+
* menu from closing when selecting that item.
|
|
218
|
+
*/
|
|
219
|
+
onSelect?: DropdownMenuPrimitive.DropdownMenuRadioItemProps[ 'onSelect' ];
|
|
220
|
+
/**
|
|
221
|
+
* Optional text used for typeahead purposes. By default the typeahead
|
|
222
|
+
* behavior will use the `.textContent` of the item. Use this when the content
|
|
223
|
+
* is complex, or you have non-textual content inside.
|
|
224
|
+
*/
|
|
225
|
+
textValue?: DropdownMenuPrimitive.DropdownMenuRadioItemProps[ 'textValue' ];
|
|
226
|
+
/**
|
|
227
|
+
* The contents of the radio item
|
|
228
|
+
*/
|
|
229
|
+
children: React.ReactNode;
|
|
230
|
+
/**
|
|
231
|
+
* The contents of the radio item's suffix
|
|
232
|
+
*/
|
|
233
|
+
suffix?: React.ReactNode;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export type DropdownMenuLabelProps = {
|
|
237
|
+
/**
|
|
238
|
+
* The contents of the label
|
|
239
|
+
*/
|
|
240
|
+
children: React.ReactNode;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export type DropdownMenuGroupProps = {
|
|
244
|
+
/**
|
|
245
|
+
* The contents of the group
|
|
246
|
+
*/
|
|
247
|
+
children: React.ReactNode;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
export type DropdownMenuSeparatorProps = {};
|
|
@@ -44,11 +44,7 @@ $toggle-border-width: 1px;
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.components-form-toggle__input:focus + .components-form-toggle__track {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// Windows High Contrast mode will show this outline, but not the box-shadow.
|
|
50
|
-
outline: 2px solid transparent;
|
|
51
|
-
outline-offset: 2px;
|
|
47
|
+
@include button-style-outset__focus($components-color-accent);
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
&.is-checked {
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
StyledLabel,
|
|
28
28
|
} from '../base-control/styles/base-control-styles';
|
|
29
29
|
import { Spacer } from '../spacer';
|
|
30
|
+
import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';
|
|
30
31
|
|
|
31
32
|
const identity = ( value: string ) => value;
|
|
32
33
|
|
|
@@ -69,10 +70,13 @@ export function FormTokenField( props: FormTokenFieldProps ) {
|
|
|
69
70
|
__experimentalExpandOnFocus = false,
|
|
70
71
|
__experimentalValidateInput = () => true,
|
|
71
72
|
__experimentalShowHowTo = true,
|
|
72
|
-
|
|
73
|
+
__next40pxDefaultSize = false,
|
|
73
74
|
__experimentalAutoSelectFirstMatch = false,
|
|
74
75
|
__nextHasNoMarginBottom = false,
|
|
75
|
-
} =
|
|
76
|
+
} = useDeprecated36pxDefaultSizeProp< FormTokenFieldProps >(
|
|
77
|
+
props,
|
|
78
|
+
'wp.components.FormTokenField'
|
|
79
|
+
);
|
|
76
80
|
|
|
77
81
|
const instanceId = useInstanceId( FormTokenField );
|
|
78
82
|
|
|
@@ -702,7 +706,7 @@ export function FormTokenField( props: FormTokenFieldProps ) {
|
|
|
702
706
|
align="center"
|
|
703
707
|
gap={ 1 }
|
|
704
708
|
wrap={ true }
|
|
705
|
-
|
|
709
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
706
710
|
hasTokens={ !! value.length }
|
|
707
711
|
>
|
|
708
712
|
{ renderTokensAndInput() }
|
|
@@ -11,22 +11,22 @@ import { Flex } from '../flex';
|
|
|
11
11
|
import { space } from '../ui/utils/space';
|
|
12
12
|
|
|
13
13
|
type TokensAndInputWrapperProps = {
|
|
14
|
-
|
|
14
|
+
__next40pxDefaultSize: boolean;
|
|
15
15
|
hasTokens: boolean;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
const deprecatedPaddings = ( {
|
|
19
|
-
|
|
19
|
+
__next40pxDefaultSize,
|
|
20
20
|
hasTokens,
|
|
21
21
|
}: TokensAndInputWrapperProps ) =>
|
|
22
|
-
!
|
|
22
|
+
! __next40pxDefaultSize &&
|
|
23
23
|
css`
|
|
24
24
|
padding-top: ${ space( hasTokens ? 1 : 0.5 ) };
|
|
25
25
|
padding-bottom: ${ space( hasTokens ? 1 : 0.5 ) };
|
|
26
26
|
`;
|
|
27
27
|
|
|
28
28
|
export const TokensAndInputWrapperFlex = styled( Flex )`
|
|
29
|
-
padding:
|
|
29
|
+
padding: 7px;
|
|
30
30
|
|
|
31
31
|
${ deprecatedPaddings }
|
|
32
32
|
`;
|
|
@@ -151,13 +151,20 @@ export interface FormTokenFieldProps
|
|
|
151
151
|
* @default true
|
|
152
152
|
*/
|
|
153
153
|
__experimentalShowHowTo?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Deprecated. Use `__next40pxDefaultSize` instead.
|
|
156
|
+
*
|
|
157
|
+
* @default false
|
|
158
|
+
* @deprecated
|
|
159
|
+
*/
|
|
160
|
+
__next36pxDefaultSize?: boolean;
|
|
154
161
|
/**
|
|
155
162
|
* Start opting into the larger default height that will become the
|
|
156
163
|
* default size in a future version.
|
|
157
164
|
*
|
|
158
165
|
* @default false
|
|
159
166
|
*/
|
|
160
|
-
|
|
167
|
+
__next40pxDefaultSize?: boolean;
|
|
161
168
|
/**
|
|
162
169
|
* If true, the select the first matching suggestion when the user presses
|
|
163
170
|
* the Enter key (or space when tokenizeOnSpace is true).
|
package/src/index.native.js
CHANGED
|
@@ -94,7 +94,6 @@ export { default as HTMLTextInput } from './mobile/html-text-input';
|
|
|
94
94
|
export { default as KeyboardAvoidingView } from './mobile/keyboard-avoiding-view';
|
|
95
95
|
export { default as KeyboardAwareFlatList } from './mobile/keyboard-aware-flat-list';
|
|
96
96
|
export { default as Picker } from './mobile/picker';
|
|
97
|
-
export { default as ReadableContentView } from './mobile/readable-content-view';
|
|
98
97
|
export { default as CycleSelectControl } from './mobile/cycle-select-control';
|
|
99
98
|
export { default as Gradient } from './mobile/gradient';
|
|
100
99
|
export { default as ColorSettings } from './mobile/color-settings';
|
|
@@ -270,9 +270,14 @@ const backdropFocusedStyles = ( {
|
|
|
270
270
|
let borderColor = isFocused ? COLORS.ui.borderFocus : COLORS.ui.border;
|
|
271
271
|
|
|
272
272
|
let boxShadow;
|
|
273
|
+
let outline;
|
|
274
|
+
let outlineOffset;
|
|
273
275
|
|
|
274
276
|
if ( isFocused ) {
|
|
275
277
|
boxShadow = `0 0 0 1px ${ COLORS.ui.borderFocus } inset`;
|
|
278
|
+
// Windows High Contrast mode will show this outline, but not the box-shadow.
|
|
279
|
+
outline = `2px solid transparent`;
|
|
280
|
+
outlineOffset = `-2px`;
|
|
276
281
|
}
|
|
277
282
|
|
|
278
283
|
if ( disabled ) {
|
|
@@ -284,6 +289,8 @@ const backdropFocusedStyles = ( {
|
|
|
284
289
|
borderColor,
|
|
285
290
|
borderStyle: 'solid',
|
|
286
291
|
borderWidth: 1,
|
|
292
|
+
outline,
|
|
293
|
+
outlineOffset,
|
|
287
294
|
} );
|
|
288
295
|
};
|
|
289
296
|
|
|
@@ -92,6 +92,7 @@ class BottomSheetCell extends Component {
|
|
|
92
92
|
accessibilityHint,
|
|
93
93
|
accessibilityRole,
|
|
94
94
|
disabled = false,
|
|
95
|
+
disabledStyle = styles.cellDisabled,
|
|
95
96
|
activeOpacity,
|
|
96
97
|
onPress,
|
|
97
98
|
onLongPress,
|
|
@@ -223,11 +224,22 @@ class BottomSheetCell extends Component {
|
|
|
223
224
|
styles.cellValue,
|
|
224
225
|
styles.cellTextDark
|
|
225
226
|
);
|
|
226
|
-
const
|
|
227
|
+
const textInputStyle = {
|
|
227
228
|
...cellValueStyle,
|
|
228
229
|
...valueStyle,
|
|
229
230
|
...styleRTL,
|
|
230
231
|
};
|
|
232
|
+
const placeholderTextColor = disabled
|
|
233
|
+
? this.props.getStylesFromColorScheme(
|
|
234
|
+
styles.placeholderColorDisabled,
|
|
235
|
+
styles.placeholderColorDisabledDark
|
|
236
|
+
).color
|
|
237
|
+
: styles.placeholderColor.color;
|
|
238
|
+
const textStyle = {
|
|
239
|
+
...( disabled && styles.cellDisabled ),
|
|
240
|
+
...cellValueStyle,
|
|
241
|
+
...valueStyle,
|
|
242
|
+
};
|
|
231
243
|
|
|
232
244
|
// To be able to show the `middle` ellipsizeMode on editable cells
|
|
233
245
|
// we show the TextInput just when the user wants to edit the value,
|
|
@@ -238,10 +250,10 @@ class BottomSheetCell extends Component {
|
|
|
238
250
|
<TextInput
|
|
239
251
|
ref={ ( c ) => ( this._valueTextInput = c ) }
|
|
240
252
|
numberOfLines={ 1 }
|
|
241
|
-
style={
|
|
253
|
+
style={ textInputStyle }
|
|
242
254
|
value={ value }
|
|
243
255
|
placeholder={ valuePlaceholder }
|
|
244
|
-
placeholderTextColor={
|
|
256
|
+
placeholderTextColor={ placeholderTextColor }
|
|
245
257
|
onChangeText={ onChangeValue }
|
|
246
258
|
editable={ isValueEditable }
|
|
247
259
|
pointerEvents={
|
|
@@ -251,11 +263,12 @@ class BottomSheetCell extends Component {
|
|
|
251
263
|
onBlur={ finishEditing }
|
|
252
264
|
onSubmitEditing={ onSubmit }
|
|
253
265
|
keyboardType={ this.typeToKeyboardType( type, step ) }
|
|
266
|
+
disabled={ disabled }
|
|
254
267
|
{ ...valueProps }
|
|
255
268
|
/>
|
|
256
269
|
) : (
|
|
257
270
|
<Text
|
|
258
|
-
style={
|
|
271
|
+
style={ textStyle }
|
|
259
272
|
numberOfLines={ 1 }
|
|
260
273
|
ellipsizeMode={ 'middle' }
|
|
261
274
|
>
|
|
@@ -418,7 +431,15 @@ class BottomSheetCell extends Component {
|
|
|
418
431
|
/>
|
|
419
432
|
) }
|
|
420
433
|
{ showValue && getValueComponent() }
|
|
421
|
-
|
|
434
|
+
<View
|
|
435
|
+
style={ [
|
|
436
|
+
disabled && disabledStyle,
|
|
437
|
+
styles.cellRowContainer,
|
|
438
|
+
] }
|
|
439
|
+
pointerEvents={ disabled ? 'none' : 'auto' }
|
|
440
|
+
>
|
|
441
|
+
{ children }
|
|
442
|
+
</View>
|
|
422
443
|
</View>
|
|
423
444
|
{ help && (
|
|
424
445
|
<Text style={ [ cellHelpStyle, styles.placeholderColor ] }>
|
|
@@ -218,6 +218,7 @@ class BottomSheetRangeCell extends Component {
|
|
|
218
218
|
activeOpacity={ 1 }
|
|
219
219
|
accessible={ false }
|
|
220
220
|
valueStyle={ styles.valueStyle }
|
|
221
|
+
disabled={ disabled }
|
|
221
222
|
>
|
|
222
223
|
<View style={ containerStyle }>
|
|
223
224
|
{ preview }
|
|
@@ -225,7 +226,7 @@ class BottomSheetRangeCell extends Component {
|
|
|
225
226
|
testID={ `Slider ${ cellProps.label }` }
|
|
226
227
|
value={ sliderValue }
|
|
227
228
|
defaultValue={ defaultValue }
|
|
228
|
-
disabled={ disabled }
|
|
229
|
+
disabled={ disabled && ! isIOS }
|
|
229
230
|
step={ step }
|
|
230
231
|
minimumValue={ minimumValue }
|
|
231
232
|
maximumValue={ maximumValue }
|
|
@@ -144,6 +144,7 @@ class BottomSheetStepperCell extends Component {
|
|
|
144
144
|
openUnitPicker,
|
|
145
145
|
decimalNum,
|
|
146
146
|
cellContainerStyle,
|
|
147
|
+
disabled,
|
|
147
148
|
} = this.props;
|
|
148
149
|
const { inputValue } = this.state;
|
|
149
150
|
const isMinValue = value === min;
|
|
@@ -215,6 +216,7 @@ class BottomSheetStepperCell extends Component {
|
|
|
215
216
|
labelStyle={ labelStyle }
|
|
216
217
|
leftAlign={ true }
|
|
217
218
|
separatorType={ separatorType }
|
|
219
|
+
disabled={ disabled }
|
|
218
220
|
>
|
|
219
221
|
<View style={ preview && containerStyle }>
|
|
220
222
|
{ preview }
|
|
@@ -284,7 +284,15 @@
|
|
|
284
284
|
|
|
285
285
|
// used in both light and dark modes
|
|
286
286
|
.placeholderColor {
|
|
287
|
-
color:
|
|
287
|
+
color: $gray;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.placeholderColorDisabled {
|
|
291
|
+
color: lighten($gray, 20%);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.placeholderColorDisabledDark {
|
|
295
|
+
color: lighten($gray-dark, 10%);
|
|
288
296
|
}
|
|
289
297
|
|
|
290
298
|
.applyButton {
|
|
@@ -317,3 +325,7 @@
|
|
|
317
325
|
.cellSubLabelTextDark {
|
|
318
326
|
color: $sub-heading-dark;
|
|
319
327
|
}
|
|
328
|
+
|
|
329
|
+
.cellDisabled {
|
|
330
|
+
opacity: 0.3;
|
|
331
|
+
}
|
|
@@ -12,8 +12,10 @@ import { __, _x, sprintf } from '@wordpress/i18n';
|
|
|
12
12
|
*/
|
|
13
13
|
import Cell from './cell';
|
|
14
14
|
|
|
15
|
+
const EMPTY_STYLE = {};
|
|
16
|
+
|
|
15
17
|
export default function BottomSheetSwitchCell( props ) {
|
|
16
|
-
const { value, onValueChange, ...cellProps } = props;
|
|
18
|
+
const { value, onValueChange, disabled, ...cellProps } = props;
|
|
17
19
|
|
|
18
20
|
const onPress = () => {
|
|
19
21
|
onValueChange( ! value );
|
|
@@ -60,8 +62,14 @@ export default function BottomSheetSwitchCell( props ) {
|
|
|
60
62
|
onPress={ onPress }
|
|
61
63
|
editable={ false }
|
|
62
64
|
value={ '' }
|
|
65
|
+
disabled={ disabled }
|
|
66
|
+
disabledStyle={ EMPTY_STYLE }
|
|
63
67
|
>
|
|
64
|
-
<Switch
|
|
68
|
+
<Switch
|
|
69
|
+
value={ value }
|
|
70
|
+
onValueChange={ onValueChange }
|
|
71
|
+
disabled={ disabled }
|
|
72
|
+
/>
|
|
65
73
|
</Cell>
|
|
66
74
|
);
|
|
67
75
|
}
|
|
@@ -22,6 +22,7 @@ const BottomSheetSelectControl = ( {
|
|
|
22
22
|
options: items,
|
|
23
23
|
onChange,
|
|
24
24
|
value: selectedValue,
|
|
25
|
+
disabled,
|
|
25
26
|
} ) => {
|
|
26
27
|
const [ showSubSheet, setShowSubSheet ] = useState( false );
|
|
27
28
|
const navigation = useNavigation();
|
|
@@ -68,6 +69,7 @@ const BottomSheetSelectControl = ( {
|
|
|
68
69
|
__( 'Navigates to select %s' ),
|
|
69
70
|
label
|
|
70
71
|
) }
|
|
72
|
+
disabled={ disabled }
|
|
71
73
|
>
|
|
72
74
|
<Icon icon={ chevronRight }></Icon>
|
|
73
75
|
</BottomSheet.Cell>
|
|
@@ -29,6 +29,7 @@ const BottomSheetTextControl = ( {
|
|
|
29
29
|
icon,
|
|
30
30
|
footerNote,
|
|
31
31
|
cellPlaceholder,
|
|
32
|
+
disabled,
|
|
32
33
|
} ) => {
|
|
33
34
|
const [ showSubSheet, setShowSubSheet ] = useState( false );
|
|
34
35
|
const navigation = useNavigation();
|
|
@@ -62,6 +63,7 @@ const BottomSheetTextControl = ( {
|
|
|
62
63
|
onPress={ openSubSheet }
|
|
63
64
|
value={ initialValue || '' }
|
|
64
65
|
placeholder={ cellPlaceholder || placeholder || '' }
|
|
66
|
+
disabled={ disabled }
|
|
65
67
|
>
|
|
66
68
|
<Icon icon={ chevronRight }></Icon>
|
|
67
69
|
</BottomSheet.Cell>
|
|
@@ -26,9 +26,20 @@ export const getMergedGlobalStyles = (
|
|
|
26
26
|
blockName,
|
|
27
27
|
fontSizes
|
|
28
28
|
) => {
|
|
29
|
+
// Current support for general styles and blocks.
|
|
29
30
|
const baseGlobalColors = {
|
|
30
|
-
baseColors:
|
|
31
|
+
baseColors: {
|
|
32
|
+
color: baseGlobalStyles?.color,
|
|
33
|
+
typography: baseGlobalStyles?.typography,
|
|
34
|
+
elements: {
|
|
35
|
+
link: baseGlobalStyles?.elements?.link,
|
|
36
|
+
},
|
|
37
|
+
blocks: {
|
|
38
|
+
'core/button': baseGlobalStyles?.blocks?.[ 'core/button' ],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
31
41
|
};
|
|
42
|
+
|
|
32
43
|
const blockStyleAttributes = Object.fromEntries(
|
|
33
44
|
Object.entries( blockAttributes ?? {} ).filter( ( [ key ] ) =>
|
|
34
45
|
BLOCK_STYLE_ATTRIBUTES.includes( key )
|
|
@@ -74,6 +74,9 @@ export default function LinkPickerResults( {
|
|
|
74
74
|
return {
|
|
75
75
|
fetchMoreSuggestions: debounce( fetchMore, REQUEST_DEBOUNCE_DELAY ),
|
|
76
76
|
};
|
|
77
|
+
// Disable eslint rule for now, to avoid introducing a regression
|
|
78
|
+
// (see https://github.com/WordPress/gutenberg/pull/23922#discussion_r1170634879).
|
|
79
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77
80
|
}, [] );
|
|
78
81
|
|
|
79
82
|
// Prevent setting state when unmounted.
|
package/src/modal/style.scss
CHANGED
|
@@ -2,38 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
`NavigableContainer` is a React component to render a container navigable using the keyboard. Only things that are focusable can be navigated to. It will currently always be a `div`.
|
|
4
4
|
|
|
5
|
-
`NavigableContainer` is exported as two
|
|
5
|
+
`NavigableContainer` is exported as two components: `NavigableMenu` and `TabbableContainer`. `NavigableContainer` itself is **not** exported. `NavigableMenu` and `TabbableContainer` have the props listed below. Any other props will be passed through to the `div`.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## Props
|
|
10
10
|
|
|
11
|
-
These are the props that `NavigableMenu` and `TabbableContainer`. Any props which are specific to one
|
|
11
|
+
These are the props that `NavigableMenu` and `TabbableContainer`. Any props which are specific to one component are labelled appropriately.
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### `cycle`: `boolean`
|
|
14
14
|
|
|
15
|
-
A
|
|
15
|
+
A boolean which tells the component whether or not to cycle from the end back to the beginning and vice versa.
|
|
16
16
|
|
|
17
|
-
- Type: `Function`
|
|
18
17
|
- Required: No
|
|
18
|
+
- default: `true`
|
|
19
19
|
|
|
20
|
-
###
|
|
20
|
+
### `eventToOffset`: `( event: KeyboardEvent ) => -1 | 0 | 1 | undefined`
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
(TabbableContainer only)
|
|
23
|
+
Gets an offset, given an event.
|
|
24
|
+
|
|
25
|
+
- Required: No
|
|
26
|
+
|
|
27
|
+
### `onKeydown`: `( event: KeyboardEvent ) => void`
|
|
28
|
+
|
|
29
|
+
A callback invoked on the keydown event.
|
|
30
|
+
|
|
31
|
+
- Required: No
|
|
32
|
+
|
|
33
|
+
### `onNavigate`: `( index: number, focusable: HTMLElement ) => void`
|
|
34
|
+
|
|
35
|
+
A callback invoked when the menu navigates to one of its children passing the index and child as an argument
|
|
23
36
|
|
|
24
|
-
- Type: `Boolean`
|
|
25
37
|
- Required: No
|
|
26
|
-
- default: true
|
|
27
38
|
|
|
28
|
-
### orientation
|
|
39
|
+
### `orientation`: `'vertical' | 'horizontal' | 'both'`
|
|
29
40
|
|
|
30
|
-
|
|
41
|
+
(NavigableMenu only)
|
|
42
|
+
The orientation of the menu. It could be "vertical", "horizontal", or "both".
|
|
31
43
|
|
|
32
|
-
- Type: `String`
|
|
33
44
|
- Required: No
|
|
34
45
|
- Default: `"vertical"`
|
|
35
46
|
|
|
36
|
-
##
|
|
47
|
+
## Components
|
|
37
48
|
|
|
38
49
|
### NavigableMenu
|
|
39
50
|
|