@astryxdesign/core 0.7.1-canary.ff40b78 → 0.7.1

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 (348) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/dist/Button/Button.d.ts +1 -1
  3. package/dist/Button/Button.d.ts.map +1 -1
  4. package/dist/Button/Button.js +5 -2
  5. package/dist/Calendar/Calendar.d.ts.map +1 -1
  6. package/dist/Calendar/Calendar.js +191 -32
  7. package/dist/Chat/ChatComposerInput.d.ts +9 -0
  8. package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
  9. package/dist/Chat/ChatComposerInput.js +5 -0
  10. package/dist/Chat/ChatMessage.d.ts +11 -0
  11. package/dist/Chat/ChatMessage.d.ts.map +1 -1
  12. package/dist/Chat/ChatMessage.js +18 -9
  13. package/dist/Chat/useTriggerMenu.d.ts +9 -2
  14. package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
  15. package/dist/Chat/useTriggerMenu.js +222 -50
  16. package/dist/CodeBlock/CodeBlock.d.ts +10 -1
  17. package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
  18. package/dist/CodeBlock/CodeBlock.js +158 -38
  19. package/dist/CodeBlock/tokenizer.d.ts +39 -0
  20. package/dist/CodeBlock/tokenizer.d.ts.map +1 -1
  21. package/dist/CodeBlock/tokenizer.js +108 -0
  22. package/dist/CommandPalette/CommandPalette.d.ts +9 -5
  23. package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
  24. package/dist/CommandPalette/CommandPalette.js +38 -20
  25. package/dist/CommandPalette/CommandPaletteEmpty.d.ts +4 -3
  26. package/dist/CommandPalette/CommandPaletteEmpty.d.ts.map +1 -1
  27. package/dist/CommandPalette/CommandPaletteEmpty.js +4 -3
  28. package/dist/CommandPalette/CommandPaletteInput.d.ts +5 -4
  29. package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
  30. package/dist/CommandPalette/CommandPaletteInput.js +35 -18
  31. package/dist/CommandPalette/CommandPaletteItem.d.ts +11 -6
  32. package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
  33. package/dist/CommandPalette/CommandPaletteItem.js +8 -9
  34. package/dist/CommandPalette/CommandPaletteList.d.ts +4 -2
  35. package/dist/CommandPalette/CommandPaletteList.d.ts.map +1 -1
  36. package/dist/CommandPalette/CommandPaletteList.js +10 -5
  37. package/dist/ComplexSelector/ComplexSelector.d.ts +8 -5
  38. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  39. package/dist/ComplexSelector/ComplexSelector.js +12 -3
  40. package/dist/ContextMenu/ContextMenu.d.ts +3 -3
  41. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  42. package/dist/ContextMenu/ContextMenu.js +62 -48
  43. package/dist/DateInput/DateInput.js +1 -1
  44. package/dist/DateInput/MonthScroller.d.ts.map +1 -1
  45. package/dist/DateInput/MonthScroller.js +12 -4
  46. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  47. package/dist/DateRangeInput/DateRangeInput.js +12 -2
  48. package/dist/Dialog/Dialog.d.ts +1 -1
  49. package/dist/Dialog/Dialog.d.ts.map +1 -1
  50. package/dist/Dialog/Dialog.js +16 -5
  51. package/dist/Dialog/DialogHeader.d.ts +1 -1
  52. package/dist/Dialog/DialogHeader.d.ts.map +1 -1
  53. package/dist/Dialog/DialogHeader.js +7 -7
  54. package/dist/Divider/Divider.d.ts +1 -0
  55. package/dist/Divider/Divider.d.ts.map +1 -1
  56. package/dist/Divider/Divider.js +5 -4
  57. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  58. package/dist/DropdownMenu/DropdownMenu.js +161 -65
  59. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +7 -5
  60. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
  61. package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +12 -5
  62. package/dist/Field/InputClearButton.d.ts +8 -4
  63. package/dist/Field/InputClearButton.d.ts.map +1 -1
  64. package/dist/Field/InputClearButton.js +23 -7
  65. package/dist/FormLayout/FormLayout.d.ts.map +1 -1
  66. package/dist/FormLayout/FormLayout.js +1 -0
  67. package/dist/Grid/Grid.d.ts +13 -4
  68. package/dist/Grid/Grid.d.ts.map +1 -1
  69. package/dist/Grid/Grid.js +7 -1
  70. package/dist/HoverCard/useHoverCard.d.ts +1 -1
  71. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  72. package/dist/HoverCard/useHoverCard.js +67 -49
  73. package/dist/InputGroup/InputGroup.d.ts +2 -4
  74. package/dist/InputGroup/InputGroup.d.ts.map +1 -1
  75. package/dist/InputGroup/InputGroup.js +2 -4
  76. package/dist/InputGroup/groupStyles.d.ts +10 -2
  77. package/dist/InputGroup/groupStyles.d.ts.map +1 -1
  78. package/dist/InputGroup/groupStyles.js +19 -2
  79. package/dist/Layer/useLayerDismissal.d.ts +9 -9
  80. package/dist/Layer/useLayerDismissal.js +9 -9
  81. package/dist/Markdown/Markdown.d.ts.map +1 -1
  82. package/dist/Markdown/Markdown.js +25 -4
  83. package/dist/MobileNav/MobileNav.d.ts +7 -0
  84. package/dist/MobileNav/MobileNav.d.ts.map +1 -1
  85. package/dist/MobileNav/MobileNav.js +45 -2
  86. package/dist/MultiSelector/MultiSelector.d.ts +7 -4
  87. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  88. package/dist/MultiSelector/MultiSelector.js +24 -3
  89. package/dist/NumberInput/NumberInput.js +1 -1
  90. package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
  91. package/dist/PowerSearch/PowerSearchEditPopover.js +6 -0
  92. package/dist/Resizable/ResizeHandle.d.ts +1 -1
  93. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  94. package/dist/Resizable/ResizeHandle.js +83 -15
  95. package/dist/Resizable/useResizable.d.ts +23 -0
  96. package/dist/Resizable/useResizable.d.ts.map +1 -1
  97. package/dist/Resizable/useResizable.js +78 -0
  98. package/dist/Selector/Selector.d.ts +6 -3
  99. package/dist/Selector/Selector.d.ts.map +1 -1
  100. package/dist/Selector/Selector.js +28 -6
  101. package/dist/SideNav/SideNav.d.ts.map +1 -1
  102. package/dist/SideNav/SideNav.js +10 -2
  103. package/dist/Slider/Slider.d.ts.map +1 -1
  104. package/dist/Slider/Slider.js +18 -7
  105. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  106. package/dist/Tokenizer/Tokenizer.js +16 -4
  107. package/dist/Toolbar/Toolbar.d.ts +2 -1
  108. package/dist/Toolbar/Toolbar.d.ts.map +1 -1
  109. package/dist/Toolbar/Toolbar.js +3 -1
  110. package/dist/TreeList/TreeList.d.ts.map +1 -1
  111. package/dist/TreeList/TreeList.js +6 -3
  112. package/dist/TreeList/TreeListItem.d.ts.map +1 -1
  113. package/dist/TreeList/TreeListItem.js +7 -1
  114. package/dist/astryx.css +22 -0
  115. package/dist/hooks/useScrollOverflow.d.ts.map +1 -1
  116. package/dist/hooks/useScrollOverflow.js +55 -12
  117. package/dist/hooks/useTreeFocus.d.ts +21 -0
  118. package/dist/hooks/useTreeFocus.d.ts.map +1 -1
  119. package/dist/hooks/useTreeFocus.js +40 -2
  120. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  121. package/dist/i18n/generated-locales/en.generated.js +3 -0
  122. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  123. package/dist/i18n/generated-locales/pseudo.generated.js +3 -0
  124. package/dist/reset.a11y.chromium.spec.js +6 -1
  125. package/dist/reset.until-found.a11y.browser.spec.d.ts +2 -0
  126. package/dist/reset.until-found.a11y.browser.spec.d.ts.map +1 -0
  127. package/dist/reset.until-found.a11y.browser.spec.js +71 -0
  128. package/dist/theme/syntax/SyntaxTheme.d.ts.map +1 -1
  129. package/dist/theme/syntax/SyntaxTheme.js +43 -2
  130. package/dist/theme/syntax/defineSyntaxTheme.d.ts +18 -5
  131. package/dist/theme/syntax/defineSyntaxTheme.d.ts.map +1 -1
  132. package/dist/theme/syntax/defineSyntaxTheme.js +38 -9
  133. package/dist/theme/syntax/index.d.ts +1 -1
  134. package/dist/theme/syntax/index.d.ts.map +1 -1
  135. package/dist/theme/syntax/tokens.d.ts +12 -2
  136. package/dist/theme/syntax/tokens.d.ts.map +1 -1
  137. package/dist/theme/syntax/tokens.js +25 -4
  138. package/dist/utils/plainDate.d.ts +12 -0
  139. package/dist/utils/plainDate.d.ts.map +1 -1
  140. package/dist/utils/plainDate.js +63 -10
  141. package/locales/en.json +13 -1
  142. package/locales/pseudo.json +9 -0
  143. package/package.json +4 -4
  144. package/src/AlertDialog/AlertDialog.doc.mjs +6 -0
  145. package/src/AlertDialog/AlertDialog.spec.md +205 -0
  146. package/src/AlertDialog/AlertDialog.test.tsx +3 -14
  147. package/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts +115 -0
  148. package/src/AlertDialog/__tests__/AlertDialog.a11y.renders.tsx +52 -0
  149. package/src/AlertDialog/__tests__/AlertDialog.a11y.states.ts +68 -0
  150. package/src/AlertDialog/__tests__/AlertDialog.a11y.test.tsx +144 -0
  151. package/src/Button/Button.test.tsx +37 -0
  152. package/src/Button/Button.tsx +5 -1
  153. package/src/Calendar/Calendar.doc.mjs +234 -60
  154. package/src/Calendar/Calendar.spec.md +209 -0
  155. package/src/Calendar/Calendar.test.tsx +559 -20
  156. package/src/Calendar/Calendar.tsx +258 -41
  157. package/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts +126 -0
  158. package/src/Calendar/__tests__/Calendar.a11y.known-failures.ts +12 -0
  159. package/src/Calendar/__tests__/Calendar.a11y.renders.tsx +57 -0
  160. package/src/Calendar/__tests__/Calendar.a11y.states.ts +139 -0
  161. package/src/Calendar/__tests__/Calendar.a11y.test.tsx +137 -0
  162. package/src/Carousel/Carousel.test.tsx +54 -71
  163. package/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts +192 -0
  164. package/src/Carousel/__tests__/Carousel.a11y.known-failures.ts +27 -0
  165. package/src/Carousel/__tests__/Carousel.a11y.renders.tsx +39 -0
  166. package/src/Carousel/__tests__/Carousel.a11y.states.ts +139 -0
  167. package/src/Carousel/__tests__/Carousel.a11y.test.tsx +127 -0
  168. package/src/Chat/ChatComposerInput.doc.mjs +1 -1
  169. package/src/Chat/ChatComposerInput.spec.md +94 -55
  170. package/src/Chat/ChatComposerInput.test.tsx +202 -1
  171. package/src/Chat/ChatComposerInput.tsx +13 -0
  172. package/src/Chat/ChatMessage.doc.mjs +31 -16
  173. package/src/Chat/ChatMessage.spec.md +265 -0
  174. package/src/Chat/ChatMessage.test.tsx +246 -0
  175. package/src/Chat/ChatMessage.tsx +30 -7
  176. package/src/Chat/ChatSystemMessage.spec.md +36 -37
  177. package/src/Chat/ChatSystemMessage.test.tsx +4 -4
  178. package/src/Chat/useTriggerMenu.test.tsx +994 -0
  179. package/src/Chat/useTriggerMenu.tsx +278 -46
  180. package/src/CodeBlock/CodeBlock.doc.mjs +7 -0
  181. package/src/CodeBlock/CodeBlock.spec.md +40 -41
  182. package/src/CodeBlock/CodeBlock.test.tsx +89 -9
  183. package/src/CodeBlock/CodeBlock.tsx +205 -25
  184. package/src/CodeBlock/__tests__/CodeBlockOverflowStop.a11y.chromium.spec.ts +125 -0
  185. package/src/CodeBlock/__tests__/DiffRowPaint.a11y.chromium.spec.ts +93 -0
  186. package/src/CodeBlock/tokenizer.test.ts +112 -0
  187. package/src/CodeBlock/tokenizer.ts +106 -0
  188. package/src/Collapsible/CollapsibleGroup.spec.md +17 -8
  189. package/src/Collapsible/__tests__/CollapsibleGroup.a11y.renders.tsx +45 -0
  190. package/src/Collapsible/__tests__/CollapsibleGroup.a11y.states.ts +139 -0
  191. package/src/Collapsible/__tests__/CollapsibleGroup.a11y.test.tsx +135 -0
  192. package/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts +128 -0
  193. package/src/CommandPalette/CommandPalette.doc.mjs +126 -23
  194. package/src/CommandPalette/CommandPalette.spec.md +100 -49
  195. package/src/CommandPalette/CommandPalette.test.tsx +241 -2
  196. package/src/CommandPalette/CommandPalette.tsx +47 -21
  197. package/src/CommandPalette/CommandPaletteEmpty.tsx +4 -3
  198. package/src/CommandPalette/CommandPaletteInput.doc.mjs +61 -4
  199. package/src/CommandPalette/CommandPaletteInput.spec.md +215 -0
  200. package/src/CommandPalette/CommandPaletteInput.test.tsx +375 -51
  201. package/src/CommandPalette/CommandPaletteInput.tsx +74 -21
  202. package/src/CommandPalette/CommandPaletteItem.doc.mjs +73 -22
  203. package/src/CommandPalette/CommandPaletteItem.spec.md +223 -0
  204. package/src/CommandPalette/CommandPaletteItem.test.tsx +200 -5
  205. package/src/CommandPalette/CommandPaletteItem.tsx +16 -11
  206. package/src/CommandPalette/CommandPaletteList.doc.mjs +3 -3
  207. package/src/CommandPalette/CommandPaletteList.spec.md +41 -36
  208. package/src/CommandPalette/CommandPaletteList.test.tsx +80 -0
  209. package/src/CommandPalette/CommandPaletteList.tsx +10 -5
  210. package/src/CommandPalette/__tests__/CommandPalette.a11y.chromium.spec.ts +599 -0
  211. package/src/ComplexSelector/ComplexSelector.doc.mjs +10 -8
  212. package/src/ComplexSelector/ComplexSelector.spec.md +14 -9
  213. package/src/ComplexSelector/ComplexSelector.test.tsx +64 -16
  214. package/src/ComplexSelector/ComplexSelector.tsx +37 -8
  215. package/src/ContextMenu/ContextMenu.doc.mjs +6 -0
  216. package/src/ContextMenu/ContextMenu.spec.md +51 -53
  217. package/src/ContextMenu/ContextMenu.test.tsx +132 -1
  218. package/src/ContextMenu/ContextMenu.tsx +78 -48
  219. package/src/DateInput/DateInput.doc.mjs +52 -0
  220. package/src/DateInput/DateInput.spec.md +27 -15
  221. package/src/DateInput/DateInput.test.tsx +38 -0
  222. package/src/DateInput/DateInput.tsx +1 -1
  223. package/src/DateInput/DateInputTouch.test.tsx +22 -0
  224. package/src/DateInput/MonthScroller.tsx +12 -4
  225. package/src/DateRangeInput/DateRangeInput.test.tsx +49 -0
  226. package/src/DateRangeInput/DateRangeInput.tsx +20 -2
  227. package/src/Dialog/Dialog.test.tsx +27 -1
  228. package/src/Dialog/Dialog.tsx +16 -5
  229. package/src/Dialog/DialogHeader.test.tsx +27 -2
  230. package/src/Dialog/DialogHeader.tsx +7 -8
  231. package/src/Dialog/__tests__/Dialog.a11y.chromium.spec.ts +21 -14
  232. package/src/Divider/Divider.doc.mjs +5 -3
  233. package/src/Divider/Divider.spec.md +140 -54
  234. package/src/Divider/Divider.test.tsx +15 -0
  235. package/src/Divider/Divider.tsx +6 -4
  236. package/src/DropdownMenu/DropdownMenu.doc.mjs +2 -2
  237. package/src/DropdownMenu/DropdownMenu.spec.md +121 -45
  238. package/src/DropdownMenu/DropdownMenu.test.tsx +288 -23
  239. package/src/DropdownMenu/DropdownMenu.tsx +212 -81
  240. package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +38 -2
  241. package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +32 -18
  242. package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +146 -1
  243. package/src/DropdownMenu/__tests__/MenuButton.a11y.chromium.spec.ts +136 -0
  244. package/src/DropdownMenu/__tests__/MenuButton.a11y.known-failures.ts +12 -0
  245. package/src/DropdownMenu/__tests__/MenuButton.a11y.renders.tsx +67 -0
  246. package/src/DropdownMenu/__tests__/MenuButton.a11y.states.ts +141 -0
  247. package/src/DropdownMenu/__tests__/MenuButton.a11y.test.tsx +138 -0
  248. package/src/DropdownMenu/__tests__/MenuHeaderFooter.a11y.chromium.spec.ts +40 -5
  249. package/src/Field/InputClearButton.test.tsx +29 -4
  250. package/src/Field/InputClearButton.tsx +26 -8
  251. package/src/FieldStatus/__tests__/StatusMessage.a11y.chromium.spec.ts +21 -14
  252. package/src/FormLayout/FormLayout.tsx +1 -0
  253. package/src/FormLayout/__snapshots__/FormLayout.test.tsx.snap +1 -1
  254. package/src/Grid/Grid.doc.mjs +14 -11
  255. package/src/Grid/Grid.spec.md +50 -32
  256. package/src/Grid/Grid.tsx +13 -4
  257. package/src/HoverCard/HoverCard.test.tsx +46 -1
  258. package/src/HoverCard/useHoverCard.tsx +68 -48
  259. package/src/InputGroup/InputGroup.doc.mjs +11 -1
  260. package/src/InputGroup/InputGroup.tsx +2 -4
  261. package/src/InputGroup/groupStyles.ts +40 -2
  262. package/src/Layer/useLayerDismissal.ts +9 -9
  263. package/src/Link/__tests__/Link.a11y.chromium.spec.ts +142 -0
  264. package/src/Link/__tests__/Link.a11y.renders.tsx +97 -0
  265. package/src/Link/__tests__/Link.a11y.states.ts +104 -0
  266. package/src/Link/__tests__/Link.a11y.test.tsx +127 -0
  267. package/src/Markdown/Markdown.doc.mjs +1 -1
  268. package/src/Markdown/Markdown.fr23.perf.test.ts +161 -40
  269. package/src/Markdown/Markdown.spec.md +45 -23
  270. package/src/Markdown/Markdown.test.tsx +38 -0
  271. package/src/Markdown/Markdown.tsx +24 -2
  272. package/src/Markdown/plugins/semanticFence.test.tsx +3 -2
  273. package/src/MobileNav/MobileNav.tsx +50 -2
  274. package/src/MobileNav/MobileNavFocus.test.tsx +553 -0
  275. package/src/MoreMenu/MoreMenu.spec.md +18 -7
  276. package/src/MoreMenu/MoreMenu.test.tsx +38 -0
  277. package/src/MultiSelector/MultiSelector.doc.mjs +8 -8
  278. package/src/MultiSelector/MultiSelector.spec.md +1 -1
  279. package/src/MultiSelector/MultiSelector.test.tsx +188 -21
  280. package/src/MultiSelector/MultiSelector.tsx +50 -11
  281. package/src/NumberInput/NumberInput.test.tsx +24 -0
  282. package/src/NumberInput/NumberInput.tsx +1 -1
  283. package/src/NumberInput/__tests__/NumberInput.a11y.chromium.spec.ts +22 -15
  284. package/src/PowerSearch/PowerSearchEditPopover.test.tsx +78 -0
  285. package/src/PowerSearch/PowerSearchEditPopover.tsx +6 -0
  286. package/src/Resizable/Resizable.spec.md +41 -9
  287. package/src/Resizable/ResizeHandle.test.tsx +565 -2
  288. package/src/Resizable/ResizeHandle.tsx +126 -21
  289. package/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts +119 -0
  290. package/src/Resizable/__tests__/ResizeHandle.a11y.known-failures.ts +39 -0
  291. package/src/Resizable/__tests__/ResizeHandle.a11y.renders.tsx +80 -0
  292. package/src/Resizable/__tests__/ResizeHandle.a11y.states.ts +197 -0
  293. package/src/Resizable/__tests__/ResizeHandle.a11y.test.tsx +123 -0
  294. package/src/Resizable/useResizable.ts +95 -0
  295. package/src/Selector/Selector.doc.mjs +7 -6
  296. package/src/Selector/Selector.spec.md +37 -24
  297. package/src/Selector/Selector.test.tsx +176 -10
  298. package/src/Selector/Selector.tsx +59 -14
  299. package/src/Selector/__tests__/Combobox.a11y.known-failures.ts +27 -0
  300. package/src/Selector/__tests__/Combobox.a11y.states.ts +145 -0
  301. package/src/Selector/__tests__/Selector.combobox.a11y.chromium.spec.ts +108 -0
  302. package/src/Selector/__tests__/Selector.combobox.a11y.test.tsx +126 -0
  303. package/src/SideNav/SideNav.test.tsx +35 -0
  304. package/src/SideNav/SideNav.tsx +16 -2
  305. package/src/Slider/Slider.spec.md +43 -17
  306. package/src/Slider/Slider.test.tsx +134 -0
  307. package/src/Slider/Slider.tsx +29 -6
  308. package/src/Slider/__tests__/Slider.a11y.chromium.spec.ts +112 -0
  309. package/src/Slider/__tests__/Slider.a11y.known-failures.ts +12 -0
  310. package/src/Slider/__tests__/Slider.a11y.renders.tsx +42 -0
  311. package/src/Slider/__tests__/Slider.a11y.states.ts +106 -0
  312. package/src/Slider/__tests__/Slider.a11y.test.tsx +105 -0
  313. package/src/Switch/__tests__/Switch.a11y.chromium.spec.ts +25 -18
  314. package/src/TabList/__tests__/Tabs.a11y.chromium.spec.ts +19 -12
  315. package/src/TextInput/__tests__/TextInput.a11y.chromium.spec.ts +21 -14
  316. package/src/ToggleButton/__tests__/ToggleButton.a11y.chromium.spec.ts +18 -11
  317. package/src/Tokenizer/Tokenizer.test.tsx +87 -0
  318. package/src/Tokenizer/Tokenizer.tsx +31 -3
  319. package/src/Toolbar/Toolbar.test.tsx +131 -4
  320. package/src/Toolbar/Toolbar.tsx +3 -1
  321. package/src/TreeList/TreeList.spec.md +33 -8
  322. package/src/TreeList/TreeList.test.tsx +72 -0
  323. package/src/TreeList/TreeList.tsx +10 -6
  324. package/src/TreeList/TreeListItem.tsx +5 -0
  325. package/src/TreeList/__tests__/TreeList.a11y.chromium.spec.ts +125 -0
  326. package/src/TreeList/__tests__/TreeList.a11y.renders.tsx +44 -0
  327. package/src/TreeList/__tests__/TreeList.a11y.states.ts +164 -0
  328. package/src/TreeList/__tests__/TreeList.a11y.test.tsx +138 -0
  329. package/src/TreeList/__tests__/TreeListRowNames.a11y.chromium.spec.ts +82 -0
  330. package/src/hooks/useScrollOverflow.test.tsx +222 -0
  331. package/src/hooks/useScrollOverflow.ts +55 -13
  332. package/src/hooks/useTreeFocus.test.tsx +37 -0
  333. package/src/hooks/useTreeFocus.ts +55 -2
  334. package/src/i18n/generated-locales/en.generated.ts +3 -0
  335. package/src/i18n/generated-locales/pseudo.generated.ts +3 -0
  336. package/src/reset.a11y.chromium.spec.ts +9 -1
  337. package/src/reset.css +8 -3
  338. package/src/reset.until-found.a11y.browser.spec.ts +75 -0
  339. package/src/reset.until-found.test.ts +32 -0
  340. package/src/stylexValidation.source-build.test.mjs +42 -0
  341. package/src/theme/syntax/SyntaxTheme.tsx +46 -5
  342. package/src/theme/syntax/defineSyntaxTheme.diff.test.ts +91 -0
  343. package/src/theme/syntax/defineSyntaxTheme.ts +75 -15
  344. package/src/theme/syntax/index.ts +5 -1
  345. package/src/theme/syntax/tokens.ts +32 -2
  346. package/src/theme/syntax/useSyntaxTheme.diff.test.tsx +40 -0
  347. package/src/utils/plainDate.test.ts +147 -0
  348. package/src/utils/plainDate.ts +75 -10
