@wordpress/components 25.6.1 → 26.0.1-next.5a1d1283.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 +21 -1
- package/CONTRIBUTING.md +1 -1
- package/README.md +3 -8
- package/build/color-picker/hsv-color-picker.native.js +92 -0
- package/build/color-picker/hsv-color-picker.native.js.map +1 -0
- package/build/color-picker/hue-picker.native.js +195 -0
- package/build/color-picker/hue-picker.native.js.map +1 -0
- package/build/color-picker/index.native.js +3 -2
- package/build/color-picker/index.native.js.map +1 -1
- package/build/color-picker/saturation-picker.native.js +178 -0
- package/build/color-picker/saturation-picker.native.js.map +1 -0
- package/build/item-group/item/component.js +0 -1
- package/build/item-group/item/component.js.map +1 -1
- package/build/item-group/item-group/component.js +0 -1
- package/build/item-group/item-group/component.js.map +1 -1
- package/build/menu-item/index.js +6 -4
- package/build/menu-item/index.js.map +1 -1
- package/build/menu-item/types.js.map +1 -1
- package/build/mobile/link-settings/link-settings-navigation.native.js +1 -1
- package/build/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
- package/build/navigation/index.js +0 -1
- package/build/navigation/index.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +1 -2
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/palette-edit/styles.js +10 -10
- package/build/palette-edit/styles.js.map +1 -1
- package/build/popover/index.js +38 -75
- package/build/popover/index.js.map +1 -1
- package/build/popover/overlay-middlewares.js.map +1 -1
- package/build/popover/types.js.map +1 -1
- package/build/popover/utils.js +5 -50
- package/build/popover/utils.js.map +1 -1
- package/build/progress-bar/styles.js +6 -5
- package/build/progress-bar/styles.js.map +1 -1
- package/build/search-control/index.native.js +27 -24
- package/build/search-control/index.native.js.map +1 -1
- package/build/shortcut/index.js +13 -0
- package/build/shortcut/index.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js +3 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js +14 -8
- package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build/slot-fill/index.js +5 -0
- package/build/slot-fill/index.js.map +1 -1
- package/build/spinner/index.js +0 -1
- package/build/spinner/index.js.map +1 -1
- package/build/theme/index.js +0 -1
- package/build/theme/index.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +0 -1
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +5 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tree-select/index.js +0 -1
- package/build/tree-select/index.js.map +1 -1
- package/build/unit-control/index.js +0 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/utils/hooks/use-cx.js +2 -1
- package/build/utils/hooks/use-cx.js.map +1 -1
- package/build/view/component.js +1 -2
- package/build/view/component.js.map +1 -1
- package/build-module/color-picker/hsv-color-picker.native.js +84 -0
- package/build-module/color-picker/hsv-color-picker.native.js.map +1 -0
- package/build-module/color-picker/hue-picker.native.js +185 -0
- package/build-module/color-picker/hue-picker.native.js.map +1 -0
- package/build-module/color-picker/index.native.js +2 -1
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/color-picker/saturation-picker.native.js +168 -0
- package/build-module/color-picker/saturation-picker.native.js.map +1 -0
- package/build-module/item-group/item/component.js +0 -1
- package/build-module/item-group/item/component.js.map +1 -1
- package/build-module/item-group/item-group/component.js +0 -1
- package/build-module/item-group/item-group/component.js.map +1 -1
- package/build-module/menu-item/index.js +4 -2
- package/build-module/menu-item/index.js.map +1 -1
- package/build-module/menu-item/types.js.map +1 -1
- package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -1
- package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
- package/build-module/navigation/index.js +0 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +1 -2
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/palette-edit/styles.js +10 -10
- package/build-module/palette-edit/styles.js.map +1 -1
- package/build-module/popover/index.js +42 -79
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/overlay-middlewares.js.map +1 -1
- package/build-module/popover/types.js.map +1 -1
- package/build-module/popover/utils.js +4 -47
- package/build-module/popover/utils.js.map +1 -1
- package/build-module/progress-bar/styles.js +6 -5
- package/build-module/progress-bar/styles.js.map +1 -1
- package/build-module/search-control/index.native.js +28 -25
- package/build-module/search-control/index.native.js.map +1 -1
- package/build-module/shortcut/index.js +13 -0
- package/build-module/shortcut/index.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +3 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js +14 -8
- package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build-module/slot-fill/index.js +6 -1
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/spinner/index.js +0 -1
- package/build-module/spinner/index.js.map +1 -1
- package/build-module/theme/index.js +0 -1
- package/build-module/theme/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +0 -1
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +5 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tree-select/index.js +0 -1
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/unit-control/index.js +0 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/utils/hooks/use-cx.js +2 -1
- package/build-module/utils/hooks/use-cx.js.map +1 -1
- package/build-module/view/component.js +1 -2
- package/build-module/view/component.js.map +1 -1
- package/build-types/alignment-matrix-control/stories/index.story.d.ts +2 -2
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
- package/build-types/angle-picker-control/stories/index.story.d.ts +2 -2
- package/build-types/angle-picker-control/stories/index.story.d.ts.map +1 -1
- package/build-types/animate/stories/index.story.d.ts +9 -9
- package/build-types/animate/stories/index.story.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts +4 -4
- package/build-types/base-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-box-control/stories/index.story.d.ts +2 -2
- package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-control/stories/index.story.d.ts +2 -2
- package/build-types/border-control/stories/index.story.d.ts.map +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts +3 -3
- package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts +10 -9
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/button-group/stories/index.story.d.ts +3 -3
- package/build-types/button-group/stories/index.story.d.ts.map +1 -1
- package/build-types/card/stories/index.story.d.ts +2 -2
- package/build-types/card/stories/index.story.d.ts.map +1 -1
- package/build-types/checkbox-control/stories/index.story.d.ts +4 -4
- package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/circular-option-picker/stories/index.story.d.ts +2 -2
- package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/color-indicator/stories/index.story.d.ts +3 -3
- package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.story.d.ts +3 -3
- package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +1 -1
- package/build-types/color-picker/stories/index.story.d.ts +2 -2
- package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts +2 -2
- package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/stories/index.story.d.ts +2 -2
- package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +1 -1
- package/build-types/date-time/stories/date-time.story.d.ts +5 -5
- package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
- package/build-types/date-time/stories/date.story.d.ts +5 -5
- package/build-types/date-time/stories/date.story.d.ts.map +1 -1
- package/build-types/date-time/stories/time.story.d.ts +3 -3
- package/build-types/date-time/stories/time.story.d.ts.map +1 -1
- package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
- package/build-types/disabled/stories/index.story.d.ts +4 -4
- package/build-types/disabled/stories/index.story.d.ts.map +1 -1
- package/build-types/divider/stories/index.story.d.ts +5 -5
- package/build-types/divider/stories/index.story.d.ts.map +1 -1
- package/build-types/draggable/stories/index.story.d.ts +4 -4
- package/build-types/draggable/stories/index.story.d.ts.map +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts +2 -2
- package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.story.d.ts +6 -5
- package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
- package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts +2 -2
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +2 -2
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +2 -2
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
- package/build-types/elevation/stories/index.story.d.ts +5 -5
- package/build-types/elevation/stories/index.story.d.ts.map +1 -1
- package/build-types/external-link/stories/index.story.d.ts +3 -3
- package/build-types/external-link/stories/index.story.d.ts.map +1 -1
- package/build-types/flex/stories/index.story.d.ts +4 -4
- package/build-types/flex/stories/index.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts +2 -2
- package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/font-size-picker/stories/e2e/index.story.d.ts +2 -2
- package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/font-size-picker/stories/index.story.d.ts +8 -8
- package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/form-file-upload/stories/index.story.d.ts +2 -2
- package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
- package/build-types/form-toggle/stories/index.story.d.ts +3 -3
- package/build-types/form-toggle/stories/index.story.d.ts.map +1 -1
- package/build-types/form-token-field/stories/index.story.d.ts +7 -7
- package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts +2 -2
- package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/grid/stories/index.story.d.ts +3 -3
- package/build-types/grid/stories/index.story.d.ts.map +1 -1
- package/build-types/guide/stories/index.story.d.ts +2 -2
- package/build-types/guide/stories/index.story.d.ts.map +1 -1
- package/build-types/h-stack/stories/e2e/index.story.d.ts +3 -3
- package/build-types/h-stack/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/h-stack/stories/index.story.d.ts +3 -3
- package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
- package/build-types/heading/stories/index.story.d.ts +3 -3
- package/build-types/heading/stories/index.story.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts +4 -4
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts +2 -2
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/item-group/item/component.d.ts +0 -1
- package/build-types/item-group/item/component.d.ts.map +1 -1
- package/build-types/item-group/item-group/component.d.ts +0 -1
- package/build-types/item-group/item-group/component.d.ts.map +1 -1
- package/build-types/item-group/stories/index.story.d.ts +6 -6
- package/build-types/item-group/stories/index.story.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts +2 -2
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-group/stories/index.story.d.ts +3 -3
- package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-item/index.d.ts +5 -58
- package/build-types/menu-item/index.d.ts.map +1 -1
- package/build-types/menu-item/stories/index.story.d.ts +74 -0
- package/build-types/menu-item/stories/index.story.d.ts.map +1 -0
- package/build-types/menu-item/types.d.ts +3 -2
- package/build-types/menu-item/types.d.ts.map +1 -1
- package/build-types/menu-items-choice/stories/index.story.d.ts +3 -3
- package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
- package/build-types/modal/stories/index.story.d.ts +4 -4
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- package/build-types/navigable-container/stories/navigable-menu.story.d.ts +3 -3
- package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
- package/build-types/navigable-container/stories/tabbable-container.story.d.ts +3 -3
- package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
- package/build-types/navigation/index.d.ts +0 -1
- package/build-types/navigation/index.d.ts.map +1 -1
- package/build-types/navigation/stories/index.story.d.ts +2 -2
- package/build-types/navigation/stories/index.story.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/controlled-state.d.ts +2 -2
- package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/default.d.ts +2 -2
- package/build-types/navigation/stories/utils/default.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/group.d.ts +2 -2
- package/build-types/navigation/stories/utils/group.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts +2 -2
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/more-examples.d.ts +2 -2
- package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/search.d.ts +2 -2
- package/build-types/navigation/stories/utils/search.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts +0 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/stories/index.story.d.ts +5 -5
- package/build-types/navigator/stories/index.story.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts +3 -3
- package/build-types/notice/stories/index.story.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +2 -2
- package/build-types/number-control/stories/index.story.d.ts.map +1 -1
- package/build-types/palette-edit/stories/index.story.d.ts +2 -2
- package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
- package/build-types/palette-edit/styles.d.ts +1 -1
- package/build-types/palette-edit/styles.d.ts.map +1 -1
- package/build-types/panel/stories/index.story.d.ts +6 -6
- package/build-types/panel/stories/index.story.d.ts.map +1 -1
- package/build-types/placeholder/stories/index.story.d.ts +3 -3
- package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/overlay-middlewares.d.ts +2 -2
- package/build-types/popover/overlay-middlewares.d.ts.map +1 -1
- package/build-types/popover/stories/index.story.d.ts +7 -7
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +6 -0
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/popover/utils.d.ts +1 -21
- package/build-types/popover/utils.d.ts.map +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts +3 -3
- package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
- package/build-types/progress-bar/styles.d.ts.map +1 -1
- package/build-types/query-controls/stories/index.story.d.ts +4 -4
- package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-control/stories/index.story.d.ts +3 -3
- package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
- package/build-types/range-control/stories/index.story.d.ts +9 -9
- package/build-types/range-control/stories/index.story.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts +2 -2
- package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
- package/build-types/responsive-wrapper/stories/index.story.d.ts +3 -3
- package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
- package/build-types/sandbox/stories/index.story.d.ts +2 -2
- package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
- package/build-types/scroll-lock/stories/index.story.d.ts +3 -3
- package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
- package/build-types/scrollable/stories/index.story.d.ts +3 -3
- package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts +2 -2
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts +2 -2
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/shortcut/index.d.ts +13 -0
- package/build-types/shortcut/index.d.ts.map +1 -1
- package/build-types/shortcut/stories/index.story.d.ts +13 -0
- package/build-types/shortcut/stories/index.story.d.ts.map +1 -0
- package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts +1 -0
- package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -6
- package/build-types/slot-fill/index.d.ts +1 -1
- package/build-types/slot-fill/index.d.ts.map +1 -1
- package/build-types/snackbar/stories/index.story.d.ts +7 -7
- package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
- package/build-types/snackbar/stories/list.story.d.ts +3 -3
- package/build-types/snackbar/stories/list.story.d.ts.map +1 -1
- package/build-types/spacer/stories/index.story.d.ts +3 -3
- package/build-types/spacer/stories/index.story.d.ts.map +1 -1
- package/build-types/spinner/index.d.ts +0 -1
- package/build-types/spinner/index.d.ts.map +1 -1
- package/build-types/spinner/stories/index.story.d.ts +4 -4
- package/build-types/spinner/stories/index.story.d.ts.map +1 -1
- package/build-types/surface/stories/index.story.d.ts +3 -3
- package/build-types/surface/stories/index.story.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.story.d.ts +2 -2
- package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/text-control/stories/index.story.d.ts +4 -4
- package/build-types/text-control/stories/index.story.d.ts.map +1 -1
- package/build-types/text-highlight/stories/index.story.d.ts +3 -3
- package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
- package/build-types/textarea-control/stories/index.story.d.ts +3 -3
- package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
- package/build-types/theme/index.d.ts +0 -1
- package/build-types/theme/index.d.ts.map +1 -1
- package/build-types/theme/stories/index.story.d.ts +4 -4
- package/build-types/theme/stories/index.story.d.ts.map +1 -1
- package/build-types/tip/stories/index.story.d.ts +3 -3
- package/build-types/tip/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts +2 -2
- package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-group-control/stories/index.story.d.ts +6 -6
- package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
- package/build-types/toolbar/stories/index.story.d.ts +2 -2
- package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
- package/build-types/tools-panel/stories/index.story.d.ts +8 -8
- package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/component.d.ts +0 -1
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts +2 -2
- package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts +0 -1
- package/build-types/tree-select/index.d.ts.map +1 -1
- package/build-types/tree-select/stories/index.story.d.ts +2 -2
- package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
- package/build-types/truncate/stories/index.story.d.ts +4 -4
- package/build-types/truncate/stories/index.story.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +0 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/stories/index.story.d.ts +7 -7
- package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
- package/build-types/utils/hooks/use-cx.d.ts +2 -1
- package/build-types/utils/hooks/use-cx.d.ts.map +1 -1
- package/build-types/v-stack/stories/e2e/index.story.d.ts +3 -3
- package/build-types/v-stack/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.story.d.ts +2 -2
- package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
- package/build-types/view/component.d.ts +0 -1
- package/build-types/view/component.d.ts.map +1 -1
- package/build-types/view/stories/index.story.d.ts +3 -3
- package/build-types/view/stories/index.story.d.ts.map +1 -1
- package/build-types/visually-hidden/stories/index.story.d.ts +5 -5
- package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
- package/build-types/z-stack/stories/index.story.d.ts +3 -3
- package/build-types/z-stack/stories/index.story.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/alignment-matrix-control/stories/index.story.tsx +7 -3
- package/src/angle-picker-control/stories/index.story.tsx +3 -3
- package/src/animate/stories/index.story.tsx +12 -10
- package/src/base-control/stories/index.story.tsx +5 -9
- package/src/border-box-control/stories/index.story.tsx +5 -9
- package/src/border-control/stories/index.story.tsx +8 -14
- package/src/button/stories/e2e/index.story.tsx +3 -3
- package/src/button/stories/index.story.tsx +10 -10
- package/src/button-group/stories/index.story.tsx +4 -6
- package/src/card/stories/index.story.tsx +5 -5
- package/src/checkbox-control/stories/index.story.tsx +7 -6
- package/src/circular-option-picker/stories/index.story.tsx +16 -4
- package/src/color-indicator/stories/index.story.tsx +4 -6
- package/src/color-palette/stories/index.story.tsx +12 -21
- package/src/color-picker/hsv-color-picker.native.js +88 -0
- package/src/color-picker/hue-picker.native.js +194 -0
- package/src/color-picker/index.native.js +2 -1
- package/src/color-picker/saturation-picker.native.js +163 -0
- package/src/color-picker/stories/index.story.tsx +3 -3
- package/src/color-picker/style.native.scss +23 -0
- package/src/combobox-control/stories/index.story.tsx +3 -3
- package/src/custom-gradient-picker/stories/index.story.tsx +3 -3
- package/src/date-time/stories/date-time.story.tsx +8 -10
- package/src/date-time/stories/date.story.tsx +8 -9
- package/src/date-time/stories/time.story.tsx +4 -4
- package/src/dimension-control/stories/index.story.tsx +3 -3
- package/src/disabled/stories/index.story.tsx +4 -4
- package/src/divider/stories/index.story.tsx +6 -6
- package/src/draggable/stories/index.story.tsx +5 -7
- package/src/drop-zone/stories/index.story.tsx +3 -3
- package/src/dropdown/stories/index.story.tsx +8 -6
- package/src/dropdown-menu/stories/index.story.tsx +3 -3
- package/src/dropdown-menu-v2/stories/index.story.tsx +24 -10
- package/src/duotone-picker/stories/duotone-picker.story.tsx +3 -6
- package/src/duotone-picker/stories/duotone-swatch.story.tsx +3 -3
- package/src/elevation/stories/index.story.tsx +7 -7
- package/src/external-link/stories/index.story.tsx +4 -6
- package/src/flex/stories/index.story.tsx +6 -6
- package/src/focal-point-picker/stories/index.story.tsx +3 -3
- package/src/font-size-picker/stories/e2e/index.story.tsx +3 -3
- package/src/font-size-picker/stories/index.story.tsx +10 -10
- package/src/form-file-upload/stories/index.story.tsx +3 -3
- package/src/form-toggle/stories/index.story.tsx +4 -7
- package/src/form-token-field/stories/index.story.tsx +10 -11
- package/src/gradient-picker/stories/index.story.tsx +3 -3
- package/src/grid/stories/index.story.tsx +4 -4
- package/src/guide/stories/index.story.tsx +3 -3
- package/src/h-stack/stories/e2e/index.story.tsx +4 -4
- package/src/h-stack/stories/index.story.tsx +4 -4
- package/src/heading/stories/index.story.tsx +3 -3
- package/src/icon/stories/index.story.tsx +5 -5
- package/src/input-control/stories/index.story.tsx +5 -3
- package/src/item-group/item/component.tsx +0 -1
- package/src/item-group/item-group/component.tsx +0 -1
- package/src/item-group/stories/index.story.tsx +11 -12
- package/src/keyboard-shortcuts/stories/index.story.tsx +3 -3
- package/src/menu-group/stories/index.story.tsx +5 -5
- package/src/menu-item/README.md +1 -1
- package/src/menu-item/index.tsx +5 -2
- package/src/menu-item/stories/index.story.tsx +80 -0
- package/src/menu-item/types.ts +3 -2
- package/src/menu-items-choice/stories/index.story.tsx +4 -6
- package/src/mobile/link-settings/link-settings-navigation.native.js +1 -1
- package/src/modal/stories/index.story.tsx +5 -10
- package/src/navigable-container/stories/navigable-menu.story.tsx +3 -3
- package/src/navigable-container/stories/tabbable-container.story.tsx +3 -3
- package/src/navigation/index.tsx +0 -1
- package/src/navigation/stories/index.story.tsx +16 -2
- package/src/navigation/stories/utils/controlled-state.tsx +2 -2
- package/src/navigation/stories/utils/default.tsx +2 -2
- package/src/navigation/stories/utils/group.tsx +2 -2
- package/src/navigation/stories/utils/hide-if-empty.tsx +2 -2
- package/src/navigation/stories/utils/more-examples.tsx +2 -2
- package/src/navigation/stories/utils/search.tsx +2 -2
- package/src/navigator/navigator-provider/component.tsx +0 -1
- package/src/navigator/stories/index.story.tsx +9 -10
- package/src/notice/stories/index.story.tsx +6 -6
- package/src/number-control/stories/index.story.tsx +3 -3
- package/src/palette-edit/stories/index.story.tsx +3 -3
- package/src/palette-edit/styles.js +0 -1
- package/src/panel/stories/index.story.tsx +9 -11
- package/src/placeholder/stories/index.story.tsx +4 -6
- package/src/popover/README.md +2 -2
- package/src/popover/index.tsx +69 -103
- package/src/popover/overlay-middlewares.tsx +2 -2
- package/src/popover/stories/index.story.tsx +8 -10
- package/src/popover/test/index.tsx +15 -1
- package/src/popover/types.ts +6 -0
- package/src/popover/utils.ts +5 -56
- package/src/progress-bar/stories/index.story.tsx +4 -6
- package/src/progress-bar/styles.ts +4 -1
- package/src/query-controls/stories/index.story.tsx +5 -6
- package/src/radio-control/stories/index.story.tsx +4 -6
- package/src/radio-group/stories/index.story.js +1 -0
- package/src/range-control/stories/index.story.tsx +12 -18
- package/src/resizable-box/stories/index.story.tsx +3 -3
- package/src/responsive-wrapper/stories/index.story.tsx +4 -5
- package/src/sandbox/stories/index.story.tsx +3 -5
- package/src/scroll-lock/stories/index.story.tsx +3 -3
- package/src/scrollable/stories/index.story.tsx +4 -4
- package/src/search-control/index.native.js +39 -27
- package/src/search-control/stories/index.story.tsx +3 -3
- package/src/select-control/stories/index.story.tsx +3 -3
- package/src/shortcut/index.tsx +13 -0
- package/src/shortcut/stories/index.story.tsx +33 -0
- package/src/slot-fill/README.md +5 -5
- package/src/slot-fill/bubbles-virtually/slot-fill-context.js +3 -0
- package/src/slot-fill/bubbles-virtually/slot.js +17 -5
- package/src/slot-fill/index.js +6 -1
- package/src/slot-fill/stories/index.story.js +2 -0
- package/src/slot-fill/test/__snapshots__/slot.js.snap +12 -4
- package/src/snackbar/stories/index.story.tsx +10 -13
- package/src/snackbar/stories/list.story.tsx +3 -3
- package/src/spacer/stories/index.story.tsx +4 -4
- package/src/spinner/index.tsx +0 -1
- package/src/spinner/stories/index.story.tsx +5 -5
- package/src/surface/stories/index.story.tsx +4 -4
- package/src/tab-panel/stories/index.story.tsx +5 -13
- package/src/tab-panel/test/index.tsx +9 -25
- package/src/text-control/stories/index.story.tsx +7 -6
- package/src/text-highlight/stories/index.story.tsx +4 -6
- package/src/textarea-control/stories/index.story.tsx +4 -6
- package/src/theme/index.tsx +0 -1
- package/src/theme/stories/index.story.tsx +5 -5
- package/src/tip/stories/index.story.tsx +4 -4
- package/src/toggle-control/stories/index.story.tsx +3 -3
- package/src/toggle-group-control/stories/index.story.tsx +17 -11
- package/src/toolbar/stories/index.story.tsx +13 -3
- package/src/tools-panel/stories/index.story.tsx +17 -12
- package/src/tools-panel/tools-panel/component.tsx +0 -1
- package/src/tools-panel/tools-panel-header/component.tsx +3 -0
- package/src/tree-grid/stories/index.story.tsx +5 -3
- package/src/tree-select/index.tsx +0 -1
- package/src/tree-select/stories/index.story.tsx +3 -3
- package/src/truncate/stories/index.story.tsx +5 -7
- package/src/unit-control/index.tsx +0 -1
- package/src/unit-control/stories/index.story.tsx +10 -9
- package/src/utils/hooks/use-cx.ts +2 -1
- package/src/v-stack/stories/e2e/index.story.tsx +4 -4
- package/src/v-stack/stories/index.story.tsx +3 -3
- package/src/view/component.tsx +0 -1
- package/src/view/stories/index.story.tsx +4 -4
- package/src/visually-hidden/stories/index.story.tsx +7 -7
- package/src/z-stack/stories/index.story.tsx +4 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/build/popover/limit-shift.js +0 -129
- package/build/popover/limit-shift.js.map +0 -1
- package/build-module/popover/limit-shift.js +0 -122
- package/build-module/popover/limit-shift.js.map +0 -1
- package/build-types/popover/limit-shift.d.ts +0 -87
- package/build-types/popover/limit-shift.d.ts.map +0 -1
- package/src/popover/limit-shift.ts +0 -205
|
@@ -13,9 +13,9 @@ import MenuItemsChoice from '../../menu-items-choice';
|
|
|
13
13
|
/**
|
|
14
14
|
* External dependencies
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
16
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
17
17
|
|
|
18
|
-
const meta:
|
|
18
|
+
const meta: Meta< typeof MenuGroup > = {
|
|
19
19
|
title: 'Components/MenuGroup',
|
|
20
20
|
component: MenuGroup,
|
|
21
21
|
argTypes: {
|
|
@@ -28,7 +28,7 @@ const meta: ComponentMeta< typeof MenuGroup > = {
|
|
|
28
28
|
};
|
|
29
29
|
export default meta;
|
|
30
30
|
|
|
31
|
-
const Template:
|
|
31
|
+
const Template: StoryFn< typeof MenuGroup > = ( args ) => {
|
|
32
32
|
return (
|
|
33
33
|
<MenuGroup { ...args }>
|
|
34
34
|
<MenuItem>Menu Item 1</MenuItem>
|
|
@@ -37,9 +37,9 @@ const Template: ComponentStory< typeof MenuGroup > = ( args ) => {
|
|
|
37
37
|
);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
export const Default:
|
|
40
|
+
export const Default: StoryFn< typeof MenuGroup > = Template.bind( {} );
|
|
41
41
|
|
|
42
|
-
const MultiGroupsTemplate:
|
|
42
|
+
const MultiGroupsTemplate: StoryFn< typeof MenuGroup > = ( args ) => {
|
|
43
43
|
const [ mode, setMode ] = useState( 'visual' );
|
|
44
44
|
const choices = [
|
|
45
45
|
{
|
package/src/menu-item/README.md
CHANGED
|
@@ -70,7 +70,7 @@ Determines where to display the provided `icon`.
|
|
|
70
70
|
- Type: `boolean`
|
|
71
71
|
- Required: No
|
|
72
72
|
|
|
73
|
-
Whether or not the menu item is currently selected.
|
|
73
|
+
Whether or not the menu item is currently selected. `isSelected` is only taken into account when the `role` prop is either `"menuitemcheckbox"` or `"menuitemradio"`.
|
|
74
74
|
|
|
75
75
|
### `shortcut`
|
|
76
76
|
|
package/src/menu-item/index.tsx
CHANGED
|
@@ -18,7 +18,7 @@ import Icon from '../icon';
|
|
|
18
18
|
import type { WordPressComponentProps } from '../ui/context';
|
|
19
19
|
import type { MenuItemProps } from './types';
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
function UnforwardedMenuItem(
|
|
22
22
|
props: WordPressComponentProps< MenuItemProps, 'button', false >,
|
|
23
23
|
ref: ForwardedRef< HTMLButtonElement >
|
|
24
24
|
) {
|
|
@@ -97,6 +97,7 @@ export function MenuItem(
|
|
|
97
97
|
* <MenuItem
|
|
98
98
|
* icon={ isActive ? 'yes' : 'no' }
|
|
99
99
|
* isSelected={ isActive }
|
|
100
|
+
* role="menuitemcheckbox"
|
|
100
101
|
* onClick={ () => setIsActive( ( state ) => ! state ) }
|
|
101
102
|
* >
|
|
102
103
|
* Toggle
|
|
@@ -105,4 +106,6 @@ export function MenuItem(
|
|
|
105
106
|
* };
|
|
106
107
|
* ```
|
|
107
108
|
*/
|
|
108
|
-
export
|
|
109
|
+
export const MenuItem = forwardRef( UnforwardedMenuItem );
|
|
110
|
+
|
|
111
|
+
export default MenuItem;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { link, more, check } from '@wordpress/icons';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import MenuGroup from '../../menu-group';
|
|
15
|
+
import MenuItem from '..';
|
|
16
|
+
import Shortcut from '../../shortcut';
|
|
17
|
+
|
|
18
|
+
const meta: Meta< typeof MenuItem > = {
|
|
19
|
+
component: MenuItem,
|
|
20
|
+
title: 'Components/MenuItem',
|
|
21
|
+
argTypes: {
|
|
22
|
+
children: { control: { type: null } },
|
|
23
|
+
icon: {
|
|
24
|
+
control: { type: 'select' },
|
|
25
|
+
options: [ 'check', 'link', 'more' ],
|
|
26
|
+
mapping: {
|
|
27
|
+
check,
|
|
28
|
+
link,
|
|
29
|
+
more,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
parameters: {
|
|
34
|
+
controls: {
|
|
35
|
+
expanded: true,
|
|
36
|
+
},
|
|
37
|
+
docs: { canvas: { sourceState: 'shown' } },
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export default meta;
|
|
41
|
+
|
|
42
|
+
const Template: StoryFn< typeof MenuItem > = ( props ) => {
|
|
43
|
+
return (
|
|
44
|
+
<MenuGroup>
|
|
45
|
+
<MenuItem { ...props }>Menu Item 1</MenuItem>
|
|
46
|
+
</MenuGroup>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Default: StoryFn< typeof MenuItem > = Template.bind( {} );
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* When the `role` prop is either `"menuitemcheckbox"` or `"menuitemradio"`, the
|
|
54
|
+
* `isSelected` prop should be used so screen readers can tell which item is currently selected.
|
|
55
|
+
*/
|
|
56
|
+
export const IsSelected = Template.bind( {} );
|
|
57
|
+
IsSelected.args = {
|
|
58
|
+
...Default.args,
|
|
59
|
+
isSelected: true,
|
|
60
|
+
role: 'menuitemcheckbox',
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const WithIcon = Template.bind( {} );
|
|
64
|
+
WithIcon.args = {
|
|
65
|
+
...Default.args,
|
|
66
|
+
icon: link,
|
|
67
|
+
iconPosition: 'left',
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const WithInfo = Template.bind( {} );
|
|
71
|
+
WithInfo.args = {
|
|
72
|
+
...Default.args,
|
|
73
|
+
info: 'Menu Item description',
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const WithSuffix = Template.bind( {} );
|
|
77
|
+
WithSuffix.args = {
|
|
78
|
+
...Default.args,
|
|
79
|
+
suffix: <Shortcut shortcut="Ctrl+M"></Shortcut>,
|
|
80
|
+
};
|
package/src/menu-item/types.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { ReactNode } from 'react';
|
|
|
8
8
|
*/
|
|
9
9
|
import type { ButtonAsButtonProps } from '../button/types';
|
|
10
10
|
|
|
11
|
-
export type MenuItemProps = ButtonAsButtonProps & {
|
|
11
|
+
export type MenuItemProps = Pick< ButtonAsButtonProps, 'isDestructive' > & {
|
|
12
12
|
/**
|
|
13
13
|
* A CSS `class` to give to the container element.
|
|
14
14
|
*/
|
|
@@ -33,7 +33,8 @@ export type MenuItemProps = ButtonAsButtonProps & {
|
|
|
33
33
|
*/
|
|
34
34
|
iconPosition?: ButtonAsButtonProps[ 'iconPosition' ];
|
|
35
35
|
/**
|
|
36
|
-
* Whether or not the menu item is currently selected
|
|
36
|
+
* Whether or not the menu item is currently selected, `isSelected` is only taken into
|
|
37
|
+
* account when the `role` prop is either `"menuitemcheckbox"` or `"menuitemradio"`.
|
|
37
38
|
*/
|
|
38
39
|
isSelected?: boolean;
|
|
39
40
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -14,7 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import MenuItemsChoice from '..';
|
|
15
15
|
import MenuGroup from '../../menu-group';
|
|
16
16
|
|
|
17
|
-
const meta:
|
|
17
|
+
const meta: Meta< typeof MenuItemsChoice > = {
|
|
18
18
|
component: MenuItemsChoice,
|
|
19
19
|
title: 'Components/MenuItemsChoice',
|
|
20
20
|
argTypes: {
|
|
@@ -31,7 +31,7 @@ const meta: ComponentMeta< typeof MenuItemsChoice > = {
|
|
|
31
31
|
};
|
|
32
32
|
export default meta;
|
|
33
33
|
|
|
34
|
-
const Template:
|
|
34
|
+
const Template: StoryFn< typeof MenuItemsChoice > = ( {
|
|
35
35
|
onHover,
|
|
36
36
|
onSelect,
|
|
37
37
|
choices,
|
|
@@ -53,9 +53,7 @@ const Template: ComponentStory< typeof MenuItemsChoice > = ( {
|
|
|
53
53
|
);
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
export const Default:
|
|
57
|
-
{}
|
|
58
|
-
);
|
|
56
|
+
export const Default: StoryFn< typeof MenuItemsChoice > = Template.bind( {} );
|
|
59
57
|
|
|
60
58
|
Default.args = {
|
|
61
59
|
choices: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { StoryFn, Meta } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -17,7 +17,7 @@ import InputControl from '../../input-control';
|
|
|
17
17
|
import Modal from '../';
|
|
18
18
|
import type { ModalProps } from '../types';
|
|
19
19
|
|
|
20
|
-
const meta:
|
|
20
|
+
const meta: Meta< typeof Modal > = {
|
|
21
21
|
component: Modal,
|
|
22
22
|
title: 'Components/Modal',
|
|
23
23
|
argTypes: {
|
|
@@ -46,10 +46,7 @@ const meta: ComponentMeta< typeof Modal > = {
|
|
|
46
46
|
};
|
|
47
47
|
export default meta;
|
|
48
48
|
|
|
49
|
-
const Template:
|
|
50
|
-
onRequestClose,
|
|
51
|
-
...args
|
|
52
|
-
} ) => {
|
|
49
|
+
const Template: StoryFn< typeof Modal > = ( { onRequestClose, ...args } ) => {
|
|
53
50
|
const [ isOpen, setOpen ] = useState( false );
|
|
54
51
|
const openModal = () => setOpen( true );
|
|
55
52
|
const closeModal: ModalProps[ 'onRequestClose' ] = ( event ) => {
|
|
@@ -91,7 +88,7 @@ const Template: ComponentStory< typeof Modal > = ( {
|
|
|
91
88
|
);
|
|
92
89
|
};
|
|
93
90
|
|
|
94
|
-
export const Default:
|
|
91
|
+
export const Default: StoryFn< typeof Modal > = Template.bind( {} );
|
|
95
92
|
Default.args = {
|
|
96
93
|
title: 'Title',
|
|
97
94
|
};
|
|
@@ -114,9 +111,7 @@ const LikeButton = () => {
|
|
|
114
111
|
);
|
|
115
112
|
};
|
|
116
113
|
|
|
117
|
-
export const WithHeaderActions:
|
|
118
|
-
{}
|
|
119
|
-
);
|
|
114
|
+
export const WithHeaderActions: StoryFn< typeof Modal > = Template.bind( {} );
|
|
120
115
|
WithHeaderActions.args = {
|
|
121
116
|
...Default.args,
|
|
122
117
|
headerActions: <LikeButton />,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { NavigableMenu } from '..';
|
|
10
10
|
|
|
11
|
-
const meta:
|
|
11
|
+
const meta: Meta< typeof NavigableMenu > = {
|
|
12
12
|
title: 'Components/NavigableMenu',
|
|
13
13
|
component: NavigableMenu,
|
|
14
14
|
argTypes: {
|
|
@@ -24,7 +24,7 @@ const meta: ComponentMeta< typeof NavigableMenu > = {
|
|
|
24
24
|
};
|
|
25
25
|
export default meta;
|
|
26
26
|
|
|
27
|
-
export const Default:
|
|
27
|
+
export const Default: StoryFn< typeof NavigableMenu > = ( args ) => {
|
|
28
28
|
return (
|
|
29
29
|
<>
|
|
30
30
|
<button>Before navigable menu</button>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { TabbableContainer } from '..';
|
|
10
10
|
|
|
11
|
-
const meta:
|
|
11
|
+
const meta: Meta< typeof TabbableContainer > = {
|
|
12
12
|
title: 'Components/TabbableContainer',
|
|
13
13
|
component: TabbableContainer,
|
|
14
14
|
argTypes: {
|
|
@@ -24,7 +24,7 @@ const meta: ComponentMeta< typeof TabbableContainer > = {
|
|
|
24
24
|
};
|
|
25
25
|
export default meta;
|
|
26
26
|
|
|
27
|
-
export const Default:
|
|
27
|
+
export const Default: StoryFn< typeof TabbableContainer > = ( args ) => {
|
|
28
28
|
return (
|
|
29
29
|
<>
|
|
30
30
|
<button>Before tabbable container</button>
|
package/src/navigation/index.tsx
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { Meta } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { Navigation } from '..';
|
|
10
|
+
import { NavigationBackButton } from '../back-button';
|
|
11
|
+
import { NavigationGroup } from '../group';
|
|
12
|
+
import { NavigationItem } from '../item';
|
|
13
|
+
import { NavigationMenu } from '../menu';
|
|
10
14
|
import { DefaultStory } from './utils/default';
|
|
11
15
|
import { GroupStory } from './utils/group';
|
|
12
16
|
import { ControlledStateStory } from './utils/controlled-state';
|
|
@@ -15,9 +19,19 @@ import { MoreExamplesStory } from './utils/more-examples';
|
|
|
15
19
|
import { HideIfEmptyStory } from './utils/hide-if-empty';
|
|
16
20
|
import './style.css';
|
|
17
21
|
|
|
18
|
-
const meta:
|
|
22
|
+
const meta: Meta< typeof Navigation > = {
|
|
19
23
|
title: 'Components (Experimental)/Navigation',
|
|
20
24
|
component: Navigation,
|
|
25
|
+
subcomponents: {
|
|
26
|
+
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
27
|
+
NavigationBackButton,
|
|
28
|
+
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
29
|
+
NavigationGroup,
|
|
30
|
+
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
31
|
+
NavigationItem,
|
|
32
|
+
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
33
|
+
NavigationMenu,
|
|
34
|
+
},
|
|
21
35
|
argTypes: {
|
|
22
36
|
activeItem: { control: { type: null } },
|
|
23
37
|
activeMenu: { control: { type: null } },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -16,7 +16,7 @@ import { Navigation } from '../..';
|
|
|
16
16
|
import { NavigationItem } from '../../item';
|
|
17
17
|
import { NavigationMenu } from '../../menu';
|
|
18
18
|
|
|
19
|
-
export const ControlledStateStory:
|
|
19
|
+
export const ControlledStateStory: StoryFn< typeof Navigation > = ( {
|
|
20
20
|
className,
|
|
21
21
|
...props
|
|
22
22
|
} ) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -15,7 +15,7 @@ import { Navigation } from '../..';
|
|
|
15
15
|
import { NavigationItem } from '../../item';
|
|
16
16
|
import { NavigationMenu } from '../../menu';
|
|
17
17
|
|
|
18
|
-
export const DefaultStory:
|
|
18
|
+
export const DefaultStory: StoryFn< typeof Navigation > = ( {
|
|
19
19
|
className,
|
|
20
20
|
...props
|
|
21
21
|
} ) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -16,7 +16,7 @@ import { NavigationItem } from '../../item';
|
|
|
16
16
|
import { NavigationMenu } from '../../menu';
|
|
17
17
|
import { NavigationGroup } from '../../group';
|
|
18
18
|
|
|
19
|
-
export const GroupStory:
|
|
19
|
+
export const GroupStory: StoryFn< typeof Navigation > = ( {
|
|
20
20
|
className,
|
|
21
21
|
...props
|
|
22
22
|
} ) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
@@ -10,7 +10,7 @@ import { Navigation } from '../..';
|
|
|
10
10
|
import { NavigationItem } from '../../item';
|
|
11
11
|
import { NavigationMenu } from '../../menu';
|
|
12
12
|
|
|
13
|
-
export const HideIfEmptyStory:
|
|
13
|
+
export const HideIfEmptyStory: StoryFn< typeof Navigation > = ( {
|
|
14
14
|
className,
|
|
15
15
|
...props
|
|
16
16
|
} ) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -17,7 +17,7 @@ import { NavigationGroup } from '../../group';
|
|
|
17
17
|
import { NavigationItem } from '../../item';
|
|
18
18
|
import { NavigationMenu } from '../../menu';
|
|
19
19
|
|
|
20
|
-
export const MoreExamplesStory:
|
|
20
|
+
export const MoreExamplesStory: StoryFn< typeof Navigation > = ( {
|
|
21
21
|
className,
|
|
22
22
|
...props
|
|
23
23
|
} ) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -29,7 +29,7 @@ const searchItems = [
|
|
|
29
29
|
{ item: 'waldo', title: 'Waldo' },
|
|
30
30
|
];
|
|
31
31
|
|
|
32
|
-
export const SearchStory:
|
|
32
|
+
export const SearchStory: StoryFn< typeof Navigation > = ( {
|
|
33
33
|
className,
|
|
34
34
|
...props
|
|
35
35
|
} ) => {
|
|
@@ -268,7 +268,6 @@ function UnconnectedNavigatorProvider(
|
|
|
268
268
|
* view (via the `NavigatorButton` and `NavigatorBackButton` components or the
|
|
269
269
|
* `useNavigator` hook).
|
|
270
270
|
*
|
|
271
|
-
* @example
|
|
272
271
|
* ```jsx
|
|
273
272
|
* import {
|
|
274
273
|
* __experimentalNavigatorProvider as NavigatorProvider,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
@@ -19,8 +19,10 @@ import {
|
|
|
19
19
|
useNavigator,
|
|
20
20
|
} from '..';
|
|
21
21
|
|
|
22
|
-
const meta:
|
|
22
|
+
const meta: Meta< typeof NavigatorProvider > = {
|
|
23
23
|
component: NavigatorProvider,
|
|
24
|
+
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
25
|
+
subcomponents: { NavigatorScreen, NavigatorButton, NavigatorBackButton },
|
|
24
26
|
title: 'Components (Experimental)/Navigator',
|
|
25
27
|
argTypes: {
|
|
26
28
|
as: { control: { type: null } },
|
|
@@ -34,7 +36,7 @@ const meta: ComponentMeta< typeof NavigatorProvider > = {
|
|
|
34
36
|
};
|
|
35
37
|
export default meta;
|
|
36
38
|
|
|
37
|
-
const Template:
|
|
39
|
+
const Template: StoryFn< typeof NavigatorProvider > = ( {
|
|
38
40
|
style,
|
|
39
41
|
...props
|
|
40
42
|
} ) => (
|
|
@@ -178,8 +180,7 @@ const Template: ComponentStory< typeof NavigatorProvider > = ( {
|
|
|
178
180
|
</NavigatorProvider>
|
|
179
181
|
);
|
|
180
182
|
|
|
181
|
-
export const Default:
|
|
182
|
-
Template.bind( {} );
|
|
183
|
+
export const Default: StoryFn< typeof NavigatorProvider > = Template.bind( {} );
|
|
183
184
|
Default.args = {
|
|
184
185
|
initialPath: '/',
|
|
185
186
|
};
|
|
@@ -233,7 +234,7 @@ function ProductDetails() {
|
|
|
233
234
|
);
|
|
234
235
|
}
|
|
235
236
|
|
|
236
|
-
const NestedNavigatorTemplate:
|
|
237
|
+
const NestedNavigatorTemplate: StoryFn< typeof NavigatorProvider > = ( {
|
|
237
238
|
style,
|
|
238
239
|
...props
|
|
239
240
|
} ) => (
|
|
@@ -292,7 +293,7 @@ const NestedNavigatorTemplate: ComponentStory< typeof NavigatorProvider > = ( {
|
|
|
292
293
|
</NavigatorProvider>
|
|
293
294
|
);
|
|
294
295
|
|
|
295
|
-
export const NestedNavigator:
|
|
296
|
+
export const NestedNavigator: StoryFn< typeof NavigatorProvider > =
|
|
296
297
|
NestedNavigatorTemplate.bind( {} );
|
|
297
298
|
NestedNavigator.args = {
|
|
298
299
|
initialPath: '/child2/grandchild',
|
|
@@ -316,9 +317,7 @@ const NavigatorButtonWithSkipFocus = ( {
|
|
|
316
317
|
);
|
|
317
318
|
};
|
|
318
319
|
|
|
319
|
-
export const SkipFocus:
|
|
320
|
-
args
|
|
321
|
-
) => {
|
|
320
|
+
export const SkipFocus: StoryFn< typeof NavigatorProvider > = ( args ) => {
|
|
322
321
|
return <NavigatorProvider { ...args } />;
|
|
323
322
|
};
|
|
324
323
|
SkipFocus.args = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -16,9 +16,11 @@ import Button from '../../button';
|
|
|
16
16
|
import NoticeList from '../list';
|
|
17
17
|
import type { NoticeListProps } from '../types';
|
|
18
18
|
|
|
19
|
-
const meta:
|
|
19
|
+
const meta: Meta< typeof Notice > = {
|
|
20
20
|
title: 'Components/Notice',
|
|
21
21
|
component: Notice,
|
|
22
|
+
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
23
|
+
subcomponents: { NoticeList },
|
|
22
24
|
parameters: {
|
|
23
25
|
actions: { argTypesRegex: '^on.*' },
|
|
24
26
|
controls: { expanded: true },
|
|
@@ -27,7 +29,7 @@ const meta: ComponentMeta< typeof Notice > = {
|
|
|
27
29
|
};
|
|
28
30
|
export default meta;
|
|
29
31
|
|
|
30
|
-
const Template:
|
|
32
|
+
const Template: StoryFn< typeof Notice > = ( props ) => {
|
|
31
33
|
return <Notice { ...props } />;
|
|
32
34
|
};
|
|
33
35
|
|
|
@@ -81,9 +83,7 @@ WithActions.args = {
|
|
|
81
83
|
],
|
|
82
84
|
};
|
|
83
85
|
|
|
84
|
-
export const NoticeListSubcomponent:
|
|
85
|
-
typeof NoticeList
|
|
86
|
-
> = () => {
|
|
86
|
+
export const NoticeListSubcomponent: StoryFn< typeof NoticeList > = () => {
|
|
87
87
|
const exampleNotices = [
|
|
88
88
|
{
|
|
89
89
|
id: 'second-notice',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -13,7 +13,7 @@ import { useState } from '@wordpress/element';
|
|
|
13
13
|
*/
|
|
14
14
|
import NumberControl from '..';
|
|
15
15
|
|
|
16
|
-
const meta:
|
|
16
|
+
const meta: Meta< typeof NumberControl > = {
|
|
17
17
|
title: 'Components (Experimental)/NumberControl',
|
|
18
18
|
component: NumberControl,
|
|
19
19
|
argTypes: {
|
|
@@ -32,7 +32,7 @@ const meta: ComponentMeta< typeof NumberControl > = {
|
|
|
32
32
|
|
|
33
33
|
export default meta;
|
|
34
34
|
|
|
35
|
-
const Template:
|
|
35
|
+
const Template: StoryFn< typeof NumberControl > = ( {
|
|
36
36
|
onChange,
|
|
37
37
|
...props
|
|
38
38
|
} ) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -14,7 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import PaletteEdit from '..';
|
|
15
15
|
import type { Color, Gradient } from '../types';
|
|
16
16
|
|
|
17
|
-
const meta:
|
|
17
|
+
const meta: Meta< typeof PaletteEdit > = {
|
|
18
18
|
title: 'Components/PaletteEdit',
|
|
19
19
|
component: PaletteEdit,
|
|
20
20
|
parameters: {
|
|
@@ -25,7 +25,7 @@ const meta: ComponentMeta< typeof PaletteEdit > = {
|
|
|
25
25
|
};
|
|
26
26
|
export default meta;
|
|
27
27
|
|
|
28
|
-
const Template:
|
|
28
|
+
const Template: StoryFn< typeof PaletteEdit > = ( args ) => {
|
|
29
29
|
const { colors, gradients, onChange, ...props } = args;
|
|
30
30
|
const [ value, setValue ] = useState( gradients || colors );
|
|
31
31
|
|
|
@@ -42,7 +42,6 @@ export const NameInputControl = styled( InputControl )`
|
|
|
42
42
|
|
|
43
43
|
export const PaletteItem = styled( View )`
|
|
44
44
|
padding: 3px 0 3px ${ space( 3 ) };
|
|
45
|
-
height: calc( 40px - ${ CONFIG.borderWidth } );
|
|
46
45
|
border: 1px solid ${ CONFIG.surfaceBorderColor };
|
|
47
46
|
border-bottom-color: transparent;
|
|
48
47
|
&:first-of-type {
|