@wordpress/components 32.3.1-next.v.202602241322.0 → 32.4.1-next.v.202603102151.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 (132) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/build/alignment-matrix-control/cell.cjs +2 -2
  3. package/build/alignment-matrix-control/cell.cjs.map +2 -2
  4. package/build/alignment-matrix-control/index.cjs +2 -2
  5. package/build/alignment-matrix-control/index.cjs.map +2 -2
  6. package/build/angle-picker-control/angle-circle.cjs +2 -2
  7. package/build/angle-picker-control/angle-circle.cjs.map +2 -2
  8. package/build/calendar/utils/constants.cjs +1 -0
  9. package/build/calendar/utils/constants.cjs.map +2 -2
  10. package/build/date-time/date/styles.cjs +9 -9
  11. package/build/date-time/date/styles.cjs.map +2 -2
  12. package/build/menu/radio-item.cjs +1 -1
  13. package/build/menu/radio-item.cjs.map +2 -2
  14. package/build/private-apis.cjs +0 -4
  15. package/build/private-apis.cjs.map +3 -3
  16. package/build/select-control/styles/select-control-styles.cjs +8 -8
  17. package/build/select-control/styles/select-control-styles.cjs.map +2 -2
  18. package/build/tooltip/index.cjs +1 -1
  19. package/build/tooltip/index.cjs.map +1 -1
  20. package/build/visually-hidden/styles.cjs +2 -1
  21. package/build/visually-hidden/styles.cjs.map +2 -2
  22. package/build-module/alignment-matrix-control/cell.mjs +2 -2
  23. package/build-module/alignment-matrix-control/cell.mjs.map +2 -2
  24. package/build-module/alignment-matrix-control/index.mjs +2 -2
  25. package/build-module/alignment-matrix-control/index.mjs.map +2 -2
  26. package/build-module/angle-picker-control/angle-circle.mjs +2 -2
  27. package/build-module/angle-picker-control/angle-circle.mjs.map +2 -2
  28. package/build-module/calendar/utils/constants.mjs +1 -0
  29. package/build-module/calendar/utils/constants.mjs.map +2 -2
  30. package/build-module/date-time/date/styles.mjs +9 -9
  31. package/build-module/date-time/date/styles.mjs.map +2 -2
  32. package/build-module/menu/radio-item.mjs +1 -1
  33. package/build-module/menu/radio-item.mjs.map +2 -2
  34. package/build-module/private-apis.mjs +0 -4
  35. package/build-module/private-apis.mjs.map +2 -2
  36. package/build-module/select-control/styles/select-control-styles.mjs +8 -8
  37. package/build-module/select-control/styles/select-control-styles.mjs.map +2 -2
  38. package/build-module/tooltip/index.mjs +1 -1
  39. package/build-module/tooltip/index.mjs.map +1 -1
  40. package/build-module/visually-hidden/styles.mjs +2 -1
  41. package/build-module/visually-hidden/styles.mjs.map +2 -2
  42. package/build-style/style-rtl.css +5 -180
  43. package/build-style/style.css +5 -180
  44. package/build-types/calendar/stories/date-calendar.story.d.ts +5 -0
  45. package/build-types/calendar/stories/date-calendar.story.d.ts.map +1 -1
  46. package/build-types/calendar/stories/date-range-calendar.story.d.ts +5 -0
  47. package/build-types/calendar/stories/date-range-calendar.story.d.ts.map +1 -1
  48. package/build-types/calendar/types.d.ts +12 -0
  49. package/build-types/calendar/types.d.ts.map +1 -1
  50. package/build-types/calendar/utils/constants.d.ts +1 -0
  51. package/build-types/calendar/utils/constants.d.ts.map +1 -1
  52. package/build-types/date-time/date/styles.d.ts.map +1 -1
  53. package/build-types/dropdown/types.d.ts +9 -13
  54. package/build-types/dropdown/types.d.ts.map +1 -1
  55. package/build-types/menu/radio-item.d.ts.map +1 -1
  56. package/build-types/modal/types.d.ts +9 -3
  57. package/build-types/modal/types.d.ts.map +1 -1
  58. package/build-types/popover/types.d.ts +10 -10
  59. package/build-types/popover/types.d.ts.map +1 -1
  60. package/build-types/private-apis.d.ts.map +1 -1
  61. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  62. package/build-types/tools-panel/tools-panel/hook.d.ts +1 -1
  63. package/build-types/tools-panel/types.d.ts +1 -1
  64. package/build-types/tools-panel/types.d.ts.map +1 -1
  65. package/build-types/tooltip/types.d.ts +2 -2
  66. package/build-types/visually-hidden/styles.d.ts.map +1 -1
  67. package/package.json +22 -22
  68. package/src/calendar/stories/date-calendar.story.tsx +11 -0
  69. package/src/calendar/stories/date-range-calendar.story.tsx +11 -0
  70. package/src/calendar/style.scss +5 -0
  71. package/src/calendar/types.ts +12 -0
  72. package/src/calendar/utils/constants.ts +1 -0
  73. package/src/date-time/date/styles.ts +1 -0
  74. package/src/dropdown/types.ts +9 -14
  75. package/src/form-token-field/style.scss +1 -0
  76. package/src/menu/radio-item.tsx +1 -1
  77. package/src/modal/types.ts +9 -5
  78. package/src/notice/test/__snapshots__/index.tsx.snap +1 -1
  79. package/src/popover/types.ts +10 -10
  80. package/src/private-apis.ts +0 -4
  81. package/src/select-control/styles/select-control-styles.ts +1 -0
  82. package/src/style.scss +0 -2
  83. package/src/tools-panel/types.ts +4 -1
  84. package/src/tooltip/README.md +2 -2
  85. package/src/tooltip/index.tsx +2 -2
  86. package/src/tooltip/types.ts +2 -2
  87. package/src/visually-hidden/styles.ts +1 -0
  88. package/src/visually-hidden/test/__snapshots__/index.tsx.snap +1 -1
  89. package/build/avatar/component.cjs +0 -99
  90. package/build/avatar/component.cjs.map +0 -7
  91. package/build/avatar/index.cjs +0 -37
  92. package/build/avatar/index.cjs.map +0 -7
  93. package/build/avatar/types.cjs +0 -19
  94. package/build/avatar/types.cjs.map +0 -7
  95. package/build/avatar-group/component.cjs +0 -60
  96. package/build/avatar-group/component.cjs.map +0 -7
  97. package/build/avatar-group/index.cjs +0 -37
  98. package/build/avatar-group/index.cjs.map +0 -7
  99. package/build/avatar-group/types.cjs +0 -19
  100. package/build/avatar-group/types.cjs.map +0 -7
  101. package/build-module/avatar/component.mjs +0 -68
  102. package/build-module/avatar/component.mjs.map +0 -7
  103. package/build-module/avatar/index.mjs +0 -6
  104. package/build-module/avatar/index.mjs.map +0 -7
  105. package/build-module/avatar/types.mjs +0 -1
  106. package/build-module/avatar/types.mjs.map +0 -7
  107. package/build-module/avatar-group/component.mjs +0 -29
  108. package/build-module/avatar-group/component.mjs.map +0 -7
  109. package/build-module/avatar-group/index.mjs +0 -6
  110. package/build-module/avatar-group/index.mjs.map +0 -7
  111. package/build-module/avatar-group/types.mjs +0 -1
  112. package/build-module/avatar-group/types.mjs.map +0 -7
  113. package/build-types/avatar/component.d.ts +0 -5
  114. package/build-types/avatar/component.d.ts.map +0 -1
  115. package/build-types/avatar/index.d.ts +0 -3
  116. package/build-types/avatar/index.d.ts.map +0 -1
  117. package/build-types/avatar/types.d.ts +0 -59
  118. package/build-types/avatar/types.d.ts.map +0 -1
  119. package/build-types/avatar-group/component.d.ts +0 -8
  120. package/build-types/avatar-group/component.d.ts.map +0 -1
  121. package/build-types/avatar-group/index.d.ts +0 -3
  122. package/build-types/avatar-group/index.d.ts.map +0 -1
  123. package/build-types/avatar-group/types.d.ts +0 -14
  124. package/build-types/avatar-group/types.d.ts.map +0 -1
  125. package/src/avatar/component.tsx +0 -82
  126. package/src/avatar/index.ts +0 -2
  127. package/src/avatar/styles.scss +0 -152
  128. package/src/avatar/types.ts +0 -59
  129. package/src/avatar-group/component.tsx +0 -46
  130. package/src/avatar-group/index.ts +0 -2
  131. package/src/avatar-group/styles.scss +0 -32
  132. package/src/avatar-group/types.ts +0 -13
