@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
|
@@ -54,7 +54,10 @@ export const Indicator = styled.div< {
|
|
|
54
54
|
animationName: animateProgressBar,
|
|
55
55
|
width: `${ INDETERMINATE_TRACK_WIDTH }%`,
|
|
56
56
|
} )
|
|
57
|
-
: css( {
|
|
57
|
+
: css( {
|
|
58
|
+
width: `${ value }%`,
|
|
59
|
+
transition: 'width 0.4s ease-in-out',
|
|
60
|
+
} ) };
|
|
58
61
|
`;
|
|
59
62
|
|
|
60
63
|
export const ProgressElement = styled.progress`
|
|
@@ -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
|
|
@@ -18,7 +18,7 @@ import type {
|
|
|
18
18
|
QueryControlsWithMultipleCategorySelectionProps,
|
|
19
19
|
} from '../types';
|
|
20
20
|
|
|
21
|
-
const meta:
|
|
21
|
+
const meta: Meta< typeof QueryControls > = {
|
|
22
22
|
title: 'Components/QueryControls',
|
|
23
23
|
component: QueryControls,
|
|
24
24
|
argTypes: {
|
|
@@ -37,7 +37,7 @@ const meta: ComponentMeta< typeof QueryControls > = {
|
|
|
37
37
|
};
|
|
38
38
|
export default meta;
|
|
39
39
|
|
|
40
|
-
export const Default:
|
|
40
|
+
export const Default: StoryFn< typeof QueryControls > = ( args ) => {
|
|
41
41
|
const {
|
|
42
42
|
onAuthorChange,
|
|
43
43
|
onCategoryChange,
|
|
@@ -146,7 +146,7 @@ Default.args = {
|
|
|
146
146
|
selectedAuthorId: 1,
|
|
147
147
|
};
|
|
148
148
|
|
|
149
|
-
const SingleCategoryTemplate:
|
|
149
|
+
const SingleCategoryTemplate: StoryFn< typeof QueryControls > = ( args ) => {
|
|
150
150
|
const {
|
|
151
151
|
onAuthorChange,
|
|
152
152
|
onCategoryChange,
|
|
@@ -184,8 +184,7 @@ const SingleCategoryTemplate: Story< typeof QueryControls > = ( args ) => {
|
|
|
184
184
|
/>
|
|
185
185
|
);
|
|
186
186
|
};
|
|
187
|
-
export const SelectSingleCategory
|
|
188
|
-
SingleCategoryTemplate.bind( {} );
|
|
187
|
+
export const SelectSingleCategory = SingleCategoryTemplate.bind( {} );
|
|
189
188
|
SelectSingleCategory.args = {
|
|
190
189
|
categoriesList: [
|
|
191
190
|
{
|
|
@@ -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 RadioControl from '..';
|
|
15
15
|
|
|
16
|
-
const meta:
|
|
16
|
+
const meta: Meta< typeof RadioControl > = {
|
|
17
17
|
component: RadioControl,
|
|
18
18
|
title: 'Components/RadioControl',
|
|
19
19
|
argTypes: {
|
|
@@ -39,7 +39,7 @@ const meta: ComponentMeta< typeof RadioControl > = {
|
|
|
39
39
|
};
|
|
40
40
|
export default meta;
|
|
41
41
|
|
|
42
|
-
const Template:
|
|
42
|
+
const Template: StoryFn< typeof RadioControl > = ( {
|
|
43
43
|
onChange,
|
|
44
44
|
options,
|
|
45
45
|
...args
|
|
@@ -59,9 +59,7 @@ const Template: ComponentStory< typeof RadioControl > = ( {
|
|
|
59
59
|
);
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
export const Default:
|
|
63
|
-
{}
|
|
64
|
-
);
|
|
62
|
+
export const Default: StoryFn< typeof RadioControl > = Template.bind( {} );
|
|
65
63
|
Default.args = {
|
|
66
64
|
label: 'Post visibility',
|
|
67
65
|
options: [
|
|
@@ -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,7 +16,7 @@ import RangeControl from '..';
|
|
|
16
16
|
|
|
17
17
|
const ICONS = { starEmpty, starFilled, styles, wordpress };
|
|
18
18
|
|
|
19
|
-
const meta:
|
|
19
|
+
const meta: Meta< typeof RangeControl > = {
|
|
20
20
|
component: RangeControl,
|
|
21
21
|
title: 'Components/RangeControl',
|
|
22
22
|
argTypes: {
|
|
@@ -53,10 +53,7 @@ const meta: ComponentMeta< typeof RangeControl > = {
|
|
|
53
53
|
};
|
|
54
54
|
export default meta;
|
|
55
55
|
|
|
56
|
-
const Template:
|
|
57
|
-
onChange,
|
|
58
|
-
...args
|
|
59
|
-
} ) => {
|
|
56
|
+
const Template: StoryFn< typeof RangeControl > = ( { onChange, ...args } ) => {
|
|
60
57
|
const [ value, setValue ] = useState< number >();
|
|
61
58
|
|
|
62
59
|
return (
|
|
@@ -71,9 +68,7 @@ const Template: ComponentStory< typeof RangeControl > = ( {
|
|
|
71
68
|
);
|
|
72
69
|
};
|
|
73
70
|
|
|
74
|
-
export const Default:
|
|
75
|
-
{}
|
|
76
|
-
);
|
|
71
|
+
export const Default: StoryFn< typeof RangeControl > = Template.bind( {} );
|
|
77
72
|
Default.args = {
|
|
78
73
|
help: 'Please select how transparent you would like this.',
|
|
79
74
|
initialPosition: 50,
|
|
@@ -87,7 +82,7 @@ Default.args = {
|
|
|
87
82
|
* values. This also overrides both `withInputField` and `showTooltip` props to
|
|
88
83
|
* `false`.
|
|
89
84
|
*/
|
|
90
|
-
export const WithAnyStep:
|
|
85
|
+
export const WithAnyStep: StoryFn< typeof RangeControl > = ( {
|
|
91
86
|
onChange,
|
|
92
87
|
...args
|
|
93
88
|
} ) => {
|
|
@@ -113,7 +108,7 @@ WithAnyStep.args = {
|
|
|
113
108
|
step: 'any',
|
|
114
109
|
};
|
|
115
110
|
|
|
116
|
-
const MarkTemplate:
|
|
111
|
+
const MarkTemplate: StoryFn< typeof RangeControl > = ( {
|
|
117
112
|
label,
|
|
118
113
|
onChange,
|
|
119
114
|
...args
|
|
@@ -168,7 +163,7 @@ const marksWithNegatives = [
|
|
|
168
163
|
* automatically generated or custom mark indicators can be provided by an
|
|
169
164
|
* `Array`.
|
|
170
165
|
*/
|
|
171
|
-
export const WithIntegerStepAndMarks:
|
|
166
|
+
export const WithIntegerStepAndMarks: StoryFn< typeof RangeControl > =
|
|
172
167
|
MarkTemplate.bind( {} );
|
|
173
168
|
|
|
174
169
|
WithIntegerStepAndMarks.args = {
|
|
@@ -184,7 +179,7 @@ WithIntegerStepAndMarks.args = {
|
|
|
184
179
|
* `step` ticks. Marks may be automatically generated or custom mark indicators
|
|
185
180
|
* can be provided by an `Array`.
|
|
186
181
|
*/
|
|
187
|
-
export const WithDecimalStepAndMarks:
|
|
182
|
+
export const WithDecimalStepAndMarks: StoryFn< typeof RangeControl > =
|
|
188
183
|
MarkTemplate.bind( {} );
|
|
189
184
|
|
|
190
185
|
WithDecimalStepAndMarks.args = {
|
|
@@ -203,9 +198,8 @@ WithDecimalStepAndMarks.args = {
|
|
|
203
198
|
* indicators can represent negative values as well. Marks may be automatically
|
|
204
199
|
* generated or custom mark indicators can be provided by an `Array`.
|
|
205
200
|
*/
|
|
206
|
-
export const WithNegativeMinimumAndMarks:
|
|
207
|
-
|
|
208
|
-
> = MarkTemplate.bind( {} );
|
|
201
|
+
export const WithNegativeMinimumAndMarks: StoryFn< typeof RangeControl > =
|
|
202
|
+
MarkTemplate.bind( {} );
|
|
209
203
|
|
|
210
204
|
WithNegativeMinimumAndMarks.args = {
|
|
211
205
|
marks: marksWithNegatives,
|
|
@@ -219,7 +213,7 @@ WithNegativeMinimumAndMarks.args = {
|
|
|
219
213
|
* indicators can represent negative values as well. Marks may be automatically
|
|
220
214
|
* generated or custom mark indicators can be provided by an `Array`.
|
|
221
215
|
*/
|
|
222
|
-
export const WithNegativeRangeAndMarks:
|
|
216
|
+
export const WithNegativeRangeAndMarks: StoryFn< typeof RangeControl > =
|
|
223
217
|
MarkTemplate.bind( {} );
|
|
224
218
|
|
|
225
219
|
WithNegativeRangeAndMarks.args = {
|
|
@@ -234,7 +228,7 @@ WithNegativeRangeAndMarks.args = {
|
|
|
234
228
|
* non-integer values. This may still be used in conjunction with `marks`
|
|
235
229
|
* rendering a visual representation of `step` ticks.
|
|
236
230
|
*/
|
|
237
|
-
export const WithAnyStepAndMarks:
|
|
231
|
+
export const WithAnyStepAndMarks: StoryFn< typeof RangeControl > =
|
|
238
232
|
MarkTemplate.bind( {} );
|
|
239
233
|
|
|
240
234
|
WithAnyStepAndMarks.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
|
* Internal dependencies
|
|
@@ -13,7 +13,7 @@ import ResizableBox from '..';
|
|
|
13
13
|
*/
|
|
14
14
|
import { useState } from '@wordpress/element';
|
|
15
15
|
|
|
16
|
-
const meta:
|
|
16
|
+
const meta: Meta< typeof ResizableBox > = {
|
|
17
17
|
title: 'Components/ResizableBox',
|
|
18
18
|
component: ResizableBox,
|
|
19
19
|
argTypes: {
|
|
@@ -28,7 +28,7 @@ const meta: ComponentMeta< typeof ResizableBox > = {
|
|
|
28
28
|
};
|
|
29
29
|
export default meta;
|
|
30
30
|
|
|
31
|
-
const Template:
|
|
31
|
+
const Template: StoryFn< typeof ResizableBox > = ( {
|
|
32
32
|
onResizeStop,
|
|
33
33
|
...props
|
|
34
34
|
} ) => {
|
|
@@ -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 ResponsiveWrapper from '..';
|
|
10
10
|
|
|
11
|
-
const meta:
|
|
11
|
+
const meta: Meta< typeof ResponsiveWrapper > = {
|
|
12
12
|
component: ResponsiveWrapper,
|
|
13
13
|
title: 'Components/ResponsiveWrapper',
|
|
14
14
|
argTypes: {
|
|
@@ -21,7 +21,7 @@ const meta: ComponentMeta< typeof ResponsiveWrapper > = {
|
|
|
21
21
|
};
|
|
22
22
|
export default meta;
|
|
23
23
|
|
|
24
|
-
const Template:
|
|
24
|
+
const Template: StoryFn< typeof ResponsiveWrapper > = ( args ) => (
|
|
25
25
|
<ResponsiveWrapper { ...args } />
|
|
26
26
|
);
|
|
27
27
|
|
|
@@ -46,8 +46,7 @@ Default.args = {
|
|
|
46
46
|
* `<ResponsiveWrapper />`. In this case, the SVG simply keeps scaling up to fill
|
|
47
47
|
* its container, unless the `height` and `width` attributes are specified.
|
|
48
48
|
*/
|
|
49
|
-
export const WithSVG:
|
|
50
|
-
Template.bind( {} );
|
|
49
|
+
export const WithSVG: StoryFn< typeof ResponsiveWrapper > = Template.bind( {} );
|
|
51
50
|
WithSVG.args = {
|
|
52
51
|
children: (
|
|
53
52
|
<svg
|
|
@@ -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 SandBox from '..';
|
|
10
10
|
|
|
11
|
-
const meta:
|
|
11
|
+
const meta: Meta< typeof SandBox > = {
|
|
12
12
|
component: SandBox,
|
|
13
13
|
title: 'Components/SandBox',
|
|
14
14
|
argTypes: {
|
|
@@ -22,9 +22,7 @@ const meta: ComponentMeta< typeof SandBox > = {
|
|
|
22
22
|
};
|
|
23
23
|
export default meta;
|
|
24
24
|
|
|
25
|
-
const Template:
|
|
26
|
-
<SandBox { ...args } />
|
|
27
|
-
);
|
|
25
|
+
const Template: StoryFn< typeof SandBox > = ( args ) => <SandBox { ...args } />;
|
|
28
26
|
|
|
29
27
|
export const Default = Template.bind( {} );
|
|
30
28
|
Default.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
|
import type { ReactNode } from 'react';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -15,7 +15,7 @@ import { useState } from '@wordpress/element';
|
|
|
15
15
|
import Button from '../../button';
|
|
16
16
|
import ScrollLock from '..';
|
|
17
17
|
|
|
18
|
-
const meta:
|
|
18
|
+
const meta: Meta< typeof ScrollLock > = {
|
|
19
19
|
component: ScrollLock,
|
|
20
20
|
title: 'Components/ScrollLock',
|
|
21
21
|
parameters: {
|
|
@@ -59,7 +59,7 @@ function ToggleContainer( props: { children: ReactNode } ) {
|
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
export const Default:
|
|
62
|
+
export const Default: StoryFn< typeof ScrollLock > = () => {
|
|
63
63
|
const [ isScrollLocked, setScrollLocked ] = useState( false );
|
|
64
64
|
const toggleLock = () => setScrollLocked( ! isScrollLocked );
|
|
65
65
|
|
|
@@ -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 { useRef } from '@wordpress/element';
|
|
|
14
14
|
import { View } from '../../view';
|
|
15
15
|
import { Scrollable } from '..';
|
|
16
16
|
|
|
17
|
-
const meta:
|
|
17
|
+
const meta: Meta< typeof Scrollable > = {
|
|
18
18
|
component: Scrollable,
|
|
19
19
|
title: 'Components (Experimental)/Scrollable',
|
|
20
20
|
argTypes: {
|
|
@@ -34,7 +34,7 @@ const meta: ComponentMeta< typeof Scrollable > = {
|
|
|
34
34
|
};
|
|
35
35
|
export default meta;
|
|
36
36
|
|
|
37
|
-
const Template:
|
|
37
|
+
const Template: StoryFn< typeof Scrollable > = ( { ...args } ) => {
|
|
38
38
|
const targetRef = useRef< HTMLInputElement >( null );
|
|
39
39
|
|
|
40
40
|
const onButtonClick = () => {
|
|
@@ -76,7 +76,7 @@ const Template: ComponentStory< typeof Scrollable > = ( { ...args } ) => {
|
|
|
76
76
|
);
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
export const Default:
|
|
79
|
+
export const Default: StoryFn< typeof Scrollable > = Template.bind( {} );
|
|
80
80
|
Default.args = {
|
|
81
81
|
smoothScroll: false,
|
|
82
82
|
scrollDirection: 'y',
|
|
@@ -14,7 +14,13 @@ import {
|
|
|
14
14
|
/**
|
|
15
15
|
* WordPress dependencies
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
useState,
|
|
19
|
+
useRef,
|
|
20
|
+
useMemo,
|
|
21
|
+
useEffect,
|
|
22
|
+
useCallback,
|
|
23
|
+
} from '@wordpress/element';
|
|
18
24
|
import { __ } from '@wordpress/i18n';
|
|
19
25
|
import { Button, Gridicons } from '@wordpress/components';
|
|
20
26
|
import {
|
|
@@ -120,23 +126,44 @@ function SearchControl( {
|
|
|
120
126
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
121
127
|
}, [ isActive, isDark ] );
|
|
122
128
|
|
|
129
|
+
const clearInput = useCallback( () => {
|
|
130
|
+
onChange( '' );
|
|
131
|
+
}, [ onChange ] );
|
|
132
|
+
|
|
133
|
+
const onPress = useCallback( () => {
|
|
134
|
+
setIsActive( true );
|
|
135
|
+
inputRef.current?.focus();
|
|
136
|
+
}, [] );
|
|
137
|
+
|
|
138
|
+
const onFocus = useCallback( () => {
|
|
139
|
+
setIsActive( true );
|
|
140
|
+
}, [] );
|
|
141
|
+
|
|
142
|
+
const onCancel = useCallback( () => {
|
|
143
|
+
clearTimeout( onCancelTimer.current );
|
|
144
|
+
onCancelTimer.current = setTimeout( () => {
|
|
145
|
+
inputRef.current?.blur();
|
|
146
|
+
clearInput();
|
|
147
|
+
setIsActive( false );
|
|
148
|
+
}, 0 );
|
|
149
|
+
}, [ clearInput ] );
|
|
150
|
+
|
|
151
|
+
const onKeyboardDidHide = useCallback( () => {
|
|
152
|
+
if ( ! isIOS ) {
|
|
153
|
+
onCancel();
|
|
154
|
+
}
|
|
155
|
+
}, [ isIOS, onCancel ] );
|
|
156
|
+
|
|
123
157
|
useEffect( () => {
|
|
124
158
|
const keyboardHideSubscription = Keyboard.addListener(
|
|
125
159
|
'keyboardDidHide',
|
|
126
|
-
|
|
127
|
-
if ( ! isIOS ) {
|
|
128
|
-
onCancel();
|
|
129
|
-
}
|
|
130
|
-
}
|
|
160
|
+
onKeyboardDidHide
|
|
131
161
|
);
|
|
132
162
|
return () => {
|
|
133
163
|
clearTimeout( onCancelTimer.current );
|
|
134
164
|
keyboardHideSubscription.remove();
|
|
135
165
|
};
|
|
136
|
-
|
|
137
|
-
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
138
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
139
|
-
}, [] );
|
|
166
|
+
}, [ onKeyboardDidHide ] );
|
|
140
167
|
|
|
141
168
|
const {
|
|
142
169
|
'search-control__container': containerStyle,
|
|
@@ -153,18 +180,6 @@ function SearchControl( {
|
|
|
153
180
|
'search-control__right-icon': rightIconStyle,
|
|
154
181
|
} = currentStyles;
|
|
155
182
|
|
|
156
|
-
function clearInput() {
|
|
157
|
-
onChange( '' );
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function onCancel() {
|
|
161
|
-
onCancelTimer.current = setTimeout( () => {
|
|
162
|
-
inputRef.current.blur();
|
|
163
|
-
clearInput();
|
|
164
|
-
setIsActive( false );
|
|
165
|
-
}, 0 );
|
|
166
|
-
}
|
|
167
|
-
|
|
168
183
|
function renderLeftButton() {
|
|
169
184
|
const button =
|
|
170
185
|
! isIOS && isActive ? (
|
|
@@ -234,10 +249,7 @@ function SearchControl( {
|
|
|
234
249
|
return (
|
|
235
250
|
<TouchableOpacity
|
|
236
251
|
style={ containerStyle }
|
|
237
|
-
onPress={
|
|
238
|
-
setIsActive( true );
|
|
239
|
-
inputRef.current.focus();
|
|
240
|
-
} }
|
|
252
|
+
onPress={ onPress }
|
|
241
253
|
activeOpacity={ 1 }
|
|
242
254
|
>
|
|
243
255
|
<View style={ innerContainerStyle }>
|
|
@@ -248,7 +260,7 @@ function SearchControl( {
|
|
|
248
260
|
style={ formInputStyle }
|
|
249
261
|
placeholderTextColor={ placeholderStyle?.color }
|
|
250
262
|
onChangeText={ onChange }
|
|
251
|
-
onFocus={
|
|
263
|
+
onFocus={ onFocus }
|
|
252
264
|
value={ value }
|
|
253
265
|
placeholder={ placeholder }
|
|
254
266
|
/>
|
|
@@ -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 SearchControl from '..';
|
|
15
15
|
|
|
16
|
-
const meta:
|
|
16
|
+
const meta: Meta< typeof SearchControl > = {
|
|
17
17
|
title: 'Components/SearchControl',
|
|
18
18
|
component: SearchControl,
|
|
19
19
|
argTypes: {
|
|
@@ -26,7 +26,7 @@ const meta: ComponentMeta< typeof SearchControl > = {
|
|
|
26
26
|
};
|
|
27
27
|
export default meta;
|
|
28
28
|
|
|
29
|
-
const Template:
|
|
29
|
+
const Template: StoryFn< typeof SearchControl > = ( {
|
|
30
30
|
onChange,
|
|
31
31
|
...props
|
|
32
32
|
} ) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { Meta,
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -31,7 +31,7 @@ const meta: Meta< typeof SelectControl > = {
|
|
|
31
31
|
};
|
|
32
32
|
export default meta;
|
|
33
33
|
|
|
34
|
-
const SelectControlWithState:
|
|
34
|
+
const SelectControlWithState: StoryFn< typeof SelectControl > = ( props ) => {
|
|
35
35
|
const [ selection, setSelection ] = useState< string[] >();
|
|
36
36
|
|
|
37
37
|
if ( props.multiple ) {
|
|
@@ -82,7 +82,7 @@ WithLabelAndHelpText.args = {
|
|
|
82
82
|
* As an alternative to the `options` prop, `optgroup`s and `options` can be
|
|
83
83
|
* passed in as `children` for more customizeability.
|
|
84
84
|
*/
|
|
85
|
-
export const WithCustomChildren:
|
|
85
|
+
export const WithCustomChildren: StoryFn< typeof SelectControl > = ( args ) => {
|
|
86
86
|
return (
|
|
87
87
|
<SelectControlWithState { ...args }>
|
|
88
88
|
<option value="option-1">Option 1</option>
|
package/src/shortcut/index.tsx
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { ShortcutProps } from './types';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Shortcut component is used to display keyboard shortcuts, and it can be customized with a custom display and aria label if needed.
|
|
8
|
+
*
|
|
9
|
+
* ```jsx
|
|
10
|
+
* import { Shortcut } from '@wordpress/components';
|
|
11
|
+
*
|
|
12
|
+
* const MyShortcut = () => {
|
|
13
|
+
* return (
|
|
14
|
+
* <Shortcut shortcut={{ display: 'Ctrl + S', ariaLabel: 'Save' }} />
|
|
15
|
+
* );
|
|
16
|
+
* };
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
6
19
|
function Shortcut( props: ShortcutProps ) {
|
|
7
20
|
const { shortcut, className } = props;
|
|
8
21
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import Shortcut from '../';
|
|
10
|
+
|
|
11
|
+
const meta: Meta< typeof Shortcut > = {
|
|
12
|
+
component: Shortcut,
|
|
13
|
+
title: 'Components/Shortcut',
|
|
14
|
+
parameters: {
|
|
15
|
+
controls: {
|
|
16
|
+
expanded: true,
|
|
17
|
+
},
|
|
18
|
+
docs: { canvas: { sourceState: 'shown' } },
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export default meta;
|
|
22
|
+
|
|
23
|
+
const Template: StoryFn< typeof Shortcut > = ( props ) => {
|
|
24
|
+
return <Shortcut shortcut="Ctrl + S" { ...props } />;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Default: StoryFn< typeof Shortcut > = Template.bind( {} );
|
|
28
|
+
|
|
29
|
+
export const WithAriaLabel = Template.bind( {} );
|
|
30
|
+
WithAriaLabel.args = {
|
|
31
|
+
...Default.args,
|
|
32
|
+
shortcut: { display: 'Ctrl + L', ariaLabel: 'Load' },
|
|
33
|
+
};
|
package/src/slot-fill/README.md
CHANGED
|
@@ -70,7 +70,7 @@ Both `Slot` and `Fill` accept a `name` string prop, where a `Slot` with a given
|
|
|
70
70
|
|
|
71
71
|
`Slot` with `bubblesVirtually` set to true also accept an optional `className` to add to the slot container.
|
|
72
72
|
|
|
73
|
-
`Slot` accepts an optional `children` function prop, which takes `fills` as a param. It allows you to perform additional processing and wrap `fills` conditionally.
|
|
73
|
+
`Slot` **without** `bubblesVirtually` accepts an optional `children` function prop, which takes `fills` as a param. It allows you to perform additional processing and wrap `fills` conditionally.
|
|
74
74
|
|
|
75
75
|
_Example_:
|
|
76
76
|
|
|
@@ -103,14 +103,14 @@ const ToolbarItem = () => (
|
|
|
103
103
|
</Fill>
|
|
104
104
|
);
|
|
105
105
|
|
|
106
|
-
const Toolbar = () =>
|
|
107
|
-
const hideToolbar() => {
|
|
106
|
+
const Toolbar = () => {
|
|
107
|
+
const hideToolbar = () => {
|
|
108
108
|
console.log( 'Hide toolbar' );
|
|
109
|
-
}
|
|
109
|
+
};
|
|
110
110
|
return (
|
|
111
111
|
<div className="toolbar">
|
|
112
112
|
<Slot fillProps={ { hideToolbar } } />
|
|
113
113
|
</div>
|
|
114
114
|
);
|
|
115
|
-
|
|
115
|
+
};
|
|
116
116
|
```
|
|
@@ -22,6 +22,9 @@ const SlotFillContext = createContext( {
|
|
|
22
22
|
unregisterSlot: () => {},
|
|
23
23
|
registerFill: () => {},
|
|
24
24
|
unregisterFill: () => {},
|
|
25
|
+
|
|
26
|
+
// This helps the provider know if it's using the default context value or not.
|
|
27
|
+
isDefault: true,
|
|
25
28
|
} );
|
|
26
29
|
|
|
27
30
|
export default SlotFillContext;
|
|
@@ -13,12 +13,20 @@ import { useMergeRefs } from '@wordpress/compose';
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
|
+
import { View } from '../../view';
|
|
16
17
|
import SlotFillContext from './slot-fill-context';
|
|
17
18
|
|
|
18
|
-
function Slot(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
function Slot( props, forwardedRef ) {
|
|
20
|
+
const {
|
|
21
|
+
name,
|
|
22
|
+
fillProps = {},
|
|
23
|
+
as,
|
|
24
|
+
// `children` is not allowed. However, if it is passed,
|
|
25
|
+
// it will be displayed as is, so remove `children`.
|
|
26
|
+
children,
|
|
27
|
+
...restProps
|
|
28
|
+
} = props;
|
|
29
|
+
|
|
22
30
|
const { registerSlot, unregisterSlot, ...registry } =
|
|
23
31
|
useContext( SlotFillContext );
|
|
24
32
|
const ref = useRef();
|
|
@@ -41,7 +49,11 @@ function Slot(
|
|
|
41
49
|
} );
|
|
42
50
|
|
|
43
51
|
return (
|
|
44
|
-
<
|
|
52
|
+
<View
|
|
53
|
+
as={ as }
|
|
54
|
+
ref={ useMergeRefs( [ forwardedRef, ref ] ) }
|
|
55
|
+
{ ...restProps }
|
|
56
|
+
/>
|
|
45
57
|
);
|
|
46
58
|
}
|
|
47
59
|
|