@@ -0,0 +1,139 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file CollapsibleGroup.a11y.states.ts
5
+ * @input CollapsibleGroup's representative accordion states and the facts the ACCORDION_PATTERN contract reads
6
+ * @output COLLAPSIBLE_GROUP_ACCORDION_STATES and the explicit ownership exclusions for this binding
7
+ * @position Binding inventory shared by the jsdom test and the Chromium spec (component:CollapsibleGroup AR4)
8
+ */
9
+
10
+ import type {AccordionStateFacts} from '@astryxdesign/a11y-spec';
11
+
12
+ export interface CollapsibleGroupAccordionState {
13
+ readonly id: string;
14
+ readonly summary: string;
15
+ readonly storyId: string;
16
+ /** The subject header's visible label. */
17
+ readonly label: string;
18
+ /** The header that follows the subject in the page Tab order, when one exists. */
19
+ readonly nextLabel?: string;
20
+ /** The other header that starts expanded in a single-expansion group, when one exists. */
21
+ readonly openSiblingLabel?: string;
22
+ readonly facts: AccordionStateFacts;
23
+ readonly type: 'single' | 'multiple';
24
+ /** Values open at mount. */
25
+ readonly defaultValue: ReadonlyArray<string>;
26
+ /** Items that are disabled at mount. */
27
+ readonly disabled?: ReadonlyArray<string>;
28
+ }
29
+
30
+ const ITEMS = [
31
+ {value: 'profile', label: 'Profile settings'},
32
+ {value: 'privacy', label: 'Privacy settings'},
33
+ {value: 'notifications', label: 'Notification settings'},
34
+ ] as const;
35
+
36
+ export const COLLAPSIBLE_GROUP_ITEMS = ITEMS;
37
+
38
+ function facts(
39
+ overrides: Partial<AccordionStateFacts> = {},
40
+ ): AccordionStateFacts {
41
+ return {
42
+ expanded: false,
43
+ operable: true,
44
+ focusable: true,
45
+ single: true,
46
+ hasNextHeader: true,
47
+ hasOpenSibling: true,
48
+ ...overrides,
49
+ };
50
+ }
51
+
52
+ const story = (id: string) => `a11y-collapsiblegroup-accordion--${id}`;
53
+
54
+ export const COLLAPSIBLE_GROUP_ACCORDION_STATES = [
55
+ {
56
+ id: 'single-collapsed-middle',
57
+ summary:
58
+ 'the collapsed middle header of a single-expansion group whose first header is open',
59
+ storyId: story('single-collapsed-middle'),
60
+ label: 'Privacy settings',
61
+ nextLabel: 'Notification settings',
62
+ openSiblingLabel: 'Profile settings',
63
+ facts: facts(),
64
+ type: 'single',
65
+ defaultValue: ['profile'],
66
+ },
67
+ {
68
+ id: 'single-expanded-first',
69
+ summary: 'the expanded first header of a single-expansion group',
70
+ storyId: story('single-expanded-first'),
71
+ label: 'Profile settings',
72
+ nextLabel: 'Privacy settings',
73
+ facts: facts({expanded: true, hasOpenSibling: false}),
74
+ type: 'single',
75
+ defaultValue: ['profile'],
76
+ },
77
+ {
78
+ id: 'multiple-collapsed-last',
79
+ summary:
80
+ 'the collapsed last header of a group that allows several open panels',
81
+ storyId: story('multiple-collapsed-last'),
82
+ label: 'Notification settings',
83
+ facts: facts({
84
+ single: false,
85
+ hasNextHeader: false,
86
+ hasOpenSibling: false,
87
+ }),
88
+ type: 'multiple',
89
+ defaultValue: ['profile', 'privacy'],
90
+ },
91
+ {
92
+ id: 'single-disabled-collapsed',
93
+ summary:
94
+ 'a disabled collapsed header that stays named and exposed but leaves the Tab order and cannot be toggled',
95
+ storyId: story('single-disabled-collapsed'),
96
+ label: 'Privacy settings',
97
+ facts: facts({
98
+ operable: false,
99
+ focusable: false,
100
+ hasNextHeader: false,
101
+ hasOpenSibling: false,
102
+ }),
103
+ type: 'single',
104
+ defaultValue: ['profile'],
105
+ disabled: ['privacy'],
106
+ },
107
+ {
108
+ id: 'single-disabled-expanded',
109
+ summary:
110
+ 'a disabled header whose panel stays open: it says aria-disabled, leaves the Tab order, and cannot be collapsed',
111
+ storyId: story('single-disabled-expanded'),
112
+ label: 'Profile settings',
113
+ facts: facts({
114
+ expanded: true,
115
+ operable: false,
116
+ focusable: false,
117
+ hasNextHeader: false,
118
+ hasOpenSibling: false,
119
+ }),
120
+ type: 'single',
121
+ defaultValue: ['profile'],
122
+ disabled: ['profile'],
123
+ },
124
+ ] as const satisfies ReadonlyArray<CollapsibleGroupAccordionState>;
125
+
126
+ export const COLLAPSIBLE_GROUP_ACCORDION_EXCLUSIONS = [
127
+ {
128
+ id: 'collapsible-disclosure-semantics',
129
+ owner: 'DISCLOSURE_PATTERN and Collapsible.a11y.test.tsx',
130
+ reason:
131
+ 'Each header is a Collapsible trigger. Its standalone disclosure state, pointer round trip, and aborted-press behavior are already bound to the disclosure contract; this binding proves the Accordion parts across the group — header role and name, aria-controls, aria-disabled on a fixed panel, Enter and Space — and, advisory until the record is current, what the group adds: single-expansion sibling collapse, the page Tab step between headers, and the absence of arrow-key focus movement.',
132
+ },
133
+ {
134
+ id: 'heading-wrapper-and-region-panels',
135
+ owner: 'component:CollapsibleGroup AR4 and the composing page',
136
+ reason:
137
+ 'The record adopts the Accordion pattern without a heading element around each header and without the optional region role on panels; the caller places the group in its own heading structure. Neither is asserted here because neither is a component promise.',
138
+ },
139
+ ] as const;
@@ -0,0 +1,135 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ /** @vitest-environment jsdom */
3
+
4
+ /**
5
+ * @file CollapsibleGroup.a11y.test.tsx
6
+ * @input ACCORDION_PATTERN bound to CollapsibleGroup's representative states
7
+ * @output jsdom-lane proof of the DOM expectations and an honest "unrun" report for the browser layers
8
+ * @position Binding test for component:CollapsibleGroup AR4 (the Chromium spec covers the rest)
9
+ */
10
+
11
+ import {cleanup, render, screen} from '@testing-library/react';
12
+ import {describe, expect, it} from 'vitest';
13
+ import {
14
+ ACCORDION_PATTERN,
15
+ checkAccessibilitySpec,
16
+ createJsdomHarness,
17
+ expectAccessibilitySpec,
18
+ summarize,
19
+ type BindingResult,
20
+ } from '@astryxdesign/a11y-spec';
21
+ import {renderAccordionState} from './CollapsibleGroup.a11y.renders';
22
+ import {
23
+ COLLAPSIBLE_GROUP_ACCORDION_EXCLUSIONS,
24
+ COLLAPSIBLE_GROUP_ACCORDION_STATES,
25
+ type CollapsibleGroupAccordionState,
26
+ } from './CollapsibleGroup.a11y.states';
27
+
28
+ function header(label: string): HTMLElement {
29
+ return screen.getByRole('button', {name: label});
30
+ }
31
+
32
+ function panelFor(subject: HTMLElement, id: string): HTMLElement {
33
+ const controls = subject.getAttribute('aria-controls');
34
+ const panel = controls == null ? null : document.getElementById(controls);
35
+ if (panel == null) {
36
+ throw new Error(`CollapsibleGroup state "${id}" has no controlled panel`);
37
+ }
38
+ return panel;
39
+ }
40
+
41
+ function relatedFor(
42
+ state: CollapsibleGroupAccordionState,
43
+ ): Readonly<Record<string, Element>> {
44
+ const subject = header(state.label);
45
+ const related: Record<string, Element> = {
46
+ panel: panelFor(subject, state.id),
47
+ };
48
+ if (state.nextLabel != null) {
49
+ related['next-header'] = header(state.nextLabel);
50
+ }
51
+ if (state.openSiblingLabel != null) {
52
+ related['open-sibling'] = header(state.openSiblingLabel);
53
+ }
54
+ return related;
55
+ }
56
+
57
+ async function checkState(
58
+ state: CollapsibleGroupAccordionState,
59
+ ): Promise<BindingResult> {
60
+ return checkAccessibilitySpec({
61
+ spec: ACCORDION_PATTERN,
62
+ binding: 'CollapsibleGroup.header',
63
+ state: state.id,
64
+ facts: state.facts,
65
+ mount: async () => {
66
+ render(renderAccordionState(state));
67
+ return createJsdomHarness({
68
+ subject: header(state.label),
69
+ related: relatedFor(state),
70
+ });
71
+ },
72
+ unmount: cleanup,
73
+ });
74
+ }
75
+
76
+ describe('CollapsibleGroup.header — accordion pattern, jsdom lane', () => {
77
+ it.each(
78
+ COLLAPSIBLE_GROUP_ACCORDION_STATES.map(
79
+ state => [state.id, state.summary, state] as const,
80
+ ),
81
+ )('%s — %s', async (_id, _summary, state) => {
82
+ await expectAccessibilitySpec({
83
+ spec: ACCORDION_PATTERN,
84
+ binding: 'CollapsibleGroup.header',
85
+ state: state.id,
86
+ facts: state.facts,
87
+ render: () => {
88
+ render(renderAccordionState(state));
89
+ },
90
+ subject: () => header(state.label),
91
+ related: () => relatedFor(state),
92
+ cleanup,
93
+ });
94
+ });
95
+
96
+ it('runs the DOM layer and reports the browser-owned outcomes as unrun', async () => {
97
+ const results: BindingResult[] = [];
98
+ for (const state of COLLAPSIBLE_GROUP_ACCORDION_STATES) {
99
+ results.push(await checkState(state));
100
+ }
101
+ const report = summarize(ACCORDION_PATTERN, results);
102
+ expect(report.counts.pass).toBeGreaterThan(0);
103
+ expect(report.unrunLayers).toEqual(['accessibility-tree', 'real-browser']);
104
+ expect(report.counts.unexpectedPass).toBe(0);
105
+ });
106
+ });
107
+
108
+ describe('CollapsibleGroup accordion binding inventory', () => {
109
+ it('gives every representative state a distinct checked-in story', () => {
110
+ const stories = COLLAPSIBLE_GROUP_ACCORDION_STATES.map(
111
+ state => state.storyId,
112
+ );
113
+ expect(new Set(stories).size).toBe(stories.length);
114
+ });
115
+
116
+ it('keeps disclosure and page ownership explicit', () => {
117
+ expect(COLLAPSIBLE_GROUP_ACCORDION_EXCLUSIONS.map(row => row.id)).toEqual([
118
+ 'collapsible-disclosure-semantics',
119
+ 'heading-wrapper-and-region-panels',
120
+ ]);
121
+ for (const exclusion of COLLAPSIBLE_GROUP_ACCORDION_EXCLUSIONS) {
122
+ expect(exclusion.owner.length, exclusion.id).toBeGreaterThan(20);
123
+ expect(exclusion.reason.length, exclusion.id).toBeGreaterThan(80);
124
+ }
125
+ });
126
+
127
+ it('renders exactly one subject header and its relations for every state', () => {
128
+ for (const state of COLLAPSIBLE_GROUP_ACCORDION_STATES) {
129
+ render(renderAccordionState(state));
130
+ expect(header(state.label), state.id).toBeTruthy();
131
+ expect(Object.keys(relatedFor(state)), state.id).toContain('panel');
132
+ cleanup();
133
+ }
134
+ });
135
+ });
@@ -0,0 +1,128 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file CollapsibleGroupAccordion.a11y.chromium.spec.ts
5
+ * @input Built CollapsibleGroup accordion stories and ACCORDION_PATTERN in real Chromium
6
+ * @output Browser evidence for every accordion expectation across the binding's states
7
+ * @position Chromium lane of the CollapsibleGroup accordion binding (component:CollapsibleGroup AR4)
8
+ */
9
+
10
+ import {
11
+ expect,
12
+ test,
13
+ type CDPSession,
14
+ type Locator,
15
+ type Page,
16
+ } from '@playwright/test';
17
+ import {
18
+ ACCORDION_PATTERN,
19
+ blockingResults,
20
+ checkAccessibilitySpec,
21
+ formatFailures,
22
+ neverExercised,
23
+ summarize,
24
+ type BindingResult,
25
+ } from '@astryxdesign/a11y-spec';
26
+ import {
27
+ createChromiumHarness,
28
+ holdMotionStill,
29
+ } from '@astryxdesign/a11y-spec/chromium';
30
+ import {
31
+ DEFAULT_STORYBOOK_DIR,
32
+ serveStorybook,
33
+ type StaticServer,
34
+ } from '@astryxdesign/a11y-spec/storybook';
35
+ import {
36
+ COLLAPSIBLE_GROUP_ACCORDION_STATES,
37
+ type CollapsibleGroupAccordionState,
38
+ } from './CollapsibleGroup.a11y.states';
39
+
40
+ let storybook: StaticServer;
41
+
42
+ test.beforeAll(async () => {
43
+ storybook = await serveStorybook(
44
+ process.env.ASTRYX_STORYBOOK_DIR ?? DEFAULT_STORYBOOK_DIR,
45
+ );
46
+ });
47
+
48
+ test.afterAll(async () => {
49
+ await storybook?.close();
50
+ });
51
+
52
+ function storyUrl(storyId: string): string {
53
+ return `${storybook.origin}/iframe.html?id=${storyId}&viewMode=story`;
54
+ }
55
+
56
+ function header(page: Page, label: string): Locator {
57
+ return page
58
+ .locator('#storybook-root')
59
+ .getByRole('button', {name: label, includeHidden: true});
60
+ }
61
+
62
+ async function mountState(
63
+ page: Page,
64
+ state: CollapsibleGroupAccordionState,
65
+ ): Promise<{subject: Locator; related: Record<string, Locator>}> {
66
+ await page.goto(storyUrl(state.storyId), {waitUntil: 'load'});
67
+ await holdMotionStill(page);
68
+ const subject = header(page, state.label);
69
+ await subject.waitFor({state: 'attached'});
70
+ const id = await subject.getAttribute('aria-controls');
71
+ if (id == null) {
72
+ throw new Error(
73
+ `CollapsibleGroup state "${state.id}" has no aria-controls`,
74
+ );
75
+ }
76
+ const related: Record<string, Locator> = {
77
+ panel: page.locator(`#storybook-root [id="${id}"]`),
78
+ };
79
+ if (state.nextLabel != null) {
80
+ related['next-header'] = header(page, state.nextLabel);
81
+ }
82
+ if (state.openSiblingLabel != null) {
83
+ related['open-sibling'] = header(page, state.openSiblingLabel);
84
+ }
85
+ return {subject, related};
86
+ }
87
+
88
+ async function runState(
89
+ page: Page,
90
+ cdp: CDPSession,
91
+ state: CollapsibleGroupAccordionState,
92
+ ): Promise<BindingResult> {
93
+ return checkAccessibilitySpec({
94
+ spec: ACCORDION_PATTERN,
95
+ binding: 'CollapsibleGroup.header',
96
+ state: state.id,
97
+ facts: state.facts,
98
+ mount: async () => {
99
+ const {subject, related} = await mountState(page, state);
100
+ return createChromiumHarness({page, cdp, subject, related});
101
+ },
102
+ });
103
+ }
104
+
105
+ test('every accordion expectation is exercised by a CollapsibleGroup state', async ({
106
+ page,
107
+ }) => {
108
+ const cdp = await page.context().newCDPSession(page);
109
+ const results: BindingResult[] = [];
110
+ for (const state of COLLAPSIBLE_GROUP_ACCORDION_STATES) {
111
+ results.push(await runState(page, cdp, state));
112
+ }
113
+ expect(neverExercised(results)).toEqual([]);
114
+ });
115
+
116
+ for (const state of COLLAPSIBLE_GROUP_ACCORDION_STATES) {
117
+ test(`CollapsibleGroup.header [${state.id}] — ${state.summary}`, async ({
118
+ page,
119
+ }) => {
120
+ const cdp = await page.context().newCDPSession(page);
121
+ const result = await runState(page, cdp, state);
122
+ const report = summarize(ACCORDION_PATTERN, [result]);
123
+ // Only required rows block (AST-020 FR9); advisory rows report.
124
+ expect(formatFailures(blockingResults([result]))).toBe('');
125
+ expect(report.unrunLayers).toEqual([]);
126
+ expect(report.counts.unexpectedPass).toBe(0);
127
+ });
128
+ }
@@ -33,7 +33,7 @@ const anatomy = [
33
33
  name: 'List',
34
34
  required: true,
35
35
  description:
36
- 'Scrollable listbox containing the current results or Empty state.',
36
+ 'Scrollable results container: a listbox while selectable results exist, otherwise the Empty state as plain content.',
37
37
  },