@@ -1,8 +1,6 @@
1
- /**
2
- * External dependencies
3
- */
4
- import type { ReactNode, MutableRefObject, SyntheticEvent } from 'react';
5
1
  import type { Placement } from '@floating-ui/react-dom';
2
+ import type { useFocusOnMount } from '@wordpress/compose';
3
+ import type { MutableRefObject, ReactNode, SyntheticEvent } from 'react';
6
4
  type PositionYAxis = 'top' | 'middle' | 'bottom';
7
5
  type PositionXAxis = 'left' | 'center' | 'right';
8
6
  type PositionCorner = 'top' | 'right' | 'bottom' | 'left';
@@ -70,15 +68,17 @@ export type PopoverProps = {
70
68
  */
71
69
  constrainTabbing?: boolean;
72
70
  /**
73
- * By default, the _first tabbable element_ in the popover will receive focus
74
- * when it mounts. This is the same as setting this prop to `"firstElement"`.
75
- * Specifying a `false` value disables the focus handling entirely (this
76
- * should only be done when an appropriately accessible substitute behavior
77
- * exists).
71
+ * Determines focus behavior when the popover mounts.
72
+ *
73
+ * - `"firstElement"` focuses the first tabbable element within.
74
+ * - `"firstInputElement"` focuses the first value control within.
75
+ * - `true` focuses the element itself.
76
+ * - `false` does nothing and _should not be used unless an accessible
77
+ * substitute behavior is implemented_.
78
78
  *
79
79
  * @default 'firstElement'
80
80
  */
81
- focusOnMount?: 'firstElement' | boolean;
81
+ focusOnMount?: useFocusOnMount.Mode;
82
82
  /**
83
83
  * A callback invoked when the focus leaves the opened popover. This should
84
84
  * only be provided in advanced use-cases when a popover should close under
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/popover/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,KAAK,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACjD,KAAK,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AACjD,KAAK,cAAc,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1D,KAAK,wBAAwB,GAAG,OAAO,GAAG;IACzC,aAAa,CAAC,EAAE,QAAQ,CAAC;CACzB,CAAC;AAEF,KAAK,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC;AAE9C,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,CACvD,OAAO,GAAG,IAAI,GAAG,SAAS,CAC1B,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1E,MAAM,MAAM,cAAc,GAAG,IAAI,CAAE,OAAO,EAAE,uBAAuB,CAAE,GAAG;IACvE,aAAa,CAAC,EAAE,QAAQ,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAC1B;;;;;OAKG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AC;IACjC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,wBAAwB,CAAC;IACtC;;;;;;OAMG;IACH,SAAS,CAAC,EACP,OAAO,GACP,yBAAyB,GACzB,yBAAyB,GACzB,KAAK,CAAC;IACT;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CACf,wBAAwB,EAAE,OAAO,GAAG,IAAI,KACpC,wBAAwB,CAAC;IAC9B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"private-apis.d.ts","sourceRoot":"","sources":["../src/private-apis.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,WAAW,IAAK,CAAC"}
1
+ {"version":3,"file":"private-apis.d.ts","sourceRoot":"","sources":["../src/private-apis.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,WAAW,IAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"select-control-styles.d.ts","sourceRoot":"","sources":["../../../src/select-control/styles/select-control-styles.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAKnD,UAAU,WACT,SAAQ,IAAI,CACX,kBAAkB,EAClB,uBAAuB,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAC7D;IAGD,UAAU,CAAC,EAAE,kBAAkB,CAAE,MAAM,CAAE,CAAC;CAC1C;AAuBD,eAAO,MAAM,eAAe;;;;wBAM3B,CAAC;AAiDF,eAAO,MAAM,eAAe,KAAK,CAAC;AAmDlC,eAAO,MAAM,MAAM;;;mIAuBlB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;yGAO5B,CAAC;AAEF,eAAO,MAAM,yCAAyC;;;;UAOrD,CAAC"}
1
+ {"version":3,"file":"select-control-styles.d.ts","sourceRoot":"","sources":["../../../src/select-control/styles/select-control-styles.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAKnD,UAAU,WACT,SAAQ,IAAI,CACX,kBAAkB,EAClB,uBAAuB,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAC7D;IAGD,UAAU,CAAC,EAAE,kBAAkB,CAAE,MAAM,CAAE,CAAC;CAC1C;AAuBD,eAAO,MAAM,eAAe;;;;wBAM3B,CAAC;AAiDF,eAAO,MAAM,eAAe,KAAK,CAAC;AAmDlC,eAAO,MAAM,MAAM;;;mIAwBlB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;yGAO5B,CAAC;AAEF,eAAO,MAAM,yCAAyC;;;;UAOrD,CAAC"}
@@ -23,7 +23,7 @@ export declare function useToolsPanel(props: WordPressComponentProps<ToolsPanelP
23
23
  toggleItem: (label: string) => void;
24
24
  className: string;
25
25
  children: import("react").ReactNode;
26
- dropdownMenuProps?: React.ComponentProps<typeof import("../..").DropdownMenu>;
26
+ dropdownMenuProps?: Omit<React.ComponentProps<typeof import("../..").DropdownMenu>, "label">;
27
27
  label: string;
28
28
  defaultValue?: string | number | readonly string[] | undefined;
29
29
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -17,7 +17,7 @@ export type ToolsPanelProps = {
17
17
  /**
18
18
  * The dropdown menu props to configure the panel's `DropdownMenu`.
19
19
  */
20
- dropdownMenuProps?: React.ComponentProps<typeof DropdownMenu>;
20
+ dropdownMenuProps?: Omit<React.ComponentProps<typeof DropdownMenu>, 'label'>;
21
21
  /**
22
22
  * Flags that the items in this ToolsPanel will be contained within an inner
23
23
  * wrapper element allowing the panel to lay them out accordingly.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/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AC5C,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,CAAE,MAAM,EAAE,OAAO,CAAE,EAAE,CAAC;IAC7B,UAAU,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACvC,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;IACvC,aAAa,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC"}
@@ -33,7 +33,7 @@ export type TooltipProps = {
33
33
  /**
34
34
  * Where the tooltip should be positioned relative to its parent.
35
35
  *
36
- * @default bottom
36
+ * @default top
37
37
  */
38
38
  placement?: Placement;
39
39
  /**
@@ -45,7 +45,7 @@ export type TooltipProps = {
45
45
  * `"bottom"` y axis, and `"left"`, `"center"`, `"right"` x axis.
46
46
  *
47
47
  * @deprecated
48
- * @default bottom
48
+ * @default top
49
49
  */
50
50
  position?: PopoverProps['position'];
51
51
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/visually-hidden/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,eAAO,MAAM,cAAc,EAAE,aAY5B,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/visually-hidden/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,eAAO,MAAM,cAAc,EAAE,aAa5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "32.3.1-next.v.202602241322.0+bce7cff88",
3
+ "version": "32.4.1-next.v.202603102151.0+59e17f9ec",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -51,7 +51,7 @@
51
51
  "src/**/*.scss"
52
52
  ],
