@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.
Files changed (158) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/build/card/context.js +1 -0
  3. package/build/card/context.js.map +1 -1
  4. package/build/circular-option-picker/circular-option-picker-context.js +1 -0
  5. package/build/circular-option-picker/circular-option-picker-context.js.map +1 -1
  6. package/build/composite/context.js +1 -0
  7. package/build/composite/context.js.map +1 -1
  8. package/build/context/context-system-provider.js +1 -0
  9. package/build/context/context-system-provider.js.map +1 -1
  10. package/build/custom-select-control-v2/custom-select.js +1 -0
  11. package/build/custom-select-control-v2/custom-select.js.map +1 -1
  12. package/build/disabled/index.js +1 -0
  13. package/build/disabled/index.js.map +1 -1
  14. package/build/item-group/context.js +1 -0
  15. package/build/item-group/context.js.map +1 -1
  16. package/build/menu/context.js +1 -0
  17. package/build/menu/context.js.map +1 -1
  18. package/build/modal/index.js +1 -0
  19. package/build/modal/index.js.map +1 -1
  20. package/build/navigation/context.js +1 -0
  21. package/build/navigation/context.js.map +1 -1
  22. package/build/navigation/group/context.js +1 -0
  23. package/build/navigation/group/context.js.map +1 -1
  24. package/build/navigation/menu/context.js +1 -0
  25. package/build/navigation/menu/context.js.map +1 -1
  26. package/build/navigator/context.js +1 -0
  27. package/build/navigator/context.js.map +1 -1
  28. package/build/popover/index.js +1 -0
  29. package/build/popover/index.js.map +1 -1
  30. package/build/private-apis.js +4 -0
  31. package/build/private-apis.js.map +1 -1
  32. package/build/radio-group/context.js +1 -0
  33. package/build/radio-group/context.js.map +1 -1
  34. package/build/slot-fill/bubbles-virtually/slot-fill-context.js +1 -0
  35. package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  36. package/build/slot-fill/context.js +1 -0
  37. package/build/slot-fill/context.js.map +1 -1
  38. package/build/tabs/context.js +1 -0
  39. package/build/tabs/context.js.map +1 -1
  40. package/build/toggle-group-control/context.js +1 -0
  41. package/build/toggle-group-control/context.js.map +1 -1
  42. package/build/toolbar/toolbar-context/index.js +1 -0
  43. package/build/toolbar/toolbar-context/index.js.map +1 -1
  44. package/build/tools-panel/context.js +1 -0
  45. package/build/tools-panel/context.js.map +1 -1
  46. package/build/tooltip/index.js +1 -0
  47. package/build/tooltip/index.js.map +1 -1
  48. package/build/tree-grid/roving-tab-index-context.js +1 -0
  49. package/build/tree-grid/roving-tab-index-context.js.map +1 -1
  50. package/build/validated-form-controls/control-with-error.js.map +1 -1
  51. package/build-module/card/context.js +1 -0
  52. package/build-module/card/context.js.map +1 -1
  53. package/build-module/circular-option-picker/circular-option-picker-context.js +1 -0
  54. package/build-module/circular-option-picker/circular-option-picker-context.js.map +1 -1
  55. package/build-module/composite/context.js +1 -0
  56. package/build-module/composite/context.js.map +1 -1
  57. package/build-module/context/context-system-provider.js +1 -0
  58. package/build-module/context/context-system-provider.js.map +1 -1
  59. package/build-module/custom-select-control-v2/custom-select.js +1 -0
  60. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  61. package/build-module/disabled/index.js +1 -0
  62. package/build-module/disabled/index.js.map +1 -1
  63. package/build-module/item-group/context.js +1 -0
  64. package/build-module/item-group/context.js.map +1 -1
  65. package/build-module/menu/context.js +1 -0
  66. package/build-module/menu/context.js.map +1 -1
  67. package/build-module/modal/index.js +1 -0
  68. package/build-module/modal/index.js.map +1 -1
  69. package/build-module/navigation/context.js +1 -0
  70. package/build-module/navigation/context.js.map +1 -1
  71. package/build-module/navigation/group/context.js +1 -0
  72. package/build-module/navigation/group/context.js.map +1 -1
  73. package/build-module/navigation/menu/context.js +1 -0
  74. package/build-module/navigation/menu/context.js.map +1 -1
  75. package/build-module/navigator/context.js +1 -0
  76. package/build-module/navigator/context.js.map +1 -1
  77. package/build-module/popover/index.js +1 -0
  78. package/build-module/popover/index.js.map +1 -1
  79. package/build-module/private-apis.js +5 -1
  80. package/build-module/private-apis.js.map +1 -1
  81. package/build-module/radio-group/context.js +1 -0
  82. package/build-module/radio-group/context.js.map +1 -1
  83. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +1 -0
  84. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  85. package/build-module/slot-fill/context.js +1 -0
  86. package/build-module/slot-fill/context.js.map +1 -1
  87. package/build-module/tabs/context.js +1 -0
  88. package/build-module/tabs/context.js.map +1 -1
  89. package/build-module/toggle-group-control/context.js +1 -0
  90. package/build-module/toggle-group-control/context.js.map +1 -1
  91. package/build-module/toolbar/toolbar-context/index.js +1 -0
  92. package/build-module/toolbar/toolbar-context/index.js.map +1 -1
  93. package/build-module/tools-panel/context.js +1 -0
  94. package/build-module/tools-panel/context.js.map +1 -1
  95. package/build-module/tooltip/index.js +1 -0
  96. package/build-module/tooltip/index.js.map +1 -1
  97. package/build-module/tree-grid/roving-tab-index-context.js +1 -0
  98. package/build-module/tree-grid/roving-tab-index-context.js.map +1 -1
  99. package/build-module/validated-form-controls/control-with-error.js.map +1 -1
  100. package/build-style/style-rtl.css +11 -5
  101. package/build-style/style.css +11 -5
  102. package/build-types/calendar/stories/date-calendar.story.d.ts.map +1 -1
  103. package/build-types/calendar/stories/date-range-calendar.story.d.ts.map +1 -1
  104. package/build-types/card/context.d.ts.map +1 -1
  105. package/build-types/composite/context.d.ts.map +1 -1
  106. package/build-types/context/context-system-provider.d.ts.map +1 -1
  107. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  108. package/build-types/disabled/index.d.ts.map +1 -1
  109. package/build-types/item-group/context.d.ts.map +1 -1
  110. package/build-types/modal/index.d.ts.map +1 -1
  111. package/build-types/navigation/context.d.ts.map +1 -1
  112. package/build-types/navigation/group/context.d.ts.map +1 -1
  113. package/build-types/navigation/menu/context.d.ts.map +1 -1
  114. package/build-types/popover/index.d.ts +1 -1
  115. package/build-types/popover/index.d.ts.map +1 -1
  116. package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
  117. package/build-types/private-apis.d.ts.map +1 -1
  118. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
  119. package/build-types/slot-fill/context.d.ts.map +1 -1
  120. package/build-types/tabs/context.d.ts.map +1 -1
  121. package/build-types/toggle-group-control/context.d.ts.map +1 -1
  122. package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
  123. package/build-types/tools-panel/context.d.ts.map +1 -1
  124. package/build-types/tooltip/index.d.ts.map +1 -1
  125. package/build-types/tree-grid/roving-tab-index-context.d.ts.map +1 -1
  126. package/build-types/validated-form-controls/control-with-error.d.ts +5 -0
  127. package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
  128. package/package.json +20 -20
  129. package/src/calendar/stories/date-calendar.story.tsx +1 -0
  130. package/src/calendar/stories/date-range-calendar.story.tsx +1 -0
  131. package/src/card/context.ts +2 -0
  132. package/src/circular-option-picker/circular-option-picker-context.tsx +1 -0
  133. package/src/composite/context.tsx +1 -0
  134. package/src/context/context-system-provider.js +2 -0
  135. package/src/custom-select-control-v2/custom-select.tsx +1 -0
  136. package/src/disabled/index.tsx +2 -0
  137. package/src/item-group/context.ts +1 -0
  138. package/src/menu/context.tsx +1 -0
  139. package/src/modal/index.tsx +1 -0
  140. package/src/modal/style.scss +8 -0
  141. package/src/navigation/context.tsx +3 -0
  142. package/src/navigation/group/context.tsx +1 -0
  143. package/src/navigation/menu/context.tsx +2 -0
  144. package/src/navigator/context.ts +1 -0
  145. package/src/popover/index.tsx +1 -0
  146. package/src/private-apis.ts +6 -0
  147. package/src/radio-group/context.tsx +1 -0
  148. package/src/slot-fill/bubbles-virtually/slot-fill-context.ts +1 -0
  149. package/src/slot-fill/context.ts +1 -0
  150. package/src/tabs/context.ts +1 -0
  151. package/src/toggle-group-control/context.ts +2 -0
  152. package/src/toolbar/toolbar-context/index.ts +1 -0
  153. package/src/tools-panel/context.ts +1 -0
  154. package/src/tooltip/index.tsx +1 -0
  155. package/src/tree-grid/roving-tab-index-context.ts +2 -0
  156. package/src/validated-form-controls/control-with-error.tsx +5 -0
  157. package/src/validated-form-controls/style.scss +5 -5
  158. 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' ]
