@wordpress/components 35.0.1 → 35.1.1-next.v.202606191442.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 (264) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/build/alignment-matrix-control/cell.cjs +1 -1
  3. package/build/alignment-matrix-control/cell.cjs.map +2 -2
  4. package/build/alignment-matrix-control/index.cjs +1 -1
  5. package/build/alignment-matrix-control/index.cjs.map +2 -2
  6. package/build/angle-picker-control/angle-circle.cjs +1 -1
  7. package/build/angle-picker-control/angle-circle.cjs.map +2 -2
  8. package/build/angle-picker-control/index.cjs +2 -2
  9. package/build/autocomplete/get-autocomplete-match.cjs.map +1 -1
  10. package/build/autocomplete/index.cjs.map +1 -1
  11. package/build/base-control/styles/base-control-styles.cjs +6 -6
  12. package/build/base-control/styles/base-control-styles.cjs.map +2 -2
  13. package/build/border-control/styles.cjs +17 -14
  14. package/build/border-control/styles.cjs.map +2 -2
  15. package/build/button/index.cjs +3 -7
  16. package/build/button/index.cjs.map +2 -2
  17. package/build/card/card-divider/hook.cjs.map +2 -2
  18. package/build/color-palette/index.cjs.map +1 -1
  19. package/build/color-picker/component.cjs.map +1 -1
  20. package/build/date-time/utils.cjs.map +1 -1
  21. package/build/draggable/index.cjs.map +1 -1
  22. package/build/external-link/index.cjs +1 -1
  23. package/build/external-link/index.cjs.map +1 -1
  24. package/build/menu/popover.cjs.map +1 -1
  25. package/build/menu/styles.cjs +17 -17
  26. package/build/menu/styles.cjs.map +2 -2
  27. package/build/modal/index.cjs.map +1 -1
  28. package/build/modal/use-modal-exit-animation.cjs +37 -52
  29. package/build/modal/use-modal-exit-animation.cjs.map +2 -2
  30. package/build/palette-edit/index.cjs +1 -1
  31. package/build/progress-bar/index.cjs +1 -1
  32. package/build/progress-bar/index.cjs.map +2 -2
  33. package/build/query-controls/index.cjs +2 -2
  34. package/build/query-controls/index.cjs.map +2 -2
  35. package/build/range-control/index.cjs.map +1 -1
  36. package/build/sandbox/index.cjs +7 -1
  37. package/build/sandbox/index.cjs.map +2 -2
  38. package/build/snackbar/index.cjs +1 -1
  39. package/build/spinner/styles.cjs +4 -4
  40. package/build/spinner/styles.cjs.map +2 -2
  41. package/build/tabs/index.cjs +0 -18
  42. package/build/tabs/index.cjs.map +2 -2
  43. package/build/tabs/tablist.cjs +5 -15
  44. package/build/tabs/tablist.cjs.map +2 -2
  45. package/build/tools-panel/styles.cjs +13 -13
  46. package/build/tools-panel/styles.cjs.map +2 -2
  47. package/build/tools-panel/tools-panel/hook.cjs.map +1 -1
  48. package/build/tree-select/index.cjs +1 -1
  49. package/build/tree-select/index.cjs.map +1 -1
  50. package/build/truncate/utils.cjs +1 -1
  51. package/build/truncate/utils.cjs.map +1 -1
  52. package/build/utils/colors-values.cjs +12 -12
  53. package/build/utils/colors-values.cjs.map +2 -2
  54. package/build/utils/config-values.cjs +2 -2
  55. package/build/utils/config-values.cjs.map +2 -2
  56. package/build/utils/dropdown-motion.cjs.map +2 -2
  57. package/build/utils/strings.cjs.map +1 -1
  58. package/build-module/alignment-matrix-control/cell.mjs +1 -1
  59. package/build-module/alignment-matrix-control/cell.mjs.map +2 -2
  60. package/build-module/alignment-matrix-control/index.mjs +1 -1
  61. package/build-module/alignment-matrix-control/index.mjs.map +2 -2
  62. package/build-module/angle-picker-control/angle-circle.mjs +1 -1
  63. package/build-module/angle-picker-control/angle-circle.mjs.map +2 -2
  64. package/build-module/angle-picker-control/index.mjs +2 -2
  65. package/build-module/autocomplete/get-autocomplete-match.mjs.map +1 -1
  66. package/build-module/autocomplete/index.mjs.map +1 -1
  67. package/build-module/base-control/styles/base-control-styles.mjs +6 -6
  68. package/build-module/base-control/styles/base-control-styles.mjs.map +2 -2
  69. package/build-module/border-control/styles.mjs +17 -14
  70. package/build-module/border-control/styles.mjs.map +2 -2
  71. package/build-module/button/index.mjs +2 -5
  72. package/build-module/button/index.mjs.map +2 -2
  73. package/build-module/card/card-divider/hook.mjs.map +2 -2
  74. package/build-module/color-palette/index.mjs.map +1 -1
  75. package/build-module/color-picker/component.mjs.map +1 -1
  76. package/build-module/date-time/utils.mjs.map +1 -1
  77. package/build-module/draggable/index.mjs.map +1 -1
  78. package/build-module/external-link/index.mjs +1 -1
  79. package/build-module/external-link/index.mjs.map +1 -1
  80. package/build-module/menu/popover.mjs.map +1 -1
  81. package/build-module/menu/styles.mjs +17 -17
  82. package/build-module/menu/styles.mjs.map +2 -2
  83. package/build-module/modal/index.mjs.map +1 -1
  84. package/build-module/modal/use-modal-exit-animation.mjs +37 -52
  85. package/build-module/modal/use-modal-exit-animation.mjs.map +2 -2
  86. package/build-module/palette-edit/index.mjs +1 -1
  87. package/build-module/progress-bar/index.mjs +1 -1
  88. package/build-module/progress-bar/index.mjs.map +2 -2
  89. package/build-module/query-controls/index.mjs +2 -2
  90. package/build-module/query-controls/index.mjs.map +2 -2
  91. package/build-module/range-control/index.mjs.map +1 -1
  92. package/build-module/sandbox/index.mjs +3 -1
  93. package/build-module/sandbox/index.mjs.map +2 -2
  94. package/build-module/snackbar/index.mjs +1 -1
  95. package/build-module/spinner/styles.mjs +4 -4
  96. package/build-module/spinner/styles.mjs.map +2 -2
  97. package/build-module/tabs/index.mjs +1 -19
  98. package/build-module/tabs/index.mjs.map +2 -2
  99. package/build-module/tabs/tablist.mjs +5 -15
  100. package/build-module/tabs/tablist.mjs.map +2 -2
  101. package/build-module/tools-panel/styles.mjs +13 -13
  102. package/build-module/tools-panel/styles.mjs.map +2 -2
  103. package/build-module/tools-panel/tools-panel/hook.mjs.map +1 -1
  104. package/build-module/tree-select/index.mjs +1 -1
  105. package/build-module/tree-select/index.mjs.map +1 -1
  106. package/build-module/truncate/utils.mjs +1 -1
  107. package/build-module/truncate/utils.mjs.map +1 -1
  108. package/build-module/utils/colors-values.mjs +12 -12
  109. package/build-module/utils/colors-values.mjs.map +2 -2
  110. package/build-module/utils/config-values.mjs +2 -2
  111. package/build-module/utils/config-values.mjs.map +2 -2
  112. package/build-module/utils/dropdown-motion.mjs.map +2 -2
  113. package/build-module/utils/strings.mjs.map +1 -1
  114. package/build-style/style-rtl.css +82 -82
  115. package/build-style/style.css +82 -82
  116. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  117. package/build-types/border-control/styles.d.ts.map +1 -1
  118. package/build-types/button/index.d.ts +0 -2
  119. package/build-types/button/index.d.ts.map +1 -1
  120. package/build-types/card/card-divider/hook.d.ts +1 -274
  121. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  122. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  123. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  124. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  125. package/build-types/menu/styles.d.ts.map +1 -1
  126. package/build-types/menu/types.d.ts +2 -2
  127. package/build-types/sandbox/index.d.ts +15 -0
  128. package/build-types/sandbox/index.d.ts.map +1 -1
  129. package/build-types/spinner/styles.d.ts.map +1 -1
  130. package/build-types/tabs/index.d.ts.map +1 -1
  131. package/build-types/tabs/tablist.d.ts.map +1 -1
  132. package/build-types/tools-panel/styles.d.ts.map +1 -1
  133. package/build-types/utils/colors-values.d.ts.map +1 -1
  134. package/build-types/utils/dropdown-motion.d.ts.map +1 -1
  135. package/build-types/validated-form-controls/components/combobox-control.d.ts +1 -1
  136. package/package.json +34 -28
  137. package/src/angle-picker-control/angle-circle.tsx +3 -3
  138. package/src/base-control/README.md +2 -2
  139. package/src/base-control/styles/base-control-styles.ts +1 -0
  140. package/src/border-control/styles.ts +1 -0
  141. package/src/button/index.tsx +2 -4
  142. package/src/button/style.scss +3 -3
  143. package/src/card/card-divider/hook.ts +5 -1
  144. package/src/card/test/__snapshots__/index.tsx.snap +3 -3
  145. package/src/composite/stories/index.story.tsx +5 -0
  146. package/src/confirm-dialog/stories/index.story.tsx +1 -0
  147. package/src/dropdown/stories/index.story.tsx +5 -0
  148. package/src/dropdown-menu/style.scss +1 -1
  149. package/src/external-link/style.scss +4 -4
  150. package/src/form-toggle/style.scss +1 -1
  151. package/src/heading/test/__snapshots__/index.tsx.snap +4 -4
  152. package/src/menu/README.md +2 -2
  153. package/src/menu/styles.ts +2 -0
  154. package/src/menu/test/index.tsx +120 -87
  155. package/src/menu/types.ts +2 -2
  156. package/src/modal/style.scss +1 -1
  157. package/src/modal/use-modal-exit-animation.ts +2 -2
  158. package/src/notice/style.scss +11 -13
  159. package/src/panel/README.md +2 -0
  160. package/src/panel/stories/index.story.tsx +2 -2
  161. package/src/panel/style.scss +1 -1
  162. package/src/radio-control/style.scss +1 -1
  163. package/src/sandbox/index.tsx +18 -1
  164. package/src/sandbox/test/index.tsx +44 -1
  165. package/src/spinner/styles.ts +1 -0
  166. package/src/tab-panel/style.scss +6 -6
  167. package/src/tabs/index.tsx +1 -26
  168. package/src/tabs/tablist.tsx +5 -21
  169. package/src/tabs/test/index.tsx +16 -27
  170. package/src/text/test/__snapshots__/index.tsx.snap +3 -3
  171. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +34 -26
  172. package/src/toolbar/toolbar-group/style.scss +2 -2
  173. package/src/tools-panel/styles.ts +1 -1
  174. package/src/tooltip/stories/index.story.tsx +2 -2
  175. package/src/utils/colors-values.js +36 -16
  176. package/src/utils/config-values.js +2 -2
  177. package/src/utils/dropdown-motion.ts +6 -4
  178. package/src/utils/theme-variables.scss +18 -13
  179. package/build-types/card/context.d.ts +0 -3
  180. package/build-types/card/context.d.ts.map +0 -1
  181. package/build-types/date-time/date/index.d.ts +0 -23
  182. package/build-types/date-time/date/index.d.ts.map +0 -1
  183. package/build-types/date-time/date/styles.d.ts +0 -45
  184. package/build-types/date-time/date/styles.d.ts.map +0 -1
  185. package/build-types/date-time/date/test/index.d.ts +0 -2
  186. package/build-types/date-time/date/test/index.d.ts.map +0 -1
  187. package/build-types/date-time/date/test/use-lilius.d.ts +0 -2
  188. package/build-types/date-time/date/test/use-lilius.d.ts.map +0 -1
  189. package/build-types/date-time/date/use-lilius/index.d.ts +0 -169
  190. package/build-types/date-time/date/use-lilius/index.d.ts.map +0 -1
  191. package/build-types/date-time/time/index.d.ts +0 -27
  192. package/build-types/date-time/time/index.d.ts.map +0 -1
  193. package/build-types/date-time/time/styles.d.ts +0 -93
  194. package/build-types/date-time/time/styles.d.ts.map +0 -1
  195. package/build-types/date-time/time/test/index.d.ts +0 -2
  196. package/build-types/date-time/time/test/index.d.ts.map +0 -1
  197. package/build-types/date-time/time/time-input/index.d.ts +0 -4
  198. package/build-types/date-time/time/time-input/index.d.ts.map +0 -1
  199. package/build-types/date-time/time/time-input/test/index.d.ts +0 -2
  200. package/build-types/date-time/time/time-input/test/index.d.ts.map +0 -1
  201. package/build-types/date-time/time/timezone.d.ts +0 -7
  202. package/build-types/date-time/time/timezone.d.ts.map +0 -1
  203. package/build-types/mobile/image/constants.d.ts +0 -5
  204. package/build-types/mobile/image/constants.d.ts.map +0 -1
  205. package/build-types/navigation/back-button/index.d.ts +0 -7
  206. package/build-types/navigation/back-button/index.d.ts.map +0 -1
  207. package/build-types/navigation/constants.d.ts +0 -3
  208. package/build-types/navigation/constants.d.ts.map +0 -1
  209. package/build-types/navigation/context.d.ts +0 -4
  210. package/build-types/navigation/context.d.ts.map +0 -1
  211. package/build-types/navigation/group/context.d.ts +0 -7
  212. package/build-types/navigation/group/context.d.ts.map +0 -1
  213. package/build-types/navigation/group/index.d.ts +0 -7
  214. package/build-types/navigation/group/index.d.ts.map +0 -1
  215. package/build-types/navigation/index.d.ts +0 -46
  216. package/build-types/navigation/index.d.ts.map +0 -1
  217. package/build-types/navigation/item/base-content.d.ts +0 -3
  218. package/build-types/navigation/item/base-content.d.ts.map +0 -1
  219. package/build-types/navigation/item/base.d.ts +0 -3
  220. package/build-types/navigation/item/base.d.ts.map +0 -1
  221. package/build-types/navigation/item/index.d.ts +0 -7
  222. package/build-types/navigation/item/index.d.ts.map +0 -1
  223. package/build-types/navigation/item/use-navigation-tree-item.d.ts +0 -3
  224. package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +0 -1
  225. package/build-types/navigation/menu/context.d.ts +0 -7
  226. package/build-types/navigation/menu/context.d.ts.map +0 -1
  227. package/build-types/navigation/menu/index.d.ts +0 -7
  228. package/build-types/navigation/menu/index.d.ts.map +0 -1
  229. package/build-types/navigation/menu/menu-title-search.d.ts +0 -3
  230. package/build-types/navigation/menu/menu-title-search.d.ts.map +0 -1
  231. package/build-types/navigation/menu/menu-title.d.ts +0 -3
  232. package/build-types/navigation/menu/menu-title.d.ts.map +0 -1
  233. package/build-types/navigation/menu/search-no-results-found.d.ts +0 -3
  234. package/build-types/navigation/menu/search-no-results-found.d.ts.map +0 -1
  235. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +0 -3
  236. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +0 -1
  237. package/build-types/navigation/stories/index.story.d.ts +0 -23
  238. package/build-types/navigation/stories/index.story.d.ts.map +0 -1
  239. package/build-types/navigation/stories/utils/controlled-state.d.ts +0 -7
  240. package/build-types/navigation/stories/utils/controlled-state.d.ts.map +0 -1
  241. package/build-types/navigation/stories/utils/default.d.ts +0 -10
  242. package/build-types/navigation/stories/utils/default.d.ts.map +0 -1
  243. package/build-types/navigation/stories/utils/group.d.ts +0 -10
  244. package/build-types/navigation/stories/utils/group.d.ts.map +0 -1
  245. package/build-types/navigation/stories/utils/hide-if-empty.d.ts +0 -10
  246. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +0 -1
  247. package/build-types/navigation/stories/utils/more-examples.d.ts +0 -10
  248. package/build-types/navigation/stories/utils/more-examples.d.ts.map +0 -1
  249. package/build-types/navigation/stories/utils/search.d.ts +0 -10
  250. package/build-types/navigation/stories/utils/search.d.ts.map +0 -1
  251. package/build-types/navigation/styles/navigation-styles.d.ts +0 -55
  252. package/build-types/navigation/styles/navigation-styles.d.ts.map +0 -1
  253. package/build-types/navigation/test/index.d.ts +0 -2
  254. package/build-types/navigation/test/index.d.ts.map +0 -1
  255. package/build-types/navigation/types.d.ts +0 -266
  256. package/build-types/navigation/types.d.ts.map +0 -1
  257. package/build-types/navigation/use-create-navigation-tree.d.ts +0 -15
  258. package/build-types/navigation/use-create-navigation-tree.d.ts.map +0 -1
  259. package/build-types/navigation/use-navigation-tree-nodes.d.ts +0 -10
  260. package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +0 -1
  261. package/build-types/navigation/utils.d.ts +0 -3
  262. package/build-types/navigation/utils.d.ts.map +0 -1
  263. package/build-types/visually-hidden/test/index.d.ts +0 -2
  264. package/build-types/visually-hidden/test/index.d.ts.map +0 -1
