@wordpress/components 25.6.0 → 25.6.1
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 +5 -0
- package/CONTRIBUTING.md +1 -1
- package/build/color-palette/utils.js +2 -9
- package/build/color-palette/utils.js.map +1 -1
- package/build/sandbox/index.js +1 -1
- package/build/sandbox/index.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build/snackbar/index.js +1 -1
- package/build/snackbar/index.js.map +1 -1
- package/build/theme/color-algorithms.js +2 -2
- package/build/theme/color-algorithms.js.map +1 -1
- package/build/toolbar/toolbar-item/index.js +1 -1
- package/build/toolbar/toolbar-item/index.js.map +1 -1
- package/build/toolbar/toolbar-item/index.native.js +1 -1
- package/build/toolbar/toolbar-item/index.native.js.map +1 -1
- package/build/ui/context/constants.js +2 -6
- package/build/ui/context/constants.js.map +1 -1
- package/build/ui/context/context-connect.js +1 -1
- package/build/ui/context/context-connect.js.map +1 -1
- package/build/ui/context/context-system-provider.js +1 -1
- package/build/ui/context/context-system-provider.js.map +1 -1
- package/build/ui/context/use-context-system.js +1 -1
- package/build/ui/context/use-context-system.js.map +1 -1
- package/build/utils/math.js +0 -12
- package/build/utils/math.js.map +1 -1
- package/build/utils/values.js +3 -66
- package/build/utils/values.js.map +1 -1
- package/build-module/color-palette/utils.js +0 -6
- package/build-module/color-palette/utils.js.map +1 -1
- package/build-module/sandbox/index.js +1 -1
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build-module/snackbar/index.js +1 -1
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/theme/color-algorithms.js +2 -2
- package/build-module/theme/color-algorithms.js.map +1 -1
- package/build-module/toolbar/toolbar-item/index.js +1 -1
- package/build-module/toolbar/toolbar-item/index.js.map +1 -1
- package/build-module/toolbar/toolbar-item/index.native.js +1 -1
- package/build-module/toolbar/toolbar-item/index.native.js.map +1 -1
- package/build-module/ui/context/constants.js +0 -2
- package/build-module/ui/context/constants.js.map +1 -1
- package/build-module/ui/context/context-connect.js +1 -1
- package/build-module/ui/context/context-connect.js.map +1 -1
- package/build-module/ui/context/context-system-provider.js +1 -1
- package/build-module/ui/context/context-system-provider.js.map +1 -1
- package/build-module/ui/context/use-context-system.js +1 -1
- package/build-module/ui/context/use-context-system.js.map +1 -1
- package/build-module/utils/math.js +0 -11
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/values.js +0 -60
- package/build-module/utils/values.js.map +1 -1
- package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/utils.d.ts +0 -1
- package/build-types/color-palette/utils.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +1 -1
- package/build-types/sandbox/index.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts +0 -14
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/ui/context/constants.d.ts +0 -2
- package/build-types/ui/context/constants.d.ts.map +1 -1
- package/build-types/utils/math.d.ts +0 -8
- package/build-types/utils/math.d.ts.map +1 -1
- package/build-types/utils/values.d.ts +0 -13
- package/build-types/utils/values.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/alignment-matrix-control/stories/index.story.tsx +1 -1
- package/src/alignment-matrix-control/test/index.tsx +6 -2
- package/src/angle-picker-control/stories/index.story.tsx +1 -1
- package/src/animate/stories/index.story.tsx +1 -1
- package/src/base-control/stories/index.story.tsx +1 -1
- package/src/border-box-control/stories/index.story.tsx +1 -1
- package/src/border-control/stories/index.story.tsx +1 -1
- package/src/button/stories/index.story.tsx +1 -1
- package/src/button-group/stories/index.story.tsx +1 -1
- package/src/card/stories/index.story.tsx +1 -1
- package/src/checkbox-control/stories/index.story.tsx +1 -1
- package/src/circular-option-picker/stories/index.story.tsx +4 -1
- package/src/color-indicator/stories/index.story.tsx +1 -1
- package/src/color-palette/stories/index.story.tsx +1 -1
- package/src/color-palette/test/index.tsx +15 -9
- package/src/color-palette/test/utils.ts +0 -15
- package/src/color-palette/utils.ts +0 -7
- package/src/color-picker/stories/index.story.tsx +1 -1
- package/src/combobox-control/stories/index.story.tsx +1 -1
- package/src/confirm-dialog/stories/index.story.js +1 -1
- package/src/custom-gradient-picker/stories/index.story.tsx +1 -1
- package/src/date-time/stories/date-time.story.tsx +1 -1
- package/src/date-time/stories/date.story.tsx +1 -1
- package/src/date-time/stories/time.story.tsx +1 -1
- package/src/dimension-control/stories/index.story.tsx +1 -1
- package/src/disabled/stories/index.story.tsx +1 -1
- package/src/divider/stories/index.story.tsx +1 -1
- package/src/drop-zone/stories/index.story.tsx +1 -1
- package/src/dropdown-menu/stories/index.story.tsx +1 -1
- package/src/dropdown-menu-v2/stories/index.story.tsx +4 -1
- package/src/duotone-picker/stories/duotone-picker.story.tsx +1 -1
- package/src/duotone-picker/stories/duotone-swatch.story.tsx +1 -1
- package/src/elevation/stories/index.story.tsx +1 -1
- package/src/external-link/stories/index.story.tsx +1 -1
- package/src/flex/stories/index.story.tsx +1 -1
- package/src/focal-point-picker/stories/index.story.tsx +1 -1
- package/src/font-size-picker/stories/index.story.tsx +1 -1
- package/src/form-file-upload/stories/index.story.tsx +1 -1
- package/src/form-toggle/stories/index.story.tsx +1 -1
- package/src/form-token-field/stories/index.story.tsx +1 -1
- package/src/gradient-picker/stories/index.story.tsx +1 -1
- package/src/grid/stories/index.story.tsx +1 -1
- package/src/h-stack/stories/index.story.tsx +1 -1
- package/src/heading/stories/index.story.tsx +1 -1
- package/src/icon/stories/index.story.tsx +1 -1
- package/src/input-control/stories/index.story.tsx +1 -1
- package/src/item-group/stories/index.story.tsx +1 -1
- package/src/keyboard-shortcuts/stories/index.story.tsx +1 -1
- package/src/menu-group/stories/index.story.tsx +1 -1
- package/src/menu-items-choice/stories/index.story.tsx +1 -1
- package/src/navigable-container/stories/navigable-menu.story.tsx +1 -1
- package/src/navigable-container/stories/tabbable-container.story.tsx +1 -1
- package/src/navigation/stories/index.story.tsx +1 -1
- package/src/navigator/stories/index.story.tsx +1 -1
- package/src/notice/stories/index.story.tsx +1 -1
- package/src/number-control/stories/index.story.tsx +1 -1
- package/src/palette-edit/stories/index.story.tsx +1 -1
- package/src/panel/stories/index.story.tsx +1 -1
- package/src/placeholder/stories/index.story.tsx +1 -1
- package/src/progress-bar/stories/index.story.tsx +1 -1
- package/src/query-controls/stories/index.story.tsx +1 -1
- package/src/radio-control/stories/index.story.tsx +1 -1
- package/src/range-control/stories/index.story.tsx +1 -1
- package/src/resizable-box/stories/index.story.tsx +1 -1
- package/src/responsive-wrapper/stories/index.story.tsx +1 -1
- package/src/sandbox/index.tsx +4 -1
- package/src/sandbox/stories/index.story.tsx +1 -1
- package/src/scroll-lock/stories/index.story.tsx +1 -1
- package/src/scrollable/stories/index.story.tsx +1 -1
- package/src/search-control/stories/index.story.tsx +1 -1
- package/src/select-control/stories/index.story.tsx +1 -1
- package/src/slot-fill/stories/index.story.js +1 -1
- package/src/snackbar/stories/index.story.tsx +1 -1
- package/src/snackbar/stories/list.story.tsx +1 -1
- package/src/spacer/stories/index.story.tsx +1 -1
- package/src/spinner/stories/index.story.tsx +1 -1
- package/src/surface/stories/index.story.tsx +1 -1
- package/src/tab-panel/stories/index.story.tsx +1 -1
- package/src/text/test/index.tsx +1 -1
- package/src/text-control/stories/index.story.tsx +1 -1
- package/src/text-highlight/stories/index.story.tsx +1 -1
- package/src/textarea-control/stories/index.story.tsx +1 -1
- package/src/theme/stories/index.story.tsx +2 -2
- package/src/tip/stories/index.story.tsx +1 -1
- package/src/toggle-control/stories/index.story.tsx +1 -1
- package/src/toggle-group-control/stories/index.story.tsx +1 -1
- package/src/toolbar/stories/index.story.tsx +1 -1
- package/src/tools-panel/stories/index.story.tsx +1 -1
- package/src/tooltip/stories/index.story.js +1 -1
- package/src/tree-select/stories/index.story.tsx +1 -1
- package/src/truncate/stories/index.story.tsx +1 -1
- package/src/ui/context/constants.js +0 -2
- package/src/unit-control/stories/index.story.tsx +1 -1
- package/src/utils/math.js +0 -11
- package/src/utils/values.js +0 -81
- package/src/v-stack/stories/index.story.tsx +1 -1
- package/src/view/stories/index.story.tsx +1 -1
- package/src/visually-hidden/stories/index.story.tsx +1 -1
- package/src/z-stack/stories/index.story.tsx +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/ui/utils/get-high-dpi.js +0 -16
- package/build/ui/utils/get-high-dpi.js.map +0 -1
- package/build/utils/browsers.js +0 -32
- package/build/utils/browsers.js.map +0 -1
- package/build/utils/events.js +0 -43
- package/build/utils/events.js.map +0 -1
- package/build-module/ui/utils/get-high-dpi.js +0 -11
- package/build-module/ui/utils/get-high-dpi.js.map +0 -1
- package/build-module/utils/browsers.js +0 -25
- package/build-module/utils/browsers.js.map +0 -1
- package/build-module/utils/events.js +0 -37
- package/build-module/utils/events.js.map +0 -1
- package/build-types/alignment-matrix-control/stories/index.d.ts +0 -14
- package/build-types/alignment-matrix-control/stories/index.d.ts.map +0 -1
- package/build-types/angle-picker-control/stories/index.d.ts +0 -15
- package/build-types/angle-picker-control/stories/index.d.ts.map +0 -1
- package/build-types/animate/stories/index.d.ts +0 -18
- package/build-types/animate/stories/index.d.ts.map +0 -1
- package/build-types/base-control/stories/index.d.ts +0 -25
- package/build-types/base-control/stories/index.d.ts.map +0 -1
- package/build-types/border-box-control/stories/index.d.ts +0 -17
- package/build-types/border-box-control/stories/index.d.ts.map +0 -1
- package/build-types/border-control/stories/index.d.ts +0 -119
- package/build-types/border-control/stories/index.d.ts.map +0 -1
- package/build-types/button/stories/e2e/index.d.ts +0 -15
- package/build-types/button/stories/e2e/index.d.ts.map +0 -1
- package/build-types/button/stories/index.d.ts +0 -20
- package/build-types/button/stories/index.d.ts.map +0 -1
- package/build-types/button-group/stories/index.d.ts +0 -12
- package/build-types/button-group/stories/index.d.ts.map +0 -1
- package/build-types/card/stories/index.d.ts +0 -32
- package/build-types/card/stories/index.d.ts.map +0 -1
- package/build-types/checkbox-control/stories/index.d.ts +0 -13
- package/build-types/checkbox-control/stories/index.d.ts.map +0 -1
- package/build-types/circular-option-picker/stories/index.d.ts +0 -14
- package/build-types/circular-option-picker/stories/index.d.ts.map +0 -1
- package/build-types/color-indicator/stories/index.d.ts +0 -12
- package/build-types/color-indicator/stories/index.d.ts.map +0 -1
- package/build-types/color-palette/stories/index.d.ts +0 -46
- package/build-types/color-palette/stories/index.d.ts.map +0 -1
- package/build-types/color-picker/stories/index.d.ts +0 -19
- package/build-types/color-picker/stories/index.d.ts.map +0 -1
- package/build-types/combobox-control/stories/index.d.ts +0 -18
- package/build-types/combobox-control/stories/index.d.ts.map +0 -1
- package/build-types/custom-gradient-picker/stories/index.d.ts +0 -12
- package/build-types/custom-gradient-picker/stories/index.d.ts.map +0 -1
- package/build-types/date-time/stories/date-time.d.ts +0 -14
- package/build-types/date-time/stories/date-time.d.ts.map +0 -1
- package/build-types/date-time/stories/date.d.ts +0 -14
- package/build-types/date-time/stories/date.d.ts.map +0 -1
- package/build-types/date-time/stories/time.d.ts +0 -12
- package/build-types/date-time/stories/time.d.ts.map +0 -1
- package/build-types/dimension-control/stories/index.d.ts +0 -12
- package/build-types/dimension-control/stories/index.d.ts.map +0 -1
- package/build-types/disabled/stories/index.d.ts +0 -13
- package/build-types/disabled/stories/index.d.ts.map +0 -1
- package/build-types/divider/stories/index.d.ts +0 -11
- package/build-types/divider/stories/index.d.ts.map +0 -1
- package/build-types/draggable/stories/index.d.ts +0 -20
- package/build-types/draggable/stories/index.d.ts.map +0 -1
- package/build-types/drop-zone/stories/index.d.ts +0 -12
- package/build-types/drop-zone/stories/index.d.ts.map +0 -1
- package/build-types/dropdown/stories/index.d.ts +0 -23
- package/build-types/dropdown/stories/index.d.ts.map +0 -1
- package/build-types/dropdown-menu/stories/index.d.ts +0 -14
- package/build-types/dropdown-menu/stories/index.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/stories/index.d.ts +0 -11
- package/build-types/dropdown-menu-v2/stories/index.d.ts.map +0 -1
- package/build-types/duotone-picker/stories/duotone-picker.d.ts +0 -12
- package/build-types/duotone-picker/stories/duotone-picker.d.ts.map +0 -1
- package/build-types/duotone-picker/stories/duotone-swatch.d.ts +0 -14
- package/build-types/duotone-picker/stories/duotone-swatch.d.ts.map +0 -1
- package/build-types/elevation/stories/index.d.ts +0 -22
- package/build-types/elevation/stories/index.d.ts.map +0 -1
- package/build-types/external-link/stories/index.d.ts +0 -12
- package/build-types/external-link/stories/index.d.ts.map +0 -1
- package/build-types/flex/stories/index.d.ts +0 -13
- package/build-types/flex/stories/index.d.ts.map +0 -1
- package/build-types/focal-point-picker/stories/index.d.ts +0 -15
- package/build-types/focal-point-picker/stories/index.d.ts.map +0 -1
- package/build-types/font-size-picker/stories/e2e/index.d.ts +0 -16
- package/build-types/font-size-picker/stories/e2e/index.d.ts.map +0 -1
- package/build-types/font-size-picker/stories/index.d.ts +0 -31
- package/build-types/font-size-picker/stories/index.d.ts.map +0 -1
- package/build-types/form-file-upload/stories/index.d.ts +0 -23
- package/build-types/form-file-upload/stories/index.d.ts.map +0 -1
- package/build-types/form-toggle/stories/index.d.ts +0 -12
- package/build-types/form-toggle/stories/index.d.ts.map +0 -1
- package/build-types/form-token-field/stories/index.d.ts +0 -26
- package/build-types/form-token-field/stories/index.d.ts.map +0 -1
- package/build-types/gradient-picker/stories/index.d.ts +0 -14
- package/build-types/gradient-picker/stories/index.d.ts.map +0 -1
- package/build-types/grid/stories/index.d.ts +0 -9
- package/build-types/grid/stories/index.d.ts.map +0 -1
- package/build-types/guide/stories/index.d.ts +0 -9
- package/build-types/guide/stories/index.d.ts.map +0 -1
- package/build-types/h-stack/stories/e2e/index.d.ts +0 -9
- package/build-types/h-stack/stories/e2e/index.d.ts.map +0 -1
- package/build-types/h-stack/stories/index.d.ts +0 -9
- package/build-types/h-stack/stories/index.d.ts.map +0 -1
- package/build-types/heading/stories/index.d.ts +0 -12
- package/build-types/heading/stories/index.d.ts.map +0 -1
- package/build-types/icon/stories/index.d.ts +0 -22
- package/build-types/icon/stories/index.d.ts.map +0 -1
- package/build-types/input-control/stories/index.d.ts +0 -28
- package/build-types/input-control/stories/index.d.ts.map +0 -1
- package/build-types/item-group/stories/index.d.ts +0 -15
- package/build-types/item-group/stories/index.d.ts.map +0 -1
- package/build-types/keyboard-shortcuts/stories/index.d.ts +0 -12
- package/build-types/keyboard-shortcuts/stories/index.d.ts.map +0 -1
- package/build-types/menu-group/stories/index.d.ts +0 -17
- package/build-types/menu-group/stories/index.d.ts.map +0 -1
- package/build-types/menu-items-choice/stories/index.d.ts +0 -12
- package/build-types/menu-items-choice/stories/index.d.ts.map +0 -1
- package/build-types/modal/stories/index.d.ts +0 -10
- package/build-types/modal/stories/index.d.ts.map +0 -1
- package/build-types/navigable-container/stories/navigable-menu.d.ts +0 -12
- package/build-types/navigable-container/stories/navigable-menu.d.ts.map +0 -1
- package/build-types/navigable-container/stories/tabbable-container.d.ts +0 -12
- package/build-types/navigable-container/stories/tabbable-container.d.ts.map +0 -1
- package/build-types/navigation/stories/index.d.ts +0 -18
- package/build-types/navigation/stories/index.d.ts.map +0 -1
- package/build-types/navigator/stories/index.d.ts +0 -11
- package/build-types/navigator/stories/index.d.ts.map +0 -1
- package/build-types/notice/stories/index.d.ts +0 -17
- package/build-types/notice/stories/index.d.ts.map +0 -1
- package/build-types/number-control/stories/index.d.ts +0 -25
- package/build-types/number-control/stories/index.d.ts.map +0 -1
- package/build-types/palette-edit/stories/index.d.ts +0 -13
- package/build-types/palette-edit/stories/index.d.ts.map +0 -1
- package/build-types/panel/stories/index.d.ts +0 -19
- package/build-types/panel/stories/index.d.ts.map +0 -1
- package/build-types/placeholder/stories/index.d.ts +0 -12
- package/build-types/placeholder/stories/index.d.ts.map +0 -1
- package/build-types/popover/stories/e2e/index.d.ts +0 -8
- package/build-types/popover/stories/e2e/index.d.ts.map +0 -1
- package/build-types/popover/stories/index.d.ts +0 -13
- package/build-types/popover/stories/index.d.ts.map +0 -1
- package/build-types/progress-bar/stories/index.d.ts +0 -12
- package/build-types/progress-bar/stories/index.d.ts.map +0 -1
- package/build-types/query-controls/stories/index.d.ts +0 -13
- package/build-types/query-controls/stories/index.d.ts.map +0 -1
- package/build-types/radio-control/stories/index.d.ts +0 -12
- package/build-types/radio-control/stories/index.d.ts.map +0 -1
- package/build-types/range-control/stories/index.d.ts +0 -48
- package/build-types/range-control/stories/index.d.ts.map +0 -1
- package/build-types/resizable-box/stories/index.d.ts +0 -61
- package/build-types/resizable-box/stories/index.d.ts.map +0 -1
- package/build-types/responsive-wrapper/stories/index.d.ts +0 -22
- package/build-types/responsive-wrapper/stories/index.d.ts.map +0 -1
- package/build-types/sandbox/stories/index.d.ts +0 -12
- package/build-types/sandbox/stories/index.d.ts.map +0 -1
- package/build-types/scroll-lock/stories/index.d.ts +0 -9
- package/build-types/scroll-lock/stories/index.d.ts.map +0 -1
- package/build-types/scrollable/stories/index.d.ts +0 -9
- package/build-types/scrollable/stories/index.d.ts.map +0 -1
- package/build-types/search-control/stories/index.d.ts +0 -47
- package/build-types/search-control/stories/index.d.ts.map +0 -1
- package/build-types/select-control/stories/index.d.ts +0 -19
- package/build-types/select-control/stories/index.d.ts.map +0 -1
- package/build-types/snackbar/stories/index.d.ts +0 -16
- package/build-types/snackbar/stories/index.d.ts.map +0 -1
- package/build-types/snackbar/stories/list.d.ts +0 -12
- package/build-types/snackbar/stories/list.d.ts.map +0 -1
- package/build-types/spacer/stories/index.d.ts +0 -12
- package/build-types/spacer/stories/index.d.ts.map +0 -1
- package/build-types/spinner/stories/index.d.ts +0 -13
- package/build-types/spinner/stories/index.d.ts.map +0 -1
- package/build-types/surface/stories/index.d.ts +0 -12
- package/build-types/surface/stories/index.d.ts.map +0 -1
- package/build-types/tab-panel/stories/index.d.ts +0 -16
- package/build-types/tab-panel/stories/index.d.ts.map +0 -1
- package/build-types/text-control/stories/index.d.ts +0 -13
- package/build-types/text-control/stories/index.d.ts.map +0 -1
- package/build-types/text-highlight/stories/index.d.ts +0 -12
- package/build-types/text-highlight/stories/index.d.ts.map +0 -1
- package/build-types/textarea-control/stories/index.d.ts +0 -12
- package/build-types/textarea-control/stories/index.d.ts.map +0 -1
- package/build-types/theme/stories/index.d.ts +0 -17
- package/build-types/theme/stories/index.d.ts.map +0 -1
- package/build-types/tip/stories/index.d.ts +0 -12
- package/build-types/tip/stories/index.d.ts.map +0 -1
- package/build-types/toggle-control/stories/index.d.ts +0 -13
- package/build-types/toggle-control/stories/index.d.ts.map +0 -1
- package/build-types/toggle-group-control/stories/index.d.ts +0 -27
- package/build-types/toggle-group-control/stories/index.d.ts.map +0 -1
- package/build-types/toolbar/stories/index.d.ts +0 -14
- package/build-types/toolbar/stories/index.d.ts.map +0 -1
- package/build-types/tools-panel/stories/index.d.ts +0 -17
- package/build-types/tools-panel/stories/index.d.ts.map +0 -1
- package/build-types/tree-grid/stories/index.d.ts +0 -13
- package/build-types/tree-grid/stories/index.d.ts.map +0 -1
- package/build-types/tree-select/stories/index.d.ts +0 -12
- package/build-types/tree-select/stories/index.d.ts.map +0 -1
- package/build-types/truncate/stories/index.d.ts +0 -13
- package/build-types/truncate/stories/index.d.ts.map +0 -1
- package/build-types/ui/control-group/component.d.ts +0 -27
- package/build-types/ui/control-group/component.d.ts.map +0 -1
- package/build-types/ui/control-group/context.d.ts +0 -4
- package/build-types/ui/control-group/context.d.ts.map +0 -1
- package/build-types/ui/control-group/hook.d.ts +0 -266
- package/build-types/ui/control-group/hook.d.ts.map +0 -1
- package/build-types/ui/control-group/index.d.ts +0 -4
- package/build-types/ui/control-group/index.d.ts.map +0 -1
- package/build-types/ui/control-group/styles.d.ts +0 -8
- package/build-types/ui/control-group/styles.d.ts.map +0 -1
- package/build-types/ui/control-group/types.d.ts +0 -27
- package/build-types/ui/control-group/types.d.ts.map +0 -1
- package/build-types/ui/control-label/component.d.ts +0 -23
- package/build-types/ui/control-label/component.d.ts.map +0 -1
- package/build-types/ui/control-label/hook.d.ts +0 -265
- package/build-types/ui/control-label/hook.d.ts.map +0 -1
- package/build-types/ui/control-label/index.d.ts +0 -3
- package/build-types/ui/control-label/index.d.ts.map +0 -1
- package/build-types/ui/control-label/styles.d.ts +0 -7
- package/build-types/ui/control-label/styles.d.ts.map +0 -1
- package/build-types/ui/control-label/types.d.ts +0 -9
- package/build-types/ui/control-label/types.d.ts.map +0 -1
- package/build-types/ui/form-group/form-group-content.d.ts +0 -7
- package/build-types/ui/form-group/form-group-content.d.ts.map +0 -1
- package/build-types/ui/form-group/form-group-context.d.ts +0 -11
- package/build-types/ui/form-group/form-group-context.d.ts.map +0 -1
- package/build-types/ui/form-group/form-group-help.d.ts +0 -18
- package/build-types/ui/form-group/form-group-help.d.ts.map +0 -1
- package/build-types/ui/form-group/form-group-label.d.ts +0 -8
- package/build-types/ui/form-group/form-group-label.d.ts.map +0 -1
- package/build-types/ui/form-group/form-group-styles.d.ts +0 -2
- package/build-types/ui/form-group/form-group-styles.d.ts.map +0 -1
- package/build-types/ui/form-group/form-group.d.ts +0 -53
- package/build-types/ui/form-group/form-group.d.ts.map +0 -1
- package/build-types/ui/form-group/index.d.ts +0 -4
- package/build-types/ui/form-group/index.d.ts.map +0 -1
- package/build-types/ui/form-group/types.d.ts +0 -30
- package/build-types/ui/form-group/types.d.ts.map +0 -1
- package/build-types/ui/form-group/use-form-group.d.ts +0 -593
- package/build-types/ui/form-group/use-form-group.d.ts.map +0 -1
- package/build-types/ui/index.d.ts +0 -6
- package/build-types/ui/index.d.ts.map +0 -1
- package/build-types/ui/spinner/component.d.ts +0 -13
- package/build-types/ui/spinner/component.d.ts.map +0 -1
- package/build-types/ui/spinner/index.d.ts +0 -2
- package/build-types/ui/spinner/index.d.ts.map +0 -1
- package/build-types/ui/spinner/styles.d.ts +0 -13
- package/build-types/ui/spinner/styles.d.ts.map +0 -1
- package/build-types/ui/spinner/utils.d.ts +0 -3
- package/build-types/ui/spinner/utils.d.ts.map +0 -1
- package/build-types/ui/utils/get-high-dpi.d.ts +0 -3
- package/build-types/ui/utils/get-high-dpi.d.ts.map +0 -1
- package/build-types/unit-control/stories/index.d.ts +0 -33
- package/build-types/unit-control/stories/index.d.ts.map +0 -1
- package/build-types/utils/browsers.d.ts +0 -11
- package/build-types/utils/browsers.d.ts.map +0 -1
- package/build-types/utils/events.d.ts +0 -11
- package/build-types/utils/events.d.ts.map +0 -1
- package/build-types/v-stack/stories/e2e/index.d.ts +0 -9
- package/build-types/v-stack/stories/e2e/index.d.ts.map +0 -1
- package/build-types/v-stack/stories/index.d.ts +0 -13
- package/build-types/v-stack/stories/index.d.ts.map +0 -1
- package/build-types/view/stories/index.d.ts +0 -12
- package/build-types/view/stories/index.d.ts.map +0 -1
- package/build-types/visually-hidden/stories/index.d.ts +0 -14
- package/build-types/visually-hidden/stories/index.d.ts.map +0 -1
- package/build-types/z-stack/stories/index.d.ts +0 -6
- package/build-types/z-stack/stories/index.d.ts.map +0 -1
- package/src/ui/utils/get-high-dpi.ts +0 -20
- package/src/utils/browsers.js +0 -36
- package/src/utils/events.ts +0 -50
- package/src/utils/test/events.js +0 -63
- package/src/utils/test/values.js +0 -101
|
@@ -39,7 +39,7 @@ function useContextSystemBridge({
|
|
|
39
39
|
fastDeepEqual(valueRef.current, value) &&
|
|
40
40
|
// But not the same reference.
|
|
41
41
|
valueRef.current !== value) {
|
|
42
|
-
typeof
|
|
42
|
+
typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warn(`Please memoize your context: ${JSON.stringify(value)}`) : void 0;
|
|
43
43
|
}
|
|
44
44
|
}, [value]);
|
|
45
45
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["deepmerge","fastDeepEqual","isPlainObject","createContext","useContext","useRef","useMemo","memo","warn","useUpdateEffect","ComponentsContext","useComponentsContext","useContextSystemBridge","value","parentContext","valueRef","current","
|
|
1
|
+
{"version":3,"names":["deepmerge","fastDeepEqual","isPlainObject","createContext","useContext","useRef","useMemo","memo","warn","useUpdateEffect","ComponentsContext","useComponentsContext","useContextSystemBridge","value","parentContext","valueRef","current","SCRIPT_DEBUG","JSON","stringify","config","isMergeableObject","BaseContextSystemProvider","children","contextValue","createElement","Provider","ContextSystemProvider"],"sources":["@wordpress/components/src/ui/context/context-system-provider.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseRef,\n\tuseMemo,\n\tmemo,\n} from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useUpdateEffect } from '../../utils';\n\nexport const ComponentsContext = createContext(\n\t/** @type {Record<string, any>} */ ( {} )\n);\nexport const useComponentsContext = () => useContext( ComponentsContext );\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge( { value } ) {\n\tconst parentContext = useComponentsContext();\n\n\tconst valueRef = useRef( value );\n\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\t// Objects are equivalent.\n\t\t\tfastDeepEqual( valueRef.current, value ) &&\n\t\t\t// But not the same reference.\n\t\t\tvalueRef.current !== value\n\t\t) {\n\t\t\twarn( `Please memoize your context: ${ JSON.stringify( value ) }` );\n\t\t}\n\t}, [ value ] );\n\n\t// `parentContext` will always be memoized (i.e., the result of this hook itself)\n\t// or the default value from when the `ComponentsContext` was originally\n\t// initialized (which will never change, it's a static variable)\n\t// so this memoization will prevent `deepmerge()` from rerunning unless\n\t// the references to `value` change OR the `parentContext` has an actual material change\n\t// (because again, it's guaranteed to be memoized or a static reference to the empty object\n\t// so we know that the only changes for `parentContext` are material ones... i.e., why we\n\t// don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n\t// need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n\t// correctly warning when the `value` isn't being properly memoized. All of that to say\n\t// that this should be super safe to assume that `useMemo` will only run on actual\n\t// changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n\tconst config = useMemo( () => {\n\t\t// Deep clone `parentContext` to avoid mutating it later.\n\t\treturn deepmerge( parentContext ?? {}, value ?? {}, {\n\t\t\tisMergeableObject: isPlainObject,\n\t\t} );\n\t}, [ parentContext, value ] );\n\n\treturn config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {import('react').ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ( { children, value } ) => {\n\tconst contextValue = useContextSystemBridge( { value } );\n\n\treturn (\n\t\t<ComponentsContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</ComponentsContext.Provider>\n\t);\n};\n\nexport const ContextSystemProvider = memo( BaseContextSystemProvider );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,WAAW;AACjC,OAAOC,aAAa,MAAM,qBAAqB;AAC/C,SAASC,aAAa,QAAQ,iBAAiB;;AAE/C;AACA;AACA;AACA,SACCC,aAAa,EACbC,UAAU,EACVC,MAAM,EACNC,OAAO,EACPC,IAAI,QACE,oBAAoB;AAC3B,OAAOC,IAAI,MAAM,oBAAoB;;AAErC;AACA;AACA;AACA,SAASC,eAAe,QAAQ,aAAa;AAE7C,OAAO,MAAMC,iBAAiB,GAAGP,aAAa,EAC7C,kCAAqC,CAAC,CACvC,CAAC;AACD,OAAO,MAAMQ,oBAAoB,GAAGA,CAAA,KAAMP,UAAU,CAAEM,iBAAkB,CAAC;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,sBAAsBA,CAAE;EAAEC;AAAM,CAAC,EAAG;EAC5C,MAAMC,aAAa,GAAGH,oBAAoB,CAAC,CAAC;EAE5C,MAAMI,QAAQ,GAAGV,MAAM,CAAEQ,KAAM,CAAC;EAEhCJ,eAAe,CAAE,MAAM;IACtB;IACC;IACAR,aAAa,CAAEc,QAAQ,CAACC,OAAO,EAAEH,KAAM,CAAC;IACxC;IACAE,QAAQ,CAACC,OAAO,KAAKH,KAAK,EACzB;MACD,OAAAI,YAAA,oBAAAA,YAAA,YAAAT,IAAI,CAAG,gCAAgCU,IAAI,CAACC,SAAS,CAAEN,KAAM,CAAG,EAAE,CAAC;IACpE;EACD,CAAC,EAAE,CAAEA,KAAK,CAAG,CAAC;;EAEd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMO,MAAM,GAAGd,OAAO,CAAE,MAAM;IAC7B;IACA,OAAON,SAAS,CAAEc,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAI,CAAC,CAAC,EAAED,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,CAAC,CAAC,EAAE;MACnDQ,iBAAiB,EAAEnB;IACpB,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEY,aAAa,EAAED,KAAK,CAAG,CAAC;EAE7B,OAAOO,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,yBAAyB,GAAGA,CAAE;EAAEC,QAAQ;EAAEV;AAAM,CAAC,KAAM;EAC5D,MAAMW,YAAY,GAAGZ,sBAAsB,CAAE;IAAEC;EAAM,CAAE,CAAC;EAExD,OACCY,aAAA,CAACf,iBAAiB,CAACgB,QAAQ;IAACb,KAAK,EAAGW;EAAc,GAC/CD,QACyB,CAAC;AAE/B,CAAC;AAED,OAAO,MAAMI,qBAAqB,GAAGpB,IAAI,CAAEe,yBAA0B,CAAC"}
|
|
@@ -28,7 +28,7 @@ import { useCx } from '../../utils/hooks/use-cx';
|
|
|
28
28
|
export function useContextSystem(props, namespace) {
|
|
29
29
|
const contextSystemProps = useComponentsContext();
|
|
30
30
|
if (typeof namespace === 'undefined') {
|
|
31
|
-
typeof
|
|
31
|
+
typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warn('useContextSystem: Please provide a namespace') : void 0;
|
|
32
32
|
}
|
|
33
33
|
const contextProps = contextSystemProps?.[namespace] || {};
|
|
34
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["warn","useComponentsContext","getNamespace","getConnectedNamespace","getStyledClassNameFromKey","useCx","useContextSystem","props","namespace","contextSystemProps","
|
|
1
|
+
{"version":3,"names":["warn","useComponentsContext","getNamespace","getConnectedNamespace","getStyledClassNameFromKey","useCx","useContextSystem","props","namespace","contextSystemProps","SCRIPT_DEBUG","contextProps","finalComponentProps","_overrides","overrideProps","otherContextProps","initialMergedProps","Object","entries","length","assign","cx","classes","className","rendered","renderChildren","children","key","undefined"],"sources":["@wordpress/components/src/ui/context/use-context-system.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useComponentsContext } from './context-system-provider';\nimport { getNamespace, getConnectedNamespace } from './utils';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport { useCx } from '../../utils/hooks/use-cx';\n\n/**\n * @template TProps\n * @typedef {TProps & { className: string }} ConnectedProps\n */\n\n/**\n * Custom hook that derives registered props from the Context system.\n * These derived props are then consolidated with incoming component props.\n *\n * @template {{ className?: string }} P\n * @param {P} props Incoming props from the component.\n * @param {string} namespace The namespace to register and to derive context props from.\n * @return {ConnectedProps<P>} The connected props.\n */\nexport function useContextSystem( props, namespace ) {\n\tconst contextSystemProps = useComponentsContext();\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'useContextSystem: Please provide a namespace' );\n\t}\n\n\tconst contextProps = contextSystemProps?.[ namespace ] || {};\n\n\t/* eslint-disable jsdoc/no-undefined-types */\n\t/** @type {ConnectedProps<P>} */\n\t// @ts-ignore We fill in the missing properties below\n\tconst finalComponentProps = {\n\t\t...getConnectedNamespace(),\n\t\t...getNamespace( namespace ),\n\t};\n\t/* eslint-enable jsdoc/no-undefined-types */\n\n\tconst { _overrides: overrideProps, ...otherContextProps } = contextProps;\n\n\tconst initialMergedProps = Object.entries( otherContextProps ).length\n\t\t? Object.assign( {}, otherContextProps, props )\n\t\t: props;\n\n\tconst cx = useCx();\n\n\tconst classes = cx(\n\t\tgetStyledClassNameFromKey( namespace ),\n\t\tprops.className\n\t);\n\n\t// Provides the ability to customize the render of the component.\n\tconst rendered =\n\t\ttypeof initialMergedProps.renderChildren === 'function'\n\t\t\t? initialMergedProps.renderChildren( initialMergedProps )\n\t\t\t: initialMergedProps.children;\n\n\tfor ( const key in initialMergedProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = initialMergedProps[ key ];\n\t}\n\n\tfor ( const key in overrideProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = overrideProps[ key ];\n\t}\n\n\t// Setting an `undefined` explicitly can cause unintended overwrites\n\t// when a `cloneElement()` is involved.\n\tif ( rendered !== undefined ) {\n\t\t// @ts-ignore\n\t\tfinalComponentProps.children = rendered;\n\t}\n\n\tfinalComponentProps.className = classes;\n\n\treturn finalComponentProps;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,oBAAoB;;AAErC;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,YAAY,EAAEC,qBAAqB,QAAQ,SAAS;AAC7D,SAASC,yBAAyB,QAAQ,kCAAkC;AAC5E,SAASC,KAAK,QAAQ,0BAA0B;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,KAAK,EAAEC,SAAS,EAAG;EACpD,MAAMC,kBAAkB,GAAGR,oBAAoB,CAAC,CAAC;EACjD,IAAK,OAAOO,SAAS,KAAK,WAAW,EAAG;IACvC,OAAAE,YAAA,oBAAAA,YAAA,YAAAV,IAAI,CAAE,8CAA+C,CAAC;EACvD;EAEA,MAAMW,YAAY,GAAGF,kBAAkB,GAAID,SAAS,CAAE,IAAI,CAAC,CAAC;;EAE5D;EACA;EACA;EACA,MAAMI,mBAAmB,GAAG;IAC3B,GAAGT,qBAAqB,CAAC,CAAC;IAC1B,GAAGD,YAAY,CAAEM,SAAU;EAC5B,CAAC;EACD;;EAEA,MAAM;IAAEK,UAAU,EAAEC,aAAa;IAAE,GAAGC;EAAkB,CAAC,GAAGJ,YAAY;EAExE,MAAMK,kBAAkB,GAAGC,MAAM,CAACC,OAAO,CAAEH,iBAAkB,CAAC,CAACI,MAAM,GAClEF,MAAM,CAACG,MAAM,CAAE,CAAC,CAAC,EAAEL,iBAAiB,EAAER,KAAM,CAAC,GAC7CA,KAAK;EAER,MAAMc,EAAE,GAAGhB,KAAK,CAAC,CAAC;EAElB,MAAMiB,OAAO,GAAGD,EAAE,CACjBjB,yBAAyB,CAAEI,SAAU,CAAC,EACtCD,KAAK,CAACgB,SACP,CAAC;;EAED;EACA,MAAMC,QAAQ,GACb,OAAOR,kBAAkB,CAACS,cAAc,KAAK,UAAU,GACpDT,kBAAkB,CAACS,cAAc,CAAET,kBAAmB,CAAC,GACvDA,kBAAkB,CAACU,QAAQ;EAE/B,KAAM,MAAMC,GAAG,IAAIX,kBAAkB,EAAG;IACvC;IACAJ,mBAAmB,CAAEe,GAAG,CAAE,GAAGX,kBAAkB,CAAEW,GAAG,CAAE;EACvD;EAEA,KAAM,MAAMA,GAAG,IAAIb,aAAa,EAAG;IAClC;IACAF,mBAAmB,CAAEe,GAAG,CAAE,GAAGb,aAAa,CAAEa,GAAG,CAAE;EAClD;;EAEA;EACA;EACA,IAAKH,QAAQ,KAAKI,SAAS,EAAG;IAC7B;IACAhB,mBAAmB,CAACc,QAAQ,GAAGF,QAAQ;EACxC;EAEAZ,mBAAmB,CAACW,SAAS,GAAGD,OAAO;EAEvC,OAAOV,mBAAmB;AAC3B"}
|
|
@@ -81,15 +81,4 @@ export function roundClamp(value = 0, min = Infinity, max = Infinity, step = 1)
|
|
|
81
81
|
const clampedValue = clamp(rounded, min, max);
|
|
82
82
|
return precision ? getNumber(clampedValue.toFixed(precision)) : clampedValue;
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Clamps a value based on a min/max range with rounding.
|
|
87
|
-
* Returns a string.
|
|
88
|
-
*
|
|
89
|
-
* @param {Parameters<typeof roundClamp>} args Arguments for roundClamp().
|
|
90
|
-
* @return {string} The rounded and clamped value.
|
|
91
|
-
*/
|
|
92
|
-
export function roundClampString(...args) {
|
|
93
|
-
return roundClamp(...args).toString();
|
|
94
|
-
}
|
|
95
84
|
//# sourceMappingURL=math.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getNumber","value","number","Number","isNaN","add","args","reduce","sum","arg","subtract","diff","index","getPrecision","split","undefined","length","clamp","min","max","baseValue","Math","roundClamp","Infinity","step","stepValue","precision","rounded","round","clampedValue","toFixed"
|
|
1
|
+
{"version":3,"names":["getNumber","value","number","Number","isNaN","add","args","reduce","sum","arg","subtract","diff","index","getPrecision","split","undefined","length","clamp","min","max","baseValue","Math","roundClamp","Infinity","step","stepValue","precision","rounded","round","clampedValue","toFixed"],"sources":["@wordpress/components/src/utils/math.js"],"sourcesContent":["/**\n * Parses and retrieves a number value.\n *\n * @param {unknown} value The incoming value.\n *\n * @return {number} The parsed number value.\n */\nexport function getNumber( value ) {\n\tconst number = Number( value );\n\n\treturn isNaN( number ) ? 0 : number;\n}\n\n/**\n * Safely adds 2 values.\n *\n * @param {Array<number|string>} args Values to add together.\n *\n * @return {number} The sum of values.\n */\nexport function add( ...args ) {\n\treturn args.reduce(\n\t\t/** @type {(sum:number, arg: number|string) => number} */\n\t\t( sum, arg ) => sum + getNumber( arg ),\n\t\t0\n\t);\n}\n\n/**\n * Safely subtracts 2 values.\n *\n * @param {Array<number|string>} args Values to subtract together.\n *\n * @return {number} The difference of the values.\n */\nexport function subtract( ...args ) {\n\treturn args.reduce(\n\t\t/** @type {(diff:number, arg: number|string, index:number) => number} */\n\t\t( diff, arg, index ) => {\n\t\t\tconst value = getNumber( arg );\n\t\t\treturn index === 0 ? value : diff - value;\n\t\t},\n\t\t0\n\t);\n}\n\n/**\n * Determines the decimal position of a number value.\n *\n * @param {number} value The number to evaluate.\n *\n * @return {number} The number of decimal places.\n */\nfunction getPrecision( value ) {\n\tconst split = ( value + '' ).split( '.' );\n\treturn split[ 1 ] !== undefined ? split[ 1 ].length : 0;\n}\n\n/**\n * Clamps a value based on a min/max range.\n *\n * @param {number} value The value.\n * @param {number} min The minimum range.\n * @param {number} max The maximum range.\n *\n * @return {number} The clamped value.\n */\nexport function clamp( value, min, max ) {\n\tconst baseValue = getNumber( value );\n\treturn Math.max( min, Math.min( baseValue, max ) );\n}\n\n/**\n * Clamps a value based on a min/max range with rounding\n *\n * @param {number | string} value The value.\n * @param {number} min The minimum range.\n * @param {number} max The maximum range.\n * @param {number} step A multiplier for the value.\n *\n * @return {number} The rounded and clamped value.\n */\nexport function roundClamp(\n\tvalue = 0,\n\tmin = Infinity,\n\tmax = Infinity,\n\tstep = 1\n) {\n\tconst baseValue = getNumber( value );\n\tconst stepValue = getNumber( step );\n\tconst precision = getPrecision( step );\n\tconst rounded = Math.round( baseValue / stepValue ) * stepValue;\n\tconst clampedValue = clamp( rounded, min, max );\n\n\treturn precision\n\t\t? getNumber( clampedValue.toFixed( precision ) )\n\t\t: clampedValue;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,SAASA,CAAEC,KAAK,EAAG;EAClC,MAAMC,MAAM,GAAGC,MAAM,CAAEF,KAAM,CAAC;EAE9B,OAAOG,KAAK,CAAEF,MAAO,CAAC,GAAG,CAAC,GAAGA,MAAM;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,GAAGA,CAAE,GAAGC,IAAI,EAAG;EAC9B,OAAOA,IAAI,CAACC,MAAM,EACjB;EACA,CAAEC,GAAG,EAAEC,GAAG,KAAMD,GAAG,GAAGR,SAAS,CAAES,GAAI,CAAC,EACtC,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAE,GAAGJ,IAAI,EAAG;EACnC,OAAOA,IAAI,CAACC,MAAM,EACjB;EACA,CAAEI,IAAI,EAAEF,GAAG,EAAEG,KAAK,KAAM;IACvB,MAAMX,KAAK,GAAGD,SAAS,CAAES,GAAI,CAAC;IAC9B,OAAOG,KAAK,KAAK,CAAC,GAAGX,KAAK,GAAGU,IAAI,GAAGV,KAAK;EAC1C,CAAC,EACD,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASY,YAAYA,CAAEZ,KAAK,EAAG;EAC9B,MAAMa,KAAK,GAAG,CAAEb,KAAK,GAAG,EAAE,EAAGa,KAAK,CAAE,GAAI,CAAC;EACzC,OAAOA,KAAK,CAAE,CAAC,CAAE,KAAKC,SAAS,GAAGD,KAAK,CAAE,CAAC,CAAE,CAACE,MAAM,GAAG,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,KAAKA,CAAEhB,KAAK,EAAEiB,GAAG,EAAEC,GAAG,EAAG;EACxC,MAAMC,SAAS,GAAGpB,SAAS,CAAEC,KAAM,CAAC;EACpC,OAAOoB,IAAI,CAACF,GAAG,CAAED,GAAG,EAAEG,IAAI,CAACH,GAAG,CAAEE,SAAS,EAAED,GAAI,CAAE,CAAC;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,UAAUA,CACzBrB,KAAK,GAAG,CAAC,EACTiB,GAAG,GAAGK,QAAQ,EACdJ,GAAG,GAAGI,QAAQ,EACdC,IAAI,GAAG,CAAC,EACP;EACD,MAAMJ,SAAS,GAAGpB,SAAS,CAAEC,KAAM,CAAC;EACpC,MAAMwB,SAAS,GAAGzB,SAAS,CAAEwB,IAAK,CAAC;EACnC,MAAME,SAAS,GAAGb,YAAY,CAAEW,IAAK,CAAC;EACtC,MAAMG,OAAO,GAAGN,IAAI,CAACO,KAAK,CAAER,SAAS,GAAGK,SAAU,CAAC,GAAGA,SAAS;EAC/D,MAAMI,YAAY,GAAGZ,KAAK,CAAEU,OAAO,EAAET,GAAG,EAAEC,GAAI,CAAC;EAE/C,OAAOO,SAAS,GACb1B,SAAS,CAAE6B,YAAY,CAACC,OAAO,CAAEJ,SAAU,CAAE,CAAC,GAC9CG,YAAY;AAChB"}
|
|
@@ -39,44 +39,6 @@ export function getDefinedValue(values = [], fallbackValue) {
|
|
|
39
39
|
return (_values$find = values.find(isValueDefined)) !== null && _values$find !== void 0 ? _values$find : fallbackValue;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
* @param {string} [locale]
|
|
44
|
-
* @return {[RegExp, RegExp]} The delimiter and decimal regexp
|
|
45
|
-
*/
|
|
46
|
-
const getDelimiterAndDecimalRegex = locale => {
|
|
47
|
-
const formatted = Intl.NumberFormat(locale).format(1000.1);
|
|
48
|
-
const delimiter = formatted[1];
|
|
49
|
-
const decimal = formatted[formatted.length - 2];
|
|
50
|
-
return [new RegExp(`\\${delimiter}`, 'g'), new RegExp(`\\${decimal}`, 'g')];
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// https://en.wikipedia.org/wiki/Decimal_separator#Current_standards
|
|
54
|
-
const INTERNATIONAL_THOUSANDS_DELIMITER = / /g;
|
|
55
|
-
const ARABIC_NUMERAL_LOCALES = ['ar', 'fa', 'ur', 'ckb', 'ps'];
|
|
56
|
-
const EASTERN_ARABIC_NUMBERS = /([۰-۹]|[٠-٩])/g;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Checks to see if a value is a numeric value (`number` or `string`).
|
|
60
|
-
*
|
|
61
|
-
* Intentionally ignores whether the thousands delimiters are only
|
|
62
|
-
* in the thousands marks.
|
|
63
|
-
*
|
|
64
|
-
* @param {any} value
|
|
65
|
-
* @param {string} [locale]
|
|
66
|
-
* @return {boolean} Whether value is numeric.
|
|
67
|
-
*/
|
|
68
|
-
export function isValueNumeric(value, locale = window.navigator.language) {
|
|
69
|
-
if (ARABIC_NUMERAL_LOCALES.some(l => locale.startsWith(l))) {
|
|
70
|
-
locale = 'en-GB';
|
|
71
|
-
if (EASTERN_ARABIC_NUMBERS.test(value)) {
|
|
72
|
-
value = value.replace(/[٠-٩]/g, ( /** @type {string} */d) => '٠١٢٣٤٥٦٧٨٩'.indexOf(d)).replace(/[۰-۹]/g, ( /** @type {string} */d) => '۰۱۲۳۴۵۶۷۸۹'.indexOf(d)).replace(/٬/g, ',').replace(/٫/g, '.');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
const [delimiterRegexp, decimalRegexp] = getDelimiterAndDecimalRegex(locale);
|
|
76
|
-
const valueToCheck = typeof value === 'string' ? value.replace(delimiterRegexp, '').replace(decimalRegexp, '.').replace(INTERNATIONAL_THOUSANDS_DELIMITER, '') : value;
|
|
77
|
-
return !isNaN(parseFloat(valueToCheck)) && isFinite(valueToCheck);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
42
|
/**
|
|
81
43
|
* Converts a string to a number.
|
|
82
44
|
*
|
|
@@ -87,16 +49,6 @@ export const stringToNumber = value => {
|
|
|
87
49
|
return parseFloat(value);
|
|
88
50
|
};
|
|
89
51
|
|
|
90
|
-
/**
|
|
91
|
-
* Converts a number to a string.
|
|
92
|
-
*
|
|
93
|
-
* @param {number} value
|
|
94
|
-
* @return {string} Number as a string.
|
|
95
|
-
*/
|
|
96
|
-
export const numberToString = value => {
|
|
97
|
-
return `${value}`;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
52
|
/**
|
|
101
53
|
* Regardless of the input being a string or a number, returns a number.
|
|
102
54
|
*
|
|
@@ -108,16 +60,4 @@ export const numberToString = value => {
|
|
|
108
60
|
export const ensureNumber = value => {
|
|
109
61
|
return typeof value === 'string' ? stringToNumber(value) : value;
|
|
110
62
|
};
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Regardless of the input being a string or a number, returns a number.
|
|
114
|
-
*
|
|
115
|
-
* Returns `undefined` in case the string is `undefined` or not a valid numeric value.
|
|
116
|
-
*
|
|
117
|
-
* @param {string | number} value
|
|
118
|
-
* @return {string} The converted string, or `undefined` in case the input is `undefined` or `NaN`.
|
|
119
|
-
*/
|
|
120
|
-
export const ensureString = value => {
|
|
121
|
-
return typeof value === 'string' ? value : numberToString(value);
|
|
122
|
-
};
|
|
123
63
|
//# sourceMappingURL=values.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isValueDefined","value","undefined","isValueEmpty","isEmptyString","getDefinedValue","values","fallbackValue","_values$find","find","
|
|
1
|
+
{"version":3,"names":["isValueDefined","value","undefined","isValueEmpty","isEmptyString","getDefinedValue","values","fallbackValue","_values$find","find","stringToNumber","parseFloat","ensureNumber"],"sources":["@wordpress/components/src/utils/values.js"],"sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * Determines if a value is null or undefined.\n *\n * @template T\n *\n * @param {T} value The value to check.\n * @return {value is Exclude<T, null | undefined>} Whether value is not null or undefined.\n */\nexport function isValueDefined( value ) {\n\treturn value !== undefined && value !== null;\n}\n/* eslint-enable jsdoc/valid-types */\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Determines if a value is empty, null, or undefined.\n *\n * @param {string | number | null | undefined} value The value to check.\n * @return {value is (\"\" | null | undefined)} Whether value is empty.\n */\nexport function isValueEmpty( value ) {\n\tconst isEmptyString = value === '';\n\n\treturn ! isValueDefined( value ) || isEmptyString;\n}\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * Get the first defined/non-null value from an array.\n *\n * @template T\n *\n * @param {Array<T | null | undefined>} values Values to derive from.\n * @param {T} fallbackValue Fallback value if there are no defined values.\n * @return {T} A defined value or the fallback value.\n */\nexport function getDefinedValue( values = [], fallbackValue ) {\n\treturn values.find( isValueDefined ) ?? fallbackValue;\n}\n\n/**\n * Converts a string to a number.\n *\n * @param {string} value\n * @return {number} String as a number.\n */\nexport const stringToNumber = ( value ) => {\n\treturn parseFloat( value );\n};\n\n/**\n * Regardless of the input being a string or a number, returns a number.\n *\n * Returns `undefined` in case the string is `undefined` or not a valid numeric value.\n *\n * @param {string | number} value\n * @return {number} The parsed number.\n */\nexport const ensureNumber = ( value ) => {\n\treturn typeof value === 'string' ? stringToNumber( value ) : value;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,cAAcA,CAAEC,KAAK,EAAG;EACvC,OAAOA,KAAK,KAAKC,SAAS,IAAID,KAAK,KAAK,IAAI;AAC7C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,YAAYA,CAAEF,KAAK,EAAG;EACrC,MAAMG,aAAa,GAAGH,KAAK,KAAK,EAAE;EAElC,OAAO,CAAED,cAAc,CAAEC,KAAM,CAAC,IAAIG,aAAa;AAClD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAEC,MAAM,GAAG,EAAE,EAAEC,aAAa,EAAG;EAAA,IAAAC,YAAA;EAC7D,QAAAA,YAAA,GAAOF,MAAM,CAACG,IAAI,CAAET,cAAe,CAAC,cAAAQ,YAAA,cAAAA,YAAA,GAAID,aAAa;AACtD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,cAAc,GAAKT,KAAK,IAAM;EAC1C,OAAOU,UAAU,CAAEV,KAAM,CAAC;AAC3B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMW,YAAY,GAAKX,KAAK,IAAM;EACxC,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGS,cAAc,CAAET,KAAM,CAAC,GAAGA,KAAK;AACnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/circular-option-picker/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAKtE;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAOrD,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/circular-option-picker/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAKtE;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAOrD,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,oBAAoB,CAiCrD,CAAC;AACF,eAAe,IAAI,CAAC;AAiDpB,eAAO,MAAM,OAAO,6IAAsB,CAAC;AAG3C,eAAO,MAAM,gBAAgB,6IAAsB,CAAC;AAOpD,eAAO,MAAM,sBAAsB,6IAAsB,CAAC"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { ColorObject, ColorPaletteProps, PaletteObject } from './types';
|
|
5
5
|
export declare const extractColorNameFromCurrentValue: (currentValue?: ColorPaletteProps['value'], colors?: ColorPaletteProps['colors'], showMultiplePalettes?: boolean) => string;
|
|
6
|
-
export declare const showTransparentBackground: (currentValue?: string) => boolean;
|
|
7
6
|
export declare const isMultiplePaletteObject: (obj: PaletteObject | ColorObject) => obj is PaletteObject;
|
|
8
7
|
export declare const isMultiplePaletteArray: (arr: (PaletteObject | ColorObject)[]) => arr is PaletteObject[];
|
|
9
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/color-palette/utils.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7E,eAAO,MAAM,gCAAgC,kBAC7B,iBAAiB,CAAE,OAAO,CAAE,WACnC,iBAAiB,CAAE,QAAQ,CAAE,yBACf,OAAO,WA8B7B,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/color-palette/utils.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7E,eAAO,MAAM,gCAAgC,kBAC7B,iBAAiB,CAAE,OAAO,CAAE,WACnC,iBAAiB,CAAE,QAAQ,CAAE,yBACf,OAAO,WA8B7B,CAAC;AAIF,eAAO,MAAM,uBAAuB,QAC9B,aAAa,GAAG,WAAW,yBAEwC,CAAC;AAE1E,eAAO,MAAM,sBAAsB,QAC7B,CAAE,aAAa,GAAG,WAAW,CAAE,EAAE,2BAMtC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,UACxB,MAAM,GAAG,SAAS,WAChB,WAAW,GAAG,IAAI,uBAgB3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/dropdown-menu-v2/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAOpD,OAAO,EACN,YAAY,EAUZ,MAAM,IAAI,CAAC;AAiBZ,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,YAAY,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/dropdown-menu-v2/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAOpD,OAAO,EACN,YAAY,EAUZ,MAAM,IAAI,CAAC;AAiBZ,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,YAAY,CA2BpC,CAAC;AACF,eAAe,IAAI,CAAC;AAiEpB,eAAO,MAAM,OAAO,oOAAsB,CAAC;AAoE3C,eAAO,MAAM,cAAc,EAAE,KAAK,CAAE,OAAO,YAAY,CAItD,CAAC"}
|
|
@@ -259,7 +259,7 @@ export declare function useItem(props: WordPressComponentProps<ItemProps, 'div'>
|
|
|
259
259
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
260
260
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
261
261
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
262
|
-
as: "symbol" | "object" | "
|
|
262
|
+
as: "symbol" | "object" | "map" | "filter" | "clipPath" | "mask" | "marker" | "button" | "meter" | "textarea" | "style" | "progress" | "text" | "ruby" | "table" | "small" | "sub" | "circle" | "embed" | "pre" | "caption" | "menu" | "menuitem" | "big" | "link" | "sup" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "canvas" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "mark" | "meta" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "q" | "rp" | "rt" | "s" | "samp" | "slot" | "script" | "section" | "select" | "source" | "span" | "strong" | "summary" | "template" | "tbody" | "td" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view";
|
|
263
263
|
className: string;
|
|
264
264
|
onClick: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
265
265
|
wrapperClassName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.tsx"],"names":[],"mappings":";AAWA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAoG5C;;;;;;;;;;GAUG;AACH,iBAAS,OAAO,CAAE,EACjB,IAAS,EACT,KAAU,EACV,IAAI,EACJ,MAAW,EACX,OAAY,EACZ,OAAO,GACP,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.tsx"],"names":[],"mappings":";AAWA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAoG5C;;;;;;;;;;GAUG;AACH,iBAAS,OAAO,CAAE,EACjB,IAAS,EACT,KAAU,EACV,IAAI,EACJ,MAAW,EACX,OAAY,EACZ,OAAO,GACP,EAAE,YAAY,eA+Jd;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -14,13 +14,6 @@ export declare const Default: import("@storybook/types").AnnotatedStoryFn<import
|
|
|
14
14
|
onChange: (value: string) => void;
|
|
15
15
|
onClose?: (() => void) | undefined;
|
|
16
16
|
placeholder?: string | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* When an `onClose` callback is provided, the search control will render a close button
|
|
19
|
-
* that will trigger the given callback.
|
|
20
|
-
*
|
|
21
|
-
* Use this if you want the button to trigger your own logic to close the search field entirely,
|
|
22
|
-
* rather than just clearing the input value.
|
|
23
|
-
*/
|
|
24
17
|
value?: string | undefined;
|
|
25
18
|
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "help" | "children" | "label" | "as" | "placeholder" | "onClose" | "hideLabelFromVision" | "__nextHasNoMarginBottom"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
26
19
|
/**
|
|
@@ -35,13 +28,6 @@ export declare const WithOnClose: import("@storybook/types").AnnotatedStoryFn<im
|
|
|
35
28
|
onChange: (value: string) => void;
|
|
36
29
|
onClose?: (() => void) | undefined;
|
|
37
30
|
placeholder?: string | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* When an `onClose` callback is provided, the search control will render a close button
|
|
40
|
-
* that will trigger the given callback.
|
|
41
|
-
*
|
|
42
|
-
* Use this if you want the button to trigger your own logic to close the search field entirely,
|
|
43
|
-
* rather than just clearing the input value.
|
|
44
|
-
*/
|
|
45
31
|
value?: string | undefined;
|
|
46
32
|
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "help" | "children" | "label" | "as" | "placeholder" | "onClose" | "hideLabelFromVision" | "__nextHasNoMarginBottom"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
47
33
|
//# sourceMappingURL=index.story.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/search-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAOtE;;GAEG;AACH,OAAO,aAAa,MAAM,IAAI,CAAC;AAE/B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,aAAa,CAU9C,CAAC;AACF,eAAe,IAAI,CAAC;AAoBpB,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/search-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAOtE;;GAEG;AACH,OAAO,aAAa,MAAM,IAAI,CAAC;AAE/B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,aAAa,CAU9C,CAAC;AACF,eAAe,IAAI,CAAC;AAoBpB,eAAO,MAAM,OAAO;;;;;;+XAAsB,CAAC;AAM3C;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;;;;;+XAAsB,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export const REACT_TYPEOF_KEY: "$$typeof";
|
|
2
1
|
export const COMPONENT_NAMESPACE: "data-wp-component";
|
|
3
2
|
export const CONNECTED_NAMESPACE: "data-wp-c16t";
|
|
4
|
-
export const CONTEXT_COMPONENT_NAMESPACE: "data-wp-c5tc8t";
|
|
5
3
|
/**
|
|
6
4
|
* Special key where the connected namespaces are stored.
|
|
7
5
|
* This is attached to Context connected components as a static property.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/ui/context/constants.js"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/ui/context/constants.js"],"names":[],"mappings":"AAAA,sDAAuD;AACvD,iDAAkD;AAElD;;;GAGG;AACH,8DAA+D"}
|
|
@@ -43,12 +43,4 @@ export function clamp(value: number, min: number, max: number): number;
|
|
|
43
43
|
* @return {number} The rounded and clamped value.
|
|
44
44
|
*/
|
|
45
45
|
export function roundClamp(value?: number | string, min?: number, max?: number, step?: number): number;
|
|
46
|
-
/**
|
|
47
|
-
* Clamps a value based on a min/max range with rounding.
|
|
48
|
-
* Returns a string.
|
|
49
|
-
*
|
|
50
|
-
* @param {Parameters<typeof roundClamp>} args Arguments for roundClamp().
|
|
51
|
-
* @return {string} The rounded and clamped value.
|
|
52
|
-
*/
|
|
53
|
-
export function roundClampString(value?: string | number | undefined, min?: number | undefined, max?: number | undefined, step?: number | undefined): string;
|
|
54
46
|
//# sourceMappingURL=math.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/utils/math.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,iCAJW,OAAO,GAEN,MAAM,CAMjB;AAED;;;;;;GAMG;AACH,6BAJW,MAAM,MAAM,GAAC,MAAM,CAAC,GAEnB,MAAM,CAQjB;AAED;;;;;;GAMG;AACH,kCAJW,MAAM,MAAM,GAAC,MAAM,CAAC,GAEnB,MAAM,CAWjB;AAcD;;;;;;;;GAQG;AACH,6BANW,MAAM,OACN,MAAM,OACN,MAAM,GAEL,MAAM,CAKjB;AAED;;;;;;;;;GASG;AACH,mCAPW,MAAM,GAAG,MAAM,QACf,MAAM,QACN,MAAM,SACN,MAAM,GAEL,MAAM,CAiBjB
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/utils/math.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,iCAJW,OAAO,GAEN,MAAM,CAMjB;AAED;;;;;;GAMG;AACH,6BAJW,MAAM,MAAM,GAAC,MAAM,CAAC,GAEnB,MAAM,CAQjB;AAED;;;;;;GAMG;AACH,kCAJW,MAAM,MAAM,GAAC,MAAM,CAAC,GAEnB,MAAM,CAWjB;AAcD;;;;;;;;GAQG;AACH,6BANW,MAAM,OACN,MAAM,OACN,MAAM,GAEL,MAAM,CAKjB;AAED;;;;;;;;;GASG;AACH,mCAPW,MAAM,GAAG,MAAM,QACf,MAAM,QACN,MAAM,SACN,MAAM,GAEL,MAAM,CAiBjB"}
|
|
@@ -24,19 +24,6 @@ export function isValueEmpty(value: string | number | null | undefined): value i
|
|
|
24
24
|
* @return {T} A defined value or the fallback value.
|
|
25
25
|
*/
|
|
26
26
|
export function getDefinedValue<T>(values: (T | null | undefined)[] | undefined, fallbackValue: T): T;
|
|
27
|
-
/**
|
|
28
|
-
* Checks to see if a value is a numeric value (`number` or `string`).
|
|
29
|
-
*
|
|
30
|
-
* Intentionally ignores whether the thousands delimiters are only
|
|
31
|
-
* in the thousands marks.
|
|
32
|
-
*
|
|
33
|
-
* @param {any} value
|
|
34
|
-
* @param {string} [locale]
|
|
35
|
-
* @return {boolean} Whether value is numeric.
|
|
36
|
-
*/
|
|
37
|
-
export function isValueNumeric(value: any, locale?: string | undefined): boolean;
|
|
38
27
|
export function stringToNumber(value: string): number;
|
|
39
|
-
export function numberToString(value: number): string;
|
|
40
28
|
export function ensureNumber(value: string | number): number;
|
|
41
|
-
export function ensureString(value: string | number): string;
|
|
42
29
|
//# sourceMappingURL=values.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/utils/values.js"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,mFAEC;AAID;;;;;GAKG;AACH,oCAHW,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,kCAO5C;AAGD;;;;;;;;GAQG;AACH,sGAEC;
|
|
1
|
+
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/utils/values.js"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,mFAEC;AAID;;;;;GAKG;AACH,oCAHW,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,kCAO5C;AAGD;;;;;;;;GAQG;AACH,sGAEC;AAQM,sCAHI,MAAM,GACL,MAAM,CAIjB;AAUM,oCAHI,MAAM,GAAG,MAAM,GACd,MAAM,CAIjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "25.6.
|
|
3
|
+
"version": "25.6.1",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
"@floating-ui/react-dom": "1.0.0",
|
|
42
42
|
"@radix-ui/react-dropdown-menu": "2.0.4",
|
|
43
43
|
"@use-gesture/react": "^10.2.24",
|
|
44
|
-
"@wordpress/a11y": "^3.40.
|
|
45
|
-
"@wordpress/compose": "^6.17.
|
|
46
|
-
"@wordpress/date": "^4.40.
|
|
47
|
-
"@wordpress/deprecated": "^3.40.
|
|
48
|
-
"@wordpress/dom": "^3.40.
|
|
49
|
-
"@wordpress/element": "^5.17.
|
|
50
|
-
"@wordpress/escape-html": "^2.40.
|
|
51
|
-
"@wordpress/hooks": "^3.40.
|
|
52
|
-
"@wordpress/html-entities": "^3.40.
|
|
53
|
-
"@wordpress/i18n": "^4.40.
|
|
54
|
-
"@wordpress/icons": "^9.31.
|
|
55
|
-
"@wordpress/is-shallow-equal": "^4.40.
|
|
56
|
-
"@wordpress/keycodes": "^3.40.
|
|
57
|
-
"@wordpress/primitives": "^3.38.
|
|
58
|
-
"@wordpress/private-apis": "^0.22.
|
|
59
|
-
"@wordpress/rich-text": "^6.17.
|
|
60
|
-
"@wordpress/warning": "^2.40.
|
|
44
|
+
"@wordpress/a11y": "^3.40.1",
|
|
45
|
+
"@wordpress/compose": "^6.17.1",
|
|
46
|
+
"@wordpress/date": "^4.40.1",
|
|
47
|
+
"@wordpress/deprecated": "^3.40.1",
|
|
48
|
+
"@wordpress/dom": "^3.40.1",
|
|
49
|
+
"@wordpress/element": "^5.17.1",
|
|
50
|
+
"@wordpress/escape-html": "^2.40.1",
|
|
51
|
+
"@wordpress/hooks": "^3.40.1",
|
|
52
|
+
"@wordpress/html-entities": "^3.40.1",
|
|
53
|
+
"@wordpress/i18n": "^4.40.1",
|
|
54
|
+
"@wordpress/icons": "^9.31.1",
|
|
55
|
+
"@wordpress/is-shallow-equal": "^4.40.1",
|
|
56
|
+
"@wordpress/keycodes": "^3.40.1",
|
|
57
|
+
"@wordpress/primitives": "^3.38.1",
|
|
58
|
+
"@wordpress/private-apis": "^0.22.1",
|
|
59
|
+
"@wordpress/rich-text": "^6.17.1",
|
|
60
|
+
"@wordpress/warning": "^2.40.1",
|
|
61
61
|
"change-case": "^4.1.2",
|
|
62
62
|
"classnames": "^2.3.1",
|
|
63
63
|
"colord": "^2.7.0",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "bb1fbf87bb0f451744530fc6a85de2dff1263bed"
|
|
91
91
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { render, screen, within } from '@testing-library/react';
|
|
5
|
+
import userEvent from '@testing-library/user-event';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
@@ -27,6 +28,7 @@ describe( 'AlignmentMatrixControl', () => {
|
|
|
27
28
|
|
|
28
29
|
describe( 'Change value', () => {
|
|
29
30
|
const alignments = [ 'center left', 'center center', 'bottom center' ];
|
|
31
|
+
const user = userEvent.setup();
|
|
30
32
|
|
|
31
33
|
it.each( alignments )(
|
|
32
34
|
'should change value on %s cell click',
|
|
@@ -37,7 +39,9 @@ describe( 'AlignmentMatrixControl', () => {
|
|
|
37
39
|
<AlignmentMatrixControl value="center" onChange={ spy } />
|
|
38
40
|
);
|
|
39
41
|
|
|
40
|
-
await
|
|
42
|
+
await user.click( getCell( alignment ) );
|
|
43
|
+
|
|
44
|
+
expect( getCell( alignment ) ).toHaveFocus();
|
|
41
45
|
|
|
42
46
|
expect( spy ).toHaveBeenCalledWith( alignment );
|
|
43
47
|
}
|
|
@@ -27,7 +27,10 @@ const meta: ComponentMeta< typeof CircularOptionPicker > = {
|
|
|
27
27
|
parameters: {
|
|
28
28
|
actions: { argTypesRegex: '^on.*' },
|
|
29
29
|
controls: { expanded: true },
|
|
30
|
-
docs: {
|
|
30
|
+
docs: {
|
|
31
|
+
canvas: { sourceState: 'shown' },
|
|
32
|
+
source: { excludeDecorators: true },
|
|
33
|
+
},
|
|
31
34
|
},
|
|
32
35
|
decorators: [
|
|
33
36
|
// Share current color state between main component, `actions` and `options`
|