@@ -12,6 +12,8 @@ import type { WordPressComponentProps } from '../context';
12
12
  import { useCx } from '../utils';
13
13
 
14
14
  const Context = createContext< boolean >( false );
15
+ Context.displayName = 'DisabledContext';
16
+
15
17
  const { Consumer, Provider } = Context;
16
18
 
17
19
  /**
@@ -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 );
@@ -9,3 +9,4 @@ import { createContext } from '@wordpress/element';
9
9
  import type { ContextProps } from './types';
10
10
 
11
11
  export const Context = createContext< ContextProps | undefined >( undefined );
12
+ Context.displayName = 'MenuContext';
@@ -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 >();
@@ -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
  }
@@ -34,4 +34,7 @@ export const NavigationContext = createContext< NavigationContextType >( {
34
34
  isMenuEmpty: defaultIsEmpty,
35
35
  },
36
36
  } );
37
+
38
+ NavigationContext.displayName = 'NavigationContext';
39
+
37
40
  export const useNavigationContext = () => useContext( NavigationContext );
@@ -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 );
@@ -14,5 +14,7 @@ export const NavigationMenuContext = createContext< NavigationMenuContextType >(
14
14
  search: '',
15
15
  }
16
16
  );
17
+ NavigationMenuContext.displayName = 'NavigationMenuContext';
18
+
17
19
  export const useNavigationMenuContext = () =>
18
20
  useContext( NavigationMenuContext );
@@ -18,3 +18,4 @@ const initialContextValue: NavigatorContextType = {
18
18
  params: {},
19
19
  };
20
20
  export const NavigatorContext = createContext( initialContextValue );
21
+ NavigatorContext.displayName = 'NavigatorContext';
@@ -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 = () => {
@@ -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,
@@ -15,3 +15,4 @@ export const RadioGroupContext = createContext< {
15
15
  store: undefined,
16
16
  disabled: undefined,
17
17
  } );
18
+ RadioGroupContext.displayName = 'RadioGroupContext';
@@ -29,5 +29,6 @@ const initialContextValue: SlotFillBubblesVirtuallyContext = {
29
29
  };
30
30
 
31
31
  const SlotFillContext = createContext( initialContextValue );
32
+ SlotFillContext.displayName = 'SlotFillContext';
32
33
 
33
34
  export default SlotFillContext;
@@ -19,5 +19,6 @@ const initialValue: BaseSlotFillContext = {
19
19
  updateFill: () => {},
20
20
  };
21
21
  export const SlotFillContext = createContext( initialValue );
22
+ SlotFillContext.displayName = 'SlotFillContext';
22
23
 
23
24
  export default SlotFillContext;
@@ -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;
@@ -11,5 +11,6 @@ import { createContext } from '@wordpress/element';
11
11
  const ToolbarContext = createContext< Ariakit.ToolbarStore | undefined >(
12
12
  undefined
13
13
  );
14
+ ToolbarContext.displayName = 'ToolbarContext';
14
15
 
15
16
  export default ToolbarContext;
@@ -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 );
@@ -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