@stll/ui 0.65.1 → 0.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (397) hide show
  1. package/dist/calendar/day-calendar.d.ts +8 -3
  2. package/dist/calendar/day-calendar.js +8 -11
  3. package/dist/calendar/day-calendar.logic.d.ts +0 -2
  4. package/dist/calendar/day-calendar.logic.js +1 -2
  5. package/dist/calendar/primitives.d.ts +1 -3
  6. package/dist/calendar/primitives.js +1 -2
  7. package/dist/calendar/resource-calendar.d.ts +0 -2
  8. package/dist/calendar/resource-calendar.js +1 -2
  9. package/dist/calendar/resource-calendar.logic.d.ts +1 -3
  10. package/dist/calendar/resource-calendar.logic.js +1 -2
  11. package/dist/components/accordion.d.ts +0 -2
  12. package/dist/components/accordion.js +1 -2
  13. package/dist/components/ai-label.d.ts +0 -2
  14. package/dist/components/ai-label.js +1 -2
  15. package/dist/components/alert-dialog.d.ts +0 -2
  16. package/dist/components/alert-dialog.js +2 -3
  17. package/dist/components/animated-count.d.ts +0 -2
  18. package/dist/components/animated-count.js +1 -2
  19. package/dist/components/animated-preview.css +152 -0
  20. package/dist/components/animated-preview.d.ts +75 -0
  21. package/dist/components/animated-preview.js +105 -0
  22. package/dist/components/application-rail.d.ts +1 -3
  23. package/dist/components/application-rail.js +2 -3
  24. package/dist/components/avatar.d.ts +0 -2
  25. package/dist/components/avatar.js +1 -2
  26. package/dist/components/badge.d.ts +0 -2
  27. package/dist/components/badge.js +1 -2
  28. package/dist/components/bidi-text.d.ts +0 -2
  29. package/dist/components/bidi-text.js +1 -2
  30. package/dist/components/brand-icons.d.ts +0 -2
  31. package/dist/components/brand-icons.js +1 -2
  32. package/dist/components/breadcrumb.d.ts +0 -2
  33. package/dist/components/breadcrumb.js +1 -2
  34. package/dist/components/button.d.ts +0 -2
  35. package/dist/components/button.js +37 -15
  36. package/dist/components/button.native-classes.d.ts +0 -2
  37. package/dist/components/button.native-classes.js +1 -2
  38. package/dist/components/button.native.d.ts +0 -2
  39. package/dist/components/button.native.js +1 -2
  40. package/dist/components/button.shared.d.ts +1 -3
  41. package/dist/components/button.shared.js +1 -2
  42. package/dist/components/checkbox.d.ts +0 -2
  43. package/dist/components/checkbox.js +3 -4
  44. package/dist/components/collapsible.d.ts +0 -2
  45. package/dist/components/collapsible.js +1 -2
  46. package/dist/components/color-picker.d.ts +12 -5
  47. package/dist/components/color-picker.js +8 -10
  48. package/dist/components/combobox.d.ts +0 -2
  49. package/dist/components/combobox.js +5 -6
  50. package/dist/components/command.d.ts +0 -2
  51. package/dist/components/command.js +4 -5
  52. package/dist/components/composer-tokens.d.ts +1 -3
  53. package/dist/components/composer-tokens.js +1 -2
  54. package/dist/components/composer.d.ts +0 -2
  55. package/dist/components/composer.js +2 -3
  56. package/dist/components/context-menu.d.ts +9 -2
  57. package/dist/components/context-menu.js +10 -4
  58. package/dist/components/copy-button.d.ts +0 -2
  59. package/dist/components/copy-button.js +1 -2
  60. package/dist/components/court-badge.d.ts +0 -2
  61. package/dist/components/court-badge.js +1 -2
  62. package/dist/components/court-filter.d.ts +0 -2
  63. package/dist/components/court-filter.js +3 -4
  64. package/dist/components/date-picker-popover.d.ts +0 -2
  65. package/dist/components/date-picker-popover.js +6 -70
  66. package/dist/components/date-picker-popover.logic.d.ts +1 -3
  67. package/dist/components/date-picker-popover.logic.js +1 -2
  68. package/dist/components/date-range-filter.d.ts +0 -2
  69. package/dist/components/date-range-filter.js +1 -2
  70. package/dist/components/destructive-action-confirmation.d.ts +0 -2
  71. package/dist/components/destructive-action-confirmation.js +2 -3
  72. package/dist/components/destructive-confirm-dialog.d.ts +0 -2
  73. package/dist/components/destructive-confirm-dialog.js +1 -2
  74. package/dist/components/details-grid.d.ts +13 -5
  75. package/dist/components/details-grid.js +69 -14
  76. package/dist/components/dialog-form-state.d.ts +1 -3
  77. package/dist/components/dialog-form-state.js +1 -2
  78. package/dist/components/dialog.d.ts +0 -2
  79. package/dist/components/dialog.js +4 -5
  80. package/dist/components/directional-icon.d.ts +0 -2
  81. package/dist/components/directional-icon.js +1 -2
  82. package/dist/components/document-identity-badge.d.ts +0 -2
  83. package/dist/components/document-identity-badge.js +2 -3
  84. package/dist/components/document-identity-badge.logic.d.ts +1 -3
  85. package/dist/components/document-identity-badge.logic.js +1 -2
  86. package/dist/components/document-mark.d.ts +9 -0
  87. package/dist/components/document-mark.js +29 -0
  88. package/dist/components/document-mark.native.d.ts +11 -0
  89. package/dist/components/document-mark.native.js +36 -0
  90. package/dist/components/document-mark.shared.d.ts +378 -0
  91. package/dist/components/document-mark.shared.js +756 -0
  92. package/dist/components/entity-actions.d.ts +34 -0
  93. package/dist/components/entity-actions.js +132 -0
  94. package/dist/components/field.d.ts +0 -2
  95. package/dist/components/field.js +1 -2
  96. package/dist/components/file-input.d.ts +0 -2
  97. package/dist/components/file-input.js +2 -3
  98. package/dist/components/form.d.ts +0 -2
  99. package/dist/components/form.js +1 -2
  100. package/dist/components/frame.d.ts +0 -2
  101. package/dist/components/frame.js +1 -2
  102. package/dist/components/hex-color-picker.d.ts +0 -2
  103. package/dist/components/hex-color-picker.js +2 -3
  104. package/dist/components/horizontal-scroller.d.ts +0 -2
  105. package/dist/components/horizontal-scroller.js +3 -4
  106. package/dist/components/identity-text.d.ts +0 -2
  107. package/dist/components/identity-text.js +2 -3
  108. package/dist/components/inline-drop-indicator.d.ts +1 -3
  109. package/dist/components/inline-drop-indicator.js +1 -2
  110. package/dist/components/inline-rename.d.ts +0 -2
  111. package/dist/components/inline-rename.js +2 -3
  112. package/dist/components/input-control.d.ts +1 -3
  113. package/dist/components/input-control.js +1 -2
  114. package/dist/components/input-group.d.ts +0 -2
  115. package/dist/components/input-group.js +4 -5
  116. package/dist/components/input-otp.d.ts +0 -2
  117. package/dist/components/input-otp.js +1 -2
  118. package/dist/components/input.d.ts +0 -2
  119. package/dist/components/input.js +3 -4
  120. package/dist/components/input.native.d.ts +0 -2
  121. package/dist/components/input.native.js +1 -2
  122. package/dist/components/input.shared.d.ts +1 -3
  123. package/dist/components/kbd.d.ts +58 -0
  124. package/dist/components/kbd.js +90 -0
  125. package/dist/components/label.d.ts +0 -2
  126. package/dist/components/label.js +1 -2
  127. package/dist/components/landing.d.ts +0 -2
  128. package/dist/components/landing.js +1 -2
  129. package/dist/components/list.d.ts +0 -2
  130. package/dist/components/list.js +1 -2
  131. package/dist/components/loader.d.ts +0 -2
  132. package/dist/components/loader.js +1 -2
  133. package/dist/components/loader.native.d.ts +0 -2
  134. package/dist/components/loader.native.js +1 -2
  135. package/dist/components/loader.shared.d.ts +1 -3
  136. package/dist/components/loader.shared.js +1 -2
  137. package/dist/components/matter-icon.d.ts +0 -2
  138. package/dist/components/matter-icon.js +2 -3
  139. package/dist/components/matter-icon.native.d.ts +0 -2
  140. package/dist/components/matter-icon.native.js +2 -3
  141. package/dist/components/matter-icon.shared.d.ts +1 -3
  142. package/dist/components/matter-icon.shared.js +1 -2
  143. package/dist/components/menu-section.d.ts +0 -2
  144. package/dist/components/menu-section.js +1 -2
  145. package/dist/components/menu.d.ts +18 -4
  146. package/dist/components/menu.js +29 -9
  147. package/dist/components/middle-truncate.d.ts +0 -2
  148. package/dist/components/middle-truncate.js +1 -2
  149. package/dist/components/middle-truncate.logic.d.ts +0 -2
  150. package/dist/components/middle-truncate.logic.js +1 -2
  151. package/dist/components/number-input.d.ts +0 -2
  152. package/dist/components/number-input.js +2 -3
  153. package/dist/components/outline-rail.d.ts +12 -3
  154. package/dist/components/outline-rail.js +64 -12
  155. package/dist/components/outline-rail.logic.d.ts +0 -2
  156. package/dist/components/outline-rail.logic.js +7 -3
  157. package/dist/components/pagination.d.ts +0 -2
  158. package/dist/components/pagination.js +1 -2
  159. package/dist/components/popover.d.ts +0 -2
  160. package/dist/components/popover.js +2 -3
  161. package/dist/components/preview-card.d.ts +0 -2
  162. package/dist/components/preview-card.js +1 -2
  163. package/dist/components/preview-pane.d.ts +0 -2
  164. package/dist/components/preview-pane.js +1 -2
  165. package/dist/components/prose.d.ts +0 -2
  166. package/dist/components/prose.js +1 -2
  167. package/dist/components/scroll-area.d.ts +0 -2
  168. package/dist/components/scroll-area.js +1 -2
  169. package/dist/components/scroll-to-top.d.ts +1 -3
  170. package/dist/components/scroll-to-top.js +1 -2
  171. package/dist/components/search-field.d.ts +0 -2
  172. package/dist/components/search-field.js +1 -2
  173. package/dist/components/secret-input.d.ts +0 -2
  174. package/dist/components/secret-input.js +1 -2
  175. package/dist/components/segmented-icon-toggle.d.ts +0 -2
  176. package/dist/components/segmented-icon-toggle.js +2 -3
  177. package/dist/components/select.d.ts +0 -2
  178. package/dist/components/select.js +4 -5
  179. package/dist/components/separator.d.ts +0 -2
  180. package/dist/components/separator.js +1 -2
  181. package/dist/components/separator.native.d.ts +1 -3
  182. package/dist/components/separator.native.js +1 -2
  183. package/dist/components/separator.shared.d.ts +1 -3
  184. package/dist/components/sheet.d.ts +0 -2
  185. package/dist/components/sheet.js +3 -4
  186. package/dist/components/sheet.native.d.ts +1 -3
  187. package/dist/components/sheet.native.js +2 -3
  188. package/dist/components/sheet.shared.d.ts +1 -3
  189. package/dist/components/sidebar.d.ts +0 -2
  190. package/dist/components/sidebar.js +5 -6
  191. package/dist/components/sidebar.logic.d.ts +1 -3
  192. package/dist/components/sidebar.logic.js +1 -2
  193. package/dist/components/skeleton.d.ts +0 -2
  194. package/dist/components/skeleton.js +1 -2
  195. package/dist/components/split-button.d.ts +0 -2
  196. package/dist/components/split-button.js +2 -3
  197. package/dist/components/status-mark.d.ts +0 -2
  198. package/dist/components/status-mark.js +1 -2
  199. package/dist/components/stella-mark.d.ts +1 -3
  200. package/dist/components/stella-mark.js +1 -2
  201. package/dist/components/stella-mark.native.d.ts +1 -3
  202. package/dist/components/stella-mark.native.js +1 -2
  203. package/dist/components/stella-mark.shared.d.ts +1 -3
  204. package/dist/components/stella-mark.shared.js +1 -2
  205. package/dist/components/stella-wordmark.d.ts +1 -3
  206. package/dist/components/stella-wordmark.js +1 -2
  207. package/dist/components/stella-wordmark.native.d.ts +1 -3
  208. package/dist/components/stella-wordmark.native.js +1 -2
  209. package/dist/components/stella-wordmark.shared.d.ts +1 -3
  210. package/dist/components/stella-wordmark.shared.js +1 -2
  211. package/dist/components/steps.d.ts +0 -2
  212. package/dist/components/steps.js +1 -2
  213. package/dist/components/swap-text.d.ts +0 -2
  214. package/dist/components/swap-text.js +1 -2
  215. package/dist/components/switch.d.ts +0 -2
  216. package/dist/components/switch.js +1 -2
  217. package/dist/components/switch.native.d.ts +0 -2
  218. package/dist/components/switch.native.js +1 -2
  219. package/dist/components/switch.shared.d.ts +1 -3
  220. package/dist/components/table-chart.d.ts +1 -3
  221. package/dist/components/table-chart.js +1 -2
  222. package/dist/components/table.d.ts +0 -2
  223. package/dist/components/table.js +1 -2
  224. package/dist/components/tabs.d.ts +0 -2
  225. package/dist/components/tabs.js +2 -3
  226. package/dist/components/text.d.ts +0 -2
  227. package/dist/components/text.js +1 -2
  228. package/dist/components/text.native.d.ts +0 -2
  229. package/dist/components/text.native.js +1 -2
  230. package/dist/components/text.shared.d.ts +1 -3
  231. package/dist/components/text.shared.js +1 -2
  232. package/dist/components/textarea.d.ts +11 -3
  233. package/dist/components/textarea.js +53 -15
  234. package/dist/components/textarea.native.d.ts +1 -3
  235. package/dist/components/textarea.native.js +1 -2
  236. package/dist/components/textarea.shared.d.ts +1 -3
  237. package/dist/components/time-field.d.ts +25 -0
  238. package/dist/components/time-field.js +108 -0
  239. package/dist/components/toast.d.ts +0 -2
  240. package/dist/components/toast.js +4 -5
  241. package/dist/components/toggle-group.d.ts +0 -2
  242. package/dist/components/toggle-group.js +1 -2
  243. package/dist/components/toggle.d.ts +0 -2
  244. package/dist/components/toggle.js +1 -2
  245. package/dist/components/toolbar-icon-action.d.ts +0 -2
  246. package/dist/components/toolbar-icon-action.js +1 -2
  247. package/dist/components/tooltip-trigger-helper.d.ts +0 -2
  248. package/dist/components/tooltip-trigger-helper.js +1 -2
  249. package/dist/components/tooltip.d.ts +7 -3
  250. package/dist/components/tooltip.js +10 -6
  251. package/dist/components/truncated-text.d.ts +0 -2
  252. package/dist/components/truncated-text.js +3 -4
  253. package/dist/components/view-toolbar.d.ts +0 -2
  254. package/dist/components/view-toolbar.js +1 -2
  255. package/dist/components/workspace-shell.d.ts +0 -2
  256. package/dist/components/workspace-shell.js +4 -5
  257. package/dist/css.d.ts +0 -1
  258. package/dist/data-table/schema.d.ts +1 -3
  259. package/dist/data-table/schema.js +1 -2
  260. package/dist/data-table/table.d.ts +0 -2
  261. package/dist/data-table/table.js +2 -3
  262. package/dist/hooks/use-contained-handler.d.ts +0 -2
  263. package/dist/hooks/use-contained-handler.js +1 -2
  264. package/dist/hooks/use-content-dir.d.ts +0 -2
  265. package/dist/hooks/use-content-dir.js +1 -2
  266. package/dist/hooks/use-latest.d.ts +1 -3
  267. package/dist/hooks/use-latest.js +1 -2
  268. package/dist/hooks/use-mobile.d.ts +1 -3
  269. package/dist/hooks/use-mobile.js +1 -2
  270. package/dist/hooks/use-prefers-reduced-motion.d.ts +6 -0
  271. package/dist/hooks/use-prefers-reduced-motion.js +17 -0
  272. package/dist/hooks/use-viewport-width.d.ts +1 -3
  273. package/dist/hooks/use-viewport-width.js +1 -2
  274. package/dist/index.d.ts +5 -4
  275. package/dist/index.js +35 -34
  276. package/dist/inspector/chrome.d.ts +1 -3
  277. package/dist/inspector/chrome.js +2 -3
  278. package/dist/inspector/dock.d.ts +0 -2
  279. package/dist/inspector/dock.js +2 -3
  280. package/dist/inspector/entity-tab.d.ts +0 -2
  281. package/dist/inspector/entity-tab.js +3 -4
  282. package/dist/inspector/entity-tab.logic.d.ts +1 -3
  283. package/dist/inspector/entity-tab.logic.js +1 -2
  284. package/dist/inspector/facet-bar.d.ts +1 -3
  285. package/dist/inspector/facet-bar.js +5 -6
  286. package/dist/inspector/facet-bar.logic.d.ts +1 -3
  287. package/dist/inspector/facet-bar.logic.js +1 -2
  288. package/dist/inspector/index.js +2 -2
  289. package/dist/inspector/layout-tokens.d.ts +1 -3
  290. package/dist/inspector/layout-tokens.js +1 -2
  291. package/dist/inspector/pane-width.d.ts +0 -2
  292. package/dist/inspector/pane-width.js +1 -2
  293. package/dist/inspector/use-pane-width.d.ts +0 -2
  294. package/dist/inspector/use-pane-width.js +1 -2
  295. package/dist/kanban/band-peek.d.ts +1 -3
  296. package/dist/kanban/band-peek.js +1 -2
  297. package/dist/kanban/card-properties.d.ts +1 -3
  298. package/dist/kanban/card-properties.js +1 -2
  299. package/dist/kanban/card-shell.d.ts +1 -3
  300. package/dist/kanban/card-shell.js +2 -3
  301. package/dist/kanban/cell-action.d.ts +1 -3
  302. package/dist/kanban/cell-action.js +2 -3
  303. package/dist/kanban/column-band-header.d.ts +1 -3
  304. package/dist/kanban/column-band-header.js +2 -3
  305. package/dist/kanban/column-bands.d.ts +1 -3
  306. package/dist/kanban/column-bands.js +1 -2
  307. package/dist/kanban/column-header.d.ts +1 -3
  308. package/dist/kanban/column-header.js +1 -2
  309. package/dist/kanban/drag-interactions.d.ts +0 -2
  310. package/dist/kanban/drag-interactions.js +1 -2
  311. package/dist/kanban/grouping.d.ts +1 -3
  312. package/dist/kanban/grouping.js +1 -2
  313. package/dist/kanban/index.js +5 -5
  314. package/dist/kanban/layout-tokens.d.ts +1 -3
  315. package/dist/kanban/layout-tokens.js +1 -2
  316. package/dist/kanban/matrix.d.ts +1 -3
  317. package/dist/kanban/matrix.js +1 -2
  318. package/dist/kanban/sortable-edge.d.ts +0 -2
  319. package/dist/kanban/sortable-edge.js +1 -2
  320. package/dist/kanban/sortable-interactions.d.ts +0 -2
  321. package/dist/kanban/sortable-interactions.js +3 -4
  322. package/dist/kanban/sortable-interactions.logic.d.ts +0 -2
  323. package/dist/kanban/sortable-interactions.logic.js +1 -2
  324. package/dist/kanban/sticky-lane.d.ts +0 -2
  325. package/dist/kanban/sticky-lane.js +1 -2
  326. package/dist/kanban/subgroup-board.d.ts +0 -2
  327. package/dist/kanban/subgroup-board.js +5 -6
  328. package/dist/kanban/touch-identity.d.ts +0 -2
  329. package/dist/kanban/touch-identity.js +1 -2
  330. package/dist/kanban/virtual-cell.d.ts +1 -3
  331. package/dist/kanban/virtual-cell.js +3 -4
  332. package/dist/lib/button-disposition.d.ts +0 -2
  333. package/dist/lib/button-disposition.js +1 -2
  334. package/dist/lib/control-size.d.ts +0 -2
  335. package/dist/lib/control-size.js +1 -2
  336. package/dist/lib/field-trigger.d.ts +1 -3
  337. package/dist/lib/field-trigger.js +1 -2
  338. package/dist/lib/file-picker.d.ts +0 -2
  339. package/dist/lib/file-picker.js +1 -2
  340. package/dist/lib/initials.d.ts +1 -3
  341. package/dist/lib/initials.js +1 -2
  342. package/dist/lib/inline-reorder.d.ts +0 -2
  343. package/dist/lib/inline-reorder.js +1 -2
  344. package/dist/lib/matter-colors.d.ts +0 -2
  345. package/dist/lib/matter-colors.js +1 -2
  346. package/dist/lib/menu-row.d.ts +1 -3
  347. package/dist/lib/menu-row.js +1 -2
  348. package/dist/lib/native-context-menu.d.ts +24 -0
  349. package/dist/lib/native-context-menu.js +85 -0
  350. package/dist/lib/option-color.d.ts +1 -3
  351. package/dist/lib/option-color.js +1 -2
  352. package/dist/lib/overlay-layer.d.ts +1 -3
  353. package/dist/lib/overlay-layer.js +1 -2
  354. package/dist/lib/panel-inset.d.ts +1 -3
  355. package/dist/lib/panel-inset.js +1 -2
  356. package/dist/lib/positioner-sizing.d.ts +1 -3
  357. package/dist/lib/positioner-sizing.js +1 -2
  358. package/dist/lib/renders-nothing.d.ts +8 -0
  359. package/dist/lib/renders-nothing.js +14 -0
  360. package/dist/lib/safe-area.d.ts +1 -3
  361. package/dist/lib/safe-area.js +1 -2
  362. package/dist/lib/scroll-edge-fade.d.ts +1 -3
  363. package/dist/lib/scroll-edge-fade.js +1 -2
  364. package/dist/lib/slot.d.ts +0 -2
  365. package/dist/lib/slot.js +1 -2
  366. package/dist/lib/tab-order.d.ts +0 -2
  367. package/dist/lib/tab-order.js +1 -2
  368. package/dist/lib/tooltip-content.d.ts +1 -3
  369. package/dist/lib/tooltip-content.js +1 -2
  370. package/dist/lib/typed-character.d.ts +1 -3
  371. package/dist/lib/typed-character.js +1 -2
  372. package/dist/lib/utils.d.ts +1 -3
  373. package/dist/lib/utils.js +1 -2
  374. package/dist/lib/week.d.ts +1 -3
  375. package/dist/lib/week.js +1 -2
  376. package/dist/review/review-author-avatar.d.ts +0 -2
  377. package/dist/review/review-author-avatar.js +2 -3
  378. package/dist/review/review-comment-card.d.ts +0 -2
  379. package/dist/review/review-comment-card.js +3 -4
  380. package/dist/review/review-decision-actions.d.ts +0 -2
  381. package/dist/review/review-decision-actions.js +2 -3
  382. package/dist/review/review-diff-text.d.ts +0 -2
  383. package/dist/review/review-diff-text.js +1 -2
  384. package/dist/review/review-out-of-date-notice.d.ts +0 -2
  385. package/dist/review/review-out-of-date-notice.js +2 -3
  386. package/dist/review/review-severity-dot.d.ts +0 -2
  387. package/dist/review/review-severity-dot.js +1 -2
  388. package/dist/review/review-status-badge.d.ts +0 -2
  389. package/dist/review/review-status-badge.js +1 -2
  390. package/dist/review/review-word-diff.d.ts +1 -3
  391. package/dist/review/review-word-diff.js +1 -2
  392. package/dist/review/text-mark.d.ts +0 -2
  393. package/dist/review/text-mark.js +1 -2
  394. package/dist/styles/theme.css +50 -23
  395. package/dist/testing/browser-clock.d.ts +1 -3
  396. package/dist/testing/browser-clock.js +1 -2
  397. package/package.json +50 -10
