@womp/kookie-ui 0.24.0 → 0.25.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 (1173) hide show
  1. package/README.md +3 -3
  2. package/components.css +12859 -11868
  3. package/dist/cjs/components/_internal/base-button.d.ts.map +1 -1
  4. package/dist/cjs/components/_internal/base-button.js +2 -1
  5. package/dist/cjs/components/_internal/base-button.js.map +4 -4
  6. package/dist/cjs/components/_internal/base-button.props.js +1 -0
  7. package/dist/cjs/components/_internal/base-button.props.js.map +2 -2
  8. package/dist/cjs/components/_internal/base-checkbox.props.js +1 -0
  9. package/dist/cjs/components/_internal/base-checkbox.props.js.map +1 -1
  10. package/dist/cjs/components/_internal/base-menu.props.js +1 -0
  11. package/dist/cjs/components/_internal/base-menu.props.js.map +1 -1
  12. package/dist/cjs/components/_internal/base-menu.utils.js +1 -0
  13. package/dist/cjs/components/_internal/base-menu.utils.js.map +1 -1
  14. package/dist/cjs/components/_internal/base-radio.props.js +1 -0
  15. package/dist/cjs/components/_internal/base-radio.props.js.map +1 -1
  16. package/dist/cjs/components/_internal/base-tab-list.props.js +1 -0
  17. package/dist/cjs/components/_internal/base-tab-list.props.js.map +1 -1
  18. package/dist/cjs/components/_internal/dropdown-menu-drill-down.d.ts +19 -7
  19. package/dist/cjs/components/_internal/dropdown-menu-drill-down.d.ts.map +1 -1
  20. package/dist/cjs/components/_internal/dropdown-menu-drill-down.js +2 -1
  21. package/dist/cjs/components/_internal/dropdown-menu-drill-down.js.map +3 -3
  22. package/dist/cjs/components/_internal/menu-context.d.ts +10 -0
  23. package/dist/cjs/components/_internal/menu-context.d.ts.map +1 -1
  24. package/dist/cjs/components/_internal/menu-context.js +2 -1
  25. package/dist/cjs/components/_internal/menu-context.js.map +3 -3
  26. package/dist/cjs/components/_internal/pane-chrome.d.ts +3 -1
  27. package/dist/cjs/components/_internal/pane-chrome.d.ts.map +1 -1
  28. package/dist/cjs/components/_internal/pane-chrome.js +2 -1
  29. package/dist/cjs/components/_internal/pane-chrome.js.map +3 -3
  30. package/dist/cjs/components/_internal/shell-bottom.d.ts +1 -1
  31. package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
  32. package/dist/cjs/components/_internal/shell-bottom.js +2 -1
  33. package/dist/cjs/components/_internal/shell-bottom.js.map +3 -3
  34. package/dist/cjs/components/_internal/shell-handles.d.ts.map +1 -1
  35. package/dist/cjs/components/_internal/shell-handles.js +2 -1
  36. package/dist/cjs/components/_internal/shell-handles.js.map +3 -3
  37. package/dist/cjs/components/_internal/shell-inspector.d.ts +1 -1
  38. package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
  39. package/dist/cjs/components/_internal/shell-inspector.js +2 -1
  40. package/dist/cjs/components/_internal/shell-inspector.js.map +3 -3
  41. package/dist/cjs/components/_internal/shell-pane.d.ts.map +1 -1
  42. package/dist/cjs/components/_internal/shell-pane.js +2 -1
  43. package/dist/cjs/components/_internal/shell-pane.js.map +3 -3
  44. package/dist/cjs/components/_internal/shell-resizable.d.ts +6 -0
  45. package/dist/cjs/components/_internal/shell-resizable.d.ts.map +1 -1
  46. package/dist/cjs/components/_internal/shell-resizable.js +2 -1
  47. package/dist/cjs/components/_internal/shell-resizable.js.map +3 -3
  48. package/dist/cjs/components/_internal/shell-resize.js +1 -0
  49. package/dist/cjs/components/_internal/shell-resize.js.map +1 -1
  50. package/dist/cjs/components/_internal/shell-rest.js +1 -0
  51. package/dist/cjs/components/_internal/shell-rest.js.map +1 -1
  52. package/dist/cjs/components/_internal/shell-sidebar.d.ts +1 -1
  53. package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
  54. package/dist/cjs/components/_internal/shell-sidebar.js +2 -1
  55. package/dist/cjs/components/_internal/shell-sidebar.js.map +3 -3
  56. package/dist/cjs/components/_internal/shell-store.d.ts.map +1 -1
  57. package/dist/cjs/components/_internal/shell-store.js +2 -1
  58. package/dist/cjs/components/_internal/shell-store.js.map +3 -3
  59. package/dist/cjs/components/accessible-icon.js +1 -0
  60. package/dist/cjs/components/accessible-icon.js.map +1 -1
  61. package/dist/cjs/components/accordion.d.ts.map +1 -1
  62. package/dist/cjs/components/accordion.js +2 -1
  63. package/dist/cjs/components/accordion.js.map +4 -4
  64. package/dist/cjs/components/accordion.props.js +1 -0
  65. package/dist/cjs/components/accordion.props.js.map +1 -1
  66. package/dist/cjs/components/alert-dialog.d.ts.map +1 -1
  67. package/dist/cjs/components/alert-dialog.js +2 -1
  68. package/dist/cjs/components/alert-dialog.js.map +4 -4
  69. package/dist/cjs/components/alert-dialog.props.js +1 -0
  70. package/dist/cjs/components/alert-dialog.props.js.map +1 -1
  71. package/dist/cjs/components/avatar.d.ts.map +1 -1
  72. package/dist/cjs/components/avatar.js +2 -1
  73. package/dist/cjs/components/avatar.js.map +4 -4
  74. package/dist/cjs/components/avatar.props.js +1 -0
  75. package/dist/cjs/components/avatar.props.js.map +1 -1
  76. package/dist/cjs/components/blockquote.js +1 -0
  77. package/dist/cjs/components/blockquote.js.map +1 -1
  78. package/dist/cjs/components/blockquote.props.js +1 -0
  79. package/dist/cjs/components/blockquote.props.js.map +1 -1
  80. package/dist/cjs/components/box.js +1 -0
  81. package/dist/cjs/components/box.js.map +1 -1
  82. package/dist/cjs/components/box.props.js +1 -0
  83. package/dist/cjs/components/box.props.js.map +1 -1
  84. package/dist/cjs/components/button.d.ts.map +1 -1
  85. package/dist/cjs/components/button.js +2 -1
  86. package/dist/cjs/components/button.js.map +4 -4
  87. package/dist/cjs/components/button.props.js +1 -0
  88. package/dist/cjs/components/button.props.js.map +2 -2
  89. package/dist/cjs/components/card.js +2 -1
  90. package/dist/cjs/components/card.js.map +4 -4
  91. package/dist/cjs/components/card.props.js +1 -0
  92. package/dist/cjs/components/card.props.js.map +1 -1
  93. package/dist/cjs/components/chatbar.d.ts.map +1 -1
  94. package/dist/cjs/components/chatbar.js +2 -1
  95. package/dist/cjs/components/chatbar.js.map +4 -4
  96. package/dist/cjs/components/checkbox-group.js +2 -1
  97. package/dist/cjs/components/checkbox-group.js.map +4 -4
  98. package/dist/cjs/components/checkbox-group.primitive.js +1 -0
  99. package/dist/cjs/components/checkbox-group.primitive.js.map +1 -1
  100. package/dist/cjs/components/checkbox-group.props.js +1 -0
  101. package/dist/cjs/components/checkbox-group.props.js.map +1 -1
  102. package/dist/cjs/components/checkbox.js +2 -1
  103. package/dist/cjs/components/checkbox.js.map +4 -4
  104. package/dist/cjs/components/checkbox.props.js +1 -0
  105. package/dist/cjs/components/checkbox.props.js.map +1 -1
  106. package/dist/cjs/components/chip.js +2 -1
  107. package/dist/cjs/components/chip.js.map +4 -4
  108. package/dist/cjs/components/chip.props.js +1 -0
  109. package/dist/cjs/components/chip.props.js.map +1 -1
  110. package/dist/cjs/components/code.js +1 -0
  111. package/dist/cjs/components/code.js.map +1 -1
  112. package/dist/cjs/components/code.props.js +1 -0
  113. package/dist/cjs/components/code.props.js.map +1 -1
  114. package/dist/cjs/components/combobox.d.ts.map +1 -1
  115. package/dist/cjs/components/combobox.js +2 -1
  116. package/dist/cjs/components/combobox.js.map +4 -4
  117. package/dist/cjs/components/combobox.props.js +1 -0
  118. package/dist/cjs/components/combobox.props.js.map +1 -1
  119. package/dist/cjs/components/context-menu.d.ts +1 -2
  120. package/dist/cjs/components/context-menu.d.ts.map +1 -1
  121. package/dist/cjs/components/context-menu.js +2 -1
  122. package/dist/cjs/components/context-menu.js.map +4 -4
  123. package/dist/cjs/components/context-menu.props.js +1 -0
  124. package/dist/cjs/components/context-menu.props.js.map +1 -1
  125. package/dist/cjs/components/dialog.js +2 -1
  126. package/dist/cjs/components/dialog.js.map +4 -4
  127. package/dist/cjs/components/dialog.props.js +1 -0
  128. package/dist/cjs/components/dialog.props.js.map +1 -1
  129. package/dist/cjs/components/dropdown-menu.d.ts +1 -2
  130. package/dist/cjs/components/dropdown-menu.d.ts.map +1 -1
  131. package/dist/cjs/components/dropdown-menu.js +2 -1
  132. package/dist/cjs/components/dropdown-menu.js.map +4 -4
  133. package/dist/cjs/components/dropdown-menu.props.js +1 -0
  134. package/dist/cjs/components/dropdown-menu.props.js.map +1 -1
  135. package/dist/cjs/components/flex.js +1 -0
  136. package/dist/cjs/components/flex.js.map +2 -2
  137. package/dist/cjs/components/flex.props.js +1 -0
  138. package/dist/cjs/components/flex.props.js.map +2 -2
  139. package/dist/cjs/components/grid.js +1 -0
  140. package/dist/cjs/components/grid.js.map +2 -2
  141. package/dist/cjs/components/grid.props.js +1 -0
  142. package/dist/cjs/components/grid.props.js.map +2 -2
  143. package/dist/cjs/components/heading.d.ts +2 -2
  144. package/dist/cjs/components/heading.d.ts.map +1 -1
  145. package/dist/cjs/components/heading.js +2 -1
  146. package/dist/cjs/components/heading.js.map +2 -2
  147. package/dist/cjs/components/heading.props.d.ts +1 -1
  148. package/dist/cjs/components/heading.props.js +2 -1
  149. package/dist/cjs/components/heading.props.js.map +2 -2
  150. package/dist/cjs/components/icons.js +1 -0
  151. package/dist/cjs/components/icons.js.map +1 -1
  152. package/dist/cjs/components/image.d.ts +9 -2
  153. package/dist/cjs/components/image.d.ts.map +1 -1
  154. package/dist/cjs/components/image.js +2 -1
  155. package/dist/cjs/components/image.js.map +3 -3
  156. package/dist/cjs/components/image.props.js +1 -0
  157. package/dist/cjs/components/image.props.js.map +1 -1
  158. package/dist/cjs/components/index.d.ts +1 -1
  159. package/dist/cjs/components/index.d.ts.map +1 -1
  160. package/dist/cjs/components/index.js +3 -2
  161. package/dist/cjs/components/index.js.map +4 -4
  162. package/dist/cjs/components/kbd.js +1 -0
  163. package/dist/cjs/components/kbd.js.map +1 -1
  164. package/dist/cjs/components/kbd.props.js +1 -0
  165. package/dist/cjs/components/kbd.props.js.map +1 -1
  166. package/dist/cjs/components/link.js +1 -0
  167. package/dist/cjs/components/link.js.map +1 -1
  168. package/dist/cjs/components/link.props.js +1 -0
  169. package/dist/cjs/components/link.props.js.map +1 -1
  170. package/dist/cjs/components/message-scroller.d.ts +2 -2
  171. package/dist/cjs/components/message-scroller.d.ts.map +1 -1
  172. package/dist/cjs/components/message-scroller.js +2 -1
  173. package/dist/cjs/components/message-scroller.js.map +4 -4
  174. package/dist/cjs/components/navbar.js +2 -1
  175. package/dist/cjs/components/navbar.js.map +4 -4
  176. package/dist/cjs/components/navbar.props.js +1 -0
  177. package/dist/cjs/components/navbar.props.js.map +1 -1
  178. package/dist/cjs/components/notice.js +2 -1
  179. package/dist/cjs/components/notice.js.map +4 -4
  180. package/dist/cjs/components/popover.d.ts +3 -1
  181. package/dist/cjs/components/popover.d.ts.map +1 -1
  182. package/dist/cjs/components/popover.js +2 -1
  183. package/dist/cjs/components/popover.js.map +4 -4
  184. package/dist/cjs/components/popover.props.js +1 -0
  185. package/dist/cjs/components/popover.props.js.map +1 -1
  186. package/dist/cjs/components/portal.js +1 -0
  187. package/dist/cjs/components/portal.js.map +1 -1
  188. package/dist/cjs/components/progress.d.ts.map +1 -1
  189. package/dist/cjs/components/progress.js +2 -1
  190. package/dist/cjs/components/progress.js.map +3 -3
  191. package/dist/cjs/components/progress.props.js +1 -0
  192. package/dist/cjs/components/progress.props.js.map +1 -1
  193. package/dist/cjs/components/radio-group.js +2 -1
  194. package/dist/cjs/components/radio-group.js.map +4 -4
  195. package/dist/cjs/components/radio-group.props.js +1 -0
  196. package/dist/cjs/components/radio-group.props.js.map +1 -1
  197. package/dist/cjs/components/radio.js +2 -1
  198. package/dist/cjs/components/radio.js.map +4 -4
  199. package/dist/cjs/components/radio.props.js +1 -0
  200. package/dist/cjs/components/radio.props.js.map +1 -1
  201. package/dist/cjs/components/reset.js +1 -0
  202. package/dist/cjs/components/reset.js.map +1 -1
  203. package/dist/cjs/components/schemas/base-button.schema.js +1 -0
  204. package/dist/cjs/components/schemas/base-button.schema.js.map +1 -1
  205. package/dist/cjs/components/schemas/button.schema.js +1 -0
  206. package/dist/cjs/components/schemas/button.schema.js.map +1 -1
  207. package/dist/cjs/components/schemas/index.js +1 -0
  208. package/dist/cjs/components/schemas/index.js.map +1 -1
  209. package/dist/cjs/components/schemas/shell.schema.js +1 -0
  210. package/dist/cjs/components/schemas/shell.schema.js.map +1 -1
  211. package/dist/cjs/components/schemas/toggle.schema.js +1 -0
  212. package/dist/cjs/components/schemas/toggle.schema.js.map +1 -1
  213. package/dist/cjs/components/scroll-area.js +1 -0
  214. package/dist/cjs/components/scroll-area.js.map +1 -1
  215. package/dist/cjs/components/scroll-area.props.js +1 -0
  216. package/dist/cjs/components/scroll-area.props.js.map +1 -1
  217. package/dist/cjs/components/segmented-control.d.ts.map +1 -1
  218. package/dist/cjs/components/segmented-control.js +2 -1
  219. package/dist/cjs/components/segmented-control.js.map +4 -4
  220. package/dist/cjs/components/segmented-control.props.d.ts +0 -1
  221. package/dist/cjs/components/segmented-control.props.d.ts.map +1 -1
  222. package/dist/cjs/components/segmented-control.props.js +2 -1
  223. package/dist/cjs/components/segmented-control.props.js.map +2 -2
  224. package/dist/cjs/components/select.d.ts.map +1 -1
  225. package/dist/cjs/components/select.js +2 -1
  226. package/dist/cjs/components/select.js.map +4 -4
  227. package/dist/cjs/components/select.props.js +1 -0
  228. package/dist/cjs/components/select.props.js.map +1 -1
  229. package/dist/cjs/components/separator.d.ts.map +1 -1
  230. package/dist/cjs/components/separator.js +2 -1
  231. package/dist/cjs/components/separator.js.map +4 -4
  232. package/dist/cjs/components/separator.props.d.ts +1 -1
  233. package/dist/cjs/components/separator.props.js +2 -1
  234. package/dist/cjs/components/separator.props.js.map +2 -2
  235. package/dist/cjs/components/sheet.d.ts +1 -1
  236. package/dist/cjs/components/sheet.d.ts.map +1 -1
  237. package/dist/cjs/components/sheet.js +2 -1
  238. package/dist/cjs/components/sheet.js.map +4 -4
  239. package/dist/cjs/components/shell.context.js +2 -1
  240. package/dist/cjs/components/shell.context.js.map +3 -3
  241. package/dist/cjs/components/shell.d.ts +5 -2
  242. package/dist/cjs/components/shell.d.ts.map +1 -1
  243. package/dist/cjs/components/shell.hooks.js +2 -1
  244. package/dist/cjs/components/shell.hooks.js.map +3 -3
  245. package/dist/cjs/components/shell.js +2 -1
  246. package/dist/cjs/components/shell.js.map +4 -4
  247. package/dist/cjs/components/shell.types.js +1 -0
  248. package/dist/cjs/components/shell.types.js.map +1 -1
  249. package/dist/cjs/components/sidebar.d.ts.map +1 -1
  250. package/dist/cjs/components/sidebar.js +2 -1
  251. package/dist/cjs/components/sidebar.js.map +4 -4
  252. package/dist/cjs/components/slider.d.ts.map +1 -1
  253. package/dist/cjs/components/slider.js +2 -1
  254. package/dist/cjs/components/slider.js.map +4 -4
  255. package/dist/cjs/components/slider.props.d.ts +0 -2
  256. package/dist/cjs/components/slider.props.d.ts.map +1 -1
  257. package/dist/cjs/components/slider.props.js +2 -1
  258. package/dist/cjs/components/slider.props.js.map +2 -2
  259. package/dist/cjs/components/slot.js +1 -0
  260. package/dist/cjs/components/slot.js.map +1 -1
  261. package/dist/cjs/components/spinner.d.ts.map +1 -1
  262. package/dist/cjs/components/spinner.js +2 -1
  263. package/dist/cjs/components/spinner.js.map +2 -2
  264. package/dist/cjs/components/spinner.props.js +1 -0
  265. package/dist/cjs/components/spinner.props.js.map +1 -1
  266. package/dist/cjs/components/switch.js +2 -1
  267. package/dist/cjs/components/switch.js.map +4 -4
  268. package/dist/cjs/components/switch.props.js +1 -0
  269. package/dist/cjs/components/switch.props.js.map +1 -1
  270. package/dist/cjs/components/table.d.ts.map +1 -1
  271. package/dist/cjs/components/table.js +2 -1
  272. package/dist/cjs/components/table.js.map +4 -4
  273. package/dist/cjs/components/table.props.d.ts +0 -2
  274. package/dist/cjs/components/table.props.d.ts.map +1 -1
  275. package/dist/cjs/components/table.props.js +2 -1
  276. package/dist/cjs/components/table.props.js.map +3 -3
  277. package/dist/cjs/components/tabs.d.ts.map +1 -1
  278. package/dist/cjs/components/tabs.js +2 -1
  279. package/dist/cjs/components/tabs.js.map +4 -4
  280. package/dist/cjs/components/tabs.props.js +1 -0
  281. package/dist/cjs/components/tabs.props.js.map +1 -1
  282. package/dist/cjs/components/text-area.d.ts.map +1 -1
  283. package/dist/cjs/components/text-area.js +2 -1
  284. package/dist/cjs/components/text-area.js.map +4 -4
  285. package/dist/cjs/components/text-area.props.js +1 -0
  286. package/dist/cjs/components/text-area.props.js.map +1 -1
  287. package/dist/cjs/components/text-field.d.ts.map +1 -1
  288. package/dist/cjs/components/text-field.js +3 -2
  289. package/dist/cjs/components/text-field.js.map +4 -4
  290. package/dist/cjs/components/text-field.props.js +1 -0
  291. package/dist/cjs/components/text-field.props.js.map +2 -2
  292. package/dist/cjs/components/text.js +1 -0
  293. package/dist/cjs/components/text.js.map +1 -1
  294. package/dist/cjs/components/text.props.js +1 -0
  295. package/dist/cjs/components/text.props.js.map +1 -1
  296. package/dist/cjs/components/theme.d.ts.map +1 -1
  297. package/dist/cjs/components/theme.js +2 -1
  298. package/dist/cjs/components/theme.js.map +4 -4
  299. package/dist/cjs/components/theme.props.js +1 -0
  300. package/dist/cjs/components/theme.props.js.map +1 -1
  301. package/dist/cjs/components/toggle.js +2 -1
  302. package/dist/cjs/components/toggle.js.map +4 -4
  303. package/dist/cjs/components/toolbar.d.ts +4 -1
  304. package/dist/cjs/components/toolbar.d.ts.map +1 -1
  305. package/dist/cjs/components/toolbar.js +2 -1
  306. package/dist/cjs/components/toolbar.js.map +4 -4
  307. package/dist/cjs/components/toolbar.props.js +1 -0
  308. package/dist/cjs/components/toolbar.props.js.map +1 -1
  309. package/dist/cjs/components/tooltip.d.ts +13 -2
  310. package/dist/cjs/components/tooltip.d.ts.map +1 -1
  311. package/dist/cjs/components/tooltip.js +2 -1
  312. package/dist/cjs/components/tooltip.js.map +4 -4
  313. package/dist/cjs/components/tooltip.props.js +1 -0
  314. package/dist/cjs/components/tooltip.props.js.map +1 -1
  315. package/dist/cjs/components/virtual-menu.d.ts +19 -12
  316. package/dist/cjs/components/virtual-menu.d.ts.map +1 -1
  317. package/dist/cjs/components/virtual-menu.js +2 -1
  318. package/dist/cjs/components/virtual-menu.js.map +3 -3
  319. package/dist/cjs/components/visually-hidden.js +1 -0
  320. package/dist/cjs/components/visually-hidden.js.map +1 -1
  321. package/dist/cjs/helpers/get-margin-styles.d.ts.map +1 -1
  322. package/dist/cjs/helpers/get-margin-styles.js +1 -1
  323. package/dist/cjs/helpers/get-margin-styles.js.map +3 -3
  324. package/dist/cjs/helpers/index.d.ts +1 -0
  325. package/dist/cjs/helpers/index.d.ts.map +1 -1
  326. package/dist/cjs/helpers/index.js +3 -3
  327. package/dist/cjs/helpers/index.js.map +3 -3
  328. package/dist/cjs/helpers/theme-size.d.ts +8 -30
  329. package/dist/cjs/helpers/theme-size.d.ts.map +1 -1
  330. package/dist/cjs/helpers/theme-size.js +1 -1
  331. package/dist/cjs/helpers/theme-size.js.map +3 -3
  332. package/dist/cjs/hooks/index.js +5 -4
  333. package/dist/cjs/hooks/index.js.map +3 -3
  334. package/dist/cjs/hooks/theme-size.d.ts +32 -0
  335. package/dist/cjs/hooks/theme-size.d.ts.map +1 -0
  336. package/dist/cjs/hooks/theme-size.js +3 -0
  337. package/dist/cjs/hooks/theme-size.js.map +7 -0
  338. package/dist/cjs/hooks/use-appearance.d.ts.map +1 -1
  339. package/dist/cjs/hooks/use-appearance.js +4 -3
  340. package/dist/cjs/hooks/use-appearance.js.map +3 -3
  341. package/dist/cjs/hooks/use-body-pointer-events-cleanup.d.ts +1 -1
  342. package/dist/cjs/hooks/use-body-pointer-events-cleanup.d.ts.map +1 -1
  343. package/dist/cjs/hooks/use-body-pointer-events-cleanup.js +2 -1
  344. package/dist/cjs/hooks/use-body-pointer-events-cleanup.js.map +3 -3
  345. package/dist/cjs/hooks/use-breakpoint.js +1 -0
  346. package/dist/cjs/hooks/use-breakpoint.js.map +1 -1
  347. package/dist/cjs/hooks/use-live-announcer.js +1 -0
  348. package/dist/cjs/hooks/use-live-announcer.js.map +1 -1
  349. package/dist/cjs/hooks/use-prop-synced-state.js +1 -0
  350. package/dist/cjs/hooks/use-prop-synced-state.js.map +1 -1
  351. package/dist/cjs/hooks/use-scroll-edges.js +1 -0
  352. package/dist/cjs/hooks/use-scroll-edges.js.map +1 -1
  353. package/dist/cjs/hooks/use-thumb-sync.js +1 -0
  354. package/dist/cjs/hooks/use-thumb-sync.js.map +1 -1
  355. package/dist/cjs/hooks/use-toggle-state.js +1 -0
  356. package/dist/cjs/hooks/use-toggle-state.js.map +1 -1
  357. package/dist/cjs/hooks/use-tooltip-wrapper.js +1 -0
  358. package/dist/cjs/hooks/use-tooltip-wrapper.js.map +1 -1
  359. package/dist/cjs/index.js +6 -5
  360. package/dist/cjs/index.js.map +4 -4
  361. package/dist/cjs/props/gap.props.d.ts +4 -4
  362. package/dist/cjs/props/gap.props.js.map +1 -1
  363. package/dist/cjs/props/index.js +1 -1
  364. package/dist/cjs/props/index.js.map +4 -4
  365. package/dist/esm/chunk-2IU5XPR2.js +3 -0
  366. package/dist/esm/chunk-2IU5XPR2.js.map +7 -0
  367. package/dist/esm/{chunk-JYQGCXXI.js → chunk-2VSRZ4IT.js} +2 -1
  368. package/dist/esm/{chunk-JYQGCXXI.js.map → chunk-2VSRZ4IT.js.map} +1 -1
  369. package/dist/esm/{chunk-GNTNGLYR.js → chunk-2Z2I27ZS.js} +3 -2
  370. package/dist/esm/{chunk-GNTNGLYR.js.map → chunk-2Z2I27ZS.js.map} +1 -1
  371. package/dist/esm/chunk-3B25RLWX.js +3 -0
  372. package/dist/esm/chunk-3B25RLWX.js.map +7 -0
  373. package/dist/esm/chunk-3CY6H4TE.js +3 -0
  374. package/dist/esm/chunk-3CY6H4TE.js.map +7 -0
  375. package/dist/esm/{chunk-MPTTUBFU.js → chunk-3H23GRNQ.js} +3 -2
  376. package/dist/esm/{chunk-MPTTUBFU.js.map → chunk-3H23GRNQ.js.map} +2 -2
  377. package/dist/esm/chunk-3L2MDOYC.js +3 -0
  378. package/dist/esm/chunk-3L2MDOYC.js.map +7 -0
  379. package/dist/esm/chunk-3LIF53YY.js +13 -0
  380. package/dist/esm/chunk-3LIF53YY.js.map +7 -0
  381. package/dist/esm/chunk-3QWGSRYC.js +3 -0
  382. package/dist/esm/chunk-3QWGSRYC.js.map +7 -0
  383. package/dist/esm/{chunk-IAEAXIBI.js → chunk-4J7QDLKI.js} +3 -2
  384. package/dist/esm/{chunk-IAEAXIBI.js.map → chunk-4J7QDLKI.js.map} +1 -1
  385. package/dist/esm/chunk-5CFSNNYS.js +3 -0
  386. package/dist/esm/chunk-5CFSNNYS.js.map +7 -0
  387. package/dist/esm/chunk-5EBJOOXE.js +3 -0
  388. package/dist/esm/chunk-5EBJOOXE.js.map +7 -0
  389. package/dist/esm/chunk-5EP3UTM7.js +3 -0
  390. package/dist/esm/{chunk-Q4IA622Q.js.map → chunk-5EP3UTM7.js.map} +1 -1
  391. package/dist/esm/chunk-5JYSYTHA.js +3 -0
  392. package/dist/esm/chunk-5JYSYTHA.js.map +7 -0
  393. package/dist/esm/{chunk-FWB47YCH.js → chunk-5KMEUZWN.js} +2 -1
  394. package/dist/esm/{chunk-FWB47YCH.js.map → chunk-5KMEUZWN.js.map} +1 -1
  395. package/dist/esm/{chunk-7MC7N4BC.js → chunk-5KQCG7AV.js} +2 -1
  396. package/dist/esm/{chunk-7MC7N4BC.js.map → chunk-5KQCG7AV.js.map} +1 -1
  397. package/dist/esm/chunk-5L4DZ2D3.js +3 -0
  398. package/dist/esm/chunk-5L4DZ2D3.js.map +7 -0
  399. package/dist/esm/chunk-5ON3XLRD.js +3 -0
  400. package/dist/esm/chunk-5ON3XLRD.js.map +7 -0
  401. package/dist/esm/chunk-5RFDCAKC.js +3 -0
  402. package/dist/esm/{chunk-SKOYHBIE.js.map → chunk-5RFDCAKC.js.map} +1 -1
  403. package/dist/esm/chunk-5TJH35TF.js +3 -0
  404. package/dist/esm/chunk-5TJH35TF.js.map +7 -0
  405. package/dist/esm/{chunk-BIITGC3Z.js → chunk-5WTSKXAE.js} +3 -2
  406. package/dist/esm/{chunk-BIITGC3Z.js.map → chunk-5WTSKXAE.js.map} +1 -1
  407. package/dist/esm/chunk-5XR5PTDR.js +3 -0
  408. package/dist/esm/chunk-5XR5PTDR.js.map +7 -0
  409. package/dist/esm/{chunk-4BU4R7UM.js → chunk-63MUJFVF.js} +3 -2
  410. package/dist/esm/chunk-63MUJFVF.js.map +7 -0
  411. package/dist/esm/{chunk-OSSNMF5U.js → chunk-647DRBXQ.js} +3 -2
  412. package/dist/esm/{chunk-OSSNMF5U.js.map → chunk-647DRBXQ.js.map} +1 -1
  413. package/dist/esm/{chunk-KKMOGHIY.js → chunk-64EFWPHI.js} +3 -2
  414. package/dist/esm/{chunk-KKMOGHIY.js.map → chunk-64EFWPHI.js.map} +1 -1
  415. package/dist/esm/{chunk-BWLCTTTN.js → chunk-65KD6WS6.js} +3 -2
  416. package/dist/esm/{chunk-BWLCTTTN.js.map → chunk-65KD6WS6.js.map} +2 -2
  417. package/dist/esm/{chunk-RWTSGUVJ.js → chunk-6AMWYEM7.js} +3 -2
  418. package/dist/esm/{chunk-RWTSGUVJ.js.map → chunk-6AMWYEM7.js.map} +1 -1
  419. package/dist/esm/chunk-6AUIIXXE.js +2 -0
  420. package/dist/esm/chunk-6AUIIXXE.js.map +7 -0
  421. package/dist/esm/{chunk-ELAW7ZUG.js → chunk-6FLLFCBU.js} +2 -2
  422. package/dist/esm/{chunk-4QKZYCCH.js → chunk-6RJQ5LLP.js} +3 -2
  423. package/dist/esm/{chunk-4QKZYCCH.js.map → chunk-6RJQ5LLP.js.map} +1 -1
  424. package/dist/esm/{chunk-4P6TKZCA.js → chunk-6UZT3ZLO.js} +3 -2
  425. package/dist/esm/{chunk-4P6TKZCA.js.map → chunk-6UZT3ZLO.js.map} +1 -1
  426. package/dist/esm/{chunk-I4FLQELQ.js → chunk-7B3XDZXZ.js} +3 -2
  427. package/dist/esm/chunk-7B3XDZXZ.js.map +7 -0
  428. package/dist/esm/chunk-7N2Q5WOM.js +3 -0
  429. package/dist/esm/chunk-7N2Q5WOM.js.map +7 -0
  430. package/dist/esm/{chunk-25FNCKUM.js → chunk-7ROKZHH2.js} +3 -2
  431. package/dist/esm/{chunk-25FNCKUM.js.map → chunk-7ROKZHH2.js.map} +1 -1
  432. package/dist/esm/chunk-7VJF6EXN.js +3 -0
  433. package/dist/esm/chunk-7VJF6EXN.js.map +7 -0
  434. package/dist/esm/chunk-7X7VWR3F.js +3 -0
  435. package/dist/esm/chunk-7X7VWR3F.js.map +7 -0
  436. package/dist/esm/chunk-7XHE6TOA.js +6 -0
  437. package/dist/esm/chunk-7XHE6TOA.js.map +7 -0
  438. package/dist/esm/chunk-A2OMWZI7.js +2 -0
  439. package/dist/esm/chunk-AQ7VUGQQ.js +3 -0
  440. package/dist/esm/chunk-AQ7VUGQQ.js.map +7 -0
  441. package/dist/esm/{chunk-XEZXKPLE.js → chunk-AXODGYRY.js} +2 -1
  442. package/dist/esm/{chunk-XEZXKPLE.js.map → chunk-AXODGYRY.js.map} +1 -1
  443. package/dist/esm/chunk-AYKOOEZR.js +2 -0
  444. package/dist/esm/{chunk-YHYPIJCR.js → chunk-AZHSPPBV.js} +3 -2
  445. package/dist/esm/{chunk-YHYPIJCR.js.map → chunk-AZHSPPBV.js.map} +1 -1
  446. package/dist/esm/{chunk-ERNM3KVF.js → chunk-B6YGNB3V.js} +2 -1
  447. package/dist/esm/{chunk-ERNM3KVF.js.map → chunk-B6YGNB3V.js.map} +1 -1
  448. package/dist/esm/chunk-BMKUGZ4I.js +3 -0
  449. package/dist/esm/{chunk-VPSMETY2.js.map → chunk-BMKUGZ4I.js.map} +1 -1
  450. package/dist/esm/chunk-BOLSK63X.js +3 -0
  451. package/dist/esm/{chunk-X4A3XRBY.js.map → chunk-BOLSK63X.js.map} +1 -1
  452. package/dist/esm/chunk-BVFHJP5E.js +3 -0
  453. package/dist/esm/chunk-BVFHJP5E.js.map +7 -0
  454. package/dist/esm/{chunk-H5BYPX6V.js → chunk-BXZSJKWA.js} +3 -2
  455. package/dist/esm/chunk-BXZSJKWA.js.map +7 -0
  456. package/dist/esm/{chunk-IDOZJVO6.js → chunk-CAAEEHGQ.js} +3 -2
  457. package/dist/esm/{chunk-IDOZJVO6.js.map → chunk-CAAEEHGQ.js.map} +1 -1
  458. package/dist/esm/{chunk-3QZBWH2A.js → chunk-CKJXTEVO.js} +3 -2
  459. package/dist/esm/chunk-CKJXTEVO.js.map +7 -0
  460. package/dist/esm/chunk-CLJ6SEGP.js +3 -0
  461. package/dist/esm/chunk-CLJ6SEGP.js.map +7 -0
  462. package/dist/esm/{chunk-UY6WJUNA.js → chunk-CQG4U5BR.js} +3 -2
  463. package/dist/esm/{chunk-UY6WJUNA.js.map → chunk-CQG4U5BR.js.map} +2 -2
  464. package/dist/esm/chunk-CR65RYGM.js +3 -0
  465. package/dist/esm/chunk-CR65RYGM.js.map +7 -0
  466. package/dist/esm/chunk-CV7QQTI3.js +3 -0
  467. package/dist/esm/chunk-CV7QQTI3.js.map +7 -0
  468. package/dist/esm/chunk-CYTPMHSJ.js +3 -0
  469. package/dist/esm/chunk-CYTPMHSJ.js.map +7 -0
  470. package/dist/esm/{chunk-GYP66ZK2.js → chunk-D4P7332M.js} +3 -2
  471. package/dist/esm/{chunk-GYP66ZK2.js.map → chunk-D4P7332M.js.map} +1 -1
  472. package/dist/esm/{chunk-OY5NT7VT.js → chunk-DVXDFCCV.js} +3 -2
  473. package/dist/esm/{chunk-OY5NT7VT.js.map → chunk-DVXDFCCV.js.map} +1 -1
  474. package/dist/esm/chunk-EAIQIW23.js +3 -0
  475. package/dist/esm/{chunk-4ZOVV3TY.js.map → chunk-EAIQIW23.js.map} +3 -3
  476. package/dist/esm/{chunk-RAVZ7F5L.js → chunk-EY6TCYGG.js} +3 -2
  477. package/dist/esm/{chunk-RAVZ7F5L.js.map → chunk-EY6TCYGG.js.map} +1 -1
  478. package/dist/esm/chunk-FFJE25TJ.js +3 -0
  479. package/dist/esm/chunk-FFJE25TJ.js.map +7 -0
  480. package/dist/esm/chunk-FI32HA4X.js +3 -0
  481. package/dist/esm/{chunk-YXLDRDHW.js.map → chunk-FI32HA4X.js.map} +3 -3
  482. package/dist/esm/{chunk-NA237RHQ.js → chunk-FJLYSZV3.js} +1 -1
  483. package/dist/esm/{chunk-NA237RHQ.js.map → chunk-FJLYSZV3.js.map} +1 -1
  484. package/dist/esm/{chunk-DNOQ6E3W.js → chunk-FM3GBCX5.js} +3 -2
  485. package/dist/esm/{chunk-DNOQ6E3W.js.map → chunk-FM3GBCX5.js.map} +1 -1
  486. package/dist/esm/chunk-FPGBCCML.js +3 -0
  487. package/dist/esm/chunk-FPGBCCML.js.map +7 -0
  488. package/dist/esm/{chunk-TBZO22XK.js → chunk-G66WDIIV.js} +3 -2
  489. package/dist/esm/{chunk-TBZO22XK.js.map → chunk-G66WDIIV.js.map} +1 -1
  490. package/dist/esm/{chunk-PN3RQFSU.js → chunk-GHUAUFG7.js} +2 -1
  491. package/dist/esm/{chunk-PN3RQFSU.js.map → chunk-GHUAUFG7.js.map} +1 -1
  492. package/dist/esm/chunk-GHWEXMF6.js +3 -0
  493. package/dist/esm/chunk-GHWEXMF6.js.map +7 -0
  494. package/dist/esm/{chunk-62ZGP4ET.js → chunk-GKDGNPBD.js} +2 -1
  495. package/dist/esm/{chunk-62ZGP4ET.js.map → chunk-GKDGNPBD.js.map} +1 -1
  496. package/dist/esm/{chunk-W6BN5QLH.js → chunk-GNPTPIL7.js} +3 -2
  497. package/dist/esm/{chunk-W6BN5QLH.js.map → chunk-GNPTPIL7.js.map} +1 -1
  498. package/dist/esm/chunk-HBWBPBSA.js +3 -0
  499. package/dist/esm/chunk-HBWBPBSA.js.map +7 -0
  500. package/dist/esm/{chunk-FDJV5RXX.js → chunk-HHSFAOIO.js} +3 -2
  501. package/dist/esm/chunk-HHSFAOIO.js.map +7 -0
  502. package/dist/esm/chunk-I3SRUPUP.js +3 -0
  503. package/dist/esm/chunk-I3SRUPUP.js.map +7 -0
  504. package/dist/esm/{chunk-3XHTJZNP.js → chunk-I6SMGWS5.js} +3 -2
  505. package/dist/esm/{chunk-3XHTJZNP.js.map → chunk-I6SMGWS5.js.map} +1 -1
  506. package/dist/esm/chunk-ILWS2JUE.js +3 -0
  507. package/dist/esm/chunk-ILWS2JUE.js.map +7 -0
  508. package/dist/esm/{chunk-QWDCLL6R.js → chunk-IN2WND4B.js} +3 -2
  509. package/dist/esm/{chunk-QWDCLL6R.js.map → chunk-IN2WND4B.js.map} +1 -1
  510. package/dist/esm/chunk-IO43RGNR.js +3 -0
  511. package/dist/esm/chunk-IO43RGNR.js.map +7 -0
  512. package/dist/esm/{chunk-DCNHG6VN.js → chunk-IZIDRDQW.js} +3 -2
  513. package/dist/esm/{chunk-DCNHG6VN.js.map → chunk-IZIDRDQW.js.map} +1 -1
  514. package/dist/esm/{chunk-7FTUTUMD.js → chunk-IZXML75Y.js} +2 -2
  515. package/dist/esm/chunk-J3QIUJ6F.js +2 -0
  516. package/dist/esm/{chunk-PBFSBHBS.js → chunk-JUY7CBSL.js} +2 -2
  517. package/dist/esm/chunk-JZ5Z53MN.js +2 -0
  518. package/dist/esm/{chunk-IWCFJJBI.js → chunk-KOAWATCI.js} +2 -1
  519. package/dist/esm/{chunk-IWCFJJBI.js.map → chunk-KOAWATCI.js.map} +1 -1
  520. package/dist/esm/chunk-KRFXTPEW.js +3 -0
  521. package/dist/esm/{chunk-63PQNLFJ.js.map → chunk-KRFXTPEW.js.map} +1 -1
  522. package/dist/esm/chunk-KSYHZCLD.js +3 -0
  523. package/dist/esm/{chunk-EZYXYLR2.js.map → chunk-KSYHZCLD.js.map} +1 -1
  524. package/dist/esm/{chunk-VW46DG7H.js → chunk-L4NF3Q2T.js} +3 -2
  525. package/dist/esm/{chunk-VW46DG7H.js.map → chunk-L4NF3Q2T.js.map} +1 -1
  526. package/dist/esm/chunk-L54FWKJE.js +3 -0
  527. package/dist/esm/chunk-L54FWKJE.js.map +7 -0
  528. package/dist/esm/{chunk-XTDXXQTB.js → chunk-L66IUPDW.js} +3 -2
  529. package/dist/esm/{chunk-XTDXXQTB.js.map → chunk-L66IUPDW.js.map} +1 -1
  530. package/dist/esm/chunk-LPLW7OWA.js +3 -0
  531. package/dist/esm/chunk-LPLW7OWA.js.map +7 -0
  532. package/dist/esm/chunk-M37GE2TE.js +3 -0
  533. package/dist/esm/{chunk-UONSKZQT.js.map → chunk-M37GE2TE.js.map} +1 -1
  534. package/dist/esm/{chunk-5YLKKQFK.js → chunk-MAA6LEE2.js} +2 -1
  535. package/dist/esm/{chunk-5YLKKQFK.js.map → chunk-MAA6LEE2.js.map} +1 -1
  536. package/dist/esm/chunk-MQEWEAH5.js +3 -0
  537. package/dist/esm/chunk-MQEWEAH5.js.map +7 -0
  538. package/dist/esm/chunk-MXIVYALY.js +3 -0
  539. package/dist/esm/chunk-MXIVYALY.js.map +7 -0
  540. package/dist/esm/chunk-N3QLHFHB.js +3 -0
  541. package/dist/esm/chunk-N3QLHFHB.js.map +7 -0
  542. package/dist/esm/{chunk-VVWYAVHM.js → chunk-N5H7C3PZ.js} +3 -2
  543. package/dist/esm/chunk-N5H7C3PZ.js.map +7 -0
  544. package/dist/esm/{chunk-LXTGEI62.js → chunk-NBVCQQSY.js} +3 -2
  545. package/dist/esm/{chunk-LXTGEI62.js.map → chunk-NBVCQQSY.js.map} +1 -1
  546. package/dist/esm/chunk-NG54K6FL.js +2 -0
  547. package/dist/esm/chunk-OAJ5DARR.js +3 -0
  548. package/dist/esm/chunk-OAJ5DARR.js.map +7 -0
  549. package/dist/esm/chunk-OKQAVYW4.js +3 -0
  550. package/dist/esm/chunk-OKQAVYW4.js.map +7 -0
  551. package/dist/esm/chunk-OQWD63AI.js +3 -0
  552. package/dist/esm/chunk-OQWD63AI.js.map +7 -0
  553. package/dist/esm/chunk-PCLO3ZZY.js +3 -0
  554. package/dist/esm/chunk-PCLO3ZZY.js.map +7 -0
  555. package/dist/esm/chunk-PHWT772P.js +3 -0
  556. package/dist/esm/{chunk-XZQSSRTG.js.map → chunk-PHWT772P.js.map} +1 -1
  557. package/dist/esm/{chunk-FNAE6HUI.js → chunk-PT45Q47V.js} +3 -2
  558. package/dist/esm/{chunk-FNAE6HUI.js.map → chunk-PT45Q47V.js.map} +1 -1
  559. package/dist/esm/{chunk-HCBR74BW.js → chunk-PT4KBXXP.js} +3 -2
  560. package/dist/esm/{chunk-HCBR74BW.js.map → chunk-PT4KBXXP.js.map} +1 -1
  561. package/dist/esm/{chunk-CHPT42BY.js → chunk-PZ6Z7WTR.js} +3 -2
  562. package/dist/esm/{chunk-CHPT42BY.js.map → chunk-PZ6Z7WTR.js.map} +1 -1
  563. package/dist/esm/{chunk-PSPENFPH.js → chunk-PZCQDZVJ.js} +3 -2
  564. package/dist/esm/{chunk-PSPENFPH.js.map → chunk-PZCQDZVJ.js.map} +1 -1
  565. package/dist/esm/chunk-PZZJH2LR.js +3 -0
  566. package/dist/esm/chunk-PZZJH2LR.js.map +7 -0
  567. package/dist/esm/{chunk-I53SGTKV.js → chunk-QH64BDXO.js} +3 -2
  568. package/dist/esm/{chunk-I53SGTKV.js.map → chunk-QH64BDXO.js.map} +1 -1
  569. package/dist/esm/chunk-QKCNGEX4.js +3 -0
  570. package/dist/esm/chunk-QKCNGEX4.js.map +7 -0
  571. package/dist/esm/{chunk-LUNWI377.js → chunk-QQY4WFJL.js} +3 -2
  572. package/dist/esm/{chunk-LUNWI377.js.map → chunk-QQY4WFJL.js.map} +1 -1
  573. package/dist/esm/{chunk-PM6QY3JO.js → chunk-R4PGFURL.js} +3 -2
  574. package/dist/esm/chunk-R4PGFURL.js.map +7 -0
  575. package/dist/esm/chunk-RB5VHWAW.js +3 -0
  576. package/dist/esm/chunk-RB5VHWAW.js.map +7 -0
  577. package/dist/esm/{chunk-BE7LMBBC.js → chunk-RIHTVZVJ.js} +3 -2
  578. package/dist/esm/{chunk-BE7LMBBC.js.map → chunk-RIHTVZVJ.js.map} +1 -1
  579. package/dist/esm/{chunk-3XZOE2IQ.js → chunk-RVPLXLRA.js} +3 -2
  580. package/dist/esm/{chunk-3XZOE2IQ.js.map → chunk-RVPLXLRA.js.map} +1 -1
  581. package/dist/esm/{chunk-GS2QSZUR.js → chunk-SCIFT27R.js} +2 -1
  582. package/dist/esm/{chunk-GS2QSZUR.js.map → chunk-SCIFT27R.js.map} +1 -1
  583. package/dist/esm/chunk-SGJKXIWG.js +3 -0
  584. package/dist/esm/{chunk-DFGY2NZB.js.map → chunk-SGJKXIWG.js.map} +1 -1
  585. package/dist/esm/chunk-SHLERRO3.js +3 -0
  586. package/dist/esm/chunk-SHLERRO3.js.map +7 -0
  587. package/dist/esm/chunk-SV3CYQY5.js +3 -0
  588. package/dist/esm/{chunk-LVCUY2OS.js.map → chunk-SV3CYQY5.js.map} +2 -2
  589. package/dist/esm/chunk-TDT2CNES.js +2 -0
  590. package/dist/esm/chunk-TDT2CNES.js.map +7 -0
  591. package/dist/esm/chunk-TGRHRMQI.js +3 -0
  592. package/dist/esm/chunk-TGRHRMQI.js.map +7 -0
  593. package/dist/esm/{chunk-HIEGLLY7.js → chunk-TGUWRU7N.js} +2 -1
  594. package/dist/esm/{chunk-HIEGLLY7.js.map → chunk-TGUWRU7N.js.map} +1 -1
  595. package/dist/esm/{chunk-7ZOGH5NT.js → chunk-U5GQ3IFS.js} +2 -1
  596. package/dist/esm/{chunk-7ZOGH5NT.js.map → chunk-U5GQ3IFS.js.map} +1 -1
  597. package/dist/esm/chunk-VPRAXHLL.js +3 -0
  598. package/dist/esm/chunk-VPRAXHLL.js.map +7 -0
  599. package/dist/esm/{chunk-OS3FCYZY.js → chunk-VQPANPMI.js} +2 -1
  600. package/dist/esm/chunk-VRQEWMC6.js +3 -0
  601. package/dist/esm/chunk-VRQEWMC6.js.map +7 -0
  602. package/dist/esm/chunk-VVBSYWUA.js +3 -0
  603. package/dist/esm/chunk-VVBSYWUA.js.map +7 -0
  604. package/dist/esm/{chunk-RKZVXVBN.js → chunk-W4MQ6TEK.js} +3 -2
  605. package/dist/esm/chunk-W4MQ6TEK.js.map +7 -0
  606. package/dist/esm/chunk-WCGQ4IDE.js +3 -0
  607. package/dist/esm/{chunk-H3IAGAEL.js.map → chunk-WCGQ4IDE.js.map} +1 -1
  608. package/dist/esm/{chunk-HWQ3NTJP.js → chunk-WEBNIUEX.js} +2 -1
  609. package/dist/esm/{chunk-HWQ3NTJP.js.map → chunk-WEBNIUEX.js.map} +1 -1
  610. package/dist/esm/chunk-WH7PQSSG.js +2 -0
  611. package/dist/esm/{chunk-PALE5UWK.js → chunk-WJ4H2O2G.js} +3 -2
  612. package/dist/esm/{chunk-PALE5UWK.js.map → chunk-WJ4H2O2G.js.map} +1 -1
  613. package/dist/esm/chunk-WMODMXEU.js +3 -0
  614. package/dist/esm/chunk-WMODMXEU.js.map +7 -0
  615. package/dist/esm/{chunk-KL73COYX.js → chunk-WMZLMZHB.js} +2 -1
  616. package/dist/esm/{chunk-KL73COYX.js.map → chunk-WMZLMZHB.js.map} +1 -1
  617. package/dist/esm/{chunk-GBQZ4Z2H.js → chunk-WN3WMFAM.js} +3 -2
  618. package/dist/esm/{chunk-GBQZ4Z2H.js.map → chunk-WN3WMFAM.js.map} +1 -1
  619. package/dist/esm/{chunk-ETQNRMHU.js → chunk-WT2SYGTU.js} +3 -2
  620. package/dist/esm/{chunk-ETQNRMHU.js.map → chunk-WT2SYGTU.js.map} +1 -1
  621. package/dist/esm/{chunk-SUPFDIJL.js → chunk-WTP2KIK3.js} +2 -1
  622. package/dist/esm/{chunk-SUPFDIJL.js.map → chunk-WTP2KIK3.js.map} +1 -1
  623. package/dist/esm/{chunk-AGAQC4HH.js → chunk-WUCBFB25.js} +2 -1
  624. package/dist/esm/{chunk-AGAQC4HH.js.map → chunk-WUCBFB25.js.map} +1 -1
  625. package/dist/esm/chunk-WZKSLTBH.js +3 -0
  626. package/dist/esm/{chunk-BJUCBOGU.js.map → chunk-WZKSLTBH.js.map} +1 -1
  627. package/dist/esm/{chunk-CN6F4REJ.js → chunk-XH2CRCXR.js} +2 -1
  628. package/dist/esm/{chunk-CN6F4REJ.js.map → chunk-XH2CRCXR.js.map} +1 -1
  629. package/dist/esm/{chunk-KZEZDBE7.js → chunk-XL5OHW6Z.js} +3 -2
  630. package/dist/esm/{chunk-KZEZDBE7.js.map → chunk-XL5OHW6Z.js.map} +1 -1
  631. package/dist/esm/chunk-XMHNOIPB.js +3 -0
  632. package/dist/esm/{chunk-3BUQ7ADW.js.map → chunk-XMHNOIPB.js.map} +1 -1
  633. package/dist/esm/{chunk-YEHM3FZN.js → chunk-XPVRXQSW.js} +3 -2
  634. package/dist/esm/chunk-XPVRXQSW.js.map +7 -0
  635. package/dist/esm/chunk-XU74PNM2.js +3 -0
  636. package/dist/esm/chunk-XU74PNM2.js.map +7 -0
  637. package/dist/esm/{chunk-3J6AUDID.js → chunk-XUCR7L4G.js} +2 -1
  638. package/dist/esm/{chunk-3J6AUDID.js.map → chunk-XUCR7L4G.js.map} +1 -1
  639. package/dist/esm/chunk-XVDT6DQZ.js +3 -0
  640. package/dist/esm/{chunk-TZTUPQYK.js.map → chunk-XVDT6DQZ.js.map} +1 -1
  641. package/dist/esm/chunk-Y2BTPKK6.js +3 -0
  642. package/dist/esm/chunk-Y2BTPKK6.js.map +7 -0
  643. package/dist/esm/{chunk-2N2AQNJH.js → chunk-Y2DBXOLT.js} +2 -1
  644. package/dist/esm/{chunk-2N2AQNJH.js.map → chunk-Y2DBXOLT.js.map} +1 -1
  645. package/dist/esm/chunk-YD2D73LF.js +3 -0
  646. package/dist/esm/chunk-YD2D73LF.js.map +7 -0
  647. package/dist/esm/chunk-YOSCUA6Z.js +3 -0
  648. package/dist/esm/chunk-YOSCUA6Z.js.map +7 -0
  649. package/dist/esm/chunk-YOSLXJI5.js +3 -0
  650. package/dist/esm/chunk-YOSLXJI5.js.map +7 -0
  651. package/dist/esm/chunk-YWG476GC.js +3 -0
  652. package/dist/esm/{chunk-MGQ4A2FI.js.map → chunk-YWG476GC.js.map} +1 -1
  653. package/dist/esm/chunk-YZZMQ457.js +3 -0
  654. package/dist/esm/{chunk-S6GWR6EZ.js.map → chunk-YZZMQ457.js.map} +1 -1
  655. package/dist/esm/chunk-Z27REN6T.js +3 -0
  656. package/dist/esm/chunk-Z27REN6T.js.map +7 -0
  657. package/dist/esm/chunk-Z563IAE3.js +3 -0
  658. package/dist/esm/chunk-Z563IAE3.js.map +7 -0
  659. package/dist/esm/{chunk-THUBY6L2.js → chunk-ZDSY6CJL.js} +3 -2
  660. package/dist/esm/chunk-ZDSY6CJL.js.map +7 -0
  661. package/dist/esm/{chunk-FVY44PTM.js → chunk-ZFDHZEWN.js} +3 -2
  662. package/dist/esm/{chunk-FVY44PTM.js.map → chunk-ZFDHZEWN.js.map} +1 -1
  663. package/dist/esm/chunk-ZPWKWESI.js +3 -0
  664. package/dist/esm/chunk-ZPWKWESI.js.map +7 -0
  665. package/dist/esm/chunk-ZYKJTNAT.js +3 -0
  666. package/dist/esm/chunk-ZYKJTNAT.js.map +7 -0
  667. package/dist/esm/components/_internal/base-button.d.ts.map +1 -1
  668. package/dist/esm/components/_internal/base-button.js +2 -1
  669. package/dist/esm/components/_internal/base-button.props.js +2 -1
  670. package/dist/esm/components/_internal/base-checkbox.props.js +2 -1
  671. package/dist/esm/components/_internal/base-menu.props.js +2 -1
  672. package/dist/esm/components/_internal/base-menu.utils.js +2 -1
  673. package/dist/esm/components/_internal/base-radio.props.js +2 -1
  674. package/dist/esm/components/_internal/base-tab-list.props.js +2 -1
  675. package/dist/esm/components/_internal/dropdown-menu-drill-down.d.ts +19 -7
  676. package/dist/esm/components/_internal/dropdown-menu-drill-down.d.ts.map +1 -1
  677. package/dist/esm/components/_internal/dropdown-menu-drill-down.js +2 -1
  678. package/dist/esm/components/_internal/menu-context.d.ts +10 -0
  679. package/dist/esm/components/_internal/menu-context.d.ts.map +1 -1
  680. package/dist/esm/components/_internal/menu-context.js +2 -1
  681. package/dist/esm/components/_internal/pane-chrome.d.ts +3 -1
  682. package/dist/esm/components/_internal/pane-chrome.d.ts.map +1 -1
  683. package/dist/esm/components/_internal/pane-chrome.js +2 -1
  684. package/dist/esm/components/_internal/shell-bottom.d.ts +1 -1
  685. package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
  686. package/dist/esm/components/_internal/shell-bottom.js +2 -1
  687. package/dist/esm/components/_internal/shell-handles.d.ts.map +1 -1
  688. package/dist/esm/components/_internal/shell-handles.js +2 -1
  689. package/dist/esm/components/_internal/shell-inspector.d.ts +1 -1
  690. package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
  691. package/dist/esm/components/_internal/shell-inspector.js +2 -1
  692. package/dist/esm/components/_internal/shell-pane.d.ts.map +1 -1
  693. package/dist/esm/components/_internal/shell-pane.js +2 -1
  694. package/dist/esm/components/_internal/shell-resizable.d.ts +6 -0
  695. package/dist/esm/components/_internal/shell-resizable.d.ts.map +1 -1
  696. package/dist/esm/components/_internal/shell-resizable.js +2 -1
  697. package/dist/esm/components/_internal/shell-resize.js +2 -1
  698. package/dist/esm/components/_internal/shell-rest.js +2 -1
  699. package/dist/esm/components/_internal/shell-sidebar.d.ts +1 -1
  700. package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
  701. package/dist/esm/components/_internal/shell-sidebar.js +2 -1
  702. package/dist/esm/components/_internal/shell-store.d.ts.map +1 -1
  703. package/dist/esm/components/_internal/shell-store.js +2 -1
  704. package/dist/esm/components/accessible-icon.js +2 -1
  705. package/dist/esm/components/accordion.d.ts.map +1 -1
  706. package/dist/esm/components/accordion.js +2 -1
  707. package/dist/esm/components/accordion.props.js +2 -1
  708. package/dist/esm/components/alert-dialog.d.ts.map +1 -1
  709. package/dist/esm/components/alert-dialog.js +2 -1
  710. package/dist/esm/components/alert-dialog.props.js +2 -1
  711. package/dist/esm/components/avatar.d.ts.map +1 -1
  712. package/dist/esm/components/avatar.js +2 -1
  713. package/dist/esm/components/avatar.props.js +2 -1
  714. package/dist/esm/components/blockquote.js +2 -1
  715. package/dist/esm/components/blockquote.props.js +2 -1
  716. package/dist/esm/components/box.js +2 -1
  717. package/dist/esm/components/box.props.js +2 -1
  718. package/dist/esm/components/button.d.ts.map +1 -1
  719. package/dist/esm/components/button.js +2 -1
  720. package/dist/esm/components/button.props.js +2 -1
  721. package/dist/esm/components/card.js +2 -1
  722. package/dist/esm/components/card.props.js +2 -1
  723. package/dist/esm/components/chatbar.d.ts.map +1 -1
  724. package/dist/esm/components/chatbar.js +2 -1
  725. package/dist/esm/components/checkbox-group.js +2 -1
  726. package/dist/esm/components/checkbox-group.primitive.js +2 -1
  727. package/dist/esm/components/checkbox-group.props.js +2 -1
  728. package/dist/esm/components/checkbox.js +2 -1
  729. package/dist/esm/components/checkbox.props.js +2 -1
  730. package/dist/esm/components/chip.js +2 -1
  731. package/dist/esm/components/chip.props.js +2 -1
  732. package/dist/esm/components/code.js +2 -1
  733. package/dist/esm/components/code.props.js +2 -1
  734. package/dist/esm/components/combobox.d.ts.map +1 -1
  735. package/dist/esm/components/combobox.js +2 -1
  736. package/dist/esm/components/combobox.props.js +2 -1
  737. package/dist/esm/components/context-menu.d.ts +1 -2
  738. package/dist/esm/components/context-menu.d.ts.map +1 -1
  739. package/dist/esm/components/context-menu.js +2 -1
  740. package/dist/esm/components/context-menu.props.js +2 -1
  741. package/dist/esm/components/dialog.js +2 -1
  742. package/dist/esm/components/dialog.props.js +2 -1
  743. package/dist/esm/components/dropdown-menu.d.ts +1 -2
  744. package/dist/esm/components/dropdown-menu.d.ts.map +1 -1
  745. package/dist/esm/components/dropdown-menu.js +2 -1
  746. package/dist/esm/components/dropdown-menu.props.js +2 -1
  747. package/dist/esm/components/flex.js +2 -1
  748. package/dist/esm/components/flex.props.js +2 -1
  749. package/dist/esm/components/grid.js +2 -1
  750. package/dist/esm/components/grid.props.js +2 -1
  751. package/dist/esm/components/heading.d.ts +2 -2
  752. package/dist/esm/components/heading.d.ts.map +1 -1
  753. package/dist/esm/components/heading.js +2 -1
  754. package/dist/esm/components/heading.props.d.ts +1 -1
  755. package/dist/esm/components/heading.props.js +2 -1
  756. package/dist/esm/components/icons.js +2 -1
  757. package/dist/esm/components/image.d.ts +9 -2
  758. package/dist/esm/components/image.d.ts.map +1 -1
  759. package/dist/esm/components/image.js +2 -1
  760. package/dist/esm/components/image.props.js +2 -1
  761. package/dist/esm/components/index.d.ts +1 -1
  762. package/dist/esm/components/index.d.ts.map +1 -1
  763. package/dist/esm/components/index.js +2 -1
  764. package/dist/esm/components/kbd.js +2 -1
  765. package/dist/esm/components/kbd.props.js +2 -1
  766. package/dist/esm/components/link.js +2 -1
  767. package/dist/esm/components/link.props.js +2 -1
  768. package/dist/esm/components/message-scroller.d.ts +2 -2
  769. package/dist/esm/components/message-scroller.d.ts.map +1 -1
  770. package/dist/esm/components/message-scroller.js +2 -1
  771. package/dist/esm/components/navbar.js +2 -1
  772. package/dist/esm/components/navbar.props.js +2 -1
  773. package/dist/esm/components/notice.js +2 -1
  774. package/dist/esm/components/popover.d.ts +3 -1
  775. package/dist/esm/components/popover.d.ts.map +1 -1
  776. package/dist/esm/components/popover.js +2 -1
  777. package/dist/esm/components/popover.props.js +2 -1
  778. package/dist/esm/components/portal.js +2 -1
  779. package/dist/esm/components/progress.d.ts.map +1 -1
  780. package/dist/esm/components/progress.js +2 -1
  781. package/dist/esm/components/progress.props.js +2 -1
  782. package/dist/esm/components/radio-group.js +2 -1
  783. package/dist/esm/components/radio-group.props.js +2 -1
  784. package/dist/esm/components/radio.js +2 -1
  785. package/dist/esm/components/radio.props.js +2 -1
  786. package/dist/esm/components/reset.js +2 -1
  787. package/dist/esm/components/schemas/base-button.schema.js +2 -1
  788. package/dist/esm/components/schemas/button.schema.js +2 -1
  789. package/dist/esm/components/schemas/index.js +2 -1
  790. package/dist/esm/components/schemas/index.js.map +1 -1
  791. package/dist/esm/components/schemas/shell.schema.js +2 -1
  792. package/dist/esm/components/schemas/toggle.schema.js +2 -1
  793. package/dist/esm/components/scroll-area.js +2 -1
  794. package/dist/esm/components/scroll-area.props.js +2 -1
  795. package/dist/esm/components/segmented-control.d.ts.map +1 -1
  796. package/dist/esm/components/segmented-control.js +2 -1
  797. package/dist/esm/components/segmented-control.props.d.ts +0 -1
  798. package/dist/esm/components/segmented-control.props.d.ts.map +1 -1
  799. package/dist/esm/components/segmented-control.props.js +2 -1
  800. package/dist/esm/components/select.d.ts.map +1 -1
  801. package/dist/esm/components/select.js +2 -1
  802. package/dist/esm/components/select.props.js +2 -1
  803. package/dist/esm/components/separator.d.ts.map +1 -1
  804. package/dist/esm/components/separator.js +2 -1
  805. package/dist/esm/components/separator.props.d.ts +1 -1
  806. package/dist/esm/components/separator.props.js +2 -1
  807. package/dist/esm/components/sheet.d.ts +1 -1
  808. package/dist/esm/components/sheet.d.ts.map +1 -1
  809. package/dist/esm/components/sheet.js +2 -1
  810. package/dist/esm/components/shell.context.js +2 -1
  811. package/dist/esm/components/shell.d.ts +5 -2
  812. package/dist/esm/components/shell.d.ts.map +1 -1
  813. package/dist/esm/components/shell.hooks.js +2 -1
  814. package/dist/esm/components/shell.js +2 -1
  815. package/dist/esm/components/shell.types.js +2 -1
  816. package/dist/esm/components/sidebar.d.ts.map +1 -1
  817. package/dist/esm/components/sidebar.js +2 -1
  818. package/dist/esm/components/slider.d.ts.map +1 -1
  819. package/dist/esm/components/slider.js +2 -1
  820. package/dist/esm/components/slider.props.d.ts +0 -2
  821. package/dist/esm/components/slider.props.d.ts.map +1 -1
  822. package/dist/esm/components/slider.props.js +2 -1
  823. package/dist/esm/components/slot.js +2 -1
  824. package/dist/esm/components/spinner.d.ts.map +1 -1
  825. package/dist/esm/components/spinner.js +2 -1
  826. package/dist/esm/components/spinner.props.js +2 -1
  827. package/dist/esm/components/switch.js +2 -1
  828. package/dist/esm/components/switch.props.js +2 -1
  829. package/dist/esm/components/table.d.ts.map +1 -1
  830. package/dist/esm/components/table.js +2 -1
  831. package/dist/esm/components/table.props.d.ts +0 -2
  832. package/dist/esm/components/table.props.d.ts.map +1 -1
  833. package/dist/esm/components/table.props.js +2 -1
  834. package/dist/esm/components/tabs.d.ts.map +1 -1
  835. package/dist/esm/components/tabs.js +2 -1
  836. package/dist/esm/components/tabs.props.js +2 -1
  837. package/dist/esm/components/text-area.d.ts.map +1 -1
  838. package/dist/esm/components/text-area.js +2 -1
  839. package/dist/esm/components/text-area.props.js +2 -1
  840. package/dist/esm/components/text-field.d.ts.map +1 -1
  841. package/dist/esm/components/text-field.js +2 -1
  842. package/dist/esm/components/text-field.props.js +2 -1
  843. package/dist/esm/components/text.js +2 -1
  844. package/dist/esm/components/text.props.js +2 -1
  845. package/dist/esm/components/theme.d.ts.map +1 -1
  846. package/dist/esm/components/theme.js +2 -1
  847. package/dist/esm/components/theme.props.js +2 -1
  848. package/dist/esm/components/toggle.js +2 -1
  849. package/dist/esm/components/toolbar.d.ts +4 -1
  850. package/dist/esm/components/toolbar.d.ts.map +1 -1
  851. package/dist/esm/components/toolbar.js +2 -1
  852. package/dist/esm/components/toolbar.props.js +2 -1
  853. package/dist/esm/components/tooltip.d.ts +13 -2
  854. package/dist/esm/components/tooltip.d.ts.map +1 -1
  855. package/dist/esm/components/tooltip.js +2 -1
  856. package/dist/esm/components/tooltip.props.js +2 -1
  857. package/dist/esm/components/virtual-menu.d.ts +19 -12
  858. package/dist/esm/components/virtual-menu.d.ts.map +1 -1
  859. package/dist/esm/components/virtual-menu.js +2 -1
  860. package/dist/esm/components/visually-hidden.js +2 -1
  861. package/dist/esm/helpers/compile-prop-defs.js +1 -1
  862. package/dist/esm/helpers/extract-margin-props.js +1 -1
  863. package/dist/esm/helpers/extract-props.js +1 -1
  864. package/dist/esm/helpers/font-config.js +1 -1
  865. package/dist/esm/helpers/get-margin-styles.d.ts.map +1 -1
  866. package/dist/esm/helpers/get-margin-styles.js +1 -1
  867. package/dist/esm/helpers/get-matching-gray-color.js +1 -1
  868. package/dist/esm/helpers/get-responsive-styles.js +1 -1
  869. package/dist/esm/helpers/get-subtree.js +1 -1
  870. package/dist/esm/helpers/has-own-property.js +1 -1
  871. package/dist/esm/helpers/index.d.ts +1 -0
  872. package/dist/esm/helpers/index.d.ts.map +1 -1
  873. package/dist/esm/helpers/index.js +1 -1
  874. package/dist/esm/helpers/index.js.map +4 -4
  875. package/dist/esm/helpers/inert.js +1 -1
  876. package/dist/esm/helpers/inert.js.map +1 -1
  877. package/dist/esm/helpers/is-responsive-object.js +1 -1
  878. package/dist/esm/helpers/map-prop-values.js +1 -1
  879. package/dist/esm/helpers/merge-styles.js +1 -1
  880. package/dist/esm/helpers/normalize-to-px.js +1 -1
  881. package/dist/esm/helpers/require-react-element.js +1 -1
  882. package/dist/esm/helpers/theme-size.d.ts +8 -30
  883. package/dist/esm/helpers/theme-size.d.ts.map +1 -1
  884. package/dist/esm/helpers/theme-size.js +1 -1
  885. package/dist/esm/helpers/warn-deprecated.js +1 -1
  886. package/dist/esm/helpers/warn-deprecated.js.map +4 -4
  887. package/dist/esm/hooks/appearance-script.js +11 -1
  888. package/dist/esm/hooks/appearance-script.js.map +4 -4
  889. package/dist/esm/hooks/index.js +2 -1
  890. package/dist/esm/hooks/theme-size.d.ts +32 -0
  891. package/dist/esm/hooks/theme-size.d.ts.map +1 -0
  892. package/dist/esm/hooks/theme-size.js +3 -0
  893. package/dist/esm/hooks/use-appearance.d.ts.map +1 -1
  894. package/dist/esm/hooks/use-appearance.js +2 -1
  895. package/dist/esm/hooks/use-body-pointer-events-cleanup.d.ts +1 -1
  896. package/dist/esm/hooks/use-body-pointer-events-cleanup.d.ts.map +1 -1
  897. package/dist/esm/hooks/use-body-pointer-events-cleanup.js +2 -1
  898. package/dist/esm/hooks/use-breakpoint.js +2 -1
  899. package/dist/esm/hooks/use-live-announcer.js +2 -1
  900. package/dist/esm/hooks/use-prop-synced-state.js +2 -1
  901. package/dist/esm/hooks/use-scroll-edges.js +2 -1
  902. package/dist/esm/hooks/use-thumb-sync.js +2 -1
  903. package/dist/esm/hooks/use-toggle-state.js +2 -1
  904. package/dist/esm/hooks/use-tooltip-wrapper.js +2 -1
  905. package/dist/esm/index.js +2 -1
  906. package/dist/esm/props/as-child.prop.js +1 -1
  907. package/dist/esm/props/color.prop.js +1 -1
  908. package/dist/esm/props/emphasis.prop.js +1 -1
  909. package/dist/esm/props/font-family.prop.js +1 -1
  910. package/dist/esm/props/font-family.prop.js.map +4 -4
  911. package/dist/esm/props/gap.props.d.ts +4 -4
  912. package/dist/esm/props/gap.props.js +1 -1
  913. package/dist/esm/props/height.props.js +1 -1
  914. package/dist/esm/props/index.js +1 -1
  915. package/dist/esm/props/index.js.map +3 -3
  916. package/dist/esm/props/layout.props.js +1 -1
  917. package/dist/esm/props/leading-trim.prop.js +1 -1
  918. package/dist/esm/props/margin.props.js +1 -1
  919. package/dist/esm/props/padding.props.js +1 -1
  920. package/dist/esm/props/prop-def.js +1 -1
  921. package/dist/esm/props/radius.prop.js +1 -1
  922. package/dist/esm/props/shadow.props.js +1 -1
  923. package/dist/esm/props/text-align.prop.js +1 -1
  924. package/dist/esm/props/text-wrap.prop.js +1 -1
  925. package/dist/esm/props/truncate.prop.js +1 -1
  926. package/dist/esm/props/weight.prop.js +1 -1
  927. package/dist/esm/props/width.props.js +1 -1
  928. package/layout/utilities.css +2 -2
  929. package/layout.css +2 -2
  930. package/package.json +3 -7
  931. package/src/components/_internal/base-button.css +24 -6
  932. package/src/components/_internal/base-button.props.ts +1 -1
  933. package/src/components/_internal/base-button.tsx +101 -42
  934. package/src/components/_internal/base-checkbox.css +23 -0
  935. package/src/components/_internal/base-menu.css +9 -3
  936. package/src/components/_internal/base-radio.css +22 -0
  937. package/src/components/_internal/base-tab-list.css +5 -0
  938. package/src/components/_internal/dropdown-menu-drill-down.tsx +45 -26
  939. package/src/components/_internal/menu-context.tsx +36 -1
  940. package/src/components/_internal/pane-chrome.tsx +8 -6
  941. package/src/components/_internal/shell-bottom.tsx +2 -0
  942. package/src/components/_internal/shell-handles.tsx +10 -1
  943. package/src/components/_internal/shell-inspector.tsx +6 -1
  944. package/src/components/_internal/shell-pane.tsx +5 -4
  945. package/src/components/_internal/shell-resizable.tsx +30 -8
  946. package/src/components/_internal/shell-sidebar.tsx +6 -1
  947. package/src/components/_internal/shell-store.tsx +2 -1
  948. package/src/components/accordion.css +55 -69
  949. package/src/components/accordion.tsx +1 -27
  950. package/src/components/alert-dialog.tsx +5 -1
  951. package/src/components/avatar.css +6 -2
  952. package/src/components/avatar.tsx +37 -4
  953. package/src/components/blockquote.css +2 -2
  954. package/src/components/button.tsx +12 -5
  955. package/src/components/card.css +14 -3
  956. package/src/components/card.tsx +1 -1
  957. package/src/components/chatbar.css +20 -3
  958. package/src/components/chatbar.tsx +15 -12
  959. package/src/components/checkbox-group.css +1 -5
  960. package/src/components/checkbox-group.tsx +1 -1
  961. package/src/components/checkbox.css +1 -5
  962. package/src/components/checkbox.tsx +1 -1
  963. package/src/components/chip.css +0 -3
  964. package/src/components/combobox.tsx +26 -27
  965. package/src/components/context-menu.tsx +48 -28
  966. package/src/components/dialog.tsx +1 -1
  967. package/src/components/dropdown-menu.css +0 -6
  968. package/src/components/dropdown-menu.tsx +72 -35
  969. package/src/components/heading.props.tsx +1 -1
  970. package/src/components/heading.tsx +4 -4
  971. package/src/components/image.css +5 -0
  972. package/src/components/image.tsx +29 -3
  973. package/src/components/index.tsx +1 -1
  974. package/src/components/kbd.css +6 -5
  975. package/src/components/link.css +1 -5
  976. package/src/components/message-scroller.tsx +15 -26
  977. package/src/components/navbar.css +9 -1
  978. package/src/components/navbar.tsx +1 -1
  979. package/src/components/notice.tsx +1 -1
  980. package/src/components/popover.css +18 -12
  981. package/src/components/popover.tsx +14 -12
  982. package/src/components/progress.css +33 -6
  983. package/src/components/progress.tsx +5 -3
  984. package/src/components/radio-group.tsx +1 -1
  985. package/src/components/radio.tsx +1 -1
  986. package/src/components/scroll-area.css +34 -4
  987. package/src/components/segmented-control.css +178 -148
  988. package/src/components/segmented-control.props.tsx +1 -1
  989. package/src/components/segmented-control.tsx +89 -64
  990. package/src/components/select.css +16 -29
  991. package/src/components/select.tsx +5 -16
  992. package/src/components/separator.css +8 -1
  993. package/src/components/separator.props.tsx +1 -1
  994. package/src/components/separator.tsx +22 -4
  995. package/src/components/sheet.css +8 -7
  996. package/src/components/sheet.tsx +4 -2
  997. package/src/components/shell.css +148 -21
  998. package/src/components/shell.tsx +19 -2
  999. package/src/components/sidebar.css +1 -135
  1000. package/src/components/sidebar.tsx +194 -161
  1001. package/src/components/slider.css +90 -21
  1002. package/src/components/slider.props.tsx +2 -2
  1003. package/src/components/slider.tsx +79 -92
  1004. package/src/components/spinner.css +10 -2
  1005. package/src/components/spinner.tsx +5 -1
  1006. package/src/components/switch.css +40 -8
  1007. package/src/components/switch.tsx +1 -1
  1008. package/src/components/table.css +5 -1
  1009. package/src/components/table.props.tsx +0 -9
  1010. package/src/components/table.tsx +3 -2
  1011. package/src/components/tabs.tsx +11 -4
  1012. package/src/components/text-area.css +17 -2
  1013. package/src/components/text-area.tsx +21 -17
  1014. package/src/components/text-field.css +51 -36
  1015. package/src/components/text-field.tsx +101 -50
  1016. package/src/components/theme.tsx +15 -45
  1017. package/src/components/toolbar.tsx +52 -16
  1018. package/src/components/tooltip.css +8 -1
  1019. package/src/components/tooltip.tsx +30 -3
  1020. package/src/components/virtual-menu.css +80 -0
  1021. package/src/components/virtual-menu.tsx +103 -62
  1022. package/src/helpers/get-margin-styles.ts +8 -10
  1023. package/src/helpers/index.ts +3 -0
  1024. package/src/helpers/theme-size.ts +8 -46
  1025. package/src/hooks/theme-size.ts +50 -0
  1026. package/src/hooks/use-appearance.ts +32 -19
  1027. package/src/hooks/use-body-pointer-events-cleanup.ts +123 -124
  1028. package/src/props/gap.props.ts +4 -4
  1029. package/src/styles/tokens/color.css +3 -0
  1030. package/src/styles/utilities/margin.css +2 -2
  1031. package/src/styles/utilities/text-align.css +8 -0
  1032. package/styles.css +1837 -808
  1033. package/tokens/base.css +2 -0
  1034. package/tokens.css +2 -0
  1035. package/utilities.css +38 -2
  1036. package/dist/esm/chunk-2E4P5XQL.js +0 -2
  1037. package/dist/esm/chunk-2E4P5XQL.js.map +0 -7
  1038. package/dist/esm/chunk-2KZ4NI3X.js +0 -1
  1039. package/dist/esm/chunk-3BUQ7ADW.js +0 -2
  1040. package/dist/esm/chunk-3PTKPDSA.js +0 -2
  1041. package/dist/esm/chunk-3PTKPDSA.js.map +0 -7
  1042. package/dist/esm/chunk-3QZBWH2A.js.map +0 -7
  1043. package/dist/esm/chunk-3VTS4C63.js +0 -2
  1044. package/dist/esm/chunk-3VTS4C63.js.map +0 -7
  1045. package/dist/esm/chunk-3WE4E2WQ.js +0 -2
  1046. package/dist/esm/chunk-3WE4E2WQ.js.map +0 -7
  1047. package/dist/esm/chunk-3XUY5WFA.js +0 -2
  1048. package/dist/esm/chunk-3XUY5WFA.js.map +0 -7
  1049. package/dist/esm/chunk-3YLYGKFB.js +0 -2
  1050. package/dist/esm/chunk-3YLYGKFB.js.map +0 -7
  1051. package/dist/esm/chunk-432YLNB3.js +0 -2
  1052. package/dist/esm/chunk-432YLNB3.js.map +0 -7
  1053. package/dist/esm/chunk-4BU4R7UM.js.map +0 -7
  1054. package/dist/esm/chunk-4R5EMVB3.js +0 -2
  1055. package/dist/esm/chunk-4R5EMVB3.js.map +0 -7
  1056. package/dist/esm/chunk-4ZOVV3TY.js +0 -2
  1057. package/dist/esm/chunk-5ROQAZ7J.js +0 -2
  1058. package/dist/esm/chunk-5ROQAZ7J.js.map +0 -7
  1059. package/dist/esm/chunk-63PQNLFJ.js +0 -2
  1060. package/dist/esm/chunk-6DWDNKLS.js +0 -1
  1061. package/dist/esm/chunk-7CUQMU3T.js +0 -2
  1062. package/dist/esm/chunk-7CUQMU3T.js.map +0 -7
  1063. package/dist/esm/chunk-BGAJ2MDF.js +0 -2
  1064. package/dist/esm/chunk-BGAJ2MDF.js.map +0 -7
  1065. package/dist/esm/chunk-BJUCBOGU.js +0 -2
  1066. package/dist/esm/chunk-CLZW2IDD.js +0 -2
  1067. package/dist/esm/chunk-CLZW2IDD.js.map +0 -7
  1068. package/dist/esm/chunk-CMHUK7OG.js +0 -2
  1069. package/dist/esm/chunk-CMHUK7OG.js.map +0 -7
  1070. package/dist/esm/chunk-DFGY2NZB.js +0 -2
  1071. package/dist/esm/chunk-DUTZUWZP.js +0 -2
  1072. package/dist/esm/chunk-DUTZUWZP.js.map +0 -7
  1073. package/dist/esm/chunk-EZYXYLR2.js +0 -2
  1074. package/dist/esm/chunk-FDHWAC6W.js +0 -2
  1075. package/dist/esm/chunk-FDHWAC6W.js.map +0 -7
  1076. package/dist/esm/chunk-FDJV5RXX.js.map +0 -7
  1077. package/dist/esm/chunk-G2JD52O5.js +0 -2
  1078. package/dist/esm/chunk-G2JD52O5.js.map +0 -7
  1079. package/dist/esm/chunk-G4ETY2NP.js +0 -2
  1080. package/dist/esm/chunk-G4ETY2NP.js.map +0 -7
  1081. package/dist/esm/chunk-GPOCLDBR.js +0 -2
  1082. package/dist/esm/chunk-GPOCLDBR.js.map +0 -7
  1083. package/dist/esm/chunk-H3IAGAEL.js +0 -2
  1084. package/dist/esm/chunk-H5BYPX6V.js.map +0 -7
  1085. package/dist/esm/chunk-H5G7UECV.js +0 -2
  1086. package/dist/esm/chunk-H5G7UECV.js.map +0 -7
  1087. package/dist/esm/chunk-HT7RFHLW.js +0 -2
  1088. package/dist/esm/chunk-HT7RFHLW.js.map +0 -7
  1089. package/dist/esm/chunk-I4FLQELQ.js.map +0 -7
  1090. package/dist/esm/chunk-IUER6BNH.js +0 -12
  1091. package/dist/esm/chunk-IUER6BNH.js.map +0 -7
  1092. package/dist/esm/chunk-IVQHRM33.js +0 -2
  1093. package/dist/esm/chunk-IVQHRM33.js.map +0 -7
  1094. package/dist/esm/chunk-KA5UE2VN.js +0 -2
  1095. package/dist/esm/chunk-KA5UE2VN.js.map +0 -7
  1096. package/dist/esm/chunk-KEGCX5VM.js +0 -2
  1097. package/dist/esm/chunk-KEGCX5VM.js.map +0 -7
  1098. package/dist/esm/chunk-KT2CMUS5.js +0 -2
  1099. package/dist/esm/chunk-KT2CMUS5.js.map +0 -7
  1100. package/dist/esm/chunk-KVHKPUZ2.js +0 -2
  1101. package/dist/esm/chunk-KVHKPUZ2.js.map +0 -7
  1102. package/dist/esm/chunk-LVCUY2OS.js +0 -2
  1103. package/dist/esm/chunk-M7I6ISPL.js +0 -2
  1104. package/dist/esm/chunk-M7I6ISPL.js.map +0 -7
  1105. package/dist/esm/chunk-MGQ4A2FI.js +0 -2
  1106. package/dist/esm/chunk-MHANZINI.js +0 -2
  1107. package/dist/esm/chunk-MHANZINI.js.map +0 -7
  1108. package/dist/esm/chunk-MYYXOFU5.js +0 -1
  1109. package/dist/esm/chunk-N3WBEQWL.js +0 -5
  1110. package/dist/esm/chunk-N3WBEQWL.js.map +0 -7
  1111. package/dist/esm/chunk-NC3CJUE3.js +0 -2
  1112. package/dist/esm/chunk-NC3CJUE3.js.map +0 -7
  1113. package/dist/esm/chunk-OA7C34MJ.js +0 -1
  1114. package/dist/esm/chunk-P2MV6HLA.js +0 -2
  1115. package/dist/esm/chunk-P2MV6HLA.js.map +0 -7
  1116. package/dist/esm/chunk-PDMCLVYT.js +0 -2
  1117. package/dist/esm/chunk-PDMCLVYT.js.map +0 -7
  1118. package/dist/esm/chunk-PJR6GRZC.js +0 -2
  1119. package/dist/esm/chunk-PJR6GRZC.js.map +0 -7
  1120. package/dist/esm/chunk-PM6QY3JO.js.map +0 -7
  1121. package/dist/esm/chunk-PPZY7PJA.js +0 -2
  1122. package/dist/esm/chunk-PPZY7PJA.js.map +0 -7
  1123. package/dist/esm/chunk-Q4IA622Q.js +0 -2
  1124. package/dist/esm/chunk-RKZVXVBN.js.map +0 -7
  1125. package/dist/esm/chunk-S6GWR6EZ.js +0 -2
  1126. package/dist/esm/chunk-SKOYHBIE.js +0 -2
  1127. package/dist/esm/chunk-STPMPY3X.js +0 -1
  1128. package/dist/esm/chunk-THUBY6L2.js.map +0 -7
  1129. package/dist/esm/chunk-TXQZ5HLV.js +0 -2
  1130. package/dist/esm/chunk-TXQZ5HLV.js.map +0 -7
  1131. package/dist/esm/chunk-TZTUPQYK.js +0 -2
  1132. package/dist/esm/chunk-UICSVJ3B.js +0 -1
  1133. package/dist/esm/chunk-UKASIY6M.js +0 -2
  1134. package/dist/esm/chunk-UKASIY6M.js.map +0 -7
  1135. package/dist/esm/chunk-UONSKZQT.js +0 -2
  1136. package/dist/esm/chunk-V5O3TF57.js +0 -2
  1137. package/dist/esm/chunk-V5O3TF57.js.map +0 -7
  1138. package/dist/esm/chunk-VCV7RACK.js +0 -2
  1139. package/dist/esm/chunk-VCV7RACK.js.map +0 -7
  1140. package/dist/esm/chunk-VPSMETY2.js +0 -2
  1141. package/dist/esm/chunk-VUNCI6A6.js +0 -2
  1142. package/dist/esm/chunk-VUNCI6A6.js.map +0 -7
  1143. package/dist/esm/chunk-VUPIJNG2.js +0 -2
  1144. package/dist/esm/chunk-VUPIJNG2.js.map +0 -7
  1145. package/dist/esm/chunk-VVWYAVHM.js.map +0 -7
  1146. package/dist/esm/chunk-VXQQ6KXI.js +0 -2
  1147. package/dist/esm/chunk-VXQQ6KXI.js.map +0 -7
  1148. package/dist/esm/chunk-WG5ORTIW.js +0 -2
  1149. package/dist/esm/chunk-WG5ORTIW.js.map +0 -7
  1150. package/dist/esm/chunk-WMVR2XBR.js +0 -2
  1151. package/dist/esm/chunk-WMVR2XBR.js.map +0 -7
  1152. package/dist/esm/chunk-WOR3JCLX.js +0 -1
  1153. package/dist/esm/chunk-WX7SX5BN.js +0 -2
  1154. package/dist/esm/chunk-WX7SX5BN.js.map +0 -7
  1155. package/dist/esm/chunk-X4A3XRBY.js +0 -2
  1156. package/dist/esm/chunk-XOACTIBL.js +0 -2
  1157. package/dist/esm/chunk-XOACTIBL.js.map +0 -7
  1158. package/dist/esm/chunk-XZQSSRTG.js +0 -2
  1159. package/dist/esm/chunk-YEHM3FZN.js.map +0 -7
  1160. package/dist/esm/chunk-YIK4ACXS.js +0 -2
  1161. package/dist/esm/chunk-YIK4ACXS.js.map +0 -7
  1162. package/dist/esm/chunk-YXLDRDHW.js +0 -2
  1163. /package/dist/esm/{chunk-ELAW7ZUG.js.map → chunk-6FLLFCBU.js.map} +0 -0
  1164. /package/dist/esm/{chunk-2KZ4NI3X.js.map → chunk-A2OMWZI7.js.map} +0 -0
  1165. /package/dist/esm/{chunk-6DWDNKLS.js.map → chunk-AYKOOEZR.js.map} +0 -0
  1166. /package/dist/esm/{chunk-7FTUTUMD.js.map → chunk-IZXML75Y.js.map} +0 -0
  1167. /package/dist/esm/{chunk-MYYXOFU5.js.map → chunk-J3QIUJ6F.js.map} +0 -0
  1168. /package/dist/esm/{chunk-PBFSBHBS.js.map → chunk-JUY7CBSL.js.map} +0 -0
  1169. /package/dist/esm/{chunk-OA7C34MJ.js.map → chunk-JZ5Z53MN.js.map} +0 -0
  1170. /package/dist/esm/{chunk-OS3FCYZY.js.map → chunk-NG54K6FL.js.map} +0 -0
  1171. /package/dist/esm/{chunk-STPMPY3X.js.map → chunk-VQPANPMI.js.map} +0 -0
  1172. /package/dist/esm/{chunk-UICSVJ3B.js.map → chunk-WH7PQSSG.js.map} +0 -0
  1173. /package/dist/esm/{chunk-WOR3JCLX.js.map → hooks/theme-size.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/toolbar.tsx", "../../../src/components/toolbar.props.tsx", "../../../src/components/button.tsx", "../../../src/components/_internal/base-button.tsx", "../../../src/props/as-child.prop.ts", "../../../src/props/color.prop.ts", "../../../src/props/radius.prop.ts", "../../../src/components/_internal/base-button.props.ts", "../../../src/components/flex.tsx", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/props/padding.props.ts", "../../../src/props/height.props.ts", "../../../src/props/width.props.ts", "../../../src/props/layout.props.ts", "../../../src/props/margin.props.ts", "../../../src/components/slot.tsx", "../../../src/props/gap.props.ts", "../../../src/components/flex.props.tsx", "../../../src/components/spinner.tsx", "../../../src/components/spinner.props.tsx", "../../../src/components/icons.tsx", "../../../src/helpers/theme-size.ts", "../../../src/components/tooltip.tsx", "../../../src/components/text.tsx", "../../../src/props/emphasis.prop.ts", "../../../src/props/leading-trim.prop.ts", "../../../src/props/text-align.prop.ts", "../../../src/props/text-wrap.prop.ts", "../../../src/props/truncate.prop.ts", "../../../src/props/font-family.prop.ts", "../../../src/props/weight.prop.ts", "../../../src/components/text.props.tsx", "../../../src/components/theme.tsx", "../../../src/helpers/get-matching-gray-color.ts", "../../../src/hooks/use-prop-synced-state.ts", "../../../src/components/theme.props.tsx", "../../../src/components/tooltip.props.tsx", "../../../src/hooks/use-tooltip-wrapper.ts", "../../../src/components/dropdown-menu.tsx", "../../../src/components/_internal/menu-context.tsx", "../../../src/components/_internal/base-menu.utils.tsx", "../../../src/components/kbd.tsx", "../../../src/components/kbd.props.tsx", "../../../src/hooks/use-breakpoint.ts", "../../../src/components/shell.types.ts", "../../../src/components/scroll-area.tsx", "../../../src/components/scroll-area.props.tsx", "../../../src/hooks/use-scroll-edges.ts", "../../../src/hooks/use-thumb-sync.ts", "../../../src/helpers/get-subtree.ts", "../../../src/components/_internal/base-menu.props.ts", "../../../src/components/_internal/dropdown-menu-drill-down.tsx", "../../../src/helpers/require-react-element.ts", "../../../src/components/_internal/pane-chrome.tsx", "../../../src/components/_internal/shell-store.tsx"],
4
- "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Toolbar as ToolbarPrimitive } from 'radix-ui';\n\nimport { toolbarRootPropDefs } from './toolbar.props.js';\nimport { Button } from './button.js';\nimport * as DropdownMenu from './dropdown-menu.js';\nimport { Text } from './text.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSize } from '../helpers/theme-size.js';\nimport { layoutPropDefs } from '../props/layout.props.js';\nimport { usePaneBandSize } from './_internal/pane-chrome.js';\n\nimport type { ButtonProps } from './button.js';\nimport type { LayoutProps } from '../props/layout.props.js';\nimport type { TextProps } from './text.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ButtonRankProps } from './button.js';\n\n/*\n * Toolbar takes Kookie UI v2's contract (v2: components/toolbar), built on Radix instead of\n * Base UI. A toolbar is a row of controls with ONE tab stop: `role=\"toolbar\"`, and the arrow\n * keys move focus between its controls. That keyboard is the reason it is a component.\n *\n * Its `size` reaches every control inside it that does not state its own. The row itself paints\n * nothing; a `ToolbarGroup` draws a quiet well around controls that belong together, and a\n * `ToolbarSeparator` draws a gray hairline between clusters. Use a `Flex` to cluster controls\n * without a well: the row spaces the clusters with `space-between`.\n */\n\ntype ToolbarSize = NonNullable<GetPropDefTypes<typeof toolbarRootPropDefs>['size']>;\ntype ToolbarOrientation = NonNullable<GetPropDefTypes<typeof toolbarRootPropDefs>['orientation']>;\n\ninterface ToolbarContextValue {\n size: ToolbarSize;\n orientation: ToolbarOrientation;\n backdrop: boolean;\n}\n\nconst ToolbarContext = React.createContext<ToolbarContextValue | null>(null);\n\n/** Set by a `ToolbarGroup`: its children rest quiet, and `disabled` turns them all off. */\nconst ToolbarGroupContext = React.createContext<{ disabled: boolean } | null>(null);\n\n/**\n * True while a subtree is drawn into a `ToolbarOverflow`'s menu instead of into the row (v2\n * `InOverflow`). The parts answer it themselves: a `ToolbarButton` renders a menu item, a\n * `ToolbarGroup` a menu group, a `ToolbarSeparator` a menu separator.\n */\nconst InOverflowContext = React.createContext(false);\n\n/**\n * True while this subtree is drawn into a `ToolbarOverflow`'s \"More\" menu instead of the row.\n *\n * The toolbar's own parts handle this already. Use it in your own component inside a\n * `ToolbarOverflow` to render a different form in the menu.\n */\nfunction useToolbarOverflow(): boolean {\n return React.useContext(InOverflowContext);\n}\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\n// ============================================================================\n// Toolbar (root)\n// ============================================================================\n\ntype ToolbarOwnProps = GetPropDefTypes<typeof toolbarRootPropDefs>;\n\ninterface ToolbarProps\n extends ComponentPropsWithout<typeof ToolbarPrimitive.Root, RemovedProps | 'orientation'>,\n ToolbarOwnProps,\n LayoutProps {\n /**\n * Gives every control a surface of its own, for a row that content passes behind, such as\n * `Shell.PaneHeader float`. Buttons rest `raised` instead of `soft`, and a group's well is\n * solid and raised.\n */\n backdrop?: boolean;\n}\n\n/**\n * A row of controls with one keyboard tab stop. The arrow keys move focus between the controls.\n *\n * Give it an `aria-label` (or `aria-labelledby`) that says what the controls act on.\n *\n * @example\n * ```tsx\n * <Toolbar aria-label=\"Formatting\">\n * <ToolbarGroup>\n * <ToolbarButton iconOnly aria-label=\"Bold\" aria-pressed={bold} onClick={toggleBold}>\n * <HugeiconsIcon icon={TextBoldIcon} strokeWidth={1.75} />\n * </ToolbarButton>\n * </ToolbarGroup>\n * <ToolbarSeparator />\n * <ToolbarButton>Share</ToolbarButton>\n * </Toolbar>\n * ```\n */\nconst ToolbarRoot = React.forwardRef<HTMLDivElement, ToolbarProps>((props, forwardedRef) => {\n // Inside a Shell (a pane's header or footer, or the content area), a toolbar with no size\n // rests one step above the Shell's. A pane's scrolling list has no band.\n const band = usePaneBandSize();\n // Elsewhere it takes the nearest Theme's size.\n const size: ToolbarSize = useThemeSize(props.size ?? band ?? undefined, toolbarRootPropDefs.size);\n const orientation: ToolbarOrientation = props.orientation ?? toolbarRootPropDefs.orientation.default;\n const { className, orientation: _orientation, backdrop = false, children, ...rootProps } = extractProps(\n { ...props, size },\n toolbarRootPropDefs,\n layoutPropDefs,\n );\n\n const context = React.useMemo(() => ({ size, orientation, backdrop }), [size, orientation, backdrop]);\n\n return (\n <ToolbarPrimitive.Root\n {...rootProps}\n ref={forwardedRef}\n orientation={orientation}\n data-backdrop={backdrop || undefined}\n className={classNames('kui-Toolbar', className)}\n >\n <ToolbarContext.Provider value={context}>{children}</ToolbarContext.Provider>\n </ToolbarPrimitive.Root>\n );\n});\nToolbarRoot.displayName = 'Toolbar';\n\n// ============================================================================\n// ToolbarGroup\n// ============================================================================\n\ninterface ToolbarGroupProps extends ComponentPropsWithout<'div', RemovedProps> {\n /** Turns every control in the group off at once. */\n disabled?: boolean;\n}\n\n/**\n * Controls that belong together, drawn as one quiet well that stands level with a button\n * beside it. Buttons inside it rest as `ghost` unless they state a `variant`.\n * To cluster controls without a well, use a `Flex`.\n *\n * In a `ToolbarOverflow`'s menu it is a menu group. Outside a `Toolbar` (rendered through a\n * portal, for example) it still draws its well, as a horizontal group.\n */\nconst ToolbarGroup = React.forwardRef<HTMLDivElement, ToolbarGroupProps>(\n ({ className, disabled = false, children, ...props }, forwardedRef) => {\n const toolbar = React.useContext(ToolbarContext);\n const overflow = React.useContext(InOverflowContext);\n const group = React.useMemo(() => ({ disabled }), [disabled]);\n\n if (overflow) {\n return (\n <DropdownMenu.Group {...props} ref={forwardedRef} className={className}>\n <ToolbarGroupContext.Provider value={group}>{children}</ToolbarGroupContext.Provider>\n </DropdownMenu.Group>\n );\n }\n\n return (\n <div\n role=\"group\"\n data-orientation={toolbar?.orientation ?? 'horizontal'}\n data-disabled={disabled || undefined}\n {...props}\n ref={forwardedRef}\n className={classNames('kui-ToolbarGroup', className)}\n >\n <ToolbarGroupContext.Provider value={group}>{children}</ToolbarGroupContext.Provider>\n </div>\n );\n },\n);\nToolbarGroup.displayName = 'Toolbar.Group';\n\n// ============================================================================\n// ToolbarButton\n// ============================================================================\n\ntype ToolbarButtonBaseProps = Omit<ButtonProps, 'as' | 'variant' | 'emphasis'>;\n\n/** A labelled button: takes every `Button` prop. */\ntype ToolbarTextButtonProps = ToolbarButtonBaseProps &\n ButtonRankProps & {\n iconOnly?: false;\n};\n\n/** An icon-only button: renders `Button iconOnly`, and the type requires an `aria-label`. */\ntype ToolbarIconButtonProps = Omit<ToolbarButtonBaseProps, 'aria-label' | 'aria-labelledby' | 'fullWidth'> &\n ButtonRankProps & {\n iconOnly: true;\n /** The control's accessible name. An icon has no words of its own, so this is required. */\n 'aria-label': string;\n};\n\ntype ToolbarButtonProps = ToolbarTextButtonProps | ToolbarIconButtonProps;\n\nfunction isPressed(value: React.AriaAttributes['aria-pressed']) {\n return value === true || value === 'true';\n}\n\n/** Does an `asChild` child render a native `<button>`? Only then is it a Radix Toolbar.Button. */\nfunction isButtonElement(children: React.ReactNode) {\n return React.isValidElement(children) && children.type === 'button';\n}\n\n/**\n * A `Button` that joins the toolbar's keyboard navigation, so a row of them is one tab stop.\n *\n * Set `iconOnly` (with an `aria-label`) for a symbol-only control. Set `aria-pressed` for a\n * control that toggles; a pressed button wears Button's pressed look. Set `asChild` to render\n * your own element, such as a link: `<ToolbarButton asChild><a href=\"/docs\">Docs</a></ToolbarButton>`.\n * A link stays in the arrow-key row and gets no `type` attribute.\n *\n * It takes the toolbar's `size`, and rests as a gray `soft` button (`raised` in a toolbar with\n * `backdrop`, gray `ghost` inside a `ToolbarGroup`). A stated `size`, `variant` or `color` wins; a\n * stated `variant` without a `color` takes Button's own default colour.\n *\n * In a `ToolbarOverflow`'s menu it renders a menu item; an icon-only button uses its\n * `aria-label` as the item's text. Outside a `Toolbar` (rendered through a React portal, for\n * example) it renders a plain Button with the same rest look, as its own tab stop. Use\n * `ToolbarSlot` and `ToolbarFill` for a control that should join the row's arrow keys.\n */\nconst ToolbarButton = React.forwardRef<HTMLButtonElement, ToolbarButtonProps>((props, forwardedRef) => {\n const toolbar = React.useContext(ToolbarContext);\n const group = React.useContext(ToolbarGroupContext);\n const overflow = React.useContext(InOverflowContext);\n const { iconOnly, size, variant, emphasis, color, disabled, asChild, onKeyDown, ...rest } = props;\n const off = disabled || group?.disabled || undefined;\n\n if (overflow) {\n return (\n <ToolbarOverflowItem\n // Only what a menu row means comes across; Button's box props (size, loading,\n // tooltip, fullWidth and the rest) would land on the DOM as unknown attributes.\n id={rest.id}\n className={rest.className}\n style={rest.style}\n onClick={rest.onClick as React.MouseEventHandler<HTMLDivElement> | undefined}\n aria-label={rest['aria-label']}\n ref={forwardedRef as unknown as React.Ref<HTMLDivElement>}\n asChild={asChild}\n iconOnly={iconOnly}\n disabled={off}\n color={color}\n >\n {rest.children}\n </ToolbarOverflowItem>\n );\n }\n\n // In a vertical toolbar, Up and Down belong to the toolbar. A menu trigger rendering this\n // hands its open-on-arrow handler in through `onKeyDown`; those two keys skip it (v2).\n const handleKeyDown =\n toolbar?.orientation === 'vertical' && onKeyDown\n ? (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') return;\n onKeyDown(event);\n }\n : onKeyDown;\n\n const pressed = isPressed(props['aria-pressed']);\n const stateProps =\n 'data-state' in props || props['aria-pressed'] === undefined ? {} : { 'data-state': pressed ? 'on' : 'off' };\n\n const shared = {\n size: size ?? toolbar?.size,\n // A caller states the look by `variant` or the rank by `emphasis`, never both.\n ...(emphasis !== undefined\n ? { emphasis }\n : { variant: variant ?? (group ? 'ghost' : toolbar?.backdrop ? 'raised' : 'soft') }),\n // The gray rest is a pair with the default variant: a caller who states a variant or an\n // emphasis gets Button's own colour for it unless they state a colour too.\n color: color ?? (variant || emphasis ? undefined : 'gray'),\n ...stateProps,\n } as const;\n\n // The text and icon-only branches share every prop but the name; one Button renders both.\n const buttonProps = {\n ...rest,\n ...(iconOnly ? { iconOnly: true } : {}),\n ...(asChild ? { asChild: true } : {}),\n ...(handleKeyDown ? { onKeyDown: handleKeyDown } : {}),\n ...shared,\n } as ButtonProps;\n\n // Outside a toolbar there is no row to join: a plain Button, not a throw.\n if (!toolbar) {\n return <Button {...buttonProps} ref={forwardedRef} disabled={off} />;\n }\n\n // A link (or any non-button child) joins the row as a Radix Toolbar.Link, which sets no\n // `type`. Toolbar.Button would stamp `type=\"button\"` on it.\n if (asChild && !isButtonElement(rest.children)) {\n return (\n <ToolbarPrimitive.Link asChild ref={forwardedRef as unknown as React.Ref<HTMLAnchorElement>}>\n <Button {...buttonProps} disabled={off} />\n </ToolbarPrimitive.Link>\n );\n }\n\n return (\n <ToolbarPrimitive.Button asChild ref={forwardedRef} disabled={off}>\n <Button {...buttonProps} />\n </ToolbarPrimitive.Button>\n );\n});\nToolbarButton.displayName = 'Toolbar.Button';\n\ninterface ToolbarOverflowItemProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onSelect' | 'color'> {\n asChild?: boolean;\n iconOnly?: boolean;\n disabled?: boolean;\n color?: ButtonProps['color'];\n}\n\n/**\n * A ToolbarButton drawn into the overflow menu: the same element, as a menu item. An icon-only\n * button's `aria-label` becomes the item's text beside its icon, since a menu row has room for\n * words. What prices a box (size, variant, emphasis, iconOnly) does not come across.\n */\nconst ToolbarOverflowItem = React.forwardRef<HTMLDivElement, ToolbarOverflowItemProps>(\n ({ asChild, iconOnly, disabled, color, children, 'aria-label': label, ...props }, forwardedRef) => {\n const words = iconOnly ? label : undefined;\n const itemProps = {\n ...props,\n ...(iconOnly ? {} : label ? { 'aria-label': label } : {}),\n disabled,\n ...(color ? { color: color as DropdownMenu.ItemProps['color'] } : {}),\n };\n if (asChild && React.isValidElement<{ children?: React.ReactNode }>(children)) {\n const child = words\n ? React.cloneElement(children, undefined, children.props.children, <span>{words}</span>)\n : children;\n return (\n <DropdownMenu.Item {...itemProps} ref={forwardedRef} asChild>\n {child}\n </DropdownMenu.Item>\n );\n }\n return (\n <DropdownMenu.Item {...itemProps} ref={forwardedRef}>\n {children}\n {words}\n </DropdownMenu.Item>\n );\n },\n);\nToolbarOverflowItem.displayName = 'Toolbar.OverflowItem';\n\n// ============================================================================\n// ToolbarOverflow\n// ============================================================================\n\ninterface ToolbarOverflowProps extends ComponentPropsWithout<'div', RemovedProps> {\n /** The accessible name of the \"More\" button. Defaults to `More`. */\n label?: string;\n /** The controls in the cluster, in order. The ones that don't fit move into the \"More\" menu. */\n children?: React.ReactNode;\n}\n\n/** Three filled dots for the \"More\" button. Internal, so the library carries no icon set. */\nfunction MoreIcon() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentcolor\" aria-hidden xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"3.25\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"8\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"12.75\" cy=\"8\" r=\"1.25\" />\n </svg>\n );\n}\n\n/**\n * A cluster of controls that collapses into a \"More\" menu when the row runs out of room.\n *\n * It takes the room the row leaves, and when its controls don't fit, they move into the menu\n * from the end of the cluster. A `ToolbarButton` shows as a menu item there, and a\n * `ToolbarGroup` as a menu group. Use `useToolbarOverflow()` in your own components to render a\n * different form in the menu.\n *\n * It measures on mount and on resize (v2 ToolbarOverflow): each control's width is cached while\n * it is in the row, since a hidden control has no width to measure.\n */\nconst ToolbarOverflow = React.forwardRef<HTMLDivElement, ToolbarOverflowProps>(\n ({ label = 'More', className, children, ...props }, forwardedRef) => {\n const items = React.Children.toArray(children);\n const count = items.length;\n\n const rootRef = React.useRef<HTMLDivElement | null>(null);\n const widths = React.useRef<number[]>([]);\n const triggerWidth = React.useRef(0);\n const [shown, setShown] = React.useState(count);\n const [tick, setTick] = React.useState(0);\n\n // A different set of children is a different set of widths: show them all and measure again.\n const [measuredCount, setMeasuredCount] = React.useState(count);\n if (measuredCount !== count) {\n setMeasuredCount(count);\n setShown(count);\n }\n useIsomorphicLayoutEffect(() => {\n widths.current = [];\n }, [count]);\n\n useIsomorphicLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n\n // The root's children are one seat per visible child, then the trigger.\n const kids = Array.from(root.children) as HTMLElement[];\n const visible = Math.min(shown, count);\n for (let i = 0; i < visible; i++) {\n const el = kids[i];\n if (el) widths.current[i] = el.offsetWidth;\n }\n const trigger = kids[visible];\n if (trigger) triggerWidth.current = trigger.offsetWidth;\n\n const gap = Number.parseFloat(getComputedStyle(root).columnGap) || 0;\n const available = root.clientWidth;\n\n let total = 0;\n let counted = 0;\n for (let i = 0; i < count; i++) {\n const width = widths.current[i];\n // Never seen in the row, so there is nothing to decide with yet.\n if (width === undefined) return;\n // An empty seat leaves the layout, so it spends no gap.\n if (width === 0) continue;\n total += width + (counted > 0 ? gap : 0);\n counted += 1;\n }\n\n let next = count;\n if (total > available) {\n // Before the trigger exists, the row's height stands in for its width: an icon-only\n // button is square. The next pass, before paint, corrects it.\n const budget = available - (triggerWidth.current || root.clientHeight) - gap;\n let used = 0;\n let drawn = 0;\n next = 0;\n for (let i = 0; i < count; i++) {\n const own = widths.current[i]!;\n if (own > 0) {\n const width = own + (drawn > 0 ? gap : 0);\n if (used + width > budget) break;\n used += width;\n drawn += 1;\n }\n next += 1;\n }\n }\n if (next !== shown) setShown(next);\n }, [shown, count, tick]);\n\n // Watch the row and every seat in it: a control whose content changes (a page's actions\n // arriving after navigation) changes its width without the row's width changing.\n React.useEffect(() => {\n const root = rootRef.current;\n if (!root || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(() => setTick((n) => n + 1));\n observer.observe(root);\n for (const seat of Array.from(root.children)) observer.observe(seat);\n return () => observer.disconnect();\n }, [shown, count]);\n\n const attach = React.useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n\n return (\n <div {...props} ref={attach} className={classNames('kui-ToolbarOverflow', className)}>\n {items.slice(0, shown).map((item, i) => (\n // The seat is a position in the row, so its key is the index.\n <div key={i} className=\"kui-ToolbarOverflowSeat\">\n {item}\n </div>\n ))}\n {shown < count ? (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger>\n <ToolbarButton iconOnly aria-label={label}>\n <MoreIcon />\n </ToolbarButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n <InOverflowContext.Provider value>{items.slice(shown)}</InOverflowContext.Provider>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n ) : null}\n </div>\n );\n },\n);\nToolbarOverflow.displayName = 'Toolbar.Overflow';\n\n// ============================================================================\n// ToolbarSlot and ToolbarFill\n// ============================================================================\n\ntype SlotEntry = { id: string; node: React.ReactNode };\n\nconst EMPTY_ENTRIES: readonly SlotEntry[] = [];\nconst slotEntries = new Map<string, readonly SlotEntry[]>();\nconst slotListeners = new Set<() => void>();\n\nfunction subscribeSlots(listener: () => void) {\n slotListeners.add(listener);\n return () => {\n slotListeners.delete(listener);\n };\n}\n\nfunction setSlotEntry(name: string, id: string, node: React.ReactNode) {\n const list = slotEntries.get(name) ?? EMPTY_ENTRIES;\n const index = list.findIndex((entry) => entry.id === id);\n const next = index === -1 ? [...list, { id, node }] : list.map((entry) => (entry.id === id ? { id, node } : entry));\n slotEntries.set(name, next);\n slotListeners.forEach((listener) => listener());\n}\n\nfunction removeSlotEntry(name: string, id: string) {\n const list = slotEntries.get(name);\n if (!list) return;\n const next = list.filter((entry) => entry.id !== id);\n if (next.length === 0) slotEntries.delete(name);\n else slotEntries.set(name, next);\n slotListeners.forEach((listener) => listener());\n}\n\ninterface ToolbarSlotProps {\n /** Which `ToolbarFill` renders here. Use one name per slot. Defaults to `default`. */\n name?: string;\n}\n\n/**\n * A place in a toolbar that content elsewhere in the app fills, such as a page adding its own\n * actions to a header toolbar the layout owns.\n *\n * It renders whatever the `ToolbarFill` with the same `name` holds, as if it were written here:\n * the controls take the toolbar's size and join its arrow-key row. It adds no element.\n */\nfunction ToolbarSlot({ name = 'default' }: ToolbarSlotProps) {\n const entries = React.useSyncExternalStore(\n subscribeSlots,\n () => slotEntries.get(name) ?? EMPTY_ENTRIES,\n () => EMPTY_ENTRIES,\n );\n return (\n <>\n {entries.map((entry) => (\n <React.Fragment key={entry.id}>{entry.node}</React.Fragment>\n ))}\n </>\n );\n}\nToolbarSlot.displayName = 'Toolbar.Slot';\n\ninterface ToolbarFillProps {\n /** The `ToolbarSlot` to render into. Defaults to `default`. */\n name?: string;\n /** The controls to show in the slot, such as `ToolbarButton`s. */\n children?: React.ReactNode;\n}\n\n/**\n * Sends its children to the `ToolbarSlot` with the same `name`, and renders nothing where it\n * is written. Use it instead of a React portal: a portal keeps the page's React tree, so a\n * ToolbarButton in it can't join the toolbar's arrow keys.\n *\n * The children render inside the toolbar, so they read the toolbar's context, not the page's.\n * They appear after the page mounts on the client, not in server-rendered HTML.\n */\nfunction ToolbarFill({ name = 'default', children }: ToolbarFillProps) {\n const id = React.useId();\n useIsomorphicLayoutEffect(() => {\n setSlotEntry(name, id, children);\n }, [name, id, children]);\n useIsomorphicLayoutEffect(() => () => removeSlotEntry(name, id), [name, id]);\n return null;\n}\nToolbarFill.displayName = 'Toolbar.Fill';\n\n// ============================================================================\n// ToolbarSeparator\n// ============================================================================\n\ntype ToolbarSeparatorProps = ComponentPropsWithout<typeof ToolbarPrimitive.Separator, RemovedProps | 'orientation'>;\n\n/**\n * A gray hairline between two clusters, announced as a separator. Its direction is always\n * opposite to the toolbar's. In a `ToolbarOverflow`'s menu it is a menu separator.\n */\nconst ToolbarSeparator = React.forwardRef<HTMLDivElement, ToolbarSeparatorProps>(\n ({ className, ...props }, forwardedRef) => {\n const toolbar = React.useContext(ToolbarContext);\n const overflow = React.useContext(InOverflowContext);\n if (overflow) return <DropdownMenu.Separator {...props} ref={forwardedRef} className={className} />;\n if (!toolbar) {\n return (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n data-orientation=\"vertical\"\n {...props}\n ref={forwardedRef}\n className={classNames('kui-ToolbarSeparator', className)}\n />\n );\n }\n return (\n <ToolbarPrimitive.Separator\n {...props}\n ref={forwardedRef}\n className={classNames('kui-ToolbarSeparator', className)}\n />\n );\n },\n);\nToolbarSeparator.displayName = 'Toolbar.Separator';\n\n// ============================================================================\n// ToolbarTitle\n// ============================================================================\n\n/** The title's text step: one step above the label of a button at the same size. */\nconst TITLE_SIZE = { '1': '2', '2': '3', '3': '4', '4': '5' } as const satisfies Record<ToolbarSize, TextProps['size']>;\n\ninterface ToolbarTitleProps {\n /** The title text. With none, the title renders nothing. */\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n /** The id of the title, so that the toolbar's `aria-labelledby` can point at it. */\n id?: string;\n}\n\n/**\n * What the row is about, at its leading edge. One line: it truncates rather than wrapping.\n * Its text step follows the toolbar's `size`, and it takes more air from the controls beside it\n * than they take from each other.\n */\nconst ToolbarTitle = React.forwardRef<HTMLSpanElement, ToolbarTitleProps>(\n ({ className, children, style, id }, forwardedRef) => {\n const toolbar = React.useContext(ToolbarContext);\n const themeSize = useThemeSize<ToolbarSize>(undefined, toolbarRootPropDefs.size);\n const size = toolbar?.size ?? themeSize;\n if (children === undefined || children === null || children === false) return null;\n return (\n <Text\n ref={forwardedRef}\n as=\"span\"\n size={TITLE_SIZE[size]}\n weight=\"medium\"\n truncate\n id={id}\n style={style}\n className={classNames('kui-ToolbarTitle', className)}\n >\n {children}\n </Text>\n );\n },\n);\nToolbarTitle.displayName = 'Toolbar.Title';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst Toolbar = Object.assign(ToolbarRoot, {\n Root: ToolbarRoot,\n Group: ToolbarGroup,\n Button: ToolbarButton,\n Separator: ToolbarSeparator,\n Title: ToolbarTitle,\n Overflow: ToolbarOverflow,\n Slot: ToolbarSlot,\n Fill: ToolbarFill,\n});\n\nexport {\n Toolbar,\n ToolbarGroup,\n ToolbarButton,\n ToolbarSeparator,\n ToolbarTitle,\n ToolbarOverflow,\n ToolbarSlot,\n ToolbarFill,\n useToolbarOverflow,\n ToolbarRoot as Root,\n ToolbarGroup as Group,\n ToolbarButton as Button,\n ToolbarSeparator as Separator,\n ToolbarTitle as Title,\n ToolbarOverflow as Overflow,\n ToolbarSlot as Slot,\n ToolbarFill as Fill,\n};\nexport type {\n ToolbarProps,\n ToolbarGroupProps,\n ToolbarButtonProps,\n ToolbarSeparatorProps,\n ToolbarTitleProps,\n ToolbarOverflowProps,\n ToolbarSlotProps,\n ToolbarFillProps,\n ToolbarProps as RootProps,\n ToolbarGroupProps as GroupProps,\n ToolbarButtonProps as ButtonProps,\n ToolbarSeparatorProps as SeparatorProps,\n ToolbarTitleProps as TitleProps,\n ToolbarOverflowProps as OverflowProps,\n ToolbarSlotProps as SlotProps,\n ToolbarFillProps as FillProps,\n};\n", "import type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4'] as const;\nconst orientations = ['horizontal', 'vertical'] as const;\n\n/**\n * Toolbar prop definitions.\n *\n * `size` is one value for the whole row (not responsive): the row hands it to every control\n * inside it that does not state its own, through context, so it has to be a single index.\n */\nconst toolbarRootPropDefs = {\n /**\n * Size step of the row and of every control in it that doesn't set its own `size`.\n * Matches Button's sizes: 1 (28px) to 4 (48px). Unset inside `Shell.PaneHeader` or\n * `Shell.PaneFooter`, it rests one step above the Shell's `size`.\n */\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2' },\n /**\n * Direction of the row and of the arrow keys. Use `vertical` for a strip of tools along an edge.\n */\n orientation: { type: 'enum', values: orientations, default: 'horizontal' },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n orientation: PropDef<(typeof orientations)[number]>;\n};\n\nexport { toolbarRootPropDefs };\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { BaseButton } from './_internal/base-button.js';\nimport { Tooltip } from './tooltip.js';\nimport { useTooltipWrapper } from '../hooks/use-tooltip-wrapper.js';\nimport type { BaseButtonProps } from './_internal/base-button.js';\n\ntype ButtonElement = React.ElementRef<typeof BaseButton>;\n\n/**\n * Tooltip configuration props that can be passed to Button\n * These props are forwarded to the underlying Tooltip component\n */\nexport interface ButtonTooltipProps {\n /** Content to display in the tooltip on hover/focus */\n tooltip?: React.ReactNode;\n /** Side of the button where the tooltip should appear */\n tooltipSide?: 'top' | 'right' | 'bottom' | 'left';\n /** Alignment of the tooltip relative to the button */\n tooltipAlign?: 'start' | 'center' | 'end';\n /** Delay before showing the tooltip (in milliseconds) */\n tooltipDelayDuration?: number;\n /** Whether to disable hoverable content behavior */\n tooltipDisableHoverableContent?: boolean;\n}\n\n/**\n * Core Button props excluding the 'as' prop for polymorphic behavior\n * Combines BaseButton props with tooltip functionality\n */\ntype ButtonEmphasis = 'loud' | 'medium' | 'quiet';\n\n/** `emphasis` is a button's rank: loud is `solid`, medium is `raised`, quiet is `ghost`. */\nconst EMPHASIS_VARIANT = { loud: 'solid', medium: 'raised', quiet: 'ghost' } as const;\n\n/**\n * A button states its rank with `emphasis` or its look with `variant`, never both.\n */\ntype ButtonRankProps =\n | {\n /** The button's look. `outline` and `surface` have no emphasis of their own. */\n variant?: BaseButtonProps['variant'];\n emphasis?: never;\n }\n | {\n /** The button's rank: `loud` (solid, the default), `medium` (raised) or `quiet` (ghost). */\n emphasis?: ButtonEmphasis;\n variant?: never;\n };\n\n/**\n * An icon-only button is square and holds only its icon, so it has no visible text: the type\n * requires `aria-label` or `aria-labelledby`. It never takes the full width.\n */\ntype ButtonIconOnlyProps =\n | {\n /** Makes the button square and shows only the icon in `children`. Requires `aria-label` or `aria-labelledby`. */\n iconOnly: true;\n /** The button's name for screen readers. Required with `iconOnly` unless `aria-labelledby` is set. */\n 'aria-label': string;\n fullWidth?: never;\n }\n | {\n /** Makes the button square and shows only the icon in `children`. Requires `aria-label` or `aria-labelledby`. */\n iconOnly: true;\n /** The id of an element that names this button. Use it instead of `aria-label`. */\n 'aria-labelledby': string;\n fullWidth?: never;\n }\n | { iconOnly?: false };\n\ntype ButtonOwnProps = Omit<BaseButtonProps, 'as' | 'variant'> & ButtonRankProps & ButtonTooltipProps & ButtonIconOnlyProps;\n\n/**\n * Polymorphic Button props that support rendering as different HTML elements\n * @template C - The element type to render as (defaults to 'button')\n */\ntype ButtonProps<C extends React.ElementType = 'button'> = ButtonOwnProps & {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & Omit<React.ComponentPropsWithoutRef<C>, keyof ButtonOwnProps>;\n\n/**\n * Button component type that supports polymorphic rendering\n * @template C - The element type to render as\n */\ntype ButtonComponent = <C extends React.ElementType = 'button'>(props: ButtonProps<C> & { ref?: React.ForwardedRef<ButtonElement> }) => React.ReactElement | null;\n\n/**\n * An icon-only button must have an accessible name. Throws in development, logs otherwise.\n */\nfunction validateIconButtonName(props: Record<string, unknown>) {\n if (props['aria-label'] || props['aria-labelledby']) return;\n const errorMessage =\n 'Button: an `iconOnly` button must have an accessible name. Pass `aria-label`, or ' +\n '`aria-labelledby` referencing a label element.';\n if (process.env.NODE_ENV === 'development') throw new Error(errorMessage);\n console.error(errorMessage);\n}\n\n/**\n * Button component for triggering actions throughout your interface\n *\n * The Button component is the primary interactive element in the Kookie User Interface.\n * It provides six visual variants, four sizes, comprehensive color options, and built-in\n * tooltip support. The component automatically handles icon sizing, supports responsive\n * layouts, and provides accessibility compliance out of the box.\n *\n * @example\n * ```tsx\n * // Basic button\n * <Button>Click me</Button>\n *\n * // Button with variant and size\n * <Button variant=\"solid\" size=\"3\">Primary Action</Button>\n *\n * // Button with tooltip\n * <Button tooltip=\"Save your progress\">Save</Button>\n *\n * // Polymorphic button as link\n * <Button as=\"a\" href=\"/dashboard\">Go to Dashboard</Button>\n *\n * // Square, icon-only button: needs an accessible name\n * <Button iconOnly aria-label=\"Settings\"><Settings /></Button>\n * ```\n */\nconst Button = React.forwardRef(\n (\n {\n className,\n style,\n tooltip,\n tooltipSide = 'top',\n tooltipAlign = 'center',\n tooltipDelayDuration,\n tooltipDisableHoverableContent,\n iconOnly = false,\n emphasis,\n variant,\n ...props\n }: ButtonProps,\n forwardedRef: React.ForwardedRef<ButtonElement>,\n ) => {\n // Use shared tooltip wrapper hook for accessibility props\n const { tooltipId, hasTooltip, accessibilityProps: tooltipAccessibilityProps } = useTooltipWrapper(tooltip);\n\n // An icon-only button is square, so it never takes the full width.\n if (iconOnly) {\n validateIconButtonName(props as Record<string, unknown>);\n (props as { fullWidth?: boolean }).fullWidth = false;\n }\n\n if (emphasis !== undefined && variant !== undefined) {\n throw new Error('Button: pass `emphasis` or `variant`, not both. They set the same thing.');\n }\n const resolvedVariant = emphasis !== undefined ? EMPHASIS_VARIANT[emphasis] : variant;\n\n const button = (\n <BaseButton\n {...props}\n variant={resolvedVariant}\n {...tooltipAccessibilityProps}\n ref={forwardedRef}\n data-icon-only={iconOnly || undefined}\n className={classNames('kui-Button', className)}\n style={style}\n />\n );\n\n // If no tooltip is provided, return the button as-is for better performance\n if (!hasTooltip) {\n return button;\n }\n\n // Wrap with Tooltip when tooltip content is provided\n // This creates a compound component that handles both button and tooltip functionality\n return (\n <Tooltip content={tooltip} side={tooltipSide} align={tooltipAlign} delayDuration={tooltipDelayDuration} disableHoverableContent={tooltipDisableHoverableContent} id={tooltipId}>\n {button}\n </Tooltip>\n );\n },\n) as ButtonComponent & { displayName?: string };\n\nButton.displayName = 'Button';\n\nexport { Button };\nexport type { ButtonProps, ButtonEmphasis, ButtonRankProps, ButtonIconOnlyProps };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\nimport { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';\n\nimport { baseButtonPropDefs } from './base-button.props.js';\nimport { Flex } from '../flex.js';\nimport { Spinner } from '../spinner.js';\nimport { TickIcon } from '../icons.js';\nimport { extractProps } from '../../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../../helpers/theme-size.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../../props/prop-def.js';\n\ntype BaseButtonElement = React.ElementRef<'button'>;\ntype BaseButtonOwnProps = GetPropDefTypes<typeof baseButtonPropDefs>;\n\n/**\n * Polymorphic BaseButton props that support rendering as different HTML elements\n * Uses the proper ComponentPropsWithout pattern for type safety\n * @template C - The element type to render as (defaults to 'button')\n */\ntype PolymorphicBaseButtonProps<C extends React.ElementType = 'button'> = {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & BaseButtonOwnProps &\n BaseButtonDoneProps &\n ComponentPropsWithout<C, RemovedProps | keyof BaseButtonOwnProps | 'as' | 'done'>;\n\ninterface BaseButtonDoneProps {\n /**\n * Shows a tick in place of the icon to say that the action finished. The tick takes the\n * icon's box, so nothing moves, and the icon comes back as soon as `done` is false again. On\n * an `iconOnly` button the tick replaces the content. It doesn't block the press. Screen\n * readers don't announce the tick, so also change the label or `aria-label` (for example,\n * `Copy` to `Copied`).\n */\n done?: boolean;\n}\n\n/**\n * BaseButton props interface that combines all available props\n */\ninterface BaseButtonProps extends PolymorphicBaseButtonProps {}\n\n/**\n * BaseButton component that provides the core button functionality\n *\n * This is the foundational button component that handles all the complex logic\n * including loading states, accessibility, performance optimizations, and\n * polymorphic rendering. It's used by Button and Toggle to ensure consistent behavior across the design system.\n *\n * Key features:\n * - Loading state with spinner and accessibility announcements\n * - Comprehensive accessibility support\n * - Polymorphic rendering support\n *\n * @example\n * ```tsx\n * // Basic usage\n * <BaseButton>Click me</BaseButton>\n *\n * // With loading state\n * <BaseButton loading>Processing...</BaseButton>\n *\n * // Polymorphic rendering\n * <BaseButton as=\"a\" href=\"/link\">Link Button</BaseButton>\n * ```\n */\nconst BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, baseButtonPropDefs.size);\n\n // Extract button-specific props from the combined props object\n const {\n className,\n children,\n asChild,\n as,\n color,\n radius,\n disabled: nativeDisabled,\n done = false,\n ...baseButtonProps\n } = extractProps(props, baseButtonPropDefs);\n\n // Loading blocks activation but keeps the native `disabled` off, so the button keeps focus\n // and its place in the tab order (aria-disabled carries the state). An explicit `disabled`\n // stays native on form controls; on anything else (a link, an asChild child) the `disabled`\n // attribute does nothing, so aria-disabled carries the state and the click is stopped here.\n const loading = Boolean(props.loading);\n const disabled = Boolean(nativeDisabled) || loading;\n const { onClick, 'aria-describedby': ariaDescribedByProp } = baseButtonProps as {\n onClick?: React.MouseEventHandler<HTMLElement>;\n 'aria-describedby'?: string;\n };\n const handleClick = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n },\n [disabled, onClick],\n );\n\n // Which edges start or end with an icon. A bare edge pads wider under a full radius; an edge\n // holding an icon keeps the plain padding (the icon already stands between text and curve).\n // Only an svg is an icon. Rendering reads the children for an svg element at either end, so\n // the server output is right for inline svgs; after mount the rendered DOM settles it, which\n // also catches icon components (they render an svg) and rules out wrapped text (`<Text>`,\n // `<Kbd>`, `<Trans>`), whose first node is not an svg.\n const childEdges = React.useMemo(() => {\n const content =\n asChild && React.isValidElement(children) ? (children.props as { children?: React.ReactNode }).children : children;\n // Fragments are see-through: their own first and last children are the edges.\n const items = flattenFragments(content);\n const isIcon = (node: React.ReactNode) => React.isValidElement(node) && node.type === 'svg';\n return { iconStart: isIcon(items[0]), iconEnd: isIcon(items[items.length - 1]) };\n }, [asChild, children]);\n const [domEdges, setDomEdges] = React.useState<{ iconStart: boolean; iconEnd: boolean } | null>(null);\n const elementRef = React.useRef<HTMLElement>(null);\n const composedRef = useComposedRefs(forwardedRef, elementRef as React.Ref<BaseButtonElement>);\n useLayoutEffect(() => {\n const element = elementRef.current;\n // While loading the label sits in a wrapper, and while done the tick stands at the start;\n // keep the edges read before either.\n if (!element || loading || done) return;\n const iconStart = edgeIsSvg(element, 'start');\n const iconEnd = edgeIsSvg(element, 'end');\n setDomEdges((prev) => (prev && prev.iconStart === iconStart && prev.iconEnd === iconEnd ? prev : { iconStart, iconEnd }));\n });\n const { iconStart, iconEnd } = domEdges ?? childEdges;\n\n // Done swaps the icon for a tick in the same place: the leading icon when there is one, the\n // whole content on an icon-only button. Without a leading icon the tick goes before the label.\n const iconOnly = Boolean((baseButtonProps as Record<string, unknown>)['data-icon-only']);\n const content = React.useMemo(() => {\n if (!done) return children;\n const tick = <TickIcon key=\"kui-done-tick\" className=\"kui-BaseButtonTick\" aria-hidden />;\n const swap = (nodes: React.ReactNode): React.ReactNode => {\n if (iconOnly) return tick;\n const items = flattenFragments(nodes);\n const first = items.findIndex((node) => !(typeof node === 'string' && !node.trim()));\n if (iconStart && first !== -1) return items.map((node, index) => (index === first ? tick : node));\n return [tick, ...items];\n };\n if (asChild && React.isValidElement(children)) {\n const element = children as React.ReactElement<{ children?: React.ReactNode }>;\n return React.cloneElement(element, undefined, swap(element.props.children));\n }\n return swap(children);\n }, [done, children, iconOnly, iconStart, asChild]);\n\n // asChild takes precedence over as prop for Radix Slot integration\n // When asChild is true, we use Slot.Root to merge props onto the child element\n // When asChild is false, we render as the specified element (or button by default)\n const Comp = asChild ? Slot.Root : (as || 'button');\n\n // Only pass disabled for elements that support it\n // This prevents invalid HTML attributes on unsupported elements\n const shouldPassDisabled = asChild || !as || ['button', 'input', 'textarea', 'select'].includes(as);\n\n // Determine if we are rendering a real <button> element so we can set a safe\n // default type. Native <button> defaults to type=\"submit\" which can cause\n // accidental form submissions. We default to type=\"button\" unless the user\n // explicitly provided a type or we're using asChild (unknown underlying node).\n const isNativeButtonElement = !asChild && (!as || as === 'button');\n const hasExplicitTypeAttribute = 'type' in (baseButtonProps as Record<string, unknown>);\n\n // Generate unique ID for loading announcements\n const loadingId = React.useId();\n const describedById = loading ? `${loadingId}-loading` : undefined;\n\n // Loading keeps the caller's name (aria-label, aria-labelledby or the label text) and adds\n // aria-busy plus a description, as v2 does. A disabled element with no native `disabled`\n // announces itself through aria-disabled.\n const accessibilityProps = React.useMemo(() => {\n if (loading) {\n return {\n 'aria-busy': true,\n 'aria-disabled': true,\n 'aria-describedby': [ariaDescribedByProp, describedById].filter(Boolean).join(' '),\n };\n }\n if (nativeDisabled && (!shouldPassDisabled || asChild)) {\n return { 'aria-disabled': true };\n }\n return {};\n }, [loading, describedById, ariaDescribedByProp, nativeDisabled, shouldPassDisabled, asChild]);\n\n return (\n <Comp\n data-accent-color={color}\n data-radius={radius}\n data-icon-start={iconStart || undefined}\n data-icon-end={iconEnd || undefined}\n data-done={done || undefined}\n {...baseButtonProps}\n {...accessibilityProps}\n // After the spread: `data-disabled` styles `<Button asChild disabled>`, and a wrapping\n // Radix Toggle (asChild) passes `data-disabled={undefined}` that must not erase it.\n data-disabled={disabled || undefined}\n onClick={handleClick}\n ref={composedRef}\n className={classNames('kui-reset', 'kui-BaseButton', className)}\n {...(shouldPassDisabled && { disabled: nativeDisabled })}\n {...(isNativeButtonElement && !hasExplicitTypeAttribute ? { type: 'button' } : {})}\n >\n {props.loading ? (\n <>\n {/**\n * We need a wrapper to set `visibility: hidden` to hide the button content whilst we show the `Spinner`.\n * The button is a flex container with a `gap`, so we use `display: contents` to ensure the correct flex layout.\n *\n * However, `display: contents` removes the content from the accessibility tree in some browsers,\n * so we force remove it with `aria-hidden` and re-add it in the tree with a `kui-sr-only` copy.\n * Both are classes, not style attributes, so a loading button carries no inline style.\n */}\n <span className=\"kui-BaseButtonContent\" aria-hidden>\n {content}\n </span>\n\n {/* The label stays the name; the hidden \"Loading\" only describes (aria-describedby reads hidden text). */}\n <span className=\"kui-sr-only\">\n <span id={describedById} aria-hidden>\n Loading\n </span>\n {children}\n </span>\n\n {/* Centered spinner overlay during loading state */}\n <Flex asChild align=\"center\" justify=\"center\" position=\"absolute\" inset=\"0\">\n <span>\n <Spinner aria-hidden=\"true\" />\n </span>\n </Flex>\n </>\n ) : (\n content\n )}\n </Comp>\n );\n});\nBaseButton.displayName = 'BaseButton';\n\n/** The child list with fragments opened up: a fragment's own children are the edges. */\nfunction flattenFragments(nodes: React.ReactNode): React.ReactNode[] {\n return React.Children.toArray(nodes).flatMap((node) =>\n React.isValidElement(node) && node.type === React.Fragment\n ? flattenFragments((node.props as { children?: React.ReactNode }).children)\n : [node],\n );\n}\n\n/** Whether the first or last rendered node of `element` (blank text and comments skipped) is an svg. */\nfunction edgeIsSvg(element: Element, edge: 'start' | 'end'): boolean {\n let node = edge === 'start' ? element.firstChild : element.lastChild;\n while (node) {\n const blank =\n node.nodeType === Node.COMMENT_NODE || (node.nodeType === Node.TEXT_NODE && !node.textContent?.trim());\n if (!blank) break;\n node = edge === 'start' ? node.nextSibling : node.previousSibling;\n }\n return node?.nodeType === Node.ELEMENT_NODE && (node as Element).localName === 'svg';\n}\n\nexport { BaseButton };\nexport type { BaseButtonProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import type { PropDef } from './prop-def.js';\n\nconst radii = ['none', 'small', 'medium', 'large', 'full'] as const;\n\nconst radiusPropDef = {\n radius: {\n type: 'enum',\n values: radii,\n default: undefined,\n },\n} satisfies {\n radius: PropDef<(typeof radii)[number]>;\n};\n\nexport { radiusPropDef, radii };\n", "import { asChildPropDef } from '../../props/as-child.prop.js';\nimport { accentColorPropDef } from '../../props/color.prop.js';\nimport { radiusPropDef } from '../../props/radius.prop.js';\n\nimport type { PropDef } from '../../props/prop-def.js';\n\n/**\n * Available button sizes for responsive design\n * Size 1: 24px - Compact for toolbars and dense interfaces\n * Size 2: 32px - Standard for most interface contexts\n * Size 3: 40px - Large for important actions and mobile touch targets\n * Size 4: 48px - Extra large for hero sections and maximum impact\n */\nconst sizes = ['1', '2', '3', '4'] as const;\n\n/**\n * Available button variants for different visual contexts\n * - raised: lifted off its ground, with an edge and a shadow\n * - solid: Primary actions that should be noticed first (the default)\n * - soft: Content-heavy interfaces, natural integration\n * - surface: Elevated appearance with subtle depth\n * - outline: Secondary actions that support primary actions\n * - ghost: Utility functions that don't compete for attention\n */\nconst variants = ['raised', 'solid', 'soft', 'surface', 'outline', 'ghost'] as const;\n\n/**\n * Base button prop definitions that define the component's API\n * \n * These props are used by all button variants (Button and Toggle)\n * to ensure consistent behavior and styling across the design system.\n * \n * Key features:\n * - Responsive sizing with mobile-first approach\n * - Six visual variants for different interface contexts\n * - Comprehensive color system with semantic meanings\n * - Loading states with automatic accessibility\n * - Polymorphic rendering support via asChild\n * \n * @example\n * ```tsx\n * // Basic button with default props\n * <BaseButton>Click me</BaseButton>\n * \n * // Button with custom size and variant\n * <BaseButton size=\"3\" variant=\"solid\">Primary Action</BaseButton>\n * \n * // Button with loading state\n * <BaseButton loading>Processing...</BaseButton>\n * ```\n */\nconst baseButtonPropDefs = {\n ...asChildPropDef,\n /**\n * Button size for responsive design and interface density\n * Supports responsive objects: { initial: '1', sm: '2', md: '3', lg: '4' }\n */\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n /**\n * Visual variant that determines the button's appearance and context\n */\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'solid' },\n ...accentColorPropDef,\n ...radiusPropDef,\n /**\n * Loading state that shows a spinner and disables interaction\n * Automatically sets disabled=true and provides accessibility announcements\n */\n loading: { type: 'boolean', className: 'kui-loading', default: false },\n /**\n * Full width mode that expands the button to fill its container\n * Useful for mobile layouts and form submissions\n */\n fullWidth: { type: 'boolean', className: 'kui-full-width', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n loading: PropDef<boolean>;\n fullWidth: PropDef<boolean>;\n};\n\nexport { baseButtonPropDefs };\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { layoutPropDefs } from '../props/layout.props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { Slot } from './slot.js';\nimport { flexPropDefs } from './flex.props.js';\n\nimport type { FlexOwnProps } from './flex.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { LayoutProps } from '../props/layout.props.js';\nimport type { MarginProps } from '../props/margin.props.js';\n\ntype FlexElement = React.ElementRef<'div'>;\ninterface CommonFlexProps extends MarginProps, LayoutProps, FlexOwnProps {}\ntype FlexDivProps = { as?: 'div' } & ComponentPropsWithout<'div', RemovedProps>;\ntype FlexSpanProps = { as: 'span' } & ComponentPropsWithout<'span', RemovedProps>;\ntype FlexProps = CommonFlexProps & (FlexSpanProps | FlexDivProps);\n\nconst Flex = React.forwardRef<FlexElement, FlexProps>((props, forwardedRef) => {\n const {\n className,\n asChild,\n as: Tag = 'div',\n ...flexProps\n } = extractProps(props, flexPropDefs, layoutPropDefs, marginPropDefs);\n const Comp = asChild ? Slot : Tag;\n return <Comp {...flexProps} ref={forwardedRef} className={classNames('kui-Flex', className)} />;\n});\nFlex.displayName = 'Flex';\n\nexport { Flex };\nexport type { FlexProps };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst paddingValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] as const;\n\nconst paddingPropDefs = {\n /**\n * Sets the CSS **padding** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * p=\"4\"\n * p=\"100px\"\n * p={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding\n */\n p: {\n type: 'enum | string',\n className: 'kui-r-p',\n customProperties: ['--p'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-left** and **padding-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * px=\"4\"\n * px=\"100px\"\n * px={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right\n */\n px: {\n type: 'enum | string',\n className: 'kui-r-px',\n customProperties: ['--pl', '--pr'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-top** and **padding-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * py=\"4\"\n * py=\"100px\"\n * py={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom\n */\n py: {\n type: 'enum | string',\n className: 'kui-r-py',\n customProperties: ['--pt', '--pb'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pt=\"4\"\n * pt=\"100px\"\n * pt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top\n */\n pt: {\n type: 'enum | string',\n className: 'kui-r-pt',\n customProperties: ['--pt'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pr=\"4\"\n * pr=\"100px\"\n * pr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right\n */\n pr: {\n type: 'enum | string',\n className: 'kui-r-pr',\n customProperties: ['--pr'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pb=\"4\"\n * pb=\"100px\"\n * pb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom\n */\n pb: {\n type: 'enum | string',\n className: 'kui-r-pb',\n customProperties: ['--pb'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pl=\"4\"\n * pl=\"100px\"\n * pl={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left\n */\n pl: {\n type: 'enum | string',\n className: 'kui-r-pl',\n customProperties: ['--pl'],\n values: paddingValues,\n responsive: true,\n },\n} satisfies {\n p: PropDef<(typeof paddingValues)[number]>;\n px: PropDef<(typeof paddingValues)[number]>;\n py: PropDef<(typeof paddingValues)[number]>;\n pt: PropDef<(typeof paddingValues)[number]>;\n pr: PropDef<(typeof paddingValues)[number]>;\n pb: PropDef<(typeof paddingValues)[number]>;\n pl: PropDef<(typeof paddingValues)[number]>;\n};\n\ntype PaddingProps = GetPropDefTypes<typeof paddingPropDefs>;\n\nexport { paddingPropDefs };\nexport type { PaddingProps };\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst heightPropDefs = {\n /**\n * Sets the CSS **height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * height=\"100px\"\n * height={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/height\n */\n height: {\n type: 'string',\n className: 'kui-r-h',\n customProperties: ['--height'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minHeight=\"100px\"\n * minHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-height\n */\n minHeight: {\n type: 'string',\n className: 'kui-r-min-h',\n customProperties: ['--min-height'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxHeight=\"100px\"\n * maxHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-height\n */\n maxHeight: {\n type: 'string',\n className: 'kui-r-max-h',\n customProperties: ['--max-height'],\n responsive: true,\n },\n} satisfies {\n height: PropDef<string>;\n minHeight: PropDef<string>;\n maxHeight: PropDef<string>;\n};\n\ntype HeightProps = GetPropDefTypes<typeof heightPropDefs>;\n\nexport { heightPropDefs };\nexport type { HeightProps };\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst widthPropDefs = {\n /**\n * Sets the CSS **width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * width=\"100px\"\n * width={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/width\n */\n width: {\n type: 'string',\n className: 'kui-r-w',\n customProperties: ['--width'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minWidth=\"100px\"\n * minWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-width\n */\n minWidth: {\n type: 'string',\n className: 'kui-r-min-w',\n customProperties: ['--min-width'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxWidth=\"100px\"\n * maxWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n */\n maxWidth: {\n type: 'string',\n className: 'kui-r-max-w',\n customProperties: ['--max-width'],\n responsive: true,\n },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n};\n\ntype WidthProps = GetPropDefTypes<typeof widthPropDefs>;\n\nexport { widthPropDefs };\nexport type { WidthProps };\n", "import { paddingPropDefs } from './padding.props.js';\nimport { heightPropDefs } from './height.props.js';\nimport { widthPropDefs } from './width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst overflowValues = ['visible', 'hidden', 'clip', 'scroll', 'auto'] as const;\nconst positionValues = ['static', 'relative', 'absolute', 'fixed', 'sticky'] as const;\n// prettier-ignore\nconst positionEdgeValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9'] as const;\nconst flexShrinkValues = ['0', '1'] as const;\nconst flexGrowValues = ['0', '1'] as const;\nconst alignSelfValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\nconst justifySelfValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\n\nconst layoutPropDefs = {\n ...paddingPropDefs,\n ...widthPropDefs,\n ...heightPropDefs,\n /**\n * Sets the CSS **position** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * position=\"absolute\"\n * position={{ sm: 'absolute', lg: 'sticky' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/position\n */\n position: {\n type: 'enum',\n className: 'kui-r-position',\n values: positionValues,\n responsive: true,\n },\n /**\n * Sets the CSS **inset** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * inset=\"4\"\n * inset=\"100px\"\n * inset={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/inset\n */\n inset: {\n type: 'enum | string',\n className: 'kui-r-inset',\n customProperties: ['--inset'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * top=\"4\"\n * top=\"100px\"\n * top={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/top\n */\n top: {\n type: 'enum | string',\n className: 'kui-r-top',\n customProperties: ['--top'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * right=\"4\"\n * right=\"100px\"\n * right={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/right\n */\n right: {\n type: 'enum | string',\n className: 'kui-r-right',\n customProperties: ['--right'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * bottom=\"4\"\n * bottom=\"100px\"\n * bottom={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/bottom\n */\n bottom: {\n type: 'enum | string',\n className: 'kui-r-bottom',\n customProperties: ['--bottom'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * left=\"4\"\n * left=\"100px\"\n * left={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/left\n */\n left: {\n type: 'enum | string',\n className: 'kui-r-left',\n customProperties: ['--left'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflow=\"hidden\"\n * overflow={{ sm: 'hidden', lg: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflow: {\n type: 'enum',\n className: 'kui-r-overflow',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow-x** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflowX=\"hidden\"\n * overflowX={{ sm: 'hidden', md: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflowX: {\n type: 'enum',\n className: 'kui-r-ox',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow-y** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflowY=\"hidden\"\n * overflowY={{ sm: 'hidden', md: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflowY: {\n type: 'enum',\n className: 'kui-r-oy',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-basis** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexBasis=\"0\"\n * flexBasis=\"100%\"\n * flexBasis={{ sm: '200px', lg: 'auto' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis\n */\n flexBasis: {\n type: 'string',\n className: 'kui-r-fb',\n customProperties: ['--flex-basis'],\n responsive: true,\n },\n /**\n * Sets the CSS **flex-shrink** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexShrink=\"0\"\n * flexShrink=\"1\"\n * flexShrink={{ sm: '0', lg: '1' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink\n */\n flexShrink: {\n type: 'enum | string',\n className: 'kui-r-fs',\n customProperties: ['--flex-shrink'],\n values: flexShrinkValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-grow** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexGrow=\"0\"\n * flexGrow=\"1\"\n * flexGrow={{ sm: '0', lg: '1' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow\n */\n flexGrow: {\n type: 'enum | string',\n className: 'kui-r-fg',\n customProperties: ['--flex-grow'],\n values: flexGrowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **grid-area** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridArea=\"header\"\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area\n */\n gridArea: {\n type: 'string',\n className: 'kui-r-ga',\n customProperties: ['--grid-area'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumn=\"1\"\n * gridColumn=\"1 / -1\"\n * gridColumn={{ sm: '1 / 3', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column\n */\n gridColumn: {\n type: 'string',\n className: 'kui-r-gc',\n customProperties: ['--grid-column'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column-start** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumnStart=\"1\"\n * gridColumnStart=\"auto\"\n * gridColumnStart={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start\n */\n gridColumnStart: {\n type: 'string',\n className: 'kui-r-gcs',\n customProperties: ['--grid-column-start'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column-end** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumnEnd=\"1\"\n * gridColumnEnd=\"auto\"\n * gridColumnEnd={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end\n */\n gridColumnEnd: {\n type: 'string',\n className: 'kui-r-gce',\n customProperties: ['--grid-column-end'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRow=\"1\"\n * gridRow=\"auto\"\n * gridRow={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row\n */\n gridRow: {\n type: 'string',\n className: 'kui-r-gr',\n customProperties: ['--grid-row'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row-start** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRowStart=\"1\"\n * gridRowStart=\"auto\"\n * gridRowStart={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start\n */\n gridRowStart: {\n type: 'string',\n className: 'kui-r-grs',\n customProperties: ['--grid-row-start'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row-end** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRowEnd=\"1\"\n * gridRowEnd=\"auto\"\n * gridRowEnd={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end\n */\n gridRowEnd: {\n type: 'string',\n className: 'kui-r-gre',\n customProperties: ['--grid-row-end'],\n responsive: true,\n },\n /**\n * Sets the CSS **align-self** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * alignSelf=\"center\"\n * alignSelf={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/align-self\n */\n alignSelf: {\n type: 'enum',\n className: 'kui-r-as',\n values: alignSelfValues,\n responsive: true,\n },\n /**\n * Sets the CSS **justify-self** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * justifySelf=\"center\"\n * justifySelf={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self\n */\n justifySelf: {\n type: 'enum',\n className: 'kui-r-js',\n values: justifySelfValues,\n responsive: true,\n },\n} satisfies {\n position: PropDef<(typeof positionValues)[number]>;\n inset: PropDef<(typeof positionEdgeValues)[number]>;\n top: PropDef<(typeof positionEdgeValues)[number]>;\n right: PropDef<(typeof positionEdgeValues)[number]>;\n bottom: PropDef<(typeof positionEdgeValues)[number]>;\n left: PropDef<(typeof positionEdgeValues)[number]>;\n overflow: PropDef<(typeof overflowValues)[number]>;\n overflowX: PropDef<(typeof overflowValues)[number]>;\n overflowY: PropDef<(typeof overflowValues)[number]>;\n flexBasis: PropDef<string>;\n flexShrink: PropDef<(typeof flexShrinkValues)[number]>;\n flexGrow: PropDef<(typeof flexGrowValues)[number]>;\n gridColumn: PropDef<string>;\n gridColumnStart: PropDef<string>;\n gridColumnEnd: PropDef<string>;\n gridRow: PropDef<string>;\n gridRowStart: PropDef<string>;\n gridRowEnd: PropDef<string>;\n gridArea: PropDef<string>;\n alignSelf: PropDef<(typeof alignSelfValues)[number]>;\n justifySelf: PropDef<(typeof justifySelfValues)[number]>;\n};\n\n// Use all of the imported prop defs to ensure that JSDoc works\ntype LayoutProps = GetPropDefTypes<\n typeof paddingPropDefs & typeof widthPropDefs & typeof heightPropDefs & typeof layoutPropDefs\n>;\n\nexport { layoutPropDefs };\nexport type { LayoutProps };\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\n// prettier-ignore\nconst marginValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10', '-11', '-12', 'bleed'] as const;\n\nconst marginPropDefs = {\n /**\n * Sets the CSS **margin** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * m=\"4\"\n * m=\"100px\"\n * m={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n */\n m: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-m',\n customProperties: ['--m'],\n },\n /**\n * Sets the CSS **margin-left** and **margin-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mx=\"4\"\n * mx=\"100px\"\n * mx={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mx: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mx',\n customProperties: ['--ml', '--mr'],\n },\n /**\n * Sets the CSS **margin-top** and **margin-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * my=\"4\"\n * my=\"100px\"\n * my={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n my: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-my',\n customProperties: ['--mt', '--mb'],\n },\n /**\n * Sets the CSS **margin-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mt=\"4\"\n * mt=\"100px\"\n * mt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n */\n mt: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mt',\n customProperties: ['--mt'],\n },\n /**\n * Sets the CSS **margin-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mr=\"4\"\n * mr=\"100px\"\n * mr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mr: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mr',\n customProperties: ['--mr'],\n },\n /**\n * Sets the CSS **margin-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mb=\"4\"\n * mb=\"100px\"\n * mb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n mb: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mb',\n customProperties: ['--mb'],\n },\n /**\n * Sets the CSS **margin-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * ml=\"4\"\n * ml=\"100px\"\n * ml={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n */\n ml: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-ml',\n customProperties: ['--ml'],\n },\n} satisfies {\n m: PropDef<(typeof marginValues)[number]>;\n mx: PropDef<(typeof marginValues)[number]>;\n my: PropDef<(typeof marginValues)[number]>;\n mt: PropDef<(typeof marginValues)[number]>;\n mr: PropDef<(typeof marginValues)[number]>;\n mb: PropDef<(typeof marginValues)[number]>;\n ml: PropDef<(typeof marginValues)[number]>;\n};\n\ntype MarginProps = GetPropDefTypes<typeof marginPropDefs>;\n\nexport { marginPropDefs };\nexport type { MarginProps };\n", "import { Slot as SlotPrimitive } from 'radix-ui';\nexport const Root = SlotPrimitive.Root;\nexport const Slot = SlotPrimitive.Root;\nexport const Slottable: typeof SlotPrimitive.Slottable = SlotPrimitive.Slottable;\n", "import type { PropDef } from './prop-def.js';\n\nconst gapValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] as const;\n\nconst gapPropDefs = {\n /**\n * Sets the CSS **gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gap=\"4\"\n * gap=\"20px\"\n * gap={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/gap\n */\n gap: {\n type: 'enum | string',\n className: 'kui-r-gap',\n customProperties: ['--gap'],\n values: gapValues,\n responsive: true,\n },\n /**\n * Sets the CSS **row-gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gapX=\"4\"\n * gapX=\"20px\"\n * gapX={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap\n */\n gapX: {\n type: 'enum | string',\n className: 'kui-r-cg',\n customProperties: ['--column-gap'],\n values: gapValues,\n responsive: true,\n },\n /**\n * Sets the CSS **column-gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gapY=\"4\"\n * gapY=\"20px\"\n * gapY={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap\n */\n gapY: {\n type: 'enum | string',\n className: 'kui-r-rg',\n customProperties: ['--row-gap'],\n values: gapValues,\n responsive: true,\n },\n} satisfies {\n gap: PropDef<(typeof gapValues)[number]>;\n gapX: PropDef<(typeof gapValues)[number]>;\n gapY: PropDef<(typeof gapValues)[number]>;\n};\n\nexport { gapPropDefs };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { gapPropDefs } from '../props/gap.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst as = ['div', 'span'] as const;\nconst displayValues = ['none', 'inline-flex', 'flex'] as const;\nconst directionValues = ['row', 'column', 'row-reverse', 'column-reverse'] as const;\nconst alignValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\nconst justifyValues = ['start', 'center', 'end', 'between'] as const;\nconst wrapValues = ['nowrap', 'wrap', 'wrap-reverse'] as const;\n\nconst flexPropDefs = {\n /**\n * Controls whether to render **div** or **span**\n *\n * @example\n * as=\"div\"\n * as=\"span\"\n */\n as: { type: 'enum', values: as, default: 'div' },\n ...asChildPropDef,\n /**\n * Sets the CSS **display** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * display=\"inline-flex\"\n * display={{ sm: 'none', lg: 'flex' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/display\n */\n display: {\n type: 'enum',\n className: 'kui-r-display',\n values: displayValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-direction** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * direction=\"column\"\n * direction={{ sm: 'column', lg: 'row' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction\n */\n direction: {\n type: 'enum',\n className: 'kui-r-fd',\n values: directionValues,\n responsive: true,\n },\n /**\n * Sets the CSS **align-items** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * align=\"center\"\n * align={{ sm: 'baseline', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/align-items\n */\n align: {\n type: 'enum',\n className: 'kui-r-ai',\n values: alignValues,\n responsive: true,\n },\n /**\n * Sets the CSS **justify-content** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * justify=\"between\"\n * justify={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content\n */\n justify: {\n type: 'enum',\n className: 'kui-r-jc',\n values: justifyValues,\n parseValue: parseJustifyValue,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-wrap** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * wrap=\"wrap\"\n * wrap={{ sm: 'wrap', lg: 'nowrap' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap\n */\n wrap: {\n type: 'enum',\n className: 'kui-r-fw',\n values: wrapValues,\n responsive: true,\n },\n ...gapPropDefs,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n display: PropDef<(typeof displayValues)[number]>;\n direction: PropDef<(typeof directionValues)[number]>;\n align: PropDef<(typeof alignValues)[number]>;\n justify: PropDef<(typeof justifyValues)[number]>;\n wrap: PropDef<(typeof wrapValues)[number]>;\n};\n\nfunction parseJustifyValue(value: string) {\n return value === 'between' ? 'space-between' : value;\n}\n\n// Use all of the imported prop defs to ensure that JSDoc works\ntype FlexOwnProps = GetPropDefTypes<\n typeof flexPropDefs & typeof gapPropDefs & typeof asChildPropDef\n>;\n\nexport { flexPropDefs };\nexport type { FlexOwnProps };\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Flex } from './flex.js';\nimport { spinnerPropDefs } from './spinner.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype SpinnerElement = React.ElementRef<'span'>;\ntype SpinnerOwnProps = GetPropDefTypes<typeof spinnerPropDefs>;\ninterface SpinnerProps\n extends ComponentPropsWithout<'span', RemovedProps>,\n SpinnerOwnProps {}\nconst Spinner = React.forwardRef<SpinnerElement, SpinnerProps>((props, forwardedRef) => {\n const { className, children, loading, ...spinnerProps } = extractProps(\n props,\n spinnerPropDefs\n );\n\n if (!loading) return children;\n\n // Decorative unless named: a named spinner is a status message, an unnamed one is hidden.\n const named =\n spinnerProps['aria-label'] !== undefined || spinnerProps['aria-labelledby'] !== undefined;\n\n const spinner = (\n <span\n role={named ? 'status' : undefined}\n aria-hidden={named ? undefined : true}\n {...spinnerProps}\n ref={forwardedRef} className={classNames('kui-Spinner', className)}>\n <span className=\"kui-SpinnerWheel\">\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n </span>\n </span>\n );\n\n if (children === undefined) return spinner;\n\n return (\n <Flex asChild position=\"relative\" align=\"center\" justify=\"center\">\n <span aria-busy=\"true\">\n {/**\n * `display: contents` removes the content from the accessibility tree in some browsers,\n * so we force remove it with `aria-hidden`\n */}\n <span aria-hidden className=\"kui-SpinnerHiddenChildren\" inert={undefined}>\n {children}\n </span>\n\n <Flex asChild align=\"center\" justify=\"center\" position=\"absolute\" inset=\"0\">\n <span>{spinner}</span>\n </Flex>\n </span>\n </Flex>\n );\n});\nSpinner.displayName = 'Spinner';\n\nexport { Spinner };\nexport type { SpinnerProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\nconst spinnerPropDefs = {\n loading: { type: 'boolean', default: true },\n} satisfies {\n loading: PropDef<boolean>;\n};\n\nexport { spinnerPropDefs };\n", "import React from 'react';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype IconElement = React.ElementRef<'svg'>;\ninterface IconProps extends ComponentPropsWithout<'svg', RemovedProps | 'children'> {}\n\nconst ThickDividerHorizontalIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z\"\n />\n </svg>\n );\n});\n\nThickDividerHorizontalIcon.displayName = 'ThickDividerHorizontalIcon';\n\nconst ThickCheckIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z\"\n />\n </svg>\n );\n});\nThickCheckIcon.displayName = 'ThickCheckIcon';\n\nconst ChevronDownIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path d=\"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z\" />\n </svg>\n );\n});\nChevronDownIcon.displayName = 'ChevronDownIcon';\n\nconst ThickChevronRightIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronRightIcon.displayName = 'ThickChevronRightIcon';\n\nconst ThickChevronLeftIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronLeftIcon.displayName = 'ThickChevronLeftIcon';\n\nconst ThickDotIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <circle cx=\"4.5\" cy=\"4.5\" r=\"2\" />\n </svg>\n );\n});\nThickDotIcon.displayName = 'ThickDotIcon';\n\nexport { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDividerHorizontalIcon, ThickDotIcon };\nexport type { IconProps };\n\n// Additional minimal icons\nconst CloseIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg\n {..._props}\n ref={_forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n});\nCloseIcon.displayName = 'CloseIcon';\n\nconst PaperclipIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n {...props}\n ref={forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n});\nPaperclipIcon.displayName = 'PaperclipIcon';\n\nconst FileIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n </svg>\n );\n});\nFileIcon.displayName = 'FileIcon';\n\nconst FileTextIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n});\nFileTextIcon.displayName = 'FileTextIcon';\n\n/** The tick a button shows in place of its icon while `done`. Drawn on the 24 grid at the icon set's stroke. */\nconst TickIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path d=\"M5 12.75L9.5 17.25L19 7.25\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n});\nTickIcon.displayName = 'TickIcon';\n\nexport { CloseIcon, PaperclipIcon, FileIcon, FileTextIcon, TickIcon };\n", "'use client';\n\nimport * as React from 'react';\n\ntype ThemeSize = '1' | '2' | '3' | '4';\n\n/** The rest of the 1-4 index when no Theme states a size. */\nconst THEME_SIZE_DEFAULT: ThemeSize = '2';\n\n/**\n * The app-wide size index, provided by `Theme` beside `ThemeContext`.\n *\n * It is its own context, holding one string, so a component that only needs\n * the size does not re-render when the accent colour or appearance changes.\n */\nconst ThemeSizeContext = React.createContext<ThemeSize>(THEME_SIZE_DEFAULT);\nThemeSizeContext.displayName = 'ThemeSizeContext';\n\ninterface SizePropDef {\n values: readonly string[];\n default?: string;\n}\n\n/**\n * Maps the theme size onto a component's own range: the value itself when the\n * component has it, otherwise the nearest end of the range (`4` on a 1-3 scale\n * is `3`, on a 1-2 scale it is `2`).\n */\nfunction clampSize(size: ThemeSize, values: readonly string[]): string {\n if (values.includes(size)) return size;\n const n = Number(size);\n let nearest = values[0];\n let distance = Infinity;\n for (let i = 0; i < values.length; i++) {\n const d = Math.abs(Number(values[i]) - n);\n if (d < distance) {\n distance = d;\n nearest = values[i];\n }\n }\n return nearest;\n}\n\n/**\n * The size a component on the 1-4 index takes: what the caller said, else the\n * nearest Theme's size, mapped into the component's range.\n */\nfunction useThemeSize<V>(explicit: V | undefined, propDef: SizePropDef): V {\n const themeSize = React.useContext(ThemeSizeContext);\n if (explicit !== undefined) return explicit;\n // The clamped value is one of `propDef.values`, which is what `V` ranges over.\n return clampSize(themeSize, propDef.values) as V;\n}\n\n/**\n * Fills `size` from the nearest Theme when the caller left it unset, so the\n * result can go straight into `extractProps`. An explicit size, responsive\n * object included, wins.\n *\n * Returns the same props object when there is nothing to fill: when a size is\n * set, or when the theme size resolves to the prop def's own default (the\n * common case, a Theme with no size), so `extractProps` applies it as before.\n */\nfunction useThemeSizeProps<P extends { size?: unknown }>(props: P, propDef: SizePropDef): P {\n const themeSize = React.useContext(ThemeSizeContext);\n if (props.size !== undefined) return props;\n const size = clampSize(themeSize, propDef.values);\n if (size === propDef.default) return props;\n return { ...props, size };\n}\n\nexport { ThemeSizeContext, THEME_SIZE_DEFAULT, clampSize, useThemeSize, useThemeSizeProps };\nexport type { ThemeSize };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\n\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { tooltipPropDefs } from './tooltip.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype TooltipElement = React.ElementRef<typeof TooltipPrimitive.Content>;\ntype TooltipOwnProps = GetPropDefTypes<typeof tooltipPropDefs>;\ninterface TooltipProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>,\n ComponentPropsWithout<typeof TooltipPrimitive.Content, RemovedProps | 'content'>,\n TooltipOwnProps {\n content: React.ReactNode;\n container?: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Portal>['container'];\n}\nconst Tooltip = React.forwardRef<TooltipElement, TooltipProps>((props, forwardedRef) => {\n const {\n children,\n className,\n open,\n defaultOpen,\n onOpenChange,\n delayDuration,\n disableHoverableContent,\n content,\n container,\n forceMount,\n ...tooltipContentProps\n } = extractProps(props, tooltipPropDefs);\n const rootProps = { open, defaultOpen, onOpenChange, delayDuration, disableHoverableContent };\n return (\n <TooltipPrimitive.Root {...rootProps}>\n <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <TooltipPrimitive.Content\n sideOffset={4}\n collisionPadding={10}\n {...tooltipContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-TooltipContent', className)}\n >\n <Text as=\"p\" className=\"kui-TooltipText\" size=\"1\">\n {content}\n </Text>\n <TooltipPrimitive.Arrow className=\"kui-TooltipArrow\" />\n </TooltipPrimitive.Content>\n </Theme>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n});\nTooltip.displayName = 'Tooltip';\n\nexport { Tooltip };\nexport type { TooltipProps };\n", "import * as React from 'react';\nimport { Slot } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { textPropDefs } from './text.props.js';\n\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype TextElement = React.ElementRef<'span'>;\ntype TextOwnProps = GetPropDefTypes<typeof textPropDefs>;\ninterface CommonTextProps extends TextOwnProps {}\ntype TextSpanProps = { as?: 'span' } & ComponentPropsWithout<'span', RemovedProps>;\ntype TextDivProps = { as: 'div' } & ComponentPropsWithout<'div', RemovedProps>;\ntype TextLabelProps = { as: 'label' } & ComponentPropsWithout<'label', RemovedProps>;\ntype TextPProps = { as: 'p' } & ComponentPropsWithout<'p', RemovedProps>;\ntype TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);\n\n// Pre-merge prop definitions at module level to avoid per-render allocation\n\nconst Text = React.memo(\n React.forwardRef<TextElement, TextProps>((props, forwardedRef) => {\n const {\n children,\n className,\n asChild,\n as: Tag = 'span',\n color,\n ...textProps\n } = extractProps(props, textPropDefs);\n\n const combinedClassName = className ? `kui-Text ${className}` : 'kui-Text';\n\n if (asChild) {\n return (\n <Slot.Root\n data-accent-color={color}\n {...textProps}\n ref={forwardedRef}\n className={combinedClassName}\n >\n {children}\n </Slot.Root>\n );\n }\n\n return (\n <Tag\n data-accent-color={color}\n {...(textProps as React.HTMLAttributes<HTMLElement>)}\n ref={forwardedRef as any}\n className={combinedClassName}\n >\n {children}\n </Tag>\n );\n })\n);\nText.displayName = 'Text';\n\nexport { Text };\nexport type { TextProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst emphases = ['loud', 'medium', 'quiet'] as const;\n\n// Text-first components only (Text, Heading, Blockquote, Code).\n// No colour + emphasis reads the gray ink ladder; colour + emphasis reads the accent ink ladder.\n// Components that need a different default spread this def and override `default`.\nconst emphasisPropDef = {\n emphasis: {\n type: 'enum',\n className: 'kui-emphasis',\n values: emphases,\n default: undefined,\n },\n} satisfies {\n emphasis: PropDef<(typeof emphases)[number]>;\n};\n\nexport { emphasisPropDef, emphases };\n", "import type { PropDef } from './prop-def.js';\n\nconst leadingTrimValues = ['normal', 'start', 'end', 'both'] as const;\n\nconst leadingTrimPropDef = {\n trim: {\n type: 'enum',\n className: 'kui-r-lt',\n values: leadingTrimValues,\n responsive: true,\n },\n} satisfies {\n trim: PropDef<(typeof leadingTrimValues)[number]>;\n};\n\nexport { leadingTrimPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textAlignValues = ['left', 'center', 'right'] as const;\n\nconst textAlignPropDef = {\n align: {\n type: 'enum',\n className: 'kui-r-ta',\n values: textAlignValues,\n responsive: true,\n },\n} satisfies {\n align: PropDef<(typeof textAlignValues)[number]>;\n};\n\nexport { textAlignPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textWrapValues = ['wrap', 'nowrap', 'pretty', 'balance'] as const;\n\nconst textWrapPropDef = {\n wrap: {\n type: 'enum',\n className: 'kui-r-tw',\n values: textWrapValues,\n responsive: true,\n },\n} satisfies {\n wrap: PropDef<(typeof textWrapValues)[number]>;\n};\n\nexport { textWrapPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst truncatePropDef = {\n truncate: {\n type: 'boolean',\n className: 'kui-truncate',\n },\n} satisfies {\n truncate: PropDef<boolean>;\n};\n\nexport { truncatePropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\n\nconst fontFamilyPropDef = {\n font: {\n type: 'enum',\n className: 'kui-r-ff',\n values: fontFamilies,\n },\n} satisfies {\n font: PropDef<(typeof fontFamilies)[number]>;\n};\n\nexport { fontFamilyPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n/** v2's three weights (\u00A715). No bold: a larger size or stronger emphasis says importance. */\nconst weights = ['regular', 'medium', 'semibold'] as const;\n\nconst weightPropDef = {\n weight: {\n type: 'enum',\n className: 'kui-r-weight',\n values: weights,\n responsive: true,\n },\n} satisfies {\n weight: PropDef<(typeof weights)[number]>;\n};\n\nexport { weightPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { emphasisPropDef } from '../props/emphasis.prop.js';\nimport { leadingTrimPropDef } from '../props/leading-trim.prop.js';\nimport { textAlignPropDef } from '../props/text-align.prop.js';\nimport { textWrapPropDef } from '../props/text-wrap.prop.js';\nimport { truncatePropDef } from '../props/truncate.prop.js';\nimport { fontFamilyPropDef } from '../props/font-family.prop.js';\nimport { weightPropDef } from '../props/weight.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst as = ['span', 'div', 'label', 'p'] as const;\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\n\nconst textPropDefs = {\n as: { type: 'enum', values: as, default: 'span' },\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n responsive: true,\n },\n ...fontFamilyPropDef,\n ...weightPropDef,\n ...textAlignPropDef,\n ...leadingTrimPropDef,\n ...truncatePropDef,\n ...textWrapPropDef,\n ...colorPropDef,\n ...emphasisPropDef,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\nexport { textPropDefs };\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Direction, Slot, Tooltip as TooltipPrimitive } from 'radix-ui';\nimport { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';\n\nimport { getMatchingGrayColor } from '../helpers/get-matching-gray-color.js';\nimport { ThemeSizeContext } from '../helpers/theme-size.js';\nimport { usePropSyncedState } from '../hooks/use-prop-synced-state.js';\nimport { themePropDefs } from './theme.props.js';\n\nimport type { ThemeOwnProps } from './theme.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\nconst noop = () => {};\n\ntype ThemeAppearance = (typeof themePropDefs.appearance.values)[number];\ntype ThemeAccentColor = (typeof themePropDefs.accentColor.values)[number];\ntype ThemeGrayColor = (typeof themePropDefs.grayColor.values)[number];\ntype ThemeRadius = (typeof themePropDefs.radius.values)[number];\ntype ThemeFontFamily = (typeof themePropDefs.fontFamily.values)[number];\ntype ThemeSize = (typeof themePropDefs.size.values)[number];\n// Headings follow the body font until something sets this, so `undefined` is a\n// meaningful value here rather than a missing one.\ntype ThemeHeadingFontFamily = ThemeFontFamily | undefined;\n\ninterface ThemeChangeHandlers {\n onAppearanceChange: (appearance: ThemeAppearance) => void;\n onAccentColorChange: (accentColor: ThemeAccentColor) => void;\n onGrayColorChange: (grayColor: ThemeGrayColor) => void;\n onRadiusChange: (radius: ThemeRadius) => void;\n onFontFamilyChange: (fontFamily: ThemeFontFamily) => void;\n onHeadingFontFamilyChange: (headingFontFamily: ThemeHeadingFontFamily) => void;\n onSizeChange: (size: ThemeSize) => void;\n}\n\ninterface ThemeContextValue extends ThemeChangeHandlers {\n appearance: ThemeAppearance;\n accentColor: ThemeAccentColor;\n grayColor: ThemeGrayColor;\n resolvedGrayColor: ThemeGrayColor;\n radius: ThemeRadius;\n fontFamily: ThemeFontFamily;\n headingFontFamily: ThemeHeadingFontFamily;\n size: ThemeSize;\n}\n// Default theme values used when components render outside a Theme provider\nconst defaultThemeContext: ThemeContextValue = {\n appearance: themePropDefs.appearance.default,\n accentColor: themePropDefs.accentColor.default,\n grayColor: themePropDefs.grayColor.default,\n resolvedGrayColor: themePropDefs.grayColor.default,\n radius: themePropDefs.radius.default,\n fontFamily: themePropDefs.fontFamily.default,\n headingFontFamily: undefined,\n size: themePropDefs.size.default,\n onAppearanceChange: noop,\n onAccentColorChange: noop,\n onGrayColorChange: noop,\n onRadiusChange: noop,\n onFontFamilyChange: noop,\n onHeadingFontFamilyChange: noop,\n onSizeChange: noop,\n};\n\nconst ThemeContext = React.createContext<ThemeContextValue | undefined>(undefined);\n\nfunction useThemeContext() {\n const context = React.useContext(ThemeContext);\n // Return default context if used outside Theme provider (e.g., during SSR)\n return context ?? defaultThemeContext;\n}\n\ninterface ThemeProps extends ThemeImplPublicProps {}\nconst Theme = React.forwardRef<ThemeImplElement, ThemeProps>((props, forwardedRef) => {\n const context = React.useContext(ThemeContext);\n // Direction is inherited: a Radix DirectionProvider above the Theme (for a right-to-left app)\n // wins, and left-to-right stays the default when there is none.\n const dir = Direction.useDirection();\n const isRoot = context === undefined;\n if (isRoot) {\n return (\n <TooltipPrimitive.Provider delayDuration={200}>\n <Direction.Provider dir={dir}>\n <ThemeRoot {...props} ref={forwardedRef} />\n </Direction.Provider>\n </TooltipPrimitive.Provider>\n );\n }\n return <ThemeImpl {...props} ref={forwardedRef} />;\n});\nTheme.displayName = 'Theme';\n\nconst ThemeRoot = React.forwardRef<ThemeImplElement, ThemeImplPublicProps>((props, forwardedRef) => {\n const {\n appearance: appearanceProp = themePropDefs.appearance.default,\n accentColor: accentColorProp = themePropDefs.accentColor.default,\n grayColor: grayColorProp = themePropDefs.grayColor.default,\n radius: radiusProp = themePropDefs.radius.default,\n fontFamily: fontFamilyProp = themePropDefs.fontFamily.default,\n headingFontFamily: headingFontFamilyProp,\n size: sizeProp = themePropDefs.size.default,\n hasBackground = themePropDefs.hasBackground.default,\n ...rootProps\n } = props;\n\n // Each of these follows its prop but stays independently settable, so\n // the context setters can change the theme at runtime. Syncing during render\n // rather than in an effect matters here: an effect would commit the old\n // theme first and re-render every consumer of the context a second time.\n const [appearance, setAppearance] = usePropSyncedState(appearanceProp);\n const [accentColor, setAccentColor] = usePropSyncedState(accentColorProp);\n const [grayColor, setGrayColor] = usePropSyncedState(grayColorProp);\n const [radius, setRadius] = usePropSyncedState(radiusProp);\n const [fontFamily, setFontFamily] = usePropSyncedState(fontFamilyProp);\n const [headingFontFamily, setHeadingFontFamily] = usePropSyncedState(headingFontFamilyProp);\n const [size, setSize] = usePropSyncedState(sizeProp);\n\n return (\n <ThemeImpl\n {...rootProps}\n ref={forwardedRef}\n isRoot\n hasBackground={hasBackground}\n //\n appearance={appearance}\n accentColor={accentColor}\n grayColor={grayColor}\n radius={radius}\n fontFamily={fontFamily}\n headingFontFamily={headingFontFamily}\n size={size}\n //\n onAppearanceChange={setAppearance}\n onAccentColorChange={setAccentColor}\n onGrayColorChange={setGrayColor}\n onRadiusChange={setRadius}\n onFontFamilyChange={setFontFamily}\n onHeadingFontFamilyChange={setHeadingFontFamily}\n onSizeChange={setSize}\n />\n );\n});\nThemeRoot.displayName = 'ThemeRoot';\n\ntype ThemeImplElement = React.ElementRef<'div'>;\ninterface ThemeImplProps extends ThemeImplPublicProps, ThemeImplPrivateProps {}\ninterface ThemeImplPublicProps extends ComponentPropsWithout<'div', RemovedProps | 'dir'>, ThemeOwnProps {}\ninterface ThemeImplPrivateProps extends Partial<ThemeChangeHandlers> {\n isRoot?: boolean;\n}\nfunction getClientOS(): 'windows' | 'macos' | 'linux' | undefined {\n if (typeof navigator === 'undefined') return undefined;\n const ua = navigator.userAgent;\n if (ua.includes('Win')) return 'windows';\n if (ua.includes('Mac')) return 'macos';\n if (ua.includes('Linux')) return 'linux';\n return undefined;\n}\n\nconst ThemeImpl = React.forwardRef<ThemeImplElement, ThemeImplProps>((props, forwardedRef) => {\n const context = React.useContext(ThemeContext);\n const {\n asChild,\n isRoot,\n hasBackground: hasBackgroundProp,\n //\n appearance = props.appearance ?? context?.appearance ?? themePropDefs.appearance.default,\n accentColor = props.accentColor ?? context?.accentColor ?? themePropDefs.accentColor.default,\n grayColor = props.grayColor ?? context?.resolvedGrayColor ?? themePropDefs.grayColor.default,\n radius = props.radius ?? context?.radius ?? themePropDefs.radius.default,\n fontFamily = props.fontFamily ?? context?.fontFamily ?? themePropDefs.fontFamily.default,\n headingFontFamily = props.headingFontFamily ?? context?.headingFontFamily,\n size = props.size ?? context?.size ?? themePropDefs.size.default,\n //\n onAppearanceChange = noop,\n onAccentColorChange = noop,\n onGrayColorChange = noop,\n onRadiusChange = noop,\n onFontFamilyChange = noop,\n onHeadingFontFamilyChange = noop,\n onSizeChange = noop,\n //\n ...themeProps\n } = props;\n const Comp = asChild ? Slot.Root : 'div';\n const resolvedGrayColor = grayColor === 'auto' ? getMatchingGrayColor(accentColor) : grayColor;\n const isExplicitAppearance = props.appearance === 'light' || props.appearance === 'dark';\n const hasBackground = hasBackgroundProp === undefined ? isRoot || isExplicitAppearance : hasBackgroundProp;\n\n // `data-os` can only be resolved on the client. Writing it straight to the\n // DOM keeps it out of the server markup \u2014 so hydration still matches \u2014 without\n // spending a render pass, and a state update here would re-render the whole\n // application on mount.\n const rootRef = React.useRef<ThemeImplElement>(null);\n const composedRef = useComposedRefs(forwardedRef, rootRef);\n const hasExplicitOS = 'data-os' in themeProps;\n\n useLayoutEffect(() => {\n if (!isRoot || hasExplicitOS) return;\n const node = rootRef.current;\n if (!node) return;\n\n const os = getClientOS();\n if (!os) return;\n node.setAttribute('data-os', os);\n return () => node.removeAttribute('data-os');\n }, [isRoot, hasExplicitOS]);\n\n return (\n <ThemeContext.Provider\n value={React.useMemo(\n () => ({\n appearance,\n accentColor,\n grayColor,\n resolvedGrayColor,\n radius,\n fontFamily,\n headingFontFamily,\n size,\n //\n onAppearanceChange,\n onAccentColorChange,\n onGrayColorChange,\n onRadiusChange,\n onFontFamilyChange,\n onHeadingFontFamilyChange,\n onSizeChange,\n }),\n [\n appearance,\n accentColor,\n grayColor,\n resolvedGrayColor,\n radius,\n fontFamily,\n headingFontFamily,\n size,\n //\n onAppearanceChange,\n onAccentColorChange,\n onGrayColorChange,\n onRadiusChange,\n onFontFamilyChange,\n onHeadingFontFamilyChange,\n onSizeChange,\n ],\n )}\n >\n {/* Size travels on its own context as a bare string, so the components\n that read it do not re-render when another theme value changes. */}\n <ThemeSizeContext.Provider value={size}>\n <Comp\n data-is-root-theme={isRoot ? 'true' : 'false'}\n data-accent-color={accentColor}\n data-gray-color={resolvedGrayColor}\n // for nested `Theme` background\n data-has-background={hasBackground ? 'true' : 'false'}\n data-radius={radius}\n data-font-family={fontFamily}\n data-heading-font-family={headingFontFamily}\n ref={composedRef}\n {...themeProps}\n className={classNames(\n 'kui-theme',\n {\n light: appearance === 'light',\n dark: appearance === 'dark',\n },\n themeProps.className,\n )}\n />\n </ThemeSizeContext.Provider>\n </ThemeContext.Provider>\n );\n});\nThemeImpl.displayName = 'ThemeImpl';\n\nexport { Theme, ThemeContext, useThemeContext };\nexport type { ThemeProps, ThemeContextValue };\n", "import type { accentColors } from '../props/color.prop.js';\n\ntype ThemeAccentColor = (typeof accentColors)[number];\n\nexport function getMatchingGrayColor(accentColor: ThemeAccentColor) {\n switch (accentColor) {\n case 'tomato':\n case 'red':\n case 'ruby':\n case 'crimson':\n case 'pink':\n case 'plum':\n case 'purple':\n case 'violet':\n return 'mauve';\n case 'iris':\n case 'indigo':\n case 'blue':\n case 'sky':\n case 'cyan':\n return 'slate';\n case 'teal':\n case 'jade':\n case 'mint':\n case 'green':\n return 'sage';\n case 'grass':\n case 'lime':\n return 'olive';\n case 'yellow':\n case 'amber':\n case 'orange':\n case 'brown':\n case 'gold':\n case 'bronze':\n return 'sand';\n case 'gray':\n return 'gray';\n }\n}\n", "import * as React from 'react';\n\n/**\n * State that tracks a prop but can also be set imperatively \u2014 the shape `Theme`\n * needs, where a prop sets the value and the context setters can change it at runtime.\n *\n * Adjusts state during render rather than syncing in a `useEffect`. An effect\n * would commit one render carrying the *old* value and schedule a second one,\n * which for a provider means every consumer renders twice and the browser can\n * paint the stale value in between.\n *\n * @see https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\nexport function usePropSyncedState<T>(propValue: T) {\n const [value, setValue] = React.useState(propValue);\n const [previousPropValue, setPreviousPropValue] = React.useState(propValue);\n\n if (!Object.is(propValue, previousPropValue)) {\n setPreviousPropValue(propValue);\n setValue(propValue);\n }\n\n return [value, setValue] as const;\n}\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { accentColors, grayColors } from '../props/color.prop.js';\nimport { radii } from '../props/radius.prop.js';\n\nimport type { GetPropDefTypes, PropDef } from '../props/prop-def.js';\n\nconst appearances = ['inherit', 'light', 'dark'] as const;\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\nconst sizes = ['1', '2', '3', '4'] as const;\n\nconst themePropDefs = {\n ...asChildPropDef,\n /**\n * Whether to apply background color to the Theme element.\n *\n * Defaults to true for the root Theme and for Theme elements that\n * have an explicit light or dark appearance prop.\n */\n hasBackground: { type: 'boolean', default: true },\n /**\n * Sets the color scheme of the theme, typcially referred to as light and dark mode.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/dark-mode\n */\n appearance: { type: 'enum', values: appearances, default: 'inherit' },\n /**\n * Selects one of the accent color options to use in the Theme.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/color\n */\n accentColor: { type: 'enum', values: accentColors, default: 'gray' },\n /**\n * Selects one of the gray color options to use in the Theme.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/color\n */\n grayColor: { type: 'enum', values: grayColors, default: 'gray' },\n /**\n * Sets the default radius of the components.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/visual-style\n */\n radius: { type: 'enum', values: radii, default: 'full' },\n /**\n * Sets the font family used for body text in the theme.\n *\n * Headings follow this unless `headingFontFamily` (or the `--font-heading`\n * token) says otherwise.\n *\n * @default 'sans'\n */\n fontFamily: { type: 'enum', values: fontFamilies, default: 'sans' },\n /**\n * Sets the font family used for `Heading`, independently of body text.\n *\n * Deliberately has no default: when it is left unset no attribute is\n * emitted and `--font-heading` keeps following `--font-body`, so a\n * `--font-heading` override in your own CSS survives a `fontFamily` switch.\n */\n headingFontFamily: { type: 'enum', values: fontFamilies },\n /**\n * The app-wide size index. Every component on the 1-4 control and surface\n * scale that states no `size` of its own takes this one; an explicit\n * `size` always wins. Nested Themes override it for their subtree.\n *\n * @default '2'\n */\n size: { type: 'enum', values: sizes, default: '2' },\n} satisfies {\n hasBackground: PropDef<boolean>;\n appearance: PropDef<(typeof appearances)[number]>;\n accentColor: PropDef<(typeof accentColors)[number]>;\n grayColor: PropDef<(typeof grayColors)[number]>;\n radius: PropDef<(typeof radii)[number]>;\n fontFamily: PropDef<(typeof fontFamilies)[number]>;\n headingFontFamily: PropDef<(typeof fontFamilies)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\ntype ThemeOwnProps = GetPropDefTypes<typeof themePropDefs & typeof asChildPropDef>;\n\nexport { themePropDefs };\nexport type { ThemeOwnProps };\n", "import { widthPropDefs } from '../props/width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst tooltipPropDefs = {\n content: { type: 'ReactNode', required: true },\n width: widthPropDefs.width,\n minWidth: widthPropDefs.minWidth,\n maxWidth: { ...widthPropDefs.maxWidth, default: '360px' },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n content: PropDef<React.ReactNode>;\n};\n\ntype TooltipOwnProps = GetPropDefTypes<typeof tooltipPropDefs & typeof widthPropDefs>;\n\nexport { tooltipPropDefs };\nexport type { TooltipOwnProps };\n", "import * as React from 'react';\n\n/**\n * Hook for managing tooltip accessibility props and conditional rendering.\n * Encapsulates tooltip ID generation and aria-describedby binding.\n *\n * @param tooltip - The tooltip content (if any)\n * @returns Object containing tooltipId, hasTooltip flag, and accessibility props\n *\n * @example\n * ```tsx\n * const { tooltipId, hasTooltip, accessibilityProps } = useTooltipWrapper(tooltip);\n *\n * const button = <button {...accessibilityProps}>Click me</button>;\n *\n * if (!hasTooltip) return button;\n *\n * return <Tooltip id={tooltipId} content={tooltip}>{button}</Tooltip>;\n * ```\n */\nexport function useTooltipWrapper(tooltip: React.ReactNode) {\n const tooltipId = React.useId();\n const hasTooltip = Boolean(tooltip);\n\n const accessibilityProps = React.useMemo(() => (hasTooltip ? { 'aria-describedby': tooltipId } : {}), [hasTooltip, tooltipId]);\n\n return { tooltipId, hasTooltip, accessibilityProps };\n}\n", "'use client';\n\nimport * as React from 'react';\nimport { VirtualMenu } from './virtual-menu.js';\nimport classNames from 'classnames';\nimport { DropdownMenu as DropdownMenuPrimitive, Slot } from 'radix-ui';\nimport { useCallbackRef } from 'radix-ui/internal';\n\nimport { ScrollArea } from './scroll-area.js';\nimport {\n dropdownMenuContentPropDefs,\n dropdownMenuSubContentPropDefs,\n dropdownMenuItemPropDefs,\n dropdownMenuCheckboxItemPropDefs,\n dropdownMenuRadioItemPropDefs,\n} from './dropdown-menu.props.js';\nimport { Theme, useThemeContext } from './theme.js';\nimport { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDotIcon } from './icons.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../helpers/theme-size.js';\nimport {\n DrillDownLevelContext,\n DrillDownRoot,\n SubContext,\n useCreateDrillDownStore,\n useDrillDownDirection,\n useDrillDownStore,\n usePanelPosition,\n useStackEntry,\n useSubContext,\n} from './_internal/dropdown-menu-drill-down.js';\nimport { MenuCloseProvider, MenuProvider } from './_internal/menu-context.js';\nimport {\n MenuShortcut,\n getMenuAlignOffset,\n toAriaKeyShortcuts,\n useResolvedResponsiveValue,\n} from './_internal/base-menu.utils.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\n\nimport type { SubmenuBehavior } from './_internal/dropdown-menu-drill-down.js';\nimport type { IconProps } from './icons.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes, Responsive } from '../props/prop-def.js';\n\n/**\n * Open state of the menu, mirrored from Root so Content can reset drill-down\n * navigation when a force-mounted menu opens again.\n */\nconst DropdownMenuOpenContext = React.createContext(false);\n\ninterface DropdownMenuRootProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root> {}\nconst DropdownMenuRoot: React.FC<DropdownMenuRootProps> = (props) => {\n const { open: openProp, defaultOpen = false, onOpenChange } = props;\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);\n const open = openProp ?? uncontrolledOpen;\n\n const handleOpenChangeProp = useCallbackRef(onOpenChange);\n const handleOpenChange = React.useCallback(\n (next: boolean) => {\n setUncontrolledOpen(next);\n handleOpenChangeProp(next);\n },\n [handleOpenChangeProp],\n );\n\n const close = React.useCallback(() => handleOpenChange(false), [handleOpenChange]);\n\n return (\n <DropdownMenuOpenContext.Provider value={open}>\n <MenuCloseProvider value={close}>\n <DropdownMenuPrimitive.Root {...props} open={open} onOpenChange={handleOpenChange} />\n </MenuCloseProvider>\n </DropdownMenuOpenContext.Provider>\n );\n};\nDropdownMenuRoot.displayName = 'DropdownMenu.Root';\n\ntype DropdownMenuTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.Trigger>;\ninterface DropdownMenuTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Trigger, RemovedProps> {}\nconst DropdownMenuTrigger = React.forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DropdownMenuPrimitive.Trigger>\n ),\n);\nDropdownMenuTrigger.displayName = 'DropdownMenu.Trigger';\n\n/** Visual props shared by Content and SubContent. */\ntype DropdownMenuSurfaceProps = GetPropDefTypes<typeof dropdownMenuSubContentPropDefs>;\n\ntype DropdownMenuContentContextValue = {\n size?: DropdownMenuSurfaceProps['size'];\n color?: DropdownMenuSurfaceProps['color'];\n};\nconst DropdownMenuContentContext = React.createContext<DropdownMenuContentContextValue>({});\n\n/** Keys that navigate back one drill-down level, by writing direction. */\nconst BACK_KEYS = { ltr: 'ArrowLeft', rtl: 'ArrowRight' } as const;\nconst FORWARD_KEYS = { ltr: 'ArrowRight', rtl: 'ArrowLeft' } as const;\n\nfunction isTextEntryTarget(target: EventTarget | null) {\n return (\n target instanceof HTMLElement &&\n (target.isContentEditable || target.tagName === 'INPUT' || target.tagName === 'TEXTAREA')\n );\n}\n\nfunction getDirection(element: HTMLElement | null): 'ltr' | 'rtl' {\n return element?.closest('[dir]')?.getAttribute('dir') === 'rtl' ? 'rtl' : 'ltr';\n}\n\ntype DropdownMenuContentElement = React.ElementRef<typeof DropdownMenuPrimitive.Content>;\ninterface DropdownMenuContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Content, RemovedProps>,\n DropdownMenuSurfaceProps {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n /**\n * Controls how submenus behave.\n * - `cascade`: Default cascading behavior where submenus open to the side (portal-based)\n * - `drill-down`: Mobile-friendly behavior where submenus replace the content inline\n * Supports responsive values: `{ initial: 'drill-down', md: 'cascade' }`\n */\n submenuBehavior?: Responsive<SubmenuBehavior>;\n /**\n * When true, skips the ScrollArea wrapper to allow VirtualMenu to handle its own scrolling.\n * Use this when rendering virtualized lists inside the dropdown.\n */\n virtualized?: boolean;\n}\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, dropdownMenuContentPropDefs.size);\n const themeContext = useThemeContext();\n const {\n size = dropdownMenuContentPropDefs.size.default,\n } = props;\n const {\n className,\n children,\n color,\n container,\n forceMount,\n submenuBehavior,\n virtualized = false,\n onEscapeKeyDown,\n onKeyDown,\n ...contentProps\n } = extractProps(props, dropdownMenuContentPropDefs);\n\n const resolvedColor = color || themeContext.accentColor;\n const behavior = useResolvedResponsiveValue<SubmenuBehavior>(submenuBehavior, 'cascade');\n const isDrillDown = behavior === 'drill-down';\n const open = React.useContext(DropdownMenuOpenContext);\n const drillDownStore = useCreateDrillDownStore();\n\n // Escape goes back one drill-down level before it closes the menu.\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n onEscapeKeyDown?.(event);\n if (event.defaultPrevented || !isDrillDown || drillDownStore.getDepth() === 0) return;\n event.preventDefault();\n drillDownStore.pop('keyboard');\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || !isDrillDown || drillDownStore.getDepth() === 0) return;\n if (isTextEntryTarget(event.target)) return;\n if (event.key === BACK_KEYS[getDirection(event.currentTarget)]) {\n event.preventDefault();\n drillDownStore.pop('keyboard');\n }\n };\n\n const contextValue = React.useMemo(\n () => ({ size, color: resolvedColor }),\n [size, resolvedColor],\n );\n\n const contentBody = (\n <MenuProvider size={size}>\n <DropdownMenuContentContext.Provider value={contextValue}>\n <DrillDownRoot store={drillDownStore} behavior={behavior} open={open}>\n {children}\n </DrillDownRoot>\n </DropdownMenuContentContext.Provider>\n </MenuProvider>\n );\n\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DropdownMenuPrimitive.Content\n data-accent-color={resolvedColor}\n align=\"start\"\n sideOffset={4}\n collisionPadding={10}\n {...contentProps}\n onEscapeKeyDown={handleEscapeKeyDown}\n onKeyDown={handleKeyDown}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-DropdownMenuContent',\n className,\n )}\n >\n {virtualized ? (\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport', 'kui-virtualized')}>\n {contentBody}\n </div>\n ) : (\n <ScrollArea type=\"auto\" scrollbars=\"vertical\">\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport')}>\n {contentBody}\n </div>\n </ScrollArea>\n )}\n </DropdownMenuPrimitive.Content>\n </Theme>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nDropdownMenuContent.displayName = 'DropdownMenu.Content';\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof DropdownMenuPrimitive.Label>;\ninterface DropdownMenuLabelProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Label, RemovedProps> {}\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n ({ className, ...props }, forwardedRef) => {\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.Label\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuLabel', 'kui-DropdownMenuLabel', className)}\n />\n );\n },\n);\nDropdownMenuLabel.displayName = 'DropdownMenu.Label';\n\ntype DropdownMenuItemElement = React.ElementRef<typeof DropdownMenuPrimitive.Item>;\ntype DropdownMenuItemOwnProps = GetPropDefTypes<typeof dropdownMenuItemPropDefs>;\ninterface DropdownMenuItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Item, RemovedProps>,\n DropdownMenuItemOwnProps {}\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props, forwardedRef) => {\n const {\n className,\n children,\n color = dropdownMenuItemPropDefs.color.default,\n shortcut,\n ...itemProps\n } = props;\n // In drill-down mode, items of levels that are not on screen do not mount.\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.Item\n data-accent-color={color}\n aria-keyshortcuts={shortcut ? toAriaKeyShortcuts(shortcut) : undefined}\n {...itemProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-DropdownMenuItem', className)}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n {shortcut && <MenuShortcut shortcut={shortcut} className=\"kui-DropdownMenuShortcut\" />}\n </DropdownMenuPrimitive.Item>\n );\n },\n);\nDropdownMenuItem.displayName = 'DropdownMenu.Item';\n\ntype DropdownMenuGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.Group>;\ninterface DropdownMenuGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Group, RemovedProps> {}\nconst DropdownMenuGroup = React.forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n ({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Group\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuGroup', 'kui-DropdownMenuGroup', className)}\n />\n ),\n);\nDropdownMenuGroup.displayName = 'DropdownMenu.Group';\n\ntype DropdownMenuRadioGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>;\ninterface DropdownMenuRadioGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioGroup, RemovedProps> {}\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>(({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.RadioGroup\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuRadioGroup', 'kui-DropdownMenuRadioGroup', className)}\n />\n));\nDropdownMenuRadioGroup.displayName = 'DropdownMenu.RadioGroup';\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>;\ntype DropdownMenuRadioItemOwnProps = GetPropDefTypes<typeof dropdownMenuRadioItemPropDefs>;\ninterface DropdownMenuRadioItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioItem, RemovedProps>,\n DropdownMenuRadioItemOwnProps {}\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n color = dropdownMenuRadioItemPropDefs.color.default,\n ...itemProps\n } = props;\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.RadioItem\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuRadioItem',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuRadioItem',\n className,\n )}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n <DropdownMenuPrimitive.ItemIndicator className=\"kui-BaseMenuItemIndicator kui-DropdownMenuItemIndicator\">\n <ThickDotIcon className=\"kui-BaseMenuItemIndicatorIcon kui-DropdownMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </DropdownMenuPrimitive.RadioItem>\n );\n});\nDropdownMenuRadioItem.displayName = 'DropdownMenu.RadioItem';\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>;\ntype DropdownMenuCheckboxItemOwnProps = GetPropDefTypes<typeof dropdownMenuCheckboxItemPropDefs>;\ninterface DropdownMenuCheckboxItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.CheckboxItem, RemovedProps>,\n DropdownMenuCheckboxItemOwnProps {}\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n shortcut,\n color = dropdownMenuCheckboxItemPropDefs.color.default,\n ...itemProps\n } = props;\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.CheckboxItem\n aria-keyshortcuts={shortcut ? toAriaKeyShortcuts(shortcut) : undefined}\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuCheckboxItem',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuCheckboxItem',\n className,\n )}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n <DropdownMenuPrimitive.ItemIndicator className=\"kui-BaseMenuItemIndicator kui-DropdownMenuItemIndicator\">\n <ThickCheckIcon className=\"kui-BaseMenuItemIndicatorIcon kui-DropdownMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n {shortcut && <MenuShortcut shortcut={shortcut} className=\"kui-DropdownMenuShortcut\" />}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n});\nDropdownMenuCheckboxItem.displayName = 'DropdownMenu.CheckboxItem';\n\ninterface DropdownMenuSubProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub> {\n /**\n * Label displayed in the back button when using drill-down mode.\n * If not provided, defaults to \"Back\".\n */\n label?: React.ReactNode;\n}\nconst DropdownMenuSub: React.FC<DropdownMenuSubProps> = ({\n label = 'Back',\n open,\n defaultOpen,\n onOpenChange,\n children,\n}) => {\n const drillDownStore = useDrillDownStore();\n const id = React.useId();\n const subContextValue = React.useMemo(() => ({ id, label }), [id, label]);\n const isOpenInDrillDown = usePanelPosition(drillDownStore, id) !== 'closed';\n\n // Drill-down: `open` and `defaultOpen` drive the stack; the stack drives\n // `onOpenChange`. A controlled `open` is applied when it changes.\n React.useLayoutEffect(() => {\n if (!drillDownStore || open === undefined) return;\n if (open && !drillDownStore.isOpen(id)) drillDownStore.push(id, null);\n else if (!open && drillDownStore.isOpen(id)) drillDownStore.close(id);\n }, [drillDownStore, open, id]);\n\n const defaultOpenRef = React.useRef(defaultOpen);\n React.useLayoutEffect(() => {\n if (drillDownStore && defaultOpenRef.current && open === undefined) drillDownStore.push(id, null);\n // Only on mount, like an uncontrolled default.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleOpenChange = useCallbackRef(onOpenChange);\n const wasOpenRef = React.useRef(isOpenInDrillDown);\n React.useEffect(() => {\n if (!drillDownStore || wasOpenRef.current === isOpenInDrillDown) return;\n wasOpenRef.current = isOpenInDrillDown;\n handleOpenChange(isOpenInDrillDown);\n }, [drillDownStore, isOpenInDrillDown, handleOpenChange]);\n\n // Radix Sub stays mounted in both behaviors so switching behavior does not\n // remount the subtree. It only renders context; in drill-down its trigger\n // and content are never rendered, so it reports no open changes of its own.\n return (\n <SubContext.Provider value={subContextValue}>\n <DropdownMenuPrimitive.Sub\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={drillDownStore ? undefined : onOpenChange}\n >\n {children}\n </DropdownMenuPrimitive.Sub>\n </SubContext.Provider>\n );\n};\nDropdownMenuSub.displayName = 'DropdownMenu.Sub';\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>;\ninterface DropdownMenuSubTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubTrigger, RemovedProps> {}\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>((props, forwardedRef) => {\n const { className, children, onKeyDown, ...subTriggerProps } = props;\n const drillDownStore = useDrillDownStore();\n const subContext = useSubContext();\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n\n if (drillDownStore && subContext) {\n if (!isLevelVisible) return null;\n\n const handleSelect = (event: Event) => {\n // Navigating does not close the menu.\n event.preventDefault();\n drillDownStore.push(subContext.id);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || subTriggerProps.disabled) return;\n if (event.key === FORWARD_KEYS[getDirection(event.currentTarget)]) {\n event.preventDefault();\n drillDownStore.push(subContext.id, 'keyboard');\n }\n };\n\n return (\n <DropdownMenuPrimitive.Item\n aria-haspopup=\"menu\"\n {...subTriggerProps}\n data-drill-down-trigger={subContext.id}\n data-drill-down-name={subTriggerProps.textValue}\n onSelect={handleSelect}\n onKeyDown={handleKeyDown}\n ref={forwardedRef}\n className={classNames(\n 'kui-reset',\n 'kui-BaseMenuItem',\n 'kui-BaseMenuSubTrigger',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuSubTrigger',\n 'kui-DropdownMenuDrillDownSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"kui-BaseMenuShortcut kui-DropdownMenuShortcut\">\n <ThickChevronRightIcon className=\"kui-BaseMenuSubTriggerIcon kui-DropdownMenuSubTriggerIcon\" />\n </div>\n </DropdownMenuPrimitive.Item>\n );\n }\n\n return (\n <DropdownMenuPrimitive.SubTrigger\n {...subTriggerProps}\n onKeyDown={onKeyDown}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuSubTrigger',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"kui-BaseMenuShortcut kui-DropdownMenuShortcut\">\n <ThickChevronRightIcon className=\"kui-BaseMenuSubTriggerIcon kui-DropdownMenuSubTriggerIcon\" />\n </div>\n </DropdownMenuPrimitive.SubTrigger>\n );\n});\nDropdownMenuSubTrigger.displayName = 'DropdownMenu.SubTrigger';\n\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof DropdownMenuPrimitive.Separator>;\ninterface DropdownMenuSeparatorProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Separator, RemovedProps> {}\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, forwardedRef) => {\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.Separator\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuSeparator', 'kui-DropdownMenuSeparator', className)}\n />\n );\n});\nDropdownMenuSeparator.displayName = 'DropdownMenu.Separator';\n\n/** The row at the top of a drill-down panel that returns to the parent level. */\nfunction DrillDownBackItem({ label, name }: { label: React.ReactNode; name: string }) {\n const drillDownStore = useDrillDownStore();\n\n const handleSelect = React.useCallback(\n (event: Event) => {\n // Navigating does not close the menu.\n event.preventDefault();\n drillDownStore?.pop();\n },\n [drillDownStore],\n );\n\n // The visible label is often the submenu title, so the accessible name says\n // what the row does while still containing the visible text.\n const labelText = typeof label === 'string' ? label : name;\n const ariaLabel = labelText && labelText !== 'Back' ? `Back from ${labelText}` : undefined;\n\n return (\n <DropdownMenuPrimitive.Item\n aria-label={ariaLabel}\n textValue={labelText || 'Back'}\n onSelect={handleSelect}\n className={classNames(\n 'kui-reset',\n 'kui-BaseMenuItem',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuDrillDownBackItem',\n )}\n >\n <ThickChevronLeftIcon className=\"kui-BaseMenuSubTriggerIcon kui-DropdownMenuDrillDownBackIcon\" />\n <span className=\"kui-DropdownMenuDrillDownBackLabel\">{label}</span>\n </DropdownMenuPrimitive.Item>\n );\n}\n\n/** Radix positioning and layer props that have no meaning for an inline drill-down panel. */\ntype PopperOnlyProps =\n | 'loop'\n | 'onEscapeKeyDown'\n | 'onPointerDownOutside'\n | 'onFocusOutside'\n | 'onInteractOutside'\n | 'sideOffset'\n | 'alignOffset'\n | 'avoidCollisions'\n | 'collisionBoundary'\n | 'collisionPadding'\n | 'arrowPadding'\n | 'sticky'\n | 'hideWhenDetached'\n | 'updatePositionStrategy';\n\nfunction omitPopperProps<T extends Record<string, unknown>>(props: T): Omit<T, PopperOnlyProps> {\n const {\n loop: _loop,\n onEscapeKeyDown: _onEscapeKeyDown,\n onPointerDownOutside: _onPointerDownOutside,\n onFocusOutside: _onFocusOutside,\n onInteractOutside: _onInteractOutside,\n sideOffset: _sideOffset,\n alignOffset: _alignOffset,\n avoidCollisions: _avoidCollisions,\n collisionBoundary: _collisionBoundary,\n collisionPadding: _collisionPadding,\n arrowPadding: _arrowPadding,\n sticky: _sticky,\n hideWhenDetached: _hideWhenDetached,\n updatePositionStrategy: _updatePositionStrategy,\n ...rest\n } = props;\n return rest;\n}\n\ntype DropdownMenuSubContentElement = React.ElementRef<typeof DropdownMenuPrimitive.SubContent>;\ninterface DropdownMenuSubContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubContent, RemovedProps>,\n DropdownMenuSurfaceProps {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n /**\n * When true, skips the ScrollArea wrapper so a VirtualMenu can handle its own\n * scrolling. Applies to cascade submenus; a drill-down panel scrolls with the\n * root content.\n */\n virtualized?: boolean;\n}\nconst DropdownMenuSubContent = React.forwardRef<\n DropdownMenuSubContentElement,\n DropdownMenuSubContentProps\n>((props, forwardedRef) => {\n const drillDownStore = useDrillDownStore();\n const subContext = useSubContext();\n\n if (drillDownStore && subContext) {\n return (\n <DrillDownPanel {...props} ref={forwardedRef} store={drillDownStore} sub={subContext} />\n );\n }\n return <CascadeSubContent {...props} ref={forwardedRef} />;\n});\nDropdownMenuSubContent.displayName = 'DropdownMenu.SubContent';\n\nconst CascadeSubContent = React.forwardRef<DropdownMenuSubContentElement, DropdownMenuSubContentProps>(\n (props, forwardedRef) => {\n const parent = React.useContext(DropdownMenuContentContext);\n\n // A submenu inherits the parent surface, and its own props win.\n const size = props.size ?? parent.size;\n const color = props.color ?? parent.color;\n\n const {\n className,\n children,\n container,\n forceMount,\n color: _color,\n virtualized = false,\n ...subContentProps\n } = extractProps({ ...props, size }, dropdownMenuSubContentPropDefs);\n\n const scalarSize = useResolvedResponsiveValue(size, dropdownMenuSubContentPropDefs.size.default);\n\n const contextValue = React.useMemo(\n () => ({ size, color }),\n [size, color],\n );\n\n const body = (\n <MenuProvider size={size}>\n <DropdownMenuContentContext.Provider value={contextValue}>{children}</DropdownMenuContentContext.Provider>\n </MenuProvider>\n );\n\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DropdownMenuPrimitive.SubContent\n data-accent-color={color}\n alignOffset={getMenuAlignOffset(scalarSize)}\n // Side offset accounts for the outer solid box-shadow\n sideOffset={1}\n collisionPadding={10}\n {...subContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-BaseMenuSubContent',\n 'kui-DropdownMenuContent',\n 'kui-DropdownMenuSubContent',\n className,\n )}\n >\n {virtualized ? (\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport', 'kui-virtualized')}>\n {body}\n </div>\n ) : (\n <ScrollArea type=\"auto\" scrollbars=\"vertical\">\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport')}>{body}</div>\n </ScrollArea>\n )}\n </DropdownMenuPrimitive.SubContent>\n </Theme>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nCascadeSubContent.displayName = 'DropdownMenu.CascadeSubContent';\n\ninterface DrillDownPanelProps extends DropdownMenuSubContentProps {\n store: NonNullable<ReturnType<typeof useDrillDownStore>>;\n sub: NonNullable<ReturnType<typeof useSubContext>>;\n}\n\n/**\n * A submenu rendered inline in drill-down mode. It mounts its children only\n * while it is on the navigation stack, and shows its own items only while it\n * is the top level; deeper panels inside it stay mounted.\n */\nconst DrillDownPanel = React.forwardRef<DropdownMenuSubContentElement, DrillDownPanelProps>(\n ({ store, sub, ...props }, forwardedRef) => {\n const position = usePanelPosition(store, sub.id);\n const entry = useStackEntry(store, sub.id);\n const direction = useDrillDownDirection(position === 'top' ? store : null);\n\n if (position === 'closed') return null;\n\n const {\n className,\n children,\n container: _container,\n forceMount: _forceMount,\n virtualized: _virtualized,\n size: _size,\n color: _color,\n ...panelProps\n } = omitPopperProps(props);\n\n const isTop = position === 'top';\n const name = entry?.name || (typeof sub.label === 'string' ? sub.label : '');\n\n return (\n <div\n role=\"group\"\n aria-label={name || undefined}\n {...panelProps}\n ref={forwardedRef}\n data-drill-down-panel={sub.id}\n data-drill-down-active={isTop ? true : undefined}\n data-animation-direction={isTop ? (direction ?? undefined) : undefined}\n className={classNames('kui-DropdownMenuDrillDownPanel', className)}\n >\n {isTop && (\n <>\n <DrillDownBackItem label={sub.label} name={name} />\n <DropdownMenuPrimitive.Separator className=\"kui-BaseMenuSeparator kui-DropdownMenuSeparator\" />\n </>\n )}\n <DrillDownLevelContext.Provider value={isTop}>{children}</DrillDownLevelContext.Provider>\n </div>\n );\n },\n);\nDrillDownPanel.displayName = 'DropdownMenu.DrillDownPanel';\n\ntype DropdownMenuTriggerIconElement = React.ElementRef<'svg'>;\ninterface DropdownMenuTriggerIconProps extends IconProps {}\nconst DropdownMenuTriggerIcon = React.forwardRef<\n DropdownMenuTriggerIconElement,\n DropdownMenuTriggerIconProps\n>(({ className, ...props }, forwardedRef) => (\n <ChevronDownIcon\n {...props}\n ref={forwardedRef}\n className={classNames('kui-DropdownMenuTriggerIcon', className)}\n />\n));\nDropdownMenuTriggerIcon.displayName = 'DropdownMenu.TriggerIcon';\n\nexport {\n DropdownMenuRoot as Root,\n DropdownMenuTrigger as Trigger,\n DropdownMenuTriggerIcon as TriggerIcon,\n DropdownMenuContent as Content,\n DropdownMenuLabel as Label,\n DropdownMenuItem as Item,\n DropdownMenuGroup as Group,\n DropdownMenuRadioGroup as RadioGroup,\n DropdownMenuRadioItem as RadioItem,\n DropdownMenuCheckboxItem as CheckboxItem,\n DropdownMenuSub as Sub,\n DropdownMenuSubTrigger as SubTrigger,\n DropdownMenuSubContent as SubContent,\n DropdownMenuSeparator as Separator,\n VirtualMenu as Virtual,\n};\n\nexport type {\n DropdownMenuRootProps as RootProps,\n DropdownMenuTriggerProps as TriggerProps,\n DropdownMenuTriggerIconProps as TriggerIconProps,\n DropdownMenuContentProps as ContentProps,\n DropdownMenuLabelProps as LabelProps,\n DropdownMenuItemProps as ItemProps,\n DropdownMenuGroupProps as GroupProps,\n DropdownMenuRadioGroupProps as RadioGroupProps,\n DropdownMenuRadioItemProps as RadioItemProps,\n DropdownMenuCheckboxItemProps as CheckboxItemProps,\n DropdownMenuSubProps as SubProps,\n DropdownMenuSubTriggerProps as SubTriggerProps,\n DropdownMenuSubContentProps as SubContentProps,\n DropdownMenuSeparatorProps as SeparatorProps,\n SubmenuBehavior,\n};\n", "'use client';\n\nimport * as React from 'react';\n\nimport { useResolvedResponsiveValue } from './base-menu.utils.js';\n\nimport type { Responsive } from '../../props/prop-def.js';\n\n/**\n * Context to detect if a component is rendered inside a menu (DropdownMenu, ContextMenu, etc.)\n * Used by VirtualMenu to adjust its behavior:\n * - Skip role=\"menu\" when inside a parent menu (parent owns the role)\n * - Delegate certain keyboard handling to parent\n * - Use the correct item height based on menu size\n */\n\nexport type MenuSize = '1' | '2' | '3' | '4';\n\ninterface MenuContextValue {\n /** Whether we're inside a menu that owns the menu role */\n isInsideMenu: boolean;\n /** Menu size for the current breakpoint */\n size?: MenuSize;\n /** Item height in px for the current size and theme scaling */\n itemHeight?: number;\n}\n\nconst MenuContext = React.createContext<MenuContextValue>({ isInsideMenu: false });\n\ninterface MenuProviderProps {\n children: React.ReactNode;\n /** Menu size passed from parent (DropdownMenu.Content, ContextMenu.Content, etc.) */\n size?: Responsive<MenuSize>;\n}\n\n/**\n * Menu row height in pixels per size: the line height plus --row-inset-N above and below\n * (base-menu.css), never under the 24px target floor.\n */\nexport const menuSizeToItemHeight: Record<MenuSize, number> = {\n '1': 24,\n '2': 30,\n '3': 34,\n '4': 38,\n};\n\nexport function getMenuItemHeight(size: MenuSize): number {\n return menuSizeToItemHeight[size];\n}\n\nexport function MenuProvider({ children, size }: MenuProviderProps) {\n const resolvedSize = useResolvedResponsiveValue<MenuSize | undefined>(size, undefined);\n const itemHeight = resolvedSize ? getMenuItemHeight(resolvedSize) : undefined;\n const value = React.useMemo(\n () => ({ isInsideMenu: true, size: resolvedSize, itemHeight }),\n [resolvedSize, itemHeight],\n );\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>;\n}\n\nexport function useMenuContext() {\n return React.useContext(MenuContext);\n}\n\n/**\n * Closes the whole menu from inside it. DropdownMenu.Root and ContextMenu.Root provide it,\n * so a VirtualMenu row can close the menu on select the way a menu item does.\n */\nconst MenuCloseContext = React.createContext<(() => void) | undefined>(undefined);\nexport const MenuCloseProvider = MenuCloseContext.Provider;\n\nexport function useMenuClose() {\n return React.useContext(MenuCloseContext);\n}\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Kbd } from '../kbd.js';\nimport { useBreakpoint } from '../../hooks/use-breakpoint.js';\n\nimport type { Breakpoint, Responsive } from '../../props/prop-def.js';\n\nconst BREAKPOINTS_DESCENDING: Breakpoint[] = ['xl', 'lg', 'md', 'sm', 'xs', 'initial'];\n\n/**\n * Resolves a responsive value for the given breakpoint, falling back through\n * the smaller breakpoints when the current one is not set.\n */\nfunction resolveResponsiveValue<T>(\n value: T | Partial<Record<Breakpoint, T>> | undefined,\n currentBreakpoint: Breakpoint,\n defaultValue: T,\n): T {\n if (value === undefined || value === null) return defaultValue;\n if (typeof value !== 'object') return value;\n\n const map = value as Partial<Record<Breakpoint, T>>;\n for (let i = BREAKPOINTS_DESCENDING.indexOf(currentBreakpoint); i < BREAKPOINTS_DESCENDING.length; i++) {\n const resolved = map[BREAKPOINTS_DESCENDING[i]];\n if (resolved !== undefined) return resolved;\n }\n return defaultValue;\n}\n\n/**\n * Resolves a possibly responsive value against the current viewport. Only a\n * responsive object subscribes to breakpoint changes; a plain value costs\n * nothing.\n */\nfunction useResolvedResponsiveValue<T>(value: Responsive<T> | undefined, defaultValue: T): T {\n const isResponsive = typeof value === 'object' && value !== null;\n const { breakpoint } = useBreakpoint(isResponsive);\n return resolveResponsiveValue(value as T | Partial<Record<Breakpoint, T>> | undefined, breakpoint, defaultValue);\n}\n\n/** Content padding per menu size, in px (see base-menu.css). */\n// The panel padding ladder (--panel-p-N).\nconst CONTENT_PADDING: Record<string, number> = { '1': 8, '2': 12, '3': 16, '4': 24 };\n\n/**\n * Offset that lines the first item of a menu up with its anchor: the pointer\n * for a context menu, or the sub trigger for a submenu. It cancels the content\n * padding.\n */\nfunction getMenuAlignOffset(size: string): number {\n return -(CONTENT_PADDING[size] ?? CONTENT_PADDING['2']);\n}\n\nconst KEY_SYMBOLS: Record<string, string> = {\n '\u2318': 'Meta',\n cmd: 'Meta',\n command: 'Meta',\n meta: 'Meta',\n '\u2325': 'Alt',\n option: 'Alt',\n opt: 'Alt',\n alt: 'Alt',\n '\u21E7': 'Shift',\n shift: 'Shift',\n '\u2303': 'Control',\n ctrl: 'Control',\n control: 'Control',\n '\u232B': 'Backspace',\n '\u2326': 'Delete',\n '\u23CE': 'Enter',\n '\u21B5': 'Enter',\n '\u238B': 'Escape',\n esc: 'Escape',\n '\u21E5': 'Tab',\n '\u2191': 'ArrowUp',\n '\u2193': 'ArrowDown',\n '\u2190': 'ArrowLeft',\n '\u2192': 'ArrowRight',\n};\n\nconst ariaKeyShortcutsCache = new Map<string, string>();\n\n/**\n * Converts a display shortcut such as \"\u2318 \u21E7 P\" or \"Ctrl+S\" into the\n * `aria-keyshortcuts` format (\"Meta+Shift+P\", \"Control+S\").\n */\nfunction toAriaKeyShortcuts(shortcut: string): string | undefined {\n const cached = ariaKeyShortcutsCache.get(shortcut);\n if (cached !== undefined) return cached || undefined;\n\n // Modifier symbols are tokens of their own (\"\u2318\u21E7P\"); otherwise split on \"+\" and spaces.\n const tokens = shortcut.match(/[\u2318\u2325\u21E7\u2303]|[^\\s+\u2318\u2325\u21E7\u2303]+/gu) ?? [];\n const keys = tokens.map((token) => {\n const mapped = KEY_SYMBOLS[token] ?? KEY_SYMBOLS[token.toLowerCase()];\n return mapped ?? (token.length === 1 ? token.toUpperCase() : token);\n });\n const result = keys.join('+');\n ariaKeyShortcutsCache.set(shortcut, result);\n return result || undefined;\n}\n\n/**\n * The keyboard shortcut hint at the end of a menu item. It is hidden from\n * assistive technology because the item exposes it through\n * `aria-keyshortcuts` instead of reading it as part of the item name.\n */\nfunction MenuShortcut({ shortcut, className }: { shortcut: string; className?: string }) {\n return (\n <div aria-hidden className={classNames('kui-BaseMenuShortcut', className)}>\n <Kbd size=\"1\">{shortcut}</Kbd>\n </div>\n );\n}\n\nexport {\n resolveResponsiveValue,\n useResolvedResponsiveValue,\n getMenuAlignOffset,\n toAriaKeyShortcuts,\n MenuShortcut,\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { kbdPropDefs } from './kbd.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype KbdElement = React.ElementRef<'kbd'>;\ntype KbdOwnProps = GetPropDefTypes<typeof kbdPropDefs>;\ninterface KbdProps extends ComponentPropsWithout<'kbd', RemovedProps>, KbdOwnProps {}\nconst Kbd = React.forwardRef<KbdElement, KbdProps>((props, forwardedRef) => {\n const { asChild, className, ...kbdProps } = extractProps(props, kbdPropDefs);\n const Comp = asChild ? Slot.Root : 'kbd';\n return (\n <Comp\n {...kbdProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-Kbd', className)}\n />\n );\n});\nKbd.displayName = 'Kbd';\n\nexport { Kbd };\nexport type { KbdProps };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\nconst variants = ['raised', 'soft'] as const;\n\nconst kbdPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n responsive: true,\n },\n variant: {\n type: 'enum',\n className: 'kui-variant',\n values: variants,\n default: 'raised',\n },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n};\n\nexport { kbdPropDefs };\n", "'use client';\n\nimport * as React from 'react';\nimport { _BREAKPOINTS, type Breakpoint } from '../components/shell.types.js';\n\nconst QUERIES = Object.entries(_BREAKPOINTS) as Array<[Breakpoint, string]>;\n\ntype Listener = () => void;\n\n/**\n * One set of `MediaQueryList`s and one set of listeners for the whole\n * application. Every component that asks for the breakpoint used to create and\n * subscribe to its own copy of all five queries.\n */\nlet mediaQueryLists: Array<[Breakpoint, MediaQueryList]> | null = null;\nconst listeners = new Set<Listener>();\nlet cachedBreakpoint: Breakpoint | null = null;\n\nfunction getMediaQueryLists() {\n mediaQueryLists ??= QUERIES.map(([name, query]) => [name, window.matchMedia(query)] as [Breakpoint, MediaQueryList]);\n return mediaQueryLists;\n}\n\nfunction computeBreakpoint(): Breakpoint {\n // The largest matching query wins; `_BREAKPOINTS` is ordered smallest first.\n let matched: Breakpoint = 'initial';\n for (const [name, mql] of getMediaQueryLists()) {\n if (mql.matches) matched = name;\n }\n return matched;\n}\n\nfunction handleChange() {\n const next = computeBreakpoint();\n if (next === cachedBreakpoint) return;\n cachedBreakpoint = next;\n listeners.forEach((listener) => listener());\n}\n\nfunction subscribe(listener: Listener) {\n if (typeof window === 'undefined') return () => {};\n\n if (listeners.size === 0) {\n cachedBreakpoint = computeBreakpoint();\n for (const [, mql] of getMediaQueryLists()) {\n // Safari below 14 only has the deprecated listener API.\n if (typeof mql.addEventListener === 'function') mql.addEventListener('change', handleChange);\n else mql.addListener?.(handleChange);\n }\n }\n\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n if (listeners.size > 0) return;\n\n for (const [, mql] of getMediaQueryLists()) {\n try {\n if (typeof mql.removeEventListener === 'function') mql.removeEventListener('change', handleChange);\n else mql.removeListener?.(handleChange);\n } catch (error) {\n // Removal can throw in edge cases, e.g. the list was already torn down.\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[useBreakpoint] MediaQueryList cleanup warning:', error);\n }\n }\n }\n cachedBreakpoint = null;\n };\n}\n\n/**\n * `getSnapshot` must return a referentially stable value between changes, so it\n * reads the cache that `handleChange` maintains rather than recomputing.\n */\nfunction getSnapshot(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n cachedBreakpoint ??= computeBreakpoint();\n return cachedBreakpoint;\n}\n\nfunction getServerSnapshot(): Breakpoint {\n return 'initial';\n}\n\n/**\n * The breakpoint right now, outside React's render. For an effect that needs\n * the answer at the moment it runs rather than the one its render saw.\n */\nexport function readBreakpoint(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n return computeBreakpoint();\n}\n\nconst getReadySnapshot = () => true;\nconst getReadyServerSnapshot = () => false;\n\nconst noopSubscribe = () => () => {};\nconst getInitialSnapshot = (): Breakpoint => 'initial';\n\n/**\n * The current breakpoint, and whether it has been resolved against a real\n * viewport yet (`false` on the server and during hydration).\n *\n * Reads through `useSyncExternalStore` rather than settling into state from an\n * effect. On a client render the very first pass already has the real\n * breakpoint, instead of rendering the whole shell at `initial` and correcting\n * it after the browser has painted.\n *\n * Pass `enabled = false` to skip the subscription (the breakpoint then reads as\n * `initial`).\n */\nexport function useBreakpoint(enabled = true): { breakpoint: Breakpoint; ready: boolean } {\n // Callers with a non-responsive value pass `enabled = false` so they neither\n // subscribe to the media queries nor re-render when the viewport crosses one.\n const breakpoint = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n enabled ? getSnapshot : getInitialSnapshot,\n getServerSnapshot,\n );\n const ready = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n getReadySnapshot,\n getReadyServerSnapshot,\n );\n\n return React.useMemo(() => ({ breakpoint, ready }), [breakpoint, ready]);\n}\n", "import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\nexport type PaneSizePersistence = {\n load?: () => number | Promise<number | undefined> | undefined;\n save?: (size: number) => void | Promise<void>;\n};\n\n/**\n * Why a pane's open state changed. Since 0.8.0 only a user action is reported:\n * `toggle` for a Trigger, a handle double-click or a drag past\n * `collapseThreshold`, and `dismiss` for Escape or a press on the scrim.\n * `init`, `responsive`, `panel` and `left` are kept in the types for\n * compatibility and are never sent.\n */\nexport type PaneOpenChangeReason = 'toggle' | 'dismiss' | 'init' | 'responsive';\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n resizable?: boolean;\n collapsible?: boolean;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onExpand?: () => void;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onCollapse?: () => void;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n /** @deprecated Removed in 1.0. Snap in your own `onSizeChange` and pass `size`. */\n snapPoints?: number[];\n /** @deprecated Removed in 1.0, with `snapPoints`. */\n snapTolerance?: number;\n /** @deprecated Removed in 1.0. Close the pane from your own `onResizeEnd`. */\n collapseThreshold?: number;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n paneId?: string;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n persistence?: PaneSizePersistence;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\n/** Every breakpoint, smallest first. The stylesheet's @media blocks follow this order. */\nexport const SHELL_BREAKPOINTS: readonly Breakpoint[] = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'];\n\nexport type PaneTarget = 'left' | 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\n/** The panes a Trigger can drive. `left` is the deprecated name for `rail`. */\nexport type PaneName = Exclude<PaneTarget, 'left'>;\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n [key: CSSCustomProperty]: string | number | undefined;\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { useComposedRefs } from 'radix-ui/internal';\n\nimport { scrollAreaPropDefs } from './scroll-area.props.js';\nimport { useScrollEdges } from '../hooks/use-scroll-edges.js';\nimport { useThumbSync } from '../hooks/use-thumb-sync.js';\nimport { getSubtree } from '../helpers/get-subtree.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\n\ntype ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Viewport>;\ntype ScrollAreaOwnProps = GetPropDefTypes<typeof scrollAreaPropDefs>;\ninterface ScrollAreaProps\n extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>,\n ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>,\n ScrollAreaOwnProps,\n WidthProps,\n HeightProps {}\n\n/** Menus and listboxes move focus between their items, so a scroller inside one stays out of the tab order. */\nconst OWNS_FOCUS = '[role=\"menu\"], [role=\"listbox\"]';\n\n/**\n * Puts the viewport in the tab order while it has something to scroll, so a keyboard can reach it\n * and scroll it with the arrow keys. A `tabIndex` the caller set wins.\n */\nfunction useFocusableWhileScrollable(element: HTMLDivElement | null, enabled: boolean) {\n React.useEffect(() => {\n if (!enabled || !element || element.closest(OWNS_FOCUS)) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n const scrollable = element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;\n if (scrollable) element.setAttribute('tabindex', '0');\n else element.removeAttribute('tabindex');\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(update);\n };\n update();\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n return () => {\n if (frame) cancelAnimationFrame(frame);\n // The attribute stays: a caller who now sets `tabIndex` has already written it.\n observer?.disconnect();\n };\n }, [element, enabled]);\n}\n\nconst ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n style,\n type,\n scrollHideDelay = type !== 'scroll' ? 0 : undefined,\n dir,\n radius = scrollAreaPropDefs.radius.default,\n scrollbars = scrollAreaPropDefs.scrollbars.default,\n fade = scrollAreaPropDefs.fade.default,\n ...viewportProps\n } = extractProps(props, widthPropDefs, heightPropDefs);\n const [viewport, setViewport] = React.useState<HTMLDivElement | null>(null);\n const setEdgesElement = useScrollEdges<HTMLDivElement>(fade);\n const setThumbViewport = useThumbSync<HTMLDivElement>();\n const viewportRef = useComposedRefs(forwardedRef, setEdgesElement, setThumbViewport, setViewport);\n useFocusableWhileScrollable(viewport, viewportProps.tabIndex === undefined);\n // A named scroller is a region, so a screen reader can find it and say what it holds.\n const named = viewportProps['aria-label'] !== undefined || viewportProps['aria-labelledby'] !== undefined;\n\n return (\n <ScrollAreaPrimitive.Root\n type={type}\n scrollHideDelay={scrollHideDelay}\n dir={dir}\n className={classNames('kui-ScrollAreaRoot', className)}\n data-fade={fade ? '' : undefined}\n style={style}\n asChild={asChild}\n >\n {getSubtree({ asChild, children }, (children) => (\n <>\n <ScrollAreaPrimitive.Viewport\n role={named ? 'region' : undefined}\n {...viewportProps}\n ref={viewportRef}\n className=\"kui-ScrollAreaViewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n\n <div className=\"kui-ScrollAreaViewportFocusRing\" />\n\n {scrollbars !== 'vertical' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"horizontal\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars !== 'horizontal' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"vertical\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars === 'both' ? (\n <ScrollAreaPrimitive.Corner className=\"kui-ScrollAreaCorner\" />\n ) : null}\n </>\n ))}\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport { ScrollArea };\nexport type { ScrollAreaProps };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst scrollbarsValues = ['vertical', 'horizontal', 'both'] as const;\n\nconst scrollAreaPropDefs = {\n ...asChildPropDef,\n ...radiusPropDef,\n scrollbars: { type: 'enum', values: scrollbarsValues, default: 'both' },\n /**\n * Fades the content toward the top and bottom edges while there is more content past them.\n * An edge with nothing hidden past it does not fade. A floating band over an edge can set\n * `--scroll-fade-start` or `--scroll-fade-end` to its height, so content fades as it passes\n * under the band.\n */\n fade: { type: 'boolean', default: false },\n} satisfies {\n scrollbars: PropDef<(typeof scrollbarsValues)[number]>;\n fade: PropDef<boolean>;\n};\n\nexport { scrollAreaPropDefs };\n", "import * as React from 'react';\n\n/**\n * Publishes how much content is hidden past each edge of a scroller, as\n * `--scroll-overflow-start` and `--scroll-overflow-end` (block axis) and\n * `--scroll-overflow-x-start` and `--scroll-overflow-x-end` (inline axis, from\n * the inline start, so right-to-left reads the same) in px on the element.\n * The scroll fade reads them, so an edge fades only while content is hidden\n * there, and the fade ramps in over the first pixels of scrolling.\n *\n * Writes happen at most once per frame, on scroll and when the element or its\n * content resizes. Nothing re-renders.\n */\nexport function useScrollEdges<T extends HTMLElement>(enabled: boolean) {\n const [element, setElement] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n if (!enabled || !element) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n const start = Math.max(0, element.scrollTop);\n const end = Math.max(0, element.scrollHeight - element.clientHeight - element.scrollTop);\n element.style.setProperty('--scroll-overflow-start', `${start}px`);\n element.style.setProperty('--scroll-overflow-end', `${end}px`);\n // scrollLeft runs negative in right-to-left, so its size is the distance from the inline start.\n const xStart = Math.abs(element.scrollLeft);\n const xEnd = Math.max(0, element.scrollWidth - element.clientWidth - xStart);\n element.style.setProperty('--scroll-overflow-x-start', `${xStart}px`);\n element.style.setProperty('--scroll-overflow-x-end', `${xEnd}px`);\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n write();\n element.addEventListener('scroll', schedule, { passive: true });\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n const mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver(schedule);\n mutations?.observe(element, { childList: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n element.removeEventListener('scroll', schedule);\n observer?.disconnect();\n mutations?.disconnect();\n element.style.removeProperty('--scroll-overflow-start');\n element.style.removeProperty('--scroll-overflow-end');\n element.style.removeProperty('--scroll-overflow-x-start');\n element.style.removeProperty('--scroll-overflow-x-end');\n };\n }, [enabled, element]);\n\n return setElement;\n}\n", "import * as React from 'react';\n\n/**\n * Keeps a Radix ScrollArea's thumbs on the scroll position on every scroll.\n *\n * Radix moves a thumb from a requestAnimationFrame loop it starts on the first scroll event of a\n * burst. Next's production minifier compiles that self-calling loop away, so in a production\n * build the thumb moves once, sits while the content scrolls, and jumps when the next burst\n * starts. This writes the transform Radix would, at most once per frame. Nothing re-renders.\n *\n * Pass the hook's setter as a ref on `ScrollArea.Viewport`; the scrollbars are its siblings.\n */\nexport function useThumbSync<T extends HTMLElement>() {\n const [viewport, setViewport] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n const root = viewport?.parentElement;\n if (!viewport || !root) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n for (const thumb of root.querySelectorAll<HTMLElement>(':scope > .kui-ScrollAreaScrollbar > .kui-ScrollAreaThumb')) {\n const scrollbar = thumb.parentElement as HTMLElement;\n const style = getComputedStyle(scrollbar);\n if (scrollbar.dataset.orientation === 'horizontal') {\n const track = scrollbar.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);\n const offset = thumbOffset(viewport.scrollLeft, viewport.scrollWidth - viewport.offsetWidth, track - thumb.offsetWidth);\n thumb.style.transform = `translate3d(${offset}px, 0, 0)`;\n } else {\n const track = scrollbar.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n const offset = thumbOffset(viewport.scrollTop, viewport.scrollHeight - viewport.offsetHeight, track - thumb.offsetHeight);\n thumb.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n }\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n viewport.addEventListener('scroll', schedule, { passive: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n viewport.removeEventListener('scroll', schedule);\n };\n }, [viewport]);\n\n return setViewport;\n}\n\n/** Radix's mapping: scroll position over its range, onto the room the thumb has to travel. */\nfunction thumbOffset(position: number, range: number, travel: number) {\n if (range <= 0 || travel <= 0) return 0;\n // Right-to-left scrolls run from -range to 0; the thumb then travels from -travel to 0.\n const clamped = Math.min(Math.max(position, -range), range);\n return (clamped / range) * travel;\n}\n", "import * as React from 'react';\n\n/**\n * This is a helper function that is used when a component supports `asChild`\n * using the `Slot` component but its implementation contains nested DOM elements.\n *\n * Using it ensures if a consumer uses the `asChild` prop, the elements are in\n * correct order in the DOM, adopting the intended consumer `children`.\n */\nexport function getSubtree(\n options: { asChild: boolean | undefined; children: React.ReactNode },\n content: React.ReactNode | ((children: React.ReactNode) => React.ReactNode)\n) {\n const { asChild, children } = options;\n if (!asChild) return typeof content === 'function' ? content(children) : content;\n\n const firstChild = React.Children.only(children) as React.ReactElement;\n return React.cloneElement(firstChild, {\n // @ts-expect-error\n children: typeof content === 'function' ? content(firstChild.props.children) : content,\n });\n}\n", "import { asChildPropDef } from '../../props/as-child.prop.js';\nimport { colorPropDef } from '../../props/color.prop.js';\n\nimport type { PropDef } from '../../props/prop-def.js';\n\nconst contentSizes = ['1', '2', '3', '4'] as const;\nconst submenuBehaviors = ['cascade', 'drill-down'] as const;\n\n// Base props shared between Content and SubContent\nconst baseMenuSharedPropDefs = {\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: contentSizes,\n default: '2',\n responsive: true,\n },\n ...colorPropDef,\n} satisfies {\n size: PropDef<(typeof contentSizes)[number]>;\n};\n\n// Content-specific props (includes submenuBehavior)\nconst baseMenuContentPropDefs = {\n ...baseMenuSharedPropDefs,\n /**\n * Controls how submenus behave.\n * - `cascade`: Default cascading behavior where submenus open to the side (portal-based)\n * - `drill-down`: Mobile-friendly behavior where submenus replace the content inline\n * Supports responsive values: `{ initial: 'drill-down', md: 'cascade' }`\n */\n submenuBehavior: {\n type: 'enum',\n values: submenuBehaviors,\n default: 'cascade',\n responsive: true,\n },\n} satisfies {\n size: PropDef<(typeof contentSizes)[number]>;\n submenuBehavior: PropDef<(typeof submenuBehaviors)[number]>;\n};\n\n// SubContent props (no submenuBehavior)\nconst baseMenuSubContentPropDefs = baseMenuSharedPropDefs;\n\nconst baseMenuItemPropDefs = {\n ...asChildPropDef,\n ...colorPropDef,\n shortcut: { type: 'string' },\n} satisfies {\n shortcut: PropDef<string>;\n};\n\nconst baseMenuCheckboxItemPropDefs = {\n ...colorPropDef,\n shortcut: { type: 'string' },\n} satisfies {\n shortcut: PropDef<string>;\n};\n\nconst baseMenuRadioItemPropDefs = {\n ...colorPropDef,\n};\n\nexport {\n baseMenuContentPropDefs,\n baseMenuSubContentPropDefs,\n baseMenuItemPropDefs,\n baseMenuCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs,\n submenuBehaviors,\n};\n", "'use client';\n\nimport * as React from 'react';\n\nimport type { submenuBehaviors } from './base-menu.props.js';\n\ntype SubmenuBehavior = (typeof submenuBehaviors)[number];\n\n/*\n * Drill-down navigation for DropdownMenu.\n *\n * The stack of open submenus lives in a small external store rather than in\n * React state, so each part subscribes only to the slice it renders from:\n * a panel re-renders when it enters or leaves the stack, a Sub when its own\n * open state changes, and nothing else on the path re-renders on navigation.\n *\n * Only the levels on the stack mount their children, and only the top level\n * mounts its items (see `DrillDownLevelContext`). That keeps the Radix item\n * collection limited to what is on screen, so roving focus and typeahead\n * never land on a hidden item.\n */\n\ntype AnimationDirection = 'forward' | 'backward' | null;\ntype Modality = 'keyboard' | 'pointer';\n\ninterface StackEntry {\n id: string;\n /** Accessible name of the submenu, taken from its trigger text */\n name: string;\n /** Scroll position of the parent level when this entry was pushed */\n scrollTop: number;\n}\n\ntype LastChange =\n | { type: 'push'; id: string; modality: Modality | null }\n | { type: 'pop'; id: string; modality: Modality | null; scrollTop: number }\n | { type: 'reset' };\n\ninterface DrillDownState {\n stack: StackEntry[];\n direction: AnimationDirection;\n lastChange: LastChange | null;\n}\n\nconst INITIAL_STATE: DrillDownState = { stack: [], direction: null, lastChange: null };\n\nconst PANEL_ITEM_SELECTOR = '[role^=\"menuitem\"]:not([data-disabled])';\nconst BACK_ITEM_CLASS = 'kui-DropdownMenuDrillDownBackItem';\n\nfunction escapeAttributeValue(value: string) {\n return value.replace(/[\"\\\\]/g, '\\\\$&');\n}\n\nclass DrillDownStore {\n private state = INITIAL_STATE;\n private listeners = new Set<() => void>();\n private modality: Modality = 'keyboard';\n /** The drill-down root element, set by the provider */\n rootElement: HTMLElement | null = null;\n\n setRootElement = (element: HTMLElement | null) => {\n this.rootElement = element;\n };\n\n getState = () => this.state;\n\n subscribe = (listener: () => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n private setState(next: DrillDownState) {\n this.state = next;\n this.listeners.forEach((listener) => listener());\n }\n\n /** Records how the user is interacting, so focus can follow the same model as Radix. */\n setModality = (modality: Modality) => {\n this.modality = modality;\n };\n\n getModality = () => this.modality;\n\n getDepth = () => this.state.stack.length;\n\n isOpen = (id: string) => this.state.stack.some((entry) => entry.id === id);\n\n private getScrollContainer() {\n const root = this.rootElement;\n if (!root) return null;\n return (\n root.closest<HTMLElement>('.kui-ScrollAreaViewport') ??\n root.closest<HTMLElement>('.kui-BaseMenuViewport')\n );\n }\n\n private getTrigger(id: string) {\n return this.rootElement?.querySelector<HTMLElement>(\n `[data-drill-down-trigger=\"${escapeAttributeValue(id)}\"]`,\n );\n }\n\n /**\n * Opens a submenu. `modality` decides where focus goes: the first item for\n * keyboard, the menu for pointer, and nowhere for a programmatic open\n * (`null`) unless focus was lost.\n */\n push = (id: string, modality: Modality | null = this.modality) => {\n const { stack } = this.state;\n if (stack.some((entry) => entry.id === id)) return;\n const trigger = this.getTrigger(id);\n const name = (trigger?.dataset.drillDownName ?? trigger?.textContent ?? '').trim();\n const scrollTop = this.getScrollContainer()?.scrollTop ?? 0;\n this.setState({\n stack: [...stack, { id, name, scrollTop }],\n direction: 'forward',\n lastChange: { type: 'push', id, modality },\n });\n };\n\n pop = (modality: Modality = this.modality) => {\n const { stack } = this.state;\n const top = stack[stack.length - 1];\n if (!top) return;\n this.setState({\n stack: stack.slice(0, -1),\n direction: 'backward',\n lastChange: { type: 'pop', id: top.id, modality, scrollTop: top.scrollTop },\n });\n };\n\n /** Closes a submenu and everything opened from it, without moving focus to its trigger. */\n close = (id: string) => {\n const { stack } = this.state;\n const index = stack.findIndex((entry) => entry.id === id);\n if (index === -1) return;\n this.setState({\n stack: stack.slice(0, index),\n direction: 'backward',\n lastChange: { type: 'pop', id, modality: null, scrollTop: stack[index].scrollTop },\n });\n };\n\n reset = () => {\n if (this.state.stack.length === 0 && this.state.direction === null) return;\n this.setState({ stack: [], direction: null, lastChange: { type: 'reset' } });\n };\n\n /**\n * Moves focus and scroll after a navigation step has been committed. Runs in\n * a layout effect, so the new level is already in the DOM and nothing paints\n * with focus on `<body>` or at the old scroll position.\n */\n applyLastChange() {\n const change = this.state.lastChange;\n const root = this.rootElement;\n if (!change || !root) return;\n this.state = { ...this.state, lastChange: null };\n\n const content = root.closest<HTMLElement>('[role=\"menu\"]');\n const scroller = this.getScrollContainer();\n const focus = (element: HTMLElement | null | undefined) => element?.focus({ preventScroll: true });\n\n if (change.type === 'push') {\n if (scroller) scroller.scrollTop = 0;\n const panel = root.querySelector<HTMLElement>(\n `[data-drill-down-panel=\"${escapeAttributeValue(change.id)}\"]`,\n );\n if (change.modality === 'keyboard') {\n // Land on the first real option; the back row stays one ArrowUp away.\n const items = panel ? Array.from(panel.querySelectorAll<HTMLElement>(PANEL_ITEM_SELECTOR)) : [];\n focus(items.find((item) => !item.classList.contains(BACK_ITEM_CLASS)) ?? items[0] ?? content);\n } else if (change.modality === 'pointer' || !root.contains(document.activeElement)) {\n // Match Radix: pointer users get focus on the menu, not a highlighted item.\n focus(content);\n }\n return;\n }\n\n if (change.type === 'pop') {\n if (scroller) scroller.scrollTop = change.scrollTop;\n const trigger = this.getTrigger(change.id);\n if (change.modality === 'keyboard') {\n focus(trigger ?? content);\n } else if (change.modality === 'pointer' || !root.contains(document.activeElement)) {\n focus(content);\n }\n return;\n }\n\n if (scroller) scroller.scrollTop = 0;\n }\n}\n\nconst DrillDownStoreContext = React.createContext<DrillDownStore | null>(null);\n\n/**\n * Whether the items of the current level are on screen. The root level and\n * every panel provide it; menu parts render nothing when it is false.\n */\nconst DrillDownLevelContext = React.createContext(true);\n\nfunction useDrillDownStore() {\n return React.useContext(DrillDownStoreContext);\n}\n\nfunction useCreateDrillDownStore() {\n const [store] = React.useState(() => new DrillDownStore());\n return store;\n}\n\nconst selectDepth = (state: DrillDownState) => state.stack.length;\nconst selectDirection = (state: DrillDownState) => state.direction;\nconst getServerDepth = () => 0;\nconst getServerDirection = (): AnimationDirection => null;\n\ninterface DrillDownRootProps {\n store: DrillDownStore;\n behavior: SubmenuBehavior;\n /** Open state of the menu; the stack resets every time the menu opens */\n open: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Provides the drill-down store and renders the root level. The wrapper is\n * the same element in both behaviors, so crossing a breakpoint that switches\n * between cascade and drill-down does not remount the items.\n */\nfunction DrillDownRoot({ store, behavior, open, children }: DrillDownRootProps) {\n const isDrillDown = behavior === 'drill-down';\n const depth = React.useSyncExternalStore(\n store.subscribe,\n () => selectDepth(store.getState()),\n getServerDepth,\n );\n const direction = React.useSyncExternalStore(\n store.subscribe,\n () => selectDirection(store.getState()),\n getServerDirection,\n );\n const isRoot = !isDrillDown || depth === 0;\n\n // Cascade mode has no stack. A reset while switching modes keeps the next\n // switch back to drill-down from resuming a stale level.\n React.useLayoutEffect(() => {\n if (!isDrillDown) store.reset();\n }, [isDrillDown, store]);\n\n // Start every opening at the root. Content usually remounts on open anyway;\n // this covers `forceMount`. Resetting on open rather than on close keeps the\n // closing animation on the level the user was looking at.\n const wasOpenRef = React.useRef(open);\n React.useLayoutEffect(() => {\n if (open && !wasOpenRef.current) store.reset();\n wasOpenRef.current = open;\n }, [open, store]);\n\n // Focus and scroll follow each navigation step once it is in the DOM.\n React.useLayoutEffect(() => {\n store.applyLastChange();\n }, [depth, store]);\n\n const rootRef = React.useCallback((element: HTMLDivElement | null) => store.setRootElement(element), [store]);\n const handleKeyDownCapture = React.useCallback(() => store.setModality('keyboard'), [store]);\n const handlePointerDownCapture = React.useCallback(() => store.setModality('pointer'), [store]);\n\n return (\n <DrillDownStoreContext.Provider value={isDrillDown ? store : null}>\n {/* Event capture only records the input modality; it does not handle interaction. */}\n <div\n ref={rootRef}\n className=\"kui-DropdownMenuDrillDownRoot\"\n data-submenu-behavior={behavior}\n data-drill-down-active={isRoot ? undefined : true}\n data-animation-direction={isDrillDown ? (direction ?? undefined) : undefined}\n onKeyDownCapture={isDrillDown ? handleKeyDownCapture : undefined}\n onPointerDownCapture={isDrillDown ? handlePointerDownCapture : undefined}\n >\n <DrillDownLevelContext.Provider value={isRoot}>{children}</DrillDownLevelContext.Provider>\n </div>\n </DrillDownStoreContext.Provider>\n );\n}\n\n/** Where a submenu sits in the stack: not open, open under another level, or on top. */\ntype PanelPosition = 'closed' | 'open' | 'top';\n\nfunction usePanelPosition(store: DrillDownStore | null, id: string): PanelPosition {\n const getSnapshot = React.useCallback((): PanelPosition => {\n if (!store) return 'closed';\n const { stack } = store.getState();\n if (stack.length > 0 && stack[stack.length - 1].id === id) return 'top';\n return stack.some((entry) => entry.id === id) ? 'open' : 'closed';\n }, [store, id]);\n return React.useSyncExternalStore(store?.subscribe ?? noopSubscribe, getSnapshot, getClosed);\n}\n\nfunction useStackEntry(store: DrillDownStore | null, id: string): StackEntry | undefined {\n const getSnapshot = React.useCallback(\n () => store?.getState().stack.find((entry) => entry.id === id),\n [store, id],\n );\n return React.useSyncExternalStore(store?.subscribe ?? noopSubscribe, getSnapshot, getUndefined);\n}\n\nfunction useDrillDownDirection(store: DrillDownStore | null): AnimationDirection {\n const getSnapshot = React.useCallback(() => store?.getState().direction ?? null, [store]);\n return React.useSyncExternalStore(store?.subscribe ?? noopSubscribe, getSnapshot, getServerDirection);\n}\n\nconst noopSubscribe = () => () => {};\nconst getClosed = (): PanelPosition => 'closed';\nconst getUndefined = () => undefined;\n\n// ============================================================================\n// Sub Context (for individual submenu instances)\n// ============================================================================\n\ninterface SubContextValue {\n /** Unique ID for this submenu */\n id: string;\n /** Label for the back button */\n label: React.ReactNode;\n}\n\nconst SubContext = React.createContext<SubContextValue | null>(null);\n\nfunction useSubContext() {\n return React.useContext(SubContext);\n}\n\nexport {\n DrillDownRoot,\n DrillDownLevelContext,\n SubContext,\n useCreateDrillDownStore,\n useDrillDownStore,\n useDrillDownDirection,\n usePanelPosition,\n useStackEntry,\n useSubContext,\n};\n\nexport type { SubmenuBehavior, DrillDownStore, PanelPosition, SubContextValue, AnimationDirection };\n", "import * as React from 'react';\n\n/** A function that throws an error when a value isn't a valid React Element, otherwise returns the value */\nexport const requireReactElement = <T extends React.ReactNode>(children: T): T => {\n const isReactElement = React.isValidElement(children);\n\n if (!isReactElement) {\n throw Error(\n `Expected a single React Element child, but got: ${React.Children.toArray(children)\n .map((child) =>\n typeof child === 'object' && 'type' in child && typeof child.type === 'string'\n ? child.type\n : typeof child\n )\n .join(', ')}`\n );\n }\n\n return children;\n};\n", "'use client';\n\n/**\n * A pane's own chrome: a header row, a scrolling region and a footer row.\n *\n * Shell.Sidebar and Shell.Panel render these as `Shell.PaneHeader`, `Shell.Scroll` and\n * `Shell.PaneFooter`. The pane renders anything; with these parts it is the presentation, so\n * Sidebar's menu parts work inside it with no `Sidebar.Root`. The index comes from the nearest\n * Shell (`Shell.Root size`), or from a deprecated `Sidebar.Root` that still wraps them.\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { ScrollArea } from '../scroll-area.js';\nimport { ShellStoreContext } from './shell-store.js';\n\ntype PaneSize = '1' | '2' | '3';\n\ntype SidebarVisualContextValue = {\n size: PaneSize;\n menuVariant: 'solid' | 'soft';\n presentation?: 'thin' | 'expanded';\n color?: string;\n};\n\n/** Size, menu highlight and presentation for the Sidebar parts. Internal: not exported. */\nconst SidebarVisualContext = React.createContext<SidebarVisualContextValue | null>(null);\n\nfunction useSidebarVisual() {\n return React.useContext(SidebarVisualContext);\n}\n\n/** The Shell's index. `Shell.Root size` sets it; panes hand it to their chrome. */\nconst ShellSizeContext = React.createContext<PaneSize>('2');\n\n/**\n * True inside `Shell.Content`. `Shell.Root` sets it back to false, so a Shell nested in the\n * content gets pane chrome in its own panes. Read by `Shell.Scroll`: in the content it holds a\n * page, not a menu, so it takes none of the menu's padding, gap or layering.\n */\nconst ShellContentContext = React.createContext(false);\n\n/**\n * Gives a Shell pane's children the Shell's index, so Sidebar parts size themselves. In a Rail\n * the rows are `thin`: icon tiles with a small label, sub-menus as dropdowns.\n */\nfunction PaneChromeScope({ children, presentation }: { children: React.ReactNode; presentation?: 'thin' }) {\n const size = React.useContext(ShellSizeContext);\n const value = React.useMemo<SidebarVisualContextValue>(() => ({ size, menuVariant: 'soft', presentation }), [size, presentation]);\n return <SidebarVisualContext.Provider value={value}>{children}</SidebarVisualContext.Provider>;\n}\n\nfunction useChromeClasses() {\n const visual = useSidebarVisual();\n // A pane with no scope (Inspector, Bottom) still takes the Shell's index.\n const shellSize = React.useContext(ShellSizeContext);\n const size = visual?.size ?? shellSize;\n const menuVariant = visual?.menuVariant ?? 'soft';\n return ['kui-ShellPaneChrome', `kui-r-size-${size}`, `kui-menu-variant-${menuVariant}`];\n}\n\ntype BandSize = '1' | '2' | '3' | '4';\n\n/**\n * The index a Toolbar in a pane's header or footer rests at when it states none: one step above\n * the Shell's, so the band reads as chrome over the rows (v2 BAND_STEP). 4 has no step above.\n */\nconst BAND_STEP = { '1': '2', '2': '3', '3': '4', '4': '4' } as const satisfies Record<BandSize, BandSize>;\n\n/**\n * Set by `Shell.PaneHeader` and `Shell.PaneFooter` to their band size, and by `Shell.Scroll` to\n * null (a scrolling list has no band). Unset (`undefined`) everywhere else.\n */\nconst PaneBandSizeContext = React.createContext<BandSize | null | undefined>(undefined);\n\nfunction useBandSize(): BandSize {\n const visual = useSidebarVisual();\n const shellSize = React.useContext(ShellSizeContext);\n return BAND_STEP[visual?.size ?? shellSize];\n}\n\n/**\n * The size a Toolbar with no `size` of its own rests at, or null for none.\n *\n * In a pane's header or footer it is that band's size. Anywhere else inside a Shell, such as\n * `Shell.Content` or a pane's body, it is the same step: one above the Shell's index, so a\n * toolbar in the content area matches the ones in the pane headers beside it (v2 sizes every\n * toolbar this way). A pane's scrolling list, and anything outside a Shell, has none.\n */\nfunction usePaneBandSize(): BandSize | null {\n const band = React.useContext(PaneBandSizeContext);\n const inShell = React.useContext(ShellStoreContext) !== null;\n const step = useBandSize();\n if (band !== undefined) return band;\n return inShell ? step : null;\n}\n\ninterface PaneHeaderProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Floats the row over the top of `Shell.Scroll`, so the list scrolls behind it. The list\n * starts below the row, and `Shell.Scroll fade` fades it out under the row. The row paints\n * nothing and lets clicks through between its controls; a `Toolbar backdrop` in it keeps\n * the controls readable.\n */\n float?: boolean;\n}\n\n/** A pane's header row, pinned above its scrolling region. */\nconst PaneHeader = React.forwardRef<HTMLDivElement, PaneHeaderProps>(({ className, float, children, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n const band = useBandSize();\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-float={float || undefined}\n className={classNames('kui-ShellPaneHeader', 'kui-SidebarHeader', 'kui-SidebarHeader--container', ...chrome, className)}\n >\n <PaneBandSizeContext.Provider value={band}>{children}</PaneBandSizeContext.Provider>\n </div>\n );\n});\nPaneHeader.displayName = 'Shell.PaneHeader';\n\ninterface PaneFooterProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Floats the row over the bottom of `Shell.Scroll`, the way `Shell.PaneHeader float` does at the top. */\n float?: boolean;\n}\n\n/** A pane's footer row, pinned below its scrolling region. */\nconst PaneFooter = React.forwardRef<HTMLDivElement, PaneFooterProps>(({ className, float, children, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n const band = useBandSize();\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-float={float || undefined}\n className={classNames('kui-ShellPaneFooter', 'kui-SidebarFooter', 'kui-SidebarFooter--container', ...chrome, className)}\n >\n <PaneBandSizeContext.Provider value={band}>{children}</PaneBandSizeContext.Provider>\n </div>\n );\n});\nPaneFooter.displayName = 'Shell.PaneFooter';\n\ninterface ScrollProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Fades the list out toward an edge with more past it, and under a floating header or footer. */\n fade?: boolean;\n}\n\n/**\n * The one region of a pane that scrolls; it takes the room the header and footer leave.\n * In `Shell.Content` it is the page's scroller, and a `Shell.PaneHeader float` beside it pins\n * the page's toolbar over it. It is not a landmark: for navigation, pass `role=\"navigation\"` and an `aria-label`.\n */\nconst Scroll = React.forwardRef<HTMLDivElement, ScrollProps>(({ className, children, fade = false, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n // A Sidebar.Root inside the content still gets a menu.\n const contentPane = React.useContext(ShellContentContext);\n const visual = useSidebarVisual();\n const inContent = contentPane && visual === null;\n if (inContent) {\n return (\n <ScrollArea type=\"hover\" fade={fade} className=\"kui-ShellScroll\">\n <div {...props} ref={forwardedRef} className={classNames('kui-ShellScrollContent', className)}>\n {children}\n </div>\n </ScrollArea>\n );\n }\n return (\n <ScrollArea type=\"hover\" fade={fade} className=\"kui-ShellScroll\">\n <div {...props} ref={forwardedRef} className={classNames('kui-BaseMenuContent', 'kui-SidebarContent', ...chrome, className)}>\n {/* A header's band does not reach a Toolbar in the scrolling list. */}\n <PaneBandSizeContext.Provider value={null}>\n <div className=\"kui-BaseMenuViewport\">{children}</div>\n </PaneBandSizeContext.Provider>\n </div>\n </ScrollArea>\n );\n});\nScroll.displayName = 'Shell.Scroll';\n\nexport { SidebarVisualContext, useSidebarVisual, ShellSizeContext, ShellContentContext, PaneChromeScope, PaneHeader, PaneFooter, Scroll, BAND_STEP, usePaneBandSize };\nexport type { SidebarVisualContextValue, PaneSize, BandSize, PaneHeaderProps, PaneFooterProps, ScrollProps };\n", "'use client';\n\n/**\n * The Shell's state model (0.8.0), ported from kookie-ui-v2's Shell.\n *\n * - State lives on the pane. Each pane holds `auto | open | closed`.\n * `auto` means untouched: the stylesheet decides what\n * it shows at each breakpoint, so first paint is right with no script, the\n * server and the client render the same markup, and no open-state callback\n * can fire on mount or on a resize.\n * - The one thing that crosses the Shell is a registry keyed by pane name.\n * Each pane registers what it is and how to drive it; a Trigger looks its\n * pane up, and the Root reads the set of live overlays. Nothing scans\n * children and nothing checks `displayName`.\n * - The responsive props are resolved into a table with one value per\n * breakpoint, from the props alone, with no window. The table is written to\n * the DOM as data attributes for the stylesheet, and read again in JS by the\n * mirror that sets `aria-expanded`. One table, two readers, so they agree by\n * construction.\n */\nimport * as React from 'react';\nimport { SHELL_BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneName, PresentationValue } from '../shell.types.js';\n\n/* \u2500\u2500 Breakpoint tables \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type Table<T> = Record<Breakpoint, T>;\n\n/** What a pane shows: open or closed. */\nexport type PaneValue = 'open' | 'closed';\n\ntype ResponsiveInput<T> = T | Partial<Record<Breakpoint, T>> | undefined;\n\nfunction isMap<T>(value: ResponsiveInput<T>): value is Partial<Record<Breakpoint, T>> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * A responsive value at every breakpoint. A breakpoint takes the largest key\n * at or below it, the same fallback `useResponsiveValue` used; a breakpoint\n * below every key takes `fallback`.\n */\nexport function tableOf<T>(value: ResponsiveInput<T>, fallback: (bp: Breakpoint) => T): Table<T> {\n const table = {} as Table<T>;\n let carried: { value: T } | null = null;\n for (const bp of SHELL_BREAKPOINTS) {\n if (value !== undefined && !isMap(value)) {\n table[bp] = value;\n continue;\n }\n const entry = isMap(value) ? value[bp] : undefined;\n if (entry !== undefined) carried = { value: entry };\n table[bp] = carried ? carried.value : fallback(bp);\n }\n return table;\n}\n\n/** The table's one value, when it has only one. */\nexport function constantOf<T>(table: Table<T>): T | undefined {\n const first = table.initial;\n return SHELL_BREAKPOINTS.every((bp) => table[bp] === first) ? first : undefined;\n}\n\n/**\n * The table as data attributes: `data-<name>` when it holds one value, one\n * `data-<name>-<bp>` per breakpoint when it holds several. The stylesheet has\n * a rule for each spelling.\n */\nexport function tableAttributes(name: string, table: Table<string>): Record<string, string> {\n const constant = constantOf(table);\n if (constant !== undefined) return { [`data-${name}`]: constant };\n const attributes: Record<string, string> = {};\n for (const bp of SHELL_BREAKPOINTS) attributes[`data-${name}-${bp}`] = table[bp];\n return attributes;\n}\n\n/**\n * A responsive prop object is usually an inline literal, a new identity every\n * render. Keying memoisation on its contents keeps the tables, and so the\n * registry entries, stable across renders that change nothing.\n */\nexport function useStableKey(value: unknown): string {\n return typeof value === 'object' && value !== null ? JSON.stringify(value) : String(value);\n}\n\nexport const FIXED_TABLE: Table<PresentationValue> = tableOf<PresentationValue>('fixed', () => 'fixed');\n\n/* \u2500\u2500 The registry \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type OpenChangeReason = 'toggle' | 'dismiss';\n\nexport type PaneEntry = {\n name: PaneName;\n id: string;\n el: HTMLElement | null;\n /** What the pane shows now; `undefined` while an untouched pane cannot know (before the breakpoint is known). */\n value: PaneValue | undefined;\n /** How the pane is presented now, when known. */\n presentation: PresentationValue | undefined;\n /** The pane's own presentation at every breakpoint. A Panel with none of its own follows the Rail's. */\n presentationTable: Table<PresentationValue>;\n /** Open and presented as an overlay: what the scrim and Escape close, and what containment exempts. */\n overlayLive: boolean;\n /** The pane's designed open width, for panes that sit beside it when floating. */\n size: number;\n setValue: (value: PaneValue, reason: OpenChangeReason) => void;\n toggle: (reason: OpenChangeReason) => void;\n};\n\nexport type ShellStore = {\n entries: Map<PaneName, PaneEntry>;\n listeners: Set<() => void>;\n /**\n * What a subscriber reads. useSyncExternalStore needs a value that is stable\n * between notifications, and a number is; the Map, or anything derived from\n * it, would be a new identity on every read.\n */\n version: number;\n /** The pane a hovered Trigger is previewing, if any. Layout only. */\n peek: PaneName | null;\n};\n\nexport function createShellStore(): ShellStore {\n return { entries: new Map(), listeners: new Set(), version: 0, peek: null };\n}\n\nexport function notifyShellStore(store: ShellStore) {\n store.version += 1;\n for (const listener of store.listeners) listener();\n}\n\nexport function subscribeShellStore(store: ShellStore, listener: () => void) {\n store.listeners.add(listener);\n return () => {\n store.listeners.delete(listener);\n };\n}\n\nexport function setShellPeek(store: ShellStore, peek: PaneName | null) {\n if (store.peek === peek) return;\n store.peek = peek;\n notifyShellStore(store);\n}\n\nexport const ShellStoreContext = React.createContext<ShellStore | null>(null);\n\nexport function useShellStore(part: string): ShellStore {\n const store = React.useContext(ShellStoreContext);\n if (!store) throw new Error(`${part} must be used within <Shell.Root>`);\n return store;\n}\n\n/** One pane's registry entry. Re-renders only when that entry is replaced. */\nexport function usePaneEntry(store: ShellStore, name: PaneName): PaneEntry | undefined {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n const getSnapshot = React.useCallback(() => store.entries.get(name), [store, name]);\n return React.useSyncExternalStore(subscribe, getSnapshot, () => undefined);\n}\n\n/**\n * Whether this pane is the one being previewed. A boolean per pane rather than\n * the peek target itself, so hovering one Trigger re-renders one pane, not all.\n */\nexport function usePeeking(store: ShellStore, name: PaneName): boolean {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n return React.useSyncExternalStore(\n subscribe,\n () => store.peek === name,\n () => false,\n );\n}\n\n/* \u2500\u2500 Inset \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type InsetPaneId = 'rail' | 'panel' | 'sidebar' | 'content' | 'inspector' | 'bottom';\n\nexport const ShellInsetContext = React.createContext<{\n registerInset: (id: InsetPaneId) => void;\n unregisterInset: (id: InsetPaneId) => void;\n} | null>(null);\n\n/** Registers a pane's `inset` with the Root, which paints the backdrop while any pane is inset. */\nexport function useInsetRegistration(id: InsetPaneId, inset: boolean | undefined) {\n const ctx = React.useContext(ShellInsetContext);\n if (!ctx) throw new Error('Shell panes must be used within <Shell.Root>');\n const { registerInset, unregisterInset } = ctx;\n React.useLayoutEffect(() => {\n if (!inset) return;\n registerInset(id);\n return () => unregisterInset(id);\n }, [id, inset, registerInset, unregisterInset]);\n}\n\n/* \u2500\u2500 Development warnings \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nconst warned = new Set<string>();\n\n/** A deprecation warning, once per message per page load. Development only. */\nexport function warnOnce(message: string) {\n if (process.env.NODE_ENV === 'production') return;\n if (warned.has(message)) return;\n warned.add(message);\n console.warn(`[kookie-ui] ${message}`);\n}\n"],
5
- "mappings": "suBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,GAAA,SAAAC,GAAA,UAAAC,GAAA,aAAAC,GAAA,SAAAC,GAAA,cAAAC,GAAA,SAAAC,GAAA,UAAAC,GAAA,YAAAC,GAAA,kBAAAR,GAAA,gBAAAC,GAAA,iBAAAC,GAAA,oBAAAC,GAAA,qBAAAE,GAAA,gBAAAC,GAAA,iBAAAC,GAAA,uBAAAE,KAAA,eAAAC,GAAAZ,IAEA,IAAAa,EAAuB,oBACvBC,GAAuB,yBACvBC,GAA4C,oBCF5C,IAAMC,GAAQ,CAAC,IAAK,IAAK,IAAK,GAAG,EAC3BC,GAAe,CAAC,aAAc,UAAU,EAQxCC,GAAsB,CAM1B,KAAM,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQF,GAAO,QAAS,GAAI,EAI3E,YAAa,CAAE,KAAM,OAAQ,OAAQC,GAAc,QAAS,YAAa,CAC3E,ECtBA,IAAAE,GAAuB,oBACvBC,GAAuB,yBCDvB,IAAAC,EAAuB,oBACvBC,GAAuB,yBACvBC,GAAqB,oBACrBC,GAAiD,6BCDjD,IAAMC,EAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECPA,IAAMC,GAAe,CAAC,O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,GAAG,OACH,KAAMsG,GAAWnG,CAAI,EACrB,OAAO,SACP,SAAQ,GACR,GAAI0F,EACJ,MAAOW,EACP,aAAW,GAAAxF,SAAW,mBAAoBT,CAAS,GAElDG,CACH,CAEJ,CACF,EACA6F,GAAa,YAAc,gBAM3B,IAAMI,GAAU,OAAO,OAAO7G,GAAa,CACzC,KAAMA,GACN,MAAOmB,GACP,OAAQS,GACR,UAAW0E,GACX,MAAOG,GACP,SAAUtD,GACV,KAAMgD,GACN,KAAME,EACR,CAAC",
6
- "names": ["toolbar_exports", "__export", "ToolbarButton", "ToolbarFill", "ToolbarGroup", "ToolbarOverflow", "ToolbarRoot", "ToolbarSeparator", "ToolbarSlot", "ToolbarTitle", "Toolbar", "useToolbarOverflow", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "sizes", "orientations", "toolbarRootPropDefs", "React", "import_classnames", "React", "import_classnames", "import_radix_ui", "import_internal", "asChildPropDef", "accentColors", "grayColors", "colorPropDef", "accentColorPropDef", "radii", "radiusPropDef", "sizes", "variants", "baseButtonPropDefs", "asChildPropDef", "accentColorPropDef", "radiusPropDef", "React", "import_classnames", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "i", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "paddingValues", "paddingPropDefs", "heightPropDefs", "widthPropDefs", "overflowValues", "positionValues", "positionEdgeValues", "flexShrinkValues", "flexGrowValues", "alignSelfValues", "justifySelfValues", "layoutPropDefs", "paddingPropDefs", "widthPropDefs", "heightPropDefs", "marginValues", "marginPropDefs", "import_radix_ui", "Root", "SlotPrimitive", "Slot", "Slottable", "gapValues", "gapPropDefs", "as", "displayValues", "directionValues", "alignValues", "justifyValues", "wrapValues", "flexPropDefs", "asChildPropDef", "parseJustifyValue", "gapPropDefs", "value", "Flex", "props", "forwardedRef", "className", "asChild", "Tag", "flexProps", "extractProps", "flexPropDefs", "layoutPropDefs", "marginPropDefs", "Slot", "classNames", "React", "import_classnames", "spinnerPropDefs", "Spinner", "props", "forwardedRef", "className", "children", "loading", "spinnerProps", "extractProps", "spinnerPropDefs", "named", "spinner", "classNames", "Flex", "import_react", "ThickDividerHorizontalIcon", "React", "props", "forwardedRef", "ThickCheckIcon", "ChevronDownIcon", "ThickChevronRightIcon", "ThickChevronLeftIcon", "ThickDotIcon", "CloseIcon", "React", "_props", "_forwardedRef", "PaperclipIcon", "props", "forwardedRef", "FileIcon", "FileTextIcon", "TickIcon", "React", "THEME_SIZE_DEFAULT", "ThemeSizeContext", "clampSize", "size", "values", "n", "nearest", "distance", "i", "d", "useThemeSize", "explicit", "propDef", "themeSize", "useThemeSizeProps", "props", "BaseButton", "ownProps", "forwardedRef", "props", "useThemeSizeProps", "baseButtonPropDefs", "className", "children", "asChild", "as", "color", "radius", "nativeDisabled", "done", "baseButtonProps", "extractProps", "loading", "disabled", "onClick", "ariaDescribedByProp", "handleClick", "event", "childEdges", "content", "items", "flattenFragments", "isIcon", "node", "domEdges", "setDomEdges", "elementRef", "composedRef", "element", "iconStart", "edgeIsSvg", "iconEnd", "prev", "iconOnly", "tick", "TickIcon", "swap", "nodes", "first", "index", "Comp", "shouldPassDisabled", "isNativeButtonElement", "hasExplicitTypeAttribute", "loadingId", "describedById", "accessibilityProps", "classNames", "Flex", "Spinner", "edge", "React", "import_classnames", "import_radix_ui", "React", "import_radix_ui", "emphases", "emphasisPropDef", "leadingTrimValues", "leadingTrimPropDef", "textAlignValues", "textAlignPropDef", "textWrapValues", "textWrapPropDef", "truncatePropDef", "fontFamilies", "fontFamilyPropDef", "weights", "weightPropDef", "as", "sizes", "textPropDefs", "asChildPropDef", "fontFamilyPropDef", "weightPropDef", "textAlignPropDef", "leadingTrimPropDef", "truncatePropDef", "textWrapPropDef", "colorPropDef", "emphasisPropDef", "Text", "props", "forwardedRef", "children", "className", "asChild", "Tag", "color", "textProps", "extractProps", "textPropDefs", "combinedClassName", "React", "import_classnames", "import_radix_ui", "import_internal", "getMatchingGrayColor", "accentColor", "React", "usePropSyncedState", "propValue", "value", "setValue", "previousPropValue", "setPreviousPropValue", "appearances", "fontFamilies", "sizes", "themePropDefs", "asChildPropDef", "accentColors", "grayColors", "radii", "noop", "defaultThemeContext", "themePropDefs", "ThemeContext", "useThemeContext", "Theme", "props", "forwardedRef", "context", "dir", "TooltipPrimitive", "ThemeRoot", "ThemeImpl", "appearanceProp", "accentColorProp", "grayColorProp", "radiusProp", "fontFamilyProp", "headingFontFamilyProp", "sizeProp", "hasBackground", "rootProps", "appearance", "setAppearance", "usePropSyncedState", "accentColor", "setAccentColor", "grayColor", "setGrayColor", "radius", "setRadius", "fontFamily", "setFontFamily", "headingFontFamily", "setHeadingFontFamily", "size", "setSize", "getClientOS", "ua", "asChild", "isRoot", "hasBackgroundProp", "onAppearanceChange", "onAccentColorChange", "onGrayColorChange", "onRadiusChange", "onFontFamilyChange", "onHeadingFontFamilyChange", "onSizeChange", "themeProps", "Comp", "resolvedGrayColor", "getMatchingGrayColor", "isExplicitAppearance", "rootRef", "composedRef", "hasExplicitOS", "node", "os", "ThemeSizeContext", "classNames", "tooltipPropDefs", "widthPropDefs", "Tooltip", "props", "forwardedRef", "children", "className", "open", "defaultOpen", "onOpenChange", "delayDuration", "disableHoverableContent", "content", "container", "forceMount", "tooltipContentProps", "extractProps", "tooltipPropDefs", "rootProps", "TooltipPrimitive", "Theme", "classNames", "Text", "React", "useTooltipWrapper", "tooltip", "tooltipId", "hasTooltip", "accessibilityProps", "EMPHASIS_VARIANT", "validateIconButtonName", "props", "Button", "className", "style", "tooltip", "tooltipSide", "tooltipAlign", "tooltipDelayDuration", "tooltipDisableHoverableContent", "iconOnly", "emphasis", "variant", "forwardedRef", "tooltipId", "hasTooltip", "tooltipAccessibilityProps", "useTooltipWrapper", "resolvedVariant", "button", "BaseButton", "classNames", "Tooltip", "React", "React", "React", "import_classnames", "React", "import_classnames", "import_radix_ui", "sizes", "variants", "kbdPropDefs", "asChildPropDef", "Kbd", "props", "forwardedRef", "asChild", "className", "kbdProps", "extractProps", "kbdPropDefs", "Comp", "classNames", "React", "_BREAKPOINTS", "SHELL_BREAKPOINTS", "QUERIES", "_BREAKPOINTS", "mediaQueryLists", "listeners", "cachedBreakpoint", "getMediaQueryLists", "name", "query", "computeBreakpoint", "matched", "mql", "handleChange", "next", "listener", "subscribe", "getSnapshot", "getServerSnapshot", "getReadySnapshot", "getReadyServerSnapshot", "noopSubscribe", "getInitialSnapshot", "useBreakpoint", "enabled", "breakpoint", "subscribe", "getSnapshot", "getServerSnapshot", "ready", "BREAKPOINTS_DESCENDING", "resolveResponsiveValue", "value", "currentBreakpoint", "defaultValue", "map", "i", "resolved", "useResolvedResponsiveValue", "isResponsive", "breakpoint", "useBreakpoint", "CONTENT_PADDING", "getMenuAlignOffset", "size", "KEY_SYMBOLS", "ariaKeyShortcutsCache", "toAriaKeyShortcuts", "shortcut", "cached", "result", "token", "MenuShortcut", "className", "classNames", "Kbd", "MenuContext", "menuSizeToItemHeight", "getMenuItemHeight", "size", "MenuProvider", "children", "resolvedSize", "useResolvedResponsiveValue", "itemHeight", "value", "MenuCloseContext", "MenuCloseProvider", "import_classnames", "import_radix_ui", "import_internal", "React", "import_classnames", "import_radix_ui", "import_internal", "scrollbarsValues", "scrollAreaPropDefs", "asChildPropDef", "radiusPropDef", "React", "useScrollEdges", "enabled", "element", "setElement", "frame", "write", "start", "end", "xStart", "xEnd", "schedule", "observer", "child", "mutations", "React", "useThumbSync", "viewport", "setViewport", "root", "frame", "write", "thumb", "scrollbar", "style", "track", "offset", "thumbOffset", "schedule", "position", "range", "travel", "React", "getSubtree", "options", "content", "asChild", "children", "firstChild", "OWNS_FOCUS", "useFocusableWhileScrollable", "element", "enabled", "frame", "update", "schedule", "observer", "child", "ScrollArea", "props", "forwardedRef", "asChild", "children", "className", "style", "type", "scrollHideDelay", "dir", "radius", "scrollAreaPropDefs", "scrollbars", "fade", "viewportProps", "extractProps", "widthPropDefs", "heightPropDefs", "viewport", "setViewport", "setEdgesElement", "useScrollEdges", "setThumbViewport", "useThumbSync", "viewportRef", "named", "ScrollAreaPrimitive", "classNames", "getSubtree", "contentSizes", "submenuBehaviors", "baseMenuSharedPropDefs", "colorPropDef", "baseMenuContentPropDefs", "baseMenuSubContentPropDefs", "baseMenuItemPropDefs", "asChildPropDef", "baseMenuCheckboxItemPropDefs", "baseMenuRadioItemPropDefs", "React", "INITIAL_STATE", "PANEL_ITEM_SELECTOR", "BACK_ITEM_CLASS", "escapeAttributeValue", "value", "DrillDownStore", "__publicField", "element", "listener", "modality", "id", "entry", "stack", "trigger", "name", "scrollTop", "top", "index", "next", "root", "change", "content", "scroller", "focus", "panel", "items", "item", "DrillDownStoreContext", "DrillDownLevelContext", "useDrillDownStore", "useCreateDrillDownStore", "store", "selectDepth", "state", "selectDirection", "getServerDepth", "getServerDirection", "DrillDownRoot", "behavior", "open", "children", "isDrillDown", "depth", "direction", "isRoot", "wasOpenRef", "rootRef", "handleKeyDownCapture", "handlePointerDownCapture", "usePanelPosition", "getSnapshot", "noopSubscribe", "getClosed", "useStackEntry", "getUndefined", "useDrillDownDirection", "SubContext", "useSubContext", "React", "requireReactElement", "children", "child", "DropdownMenuOpenContext", "DropdownMenuRoot", "props", "openProp", "defaultOpen", "onOpenChange", "uncontrolledOpen", "setUncontrolledOpen", "open", "handleOpenChangeProp", "handleOpenChange", "next", "close", "MenuCloseProvider", "DropdownMenuPrimitive", "DropdownMenuTrigger", "children", "forwardedRef", "requireReactElement", "DropdownMenuContentContext", "BACK_KEYS", "FORWARD_KEYS", "isTextEntryTarget", "target", "getDirection", "element", "DropdownMenuContent", "ownProps", "useThemeSizeProps", "baseMenuContentPropDefs", "themeContext", "useThemeContext", "size", "className", "color", "container", "forceMount", "submenuBehavior", "virtualized", "onEscapeKeyDown", "onKeyDown", "contentProps", "extractProps", "resolvedColor", "behavior", "useResolvedResponsiveValue", "isDrillDown", "drillDownStore", "useCreateDrillDownStore", "handleEscapeKeyDown", "event", "handleKeyDown", "contextValue", "contentBody", "MenuProvider", "DrillDownRoot", "Theme", "classNames", "ScrollArea", "DropdownMenuLabel", "DrillDownLevelContext", "DropdownMenuItem", "baseMenuItemPropDefs", "shortcut", "itemProps", "toAriaKeyShortcuts", "MenuShortcut", "DropdownMenuGroup", "DropdownMenuRadioGroup", "DropdownMenuRadioItem", "baseMenuRadioItemPropDefs", "ThickDotIcon", "DropdownMenuCheckboxItem", "baseMenuCheckboxItemPropDefs", "ThickCheckIcon", "DropdownMenuSub", "label", "useDrillDownStore", "id", "subContextValue", "isOpenInDrillDown", "usePanelPosition", "defaultOpenRef", "wasOpenRef", "SubContext", "DropdownMenuSubTrigger", "subTriggerProps", "subContext", "useSubContext", "isLevelVisible", "handleSelect", "ThickChevronRightIcon", "DropdownMenuSeparator", "DrillDownBackItem", "name", "labelText", "ariaLabel", "ThickChevronLeftIcon", "omitPopperProps", "_loop", "_onEscapeKeyDown", "_onPointerDownOutside", "_onFocusOutside", "_onInteractOutside", "_sideOffset", "_alignOffset", "_avoidCollisions", "_collisionBoundary", "_collisionPadding", "_arrowPadding", "_sticky", "_hideWhenDetached", "_updatePositionStrategy", "rest", "DropdownMenuSubContent", "DrillDownPanel", "CascadeSubContent", "parent", "_color", "subContentProps", "baseMenuSubContentPropDefs", "scalarSize", "body", "getMenuAlignOffset", "store", "sub", "position", "entry", "useStackEntry", "direction", "useDrillDownDirection", "_container", "_forceMount", "_virtualized", "_size", "panelProps", "isTop", "DropdownMenuTriggerIcon", "ChevronDownIcon", "React", "import_classnames", "React", "isMap", "value", "tableOf", "fallback", "table", "carried", "bp", "SHELL_BREAKPOINTS", "entry", "FIXED_TABLE", "tableOf", "ShellStoreContext", "ShellInsetContext", "SidebarVisualContext", "useSidebarVisual", "ShellSizeContext", "ShellContentContext", "useChromeClasses", "visual", "useSidebarVisual", "shellSize", "ShellSizeContext", "size", "menuVariant", "BAND_STEP", "PaneBandSizeContext", "useBandSize", "usePaneBandSize", "band", "inShell", "ShellStoreContext", "step", "PaneHeader", "className", "float", "children", "props", "forwardedRef", "chrome", "classNames", "PaneFooter", "Scroll", "fade", "contentPane", "ShellContentContext", "ScrollArea", "ToolbarContext", "ToolbarGroupContext", "InOverflowContext", "useToolbarOverflow", "useIsomorphicLayoutEffect", "ToolbarRoot", "props", "forwardedRef", "band", "usePaneBandSize", "size", "useThemeSize", "toolbarRootPropDefs", "orientation", "className", "_orientation", "backdrop", "children", "rootProps", "extractProps", "layoutPropDefs", "context", "ToolbarPrimitive", "classNames", "ToolbarGroup", "disabled", "toolbar", "overflow", "group", "DropdownMenuGroup", "isPressed", "value", "isButtonElement", "ToolbarButton", "iconOnly", "variant", "emphasis", "color", "asChild", "onKeyDown", "rest", "off", "ToolbarOverflowItem", "handleKeyDown", "event", "pressed", "stateProps", "shared", "buttonProps", "Button", "label", "words", "itemProps", "child", "DropdownMenuItem", "MoreIcon", "ToolbarOverflow", "items", "count", "rootRef", "widths", "triggerWidth", "shown", "setShown", "tick", "setTick", "measuredCount", "setMeasuredCount", "root", "kids", "visible", "i", "el", "trigger", "gap", "available", "total", "counted", "width", "next", "budget", "used", "drawn", "own", "observer", "n", "seat", "attach", "node", "item", "DropdownMenuRoot", "DropdownMenuTrigger", "DropdownMenuContent", "EMPTY_ENTRIES", "slotEntries", "slotListeners", "subscribeSlots", "listener", "setSlotEntry", "name", "id", "list", "entry", "removeSlotEntry", "ToolbarSlot", "entries", "ToolbarFill", "ToolbarSeparator", "DropdownMenuSeparator", "TITLE_SIZE", "ToolbarTitle", "style", "themeSize", "Text", "Toolbar"]
3
+ "sources": ["../../../src/components/toolbar.tsx", "../../../src/components/toolbar.props.tsx", "../../../src/components/button.tsx", "../../../src/components/_internal/base-button.tsx", "../../../src/props/as-child.prop.ts", "../../../src/props/color.prop.ts", "../../../src/props/radius.prop.ts", "../../../src/components/_internal/base-button.props.ts", "../../../src/components/flex.tsx", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/props/padding.props.ts", "../../../src/props/height.props.ts", "../../../src/props/width.props.ts", "../../../src/props/layout.props.ts", "../../../src/props/margin.props.ts", "../../../src/components/slot.tsx", "../../../src/props/gap.props.ts", "../../../src/components/flex.props.tsx", "../../../src/components/spinner.tsx", "../../../src/components/spinner.props.tsx", "../../../src/components/icons.tsx", "../../../src/hooks/theme-size.ts", "../../../src/helpers/theme-size.ts", "../../../src/components/tooltip.tsx", "../../../src/components/text.tsx", "../../../src/props/emphasis.prop.ts", "../../../src/props/leading-trim.prop.ts", "../../../src/props/text-align.prop.ts", "../../../src/props/text-wrap.prop.ts", "../../../src/props/truncate.prop.ts", "../../../src/props/font-family.prop.ts", "../../../src/props/weight.prop.ts", "../../../src/components/text.props.tsx", "../../../src/components/theme.tsx", "../../../src/helpers/get-matching-gray-color.ts", "../../../src/hooks/use-prop-synced-state.ts", "../../../src/components/theme.props.tsx", "../../../src/components/tooltip.props.tsx", "../../../src/hooks/use-tooltip-wrapper.ts", "../../../src/components/dropdown-menu.tsx", "../../../src/components/scroll-area.tsx", "../../../src/components/scroll-area.props.tsx", "../../../src/hooks/use-scroll-edges.ts", "../../../src/hooks/use-thumb-sync.ts", "../../../src/helpers/get-subtree.ts", "../../../src/components/_internal/base-menu.props.ts", "../../../src/components/_internal/dropdown-menu-drill-down.tsx", "../../../src/components/_internal/menu-context.tsx", "../../../src/components/_internal/base-menu.utils.tsx", "../../../src/components/kbd.tsx", "../../../src/components/kbd.props.tsx", "../../../src/hooks/use-breakpoint.ts", "../../../src/components/shell.types.ts", "../../../src/helpers/require-react-element.ts", "../../../src/components/_internal/pane-chrome.tsx", "../../../src/components/_internal/shell-store.tsx"],
4
+ "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport classNames from 'classnames';\nimport { Toolbar as ToolbarPrimitive } from 'radix-ui';\n\nimport { toolbarRootPropDefs } from './toolbar.props.js';\nimport { Button } from './button.js';\nimport * as DropdownMenu from './dropdown-menu.js';\nimport { Text } from './text.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSize } from '../hooks/theme-size.js';\nimport { layoutPropDefs } from '../props/layout.props.js';\nimport { usePaneBandSize } from './_internal/pane-chrome.js';\n\nimport type { ButtonProps } from './button.js';\nimport type { LayoutProps } from '../props/layout.props.js';\nimport type { TextProps } from './text.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ButtonRankProps } from './button.js';\n\n/*\n * Toolbar takes Kookie UI v2's contract (v2: components/toolbar), built on Radix instead of\n * Base UI. A toolbar is a row of controls with ONE tab stop: `role=\"toolbar\"`, and the arrow\n * keys move focus between its controls. That keyboard is the reason it is a component.\n *\n * Its `size` reaches every control inside it that does not state its own. The row itself paints\n * nothing; a `ToolbarGroup` draws a quiet well around controls that belong together, and a\n * `ToolbarSeparator` draws a gray hairline between clusters. Use a `Flex` to cluster controls\n * without a well: the row spaces the clusters with `space-between`.\n */\n\ntype ToolbarSize = NonNullable<GetPropDefTypes<typeof toolbarRootPropDefs>['size']>;\ntype ToolbarOrientation = NonNullable<GetPropDefTypes<typeof toolbarRootPropDefs>['orientation']>;\n\ninterface ToolbarContextValue {\n size: ToolbarSize;\n orientation: ToolbarOrientation;\n backdrop: boolean;\n}\n\nconst ToolbarContext = React.createContext<ToolbarContextValue | null>(null);\n\n/** Set by a `ToolbarGroup`: its children rest quiet, and `disabled` turns them all off. */\nconst ToolbarGroupContext = React.createContext<{ disabled: boolean } | null>(null);\n\n/**\n * True while a subtree is drawn into a `ToolbarOverflow`'s menu instead of into the row (v2\n * `InOverflow`). The parts answer it themselves: a `ToolbarButton` renders a menu item, a\n * `ToolbarGroup` a menu group, a `ToolbarSeparator` a menu separator.\n */\nconst InOverflowContext = React.createContext(false);\n\n/**\n * True while this subtree is drawn into a `ToolbarOverflow`'s \"More\" menu instead of the row.\n *\n * The toolbar's own parts handle this already. Use it in your own component inside a\n * `ToolbarOverflow` to render a different form in the menu.\n */\nfunction useToolbarOverflow(): boolean {\n return React.useContext(InOverflowContext);\n}\n\n// ============================================================================\n// Toolbar (root)\n// ============================================================================\n\ntype ToolbarOwnProps = GetPropDefTypes<typeof toolbarRootPropDefs>;\n\ninterface ToolbarProps\n extends ComponentPropsWithout<typeof ToolbarPrimitive.Root, RemovedProps | 'orientation'>,\n ToolbarOwnProps,\n LayoutProps {\n /**\n * Gives every control a surface of its own, for a row that content passes behind, such as\n * `Shell.PaneHeader float`. Buttons rest `raised` instead of `soft`, and a group's well is\n * solid and raised.\n */\n backdrop?: boolean;\n}\n\n/**\n * A row of controls with one keyboard tab stop. The arrow keys move focus between the controls.\n *\n * Give it an `aria-label` (or `aria-labelledby`) that says what the controls act on.\n *\n * @example\n * ```tsx\n * <Toolbar aria-label=\"Formatting\">\n * <ToolbarGroup>\n * <ToolbarButton iconOnly aria-label=\"Bold\" aria-pressed={bold} onClick={toggleBold}>\n * <HugeiconsIcon icon={TextBoldIcon} strokeWidth={1.75} />\n * </ToolbarButton>\n * </ToolbarGroup>\n * <ToolbarSeparator />\n * <ToolbarButton>Share</ToolbarButton>\n * </Toolbar>\n * ```\n */\nconst ToolbarRoot = React.forwardRef<HTMLDivElement, ToolbarProps>((props, forwardedRef) => {\n // Inside a Shell (a pane's header or footer, or the content area), a toolbar with no size\n // rests one step above the Shell's. A pane's scrolling list has no band.\n const band = usePaneBandSize();\n // Elsewhere it takes the nearest Theme's size.\n const size: ToolbarSize = useThemeSize(props.size ?? band ?? undefined, toolbarRootPropDefs.size);\n const orientation: ToolbarOrientation = props.orientation ?? toolbarRootPropDefs.orientation.default;\n const { className, orientation: _orientation, backdrop = false, children, ...rootProps } = extractProps(\n { ...props, size },\n toolbarRootPropDefs,\n layoutPropDefs,\n );\n\n const context = React.useMemo(() => ({ size, orientation, backdrop }), [size, orientation, backdrop]);\n\n return (\n <ToolbarPrimitive.Root\n {...rootProps}\n ref={forwardedRef}\n orientation={orientation}\n data-backdrop={backdrop || undefined}\n className={classNames('kui-Toolbar', className)}\n >\n <ToolbarContext.Provider value={context}>{children}</ToolbarContext.Provider>\n </ToolbarPrimitive.Root>\n );\n});\nToolbarRoot.displayName = 'Toolbar';\n\n// ============================================================================\n// ToolbarGroup\n// ============================================================================\n\ninterface ToolbarGroupProps extends ComponentPropsWithout<'div', RemovedProps> {\n /** Turns every control in the group off at once. */\n disabled?: boolean;\n}\n\n/**\n * Controls that belong together, drawn as one quiet well that stands level with a button\n * beside it. Buttons inside it rest as `ghost` unless they state a `variant`.\n * To cluster controls without a well, use a `Flex`.\n *\n * In a `ToolbarOverflow`'s menu it is a menu group. Outside a `Toolbar` (rendered through a\n * portal, for example) it still draws its well, as a horizontal group.\n */\nconst ToolbarGroup = React.forwardRef<HTMLDivElement, ToolbarGroupProps>(\n ({ className, disabled = false, children, ...props }, forwardedRef) => {\n const toolbar = React.useContext(ToolbarContext);\n const overflow = React.useContext(InOverflowContext);\n const group = React.useMemo(() => ({ disabled }), [disabled]);\n\n if (overflow) {\n return (\n <DropdownMenu.Group {...props} ref={forwardedRef} className={className}>\n <ToolbarGroupContext.Provider value={group}>{children}</ToolbarGroupContext.Provider>\n </DropdownMenu.Group>\n );\n }\n\n return (\n <div\n role=\"group\"\n data-orientation={toolbar?.orientation ?? 'horizontal'}\n data-disabled={disabled || undefined}\n {...props}\n ref={forwardedRef}\n className={classNames('kui-ToolbarGroup', className)}\n >\n <ToolbarGroupContext.Provider value={group}>{children}</ToolbarGroupContext.Provider>\n </div>\n );\n },\n);\nToolbarGroup.displayName = 'Toolbar.Group';\n\n// ============================================================================\n// ToolbarButton\n// ============================================================================\n\ntype ToolbarButtonBaseProps = Omit<ButtonProps, 'as' | 'variant' | 'emphasis'>;\n\n/** A labelled button: takes every `Button` prop. */\ntype ToolbarTextButtonProps = ToolbarButtonBaseProps &\n ButtonRankProps & {\n iconOnly?: false;\n};\n\n/** An icon-only button: renders `Button iconOnly`, and the type requires an `aria-label`. */\ntype ToolbarIconButtonProps = Omit<ToolbarButtonBaseProps, 'aria-label' | 'aria-labelledby' | 'fullWidth'> &\n ButtonRankProps & {\n iconOnly: true;\n /** The control's accessible name. An icon has no words of its own, so this is required. */\n 'aria-label': string;\n};\n\ntype ToolbarButtonProps = ToolbarTextButtonProps | ToolbarIconButtonProps;\n\n/** The plain DOM props, besides handlers, ARIA and data attributes, a menu row takes from a ToolbarButton. */\nconst OVERFLOW_ITEM_KEYS = new Set(['id', 'className', 'style', 'title']);\n\nfunction isPressed(value: React.AriaAttributes['aria-pressed']) {\n return value === true || value === 'true';\n}\n\n/** Does an `asChild` child render a native `<button>`? Only then is it a Radix Toolbar.Button. */\nfunction isButtonElement(children: React.ReactNode) {\n return React.isValidElement(children) && children.type === 'button';\n}\n\n/**\n * A `Button` that joins the toolbar's keyboard navigation, so a row of them is one tab stop.\n *\n * Set `iconOnly` (with an `aria-label`) for a symbol-only control. Set `aria-pressed` for a\n * control that toggles; a pressed button wears Button's pressed look. Set `asChild` to render\n * your own element, such as a link: `<ToolbarButton asChild><a href=\"/docs\">Docs</a></ToolbarButton>`.\n * A link stays in the arrow-key row and gets no `type` attribute.\n *\n * It takes the toolbar's `size`, and rests as a gray `soft` button (`raised` in a toolbar with\n * `backdrop`, gray `ghost` inside a `ToolbarGroup`). A stated `size`, `variant` or `color` wins; a\n * stated `variant` without a `color` takes Button's own default colour.\n *\n * In a `ToolbarOverflow`'s menu it renders a menu item; an icon-only button uses its\n * `aria-label` as the item's text. Outside a `Toolbar` (rendered through a React portal, for\n * example) it renders a plain Button with the same rest look, as its own tab stop. Use\n * `ToolbarSlot` and `ToolbarFill` for a control that should join the row's arrow keys.\n */\nconst ToolbarButton = React.forwardRef<HTMLButtonElement, ToolbarButtonProps>((props, forwardedRef) => {\n const toolbar = React.useContext(ToolbarContext);\n const group = React.useContext(ToolbarGroupContext);\n const overflow = React.useContext(InOverflowContext);\n const { iconOnly, size, variant, emphasis, color, disabled, asChild, onKeyDown, ...rest } = props;\n const off = disabled || group?.disabled || undefined;\n\n if (overflow) {\n // Only what a menu row means comes across: handlers, ARIA, data attributes, id, class and\n // style. Button's box props (size, loading, tooltip, fullWidth and the rest) would land on the\n // DOM as unknown attributes. A wrapping menu trigger hands its open handlers (onPointerDown,\n // onKeyDown), aria-expanded/haspopup/controls and data-state in through these, so it still\n // opens from the row.\n const passed: Record<string, unknown> = {};\n for (const key of Object.keys(rest)) {\n if (/^on[A-Z]/.test(key) || key.startsWith('aria-') || key.startsWith('data-') || OVERFLOW_ITEM_KEYS.has(key)) {\n passed[key] = (rest as Record<string, unknown>)[key];\n }\n }\n if (onKeyDown) passed.onKeyDown = onKeyDown;\n return (\n <ToolbarOverflowItem\n {...(passed as React.ComponentPropsWithoutRef<'div'>)}\n ref={forwardedRef as unknown as React.Ref<HTMLDivElement>}\n asChild={asChild}\n iconOnly={iconOnly}\n disabled={off}\n color={color}\n pressed={props['aria-pressed'] === undefined ? undefined : isPressed(props['aria-pressed'])}\n >\n {rest.children}\n </ToolbarOverflowItem>\n );\n }\n\n // In a vertical toolbar, Up and Down belong to the toolbar. A menu trigger rendering this\n // hands its open-on-arrow handler in through `onKeyDown`; those two keys skip it (v2).\n const handleKeyDown =\n toolbar?.orientation === 'vertical' && onKeyDown\n ? (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') return;\n onKeyDown(event);\n }\n : onKeyDown;\n\n const pressed = isPressed(props['aria-pressed']);\n const stateProps =\n 'data-state' in props || props['aria-pressed'] === undefined ? {} : { 'data-state': pressed ? 'on' : 'off' };\n\n const shared = {\n size: size ?? toolbar?.size,\n // A caller states the look by `variant` or the rank by `emphasis`, never both.\n ...(emphasis !== undefined\n ? { emphasis }\n : { variant: variant ?? (group ? 'ghost' : toolbar?.backdrop ? 'raised' : 'soft') }),\n // The gray rest is a pair with the default variant: a caller who states a variant or an\n // emphasis gets Button's own colour for it unless they state a colour too.\n color: color ?? (variant || emphasis ? undefined : 'gray'),\n ...stateProps,\n } as const;\n\n // The text and icon-only branches share every prop but the name; one Button renders both.\n const buttonProps = {\n ...rest,\n ...(iconOnly ? { iconOnly: true } : {}),\n ...(asChild ? { asChild: true } : {}),\n ...(handleKeyDown ? { onKeyDown: handleKeyDown } : {}),\n ...shared,\n } as ButtonProps;\n\n // Outside a toolbar there is no row to join: a plain Button, not a throw.\n if (!toolbar) {\n return <Button {...buttonProps} ref={forwardedRef} disabled={off} />;\n }\n\n // A link (or any non-button child) joins the row as a Radix Toolbar.Link, which sets no\n // `type`. Toolbar.Button would stamp `type=\"button\"` on it.\n if (asChild && !isButtonElement(rest.children)) {\n return (\n <ToolbarPrimitive.Link asChild ref={forwardedRef as unknown as React.Ref<HTMLAnchorElement>}>\n <Button {...buttonProps} disabled={off} />\n </ToolbarPrimitive.Link>\n );\n }\n\n return (\n <ToolbarPrimitive.Button asChild ref={forwardedRef} disabled={off}>\n <Button {...buttonProps} />\n </ToolbarPrimitive.Button>\n );\n});\nToolbarButton.displayName = 'Toolbar.Button';\n\ninterface ToolbarOverflowItemProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onSelect' | 'color'> {\n asChild?: boolean;\n iconOnly?: boolean;\n disabled?: boolean;\n color?: ButtonProps['color'];\n /** A toggle's pressed state. A toggle becomes a checkbox item, so the menu still says whether it is on. */\n pressed?: boolean;\n}\n\n/**\n * A ToolbarButton drawn into the overflow menu: the same element, as a menu item. An icon-only\n * button's `aria-label` becomes the item's text beside its icon, since a menu row has room for\n * words. What prices a box (size, variant, emphasis, iconOnly) does not come across.\n */\nconst ToolbarOverflowItem = React.forwardRef<HTMLDivElement, ToolbarOverflowItemProps>(\n ({ asChild, iconOnly, disabled, color, pressed, children, 'aria-label': label, ...props }, forwardedRef) => {\n const words = iconOnly ? label : undefined;\n const itemProps = {\n ...props,\n ...(iconOnly ? {} : label ? { 'aria-label': label } : {}),\n disabled,\n ...(color ? { color: color as DropdownMenu.ItemProps['color'] } : {}),\n };\n if (asChild && React.isValidElement<{ children?: React.ReactNode }>(children)) {\n const child = words\n ? React.cloneElement(children, undefined, children.props.children, <span>{words}</span>)\n : children;\n return (\n <DropdownMenu.Item {...itemProps} ref={forwardedRef} asChild>\n {child}\n </DropdownMenu.Item>\n );\n }\n if (pressed !== undefined) {\n return (\n <DropdownMenu.CheckboxItem {...itemProps} ref={forwardedRef} checked={pressed}>\n {children}\n {words}\n </DropdownMenu.CheckboxItem>\n );\n }\n return (\n <DropdownMenu.Item {...itemProps} ref={forwardedRef}>\n {children}\n {words}\n </DropdownMenu.Item>\n );\n },\n);\nToolbarOverflowItem.displayName = 'Toolbar.OverflowItem';\n\n// ============================================================================\n// ToolbarOverflow\n// ============================================================================\n\ninterface ToolbarOverflowProps extends ComponentPropsWithout<'div', RemovedProps> {\n /** The accessible name of the \"More\" button. Defaults to `More`. */\n label?: string;\n /** The controls in the cluster, in order. The ones that don't fit move into the \"More\" menu. */\n children?: React.ReactNode;\n}\n\n/** Three filled dots for the \"More\" button. Internal, so the library carries no icon set. */\nfunction MoreIcon() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentcolor\" aria-hidden xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"3.25\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"8\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"12.75\" cy=\"8\" r=\"1.25\" />\n </svg>\n );\n}\n\n/**\n * A cluster of controls that collapses into a \"More\" menu when the row runs out of room.\n *\n * It takes the room the row leaves, and when its controls don't fit, they move into the menu\n * from the end of the cluster. A `ToolbarButton` shows as a menu item there, and a\n * `ToolbarGroup` as a menu group. Use `useToolbarOverflow()` in your own components to render a\n * different form in the menu.\n *\n * It measures on mount and on resize (v2 ToolbarOverflow): each control's width is cached while\n * it is in the row, since a hidden control has no width to measure.\n */\nconst ToolbarOverflow = React.forwardRef<HTMLDivElement, ToolbarOverflowProps>(\n ({ label = 'More', className, children, ...props }, forwardedRef) => {\n const items = React.Children.toArray(children);\n const count = items.length;\n\n const rootRef = React.useRef<HTMLDivElement | null>(null);\n const widths = React.useRef<number[]>([]);\n const triggerWidth = React.useRef(0);\n const [shown, setShown] = React.useState(count);\n const [tick, setTick] = React.useState(0);\n\n // A different set of children is a different set of widths: show them all and measure again.\n const [measuredCount, setMeasuredCount] = React.useState(count);\n if (measuredCount !== count) {\n setMeasuredCount(count);\n setShown(count);\n }\n useLayoutEffect(() => {\n widths.current = [];\n }, [count]);\n\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n\n // The root's children are one seat per visible child, then the trigger.\n const kids = Array.from(root.children) as HTMLElement[];\n const visible = Math.min(shown, count);\n for (let i = 0; i < visible; i++) {\n const el = kids[i];\n if (el) widths.current[i] = el.offsetWidth;\n }\n const trigger = kids[visible];\n if (trigger) triggerWidth.current = trigger.offsetWidth;\n\n const gap = Number.parseFloat(getComputedStyle(root).columnGap) || 0;\n const available = root.clientWidth;\n\n let total = 0;\n let counted = 0;\n for (let i = 0; i < count; i++) {\n const width = widths.current[i];\n // Never seen in the row, so there is nothing to decide with yet.\n if (width === undefined) return;\n // An empty seat leaves the layout, so it spends no gap.\n if (width === 0) continue;\n total += width + (counted > 0 ? gap : 0);\n counted += 1;\n }\n\n let next = count;\n if (total > available) {\n // Before the trigger exists, the row's height stands in for its width: an icon-only\n // button is square. The next pass, before paint, corrects it.\n const budget = available - (triggerWidth.current || root.clientHeight) - gap;\n let used = 0;\n let drawn = 0;\n next = 0;\n for (let i = 0; i < count; i++) {\n const own = widths.current[i]!;\n if (own > 0) {\n const width = own + (drawn > 0 ? gap : 0);\n if (used + width > budget) break;\n used += width;\n drawn += 1;\n }\n next += 1;\n }\n }\n if (next !== shown) setShown(next);\n }, [shown, count, tick]);\n\n // Watch the row and every seat in it: a control whose content changes (a page's actions\n // arriving after navigation) changes its width without the row's width changing.\n React.useEffect(() => {\n const root = rootRef.current;\n if (!root || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(() => setTick((n) => n + 1));\n observer.observe(root);\n for (const seat of Array.from(root.children)) observer.observe(seat);\n return () => observer.disconnect();\n }, [shown, count]);\n\n const attach = React.useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n\n return (\n <div {...props} ref={attach} className={classNames('kui-ToolbarOverflow', className)}>\n {items.slice(0, shown).map((item, i) => (\n // The seat is a position in the row, so its key is the index.\n <div key={i} className=\"kui-ToolbarOverflowSeat\">\n {item}\n </div>\n ))}\n {shown < count ? (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger>\n <ToolbarButton iconOnly aria-label={label}>\n <MoreIcon />\n </ToolbarButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n <InOverflowContext.Provider value>{items.slice(shown)}</InOverflowContext.Provider>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n ) : null}\n </div>\n );\n },\n);\nToolbarOverflow.displayName = 'Toolbar.Overflow';\n\n// ============================================================================\n// ToolbarSlot and ToolbarFill\n// ============================================================================\n\ntype SlotEntry = { id: string; node: React.ReactNode };\n\nconst EMPTY_ENTRIES: readonly SlotEntry[] = [];\nconst slotEntries = new Map<string, readonly SlotEntry[]>();\nconst slotListeners = new Set<() => void>();\n/** How many ToolbarSlots of each name are mounted, to warn when one Fill would render twice. */\nconst mountedSlots = new Map<string, number>();\n\nfunction subscribeSlots(listener: () => void) {\n slotListeners.add(listener);\n return () => {\n slotListeners.delete(listener);\n };\n}\n\nfunction setSlotEntry(name: string, id: string, node: React.ReactNode) {\n const list = slotEntries.get(name) ?? EMPTY_ENTRIES;\n const index = list.findIndex((entry) => entry.id === id);\n const next = index === -1 ? [...list, { id, node }] : list.map((entry) => (entry.id === id ? { id, node } : entry));\n slotEntries.set(name, next);\n slotListeners.forEach((listener) => listener());\n}\n\nfunction removeSlotEntry(name: string, id: string) {\n const list = slotEntries.get(name);\n if (!list) return;\n const next = list.filter((entry) => entry.id !== id);\n if (next.length === 0) slotEntries.delete(name);\n else slotEntries.set(name, next);\n slotListeners.forEach((listener) => listener());\n}\n\ninterface ToolbarSlotProps {\n /**\n * Which `ToolbarFill` renders here. Defaults to `default`. Names are global to the page: mount one\n * slot per name, or the fill renders in each of them (development builds warn).\n */\n name?: string;\n}\n\n/**\n * A place in a toolbar that content elsewhere in the app fills, such as a page adding its own\n * actions to a header toolbar the layout owns.\n *\n * It renders whatever the `ToolbarFill` with the same `name` holds, as if it were written here:\n * the controls take the toolbar's size and join its arrow-key row. It adds no element.\n */\nfunction ToolbarSlot({ name = 'default' }: ToolbarSlotProps) {\n useLayoutEffect(() => {\n const count = (mountedSlots.get(name) ?? 0) + 1;\n mountedSlots.set(name, count);\n if (count > 1 && process.env.NODE_ENV !== 'production') {\n console.warn(`[kookie-ui] ToolbarSlot: ${count} slots named \"${name}\" are mounted. Each renders the ToolbarFill's controls, so they appear more than once. Give each slot its own name.`);\n }\n return () => {\n const left = (mountedSlots.get(name) ?? 1) - 1;\n if (left > 0) mountedSlots.set(name, left);\n else mountedSlots.delete(name);\n };\n }, [name]);\n const entries = React.useSyncExternalStore(\n subscribeSlots,\n () => slotEntries.get(name) ?? EMPTY_ENTRIES,\n () => EMPTY_ENTRIES,\n );\n return (\n <>\n {entries.map((entry) => (\n <React.Fragment key={entry.id}>{entry.node}</React.Fragment>\n ))}\n </>\n );\n}\nToolbarSlot.displayName = 'Toolbar.Slot';\n\ninterface ToolbarFillProps {\n /** The `ToolbarSlot` to render into. Defaults to `default`. */\n name?: string;\n /** The controls to show in the slot, such as `ToolbarButton`s. */\n children?: React.ReactNode;\n}\n\n/**\n * Sends its children to the `ToolbarSlot` with the same `name`, and renders nothing where it\n * is written. Use it instead of a React portal: a portal keeps the page's React tree, so a\n * ToolbarButton in it can't join the toolbar's arrow keys.\n *\n * The children render inside the toolbar, so they read the toolbar's context, not the page's.\n * They appear after the page mounts on the client, not in server-rendered HTML.\n */\nfunction ToolbarFill({ name = 'default', children }: ToolbarFillProps) {\n const id = React.useId();\n useLayoutEffect(() => {\n setSlotEntry(name, id, children);\n }, [name, id, children]);\n useLayoutEffect(() => () => removeSlotEntry(name, id), [name, id]);\n return null;\n}\nToolbarFill.displayName = 'Toolbar.Fill';\n\n// ============================================================================\n// ToolbarSeparator\n// ============================================================================\n\ntype ToolbarSeparatorProps = ComponentPropsWithout<typeof ToolbarPrimitive.Separator, RemovedProps | 'orientation'>;\n\n/**\n * A gray hairline between two clusters, announced as a separator. Its direction is always\n * opposite to the toolbar's. In a `ToolbarOverflow`'s menu it is a menu separator.\n */\nconst ToolbarSeparator = React.forwardRef<HTMLDivElement, ToolbarSeparatorProps>(\n ({ className, ...props }, forwardedRef) => {\n const toolbar = React.useContext(ToolbarContext);\n const overflow = React.useContext(InOverflowContext);\n if (overflow) return <DropdownMenu.Separator {...props} ref={forwardedRef} className={className} />;\n if (!toolbar) {\n return (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n data-orientation=\"vertical\"\n {...props}\n ref={forwardedRef}\n className={classNames('kui-ToolbarSeparator', className)}\n />\n );\n }\n return (\n <ToolbarPrimitive.Separator\n {...props}\n ref={forwardedRef}\n className={classNames('kui-ToolbarSeparator', className)}\n />\n );\n },\n);\nToolbarSeparator.displayName = 'Toolbar.Separator';\n\n// ============================================================================\n// ToolbarTitle\n// ============================================================================\n\n/** The title's text step: one step above the label of a button at the same size. */\nconst TITLE_SIZE = { '1': '2', '2': '3', '3': '4', '4': '5' } as const satisfies Record<ToolbarSize, TextProps['size']>;\n\ninterface ToolbarTitleProps {\n /** The title text. With none, the title renders nothing. */\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n /** The id of the title, so that the toolbar's `aria-labelledby` can point at it. */\n id?: string;\n}\n\n/**\n * What the row is about, at its leading edge. One line: it truncates rather than wrapping.\n * Its text step follows the toolbar's `size`, and it takes more air from the controls beside it\n * than they take from each other.\n */\nconst ToolbarTitle = React.forwardRef<HTMLSpanElement, ToolbarTitleProps>(\n ({ className, children, style, id }, forwardedRef) => {\n const toolbar = React.useContext(ToolbarContext);\n const themeSize = useThemeSize<ToolbarSize>(undefined, toolbarRootPropDefs.size);\n const size = toolbar?.size ?? themeSize;\n if (children === undefined || children === null || children === false) return null;\n return (\n <Text\n ref={forwardedRef}\n as=\"span\"\n size={TITLE_SIZE[size]}\n weight=\"medium\"\n truncate\n id={id}\n style={style}\n className={classNames('kui-ToolbarTitle', className)}\n >\n {children}\n </Text>\n );\n },\n);\nToolbarTitle.displayName = 'Toolbar.Title';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst Toolbar = Object.assign(ToolbarRoot, {\n Root: ToolbarRoot,\n Group: ToolbarGroup,\n Button: ToolbarButton,\n Separator: ToolbarSeparator,\n Title: ToolbarTitle,\n Overflow: ToolbarOverflow,\n Slot: ToolbarSlot,\n Fill: ToolbarFill,\n});\n\nexport {\n Toolbar,\n ToolbarGroup,\n ToolbarButton,\n ToolbarSeparator,\n ToolbarTitle,\n ToolbarOverflow,\n ToolbarSlot,\n ToolbarFill,\n useToolbarOverflow,\n ToolbarRoot as Root,\n ToolbarGroup as Group,\n ToolbarButton as Button,\n ToolbarSeparator as Separator,\n ToolbarTitle as Title,\n ToolbarOverflow as Overflow,\n ToolbarSlot as Slot,\n ToolbarFill as Fill,\n};\nexport type {\n ToolbarProps,\n ToolbarGroupProps,\n ToolbarButtonProps,\n ToolbarSeparatorProps,\n ToolbarTitleProps,\n ToolbarOverflowProps,\n ToolbarSlotProps,\n ToolbarFillProps,\n ToolbarProps as RootProps,\n ToolbarGroupProps as GroupProps,\n ToolbarButtonProps as ButtonProps,\n ToolbarSeparatorProps as SeparatorProps,\n ToolbarTitleProps as TitleProps,\n ToolbarOverflowProps as OverflowProps,\n ToolbarSlotProps as SlotProps,\n ToolbarFillProps as FillProps,\n};\n", "import type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4'] as const;\nconst orientations = ['horizontal', 'vertical'] as const;\n\n/**\n * Toolbar prop definitions.\n *\n * `size` is one value for the whole row (not responsive): the row hands it to every control\n * inside it that does not state its own, through context, so it has to be a single index.\n */\nconst toolbarRootPropDefs = {\n /**\n * Size step of the row and of every control in it that doesn't set its own `size`.\n * Matches Button's sizes: 1 (28px) to 4 (48px). Unset inside `Shell.PaneHeader` or\n * `Shell.PaneFooter`, it rests one step above the Shell's `size`.\n */\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2' },\n /**\n * Direction of the row and of the arrow keys. Use `vertical` for a strip of tools along an edge.\n */\n orientation: { type: 'enum', values: orientations, default: 'horizontal' },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n orientation: PropDef<(typeof orientations)[number]>;\n};\n\nexport { toolbarRootPropDefs };\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { BaseButton } from './_internal/base-button.js';\nimport { Tooltip } from './tooltip.js';\nimport { useTooltipWrapper } from '../hooks/use-tooltip-wrapper.js';\nimport type { BaseButtonProps } from './_internal/base-button.js';\n\ntype ButtonElement = React.ElementRef<typeof BaseButton>;\n\n/**\n * Tooltip configuration props that can be passed to Button\n * These props are forwarded to the underlying Tooltip component\n */\nexport interface ButtonTooltipProps {\n /** Content to display in the tooltip on hover/focus */\n tooltip?: React.ReactNode;\n /** Side of the button where the tooltip should appear */\n tooltipSide?: 'top' | 'right' | 'bottom' | 'left';\n /** Alignment of the tooltip relative to the button */\n tooltipAlign?: 'start' | 'center' | 'end';\n /** Delay before showing the tooltip (in milliseconds) */\n tooltipDelayDuration?: number;\n /** Whether to disable hoverable content behavior */\n tooltipDisableHoverableContent?: boolean;\n}\n\n/**\n * Core Button props excluding the 'as' prop for polymorphic behavior\n * Combines BaseButton props with tooltip functionality\n */\ntype ButtonEmphasis = 'loud' | 'medium' | 'quiet';\n\n/** `emphasis` is a button's rank: loud is `solid`, medium is `raised`, quiet is `ghost`. */\nconst EMPHASIS_VARIANT = { loud: 'solid', medium: 'raised', quiet: 'ghost' } as const;\n\n/**\n * A button states its rank with `emphasis` or its look with `variant`, never both.\n */\ntype ButtonRankProps =\n | {\n /** The button's look. `outline` and `surface` have no emphasis of their own. */\n variant?: BaseButtonProps['variant'];\n emphasis?: never;\n }\n | {\n /** The button's rank: `loud` (solid, the default), `medium` (raised) or `quiet` (ghost). */\n emphasis?: ButtonEmphasis;\n variant?: never;\n };\n\n/**\n * An icon-only button is square and holds only its icon, so it has no visible text: the type\n * requires `aria-label` or `aria-labelledby`. It never takes the full width.\n */\ntype ButtonIconOnlyProps =\n | {\n /** Makes the button square and shows only the icon in `children`. Requires `aria-label` or `aria-labelledby`. */\n iconOnly: true;\n /** The button's name for screen readers. Required with `iconOnly` unless `aria-labelledby` is set. */\n 'aria-label': string;\n fullWidth?: never;\n }\n | {\n /** Makes the button square and shows only the icon in `children`. Requires `aria-label` or `aria-labelledby`. */\n iconOnly: true;\n /** The id of an element that names this button. Use it instead of `aria-label`. */\n 'aria-labelledby': string;\n fullWidth?: never;\n }\n | { iconOnly?: false };\n\ntype ButtonOwnProps = Omit<BaseButtonProps, 'as' | 'variant'> & ButtonRankProps & ButtonTooltipProps & ButtonIconOnlyProps;\n\n/**\n * Polymorphic Button props that support rendering as different HTML elements\n * @template C - The element type to render as (defaults to 'button')\n */\ntype ButtonProps<C extends React.ElementType = 'button'> = ButtonOwnProps & {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & Omit<React.ComponentPropsWithoutRef<C>, keyof ButtonOwnProps>;\n\n/**\n * Button component type that supports polymorphic rendering\n * @template C - The element type to render as\n */\ntype ButtonComponent = <C extends React.ElementType = 'button'>(props: ButtonProps<C> & { ref?: React.ForwardedRef<ButtonElement> }) => React.ReactElement | null;\n\n/**\n * An icon-only button must have an accessible name. Logs an error, never throws: a name that is\n * still loading (an empty `aria-label` while a translation loads) must not crash the tree.\n */\nfunction validateIconButtonName(props: Record<string, unknown>) {\n if (props['aria-label'] || props['aria-labelledby']) return;\n const errorMessage =\n 'Button: an `iconOnly` button must have an accessible name. Pass `aria-label`, or ' +\n '`aria-labelledby` referencing a label element.';\n console.error(errorMessage);\n}\n\n/**\n * Button component for triggering actions throughout your interface\n *\n * The Button component is the primary interactive element in the Kookie User Interface.\n * It provides six visual variants, four sizes, comprehensive color options, and built-in\n * tooltip support. The component automatically handles icon sizing, supports responsive\n * layouts, and provides accessibility compliance out of the box.\n *\n * @example\n * ```tsx\n * // Basic button\n * <Button>Click me</Button>\n *\n * // Button with variant and size\n * <Button variant=\"solid\" size=\"3\">Primary Action</Button>\n *\n * // Button with tooltip\n * <Button tooltip=\"Save your progress\">Save</Button>\n *\n * // Polymorphic button as link\n * <Button as=\"a\" href=\"/dashboard\">Go to Dashboard</Button>\n *\n * // Square, icon-only button: needs an accessible name\n * <Button iconOnly aria-label=\"Settings\"><Settings /></Button>\n * ```\n */\nconst Button = React.forwardRef(\n (\n {\n className,\n style,\n tooltip,\n tooltipSide = 'top',\n tooltipAlign = 'center',\n tooltipDelayDuration,\n tooltipDisableHoverableContent,\n iconOnly = false,\n emphasis,\n variant,\n ...props\n }: ButtonProps,\n forwardedRef: React.ForwardedRef<ButtonElement>,\n ) => {\n // Use shared tooltip wrapper hook for accessibility props\n const { tooltipId, hasTooltip, accessibilityProps: tooltipAccessibilityProps } = useTooltipWrapper(tooltip);\n\n // An icon-only button is square, so it never takes the full width.\n if (iconOnly) {\n validateIconButtonName(props as Record<string, unknown>);\n (props as { fullWidth?: boolean }).fullWidth = false;\n }\n\n // Both set the same thing. The types forbid it; an untyped spread that sets both logs and\n // `emphasis` wins, rather than crashing the tree.\n if (emphasis !== undefined && variant !== undefined && process.env.NODE_ENV !== 'production') {\n console.error('Button: pass `emphasis` or `variant`, not both. They set the same thing; `emphasis` wins.');\n }\n const resolvedVariant = emphasis !== undefined ? EMPHASIS_VARIANT[emphasis] : variant;\n\n // The tooltip's description joins the caller's aria-describedby rather than replacing it.\n const callerDescribedBy = (props as { 'aria-describedby'?: string })['aria-describedby'];\n const tooltipDescribedBy = (tooltipAccessibilityProps as { 'aria-describedby'?: string })['aria-describedby'];\n const ariaDescribedBy = [callerDescribedBy, tooltipDescribedBy].filter(Boolean).join(' ') || undefined;\n\n const button = (\n <BaseButton\n {...props}\n variant={resolvedVariant}\n aria-describedby={ariaDescribedBy}\n ref={forwardedRef}\n data-icon-only={iconOnly || undefined}\n className={classNames('kui-Button', className)}\n style={style}\n />\n );\n\n // If no tooltip is provided, return the button as-is for better performance\n if (!hasTooltip) {\n return button;\n }\n\n // Wrap with Tooltip when tooltip content is provided\n // This creates a compound component that handles both button and tooltip functionality\n return (\n <Tooltip content={tooltip} side={tooltipSide} align={tooltipAlign} delayDuration={tooltipDelayDuration} disableHoverableContent={tooltipDisableHoverableContent} id={tooltipId}>\n {button}\n </Tooltip>\n );\n },\n) as ButtonComponent & { displayName?: string };\n\nButton.displayName = 'Button';\n\nexport { Button };\nexport type { ButtonProps, ButtonEmphasis, ButtonRankProps, ButtonIconOnlyProps };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\nimport { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';\n\nimport { baseButtonPropDefs } from './base-button.props.js';\nimport { Flex } from '../flex.js';\nimport { Spinner } from '../spinner.js';\nimport { TickIcon } from '../icons.js';\nimport { extractProps } from '../../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../../hooks/theme-size.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../../props/prop-def.js';\n\ntype BaseButtonElement = React.ElementRef<'button'>;\ntype BaseButtonOwnProps = GetPropDefTypes<typeof baseButtonPropDefs>;\n\n/**\n * Polymorphic BaseButton props that support rendering as different HTML elements\n * Uses the proper ComponentPropsWithout pattern for type safety\n * @template C - The element type to render as (defaults to 'button')\n */\ntype PolymorphicBaseButtonProps<C extends React.ElementType = 'button'> = {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & BaseButtonOwnProps &\n BaseButtonDoneProps &\n ComponentPropsWithout<C, RemovedProps | keyof BaseButtonOwnProps | 'as' | 'done'>;\n\ninterface BaseButtonDoneProps {\n /**\n * Shows a tick in place of the icon to say that the action finished. The tick takes the\n * icon's box, so nothing moves, and the icon comes back as soon as `done` is false again. On\n * an `iconOnly` button the tick replaces the content. It doesn't block the press. Screen\n * readers don't announce the tick, so also change the label or `aria-label` (for example,\n * `Copy` to `Copied`).\n */\n done?: boolean;\n}\n\n/**\n * BaseButton props interface that combines all available props\n */\ninterface BaseButtonProps extends PolymorphicBaseButtonProps {}\n\n/**\n * BaseButton component that provides the core button functionality\n *\n * This is the foundational button component that handles all the complex logic\n * including loading states, accessibility, performance optimizations, and\n * polymorphic rendering. It's used by Button and Toggle to ensure consistent behavior across the design system.\n *\n * Key features:\n * - Loading state with spinner and accessibility announcements\n * - Comprehensive accessibility support\n * - Polymorphic rendering support\n *\n * @example\n * ```tsx\n * // Basic usage\n * <BaseButton>Click me</BaseButton>\n *\n * // With loading state\n * <BaseButton loading>Processing...</BaseButton>\n *\n * // Polymorphic rendering\n * <BaseButton as=\"a\" href=\"/link\">Link Button</BaseButton>\n * ```\n */\nconst BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, baseButtonPropDefs.size);\n\n // Extract button-specific props from the combined props object\n const {\n className,\n children,\n asChild,\n as,\n color,\n radius,\n disabled: nativeDisabled,\n done = false,\n ...baseButtonProps\n } = extractProps(props, baseButtonPropDefs);\n\n // Loading blocks activation but keeps the native `disabled` off, so the button keeps focus\n // and its place in the tab order (aria-disabled carries the state). An explicit `disabled`\n // stays native on form controls; on anything else (a link, an asChild child) the `disabled`\n // attribute does nothing, so aria-disabled carries the state and the click is stopped here.\n const loading = Boolean(props.loading);\n const canLoad = props.loading !== undefined;\n const disabled = Boolean(nativeDisabled) || loading;\n const { onClick, 'aria-describedby': ariaDescribedByProp } = baseButtonProps as {\n onClick?: React.MouseEventHandler<HTMLElement>;\n 'aria-describedby'?: string;\n };\n const handleClick = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n },\n [disabled, onClick],\n );\n\n // Which edges start or end with an icon. A bare edge pads wider under a full radius; an edge\n // holding an icon keeps the plain padding (the icon already stands between text and curve).\n // Rendering guesses from the children: an svg element, or a component at either end that is\n // not a known text component (`<Text>`, `<Kbd>`, `<Trans>` and the like), counts as an icon,\n // so the server output is right for icon components such as HugeIcons. After mount the\n // rendered DOM settles it: only an svg is an icon, which corrects a wrong guess.\n const childEdges = React.useMemo(() => {\n const content =\n asChild && React.isValidElement(children) ? (children.props as { children?: React.ReactNode }).children : children;\n // Fragments are see-through: their own first and last children are the edges.\n const items = flattenFragments(content);\n const isIcon = (node: React.ReactNode) =>\n React.isValidElement(node) &&\n (node.type === 'svg' ||\n (typeof node.type !== 'string' && node.type !== React.Fragment && !TEXT_COMPONENTS.has(componentName(node.type))));\n return { iconStart: isIcon(items[0]), iconEnd: isIcon(items[items.length - 1]) };\n }, [asChild, children]);\n const [domEdges, setDomEdges] = React.useState<{ iconStart: boolean; iconEnd: boolean } | null>(null);\n const elementRef = React.useRef<HTMLElement>(null);\n const composedRef = useComposedRefs(forwardedRef, elementRef as React.Ref<BaseButtonElement>);\n useLayoutEffect(() => {\n const element = elementRef.current;\n // While loading the sr-only copy and spinner follow the content, and while done the tick\n // stands at the start; keep the edges read before either.\n if (!element || loading || done) return;\n const contentRoot = element.querySelector(':scope > .kui-BaseButtonContent') ?? element;\n const iconStart = edgeIsSvg(contentRoot, 'start');\n const iconEnd = edgeIsSvg(contentRoot, 'end');\n setDomEdges((prev) => (prev && prev.iconStart === iconStart && prev.iconEnd === iconEnd ? prev : { iconStart, iconEnd }));\n });\n const { iconStart, iconEnd } = domEdges ?? childEdges;\n\n // Done swaps the icon for a tick in the same place: the leading icon when there is one, the\n // whole content on an icon-only button. Without a leading icon the tick goes before the label.\n const iconOnly = Boolean((baseButtonProps as Record<string, unknown>)['data-icon-only']);\n const content = React.useMemo(() => {\n if (!done) return children;\n const tick = <TickIcon key=\"kui-done-tick\" className=\"kui-BaseButtonTick\" aria-hidden />;\n const swap = (nodes: React.ReactNode): React.ReactNode => {\n if (iconOnly) return tick;\n const items = flattenFragments(nodes);\n const first = items.findIndex((node) => !(typeof node === 'string' && !node.trim()));\n if (iconStart && first !== -1) return items.map((node, index) => (index === first ? tick : node));\n return [tick, ...items];\n };\n if (asChild && React.isValidElement(children)) {\n const element = children as React.ReactElement<{ children?: React.ReactNode }>;\n return React.cloneElement(element, undefined, swap(element.props.children));\n }\n return swap(children);\n }, [done, children, iconOnly, iconStart, asChild]);\n\n // asChild takes precedence over as prop for Radix Slot integration\n // When asChild is true, we use Slot.Root to merge props onto the child element\n // When asChild is false, we render as the specified element (or button by default)\n const Comp = asChild ? Slot.Root : (as || 'button');\n\n // Only pass disabled for elements that support it\n // This prevents invalid HTML attributes on unsupported elements. With asChild, the child's own\n // element type decides: a link child gets aria-disabled, not an invalid `disabled`.\n const formElements = ['button', 'input', 'textarea', 'select'];\n const renderedType = asChild ? (React.isValidElement(children) ? children.type : undefined) : (as || 'button');\n const shouldPassDisabled = typeof renderedType === 'string' && formElements.includes(renderedType);\n\n // With asChild, Radix Slot runs the child's own onClick before ours, so a disabled asChild\n // button stops the click in the capture phase, before any bubble handler runs.\n const { onClickCapture } = baseButtonProps as { onClickCapture?: React.MouseEventHandler<HTMLElement> };\n const handleClickCapture = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if (asChild && disabled) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n onClickCapture?.(event);\n },\n [asChild, disabled, onClickCapture],\n );\n\n // Determine if we are rendering a real <button> element so we can set a safe\n // default type. Native <button> defaults to type=\"submit\" which can cause\n // accidental form submissions. We default to type=\"button\" unless the user\n // explicitly provided a type or we're using asChild (unknown underlying node).\n const isNativeButtonElement = !asChild && (!as || as === 'button');\n const hasExplicitTypeAttribute = 'type' in (baseButtonProps as Record<string, unknown>);\n\n // Generate unique ID for loading announcements\n const loadingId = React.useId();\n const describedById = loading ? `${loadingId}-loading` : undefined;\n\n // Loading keeps the caller's name (aria-label, aria-labelledby or the label text) and adds\n // aria-busy plus a description, as v2 does. A disabled element with no native `disabled`\n // announces itself through aria-disabled.\n const accessibilityProps = React.useMemo(() => {\n if (loading) {\n return {\n 'aria-busy': true,\n 'aria-disabled': true,\n 'aria-describedby': [ariaDescribedByProp, describedById].filter(Boolean).join(' '),\n };\n }\n if (nativeDisabled && (!shouldPassDisabled || asChild)) {\n return { 'aria-disabled': true };\n }\n return {};\n }, [loading, describedById, ariaDescribedByProp, nativeDisabled, shouldPassDisabled, asChild]);\n\n /**\n * The inside of the button. A button that takes `loading` (true or false) keeps its content in\n * a `kui-BaseButtonContent` wrapper, so starting or stopping `loading` keeps the children in\n * place (their state survives). A button that never loads skips it, which saves a node per\n * button. `display: contents` keeps the button's flex gap; while loading the wrapper is\n * `visibility: hidden` under the spinner.\n *\n * `display: contents` removes the content from the accessibility tree in some browsers, so\n * while loading the wrapper is `aria-hidden` and a `kui-sr-only` copy carries the name.\n */\n const renderInner = (inner: React.ReactNode, label: React.ReactNode) => {\n if (!canLoad) return inner;\n return (\n <>\n <span className=\"kui-BaseButtonContent\" aria-hidden={loading || undefined}>\n {inner}\n </span>\n {loading ? (\n <>\n {/* The label stays the name; the hidden \"Loading\" only describes (aria-describedby reads hidden text). */}\n <span className=\"kui-sr-only\">\n <span id={describedById} aria-hidden>\n Loading\n </span>\n {label}\n </span>\n\n {/* Centered spinner overlay during loading state */}\n <Flex asChild align=\"center\" justify=\"center\" position=\"absolute\" inset=\"0\">\n <span>\n <Spinner aria-hidden=\"true\" />\n </span>\n </Flex>\n </>\n ) : null}\n </>\n );\n };\n const asChildContent =\n asChild && canLoad && React.isValidElement(content)\n ? React.cloneElement(\n content as React.ReactElement<{ children?: React.ReactNode }>,\n undefined,\n renderInner(\n (content.props as { children?: React.ReactNode }).children,\n React.isValidElement(children) ? (children.props as { children?: React.ReactNode }).children : null,\n ),\n )\n : content;\n\n return (\n <Comp\n data-accent-color={color}\n data-radius={radius}\n data-icon-start={iconStart || undefined}\n data-icon-end={iconEnd || undefined}\n data-done={done || undefined}\n {...baseButtonProps}\n {...accessibilityProps}\n // After the spread: `data-disabled` styles `<Button asChild disabled>`, and a wrapping\n // Radix Toggle (asChild) passes `data-disabled={undefined}` that must not erase it.\n data-disabled={disabled || undefined}\n onClick={handleClick}\n onClickCapture={handleClickCapture}\n ref={composedRef}\n className={classNames('kui-reset', 'kui-BaseButton', className)}\n {...(shouldPassDisabled && { disabled: nativeDisabled })}\n {...(isNativeButtonElement && !hasExplicitTypeAttribute ? { type: 'button' } : {})}\n >\n {asChild ? (\n // asChild: Slot merges onto the single child, so the wrapper, spinner and label copy go\n // inside that child, never beside it.\n asChildContent\n ) : (\n renderInner(content, children)\n )}\n </Comp>\n );\n});\nBaseButton.displayName = 'BaseButton';\n\n/** Components that render text, never an icon, so the render-time guess skips them. */\nconst TEXT_COMPONENTS = new Set(['Text', 'Kbd', 'Code', 'Link', 'Em', 'Strong', 'Quote', 'Badge', 'Trans']);\n\n/** A component's display name, looking through forwardRef and memo. */\nfunction componentName(type: unknown): string {\n if (!type || (typeof type !== 'function' && typeof type !== 'object')) return '';\n const named = type as { displayName?: string; name?: string; render?: unknown; type?: unknown };\n return named.displayName || named.name || componentName(named.render) || componentName(named.type);\n}\n\n/** The child list with fragments opened up: a fragment's own children are the edges. */\nfunction flattenFragments(nodes: React.ReactNode): React.ReactNode[] {\n return React.Children.toArray(nodes).flatMap((node) =>\n React.isValidElement(node) && node.type === React.Fragment\n ? flattenFragments((node.props as { children?: React.ReactNode }).children)\n : [node],\n );\n}\n\n/** Whether the first or last rendered node of `element` (blank text and comments skipped) is an svg. */\nfunction edgeIsSvg(element: Element, edge: 'start' | 'end'): boolean {\n let node = edge === 'start' ? element.firstChild : element.lastChild;\n while (node) {\n const blank =\n node.nodeType === Node.COMMENT_NODE || (node.nodeType === Node.TEXT_NODE && !node.textContent?.trim());\n if (!blank) break;\n node = edge === 'start' ? node.nextSibling : node.previousSibling;\n }\n return node?.nodeType === Node.ELEMENT_NODE && (node as Element).localName === 'svg';\n}\n\nexport { BaseButton };\nexport type { BaseButtonProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import type { PropDef } from './prop-def.js';\n\nconst radii = ['none', 'small', 'medium', 'large', 'full'] as const;\n\nconst radiusPropDef = {\n radius: {\n type: 'enum',\n values: radii,\n default: undefined,\n },\n} satisfies {\n radius: PropDef<(typeof radii)[number]>;\n};\n\nexport { radiusPropDef, radii };\n", "import { asChildPropDef } from '../../props/as-child.prop.js';\nimport { accentColorPropDef } from '../../props/color.prop.js';\nimport { radiusPropDef } from '../../props/radius.prop.js';\n\nimport type { PropDef } from '../../props/prop-def.js';\n\n/**\n * Available button sizes for responsive design\n * Size 1: 28px - Compact for toolbars and dense interfaces\n * Size 2: 32px - Standard for most interface contexts\n * Size 3: 40px - Large for important actions and mobile touch targets\n * Size 4: 48px - Extra large for hero sections and maximum impact\n */\nconst sizes = ['1', '2', '3', '4'] as const;\n\n/**\n * Available button variants for different visual contexts\n * - raised: lifted off its ground, with an edge and a shadow\n * - solid: Primary actions that should be noticed first (the default)\n * - soft: Content-heavy interfaces, natural integration\n * - surface: Elevated appearance with subtle depth\n * - outline: Secondary actions that support primary actions\n * - ghost: Utility functions that don't compete for attention\n */\nconst variants = ['raised', 'solid', 'soft', 'surface', 'outline', 'ghost'] as const;\n\n/**\n * Base button prop definitions that define the component's API\n * \n * These props are used by all button variants (Button and Toggle)\n * to ensure consistent behavior and styling across the design system.\n * \n * Key features:\n * - Responsive sizing with mobile-first approach\n * - Six visual variants for different interface contexts\n * - Comprehensive color system with semantic meanings\n * - Loading states with automatic accessibility\n * - Polymorphic rendering support via asChild\n * \n * @example\n * ```tsx\n * // Basic button with default props\n * <BaseButton>Click me</BaseButton>\n * \n * // Button with custom size and variant\n * <BaseButton size=\"3\" variant=\"solid\">Primary Action</BaseButton>\n * \n * // Button with loading state\n * <BaseButton loading>Processing...</BaseButton>\n * ```\n */\nconst baseButtonPropDefs = {\n ...asChildPropDef,\n /**\n * Button size for responsive design and interface density\n * Supports responsive objects: { initial: '1', sm: '2', md: '3', lg: '4' }\n */\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n /**\n * Visual variant that determines the button's appearance and context\n */\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'solid' },\n ...accentColorPropDef,\n ...radiusPropDef,\n /**\n * Loading state that shows a spinner and disables interaction\n * Automatically sets disabled=true and provides accessibility announcements\n */\n loading: { type: 'boolean', className: 'kui-loading', default: false },\n /**\n * Full width mode that expands the button to fill its container\n * Useful for mobile layouts and form submissions\n */\n fullWidth: { type: 'boolean', className: 'kui-full-width', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n loading: PropDef<boolean>;\n fullWidth: PropDef<boolean>;\n};\n\nexport { baseButtonPropDefs };\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { layoutPropDefs } from '../props/layout.props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { Slot } from './slot.js';\nimport { flexPropDefs } from './flex.props.js';\n\nimport type { FlexOwnProps } from './flex.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { LayoutProps } from '../props/layout.props.js';\nimport type { MarginProps } from '../props/margin.props.js';\n\ntype FlexElement = React.ElementRef<'div'>;\ninterface CommonFlexProps extends MarginProps, LayoutProps, FlexOwnProps {}\ntype FlexDivProps = { as?: 'div' } & ComponentPropsWithout<'div', RemovedProps>;\ntype FlexSpanProps = { as: 'span' } & ComponentPropsWithout<'span', RemovedProps>;\ntype FlexProps = CommonFlexProps & (FlexSpanProps | FlexDivProps);\n\nconst Flex = React.forwardRef<FlexElement, FlexProps>((props, forwardedRef) => {\n const {\n className,\n asChild,\n as: Tag = 'div',\n ...flexProps\n } = extractProps(props, flexPropDefs, layoutPropDefs, marginPropDefs);\n const Comp = asChild ? Slot : Tag;\n return <Comp {...flexProps} ref={forwardedRef} className={classNames('kui-Flex', className)} />;\n});\nFlex.displayName = 'Flex';\n\nexport { Flex };\nexport type { FlexProps };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst paddingValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] as const;\n\nconst paddingPropDefs = {\n /**\n * Sets the CSS **padding** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * p=\"4\"\n * p=\"100px\"\n * p={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding\n */\n p: {\n type: 'enum | string',\n className: 'kui-r-p',\n customProperties: ['--p'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-left** and **padding-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * px=\"4\"\n * px=\"100px\"\n * px={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right\n */\n px: {\n type: 'enum | string',\n className: 'kui-r-px',\n customProperties: ['--pl', '--pr'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-top** and **padding-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * py=\"4\"\n * py=\"100px\"\n * py={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom\n */\n py: {\n type: 'enum | string',\n className: 'kui-r-py',\n customProperties: ['--pt', '--pb'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pt=\"4\"\n * pt=\"100px\"\n * pt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top\n */\n pt: {\n type: 'enum | string',\n className: 'kui-r-pt',\n customProperties: ['--pt'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pr=\"4\"\n * pr=\"100px\"\n * pr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right\n */\n pr: {\n type: 'enum | string',\n className: 'kui-r-pr',\n customProperties: ['--pr'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pb=\"4\"\n * pb=\"100px\"\n * pb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom\n */\n pb: {\n type: 'enum | string',\n className: 'kui-r-pb',\n customProperties: ['--pb'],\n values: paddingValues,\n responsive: true,\n },\n /**\n * Sets the CSS **padding-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * pl=\"4\"\n * pl=\"100px\"\n * pl={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left\n */\n pl: {\n type: 'enum | string',\n className: 'kui-r-pl',\n customProperties: ['--pl'],\n values: paddingValues,\n responsive: true,\n },\n} satisfies {\n p: PropDef<(typeof paddingValues)[number]>;\n px: PropDef<(typeof paddingValues)[number]>;\n py: PropDef<(typeof paddingValues)[number]>;\n pt: PropDef<(typeof paddingValues)[number]>;\n pr: PropDef<(typeof paddingValues)[number]>;\n pb: PropDef<(typeof paddingValues)[number]>;\n pl: PropDef<(typeof paddingValues)[number]>;\n};\n\ntype PaddingProps = GetPropDefTypes<typeof paddingPropDefs>;\n\nexport { paddingPropDefs };\nexport type { PaddingProps };\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst heightPropDefs = {\n /**\n * Sets the CSS **height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * height=\"100px\"\n * height={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/height\n */\n height: {\n type: 'string',\n className: 'kui-r-h',\n customProperties: ['--height'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minHeight=\"100px\"\n * minHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-height\n */\n minHeight: {\n type: 'string',\n className: 'kui-r-min-h',\n customProperties: ['--min-height'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxHeight=\"100px\"\n * maxHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-height\n */\n maxHeight: {\n type: 'string',\n className: 'kui-r-max-h',\n customProperties: ['--max-height'],\n responsive: true,\n },\n} satisfies {\n height: PropDef<string>;\n minHeight: PropDef<string>;\n maxHeight: PropDef<string>;\n};\n\ntype HeightProps = GetPropDefTypes<typeof heightPropDefs>;\n\nexport { heightPropDefs };\nexport type { HeightProps };\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst widthPropDefs = {\n /**\n * Sets the CSS **width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * width=\"100px\"\n * width={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/width\n */\n width: {\n type: 'string',\n className: 'kui-r-w',\n customProperties: ['--width'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minWidth=\"100px\"\n * minWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-width\n */\n minWidth: {\n type: 'string',\n className: 'kui-r-min-w',\n customProperties: ['--min-width'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxWidth=\"100px\"\n * maxWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n */\n maxWidth: {\n type: 'string',\n className: 'kui-r-max-w',\n customProperties: ['--max-width'],\n responsive: true,\n },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n};\n\ntype WidthProps = GetPropDefTypes<typeof widthPropDefs>;\n\nexport { widthPropDefs };\nexport type { WidthProps };\n", "import { paddingPropDefs } from './padding.props.js';\nimport { heightPropDefs } from './height.props.js';\nimport { widthPropDefs } from './width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst overflowValues = ['visible', 'hidden', 'clip', 'scroll', 'auto'] as const;\nconst positionValues = ['static', 'relative', 'absolute', 'fixed', 'sticky'] as const;\n// prettier-ignore\nconst positionEdgeValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9'] as const;\nconst flexShrinkValues = ['0', '1'] as const;\nconst flexGrowValues = ['0', '1'] as const;\nconst alignSelfValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\nconst justifySelfValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\n\nconst layoutPropDefs = {\n ...paddingPropDefs,\n ...widthPropDefs,\n ...heightPropDefs,\n /**\n * Sets the CSS **position** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * position=\"absolute\"\n * position={{ sm: 'absolute', lg: 'sticky' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/position\n */\n position: {\n type: 'enum',\n className: 'kui-r-position',\n values: positionValues,\n responsive: true,\n },\n /**\n * Sets the CSS **inset** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * inset=\"4\"\n * inset=\"100px\"\n * inset={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/inset\n */\n inset: {\n type: 'enum | string',\n className: 'kui-r-inset',\n customProperties: ['--inset'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * top=\"4\"\n * top=\"100px\"\n * top={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/top\n */\n top: {\n type: 'enum | string',\n className: 'kui-r-top',\n customProperties: ['--top'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * right=\"4\"\n * right=\"100px\"\n * right={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/right\n */\n right: {\n type: 'enum | string',\n className: 'kui-r-right',\n customProperties: ['--right'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * bottom=\"4\"\n * bottom=\"100px\"\n * bottom={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/bottom\n */\n bottom: {\n type: 'enum | string',\n className: 'kui-r-bottom',\n customProperties: ['--bottom'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * left=\"4\"\n * left=\"100px\"\n * left={{ sm: '0', lg: '50%' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/left\n */\n left: {\n type: 'enum | string',\n className: 'kui-r-left',\n customProperties: ['--left'],\n values: positionEdgeValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflow=\"hidden\"\n * overflow={{ sm: 'hidden', lg: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflow: {\n type: 'enum',\n className: 'kui-r-overflow',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow-x** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflowX=\"hidden\"\n * overflowX={{ sm: 'hidden', md: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflowX: {\n type: 'enum',\n className: 'kui-r-ox',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **overflow-y** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * overflowY=\"hidden\"\n * overflowY={{ sm: 'hidden', md: 'visible' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow\n */\n overflowY: {\n type: 'enum',\n className: 'kui-r-oy',\n values: overflowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-basis** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexBasis=\"0\"\n * flexBasis=\"100%\"\n * flexBasis={{ sm: '200px', lg: 'auto' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis\n */\n flexBasis: {\n type: 'string',\n className: 'kui-r-fb',\n customProperties: ['--flex-basis'],\n responsive: true,\n },\n /**\n * Sets the CSS **flex-shrink** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexShrink=\"0\"\n * flexShrink=\"1\"\n * flexShrink={{ sm: '0', lg: '1' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink\n */\n flexShrink: {\n type: 'enum | string',\n className: 'kui-r-fs',\n customProperties: ['--flex-shrink'],\n values: flexShrinkValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-grow** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * flexGrow=\"0\"\n * flexGrow=\"1\"\n * flexGrow={{ sm: '0', lg: '1' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow\n */\n flexGrow: {\n type: 'enum | string',\n className: 'kui-r-fg',\n customProperties: ['--flex-grow'],\n values: flexGrowValues,\n responsive: true,\n },\n /**\n * Sets the CSS **grid-area** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridArea=\"header\"\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area\n */\n gridArea: {\n type: 'string',\n className: 'kui-r-ga',\n customProperties: ['--grid-area'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumn=\"1\"\n * gridColumn=\"1 / -1\"\n * gridColumn={{ sm: '1 / 3', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column\n */\n gridColumn: {\n type: 'string',\n className: 'kui-r-gc',\n customProperties: ['--grid-column'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column-start** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumnStart=\"1\"\n * gridColumnStart=\"auto\"\n * gridColumnStart={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start\n */\n gridColumnStart: {\n type: 'string',\n className: 'kui-r-gcs',\n customProperties: ['--grid-column-start'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-column-end** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridColumnEnd=\"1\"\n * gridColumnEnd=\"auto\"\n * gridColumnEnd={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end\n */\n gridColumnEnd: {\n type: 'string',\n className: 'kui-r-gce',\n customProperties: ['--grid-column-end'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRow=\"1\"\n * gridRow=\"auto\"\n * gridRow={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row\n */\n gridRow: {\n type: 'string',\n className: 'kui-r-gr',\n customProperties: ['--grid-row'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row-start** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRowStart=\"1\"\n * gridRowStart=\"auto\"\n * gridRowStart={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start\n */\n gridRowStart: {\n type: 'string',\n className: 'kui-r-grs',\n customProperties: ['--grid-row-start'],\n responsive: true,\n },\n /**\n * Sets the CSS **grid-row-end** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * gridRowEnd=\"1\"\n * gridRowEnd=\"auto\"\n * gridRowEnd={{ sm: '2', lg: 'span 3' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end\n */\n gridRowEnd: {\n type: 'string',\n className: 'kui-r-gre',\n customProperties: ['--grid-row-end'],\n responsive: true,\n },\n /**\n * Sets the CSS **align-self** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * alignSelf=\"center\"\n * alignSelf={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/align-self\n */\n alignSelf: {\n type: 'enum',\n className: 'kui-r-as',\n values: alignSelfValues,\n responsive: true,\n },\n /**\n * Sets the CSS **justify-self** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * justifySelf=\"center\"\n * justifySelf={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self\n */\n justifySelf: {\n type: 'enum',\n className: 'kui-r-js',\n values: justifySelfValues,\n responsive: true,\n },\n} satisfies {\n position: PropDef<(typeof positionValues)[number]>;\n inset: PropDef<(typeof positionEdgeValues)[number]>;\n top: PropDef<(typeof positionEdgeValues)[number]>;\n right: PropDef<(typeof positionEdgeValues)[number]>;\n bottom: PropDef<(typeof positionEdgeValues)[number]>;\n left: PropDef<(typeof positionEdgeValues)[number]>;\n overflow: PropDef<(typeof overflowValues)[number]>;\n overflowX: PropDef<(typeof overflowValues)[number]>;\n overflowY: PropDef<(typeof overflowValues)[number]>;\n flexBasis: PropDef<string>;\n flexShrink: PropDef<(typeof flexShrinkValues)[number]>;\n flexGrow: PropDef<(typeof flexGrowValues)[number]>;\n gridColumn: PropDef<string>;\n gridColumnStart: PropDef<string>;\n gridColumnEnd: PropDef<string>;\n gridRow: PropDef<string>;\n gridRowStart: PropDef<string>;\n gridRowEnd: PropDef<string>;\n gridArea: PropDef<string>;\n alignSelf: PropDef<(typeof alignSelfValues)[number]>;\n justifySelf: PropDef<(typeof justifySelfValues)[number]>;\n};\n\n// Use all of the imported prop defs to ensure that JSDoc works\ntype LayoutProps = GetPropDefTypes<\n typeof paddingPropDefs & typeof widthPropDefs & typeof heightPropDefs & typeof layoutPropDefs\n>;\n\nexport { layoutPropDefs };\nexport type { LayoutProps };\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\n// prettier-ignore\nconst marginValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10', '-11', '-12', 'bleed'] as const;\n\nconst marginPropDefs = {\n /**\n * Sets the CSS **margin** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * m=\"4\"\n * m=\"100px\"\n * m={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n */\n m: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-m',\n customProperties: ['--m'],\n },\n /**\n * Sets the CSS **margin-left** and **margin-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mx=\"4\"\n * mx=\"100px\"\n * mx={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mx: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mx',\n customProperties: ['--ml', '--mr'],\n },\n /**\n * Sets the CSS **margin-top** and **margin-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * my=\"4\"\n * my=\"100px\"\n * my={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n my: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-my',\n customProperties: ['--mt', '--mb'],\n },\n /**\n * Sets the CSS **margin-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mt=\"4\"\n * mt=\"100px\"\n * mt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n */\n mt: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mt',\n customProperties: ['--mt'],\n },\n /**\n * Sets the CSS **margin-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mr=\"4\"\n * mr=\"100px\"\n * mr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mr: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mr',\n customProperties: ['--mr'],\n },\n /**\n * Sets the CSS **margin-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mb=\"4\"\n * mb=\"100px\"\n * mb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n mb: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-mb',\n customProperties: ['--mb'],\n },\n /**\n * Sets the CSS **margin-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * ml=\"4\"\n * ml=\"100px\"\n * ml={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n */\n ml: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'kui-r-ml',\n customProperties: ['--ml'],\n },\n} satisfies {\n m: PropDef<(typeof marginValues)[number]>;\n mx: PropDef<(typeof marginValues)[number]>;\n my: PropDef<(typeof marginValues)[number]>;\n mt: PropDef<(typeof marginValues)[number]>;\n mr: PropDef<(typeof marginValues)[number]>;\n mb: PropDef<(typeof marginValues)[number]>;\n ml: PropDef<(typeof marginValues)[number]>;\n};\n\ntype MarginProps = GetPropDefTypes<typeof marginPropDefs>;\n\nexport { marginPropDefs };\nexport type { MarginProps };\n", "import { Slot as SlotPrimitive } from 'radix-ui';\nexport const Root = SlotPrimitive.Root;\nexport const Slot = SlotPrimitive.Root;\nexport const Slottable: typeof SlotPrimitive.Slottable = SlotPrimitive.Slottable;\n", "import type { PropDef } from './prop-def.js';\n\nconst gapValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] as const;\n\nconst gapPropDefs = {\n /**\n * Sets the CSS **gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gap=\"4\"\n * gap=\"20px\"\n * gap={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/gap\n */\n gap: {\n type: 'enum | string',\n className: 'kui-r-gap',\n customProperties: ['--gap'],\n values: gapValues,\n responsive: true,\n },\n /**\n * Sets the CSS **column-gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gapX=\"4\"\n * gapX=\"20px\"\n * gapX={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap\n */\n gapX: {\n type: 'enum | string',\n className: 'kui-r-cg',\n customProperties: ['--column-gap'],\n values: gapValues,\n responsive: true,\n },\n /**\n * Sets the CSS **row-gap** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * gapY=\"4\"\n * gapY=\"20px\"\n * gapY={{ sm: '2', lg: '3em' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap\n */\n gapY: {\n type: 'enum | string',\n className: 'kui-r-rg',\n customProperties: ['--row-gap'],\n values: gapValues,\n responsive: true,\n },\n} satisfies {\n gap: PropDef<(typeof gapValues)[number]>;\n gapX: PropDef<(typeof gapValues)[number]>;\n gapY: PropDef<(typeof gapValues)[number]>;\n};\n\nexport { gapPropDefs };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { gapPropDefs } from '../props/gap.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst as = ['div', 'span'] as const;\nconst displayValues = ['none', 'inline-flex', 'flex'] as const;\nconst directionValues = ['row', 'column', 'row-reverse', 'column-reverse'] as const;\nconst alignValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\nconst justifyValues = ['start', 'center', 'end', 'between'] as const;\nconst wrapValues = ['nowrap', 'wrap', 'wrap-reverse'] as const;\n\nconst flexPropDefs = {\n /**\n * Controls whether to render **div** or **span**\n *\n * @example\n * as=\"div\"\n * as=\"span\"\n */\n as: { type: 'enum', values: as, default: 'div' },\n ...asChildPropDef,\n /**\n * Sets the CSS **display** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * display=\"inline-flex\"\n * display={{ sm: 'none', lg: 'flex' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/display\n */\n display: {\n type: 'enum',\n className: 'kui-r-display',\n values: displayValues,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-direction** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * direction=\"column\"\n * direction={{ sm: 'column', lg: 'row' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction\n */\n direction: {\n type: 'enum',\n className: 'kui-r-fd',\n values: directionValues,\n responsive: true,\n },\n /**\n * Sets the CSS **align-items** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * align=\"center\"\n * align={{ sm: 'baseline', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/align-items\n */\n align: {\n type: 'enum',\n className: 'kui-r-ai',\n values: alignValues,\n responsive: true,\n },\n /**\n * Sets the CSS **justify-content** property.\n * Supports a subset of the corresponding CSS values and responsive objects.\n *\n * @example\n * justify=\"between\"\n * justify={{ sm: 'start', lg: 'center' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content\n */\n justify: {\n type: 'enum',\n className: 'kui-r-jc',\n values: justifyValues,\n parseValue: parseJustifyValue,\n responsive: true,\n },\n /**\n * Sets the CSS **flex-wrap** property.\n * Supports the corresponding CSS values and responsive objects.\n *\n * @example\n * wrap=\"wrap\"\n * wrap={{ sm: 'wrap', lg: 'nowrap' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap\n */\n wrap: {\n type: 'enum',\n className: 'kui-r-fw',\n values: wrapValues,\n responsive: true,\n },\n ...gapPropDefs,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n display: PropDef<(typeof displayValues)[number]>;\n direction: PropDef<(typeof directionValues)[number]>;\n align: PropDef<(typeof alignValues)[number]>;\n justify: PropDef<(typeof justifyValues)[number]>;\n wrap: PropDef<(typeof wrapValues)[number]>;\n};\n\nfunction parseJustifyValue(value: string) {\n return value === 'between' ? 'space-between' : value;\n}\n\n// Use all of the imported prop defs to ensure that JSDoc works\ntype FlexOwnProps = GetPropDefTypes<\n typeof flexPropDefs & typeof gapPropDefs & typeof asChildPropDef\n>;\n\nexport { flexPropDefs };\nexport type { FlexOwnProps };\n", "import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Flex } from './flex.js';\nimport { spinnerPropDefs } from './spinner.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype SpinnerElement = React.ElementRef<'span'>;\ntype SpinnerOwnProps = GetPropDefTypes<typeof spinnerPropDefs>;\ninterface SpinnerProps\n extends ComponentPropsWithout<'span', RemovedProps>,\n SpinnerOwnProps {}\nconst Spinner = React.forwardRef<SpinnerElement, SpinnerProps>((props, forwardedRef) => {\n const { className, children, loading, ...spinnerProps } = extractProps(\n props,\n spinnerPropDefs\n );\n\n if (!loading) return children;\n\n // Decorative unless named: a named spinner is a status message, an unnamed one is hidden.\n const named =\n spinnerProps['aria-label'] !== undefined || spinnerProps['aria-labelledby'] !== undefined;\n\n const spinner = (\n <span\n role={named ? 'status' : undefined}\n aria-hidden={named ? undefined : true}\n {...spinnerProps}\n ref={forwardedRef} className={classNames('kui-Spinner', className)}>\n <span className=\"kui-SpinnerWheel\">\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n <span className=\"kui-SpinnerLeaf\" />\n </span>\n {/* A live region reads its text, not its aria-label, so the name is also its content. */}\n {typeof spinnerProps['aria-label'] === 'string' ? (\n <span className=\"kui-sr-only\">{spinnerProps['aria-label']}</span>\n ) : null}\n </span>\n );\n\n if (children === undefined) return spinner;\n\n return (\n <Flex asChild position=\"relative\" align=\"center\" justify=\"center\">\n <span aria-busy=\"true\">\n {/**\n * `display: contents` removes the content from the accessibility tree in some browsers,\n * so we force remove it with `aria-hidden`\n */}\n <span aria-hidden className=\"kui-SpinnerHiddenChildren\">\n {children}\n </span>\n\n <Flex asChild align=\"center\" justify=\"center\" position=\"absolute\" inset=\"0\">\n <span>{spinner}</span>\n </Flex>\n </span>\n </Flex>\n );\n});\nSpinner.displayName = 'Spinner';\n\nexport { Spinner };\nexport type { SpinnerProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\nconst spinnerPropDefs = {\n loading: { type: 'boolean', default: true },\n} satisfies {\n loading: PropDef<boolean>;\n};\n\nexport { spinnerPropDefs };\n", "import React from 'react';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype IconElement = React.ElementRef<'svg'>;\ninterface IconProps extends ComponentPropsWithout<'svg', RemovedProps | 'children'> {}\n\nconst ThickDividerHorizontalIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z\"\n />\n </svg>\n );\n});\n\nThickDividerHorizontalIcon.displayName = 'ThickDividerHorizontalIcon';\n\nconst ThickCheckIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z\"\n />\n </svg>\n );\n});\nThickCheckIcon.displayName = 'ThickCheckIcon';\n\nconst ChevronDownIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path d=\"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z\" />\n </svg>\n );\n});\nChevronDownIcon.displayName = 'ChevronDownIcon';\n\nconst ThickChevronRightIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronRightIcon.displayName = 'ThickChevronRightIcon';\n\nconst ThickChevronLeftIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronLeftIcon.displayName = 'ThickChevronLeftIcon';\n\nconst ThickDotIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <circle cx=\"4.5\" cy=\"4.5\" r=\"2\" />\n </svg>\n );\n});\nThickDotIcon.displayName = 'ThickDotIcon';\n\nexport { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDividerHorizontalIcon, ThickDotIcon };\nexport type { IconProps };\n\n// Additional minimal icons\nconst CloseIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg\n {..._props}\n ref={_forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n});\nCloseIcon.displayName = 'CloseIcon';\n\nconst PaperclipIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n {...props}\n ref={forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n});\nPaperclipIcon.displayName = 'PaperclipIcon';\n\nconst FileIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n </svg>\n );\n});\nFileIcon.displayName = 'FileIcon';\n\nconst FileTextIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n});\nFileTextIcon.displayName = 'FileTextIcon';\n\n/** The tick a button shows in place of its icon while `done`. Drawn on the 24 grid at the icon set's stroke. */\nconst TickIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path d=\"M5 12.75L9.5 17.25L19 7.25\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n});\nTickIcon.displayName = 'TickIcon';\n\nexport { CloseIcon, PaperclipIcon, FileIcon, FileTextIcon, TickIcon };\n", "'use client';\n\nimport * as React from 'react';\n\nimport { THEME_SIZE_DEFAULT, clampSize } from '../helpers/theme-size.js';\nimport type { ThemeSize } from '../helpers/theme-size.js';\n\n/**\n * The app-wide size index, provided by `Theme` beside `ThemeContext`.\n *\n * It is its own context, holding one string, so a component that only needs\n * the size does not re-render when the accent colour or appearance changes.\n */\nconst ThemeSizeContext = React.createContext<ThemeSize>(THEME_SIZE_DEFAULT);\nThemeSizeContext.displayName = 'ThemeSizeContext';\n\ninterface SizePropDef {\n values: readonly string[];\n default?: string;\n}\n\n/**\n * The size a component on the 1-4 index takes: what the caller said, else the\n * nearest Theme's size, mapped into the component's range.\n */\nfunction useThemeSize<V>(explicit: V | undefined, propDef: SizePropDef): V {\n const themeSize = React.useContext(ThemeSizeContext);\n if (explicit !== undefined) return explicit;\n // The clamped value is one of `propDef.values`, which is what `V` ranges over.\n return clampSize(themeSize, propDef.values) as V;\n}\n\n/**\n * Fills `size` from the nearest Theme when the caller left it unset, so the\n * result can go straight into `extractProps`. An explicit size, responsive\n * object included, wins.\n *\n * Returns the same props object when there is nothing to fill: when a size is\n * set, or when the theme size resolves to the prop def's own default (the\n * common case, a Theme with no size), so `extractProps` applies it as before.\n */\nfunction useThemeSizeProps<P extends { size?: unknown }>(props: P, propDef: SizePropDef): P {\n const themeSize = React.useContext(ThemeSizeContext);\n if (props.size !== undefined) return props;\n const size = clampSize(themeSize, propDef.values);\n if (size === propDef.default) return props;\n return { ...props, size };\n}\n\nexport { ThemeSizeContext, useThemeSize, useThemeSizeProps };\n", "/**\n * The pure half of the theme size: the type, the default and the clamp. Server-safe.\n *\n * The context and the hooks that read it live in `hooks/theme-size.ts`, a client module, so there\n * is one `ThemeSizeContext` and importing `/helpers` from a server component does not call\n * `createContext`.\n */\n\ntype ThemeSize = '1' | '2' | '3' | '4';\n\n/** The rest of the 1-4 index when no Theme states a size. */\nconst THEME_SIZE_DEFAULT: ThemeSize = '2';\n\n/**\n * Maps the theme size onto a component's own range: the value itself when the\n * component has it, otherwise the nearest end of the range (`4` on a 1-3 scale\n * is `3`, on a 1-2 scale it is `2`).\n */\nfunction clampSize(size: ThemeSize, values: readonly string[]): string {\n if (values.includes(size)) return size;\n const n = Number(size);\n let nearest = values[0];\n let distance = Infinity;\n for (let i = 0; i < values.length; i++) {\n const d = Math.abs(Number(values[i]) - n);\n if (d < distance) {\n distance = d;\n nearest = values[i];\n }\n }\n return nearest;\n}\n\nexport { THEME_SIZE_DEFAULT, clampSize };\nexport type { ThemeSize };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\n\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { tooltipPropDefs } from './tooltip.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\n/** The rest before a tooltip opens, in milliseconds. */\nconst TOOLTIP_DELAY = 200;\n\n/** True inside a `TooltipProvider`, so a Tooltip knows it need not bring its own. */\nconst TooltipProviderContext = React.createContext(false);\n\ninterface TooltipProviderProps extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider> {}\n\n/**\n * Groups the tooltips inside it: the first one waits `delayDuration` (200ms), and the next ones\n * open at once while the pointer moves between them. Put it once near the root of the app.\n * A Tooltip outside one still works, with the same delay, but each one waits on its own.\n */\nfunction TooltipProvider({ delayDuration = TOOLTIP_DELAY, children, ...props }: TooltipProviderProps) {\n return (\n <TooltipProviderContext.Provider value={true}>\n <TooltipPrimitive.Provider delayDuration={delayDuration} {...props}>\n {children}\n </TooltipPrimitive.Provider>\n </TooltipProviderContext.Provider>\n );\n}\nTooltipProvider.displayName = 'TooltipProvider';\n\ntype TooltipElement = React.ElementRef<typeof TooltipPrimitive.Content>;\ntype TooltipOwnProps = GetPropDefTypes<typeof tooltipPropDefs>;\ninterface TooltipProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>,\n ComponentPropsWithout<typeof TooltipPrimitive.Content, RemovedProps | 'content'>,\n TooltipOwnProps {\n content: React.ReactNode;\n container?: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Portal>['container'];\n}\nconst Tooltip = React.forwardRef<TooltipElement, TooltipProps>((props, forwardedRef) => {\n const {\n children,\n className,\n open,\n defaultOpen,\n onOpenChange,\n delayDuration,\n disableHoverableContent,\n content,\n container,\n forceMount,\n ...tooltipContentProps\n } = extractProps(props, tooltipPropDefs);\n const rootProps = { open, defaultOpen, onOpenChange, delayDuration, disableHoverableContent };\n const hasProvider = React.useContext(TooltipProviderContext);\n const tooltip = (\n <TooltipPrimitive.Root {...rootProps}>\n <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <TooltipPrimitive.Content\n sideOffset={4}\n collisionPadding={10}\n {...tooltipContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-TooltipContent', className)}\n >\n <Text as=\"p\" className=\"kui-TooltipText\" size=\"1\">\n {content}\n </Text>\n <TooltipPrimitive.Arrow className=\"kui-TooltipArrow\" />\n </TooltipPrimitive.Content>\n </Theme>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n // Radix needs a provider above every tooltip. Outside a TooltipProvider, bring one.\n return hasProvider ? tooltip : <TooltipPrimitive.Provider delayDuration={TOOLTIP_DELAY}>{tooltip}</TooltipPrimitive.Provider>;\n});\nTooltip.displayName = 'Tooltip';\n\nexport { Tooltip, TooltipProvider };\nexport type { TooltipProps, TooltipProviderProps };\n", "import * as React from 'react';\nimport { Slot } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { textPropDefs } from './text.props.js';\n\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype TextElement = React.ElementRef<'span'>;\ntype TextOwnProps = GetPropDefTypes<typeof textPropDefs>;\ninterface CommonTextProps extends TextOwnProps {}\ntype TextSpanProps = { as?: 'span' } & ComponentPropsWithout<'span', RemovedProps>;\ntype TextDivProps = { as: 'div' } & ComponentPropsWithout<'div', RemovedProps>;\ntype TextLabelProps = { as: 'label' } & ComponentPropsWithout<'label', RemovedProps>;\ntype TextPProps = { as: 'p' } & ComponentPropsWithout<'p', RemovedProps>;\ntype TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);\n\n// Pre-merge prop definitions at module level to avoid per-render allocation\n\nconst Text = React.memo(\n React.forwardRef<TextElement, TextProps>((props, forwardedRef) => {\n const {\n children,\n className,\n asChild,\n as: Tag = 'span',\n color,\n ...textProps\n } = extractProps(props, textPropDefs);\n\n const combinedClassName = className ? `kui-Text ${className}` : 'kui-Text';\n\n if (asChild) {\n return (\n <Slot.Root\n data-accent-color={color}\n {...textProps}\n ref={forwardedRef}\n className={combinedClassName}\n >\n {children}\n </Slot.Root>\n );\n }\n\n return (\n <Tag\n data-accent-color={color}\n {...(textProps as React.HTMLAttributes<HTMLElement>)}\n ref={forwardedRef as any}\n className={combinedClassName}\n >\n {children}\n </Tag>\n );\n })\n);\nText.displayName = 'Text';\n\nexport { Text };\nexport type { TextProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst emphases = ['loud', 'medium', 'quiet'] as const;\n\n// Text-first components only (Text, Heading, Blockquote, Code).\n// No colour + emphasis reads the gray ink ladder; colour + emphasis reads the accent ink ladder.\n// Components that need a different default spread this def and override `default`.\nconst emphasisPropDef = {\n emphasis: {\n type: 'enum',\n className: 'kui-emphasis',\n values: emphases,\n default: undefined,\n },\n} satisfies {\n emphasis: PropDef<(typeof emphases)[number]>;\n};\n\nexport { emphasisPropDef, emphases };\n", "import type { PropDef } from './prop-def.js';\n\nconst leadingTrimValues = ['normal', 'start', 'end', 'both'] as const;\n\nconst leadingTrimPropDef = {\n trim: {\n type: 'enum',\n className: 'kui-r-lt',\n values: leadingTrimValues,\n responsive: true,\n },\n} satisfies {\n trim: PropDef<(typeof leadingTrimValues)[number]>;\n};\n\nexport { leadingTrimPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textAlignValues = ['left', 'center', 'right'] as const;\n\nconst textAlignPropDef = {\n align: {\n type: 'enum',\n className: 'kui-r-ta',\n values: textAlignValues,\n responsive: true,\n },\n} satisfies {\n align: PropDef<(typeof textAlignValues)[number]>;\n};\n\nexport { textAlignPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textWrapValues = ['wrap', 'nowrap', 'pretty', 'balance'] as const;\n\nconst textWrapPropDef = {\n wrap: {\n type: 'enum',\n className: 'kui-r-tw',\n values: textWrapValues,\n responsive: true,\n },\n} satisfies {\n wrap: PropDef<(typeof textWrapValues)[number]>;\n};\n\nexport { textWrapPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst truncatePropDef = {\n truncate: {\n type: 'boolean',\n className: 'kui-truncate',\n },\n} satisfies {\n truncate: PropDef<boolean>;\n};\n\nexport { truncatePropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\n\nconst fontFamilyPropDef = {\n font: {\n type: 'enum',\n className: 'kui-r-ff',\n values: fontFamilies,\n },\n} satisfies {\n font: PropDef<(typeof fontFamilies)[number]>;\n};\n\nexport { fontFamilyPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n/** v2's three weights (\u00A715). No bold: a larger size or stronger emphasis says importance. */\nconst weights = ['regular', 'medium', 'semibold'] as const;\n\nconst weightPropDef = {\n weight: {\n type: 'enum',\n className: 'kui-r-weight',\n values: weights,\n responsive: true,\n },\n} satisfies {\n weight: PropDef<(typeof weights)[number]>;\n};\n\nexport { weightPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { emphasisPropDef } from '../props/emphasis.prop.js';\nimport { leadingTrimPropDef } from '../props/leading-trim.prop.js';\nimport { textAlignPropDef } from '../props/text-align.prop.js';\nimport { textWrapPropDef } from '../props/text-wrap.prop.js';\nimport { truncatePropDef } from '../props/truncate.prop.js';\nimport { fontFamilyPropDef } from '../props/font-family.prop.js';\nimport { weightPropDef } from '../props/weight.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst as = ['span', 'div', 'label', 'p'] as const;\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\n\nconst textPropDefs = {\n as: { type: 'enum', values: as, default: 'span' },\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n responsive: true,\n },\n ...fontFamilyPropDef,\n ...weightPropDef,\n ...textAlignPropDef,\n ...leadingTrimPropDef,\n ...truncatePropDef,\n ...textWrapPropDef,\n ...colorPropDef,\n ...emphasisPropDef,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\nexport { textPropDefs };\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Direction, Slot } from 'radix-ui';\n\nimport { getMatchingGrayColor } from '../helpers/get-matching-gray-color.js';\nimport { ThemeSizeContext } from '../hooks/theme-size.js';\nimport { usePropSyncedState } from '../hooks/use-prop-synced-state.js';\nimport { themePropDefs } from './theme.props.js';\n\nimport type { ThemeOwnProps } from './theme.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\nconst noop = () => {};\n\ntype ThemeAppearance = (typeof themePropDefs.appearance.values)[number];\ntype ThemeAccentColor = (typeof themePropDefs.accentColor.values)[number];\ntype ThemeGrayColor = (typeof themePropDefs.grayColor.values)[number];\ntype ThemeRadius = (typeof themePropDefs.radius.values)[number];\ntype ThemeFontFamily = (typeof themePropDefs.fontFamily.values)[number];\ntype ThemeSize = (typeof themePropDefs.size.values)[number];\n// Headings follow the body font until something sets this, so `undefined` is a\n// meaningful value here rather than a missing one.\ntype ThemeHeadingFontFamily = ThemeFontFamily | undefined;\n\ninterface ThemeChangeHandlers {\n onAppearanceChange: (appearance: ThemeAppearance) => void;\n onAccentColorChange: (accentColor: ThemeAccentColor) => void;\n onGrayColorChange: (grayColor: ThemeGrayColor) => void;\n onRadiusChange: (radius: ThemeRadius) => void;\n onFontFamilyChange: (fontFamily: ThemeFontFamily) => void;\n onHeadingFontFamilyChange: (headingFontFamily: ThemeHeadingFontFamily) => void;\n onSizeChange: (size: ThemeSize) => void;\n}\n\ninterface ThemeContextValue extends ThemeChangeHandlers {\n appearance: ThemeAppearance;\n accentColor: ThemeAccentColor;\n grayColor: ThemeGrayColor;\n resolvedGrayColor: ThemeGrayColor;\n radius: ThemeRadius;\n fontFamily: ThemeFontFamily;\n headingFontFamily: ThemeHeadingFontFamily;\n size: ThemeSize;\n}\n// Default theme values used when components render outside a Theme provider\nconst defaultThemeContext: ThemeContextValue = {\n appearance: themePropDefs.appearance.default,\n accentColor: themePropDefs.accentColor.default,\n grayColor: themePropDefs.grayColor.default,\n resolvedGrayColor: themePropDefs.grayColor.default,\n radius: themePropDefs.radius.default,\n fontFamily: themePropDefs.fontFamily.default,\n headingFontFamily: undefined,\n size: themePropDefs.size.default,\n onAppearanceChange: noop,\n onAccentColorChange: noop,\n onGrayColorChange: noop,\n onRadiusChange: noop,\n onFontFamilyChange: noop,\n onHeadingFontFamilyChange: noop,\n onSizeChange: noop,\n};\n\nconst ThemeContext = React.createContext<ThemeContextValue | undefined>(undefined);\n\nfunction useThemeContext() {\n const context = React.useContext(ThemeContext);\n // Return default context if used outside Theme provider (e.g., during SSR)\n return context ?? defaultThemeContext;\n}\n\ninterface ThemeProps extends ThemeImplPublicProps {}\nconst Theme = React.forwardRef<ThemeImplElement, ThemeProps>((props, forwardedRef) => {\n const context = React.useContext(ThemeContext);\n // Direction is inherited: a Radix DirectionProvider above the Theme (for a right-to-left app)\n // wins, and left-to-right stays the default when there is none.\n const dir = Direction.useDirection();\n const isRoot = context === undefined;\n if (isRoot) {\n return (\n <Direction.Provider dir={dir}>\n <ThemeRoot {...props} ref={forwardedRef} />\n </Direction.Provider>\n );\n }\n return <ThemeImpl {...props} ref={forwardedRef} />;\n});\nTheme.displayName = 'Theme';\n\nconst ThemeRoot = React.forwardRef<ThemeImplElement, ThemeImplPublicProps>((props, forwardedRef) => {\n const {\n appearance: appearanceProp = themePropDefs.appearance.default,\n accentColor: accentColorProp = themePropDefs.accentColor.default,\n grayColor: grayColorProp = themePropDefs.grayColor.default,\n radius: radiusProp = themePropDefs.radius.default,\n fontFamily: fontFamilyProp = themePropDefs.fontFamily.default,\n headingFontFamily: headingFontFamilyProp,\n size: sizeProp = themePropDefs.size.default,\n hasBackground = themePropDefs.hasBackground.default,\n ...rootProps\n } = props;\n\n // Each of these follows its prop but stays independently settable, so\n // the context setters can change the theme at runtime. Syncing during render\n // rather than in an effect matters here: an effect would commit the old\n // theme first and re-render every consumer of the context a second time.\n const [appearance, setAppearance] = usePropSyncedState(appearanceProp);\n const [accentColor, setAccentColor] = usePropSyncedState(accentColorProp);\n const [grayColor, setGrayColor] = usePropSyncedState(grayColorProp);\n const [radius, setRadius] = usePropSyncedState(radiusProp);\n const [fontFamily, setFontFamily] = usePropSyncedState(fontFamilyProp);\n const [headingFontFamily, setHeadingFontFamily] = usePropSyncedState(headingFontFamilyProp);\n const [size, setSize] = usePropSyncedState(sizeProp);\n\n return (\n <ThemeImpl\n {...rootProps}\n ref={forwardedRef}\n isRoot\n hasBackground={hasBackground}\n //\n appearance={appearance}\n accentColor={accentColor}\n grayColor={grayColor}\n radius={radius}\n fontFamily={fontFamily}\n headingFontFamily={headingFontFamily}\n size={size}\n //\n onAppearanceChange={setAppearance}\n onAccentColorChange={setAccentColor}\n onGrayColorChange={setGrayColor}\n onRadiusChange={setRadius}\n onFontFamilyChange={setFontFamily}\n onHeadingFontFamilyChange={setHeadingFontFamily}\n onSizeChange={setSize}\n />\n );\n});\nThemeRoot.displayName = 'ThemeRoot';\n\ntype ThemeImplElement = React.ElementRef<'div'>;\ninterface ThemeImplProps extends ThemeImplPublicProps, ThemeImplPrivateProps {}\ninterface ThemeImplPublicProps extends ComponentPropsWithout<'div', RemovedProps | 'dir'>, ThemeOwnProps {}\ninterface ThemeImplPrivateProps extends Partial<ThemeChangeHandlers> {\n isRoot?: boolean;\n}\nconst ThemeImpl = React.forwardRef<ThemeImplElement, ThemeImplProps>((props, forwardedRef) => {\n const context = React.useContext(ThemeContext);\n const {\n asChild,\n isRoot,\n hasBackground: hasBackgroundProp,\n //\n appearance = props.appearance ?? context?.appearance ?? themePropDefs.appearance.default,\n accentColor = props.accentColor ?? context?.accentColor ?? themePropDefs.accentColor.default,\n grayColor = props.grayColor ?? context?.resolvedGrayColor ?? themePropDefs.grayColor.default,\n radius = props.radius ?? context?.radius ?? themePropDefs.radius.default,\n fontFamily = props.fontFamily ?? context?.fontFamily ?? themePropDefs.fontFamily.default,\n headingFontFamily = props.headingFontFamily ?? context?.headingFontFamily,\n size = props.size ?? context?.size ?? themePropDefs.size.default,\n // A nested Theme forwards changes to the one above it, so a switcher\n // inside a portal (Dialog, Popover, menus) still reaches the root.\n onAppearanceChange = context?.onAppearanceChange ?? noop,\n onAccentColorChange = context?.onAccentColorChange ?? noop,\n onGrayColorChange = context?.onGrayColorChange ?? noop,\n onRadiusChange = context?.onRadiusChange ?? noop,\n onFontFamilyChange = context?.onFontFamilyChange ?? noop,\n onHeadingFontFamilyChange = context?.onHeadingFontFamilyChange ?? noop,\n onSizeChange = context?.onSizeChange ?? noop,\n //\n ...themeProps\n } = props;\n const Comp = asChild ? Slot.Root : 'div';\n const resolvedGrayColor = grayColor === 'auto' ? getMatchingGrayColor(accentColor) : grayColor;\n const isExplicitAppearance = props.appearance === 'light' || props.appearance === 'dark';\n const hasBackground = hasBackgroundProp === undefined ? isRoot || isExplicitAppearance : hasBackgroundProp;\n\n return (\n <ThemeContext.Provider\n value={React.useMemo(\n () => ({\n appearance,\n accentColor,\n grayColor,\n resolvedGrayColor,\n radius,\n fontFamily,\n headingFontFamily,\n size,\n //\n onAppearanceChange,\n onAccentColorChange,\n onGrayColorChange,\n onRadiusChange,\n onFontFamilyChange,\n onHeadingFontFamilyChange,\n onSizeChange,\n }),\n [\n appearance,\n accentColor,\n grayColor,\n resolvedGrayColor,\n radius,\n fontFamily,\n headingFontFamily,\n size,\n //\n onAppearanceChange,\n onAccentColorChange,\n onGrayColorChange,\n onRadiusChange,\n onFontFamilyChange,\n onHeadingFontFamilyChange,\n onSizeChange,\n ],\n )}\n >\n {/* Size travels on its own context as a bare string, so the components\n that read it do not re-render when another theme value changes. */}\n <ThemeSizeContext.Provider value={size}>\n <Comp\n data-is-root-theme={isRoot ? 'true' : 'false'}\n data-accent-color={accentColor}\n data-gray-color={resolvedGrayColor}\n // for nested `Theme` background\n data-has-background={hasBackground ? 'true' : 'false'}\n data-radius={radius}\n data-font-family={fontFamily}\n data-heading-font-family={headingFontFamily}\n ref={forwardedRef}\n {...themeProps}\n className={classNames(\n 'kui-theme',\n {\n light: appearance === 'light',\n dark: appearance === 'dark',\n },\n themeProps.className,\n )}\n />\n </ThemeSizeContext.Provider>\n </ThemeContext.Provider>\n );\n});\nThemeImpl.displayName = 'ThemeImpl';\n\nexport { Theme, ThemeContext, useThemeContext };\nexport type { ThemeProps, ThemeContextValue };\n", "import type { accentColors } from '../props/color.prop.js';\n\ntype ThemeAccentColor = (typeof accentColors)[number];\n\nexport function getMatchingGrayColor(accentColor: ThemeAccentColor) {\n switch (accentColor) {\n case 'tomato':\n case 'red':\n case 'ruby':\n case 'crimson':\n case 'pink':\n case 'plum':\n case 'purple':\n case 'violet':\n return 'mauve';\n case 'iris':\n case 'indigo':\n case 'blue':\n case 'sky':\n case 'cyan':\n return 'slate';\n case 'teal':\n case 'jade':\n case 'mint':\n case 'green':\n return 'sage';\n case 'grass':\n case 'lime':\n return 'olive';\n case 'yellow':\n case 'amber':\n case 'orange':\n case 'brown':\n case 'gold':\n case 'bronze':\n return 'sand';\n case 'gray':\n return 'gray';\n }\n}\n", "import * as React from 'react';\n\n/**\n * State that tracks a prop but can also be set imperatively \u2014 the shape `Theme`\n * needs, where a prop sets the value and the context setters can change it at runtime.\n *\n * Adjusts state during render rather than syncing in a `useEffect`. An effect\n * would commit one render carrying the *old* value and schedule a second one,\n * which for a provider means every consumer renders twice and the browser can\n * paint the stale value in between.\n *\n * @see https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\nexport function usePropSyncedState<T>(propValue: T) {\n const [value, setValue] = React.useState(propValue);\n const [previousPropValue, setPreviousPropValue] = React.useState(propValue);\n\n if (!Object.is(propValue, previousPropValue)) {\n setPreviousPropValue(propValue);\n setValue(propValue);\n }\n\n return [value, setValue] as const;\n}\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { accentColors, grayColors } from '../props/color.prop.js';\nimport { radii } from '../props/radius.prop.js';\n\nimport type { GetPropDefTypes, PropDef } from '../props/prop-def.js';\n\nconst appearances = ['inherit', 'light', 'dark'] as const;\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\nconst sizes = ['1', '2', '3', '4'] as const;\n\nconst themePropDefs = {\n ...asChildPropDef,\n /**\n * Whether to apply background color to the Theme element.\n *\n * Defaults to true for the root Theme and for Theme elements that\n * have an explicit light or dark appearance prop.\n */\n hasBackground: { type: 'boolean', default: true },\n /**\n * Sets the color scheme of the theme, typcially referred to as light and dark mode.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/dark-mode\n */\n appearance: { type: 'enum', values: appearances, default: 'inherit' },\n /**\n * Selects one of the accent color options to use in the Theme.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/color\n */\n accentColor: { type: 'enum', values: accentColors, default: 'gray' },\n /**\n * Selects one of the gray color options to use in the Theme.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/color\n */\n grayColor: { type: 'enum', values: grayColors, default: 'gray' },\n /**\n * Sets the default radius of the components.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/visual-style\n */\n radius: { type: 'enum', values: radii, default: 'full' },\n /**\n * Sets the font family used for body text in the theme.\n *\n * Headings follow this unless `headingFontFamily` (or the `--font-heading`\n * token) says otherwise.\n *\n * @default 'sans'\n */\n fontFamily: { type: 'enum', values: fontFamilies, default: 'sans' },\n /**\n * Sets the font family used for `Heading`, independently of body text.\n *\n * Deliberately has no default: when it is left unset no attribute is\n * emitted and `--font-heading` keeps following `--font-body`, so a\n * `--font-heading` override in your own CSS survives a `fontFamily` switch.\n */\n headingFontFamily: { type: 'enum', values: fontFamilies },\n /**\n * The app-wide size index. Every component on the 1-4 control and surface\n * scale that states no `size` of its own takes this one; an explicit\n * `size` always wins. Nested Themes override it for their subtree.\n *\n * @default '2'\n */\n size: { type: 'enum', values: sizes, default: '2' },\n} satisfies {\n hasBackground: PropDef<boolean>;\n appearance: PropDef<(typeof appearances)[number]>;\n accentColor: PropDef<(typeof accentColors)[number]>;\n grayColor: PropDef<(typeof grayColors)[number]>;\n radius: PropDef<(typeof radii)[number]>;\n fontFamily: PropDef<(typeof fontFamilies)[number]>;\n headingFontFamily: PropDef<(typeof fontFamilies)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\ntype ThemeOwnProps = GetPropDefTypes<typeof themePropDefs & typeof asChildPropDef>;\n\nexport { themePropDefs };\nexport type { ThemeOwnProps };\n", "import { widthPropDefs } from '../props/width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst tooltipPropDefs = {\n content: { type: 'ReactNode', required: true },\n width: widthPropDefs.width,\n minWidth: widthPropDefs.minWidth,\n maxWidth: { ...widthPropDefs.maxWidth, default: '360px' },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n content: PropDef<React.ReactNode>;\n};\n\ntype TooltipOwnProps = GetPropDefTypes<typeof tooltipPropDefs & typeof widthPropDefs>;\n\nexport { tooltipPropDefs };\nexport type { TooltipOwnProps };\n", "import * as React from 'react';\n\n/**\n * Hook for managing tooltip accessibility props and conditional rendering.\n * Encapsulates tooltip ID generation and aria-describedby binding.\n *\n * @param tooltip - The tooltip content (if any)\n * @returns Object containing tooltipId, hasTooltip flag, and accessibility props\n *\n * @example\n * ```tsx\n * const { tooltipId, hasTooltip, accessibilityProps } = useTooltipWrapper(tooltip);\n *\n * const button = <button {...accessibilityProps}>Click me</button>;\n *\n * if (!hasTooltip) return button;\n *\n * return <Tooltip id={tooltipId} content={tooltip}>{button}</Tooltip>;\n * ```\n */\nexport function useTooltipWrapper(tooltip: React.ReactNode) {\n const tooltipId = React.useId();\n const hasTooltip = Boolean(tooltip);\n\n const accessibilityProps = React.useMemo(() => (hasTooltip ? { 'aria-describedby': tooltipId } : {}), [hasTooltip, tooltipId]);\n\n return { tooltipId, hasTooltip, accessibilityProps };\n}\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { DropdownMenu as DropdownMenuPrimitive, Slot } from 'radix-ui';\nimport { useCallbackRef } from 'radix-ui/internal';\n\nimport { ScrollArea } from './scroll-area.js';\nimport {\n dropdownMenuContentPropDefs,\n dropdownMenuSubContentPropDefs,\n dropdownMenuItemPropDefs,\n dropdownMenuCheckboxItemPropDefs,\n dropdownMenuRadioItemPropDefs,\n} from './dropdown-menu.props.js';\nimport { Theme, useThemeContext } from './theme.js';\nimport { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDotIcon } from './icons.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\nimport {\n DrillDownLevelContext,\n DrillDownRoot,\n SubContext,\n useCreateDrillDownStore,\n useDrillDownStore,\n usePanelPosition,\n useStackEntry,\n useSubContext,\n} from './_internal/dropdown-menu-drill-down.js';\nimport {\n MenuCloseProvider,\n MenuGroupLabelProvider,\n MenuProvider,\n useMenuGroupLabelId,\n useMenuGroupLabelledBy,\n} from './_internal/menu-context.js';\nimport {\n MenuShortcut,\n getMenuAlignOffset,\n toAriaKeyShortcuts,\n useResolvedResponsiveValue,\n} from './_internal/base-menu.utils.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\n\nimport type { SubmenuBehavior } from './_internal/dropdown-menu-drill-down.js';\nimport type { IconProps } from './icons.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes, Responsive } from '../props/prop-def.js';\n\n/**\n * Open state of the menu, mirrored from Root so Content can reset drill-down\n * navigation when a force-mounted menu opens again.\n */\nconst DropdownMenuOpenContext = React.createContext(false);\n\ninterface DropdownMenuRootProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root> {}\nconst DropdownMenuRoot: React.FC<DropdownMenuRootProps> = (props) => {\n const { open: openProp, defaultOpen = false, onOpenChange } = props;\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);\n const open = openProp ?? uncontrolledOpen;\n\n const handleOpenChangeProp = useCallbackRef(onOpenChange);\n const handleOpenChange = React.useCallback(\n (next: boolean) => {\n setUncontrolledOpen(next);\n handleOpenChangeProp(next);\n },\n [handleOpenChangeProp],\n );\n\n const close = React.useCallback(() => handleOpenChange(false), [handleOpenChange]);\n\n return (\n <DropdownMenuOpenContext.Provider value={open}>\n <MenuCloseProvider value={close}>\n <DropdownMenuPrimitive.Root {...props} open={open} onOpenChange={handleOpenChange} />\n </MenuCloseProvider>\n </DropdownMenuOpenContext.Provider>\n );\n};\nDropdownMenuRoot.displayName = 'DropdownMenu.Root';\n\ntype DropdownMenuTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.Trigger>;\ninterface DropdownMenuTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Trigger, RemovedProps> {}\nconst DropdownMenuTrigger = React.forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DropdownMenuPrimitive.Trigger>\n ),\n);\nDropdownMenuTrigger.displayName = 'DropdownMenu.Trigger';\n\n/** Visual props shared by Content and SubContent. */\ntype DropdownMenuSurfaceProps = GetPropDefTypes<typeof dropdownMenuSubContentPropDefs>;\n\ntype DropdownMenuContentContextValue = {\n size?: DropdownMenuSurfaceProps['size'];\n color?: DropdownMenuSurfaceProps['color'];\n};\nconst DropdownMenuContentContext = React.createContext<DropdownMenuContentContextValue>({});\n\n/** Keys that navigate back one drill-down level, by writing direction. */\nconst BACK_KEYS = { ltr: 'ArrowLeft', rtl: 'ArrowRight' } as const;\nconst FORWARD_KEYS = { ltr: 'ArrowRight', rtl: 'ArrowLeft' } as const;\n\nfunction isTextEntryTarget(target: EventTarget | null) {\n return (\n target instanceof HTMLElement &&\n (target.isContentEditable || target.tagName === 'INPUT' || target.tagName === 'TEXTAREA')\n );\n}\n\nfunction getDirection(element: HTMLElement | null): 'ltr' | 'rtl' {\n return element?.closest('[dir]')?.getAttribute('dir') === 'rtl' ? 'rtl' : 'ltr';\n}\n\ntype DropdownMenuContentElement = React.ElementRef<typeof DropdownMenuPrimitive.Content>;\ninterface DropdownMenuContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Content, RemovedProps>,\n DropdownMenuSurfaceProps {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n /**\n * Controls how submenus behave.\n * - `cascade`: Default cascading behavior where submenus open to the side (portal-based)\n * - `drill-down`: Mobile-friendly behavior where submenus replace the content inline\n * Supports responsive values: `{ initial: 'drill-down', md: 'cascade' }`\n */\n submenuBehavior?: Responsive<SubmenuBehavior>;\n /**\n * When true, skips the ScrollArea wrapper to allow VirtualMenu to handle its own scrolling.\n * Use this when rendering virtualized lists inside the dropdown.\n */\n virtualized?: boolean;\n}\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, dropdownMenuContentPropDefs.size);\n const themeContext = useThemeContext();\n const {\n size = dropdownMenuContentPropDefs.size.default,\n } = props;\n const {\n className,\n children,\n color,\n container,\n forceMount,\n submenuBehavior,\n virtualized = false,\n onEscapeKeyDown,\n onKeyDown,\n ...contentProps\n } = extractProps(props, dropdownMenuContentPropDefs);\n\n const resolvedColor = color || themeContext.accentColor;\n const behavior = useResolvedResponsiveValue<SubmenuBehavior>(submenuBehavior, 'cascade');\n const isDrillDown = behavior === 'drill-down';\n const open = React.useContext(DropdownMenuOpenContext);\n const drillDownStore = useCreateDrillDownStore();\n\n // Escape goes back one drill-down level before it closes the menu.\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n onEscapeKeyDown?.(event);\n if (event.defaultPrevented || !isDrillDown || drillDownStore.getDepth() === 0) return;\n event.preventDefault();\n drillDownStore.pop('keyboard');\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || !isDrillDown || drillDownStore.getDepth() === 0) return;\n if (isTextEntryTarget(event.target)) return;\n if (event.key === BACK_KEYS[getDirection(event.currentTarget)]) {\n event.preventDefault();\n drillDownStore.pop('keyboard');\n }\n };\n\n const contextValue = React.useMemo(\n () => ({ size, color: resolvedColor }),\n [size, resolvedColor],\n );\n\n const contentBody = (\n <MenuProvider size={size}>\n <DropdownMenuContentContext.Provider value={contextValue}>\n <DrillDownRoot store={drillDownStore} behavior={behavior} open={open}>\n {children}\n </DrillDownRoot>\n </DropdownMenuContentContext.Provider>\n </MenuProvider>\n );\n\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DropdownMenuPrimitive.Content\n data-accent-color={resolvedColor}\n align=\"start\"\n sideOffset={4}\n collisionPadding={10}\n {...contentProps}\n onEscapeKeyDown={handleEscapeKeyDown}\n onKeyDown={handleKeyDown}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-DropdownMenuContent',\n className,\n )}\n >\n {virtualized ? (\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport', 'kui-virtualized')}>\n {contentBody}\n </div>\n ) : (\n <ScrollArea type=\"auto\" scrollbars=\"vertical\">\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport')}>\n {contentBody}\n </div>\n </ScrollArea>\n )}\n </DropdownMenuPrimitive.Content>\n </Theme>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nDropdownMenuContent.displayName = 'DropdownMenu.Content';\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof DropdownMenuPrimitive.Label>;\ninterface DropdownMenuLabelProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Label, RemovedProps> {}\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n ({ className, id: idProp, ...props }, forwardedRef) => {\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n const id = useMenuGroupLabelId(idProp, isLevelVisible);\n if (!isLevelVisible) return null;\n return (\n <DropdownMenuPrimitive.Label\n {...props}\n id={id}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuLabel', 'kui-DropdownMenuLabel', className)}\n />\n );\n },\n);\nDropdownMenuLabel.displayName = 'DropdownMenu.Label';\n\ntype DropdownMenuItemElement = React.ElementRef<typeof DropdownMenuPrimitive.Item>;\ntype DropdownMenuItemOwnProps = GetPropDefTypes<typeof dropdownMenuItemPropDefs>;\ninterface DropdownMenuItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Item, RemovedProps>,\n DropdownMenuItemOwnProps {}\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props, forwardedRef) => {\n const {\n className,\n children,\n color = dropdownMenuItemPropDefs.color.default,\n shortcut,\n ...itemProps\n } = props;\n // In drill-down mode, items of levels that are not on screen do not mount.\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.Item\n data-accent-color={color}\n aria-keyshortcuts={shortcut ? toAriaKeyShortcuts(shortcut) : undefined}\n {...itemProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-DropdownMenuItem', className)}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n {shortcut && <MenuShortcut shortcut={shortcut} className=\"kui-DropdownMenuShortcut\" />}\n </DropdownMenuPrimitive.Item>\n );\n },\n);\nDropdownMenuItem.displayName = 'DropdownMenu.Item';\n\ntype DropdownMenuGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.Group>;\ninterface DropdownMenuGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Group, RemovedProps> {}\nconst DropdownMenuGroup = React.forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n ({ className, 'aria-labelledby': ariaLabelledBy, ...props }, forwardedRef) => {\n const [labelledBy, setLabelId] = useMenuGroupLabelledBy(ariaLabelledBy);\n // A drill-down level that is not on screen keeps its groups only to hold the open path.\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n return (\n <MenuGroupLabelProvider value={setLabelId}>\n <DropdownMenuPrimitive.Group\n {...(isLevelVisible ? { 'aria-labelledby': labelledBy } : { role: 'none' })}\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuGroup', 'kui-DropdownMenuGroup', className)}\n />\n </MenuGroupLabelProvider>\n );\n },\n);\nDropdownMenuGroup.displayName = 'DropdownMenu.Group';\n\ntype DropdownMenuRadioGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>;\ninterface DropdownMenuRadioGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioGroup, RemovedProps> {}\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>(({ className, 'aria-labelledby': ariaLabelledBy, ...props }, forwardedRef) => {\n const [labelledBy, setLabelId] = useMenuGroupLabelledBy(ariaLabelledBy);\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n return (\n <MenuGroupLabelProvider value={setLabelId}>\n <DropdownMenuPrimitive.RadioGroup\n {...(isLevelVisible ? { 'aria-labelledby': labelledBy } : { role: 'none' })}\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuRadioGroup', 'kui-DropdownMenuRadioGroup', className)}\n />\n </MenuGroupLabelProvider>\n );\n});\nDropdownMenuRadioGroup.displayName = 'DropdownMenu.RadioGroup';\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>;\ntype DropdownMenuRadioItemOwnProps = GetPropDefTypes<typeof dropdownMenuRadioItemPropDefs>;\ninterface DropdownMenuRadioItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioItem, RemovedProps>,\n DropdownMenuRadioItemOwnProps {}\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n color = dropdownMenuRadioItemPropDefs.color.default,\n ...itemProps\n } = props;\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.RadioItem\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuRadioItem',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuRadioItem',\n className,\n )}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n <DropdownMenuPrimitive.ItemIndicator className=\"kui-BaseMenuItemIndicator kui-DropdownMenuItemIndicator\">\n <ThickDotIcon className=\"kui-BaseMenuItemIndicatorIcon kui-DropdownMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </DropdownMenuPrimitive.RadioItem>\n );\n});\nDropdownMenuRadioItem.displayName = 'DropdownMenu.RadioItem';\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>;\ntype DropdownMenuCheckboxItemOwnProps = GetPropDefTypes<typeof dropdownMenuCheckboxItemPropDefs>;\ninterface DropdownMenuCheckboxItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.CheckboxItem, RemovedProps>,\n DropdownMenuCheckboxItemOwnProps {}\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n shortcut,\n color = dropdownMenuCheckboxItemPropDefs.color.default,\n ...itemProps\n } = props;\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.CheckboxItem\n aria-keyshortcuts={shortcut ? toAriaKeyShortcuts(shortcut) : undefined}\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuCheckboxItem',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuCheckboxItem',\n className,\n )}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n <DropdownMenuPrimitive.ItemIndicator className=\"kui-BaseMenuItemIndicator kui-DropdownMenuItemIndicator\">\n <ThickCheckIcon className=\"kui-BaseMenuItemIndicatorIcon kui-DropdownMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n {shortcut && <MenuShortcut shortcut={shortcut} className=\"kui-DropdownMenuShortcut\" />}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n});\nDropdownMenuCheckboxItem.displayName = 'DropdownMenu.CheckboxItem';\n\ninterface DropdownMenuSubProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub> {\n /**\n * Label displayed in the back button when using drill-down mode.\n * If not provided, defaults to \"Back\".\n */\n label?: React.ReactNode;\n}\nconst DropdownMenuSub: React.FC<DropdownMenuSubProps> = ({\n label = 'Back',\n open,\n defaultOpen,\n onOpenChange,\n children,\n}) => {\n const drillDownStore = useDrillDownStore();\n const id = React.useId();\n const subContextValue = React.useMemo(() => ({ id, label }), [id, label]);\n const isOpenInDrillDown = usePanelPosition(drillDownStore, id) !== 'closed';\n\n const handleOpenChange = useCallbackRef(onOpenChange);\n const isControlled = open !== undefined;\n\n // Drill-down, controlled: navigating asks `onOpenChange` and leaves the stack to `open`.\n React.useLayoutEffect(() => {\n if (!drillDownStore || !isControlled) return;\n drillDownStore.setController(id, handleOpenChange);\n return () => drillDownStore.setController(id, null);\n }, [drillDownStore, isControlled, id, handleOpenChange]);\n\n React.useLayoutEffect(() => {\n if (!drillDownStore || open === undefined) return;\n if (open && !drillDownStore.isOpen(id)) drillDownStore.open(id, drillDownStore.takePendingModality(id));\n else if (!open && drillDownStore.isOpen(id)) drillDownStore.close(id, drillDownStore.takePendingModality(id));\n }, [drillDownStore, open, id]);\n\n // A `defaultOpen` push on mount is the starting state, not a change to report.\n const defaultOpenRef = React.useRef(open === undefined && Boolean(defaultOpen));\n React.useLayoutEffect(() => {\n if (drillDownStore && defaultOpenRef.current) drillDownStore.open(id);\n else defaultOpenRef.current = false;\n // Only on mount, like an uncontrolled default.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Uncontrolled, the stack drives `onOpenChange`. Controlled, it reports only a close\n // the `open` prop did not ask for, such as a parent level closing.\n const wasOpenRef = React.useRef(isOpenInDrillDown);\n React.useEffect(() => {\n if (!drillDownStore || wasOpenRef.current === isOpenInDrillDown) return;\n wasOpenRef.current = isOpenInDrillDown;\n if (isOpenInDrillDown && defaultOpenRef.current) {\n defaultOpenRef.current = false;\n return;\n }\n if (open !== undefined && open === isOpenInDrillDown) return;\n handleOpenChange(isOpenInDrillDown);\n }, [drillDownStore, isOpenInDrillDown, handleOpenChange, open]);\n\n // Radix Sub stays mounted in both behaviors so switching behavior does not\n // remount the subtree. It only renders context; in drill-down its trigger\n // and content are never rendered, so it reports no open changes of its own.\n return (\n <SubContext.Provider value={subContextValue}>\n <DropdownMenuPrimitive.Sub\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={drillDownStore ? undefined : onOpenChange}\n >\n {children}\n </DropdownMenuPrimitive.Sub>\n </SubContext.Provider>\n );\n};\nDropdownMenuSub.displayName = 'DropdownMenu.Sub';\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>;\ninterface DropdownMenuSubTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubTrigger, RemovedProps> {}\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>((props, forwardedRef) => {\n const { className, children, onKeyDown, ...subTriggerProps } = props;\n const drillDownStore = useDrillDownStore();\n const subContext = useSubContext();\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n\n if (drillDownStore && subContext) {\n if (!isLevelVisible) return null;\n\n const handleSelect = (event: Event) => {\n // Navigating does not close the menu.\n event.preventDefault();\n drillDownStore.push(subContext.id);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || subTriggerProps.disabled) return;\n if (event.key === FORWARD_KEYS[getDirection(event.currentTarget)]) {\n event.preventDefault();\n drillDownStore.push(subContext.id, 'keyboard');\n }\n };\n\n return (\n // The row navigates within the same menu, so it announces no popup.\n <DropdownMenuPrimitive.Item\n {...subTriggerProps}\n data-drill-down-trigger={subContext.id}\n data-drill-down-name={subTriggerProps.textValue}\n onSelect={handleSelect}\n onKeyDown={handleKeyDown}\n ref={forwardedRef}\n className={classNames(\n 'kui-reset',\n 'kui-BaseMenuItem',\n 'kui-BaseMenuSubTrigger',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuSubTrigger',\n 'kui-DropdownMenuDrillDownSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"kui-BaseMenuShortcut kui-DropdownMenuShortcut\">\n <ThickChevronRightIcon className=\"kui-BaseMenuSubTriggerIcon kui-DropdownMenuSubTriggerIcon\" />\n </div>\n </DropdownMenuPrimitive.Item>\n );\n }\n\n return (\n <DropdownMenuPrimitive.SubTrigger\n {...subTriggerProps}\n onKeyDown={onKeyDown}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuSubTrigger',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"kui-BaseMenuShortcut kui-DropdownMenuShortcut\">\n <ThickChevronRightIcon className=\"kui-BaseMenuSubTriggerIcon kui-DropdownMenuSubTriggerIcon\" />\n </div>\n </DropdownMenuPrimitive.SubTrigger>\n );\n});\nDropdownMenuSubTrigger.displayName = 'DropdownMenu.SubTrigger';\n\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof DropdownMenuPrimitive.Separator>;\ninterface DropdownMenuSeparatorProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Separator, RemovedProps> {}\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, forwardedRef) => {\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.Separator\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuSeparator', 'kui-DropdownMenuSeparator', className)}\n />\n );\n});\nDropdownMenuSeparator.displayName = 'DropdownMenu.Separator';\n\n/** The row at the top of a drill-down panel that returns to the parent level. */\nfunction DrillDownBackItem({ label, name }: { label: React.ReactNode; name: string }) {\n const drillDownStore = useDrillDownStore();\n\n const handleSelect = React.useCallback(\n (event: Event) => {\n // Navigating does not close the menu.\n event.preventDefault();\n drillDownStore?.pop();\n },\n [drillDownStore],\n );\n\n // The visible label is often the submenu title, so the accessible name says\n // what the row does while still containing the visible text.\n const labelText = typeof label === 'string' ? label : name;\n const ariaLabel = labelText && labelText !== 'Back' ? `Back from ${labelText}` : undefined;\n\n return (\n <DropdownMenuPrimitive.Item\n aria-label={ariaLabel}\n textValue={labelText || 'Back'}\n onSelect={handleSelect}\n className={classNames(\n 'kui-reset',\n 'kui-BaseMenuItem',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuDrillDownBackItem',\n )}\n >\n <ThickChevronLeftIcon className=\"kui-BaseMenuSubTriggerIcon kui-DropdownMenuDrillDownBackIcon\" />\n <span className=\"kui-DropdownMenuDrillDownBackLabel\">{label}</span>\n </DropdownMenuPrimitive.Item>\n );\n}\n\n/** Radix positioning and layer props that have no meaning for an inline drill-down panel. */\ntype PopperOnlyProps =\n | 'loop'\n | 'onEscapeKeyDown'\n | 'onPointerDownOutside'\n | 'onFocusOutside'\n | 'onInteractOutside'\n | 'sideOffset'\n | 'alignOffset'\n | 'avoidCollisions'\n | 'collisionBoundary'\n | 'collisionPadding'\n | 'arrowPadding'\n | 'sticky'\n | 'hideWhenDetached'\n | 'updatePositionStrategy';\n\nfunction omitPopperProps<T extends Record<string, unknown>>(props: T): Omit<T, PopperOnlyProps> {\n const {\n loop: _loop,\n onEscapeKeyDown: _onEscapeKeyDown,\n onPointerDownOutside: _onPointerDownOutside,\n onFocusOutside: _onFocusOutside,\n onInteractOutside: _onInteractOutside,\n sideOffset: _sideOffset,\n alignOffset: _alignOffset,\n avoidCollisions: _avoidCollisions,\n collisionBoundary: _collisionBoundary,\n collisionPadding: _collisionPadding,\n arrowPadding: _arrowPadding,\n sticky: _sticky,\n hideWhenDetached: _hideWhenDetached,\n updatePositionStrategy: _updatePositionStrategy,\n ...rest\n } = props;\n return rest;\n}\n\ntype DropdownMenuSubContentElement = React.ElementRef<typeof DropdownMenuPrimitive.SubContent>;\ninterface DropdownMenuSubContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubContent, RemovedProps>,\n DropdownMenuSurfaceProps {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n /**\n * When true, skips the ScrollArea wrapper so a VirtualMenu can handle its own\n * scrolling. Applies to cascade submenus; a drill-down panel scrolls with the\n * root content.\n */\n virtualized?: boolean;\n}\nconst DropdownMenuSubContent = React.forwardRef<\n DropdownMenuSubContentElement,\n DropdownMenuSubContentProps\n>((props, forwardedRef) => {\n const drillDownStore = useDrillDownStore();\n const subContext = useSubContext();\n\n if (drillDownStore && subContext) {\n return (\n <DrillDownPanel {...props} ref={forwardedRef} store={drillDownStore} sub={subContext} />\n );\n }\n return <CascadeSubContent {...props} ref={forwardedRef} />;\n});\nDropdownMenuSubContent.displayName = 'DropdownMenu.SubContent';\n\nconst CascadeSubContent = React.forwardRef<DropdownMenuSubContentElement, DropdownMenuSubContentProps>(\n (props, forwardedRef) => {\n const parent = React.useContext(DropdownMenuContentContext);\n\n // A submenu inherits the parent surface, and its own props win.\n const size = props.size ?? parent.size;\n const color = props.color ?? parent.color;\n\n const {\n className,\n children,\n container,\n forceMount,\n color: _color,\n virtualized = false,\n ...subContentProps\n } = extractProps({ ...props, size }, dropdownMenuSubContentPropDefs);\n\n const scalarSize = useResolvedResponsiveValue(size, dropdownMenuSubContentPropDefs.size.default);\n\n const contextValue = React.useMemo(\n () => ({ size, color }),\n [size, color],\n );\n\n const body = (\n <MenuProvider size={size}>\n <DropdownMenuContentContext.Provider value={contextValue}>{children}</DropdownMenuContentContext.Provider>\n </MenuProvider>\n );\n\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DropdownMenuPrimitive.SubContent\n data-accent-color={color}\n alignOffset={getMenuAlignOffset(scalarSize)}\n // Side offset accounts for the outer solid box-shadow\n sideOffset={1}\n collisionPadding={10}\n {...subContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-BaseMenuSubContent',\n 'kui-DropdownMenuContent',\n 'kui-DropdownMenuSubContent',\n className,\n )}\n >\n {virtualized ? (\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport', 'kui-virtualized')}>\n {body}\n </div>\n ) : (\n <ScrollArea type=\"auto\" scrollbars=\"vertical\">\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport')}>{body}</div>\n </ScrollArea>\n )}\n </DropdownMenuPrimitive.SubContent>\n </Theme>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nCascadeSubContent.displayName = 'DropdownMenu.CascadeSubContent';\n\ninterface DrillDownPanelProps extends DropdownMenuSubContentProps {\n store: NonNullable<ReturnType<typeof useDrillDownStore>>;\n sub: NonNullable<ReturnType<typeof useSubContext>>;\n}\n\n/**\n * A submenu rendered inline in drill-down mode. It mounts its children only\n * while it is on the navigation stack, and shows its own items only while it\n * is the top level; deeper panels inside it stay mounted.\n */\nconst DrillDownPanel = React.forwardRef<DropdownMenuSubContentElement, DrillDownPanelProps>(\n ({ store, sub, ...props }, forwardedRef) => {\n const position = usePanelPosition(store, sub.id);\n const entry = useStackEntry(store, sub.id);\n\n if (position === 'closed') return null;\n\n const {\n className,\n children,\n container: _container,\n forceMount: _forceMount,\n virtualized: _virtualized,\n size: _size,\n color: _color,\n ...panelProps\n } = omitPopperProps(props);\n\n const isTop = position === 'top';\n const name = entry?.name || (typeof sub.label === 'string' ? sub.label : '');\n\n return (\n <div\n role=\"group\"\n aria-label={name || undefined}\n {...panelProps}\n ref={forwardedRef}\n data-drill-down-panel={sub.id}\n data-drill-down-active={isTop ? true : undefined}\n className={classNames('kui-DropdownMenuDrillDownPanel', className)}\n >\n {isTop && (\n <>\n <DrillDownBackItem label={sub.label} name={name} />\n <DropdownMenuPrimitive.Separator className=\"kui-BaseMenuSeparator kui-DropdownMenuSeparator\" />\n </>\n )}\n <MenuGroupLabelProvider value={null}>\n <DrillDownLevelContext.Provider value={isTop}>{children}</DrillDownLevelContext.Provider>\n </MenuGroupLabelProvider>\n </div>\n );\n },\n);\nDrillDownPanel.displayName = 'DropdownMenu.DrillDownPanel';\n\ntype DropdownMenuTriggerIconElement = React.ElementRef<'svg'>;\ninterface DropdownMenuTriggerIconProps extends IconProps {}\nconst DropdownMenuTriggerIcon = React.forwardRef<\n DropdownMenuTriggerIconElement,\n DropdownMenuTriggerIconProps\n>(({ className, ...props }, forwardedRef) => (\n <ChevronDownIcon\n {...props}\n ref={forwardedRef}\n className={classNames('kui-DropdownMenuTriggerIcon', className)}\n />\n));\nDropdownMenuTriggerIcon.displayName = 'DropdownMenu.TriggerIcon';\n\nexport {\n DropdownMenuRoot as Root,\n DropdownMenuTrigger as Trigger,\n DropdownMenuTriggerIcon as TriggerIcon,\n DropdownMenuContent as Content,\n DropdownMenuLabel as Label,\n DropdownMenuItem as Item,\n DropdownMenuGroup as Group,\n DropdownMenuRadioGroup as RadioGroup,\n DropdownMenuRadioItem as RadioItem,\n DropdownMenuCheckboxItem as CheckboxItem,\n DropdownMenuSub as Sub,\n DropdownMenuSubTrigger as SubTrigger,\n DropdownMenuSubContent as SubContent,\n DropdownMenuSeparator as Separator,\n};\n\nexport type {\n DropdownMenuRootProps as RootProps,\n DropdownMenuTriggerProps as TriggerProps,\n DropdownMenuTriggerIconProps as TriggerIconProps,\n DropdownMenuContentProps as ContentProps,\n DropdownMenuLabelProps as LabelProps,\n DropdownMenuItemProps as ItemProps,\n DropdownMenuGroupProps as GroupProps,\n DropdownMenuRadioGroupProps as RadioGroupProps,\n DropdownMenuRadioItemProps as RadioItemProps,\n DropdownMenuCheckboxItemProps as CheckboxItemProps,\n DropdownMenuSubProps as SubProps,\n DropdownMenuSubTriggerProps as SubTriggerProps,\n DropdownMenuSubContentProps as SubContentProps,\n DropdownMenuSeparatorProps as SeparatorProps,\n SubmenuBehavior,\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { useComposedRefs } from 'radix-ui/internal';\n\nimport { scrollAreaPropDefs } from './scroll-area.props.js';\nimport { useScrollEdges } from '../hooks/use-scroll-edges.js';\nimport { useThumbSync } from '../hooks/use-thumb-sync.js';\nimport { getSubtree } from '../helpers/get-subtree.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\n\ntype ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Viewport>;\ntype ScrollAreaOwnProps = GetPropDefTypes<typeof scrollAreaPropDefs>;\ninterface ScrollAreaProps\n extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>,\n ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>,\n ScrollAreaOwnProps,\n WidthProps,\n HeightProps {}\n\n/** Menus and listboxes move focus between their items, so a scroller inside one stays out of the tab order. */\nconst OWNS_FOCUS = '[role=\"menu\"], [role=\"listbox\"]';\n\n/**\n * Puts the viewport in the tab order while it has something to scroll, so a keyboard can reach it\n * and scroll it with the arrow keys. A `tabIndex` the caller set wins.\n */\nfunction useFocusableWhileScrollable(element: HTMLDivElement | null, enabled: boolean) {\n React.useEffect(() => {\n if (!enabled || !element || element.closest(OWNS_FOCUS)) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n const scrollable = element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;\n if (scrollable) element.setAttribute('tabindex', '0');\n else element.removeAttribute('tabindex');\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(update);\n };\n update();\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n return () => {\n if (frame) cancelAnimationFrame(frame);\n // The attribute stays: a caller who now sets `tabIndex` has already written it.\n observer?.disconnect();\n };\n }, [element, enabled]);\n}\n\nconst ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n style,\n type,\n scrollHideDelay = type !== 'scroll' ? 0 : undefined,\n dir,\n radius = scrollAreaPropDefs.radius.default,\n scrollbars = scrollAreaPropDefs.scrollbars.default,\n fade = scrollAreaPropDefs.fade.default,\n ...viewportProps\n } = extractProps(props, widthPropDefs, heightPropDefs);\n const [viewport, setViewport] = React.useState<HTMLDivElement | null>(null);\n const setEdgesElement = useScrollEdges<HTMLDivElement>(fade);\n const setThumbViewport = useThumbSync<HTMLDivElement>();\n const viewportRef = useComposedRefs(forwardedRef, setEdgesElement, setThumbViewport, setViewport);\n useFocusableWhileScrollable(viewport, viewportProps.tabIndex === undefined);\n // A named scroller is a region, so a screen reader can find it and say what it holds.\n const named = viewportProps['aria-label'] !== undefined || viewportProps['aria-labelledby'] !== undefined;\n\n return (\n <ScrollAreaPrimitive.Root\n type={type}\n scrollHideDelay={scrollHideDelay}\n dir={dir}\n className={classNames('kui-ScrollAreaRoot', className)}\n data-fade={fade ? '' : undefined}\n style={style}\n asChild={asChild}\n >\n {getSubtree({ asChild, children }, (children) => (\n <>\n <ScrollAreaPrimitive.Viewport\n role={named ? 'region' : undefined}\n {...viewportProps}\n ref={viewportRef}\n className=\"kui-ScrollAreaViewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n\n <div className=\"kui-ScrollAreaViewportFocusRing\" />\n\n {scrollbars !== 'vertical' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"horizontal\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars !== 'horizontal' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"vertical\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars === 'both' ? (\n <ScrollAreaPrimitive.Corner className=\"kui-ScrollAreaCorner\" />\n ) : null}\n </>\n ))}\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport { ScrollArea };\nexport type { ScrollAreaProps };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst scrollbarsValues = ['vertical', 'horizontal', 'both'] as const;\n\nconst scrollAreaPropDefs = {\n ...asChildPropDef,\n ...radiusPropDef,\n scrollbars: { type: 'enum', values: scrollbarsValues, default: 'both' },\n /**\n * Fades the content toward the top and bottom edges while there is more content past them.\n * An edge with nothing hidden past it does not fade. A floating band over an edge can set\n * `--scroll-fade-start` or `--scroll-fade-end` to its height, so content fades as it passes\n * under the band.\n */\n fade: { type: 'boolean', default: false },\n} satisfies {\n scrollbars: PropDef<(typeof scrollbarsValues)[number]>;\n fade: PropDef<boolean>;\n};\n\nexport { scrollAreaPropDefs };\n", "import * as React from 'react';\n\n/**\n * Publishes how much content is hidden past each edge of a scroller, as\n * `--scroll-overflow-start` and `--scroll-overflow-end` (block axis) and\n * `--scroll-overflow-x-start` and `--scroll-overflow-x-end` (inline axis, from\n * the inline start, so right-to-left reads the same) in px on the element.\n * The scroll fade reads them, so an edge fades only while content is hidden\n * there, and the fade ramps in over the first pixels of scrolling.\n *\n * Writes happen at most once per frame, on scroll and when the element or its\n * content resizes. Nothing re-renders.\n */\nexport function useScrollEdges<T extends HTMLElement>(enabled: boolean) {\n const [element, setElement] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n if (!enabled || !element) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n const start = Math.max(0, element.scrollTop);\n const end = Math.max(0, element.scrollHeight - element.clientHeight - element.scrollTop);\n element.style.setProperty('--scroll-overflow-start', `${start}px`);\n element.style.setProperty('--scroll-overflow-end', `${end}px`);\n // scrollLeft runs negative in right-to-left, so its size is the distance from the inline start.\n const xStart = Math.abs(element.scrollLeft);\n const xEnd = Math.max(0, element.scrollWidth - element.clientWidth - xStart);\n element.style.setProperty('--scroll-overflow-x-start', `${xStart}px`);\n element.style.setProperty('--scroll-overflow-x-end', `${xEnd}px`);\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n write();\n element.addEventListener('scroll', schedule, { passive: true });\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n const mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver(schedule);\n mutations?.observe(element, { childList: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n element.removeEventListener('scroll', schedule);\n observer?.disconnect();\n mutations?.disconnect();\n element.style.removeProperty('--scroll-overflow-start');\n element.style.removeProperty('--scroll-overflow-end');\n element.style.removeProperty('--scroll-overflow-x-start');\n element.style.removeProperty('--scroll-overflow-x-end');\n };\n }, [enabled, element]);\n\n return setElement;\n}\n", "import * as React from 'react';\n\n/**\n * Keeps a Radix ScrollArea's thumbs on the scroll position on every scroll.\n *\n * Radix moves a thumb from a requestAnimationFrame loop it starts on the first scroll event of a\n * burst. Next's production minifier compiles that self-calling loop away, so in a production\n * build the thumb moves once, sits while the content scrolls, and jumps when the next burst\n * starts. This writes the transform Radix would, at most once per frame. Nothing re-renders.\n *\n * Pass the hook's setter as a ref on `ScrollArea.Viewport`; the scrollbars are its siblings.\n */\nexport function useThumbSync<T extends HTMLElement>() {\n const [viewport, setViewport] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n const root = viewport?.parentElement;\n if (!viewport || !root) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n for (const thumb of root.querySelectorAll<HTMLElement>(':scope > .kui-ScrollAreaScrollbar > .kui-ScrollAreaThumb')) {\n const scrollbar = thumb.parentElement as HTMLElement;\n const style = getComputedStyle(scrollbar);\n if (scrollbar.dataset.orientation === 'horizontal') {\n const track = scrollbar.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);\n const offset = thumbOffset(viewport.scrollLeft, viewport.scrollWidth - viewport.offsetWidth, track - thumb.offsetWidth);\n thumb.style.transform = `translate3d(${offset}px, 0, 0)`;\n } else {\n const track = scrollbar.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n const offset = thumbOffset(viewport.scrollTop, viewport.scrollHeight - viewport.offsetHeight, track - thumb.offsetHeight);\n thumb.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n }\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n viewport.addEventListener('scroll', schedule, { passive: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n viewport.removeEventListener('scroll', schedule);\n };\n }, [viewport]);\n\n return setViewport;\n}\n\n/** Radix's mapping: scroll position over its range, onto the room the thumb has to travel. */\nfunction thumbOffset(position: number, range: number, travel: number) {\n if (range <= 0 || travel <= 0) return 0;\n // Right-to-left scrolls run from -range to 0; the thumb then travels from -travel to 0.\n const clamped = Math.min(Math.max(position, -range), range);\n return (clamped / range) * travel;\n}\n", "import * as React from 'react';\n\n/**\n * This is a helper function that is used when a component supports `asChild`\n * using the `Slot` component but its implementation contains nested DOM elements.\n *\n * Using it ensures if a consumer uses the `asChild` prop, the elements are in\n * correct order in the DOM, adopting the intended consumer `children`.\n */\nexport function getSubtree(\n options: { asChild: boolean | undefined; children: React.ReactNode },\n content: React.ReactNode | ((children: React.ReactNode) => React.ReactNode)\n) {\n const { asChild, children } = options;\n if (!asChild) return typeof content === 'function' ? content(children) : content;\n\n const firstChild = React.Children.only(children) as React.ReactElement;\n return React.cloneElement(firstChild, {\n // @ts-expect-error\n children: typeof content === 'function' ? content(firstChild.props.children) : content,\n });\n}\n", "import { asChildPropDef } from '../../props/as-child.prop.js';\nimport { colorPropDef } from '../../props/color.prop.js';\n\nimport type { PropDef } from '../../props/prop-def.js';\n\nconst contentSizes = ['1', '2', '3', '4'] as const;\nconst submenuBehaviors = ['cascade', 'drill-down'] as const;\n\n// Base props shared between Content and SubContent\nconst baseMenuSharedPropDefs = {\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: contentSizes,\n default: '2',\n responsive: true,\n },\n ...colorPropDef,\n} satisfies {\n size: PropDef<(typeof contentSizes)[number]>;\n};\n\n// Content-specific props (includes submenuBehavior)\nconst baseMenuContentPropDefs = {\n ...baseMenuSharedPropDefs,\n /**\n * Controls how submenus behave.\n * - `cascade`: Default cascading behavior where submenus open to the side (portal-based)\n * - `drill-down`: Mobile-friendly behavior where submenus replace the content inline\n * Supports responsive values: `{ initial: 'drill-down', md: 'cascade' }`\n */\n submenuBehavior: {\n type: 'enum',\n values: submenuBehaviors,\n default: 'cascade',\n responsive: true,\n },\n} satisfies {\n size: PropDef<(typeof contentSizes)[number]>;\n submenuBehavior: PropDef<(typeof submenuBehaviors)[number]>;\n};\n\n// SubContent props (no submenuBehavior)\nconst baseMenuSubContentPropDefs = baseMenuSharedPropDefs;\n\nconst baseMenuItemPropDefs = {\n ...asChildPropDef,\n ...colorPropDef,\n shortcut: { type: 'string' },\n} satisfies {\n shortcut: PropDef<string>;\n};\n\nconst baseMenuCheckboxItemPropDefs = {\n ...colorPropDef,\n shortcut: { type: 'string' },\n} satisfies {\n shortcut: PropDef<string>;\n};\n\nconst baseMenuRadioItemPropDefs = {\n ...colorPropDef,\n};\n\nexport {\n baseMenuContentPropDefs,\n baseMenuSubContentPropDefs,\n baseMenuItemPropDefs,\n baseMenuCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs,\n submenuBehaviors,\n};\n", "'use client';\n\nimport * as React from 'react';\n\nimport type { submenuBehaviors } from './base-menu.props.js';\n\ntype SubmenuBehavior = (typeof submenuBehaviors)[number];\n\n/*\n * Drill-down navigation for DropdownMenu.\n *\n * The stack of open submenus lives in a small external store rather than in\n * React state, so each part subscribes only to the slice it renders from:\n * a panel re-renders when it enters or leaves the stack, a Sub when its own\n * open state changes, and nothing else on the path re-renders on navigation.\n *\n * Only the levels on the stack mount their children, and only the top level\n * mounts its items (see `DrillDownLevelContext`). That keeps the Radix item\n * collection limited to what is on screen, so roving focus and typeahead\n * never land on a hidden item.\n */\n\ntype Modality = 'keyboard' | 'pointer';\n\ninterface StackEntry {\n id: string;\n /** Accessible name of the submenu, taken from its trigger text */\n name: string;\n /** Scroll position of the parent level when this entry was pushed */\n scrollTop: number;\n}\n\ntype LastChange =\n | { type: 'push'; id: string; modality: Modality | null }\n | { type: 'pop'; id: string; modality: Modality | null; scrollTop: number }\n | { type: 'reset' };\n\ninterface DrillDownState {\n stack: StackEntry[];\n lastChange: LastChange | null;\n}\n\nconst INITIAL_STATE: DrillDownState = { stack: [], lastChange: null };\n\nconst PANEL_ITEM_SELECTOR = '[role^=\"menuitem\"]:not([data-disabled])';\nconst BACK_ITEM_CLASS = 'kui-DropdownMenuDrillDownBackItem';\n\nfunction escapeAttributeValue(value: string) {\n return value.replace(/[\"\\\\]/g, '\\\\$&');\n}\n\nclass DrillDownStore {\n private state = INITIAL_STATE;\n private listeners = new Set<() => void>();\n private modality: Modality = 'keyboard';\n /**\n * Controlled submenus. A request to open or close one of them goes to its\n * `onOpenChange` instead of the stack; its `open` prop then moves the stack.\n */\n private controllers = new Map<string, (open: boolean) => void>();\n private pendingModality = new Map<string, Modality | null>();\n /** The drill-down root element, set by the provider */\n rootElement: HTMLElement | null = null;\n\n setRootElement = (element: HTMLElement | null) => {\n this.rootElement = element;\n };\n\n getState = () => this.state;\n\n subscribe = (listener: () => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n private setState(next: DrillDownState) {\n this.state = next;\n this.listeners.forEach((listener) => listener());\n }\n\n /** Records how the user is interacting, so focus can follow the same model as Radix. */\n setModality = (modality: Modality) => {\n this.modality = modality;\n };\n\n getModality = () => this.modality;\n\n getDepth = () => this.state.stack.length;\n\n isOpen = (id: string) => this.state.stack.some((entry) => entry.id === id);\n\n setController = (id: string, onOpenChange: ((open: boolean) => void) | null) => {\n if (onOpenChange) this.controllers.set(id, onOpenChange);\n else this.controllers.delete(id);\n };\n\n /** The modality of the last open or close request for a controlled submenu. */\n takePendingModality = (id: string) => {\n const modality = this.pendingModality.get(id) ?? null;\n this.pendingModality.delete(id);\n return modality;\n };\n\n private request(id: string, open: boolean, modality: Modality | null) {\n const controller = this.controllers.get(id);\n if (!controller) return false;\n this.pendingModality.set(id, modality);\n controller(open);\n return true;\n }\n\n private getScrollContainer() {\n const root = this.rootElement;\n if (!root) return null;\n return (\n root.closest<HTMLElement>('.kui-ScrollAreaViewport') ??\n root.closest<HTMLElement>('.kui-BaseMenuViewport')\n );\n }\n\n private getTrigger(id: string) {\n return this.rootElement?.querySelector<HTMLElement>(\n `[data-drill-down-trigger=\"${escapeAttributeValue(id)}\"]`,\n );\n }\n\n /**\n * Opens a submenu. `modality` decides where focus goes: the first item for\n * keyboard, the menu for pointer, and nowhere for a programmatic open\n * (`null`) unless focus was lost.\n */\n push = (id: string, modality: Modality | null = this.modality) => {\n const { stack } = this.state;\n if (stack.some((entry) => entry.id === id)) return;\n if (this.request(id, true, modality)) return;\n this.open(id, modality);\n };\n\n /** Puts a submenu on the stack, bypassing its controller. */\n open = (id: string, modality: Modality | null = null) => {\n const { stack } = this.state;\n if (stack.some((entry) => entry.id === id)) return;\n const trigger = this.getTrigger(id);\n const name = (trigger?.dataset.drillDownName ?? trigger?.textContent ?? '').trim();\n const scrollTop = this.getScrollContainer()?.scrollTop ?? 0;\n this.setState({\n stack: [...stack, { id, name, scrollTop }],\n lastChange: { type: 'push', id, modality },\n });\n };\n\n pop = (modality: Modality = this.modality) => {\n const { stack } = this.state;\n const top = stack[stack.length - 1];\n if (!top) return;\n if (this.request(top.id, false, modality)) return;\n this.setState({\n stack: stack.slice(0, -1),\n lastChange: { type: 'pop', id: top.id, modality, scrollTop: top.scrollTop },\n });\n };\n\n /**\n * Closes a submenu and everything opened from it, bypassing its controller.\n * Focus moves to its trigger only for a keyboard close.\n */\n close = (id: string, modality: Modality | null = null) => {\n const { stack } = this.state;\n const index = stack.findIndex((entry) => entry.id === id);\n if (index === -1) return;\n this.setState({\n stack: stack.slice(0, index),\n lastChange: { type: 'pop', id, modality, scrollTop: stack[index].scrollTop },\n });\n };\n\n reset = () => {\n if (this.state.stack.length === 0) return;\n this.setState({ stack: [], lastChange: { type: 'reset' } });\n };\n\n /**\n * Moves focus and scroll after a navigation step has been committed. Runs in\n * a layout effect, so the new level is already in the DOM and nothing paints\n * with focus on `<body>` or at the old scroll position.\n */\n applyLastChange() {\n const change = this.state.lastChange;\n const root = this.rootElement;\n if (!change || !root) return;\n this.state = { ...this.state, lastChange: null };\n\n const content = root.closest<HTMLElement>('[role=\"menu\"]');\n const scroller = this.getScrollContainer();\n const focus = (element: HTMLElement | null | undefined) => element?.focus({ preventScroll: true });\n\n if (change.type === 'push') {\n if (scroller) scroller.scrollTop = 0;\n const panel = root.querySelector<HTMLElement>(\n `[data-drill-down-panel=\"${escapeAttributeValue(change.id)}\"]`,\n );\n if (change.modality === 'keyboard') {\n // Land on the first real option; the back row stays one ArrowUp away.\n const items = panel ? Array.from(panel.querySelectorAll<HTMLElement>(PANEL_ITEM_SELECTOR)) : [];\n focus(items.find((item) => !item.classList.contains(BACK_ITEM_CLASS)) ?? items[0] ?? content);\n } else if (change.modality === 'pointer' || !root.contains(document.activeElement)) {\n // Match Radix: pointer users get focus on the menu, not a highlighted item.\n focus(content);\n }\n return;\n }\n\n if (change.type === 'pop') {\n if (scroller) scroller.scrollTop = change.scrollTop;\n const trigger = this.getTrigger(change.id);\n if (change.modality === 'keyboard') {\n focus(trigger ?? content);\n } else if (change.modality === 'pointer' || !root.contains(document.activeElement)) {\n focus(content);\n }\n return;\n }\n\n if (scroller) scroller.scrollTop = 0;\n }\n}\n\nconst DrillDownStoreContext = React.createContext<DrillDownStore | null>(null);\n\n/**\n * Whether the items of the current level are on screen. The root level and\n * every panel provide it; menu parts render nothing when it is false.\n */\nconst DrillDownLevelContext = React.createContext(true);\n\nfunction useDrillDownStore() {\n return React.useContext(DrillDownStoreContext);\n}\n\nfunction useCreateDrillDownStore() {\n const [store] = React.useState(() => new DrillDownStore());\n return store;\n}\n\nconst selectDepth = (state: DrillDownState) => state.stack.length;\nconst getServerDepth = () => 0;\n\ninterface DrillDownRootProps {\n store: DrillDownStore;\n behavior: SubmenuBehavior;\n /** Open state of the menu; the stack resets every time the menu opens */\n open: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Provides the drill-down store and renders the root level. The wrapper is\n * the same element in both behaviors, so crossing a breakpoint that switches\n * between cascade and drill-down does not remount the items.\n */\nfunction DrillDownRoot({ store, behavior, open, children }: DrillDownRootProps) {\n const isDrillDown = behavior === 'drill-down';\n const depth = React.useSyncExternalStore(\n store.subscribe,\n () => selectDepth(store.getState()),\n getServerDepth,\n );\n const isRoot = !isDrillDown || depth === 0;\n\n // Cascade mode has no stack. A reset while switching modes keeps the next\n // switch back to drill-down from resuming a stale level.\n React.useLayoutEffect(() => {\n if (!isDrillDown) store.reset();\n }, [isDrillDown, store]);\n\n // Start every opening at the root. Content usually remounts on open anyway;\n // this covers `forceMount`. Resetting on open rather than on close keeps the\n // closing animation on the level the user was looking at.\n const wasOpenRef = React.useRef(open);\n React.useLayoutEffect(() => {\n if (open && !wasOpenRef.current) store.reset();\n wasOpenRef.current = open;\n }, [open, store]);\n\n // Focus and scroll follow each navigation step once it is in the DOM.\n React.useLayoutEffect(() => {\n store.applyLastChange();\n }, [depth, store]);\n\n const rootRef = React.useCallback((element: HTMLDivElement | null) => store.setRootElement(element), [store]);\n const handleKeyDownCapture = React.useCallback(() => store.setModality('keyboard'), [store]);\n const handlePointerDownCapture = React.useCallback(() => store.setModality('pointer'), [store]);\n\n return (\n <DrillDownStoreContext.Provider value={isDrillDown ? store : null}>\n {/* Event capture only records the input modality; it does not handle interaction. */}\n <div\n ref={rootRef}\n className=\"kui-DropdownMenuDrillDownRoot\"\n data-submenu-behavior={behavior}\n data-drill-down-active={isRoot ? undefined : true}\n onKeyDownCapture={isDrillDown ? handleKeyDownCapture : undefined}\n onPointerDownCapture={isDrillDown ? handlePointerDownCapture : undefined}\n >\n <DrillDownLevelContext.Provider value={isRoot}>{children}</DrillDownLevelContext.Provider>\n </div>\n </DrillDownStoreContext.Provider>\n );\n}\n\n/** Where a submenu sits in the stack: not open, open under another level, or on top. */\ntype PanelPosition = 'closed' | 'open' | 'top';\n\nfunction usePanelPosition(store: DrillDownStore | null, id: string): PanelPosition {\n const getSnapshot = React.useCallback((): PanelPosition => {\n if (!store) return 'closed';\n const { stack } = store.getState();\n if (stack.length > 0 && stack[stack.length - 1].id === id) return 'top';\n return stack.some((entry) => entry.id === id) ? 'open' : 'closed';\n }, [store, id]);\n return React.useSyncExternalStore(store?.subscribe ?? noopSubscribe, getSnapshot, getClosed);\n}\n\nfunction useStackEntry(store: DrillDownStore | null, id: string): StackEntry | undefined {\n const getSnapshot = React.useCallback(\n () => store?.getState().stack.find((entry) => entry.id === id),\n [store, id],\n );\n return React.useSyncExternalStore(store?.subscribe ?? noopSubscribe, getSnapshot, getUndefined);\n}\n\nconst noopSubscribe = () => () => {};\nconst getClosed = (): PanelPosition => 'closed';\nconst getUndefined = () => undefined;\n\n// ============================================================================\n// Sub Context (for individual submenu instances)\n// ============================================================================\n\ninterface SubContextValue {\n /** Unique ID for this submenu */\n id: string;\n /** Label for the back button */\n label: React.ReactNode;\n}\n\nconst SubContext = React.createContext<SubContextValue | null>(null);\n\nfunction useSubContext() {\n return React.useContext(SubContext);\n}\n\nexport {\n DrillDownRoot,\n DrillDownLevelContext,\n SubContext,\n useCreateDrillDownStore,\n useDrillDownStore,\n usePanelPosition,\n useStackEntry,\n useSubContext,\n};\n\nexport type { SubmenuBehavior, DrillDownStore, PanelPosition, SubContextValue };\n", "'use client';\n\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\n\nimport { useResolvedResponsiveValue } from './base-menu.utils.js';\n\nimport type { Responsive } from '../../props/prop-def.js';\n\n/**\n * Context to detect if a component is rendered inside a menu (DropdownMenu, ContextMenu, etc.)\n * Used by VirtualMenu to adjust its behavior:\n * - Skip role=\"menu\" when inside a parent menu (parent owns the role)\n * - Delegate certain keyboard handling to parent\n * - Use the correct item height based on menu size\n */\n\nexport type MenuSize = '1' | '2' | '3' | '4';\n\ninterface MenuContextValue {\n /** Whether we're inside a menu that owns the menu role */\n isInsideMenu: boolean;\n /** Menu size for the current breakpoint */\n size?: MenuSize;\n /** Item height in px for the current size and theme scaling */\n itemHeight?: number;\n}\n\nconst MenuContext = React.createContext<MenuContextValue>({ isInsideMenu: false });\n\n/** The register function of the menu Group a Label sits in (see useMenuGroupLabelId). */\nconst MenuGroupLabelContext = React.createContext<((id: string | null) => void) | null>(null);\n\ninterface MenuProviderProps {\n children: React.ReactNode;\n /** Menu size passed from parent (DropdownMenu.Content, ContextMenu.Content, etc.) */\n size?: Responsive<MenuSize>;\n}\n\n/**\n * Menu row height in pixels per size: the line height plus --row-inset-N above and below\n * (base-menu.css), never under the 24px target floor.\n */\nexport const menuSizeToItemHeight: Record<MenuSize, number> = {\n '1': 24,\n '2': 30,\n '3': 34,\n '4': 38,\n};\n\nexport function getMenuItemHeight(size: MenuSize): number {\n return menuSizeToItemHeight[size];\n}\n\nexport function MenuProvider({ children, size }: MenuProviderProps) {\n const resolvedSize = useResolvedResponsiveValue<MenuSize | undefined>(size, undefined);\n const itemHeight = resolvedSize ? getMenuItemHeight(resolvedSize) : undefined;\n const value = React.useMemo(\n () => ({ isInsideMenu: true, size: resolvedSize, itemHeight }),\n [resolvedSize, itemHeight],\n );\n // A submenu is its own surface, so its labels never name a group of the parent menu.\n return (\n <MenuContext.Provider value={value}>\n <MenuGroupLabelContext.Provider value={null}>{children}</MenuGroupLabelContext.Provider>\n </MenuContext.Provider>\n );\n}\n\nexport function useMenuContext() {\n return React.useContext(MenuContext);\n}\n\n/**\n * Closes the whole menu from inside it. DropdownMenu.Root and ContextMenu.Root provide it,\n * so a VirtualMenu row can close the menu on select the way a menu item does.\n */\nconst MenuCloseContext = React.createContext<(() => void) | undefined>(undefined);\nexport const MenuCloseProvider = MenuCloseContext.Provider;\n\nexport function useMenuClose() {\n return React.useContext(MenuCloseContext);\n}\n\n/**\n * Names a menu group by its label, the way v2's MenuGroup does. A Group holds the id of\n * the Label inside it and points aria-labelledby at it, so a screen reader announces the\n * section name when focus enters the group.\n */\nexport const MenuGroupLabelProvider = MenuGroupLabelContext.Provider;\n\n/** For a Group: the id its aria-labelledby points to, and the setter a nested Label calls. */\nexport function useMenuGroupLabelledBy(ariaLabelledBy: string | undefined) {\n const [labelId, setLabelId] = React.useState<string | null>(null);\n return [ariaLabelledBy ?? labelId ?? undefined, setLabelId] as const;\n}\n\n/** For a Label: its id, registered with the Group it sits in while the label is rendered. */\nexport function useMenuGroupLabelId(idProp: string | undefined, rendered = true) {\n const register = React.useContext(MenuGroupLabelContext);\n const generatedId = React.useId();\n const id = idProp ?? generatedId;\n useLayoutEffect(() => {\n if (!register || !rendered) return;\n register(id);\n return () => register(null);\n }, [register, id, rendered]);\n return register ? id : idProp;\n}\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Kbd } from '../kbd.js';\nimport { useBreakpoint } from '../../hooks/use-breakpoint.js';\n\nimport type { Breakpoint, Responsive } from '../../props/prop-def.js';\n\nconst BREAKPOINTS_DESCENDING: Breakpoint[] = ['xl', 'lg', 'md', 'sm', 'xs', 'initial'];\n\n/**\n * Resolves a responsive value for the given breakpoint, falling back through\n * the smaller breakpoints when the current one is not set.\n */\nfunction resolveResponsiveValue<T>(\n value: T | Partial<Record<Breakpoint, T>> | undefined,\n currentBreakpoint: Breakpoint,\n defaultValue: T,\n): T {\n if (value === undefined || value === null) return defaultValue;\n if (typeof value !== 'object') return value;\n\n const map = value as Partial<Record<Breakpoint, T>>;\n for (let i = BREAKPOINTS_DESCENDING.indexOf(currentBreakpoint); i < BREAKPOINTS_DESCENDING.length; i++) {\n const resolved = map[BREAKPOINTS_DESCENDING[i]];\n if (resolved !== undefined) return resolved;\n }\n return defaultValue;\n}\n\n/**\n * Resolves a possibly responsive value against the current viewport. Only a\n * responsive object subscribes to breakpoint changes; a plain value costs\n * nothing.\n */\nfunction useResolvedResponsiveValue<T>(value: Responsive<T> | undefined, defaultValue: T): T {\n const isResponsive = typeof value === 'object' && value !== null;\n const { breakpoint } = useBreakpoint(isResponsive);\n return resolveResponsiveValue(value as T | Partial<Record<Breakpoint, T>> | undefined, breakpoint, defaultValue);\n}\n\n/** Content padding per menu size, in px (see base-menu.css). */\n// The panel padding ladder (--panel-p-N).\nconst CONTENT_PADDING: Record<string, number> = { '1': 8, '2': 12, '3': 16, '4': 24 };\n\n/**\n * Offset that lines the first item of a menu up with its anchor: the pointer\n * for a context menu, or the sub trigger for a submenu. It cancels the content\n * padding.\n */\nfunction getMenuAlignOffset(size: string): number {\n return -(CONTENT_PADDING[size] ?? CONTENT_PADDING['2']);\n}\n\nconst KEY_SYMBOLS: Record<string, string> = {\n '\u2318': 'Meta',\n cmd: 'Meta',\n command: 'Meta',\n meta: 'Meta',\n '\u2325': 'Alt',\n option: 'Alt',\n opt: 'Alt',\n alt: 'Alt',\n '\u21E7': 'Shift',\n shift: 'Shift',\n '\u2303': 'Control',\n ctrl: 'Control',\n control: 'Control',\n '\u232B': 'Backspace',\n '\u2326': 'Delete',\n '\u23CE': 'Enter',\n '\u21B5': 'Enter',\n '\u238B': 'Escape',\n esc: 'Escape',\n '\u21E5': 'Tab',\n '\u2191': 'ArrowUp',\n '\u2193': 'ArrowDown',\n '\u2190': 'ArrowLeft',\n '\u2192': 'ArrowRight',\n};\n\nconst ariaKeyShortcutsCache = new Map<string, string>();\n\n/**\n * Converts a display shortcut such as \"\u2318 \u21E7 P\" or \"Ctrl+S\" into the\n * `aria-keyshortcuts` format (\"Meta+Shift+P\", \"Control+S\").\n */\nfunction toAriaKeyShortcuts(shortcut: string): string | undefined {\n const cached = ariaKeyShortcutsCache.get(shortcut);\n if (cached !== undefined) return cached || undefined;\n\n // Modifier symbols are tokens of their own (\"\u2318\u21E7P\"); otherwise split on \"+\" and spaces.\n const tokens = shortcut.match(/[\u2318\u2325\u21E7\u2303]|[^\\s+\u2318\u2325\u21E7\u2303]+/gu) ?? [];\n const keys = tokens.map((token) => {\n const mapped = KEY_SYMBOLS[token] ?? KEY_SYMBOLS[token.toLowerCase()];\n return mapped ?? (token.length === 1 ? token.toUpperCase() : token);\n });\n const result = keys.join('+');\n ariaKeyShortcutsCache.set(shortcut, result);\n return result || undefined;\n}\n\n/**\n * The keyboard shortcut hint at the end of a menu item. It is hidden from\n * assistive technology because the item exposes it through\n * `aria-keyshortcuts` instead of reading it as part of the item name.\n */\nfunction MenuShortcut({ shortcut, className }: { shortcut: string; className?: string }) {\n return (\n <div aria-hidden className={classNames('kui-BaseMenuShortcut', className)}>\n <Kbd size=\"1\">{shortcut}</Kbd>\n </div>\n );\n}\n\nexport {\n resolveResponsiveValue,\n useResolvedResponsiveValue,\n getMenuAlignOffset,\n toAriaKeyShortcuts,\n MenuShortcut,\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { kbdPropDefs } from './kbd.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype KbdElement = React.ElementRef<'kbd'>;\ntype KbdOwnProps = GetPropDefTypes<typeof kbdPropDefs>;\ninterface KbdProps extends ComponentPropsWithout<'kbd', RemovedProps>, KbdOwnProps {}\nconst Kbd = React.forwardRef<KbdElement, KbdProps>((props, forwardedRef) => {\n const { asChild, className, ...kbdProps } = extractProps(props, kbdPropDefs);\n const Comp = asChild ? Slot.Root : 'kbd';\n return (\n <Comp\n {...kbdProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-Kbd', className)}\n />\n );\n});\nKbd.displayName = 'Kbd';\n\nexport { Kbd };\nexport type { KbdProps };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\nconst variants = ['raised', 'soft'] as const;\n\nconst kbdPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n responsive: true,\n },\n variant: {\n type: 'enum',\n className: 'kui-variant',\n values: variants,\n default: 'raised',\n },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n};\n\nexport { kbdPropDefs };\n", "'use client';\n\nimport * as React from 'react';\nimport { _BREAKPOINTS, type Breakpoint } from '../components/shell.types.js';\n\nconst QUERIES = Object.entries(_BREAKPOINTS) as Array<[Breakpoint, string]>;\n\ntype Listener = () => void;\n\n/**\n * One set of `MediaQueryList`s and one set of listeners for the whole\n * application. Every component that asks for the breakpoint used to create and\n * subscribe to its own copy of all five queries.\n */\nlet mediaQueryLists: Array<[Breakpoint, MediaQueryList]> | null = null;\nconst listeners = new Set<Listener>();\nlet cachedBreakpoint: Breakpoint | null = null;\n\nfunction getMediaQueryLists() {\n mediaQueryLists ??= QUERIES.map(([name, query]) => [name, window.matchMedia(query)] as [Breakpoint, MediaQueryList]);\n return mediaQueryLists;\n}\n\nfunction computeBreakpoint(): Breakpoint {\n // The largest matching query wins; `_BREAKPOINTS` is ordered smallest first.\n let matched: Breakpoint = 'initial';\n for (const [name, mql] of getMediaQueryLists()) {\n if (mql.matches) matched = name;\n }\n return matched;\n}\n\nfunction handleChange() {\n const next = computeBreakpoint();\n if (next === cachedBreakpoint) return;\n cachedBreakpoint = next;\n listeners.forEach((listener) => listener());\n}\n\nfunction subscribe(listener: Listener) {\n if (typeof window === 'undefined') return () => {};\n\n if (listeners.size === 0) {\n cachedBreakpoint = computeBreakpoint();\n for (const [, mql] of getMediaQueryLists()) {\n // Safari below 14 only has the deprecated listener API.\n if (typeof mql.addEventListener === 'function') mql.addEventListener('change', handleChange);\n else mql.addListener?.(handleChange);\n }\n }\n\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n if (listeners.size > 0) return;\n\n for (const [, mql] of getMediaQueryLists()) {\n try {\n if (typeof mql.removeEventListener === 'function') mql.removeEventListener('change', handleChange);\n else mql.removeListener?.(handleChange);\n } catch (error) {\n // Removal can throw in edge cases, e.g. the list was already torn down.\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[useBreakpoint] MediaQueryList cleanup warning:', error);\n }\n }\n }\n cachedBreakpoint = null;\n };\n}\n\n/**\n * `getSnapshot` must return a referentially stable value between changes, so it\n * reads the cache that `handleChange` maintains rather than recomputing.\n */\nfunction getSnapshot(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n cachedBreakpoint ??= computeBreakpoint();\n return cachedBreakpoint;\n}\n\nfunction getServerSnapshot(): Breakpoint {\n return 'initial';\n}\n\n/**\n * The breakpoint right now, outside React's render. For an effect that needs\n * the answer at the moment it runs rather than the one its render saw.\n */\nexport function readBreakpoint(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n return computeBreakpoint();\n}\n\nconst getReadySnapshot = () => true;\nconst getReadyServerSnapshot = () => false;\n\nconst noopSubscribe = () => () => {};\nconst getInitialSnapshot = (): Breakpoint => 'initial';\n\n/**\n * The current breakpoint, and whether it has been resolved against a real\n * viewport yet (`false` on the server and during hydration).\n *\n * Reads through `useSyncExternalStore` rather than settling into state from an\n * effect. On a client render the very first pass already has the real\n * breakpoint, instead of rendering the whole shell at `initial` and correcting\n * it after the browser has painted.\n *\n * Pass `enabled = false` to skip the subscription (the breakpoint then reads as\n * `initial`).\n */\nexport function useBreakpoint(enabled = true): { breakpoint: Breakpoint; ready: boolean } {\n // Callers with a non-responsive value pass `enabled = false` so they neither\n // subscribe to the media queries nor re-render when the viewport crosses one.\n const breakpoint = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n enabled ? getSnapshot : getInitialSnapshot,\n getServerSnapshot,\n );\n const ready = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n getReadySnapshot,\n getReadyServerSnapshot,\n );\n\n return React.useMemo(() => ({ breakpoint, ready }), [breakpoint, ready]);\n}\n", "import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\nexport type PaneSizePersistence = {\n load?: () => number | Promise<number | undefined> | undefined;\n save?: (size: number) => void | Promise<void>;\n};\n\n/**\n * Why a pane's open state changed. Since 0.8.0 only a user action is reported:\n * `toggle` for a Trigger, a handle double-click or a drag past\n * `collapseThreshold`, and `dismiss` for Escape or a press on the scrim.\n * `init`, `responsive`, `panel` and `left` are kept in the types for\n * compatibility and are never sent.\n */\nexport type PaneOpenChangeReason = 'toggle' | 'dismiss' | 'init' | 'responsive';\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n resizable?: boolean;\n collapsible?: boolean;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onExpand?: () => void;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onCollapse?: () => void;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n /** @deprecated Removed in 1.0. Snap in your own `onSizeChange` and pass `size`. */\n snapPoints?: number[];\n /** @deprecated Removed in 1.0, with `snapPoints`. */\n snapTolerance?: number;\n /** @deprecated Removed in 1.0. Close the pane from your own `onResizeEnd`. */\n collapseThreshold?: number;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n paneId?: string;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n persistence?: PaneSizePersistence;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\n/** Every breakpoint, smallest first. The stylesheet's @media blocks follow this order. */\nexport const SHELL_BREAKPOINTS: readonly Breakpoint[] = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'];\n\nexport type PaneTarget = 'left' | 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\n/** The panes a Trigger can drive. `left` is the deprecated name for `rail`. */\nexport type PaneName = Exclude<PaneTarget, 'left'>;\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n [key: CSSCustomProperty]: string | number | undefined;\n};\n", "import * as React from 'react';\n\n/** A function that throws an error when a value isn't a valid React Element, otherwise returns the value */\nexport const requireReactElement = <T extends React.ReactNode>(children: T): T => {\n const isReactElement = React.isValidElement(children);\n\n if (!isReactElement) {\n throw Error(\n `Expected a single React Element child, but got: ${React.Children.toArray(children)\n .map((child) =>\n typeof child === 'object' && 'type' in child && typeof child.type === 'string'\n ? child.type\n : typeof child\n )\n .join(', ')}`\n );\n }\n\n return children;\n};\n", "'use client';\n\n/**\n * A pane's own chrome: a header row, a scrolling region and a footer row.\n *\n * Shell.Sidebar and Shell.Panel render these as `Shell.PaneHeader`, `Shell.Scroll` and\n * `Shell.PaneFooter`. The pane renders anything; with these parts it is the presentation, so\n * Sidebar's menu parts work inside it with no `Sidebar.Root`. The index comes from the nearest\n * Shell (`Shell.Root size`), or from a deprecated `Sidebar.Root` that still wraps them.\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { ScrollArea } from '../scroll-area.js';\nimport { ShellStoreContext } from './shell-store.js';\n\ntype PaneSize = '1' | '2' | '3';\n\ntype SidebarVisualContextValue = {\n size: PaneSize;\n menuVariant: 'solid' | 'soft';\n presentation?: 'thin' | 'expanded';\n color?: string;\n};\n\n/** Size, menu highlight and presentation for the Sidebar parts. Internal: not exported. */\nconst SidebarVisualContext = React.createContext<SidebarVisualContextValue | null>(null);\n\nfunction useSidebarVisual() {\n return React.useContext(SidebarVisualContext);\n}\n\n/** The Shell's index. `Shell.Root size` sets it; panes hand it to their chrome. */\nconst ShellSizeContext = React.createContext<PaneSize>('2');\n\n/**\n * True inside `Shell.Content`. `Shell.Root` sets it back to false, so a Shell nested in the\n * content gets pane chrome in its own panes. Read by `Shell.Scroll`: in the content it holds a\n * page, not a menu, so it takes none of the menu's padding, gap or layering.\n */\nconst ShellContentContext = React.createContext(false);\n\n/**\n * Gives a Shell pane's children the Shell's index, so Sidebar parts size themselves. In a Rail\n * the rows are `thin`: icon tiles with a small label, sub-menus as dropdowns.\n */\nfunction PaneChromeScope({ children, presentation }: { children: React.ReactNode; presentation?: 'thin' }) {\n const size = React.useContext(ShellSizeContext);\n const value = React.useMemo<SidebarVisualContextValue>(() => ({ size, menuVariant: 'soft', presentation }), [size, presentation]);\n return <SidebarVisualContext.Provider value={value}>{children}</SidebarVisualContext.Provider>;\n}\n\nfunction useChromeClasses() {\n const visual = useSidebarVisual();\n // A pane with no scope (Inspector, Bottom) still takes the Shell's index.\n const shellSize = React.useContext(ShellSizeContext);\n const size = visual?.size ?? shellSize;\n const menuVariant = visual?.menuVariant ?? 'soft';\n return ['kui-ShellPaneChrome', `kui-r-size-${size}`, `kui-menu-variant-${menuVariant}`];\n}\n\ntype BandSize = '1' | '2' | '3' | '4';\n\n/**\n * The index a Toolbar in a pane's header or footer rests at when it states none: one step above\n * the Shell's, so the band reads as chrome over the rows (v2 BAND_STEP). 4 has no step above.\n */\nconst BAND_STEP = { '1': '2', '2': '3', '3': '4', '4': '4' } as const satisfies Record<BandSize, BandSize>;\n\n/**\n * Set by `Shell.PaneHeader` and `Shell.PaneFooter` to their band size, and by `Shell.Scroll` to\n * null (a scrolling list has no band). Unset (`undefined`) everywhere else.\n */\nconst PaneBandSizeContext = React.createContext<BandSize | null | undefined>(undefined);\n\nfunction useBandSize(): BandSize {\n const visual = useSidebarVisual();\n const shellSize = React.useContext(ShellSizeContext);\n return BAND_STEP[visual?.size ?? shellSize];\n}\n\n/**\n * The size a Toolbar with no `size` of its own rests at, or null for none.\n *\n * In a pane's header or footer it is that band's size. Anywhere else inside a Shell, such as\n * `Shell.Content` or a pane's body, it is the same step: one above the Shell's index, so a\n * toolbar in the content area matches the ones in the pane headers beside it (v2 sizes every\n * toolbar this way). A pane's scrolling list, and anything outside a Shell, has none.\n */\nfunction usePaneBandSize(): BandSize | null {\n const band = React.useContext(PaneBandSizeContext);\n const inShell = React.useContext(ShellStoreContext) !== null;\n const step = useBandSize();\n if (band !== undefined) return band;\n return inShell ? step : null;\n}\n\ninterface PaneHeaderProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Floats the row over the top of `Shell.Scroll`, so the list scrolls behind it. The list\n * starts below the row, and `Shell.Scroll fade` fades it out under the row. The row paints\n * nothing and lets clicks through between its controls; a `Toolbar backdrop` in it keeps\n * the controls readable.\n */\n float?: boolean;\n}\n\n/** A pane's header row, pinned above its scrolling region. */\nconst PaneHeader = React.forwardRef<HTMLDivElement, PaneHeaderProps>(({ className, float, children, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n const band = useBandSize();\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-float={float || undefined}\n className={classNames('kui-ShellPaneHeader', 'kui-SidebarHeader', 'kui-SidebarHeader--container', ...chrome, className)}\n >\n <PaneBandSizeContext.Provider value={band}>{children}</PaneBandSizeContext.Provider>\n </div>\n );\n});\nPaneHeader.displayName = 'Shell.PaneHeader';\n\ninterface PaneFooterProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Floats the row over the bottom of `Shell.Scroll`, the way `Shell.PaneHeader float` does at the top. */\n float?: boolean;\n}\n\n/** A pane's footer row, pinned below its scrolling region. */\nconst PaneFooter = React.forwardRef<HTMLDivElement, PaneFooterProps>(({ className, float, children, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n const band = useBandSize();\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-float={float || undefined}\n className={classNames('kui-ShellPaneFooter', 'kui-SidebarFooter', 'kui-SidebarFooter--container', ...chrome, className)}\n >\n <PaneBandSizeContext.Provider value={band}>{children}</PaneBandSizeContext.Provider>\n </div>\n );\n});\nPaneFooter.displayName = 'Shell.PaneFooter';\n\ninterface ScrollProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Fades the list out toward an edge with more past it, and under a floating header or footer. */\n fade?: boolean;\n}\n\n/**\n * The one region of a pane that scrolls; it takes the room the header and footer leave.\n * In `Shell.Content` it is the page's scroller, and a `Shell.PaneHeader float` beside it pins\n * the page's toolbar over it. The ref, events and ARIA props land on the element that scrolls;\n * `className`, `style` and `dir` apply to the content inside it. In a Rail, Panel or Sidebar the pane is\n * already a navigation landmark, so it needs no role of its own.\n */\nconst Scroll = React.forwardRef<HTMLDivElement, ScrollProps>(({ className, style, dir, children, fade = false, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n // A Sidebar.Root inside the content still gets a menu.\n const contentPane = React.useContext(ShellContentContext);\n const visual = useSidebarVisual();\n const inContent = contentPane && visual === null;\n if (inContent) {\n return (\n <ScrollArea {...props} ref={forwardedRef} type=\"hover\" fade={fade} className=\"kui-ShellScroll\">\n <div style={style} dir={dir} className={classNames('kui-ShellScrollContent', className)}>\n {children}\n </div>\n </ScrollArea>\n );\n }\n return (\n <ScrollArea {...props} ref={forwardedRef} type=\"hover\" fade={fade} className=\"kui-ShellScroll\">\n <div style={style} dir={dir} className={classNames('kui-BaseMenuContent', 'kui-SidebarContent', ...chrome, className)}>\n {/* A header's band does not reach a Toolbar in the scrolling list. */}\n <PaneBandSizeContext.Provider value={null}>\n <div className=\"kui-BaseMenuViewport\">{children}</div>\n </PaneBandSizeContext.Provider>\n </div>\n </ScrollArea>\n );\n});\nScroll.displayName = 'Shell.Scroll';\n\nexport { SidebarVisualContext, useSidebarVisual, ShellSizeContext, ShellContentContext, PaneChromeScope, PaneHeader, PaneFooter, Scroll, BAND_STEP, usePaneBandSize };\nexport type { SidebarVisualContextValue, PaneSize, BandSize, PaneHeaderProps, PaneFooterProps, ScrollProps };\n", "'use client';\n\n/**\n * The Shell's state model (0.8.0), ported from kookie-ui-v2's Shell.\n *\n * - State lives on the pane. Each pane holds `auto | open | closed`.\n * `auto` means untouched: the stylesheet decides what\n * it shows at each breakpoint, so first paint is right with no script, the\n * server and the client render the same markup, and no open-state callback\n * can fire on mount or on a resize.\n * - The one thing that crosses the Shell is a registry keyed by pane name.\n * Each pane registers what it is and how to drive it; a Trigger looks its\n * pane up, and the Root reads the set of live overlays. Nothing scans\n * children and nothing checks `displayName`.\n * - The responsive props are resolved into a table with one value per\n * breakpoint, from the props alone, with no window. The table is written to\n * the DOM as data attributes for the stylesheet, and read again in JS by the\n * mirror that sets `aria-expanded`. One table, two readers, so they agree by\n * construction.\n */\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport { SHELL_BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneName, PresentationValue } from '../shell.types.js';\n\n/* \u2500\u2500 Breakpoint tables \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type Table<T> = Record<Breakpoint, T>;\n\n/** What a pane shows: open or closed. */\nexport type PaneValue = 'open' | 'closed';\n\ntype ResponsiveInput<T> = T | Partial<Record<Breakpoint, T>> | undefined;\n\nfunction isMap<T>(value: ResponsiveInput<T>): value is Partial<Record<Breakpoint, T>> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * A responsive value at every breakpoint. A breakpoint takes the largest key\n * at or below it, the same fallback `useResponsiveValue` used; a breakpoint\n * below every key takes `fallback`.\n */\nexport function tableOf<T>(value: ResponsiveInput<T>, fallback: (bp: Breakpoint) => T): Table<T> {\n const table = {} as Table<T>;\n let carried: { value: T } | null = null;\n for (const bp of SHELL_BREAKPOINTS) {\n if (value !== undefined && !isMap(value)) {\n table[bp] = value;\n continue;\n }\n const entry = isMap(value) ? value[bp] : undefined;\n if (entry !== undefined) carried = { value: entry };\n table[bp] = carried ? carried.value : fallback(bp);\n }\n return table;\n}\n\n/** The table's one value, when it has only one. */\nexport function constantOf<T>(table: Table<T>): T | undefined {\n const first = table.initial;\n return SHELL_BREAKPOINTS.every((bp) => table[bp] === first) ? first : undefined;\n}\n\n/**\n * The table as data attributes: `data-<name>` when it holds one value, one\n * `data-<name>-<bp>` per breakpoint when it holds several. The stylesheet has\n * a rule for each spelling.\n */\nexport function tableAttributes(name: string, table: Table<string>): Record<string, string> {\n const constant = constantOf(table);\n if (constant !== undefined) return { [`data-${name}`]: constant };\n const attributes: Record<string, string> = {};\n for (const bp of SHELL_BREAKPOINTS) attributes[`data-${name}-${bp}`] = table[bp];\n return attributes;\n}\n\n/**\n * A responsive prop object is usually an inline literal, a new identity every\n * render. Keying memoisation on its contents keeps the tables, and so the\n * registry entries, stable across renders that change nothing.\n */\nexport function useStableKey(value: unknown): string {\n return typeof value === 'object' && value !== null ? JSON.stringify(value) : String(value);\n}\n\nexport const FIXED_TABLE: Table<PresentationValue> = tableOf<PresentationValue>('fixed', () => 'fixed');\n\n/* \u2500\u2500 The registry \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type OpenChangeReason = 'toggle' | 'dismiss';\n\nexport type PaneEntry = {\n name: PaneName;\n id: string;\n el: HTMLElement | null;\n /** What the pane shows now; `undefined` while an untouched pane cannot know (before the breakpoint is known). */\n value: PaneValue | undefined;\n /** How the pane is presented now, when known. */\n presentation: PresentationValue | undefined;\n /** The pane's own presentation at every breakpoint. A Panel with none of its own follows the Rail's. */\n presentationTable: Table<PresentationValue>;\n /** Open and presented as an overlay: what the scrim and Escape close, and what containment exempts. */\n overlayLive: boolean;\n /** The pane's designed open width, for panes that sit beside it when floating. */\n size: number;\n setValue: (value: PaneValue, reason: OpenChangeReason) => void;\n toggle: (reason: OpenChangeReason) => void;\n};\n\nexport type ShellStore = {\n entries: Map<PaneName, PaneEntry>;\n listeners: Set<() => void>;\n /**\n * What a subscriber reads. useSyncExternalStore needs a value that is stable\n * between notifications, and a number is; the Map, or anything derived from\n * it, would be a new identity on every read.\n */\n version: number;\n /** The pane a hovered Trigger is previewing, if any. Layout only. */\n peek: PaneName | null;\n};\n\nexport function createShellStore(): ShellStore {\n return { entries: new Map(), listeners: new Set(), version: 0, peek: null };\n}\n\nexport function notifyShellStore(store: ShellStore) {\n store.version += 1;\n for (const listener of store.listeners) listener();\n}\n\nexport function subscribeShellStore(store: ShellStore, listener: () => void) {\n store.listeners.add(listener);\n return () => {\n store.listeners.delete(listener);\n };\n}\n\nexport function setShellPeek(store: ShellStore, peek: PaneName | null) {\n if (store.peek === peek) return;\n store.peek = peek;\n notifyShellStore(store);\n}\n\nexport const ShellStoreContext = React.createContext<ShellStore | null>(null);\n\nexport function useShellStore(part: string): ShellStore {\n const store = React.useContext(ShellStoreContext);\n if (!store) throw new Error(`${part} must be used within <Shell.Root>`);\n return store;\n}\n\n/** One pane's registry entry. Re-renders only when that entry is replaced. */\nexport function usePaneEntry(store: ShellStore, name: PaneName): PaneEntry | undefined {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n const getSnapshot = React.useCallback(() => store.entries.get(name), [store, name]);\n return React.useSyncExternalStore(subscribe, getSnapshot, () => undefined);\n}\n\n/**\n * Whether this pane is the one being previewed. A boolean per pane rather than\n * the peek target itself, so hovering one Trigger re-renders one pane, not all.\n */\nexport function usePeeking(store: ShellStore, name: PaneName): boolean {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n return React.useSyncExternalStore(\n subscribe,\n () => store.peek === name,\n () => false,\n );\n}\n\n/* \u2500\u2500 Inset \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type InsetPaneId = 'rail' | 'panel' | 'sidebar' | 'content' | 'inspector' | 'bottom';\n\nexport const ShellInsetContext = React.createContext<{\n registerInset: (id: InsetPaneId) => void;\n unregisterInset: (id: InsetPaneId) => void;\n} | null>(null);\n\n/** Registers a pane's `inset` with the Root, which paints the backdrop while any pane is inset. */\nexport function useInsetRegistration(id: InsetPaneId, inset: boolean | undefined) {\n const ctx = React.useContext(ShellInsetContext);\n if (!ctx) throw new Error('Shell panes must be used within <Shell.Root>');\n const { registerInset, unregisterInset } = ctx;\n useLayoutEffect(() => {\n if (!inset) return;\n registerInset(id);\n return () => unregisterInset(id);\n }, [id, inset, registerInset, unregisterInset]);\n}\n\n/* \u2500\u2500 Development warnings \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nconst warned = new Set<string>();\n\n/** A deprecation warning, once per message per page load. Development only. */\nexport function warnOnce(message: string) {\n if (process.env.NODE_ENV === 'production') return;\n if (warned.has(message)) return;\n warned.add(message);\n console.warn(`[kookie-ui] ${message}`);\n}\n"],
5
+ "mappings": ";suBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,GAAA,SAAAC,GAAA,UAAAC,GAAA,aAAAC,GAAA,SAAAC,GAAA,cAAAC,GAAA,SAAAC,GAAA,UAAAC,GAAA,YAAAC,GAAA,kBAAAR,GAAA,gBAAAC,GAAA,iBAAAC,GAAA,oBAAAC,GAAA,qBAAAE,GAAA,gBAAAC,GAAA,iBAAAC,GAAA,uBAAAE,KAAA,eAAAC,GAAAZ,IAEA,IAAAa,EAAuB,oBACvBC,GAAgC,6BAChCC,GAAuB,yBACvBC,GAA4C,oBCH5C,IAAMC,GAAQ,CAAC,IAAK,IAAK,IAAK,GAAG,EAC3BC,GAAe,CAAC,aAAc,UAAU,EAQxCC,GAAsB,CAM1B,KAAM,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQF,GAAO,QAAS,GAAI,EAI3E,YAAa,CAAE,KAAM,OAAQ,OAAQC,GAAc,QAAS,YAAa,CAC3E,ECtBA,IAAAE,GAAuB,oBACvBC,GAAuB,yBCDvB,IAAAC,EAAuB,oBACvBC,GAAuB,yBACvBC,GAAqB,oBACrBC,GAAiD,6BCDjD,IAAMC,EAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECPA,IAAMC,GAAe,CAAC,OAAQ,OAAQ,SAAU,QAAS,SAAU,QAAS,SAAU,SAAU,MAAO,OAAQ,UAAW,OAAQ,OAAQ,SAAU,SAAU,OAAQ,SAAU,OAAQ,OAAQ,OAAQ,OAAQ,QAAS,QAAS,OAAQ,OAAQ,KAAK,EAEjPC,GAAa,CAAC,OAAQ,OAAQ,QAAS,QAAS,OAAQ,QAAS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,OAAOnH,GAAa,CACzC,KAAMA,GACN,MAAOmB,GACP,OAAQU,GACR,UAAW+E,GACX,MAAOG,GACP,SAAUxD,GACV,KAAMiD,GACN,KAAMG,EACR,CAAC",
6
+ "names": ["toolbar_exports", "__export", "ToolbarButton", "ToolbarFill", "ToolbarGroup", "ToolbarOverflow", "ToolbarRoot", "ToolbarSeparator", "ToolbarSlot", "ToolbarTitle", "Toolbar", "useToolbarOverflow", "__toCommonJS", "React", "import_internal", "import_classnames", "import_radix_ui", "sizes", "orientations", "toolbarRootPropDefs", "React", "import_classnames", "React", "import_classnames", "import_radix_ui", "import_internal", "asChildPropDef", "accentColors", "grayColors", "colorPropDef", "accentColorPropDef", "radii", "radiusPropDef", "sizes", "variants", "baseButtonPropDefs", "asChildPropDef", "accentColorPropDef", "radiusPropDef", "React", "import_classnames", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "i", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "paddingValues", "paddingPropDefs", "heightPropDefs", "widthPropDefs", "overflowValues", "positionValues", "positionEdgeValues", "flexShrinkValues", "flexGrowValues", "alignSelfValues", "justifySelfValues", "layoutPropDefs", "paddingPropDefs", "widthPropDefs", "heightPropDefs", "marginValues", "marginPropDefs", "import_radix_ui", "Root", "SlotPrimitive", "Slot", "Slottable", "gapValues", "gapPropDefs", "as", "displayValues", "directionValues", "alignValues", "justifyValues", "wrapValues", "flexPropDefs", "asChildPropDef", "parseJustifyValue", "gapPropDefs", "value", "Flex", "props", "forwardedRef", "className", "asChild", "Tag", "flexProps", "extractProps", "flexPropDefs", "layoutPropDefs", "marginPropDefs", "Slot", "classNames", "React", "import_classnames", "spinnerPropDefs", "Spinner", "props", "forwardedRef", "className", "children", "loading", "spinnerProps", "extractProps", "spinnerPropDefs", "named", "spinner", "classNames", "Flex", "import_react", "ThickDividerHorizontalIcon", "React", "props", "forwardedRef", "ThickCheckIcon", "ChevronDownIcon", "ThickChevronRightIcon", "ThickChevronLeftIcon", "ThickDotIcon", "CloseIcon", "React", "_props", "_forwardedRef", "PaperclipIcon", "props", "forwardedRef", "FileIcon", "FileTextIcon", "TickIcon", "React", "clampSize", "size", "values", "n", "nearest", "distance", "i", "d", "ThemeSizeContext", "useThemeSize", "explicit", "propDef", "themeSize", "clampSize", "useThemeSizeProps", "props", "size", "BaseButton", "ownProps", "forwardedRef", "props", "useThemeSizeProps", "baseButtonPropDefs", "className", "children", "asChild", "as", "color", "radius", "nativeDisabled", "done", "baseButtonProps", "extractProps", "loading", "canLoad", "disabled", "onClick", "ariaDescribedByProp", "handleClick", "event", "childEdges", "content", "items", "flattenFragments", "isIcon", "node", "TEXT_COMPONENTS", "componentName", "domEdges", "setDomEdges", "elementRef", "composedRef", "element", "contentRoot", "iconStart", "edgeIsSvg", "iconEnd", "prev", "iconOnly", "tick", "TickIcon", "swap", "nodes", "first", "index", "Comp", "formElements", "renderedType", "shouldPassDisabled", "onClickCapture", "handleClickCapture", "isNativeButtonElement", "hasExplicitTypeAttribute", "loadingId", "describedById", "accessibilityProps", "renderInner", "inner", "label", "Flex", "Spinner", "asChildContent", "classNames", "type", "named", "edge", "React", "import_classnames", "import_radix_ui", "React", "import_radix_ui", "emphases", "emphasisPropDef", "leadingTrimValues", "leadingTrimPropDef", "textAlignValues", "textAlignPropDef", "textWrapValues", "textWrapPropDef", "truncatePropDef", "fontFamilies", "fontFamilyPropDef", "weights", "weightPropDef", "as", "sizes", "textPropDefs", "asChildPropDef", "fontFamilyPropDef", "weightPropDef", "textAlignPropDef", "leadingTrimPropDef", "truncatePropDef", "textWrapPropDef", "colorPropDef", "emphasisPropDef", "Text", "props", "forwardedRef", "children", "className", "asChild", "Tag", "color", "textProps", "extractProps", "textPropDefs", "combinedClassName", "React", "import_classnames", "import_radix_ui", "getMatchingGrayColor", "accentColor", "React", "usePropSyncedState", "propValue", "value", "setValue", "previousPropValue", "setPreviousPropValue", "appearances", "fontFamilies", "sizes", "themePropDefs", "asChildPropDef", "accentColors", "grayColors", "radii", "noop", "defaultThemeContext", "themePropDefs", "ThemeContext", "useThemeContext", "Theme", "props", "forwardedRef", "context", "dir", "ThemeRoot", "ThemeImpl", "appearanceProp", "accentColorProp", "grayColorProp", "radiusProp", "fontFamilyProp", "headingFontFamilyProp", "sizeProp", "hasBackground", "rootProps", "appearance", "setAppearance", "usePropSyncedState", "accentColor", "setAccentColor", "grayColor", "setGrayColor", "radius", "setRadius", "fontFamily", "setFontFamily", "headingFontFamily", "setHeadingFontFamily", "size", "setSize", "asChild", "isRoot", "hasBackgroundProp", "onAppearanceChange", "onAccentColorChange", "onGrayColorChange", "onRadiusChange", "onFontFamilyChange", "onHeadingFontFamilyChange", "onSizeChange", "themeProps", "Comp", "resolvedGrayColor", "getMatchingGrayColor", "isExplicitAppearance", "ThemeSizeContext", "classNames", "tooltipPropDefs", "widthPropDefs", "TOOLTIP_DELAY", "TooltipProviderContext", "TooltipProvider", "delayDuration", "children", "props", "TooltipPrimitive", "Tooltip", "forwardedRef", "className", "open", "defaultOpen", "onOpenChange", "disableHoverableContent", "content", "container", "forceMount", "tooltipContentProps", "extractProps", "tooltipPropDefs", "rootProps", "hasProvider", "tooltip", "Theme", "classNames", "Text", "React", "useTooltipWrapper", "tooltip", "tooltipId", "hasTooltip", "accessibilityProps", "EMPHASIS_VARIANT", "validateIconButtonName", "props", "Button", "className", "style", "tooltip", "tooltipSide", "tooltipAlign", "tooltipDelayDuration", "tooltipDisableHoverableContent", "iconOnly", "emphasis", "variant", "forwardedRef", "tooltipId", "hasTooltip", "tooltipAccessibilityProps", "useTooltipWrapper", "resolvedVariant", "callerDescribedBy", "tooltipDescribedBy", "ariaDescribedBy", "button", "BaseButton", "classNames", "Tooltip", "React", "import_classnames", "import_radix_ui", "import_internal", "React", "import_classnames", "import_radix_ui", "import_internal", "scrollbarsValues", "scrollAreaPropDefs", "asChildPropDef", "radiusPropDef", "React", "useScrollEdges", "enabled", "element", "setElement", "frame", "write", "start", "end", "xStart", "xEnd", "schedule", "observer", "child", "mutations", "React", "useThumbSync", "viewport", "setViewport", "root", "frame", "write", "thumb", "scrollbar", "style", "track", "offset", "thumbOffset", "schedule", "position", "range", "travel", "React", "getSubtree", "options", "content", "asChild", "children", "firstChild", "OWNS_FOCUS", "useFocusableWhileScrollable", "element", "enabled", "frame", "update", "schedule", "observer", "child", "ScrollArea", "props", "forwardedRef", "asChild", "children", "className", "style", "type", "scrollHideDelay", "dir", "radius", "scrollAreaPropDefs", "scrollbars", "fade", "viewportProps", "extractProps", "widthPropDefs", "heightPropDefs", "viewport", "setViewport", "setEdgesElement", "useScrollEdges", "setThumbViewport", "useThumbSync", "viewportRef", "named", "ScrollAreaPrimitive", "classNames", "getSubtree", "contentSizes", "submenuBehaviors", "baseMenuSharedPropDefs", "colorPropDef", "baseMenuContentPropDefs", "baseMenuSubContentPropDefs", "baseMenuItemPropDefs", "asChildPropDef", "baseMenuCheckboxItemPropDefs", "baseMenuRadioItemPropDefs", "React", "INITIAL_STATE", "PANEL_ITEM_SELECTOR", "BACK_ITEM_CLASS", "escapeAttributeValue", "value", "DrillDownStore", "__publicField", "element", "listener", "modality", "id", "entry", "onOpenChange", "stack", "trigger", "name", "scrollTop", "top", "index", "next", "open", "controller", "root", "change", "content", "scroller", "focus", "panel", "items", "item", "DrillDownStoreContext", "DrillDownLevelContext", "useDrillDownStore", "useCreateDrillDownStore", "store", "selectDepth", "state", "getServerDepth", "DrillDownRoot", "behavior", "children", "isDrillDown", "depth", "isRoot", "wasOpenRef", "rootRef", "handleKeyDownCapture", "handlePointerDownCapture", "usePanelPosition", "getSnapshot", "noopSubscribe", "getClosed", "useStackEntry", "getUndefined", "SubContext", "useSubContext", "React", "import_internal", "React", "import_classnames", "React", "import_classnames", "import_radix_ui", "sizes", "variants", "kbdPropDefs", "asChildPropDef", "Kbd", "props", "forwardedRef", "asChild", "className", "kbdProps", "extractProps", "kbdPropDefs", "Comp", "classNames", "React", "_BREAKPOINTS", "SHELL_BREAKPOINTS", "QUERIES", "_BREAKPOINTS", "mediaQueryLists", "listeners", "cachedBreakpoint", "getMediaQueryLists", "name", "query", "computeBreakpoint", "matched", "mql", "handleChange", "next", "listener", "subscribe", "getSnapshot", "getServerSnapshot", "getReadySnapshot", "getReadyServerSnapshot", "noopSubscribe", "getInitialSnapshot", "useBreakpoint", "enabled", "breakpoint", "subscribe", "getSnapshot", "getServerSnapshot", "ready", "BREAKPOINTS_DESCENDING", "resolveResponsiveValue", "value", "currentBreakpoint", "defaultValue", "map", "i", "resolved", "useResolvedResponsiveValue", "isResponsive", "breakpoint", "useBreakpoint", "CONTENT_PADDING", "getMenuAlignOffset", "size", "KEY_SYMBOLS", "ariaKeyShortcutsCache", "toAriaKeyShortcuts", "shortcut", "cached", "result", "token", "MenuShortcut", "className", "classNames", "Kbd", "MenuContext", "MenuGroupLabelContext", "menuSizeToItemHeight", "getMenuItemHeight", "size", "MenuProvider", "children", "resolvedSize", "useResolvedResponsiveValue", "itemHeight", "value", "MenuCloseContext", "MenuCloseProvider", "MenuGroupLabelProvider", "MenuGroupLabelContext", "useMenuGroupLabelledBy", "ariaLabelledBy", "labelId", "setLabelId", "useMenuGroupLabelId", "idProp", "rendered", "register", "generatedId", "id", "React", "requireReactElement", "children", "child", "DropdownMenuOpenContext", "DropdownMenuRoot", "props", "openProp", "defaultOpen", "onOpenChange", "uncontrolledOpen", "setUncontrolledOpen", "open", "handleOpenChangeProp", "handleOpenChange", "next", "close", "MenuCloseProvider", "DropdownMenuPrimitive", "DropdownMenuTrigger", "children", "forwardedRef", "requireReactElement", "DropdownMenuContentContext", "BACK_KEYS", "FORWARD_KEYS", "isTextEntryTarget", "target", "getDirection", "element", "DropdownMenuContent", "ownProps", "useThemeSizeProps", "baseMenuContentPropDefs", "themeContext", "useThemeContext", "size", "className", "color", "container", "forceMount", "submenuBehavior", "virtualized", "onEscapeKeyDown", "onKeyDown", "contentProps", "extractProps", "resolvedColor", "behavior", "useResolvedResponsiveValue", "isDrillDown", "drillDownStore", "useCreateDrillDownStore", "handleEscapeKeyDown", "event", "handleKeyDown", "contextValue", "contentBody", "MenuProvider", "DrillDownRoot", "Theme", "classNames", "ScrollArea", "DropdownMenuLabel", "idProp", "isLevelVisible", "DrillDownLevelContext", "id", "useMenuGroupLabelId", "DropdownMenuItem", "baseMenuItemPropDefs", "shortcut", "itemProps", "toAriaKeyShortcuts", "MenuShortcut", "DropdownMenuGroup", "ariaLabelledBy", "labelledBy", "setLabelId", "useMenuGroupLabelledBy", "MenuGroupLabelProvider", "DropdownMenuRadioGroup", "DropdownMenuRadioItem", "baseMenuRadioItemPropDefs", "ThickDotIcon", "DropdownMenuCheckboxItem", "baseMenuCheckboxItemPropDefs", "ThickCheckIcon", "DropdownMenuSub", "label", "useDrillDownStore", "subContextValue", "isOpenInDrillDown", "usePanelPosition", "isControlled", "defaultOpenRef", "wasOpenRef", "SubContext", "DropdownMenuSubTrigger", "subTriggerProps", "subContext", "useSubContext", "handleSelect", "ThickChevronRightIcon", "DropdownMenuSeparator", "DrillDownBackItem", "name", "labelText", "ariaLabel", "ThickChevronLeftIcon", "omitPopperProps", "_loop", "_onEscapeKeyDown", "_onPointerDownOutside", "_onFocusOutside", "_onInteractOutside", "_sideOffset", "_alignOffset", "_avoidCollisions", "_collisionBoundary", "_collisionPadding", "_arrowPadding", "_sticky", "_hideWhenDetached", "_updatePositionStrategy", "rest", "DropdownMenuSubContent", "DrillDownPanel", "CascadeSubContent", "parent", "_color", "subContentProps", "baseMenuSubContentPropDefs", "scalarSize", "body", "getMenuAlignOffset", "store", "sub", "position", "entry", "useStackEntry", "_container", "_forceMount", "_virtualized", "_size", "panelProps", "isTop", "DropdownMenuTriggerIcon", "ChevronDownIcon", "React", "import_classnames", "React", "import_internal", "isMap", "value", "tableOf", "fallback", "table", "carried", "bp", "SHELL_BREAKPOINTS", "entry", "FIXED_TABLE", "tableOf", "ShellStoreContext", "ShellInsetContext", "SidebarVisualContext", "useSidebarVisual", "ShellSizeContext", "ShellContentContext", "useChromeClasses", "visual", "useSidebarVisual", "shellSize", "ShellSizeContext", "size", "menuVariant", "BAND_STEP", "PaneBandSizeContext", "useBandSize", "usePaneBandSize", "band", "inShell", "ShellStoreContext", "step", "PaneHeader", "className", "float", "children", "props", "forwardedRef", "chrome", "classNames", "PaneFooter", "Scroll", "style", "dir", "fade", "contentPane", "ShellContentContext", "ScrollArea", "ToolbarContext", "ToolbarGroupContext", "InOverflowContext", "useToolbarOverflow", "ToolbarRoot", "props", "forwardedRef", "band", "usePaneBandSize", "size", "useThemeSize", "toolbarRootPropDefs", "orientation", "className", "_orientation", "backdrop", "children", "rootProps", "extractProps", "layoutPropDefs", "context", "ToolbarPrimitive", "classNames", "ToolbarGroup", "disabled", "toolbar", "overflow", "group", "DropdownMenuGroup", "OVERFLOW_ITEM_KEYS", "isPressed", "value", "isButtonElement", "ToolbarButton", "iconOnly", "variant", "emphasis", "color", "asChild", "onKeyDown", "rest", "off", "passed", "key", "ToolbarOverflowItem", "handleKeyDown", "event", "pressed", "stateProps", "shared", "buttonProps", "Button", "label", "words", "itemProps", "child", "DropdownMenuItem", "DropdownMenuCheckboxItem", "MoreIcon", "ToolbarOverflow", "items", "count", "rootRef", "widths", "triggerWidth", "shown", "setShown", "tick", "setTick", "measuredCount", "setMeasuredCount", "root", "kids", "visible", "i", "el", "trigger", "gap", "available", "total", "counted", "width", "next", "budget", "used", "drawn", "own", "observer", "n", "seat", "attach", "node", "item", "DropdownMenuRoot", "DropdownMenuTrigger", "DropdownMenuContent", "EMPTY_ENTRIES", "slotEntries", "slotListeners", "mountedSlots", "subscribeSlots", "listener", "setSlotEntry", "name", "id", "list", "entry", "removeSlotEntry", "ToolbarSlot", "left", "entries", "ToolbarFill", "ToolbarSeparator", "DropdownMenuSeparator", "TITLE_SIZE", "ToolbarTitle", "style", "themeSize", "Text", "Toolbar"]
7
7
  }