@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
|
@@ -40,7 +40,6 @@ const UnconnectedToolsPanel = (props, forwardedRef) => {
|
|
|
40
40
|
* by a header. The header includes a dropdown menu which is automatically
|
|
41
41
|
* generated from the panel's inner `ToolsPanelItems`.
|
|
42
42
|
*
|
|
43
|
-
* @example
|
|
44
43
|
* ```jsx
|
|
45
44
|
* import { __ } from '@wordpress/i18n';
|
|
46
45
|
* import {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ToolsPanelHeader","ToolsPanelContext","useToolsPanel","Grid","contextConnect","UnconnectedToolsPanel","props","forwardedRef","children","label","panelContext","resetAllItems","toggleItem","headingLevel","toolsPanelProps","createElement","columns","ref","Provider","value","resetAll","ToolsPanel"],"sources":["@wordpress/components/src/tools-panel/tools-panel/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport ToolsPanelHeader from '../tools-panel-header';\nimport { ToolsPanelContext } from '../context';\nimport { useToolsPanel } from './hook';\nimport { Grid } from '../../grid';\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { contextConnect } from '../../ui/context';\nimport type { ToolsPanelProps } from '../types';\n\nconst UnconnectedToolsPanel = (\n\tprops: WordPressComponentProps< ToolsPanelProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tchildren,\n\t\tlabel,\n\t\tpanelContext,\n\t\tresetAllItems,\n\t\ttoggleItem,\n\t\theadingLevel,\n\t\t...toolsPanelProps\n\t} = useToolsPanel( props );\n\n\treturn (\n\t\t<Grid { ...toolsPanelProps } columns={ 2 } ref={ forwardedRef }>\n\t\t\t<ToolsPanelContext.Provider value={ panelContext }>\n\t\t\t\t<ToolsPanelHeader\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tresetAll={ resetAllItems }\n\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\t\t\t</ToolsPanelContext.Provider>\n\t\t</Grid>\n\t);\n};\n\n/**\n * The `ToolsPanel` is a container component that displays its children preceded\n * by a header. The header includes a dropdown menu which is automatically\n * generated from the panel's inner `ToolsPanelItems`.\n *\n *
|
|
1
|
+
{"version":3,"names":["ToolsPanelHeader","ToolsPanelContext","useToolsPanel","Grid","contextConnect","UnconnectedToolsPanel","props","forwardedRef","children","label","panelContext","resetAllItems","toggleItem","headingLevel","toolsPanelProps","createElement","columns","ref","Provider","value","resetAll","ToolsPanel"],"sources":["@wordpress/components/src/tools-panel/tools-panel/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport ToolsPanelHeader from '../tools-panel-header';\nimport { ToolsPanelContext } from '../context';\nimport { useToolsPanel } from './hook';\nimport { Grid } from '../../grid';\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { contextConnect } from '../../ui/context';\nimport type { ToolsPanelProps } from '../types';\n\nconst UnconnectedToolsPanel = (\n\tprops: WordPressComponentProps< ToolsPanelProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tchildren,\n\t\tlabel,\n\t\tpanelContext,\n\t\tresetAllItems,\n\t\ttoggleItem,\n\t\theadingLevel,\n\t\t...toolsPanelProps\n\t} = useToolsPanel( props );\n\n\treturn (\n\t\t<Grid { ...toolsPanelProps } columns={ 2 } ref={ forwardedRef }>\n\t\t\t<ToolsPanelContext.Provider value={ panelContext }>\n\t\t\t\t<ToolsPanelHeader\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tresetAll={ resetAllItems }\n\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\t\t\t</ToolsPanelContext.Provider>\n\t\t</Grid>\n\t);\n};\n\n/**\n * The `ToolsPanel` is a container component that displays its children preceded\n * by a header. The header includes a dropdown menu which is automatically\n * generated from the panel's inner `ToolsPanelItems`.\n *\n * ```jsx\n * import { __ } from '@wordpress/i18n';\n * import {\n * __experimentalToolsPanel as ToolsPanel,\n * __experimentalToolsPanelItem as ToolsPanelItem,\n * __experimentalUnitControl as UnitControl\n * } from '@wordpress/components';\n *\n * function Example() {\n * const [ height, setHeight ] = useState();\n * const [ width, setWidth ] = useState();\n *\n * const resetAll = () => {\n * setHeight();\n * setWidth();\n * }\n *\n * return (\n * <ToolsPanel label={ __( 'Dimensions' ) } resetAll={ resetAll }>\n * <ToolsPanelItem\n * hasValue={ () => !! height }\n * label={ __( 'Height' ) }\n * onDeselect={ () => setHeight() }\n * >\n * <UnitControl\n * label={ __( 'Height' ) }\n * onChange={ setHeight }\n * value={ height }\n * />\n * </ToolsPanelItem>\n * <ToolsPanelItem\n * hasValue={ () => !! width }\n * label={ __( 'Width' ) }\n * onDeselect={ () => setWidth() }\n * >\n * <UnitControl\n * label={ __( 'Width' ) }\n * onChange={ setWidth }\n * value={ width }\n * />\n * </ToolsPanelItem>\n * </ToolsPanel>\n * );\n * }\n * ```\n */\nexport const ToolsPanel = contextConnect( UnconnectedToolsPanel, 'ToolsPanel' );\n\nexport default ToolsPanel;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAOA,gBAAgB,MAAM,uBAAuB;AACpD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,aAAa,QAAQ,QAAQ;AACtC,SAASC,IAAI,QAAQ,YAAY;AAEjC,SAASC,cAAc,QAAQ,kBAAkB;AAGjD,MAAMC,qBAAqB,GAAGA,CAC7BC,KAAwD,EACxDC,YAAiC,KAC7B;EACJ,MAAM;IACLC,QAAQ;IACRC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC,UAAU;IACVC,YAAY;IACZ,GAAGC;EACJ,CAAC,GAAGZ,aAAa,CAAEI,KAAM,CAAC;EAE1B,OACCS,aAAA,CAACZ,IAAI;IAAA,GAAMW,eAAe;IAAGE,OAAO,EAAG,CAAG;IAACC,GAAG,EAAGV;EAAc,GAC9DQ,aAAA,CAACd,iBAAiB,CAACiB,QAAQ;IAACC,KAAK,EAAGT;EAAc,GACjDK,aAAA,CAACf,gBAAgB;IAChBS,KAAK,EAAGA,KAAO;IACfW,QAAQ,EAAGT,aAAe;IAC1BC,UAAU,EAAGA,UAAY;IACzBC,YAAY,EAAGA;EAAc,CAC7B,CAAC,EACAL,QACyB,CACvB,CAAC;AAET,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMa,UAAU,GAAGjB,cAAc,CAAEC,qBAAqB,EAAE,YAAa,CAAC;AAE/E,eAAegB,UAAU"}
|
|
@@ -146,7 +146,11 @@ const ToolsPanelHeader = (props, forwardedRef) => {
|
|
|
146
146
|
items: optionalItems,
|
|
147
147
|
toggleItem: toggleItem
|
|
148
148
|
}), createElement(MenuGroup, null, createElement(MenuItem, {
|
|
149
|
-
"aria-disabled": !canResetAll
|
|
149
|
+
"aria-disabled": !canResetAll
|
|
150
|
+
// @ts-expect-error - TODO: If this "tertiary" style is something we really want to allow on MenuItem,
|
|
151
|
+
// we should rename it and explicitly allow it as an official API. All the other Button variants
|
|
152
|
+
// don't make sense in a MenuItem context, and should be disallowed.
|
|
153
|
+
,
|
|
150
154
|
variant: 'tertiary',
|
|
151
155
|
onClick: () => {
|
|
152
156
|
if (canResetAll) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["speak","check","moreVertical","plus","__","_x","sprintf","DropdownMenu","MenuGroup","MenuItem","HStack","Heading","useToolsPanelHeader","contextConnect","ResetLabel","DefaultControlsGroup","itemClassName","items","toggleItem","length","resetSuffix","createElement","label","map","hasValue","key","className","role","onClick","suffix","isSelected","OptionalControlsGroup","itemLabel","icon","ToolsPanelHeader","props","forwardedRef","areAllOptionalControlsHidden","defaultControlsItemClassName","dropdownMenuClassName","hasMenuItems","headingClassName","headingLevel","labelText","menuItems","resetAll","headerProps","defaultItems","Object","entries","default","optionalItems","optional","dropDownMenuIcon","dropDownMenuLabelText","dropdownMenuDescriptionText","undefined","canResetAll","some","ref","level","menuProps","toggleProps","isSmall","describedBy","Fragment","variant","ConnectedToolsPanelHeader"],"sources":["@wordpress/components/src/tools-panel/tools-panel-header/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { check, moreVertical, plus } from '@wordpress/icons';\nimport { __, _x, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DropdownMenu from '../../dropdown-menu';\nimport MenuGroup from '../../menu-group';\nimport MenuItem from '../../menu-item';\nimport { HStack } from '../../h-stack';\nimport { Heading } from '../../heading';\nimport { useToolsPanelHeader } from './hook';\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { contextConnect } from '../../ui/context';\nimport { ResetLabel } from '../styles';\nimport type {\n\tToolsPanelControlsGroupProps,\n\tToolsPanelHeaderProps,\n} from '../types';\n\nconst DefaultControlsGroup = ( {\n\titemClassName,\n\titems,\n\ttoggleItem,\n}: ToolsPanelControlsGroupProps ) => {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\tconst resetSuffix = <ResetLabel aria-hidden>{ __( 'Reset' ) }</ResetLabel>;\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Defaults' ) }>\n\t\t\t{ items.map( ( [ label, hasValue ] ) => {\n\t\t\t\tif ( hasValue ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\t\tclassName={ itemClassName }\n\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t__( 'Reset %s' ),\n\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\ttoggleItem( label );\n\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t\t\t__( '%s reset to default' ),\n\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsuffix={ resetSuffix }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\tclassName={ itemClassName }\n\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t\tisSelected\n\t\t\t\t\t\taria-disabled\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</MenuGroup>\n\t);\n};\n\nconst OptionalControlsGroup = ( {\n\titems,\n\ttoggleItem,\n}: ToolsPanelControlsGroupProps ) => {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t{ items.map( ( [ label, isSelected ] ) => {\n\t\t\t\tconst itemLabel = isSelected\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: The name of the control being hidden and reset e.g. \"Padding\".\n\t\t\t\t\t\t\t__( 'Hide and reset %s' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t// translators: %s: The name of the control to display e.g. \"Padding\".\n\t\t\t\t\t\t\t__( 'Show %s' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t );\n\n\t\t\t\treturn (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\ticon={ isSelected ? check : null }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tlabel={ itemLabel }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( isSelected ) {\n\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t\t\t__( '%s hidden and reset to default' ),\n\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t\t\t__( '%s is now visible' ),\n\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttoggleItem( label );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</MenuGroup>\n\t);\n};\n\nconst ToolsPanelHeader = (\n\tprops: WordPressComponentProps< ToolsPanelHeaderProps, 'h2' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tareAllOptionalControlsHidden,\n\t\tdefaultControlsItemClassName,\n\t\tdropdownMenuClassName,\n\t\thasMenuItems,\n\t\theadingClassName,\n\t\theadingLevel = 2,\n\t\tlabel: labelText,\n\t\tmenuItems,\n\t\tresetAll,\n\t\ttoggleItem,\n\t\t...headerProps\n\t} = useToolsPanelHeader( props );\n\n\tif ( ! labelText ) {\n\t\treturn null;\n\t}\n\n\tconst defaultItems = Object.entries( menuItems?.default || {} );\n\tconst optionalItems = Object.entries( menuItems?.optional || {} );\n\tconst dropDownMenuIcon = areAllOptionalControlsHidden ? plus : moreVertical;\n\tconst dropDownMenuLabelText = sprintf(\n\t\t// translators: %s: The name of the tool e.g. \"Color\" or \"Typography\".\n\t\t_x( '%s options', 'Button label to reveal tool panel options' ),\n\t\tlabelText\n\t);\n\tconst dropdownMenuDescriptionText = areAllOptionalControlsHidden\n\t\t? __( 'All options are currently hidden' )\n\t\t: undefined;\n\n\tconst canResetAll = [ ...defaultItems, ...optionalItems ].some(\n\t\t( [ , isSelected ] ) => isSelected\n\t);\n\n\treturn (\n\t\t<HStack { ...headerProps } ref={ forwardedRef }>\n\t\t\t<Heading level={ headingLevel } className={ headingClassName }>\n\t\t\t\t{ labelText }\n\t\t\t</Heading>\n\t\t\t{ hasMenuItems && (\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ticon={ dropDownMenuIcon }\n\t\t\t\t\tlabel={ dropDownMenuLabelText }\n\t\t\t\t\tmenuProps={ { className: dropdownMenuClassName } }\n\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\tdescribedBy: dropdownMenuDescriptionText,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ () => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<DefaultControlsGroup\n\t\t\t\t\t\t\t\titems={ defaultItems }\n\t\t\t\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\t\t\t\titemClassName={ defaultControlsItemClassName }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<OptionalControlsGroup\n\t\t\t\t\t\t\t\titems={ optionalItems }\n\t\t\t\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\taria-disabled={ ! canResetAll }\n\t\t\t\t\t\t\t\t\tvariant={ 'tertiary' }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tif ( canResetAll ) {\n\t\t\t\t\t\t\t\t\t\t\tresetAll();\n\t\t\t\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'All options reset' ),\n\t\t\t\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset all' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</DropdownMenu>\n\t\t\t) }\n\t\t</HStack>\n\t);\n};\n\nconst ConnectedToolsPanelHeader = contextConnect(\n\tToolsPanelHeader,\n\t'ToolsPanelHeader'\n);\n\nexport default ConnectedToolsPanelHeader;\n"],"mappings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AA,CAACd,YAAY;IACZ0B,IAAI,EAAGoB,gBAAkB;IACzB/B,KAAK,EAAGgC,qBAAuB;IAC/BO,SAAS,EAAG;MAAEnC,SAAS,EAAEa;IAAsB,CAAG;IAClDuB,WAAW,EAAG;MACbC,OAAO,EAAE,IAAI;MACbC,WAAW,EAAET;IACd;EAAG,GAED,MACDlC,aAAA,CAAA4C,QAAA,QACC5C,aAAA,CAACN,oBAAoB;IACpBE,KAAK,EAAG8B,YAAc;IACtB7B,UAAU,EAAGA,UAAY;IACzBF,aAAa,EAAGsB;EAA8B,CAC9C,CAAC,EACFjB,aAAA,CAACU,qBAAqB;IACrBd,KAAK,EAAGkC,aAAe;IACvBjC,UAAU,EAAGA;EAAY,CACzB,CAAC,EACFG,aAAA,CAACb,SAAS,QACTa,aAAA,CAACZ,QAAQ;IACR,iBAAgB,CAAEgD,WAAa;IAC/BS,OAAO,EAAG,UAAY;IACtBtC,OAAO,EAAGA,CAAA,KAAM;MACf,IAAK6B,WAAW,EAAG;QAClBZ,QAAQ,CAAC,CAAC;QACV7C,KAAK,CACJI,EAAE,CAAE,mBAAoB,CAAC,EACzB,WACD,CAAC;MACF;IACD;EAAG,GAEDA,EAAE,CAAE,WAAY,CACT,CACA,CACV,CAEU,CAER,CAAC;AAEX,CAAC;AAED,MAAM+D,yBAAyB,GAAGtD,cAAc,CAC/CqB,gBAAgB,EAChB,kBACD,CAAC;AAED,eAAeiC,yBAAyB"}
|
|
1
|
+
{"version":3,"names":["speak","check","moreVertical","plus","__","_x","sprintf","DropdownMenu","MenuGroup","MenuItem","HStack","Heading","useToolsPanelHeader","contextConnect","ResetLabel","DefaultControlsGroup","itemClassName","items","toggleItem","length","resetSuffix","createElement","label","map","hasValue","key","className","role","onClick","suffix","isSelected","OptionalControlsGroup","itemLabel","icon","ToolsPanelHeader","props","forwardedRef","areAllOptionalControlsHidden","defaultControlsItemClassName","dropdownMenuClassName","hasMenuItems","headingClassName","headingLevel","labelText","menuItems","resetAll","headerProps","defaultItems","Object","entries","default","optionalItems","optional","dropDownMenuIcon","dropDownMenuLabelText","dropdownMenuDescriptionText","undefined","canResetAll","some","ref","level","menuProps","toggleProps","isSmall","describedBy","Fragment","variant","ConnectedToolsPanelHeader"],"sources":["@wordpress/components/src/tools-panel/tools-panel-header/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { check, moreVertical, plus } from '@wordpress/icons';\nimport { __, _x, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DropdownMenu from '../../dropdown-menu';\nimport MenuGroup from '../../menu-group';\nimport MenuItem from '../../menu-item';\nimport { HStack } from '../../h-stack';\nimport { Heading } from '../../heading';\nimport { useToolsPanelHeader } from './hook';\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { contextConnect } from '../../ui/context';\nimport { ResetLabel } from '../styles';\nimport type {\n\tToolsPanelControlsGroupProps,\n\tToolsPanelHeaderProps,\n} from '../types';\n\nconst DefaultControlsGroup = ( {\n\titemClassName,\n\titems,\n\ttoggleItem,\n}: ToolsPanelControlsGroupProps ) => {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\tconst resetSuffix = <ResetLabel aria-hidden>{ __( 'Reset' ) }</ResetLabel>;\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Defaults' ) }>\n\t\t\t{ items.map( ( [ label, hasValue ] ) => {\n\t\t\t\tif ( hasValue ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\t\tclassName={ itemClassName }\n\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t__( 'Reset %s' ),\n\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\ttoggleItem( label );\n\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t\t\t__( '%s reset to default' ),\n\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsuffix={ resetSuffix }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\tclassName={ itemClassName }\n\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t\tisSelected\n\t\t\t\t\t\taria-disabled\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</MenuGroup>\n\t);\n};\n\nconst OptionalControlsGroup = ( {\n\titems,\n\ttoggleItem,\n}: ToolsPanelControlsGroupProps ) => {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t{ items.map( ( [ label, isSelected ] ) => {\n\t\t\t\tconst itemLabel = isSelected\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: The name of the control being hidden and reset e.g. \"Padding\".\n\t\t\t\t\t\t\t__( 'Hide and reset %s' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t// translators: %s: The name of the control to display e.g. \"Padding\".\n\t\t\t\t\t\t\t__( 'Show %s' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t );\n\n\t\t\t\treturn (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\ticon={ isSelected ? check : null }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tlabel={ itemLabel }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( isSelected ) {\n\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t\t\t__( '%s hidden and reset to default' ),\n\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t\t\t__( '%s is now visible' ),\n\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttoggleItem( label );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</MenuGroup>\n\t);\n};\n\nconst ToolsPanelHeader = (\n\tprops: WordPressComponentProps< ToolsPanelHeaderProps, 'h2' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tareAllOptionalControlsHidden,\n\t\tdefaultControlsItemClassName,\n\t\tdropdownMenuClassName,\n\t\thasMenuItems,\n\t\theadingClassName,\n\t\theadingLevel = 2,\n\t\tlabel: labelText,\n\t\tmenuItems,\n\t\tresetAll,\n\t\ttoggleItem,\n\t\t...headerProps\n\t} = useToolsPanelHeader( props );\n\n\tif ( ! labelText ) {\n\t\treturn null;\n\t}\n\n\tconst defaultItems = Object.entries( menuItems?.default || {} );\n\tconst optionalItems = Object.entries( menuItems?.optional || {} );\n\tconst dropDownMenuIcon = areAllOptionalControlsHidden ? plus : moreVertical;\n\tconst dropDownMenuLabelText = sprintf(\n\t\t// translators: %s: The name of the tool e.g. \"Color\" or \"Typography\".\n\t\t_x( '%s options', 'Button label to reveal tool panel options' ),\n\t\tlabelText\n\t);\n\tconst dropdownMenuDescriptionText = areAllOptionalControlsHidden\n\t\t? __( 'All options are currently hidden' )\n\t\t: undefined;\n\n\tconst canResetAll = [ ...defaultItems, ...optionalItems ].some(\n\t\t( [ , isSelected ] ) => isSelected\n\t);\n\n\treturn (\n\t\t<HStack { ...headerProps } ref={ forwardedRef }>\n\t\t\t<Heading level={ headingLevel } className={ headingClassName }>\n\t\t\t\t{ labelText }\n\t\t\t</Heading>\n\t\t\t{ hasMenuItems && (\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ticon={ dropDownMenuIcon }\n\t\t\t\t\tlabel={ dropDownMenuLabelText }\n\t\t\t\t\tmenuProps={ { className: dropdownMenuClassName } }\n\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\tdescribedBy: dropdownMenuDescriptionText,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ () => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<DefaultControlsGroup\n\t\t\t\t\t\t\t\titems={ defaultItems }\n\t\t\t\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\t\t\t\titemClassName={ defaultControlsItemClassName }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<OptionalControlsGroup\n\t\t\t\t\t\t\t\titems={ optionalItems }\n\t\t\t\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\taria-disabled={ ! canResetAll }\n\t\t\t\t\t\t\t\t\t// @ts-expect-error - TODO: If this \"tertiary\" style is something we really want to allow on MenuItem,\n\t\t\t\t\t\t\t\t\t// we should rename it and explicitly allow it as an official API. All the other Button variants\n\t\t\t\t\t\t\t\t\t// don't make sense in a MenuItem context, and should be disallowed.\n\t\t\t\t\t\t\t\t\tvariant={ 'tertiary' }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tif ( canResetAll ) {\n\t\t\t\t\t\t\t\t\t\t\tresetAll();\n\t\t\t\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'All options reset' ),\n\t\t\t\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset all' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</DropdownMenu>\n\t\t\t) }\n\t\t</HStack>\n\t);\n};\n\nconst ConnectedToolsPanelHeader = contextConnect(\n\tToolsPanelHeader,\n\t'ToolsPanelHeader'\n);\n\nexport default ConnectedToolsPanelHeader;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,iBAAiB;AACvC,SAASC,KAAK,EAAEC,YAAY,EAAEC,IAAI,QAAQ,kBAAkB;AAC5D,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA,OAAOC,YA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AA,CAAA4C,QAAA,QACC5C,aAAA,CAACN,oBAAoB;IACpBE,KAAK,EAAG8B,YAAc;IACtB7B,UAAU,EAAGA,UAAY;IACzBF,aAAa,EAAGsB;EAA8B,CAC9C,CAAC,EACFjB,aAAA,CAACU,qBAAqB;IACrBd,KAAK,EAAGkC,aAAe;IACvBjC,UAAU,EAAGA;EAAY,CACzB,CAAC,EACFG,aAAA,CAACb,SAAS,QACTa,aAAA,CAACZ,QAAQ;IACR,iBAAgB,CAAEgD;IAClB;IACA;IACA;IAAA;IACAS,OAAO,EAAG,UAAY;IACtBtC,OAAO,EAAGA,CAAA,KAAM;MACf,IAAK6B,WAAW,EAAG;QAClBZ,QAAQ,CAAC,CAAC;QACV7C,KAAK,CACJI,EAAE,CAAE,mBAAoB,CAAC,EACzB,WACD,CAAC;MACF;IACD;EAAG,GAEDA,EAAE,CAAE,WAAY,CACT,CACA,CACV,CAEU,CAER,CAAC;AAEX,CAAC;AAED,MAAM+D,yBAAyB,GAAGtD,cAAc,CAC/CqB,gBAAgB,EAChB,kBACD,CAAC;AAED,eAAeiC,yBAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","decodeEntities","SelectControl","getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options","filter","option","createElement"],"sources":["@wordpress/components/src/tree-select/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport type { TreeSelectProps, Tree, Truthy } from './types';\n\nfunction getSelectOptions(\n\ttree: Tree[],\n\tlevel = 0\n): NonNullable< TreeSelectProps[ 'options' ] > {\n\treturn tree.flatMap( ( treeNode ) => [\n\t\t{\n\t\t\tvalue: treeNode.id,\n\t\t\tlabel:\n\t\t\t\t'\\u00A0'.repeat( level * 3 ) + decodeEntities( treeNode.name ),\n\t\t},\n\t\t...getSelectOptions( treeNode.children || [], level + 1 ),\n\t] );\n}\n\n/**\n * TreeSelect component is used to generate select input fields.\n *\n *
|
|
1
|
+
{"version":3,"names":["useMemo","decodeEntities","SelectControl","getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options","filter","option","createElement"],"sources":["@wordpress/components/src/tree-select/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport type { TreeSelectProps, Tree, Truthy } from './types';\n\nfunction getSelectOptions(\n\ttree: Tree[],\n\tlevel = 0\n): NonNullable< TreeSelectProps[ 'options' ] > {\n\treturn tree.flatMap( ( treeNode ) => [\n\t\t{\n\t\t\tvalue: treeNode.id,\n\t\t\tlabel:\n\t\t\t\t'\\u00A0'.repeat( level * 3 ) + decodeEntities( treeNode.name ),\n\t\t},\n\t\t...getSelectOptions( treeNode.children || [], level + 1 ),\n\t] );\n}\n\n/**\n * TreeSelect component is used to generate select input fields.\n *\n * ```jsx\n * import { TreeSelect } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTreeSelect = () => {\n * \tconst [ page, setPage ] = useState( 'p21' );\n *\n * \treturn (\n * \t\t<TreeSelect\n * \t\t\tlabel=\"Parent page\"\n * \t\t\tnoOptionLabel=\"No parent page\"\n * \t\t\tonChange={ ( newPage ) => setPage( newPage ) }\n * \t\t\tselectedId={ page }\n * \t\t\ttree={ [\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 1',\n * \t\t\t\t\tid: 'p1',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{ name: 'Descend 1 of page 1', id: 'p11' },\n * \t\t\t\t\t\t{ name: 'Descend 2 of page 1', id: 'p12' },\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 2',\n * \t\t\t\t\tid: 'p2',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tname: 'Descend 1 of page 2',\n * \t\t\t\t\t\t\tid: 'p21',\n * \t\t\t\t\t\t\tchildren: [\n * \t\t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\t\tname: 'Descend 1 of Descend 1 of page 2',\n * \t\t\t\t\t\t\t\t\tid: 'p211',\n * \t\t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t],\n * \t\t\t\t\t\t},\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\n\nexport function TreeSelect( {\n\tlabel,\n\tnoOptionLabel,\n\tonChange,\n\tselectedId,\n\ttree = [],\n\t...props\n}: TreeSelectProps ) {\n\tconst options = useMemo( () => {\n\t\treturn [\n\t\t\tnoOptionLabel && { value: '', label: noOptionLabel },\n\t\t\t...getSelectOptions( tree ),\n\t\t].filter( < T, >( option: T ): option is Truthy< T > => !! option );\n\t}, [ noOptionLabel, tree ] );\n\n\treturn (\n\t\t<SelectControl\n\t\t\t{ ...{ label, options, onChange } }\n\t\t\tvalue={ selectedId }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default TreeSelect;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,aAAa,QAAQ,mBAAmB;AAGjD,SAASC,gBAAgBA,CACxBC,IAAY,EACZC,KAAK,GAAG,CAAC,EACqC;EAC9C,OAAOD,IAAI,CAACE,OAAO,CAAIC,QAAQ,IAAM,CACpC;IACCC,KAAK,EAAED,QAAQ,CAACE,EAAE;IAClBC,KAAK,EACJ,QAAQ,CAACC,MAAM,CAAEN,KAAK,GAAG,CAAE,CAAC,GAAGJ,cAAc,CAAEM,QAAQ,CAACK,IAAK;EAC/D,CAAC,EACD,GAAGT,gBAAgB,CAAEI,QAAQ,CAACM,QAAQ,IAAI,EAAE,EAAER,KAAK,GAAG,CAAE,CAAC,CACxD,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASS,UAAUA,CAAE;EAC3BJ,KAAK;EACLK,aAAa;EACbC,QAAQ;EACRC,UAAU;EACVb,IAAI,GAAG,EAAE;EACT,GAAGc;AACa,CAAC,EAAG;EACpB,MAAMC,OAAO,GAAGnB,OAAO,CAAE,MAAM;IAC9B,OAAO,CACNe,aAAa,IAAI;MAAEP,KAAK,EAAE,EAAE;MAAEE,KAAK,EAAEK;IAAc,CAAC,EACpD,GAAGZ,gBAAgB,CAAEC,IAAK,CAAC,CAC3B,CAACgB,MAAM,CAAUC,MAAS,IAA6B,CAAC,CAAEA,MAAO,CAAC;EACpE,CAAC,EAAE,CAAEN,aAAa,EAAEX,IAAI,CAAG,CAAC;EAE5B,OACCkB,aAAA,CAACpB,aAAa;IACNQ,KAAK;IAAES,OAAO;IAAEH,QAAQ;IAC/BR,KAAK,EAAGS,UAAY;IAAA,GACfC;EAAK,CACV,CAAC;AAEJ;AAEA,eAAeJ,UAAU"}
|
|
@@ -166,7 +166,6 @@ function UnforwardedUnitControl(unitControlProps, forwardedRef) {
|
|
|
166
166
|
* `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).
|
|
167
167
|
*
|
|
168
168
|
*
|
|
169
|
-
* @example
|
|
170
169
|
* ```jsx
|
|
171
170
|
* import { __experimentalUnitControl as UnitControl } from '@wordpress/components';
|
|
172
171
|
* import { useState } from '@wordpress/element';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","deprecated","forwardRef","useMemo","useRef","useEffect","__","ValueInput","UnitSelectControl","CSS_UNITS","getParsedQuantityAndUnit","getUnitsWithCurrentUnit","getValidParsedQuantityAndUnit","useControlledState","escapeRegExp","UnforwardedUnitControl","unitControlProps","forwardedRef","__unstableStateReducer","autoComplete","children","className","disabled","disableUnits","isPressEnterToChange","isResetValueOnUnitChange","isUnitSelectTabbable","label","onChange","onChangeProp","onUnitChange","size","unit","unitProp","units","unitsProp","value","valueProp","onFocus","onFocusProp","props","since","hint","version","nonNullValueProp","undefined","reFirstCharacterOfUnits","list","firstUnitValue","rest","firstCharacters","reduce","carry","first","substring","includes","RegExp","parsedQuantity","parsedUnit","setUnit","length","initial","fallback","classes","handleOnQuantityChange","nextQuantityValue","changeProps","onChangeValue","join","handleOnUnitChange","nextUnitValue","data","nextValue","default","handleOnKeyDown","event","onKeyDown","metaKey","test","key","refInputSuffix","current","focus","inputSuffix","createElement","ref","onBlur","step","_activeUnit$step","activeUnit","find","option","spinControls","suffix","type","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits"],"sources":["@wordpress/components/src/unit-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { KeyboardEvent, ForwardedRef, SyntheticEvent } from 'react';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef, useMemo, useRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport { ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport {\n\tCSS_UNITS,\n\tgetParsedQuantityAndUnit,\n\tgetUnitsWithCurrentUnit,\n\tgetValidParsedQuantityAndUnit,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport { escapeRegExp } from '../utils/strings';\nimport type { UnitControlProps, UnitControlOnChangeCallback } from './types';\n\nfunction UnforwardedUnitControl(\n\tunitControlProps: WordPressComponentProps<\n\t\tUnitControlProps,\n\t\t'input',\n\t\tfalse\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer,\n\t\tautoComplete = 'off',\n\t\t// @ts-expect-error Ensure that children is omitted from restProps\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled = false,\n\t\tdisableUnits = false,\n\t\tisPressEnterToChange = false,\n\t\tisResetValueOnUnitChange = false,\n\t\tisUnitSelectTabbable = true,\n\t\tlabel,\n\t\tonChange: onChangeProp,\n\t\tonUnitChange,\n\t\tsize = 'default',\n\t\tunit: unitProp,\n\t\tunits: unitsProp = CSS_UNITS,\n\t\tvalue: valueProp,\n\t\tonFocus: onFocusProp,\n\t\t...props\n\t} = unitControlProps;\n\n\tif ( 'unit' in unitControlProps ) {\n\t\tdeprecated( 'UnitControl unit prop', {\n\t\t\tsince: '5.6',\n\t\t\thint: 'The unit should be provided within the `value` prop.',\n\t\t\tversion: '6.2',\n\t\t} );\n\t}\n\n\t// The `value` prop, in theory, should not be `null`, but the following line\n\t// ensures it fallback to `undefined` in case a consumer of `UnitControl`\n\t// still passes `null` as a `value`.\n\tconst nonNullValueProp = valueProp ?? undefined;\n\tconst [ units, reFirstCharacterOfUnits ] = useMemo( () => {\n\t\tconst list = getUnitsWithCurrentUnit(\n\t\t\tnonNullValueProp,\n\t\t\tunitProp,\n\t\t\tunitsProp\n\t\t);\n\t\tconst [ { value: firstUnitValue = '' } = {}, ...rest ] = list;\n\t\tconst firstCharacters = rest.reduce( ( carry, { value } ) => {\n\t\t\tconst first = escapeRegExp( value?.substring( 0, 1 ) || '' );\n\t\t\treturn carry.includes( first ) ? carry : `${ carry }|${ first }`;\n\t\t}, escapeRegExp( firstUnitValue.substring( 0, 1 ) ) );\n\t\treturn [ list, new RegExp( `^(?:${ firstCharacters })$`, 'i' ) ];\n\t}, [ nonNullValueProp, unitProp, unitsProp ] );\n\tconst [ parsedQuantity, parsedUnit ] = getParsedQuantityAndUnit(\n\t\tnonNullValueProp,\n\t\tunitProp,\n\t\tunits\n\t);\n\n\tconst [ unit, setUnit ] = useControlledState< string | undefined >(\n\t\tunits.length === 1 ? units[ 0 ].value : unitProp,\n\t\t{\n\t\t\tinitial: parsedUnit,\n\t\t\tfallback: '',\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tif ( parsedUnit !== undefined ) {\n\t\t\tsetUnit( parsedUnit );\n\t\t}\n\t}, [ parsedUnit, setUnit ] );\n\n\tconst classes = classnames(\n\t\t'components-unit-control',\n\t\t// This class is added for legacy purposes to maintain it on the outer\n\t\t// wrapper. See: https://github.com/WordPress/gutenberg/pull/45139\n\t\t'components-unit-control-wrapper',\n\t\tclassName\n\t);\n\n\tconst handleOnQuantityChange = (\n\t\tnextQuantityValue: number | string | undefined,\n\t\tchangeProps: {\n\t\t\tevent: SyntheticEvent;\n\t\t}\n\t) => {\n\t\tif (\n\t\t\tnextQuantityValue === '' ||\n\t\t\ttypeof nextQuantityValue === 'undefined' ||\n\t\t\tnextQuantityValue === null\n\t\t) {\n\t\t\tonChangeProp?.( '', changeProps );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Customizing the onChange callback.\n\t\t * This allows as to broadcast a combined value+unit to onChange.\n\t\t */\n\t\tconst onChangeValue = getValidParsedQuantityAndUnit(\n\t\t\tnextQuantityValue,\n\t\t\tunits,\n\t\t\tparsedQuantity,\n\t\t\tunit\n\t\t).join( '' );\n\n\t\tonChangeProp?.( onChangeValue, changeProps );\n\t};\n\n\tconst handleOnUnitChange: UnitControlOnChangeCallback = (\n\t\tnextUnitValue,\n\t\tchangeProps\n\t) => {\n\t\tconst { data } = changeProps;\n\n\t\tlet nextValue = `${ parsedQuantity ?? '' }${ nextUnitValue }`;\n\n\t\tif ( isResetValueOnUnitChange && data?.default !== undefined ) {\n\t\t\tnextValue = `${ data.default }${ nextUnitValue }`;\n\t\t}\n\n\t\tonChangeProp?.( nextValue, changeProps );\n\t\tonUnitChange?.( nextUnitValue, changeProps );\n\n\t\tsetUnit( nextUnitValue );\n\t};\n\n\tlet handleOnKeyDown;\n\tif ( ! disableUnits && isUnitSelectTabbable && units.length ) {\n\t\thandleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\t\tprops.onKeyDown?.( event );\n\t\t\t// Unless the meta key was pressed (to avoid interfering with\n\t\t\t// shortcuts, e.g. pastes), moves focus to the unit select if a key\n\t\t\t// matches the first character of a unit.\n\t\t\tif ( ! event.metaKey && reFirstCharacterOfUnits.test( event.key ) )\n\t\t\t\trefInputSuffix.current?.focus();\n\t\t};\n\t}\n\n\tconst refInputSuffix = useRef< HTMLSelectElement >( null );\n\tconst inputSuffix = ! disableUnits ? (\n\t\t<UnitSelectControl\n\t\t\tref={ refInputSuffix }\n\t\t\taria-label={ __( 'Select unit' ) }\n\t\t\tdisabled={ disabled }\n\t\t\tisUnitSelectTabbable={ isUnitSelectTabbable }\n\t\t\tonChange={ handleOnUnitChange }\n\t\t\tsize={ size }\n\t\t\tunit={ unit }\n\t\t\tunits={ units }\n\t\t\tonFocus={ onFocusProp }\n\t\t\tonBlur={ unitControlProps.onBlur }\n\t\t/>\n\t) : null;\n\n\tlet step = props.step;\n\n\t/*\n\t * If no step prop has been passed, lookup the active unit and\n\t * try to get step from `units`, or default to a value of `1`\n\t */\n\tif ( ! step && units ) {\n\t\tconst activeUnit = units.find( ( option ) => option.value === unit );\n\t\tstep = activeUnit?.step ?? 1;\n\t}\n\n\treturn (\n\t\t<ValueInput\n\t\t\t{ ...props }\n\t\t\tautoComplete={ autoComplete }\n\t\t\tclassName={ classes }\n\t\t\tdisabled={ disabled }\n\t\t\tspinControls=\"none\"\n\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\tlabel={ label }\n\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\tonChange={ handleOnQuantityChange }\n\t\t\tref={ forwardedRef }\n\t\t\tsize={ size }\n\t\t\tsuffix={ inputSuffix }\n\t\t\ttype={ isPressEnterToChange ? 'text' : 'number' }\n\t\t\tvalue={ parsedQuantity ?? '' }\n\t\t\tstep={ step }\n\t\t\tonFocus={ onFocusProp }\n\t\t\t__unstableStateReducer={ __unstableStateReducer }\n\t\t/>\n\t);\n}\n\n/**\n * `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).\n *\n *\n * @example\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nexport const UnitControl = forwardRef( UnforwardedUnitControl );\n\nexport { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';\nexport default UnitControl;\n"],"mappings":";AAAA;AACA;AACA;;AAEA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,OAAO,EAAEC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AAC3E,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,SAASC,UAAU,QAAQ,8BAA8B;AACzD,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SACCC,SAAS,EACTC,wBAAwB,EACxBC,uBAAuB,EACvBC,6BAA6B,QACvB,SAAS;AAChB,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,SAASC,YAAY,QAAQ,kBAAkB;AAG/C,SAASC,sBAAsBA,CAC9BC,gBAIC,EACDC,YAAiC,EAChC;EACD,MAAM;IACLC,sBAAsB;IACtBC,YAAY,GAAG,KAAK;IACpB;IACAC,QAAQ;IACRC,SAAS;IACTC,QAAQ,GAAG,KAAK;IAChBC,YAAY,GAAG,KAAK;IACpBC,oBAAoB,GAAG,KAAK;IAC5BC,wBAAwB,GAAG,KAAK;IACh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__","ValueInput","UnitSelectControl","CSS_UNITS","getParsedQuantityAndUnit","getUnitsWithCurrentUnit","getValidParsedQuantityAndUnit","useControlledState","escapeRegExp","UnforwardedUnitControl","unitControlProps","forwardedRef","__unstableStateReducer","autoComplete","children","className","disabled","disableUnits","isPressEnterToChange","isResetValueOnUnitChange","isUnitSelectTabbable","label","onChange","onChangeProp","onUnitChange","size","unit","unitProp","units","unitsProp","value","valueProp","onFocus","onFocusProp","props","since","hint","version","nonNullValueProp","undefined","reFirstCharacterOfUnits","list","firstUnitValue","rest","firstCharacters","reduce","carry","first","substring","includes","RegExp","parsedQuantity","parsedUnit","setUnit","length","initial","fallback","classes","handleOnQuantityChange","nextQuantityValue","changeProps","onChangeValue","join","handleOnUnitChange","nextUnitValue","data","nextValue","default","handleOnKeyDown","event","onKeyDown","metaKey","test","key","refInputSuffix","current","focus","inputSuffix","createElement","ref","onBlur","step","_activeUnit$step","activeUnit","find","option","spinControls","suffix","type","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits"],"sources":["@wordpress/components/src/unit-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { KeyboardEvent, ForwardedRef, SyntheticEvent } from 'react';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef, useMemo, useRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport { ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport {\n\tCSS_UNITS,\n\tgetParsedQuantityAndUnit,\n\tgetUnitsWithCurrentUnit,\n\tgetValidParsedQuantityAndUnit,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport { escapeRegExp } from '../utils/strings';\nimport type { UnitControlProps, UnitControlOnChangeCallback } from './types';\n\nfunction UnforwardedUnitControl(\n\tunitControlProps: WordPressComponentProps<\n\t\tUnitControlProps,\n\t\t'input',\n\t\tfalse\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer,\n\t\tautoComplete = 'off',\n\t\t// @ts-expect-error Ensure that children is omitted from restProps\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled = false,\n\t\tdisableUnits = false,\n\t\tisPressEnterToChange = false,\n\t\tisResetValueOnUnitChange = false,\n\t\tisUnitSelectTabbable = true,\n\t\tlabel,\n\t\tonChange: onChangeProp,\n\t\tonUnitChange,\n\t\tsize = 'default',\n\t\tunit: unitProp,\n\t\tunits: unitsProp = CSS_UNITS,\n\t\tvalue: valueProp,\n\t\tonFocus: onFocusProp,\n\t\t...props\n\t} = unitControlProps;\n\n\tif ( 'unit' in unitControlProps ) {\n\t\tdeprecated( 'UnitControl unit prop', {\n\t\t\tsince: '5.6',\n\t\t\thint: 'The unit should be provided within the `value` prop.',\n\t\t\tversion: '6.2',\n\t\t} );\n\t}\n\n\t// The `value` prop, in theory, should not be `null`, but the following line\n\t// ensures it fallback to `undefined` in case a consumer of `UnitControl`\n\t// still passes `null` as a `value`.\n\tconst nonNullValueProp = valueProp ?? undefined;\n\tconst [ units, reFirstCharacterOfUnits ] = useMemo( () => {\n\t\tconst list = getUnitsWithCurrentUnit(\n\t\t\tnonNullValueProp,\n\t\t\tunitProp,\n\t\t\tunitsProp\n\t\t);\n\t\tconst [ { value: firstUnitValue = '' } = {}, ...rest ] = list;\n\t\tconst firstCharacters = rest.reduce( ( carry, { value } ) => {\n\t\t\tconst first = escapeRegExp( value?.substring( 0, 1 ) || '' );\n\t\t\treturn carry.includes( first ) ? carry : `${ carry }|${ first }`;\n\t\t}, escapeRegExp( firstUnitValue.substring( 0, 1 ) ) );\n\t\treturn [ list, new RegExp( `^(?:${ firstCharacters })$`, 'i' ) ];\n\t}, [ nonNullValueProp, unitProp, unitsProp ] );\n\tconst [ parsedQuantity, parsedUnit ] = getParsedQuantityAndUnit(\n\t\tnonNullValueProp,\n\t\tunitProp,\n\t\tunits\n\t);\n\n\tconst [ unit, setUnit ] = useControlledState< string | undefined >(\n\t\tunits.length === 1 ? units[ 0 ].value : unitProp,\n\t\t{\n\t\t\tinitial: parsedUnit,\n\t\t\tfallback: '',\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tif ( parsedUnit !== undefined ) {\n\t\t\tsetUnit( parsedUnit );\n\t\t}\n\t}, [ parsedUnit, setUnit ] );\n\n\tconst classes = classnames(\n\t\t'components-unit-control',\n\t\t// This class is added for legacy purposes to maintain it on the outer\n\t\t// wrapper. See: https://github.com/WordPress/gutenberg/pull/45139\n\t\t'components-unit-control-wrapper',\n\t\tclassName\n\t);\n\n\tconst handleOnQuantityChange = (\n\t\tnextQuantityValue: number | string | undefined,\n\t\tchangeProps: {\n\t\t\tevent: SyntheticEvent;\n\t\t}\n\t) => {\n\t\tif (\n\t\t\tnextQuantityValue === '' ||\n\t\t\ttypeof nextQuantityValue === 'undefined' ||\n\t\t\tnextQuantityValue === null\n\t\t) {\n\t\t\tonChangeProp?.( '', changeProps );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Customizing the onChange callback.\n\t\t * This allows as to broadcast a combined value+unit to onChange.\n\t\t */\n\t\tconst onChangeValue = getValidParsedQuantityAndUnit(\n\t\t\tnextQuantityValue,\n\t\t\tunits,\n\t\t\tparsedQuantity,\n\t\t\tunit\n\t\t).join( '' );\n\n\t\tonChangeProp?.( onChangeValue, changeProps );\n\t};\n\n\tconst handleOnUnitChange: UnitControlOnChangeCallback = (\n\t\tnextUnitValue,\n\t\tchangeProps\n\t) => {\n\t\tconst { data } = changeProps;\n\n\t\tlet nextValue = `${ parsedQuantity ?? '' }${ nextUnitValue }`;\n\n\t\tif ( isResetValueOnUnitChange && data?.default !== undefined ) {\n\t\t\tnextValue = `${ data.default }${ nextUnitValue }`;\n\t\t}\n\n\t\tonChangeProp?.( nextValue, changeProps );\n\t\tonUnitChange?.( nextUnitValue, changeProps );\n\n\t\tsetUnit( nextUnitValue );\n\t};\n\n\tlet handleOnKeyDown;\n\tif ( ! disableUnits && isUnitSelectTabbable && units.length ) {\n\t\thandleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\t\tprops.onKeyDown?.( event );\n\t\t\t// Unless the meta key was pressed (to avoid interfering with\n\t\t\t// shortcuts, e.g. pastes), moves focus to the unit select if a key\n\t\t\t// matches the first character of a unit.\n\t\t\tif ( ! event.metaKey && reFirstCharacterOfUnits.test( event.key ) )\n\t\t\t\trefInputSuffix.current?.focus();\n\t\t};\n\t}\n\n\tconst refInputSuffix = useRef< HTMLSelectElement >( null );\n\tconst inputSuffix = ! disableUnits ? (\n\t\t<UnitSelectControl\n\t\t\tref={ refInputSuffix }\n\t\t\taria-label={ __( 'Select unit' ) }\n\t\t\tdisabled={ disabled }\n\t\t\tisUnitSelectTabbable={ isUnitSelectTabbable }\n\t\t\tonChange={ handleOnUnitChange }\n\t\t\tsize={ size }\n\t\t\tunit={ unit }\n\t\t\tunits={ units }\n\t\t\tonFocus={ onFocusProp }\n\t\t\tonBlur={ unitControlProps.onBlur }\n\t\t/>\n\t) : null;\n\n\tlet step = props.step;\n\n\t/*\n\t * If no step prop has been passed, lookup the active unit and\n\t * try to get step from `units`, or default to a value of `1`\n\t */\n\tif ( ! step && units ) {\n\t\tconst activeUnit = units.find( ( option ) => option.value === unit );\n\t\tstep = activeUnit?.step ?? 1;\n\t}\n\n\treturn (\n\t\t<ValueInput\n\t\t\t{ ...props }\n\t\t\tautoComplete={ autoComplete }\n\t\t\tclassName={ classes }\n\t\t\tdisabled={ disabled }\n\t\t\tspinControls=\"none\"\n\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\tlabel={ label }\n\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\tonChange={ handleOnQuantityChange }\n\t\t\tref={ forwardedRef }\n\t\t\tsize={ size }\n\t\t\tsuffix={ inputSuffix }\n\t\t\ttype={ isPressEnterToChange ? 'text' : 'number' }\n\t\t\tvalue={ parsedQuantity ?? '' }\n\t\t\tstep={ step }\n\t\t\tonFocus={ onFocusProp }\n\t\t\t__unstableStateReducer={ __unstableStateReducer }\n\t\t/>\n\t);\n}\n\n/**\n * `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).\n *\n *\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nexport const UnitControl = forwardRef( UnforwardedUnitControl );\n\nexport { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';\nexport default UnitControl;\n"],"mappings":";AAAA;AACA;AACA;;AAEA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,OAAO,EAAEC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AAC3E,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,SAASC,UAAU,QAAQ,8BAA8B;AACzD,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SACCC,SAAS,EACTC,wBAAwB,EACxBC,uBAAuB,EACvBC,6BAA6B,QACvB,SAAS;AAChB,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,SAASC,YAAY,QAAQ,kBAAkB;AAG/C,SAASC,sBAAsBA,CAC9BC,gBAIC,EACDC,YAAiC,EAChC;EACD,MAAM;IACLC,sBAAsB;IACtBC,YAAY,GAAG,KAAK;IACpB;IACAC,QAAQ;IACRC,SAAS;IACTC,QAAQ,GAAG,KAAK;IAChBC,YAAY,GAAG,KAAK;IACpBC,oBAAoB,GAAG,KAAK;IAC5BC,wBAAwB,GAAG,KAAK;IAChCC,oBAAoB,GAAG,IAAI;IAC3BC,KAAK;IACLC,QAAQ,EAAEC,YAAY;IACtBC,YAAY;IACZC,IAAI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;EACC,IAAK,CAAEA,IAAI,IAAIrD,KAAK,EAAG;IAAA,IAAAsD,gBAAA;IACtB,MAAMC,UAAU,GAAGvD,KAAK,CAACwD,IAAI,CAAIC,MAAM,IAAMA,MAAM,CAACvD,KAAK,KAAKJ,IAAK,CAAC;IACpEuD,IAAI,IAAAC,gBAAA,GAAGC,UAAU,EAAEF,IAAI,cAAAC,gBAAA,cAAAA,gBAAA,GAAI,CAAC;EAC7B;EAEA,OACCJ,aAAA,CAAC7E,UAAU;IAAA,GACLiC,KAAK;IACVrB,YAAY,EAAGA,YAAc;IAC7BE,SAAS,EAAG0C,OAAS;IACrBzC,QAAQ,EAAGA,QAAU;IACrBsE,YAAY,EAAC,MAAM;IACnBpE,oBAAoB,EAAGA,oBAAsB;IAC7CG,KAAK,EAAGA,KAAO;IACfiD,SAAS,EAAGF,eAAiB;IAC7B9C,QAAQ,EAAGoC,sBAAwB;IACnCqB,GAAG,EAAGpE,YAAc;IACpBc,IAAI,EAAGA,IAAM;IACb8D,MAAM,EAAGV,WAAa;IACtBW,IAAI,EAAGtE,oBAAoB,GAAG,MAAM,GAAG,QAAU;IACjDY,KAAK,EAAGqB,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,EAAI;IAC9B8B,IAAI,EAAGA,IAAM;IACbjD,OAAO,EAAGC,WAAa;IACvBrB,sBAAsB,EAAGA;EAAwB,CACjD,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM6E,WAAW,GAAG7F,UAAU,CAAEa,sBAAuB,CAAC;AAE/D,SAASiF,gCAAgC,EAAEC,cAAc,QAAQ,SAAS;AAC1E,eAAeF,WAAW"}
|
|
@@ -20,7 +20,7 @@ const isSerializedStyles = o => typeof o !== 'undefined' && o !== null && ['name
|
|
|
20
20
|
* `cx` normally knows how to handle. It also hooks into the Emotion
|
|
21
21
|
* Cache, allowing `css` calls to work inside iframes.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
23
|
+
* ```jsx
|
|
24
24
|
* import { css } from '@emotion/react';
|
|
25
25
|
*
|
|
26
26
|
* const styles = css`
|
|
@@ -34,6 +34,7 @@ const isSerializedStyles = o => typeof o !== 'undefined' && o !== null && ['name
|
|
|
34
34
|
*
|
|
35
35
|
* return <span className={classes} {...props} />;
|
|
36
36
|
* }
|
|
37
|
+
* ```
|
|
37
38
|
*/
|
|
38
39
|
export const useCx = () => {
|
|
39
40
|
const cache = useEmotionCache();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__unsafe_useEmotionCache","useEmotionCache","insertStyles","cx","innerCx","useCallback","isSerializedStyles","o","every","p","useCx","cache","classNames","Error","map","arg","key","name"],"sources":["@wordpress/components/src/utils/hooks/use-cx.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { __unsafe_useEmotionCache as useEmotionCache } from '@emotion/react';\nimport type { SerializedStyles } from '@emotion/serialize';\nimport { insertStyles } from '@emotion/utils';\n// eslint-disable-next-line no-restricted-imports\nimport type { ClassNamesArg } from '@emotion/css';\n// eslint-disable-next-line no-restricted-imports\nimport { cx as innerCx } from '@emotion/css';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\n\nconst isSerializedStyles = ( o: any ): o is SerializedStyles =>\n\ttypeof o !== 'undefined' &&\n\to !== null &&\n\t[ 'name', 'styles' ].every( ( p ) => typeof o[ p ] !== 'undefined' );\n\n/**\n * Retrieve a `cx` function that knows how to handle `SerializedStyles`\n * returned by the `@emotion/react` `css` function in addition to what\n * `cx` normally knows how to handle. It also hooks into the Emotion\n * Cache, allowing `css` calls to work inside iframes.\n *\n *
|
|
1
|
+
{"version":3,"names":["__unsafe_useEmotionCache","useEmotionCache","insertStyles","cx","innerCx","useCallback","isSerializedStyles","o","every","p","useCx","cache","classNames","Error","map","arg","key","name"],"sources":["@wordpress/components/src/utils/hooks/use-cx.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { __unsafe_useEmotionCache as useEmotionCache } from '@emotion/react';\nimport type { SerializedStyles } from '@emotion/serialize';\nimport { insertStyles } from '@emotion/utils';\n// eslint-disable-next-line no-restricted-imports\nimport type { ClassNamesArg } from '@emotion/css';\n// eslint-disable-next-line no-restricted-imports\nimport { cx as innerCx } from '@emotion/css';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\n\nconst isSerializedStyles = ( o: any ): o is SerializedStyles =>\n\ttypeof o !== 'undefined' &&\n\to !== null &&\n\t[ 'name', 'styles' ].every( ( p ) => typeof o[ p ] !== 'undefined' );\n\n/**\n * Retrieve a `cx` function that knows how to handle `SerializedStyles`\n * returned by the `@emotion/react` `css` function in addition to what\n * `cx` normally knows how to handle. It also hooks into the Emotion\n * Cache, allowing `css` calls to work inside iframes.\n *\n * ```jsx\n * import { css } from '@emotion/react';\n *\n * const styles = css`\n * \tcolor: red\n * `;\n *\n * function RedText( { className, ...props } ) {\n * \tconst cx = useCx();\n *\n * \tconst classes = cx(styles, className);\n *\n * \treturn <span className={classes} {...props} />;\n * }\n * ```\n */\nexport const useCx = () => {\n\tconst cache = useEmotionCache();\n\n\tconst cx = useCallback(\n\t\t( ...classNames: ( ClassNamesArg | SerializedStyles )[] ) => {\n\t\t\tif ( cache === null ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'The `useCx` hook should be only used within a valid Emotion Cache Context'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn innerCx(\n\t\t\t\t...classNames.map( ( arg ) => {\n\t\t\t\t\tif ( isSerializedStyles( arg ) ) {\n\t\t\t\t\t\tinsertStyles( cache, arg, false );\n\t\t\t\t\t\treturn `${ cache.key }-${ arg.name }`;\n\t\t\t\t\t}\n\t\t\t\t\treturn arg;\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t\t[ cache ]\n\t);\n\n\treturn cx;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,wBAAwB,IAAIC,eAAe,QAAQ,gBAAgB;AAE5E,SAASC,YAAY,QAAQ,gBAAgB;AAC7C;;AAEA;AACA,SAASC,EAAE,IAAIC,OAAO,QAAQ,cAAc;;AAE5C;AACA;AACA;AACA,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,MAAMC,kBAAkB,GAAKC,CAAM,IAClC,OAAOA,CAAC,KAAK,WAAW,IACxBA,CAAC,KAAK,IAAI,IACV,CAAE,MAAM,EAAE,QAAQ,CAAE,CAACC,KAAK,CAAIC,CAAC,IAAM,OAAOF,CAAC,CAAEE,CAAC,CAAE,KAAK,WAAY,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGA,CAAA,KAAM;EAC1B,MAAMC,KAAK,GAAGV,eAAe,CAAC,CAAC;EAE/B,MAAME,EAAE,GAAGE,WAAW,CACrB,CAAE,GAAGO,UAAkD,KAAM;IAC5D,IAAKD,KAAK,KAAK,IAAI,EAAG;MACrB,MAAM,IAAIE,KAAK,CACd,2EACD,CAAC;IACF;IAEA,OAAOT,OAAO,CACb,GAAGQ,UAAU,CAACE,GAAG,CAAIC,GAAG,IAAM;MAC7B,IAAKT,kBAAkB,CAAES,GAAI,CAAC,EAAG;QAChCb,YAAY,CAAES,KAAK,EAAEI,GAAG,EAAE,KAAM,CAAC;QACjC,OAAQ,GAAGJ,KAAK,CAACK,GAAK,IAAID,GAAG,CAACE,IAAM,EAAC;MACtC;MACA,OAAOF,GAAG;IACX,CAAE,CACH,CAAC;EACF,CAAC,EACD,CAAEJ,KAAK,CACR,CAAC;EAED,OAAOR,EAAE;AACV,CAAC"}
|
|
@@ -7,7 +7,6 @@ import _styled from "@emotion/styled/base";
|
|
|
7
7
|
* `View` is a core component that renders everything in the library.
|
|
8
8
|
* It is the principle component in the entire library.
|
|
9
9
|
*
|
|
10
|
-
* @example
|
|
11
10
|
* ```jsx
|
|
12
11
|
* import { View } from `@wordpress/components`;
|
|
13
12
|
*
|
|
@@ -25,7 +24,7 @@ export const View = _styled("div", process.env.NODE_ENV === "production" ? {
|
|
|
25
24
|
} : {
|
|
26
25
|
target: "e19lxcc00",
|
|
27
26
|
label: "View"
|
|
28
|
-
})(process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
27
|
+
})(process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdmlldy9jb21wb25lbnQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWdDYyIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3ZpZXcvY29tcG9uZW50LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB0eXBlIHsgUmVmQXR0cmlidXRlcyB9IGZyb20gJ3JlYWN0JztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHR5cGUgeyBXb3JkUHJlc3NDb21wb25lbnQgfSBmcm9tICcuLi91aS9jb250ZXh0L3dvcmRwcmVzcy1jb21wb25lbnQnO1xuaW1wb3J0IHR5cGUgeyBWaWV3UHJvcHMgfSBmcm9tICcuL3R5cGVzJztcblxuLyoqXG4gKiBgVmlld2AgaXMgYSBjb3JlIGNvbXBvbmVudCB0aGF0IHJlbmRlcnMgZXZlcnl0aGluZyBpbiB0aGUgbGlicmFyeS5cbiAqIEl0IGlzIHRoZSBwcmluY2lwbGUgY29tcG9uZW50IGluIHRoZSBlbnRpcmUgbGlicmFyeS5cbiAqXG4gKiBgYGBqc3hcbiAqIGltcG9ydCB7IFZpZXcgfSBmcm9tIGBAd29yZHByZXNzL2NvbXBvbmVudHNgO1xuICpcbiAqIGZ1bmN0aW9uIEV4YW1wbGUoKSB7XG4gKiBcdHJldHVybiAoXG4gKiBcdFx0PFZpZXc+XG4gKiBcdFx0XHQgQ29kZSBpcyBQb2V0cnlcbiAqIFx0XHQ8L1ZpZXc+XG4gKiBcdCk7XG4gKiB9XG4gKiBgYGBcbiAqL1xuZXhwb3J0IGNvbnN0IFZpZXc6IFdvcmRQcmVzc0NvbXBvbmVudDxcblx0J2RpdicsXG5cdFZpZXdQcm9wcyAmIFJlZkF0dHJpYnV0ZXM8IGFueSA+LFxuXHR0cnVlXG4+ID0gc3R5bGVkLmRpdmBgO1xuXG5WaWV3LnNlbGVjdG9yID0gJy5jb21wb25lbnRzLXZpZXcnO1xuVmlldy5kaXNwbGF5TmFtZSA9ICdWaWV3JztcblxuZXhwb3J0IGRlZmF1bHQgVmlldztcbiJdfQ== */");
|
|
29
28
|
View.selector = '.components-view';
|
|
30
29
|
View.displayName = 'View';
|
|
31
30
|
export default View;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","_styled","process","env","NODE_ENV","target","label","selector","displayName"],"sources":["@wordpress/components/src/view/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport type { RefAttributes } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponent } from '../ui/context/wordpress-component';\nimport type { ViewProps } from './types';\n\n/**\n * `View` is a core component that renders everything in the library.\n * It is the principle component in the entire library.\n *\n *
|
|
1
|
+
{"version":3,"names":["View","_styled","process","env","NODE_ENV","target","label","selector","displayName"],"sources":["@wordpress/components/src/view/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport type { RefAttributes } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponent } from '../ui/context/wordpress-component';\nimport type { ViewProps } from './types';\n\n/**\n * `View` is a core component that renders everything in the library.\n * It is the principle component in the entire library.\n *\n * ```jsx\n * import { View } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<View>\n * \t\t\t Code is Poetry\n * \t\t</View>\n * \t);\n * }\n * ```\n */\nexport const View: WordPressComponent<\n\t'div',\n\tViewProps & RefAttributes< any >,\n\ttrue\n> = styled.div``;\n\nView.selector = '.components-view';\nView.displayName = 'View';\n\nexport default View;\n"],"mappings":";AAAA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,IAIZ,GAAAC,OAAA,QAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,24CAAe;AAEhBJ,IAAI,CAACO,QAAQ,GAAG,kBAAkB;AAClCP,IAAI,CAACQ,WAAW,GAAG,MAAM;AAEzB,eAAeR,IAAI"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { Meta } from '@storybook/react';
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import AlignmentMatrixControl from '..';
|
|
10
10
|
import type { AlignmentMatrixControlProps } from '../types';
|
|
11
|
-
declare const meta:
|
|
11
|
+
declare const meta: Meta<typeof AlignmentMatrixControl>;
|
|
12
12
|
export default meta;
|
|
13
13
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, AlignmentMatrixControlProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "children" | "as" | keyof AlignmentMatrixControlProps>>;
|
|
14
14
|
export declare const IconSubcomponent: () => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/alignment-matrix-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/alignment-matrix-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAQtD;;GAEG;AACH,OAAO,sBAAsB,MAAM,IAAI,CAAC;AAExC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,sBAAsB,CAe9C,CAAC;AACF,eAAe,IAAI,CAAC;AA0BpB,eAAO,MAAM,OAAO,iWAAsB,CAAC;AAE3C,eAAO,MAAM,gBAAgB,mBAkB5B,CAAC"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { Meta } from '@storybook/react';
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { AnglePickerControl } from '..';
|
|
10
|
-
declare const meta:
|
|
10
|
+
declare const meta: Meta<typeof AnglePickerControl>;
|
|
11
11
|
export default meta;
|
|
12
12
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnglePickerControlProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "children" | "as" | keyof import("../types").AnglePickerControlProps> & {
|
|
13
13
|
as?: keyof JSX.IntrinsicElements | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/angle-picker-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/angle-picker-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAExC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,kBAAkB,CAc1C,CAAC;AAEF,eAAe,IAAI,CAAC;AAsBpB,eAAO,MAAM,OAAO;;uCAAkC,CAAC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { Meta } from '@storybook/react';
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
8
|
import { Animate } from '..';
|
|
9
|
-
declare const meta:
|
|
9
|
+
declare const meta: Meta<typeof Animate>;
|
|
10
10
|
export default meta;
|
|
11
|
-
export declare const Default:
|
|
12
|
-
export declare const AppearTopLeft:
|
|
13
|
-
export declare const AppearTopRight:
|
|
14
|
-
export declare const AppearBottomLeft:
|
|
15
|
-
export declare const AppearBottomRight:
|
|
16
|
-
export declare const Loading:
|
|
17
|
-
export declare const SlideIn:
|
|
11
|
+
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
|
|
12
|
+
export declare const AppearTopLeft: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
|
|
13
|
+
export declare const AppearTopRight: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
|
|
14
|
+
export declare const AppearBottomLeft: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
|
|
15
|
+
export declare const AppearBottomRight: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
|
|
16
|
+
export declare const Loading: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
|
|
17
|
+
export declare const SlideIn: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
|
|
18
18
|
//# sourceMappingURL=index.story.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/animate/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/animate/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAG7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAO/B,CAAC;AACF,eAAe,IAAI,CAAC;AAMpB,eAAO,MAAM,OAAO,gIAAsB,CAAC;AAS3C,eAAO,MAAM,aAAa,gIAAsB,CAAC;AAUjD,eAAO,MAAM,cAAc,gIAAsB,CAAC;AAUlD,eAAO,MAAM,gBAAgB,gIAAsB,CAAC;AAUpD,eAAO,MAAM,iBAAiB,gIAAsB,CAAC;AAWrD,eAAO,MAAM,OAAO,gIAAsB,CAAC;AAU3C,eAAO,MAAM,OAAO,gIAAsB,CAAC"}
|
|
@@ -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
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
8
|
import BaseControl from '..';
|
|
9
|
-
declare const meta:
|
|
9
|
+
declare const meta: Meta<typeof BaseControl>;
|
|
10
10
|
export default meta;
|
|
11
|
-
export declare const Default:
|
|
11
|
+
export declare const Default: StoryFn<typeof BaseControl>;
|
|
12
12
|
export declare const WithHelpText: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").BaseControlProps>;
|
|
13
13
|
/**
|
|
14
14
|
* `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.
|
|
@@ -17,5 +17,5 @@ export declare const WithHelpText: import("@storybook/types").AnnotatedStoryFn<i
|
|
|
17
17
|
* e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would
|
|
18
18
|
* otherwise use if the `label` prop was passed.
|
|
19
19
|
*/
|
|
20
|
-
export declare const WithVisualLabel:
|
|
20
|
+
export declare const WithVisualLabel: StoryFn<typeof BaseControl>;
|
|
21
21
|
//# sourceMappingURL=index.story.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/base-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/base-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,OAAO,WAAoC,MAAM,IAAI,CAAC;AAGtD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,WAAW,CAYnC,CAAC;AACF,eAAe,IAAI,CAAC;AAYpB,eAAO,MAAM,OAAO,EAAE,OAAO,CAAE,OAAO,WAAW,CACd,CAAC;AAMpC,eAAO,MAAM,YAAY,oIAAqC,CAAC;AAM/D;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,CAAE,OAAO,WAAW,CAYxD,CAAC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { Meta } from '@storybook/react';
|
|
6
6
|
import { BorderBoxControl } from '../';
|
|
7
|
-
declare const meta:
|
|
7
|
+
declare const meta: Meta<typeof BorderBoxControl>;
|
|
8
8
|
export default meta;
|
|
9
9
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, Pick<import("../../color-palette/types").ColorPaletteProps, "colors" | "enableAlpha" | "__experimentalIsRenderedInSidebar"> & {
|
|
10
10
|
disableCustomColors?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/border-box-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/border-box-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAYtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,gBAAgB,CAWxC,CAAC;AACF,eAAe,IAAI,CAAC;AAoDpB,eAAO,MAAM,OAAO;;;;;;;2fAAsB,CAAC"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { Meta } from '@storybook/react';
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { BorderControl } from '..';
|
|
10
10
|
import type { Border } from '../types';
|
|
11
|
-
declare const meta:
|
|
11
|
+
declare const meta: Meta<typeof BorderControl>;
|
|
12
12
|
export default meta;
|
|
13
13
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, Pick<import("../../color-palette/types").ColorPaletteProps, "colors" | "enableAlpha" | "__experimentalIsRenderedInSidebar"> & {
|
|
14
14
|
disableCustomColors?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/border-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/border-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAQtD;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,aAAa,CAcrC,CAAC;AACF,eAAe,IAAI,CAAC;AA2DpB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;qkBAAsB,CAAC;AAM3C;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;qkBAAsB,CAAC;AAM9C;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;qkBAAsB,CAAC;AAQzD;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;qkBAAsB,CAAC;AAM7C;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;qkBAAsB,CAAC;AAMvD;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;qkBAAsB,CAAC"}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { StoryFn, Meta } from '@storybook/react';
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { Button } from '../..';
|
|
10
10
|
declare const meta: Meta<typeof Button>;
|
|
11
11
|
export default meta;
|
|
12
|
-
export declare const VariantStates:
|
|
12
|
+
export declare const VariantStates: StoryFn<typeof Button>;
|
|
13
13
|
export declare const Icon: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../../types").ButtonProps & import("react").RefAttributes<any>>;
|
|
14
|
-
export declare const Dashicons:
|
|
14
|
+
export declare const Dashicons: StoryFn<typeof Button>;
|
|
15
15
|
//# sourceMappingURL=index.story.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../../src/button/stories/e2e/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../../src/button/stories/e2e/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,MAAM,CAG9B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,aAAa,EAAE,OAAO,CAAE,OAAO,MAAM,CA2BjD,CAAC;AAKF,eAAO,MAAM,IAAI,uKAA2B,CAAC;AAK7C,eAAO,MAAM,SAAS,EAAE,OAAO,CAAE,OAAO,MAAM,CAgB7C,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
/**
|
|
2
3
|
* External dependencies
|
|
3
4
|
*/
|
|
4
|
-
import type { Meta
|
|
5
|
+
import type { Meta } from '@storybook/react';
|
|
5
6
|
/**
|
|
6
7
|
* Internal dependencies
|
|
7
8
|
*/
|
|
@@ -9,12 +10,12 @@ import './style.css';
|
|
|
9
10
|
import Button from '..';
|
|
10
11
|
declare const meta: Meta<typeof Button>;
|
|
11
12
|
export default meta;
|
|
12
|
-
export declare const Default:
|
|
13
|
-
export declare const Primary:
|
|
14
|
-
export declare const Secondary:
|
|
15
|
-
export declare const Tertiary:
|
|
16
|
-
export declare const Link:
|
|
17
|
-
export declare const IsDestructive:
|
|
18
|
-
export declare const Icon:
|
|
19
|
-
export declare const GroupedIcons:
|
|
13
|
+
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
|
|
14
|
+
export declare const Primary: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
|
|
15
|
+
export declare const Secondary: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
|
|
16
|
+
export declare const Tertiary: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
|
|
17
|
+
export declare const Link: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
|
|
18
|
+
export declare const IsDestructive: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
|
|
19
|
+
export declare const Icon: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
|
|
20
|
+
export declare const GroupedIcons: () => JSX.Element;
|
|
20
21
|
//# sourceMappingURL=index.story.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/button/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/button/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AActD;;GAEG;AACH,OAAO,aAAa,CAAC;AACrB,OAAO,MAAM,MAAM,IAAI,CAAC;AAExB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,MAAM,CAoB9B,CAAC;AACF,eAAe,IAAI,CAAC;AAMpB,eAAO,MAAM,OAAO,oKAAsB,CAAC;AAK3C,eAAO,MAAM,OAAO,oKAAsB,CAAC;AAM3C,eAAO,MAAM,SAAS,oKAAsB,CAAC;AAM7C,eAAO,MAAM,QAAQ,oKAAsB,CAAC;AAM5C,eAAO,MAAM,IAAI,oKAAsB,CAAC;AAMxC,eAAO,MAAM,aAAa,oKAAsB,CAAC;AAMjD,eAAO,MAAM,IAAI,oKAAsB,CAAC;AAMxC,eAAO,MAAM,YAAY,mBAYxB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
8
|
import ButtonGroup from '..';
|
|
9
|
-
declare const meta:
|
|
9
|
+
declare const meta: Meta<typeof ButtonGroup>;
|
|
10
10
|
export default meta;
|
|
11
|
-
export declare const Default:
|
|
11
|
+
export declare const Default: StoryFn<typeof ButtonGroup>;
|
|
12
12
|
//# sourceMappingURL=index.story.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/button-group/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/button-group/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,OAAO,WAAW,MAAM,IAAI,CAAC;AAG7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,WAAW,CAUnC,CAAC;AACF,eAAe,IAAI,CAAC;AAgBpB,eAAO,MAAM,OAAO,EAAE,OAAO,CAAE,OAAO,WAAW,CAAwB,CAAC"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { Meta } from '@storybook/react';
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { Card } from '..';
|
|
10
|
-
declare const meta:
|
|
10
|
+
declare const meta: Meta<typeof Card>;
|
|
11
11
|
export default meta;
|
|
12
12
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../../surface/types").SurfaceProps & {
|
|
13
13
|
size?: import("../types").SizeOptions | "extraSmall" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/card/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/card/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,OAAO,EACN,IAAI,EAMJ,MAAM,IAAI,CAAC;AAKZ,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,IAAI,CAmB5B,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,eAAO,MAAM,OAAO;;;;;;;;;EAAsB,CAAC;AA+B3C;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;EAAsB,CAAC"}
|