@@ -0,0 +1,34 @@
1
+ import { ContextMenuAction } from "./context-menu.js";
2
+ import { ReactNode, Ref } from "react";
3
+ /** One action of an object: the same shape `ContextMenu` renders. */
4
+ export type EntityAction = ContextMenuAction;
5
+ export type EntityActionsProps = {
6
+ /** The object's actions, in menu order. An empty list still owns the
7
+ * object's right-click: the native menu stays, never a parent's menu. */
8
+ actions: readonly EntityAction[];
9
+ /** The object, which becomes the right-click target. It may render an
10
+ * `EntityActionsButton` anywhere inside. */
11
+ children: ReactNode;
12
+ /** A line above the actions in both menus, such as when a message was
13
+ * sent. It is a label, not an action. */
14
+ heading?: ReactNode;
15
+ /** The accessible name of the "…" button, e.g. "Actions". */
16
+ label: string;
17
+ };
18
+ /**
19
+ * An object's actions: the right-click menu over `children`, and the list
20
+ * an `EntityActionsButton` inside them opens.
21
+ */
22
+ export declare const EntityActions: ({ actions, children, heading, label }: EntityActionsProps) => import("react").JSX.Element;
23
+ export type EntityActionsButtonProps = {
24
+ /** Popup alignment against the button. */
25
+ align?: "center" | "end" | "start";
26
+ ref?: Ref<HTMLButtonElement>;
27
+ /** Popup side against the button. */
28
+ side?: "bottom" | "left" | "right" | "top";
29
+ };
30
+ /**
31
+ * The "…" button of the `EntityActions` around it. It opens the same list
32
+ * right-click opens, and renders nothing when the object has no actions.
33
+ */
34
+ export declare const EntityActionsButton: ({ align, ref, side }: EntityActionsButtonProps) => import("react").JSX.Element | null;
@@ -0,0 +1,132 @@
1
+ "use client";
2
+ import { EllipsisIcon } from "../icons.js";
3
+ import { nativeContextMenuReason } from "../lib/native-context-menu.js";
4
+ import { Button } from "./button.js";
5
+ import { ContextMenuActionItems } from "./context-menu.js";
6
+ import { DropdownMenu as Menu, DropdownMenuContent as MenuPopup, DropdownMenuGroup as MenuGroup, DropdownMenuLabel as MenuGroupLabel, DropdownMenuSeparator as MenuSeparator, DropdownMenuTrigger as MenuTrigger, MenuAnchor } from "./menu.js";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { createContext, use, useRef, useState } from "react";
9
+ import { panic } from "better-result";
10
+ // src/components/entity-actions.tsx
11
+ const EntityActionsContext = createContext(null);
12
+ const isContextMenuKey = (event) => event.key === "ContextMenu" || event.shiftKey && event.key === "F10";
13
+ const FOCUSABLE_SELECTOR = "a[href], button, input, select, textarea, [tabindex]:not([tabindex='-1'])";
14
+ /** The control focus returns to when the menu closes, inside the object. */
15
+ const focusReturnTarget = (container, target) => {
16
+ if (!(target instanceof Element)) return null;
17
+ const focusable = target.closest(FOCUSABLE_SELECTOR);
18
+ return focusable !== null && container.contains(focusable) ? focusable : null;
19
+ };
20
+ /**
21
+ * Right-clicks (and context-menu keys) an object already answered for. The
22
+ * innermost object owns the event even when it has no actions and leaves it
23
+ * to the native menu, so the objects around it never open theirs. A marker
24
+ * rather than `stopPropagation`: the native menu, and listeners further up
25
+ * such as the desktop webview's policy, still see the event.
26
+ */
27
+ const ownedEvents = /* @__PURE__ */ new WeakSet();
28
+ /** Claims the event for this object; false when an inner object owns it. */
29
+ const claimEvent = (event) => {
30
+ if (ownedEvents.has(event)) return false;
31
+ ownedEvents.add(event);
32
+ return true;
33
+ };
34
+ const EntityActionItems = ({ actions, heading }) => /* @__PURE__ */ jsxs(Fragment, { children: [heading !== void 0 && heading !== null && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuGroup, { children: /* @__PURE__ */ jsx(MenuGroupLabel, {
35
+ className: "font-normal",
36
+ children: heading
37
+ }) }), /* @__PURE__ */ jsx(MenuSeparator, {})] }), /* @__PURE__ */ jsx(ContextMenuActionItems, { actions })] });
38
+ /**
39
+ * An object's actions: the right-click menu over `children`, and the list
40
+ * an `EntityActionsButton` inside them opens.
41
+ */
42
+ const EntityActions = ({ actions, children, heading, label }) => {
43
+ const [open, setOpen] = useState(false);
44
+ const [anchor, setAnchor] = useState(null);
45
+ const returnFocus = useRef(null);
46
+ const context = {
47
+ actions,
48
+ heading,
49
+ label
50
+ };
51
+ const hasActions = actions.length > 0;
52
+ const openAt = (event, anchorRect) => {
53
+ event.preventDefault();
54
+ event.stopPropagation();
55
+ returnFocus.current = focusReturnTarget(event.currentTarget, event.target);
56
+ setAnchor(anchorRect);
57
+ setOpen(true);
58
+ };
59
+ const handleContextMenu = (event) => {
60
+ if (event.defaultPrevented || !(event.target instanceof Node) || !event.currentTarget.contains(event.target) || !claimEvent(event.nativeEvent)) return;
61
+ if (!hasActions || nativeContextMenuReason(event) !== null) return;
62
+ const { clientX: x, clientY: y } = event;
63
+ openAt(event, { getBoundingClientRect: () => new DOMRect(x, y, 0, 0) });
64
+ };
65
+ const handleKeyDown = (event) => {
66
+ const target = event.target;
67
+ if (event.defaultPrevented || !isContextMenuKey(event) || !(target instanceof Element) || !event.currentTarget.contains(target) || !claimEvent(event.nativeEvent)) return;
68
+ if (!hasActions || nativeContextMenuReason({
69
+ shiftKey: false,
70
+ target
71
+ }) !== null) return;
72
+ openAt(event, { getBoundingClientRect: () => target.getBoundingClientRect() });
73
+ };
74
+ return /* @__PURE__ */ jsxs(EntityActionsContext, {
75
+ value: context,
76
+ children: [/* @__PURE__ */ jsx("div", {
77
+ className: "contents",
78
+ "data-context-menu-target": "",
79
+ "data-slot": "entity-actions",
80
+ onContextMenu: handleContextMenu,
81
+ onKeyDown: handleKeyDown,
82
+ role: "presentation",
83
+ children
84
+ }), hasActions && /* @__PURE__ */ jsxs(Menu, {
85
+ onOpenChange: (nextOpen) => {
86
+ setOpen(nextOpen);
87
+ if (!nextOpen) setAnchor(null);
88
+ },
89
+ open,
90
+ children: [/* @__PURE__ */ jsx(MenuAnchor, {}), /* @__PURE__ */ jsx(MenuPopup, {
91
+ anchor: anchor ?? void 0,
92
+ "data-slot": "entity-actions-context-popup",
93
+ finalFocus: () => returnFocus.current ?? false,
94
+ children: /* @__PURE__ */ jsx(EntityActionItems, {
95
+ actions,
96
+ heading
97
+ })
98
+ })]
99
+ })]
100
+ });
101
+ };
102
+ /**
103
+ * The "…" button of the `EntityActions` around it. It opens the same list
104
+ * right-click opens, and renders nothing when the object has no actions.
105
+ */
106
+ const EntityActionsButton = ({ align = "end", ref, side = "bottom" }) => {
107
+ const context = use(EntityActionsContext);
108
+ if (context === null) panic("EntityActionsButton renders inside EntityActions, which owns the list it opens");
109
+ if (context.actions.length === 0) return null;
110
+ return /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
111
+ ref,
112
+ render: /* @__PURE__ */ jsx(Button, {
113
+ "aria-label": context.label,
114
+ className: "size-6",
115
+ size: "icon-xs",
116
+ variant: "muted",
117
+ children: /* @__PURE__ */ jsx(EllipsisIcon, {
118
+ "aria-hidden": "true",
119
+ className: "size-3.5"
120
+ })
121
+ })
122
+ }), /* @__PURE__ */ jsx(MenuPopup, {
123
+ align,
124
+ "data-slot": "entity-actions-button-popup",
125
+ side,
126
+ children: /* @__PURE__ */ jsx(EntityActionItems, {
127
+ actions: context.actions,
128
+ heading: context.heading
129
+ })
130
+ })] });
131
+ };
132
+ export { EntityActions, EntityActionsButton };
@@ -1,5 +1,4 @@
1
1
  import { Field as Field$1 } from "@base-ui/react/field";