53
53
  "dependencies": {
54
- "@ariakit/react": "^0.4.21",
54
+ "@ariakit/react": "^0.4.22",
55
55
  "@date-fns/utc": "^2.1.1",
56
56
  "@emotion/cache": "^11.14.0",
57
57
  "@emotion/css": "^11.13.5",
@@ -64,24 +64,24 @@
64
64
  "@types/highlight-words-core": "1.2.1",
65
65
  "@types/react": "^18.3.27",
66
66
  "@use-gesture/react": "^10.3.1",
67
- "@wordpress/a11y": "^4.40.1-next.v.202602241322.0+bce7cff88",
68
- "@wordpress/base-styles": "^6.16.1-next.v.202602241322.0+bce7cff88",
69
- "@wordpress/compose": "^7.40.1-next.v.202602241322.0+bce7cff88",
70
- "@wordpress/date": "^5.40.1-next.v.202602241322.0+bce7cff88",
71
- "@wordpress/deprecated": "^4.40.1-next.v.202602241322.0+bce7cff88",
72
- "@wordpress/dom": "^4.40.1-next.v.202602241322.0+bce7cff88",
73
- "@wordpress/element": "^6.40.1-next.v.202602241322.0+bce7cff88",
74
- "@wordpress/escape-html": "^3.40.1-next.v.202602241322.0+bce7cff88",
75
- "@wordpress/hooks": "^4.40.1-next.v.202602241322.0+bce7cff88",
76
- "@wordpress/html-entities": "^4.40.1-next.v.202602241322.0+bce7cff88",
77
- "@wordpress/i18n": "^6.13.1-next.v.202602241322.0+bce7cff88",
78
- "@wordpress/icons": "^11.7.1-next.v.202602241322.0+bce7cff88",
79
- "@wordpress/is-shallow-equal": "^5.40.1-next.v.202602241322.0+bce7cff88",
80
- "@wordpress/keycodes": "^4.40.1-next.v.202602241322.0+bce7cff88",
81
- "@wordpress/primitives": "^4.40.1-next.v.202602241322.0+bce7cff88",
82
- "@wordpress/private-apis": "^1.40.1-next.v.202602241322.0+bce7cff88",
83
- "@wordpress/rich-text": "^7.40.1-next.v.202602241322.0+bce7cff88",
84
- "@wordpress/warning": "^3.40.1-next.v.202602241322.0+bce7cff88",
67
+ "@wordpress/a11y": "^4.41.1-next.v.202603102151.0+59e17f9ec",
68
+ "@wordpress/base-styles": "^6.17.1-next.v.202603102151.0+59e17f9ec",
69
+ "@wordpress/compose": "^7.41.1-next.v.202603102151.0+59e17f9ec",
70
+ "@wordpress/date": "^5.41.1-next.v.202603102151.0+59e17f9ec",
71
+ "@wordpress/deprecated": "^4.41.1-next.v.202603102151.0+59e17f9ec",
72
+ "@wordpress/dom": "^4.41.1-next.v.202603102151.0+59e17f9ec",
73
+ "@wordpress/element": "^6.41.1-next.v.202603102151.0+59e17f9ec",
74
+ "@wordpress/escape-html": "^3.41.1-next.v.202603102151.0+59e17f9ec",
75
+ "@wordpress/hooks": "^4.41.1-next.v.202603102151.0+59e17f9ec",
76
+ "@wordpress/html-entities": "^4.41.1-next.v.202603102151.0+59e17f9ec",
77
+ "@wordpress/i18n": "^6.14.1-next.v.202603102151.0+59e17f9ec",
78
+ "@wordpress/icons": "^12.0.1-next.v.202603102151.0+59e17f9ec",
79
+ "@wordpress/is-shallow-equal": "^5.41.1-next.v.202603102151.0+59e17f9ec",
80
+ "@wordpress/keycodes": "^4.41.1-next.v.202603102151.0+59e17f9ec",
81
+ "@wordpress/primitives": "^4.41.1-next.v.202603102151.0+59e17f9ec",
82
+ "@wordpress/private-apis": "^1.41.1-next.v.202603102151.0+59e17f9ec",
83
+ "@wordpress/rich-text": "^7.41.1-next.v.202603102151.0+59e17f9ec",
84
+ "@wordpress/warning": "^3.41.1-next.v.202603102151.0+59e17f9ec",
85
85
  "change-case": "^4.1.2",
86
86
  "clsx": "^2.1.1",
87
87
  "colord": "^2.7.0",
@@ -107,7 +107,7 @@
107
107
  "@storybook/react-vite": "^10.1.11",
108
108
  "@testing-library/jest-dom": "^6.9.1",
109
109
  "@types/jest": "^29.5.14",
110
- "@wordpress/jest-console": "^8.40.1-next.v.202602241322.0+bce7cff88",
110
+ "@wordpress/jest-console": "^8.41.1-next.v.202603102151.0+59e17f9ec",
111
111
  "snapshot-diff": "^0.10.0",
112
112
  "storybook": "^10.1.11",
113
113
  "timezone-mock": "^1.3.6"
@@ -119,5 +119,5 @@
119
119
  "publishConfig": {
120
120
  "access": "public"
121
121
  },
122
- "gitHead": "943dde7f0b600ce238726c36284bc9f70ce0ffa4"
122
+ "gitHead": "86db21e727d89e8f0dbba9300d2f97fd22b08693"
123
123
  }
