@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
|
@@ -7,6 +7,7 @@ import type { DragEvent } from 'react';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
10
11
|
import { useState } from '@wordpress/element';
|
|
11
12
|
import { Icon, more } from '@wordpress/icons';
|
|
12
13
|
|
|
@@ -32,46 +33,68 @@ export default meta;
|
|
|
32
33
|
|
|
33
34
|
const DefaultTemplate: ComponentStory< typeof Draggable > = ( args ) => {
|
|
34
35
|
const [ isDragging, setDragging ] = useState( false );
|
|
36
|
+
const instanceId = useInstanceId( DefaultTemplate );
|
|
35
37
|
|
|
36
38
|
// Allow for the use of ID in the example.
|
|
37
39
|
return (
|
|
38
40
|
<div>
|
|
39
|
-
<p
|
|
41
|
+
<p
|
|
42
|
+
style={ {
|
|
43
|
+
padding: '1em',
|
|
44
|
+
position: 'relative',
|
|
45
|
+
zIndex: 1000,
|
|
46
|
+
backgroundColor: 'whitesmoke',
|
|
47
|
+
} }
|
|
48
|
+
>
|
|
49
|
+
Is Dragging? { isDragging ? 'Yes' : 'No!' }
|
|
50
|
+
</p>
|
|
40
51
|
<div
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
style={ {
|
|
53
|
+
zIndex: 100,
|
|
54
|
+
position: 'relative',
|
|
55
|
+
} }
|
|
44
56
|
>
|
|
45
|
-
<
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
const handleOnDragEnd = ( event: DragEvent ) => {
|
|
52
|
-
setDragging( false );
|
|
53
|
-
onDraggableEnd( event );
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<div
|
|
58
|
-
onDragStart={ handleOnDragStart }
|
|
59
|
-
onDragEnd={ handleOnDragEnd }
|
|
60
|
-
draggable
|
|
61
|
-
style={ {
|
|
62
|
-
alignItems: 'center',
|
|
63
|
-
display: 'flex',
|
|
64
|
-
justifyContent: 'center',
|
|
65
|
-
width: 100,
|
|
66
|
-
height: 100,
|
|
67
|
-
background: '#ddd',
|
|
68
|
-
} }
|
|
69
|
-
>
|
|
70
|
-
<Icon icon={ more } />
|
|
71
|
-
</div>
|
|
72
|
-
);
|
|
57
|
+
<div
|
|
58
|
+
id={ `draggable-example-box-${ instanceId }` }
|
|
59
|
+
style={ {
|
|
60
|
+
display: 'inline-flex',
|
|
61
|
+
position: 'relative',
|
|
73
62
|
} }
|
|
74
|
-
|
|
63
|
+
>
|
|
64
|
+
<Draggable
|
|
65
|
+
{ ...args }
|
|
66
|
+
elementId={ `draggable-example-box-${ instanceId }` }
|
|
67
|
+
>
|
|
68
|
+
{ ( { onDraggableStart, onDraggableEnd } ) => {
|
|
69
|
+
const handleOnDragStart = ( event: DragEvent ) => {
|
|
70
|
+
setDragging( true );
|
|
71
|
+
onDraggableStart( event );
|
|
72
|
+
};
|
|
73
|
+
const handleOnDragEnd = ( event: DragEvent ) => {
|
|
74
|
+
setDragging( false );
|
|
75
|
+
onDraggableEnd( event );
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<div
|
|
80
|
+
onDragStart={ handleOnDragStart }
|
|
81
|
+
onDragEnd={ handleOnDragEnd }
|
|
82
|
+
draggable
|
|
83
|
+
style={ {
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
display: 'flex',
|
|
86
|
+
justifyContent: 'center',
|
|
87
|
+
width: 100,
|
|
88
|
+
height: 100,
|
|
89
|
+
background: '#ddd',
|
|
90
|
+
} }
|
|
91
|
+
>
|
|
92
|
+
<Icon icon={ more } />
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
} }
|
|
96
|
+
</Draggable>
|
|
97
|
+
</div>
|
|
75
98
|
</div>
|
|
76
99
|
</div>
|
|
77
100
|
);
|
|
@@ -81,3 +104,16 @@ export const Default: ComponentStory< typeof Draggable > = DefaultTemplate.bind(
|
|
|
81
104
|
{}
|
|
82
105
|
);
|
|
83
106
|
Default.args = {};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* `appendToOwnerDocument` is used to append the element being dragged to the body of the owner document.
|
|
110
|
+
*
|
|
111
|
+
* This is useful when the element being dragged should not receive styles from its parent.
|
|
112
|
+
* For example, when the element's parent sets a `z-index` value that would cause the dragged
|
|
113
|
+
* element to be rendered behind other elements.
|
|
114
|
+
*/
|
|
115
|
+
export const AppendElementToOwnerDocument: ComponentStory< typeof Draggable > =
|
|
116
|
+
DefaultTemplate.bind( {} );
|
|
117
|
+
AppendElementToOwnerDocument.args = {
|
|
118
|
+
appendToOwnerDocument: true,
|
|
119
|
+
};
|
package/src/draggable/types.ts
CHANGED
|
@@ -17,6 +17,13 @@ export type DraggableProps = {
|
|
|
17
17
|
*/
|
|
18
18
|
onDraggableEnd: ( event: DragEvent ) => void;
|
|
19
19
|
} ) => JSX.Element | null;
|
|
20
|
+
/**
|
|
21
|
+
* Whether to append the cloned element to the `ownerDocument` body.
|
|
22
|
+
* By default, elements sourced by id are appended to the element's wrapper.
|
|
23
|
+
*
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
appendToOwnerDocument?: boolean;
|
|
20
27
|
/**
|
|
21
28
|
* Classname for the cloned element.
|
|
22
29
|
*/
|
|
@@ -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.ts
CHANGED
|
@@ -90,6 +90,7 @@ export { default as GuidePage } from './guide/page';
|
|
|
90
90
|
export { Heading as __experimentalHeading } from './heading';
|
|
91
91
|
export { HStack as __experimentalHStack } from './h-stack';
|
|
92
92
|
export { default as Icon } from './icon';
|
|
93
|
+
export type { IconType } from './icon';
|
|
93
94
|
export { default as IconButton } from './button/deprecated';
|
|
94
95
|
export {
|
|
95
96
|
ItemGroup as __experimentalItemGroup,
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
AccessibilityInfo,
|
|
11
11
|
Platform,
|
|
12
12
|
} from 'react-native';
|
|
13
|
-
import { isEmpty, get } from 'lodash';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* WordPress dependencies
|
|
@@ -273,8 +272,8 @@ class BottomSheetCell extends Component {
|
|
|
273
272
|
return accessibilityLabel || label;
|
|
274
273
|
}
|
|
275
274
|
|
|
276
|
-
if (
|
|
277
|
-
return
|
|
275
|
+
if ( ! value ) {
|
|
276
|
+
return ! help
|
|
278
277
|
? sprintf(
|
|
279
278
|
/* translators: accessibility text. Empty state of a inline textinput cell. %s: The cell's title */
|
|
280
279
|
_x( '%s. Empty', 'inline textinput cell' ),
|
|
@@ -288,7 +287,7 @@ class BottomSheetCell extends Component {
|
|
|
288
287
|
help
|
|
289
288
|
);
|
|
290
289
|
}
|
|
291
|
-
return
|
|
290
|
+
return ! help
|
|
292
291
|
? sprintf(
|
|
293
292
|
/* translators: accessibility text. Inline textinput title and value.%1: Cell title, %2: cell value. */
|
|
294
293
|
_x( '%1$s, %2$s', 'inline textinput cell' ),
|
|
@@ -323,7 +322,7 @@ class BottomSheetCell extends Component {
|
|
|
323
322
|
const opacity =
|
|
324
323
|
activeOpacity !== undefined
|
|
325
324
|
? activeOpacity
|
|
326
|
-
:
|
|
325
|
+
: platformStyles.activeOpacity?.opacity;
|
|
327
326
|
|
|
328
327
|
return (
|
|
329
328
|
<TouchableRipple
|
|
@@ -78,22 +78,15 @@ const PaletteScreen = () => {
|
|
|
78
78
|
setCurrentValue( color );
|
|
79
79
|
if ( isSolidSegment && onColorChange && onGradientChange ) {
|
|
80
80
|
onColorChange( color );
|
|
81
|
-
onGradientChange( '' );
|
|
82
81
|
} else if ( isSolidSegment && onColorChange ) {
|
|
83
82
|
onColorChange( color );
|
|
84
83
|
} else if ( ! isSolidSegment && onGradientChange ) {
|
|
85
84
|
onGradientChange( color );
|
|
86
|
-
onColorChange( '' );
|
|
87
85
|
}
|
|
88
86
|
};
|
|
89
87
|
|
|
90
88
|
function onClear() {
|
|
91
89
|
setCurrentValue( undefined );
|
|
92
|
-
if ( isSolidSegment ) {
|
|
93
|
-
onColorChange( '' );
|
|
94
|
-
} else {
|
|
95
|
-
onGradientChange( '' );
|
|
96
|
-
}
|
|
97
90
|
|
|
98
91
|
if ( onColorCleared ) {
|
|
99
92
|
onColorCleared();
|
|
@@ -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 )
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { camelCase } from 'change-case';
|
|
5
|
-
import { get } from 'lodash';
|
|
6
5
|
import { Dimensions } from 'react-native';
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -191,6 +190,22 @@ export function getBlockTypography(
|
|
|
191
190
|
return typographyStyles;
|
|
192
191
|
}
|
|
193
192
|
|
|
193
|
+
/**
|
|
194
|
+
* Return a value from a certain path of the object.
|
|
195
|
+
* Path is specified as an array of properties, like: [ 'parent', 'child' ].
|
|
196
|
+
*
|
|
197
|
+
* @param {Object} object Input object.
|
|
198
|
+
* @param {Array} path Path to the object property.
|
|
199
|
+
* @return {*} Value of the object property at the specified path.
|
|
200
|
+
*/
|
|
201
|
+
const getValueFromObjectPath = ( object, path ) => {
|
|
202
|
+
let value = object;
|
|
203
|
+
path.forEach( ( fieldName ) => {
|
|
204
|
+
value = value?.[ fieldName ];
|
|
205
|
+
} );
|
|
206
|
+
return value;
|
|
207
|
+
};
|
|
208
|
+
|
|
194
209
|
export function parseStylesVariables( styles, mappedValues, customValues ) {
|
|
195
210
|
let stylesBase = styles;
|
|
196
211
|
const variables = [ 'preset', 'custom', 'var', 'fontSize' ];
|
|
@@ -231,11 +246,11 @@ export function parseStylesVariables( styles, mappedValues, customValues ) {
|
|
|
231
246
|
customValuesData
|
|
232
247
|
)
|
|
233
248
|
) {
|
|
234
|
-
return
|
|
249
|
+
return getValueFromObjectPath( customValuesData, path );
|
|
235
250
|
}
|
|
236
251
|
|
|
237
252
|
// Check for camelcase properties.
|
|
238
|
-
return
|
|
253
|
+
return getValueFromObjectPath( customValuesData, [
|
|
239
254
|
...path.slice( 0, path.length - 1 ),
|
|
240
255
|
camelCase( path[ path.length - 1 ] ),
|
|
241
256
|
] );
|
|
@@ -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.
|
|
@@ -140,8 +140,8 @@ const SegmentedControls = ( {
|
|
|
140
140
|
styles.selectedDark
|
|
141
141
|
);
|
|
142
142
|
|
|
143
|
-
const width = segmentsDimensions[ activeSegmentIndex ]
|
|
144
|
-
const height = segmentsDimensions[ activeSegmentIndex ]
|
|
143
|
+
const width = segmentsDimensions[ activeSegmentIndex ]?.width;
|
|
144
|
+
const height = segmentsDimensions[ activeSegmentIndex ]?.height;
|
|
145
145
|
|
|
146
146
|
const outlineStyle = [ styles.outline, isIOS && styles.outlineIOS ];
|
|
147
147
|
|
package/src/modal/index.tsx
CHANGED
|
@@ -252,7 +252,12 @@ function UnforwardedModal(
|
|
|
252
252
|
) }
|
|
253
253
|
</div>
|
|
254
254
|
) }
|
|
255
|
-
<div
|
|
255
|
+
<div
|
|
256
|
+
ref={ childrenContainerRef }
|
|
257
|
+
className="components-modal__children-container"
|
|
258
|
+
>
|
|
259
|
+
{ children }
|
|
260
|
+
</div>
|
|
256
261
|
</div>
|
|
257
262
|
</div>
|
|
258
263
|
</StyleProvider>
|
package/src/modal/style.scss
CHANGED
|
@@ -16,31 +16,39 @@
|
|
|
16
16
|
// The modal window element.
|
|
17
17
|
.components-modal__frame {
|
|
18
18
|
// Use the entire viewport on smaller screens.
|
|
19
|
-
margin: 0;
|
|
19
|
+
margin: $grid-unit-50 0 0 0;
|
|
20
20
|
width: 100%;
|
|
21
21
|
background: $white;
|
|
22
22
|
box-shadow: $shadow-modal;
|
|
23
|
-
border-radius: $
|
|
23
|
+
border-radius: $grid-unit-10 $grid-unit-10 0 0;
|
|
24
24
|
overflow: hidden;
|
|
25
25
|
// Have the content element fill the vertical space yet not overflow.
|
|
26
26
|
display: flex;
|
|
27
|
+
// Animate the modal frame/contents appearing on the page.
|
|
28
|
+
animation: components-modal__appear-animation 0.1s ease-out;
|
|
29
|
+
animation-fill-mode: forwards;
|
|
30
|
+
@include reduce-motion("animation");
|
|
27
31
|
|
|
28
32
|
// Show a centered modal on bigger screens.
|
|
29
33
|
@include break-small() {
|
|
34
|
+
border-radius: $grid-unit-10;
|
|
30
35
|
margin: auto;
|
|
31
36
|
width: auto;
|
|
32
37
|
min-width: $modal-min-width;
|
|
33
38
|
max-width: calc(100% - #{$grid-unit-20 * 2});
|
|
34
39
|
max-height: calc(100% - #{$header-height * 2});
|
|
35
40
|
|
|
36
|
-
// Animate the modal frame/contents appearing on the page.
|
|
37
|
-
animation: components-modal__appear-animation 0.1s ease-out;
|
|
38
|
-
animation-fill-mode: forwards;
|
|
39
|
-
@include reduce-motion("animation");
|
|
40
|
-
|
|
41
41
|
&.is-full-screen {
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
@include break-small() {
|
|
43
|
+
width: calc(100% - #{ $grid-unit-20 * 2 });
|
|
44
|
+
height: calc(100% - #{ $grid-unit-20 * 2 });
|
|
45
|
+
max-height: none;
|
|
46
|
+
}
|
|
47
|
+
@include break-medium() {
|
|
48
|
+
width: calc(100% - #{ $grid-unit-50 * 2 });
|
|
49
|
+
height: calc(100% - #{ $grid-unit-50 * 2 });
|
|
50
|
+
max-width: none;
|
|
51
|
+
}
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
54
|
|
|
@@ -64,12 +72,12 @@
|
|
|
64
72
|
.components-modal__header {
|
|
65
73
|
box-sizing: border-box;
|
|
66
74
|
border-bottom: $border-width solid transparent;
|
|
67
|
-
padding:
|
|
75
|
+
padding: $grid-unit-30 $grid-unit-40 $grid-unit-15;
|
|
68
76
|
display: flex;
|
|
69
77
|
flex-direction: row;
|
|
70
78
|
justify-content: space-between;
|
|
71
79
|
align-items: center;
|
|
72
|
-
height: $header-height + $grid-unit-
|
|
80
|
+
height: $header-height + $grid-unit-15;
|
|
73
81
|
width: 100%;
|
|
74
82
|
z-index: z-index(".components-modal__header");
|
|
75
83
|
position: absolute;
|
|
@@ -121,13 +129,13 @@
|
|
|
121
129
|
// Modal contents.
|
|
122
130
|
.components-modal__content {
|
|
123
131
|
flex: 1;
|
|
124
|
-
margin-top: $header-height + $grid-unit-
|
|
132
|
+
margin-top: $header-height + $grid-unit-15;
|
|
125
133
|
padding: 0 $grid-unit-40 $grid-unit-40;
|
|
126
134
|
overflow: auto;
|
|
127
135
|
|
|
128
136
|
&.hide-header {
|
|
129
137
|
margin-top: 0;
|
|
130
|
-
padding-top: $grid-unit-
|
|
138
|
+
padding-top: $grid-unit-40;
|
|
131
139
|
}
|
|
132
140
|
|
|
133
141
|
&.is-scrollable:focus-visible {
|
|
@@ -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
|
|