2
- //#region src/components/field.d.ts
3
2
  declare const Field: ({ className, ...props }: Field$1.Root.Props) => import("react").JSX.Element;
4
3
  declare const FieldLabel: ({ className, ...props }: Field$1.Label.Props) => import("react").JSX.Element;
5
4
  declare const FieldItem: ({ className, ...props }: Field$1.Item.Props) => import("react").JSX.Element;
@@ -13,5 +12,4 @@ declare const FieldDescription: ({ className, ...props }: Field$1.Description.Pr
13
12
  declare const FieldError: ({ className, ...props }: Field$1.Error.Props) => import("react").JSX.Element;
14
13
  declare const FieldControl: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").FieldControlProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
15
14
  declare const FieldValidity: import("react").FC<import("@base-ui/react").FieldValidityProps>;
16
- //#endregion
17
15
  export { Field, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity };
@@ -2,7 +2,7 @@
2
2
  import { cn } from "../lib/utils.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { Field as Field$1 } from "@base-ui/react/field";
5
- //#region src/components/field.tsx
5
+ // src/components/field.tsx
6
6
  const Field = ({ className, ...props }) => /* @__PURE__ */ jsx(Field$1.Root, {
7
7
  className: cn("flex flex-col items-start gap-2", className),
8
8
  "data-slot": "field",
@@ -36,5 +36,4 @@ const FieldError = ({ className, ...props }) => /* @__PURE__ */ jsx(Field$1.Erro
36
36
  });
37
37
  const FieldControl = Field$1.Control;
38
38
  const FieldValidity = Field$1.Validity;
39
- //#endregion
40
39
  export { Field, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity };
@@ -1,4 +1,3 @@
1
- //#region src/components/file-input.d.ts
2
1
  type FileInputProps = {
3
2
  accept?: string | undefined;
4
3
  "aria-labelledby"?: string | undefined;
@@ -10,5 +9,4 @@ type FileInputProps = {
10
9
  emptyLabel: string;
11
10
  };
12
11
  declare const FileInput: ({ accept, "aria-labelledby": labelledBy, className, disabled, file, onFileChange, chooseLabel, emptyLabel }: FileInputProps) => import("react").JSX.Element;
13
- //#endregion
14
12
  export { FileInput, type FileInputProps };
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { UploadIcon } from "../icons.js";
3
+ import { openFilePicker } from "../lib/file-picker.js";
3
4
  import { cn } from "../lib/utils.js";
4
5
  import { Button } from "./button.js";
5
- import { openFilePicker } from "../lib/file-picker.js";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { useId } from "react";
8
- //#region src/components/file-input.tsx
8
+ // src/components/file-input.tsx
9
9
  const FileInput = ({ accept, "aria-labelledby": labelledBy, className, disabled, file, onFileChange, chooseLabel, emptyLabel }) => {
10
10
  const triggerId = useId();
11
11
  return /* @__PURE__ */ jsxs("span", {
@@ -30,5 +30,4 @@ const FileInput = ({ accept, "aria-labelledby": labelledBy, className, disabled,
30
30
  })]
31
31
  });
32
32
  };
33
- //#endregion
34
33
  export { FileInput };
@@ -1,6 +1,5 @@
1
1
  import { Form as Form$1 } from "@base-ui/react/form";
2
2
  import { VariantProps } from "class-variance-authority";
3
- //#region src/components/form.d.ts
4
3
  declare const formVariants: (props?: ({
5
4
  density?: "compact" | "default" | "snug" | null | undefined;
6
5
  layout?: "inline" | "stack" | null | undefined;
@@ -44,5 +43,4 @@ type FormProps = Form$1.Props & VariantProps<typeof formVariants> & {
44
43
  * unsaved-changes guard.
45
44
  */
46
45
  declare const Form: ({ className, density, layout, dirty, onDiscard, children, ...props }: FormProps) => import("react").JSX.Element;
47
- //#endregion
48
46
  export { Form, type FormErrors, type FormProps, formVariants };
@@ -4,7 +4,7 @@ import { DialogFormState } from "./dialog-form-state.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { cva } from "class-variance-authority";
6
6
  import { Form as Form$1 } from "@base-ui/react/form";
7
- //#region src/components/form.tsx
7
+ // src/components/form.tsx
8
8
  const formVariants = cva("flex w-full", {
9
9
  defaultVariants: {
10
10
  density: "default",
@@ -63,5 +63,4 @@ const Form = ({ className, density, layout, dirty = false, onDiscard, children,
63
63
  onDiscard
64
64
  }), children]
65
65
  });
66
- //#endregion
67
66
  export { Form, formVariants };
@@ -1,10 +1,8 @@
1
1
  import * as React$1 from "react";
2
- //#region src/components/frame.d.ts
3
2
  declare const Frame: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
4
3
  declare const FramePanel: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
5
4
  declare const FrameHeader: ({ className, ...props }: React$1.ComponentProps<"header">) => React$1.JSX.Element;
6
5
  declare const FrameTitle: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
7
6
  declare const FrameDescription: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
8
7
  declare const FrameFooter: ({ className, ...props }: React$1.ComponentProps<"footer">) => React$1.JSX.Element;
9
- //#endregion
10
8
  export { Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle };
@@ -1,6 +1,6 @@
1
1
  import { cn } from "../lib/utils.js";
2
2
  import { jsx } from "react/jsx-runtime";
3
- //#region src/components/frame.tsx
3
+ // src/components/frame.tsx
4
4
  const Frame = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
5
5
  className: cn("bg-muted/72 relative flex flex-col rounded-2xl p-1", "*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1", className),
6
6
  "data-slot": "frame",
@@ -31,5 +31,4 @@ const FrameFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("footer", {
31
31
  "data-slot": "frame-panel-footer",
32
32
  ...props
33
33
  });
34
- //#endregion
35
34
  export { Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle };
@@ -1,5 +1,4 @@
1
1
  import * as React$1 from "react";
2
- //#region src/components/hex-color-picker.d.ts
3
2
  type HexColorPickerProps = {
4
3
  /** Hex color with or without # (e.g. "#ff0000" or "FF0000") */
5
4
  color?: string | undefined;
@@ -7,5 +6,4 @@ type HexColorPickerProps = {
7
6
  className?: string;
8
7
  };
9
8
  declare const HexColorPicker: ({ color, onChange, className }: HexColorPickerProps) => React$1.JSX.Element;
10
- //#endregion
11
9
  export { HexColorPicker, type HexColorPickerProps };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { cn } from "../lib/utils.js";
3
2
  import { containedHandler } from "../hooks/use-contained-handler.js";
4
3
  import { useLatest } from "../hooks/use-latest.js";
4
+ import { cn } from "../lib/utils.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { useCallback, useEffect, useRef, useState } from "react";
7
- //#region src/components/hex-color-picker.tsx
7
+ // src/components/hex-color-picker.tsx
8
8
  /**
9
9
  * Hex color picker — saturation/brightness square + hue strip.
10
10
  *
@@ -361,5 +361,4 @@ const HexColorPicker = ({ color = "000000", onChange, className }) => {
361
361
  })]
362
362
  });
363
363
  };
364
- //#endregion
365
364
  export { HexColorPicker };
@@ -1,5 +1,4 @@
1
1
  import { ComponentProps } from "react";
2
- //#region src/components/horizontal-scroller.d.ts
3
2
  type ScrollDirection = "ltr" | "rtl";
4
3
  type HorizontalScrollerProps = ComponentProps<"div"> & {
5
4
  nextLabel: string;
@@ -16,5 +15,4 @@ export declare const HorizontalScroller: ({ children, className, nextLabel, prev
16
15
  export declare const scrollState: (scrollLeft: number, scrollWidth: number, clientWidth: number, direction: ScrollDirection) => ScrollState;
17
16
  /** Wheel deltas arrive in pixels, lines or pages; scrollBy takes pixels. */
18
17
  export declare const wheelDeltaPixels: (event: Pick<WheelEvent, "deltaMode" | "deltaY">, node: Pick<HTMLElement, "clientWidth">) => number;
19
- //#endregion
20
18
  export {};
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { ChevronLeftIcon, ChevronRightIcon } from "../icons.js";
3
- import { cn } from "../lib/utils.js";
4
2
  import { containedEventHandler } from "../hooks/use-contained-handler.js";
3
+ import { ChevronLeftIcon, ChevronRightIcon } from "../icons.js";
5
4
  import { SCROLL_EDGE_FADE_CLASS, writeScrollEdgeFade } from "../lib/scroll-edge-fade.js";
5
+ import { cn } from "../lib/utils.js";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { useCallback, useState } from "react";
8
- //#region src/components/horizontal-scroller.tsx
8
+ // src/components/horizontal-scroller.tsx
9
9
  const CONTROL_CLASS = "bg-background/90 text-foreground absolute top-1/2 -translate-y-1/2 rounded-full border p-1 shadow-sm";
10
10
  const HorizontalScroller = ({ children, className, nextLabel, previousLabel, contentClassName, viewportClassName, ...props }) => {
11
11
  const [viewport, setViewport] = useState(null);
@@ -105,5 +105,4 @@ const wheelDeltaPixels = (event, node) => {
105
105
  default: return event.deltaY;
106
106
  }
107
107
  };
108
- //#endregion
109
108
  export { HorizontalScroller, scrollState, wheelDeltaPixels };
@@ -1,9 +1,7 @@
1
- //#region src/components/identity-text.d.ts
2
1
  type IdentityTextProps = {
3
2
  children: string;
4
3
  className?: string;
5
4
  };
6
5
  /** Discloses clipped names on hover and when their owning control receives focus. */
7
6
  export declare const IdentityText: ({ children, className }: IdentityTextProps) => import("react").JSX.Element;
8
- //#endregion
9
7
  export {};
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/utils.js";
3
- import { Tooltip, TooltipContent as TooltipPopup, TooltipTrigger } from "./tooltip.js";
4
3
  import { withoutDirectionalControls } from "./bidi-text.js";
4
+ import { Tooltip, TooltipContent as TooltipPopup, TooltipTrigger } from "./tooltip.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { useCallback, useId, useState } from "react";
7
- //#region src/components/identity-text.tsx
7
+ // src/components/identity-text.tsx
8
8
  /** Discloses clipped names on hover and when their owning control receives focus. */
9
9
  const IdentityText = ({ children, className }) => {
10
10
  const triggerId = useId();
@@ -70,5 +70,4 @@ const IdentityText = ({ children, className }) => {
70
70
  })]
71
71
  });
72
72
  };
73
- //#endregion
74
73
  export { IdentityText };
@@ -1,10 +1,8 @@
1
1
  import { InlineDropPosition } from "../lib/inline-reorder.js";
2
- //#region src/components/inline-drop-indicator.d.ts
3
2
  /**
4
3
  * The bar beside a dragged-over item in a horizontal row. Render it inside
5
4
  * the item's positioned wrapper; `before`/`after` follow the text direction.
6
5
  */
7
6
  export declare const InlineDropIndicator: ({ position }: {
8
7
  position: InlineDropPosition | null;
9
- }) => import("react").JSX.Element | null;
10
- //#endregion
8
+ }) => import("react").JSX.Element | null;
@@ -1,6 +1,6 @@
1
1
  import { cn } from "../lib/utils.js";
2
2
  import { jsx } from "react/jsx-runtime";
3
- //#region src/components/inline-drop-indicator.tsx
3
+ // src/components/inline-drop-indicator.tsx
4
4
  /**
5
5
  * The bar beside a dragged-over item in a horizontal row. Render it inside
6
6
  * the item's positioned wrapper; `before`/`after` follow the text direction.
@@ -9,5 +9,4 @@ const InlineDropIndicator = ({ position }) => position === null ? null : /* @__P
9
9
  "aria-hidden": "true",
10
10
  className: cn("bg-primary pointer-events-none absolute inset-y-1 z-20 w-0.5 rounded-full", position === "before" ? "start-0" : "end-0")
11
11
  });
12
- //#endregion
13
12
  export { InlineDropIndicator };
@@ -1,5 +1,4 @@
1
1
  import { ComponentProps } from "react";
2
- //#region src/components/inline-rename.d.ts
3
2
  type InlineRenameInputProps = Omit<ComponentProps<"input">, "value" | "onChange" | "onKeyDown" | "size"> & {
4
3
  value: string;
5
4
  onValueChange: (value: string) => void;
@@ -9,5 +8,4 @@ type InlineRenameInputProps = Omit<ComponentProps<"input">, "value" | "onChange"
9
8
  fill?: boolean;
10
9
  };
11
10
  export declare const InlineRenameInput: ({ value, onValueChange, onCommit, onCancel, onBlur, className, ref, dir, fill, ...props }: InlineRenameInputProps) => import("react").JSX.Element;
12
- //#endregion
13
11
  export {};
@@ -1,9 +1,9 @@
1
- import { cn } from "../lib/utils.js";
2
1
  import { contentDir, isStructuredInputType } from "../hooks/use-content-dir.js";
2
+ import { cn } from "../lib/utils.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { useCallback, useImperativeHandle, useRef } from "react";
5
5
  import { panic } from "better-result";
6
- //#region src/components/inline-rename.tsx
6
+ // src/components/inline-rename.tsx
7
7
  /** Content-sized rename field; the title's parent owns its typography. */
8
8
  const mirrorTextFor = (value, placeholder) => {
9
9
  if (value !== "") return value;
@@ -72,5 +72,4 @@ const InlineRenameInput = ({ value, onValueChange, onCommit, onCancel, onBlur, c
72
72
  })]
73
73
  });