@@ -159,6 +159,17 @@ export const WithSelectedDateAndMonth: Story = {
159
159
  },
160
160
  };
161
161
 
162
+ /**
163
+ * Shows days from adjacent months in the grid. Outside days use a lighter style
164
+ * and are still interactive. Use `fixedWeeks` to keep the grid height constant.
165
+ */
166
+ export const WithOutsideDays: Story = {
167
+ args: {
168
+ showOutsideDays: true,
169
+ fixedWeeks: true,
170
+ },
171
+ };
172
+
162
173
  /**
163
174
  * When working with time zones, use the `TZDate` object exported by this package instead of the native `Date` object.
164
175
  */
@@ -162,6 +162,17 @@ export const WithSelectedRangeAndMonth: Story = {
162
162
  },
163
163
  };
164
164
 
165
+ /**
166
+ * Shows days from adjacent months in the grid. Outside days use a lighter style
167
+ * and are still interactive. Use `fixedWeeks` to keep the grid height constant.
168
+ */
169
+ export const WithOutsideDays: Story = {
170
+ args: {
171
+ showOutsideDays: true,
172
+ fixedWeeks: true,
173
+ },
174
+ };
175
+
165
176
  /**
166
177
  * When working with time zones, use the `TZDate` object exported by this package instead of the native `Date` object.
167
178
  */
