@wordpress/components 23.8.0 → 24.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 +71 -0
- package/CONTRIBUTING.md +65 -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/checkbox-control/index.js +2 -2
- package/build/checkbox-control/index.js.map +1 -1
- package/build/color-palette/index.native.js +12 -0
- package/build/color-palette/index.native.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/custom-gradient-picker/index.native.js +3 -1
- package/build/custom-gradient-picker/index.native.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 +8 -8
- package/build/draggable/index.js.map +1 -1
- 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.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +6 -6
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +0 -8
- package/build/mobile/color-settings/palette.screen.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/global-styles-context/utils.native.js +21 -4
- package/build/mobile/global-styles-context/utils.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/mobile/segmented-control/index.native.js +4 -2
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/modal/index.js +2 -1
- package/build/modal/index.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/navigator/navigator-screen/component.js +1 -1
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/palette-edit/index.js +34 -12
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +1 -8
- package/build/popover/index.js.map +1 -1
- package/build/private-apis.js +4 -1
- package/build/private-apis.js.map +1 -1
- package/build/sandbox/index.native.js +10 -3
- 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 +20 -7
- 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/spinner/styles.js +4 -4
- package/build/spinner/styles.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/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/tree-grid/index.js +3 -3
- package/build/tree-grid/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/view/component.js +1 -2
- package/build/view/component.js.map +1 -1
- 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/checkbox-control/index.js +2 -2
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +13 -1
- package/build-module/color-palette/index.native.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/custom-gradient-picker/index.native.js +3 -1
- package/build-module/custom-gradient-picker/index.native.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 +8 -8
- package/build-module/draggable/index.js.map +1 -1
- 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.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +6 -5
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +0 -8
- package/build-module/mobile/color-settings/palette.screen.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/global-styles-context/utils.native.js +21 -3
- package/build-module/mobile/global-styles-context/utils.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/mobile/segmented-control/index.native.js +4 -2
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/modal/index.js +2 -1
- package/build-module/modal/index.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/navigator/navigator-screen/component.js +1 -1
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/palette-edit/index.js +34 -13
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/popover/index.js +1 -8
- package/build-module/popover/index.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/sandbox/index.native.js +10 -3
- 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 +17 -8
- 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/spinner/styles.js +4 -4
- package/build-module/spinner/styles.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/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/tree-grid/index.js +3 -3
- package/build-module/tree-grid/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-module/view/component.js +1 -2
- package/build-module/view/component.js.map +1 -1
- package/build-style/style-rtl.css +83 -70
- package/build-style/style.css +83 -70
- 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/box-control/styles/box-control-styles.d.ts +1 -1
- package/build-types/button/deprecated.d.ts +12 -6
- 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/checkbox-control/index.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +1 -1
- package/build-types/color-picker/styles.d.ts +3 -3
- 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/styles.d.ts +1 -1
- package/build-types/date-time/time/styles.d.ts +4 -4
- package/build-types/dimension-control/index.d.ts +1 -1
- package/build-types/draggable/index.d.ts +1 -1
- package/build-types/draggable/index.d.ts.map +1 -1
- package/build-types/draggable/stories/index.d.ts +8 -0
- package/build-types/draggable/stories/index.d.ts.map +1 -1
- package/build-types/draggable/types.d.ts +7 -0
- package/build-types/draggable/types.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
- 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/index.d.ts +1 -0
- package/build-types/index.d.ts.map +1 -1
- package/build-types/modal/index.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/navigation/styles/navigation-styles.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +2 -1
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +2 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +2 -1
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +2 -1
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +2 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +1 -1
- package/build-types/number-control/stories/index.d.ts +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/styles.d.ts +16 -10
- package/build-types/palette-edit/styles.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/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.d.ts +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +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 +14 -3
- 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/spinner/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 +12 -6
- 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/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/wordpress-component.d.ts +1 -1
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
- package/build-types/utils/use-deprecated-props.d.ts +9 -0
- package/build-types/utils/use-deprecated-props.d.ts.map +1 -0
- package/build-types/view/component.d.ts +1 -1
- package/build-types/view/component.d.ts.map +1 -1
- package/package.json +21 -22
- package/src/autocomplete/README.md +82 -54
- 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 +13 -6
- 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/index.tsx +6 -2
- package/src/checkbox-control/style.scss +1 -4
- package/src/color-palette/index.native.js +20 -1
- package/src/color-picker/test/index.tsx +99 -99
- 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/index.native.js +1 -1
- package/src/custom-gradient-picker/style.scss +2 -2
- package/src/dimension-control/README.md +1 -1
- package/src/dimension-control/index.tsx +1 -1
- package/src/draggable/README.md +8 -1
- package/src/draggable/index.tsx +7 -10
- package/src/draggable/stories/index.tsx +69 -33
- package/src/draggable/types.ts +7 -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.ts +1 -0
- package/src/mobile/bottom-sheet/cell.native.js +4 -5
- package/src/mobile/color-settings/palette.screen.native.js +0 -7
- package/src/mobile/global-styles-context/index.native.js +12 -1
- package/src/mobile/global-styles-context/utils.native.js +18 -3
- package/src/mobile/link-picker/link-picker-results.native.js +3 -0
- package/src/mobile/segmented-control/index.native.js +2 -2
- package/src/modal/index.tsx +6 -1
- package/src/modal/style.scss +21 -13
- 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/navigator/navigator-screen/component.tsx +1 -1
- 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/popover/index.tsx +2 -15
- package/src/private-apis.ts +2 -0
- package/src/sandbox/index.native.js +12 -1
- 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 +14 -8
- package/src/slot-fill/provider.js +0 -6
- package/src/slot-fill/slot.js +0 -5
- package/src/snackbar/style.scss +2 -1
- package/src/spinner/styles.ts +2 -0
- 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 +4 -4
- package/src/toolbar/stories/index.tsx +26 -24
- package/src/toolbar/toolbar-button/index.tsx +10 -13
- package/src/toolbar/toolbar-item/{index.js → index.tsx} +12 -3
- package/src/tree-grid/README.md +18 -0
- package/src/tree-grid/index.tsx +7 -2
- package/src/tree-grid/types.ts +7 -0
- package/src/ui/context/wordpress-component.ts +1 -1
- 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/src/view/component.tsx +2 -2
- package/tsconfig.json +3 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/src/CONTRIBUTING.md +0 -78
- package/src/README.md +0 -20
- package/src/navigable-container/menu.js +0 -62
- package/src/navigable-container/tabbable.js +0 -46
package/src/tab-panel/index.tsx
CHANGED
|
@@ -48,7 +48,7 @@ export function checkContrasts(
|
|
|
48
48
|
outputs: ThemeOutputValues[ 'colors' ]
|
|
49
49
|
) {
|
|
50
50
|
const background = inputs.background || COLORS.white;
|
|
51
|
-
const accent = inputs.accent || '#
|
|
51
|
+
const accent = inputs.accent || '#3858e9';
|
|
52
52
|
const foreground = outputs.foreground || COLORS.gray[ 900 ];
|
|
53
53
|
const gray = outputs.gray || COLORS.gray;
|
|
54
54
|
|
|
@@ -53,9 +53,9 @@ describe( 'Theme color algorithms', () => {
|
|
|
53
53
|
'wp.components.Theme: The background color ("#000") does not have sufficient contrast against the accent color ("#111").'
|
|
54
54
|
);
|
|
55
55
|
|
|
56
|
-
generateThemeVariables( { background: '#
|
|
56
|
+
generateThemeVariables( { background: '#1a1a1a' } );
|
|
57
57
|
expect( console ).toHaveWarnedWith(
|
|
58
|
-
'wp.components.Theme: The background color ("#
|
|
58
|
+
'wp.components.Theme: The background color ("#1a1a1a") does not have sufficient contrast against the accent color ("#3858e9").'
|
|
59
59
|
);
|
|
60
60
|
} );
|
|
61
61
|
|
|
@@ -65,8 +65,8 @@ exports[`ToggleGroupControl should render correctly with icons 1`] = `
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.emotion-8:focus-within {
|
|
68
|
-
border-color: var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #
|
|
69
|
-
box-shadow: 0 0 0 0.5px var(--wp-components-color-accent, var(--wp-admin-theme-color, #
|
|
68
|
+
border-color: var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6));
|
|
69
|
+
box-shadow: 0 0 0 0.5px var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
|
|
70
70
|
outline: none;
|
|
71
71
|
z-index: 1;
|
|
72
72
|
}
|
|
@@ -400,8 +400,8 @@ exports[`ToggleGroupControl should render correctly with text options 1`] = `
|
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
.emotion-8:focus-within {
|
|
403
|
-
border-color: var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #
|
|
404
|
-
box-shadow: 0 0 0 0.5px var(--wp-components-color-accent, var(--wp-admin-theme-color, #
|
|
403
|
+
border-color: var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6));
|
|
404
|
+
box-shadow: 0 0 0 0.5px var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
|
|
405
405
|
outline: none;
|
|
406
406
|
z-index: 1;
|
|
407
407
|
}
|
|
@@ -83,30 +83,32 @@ Default.args = {
|
|
|
83
83
|
<ToolbarGroup>
|
|
84
84
|
<ToolbarItem>
|
|
85
85
|
{
|
|
86
|
-
// @ts-expect-error TODO: Remove when
|
|
87
|
-
( toggleProps ) =>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
86
|
+
// @ts-expect-error TODO: Remove when DropdownMenu is typed
|
|
87
|
+
( toggleProps ) => {
|
|
88
|
+
return (
|
|
89
|
+
<DropdownMenu
|
|
90
|
+
hasArrowIndicator
|
|
91
|
+
icon={ alignLeft }
|
|
92
|
+
label="Align"
|
|
93
|
+
controls={ [
|
|
94
|
+
{
|
|
95
|
+
icon: alignLeft,
|
|
96
|
+
title: 'Align left',
|
|
97
|
+
isActive: true,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
icon: alignCenter,
|
|
101
|
+
title: 'Align center',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
icon: alignRight,
|
|
105
|
+
title: 'Align right',
|
|
106
|
+
},
|
|
107
|
+
] }
|
|
108
|
+
toggleProps={ toggleProps }
|
|
109
|
+
/>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
110
112
|
}
|
|
111
113
|
</ToolbarItem>
|
|
112
114
|
</ToolbarGroup>
|
|
@@ -82,19 +82,16 @@ function UnforwardedToolbarButton(
|
|
|
82
82
|
{ ...props }
|
|
83
83
|
ref={ ref }
|
|
84
84
|
>
|
|
85
|
-
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
</Button>
|
|
96
|
-
)
|
|
97
|
-
}
|
|
85
|
+
{ ( toolbarItemProps ) => (
|
|
86
|
+
<Button
|
|
87
|
+
label={ title }
|
|
88
|
+
isPressed={ isActive }
|
|
89
|
+
disabled={ isDisabled }
|
|
90
|
+
{ ...toolbarItemProps }
|
|
91
|
+
>
|
|
92
|
+
{ children }
|
|
93
|
+
</Button>
|
|
94
|
+
) }
|
|
98
95
|
</ToolbarItem>
|
|
99
96
|
);
|
|
100
97
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* External dependencies
|
|
5
3
|
*/
|
|
6
4
|
import { ToolbarItem as BaseToolbarItem } from 'reakit/Toolbar';
|
|
5
|
+
import type { ForwardedRef } from 'react';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* WordPress dependencies
|
|
@@ -16,7 +15,14 @@ import warning from '@wordpress/warning';
|
|
|
16
15
|
*/
|
|
17
16
|
import ToolbarContext from '../toolbar-context';
|
|
18
17
|
|
|
19
|
-
function ToolbarItem(
|
|
18
|
+
function ToolbarItem(
|
|
19
|
+
{
|
|
20
|
+
children,
|
|
21
|
+
as: Component,
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentPropsWithoutRef< typeof BaseToolbarItem >,
|
|
24
|
+
ref: ForwardedRef< any >
|
|
25
|
+
) {
|
|
20
26
|
const accessibleToolbarState = useContext( ToolbarContext );
|
|
21
27
|
|
|
22
28
|
if ( typeof children !== 'function' && ! Component ) {
|
|
@@ -33,6 +39,9 @@ function ToolbarItem( { children, as: Component, ...props }, ref ) {
|
|
|
33
39
|
if ( Component ) {
|
|
34
40
|
return <Component { ...allProps }>{ children }</Component>;
|
|
35
41
|
}
|
|
42
|
+
if ( typeof children !== 'function' ) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
36
45
|
return children( allProps );
|
|
37
46
|
}
|
|
38
47
|
|
package/src/tree-grid/README.md
CHANGED
|
@@ -127,8 +127,26 @@ An integer value that represents the total number of items in the set, at this s
|
|
|
127
127
|
|
|
128
128
|
An optional value that designates whether a row is expanded or collapsed. Currently this value only sets the correct aria-expanded property on a row, it has no other built-in behavior.
|
|
129
129
|
|
|
130
|
+
If there is a need to implement `aria-expanded` elsewhere in the row, cell, or element within a cell, you may pass `isExpanded={ undefined }`. In order for keyboard navigation to continue working, add the `data-expanded` attribute with either `true`/`false`. This allows the `TreeGrid` component to still manage keyboard interactions while allowing the `aria-expanded` attribute to be placed elsewhere. See the example below.
|
|
131
|
+
|
|
130
132
|
- Required: No
|
|
131
133
|
|
|
134
|
+
```jsx
|
|
135
|
+
function TreeMenu() {
|
|
136
|
+
return (
|
|
137
|
+
<TreeGrid>
|
|
138
|
+
<TreeGridRow level={ 1 } positionInSet={ 1 } setSize={ 2 } isExpanded={ undefined } data-expanded={ false }>
|
|
139
|
+
<TreeGridCell>
|
|
140
|
+
{ ( props ) => (
|
|
141
|
+
<Button aria-expanded="false" onClick={ onSelect } { ...props }>Select</Button>
|
|
142
|
+
) }
|
|
143
|
+
</TreeGridCell>
|
|
144
|
+
</TreeGridRow>
|
|
145
|
+
</TreeGrid>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
132
150
|
### TreeGridCell
|
|
133
151
|
|
|
134
152
|
#### Props
|
package/src/tree-grid/index.tsx
CHANGED
|
@@ -91,7 +91,8 @@ function UnforwardedTreeGrid(
|
|
|
91
91
|
const canExpandCollapse = 0 === currentColumnIndex;
|
|
92
92
|
const cannotFocusNextColumn =
|
|
93
93
|
canExpandCollapse &&
|
|
94
|
-
activeRow.getAttribute( '
|
|
94
|
+
( activeRow.getAttribute( 'data-expanded' ) === 'false' ||
|
|
95
|
+
activeRow.getAttribute( 'aria-expanded' ) === 'false' ) &&
|
|
95
96
|
keyCode === RIGHT;
|
|
96
97
|
|
|
97
98
|
if ( ( [ LEFT, RIGHT ] as number[] ).includes( keyCode ) ) {
|
|
@@ -112,6 +113,8 @@ function UnforwardedTreeGrid(
|
|
|
112
113
|
// Left:
|
|
113
114
|
// If a row is focused, and it is expanded, collapses the current row.
|
|
114
115
|
if (
|
|
116
|
+
activeRow.getAttribute( 'data-expanded' ) ===
|
|
117
|
+
'true' ||
|
|
115
118
|
activeRow.getAttribute( 'aria-expanded' ) === 'true'
|
|
116
119
|
) {
|
|
117
120
|
onCollapseRow( activeRow );
|
|
@@ -151,8 +154,10 @@ function UnforwardedTreeGrid(
|
|
|
151
154
|
// Right:
|
|
152
155
|
// If a row is focused, and it is collapsed, expands the current row.
|
|
153
156
|
if (
|
|
157
|
+
activeRow.getAttribute( 'data-expanded' ) ===
|
|
158
|
+
'false' ||
|
|
154
159
|
activeRow.getAttribute( 'aria-expanded' ) ===
|
|
155
|
-
|
|
160
|
+
'false'
|
|
156
161
|
) {
|
|
157
162
|
onExpandRow( activeRow );
|
|
158
163
|
event.preventDefault();
|
package/src/tree-grid/types.ts
CHANGED
|
@@ -22,6 +22,13 @@ export type TreeGridRowProps = {
|
|
|
22
22
|
* An optional value that designates whether a row is expanded or collapsed.
|
|
23
23
|
* Currently this value only sets the correct aria-expanded property on a row,
|
|
24
24
|
* it has no other built-in behavior.
|
|
25
|
+
*
|
|
26
|
+
* If there is a need to implement `aria-expanded` elsewhere in the row, cell,
|
|
27
|
+
* or element within a cell, you may pass `isExpanded={ undefined }`.
|
|
28
|
+
* In order for keyboard navigation to continue working, add the
|
|
29
|
+
* `data-expanded` attribute with either `true`/`false`. This allows the
|
|
30
|
+
* `TreeGrid` component to still manage keyboard interactions while allowing
|
|
31
|
+
* the `aria-expanded` attribute to be placed elsewhere.
|
|
25
32
|
*/
|
|
26
33
|
isExpanded?: boolean;
|
|
27
34
|
};
|
|
@@ -44,7 +44,7 @@ export type WordPressComponent<
|
|
|
44
44
|
* We restrict it to a class to align with the already existing class names that
|
|
45
45
|
* are generated by the context system.
|
|
46
46
|
*/
|
|
47
|
-
selector
|
|
47
|
+
selector?: `.${ string }`;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
export type WordPressComponentFromProps<
|
|
@@ -29,11 +29,11 @@ const ALERT = {
|
|
|
29
29
|
green: '#4ab866',
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
// Matches @wordpress/base-styles
|
|
32
|
+
// Matches the Modern admin scheme in @wordpress/base-styles
|
|
33
33
|
const ADMIN = {
|
|
34
|
-
theme: 'var(--wp-components-color-accent, var(--wp-admin-theme-color, #
|
|
34
|
+
theme: 'var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))',
|
|
35
35
|
themeDark10:
|
|
36
|
-
'var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #
|
|
36
|
+
'var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6))',
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
const UI = {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
//
|
|
3
3
|
// If the `--wp-components-color-accent` variable is not defined, fallback to
|
|
4
4
|
// `--wp-admin-theme-color`. If the `--wp-admin-theme-color` variable is not
|
|
5
|
-
// defined, fallback to the default theme color (WP
|
|
6
|
-
$components-color-accent: var(--wp-components-color-accent, var(--wp-admin-theme-color, #
|
|
7
|
-
$components-color-accent-darker-10: var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #
|
|
8
|
-
$components-color-accent-darker-20: var(--wp-components-color-accent-darker-20, var(--wp-admin-theme-color-darker-20, #
|
|
5
|
+
// defined, fallback to the default theme color (WP blueberry).
|
|
6
|
+
$components-color-accent: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
|
|
7
|
+
$components-color-accent-darker-10: var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6));
|
|
8
|
+
$components-color-accent-darker-20: var(--wp-components-color-accent-darker-20, var(--wp-admin-theme-color-darker-20, #183ad6));
|
|
9
9
|
|
|
10
10
|
// Used when placing text on the accent color.
|
|
11
11
|
$components-color-accent-inverted: var(--wp-components-color-accent-inverted, $white);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import deprecated from '@wordpress/deprecated';
|
|
5
|
+
|
|
6
|
+
export function useDeprecated36pxDefaultSizeProp<
|
|
7
|
+
P extends Record< string, any > & {
|
|
8
|
+
__next36pxDefaultSize?: boolean;
|
|
9
|
+
__next40pxDefaultSize?: boolean;
|
|
10
|
+
}
|
|
11
|
+
>(
|
|
12
|
+
props: P,
|
|
13
|
+
/** The component identifier in dot notation, e.g. `wp.components.ComponentName`. */
|
|
14
|
+
componentIdentifier: string
|
|
15
|
+
) {
|
|
16
|
+
const { __next36pxDefaultSize, __next40pxDefaultSize, ...otherProps } =
|
|
17
|
+
props;
|
|
18
|
+
if ( typeof __next36pxDefaultSize !== 'undefined' ) {
|
|
19
|
+
deprecated( '`__next36pxDefaultSize` prop in ' + componentIdentifier, {
|
|
20
|
+
alternative: '`__next40pxDefaultSize`',
|
|
21
|
+
since: '6.3',
|
|
22
|
+
} );
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
...otherProps,
|
|
27
|
+
__next40pxDefaultSize: __next40pxDefaultSize ?? __next36pxDefaultSize,
|
|
28
|
+
};
|
|
29
|
+
}
|
package/src/view/component.tsx
CHANGED
|
@@ -27,10 +27,10 @@ import type { ViewProps } from './types';
|
|
|
27
27
|
* }
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
// @ts-expect-error
|
|
31
30
|
export const View: WordPressComponent<
|
|
32
31
|
'div',
|
|
33
|
-
ViewProps & RefAttributes< any
|
|
32
|
+
ViewProps & RefAttributes< any >,
|
|
33
|
+
true
|
|
34
34
|
> = styled.div``;
|
|
35
35
|
|
|
36
36
|
View.selector = '.components-view';
|
package/tsconfig.json
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"snapshot-diff",
|
|
13
13
|
"@wordpress/jest-console"
|
|
14
14
|
],
|
|
15
|
-
//
|
|
16
|
-
//
|
|
15
|
+
// TODO: Remove `skipLibCheck` after resolving duplicate declaration of the `process` variable
|
|
16
|
+
// between `@types/webpack-env` (from @storybook packages) and `gutenberg-env`.
|
|
17
17
|
"skipLibCheck": true,
|
|
18
18
|
"strictNullChecks": true
|
|
19
19
|
},
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
{ "path": "../primitives" },
|
|
35
35
|
{ "path": "../private-apis" },
|
|
36
36
|
{ "path": "../react-i18n" },
|
|
37
|
+
{ "path": "../rich-text" },
|
|
37
38
|
{ "path": "../warning" }
|
|
38
39
|
],
|
|
39
40
|
"include": [ "src/**/*" ],
|