74
74
  };
75
- //#endregion
76
75
  export { InlineRenameInput };
@@ -1,4 +1,3 @@
1
- //#region src/components/input-control.d.ts
2
1
  /**
3
2
  * A text control is two boxes: the bordered wrapper a caller styles and the
4
3
  * element the text is typed into. The wrapper is what a height applies to and
@@ -24,5 +23,4 @@ export declare const INPUT_SIZE_CLASS_NAMES: {
24
23
  * the caret room, and a matching negative margin keeps the text in line with
25
24
  * its neighbours.
26
25
  */
27
- export declare const INLINE_FIELD_CLASS_NAME = "placeholder:text-foreground-placeholder focus-visible:ring-ring/30 -mx-1 min-h-0 w-full min-w-0 rounded-sm bg-transparent px-1 py-0 font-[inherit] text-[length:inherit] leading-[inherit] text-inherit outline-none focus-visible:ring-2";
28
- //#endregion
26
+ export declare const INLINE_FIELD_CLASS_NAME = "placeholder:text-foreground-placeholder focus-visible:ring-ring/30 -mx-1 min-h-0 w-full min-w-0 rounded-sm bg-transparent px-1 py-0 font-[inherit] text-[length:inherit] leading-[inherit] text-inherit outline-none focus-visible:ring-2";
@@ -1,5 +1,5 @@
1
1
  import { CONTROL_SIZE } from "../lib/control-size.js";
