@wordpress/components 21.2.0 → 21.3.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 +35 -3
- package/CONTRIBUTING.md +20 -0
- package/build/border-box-control/border-box-control/component.js +2 -0
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js +4 -1
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-control/border-control/component.js +2 -0
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/disabled/index.js +6 -26
- package/build/disabled/index.js.map +1 -1
- package/build/font-size-picker/index.js +1 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/styles.js +5 -13
- package/build/font-size-picker/styles.js.map +1 -1
- package/build/font-size-picker/utils.js +1 -1
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +5 -5
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/higher-order/with-fallback-styles/index.js +1 -1
- package/build/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build/index.js +8 -6
- package/build/index.js.map +1 -1
- package/build/modal/aria-helper.js +2 -3
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +42 -11
- package/build/modal/index.js.map +1 -1
- package/build/modal/types.js +6 -0
- package/build/modal/types.js.map +1 -0
- package/build/navigator/index.js +8 -8
- package/build/navigator/index.js.map +1 -1
- package/build/navigator/navigator-back-button/component.js +5 -4
- package/build/navigator/navigator-back-button/component.js.map +1 -1
- package/build/navigator/navigator-back-button/index.js +1 -1
- package/build/navigator/navigator-back-button/index.js.map +1 -1
- package/build/navigator/navigator-button/component.js +5 -4
- package/build/navigator/navigator-button/component.js.map +1 -1
- package/build/navigator/navigator-button/index.js +1 -1
- package/build/navigator/navigator-button/index.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +10 -7
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-provider/index.js +1 -1
- package/build/navigator/navigator-provider/index.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +24 -27
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/navigator-screen/index.js +1 -1
- package/build/navigator/navigator-screen/index.js.map +1 -1
- package/build/sandbox/index.js +55 -59
- package/build/sandbox/index.js.map +1 -1
- package/build/sandbox/index.native.js +63 -62
- package/build/sandbox/index.native.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/tab-panel/index.js +4 -4
- package/build/tab-panel/index.js.map +1 -1
- package/build/theme/index.js +62 -0
- package/build/theme/index.js.map +1 -0
- package/build/theme/styles.js +33 -0
- package/build/theme/styles.js.map +1 -0
- package/build/theme/types.js +6 -0
- package/build/theme/types.js.map +1 -0
- package/build/tools-panel/tools-panel/hook.js +3 -3
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +6 -6
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tooltip/index.js +4 -1
- package/build/tooltip/index.js.map +1 -1
- package/build/tooltip/index.native.js +17 -4
- package/build/tooltip/index.native.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +2 -0
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control/hook.js +4 -1
- package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
- package/build-module/border-control/border-control/component.js +2 -0
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/disabled/index.js +7 -26
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/font-size-picker/index.js +1 -1
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/styles.js +5 -13
- package/build-module/font-size-picker/styles.js.map +1 -1
- package/build-module/font-size-picker/utils.js +1 -1
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +5 -5
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.js +2 -2
- package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build-module/index.js +2 -1
- package/build-module/index.js.map +1 -1
- package/build-module/modal/aria-helper.js +2 -3
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +44 -12
- package/build-module/modal/index.js.map +1 -1
- package/build-module/modal/types.js +2 -0
- package/build-module/modal/types.js.map +1 -0
- package/build-module/navigator/index.js +4 -4
- package/build-module/navigator/index.js.map +1 -1
- package/build-module/navigator/navigator-back-button/component.js +3 -3
- package/build-module/navigator/navigator-back-button/component.js.map +1 -1
- package/build-module/navigator/navigator-back-button/index.js +1 -1
- package/build-module/navigator/navigator-back-button/index.js.map +1 -1
- package/build-module/navigator/navigator-button/component.js +3 -3
- package/build-module/navigator/navigator-button/component.js.map +1 -1
- package/build-module/navigator/navigator-button/index.js +1 -1
- package/build-module/navigator/navigator-button/index.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +8 -6
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-provider/index.js +1 -1
- package/build-module/navigator/navigator-provider/index.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +12 -26
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/index.js +1 -1
- package/build-module/navigator/navigator-screen/index.js.map +1 -1
- package/build-module/sandbox/index.js +56 -59
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/index.native.js +54 -52
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/tab-panel/index.js +4 -4
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/theme/index.js +52 -0
- package/build-module/theme/index.js.map +1 -0
- package/build-module/theme/styles.js +25 -0
- package/build-module/theme/styles.js.map +1 -0
- package/build-module/theme/types.js +2 -0
- package/build-module/theme/types.js.map +1 -0
- package/build-module/tools-panel/tools-panel/hook.js +3 -3
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +6 -6
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tooltip/index.js +4 -1
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tooltip/index.native.js +17 -4
- package/build-module/tooltip/index.native.js.map +1 -1
- package/build-style/style-rtl.css +26 -22
- package/build-style/style.css +26 -22
- 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 +1 -0
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +1 -0
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +1 -0
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/stories/index.d.ts +6 -0
- package/build-types/border-control/stories/index.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +4 -0
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/confirm-dialog/types.d.ts +5 -1
- package/build-types/confirm-dialog/types.d.ts.map +1 -1
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts.map +1 -1
- package/build-types/modal/aria-helper.d.ts +4 -4
- package/build-types/modal/aria-helper.d.ts.map +1 -1
- package/build-types/modal/index.d.ts +35 -2
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/modal/stories/index.d.ts +9 -0
- package/build-types/modal/stories/index.d.ts.map +1 -0
- package/build-types/modal/test/aria-helper.d.ts +2 -0
- package/build-types/modal/test/aria-helper.d.ts.map +1 -0
- package/build-types/modal/test/index.d.ts +2 -0
- package/build-types/modal/test/index.d.ts.map +1 -0
- package/build-types/modal/types.d.ts +134 -0
- package/build-types/modal/types.d.ts.map +1 -0
- package/build-types/navigator/index.d.ts +4 -4
- package/build-types/navigator/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +4 -2
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +1 -0
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/index.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +4 -2
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +1 -0
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/index.d.ts +1 -1
- package/build-types/navigator/navigator-button/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts +2 -2
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/index.d.ts +1 -1
- package/build-types/navigator/navigator-provider/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +2 -2
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/index.d.ts +1 -1
- package/build-types/navigator/navigator-screen/index.d.ts.map +1 -1
- package/build-types/navigator/stories/index.d.ts +9 -0
- package/build-types/navigator/stories/index.d.ts.map +1 -0
- package/build-types/navigator/test/index.d.ts +2 -0
- package/build-types/navigator/test/index.d.ts.map +1 -0
- package/build-types/navigator/types.d.ts +4 -1
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/theme/index.d.ts +31 -0
- package/build-types/theme/index.d.ts.map +1 -0
- package/build-types/theme/stories/index.d.ts +13 -0
- package/build-types/theme/stories/index.d.ts.map +1 -0
- package/build-types/theme/styles.d.ts +10 -0
- package/build-types/theme/styles.d.ts.map +1 -0
- package/build-types/theme/test/index.d.ts +2 -0
- package/build-types/theme/test/index.d.ts.map +1 -0
- package/build-types/theme/types.d.ts +21 -0
- package/build-types/theme/types.d.ts.map +1 -0
- 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/tooltip/index.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/base-field/test/index.js +4 -6
- package/src/border-box-control/border-box-control/component.tsx +2 -0
- package/src/border-box-control/border-box-control/hook.ts +4 -0
- package/src/border-box-control/test/index.js +7 -2
- package/src/border-control/border-control/README.md +6 -0
- package/src/border-control/border-control/component.tsx +2 -0
- package/src/border-control/types.ts +4 -0
- package/src/button/style.scss +25 -25
- package/src/button/test/index.js +3 -5
- package/src/combobox-control/test/index.js +1 -1
- package/src/confirm-dialog/types.ts +6 -0
- package/src/date-time/time/test/index.tsx +2 -6
- package/src/disabled/index.tsx +11 -33
- package/src/disabled/test/index.tsx +14 -82
- package/src/dropdown/test/index.js +4 -3
- package/src/font-size-picker/index.tsx +1 -1
- package/src/font-size-picker/styles.ts +3 -1
- package/src/font-size-picker/test/index.tsx +2 -2
- package/src/font-size-picker/test/utils.ts +5 -5
- package/src/font-size-picker/utils.ts +1 -1
- package/src/form-file-upload/test/index.tsx +1 -1
- package/src/form-token-field/suggestions-list.tsx +5 -5
- package/src/higher-order/with-fallback-styles/index.js +6 -2
- package/src/higher-order/with-focus-outside/test/index.js +44 -45
- package/src/higher-order/with-focus-return/test/index.js +34 -30
- package/src/higher-order/with-notices/test/index.js +1 -1
- package/src/index.js +2 -1
- package/src/input-control/test/index.js +2 -2
- package/src/item-group/test/index.js +2 -2
- package/src/menu-item/test/index.js +0 -3
- package/src/mobile/bottom-sheet/test/range-cell.native.js +16 -14
- package/src/modal/README.md +53 -54
- package/src/modal/{aria-helper.js → aria-helper.ts} +5 -7
- package/src/modal/{index.js → index.tsx} +48 -12
- package/src/modal/stories/{index.js → index.tsx} +47 -42
- package/src/modal/test/{aria-helper.js → aria-helper.ts} +0 -0
- package/src/modal/test/{index.js → index.tsx} +13 -3
- package/src/modal/types.ts +144 -0
- package/src/navigation/test/index.js +1 -1
- package/src/navigator/index.ts +4 -4
- package/src/navigator/navigator-back-button/component.tsx +4 -4
- package/src/navigator/navigator-back-button/index.ts +1 -1
- package/src/navigator/navigator-button/component.tsx +4 -4
- package/src/navigator/navigator-button/index.ts +1 -1
- package/src/navigator/navigator-provider/component.tsx +6 -4
- package/src/navigator/navigator-provider/index.ts +1 -1
- package/src/navigator/navigator-screen/component.tsx +20 -26
- package/src/navigator/navigator-screen/index.ts +1 -1
- package/src/navigator/stories/index.tsx +210 -0
- package/src/navigator/test/index.tsx +509 -0
- package/src/navigator/types.ts +2 -0
- package/src/notice/test/__snapshots__/index.js.snap +39 -38
- package/src/notice/test/index.js +15 -36
- package/src/notice/test/list.js +6 -14
- package/src/number-control/test/index.js +3 -2
- package/src/panel/test/body.js +2 -2
- package/src/placeholder/style.scss +5 -0
- package/src/sandbox/index.js +62 -47
- package/src/sandbox/index.native.js +72 -52
- package/src/sandbox/test/index.js +7 -10
- package/src/shortcut/test/index.tsx +1 -1
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +5 -3
- package/src/style.scss +4 -0
- package/src/tab-panel/index.tsx +4 -7
- package/src/text-highlight/test/index.tsx +1 -3
- package/src/theme/README.md +34 -0
- package/src/theme/index.tsx +51 -0
- package/src/theme/stories/index.tsx +47 -0
- package/src/theme/styles.ts +28 -0
- package/src/theme/test/index.tsx +101 -0
- package/src/theme/types.ts +21 -0
- package/src/toolbar/test/index.js +2 -2
- package/src/toolbar-group/test/index.js +6 -10
- package/src/tools-panel/test/index.js +4 -6
- package/src/tools-panel/tools-panel/hook.ts +2 -9
- package/src/tools-panel/tools-panel-item/hook.ts +17 -3
- package/src/tooltip/index.js +3 -0
- package/src/tooltip/index.native.js +15 -0
- package/src/tooltip/test/index.native.js +1 -2
- package/src/tree-grid/test/__snapshots__/cell.js.snap +1 -3
- package/src/tree-grid/test/__snapshots__/roving-tab-index-item.js.snap +17 -15
- package/src/tree-grid/test/__snapshots__/row.js.snap +25 -21
- package/src/tree-grid/test/cell.js +4 -4
- package/src/tree-grid/test/roving-tab-index-item.js +8 -8
- package/src/tree-grid/test/roving-tab-index.js +3 -3
- package/src/tree-grid/test/row.js +20 -16
- package/src/truncate/test/index.tsx +4 -4
- package/src/ui/shortcut/test/index.js +2 -1
- package/src/ui/spinner/test/index.js +14 -13
- package/src/ui/tooltip/test/index.js +16 -14
- package/src/utils/theme-variables.scss +8 -0
- package/src/visually-hidden/README.md +4 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/src/navigator/stories/index.js +0 -194
- package/src/navigator/test/index.js +0 -472
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { colord, extend } from 'colord';
|
|
5
|
+
import a11yPlugin from 'colord/plugins/a11y';
|
|
6
|
+
import namesPlugin from 'colord/plugins/names';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import type { ThemeProps } from './types';
|
|
12
|
+
import type { WordPressComponentProps } from '../ui/context';
|
|
13
|
+
import { Wrapper } from './styles';
|
|
14
|
+
|
|
15
|
+
extend( [ namesPlugin, a11yPlugin ] );
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* `Theme` allows defining theme variables for components in the `@wordpress/components` package.
|
|
19
|
+
*
|
|
20
|
+
* Multiple `Theme` components can be nested in order to override specific theme variables.
|
|
21
|
+
*
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```jsx
|
|
25
|
+
* import { __experimentalTheme as Theme } from '@wordpress/components';
|
|
26
|
+
*
|
|
27
|
+
* const Example = () => {
|
|
28
|
+
* return (
|
|
29
|
+
* <Theme accent="red">
|
|
30
|
+
* <Button variant="primary">I'm red</Button>
|
|
31
|
+
* <Theme accent="blue">
|
|
32
|
+
* <Button variant="primary">I'm blue</Button>
|
|
33
|
+
* </Theme>
|
|
34
|
+
* </Theme>
|
|
35
|
+
* );
|
|
36
|
+
* };
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
function Theme( props: WordPressComponentProps< ThemeProps, 'div', true > ) {
|
|
40
|
+
const { accent } = props;
|
|
41
|
+
if ( accent && ! colord( accent ).isValid() ) {
|
|
42
|
+
// eslint-disable-next-line no-console
|
|
43
|
+
console.warn(
|
|
44
|
+
`wp.components.Theme: "${ accent }" is not a valid color value for the 'accent' prop.`
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return <Wrapper { ...props } />;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default Theme;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import Theme from '../index';
|
|
10
|
+
import Button from '../../button';
|
|
11
|
+
|
|
12
|
+
const meta: ComponentMeta< typeof Theme > = {
|
|
13
|
+
component: Theme,
|
|
14
|
+
title: 'Components (Experimental)/Theme',
|
|
15
|
+
argTypes: {
|
|
16
|
+
accent: { control: { type: 'color' } },
|
|
17
|
+
},
|
|
18
|
+
parameters: {
|
|
19
|
+
controls: { expanded: true },
|
|
20
|
+
docs: { source: { state: 'open' } },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export default meta;
|
|
24
|
+
|
|
25
|
+
const Template: ComponentStory< typeof Theme > = ( args ) => (
|
|
26
|
+
<Theme { ...args }>
|
|
27
|
+
<Button variant="primary">Hello</Button>
|
|
28
|
+
</Theme>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export const Default = Template.bind( {} );
|
|
32
|
+
Default.args = {};
|
|
33
|
+
|
|
34
|
+
export const Nested: ComponentStory< typeof Theme > = ( args ) => (
|
|
35
|
+
<Theme accent="tomato">
|
|
36
|
+
<Button variant="primary">Outer theme (hardcoded)</Button>
|
|
37
|
+
|
|
38
|
+
<Theme { ...args }>
|
|
39
|
+
<Button variant="primary">
|
|
40
|
+
Inner theme (set via Storybook controls)
|
|
41
|
+
</Button>
|
|
42
|
+
</Theme>
|
|
43
|
+
</Theme>
|
|
44
|
+
);
|
|
45
|
+
Nested.args = {
|
|
46
|
+
accent: 'blue',
|
|
47
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { colord } from 'colord';
|
|
5
|
+
import styled from '@emotion/styled';
|
|
6
|
+
import { css } from '@emotion/react';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import type { ThemeProps } from './types';
|
|
12
|
+
|
|
13
|
+
const accentColor = ( { accent }: ThemeProps ) =>
|
|
14
|
+
accent
|
|
15
|
+
? css`
|
|
16
|
+
--wp-components-color-accent: ${ accent };
|
|
17
|
+
--wp-components-color-accent-darker-10: ${ colord( accent )
|
|
18
|
+
.darken( 0.1 )
|
|
19
|
+
.toHex() };
|
|
20
|
+
--wp-components-color-accent-darker-20: ${ colord( accent )
|
|
21
|
+
.darken( 0.2 )
|
|
22
|
+
.toHex() };
|
|
23
|
+
`
|
|
24
|
+
: undefined;
|
|
25
|
+
|
|
26
|
+
export const Wrapper = styled.div< ThemeProps >`
|
|
27
|
+
${ accentColor }
|
|
28
|
+
`;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { render, screen } from '@testing-library/react';
|
|
5
|
+
import type { ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import Theme from '../';
|
|
11
|
+
|
|
12
|
+
type MyThemableComponentProps = {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const MyThemableComponent = ( props: MyThemableComponentProps ) => {
|
|
17
|
+
return (
|
|
18
|
+
<div
|
|
19
|
+
{ ...props }
|
|
20
|
+
style={ {
|
|
21
|
+
color: 'var(--wp-components-color-accent)',
|
|
22
|
+
} }
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
describe( 'Theme', () => {
|
|
28
|
+
describe( 'accent color', () => {
|
|
29
|
+
it( 'it does not define the accent color (and its variations) as a CSS variable when the `accent` prop is undefined', () => {
|
|
30
|
+
render(
|
|
31
|
+
<Theme>
|
|
32
|
+
<MyThemableComponent>Inner</MyThemableComponent>
|
|
33
|
+
</Theme>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const inner = screen.getByText( 'Inner' );
|
|
37
|
+
|
|
38
|
+
if ( inner?.parentElement === null ) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
'Somehow the `Theme` component does not render a DOM element?'
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const innerElementStyles = window.getComputedStyle(
|
|
45
|
+
inner?.parentElement
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
expect(
|
|
49
|
+
innerElementStyles.getPropertyValue(
|
|
50
|
+
'--wp-components-color-accent'
|
|
51
|
+
)
|
|
52
|
+
).toBe( '' );
|
|
53
|
+
|
|
54
|
+
expect(
|
|
55
|
+
innerElementStyles.getPropertyValue(
|
|
56
|
+
'--wp-components-color-accent-darker-10'
|
|
57
|
+
)
|
|
58
|
+
).toBe( '' );
|
|
59
|
+
|
|
60
|
+
expect(
|
|
61
|
+
innerElementStyles.getPropertyValue(
|
|
62
|
+
'--wp-components-color-accent-darker-20'
|
|
63
|
+
)
|
|
64
|
+
).toBe( '' );
|
|
65
|
+
} );
|
|
66
|
+
|
|
67
|
+
it( 'it defines the accent color (and its variations) as a CSS variable', () => {
|
|
68
|
+
render(
|
|
69
|
+
<Theme accent="#123abc">
|
|
70
|
+
<MyThemableComponent>Inner</MyThemableComponent>
|
|
71
|
+
</Theme>
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const inner = screen.getByText( 'Inner' );
|
|
75
|
+
|
|
76
|
+
expect( inner?.parentElement ).toHaveStyle( {
|
|
77
|
+
'--wp-components-color-accent': '#123abc',
|
|
78
|
+
'--wp-components-color-accent-darker-10': '#0e2c8d',
|
|
79
|
+
'--wp-components-color-accent-darker-20': '#091d5f',
|
|
80
|
+
} );
|
|
81
|
+
} );
|
|
82
|
+
|
|
83
|
+
describe( 'unsupported values', () => {
|
|
84
|
+
it.each( [
|
|
85
|
+
// Keywords
|
|
86
|
+
'currentcolor',
|
|
87
|
+
'initial',
|
|
88
|
+
'reset',
|
|
89
|
+
'inherit',
|
|
90
|
+
'revert',
|
|
91
|
+
'unset',
|
|
92
|
+
// CSS Custom properties
|
|
93
|
+
'var( --my-variable )',
|
|
94
|
+
] )( 'should warn when the value is "%s"', ( accentValue ) => {
|
|
95
|
+
render( <Theme accent={ accentValue } /> );
|
|
96
|
+
|
|
97
|
+
expect( console ).toHaveWarned();
|
|
98
|
+
} );
|
|
99
|
+
} );
|
|
100
|
+
} );
|
|
101
|
+
} );
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
export type ThemeProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Used to set the accent color (used by components as the primary color).
|
|
9
|
+
*
|
|
10
|
+
* If an accent color is not defined, the default fallback value is the original
|
|
11
|
+
* WP Admin main theme color. No all valid CSS color syntaxes are supported —
|
|
12
|
+
* in particular, keywords (like `'currentcolor'`, `'inherit'`, `'initial'`,
|
|
13
|
+
* `'revert'`, `'unset'`...) and CSS custom properties (e.g.
|
|
14
|
+
* `var(--my-custom-property)`) are _not_ supported values for this property.
|
|
15
|
+
*/
|
|
16
|
+
accent?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The children elements.
|
|
19
|
+
*/
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
};
|
|
@@ -21,10 +21,10 @@ describe( 'Toolbar', () => {
|
|
|
21
21
|
|
|
22
22
|
expect(
|
|
23
23
|
screen.getByLabelText( 'control1', { selector: 'button' } )
|
|
24
|
-
).
|
|
24
|
+
).toBeInTheDocument();
|
|
25
25
|
expect(
|
|
26
26
|
screen.getByLabelText( 'control2', { selector: 'button' } )
|
|
27
|
-
).
|
|
27
|
+
).toBeInTheDocument();
|
|
28
28
|
} );
|
|
29
29
|
} );
|
|
30
30
|
} );
|
|
@@ -13,13 +13,13 @@ describe( 'ToolbarGroup', () => {
|
|
|
13
13
|
it( 'should render an empty node, when controls are not passed', () => {
|
|
14
14
|
const { container } = render( <ToolbarGroup /> );
|
|
15
15
|
|
|
16
|
-
expect( container
|
|
16
|
+
expect( container ).toBeEmptyDOMElement();
|
|
17
17
|
} );
|
|
18
18
|
|
|
19
19
|
it( 'should render an empty node, when controls are empty', () => {
|
|
20
20
|
const { container } = render( <ToolbarGroup controls={ [] } /> );
|
|
21
21
|
|
|
22
|
-
expect( container
|
|
22
|
+
expect( container ).toBeEmptyDOMElement();
|
|
23
23
|
} );
|
|
24
24
|
|
|
25
25
|
it( 'should render a list of controls with buttons', () => {
|
|
@@ -36,10 +36,8 @@ describe( 'ToolbarGroup', () => {
|
|
|
36
36
|
render( <ToolbarGroup controls={ controls } /> );
|
|
37
37
|
|
|
38
38
|
const toolbarButton = screen.getByLabelText( 'WordPress' );
|
|
39
|
-
expect( toolbarButton.
|
|
40
|
-
|
|
41
|
-
);
|
|
42
|
-
expect( toolbarButton.getAttribute( 'type' ) ).toBe( 'button' );
|
|
39
|
+
expect( toolbarButton ).toHaveAttribute( 'aria-pressed', 'false' );
|
|
40
|
+
expect( toolbarButton ).toHaveAttribute( 'type', 'button' );
|
|
43
41
|
} );
|
|
44
42
|
|
|
45
43
|
it( 'should render a list of controls with buttons and active control', () => {
|
|
@@ -56,10 +54,8 @@ describe( 'ToolbarGroup', () => {
|
|
|
56
54
|
render( <ToolbarGroup controls={ controls } /> );
|
|
57
55
|
|
|
58
56
|
const toolbarButton = screen.getByLabelText( 'WordPress' );
|
|
59
|
-
expect( toolbarButton.
|
|
60
|
-
|
|
61
|
-
);
|
|
62
|
-
expect( toolbarButton.getAttribute( 'type' ) ).toBe( 'button' );
|
|
57
|
+
expect( toolbarButton ).toHaveAttribute( 'aria-pressed', 'true' );
|
|
58
|
+
expect( toolbarButton ).toHaveAttribute( 'type', 'button' );
|
|
63
59
|
} );
|
|
64
60
|
|
|
65
61
|
it( 'should render a nested list of controls with separator between', () => {
|
|
@@ -295,7 +295,7 @@ describe( 'ToolsPanel', () => {
|
|
|
295
295
|
expect( control ).toBeInTheDocument();
|
|
296
296
|
|
|
297
297
|
// Test the aria live announcement.
|
|
298
|
-
const announcement =
|
|
298
|
+
const announcement = screen.getByText( 'Alt is now visible' );
|
|
299
299
|
expect( announcement ).toHaveAttribute( 'aria-live', 'assertive' );
|
|
300
300
|
} );
|
|
301
301
|
|
|
@@ -308,7 +308,7 @@ describe( 'ToolsPanel', () => {
|
|
|
308
308
|
expect( control ).not.toBeInTheDocument();
|
|
309
309
|
|
|
310
310
|
// Test the aria live announcement.
|
|
311
|
-
const announcement =
|
|
311
|
+
const announcement = screen.getByText(
|
|
312
312
|
'Example hidden and reset to default'
|
|
313
313
|
);
|
|
314
314
|
expect( announcement ).toHaveAttribute( 'aria-live', 'assertive' );
|
|
@@ -337,9 +337,7 @@ describe( 'ToolsPanel', () => {
|
|
|
337
337
|
expect( resetControl ).toBeInTheDocument();
|
|
338
338
|
|
|
339
339
|
// Test the aria live announcement.
|
|
340
|
-
const announcement =
|
|
341
|
-
'Example reset to default'
|
|
342
|
-
);
|
|
340
|
+
const announcement = screen.getByText( 'Example reset to default' );
|
|
343
341
|
expect( announcement ).toHaveAttribute( 'aria-live', 'assertive' );
|
|
344
342
|
} );
|
|
345
343
|
|
|
@@ -1057,7 +1055,7 @@ describe( 'ToolsPanel', () => {
|
|
|
1057
1055
|
await selectMenuItem( 'Reset all' );
|
|
1058
1056
|
|
|
1059
1057
|
// Test the aria live announcement.
|
|
1060
|
-
const announcement =
|
|
1058
|
+
const announcement = screen.getByText( 'All options reset' );
|
|
1061
1059
|
expect( announcement ).toHaveAttribute( 'aria-live', 'assertive' );
|
|
1062
1060
|
|
|
1063
1061
|
const disabledResetAllItem = await screen.findByRole( 'menuitem', {
|
|
@@ -139,7 +139,7 @@ export function useToolsPanel(
|
|
|
139
139
|
} );
|
|
140
140
|
return items;
|
|
141
141
|
} );
|
|
142
|
-
}, [
|
|
142
|
+
}, [ panelItems, setMenuItems ] );
|
|
143
143
|
|
|
144
144
|
// Force a menu item to be checked.
|
|
145
145
|
// This is intended for use with default panel items. They are displayed
|
|
@@ -255,13 +255,7 @@ export function useToolsPanel(
|
|
|
255
255
|
shouldReset: true,
|
|
256
256
|
} );
|
|
257
257
|
setMenuItems( resetMenuItems );
|
|
258
|
-
}, [
|
|
259
|
-
generateMenuItems,
|
|
260
|
-
isResetting.current,
|
|
261
|
-
panelItems,
|
|
262
|
-
resetAll,
|
|
263
|
-
setMenuItems,
|
|
264
|
-
] );
|
|
258
|
+
}, [ panelItems, resetAll, setMenuItems ] );
|
|
265
259
|
|
|
266
260
|
// Assist ItemGroup styling when there are potentially hidden placeholder
|
|
267
261
|
// items by identifying first & last items that are toggled on for display.
|
|
@@ -300,7 +294,6 @@ export function useToolsPanel(
|
|
|
300
294
|
deregisterPanelItem,
|
|
301
295
|
firstDisplayedItem,
|
|
302
296
|
flagItemCustomization,
|
|
303
|
-
isResetting.current,
|
|
304
297
|
lastDisplayedItem,
|
|
305
298
|
menuItems,
|
|
306
299
|
panelId,
|
|
@@ -42,8 +42,11 @@ export function useToolsPanelItem(
|
|
|
42
42
|
__experimentalLastVisibleItemClass,
|
|
43
43
|
} = useToolsPanelContext();
|
|
44
44
|
|
|
45
|
-
const hasValueCallback = useCallback( hasValue, [ panelId ] );
|
|
46
|
-
const resetAllFilterCallback = useCallback( resetAllFilter, [
|
|
45
|
+
const hasValueCallback = useCallback( hasValue, [ panelId, hasValue ] );
|
|
46
|
+
const resetAllFilterCallback = useCallback( resetAllFilter, [
|
|
47
|
+
panelId,
|
|
48
|
+
resetAllFilter,
|
|
49
|
+
] );
|
|
47
50
|
const previousPanelId = usePrevious( currentPanelId );
|
|
48
51
|
|
|
49
52
|
const hasMatchingPanel =
|
|
@@ -79,6 +82,8 @@ export function useToolsPanelItem(
|
|
|
79
82
|
panelId,
|
|
80
83
|
previousPanelId,
|
|
81
84
|
resetAllFilterCallback,
|
|
85
|
+
registerPanelItem,
|
|
86
|
+
deregisterPanelItem,
|
|
82
87
|
] );
|
|
83
88
|
|
|
84
89
|
const isValueSet = hasValue();
|
|
@@ -90,7 +95,13 @@ export function useToolsPanelItem(
|
|
|
90
95
|
if ( isShownByDefault && isValueSet && ! wasValueSet ) {
|
|
91
96
|
flagItemCustomization( label );
|
|
92
97
|
}
|
|
93
|
-
}, [
|
|
98
|
+
}, [
|
|
99
|
+
isValueSet,
|
|
100
|
+
wasValueSet,
|
|
101
|
+
isShownByDefault,
|
|
102
|
+
label,
|
|
103
|
+
flagItemCustomization,
|
|
104
|
+
] );
|
|
94
105
|
|
|
95
106
|
// Note: `label` is used as a key when building menu item state in
|
|
96
107
|
// `ToolsPanel`.
|
|
@@ -118,6 +129,8 @@ export function useToolsPanelItem(
|
|
|
118
129
|
isResetting,
|
|
119
130
|
isValueSet,
|
|
120
131
|
wasMenuItemChecked,
|
|
132
|
+
onSelect,
|
|
133
|
+
onDeselect,
|
|
121
134
|
] );
|
|
122
135
|
|
|
123
136
|
// The item is shown if it is a default control regardless of whether it
|
|
@@ -153,6 +166,7 @@ export function useToolsPanelItem(
|
|
|
153
166
|
lastDisplayedItem,
|
|
154
167
|
__experimentalFirstVisibleItemClass,
|
|
155
168
|
__experimentalLastVisibleItemClass,
|
|
169
|
+
label,
|
|
156
170
|
] );
|
|
157
171
|
|
|
158
172
|
return {
|
package/src/tooltip/index.js
CHANGED
|
@@ -228,6 +228,9 @@ function Tooltip( props ) {
|
|
|
228
228
|
document.removeEventListener( 'mouseup', cancelIsMouseDown );
|
|
229
229
|
};
|
|
230
230
|
|
|
231
|
+
// Ignore reason: updating the deps array here could cause unexpected changes in behavior.
|
|
232
|
+
// Deferring until a more detailed investigation/refactor can be performed.
|
|
233
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
231
234
|
useEffect( () => clearOnUnmount, [] );
|
|
232
235
|
|
|
233
236
|
if ( Children.count( children ) !== 1 ) {
|
|
@@ -62,6 +62,9 @@ const useKeyboardVisibility = () => {
|
|
|
62
62
|
showListener.remove();
|
|
63
63
|
hideListener.remove();
|
|
64
64
|
};
|
|
65
|
+
// Disable reason: deferring this refactor to the native team.
|
|
66
|
+
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
67
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
68
|
}, [] );
|
|
66
69
|
|
|
67
70
|
return keyboardVisible;
|
|
@@ -102,6 +105,9 @@ const Tooltip = ( {
|
|
|
102
105
|
} );
|
|
103
106
|
}
|
|
104
107
|
return () => onHandleScreenTouch( null );
|
|
108
|
+
// Disable reason: deferring this refactor to the native team.
|
|
109
|
+
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
110
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
105
111
|
}, [ visible ] );
|
|
106
112
|
|
|
107
113
|
// Manage visibility animation.
|
|
@@ -115,6 +121,9 @@ const Tooltip = ( {
|
|
|
115
121
|
setAnimating( true );
|
|
116
122
|
startAnimation();
|
|
117
123
|
}
|
|
124
|
+
// Disable reason: deferring this refactor to the native team.
|
|
125
|
+
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
126
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
118
127
|
}, [ visible ] );
|
|
119
128
|
|
|
120
129
|
// Manage tooltip visibility and position in relation to keyboard.
|
|
@@ -133,6 +142,9 @@ const Tooltip = ( {
|
|
|
133
142
|
setAnimating( true );
|
|
134
143
|
setVisible( false );
|
|
135
144
|
}
|
|
145
|
+
// Disable reason: deferring this refactor to the native team.
|
|
146
|
+
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
147
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
136
148
|
}, [ visible, keyboardVisible ] );
|
|
137
149
|
|
|
138
150
|
// Manage tooltip position during keyboard frame changes.
|
|
@@ -261,6 +273,9 @@ const TooltipSlot = ( { children, ...rest } ) => {
|
|
|
261
273
|
setHandleScreenTouch( null );
|
|
262
274
|
};
|
|
263
275
|
// Memoize context value to avoid unnecessary rerenders of the Provider's children
|
|
276
|
+
// Disable reason: deferring this refactor to the native team.
|
|
277
|
+
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
278
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
264
279
|
const value = useMemo( () => ( { onHandleScreenTouch } ) );
|
|
265
280
|
|
|
266
281
|
return (
|
|
@@ -5,7 +5,6 @@ exports[`TreeGridCell uses a child render function to render children 1`] = `
|
|
|
5
5
|
role="application"
|
|
6
6
|
>
|
|
7
7
|
<table
|
|
8
|
-
onKeyDown={[Function]}
|
|
9
8
|
role="treegrid"
|
|
10
9
|
>
|
|
11
10
|
<tbody>
|
|
@@ -14,8 +13,7 @@ exports[`TreeGridCell uses a child render function to render children 1`] = `
|
|
|
14
13
|
role="gridcell"
|
|
15
14
|
>
|
|
16
15
|
<button
|
|
17
|
-
|
|
18
|
-
onFocus={[Function]}
|
|
16
|
+
class="my-button"
|
|
19
17
|
>
|
|
20
18
|
Click Me!
|
|
21
19
|
</button>
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`RovingTabIndexItem allows another component to be specified as the rendered component using the \`as\` prop 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
<div>
|
|
5
|
+
<button />
|
|
6
|
+
</div>
|
|
7
7
|
`;
|
|
8
8
|
|
|
9
9
|
exports[`RovingTabIndexItem allows children to be declared using a child render function as an alternative to \`as\` 1`] = `
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
>
|
|
14
|
-
|
|
15
|
-
</button>
|
|
10
|
+
<div>
|
|
11
|
+
<button
|
|
12
|
+
class="my-button"
|
|
13
|
+
>
|
|
14
|
+
Click Me!
|
|
15
|
+
</button>
|
|
16
|
+
</div>
|
|
16
17
|
`;
|
|
17
18
|
|
|
18
19
|
exports[`RovingTabIndexItem forwards props to the \`as\` component 1`] = `
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
>
|
|
23
|
-
|
|
24
|
-
</button>
|
|
20
|
+
<div>
|
|
21
|
+
<button
|
|
22
|
+
class="my-button"
|
|
23
|
+
>
|
|
24
|
+
Click Me!
|
|
25
|
+
</button>
|
|
26
|
+
</div>
|
|
25
27
|
`;
|
|
@@ -2,31 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`TreeGridRow forwards other props to the rendered tr element 1`] = `
|
|
4
4
|
<table>
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
<tbody>
|
|
6
|
+
<tr
|
|
7
|
+
aria-level="1"
|
|
8
|
+
aria-posinset="1"
|
|
9
|
+
aria-setsize="1"
|
|
10
|
+
class="my-row"
|
|
11
|
+
role="row"
|
|
12
|
+
>
|
|
13
|
+
<td>
|
|
14
|
+
Test
|
|
15
|
+
</td>
|
|
16
|
+
</tr>
|
|
17
|
+
</tbody>
|
|
16
18
|
</table>
|
|
17
19
|
`;
|
|
18
20
|
|
|
19
21
|
exports[`TreeGridRow renders a tr with support for level, positionInSet and setSize props 1`] = `
|
|
20
22
|
<table>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
<tbody>
|
|
24
|
+
<tr
|
|
25
|
+
aria-level="1"
|
|
26
|
+
aria-posinset="1"
|
|
27
|
+
aria-setsize="1"
|
|
28
|
+
role="row"
|
|
29
|
+
>
|
|
30
|
+
<td>
|
|
31
|
+
Test
|
|
32
|
+
</td>
|
|
33
|
+
</tr>
|
|
34
|
+
</tbody>
|
|
31
35
|
</table>
|
|
32
36
|
`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import { render } from '@testing-library/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -21,7 +21,7 @@ const TestButton = forwardRef( ( { ...props }, ref ) => (
|
|
|
21
21
|
describe( 'TreeGridCell', () => {
|
|
22
22
|
it( 'requires TreeGrid to be declared as a parent component somewhere in the component hierarchy', () => {
|
|
23
23
|
expect( () =>
|
|
24
|
-
|
|
24
|
+
render(
|
|
25
25
|
<TreeGridCell>
|
|
26
26
|
{ ( props ) => (
|
|
27
27
|
<TestButton className="my-button" { ...props }>
|
|
@@ -35,7 +35,7 @@ describe( 'TreeGridCell', () => {
|
|
|
35
35
|
} );
|
|
36
36
|
|
|
37
37
|
it( 'uses a child render function to render children', () => {
|
|
38
|
-
const
|
|
38
|
+
const { container } = render(
|
|
39
39
|
<TreeGrid>
|
|
40
40
|
<tr>
|
|
41
41
|
<TreeGridCell>
|
|
@@ -49,6 +49,6 @@ describe( 'TreeGridCell', () => {
|
|
|
49
49
|
</TreeGrid>
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
-
expect(
|
|
52
|
+
expect( container.firstChild ).toMatchSnapshot();
|
|
53
53
|
} );
|
|
54
54
|
} );
|