@wordpress/components 40.0.0 → 40.1.1-next.v.202609031004.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 +26 -0
- package/build/border-box-control/border-box-control/component.cjs +37 -5
- package/build/border-box-control/border-box-control/component.cjs.map +3 -3
- package/build/border-box-control/border-box-control/hook.cjs +24 -3
- package/build/border-box-control/border-box-control/hook.cjs.map +3 -3
- package/build/border-box-control/border-box-control-linked-button/hook.cjs +2 -2
- package/build/border-box-control/border-box-control-linked-button/hook.cjs.map +2 -2
- package/build/border-box-control/border-box-control-split-controls/hook.cjs +2 -2
- package/build/border-box-control/border-box-control-split-controls/hook.cjs.map +2 -2
- package/build/border-box-control/border-box-control-visualizer/hook.cjs +2 -2
- package/build/border-box-control/border-box-control-visualizer/hook.cjs.map +2 -2
- package/build/color-palette/index.cjs +1 -1
- package/build/color-palette/index.cjs.map +2 -2
- package/build/context/context-system-provider.cjs +2 -5
- package/build/context/context-system-provider.cjs.map +3 -3
- package/build/context/use-context-system.cjs +7 -2
- package/build/context/use-context-system.cjs.map +2 -2
- package/build/icon/index.cjs +30 -12
- package/build/icon/index.cjs.map +2 -2
- package/build/item-group/item/hook.cjs +1 -1
- package/build/item-group/item/hook.cjs.map +2 -2
- package/build/item-group/item-group/hook.cjs +1 -1
- package/build/item-group/item-group/hook.cjs.map +2 -2
- package/build/resizable-box/index.cjs.map +1 -1
- package/build/snackbar/index.cjs +8 -5
- package/build/snackbar/index.cjs.map +2 -2
- package/build/tools-panel/tools-panel/hook.cjs +102 -106
- package/build/tools-panel/tools-panel/hook.cjs.map +2 -2
- package/build/tools-panel/tools-panel-item/hook.cjs +33 -33
- package/build/tools-panel/tools-panel-item/hook.cjs.map +2 -2
- package/build-module/border-box-control/border-box-control/component.mjs +38 -6
- package/build-module/border-box-control/border-box-control/component.mjs.map +2 -2
- package/build-module/border-box-control/border-box-control/hook.mjs +14 -3
- package/build-module/border-box-control/border-box-control/hook.mjs.map +2 -2
- package/build-module/border-box-control/border-box-control-linked-button/hook.mjs +2 -2
- package/build-module/border-box-control/border-box-control-linked-button/hook.mjs.map +2 -2
- package/build-module/border-box-control/border-box-control-split-controls/hook.mjs +2 -2
- package/build-module/border-box-control/border-box-control-split-controls/hook.mjs.map +2 -2
- package/build-module/border-box-control/border-box-control-visualizer/hook.mjs +2 -2
- package/build-module/border-box-control/border-box-control-visualizer/hook.mjs.map +2 -2
- package/build-module/color-palette/index.mjs +1 -1
- package/build-module/color-palette/index.mjs.map +2 -2
- package/build-module/context/context-system-provider.mjs +2 -5
- package/build-module/context/context-system-provider.mjs.map +3 -3
- package/build-module/context/use-context-system.mjs +7 -2
- package/build-module/context/use-context-system.mjs.map +2 -2
- package/build-module/icon/index.mjs +30 -12
- package/build-module/icon/index.mjs.map +2 -2
- package/build-module/item-group/item/hook.mjs +1 -1
- package/build-module/item-group/item/hook.mjs.map +2 -2
- package/build-module/item-group/item-group/hook.mjs +1 -1
- package/build-module/item-group/item-group/hook.mjs.map +2 -2
- package/build-module/resizable-box/index.mjs.map +1 -1
- package/build-module/snackbar/index.mjs +8 -5
- package/build-module/snackbar/index.mjs.map +2 -2
- package/build-module/tools-panel/tools-panel/hook.mjs +103 -107
- package/build-module/tools-panel/tools-panel/hook.mjs.map +2 -2
- package/build-module/tools-panel/tools-panel-item/hook.mjs +35 -35
- package/build-module/tools-panel/tools-panel-item/hook.mjs.map +2 -2
- package/build-style/style-rtl.css +7 -35
- package/build-style/style.css +7 -35
- package/build-types/border-box-control/border-box-control/component.d.ts +4 -0
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +4 -2
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/types.d.ts +6 -2
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/composite/types.d.ts +1 -1
- package/build-types/context/context-system-provider.d.ts +8 -6
- package/build-types/context/context-system-provider.d.ts.map +1 -1
- package/build-types/context/use-context-system.d.ts.map +1 -1
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +6 -2
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/snackbar/index.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +4 -4
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +52 -9
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/package.json +26 -25
- package/src/angle-picker-control/style.module.scss +1 -1
- package/src/autocomplete/test/get-autocomplete-match.ts +2 -1
- package/src/base-control/stories/index.story.tsx +2 -2
- package/src/border-box-control/border-box-control/README.md +5 -3
- package/src/border-box-control/border-box-control/component.tsx +83 -15
- package/src/border-box-control/border-box-control/hook.ts +19 -1
- package/src/border-box-control/stories/index.story.tsx +10 -0
- package/src/border-box-control/style.module.scss +34 -3
- package/src/border-box-control/test/{index.tsx → index.jsdom.test.tsx} +133 -0
- package/src/border-box-control/test/utils.ts +11 -0
- package/src/border-box-control/types.ts +6 -2
- package/src/border-control/test/{index.js → index.jsdom.test.tsx} +20 -13
- package/src/checkbox-control/style.scss +2 -2
- package/src/checkbox-control/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +8 -5
- package/src/color-palette/index.tsx +1 -1
- package/src/composite/README.md +1 -1
- package/src/composite/types.ts +1 -1
- package/src/context/{context-system-provider.js → context-system-provider.tsx} +19 -5
- package/src/context/stories/{ComponentsProvider.stories.jsx → ComponentsProvider.stories.tsx} +2 -2
- package/src/context/test/__snapshots__/{context-system-provider.js.snap → context-system-provider.jsdom.test.tsx.snap} +3 -3
- package/src/context/test/context-connect.tsx +1 -2
- package/src/context/test/{context-system-provider.js → context-system-provider.jsdom.test.tsx} +81 -43
- package/src/context/test/wordpress-component.tsx +1 -2
- package/src/context/use-context-system.js +13 -4
- package/src/custom-gradient-picker/test/serializer.ts +1 -0
- package/src/date-time/test/utils.test.ts +9 -0
- package/src/draggable/style.module.scss +1 -1
- package/src/dropdown/style.module.scss +2 -2
- package/src/font-size-picker/test/utils.ts +1 -0
- package/src/icon/index.tsx +28 -12
- package/src/icon/test/{index.tsx → index.jsdom.test.tsx} +66 -0
- package/src/input-control/test/{index.js → index.jsdom.test.tsx} +16 -10
- package/src/item-group/style.module.scss +1 -2
- package/src/navigator/test/router.ts +1 -0
- package/src/notice/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +5 -2
- package/src/popover/README.md +2 -2
- package/src/popover/test/{index.tsx → index.jsdom.test.tsx} +23 -0
- package/src/popover/types.ts +9 -3
- package/src/query-controls/test/terms.ts +1 -0
- package/src/resizable-box/index.tsx +1 -1
- package/src/slot-fill/test/{index.js → index.jsdom.test.tsx} +3 -3
- package/src/slot-fill/test/{slot.js → slot.jsdom.test.tsx} +17 -9
- package/src/snackbar/index.tsx +10 -6
- package/src/snackbar/test/{index.tsx → index.jsdom.test.tsx} +28 -2
- package/src/snackbar/test/list.jsdom.test.tsx +99 -0
- package/src/surface/style.module.scss +2 -2
- package/src/textarea-control/style.module.scss +1 -1
- package/src/tip/style.scss +1 -1
- package/src/toggle-group-control/toggle-group-control/style.module.scss +1 -1
- package/src/tools-panel/test/{index.tsx → index.jsdom.test.tsx} +528 -9
- package/src/tools-panel/tools-panel/hook.ts +195 -180
- package/src/tools-panel/tools-panel-item/README.md +42 -1
- package/src/tools-panel/tools-panel-item/hook.ts +97 -69
- package/src/tools-panel/types.ts +54 -9
- package/src/truncate/style.module.scss +0 -1
- package/src/unit-control/test/utils.ts +1 -0
- package/src/utils/hooks/test/{use-controlled-state.js → use-controlled-state.jsdom.test.tsx} +17 -3
- package/src/utils/hooks/test/{use-controlled-value.js → use-controlled-value.jsdom.test.tsx} +3 -1
- package/src/utils/hooks/test/{use-cx.js → use-cx.jsdom.test.tsx} +3 -1
- package/src/utils/test/colors.js +1 -0
- package/src/utils/test/{get-node-text.js → get-node-text.tsx} +1 -0
- package/src/utils/test/math.js +1 -0
- package/src/utils/test/rtl.js +1 -0
- package/src/utils/test/space.js +1 -0
- package/src/utils/test/strings.js +1 -0
- package/src/utils/test/unit-values.js +1 -0
- package/src/view/test/{index.js → index.jsdom.test.tsx} +5 -1
- package/src/snackbar/test/list.tsx +0 -39
- /package/src/alignment-matrix-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/autocomplete/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/badge/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/base-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/box-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/button/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/card/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/card/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/checkbox-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/circular-option-picker/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/color-indicator/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/color-indicator/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/color-palette/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/color-palette/test/{utils.ts → utils.jsdom.test.ts} +0 -0
- /package/src/color-picker/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/combobox-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/composite/legacy/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/composite/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/confirm-dialog/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/content-editable-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/custom-gradient-picker/gradient-bar/test/{utils.ts → utils.jsdom.test.ts} +0 -0
- /package/src/custom-gradient-picker/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/custom-select-control/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/custom-select-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/custom-select-control-v2/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/date-time/date-picker/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/date-time/date-picker/test/{use-lilius.ts → use-lilius.jsdom.test.ts} +0 -0
- /package/src/date-time/date-time/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/date-time/time-picker/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/date-time/time-picker/time-input/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/disabled/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/divider/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/dropdown/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/dropdown-menu/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/duotone-picker/test/{custom-duotone-bar.tsx → custom-duotone-bar.jsdom.test.tsx} +0 -0
- /package/src/duotone-picker/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/elevation/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/elevation/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/external-link/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/flex/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/flex/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/focal-point-picker/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/focal-point-picker/test/{media.tsx → media.jsdom.test.tsx} +0 -0
- /package/src/font-size-picker/test/{font-size-picker-select.tsx → font-size-picker-select.jsdom.test.tsx} +0 -0
- /package/src/font-size-picker/test/{font-size-picker-toggle-group.tsx → font-size-picker-toggle-group.jsdom.test.tsx} +0 -0
- /package/src/font-size-picker/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/form-file-upload/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/form-toggle/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/form-toggle/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/form-token-field/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/gradient-picker/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/grid/test/{grid.tsx → grid.jsdom.test.tsx} +0 -0
- /package/src/guide/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/h-stack/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/h-stack/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/heading/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/heading/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/higher-order/with-fallback-styles/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/higher-order/with-filters/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/higher-order/with-filters/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/higher-order/with-focus-outside/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/higher-order/with-focus-return/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/higher-order/with-notices/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/higher-order/with-spoken-messages/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/input-control/test/__snapshots__/{index.js.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/isolated-event-container/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/item-group/test/__snapshots__/{index.js.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/item-group/test/{index.js → index.jsdom.test.tsx} +0 -0
- /package/src/keyboard-shortcuts/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/menu/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/menu-group/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/menu-item/test/__snapshots__/{index.js.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/menu-item/test/{index.js → index.jsdom.test.tsx} +0 -0
- /package/src/modal/test/{aria-helper.ts → aria-helper.jsdom.test.ts} +0 -0
- /package/src/modal/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/navigable-container/test/{navigable-menu.tsx → navigable-menu.jsdom.test.tsx} +0 -0
- /package/src/navigable-container/test/{tababble-container.tsx → tababble-container.jsdom.test.tsx} +0 -0
- /package/src/navigator/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/notice/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/notice/test/{list.tsx → list.jsdom.test.tsx} +0 -0
- /package/src/number-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/palette-edit/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/panel/test/__snapshots__/{body.tsx.snap → body.jsdom.test.tsx.snap} +0 -0
- /package/src/panel/test/__snapshots__/{header.tsx.snap → header.jsdom.test.tsx.snap} +0 -0
- /package/src/panel/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/panel/test/__snapshots__/{row.tsx.snap → row.jsdom.test.tsx.snap} +0 -0
- /package/src/panel/test/{body.tsx → body.jsdom.test.tsx} +0 -0
- /package/src/panel/test/{header.tsx → header.jsdom.test.tsx} +0 -0
- /package/src/panel/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/panel/test/{row.tsx → row.jsdom.test.tsx} +0 -0
- /package/src/placeholder/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/progress-bar/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/radio-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/range-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/resizable-box/resize-tooltip/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/resizable-box/resize-tooltip/test/{label.tsx → label.jsdom.test.tsx} +0 -0
- /package/src/sandbox/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/scroll-lock/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/scrollable/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/search-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/select-control/test/__snapshots__/{select-control.tsx.snap → select-control.jsdom.test.tsx.snap} +0 -0
- /package/src/select-control/test/{select-control.tsx → select-control.jsdom.test.tsx} +0 -0
- /package/src/shortcut/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/shortcut/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/slot-fill/test/__snapshots__/{slot.js.snap → slot.jsdom.test.tsx.snap} +0 -0
- /package/src/spacer/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/spacer/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/style-provider/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/surface/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/tab-panel/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/tabs/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/text/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/text/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/text-control/test/{text-control.tsx → text-control.jsdom.test.tsx} +0 -0
- /package/src/text-highlight/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/toggle-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/toggle-group-control/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/toggle-group-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/toolbar/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/toolbar/test/{toolbar-group.tsx → toolbar-group.jsdom.test.tsx} +0 -0
- /package/src/tooltip/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/tree-grid/test/__snapshots__/{cell.tsx.snap → cell.jsdom.test.tsx.snap} +0 -0
- /package/src/tree-grid/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/tree-grid/test/__snapshots__/{roving-tab-index-item.tsx.snap → roving-tab-index-item.jsdom.test.tsx.snap} +0 -0
- /package/src/tree-grid/test/__snapshots__/{roving-tab-index.tsx.snap → roving-tab-index.jsdom.test.tsx.snap} +0 -0
- /package/src/tree-grid/test/__snapshots__/{row.tsx.snap → row.jsdom.test.tsx.snap} +0 -0
- /package/src/tree-grid/test/{cell.tsx → cell.jsdom.test.tsx} +0 -0
- /package/src/tree-grid/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/tree-grid/test/{roving-tab-index-item.tsx → roving-tab-index-item.jsdom.test.tsx} +0 -0
- /package/src/tree-grid/test/{roving-tab-index.tsx → roving-tab-index.jsdom.test.tsx} +0 -0
- /package/src/tree-grid/test/{row.tsx → row.jsdom.test.tsx} +0 -0
- /package/src/truncate/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/unit-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/utils/test/{polymorphic-element.tsx → polymorphic-element.jsdom.test.tsx} +0 -0
- /package/src/v-stack/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
- /package/src/v-stack/test/{index.tsx → index.jsdom.test.tsx} +0 -0
- /package/src/validated-form-controls/test/{content-editable-control.tsx → content-editable-control.jsdom.test.tsx} +0 -0
- /package/src/validated-form-controls/test/{custom-select-control.tsx → custom-select-control.jsdom.test.tsx} +0 -0
- /package/src/validated-form-controls/test/{input-control.tsx → input-control.jsdom.test.tsx} +0 -0
- /package/src/validated-form-controls/test/{range-control.tsx → range-control.jsdom.test.tsx} +0 -0
- /package/src/validated-form-controls/test/{textarea-control.tsx → textarea-control.jsdom.test.tsx} +0 -0
- /package/src/view/test/__snapshots__/{index.js.snap → index.jsdom.test.tsx.snap} +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { render, screen, within } from '@testing-library/react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
3
4
|
import { Component, createPortal, useState } from '@wordpress/element';
|
|
4
5
|
import { registerStyle } from '@wordpress/style-runtime';
|
|
5
6
|
import { Slot, Fill, Provider, useSlotFills } from '../';
|
|
6
7
|
|
|
7
|
-
function IframePortal( { children } ) {
|
|
8
|
-
const [ iframe, setIframe ] = useState( null );
|
|
8
|
+
function IframePortal( { children }: { children: ReactNode } ) {
|
|
9
|
+
const [ iframe, setIframe ] = useState< HTMLIFrameElement | null >( null );
|
|
9
10
|
const body = iframe?.contentDocument?.body;
|
|
10
11
|
|
|
11
12
|
return (
|
|
@@ -15,9 +16,14 @@ function IframePortal( { children } ) {
|
|
|
15
16
|
);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
type FillerProps = {
|
|
20
|
+
name: string;
|
|
21
|
+
text?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
class Filler extends Component< FillerProps, { num: number } > {
|
|
25
|
+
constructor( props: FillerProps ) {
|
|
26
|
+
super( props );
|
|
21
27
|
|
|
22
28
|
this.state = {
|
|
23
29
|
num: 1,
|
|
@@ -121,7 +127,7 @@ describe( 'Slot', () => {
|
|
|
121
127
|
<div>
|
|
122
128
|
<Slot name="chicken">
|
|
123
129
|
{ ( fills ) =>
|
|
124
|
-
|
|
130
|
+
( fills as ReactNode[] ).length ? (
|
|
125
131
|
<blockquote>{ fills }</blockquote>
|
|
126
132
|
) : null
|
|
127
133
|
}
|
|
@@ -290,7 +296,8 @@ describe( 'Slot', () => {
|
|
|
290
296
|
|
|
291
297
|
describe( 'cross-document styles', () => {
|
|
292
298
|
afterEach( () => {
|
|
293
|
-
delete globalThis
|
|
299
|
+
delete ( globalThis as { __wpStyleRuntime?: unknown } )
|
|
300
|
+
.__wpStyleRuntime;
|
|
294
301
|
document.head.innerHTML = '';
|
|
295
302
|
} );
|
|
296
303
|
|
|
@@ -315,13 +322,14 @@ describe( 'Slot', () => {
|
|
|
315
322
|
</Provider>
|
|
316
323
|
);
|
|
317
324
|
const iframeDocument =
|
|
318
|
-
screen.getByTitle( 'Slot document' )
|
|
325
|
+
screen.getByTitle< HTMLIFrameElement >( 'Slot document' )
|
|
326
|
+
.contentDocument!;
|
|
319
327
|
|
|
320
328
|
const styledElement = within( iframeDocument.body ).getByText(
|
|
321
329
|
'Styled content'
|
|
322
330
|
);
|
|
323
331
|
expect(
|
|
324
|
-
iframeDocument.defaultView
|
|
332
|
+
iframeDocument.defaultView!.getComputedStyle( styledElement )
|
|
325
333
|
.padding
|
|
326
334
|
).toBe( '32px' );
|
|
327
335
|
} );
|
package/src/snackbar/index.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
+
import { useIsPresent } from 'framer-motion';
|
|
3
4
|
import { speak } from '@wordpress/a11y';
|
|
4
5
|
import {
|
|
5
6
|
useEffect,
|
|
@@ -57,6 +58,8 @@ function UnforwardedSnackbar(
|
|
|
57
58
|
}: WordPressComponentProps< SnackbarProps, 'div' >,
|
|
58
59
|
ref: ForwardedRef< any >
|
|
59
60
|
) {
|
|
61
|
+
const isPresent = useIsPresent();
|
|
62
|
+
|
|
60
63
|
function dismissMe( event: KeyboardEvent | MouseEvent ) {
|
|
61
64
|
if ( event && event.preventDefault ) {
|
|
62
65
|
event.preventDefault();
|
|
@@ -92,16 +95,17 @@ function UnforwardedSnackbar(
|
|
|
92
95
|
} );
|
|
93
96
|
|
|
94
97
|
useEffect( () => {
|
|
95
|
-
|
|
98
|
+
if ( explicitDismiss || ! isPresent ) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
96
102
|
const timeoutHandle = setTimeout( () => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
callbacksRef.current.onRemove?.();
|
|
100
|
-
}
|
|
103
|
+
callbacksRef.current.onDismiss?.();
|
|
104
|
+
callbacksRef.current.onRemove?.();
|
|
101
105
|
}, NOTICE_TIMEOUT );
|
|
102
106
|
|
|
103
107
|
return () => clearTimeout( timeoutHandle );
|
|
104
|
-
}, [ explicitDismiss ] );
|
|
108
|
+
}, [ explicitDismiss, isPresent ] );
|
|
105
109
|
|
|
106
110
|
const classes = clsx( className, 'components-snackbar', {
|
|
107
111
|
'components-snackbar-explicit-dismiss': !! explicitDismiss,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { render, screen, within } from '@testing-library/react';
|
|
1
|
+
import { act, fireEvent, render, screen, within } from '@testing-library/react';
|
|
2
2
|
import { click } from '@ariakit/test';
|
|
3
3
|
import { speak } from '@wordpress/a11y';
|
|
4
4
|
import { SVG, Path } from '@wordpress/primitives';
|
|
@@ -14,6 +14,10 @@ describe( 'Snackbar', () => {
|
|
|
14
14
|
mockedSpeak.mockReset();
|
|
15
15
|
} );
|
|
16
16
|
|
|
17
|
+
afterEach( () => {
|
|
18
|
+
jest.useRealTimers();
|
|
19
|
+
} );
|
|
20
|
+
|
|
17
21
|
it( 'should render correctly', () => {
|
|
18
22
|
render( <Snackbar>Message</Snackbar> );
|
|
19
23
|
|
|
@@ -44,6 +48,22 @@ describe( 'Snackbar', () => {
|
|
|
44
48
|
expect( icon ).toBeVisible();
|
|
45
49
|
} );
|
|
46
50
|
|
|
51
|
+
it( 'should not restart auto-dismissal after an unrelated rerender', async () => {
|
|
52
|
+
jest.useFakeTimers();
|
|
53
|
+
const removeNotice = jest.fn();
|
|
54
|
+
const { rerender } = render(
|
|
55
|
+
<Snackbar onRemove={ () => removeNotice() }>Message</Snackbar>
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
await act( async () => jest.advanceTimersByTime( 5000 ) );
|
|
59
|
+
rerender(
|
|
60
|
+
<Snackbar onRemove={ () => removeNotice() }>Message</Snackbar>
|
|
61
|
+
);
|
|
62
|
+
await act( async () => jest.advanceTimersByTime( 1000 ) );
|
|
63
|
+
|
|
64
|
+
expect( removeNotice ).toHaveBeenCalledTimes( 1 );
|
|
65
|
+
} );
|
|
66
|
+
|
|
47
67
|
it( 'should be dismissible by clicking the snackbar', async () => {
|
|
48
68
|
const onRemove = jest.fn();
|
|
49
69
|
const onDismiss = jest.fn();
|
|
@@ -69,6 +89,7 @@ describe( 'Snackbar', () => {
|
|
|
69
89
|
} );
|
|
70
90
|
|
|
71
91
|
it( 'should not be dismissible by clicking the snackbar when the `explicitDismiss` prop is set to `true`', async () => {
|
|
92
|
+
jest.useFakeTimers();
|
|
72
93
|
const onRemove = jest.fn();
|
|
73
94
|
const onDismiss = jest.fn();
|
|
74
95
|
|
|
@@ -93,7 +114,12 @@ describe( 'Snackbar', () => {
|
|
|
93
114
|
'components-snackbar-explicit-dismiss'
|
|
94
115
|
);
|
|
95
116
|
|
|
96
|
-
|
|
117
|
+
fireEvent.click( snackbar );
|
|
118
|
+
|
|
119
|
+
expect( onRemove ).not.toHaveBeenCalled();
|
|
120
|
+
expect( onDismiss ).not.toHaveBeenCalled();
|
|
121
|
+
|
|
122
|
+
await act( async () => jest.advanceTimersByTime( 6000 ) );
|
|
97
123
|
|
|
98
124
|
expect( onRemove ).not.toHaveBeenCalled();
|
|
99
125
|
expect( onDismiss ).not.toHaveBeenCalled();
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { act, render, screen } from '@testing-library/react';
|
|
2
|
+
import { click } from '@ariakit/test';
|
|
3
|
+
import { useEffect, useState } from '@wordpress/element';
|
|
4
|
+
import SnackbarList from '../list';
|
|
5
|
+
|
|
6
|
+
jest.mock( '@wordpress/compose', () => ( {
|
|
7
|
+
...jest.requireActual( '@wordpress/compose' ),
|
|
8
|
+
useReducedMotion: () => false,
|
|
9
|
+
} ) );
|
|
10
|
+
|
|
11
|
+
window.scrollTo = jest.fn();
|
|
12
|
+
|
|
13
|
+
describe( 'SnackbarList', () => {
|
|
14
|
+
afterEach( () => {
|
|
15
|
+
jest.resetAllMocks();
|
|
16
|
+
jest.useRealTimers();
|
|
17
|
+
} );
|
|
18
|
+
|
|
19
|
+
it( 'should get focus after a snackbar is dismissed', async () => {
|
|
20
|
+
render(
|
|
21
|
+
<SnackbarList
|
|
22
|
+
notices={ [
|
|
23
|
+
{
|
|
24
|
+
id: 'ID_1',
|
|
25
|
+
content: 'Post published.',
|
|
26
|
+
explicitDismiss: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'ID_2',
|
|
30
|
+
content: 'Post updated.',
|
|
31
|
+
explicitDismiss: true,
|
|
32
|
+
},
|
|
33
|
+
] }
|
|
34
|
+
onRemove={ () => {} }
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
await click(
|
|
39
|
+
screen.getAllByRole( 'button', {
|
|
40
|
+
name: 'Dismiss this notice',
|
|
41
|
+
} )[ 0 ]
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
expect( screen.getByTestId( 'snackbar-list' ) ).toHaveFocus();
|
|
45
|
+
} );
|
|
46
|
+
|
|
47
|
+
it( 'should restart auto-dismissal when a notice is replaced with the same ID', async () => {
|
|
48
|
+
jest.useFakeTimers();
|
|
49
|
+
const onRemove = jest.fn();
|
|
50
|
+
const notice = {
|
|
51
|
+
id: 'ID_1',
|
|
52
|
+
content: 'A collaborator joined.',
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
function RecreatedNotice() {
|
|
56
|
+
const [ notices, setNotices ] = useState( [ notice ] );
|
|
57
|
+
const [ shouldRecreate, setShouldRecreate ] = useState( false );
|
|
58
|
+
|
|
59
|
+
useEffect( () => {
|
|
60
|
+
if ( ! shouldRecreate ) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const timeoutHandle = setTimeout( () => {
|
|
65
|
+
setNotices( [ { ...notice } ] );
|
|
66
|
+
setShouldRecreate( false );
|
|
67
|
+
}, 50 );
|
|
68
|
+
|
|
69
|
+
return () => clearTimeout( timeoutHandle );
|
|
70
|
+
}, [ shouldRecreate ] );
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<SnackbarList
|
|
74
|
+
notices={ notices }
|
|
75
|
+
onRemove={ ( id ) => {
|
|
76
|
+
onRemove( id );
|
|
77
|
+
setNotices( [] );
|
|
78
|
+
setShouldRecreate( true );
|
|
79
|
+
} }
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
render( <RecreatedNotice /> );
|
|
85
|
+
|
|
86
|
+
await act( async () => jest.advanceTimersByTime( 6000 ) );
|
|
87
|
+
expect( onRemove ).toHaveBeenCalledTimes( 1 );
|
|
88
|
+
|
|
89
|
+
// Recreate the notice before its 100ms exit animation completes.
|
|
90
|
+
await act( async () => jest.advanceTimersByTime( 50 ) );
|
|
91
|
+
|
|
92
|
+
expect( screen.getByTestId( 'snackbar' ) ).toHaveTextContent(
|
|
93
|
+
notice.content
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
await act( async () => jest.advanceTimersByTime( 6000 ) );
|
|
97
|
+
expect( onRemove ).toHaveBeenCalledTimes( 2 );
|
|
98
|
+
} );
|
|
99
|
+
} );
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.border-left {
|
|
12
|
-
/* stylelint-disable-next-line
|
|
12
|
+
/* stylelint-disable-next-line logical-css/require-logical-properties -- Surface exposes physical border props. */
|
|
13
13
|
border-left: var(--wpds-border-width-xs) solid var(--wpds-color-stroke-surface-neutral);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.border-right {
|
|
17
|
-
/* stylelint-disable-next-line
|
|
17
|
+
/* stylelint-disable-next-line logical-css/require-logical-properties -- Surface exposes physical border props. */
|
|
18
18
|
border-right: var(--wpds-border-width-xs) solid var(--wpds-color-stroke-surface-neutral);
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
display: block;
|
|
7
7
|
background: $components-color-background;
|
|
8
8
|
color: $components-color-foreground;
|
|
9
|
-
/* stylelint-disable-next-line
|
|
9
|
+
/* stylelint-disable-next-line logical-css/require-logical-keywords -- Preserve Emotion `resize: vertical`; `block` is not equivalent in vertical writing modes. */
|
|
10
10
|
resize: vertical;
|
|
11
11
|
|
|
12
12
|
@include input-control;
|
package/src/tip/style.scss
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
border-radius: var(--wpds-border-radius-sm);
|
|
32
32
|
top: -1px;
|
|
33
|
-
/* stylelint-disable-next-line
|
|
33
|
+
/* stylelint-disable-next-line logical-css/require-logical-properties -- Preserve the indicator's physical offset. */
|
|
34
34
|
left: -2px;
|
|
35
35
|
width: calc(calc(var(--selected-width, 0) * 1px) + 2px);
|
|
36
36
|
height: calc(calc(var(--selected-height, 0) * 1px) + 2px);
|