2
- //#region src/components/input-control.ts
2
+ // src/components/input-control.ts
3
3
  /**
4
4
  * A text control is two boxes: the bordered wrapper a caller styles and the
5
5
  * element the text is typed into. The wrapper is what a height applies to and
@@ -26,5 +26,4 @@ const INPUT_SIZE_CLASS_NAMES = {
26
26
  * its neighbours.
27
27
  */
28
28
  const INLINE_FIELD_CLASS_NAME = "placeholder:text-foreground-placeholder focus-visible:ring-ring/30 -mx-1 min-h-0 w-full min-w-0 rounded-sm bg-transparent px-1 py-0 font-[inherit] text-[length:inherit] leading-[inherit] text-inherit outline-none focus-visible:ring-2";
29
- //#endregion
30
29
  export { INLINE_FIELD_CLASS_NAME, INPUT_CONTROL_CLASS_NAME, INPUT_ELEMENT_CLASS_NAME, INPUT_SIZE_CLASS_NAMES };
@@ -2,7 +2,6 @@ import * as React$1 from "react";
2
2
  import { InputProps } from "./input.js";
3
3
  import { TextareaProps } from "./textarea.js";
4
4
  import { VariantProps } from "class-variance-authority";
5
- //#region src/components/input-group.d.ts
6
5
  declare const InputGroup: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
