@wordpress/components 30.2.2-next.e256d081a.0 → 30.3.2-next.6870dfe5b.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 +16 -1
- package/build/card/context.js +1 -0
- package/build/card/context.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-context.js +1 -0
- package/build/circular-option-picker/circular-option-picker-context.js.map +1 -1
- package/build/composite/context.js +1 -0
- package/build/composite/context.js.map +1 -1
- package/build/context/context-system-provider.js +1 -0
- package/build/context/context-system-provider.js.map +1 -1
- package/build/custom-select-control-v2/custom-select.js +1 -0
- package/build/custom-select-control-v2/custom-select.js.map +1 -1
- package/build/disabled/index.js +1 -0
- package/build/disabled/index.js.map +1 -1
- package/build/item-group/context.js +1 -0
- package/build/item-group/context.js.map +1 -1
- package/build/menu/context.js +1 -0
- package/build/menu/context.js.map +1 -1
- package/build/modal/index.js +1 -0
- package/build/modal/index.js.map +1 -1
- package/build/navigation/context.js +1 -0
- package/build/navigation/context.js.map +1 -1
- package/build/navigation/group/context.js +1 -0
- package/build/navigation/group/context.js.map +1 -1
- package/build/navigation/menu/context.js +1 -0
- package/build/navigation/menu/context.js.map +1 -1
- package/build/navigator/context.js +1 -0
- package/build/navigator/context.js.map +1 -1
- package/build/popover/index.js +1 -0
- package/build/popover/index.js.map +1 -1
- package/build/private-apis.js +4 -0
- package/build/private-apis.js.map +1 -1
- package/build/radio-group/context.js +1 -0
- package/build/radio-group/context.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js +1 -0
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build/slot-fill/context.js +1 -0
- package/build/slot-fill/context.js.map +1 -1
- package/build/tabs/context.js +1 -0
- package/build/tabs/context.js.map +1 -1
- package/build/toggle-group-control/context.js +1 -0
- package/build/toggle-group-control/context.js.map +1 -1
- package/build/toolbar/toolbar-context/index.js +1 -0
- package/build/toolbar/toolbar-context/index.js.map +1 -1
- package/build/tools-panel/context.js +1 -0
- package/build/tools-panel/context.js.map +1 -1
- package/build/tooltip/index.js +1 -0
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-grid/roving-tab-index-context.js +1 -0
- package/build/tree-grid/roving-tab-index-context.js.map +1 -1
- package/build/validated-form-controls/control-with-error.js.map +1 -1
- package/build-module/card/context.js +1 -0
- package/build-module/card/context.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-context.js +1 -0
- package/build-module/circular-option-picker/circular-option-picker-context.js.map +1 -1
- package/build-module/composite/context.js +1 -0
- package/build-module/composite/context.js.map +1 -1
- package/build-module/context/context-system-provider.js +1 -0
- package/build-module/context/context-system-provider.js.map +1 -1
- package/build-module/custom-select-control-v2/custom-select.js +1 -0
- package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
- package/build-module/disabled/index.js +1 -0
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/item-group/context.js +1 -0
- package/build-module/item-group/context.js.map +1 -1
- package/build-module/menu/context.js +1 -0
- package/build-module/menu/context.js.map +1 -1
- package/build-module/modal/index.js +1 -0
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigation/context.js +1 -0
- package/build-module/navigation/context.js.map +1 -1
- package/build-module/navigation/group/context.js +1 -0
- package/build-module/navigation/group/context.js.map +1 -1
- package/build-module/navigation/menu/context.js +1 -0
- package/build-module/navigation/menu/context.js.map +1 -1
- package/build-module/navigator/context.js +1 -0
- package/build-module/navigator/context.js.map +1 -1
- package/build-module/popover/index.js +1 -0
- package/build-module/popover/index.js.map +1 -1
- package/build-module/private-apis.js +5 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/radio-group/context.js +1 -0
- package/build-module/radio-group/context.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +1 -0
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build-module/slot-fill/context.js +1 -0
- package/build-module/slot-fill/context.js.map +1 -1
- package/build-module/tabs/context.js +1 -0
- package/build-module/tabs/context.js.map +1 -1
- package/build-module/toggle-group-control/context.js +1 -0
- package/build-module/toggle-group-control/context.js.map +1 -1
- package/build-module/toolbar/toolbar-context/index.js +1 -0
- package/build-module/toolbar/toolbar-context/index.js.map +1 -1
- package/build-module/tools-panel/context.js +1 -0
- package/build-module/tools-panel/context.js.map +1 -1
- package/build-module/tooltip/index.js +1 -0
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-context.js +1 -0
- package/build-module/tree-grid/roving-tab-index-context.js.map +1 -1
- package/build-module/validated-form-controls/control-with-error.js.map +1 -1
- package/build-style/style-rtl.css +11 -5
- package/build-style/style.css +11 -5
- package/build-types/calendar/stories/date-calendar.story.d.ts.map +1 -1
- package/build-types/calendar/stories/date-range-calendar.story.d.ts.map +1 -1
- package/build-types/card/context.d.ts.map +1 -1
- package/build-types/composite/context.d.ts.map +1 -1
- package/build-types/context/context-system-provider.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/item-group/context.d.ts.map +1 -1
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/navigation/context.d.ts.map +1 -1
- package/build-types/navigation/group/context.d.ts.map +1 -1
- package/build-types/navigation/menu/context.d.ts.map +1 -1
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
- package/build-types/slot-fill/context.d.ts.map +1 -1
- package/build-types/tabs/context.d.ts.map +1 -1
- package/build-types/toggle-group-control/context.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
- package/build-types/tools-panel/context.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tree-grid/roving-tab-index-context.d.ts.map +1 -1
- package/build-types/validated-form-controls/control-with-error.d.ts +5 -0
- package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/calendar/stories/date-calendar.story.tsx +1 -0
- package/src/calendar/stories/date-range-calendar.story.tsx +1 -0
- package/src/card/context.ts +2 -0
- package/src/circular-option-picker/circular-option-picker-context.tsx +1 -0
- package/src/composite/context.tsx +1 -0
- package/src/context/context-system-provider.js +2 -0
- package/src/custom-select-control-v2/custom-select.tsx +1 -0
- package/src/disabled/index.tsx +2 -0
- package/src/item-group/context.ts +1 -0
- package/src/menu/context.tsx +1 -0
- package/src/modal/index.tsx +1 -0
- package/src/modal/style.scss +8 -0
- package/src/navigation/context.tsx +3 -0
- package/src/navigation/group/context.tsx +1 -0
- package/src/navigation/menu/context.tsx +2 -0
- package/src/navigator/context.ts +1 -0
- package/src/popover/index.tsx +1 -0
- package/src/private-apis.ts +6 -0
- package/src/radio-group/context.tsx +1 -0
- package/src/slot-fill/bubbles-virtually/slot-fill-context.ts +1 -0
- package/src/slot-fill/context.ts +1 -0
- package/src/tabs/context.ts +1 -0
- package/src/toggle-group-control/context.ts +2 -0
- package/src/toolbar/toolbar-context/index.ts +1 -0
- package/src/tools-panel/context.ts +1 -0
- package/src/tooltip/index.tsx +1 -0
- package/src/tree-grid/roving-tab-index-context.ts +2 -0
- package/src/validated-form-controls/control-with-error.tsx +5 -0
- package/src/validated-form-controls/style.scss +5 -5
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -9,5 +9,6 @@ import { createContext, useContext } from '@wordpress/element';
|
|
|
9
9
|
import type { CompositeContextProps } from './types';
|
|
10
10
|
|
|
11
11
|
export const CompositeContext = createContext< CompositeContextProps >( {} );
|
|
12
|
+
CompositeContext.displayName = 'CompositeContext';
|
|
12
13
|
|
|
13
14
|
export const useCompositeContext = () => useContext( CompositeContext );
|
|
@@ -25,6 +25,8 @@ import { useUpdateEffect } from '../utils';
|
|
|
25
25
|
export const ComponentsContext = createContext(
|
|
26
26
|
/** @type {Record<string, any>} */ ( {} )
|
|
27
27
|
);
|
|
28
|
+
ComponentsContext.displayName = 'ComponentsContext';
|
|
29
|
+
|
|
28
30
|
export const useComponentsContext = () => useContext( ComponentsContext );
|
|
29
31
|
|
|
30
32
|
/**
|
|
@@ -28,6 +28,7 @@ import BaseControl from '../base-control';
|
|
|
28
28
|
|
|
29
29
|
export const CustomSelectContext =
|
|
30
30
|
createContext< CustomSelectContextType >( undefined );
|
|
31
|
+
CustomSelectContext.displayName = 'CustomSelectContext';
|
|
31
32
|
|
|
32
33
|
function defaultRenderSelectedValue(
|
|
33
34
|
value: CustomSelectButtonProps[ 'value' ]
|
package/src/disabled/index.tsx
CHANGED
|
@@ -11,5 +11,6 @@ import type { ItemGroupContext as Context } from './types';
|
|
|
11
11
|
export const ItemGroupContext = createContext( {
|
|
12
12
|
size: 'medium',
|
|
13
13
|
} as Context );
|
|
14
|
+
ItemGroupContext.displayName = 'ItemGroupContext';
|
|
14
15
|
|
|
15
16
|
export const useItemGroupContext = () => useContext( ItemGroupContext );
|
package/src/menu/context.tsx
CHANGED
package/src/modal/index.tsx
CHANGED
|
@@ -44,6 +44,7 @@ type Dismissers = Set<
|
|
|
44
44
|
React.RefObject< ModalProps[ 'onRequestClose' ] | undefined >
|
|
45
45
|
>;
|
|
46
46
|
const ModalContext = createContext< Dismissers >( new Set() );
|
|
47
|
+
ModalContext.displayName = 'ModalContext';
|
|
47
48
|
|
|
48
49
|
// Used to track body class names applied while modals are open.
|
|
49
50
|
const bodyOpenClasses = new Map< string, number >();
|
package/src/modal/style.scss
CHANGED
|
@@ -31,11 +31,19 @@
|
|
|
31
31
|
overflow: hidden;
|
|
32
32
|
// Have the content element fill the vertical space yet not overflow.
|
|
33
33
|
display: flex;
|
|
34
|
+
color: $gray-900;
|
|
34
35
|
// Animate the modal frame/contents appearing on the page.
|
|
35
36
|
animation-name: components-modal__appear-animation;
|
|
36
37
|
animation-fill-mode: forwards;
|
|
37
38
|
animation-timing-function: cubic-bezier(0.29, 0, 0, 1);
|
|
38
39
|
|
|
40
|
+
// Ensure all headings use the proper editor text color, overriding wp-admin common.css
|
|
41
|
+
h1,
|
|
42
|
+
h2,
|
|
43
|
+
h3 {
|
|
44
|
+
color: $gray-900;
|
|
45
|
+
}
|
|
46
|
+
|
|
39
47
|
@media not (prefers-reduced-motion) {
|
|
40
48
|
animation-duration: var(--modal-frame-animation-duration);
|
|
41
49
|
}
|
|
@@ -10,6 +10,7 @@ import type { NavigationGroupContext as NavigationGroupContextType } from '../ty
|
|
|
10
10
|
|
|
11
11
|
export const NavigationGroupContext =
|
|
12
12
|
createContext< NavigationGroupContextType >( { group: undefined } );
|
|
13
|
+
NavigationGroupContext.displayName = 'NavigationGroupContext';
|
|
13
14
|
|
|
14
15
|
export const useNavigationGroupContext = () =>
|
|
15
16
|
useContext( NavigationGroupContext );
|
package/src/navigator/context.ts
CHANGED
package/src/popover/index.tsx
CHANGED
|
@@ -102,6 +102,7 @@ const ArrowTriangle = () => (
|
|
|
102
102
|
);
|
|
103
103
|
|
|
104
104
|
const slotNameContext = createContext< string | undefined >( undefined );
|
|
105
|
+
slotNameContext.displayName = '__unstableSlotNameContext';
|
|
105
106
|
|
|
106
107
|
const fallbackContainerClassname = 'components-popover__fallback-container';
|
|
107
108
|
const getPopoverFallbackContainer = () => {
|
package/src/private-apis.ts
CHANGED
|
@@ -13,10 +13,13 @@ import Badge from './badge';
|
|
|
13
13
|
|
|
14
14
|
import { DateCalendar, DateRangeCalendar, TZDate } from './calendar';
|
|
15
15
|
import {
|
|
16
|
+
ValidatedCheckboxControl,
|
|
17
|
+
ValidatedInputControl,
|
|
16
18
|
ValidatedNumberControl,
|
|
17
19
|
ValidatedTextControl,
|
|
18
20
|
ValidatedToggleControl,
|
|
19
21
|
} from './validated-form-controls';
|
|
22
|
+
import { Picker } from './color-picker/picker';
|
|
20
23
|
|
|
21
24
|
export const privateApis = {};
|
|
22
25
|
lock( privateApis, {
|
|
@@ -32,6 +35,9 @@ lock( privateApis, {
|
|
|
32
35
|
DateCalendar,
|
|
33
36
|
DateRangeCalendar,
|
|
34
37
|
TZDate,
|
|
38
|
+
Picker,
|
|
39
|
+
ValidatedInputControl,
|
|
40
|
+
ValidatedCheckboxControl,
|
|
35
41
|
ValidatedNumberControl,
|
|
36
42
|
ValidatedTextControl,
|
|
37
43
|
ValidatedToggleControl,
|
package/src/slot-fill/context.ts
CHANGED
package/src/tabs/context.ts
CHANGED
|
@@ -9,5 +9,6 @@ import { createContext, useContext } from '@wordpress/element';
|
|
|
9
9
|
import type { TabsContextProps } from './types';
|
|
10
10
|
|
|
11
11
|
export const TabsContext = createContext< TabsContextProps >( undefined );
|
|
12
|
+
TabsContext.displayName = 'TabsContext';
|
|
12
13
|
|
|
13
14
|
export const useTabsContext = () => useContext( TabsContext );
|
|
@@ -11,6 +11,8 @@ import type { ToggleGroupControlContextProps } from './types';
|
|
|
11
11
|
const ToggleGroupControlContext = createContext(
|
|
12
12
|
{} as ToggleGroupControlContextProps
|
|
13
13
|
);
|
|
14
|
+
ToggleGroupControlContext.displayName = 'ToggleGroupControlContext';
|
|
15
|
+
|
|
14
16
|
export const useToggleGroupControlContext = () =>
|
|
15
17
|
useContext( ToggleGroupControlContext );
|
|
16
18
|
export default ToggleGroupControlContext;
|
|
@@ -22,6 +22,7 @@ export const ToolsPanelContext = createContext< ToolsPanelContextType >( {
|
|
|
22
22
|
deregisterResetAllFilter: noop,
|
|
23
23
|
areAllOptionalControlsHidden: true,
|
|
24
24
|
} );
|
|
25
|
+
ToolsPanelContext.displayName = 'ToolsPanelContext';
|
|
25
26
|
|
|
26
27
|
export const useToolsPanelContext = () =>
|
|
27
28
|
useContext< ToolsPanelContextType >( ToolsPanelContext );
|
package/src/tooltip/index.tsx
CHANGED
|
@@ -30,6 +30,7 @@ import { positionToPlacement } from '../popover/utils';
|
|
|
30
30
|
const TooltipInternalContext = createContext< TooltipInternalContextType >( {
|
|
31
31
|
isNestedInTooltip: false,
|
|
32
32
|
} );
|
|
33
|
+
TooltipInternalContext.displayName = 'TooltipInternalContext';
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
36
|
* Time over anchor to wait before showing tooltip
|
|
@@ -12,6 +12,8 @@ const RovingTabIndexContext = createContext<
|
|
|
12
12
|
}
|
|
13
13
|
| undefined
|
|
14
14
|
>( undefined );
|
|
15
|
+
RovingTabIndexContext.displayName = 'RovingTabIndexContext';
|
|
16
|
+
|
|
15
17
|
export const useRovingTabIndexContext = () =>
|
|
16
18
|
useContext( RovingTabIndexContext );
|
|
17
19
|
export const RovingTabIndexProvider = RovingTabIndexContext.Provider;
|
|
@@ -81,6 +81,11 @@ function UnforwardedControlWithError< C extends React.ReactElement >(
|
|
|
81
81
|
getValidityTarget: () => ValidityTarget | null | undefined;
|
|
82
82
|
/**
|
|
83
83
|
* The control component to apply validation to.
|
|
84
|
+
*
|
|
85
|
+
* As `children` will be cloned with additional props,
|
|
86
|
+
* the component at the root of `children` should accept
|
|
87
|
+
* `label`, `onChange`, and `required` props, and process them
|
|
88
|
+
* appropriately.
|
|
84
89
|
*/
|
|
85
90
|
children: C;
|
|
86
91
|
},
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// For components based on InputBase
|
|
3
3
|
&:has(:is(input, select):user-invalid)
|
|
4
4
|
.components-input-control__backdrop {
|
|
5
|
-
--wp-components-color-accent: $alert-red;
|
|
5
|
+
--wp-components-color-accent: #{$alert-red};
|
|
6
6
|
border-color: $alert-red;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
// For TextControl, TextareaControl
|
|
10
10
|
:is(textarea, input[type="text"]):user-invalid {
|
|
11
|
-
--wp-admin-theme-color: $alert-red;
|
|
12
|
-
--wp-components-color-accent: $alert-red;
|
|
11
|
+
--wp-admin-theme-color: #{$alert-red};
|
|
12
|
+
--wp-components-color-accent: #{$alert-red};
|
|
13
13
|
border-color: $alert-red;
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
|
|
27
27
|
// For CustomSelectControl
|
|
28
28
|
&:has(select:user-invalid) .components-input-control__backdrop {
|
|
29
|
-
--wp-components-color-accent: $alert-red;
|
|
29
|
+
--wp-components-color-accent: #{$alert-red};
|
|
30
30
|
border-color: $alert-red;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// For ToggleGroupControl
|
|
34
34
|
&:has(input[type="radio"]:invalid) {
|
|
35
|
-
--wp-components-color-accent: $alert-red;
|
|
35
|
+
--wp-components-color-accent: #{$alert-red};
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|