38
38
  {
39
39
  name: 'Item',
@@ -88,7 +88,8 @@ export const docs = {
88
88
  'dialog',
89
89
  'navigation',
90
90
  ],
91
- description: 'Root component. Manages open state, search, keyboard navigation, and composition slots.',
91
+ description:
92
+ 'Root component. Manages open state, search, keyboard navigation, and composition slots.',
92
93
  // Intentionally a contained isInline preview, not playground.overlay: the
93
94
  // component stays visible on load and knobs stay live, whereas a real
94
95
  // showModal() overlay makes the page inert — see ComponentPlaygroundConfig.overlay
@@ -116,13 +117,15 @@ export const docs = {
116
117
  {
117
118
  name: 'searchSource',
118
119
  type: 'SearchSource<T>',
119
- description: 'Search source providing items via search(query) and bootstrap(). Use createStaticSource for static lists.',
120
+ description:
121
+ 'Search source providing items via search(query) and bootstrap(). Use createStaticSource for static lists.',
120
122
  required: true,
121
123
  },
122
124
  {
123
125
  name: 'input',
124
126
  type: 'ReactNode',
125
- description: 'Input slot. Defaults to CommandPaletteInput with standard behavior.',
127
+ description:
128
+ 'Input slot. Defaults to CommandPaletteInput with standard behavior.',
126
129
  default: '<CommandPaletteInput />',
127
130
  slotElements: [
128
131
  {
@@ -137,7 +140,8 @@ export const docs = {
137
140
  {
138
141
  name: 'footer',
139
142
  type: 'ReactNode',
140
- description: 'Footer slot. Defaults to CommandPaletteFooter showing keyboard hints.',
143
+ description:
144
+ 'Footer slot. Defaults to CommandPaletteFooter showing keyboard hints.',
141
145
  default: '<CommandPaletteFooter />',
142
146
  slotElements: [
143
147
  {
@@ -152,7 +156,8 @@ export const docs = {
152
156
  {
153
157
  name: 'renderItem',
154
158
  type: '(item: T, isSelected: boolean) => ReactNode',
155
- description: 'Per-item render function. Auto-grouping by auxiliaryData.group is preserved. When omitted, renders label text.',
159
+ description:
160
+ 'Per-item render function for non-interactive presentation content such as labels, icons, descriptions, and shortcut hints. Do not return buttons or links inside the option. Auto-grouping by auxiliaryData.group is preserved. When omitted, renders label text.',
156
161
  },
157
162
  {
158
163
  name: 'emptySearchText',
@@ -163,7 +168,8 @@ export const docs = {
163
168
  {
164
169
  name: 'emptyBootstrapText',
165
170
  type: 'ReactNode',
166
- description: 'Content shown when there is no search query and bootstrap() returns nothing.',
171
+ description:
172
+ 'Content shown when there is no search query and bootstrap() returns nothing.',
167
173
  default: "'Type to search'",
168
174
  },
169
175
  {
@@ -197,7 +203,8 @@ export const docs = {
197
203
  {
198
204
  name: 'isInline',
199
205
  type: 'boolean',
200
- description: 'Renders command palette content inline without modal behavior. Automatically disables input auto-focus and initial highlighted-item auto-scroll. For documentation previews and showcases only.',
206
+ description:
207
+ 'Renders command palette content inline without modal behavior. Automatically disables input auto-focus and initial highlighted-item auto-scroll. For documentation previews and showcases only.',
201
208
  default: 'false',
202
209
  },
203
210
  ],
@@ -222,12 +229,44 @@ export const docs = {
222
229
  },
223
230
  usage: {
224
231
  anatomy,
225
- description: 'CommandPalette is a searchable dialog for quick access to commands, navigation, and actions. Use it as a keyboard-driven launcher powered by SearchSource for filtering and selection.',
232
+ description:
233
+ 'CommandPalette is a searchable dialog for quick access to commands, navigation, and actions. Use it as a keyboard-driven launcher powered by SearchSource for filtering and selection.',
226
234
  bestPractices: [
227
- { guidance: true, description: 'Provide a searchSource with bootstrap results so users see useful options before typing.' },
228
- { guidance: true, description: 'Use auxiliaryData.group on items to automatically organize results into labeled sections.' },
229
- { guidance: false, description: 'Use CommandPalette for simple dropdowns or menus; use Menu or Selector for inline selections.' },
230
- { guidance: false, description: 'Add too many groups or items; curate results to keep the palette fast and scannable.' },
235
+ {
236
+ guidance: true,
237
+ description:
238
+ 'Provide a searchSource with bootstrap results so users see useful options before typing.',
239
+ },
240
+ {
241
+ guidance: true,
242
+ description:
243
+ 'Use auxiliaryData.group on items to automatically organize results into labeled sections.',
244
+ },
245
+ {
246
+ guidance: true,
247
+ description:
248
+ 'Provide a specific label when more than one command palette can appear in the same product surface.',
249
+ },
250
+ {
251
+ guidance: true,
252
+ description:
253
+ 'Keep renderItem content non-interactive; each rendered row is one option, so buttons and links cannot be nested inside it.',
254
+ },
255
+ {
256
+ guidance: false,
257
+ description:
258
+ 'Intercept query-field keyboard events without preserving active IME composition and native Home/End caret movement.',
259
+ },
260
+ {
261
+ guidance: false,
262
+ description:
263
+ 'Use CommandPalette for simple dropdowns or menus; use Menu or Selector for inline selections.',
264
+ },
265
+ {
266
+ guidance: false,
267
+ description:
268
+ 'Add too many groups or items; curate results to keep the palette fast and scannable.',
269
+ },
231
270
  ],
232
271
  },
233
272
  };
@@ -236,12 +275,44 @@ export const docs = {
236
275
  export const docsZh = {
237
276
  usage: {
238
277
  anatomy,
239
- description: 'CommandPalette is a searchable dialog for quick access to commands, navigation, and actions. Use it as a keyboard-driven launcher powered by SearchSource for filtering and selection.',
278
+ description:
279
+ 'CommandPalette is a searchable dialog for quick access to commands, navigation, and actions. Use it as a keyboard-driven launcher powered by SearchSource for filtering and selection.',
240
280
  bestPractices: [
241
- { guidance: true, description: 'Provide a searchSource with bootstrap results so users see useful options before typing.' },
242
- { guidance: true, description: 'Use auxiliaryData.group on items to automatically organize results into labeled sections.' },
243
- { guidance: false, description: 'Use CommandPalette for simple dropdowns or menus; use Menu or Selector for inline selections.' },
244
- { guidance: false, description: 'Add too many groups or items; curate results to keep the palette fast and scannable.' },
281
+ {
282
+ guidance: true,
283
+ description:
284
+ 'Provide a searchSource with bootstrap results so users see useful options before typing.',
285
+ },
286
+ {
287
+ guidance: true,
288
+ description:
289
+ 'Use auxiliaryData.group on items to automatically organize results into labeled sections.',
290
+ },
291
+ {
292
+ guidance: true,
293
+ description:
294
+ 'Provide a specific label when more than one command palette can appear in the same product surface.',
295
+ },
296
+ {
297
+ guidance: true,
298
+ description:
299
+ 'Keep renderItem content non-interactive; each rendered row is one option, so buttons and links cannot be nested inside it.',
300
+ },
301
+ {
302
+ guidance: false,
303
+ description:
304
+ 'Intercept query-field keyboard events without preserving active IME composition and native Home/End caret movement.',
305
+ },
306
+ {
307
+ guidance: false,
308
+ description:
309
+ 'Use CommandPalette for simple dropdowns or menus; use Menu or Selector for inline selections.',
310
+ },
311
+ {
312
+ guidance: false,
313
+ description:
314
+ 'Add too many groups or items; curate results to keep the palette fast and scannable.',
315
+ },
245
316
  ],
246
317
  },
247
318
  };
@@ -252,12 +323,44 @@ export const docsDense = {
252
323
  'searchSource-driven command palette dialog; filtering, keyboard nav, grouping, selection; same SearchSource interface as Typeahead',
253
324
  usage: {
254
325
  anatomy,
255
- description: 'CommandPalette is a searchable dialog for quick access to commands, navigation, and actions. Use it as a keyboard-driven launcher powered by SearchSource for filtering and selection.',
326
+ description:
327
+ 'CommandPalette is a searchable dialog for quick access to commands, navigation, and actions. Use it as a keyboard-driven launcher powered by SearchSource for filtering and selection.',
256
328
  bestPractices: [
257
- { guidance: true, description: 'Provide a searchSource with bootstrap results so users see useful options before typing.' },
258
- { guidance: true, description: 'Use auxiliaryData.group on items to automatically organize results into labeled sections.' },
259
- { guidance: false, description: 'Use CommandPalette for simple dropdowns or menus; use Menu or Selector for inline selections.' },
260
- { guidance: false, description: 'Add too many groups or items; curate results to keep the palette fast and scannable.' },
329
+ {
330
+ guidance: true,
331
+ description:
332
+ 'Provide a searchSource with bootstrap results so users see useful options before typing.',
333
+ },
334
+ {
335
+ guidance: true,
336
+ description:
337
+ 'Use auxiliaryData.group on items to automatically organize results into labeled sections.',
338
+ },
339
+ {
340
+ guidance: true,
341
+ description:
342
+ 'Provide a specific label when more than one command palette can appear in the same product surface.',
343
+ },
344
+ {
345
+ guidance: true,
346
+ description:
347
+ 'Keep renderItem content non-interactive; each rendered row is one option, so buttons and links cannot be nested inside it.',
348
+ },
349
+ {
350
+ guidance: false,
351
+ description:
352
+ 'Intercept query-field keyboard events without preserving active IME composition and native Home/End caret movement.',
353
+ },
354
+ {
355
+ guidance: false,
356
+ description:
357
+ 'Use CommandPalette for simple dropdowns or menus; use Menu or Selector for inline selections.',
358
+ },
359
+ {
360
+ guidance: false,
361
+ description:
362
+ 'Add too many groups or items; curate results to keep the palette fast and scannable.',
363
+ },
261
364
  ],
262
365
  },
263
366
  };