7
6
  declare const inputGroupAddonVariants: (props?: ({
8
7
  align?: "block-end" | "block-start" | "inline-end" | "inline-start" | null | undefined;
@@ -11,5 +10,4 @@ declare const InputGroupAddon: ({ className, align, ...props }: React$1.Componen
11
10
  declare const InputGroupText: ({ className, ...props }: React$1.ComponentProps<"span">) => React$1.JSX.Element;
12
11
  declare const InputGroupInput: ({ className, ...props }: InputProps) => React$1.JSX.Element;
13
12
  declare const InputGroupTextarea: ({ className, ...props }: TextareaProps) => React$1.JSX.Element;
14
- //#endregion
15
13
  export { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea };
@@ -4,14 +4,14 @@ import { Input } from "./input.js";
4
4
  import { Textarea } from "./textarea.js";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { cva } from "class-variance-authority";
7
- //#region src/components/input-group.tsx
7
+ // src/components/input-group.tsx
8
8
  const InputGroup = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
9
9
  className: cn("border-input bg-background text-foreground ring-ring/24 has-autofill:bg-foreground/4 has-[input:focus-visible,textarea:focus-visible]:border-ring has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 relative inline-flex w-full min-w-0 items-center rounded-lg border text-base shadow-xs/5 not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[align=block-end]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:h-auto has-data-[align=block-start]:flex-col has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] has-[textarea]:h-auto sm:text-sm dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/6%)] has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=inline-start]:**:[input]:ps-2 has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)] **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5", className),
10
10
  "data-slot": "input-group",
11
11
  role: "group",
12
12
  ...props
13
13
  });
14
- const inputGroupAddonVariants = cva("flex h-auto cursor-text items-center justify-center gap-2 leading-none select-none [&_svg]:-mx-0.5 in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80 [&>kbd]:rounded-[calc(var(--radius)-5px)]", {
14
+ const inputGroupAddonVariants = cva("flex h-auto cursor-text items-center justify-center gap-2 leading-none select-none [&_svg]:-mx-0.5 in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80 [&>kbd]:rounded-sm", {
15
15
  defaultVariants: { align: "inline-start" },
16
16
  variants: { align: {
17
17
  "block-end": "order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]",
@@ -25,8 +25,8 @@ const InputGroupAddon = ({ className, align = "inline-start", ...props }) => /*
25
25
  "data-align": align,
26
26
  "data-slot": "input-group-addon",
27
27
  onMouseDown: (e) => {
28
- const { target } = e;
29
- if (!(target instanceof Element)) return;
28
+ const { currentTarget, target } = e;
29
+ if (!(target instanceof Element) || !currentTarget.contains(target)) return;
30
30
  if (target.closest("button, a, input, select, textarea, [role='button'], [role='combobox'], [role='listbox'], [data-slot='select-trigger']")) return;
31
31
  e.preventDefault();
32
32
  const parent = e.currentTarget.parentElement;
@@ -49,5 +49,4 @@ const InputGroupTextarea = ({ className, ...props }) => /* @__PURE__ */ jsx(Text
49
49
  unstyled: true,
50
50
  ...props
51
51
  });
52
- //#endregion
53
52
  export { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea };
@@ -1,6 +1,5 @@
1
1
  import * as React$1 from "react";
2
2
  import { OTPInput } from "input-otp";
3
- //#region src/components/input-otp.d.ts
4
3
  declare const InputOTP: ({ className, containerClassName, ...props }: React$1.ComponentProps<typeof OTPInput> & {
5
4
  containerClassName?: string;
6
5
  }) => React$1.JSX.Element;
@@ -9,5 +8,4 @@ declare const InputOTPSlot: ({ index, className, ...props }: React$1.ComponentPr
9
8
  index: number;
10
9
  }) => React$1.JSX.Element;
11
10
  declare const InputOTPSeparator: ({ ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
12
- //#endregion
13
11
  export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
@@ -4,7 +4,7 @@ import { cn } from "../lib/utils.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import * as React$1 from "react";
6
6
  import { OTPInput, OTPInputContext } from "input-otp";
7
- //#region src/components/input-otp.tsx
7
+ // src/components/input-otp.tsx
8
8
  const InputOTP = ({ className, containerClassName, ...props }) => /* @__PURE__ */ jsx(OTPInput, {
9
9
  className: cn("disabled:cursor-not-allowed", className),
10
10
  containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
@@ -35,5 +35,4 @@ const InputOTPSeparator = ({ ...props }) => /* @__PURE__ */ jsx("div", {
35
35
  ...props,
36
36
  children: /* @__PURE__ */ jsx(MinusIcon, {})
37
37
  });
38
- //#endregion
39
38
  export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
@@ -1,7 +1,6 @@
1
1
  import * as React$1 from "react";
2
2
  import { ControlSize } from "../lib/control-size.js";
3
3
  import { Input as Input$1 } from "@base-ui/react/input";
4
- //#region src/components/input.d.ts
5
4
  type InputProps = Omit<Input$1.Props & React$1.RefAttributes<HTMLInputElement>, "size" | "style" | "type"> & {
6
5
  type?: Exclude<React$1.HTMLInputTypeAttribute, "file"> | undefined;
7
6
  size?: ControlSize | number;
@@ -16,5 +15,4 @@ type InputProps = Omit<Input$1.Props & React$1.RefAttributes<HTMLInputElement>,
16
15
  nativeInput?: boolean;
17
16
  };
18
17
  declare const Input: ({ className, size, unstyled, inline, nativeInput, dir, onChange, ...props }: InputProps) => React$1.JSX.Element;
19
- //#endregion
20
18
  export { Input, type InputProps };
@@ -1,12 +1,12 @@
1
1
  "use client";
2
+ import { isStructuredInputType, useContentDir } from "../hooks/use-content-dir.js";
2
3
  import { SearchIcon } from "../icons.js";
3
- import { cn } from "../lib/utils.js";
4
4
  import { CONTROL_SIZE } from "../lib/control-size.js";
5
- import { isStructuredInputType, useContentDir } from "../hooks/use-content-dir.js";
5
+ import { cn } from "../lib/utils.js";
6
6
  import { INLINE_FIELD_CLASS_NAME, INPUT_ELEMENT_CLASS_NAME, INPUT_SIZE_CLASS_NAMES } from "./input-control.js";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  import { Input as Input$1 } from "@base-ui/react/input";
9
- //#region src/components/input.tsx
9
+ // src/components/input.tsx
10
10
  const Input = ({ className, size = CONTROL_SIZE.default, unstyled = false, inline = false, nativeInput = false, dir, onChange, ...props }) => {
11
11
  const controlSize = typeof size === "number" ? CONTROL_SIZE.default : size;
12
12
  const contentDir = useContentDir({
@@ -45,5 +45,4 @@ const Input = ({ className, size = CONTROL_SIZE.default, unstyled = false, inlin
45
45
  })]
46
46
  });
47
47
  };
48
- //#endregion
49
48
  export { Input };
@@ -1,6 +1,5 @@
1
1
  import { InputContract, TextFieldContract } from "./input.shared.js";
2
2
  import { TextInputProps } from "react-native";
3
- //#region src/components/input.native.d.ts
4
3
  type NativeFieldProps = Omit<TextInputProps, keyof TextFieldContract> & TextFieldContract & {
5
4
  className?: string | undefined;
6
5
  };
@@ -19,5 +18,4 @@ type InputProps = NativeFieldProps & {
19
18
  * box, or iOS's filled search field for `type="search"`.
20
19
  */
21
20
  export declare const Input: ({ type, unstyled, size, ...props }: InputProps) => import("react").JSX.Element;
22
- //#endregion
23
21
  export {};
@@ -1,7 +1,7 @@
1
1
  import { textFontFamily } from "./text.native.js";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { TextInput } from "react-native";
4
- //#region src/components/input.native.tsx
4
+ // src/components/input.native.tsx
5
5
  /** The field's text at each control size, as the web sets it on a phone. */
6
6
  const TEXT_SIZE = {
7
7
  sm: "text-sm",
@@ -62,5 +62,4 @@ const Input = ({ type = "text", unstyled = false, size = "default", ...props })
62
62
  box: inputBox(type, size, unstyled),
63
63
  size
64
64
  });
65
- //#endregion
66
65
  export { Input, NativeField };
@@ -1,5 +1,4 @@
1
1
  import { ControlSize } from "../lib/control-size.js";
2
- //#region src/components/input.shared.d.ts
3
2
  /** The props every text field renderer accepts, with one meaning. */
4
3
  export type TextFieldContract = {
5
4
  size?: ControlSize;
@@ -15,5 +14,4 @@ export type TextFieldContract = {
15
14
  /** A single-line field also says what it holds; `search` draws a search field. */
16
15
  export type InputContract = TextFieldContract & {
17
16
  type?: "email" | "search" | "tel" | "text" | "url";
18
- };
19
- //#endregion
17
+ };