@@ -253,6 +253,11 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
253
253
  }
254
254
  }
255
255
 
256
+ // Outside month days (visible when showOutsideDays is true): use a lighter text color.
257
+ .components-calendar__day--outside {
258
+ color: $components-color-gray-600;
259
+ }
260
+
256
261
  // Hidden button (ie. outside current month but still rendered)
257
262
  .components-calendar__day--hidden {
258
263
  visibility: hidden;
@@ -187,6 +187,18 @@ export interface BaseProps
187
187
  * @default 1
188
188
  */
189
189
  numberOfMonths?: number;
190
+ /**
191
+ * When `true`, days from adjacent months are shown in the grid and receive
192
+ * the `outside` modifier and the class.
193
+ * @default false
194
+ */
195
+ showOutsideDays?: boolean;
196
+ /**
197
+ * When `true`, the calendar always shows a fixed number of weeks (e.g. 6)
198
+ * so the grid height does not change between months.
199
+ * @default false
200
+ */
201
+ fixedWeeks?: boolean;
190
202
  /**
191
203
  * The earliest month to start the month navigation.
192
204
  */
@@ -7,6 +7,7 @@ const CLASSNAMES = {
7
7
  root: 'components-calendar',
8
8
  day: 'components-calendar__day',
9
9
  day_button: 'components-calendar__day-button',
10
+ outside: 'components-calendar__day--outside',
10
11
  caption_label: 'components-calendar__caption-label',
11
12
  button_next: 'components-calendar__button-next',
12
13
  button_previous: 'components-calendar__button-previous',
@@ -68,6 +68,7 @@ export const DayButton = styled( Button, {
68
68
  grid-column: ${ ( props ) => props.column };
69
69
  position: relative;
70
70
  justify-content: center;
71
+ padding: 0;
71
72
 
72
73
  ${ ( props ) =>
73
74
  props.disabled &&
@@ -1,11 +1,5 @@
1
- /**
2
- * External dependencies
3
- */
1
+ import type { useFocusOnMount } from '@wordpress/compose';
4
2
  import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from 'react';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
3
  import type Popover from '../popover';
10
4
  import type { PopoverProps } from '../popover/types';
11
5
 
@@ -42,16 +36,17 @@ export type DropdownProps = {
42
36
  */
43
37
  expandOnMobile?: boolean;
44
38
  /**
45
- * By default, the first tabbable element in the popover will receive focus
46
- * when it mounts. This is the same as setting this prop to "firstElement".
47
- * Specifying a true value will focus the container instead.
48
- * Specifying a false value disables the focus handling entirely
49
- * (this should only be done when an appropriately accessible
50
- * substitute behavior exists).
39
+ * Determines focus behavior when the dialog mounts.
40
+ *
41
+ * - `"firstElement"` focuses the first tabbable element within.
42
+ * - `"firstInputElement"` focuses the first value control within.
43
+ * - `true` focuses the element itself.
44
+ * - `false` does nothing and _should not be used unless an accessible
45
+ * substitute behavior is implemented_.
51
46
  *
52
47
  * @default 'firstElement'
53
48
  */
54
- focusOnMount?: 'firstElement' | boolean;
49
+ focusOnMount?: useFocusOnMount.Mode;
55
50
  /**
56
51
  * Set this to customize the text that is shown in the dropdown's header
57
52
  * when it is fullscreen on mobile.
@@ -25,6 +25,7 @@
25
25
  flex: 1;
26
26
  font-family: inherit;
27
27
  font-size: 16px;
28
+ line-height: 1; // Override forms.css styles
28
29
  width: 100%;
29
30
  max-width: 100%;
30
31
  margin-left: 4px;
@@ -8,6 +8,7 @@ import * as Ariakit from '@ariakit/react';
8
8
  */
9
9
  import { forwardRef, useContext } from '@wordpress/element';
10
10
  import { Icon } from '@wordpress/icons';
11
+ import { SVG, Circle } from '@wordpress/primitives';
11
12
 
12
13
  /**
13
14
  * Internal dependencies
@@ -16,7 +17,6 @@ import type { WordPressComponentProps } from '../context';
16
17
  import { Context } from './context';
17
18
  import type { RadioItemProps } from './types';
18
19
  import * as Styled from './styles';
19
- import { SVG, Circle } from '@wordpress/primitives';
20
20
 
21
21
  const radioCheck = (
22
22
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
@@ -51,14 +51,18 @@ export type ModalProps = {
51
51
  */
52
52
  contentLabel?: string;
53
53
  /**
54
- * If this property is true, it will focus the first tabbable element
55
- * rendered in the modal.
54
+ * Determines focus behavior when the modal opens.
55
+ *
56
+ * - `"firstElement"` focuses the first tabbable element within.
57
+ * - `"firstInputElement"` focuses the first value control within.
58
+ * - `"firstContentElement"` focuses the first tabbable element within the modal’s content element.
59
+ * - `true` focuses the element itself.
60
+ * - `false` does nothing and _should not be used unless an accessible
61
+ * substitute behavior is implemented_.
56
62
  *
57
63
  * @default true
58
64
  */
59
- focusOnMount?:
60
- | Parameters< typeof useFocusOnMount >[ 0 ]
61
- | 'firstContentElement';
65
+ focusOnMount?: useFocusOnMount.Mode | 'firstContentElement';
62
66
  /**
63
67
  * Elements that are injected into the modal header to the left of the close button (if rendered).
64
68
  * Hidden if `__experimentalHideHeader` is `true`.
@@ -9,7 +9,7 @@ exports[`Notice should match snapshot 1`] = `
9
9
  class="components-visually-hidden css-1ragr82-PolymorphicDiv emotion-0"
10
10
  data-wp-c16t="true"
11
11
  data-wp-component="VisuallyHidden"
12
- 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;"
12
+ 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;"
13
13
  >
14
14
  Notice
15
15
  </div>
@@ -1,8 +1,6 @@
1
- /**
2
- * External dependencies
3
- */
4
- import type { ReactNode, MutableRefObject, SyntheticEvent } from 'react';
5
1
  import type { Placement } from '@floating-ui/react-dom';
2
+ import type { useFocusOnMount } from '@wordpress/compose';
3
+ import type { MutableRefObject, ReactNode, SyntheticEvent } from 'react';
6
4
 
7
5
  type PositionYAxis = 'top' | 'middle' | 'bottom';
8
6
  type PositionXAxis = 'left' | 'center' | 'right';
@@ -75,15 +73,17 @@ export type PopoverProps = {
75
73
  */
76
74
  constrainTabbing?: boolean;
77
75
  /**
78
- * By default, the _first tabbable element_ in the popover will receive focus
79
- * when it mounts. This is the same as setting this prop to `"firstElement"`.
80
- * Specifying a `false` value disables the focus handling entirely (this
81
- * should only be done when an appropriately accessible substitute behavior
82
- * exists).
76
+ * Determines focus behavior when the popover mounts.
77
+ *
78
+ * - `"firstElement"` focuses the first tabbable element within.
79
+ * - `"firstInputElement"` focuses the first value control within.
80
+ * - `true` focuses the element itself.
81
+ * - `false` does nothing and _should not be used unless an accessible
82
+ * substitute behavior is implemented_.
83
83
  *
84
84
  * @default 'firstElement'
85
85
  */
86
- focusOnMount?: 'firstElement' | boolean;
86
+ focusOnMount?: useFocusOnMount.Mode;
87
87
  /**
88
88
  * A callback invoked when the focus leaves the opened popover. This should
89
89
  * only be provided in advanced use-cases when a popover should close under
@@ -14,8 +14,6 @@ import { Tabs } from './tabs';
14
14
  import { kebabCase, normalizeTextString } from './utils/strings';
15
15
  import { withIgnoreIMEEvents } from './utils/with-ignore-ime-events';
16
16
  import { lock } from './lock-unlock';
17
- import Avatar from './avatar';
18
- import AvatarGroup from './avatar-group';
19
17
  import Badge from './badge';
20
18
 
21
19
  import { DateCalendar, DateRangeCalendar, TZDate } from './calendar';
@@ -36,8 +34,6 @@ import { ValidatedFormTokenField } from './validated-form-controls/components/fo
36
34
  export const privateApis = {};
37
35
  lock( privateApis, {
38
36
  __experimentalPopoverLegacyPositionToPlacement,
39
- Avatar,
40
- AvatarGroup,
41
37
  ComponentsContext,
42
38
  Tabs,
43
39
  Theme,
@@ -162,6 +162,7 @@ export const Select = styled.select< SelectProps >`
162
162
  cursor: inherit;
163
163
  display: block;
164
164
  font-family: inherit;
165
+ line-height: 1.3; // Override forms.css styles, large enough value to prevent descender clipping without affecting height
165
166
  margin: 0;
166
167
  width: 100%;
167
168
  max-width: none;
package/src/style.scss CHANGED
@@ -1,8 +1,6 @@
1
1
  @use "@wordpress/base-styles/mixins" as *;
2
2
  @use "./animate/style.scss" as *;
3
3
  @use "./autocomplete/style.scss" as *;
4
- @use "./avatar/styles.scss" as *;
5
- @use "./avatar-group/styles.scss" as *;
6
4
  @use "./badge/styles.scss" as *;
7
5
  @use "./button-group/style.scss" as *;
8
6
  @use "./button/style.scss" as *;
@@ -20,7 +20,10 @@ export type ToolsPanelProps = {
20
20
  /**
21
21
  * The dropdown menu props to configure the panel's `DropdownMenu`.
22
22
  */
23
- dropdownMenuProps?: React.ComponentProps< typeof DropdownMenu >;
23
+ dropdownMenuProps?: Omit<
24
+ React.ComponentProps< typeof DropdownMenu >,
25
+ 'label'
26
+ >;
24
27
  /**
25
28
  * Flags that the items in this ToolsPanel will be contained within an inner
26
29
  * wrapper element allowing the panel to lay them out accordingly.
@@ -51,7 +51,7 @@ Option to hide the tooltip when the anchor is clicked.
51
51
  Used to specify the tooltip's placement with respect to its anchor.
52
52
 
53
53
  - Required: No
54
- - Default: `'bottom'`
54
+ - Default: `'top'`
55
55
 
56
56
  #### `position`: `string`
57
57
 
@@ -60,7 +60,7 @@ _Note: use the `placement` prop instead when possible._
60
60
  Legacy way to specify the popover's position with respect to its anchor. Specify y- and x-axis as a space-separated string. Supports `'top'`, `'middle'`, `'bottom'` y axis, and `'left'`, `'center'`, `'right'` x axis.
61
61
 
62
62
  - Required: No
63
- - Default: `'bottom'`
63
+ - Default: `'top'`
64
64
 
65
65
  #### `shortcut`: `string` | `object`
66
66
 
@@ -58,7 +58,7 @@ function UnforwardedTooltip(
58
58
  // Compute tooltip's placement:
59
59
  // - give priority to `placement` prop, if defined
60
60
  // - otherwise, compute it from the legacy `position` prop (if defined)
61
- // - finally, fallback to the default placement: 'bottom'
61
+ // - finally, fallback to the default placement: 'top'
62
62
  let computedPlacement;
63
63
  if ( placement !== undefined ) {
64
64
  computedPlacement = placement;
@@ -69,7 +69,7 @@ function UnforwardedTooltip(
69
69
  alternative: '`placement` prop',
70
70
  } );
71
71
  }
72
- computedPlacement = computedPlacement || 'bottom';
72
+ computedPlacement = computedPlacement || 'top';
73
73
 
74
74
  const tooltipStore = Ariakit.useTooltipStore( {
75
75
  placement: computedPlacement,
@@ -35,7 +35,7 @@ export type TooltipProps = {
35
35
  /**
36
36
  * Where the tooltip should be positioned relative to its parent.
37
37
  *
38
- * @default bottom
38
+ * @default top
39
39
  */
40
40
  placement?: Placement;
41
41
  /**
@@ -47,7 +47,7 @@ export type TooltipProps = {
47
47
  * `"bottom"` y axis, and `"left"`, `"center"`, `"right"` x axis.
48
48
  *
49
49
  * @deprecated
50
- * @default bottom
50
+ * @default top
51
51
  */
52
52
  position?: PopoverProps[ 'position' ];
53
53
  /**
@@ -15,4 +15,5 @@ export const visuallyHidden: CSSProperties = {
15
15
  position: 'absolute',
16
16
  width: '1px',
17
17
  wordWrap: 'normal',
18
+ wordBreak: 'normal',
18
19
  };
@@ -5,7 +5,7 @@ exports[`VisuallyHidden should render correctly 1`] = `
5
5
  class="components-visually-hidden css-1ragr82-PolymorphicDiv emotion-0"
6
6
  data-wp-c16t="true"
7
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;"
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
9
  >
10
10
  This is hidden
11
11
  </div>