@@ -1,55 +0,0 @@
1
- export declare const NavigationUI: import("@emotion/styled").StyledComponent<{
2
- theme?: import("@emotion/react").Theme;
3
- as?: React.ElementType;
4
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
- export declare const MenuUI: import("@emotion/styled").StyledComponent<{
6
- theme?: import("@emotion/react").Theme;
7
- as?: React.ElementType;
8
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
9
- export declare const MenuBackButtonUI: import("@emotion/styled").StyledComponent<((import("../../button/types").ButtonProps & import("../../button/types").DeprecatedButtonProps) & import("react").RefAttributes<any>) & {
10
- theme?: import("@emotion/react").Theme;
11
- }, {}, {}>;
12
- export declare const MenuTitleUI: import("@emotion/styled").StyledComponent<{
13
- theme?: import("@emotion/react").Theme;
14
- as?: React.ElementType;
15
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
16
- export declare const MenuTitleSearchControlWrapper: import("@emotion/styled").StyledComponent<{
17
- theme?: import("@emotion/react").Theme;
18
- as?: React.ElementType;
19
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
20
- export declare const MenuTitleActionsUI: import("@emotion/styled").StyledComponent<{
21
- theme?: import("@emotion/react").Theme;
22
- as?: React.ElementType;
23
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
24
- export declare const GroupTitleUI: import("@emotion/styled").StyledComponent<Omit<import("../../text/types").Props, "color" | "isBlock" | "weight"> & {
25
- level?: import("../../heading/types").HeadingSize;
26
- isBlock?: import("../../text/types").Props['isBlock'];
27
- color?: import("../../text/types").Props['color'];
28
- weight?: import("../../text/types").Props['weight'];
29
- } & import("react").RefAttributes<any> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">, "adjustLineHeightForInnerControls" | "align" | "as" | "children" | "color" | "display" | "ellipsis" | "ellipsizeMode" | "highlightCaseSensitive" | "highlightEscape" | "highlightSanitize" | "highlightWords" | "isBlock" | "isDestructive" | "letterSpacing" | "level" | "limit" | "lineHeight" | "numberOfLines" | "optimizeReadabilityFor" | "size" | "truncate" | "upperCase" | "variant" | "weight" | keyof import("react").RefAttributes<any>> & {
30
- as?: keyof import("react").JSX.IntrinsicElements | undefined;
31
- } & {
32
- theme?: import("@emotion/react").Theme;
33
- }, {}, {}>;
34
- export declare const ItemBaseUI: import("@emotion/styled").StyledComponent<{
35
- theme?: import("@emotion/react").Theme;
36
- as?: React.ElementType;
37
- }, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
38
- export declare const ItemUI: import("@emotion/styled").StyledComponent<{
39
- theme?: import("@emotion/react").Theme;
40
- as?: React.ElementType;
41
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
42
- export declare const ItemIconUI: import("@emotion/styled").StyledComponent<{
43
- theme?: import("@emotion/react").Theme;
44
- as?: React.ElementType;
45
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
46
- export declare const ItemBadgeUI: import("@emotion/styled").StyledComponent<{
47
- theme?: import("@emotion/react").Theme;
48
- as?: React.ElementType;
49
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
50
- export declare const ItemTitleUI: import("@emotion/styled").StyledComponent<import("../../text/types").Props & import("react").RefAttributes<any> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "as" | keyof import("../../text/types").Props | keyof import("react").RefAttributes<any>> & {
51
- as?: keyof import("react").JSX.IntrinsicElements | undefined;
52
- } & {
53
- theme?: import("@emotion/react").Theme;
54
- }, {}, {}>;
55
- //# sourceMappingURL=navigation-styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"navigation-styles.d.ts","sourceRoot":"","sources":["../../../src/navigation/styles/navigation-styles.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,YAAY;;;yGAKxB,CAAC;AAEF,eAAO,MAAM,MAAM;;;yGAiBlB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;UAiB5B,CAAC;AAEF,eAAO,MAAM,WAAW;;;yGAGvB,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;yGAGzC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;2GAoB9B,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;UAaxB,CAAC;AAEF,eAAO,MAAM,UAAU;;;yGAqCtB,CAAC;AAEF,eAAO,MAAM,MAAM;;;yGAYlB,CAAC;AAEF,eAAO,MAAM,UAAU;;;2GAGtB,CAAC;AAEF,eAAO,MAAM,WAAW;;;2GAmBvB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;UAKvB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/navigation/test/index.tsx"],"names":[],"mappings":""}
@@ -1,266 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import type { ButtonProps } from '../button/types';
5
- type IfDiscriminantDefinedBothRequired<TDiscriminant, TOther> = {
6
- [K in keyof (TDiscriminant & TOther)]: NonNullable<(TDiscriminant & TOther)[K]>;
7
- } | ({
8
- [K in keyof TDiscriminant]?: never;
9
- } & {
10
- [K in keyof TOther]?: TOther[K];
11
- });
12
- export type NavigationProps = {
13
- /**
14
- * The active item slug.
15
- */
16
- activeItem?: string;
17
- /**
18
- * The active menu slug.
19
- *
20
- * @default 'root'
21
- */
22
- activeMenu?: string;
23
- /**
24
- * The children components.
25
- */
26
- children?: React.ReactNode;
27
- /**
28
- * Optional classname for the component.
29
- */
30
- className?: string;
31
- /**
32
- * Callback used to sync the active menu between the external state
33
- * and the Navigation's internal state.
34
- */
35
- onActivateMenu?: (activeMenuSlug: string) => void;
36
- };
37
- type _NavigationMenuSearchProps = IfDiscriminantDefinedBothRequired<{
38
- /**
39
- * When the `hasSearch` prop is `true`, this callback handles the search
40
- * input's `onChange` event, making it controlled from the outside.
41
- * When using this prop, the `search` prop should be also set.
42
- */
43
- onSearch: (searchString: string) => void;
44
- }, {
45
- /**
46
- * When the `hasSearch` is `true` and the `onSearch` prop is provided, this
47
- * prop controls the value of the search input.
48
- * Required when the `onSearch` prop is provided.
49
- */
50
- search: string;
51
- }>;
52
- export type NavigationMenuProps = _NavigationMenuSearchProps & {
53
- /**
54
- * The back button label used in nested menus.
55
- * If not provided, the label will be inferred from the parent menu's title.
56
- * If the parent menu's title is not available then it will default to "Back".
57
- *
58
- * @default parentMenuTitle ?? 'Back'
59
- */
60
- backButtonLabel?: string;
61
- /**
62
- * A callback to handle clicking on the back button.
63
- * If this prop is provided then the back button will be shown.
64
- */
65
- onBackButtonClick?: React.MouseEventHandler<HTMLElement>;
66
- /**
67
- * The children components.
68
- */
69
- children?: React.ReactNode;
70
- /**
71
- * Optional classname for the component.
72
- */
73
- className?: string;
74
- /**
75
- * When `true`, enables the search feature on the menu title.
76
- */
77
- hasSearch?: boolean;
78
- /**
79
- * Indicates whether the menu is empty or not. Used together with the
80
- * `hideIfTargetMenuEmpty` prop of `NavigationItem`.
81
- */
82
- isEmpty?: boolean;
83
- /**
84
- * Indicates whether the search is debouncing or not. In case of `true`, the
85
- * "No results found." text is omitted. Used to prevent showing the
86
- * "No results found." text between debounced searches.
87
- */
88
- isSearchDebouncing?: boolean;
89
- /**
90
- * The unique identifier of the menu.
91
- * The root menu can omit this prop, and it will default to "root".
92
- * All other menus need to specify it.
93
- *
94
- * @default 'root'
95
- */
96
- menu?: string;
97
- /**
98
- * The parent menu slug; used by nested menus to indicate their parent menu.
99
- */
100
- parentMenu?: string;
101
- /**
102
- * The menu title. It's also the field used by the menu search function.
103
- */
104
- title?: string;
105
- /**
106
- * Use this prop to render additional actions in the menu title.
107
- */
108
- titleAction?: React.ReactNode;
109
- };
110
- export type NavigationGroupProps = {
111
- /**
112
- * Optional classname for the component.
113
- */
114
- className?: string;
115
- /**
116
- * The group title.
117
- */
118
- title?: string;
119
- /**
120
- * The children components.
121
- */
122
- children: React.ReactNode;
123
- };
124
- type _NavigationItemButtonProps = (ButtonProps & {
125
- /**
126
- * If set to `true` the menu item will only act as a text-only item,
127
- * rather than a `<button />` or `<a />` element.
128
- */
129
- isText?: false;
130
- }) | {
131
- /**
132
- * If set to `true` the menu item will only act as a text-only item,
133
- * rather than a `<button />` or `<a />` element.
134
- */
135
- isText: true;
136
- };
137
- export type NavigationItemBaseProps = {
138
- /**
139
- * The item badge content.
140
- */
141
- badge?: string | number;
142
- /**
143
- * The children components. When not specified, the item will render the
144
- * default item UI.
145
- */
146
- children?: React.ReactNode;
147
- /**
148
- * Optional classname for the component.
149
- */
150
- className?: string;
151
- /**
152
- * If provided, causes the component to render an `<a />` element
153
- * instead of a `<button />` element.
154
- */
155
- href?: string;
156
- /**
157
- * If no `children` are passed, this prop allows to specify a custom icon for
158
- * the menu item.
159
- */
160
- icon?: React.JSX.Element;
161
- /**
162
- * The unique identifier of the item.
163
- */
164
- item?: string;
165
- /**
166
- * The child menu slug. If provided, clicking on the item will navigate
167
- * to the target menu.
168
- */
169
- navigateToMenu?: string;
170
- /**
171
- * Indicates whether this item should be hidden if the menu specified in
172
- * `navigateToMenu` is marked as empty in the `isEmpty` prop.
173
- * Used together with the `isEmpty` prop of `NavigationMenu`.
174
- */
175
- hideIfTargetMenuEmpty?: boolean;
176
- /**
177
- * A callback to handle clicking on a menu item.
178
- *
179
- * @default noop
180
- */
181
- onClick?: React.MouseEventHandler;
182
- /**
183
- * The item title.
184
- */
185
- title?: string;
186
- };
187
- export type NavigationItemProps = _NavigationItemButtonProps & NavigationItemBaseProps;
188
- export type NavigationItemBaseContentProps = Pick<NavigationItemProps, 'badge' | 'title'>;
189
- export type NavigationBackButtonProps = {
190
- /**
191
- * The text displayed for the button
192
- */
193
- backButtonLabel?: string;
194
- /**
195
- * Optional classname for the component.
196
- */
197
- className?: string;
198
- /**
199
- * If provided, causes the component to render an `<a />` element
200
- * instead of a `<button />` element.
201
- */
202
- href?: string;
203
- /**
204
- * Callback function called when the button is clicked.
205
- */
206
- onClick?: React.MouseEventHandler;
207
- /**
208
- * Id of the parent menu
209
- */
210
- parentMenu?: string;
211
- };
212
- export type NavigationMenuTitleSearchProps = Pick<NavigationMenuProps, 'onSearch' | 'search' | 'title'> & {
213
- debouncedSpeak: (message: string, ariaLive?: 'off' | 'polite' | 'assertive') => void;
214
- onCloseSearch: () => void;
215
- };
216
- export type NavigationMenuTitleProps = Pick<NavigationMenuProps, 'hasSearch' | 'onSearch' | 'search' | 'title' | 'titleAction'>;
217
- export type NavigationSearchNoResultsFoundProps = Pick<NavigationMenuProps, 'search'>;
218
- export type Item = Omit<NavigationItemBaseProps, 'children'> & {
219
- /**
220
- * The group id
221
- */
222
- group?: string;
223
- /**
224
- * The menu id
225
- */
226
- menu?: string;
227
- /**
228
- * True is the item is currently visible (ie. the item is part
229
- * of the active menu, and — if there is a search query — its title
230
- * matches the search query).
231
- */
232
- _isVisible: boolean;
233
- };
234
- export type Menu = Omit<NavigationMenuProps, 'children'> & {
235
- menu: string;
236
- };
237
- export type NavigationGroupContext = {
238
- /**
239
- * The unique id of the group
240
- */
241
- group?: string;
242
- };
243
- export type NavigationMenuContext = {
244
- menu?: string;
245
- search?: string;
246
- };
247
- export type NavigationContext = {
248
- activeItem?: string;
249
- activeMenu: string;
250
- setActiveMenu: (parentMenu: string, animationDirection?: 'left' | 'right') => void;
251
- navigationTree: {
252
- items: Record<string, Item>;
253
- getItem: (itemId: string) => Item | undefined;
254
- addItem: (itemId: string, itemProps: Item) => void;
255
- removeItem: (itemId: string) => void;
256
- menus: Record<string, Menu>;
257
- getMenu: (menuId: string) => Menu | undefined;
258
- addMenu: (menuId: string, menuProps: Menu) => void;
259
- removeMenu: (menuId: string) => void;
260
- childMenu: Record<string, string[]>;
261
- traverseMenu: (startMenu: string, callback: (menuObject: Menu) => boolean | undefined) => void;
262
- isMenuEmpty: (menuId: string) => boolean;
263
- };
264
- };
265
- export {};
266
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/navigation/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,KAAK,iCAAiC,CAAE,aAAa,EAAE,MAAM,IAG1D;KACE,CAAC,IAAI,MAAM,CAAE,aAAa,GAAG,MAAM,CAAE,GAAI,WAAW,CACrD,CAAE,aAAa,GAAG,MAAM,CAAE,CAAE,CAAC,CAAE,CAC/B;CACA,GAGD,CAAE;KACA,CAAC,IAAI,MAAM,aAAa,CAAE,CAAC,EAAE,KAAK;CACnC,GAAG;KACF,CAAC,IAAI,MAAM,MAAM,CAAE,CAAC,EAAE,MAAM,CAAE,CAAC,CAAE;CAClC,CAAE,CAAC;AAIP,MAAM,MAAM,eAAe,GAAG;IAC7B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;I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V,cAAc,EAAE;QACf,KAAK,EAAE,MAAM,CAAE,MAAM,EAAE,IAAI,CAAE,CAAC;QAC9B,OAAO,EAAE,CAAE,MAAM,EAAE,MAAM,KAAM,IAAI,GAAG,SAAS,CAAC;QAChD,OAAO,EAAE,CAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,KAAM,IAAI,CAAC;QACrD,UAAU,EAAE,CAAE,MAAM,EAAE,MAAM,KAAM,IAAI,CAAC;QAEvC,KAAK,EAAE,MAAM,CAAE,MAAM,EAAE,IAAI,CAAE,CAAC;QAC9B,OAAO,EAAE,CAAE,MAAM,EAAE,MAAM,KAAM,IAAI,GAAG,SAAS,CAAC;QAChD,OAAO,EAAE,CAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,KAAM,IAAI,CAAC;QACrD,UAAU,EAAE,CAAE,MAAM,EAAE,MAAM,KAAM,IAAI,CAAC;QACvC,SAAS,EAAE,MAAM,CAAE,MAAM,EAAE,MAAM,EAAE,CAAE,CAAC;QACtC,YAAY,EAAE,CACb,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAE,UAAU,EAAE,IAAI,KAAM,OAAO,GAAG,SAAS,KACjD,IAAI,CAAC;QACV,WAAW,EAAE,CAAE,MAAM,EAAE,MAAM,KAAM,OAAO,CAAC;KAC3C,CAAC;CACF,CAAC"}
@@ -1,15 +0,0 @@
1
- import type { Item, Menu } from './types';
2
- export declare const useCreateNavigationTree: () => {
3
- items: Record<string, Omit<Item, "children">>;
4
- getItem: (key: string) => Omit<Item, "children">;
5
- addItem: (key: string, value: Item) => void;
6
- removeItem: (key: string) => void;
7
- menus: Record<string, Omit<Menu, "children">>;
8
- getMenu: (key: string) => Omit<Menu, "children">;
9
- addMenu: (key: string, value: Menu) => void;
10
- removeMenu: (key: string) => void;
11
- childMenu: Record<string, string[]>;
12
- traverseMenu: (startMenu: string, callback: (menuObject: Menu) => boolean | undefined) => void;
13
- isMenuEmpty: (menuToCheck: string) => boolean;
14
- };
15
- //# sourceMappingURL=use-create-navigation-tree.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-create-navigation-tree.d.ts","sourceRoot":"","sources":["../../src/navigation/use-create-navigation-tree.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAqB,IAAI,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE7D,eAAO,MAAM,uBAAuB;;;;;;;mBAyElB,MAAM,SAAS,IAAI;;;;+BAvBD,MAAM;CA+CzC,CAAC"}
@@ -1,10 +0,0 @@
1
- export declare function useNavigationTreeNodes<TNode extends {
2
- children?: React.ReactNode;
3
- [key: string]: unknown;
4
- }>(): {
5
- nodes: Record<string, Omit<TNode, "children">>;
6
- getNode: (key: string) => Omit<TNode, "children">;
7
- addNode: (key: string, value: TNode) => void;
8
- removeNode: (key: string) => void;
9
- };
10
- //# sourceMappingURL=use-navigation-tree-nodes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-navigation-tree-nodes.d.ts","sourceRoot":"","sources":["../../src/navigation/use-navigation-tree-nodes.tsx"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,CACrC,KAAK,SAAS;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,CAAE,GAAG,EAAE,MAAM,GAAI,OAAO,CAAA;CAAE;;mBAM/C,MAAM;mBAEN,MAAM,SAAS,KAAK;;EAgB3C"}
@@ -1,3 +0,0 @@
1
- export declare const normalizeInput: (input: string) => string;
2
- export declare const normalizedSearch: (title: string, search: string) => boolean;
3
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/navigation/utils.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,UAAY,MAAM,WACa,CAAC;AAE3D,eAAO,MAAM,gBAAgB,UAAY,MAAM,UAAU,MAAM,YACI,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/visually-hidden/test/index.tsx"],"names":[],"mappings":""}