@wordpress/components 32.6.0 → 33.0.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 +25 -0
- package/build/autocomplete/get-autocomplete-match.cjs +11 -2
- package/build/autocomplete/get-autocomplete-match.cjs.map +2 -2
- package/build/autocomplete/index.cjs +42 -11
- package/build/autocomplete/index.cjs.map +2 -2
- package/build/external-link/index.cjs +1 -1
- package/build/external-link/index.cjs.map +2 -2
- package/build/form-token-field/index.cjs +22 -6
- package/build/form-token-field/index.cjs.map +3 -3
- package/build/form-token-field/token-input.cjs +1 -1
- package/build/form-token-field/token-input.cjs.map +2 -2
- package/build/menu/popover.cjs +7 -3
- package/build/menu/popover.cjs.map +2 -2
- package/build/menu/styles.cjs +39 -16
- package/build/menu/styles.cjs.map +2 -2
- package/build/navigable-container/container.cjs +72 -110
- package/build/navigable-container/container.cjs.map +2 -2
- package/build/utils/breakpoint.cjs.map +1 -1
- package/build/utils/font.cjs.map +1 -1
- package/build/visually-hidden/component.cjs +1 -0
- package/build/visually-hidden/component.cjs.map +2 -2
- package/build-module/autocomplete/get-autocomplete-match.mjs +11 -2
- package/build-module/autocomplete/get-autocomplete-match.mjs.map +2 -2
- package/build-module/autocomplete/index.mjs +42 -11
- package/build-module/autocomplete/index.mjs.map +2 -2
- package/build-module/external-link/index.mjs +1 -1
- package/build-module/external-link/index.mjs.map +2 -2
- package/build-module/form-token-field/index.mjs +22 -6
- package/build-module/form-token-field/index.mjs.map +2 -2
- package/build-module/form-token-field/token-input.mjs +1 -1
- package/build-module/form-token-field/token-input.mjs.map +2 -2
- package/build-module/menu/popover.mjs +7 -3
- package/build-module/menu/popover.mjs.map +2 -2
- package/build-module/menu/styles.mjs +37 -16
- package/build-module/menu/styles.mjs.map +2 -2
- package/build-module/navigable-container/container.mjs +73 -111
- package/build-module/navigable-container/container.mjs.map +2 -2
- package/build-module/utils/breakpoint.mjs.map +1 -1
- package/build-module/utils/font.mjs.map +1 -1
- package/build-module/visually-hidden/component.mjs +1 -0
- package/build-module/visually-hidden/component.mjs.map +2 -2
- package/build-style/style-rtl.css +26 -2
- package/build-style/style.css +26 -2
- package/build-types/autocomplete/get-autocomplete-match.d.ts +10 -1
- package/build-types/autocomplete/get-autocomplete-match.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/card/stories/index.story.d.ts +0 -6
- package/build-types/card/stories/index.story.d.ts.map +1 -1
- package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
- package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/disabled/stories/index.story.d.ts.map +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/external-link/index.d.ts.map +1 -1
- package/build-types/external-link/stories/index.story.d.ts.map +1 -1
- package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
- package/build-types/form-toggle/stories/index.story.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
- package/build-types/form-token-field/token-input.d.ts.map +1 -1
- package/build-types/form-token-field/types.d.ts +16 -2
- package/build-types/form-token-field/types.d.ts.map +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/popover.d.ts.map +1 -1
- package/build-types/menu/styles.d.ts +16 -1
- package/build-types/menu/styles.d.ts.map +1 -1
- package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- package/build-types/navigable-container/container.d.ts +3 -8
- package/build-types/navigable-container/container.d.ts.map +1 -1
- package/build-types/navigable-container/types.d.ts +1 -5
- package/build-types/navigable-container/types.d.ts.map +1 -1
- package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -1
- package/build-types/navigator/stories/index.story.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts.map +1 -1
- package/build-types/panel/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
- package/build-types/range-control/stories/index.story.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
- package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
- package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
- package/build-types/slot-fill/stories/index.story.d.ts.map +1 -1
- package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
- package/build-types/spinner/stories/index.story.d.ts.map +1 -1
- package/build-types/text-control/stories/index.story.d.ts.map +1 -1
- package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
- package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
- package/build-types/utils/breakpoint.d.ts +2 -1
- package/build-types/utils/breakpoint.d.ts.map +1 -1
- package/build-types/utils/font.d.ts +3 -2
- package/build-types/utils/font.d.ts.map +1 -1
- package/build-types/visually-hidden/component.d.ts.map +1 -1
- package/build-types/visually-hidden/stories/index.story.d.ts +0 -6
- package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/autocomplete/get-autocomplete-match.ts +25 -4
- package/src/autocomplete/index.tsx +69 -21
- package/src/autocomplete/test/get-autocomplete-match.ts +97 -75
- package/src/base-control/stories/index.story.tsx +1 -0
- package/src/button/stories/index.story.tsx +1 -0
- package/src/button-group/style.scss +1 -2
- package/src/card/stories/index.story.tsx +2 -9
- package/src/checkbox-control/stories/index.story.tsx +1 -0
- package/src/circular-option-picker/style.scss +8 -6
- package/src/color-indicator/stories/index.story.tsx +1 -0
- package/src/color-palette/stories/index.story.tsx +1 -0
- package/src/color-picker/stories/index.story.tsx +1 -0
- package/src/combobox-control/stories/index.story.tsx +1 -0
- package/src/composite/stories/index.story.tsx +1 -0
- package/src/confirm-dialog/stories/index.story.tsx +1 -1
- package/src/custom-select-control/stories/index.story.tsx +1 -0
- package/src/disabled/stories/index.story.tsx +1 -0
- package/src/drop-zone/stories/index.story.tsx +1 -0
- package/src/dropdown/stories/index.story.tsx +1 -0
- package/src/external-link/index.tsx +1 -6
- package/src/external-link/stories/index.story.tsx +2 -1
- package/src/external-link/style.scss +30 -2
- package/src/form-file-upload/stories/index.story.tsx +1 -0
- package/src/form-toggle/stories/index.story.tsx +1 -0
- package/src/form-toggle/style.scss +3 -2
- package/src/form-token-field/README.md +2 -1
- package/src/form-token-field/index.tsx +39 -9
- package/src/form-token-field/stories/index.story.tsx +2 -0
- package/src/form-token-field/test/index.tsx +70 -10
- package/src/form-token-field/token-input.tsx +1 -6
- package/src/form-token-field/types.ts +16 -2
- package/src/gradient-picker/stories/index.story.tsx +1 -0
- package/src/icon/stories/index.story.tsx +1 -0
- 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 -0
- package/src/menu/popover.tsx +15 -8
- package/src/menu/styles.ts +26 -16
- package/src/menu/test/index.tsx +24 -34
- package/src/menu-group/stories/index.story.tsx +1 -0
- package/src/menu-item/stories/index.story.tsx +1 -0
- package/src/menu-items-choice/stories/index.story.tsx +1 -0
- package/src/mobile/link-settings/index.native.js +1 -1
- package/src/modal/stories/index.story.tsx +1 -0
- package/src/navigable-container/container.tsx +120 -141
- package/src/navigable-container/test/navigable-menu.tsx +24 -0
- package/src/navigable-container/types.ts +1 -5
- package/src/navigation/stories/utils/more-examples.tsx +2 -1
- package/src/navigator/stories/index.story.tsx +1 -0
- package/src/notice/stories/index.story.tsx +1 -0
- package/src/notice/test/__snapshots__/index.tsx.snap +1 -0
- package/src/number-control/stories/index.story.tsx +1 -1
- package/src/panel/stories/index.story.tsx +1 -0
- package/src/popover/stories/index.story.tsx +1 -0
- package/src/progress-bar/stories/index.story.tsx +1 -0
- package/src/radio-control/stories/index.story.tsx +1 -0
- package/src/range-control/stories/index.story.tsx +1 -0
- package/src/resizable-box/stories/index.story.tsx +1 -0
- package/src/resizable-box/style.scss +4 -5
- package/src/sandbox/stories/index.story.tsx +1 -0
- package/src/scroll-lock/stories/index.story.tsx +1 -0
- package/src/search-control/stories/index.story.tsx +1 -0
- package/src/select-control/stories/index.story.tsx +1 -0
- package/src/shortcut/stories/index.story.tsx +1 -0
- package/src/slot-fill/stories/index.story.tsx +1 -0
- package/src/snackbar/stories/index.story.tsx +1 -0
- package/src/spinner/stories/index.story.tsx +1 -0
- package/src/text-control/stories/index.story.tsx +1 -0
- package/src/text-highlight/stories/index.story.tsx +1 -0
- package/src/textarea-control/stories/index.story.tsx +1 -0
- package/src/toggle-control/stories/index.story.tsx +1 -0
- package/src/toggle-group-control/stories/index.story.tsx +1 -1
- package/src/toolbar/toolbar-group/index.tsx +2 -2
- package/src/tooltip/stories/index.story.tsx +1 -0
- package/src/tooltip/test/index.tsx +3 -2
- package/src/tree-grid/stories/index.story.tsx +1 -1
- package/src/tree-select/stories/index.story.tsx +1 -0
- package/src/truncate/stories/index.story.tsx +1 -1
- package/src/unit-control/stories/index.story.tsx +1 -1
- package/src/utils/breakpoint.js +1 -1
- package/src/utils/font.js +1 -1
- package/src/visually-hidden/component.tsx +1 -0
- package/src/visually-hidden/stories/index.story.tsx +2 -8
- package/build/card/context.cjs +0 -36
- package/build/card/context.cjs.map +0 -7
- package/build-module/card/context.mjs +0 -10
- package/build-module/card/context.mjs.map +0 -7
- package/build-types/card/context.d.ts +0 -3
- package/build-types/card/context.d.ts.map +0 -1
- package/build-types/visually-hidden/test/index.d.ts +0 -2
- package/build-types/visually-hidden/test/index.d.ts.map +0 -1
- package/src/card/context.ts +0 -9
- package/src/visually-hidden/test/__snapshots__/index.tsx.snap +0 -12
- package/src/visually-hidden/test/index.tsx +0 -17
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@use "sass:math";
|
|
2
2
|
@use "@wordpress/base-styles/colors" as *;
|
|
3
3
|
@use "@wordpress/base-styles/variables" as *;
|
|
4
|
-
@use "@wordpress/base-styles/z-index" as *;
|
|
5
4
|
@use "../utils/theme-variables" as *;
|
|
6
5
|
|
|
7
6
|
$resize-handler-size: 15px;
|
|
@@ -15,7 +14,7 @@ $resize-handler-container-size: $resize-handler-size + ($grid-unit-05 * 2); // M
|
|
|
15
14
|
height: $resize-handler-container-size;
|
|
16
15
|
|
|
17
16
|
// Elevate the resize handle above the focus style.
|
|
18
|
-
z-index:
|
|
17
|
+
z-index: 2;
|
|
19
18
|
|
|
20
19
|
// Show the resize handle if set in props
|
|
21
20
|
.components-resizable-box__container.has-show-handle & {
|
|
@@ -26,7 +25,7 @@ $resize-handler-container-size: $resize-handler-size + ($grid-unit-05 * 2); // M
|
|
|
26
25
|
position: relative;
|
|
27
26
|
width: 100%;
|
|
28
27
|
height: 100%;
|
|
29
|
-
z-index:
|
|
28
|
+
z-index: 2;
|
|
30
29
|
outline: none;
|
|
31
30
|
}
|
|
32
31
|
}
|
|
@@ -77,11 +76,11 @@ $resize-handler-container-size: $resize-handler-size + ($grid-unit-05 * 2); // M
|
|
|
77
76
|
|
|
78
77
|
// Show corner handles on top of side handles so they can be used
|
|
79
78
|
.components-resizable-box__side-handle {
|
|
80
|
-
z-index:
|
|
79
|
+
z-index: 2;
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
.components-resizable-box__corner-handle {
|
|
84
|
-
z-index:
|
|
83
|
+
z-index: 2;
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
// Make horizontal side-handles full width
|
|
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import SearchControl from '..';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof SearchControl > = {
|
|
17
|
+
tags: [ 'manifest' ],
|
|
17
18
|
title: 'Components/Selection & Input/Common/SearchControl',
|
|
18
19
|
id: 'components-searchcontrol',
|
|
19
20
|
component: SearchControl,
|
|
@@ -16,6 +16,7 @@ import SelectControl from '../';
|
|
|
16
16
|
import { InputControlPrefixWrapper } from '../../input-control/input-prefix-wrapper';
|
|
17
17
|
|
|
18
18
|
const meta: Meta< typeof SelectControl > = {
|
|
19
|
+
tags: [ 'manifest' ],
|
|
19
20
|
title: 'Components/Selection & Input/Common/SelectControl',
|
|
20
21
|
id: 'components-selectcontrol',
|
|
21
22
|
component: SelectControl,
|
|
@@ -14,6 +14,7 @@ import { createContext, useContext } from '@wordpress/element';
|
|
|
14
14
|
import { Slot, Fill, Provider as SlotFillProvider } from '../';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof Slot > = {
|
|
17
|
+
tags: [ 'manifest' ],
|
|
17
18
|
component: Slot,
|
|
18
19
|
title: 'Components/Utilities/SlotFill',
|
|
19
20
|
id: 'components-slotfill',
|
|
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import TextControl from '..';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof TextControl > = {
|
|
17
|
+
tags: [ 'manifest' ],
|
|
17
18
|
component: TextControl,
|
|
18
19
|
title: 'Components/Selection & Input/Common/TextControl',
|
|
19
20
|
id: 'components-textcontrol',
|
|
@@ -9,6 +9,7 @@ import type { Meta, StoryFn } from '@storybook/react-vite';
|
|
|
9
9
|
import TextHighlight from '..';
|
|
10
10
|
|
|
11
11
|
const meta: Meta< typeof TextHighlight > = {
|
|
12
|
+
tags: [ 'manifest' ],
|
|
12
13
|
component: TextHighlight,
|
|
13
14
|
title: 'Components/Typography/TextHighlight',
|
|
14
15
|
id: 'components-texthighlight',
|
|
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import TextareaControl from '..';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof TextareaControl > = {
|
|
17
|
+
tags: [ 'manifest' ],
|
|
17
18
|
component: TextareaControl,
|
|
18
19
|
title: 'Components/Selection & Input/Common/TextareaControl',
|
|
19
20
|
id: 'components-textareacontrol',
|
|
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import ToggleControl from '..';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof ToggleControl > = {
|
|
17
|
+
tags: [ 'manifest' ],
|
|
17
18
|
title: 'Components/Selection & Input/Common/ToggleControl',
|
|
18
19
|
id: 'components-togglecontrol',
|
|
19
20
|
component: ToggleControl,
|
|
@@ -33,7 +33,7 @@ const meta: Meta< typeof ToggleGroupControl > = {
|
|
|
33
33
|
onChange: { action: 'onChange' },
|
|
34
34
|
value: { control: false },
|
|
35
35
|
},
|
|
36
|
-
tags: [ 'status-experimental' ],
|
|
36
|
+
tags: [ 'status-experimental', 'manifest' ],
|
|
37
37
|
parameters: {
|
|
38
38
|
controls: { expanded: true },
|
|
39
39
|
docs: { canvas: { sourceState: 'shown' } },
|
|
@@ -17,7 +17,7 @@ import ToolbarGroupCollapsed from './toolbar-group-collapsed';
|
|
|
17
17
|
import ToolbarContext from '../toolbar-context';
|
|
18
18
|
import type { ToolbarGroupProps, ToolbarGroupControls } from './types';
|
|
19
19
|
|
|
20
|
-
function isNestedArray< T
|
|
20
|
+
function isNestedArray< T >( arr: T | T[] ): arr is T[] {
|
|
21
21
|
return Array.isArray( arr ) && Array.isArray( arr[ 0 ] );
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -78,7 +78,7 @@ function ToolbarGroup( {
|
|
|
78
78
|
|
|
79
79
|
// Normalize controls to nested array of objects (sets of controls)
|
|
80
80
|
let controlSets: ToolbarGroupControls[][];
|
|
81
|
-
if ( isNestedArray( controls ) ) {
|
|
81
|
+
if ( isNestedArray< ToolbarGroupControls[] >( controls ) ) {
|
|
82
82
|
controlSets = controls;
|
|
83
83
|
} else {
|
|
84
84
|
controlSets = [ controls ];
|
|
@@ -286,7 +286,7 @@ describe( 'Tooltip', () => {
|
|
|
286
286
|
|
|
287
287
|
describe( 'delay', () => {
|
|
288
288
|
it( 'should respect custom delay prop when showing tooltip', async () => {
|
|
289
|
-
const ADDITIONAL_DELAY =
|
|
289
|
+
const ADDITIONAL_DELAY = 500;
|
|
290
290
|
|
|
291
291
|
render(
|
|
292
292
|
<Tooltip
|
|
@@ -304,7 +304,8 @@ describe( 'Tooltip', () => {
|
|
|
304
304
|
await hover( anchor );
|
|
305
305
|
expectTooltipToBeHidden();
|
|
306
306
|
|
|
307
|
-
// Advance time by default delay
|
|
307
|
+
// Advance time by default delay, which is still well before the
|
|
308
|
+
// custom delay even when CI is slow to resolve the hover event.
|
|
308
309
|
await sleep( TOOLTIP_DELAY );
|
|
309
310
|
|
|
310
311
|
// Tooltip hasn't appeared yet
|
|
@@ -14,6 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import TreeSelect from '../';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof TreeSelect > = {
|
|
17
|
+
tags: [ 'manifest' ],
|
|
17
18
|
title: 'Components/Selection & Input/Common/TreeSelect',
|
|
18
19
|
id: 'components-treeselect',
|
|
19
20
|
component: TreeSelect,
|
|
@@ -16,7 +16,7 @@ const meta: Meta< typeof Truncate > = {
|
|
|
16
16
|
children: { control: { type: 'text' } },
|
|
17
17
|
as: { control: { type: 'text' } },
|
|
18
18
|
},
|
|
19
|
-
tags: [ 'status-experimental' ],
|
|
19
|
+
tags: [ 'status-experimental', 'manifest' ],
|
|
20
20
|
parameters: {
|
|
21
21
|
controls: {
|
|
22
22
|
expanded: true,
|
package/src/utils/breakpoint.js
CHANGED
package/src/utils/font.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import type { Meta, StoryFn } from '@storybook/react-vite';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { VisuallyHidden } from '..';
|
|
10
3
|
|
|
11
4
|
const meta: Meta< typeof VisuallyHidden > = {
|
|
@@ -22,8 +15,9 @@ const meta: Meta< typeof VisuallyHidden > = {
|
|
|
22
15
|
},
|
|
23
16
|
docs: { canvas: { sourceState: 'shown' } },
|
|
24
17
|
componentStatus: {
|
|
25
|
-
status: '
|
|
18
|
+
status: 'not-recommended',
|
|
26
19
|
whereUsed: 'global',
|
|
20
|
+
notes: 'Use `VisuallyHidden` from `@wordpress/ui` instead.',
|
|
27
21
|
},
|
|
28
22
|
},
|
|
29
23
|
};
|
package/build/card/context.cjs
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/components/src/card/context.ts
|
|
21
|
-
var context_exports = {};
|
|
22
|
-
__export(context_exports, {
|
|
23
|
-
CardContext: () => CardContext,
|
|
24
|
-
useCardContext: () => useCardContext
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(context_exports);
|
|
27
|
-
var import_element = require("@wordpress/element");
|
|
28
|
-
var CardContext = (0, import_element.createContext)({});
|
|
29
|
-
CardContext.displayName = "CardContext";
|
|
30
|
-
var useCardContext = () => (0, import_element.useContext)(CardContext);
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
CardContext,
|
|
34
|
-
useCardContext
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=context.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/card/context.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\nexport const CardContext = createContext({});\nCardContext.displayName = 'CardContext';\nexport const useCardContext = () => useContext(CardContext);"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0C;AACnC,IAAM,kBAAc,8BAAc,CAAC,CAAC;AAC3C,YAAY,cAAc;AACnB,IAAM,iBAAiB,UAAM,2BAAW,WAAW;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// packages/components/src/card/context.ts
|
|
2
|
-
import { createContext, useContext } from "@wordpress/element";
|
|
3
|
-
var CardContext = createContext({});
|
|
4
|
-
CardContext.displayName = "CardContext";
|
|
5
|
-
var useCardContext = () => useContext(CardContext);
|
|
6
|
-
export {
|
|
7
|
-
CardContext,
|
|
8
|
-
useCardContext
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=context.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/card/context.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\nexport const CardContext = createContext({});\nCardContext.displayName = 'CardContext';\nexport const useCardContext = () => useContext(CardContext);"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,eAAe,kBAAkB;AACnC,IAAM,cAAc,cAAc,CAAC,CAAC;AAC3C,YAAY,cAAc;AACnB,IAAM,iBAAiB,MAAM,WAAW,WAAW;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/card/context.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,6BAAsB,CAAC;AAG/C,eAAO,MAAM,cAAc,UAAkC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/visually-hidden/test/index.tsx"],"names":[],"mappings":""}
|
package/src/card/context.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`VisuallyHidden should render correctly 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
class="components-visually-hidden css-1ragr82-PolymorphicDiv emotion-0"
|
|
6
|
-
data-wp-c16t="true"
|
|
7
|
-
data-wp-component="VisuallyHidden"
|
|
8
|
-
style="border: 0px; clip: rect(1px, 1px, 1px, 1px); clip-path: inset( 50% ); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px; word-wrap: normal; word-break: normal;"
|
|
9
|
-
>
|
|
10
|
-
This is hidden
|
|
11
|
-
</div>
|
|
12
|
-
`;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { render, screen } from '@testing-library/react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { VisuallyHidden } from '..';
|
|
10
|
-
|
|
11
|
-
describe( 'VisuallyHidden', () => {
|
|
12
|
-
it( 'should render correctly', () => {
|
|
13
|
-
const text = 'This is hidden';
|
|
14
|
-
render( <VisuallyHidden>{ text }</VisuallyHidden> );
|
|
15
|
-
expect( screen.getByText( text ) ).toMatchSnapshot();
|
|
16
|
-
} );
|
|
17
|
-
} );
|