@alepha/ui 0.28.0 → 0.29.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 (378) hide show
  1. package/README.md +31 -2
  2. package/dist/components/account/account-connections.d.ts.map +1 -1
  3. package/dist/components/account/account-connections.js +4 -1
  4. package/dist/components/account/account-connections.js.map +1 -1
  5. package/dist/components/account/account-delete-dialog.d.ts.map +1 -1
  6. package/dist/components/account/account-delete-dialog.js +12 -15
  7. package/dist/components/account/account-delete-dialog.js.map +1 -1
  8. package/dist/components/account/account-keys.d.ts.map +1 -1
  9. package/dist/components/account/account-keys.js +22 -28
  10. package/dist/components/account/account-keys.js.map +1 -1
  11. package/dist/components/account/account-mfa-dialog.js +1 -4
  12. package/dist/components/account/account-mfa-dialog.js.map +1 -1
  13. package/dist/components/account/account-password-dialog.d.ts.map +1 -1
  14. package/dist/components/account/account-password-dialog.js +11 -14
  15. package/dist/components/account/account-password-dialog.js.map +1 -1
  16. package/dist/components/account/account-profile.js +3 -2
  17. package/dist/components/account/account-profile.js.map +1 -1
  18. package/dist/components/account/account-router-options.d.ts +38 -0
  19. package/dist/components/account/account-router-options.d.ts.map +1 -1
  20. package/dist/components/account/account-router-options.js.map +1 -1
  21. package/dist/components/account/account-router-page.d.ts +11 -1
  22. package/dist/components/account/account-router-page.d.ts.map +1 -1
  23. package/dist/components/account/account-router-page.js +11 -1
  24. package/dist/components/account/account-router-page.js.map +1 -1
  25. package/dist/components/account/account-router.d.ts +11 -0
  26. package/dist/components/account/account-router.d.ts.map +1 -1
  27. package/dist/components/account/account-router.js +16 -5
  28. package/dist/components/account/account-router.js.map +1 -1
  29. package/dist/components/admin/admin-audits.d.ts.map +1 -1
  30. package/dist/components/admin/admin-audits.js +91 -34
  31. package/dist/components/admin/admin-audits.js.map +1 -1
  32. package/dist/components/admin/admin-files.d.ts.map +1 -1
  33. package/dist/components/admin/admin-files.js +6 -17
  34. package/dist/components/admin/admin-files.js.map +1 -1
  35. package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -1
  36. package/dist/components/admin/admin-jobs-executions-panel.js +39 -8
  37. package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
  38. package/dist/components/admin/admin-jobs-payload-dialog.d.ts +19 -0
  39. package/dist/components/admin/admin-jobs-payload-dialog.d.ts.map +1 -0
  40. package/dist/components/admin/admin-jobs-payload-dialog.js +33 -0
  41. package/dist/components/admin/admin-jobs-payload-dialog.js.map +1 -0
  42. package/dist/components/admin/admin-keys.d.ts.map +1 -1
  43. package/dist/components/admin/admin-keys.js +5 -4
  44. package/dist/components/admin/admin-keys.js.map +1 -1
  45. package/dist/components/admin/admin-notifications-channel-label.d.ts +14 -0
  46. package/dist/components/admin/admin-notifications-channel-label.d.ts.map +1 -0
  47. package/dist/components/admin/admin-notifications-channel-label.js +26 -0
  48. package/dist/components/admin/admin-notifications-channel-label.js.map +1 -0
  49. package/dist/components/admin/admin-notifications-preview-body.d.ts.map +1 -1
  50. package/dist/components/admin/admin-notifications-preview-body.js +23 -13
  51. package/dist/components/admin/admin-notifications-preview-body.js.map +1 -1
  52. package/dist/components/admin/admin-notifications.d.ts.map +1 -1
  53. package/dist/components/admin/admin-notifications.js +11 -12
  54. package/dist/components/admin/admin-notifications.js.map +1 -1
  55. package/dist/components/admin/admin-payments.d.ts.map +1 -1
  56. package/dist/components/admin/admin-payments.js +9 -7
  57. package/dist/components/admin/admin-payments.js.map +1 -1
  58. package/dist/components/admin/admin-router-options.d.ts +12 -0
  59. package/dist/components/admin/admin-router-options.d.ts.map +1 -1
  60. package/dist/components/admin/admin-router-options.js.map +1 -1
  61. package/dist/components/admin/admin-router.d.ts +5 -8
  62. package/dist/components/admin/admin-router.d.ts.map +1 -1
  63. package/dist/components/admin/admin-router.js +6 -29
  64. package/dist/components/admin/admin-router.js.map +1 -1
  65. package/dist/components/admin/admin-sessions.d.ts.map +1 -1
  66. package/dist/components/admin/admin-sessions.js +9 -7
  67. package/dist/components/admin/admin-sessions.js.map +1 -1
  68. package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -1
  69. package/dist/components/admin/admin-user-detail-audits-tab.js +5 -4
  70. package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -1
  71. package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -1
  72. package/dist/components/admin/admin-user-detail-sessions-tab.js +7 -5
  73. package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -1
  74. package/dist/components/admin/admin-user-detail.js +3 -2
  75. package/dist/components/admin/admin-user-detail.js.map +1 -1
  76. package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -1
  77. package/dist/components/admin/admin-users-roles-picker.js.map +1 -1
  78. package/dist/components/admin/admin-users.d.ts.map +1 -1
  79. package/dist/components/admin/admin-users.js +6 -4
  80. package/dist/components/admin/admin-users.js.map +1 -1
  81. package/dist/components/admin/analytics/AnalyticsChartBars.js +2 -1
  82. package/dist/components/admin/analytics/AnalyticsChartBars.js.map +1 -1
  83. package/dist/components/admin/parameter-history-item.d.ts.map +1 -1
  84. package/dist/components/admin/parameter-history-item.js +3 -2
  85. package/dist/components/admin/parameter-history-item.js.map +1 -1
  86. package/dist/components/alepha-table/alepha-table-bulk-menu.js +2 -1
  87. package/dist/components/alepha-table/alepha-table-bulk-menu.js.map +1 -1
  88. package/dist/components/alepha-table/alepha-table-filter-dialog.d.ts +60 -0
  89. package/dist/components/alepha-table/alepha-table-filter-dialog.d.ts.map +1 -0
  90. package/dist/components/alepha-table/alepha-table-filter-dialog.js +88 -0
  91. package/dist/components/alepha-table/alepha-table-filter-dialog.js.map +1 -0
  92. package/dist/components/alepha-table/alepha-table-filter-menu.d.ts +35 -0
  93. package/dist/components/alepha-table/alepha-table-filter-menu.d.ts.map +1 -0
  94. package/dist/components/alepha-table/alepha-table-filter-menu.js +54 -0
  95. package/dist/components/alepha-table/alepha-table-filter-menu.js.map +1 -0
  96. package/dist/components/alepha-table/alepha-table.d.ts +188 -3
  97. package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
  98. package/dist/components/alepha-table/alepha-table.js +551 -162
  99. package/dist/components/alepha-table/alepha-table.js.map +1 -1
  100. package/dist/components/alepha-table/query-filters.d.ts +73 -0
  101. package/dist/components/alepha-table/query-filters.d.ts.map +1 -0
  102. package/dist/components/alepha-table/query-filters.js +118 -0
  103. package/dist/components/alepha-table/query-filters.js.map +1 -0
  104. package/dist/components/app-actions/app-actions.d.ts +21 -0
  105. package/dist/components/app-actions/app-actions.d.ts.map +1 -1
  106. package/dist/components/app-actions/app-actions.js +11 -5
  107. package/dist/components/app-actions/app-actions.js.map +1 -1
  108. package/dist/components/app-shell/app-shell.d.ts +45 -0
  109. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  110. package/dist/components/app-shell/app-shell.js +119 -16
  111. package/dist/components/app-shell/app-shell.js.map +1 -1
  112. package/dist/components/auth/auth-register.js +31 -30
  113. package/dist/components/auth/auth-register.js.map +1 -1
  114. package/dist/components/auto-form/auto-form.d.ts.map +1 -1
  115. package/dist/components/auto-form/auto-form.js +68 -30
  116. package/dist/components/auto-form/auto-form.js.map +1 -1
  117. package/dist/components/button-dark/button-dark.d.ts.map +1 -1
  118. package/dist/components/button-dark/button-dark.js +39 -8
  119. package/dist/components/button-dark/button-dark.js.map +1 -1
  120. package/dist/components/button-inbox/button-inbox.d.ts +66 -0
  121. package/dist/components/button-inbox/button-inbox.d.ts.map +1 -0
  122. package/dist/components/button-inbox/button-inbox.js +167 -0
  123. package/dist/components/button-inbox/button-inbox.js.map +1 -0
  124. package/dist/components/button-inbox/inbox-unread-atom.d.ts +22 -0
  125. package/dist/components/button-inbox/inbox-unread-atom.d.ts.map +1 -0
  126. package/dist/components/button-inbox/inbox-unread-atom.js +29 -0
  127. package/dist/components/button-inbox/inbox-unread-atom.js.map +1 -0
  128. package/dist/components/button-theme/button-theme.d.ts +4 -3
  129. package/dist/components/button-theme/button-theme.d.ts.map +1 -1
  130. package/dist/components/button-theme/button-theme.js +8 -25
  131. package/dist/components/button-theme/button-theme.js.map +1 -1
  132. package/dist/components/button-user/button-user.d.ts +19 -0
  133. package/dist/components/button-user/button-user.d.ts.map +1 -1
  134. package/dist/components/button-user/button-user.js +1 -1
  135. package/dist/components/button-user/button-user.js.map +1 -1
  136. package/dist/components/control/control.d.ts +51 -0
  137. package/dist/components/control/control.d.ts.map +1 -1
  138. package/dist/components/control/control.js +49 -5
  139. package/dist/components/control/control.js.map +1 -1
  140. package/dist/components/control-array/control-array.js +2 -1
  141. package/dist/components/control-array/control-array.js.map +1 -1
  142. package/dist/components/control-date/control-date.d.ts +27 -0
  143. package/dist/components/control-date/control-date.d.ts.map +1 -1
  144. package/dist/components/control-date/control-date.js +15 -19
  145. package/dist/components/control-date/control-date.js.map +1 -1
  146. package/dist/components/control-date/date-only.d.ts +18 -0
  147. package/dist/components/control-date/date-only.d.ts.map +1 -0
  148. package/dist/components/control-date/date-only.js +29 -0
  149. package/dist/components/control-date/date-only.js.map +1 -0
  150. package/dist/components/control-date-range/control-date-range.d.ts +56 -0
  151. package/dist/components/control-date-range/control-date-range.d.ts.map +1 -0
  152. package/dist/components/control-date-range/control-date-range.js +148 -0
  153. package/dist/components/control-date-range/control-date-range.js.map +1 -0
  154. package/dist/components/control-object/control-object.js +2 -1
  155. package/dist/components/control-object/control-object.js.map +1 -1
  156. package/dist/components/control-select/control-select.d.ts.map +1 -1
  157. package/dist/components/control-select/control-select.js +177 -37
  158. package/dist/components/control-select/control-select.js.map +1 -1
  159. package/dist/components/control-upload/control-upload.d.ts.map +1 -1
  160. package/dist/components/control-upload/control-upload.js +1 -11
  161. package/dist/components/control-upload/control-upload.js.map +1 -1
  162. package/dist/components/detail/detail-aside.d.ts.map +1 -1
  163. package/dist/components/detail/detail-aside.js +4 -3
  164. package/dist/components/detail/detail-aside.js.map +1 -1
  165. package/dist/components/file-image/file-image.js +2 -1
  166. package/dist/components/file-image/file-image.js.map +1 -1
  167. package/dist/components/markdown-view/SpoilerSpan.d.ts +28 -0
  168. package/dist/components/markdown-view/SpoilerSpan.d.ts.map +1 -0
  169. package/dist/components/markdown-view/SpoilerSpan.js +53 -0
  170. package/dist/components/markdown-view/SpoilerSpan.js.map +1 -0
  171. package/dist/components/markdown-view/diagram/layoutSequence.js +13 -23
  172. package/dist/components/markdown-view/diagram/layoutSequence.js.map +1 -1
  173. package/dist/components/markdown-view/diagram/textMetrics.js +2 -2
  174. package/dist/components/markdown-view/diagram/textMetrics.js.map +1 -1
  175. package/dist/components/markdown-view/markdown-view.css +44 -0
  176. package/dist/components/markdown-view/markdown-view.d.ts +12 -0
  177. package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
  178. package/dist/components/markdown-view/markdown-view.js +22 -1
  179. package/dist/components/markdown-view/markdown-view.js.map +1 -1
  180. package/dist/components/markdown-view/remarkSpoiler.d.ts +17 -0
  181. package/dist/components/markdown-view/remarkSpoiler.d.ts.map +1 -0
  182. package/dist/components/markdown-view/remarkSpoiler.js +117 -0
  183. package/dist/components/markdown-view/remarkSpoiler.js.map +1 -0
  184. package/dist/components/permission-matrix/permission-matrix-group-rows.d.ts +34 -0
  185. package/dist/components/permission-matrix/permission-matrix-group-rows.d.ts.map +1 -0
  186. package/dist/components/permission-matrix/permission-matrix-group-rows.js +109 -0
  187. package/dist/components/permission-matrix/permission-matrix-group-rows.js.map +1 -0
  188. package/dist/components/permission-matrix/permission-matrix.d.ts +145 -0
  189. package/dist/components/permission-matrix/permission-matrix.d.ts.map +1 -0
  190. package/dist/components/permission-matrix/permission-matrix.js +113 -0
  191. package/dist/components/permission-matrix/permission-matrix.js.map +1 -0
  192. package/dist/components/plate-layout/plate-layout.d.ts +5 -0
  193. package/dist/components/plate-layout/plate-layout.d.ts.map +1 -1
  194. package/dist/components/plate-layout/plate-layout.js +2 -1
  195. package/dist/components/plate-layout/plate-layout.js.map +1 -1
  196. package/dist/components/plate-layout/plate-tab-bar.d.ts +10 -0
  197. package/dist/components/plate-layout/plate-tab-bar.d.ts.map +1 -1
  198. package/dist/components/plate-layout/plate-tab-bar.js +1 -1
  199. package/dist/components/plate-layout/plate-tab-bar.js.map +1 -1
  200. package/dist/components/settings/settings-nav.js +2 -1
  201. package/dist/components/settings/settings-nav.js.map +1 -1
  202. package/dist/components/time-ago/time-ago.d.ts +57 -0
  203. package/dist/components/time-ago/time-ago.d.ts.map +1 -0
  204. package/dist/components/time-ago/time-ago.js +60 -0
  205. package/dist/components/time-ago/time-ago.js.map +1 -0
  206. package/dist/components/tree-view/tree-model.d.ts +128 -0
  207. package/dist/components/tree-view/tree-model.d.ts.map +1 -0
  208. package/dist/components/tree-view/tree-model.js +226 -0
  209. package/dist/components/tree-view/tree-model.js.map +1 -0
  210. package/dist/components/tree-view/tree-view-rename-input.d.ts +31 -0
  211. package/dist/components/tree-view/tree-view-rename-input.d.ts.map +1 -0
  212. package/dist/components/tree-view/tree-view-rename-input.js +68 -0
  213. package/dist/components/tree-view/tree-view-rename-input.js.map +1 -0
  214. package/dist/components/tree-view/tree-view-resizer.d.ts +38 -0
  215. package/dist/components/tree-view/tree-view-resizer.d.ts.map +1 -0
  216. package/dist/components/tree-view/tree-view-resizer.js +73 -0
  217. package/dist/components/tree-view/tree-view-resizer.js.map +1 -0
  218. package/dist/components/tree-view/tree-view-row.d.ts +177 -0
  219. package/dist/components/tree-view/tree-view-row.d.ts.map +1 -0
  220. package/dist/components/tree-view/tree-view-row.js +241 -0
  221. package/dist/components/tree-view/tree-view-row.js.map +1 -0
  222. package/dist/components/tree-view/tree-view.d.ts +186 -0
  223. package/dist/components/tree-view/tree-view.d.ts.map +1 -0
  224. package/dist/components/tree-view/tree-view.js +112 -0
  225. package/dist/components/tree-view/tree-view.js.map +1 -0
  226. package/dist/components/tree-view/use-tree-state.d.ts +79 -0
  227. package/dist/components/tree-view/use-tree-state.d.ts.map +1 -0
  228. package/dist/components/tree-view/use-tree-state.js +93 -0
  229. package/dist/components/tree-view/use-tree-state.js.map +1 -0
  230. package/dist/components/ui/button.d.ts.map +1 -1
  231. package/dist/components/ui/button.js +1 -1
  232. package/dist/components/ui/button.js.map +1 -1
  233. package/dist/components/ui/dropdown-menu.js.map +1 -1
  234. package/dist/components/ui/select.d.ts +7 -0
  235. package/dist/components/ui/select.d.ts.map +1 -1
  236. package/dist/components/ui/select.js +7 -0
  237. package/dist/components/ui/select.js.map +1 -1
  238. package/dist/components/ui/sidebar.js +1 -1
  239. package/dist/components/ui/sidebar.js.map +1 -1
  240. package/dist/components/ui/table.js.map +1 -1
  241. package/dist/components/ui/tooltip.js.map +1 -1
  242. package/dist/lib/i18n-fr.d.ts.map +1 -1
  243. package/dist/lib/i18n-fr.js +31 -47
  244. package/dist/lib/i18n-fr.js.map +1 -1
  245. package/dist/lib/utils.d.ts +22 -2
  246. package/dist/lib/utils.d.ts.map +1 -1
  247. package/dist/lib/utils.js +29 -5
  248. package/dist/lib/utils.js.map +1 -1
  249. package/dist/styles.css +255 -0
  250. package/package.json +13 -14
  251. package/src/components/account/__tests__/account-router.spec.ts +95 -0
  252. package/src/components/account/account-connections.tsx +14 -1
  253. package/src/components/account/account-delete-dialog.tsx +3 -2
  254. package/src/components/account/account-keys.tsx +11 -4
  255. package/src/components/account/account-mfa-dialog.tsx +1 -1
  256. package/src/components/account/account-password-dialog.tsx +3 -2
  257. package/src/components/account/account-profile.tsx +1 -1
  258. package/src/components/account/account-router-options.tsx +45 -0
  259. package/src/components/account/account-router-page.tsx +11 -1
  260. package/src/components/account/account-router.tsx +23 -6
  261. package/src/components/admin/__tests__/admin-jobs-payload-dialog.browser.spec.tsx +68 -0
  262. package/src/components/admin/__tests__/admin-notifications-preview-body.browser.spec.tsx +20 -4
  263. package/src/components/admin/__tests__/admin-status-labels.browser.spec.tsx +0 -31
  264. package/src/components/admin/admin-audits.tsx +99 -5
  265. package/src/components/admin/admin-files.tsx +7 -16
  266. package/src/components/admin/admin-jobs-executions-panel.tsx +152 -114
  267. package/src/components/admin/admin-jobs-payload-dialog.tsx +57 -0
  268. package/src/components/admin/admin-keys.tsx +7 -4
  269. package/src/components/admin/admin-notifications-channel-label.ts +18 -0
  270. package/src/components/admin/admin-notifications-preview-body.tsx +7 -2
  271. package/src/components/admin/admin-notifications.tsx +19 -8
  272. package/src/components/admin/admin-payments.tsx +7 -4
  273. package/src/components/admin/admin-router-options.tsx +12 -0
  274. package/src/components/admin/admin-router.tsx +5 -27
  275. package/src/components/admin/admin-sessions.tsx +10 -6
  276. package/src/components/admin/admin-user-detail-audits-tab.tsx +7 -4
  277. package/src/components/admin/admin-user-detail-sessions-tab.tsx +7 -4
  278. package/src/components/admin/admin-users-roles-picker.tsx +4 -0
  279. package/src/components/admin/admin-users.tsx +6 -3
  280. package/src/components/admin/parameter-history-item.tsx +4 -2
  281. package/src/components/alepha-table/__tests__/alepha-table-default-hidden.browser.spec.tsx +108 -0
  282. package/src/components/alepha-table/__tests__/alepha-table-empty-state.browser.spec.tsx +233 -0
  283. package/src/components/alepha-table/__tests__/alepha-table-persist-facets.browser.spec.tsx +177 -0
  284. package/src/components/alepha-table/__tests__/alepha-table-persisted-filters.browser.spec.tsx +182 -0
  285. package/src/components/alepha-table/__tests__/alepha-table-query-seed.browser.spec.tsx +170 -0
  286. package/src/components/alepha-table/__tests__/alepha-table-row-action-checked.browser.spec.tsx +210 -0
  287. package/src/components/alepha-table/__tests__/alepha-table-row-action-group.browser.spec.tsx +202 -0
  288. package/src/components/alepha-table/__tests__/alepha-table-scope.browser.spec.tsx +161 -0
  289. package/src/components/alepha-table/__tests__/alepha-table-share-filters.browser.spec.tsx +309 -0
  290. package/src/components/alepha-table/__tests__/query-filters.spec.ts +212 -0
  291. package/src/components/alepha-table/alepha-table-filter-dialog.tsx +162 -0
  292. package/src/components/alepha-table/alepha-table-filter-menu.tsx +77 -0
  293. package/src/components/alepha-table/alepha-table.tsx +1113 -207
  294. package/src/components/alepha-table/query-filters.ts +159 -0
  295. package/src/components/app-actions/app-actions.tsx +32 -3
  296. package/src/components/app-shell/__tests__/sidebar-nav-accordion.browser.spec.tsx +163 -0
  297. package/src/components/app-shell/app-shell.tsx +255 -12
  298. package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +1 -1
  299. package/src/components/auto-form/auto-form.tsx +98 -30
  300. package/src/components/button-dark/button-dark.tsx +47 -8
  301. package/src/components/button-inbox/__tests__/button-inbox.browser.spec.tsx +247 -0
  302. package/src/components/button-inbox/button-inbox.tsx +303 -0
  303. package/src/components/button-inbox/inbox-unread-atom.ts +27 -0
  304. package/src/components/button-theme/button-theme.tsx +16 -29
  305. package/src/components/button-user/__tests__/button-user-avatar.browser.spec.tsx +88 -0
  306. package/src/components/button-user/button-user.tsx +24 -1
  307. package/src/components/control/__tests__/control-date-range.browser.spec.tsx +177 -0
  308. package/src/components/control/control.tsx +119 -12
  309. package/src/components/control-date/control-date.tsx +117 -22
  310. package/src/components/control-date/date-only.ts +26 -0
  311. package/src/components/control-date-range/control-date-range.tsx +250 -0
  312. package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +129 -15
  313. package/src/components/control-select/__tests__/control-select-deselect.browser.spec.tsx +27 -6
  314. package/src/components/control-select/__tests__/control-select-multi.browser.spec.tsx +204 -1
  315. package/src/components/control-select/__tests__/control-select-size-minimal.browser.spec.tsx +77 -1
  316. package/src/components/control-select/control-select.tsx +317 -83
  317. package/src/components/control-upload/control-upload.tsx +1 -10
  318. package/src/components/detail/detail-aside.tsx +30 -6
  319. package/src/components/markdown-view/SpoilerSpan.tsx +66 -0
  320. package/src/components/markdown-view/__tests__/markdown-view-spoiler.browser.spec.tsx +165 -0
  321. package/src/components/markdown-view/diagram/textMetrics.spec.ts +1 -1
  322. package/src/components/markdown-view/diagram/textMetrics.ts +2 -2
  323. package/src/components/markdown-view/markdown-view.css +44 -0
  324. package/src/components/markdown-view/markdown-view.tsx +37 -1
  325. package/src/components/markdown-view/remarkSpoiler.ts +150 -0
  326. package/src/components/permission-matrix/__tests__/permission-matrix.browser.spec.tsx +237 -0
  327. package/src/components/permission-matrix/permission-matrix-group-rows.tsx +240 -0
  328. package/src/components/permission-matrix/permission-matrix.tsx +286 -0
  329. package/src/components/plate-layout/__tests__/plate-layout.browser.spec.tsx +22 -0
  330. package/src/components/plate-layout/plate-layout.tsx +6 -0
  331. package/src/components/plate-layout/plate-tab-bar.tsx +27 -1
  332. package/src/components/time-ago/time-ago.browser.spec.tsx +110 -0
  333. package/src/components/time-ago/time-ago.tsx +80 -0
  334. package/src/components/tree-view/__tests__/tree-model.spec.ts +441 -0
  335. package/src/components/tree-view/__tests__/tree-view-drag.browser.spec.tsx +295 -0
  336. package/src/components/tree-view/__tests__/tree-view-rename.browser.spec.tsx +278 -0
  337. package/src/components/tree-view/__tests__/tree-view-resizer.browser.spec.tsx +112 -0
  338. package/src/components/tree-view/__tests__/tree-view.browser.spec.tsx +260 -0
  339. package/src/components/tree-view/__tests__/use-tree-state.browser.spec.tsx +238 -0
  340. package/src/components/tree-view/tree-model.ts +369 -0
  341. package/src/components/tree-view/tree-view-rename-input.tsx +95 -0
  342. package/src/components/tree-view/tree-view-resizer.tsx +83 -0
  343. package/src/components/tree-view/tree-view-row.tsx +414 -0
  344. package/src/components/tree-view/tree-view.tsx +300 -0
  345. package/src/components/tree-view/use-tree-state.ts +184 -0
  346. package/src/components/ui/button.tsx +79 -1
  347. package/src/components/ui/dropdown-menu.tsx +1 -1
  348. package/src/components/ui/select.tsx +7 -0
  349. package/src/components/ui/table.tsx +1 -1
  350. package/src/components/ui/tooltip.tsx +1 -1
  351. package/src/lib/i18n-fr.ts +34 -51
  352. package/src/lib/utils.ts +32 -4
  353. package/src/styles.css +255 -0
  354. package/dist/components/admin/admin-workflows-execution-sheet.d.ts +0 -11
  355. package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +0 -1
  356. package/dist/components/admin/admin-workflows-execution-sheet.js +0 -190
  357. package/dist/components/admin/admin-workflows-execution-sheet.js.map +0 -1
  358. package/dist/components/admin/admin-workflows-executions-panel.d.ts +0 -9
  359. package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +0 -1
  360. package/dist/components/admin/admin-workflows-executions-panel.js +0 -121
  361. package/dist/components/admin/admin-workflows-executions-panel.js.map +0 -1
  362. package/dist/components/admin/admin-workflows-status-badge.d.ts +0 -12
  363. package/dist/components/admin/admin-workflows-status-badge.d.ts.map +0 -1
  364. package/dist/components/admin/admin-workflows-status-badge.js +0 -30
  365. package/dist/components/admin/admin-workflows-status-badge.js.map +0 -1
  366. package/dist/components/admin/admin-workflows-status-labels.d.ts +0 -19
  367. package/dist/components/admin/admin-workflows-status-labels.d.ts.map +0 -1
  368. package/dist/components/admin/admin-workflows-status-labels.js +0 -48
  369. package/dist/components/admin/admin-workflows-status-labels.js.map +0 -1
  370. package/dist/components/admin/admin-workflows.d.ts +0 -4
  371. package/dist/components/admin/admin-workflows.d.ts.map +0 -1
  372. package/dist/components/admin/admin-workflows.js +0 -145
  373. package/dist/components/admin/admin-workflows.js.map +0 -1
  374. package/src/components/admin/admin-workflows-execution-sheet.tsx +0 -285
  375. package/src/components/admin/admin-workflows-executions-panel.tsx +0 -169
  376. package/src/components/admin/admin-workflows-status-badge.tsx +0 -41
  377. package/src/components/admin/admin-workflows-status-labels.ts +0 -51
  378. package/src/components/admin/admin-workflows.tsx +0 -209
@@ -0,0 +1,112 @@
1
+ import { TreeViewRow } from "./tree-view-row.js";
2
+ import { useMemo, useRef } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/components/tree-view/tree-view.tsx
5
+ /**
6
+ * The controlled tree.
7
+ *
8
+ * Everything is a prop: `rows` (from `flattenTree`), the collapsed set, the
9
+ * selection, and the render slots. The component owns the row markup, the
10
+ * indent geometry, the ARIA structure and the memo, and nothing else.
11
+ *
12
+ * ```tsx
13
+ * <TreeView
14
+ * rows={flattenTree(nodes, collapsed)}
15
+ * collapsed={collapsed}
16
+ * selectedId={openId}
17
+ * onSelect={(node) => open(node.id)}
18
+ * onToggle={toggle}
19
+ * label="Files"
20
+ * />
21
+ * ```
22
+ */
23
+ const TreeView = (props) => {
24
+ /**
25
+ * The current props, read through a ref so the facade below can be held
26
+ * forever and still call this render's implementation.
27
+ *
28
+ * Assigned during render on purpose: an effect would leave one render's
29
+ * worth of rows calling last render's callbacks, which is exactly the
30
+ * stale-closure bug the facade exists to avoid.
31
+ */
32
+ const implRef = useRef(props);
33
+ implRef.current = props;
34
+ /**
35
+ * The same slots behind an object whose identity NEVER changes.
36
+ *
37
+ * This is what makes `memo(TreeViewRow)` worth anything, and it is built
38
+ * HERE rather than asked of the consumer: a showcase or an app passing
39
+ * inline arrows would otherwise defeat the memo on its first day, and the
40
+ * failure is invisible (nothing goes red, the tree just re-renders every
41
+ * row on every toggle).
42
+ */
43
+ const facade = useMemo(() => ({
44
+ select: (node) => implRef.current.onSelect(node),
45
+ toggle: (id) => implRef.current.onToggle(id),
46
+ renderIcon: (node, state) => implRef.current.renderIcon?.(node, state),
47
+ renderLabel: (node, state) => implRef.current.renderLabel?.(node, state) ?? node.name,
48
+ renderTrailing: (node, state) => implRef.current.renderTrailing?.(node, state),
49
+ onDragStart: (id) => implRef.current.onDragStart?.(id),
50
+ onDragOver: (id, position) => implRef.current.onDragOver?.(id, position),
51
+ onDrop: (id) => implRef.current.onDrop?.(id),
52
+ onDragEnd: () => implRef.current.onDragEnd?.(),
53
+ commitRename: (id, name) => implRef.current.onCommitRename?.(id, name),
54
+ cancelRename: () => implRef.current.onCancelRename?.(),
55
+ renderMenu: (node) => implRef.current.renderMenu?.(node)
56
+ }), []);
57
+ /**
58
+ * Whether ANY row of this tree is being dragged.
59
+ *
60
+ * ⚠️ A different question from "this row is being dragged", and it has to be
61
+ * answered here rather than in a row: a row can compare its own id, but only
62
+ * the tree knows whether the drag exists at all.
63
+ */
64
+ const isDragActive = props.dragId !== void 0;
65
+ /**
66
+ * The dragged node and everything beneath it.
67
+ *
68
+ * ⚠️ The one legality question this component answers on its own, and it
69
+ * has to: dropping a branch inside its own subtree would orphan the branch,
70
+ * which is a fact about the TREE and not about the consumer's domain. The
71
+ * consumer's `resolveDrop` refuses such a drop at the end anyway, so without
72
+ * this the row would light up promising a move that never happens.
73
+ *
74
+ * Computed once per render as a SET rather than asking `nodeHolds` per row,
75
+ * so a drag over a large tree stays one walk of the dragged subtree.
76
+ */
77
+ const forbidden = useMemo(() => {
78
+ const ids = /* @__PURE__ */ new Set();
79
+ if (props.dragId === void 0) return ids;
80
+ const dragged = props.rows.find((row) => row.node.id === props.dragId)?.node;
81
+ if (!dragged) return ids;
82
+ const walk = (node) => {
83
+ ids.add(node.id);
84
+ for (const child of node.children ?? []) walk(child);
85
+ };
86
+ walk(dragged);
87
+ return ids;
88
+ }, [props.dragId, props.rows]);
89
+ return /* @__PURE__ */ jsx("div", {
90
+ role: "tree",
91
+ "aria-label": props.label,
92
+ className: props.className,
93
+ children: props.rows.map((row) => /* @__PURE__ */ jsx(TreeViewRow, {
94
+ node: row.node,
95
+ depth: row.depth,
96
+ facade,
97
+ isCollapsed: props.collapsed.has(row.node.id),
98
+ isSelected: props.selectedId === row.node.id,
99
+ isRenaming: props.renamingId === row.node.id,
100
+ isDragging: props.dragId === row.node.id,
101
+ isDraggable: props.draggable === true,
102
+ isDragActive,
103
+ isDropForbidden: forbidden.has(row.node.id),
104
+ dropHere: props.drop?.id === row.node.id ? props.drop.position : void 0,
105
+ hasMenu: props.renderMenu !== void 0
106
+ }, row.node.id))
107
+ });
108
+ };
109
+ //#endregion
110
+ export { TreeView };
111
+
112
+ //# sourceMappingURL=tree-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree-view.js","names":[],"sources":["../../../src/components/tree-view/tree-view.tsx"],"sourcesContent":["import { type ReactElement, type ReactNode, useMemo, useRef } from \"react\";\n\nimport {\n type TreeDropPosition,\n type TreeNode,\n type TreeRow,\n} from \"./tree-model.ts\";\nimport { type TreeViewFacade, TreeViewRow } from \"./tree-view-row.tsx\";\n\n/**\n * A controlled tree: rows in, gestures out.\n *\n * ⚠️ This file is the DECLARATION only. The core lands in #Q1939, drag and\n * drop in #Q1940, rename and the menu slot in #Q1941. Every prop below says\n * which quest implements it.\n *\n * ## The contract, and why it is this one\n *\n * `TreeView` owns the row markup, the indent geometry and the memo. A\n * consumer supplies **render slots** (`renderIcon`, `renderLabel`,\n * `renderTrailing`, `renderMenu`) and turns capabilities on with flags.\n *\n * Render **functions** rather than `ReactNode`s carried on the node, for two\n * measured reasons. Lore's folder icon and the docs tree's folder icon both\n * need the row's collapsed state, which is row state and not node data. And\n * an element built per render changes identity every render, which is\n * exactly what defeats the row memo, while a function called inside the row\n * keeps every row prop a primitive, a memoised node, or a stable function.\n *\n * Stable **by construction**: `TreeView` wraps every callback and render prop\n * into one `useRef`-backed facade (the `implRef` pattern from Lore's\n * `useFolioTreeModel`) and hands rows that. A consumer passing inline arrows\n * still gets a memo that holds, and nobody has to rediscover `useCallback`\n * discipline.\n *\n * A `renderRow` escape hatch was considered and rejected: it hands out the\n * indent geometry and the memo contract, the two things that took the most\n * work and are easiest to break from outside.\n *\n * ## Two constraints for the docs tree, without declaring anything docs-only\n *\n * The label is its **own element**, separate from the row's click handler and\n * from the disclosure button, so rendering it as an anchor one day is a local\n * change rather than a rewrite of the row. `getHref` is deliberately NOT\n * declared: nothing in this epic implements it, and a declared prop that does\n * nothing is a lie in a types file.\n *\n * ARIA tree roles are built into the core (#Q1939) rather than opted into,\n * because they cost nothing and every consumer gains them.\n */\n\n/**\n * What a row knows about itself, handed to every render slot so a consumer\n * can draw a different icon for an open folder, dim a row being dragged, and\n * so on. None of this is node data, which is why the slots are functions of\n * two arguments.\n */\nexport interface TreeRowState {\n collapsed: boolean;\n selected: boolean;\n renaming: boolean;\n dragging: boolean;\n}\n\nexport interface TreeViewProps<T = undefined> {\n /**\n * The visible rows, from `flattenTree(nodes, collapsed)`. The tree renders\n * exactly these, in order: it does no filtering of its own.\n */\n rows: TreeRow<T>[];\n /**\n * Ids of the collapsed branches. Controlled, and the same set `rows` was\n * flattened against; the tree reads it to draw the disclosure and to\n * populate {@link TreeRowState.collapsed}.\n */\n collapsed: ReadonlySet<string>;\n /**\n * The selected row, if any. Selection is a prop pair and NOT hook state,\n * on purpose: Lore derives it from the URL, the docs tree will too, and\n * the showcase keeps a `useState` (see #Q1942).\n */\n selectedId?: string;\n /**\n * A row was activated: a plain click, or Enter / Space on a focused row.\n * ⚠️ A real double click fires click, click, dblclick, so the row guards\n * on `e.detail > 1` and this fires once per burst (#Q1939).\n */\n onSelect: (node: TreeNode<T>) => void;\n /**\n * The disclosure of a branch row was clicked. The consumer owns the\n * collapsed set, so the tree reports rather than resolves.\n */\n onToggle: (id: string) => void;\n /**\n * The leading glyph. Colour it here: the tree paints only `--border`,\n * `--primary` and `--muted`, never a palette of its own (#Q1939).\n */\n renderIcon?: (node: TreeNode<T>, state: TreeRowState) => ReactNode;\n /**\n * Defaults to `node.name`. The docs tree will put its dim `.md` suffix\n * here, which a trailing slot cannot do: trailing lands at the far right\n * after `flex-1`, and the suffix belongs against the name.\n */\n renderLabel?: (node: TreeNode<T>, state: TreeRowState) => ReactNode;\n /**\n * The far right of the row, after the label takes its `flex-1`. Lore's pin\n * badge, a count, a hover affordance.\n */\n renderTrailing?: (node: TreeNode<T>, state: TreeRowState) => ReactNode;\n\n // Drag and drop, #Q1940. Off unless `draggable` is set: a read-only tree\n // must not pay a byte of handler for it.\n\n /**\n * Turn native HTML5 drag and drop on. #Q1940.\n */\n draggable?: boolean;\n /**\n * The row currently being dragged, if any. The tree also derives \"any row\n * of this tree is being dragged\" from it, which is a different question\n * from \"this row is being dragged\" and cannot be answered by the row.\n * #Q1940.\n */\n dragId?: string;\n /**\n * Where the drop marker is drawn right now. #Q1940.\n */\n drop?: { id: string; position: TreeDropPosition };\n /**\n * A drag started on this row. #Q1940.\n */\n onDragStart?: (id: string) => void;\n /**\n * The pointer is over this row, in this zone. A branch splits 28/44/28\n * into before / inside / after; a leaf splits 50/50 with no inside area.\n * #Q1940.\n */\n onDragOver?: (id: string, position: TreeDropPosition) => void;\n /**\n * A drop landed on this row. The tree resolves nothing: the consumer calls\n * `resolveDrop` itself, because only it knows whether the resulting parent\n * change is legal in its own domain. #Q1940.\n */\n onDrop?: (id: string) => void;\n /**\n * The drag ended, dropped or cancelled. #Q1940.\n */\n onDragEnd?: () => void;\n\n // Rename and the menu slot, #Q1941.\n\n /**\n * The row showing an inline rename input, if any. The tree owns the draft\n * string; the consumer owns what a committed name means. #Q1941.\n */\n renamingId?: string;\n /**\n * Enter, or a blur that is not an Escape. #Q1941.\n */\n onCommitRename?: (id: string, name: string) => void;\n /**\n * Escape. ⚠️ Removing a focused element from the DOM can still fire\n * `blur` in some browsers, so the row guards the commit rather than\n * trusting the ordering. #Q1941.\n */\n onCancelRename?: () => void;\n /**\n * The context menu's content. Provided, the tree wraps each row in\n * `ContextMenu` / `ContextMenuTrigger`; omitted, it wraps nothing. The\n * verbs are the consumer's: Lore keeps its own 170-line menu and passes it\n * through here. #Q1941.\n */\n renderMenu?: (node: TreeNode<T>) => ReactNode;\n\n /**\n * Spoken name of the tree, for `role=\"tree\"`. #Q1939.\n */\n label?: string;\n className?: string;\n}\n\n/**\n * The controlled tree.\n *\n * Everything is a prop: `rows` (from `flattenTree`), the collapsed set, the\n * selection, and the render slots. The component owns the row markup, the\n * indent geometry, the ARIA structure and the memo, and nothing else.\n *\n * ```tsx\n * <TreeView\n * rows={flattenTree(nodes, collapsed)}\n * collapsed={collapsed}\n * selectedId={openId}\n * onSelect={(node) => open(node.id)}\n * onToggle={toggle}\n * label=\"Files\"\n * />\n * ```\n */\nexport const TreeView = <T,>(props: TreeViewProps<T>): ReactElement => {\n /**\n * The current props, read through a ref so the facade below can be held\n * forever and still call this render's implementation.\n *\n * Assigned during render on purpose: an effect would leave one render's\n * worth of rows calling last render's callbacks, which is exactly the\n * stale-closure bug the facade exists to avoid.\n */\n const implRef = useRef<TreeViewProps<T>>(props);\n implRef.current = props;\n\n /**\n * The same slots behind an object whose identity NEVER changes.\n *\n * This is what makes `memo(TreeViewRow)` worth anything, and it is built\n * HERE rather than asked of the consumer: a showcase or an app passing\n * inline arrows would otherwise defeat the memo on its first day, and the\n * failure is invisible (nothing goes red, the tree just re-renders every\n * row on every toggle).\n */\n const facade = useMemo<TreeViewFacade<T>>(\n () => ({\n select: (node) => implRef.current.onSelect(node),\n toggle: (id) => implRef.current.onToggle(id),\n renderIcon: (node, state) => implRef.current.renderIcon?.(node, state),\n renderLabel: (node, state) =>\n implRef.current.renderLabel?.(node, state) ?? node.name,\n renderTrailing: (node, state) =>\n implRef.current.renderTrailing?.(node, state),\n onDragStart: (id) => implRef.current.onDragStart?.(id),\n onDragOver: (id, position) => implRef.current.onDragOver?.(id, position),\n onDrop: (id) => implRef.current.onDrop?.(id),\n onDragEnd: () => implRef.current.onDragEnd?.(),\n commitRename: (id, name) => implRef.current.onCommitRename?.(id, name),\n cancelRename: () => implRef.current.onCancelRename?.(),\n renderMenu: (node) => implRef.current.renderMenu?.(node),\n }),\n [],\n );\n\n /**\n * Whether ANY row of this tree is being dragged.\n *\n * ⚠️ A different question from \"this row is being dragged\", and it has to be\n * answered here rather than in a row: a row can compare its own id, but only\n * the tree knows whether the drag exists at all.\n */\n const isDragActive = props.dragId !== undefined;\n\n /**\n * The dragged node and everything beneath it.\n *\n * ⚠️ The one legality question this component answers on its own, and it\n * has to: dropping a branch inside its own subtree would orphan the branch,\n * which is a fact about the TREE and not about the consumer's domain. The\n * consumer's `resolveDrop` refuses such a drop at the end anyway, so without\n * this the row would light up promising a move that never happens.\n *\n * Computed once per render as a SET rather than asking `nodeHolds` per row,\n * so a drag over a large tree stays one walk of the dragged subtree.\n */\n const forbidden = useMemo(() => {\n const ids = new Set<string>();\n if (props.dragId === undefined) return ids;\n const dragged = props.rows.find(\n (row) => row.node.id === props.dragId,\n )?.node;\n if (!dragged) return ids;\n const walk = (node: TreeNode<T>): void => {\n ids.add(node.id);\n for (const child of node.children ?? []) walk(child);\n };\n walk(dragged);\n return ids;\n }, [props.dragId, props.rows]);\n\n return (\n <div role=\"tree\" aria-label={props.label} className={props.className}>\n {props.rows.map((row) => (\n <TreeViewRow\n key={row.node.id}\n node={row.node}\n depth={row.depth}\n facade={facade}\n isCollapsed={props.collapsed.has(row.node.id)}\n isSelected={props.selectedId === row.node.id}\n isRenaming={props.renamingId === row.node.id}\n isDragging={props.dragId === row.node.id}\n isDraggable={props.draggable === true}\n isDragActive={isDragActive}\n isDropForbidden={forbidden.has(row.node.id)}\n dropHere={\n props.drop?.id === row.node.id ? props.drop.position : undefined\n }\n hasMenu={props.renderMenu !== undefined}\n />\n ))}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuMA,MAAa,YAAgB,UAA0C;;;;;;;;;CASrE,MAAM,UAAU,OAAyB,KAAK;CAC9C,QAAQ,UAAU;;;;;;;;;;CAWlB,MAAM,SAAS,eACN;EACL,SAAS,SAAS,QAAQ,QAAQ,SAAS,IAAI;EAC/C,SAAS,OAAO,QAAQ,QAAQ,SAAS,EAAE;EAC3C,aAAa,MAAM,UAAU,QAAQ,QAAQ,aAAa,MAAM,KAAK;EACrE,cAAc,MAAM,UAClB,QAAQ,QAAQ,cAAc,MAAM,KAAK,KAAK,KAAK;EACrD,iBAAiB,MAAM,UACrB,QAAQ,QAAQ,iBAAiB,MAAM,KAAK;EAC9C,cAAc,OAAO,QAAQ,QAAQ,cAAc,EAAE;EACrD,aAAa,IAAI,aAAa,QAAQ,QAAQ,aAAa,IAAI,QAAQ;EACvE,SAAS,OAAO,QAAQ,QAAQ,SAAS,EAAE;EAC3C,iBAAiB,QAAQ,QAAQ,YAAY;EAC7C,eAAe,IAAI,SAAS,QAAQ,QAAQ,iBAAiB,IAAI,IAAI;EACrE,oBAAoB,QAAQ,QAAQ,iBAAiB;EACrD,aAAa,SAAS,QAAQ,QAAQ,aAAa,IAAI;CACzD,IACA,CAAC,CACH;;;;;;;;CASA,MAAM,eAAe,MAAM,WAAW,KAAA;;;;;;;;;;;;;CActC,MAAM,YAAY,cAAc;EAC9B,MAAM,sBAAM,IAAI,IAAY;EAC5B,IAAI,MAAM,WAAW,KAAA,GAAW,OAAO;EACvC,MAAM,UAAU,MAAM,KAAK,MACxB,QAAQ,IAAI,KAAK,OAAO,MAAM,MACjC,CAAC,EAAE;EACH,IAAI,CAAC,SAAS,OAAO;EACrB,MAAM,QAAQ,SAA4B;GACxC,IAAI,IAAI,KAAK,EAAE;GACf,KAAK,MAAM,SAAS,KAAK,YAAY,CAAC,GAAG,KAAK,KAAK;EACrD;EACA,KAAK,OAAO;EACZ,OAAO;CACT,GAAG,CAAC,MAAM,QAAQ,MAAM,IAAI,CAAC;CAE7B,OACE,oBAAC,OAAD;EAAK,MAAK;EAAO,cAAY,MAAM;EAAO,WAAW,MAAM;EACxD,UAAA,MAAM,KAAK,KAAK,QACf,oBAAC,aAAD;GAEE,MAAM,IAAI;GACV,OAAO,IAAI;GACH;GACR,aAAa,MAAM,UAAU,IAAI,IAAI,KAAK,EAAE;GAC5C,YAAY,MAAM,eAAe,IAAI,KAAK;GAC1C,YAAY,MAAM,eAAe,IAAI,KAAK;GAC1C,YAAY,MAAM,WAAW,IAAI,KAAK;GACtC,aAAa,MAAM,cAAc;GACnB;GACd,iBAAiB,UAAU,IAAI,IAAI,KAAK,EAAE;GAC1C,UACE,MAAM,MAAM,OAAO,IAAI,KAAK,KAAK,MAAM,KAAK,WAAW,KAAA;GAEzD,SAAS,MAAM,eAAe,KAAA;EAC/B,GAfM,IAAI,KAAK,EAef,CACF;CACE,CAAA;AAET"}
@@ -0,0 +1,79 @@
1
+ import type { TreeDropPosition } from "./tree-model.ts";
2
+ export interface UseTreeStateOptions {
3
+ /**
4
+ * Controlled collapse state. Omit for local state.
5
+ *
6
+ * ⚠️ A controlled PAIR rather than an atom, a store or anything this
7
+ * package would have to know about, and it is not a style choice.
8
+ *
9
+ * Collapse state can outlive the hook. A consumer whose layout renders two
10
+ * different component types in the same position by route tears the whole
11
+ * tree down and rebuilds it on navigation, and an `initializedRef` guard
12
+ * survives re-renders but not that: the one-time seed runs again and
13
+ * re-collapses everything the reader had opened. Holding the pair outside
14
+ * the hook is what makes the state survive, and a parent's `useState`, a
15
+ * URL, or an atom all satisfy it identically.
16
+ */
17
+ collapsed?: [ReadonlySet<string>, (next: ReadonlySet<string>) => void];
18
+ /**
19
+ * Seed for `renamingId`, read once at mount. For a consumer that creates a
20
+ * node and navigates in the same gesture, where the new row has to open
21
+ * straight into rename on the other side of the navigation.
22
+ */
23
+ initialRenamingId?: string;
24
+ onRename: (id: string, name: string) => void | Promise<void>;
25
+ /**
26
+ * A legal-looking drop landed. The consumer calls `resolveDrop` itself,
27
+ * because only it knows whether the resulting parent change is legal in
28
+ * its own domain, and what to write.
29
+ */
30
+ onMove: (dragId: string, targetId: string, position: TreeDropPosition) => void | Promise<void>;
31
+ }
32
+ export interface TreeStateCommands {
33
+ toggle: (id: string) => void;
34
+ /**
35
+ * Expand exactly this branch, never its ancestors. For the moment after
36
+ * creating a child inside it: the parent's own row could only have been
37
+ * acted on while visible, so its ancestors are already open and only the
38
+ * parent itself might be closed.
39
+ */
40
+ expandOne: (id?: string) => void;
41
+ beginRename: (id: string) => void;
42
+ cancelRename: () => void;
43
+ commitRename: (id: string, name: string) => void | Promise<void>;
44
+ onDragStart: (id: string) => void;
45
+ onDragOver: (id: string, position: TreeDropPosition) => void;
46
+ onDragEnd: () => void;
47
+ onDrop: (targetId: string) => void | Promise<void>;
48
+ }
49
+ export interface TreeState {
50
+ collapsed: ReadonlySet<string>;
51
+ renamingId?: string;
52
+ dragId?: string;
53
+ drop?: {
54
+ id: string;
55
+ position: TreeDropPosition;
56
+ };
57
+ /**
58
+ * ⚠️ Identity NEVER changes for the life of the hook. See the facade block
59
+ * at the bottom of this file.
60
+ */
61
+ commands: TreeStateCommands;
62
+ }
63
+ /**
64
+ * The state a `TreeView` needs and a consumer would otherwise write again:
65
+ * collapse, inline rename, the drag gesture and the drop guard.
66
+ *
67
+ * **Selection is deliberately not here.** No two consumers hold it the same
68
+ * way (one derives it from the URL, another from local state), so a hook that
69
+ * owned it would need a controlled/uncontrolled pair for a value it can never
70
+ * be the source of. `TreeView` takes `selectedId` and `onSelect` directly.
71
+ *
72
+ * Neither is anything that needs to know what an ancestor means in the
73
+ * consumer's URL space: auto-expanding the branches above the selected node,
74
+ * revealing a node by some other identifier, seeding the initial collapse set.
75
+ * Those stay with the consumer, and `expandOne` plus the controlled pair is
76
+ * everything they need from here.
77
+ */
78
+ export declare const useTreeState: (options: UseTreeStateOptions) => TreeState;
79
+ //# sourceMappingURL=use-tree-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-tree-state.d.ts","sourceRoot":"","sources":["../../../src/components/tree-view/use-tree-state.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC;IACvE;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D;;;;OAIG;IACH,MAAM,EAAE,CACN,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,gBAAgB,KACvB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B;;;;;OAKG;IACH,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7D,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,gBAAgB,CAAA;KAAE,CAAC;IAClD;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY,YAAa,mBAAmB,KAAG,SAmG3D,CAAC"}
@@ -0,0 +1,93 @@
1
+ import { useMemo, useRef, useState } from "react";
2
+ //#region src/components/tree-view/use-tree-state.ts
3
+ /**
4
+ * The state a `TreeView` needs and a consumer would otherwise write again:
5
+ * collapse, inline rename, the drag gesture and the drop guard.
6
+ *
7
+ * **Selection is deliberately not here.** No two consumers hold it the same
8
+ * way (one derives it from the URL, another from local state), so a hook that
9
+ * owned it would need a controlled/uncontrolled pair for a value it can never
10
+ * be the source of. `TreeView` takes `selectedId` and `onSelect` directly.
11
+ *
12
+ * Neither is anything that needs to know what an ancestor means in the
13
+ * consumer's URL space: auto-expanding the branches above the selected node,
14
+ * revealing a node by some other identifier, seeding the initial collapse set.
15
+ * Those stay with the consumer, and `expandOne` plus the controlled pair is
16
+ * everything they need from here.
17
+ */
18
+ const useTreeState = (options) => {
19
+ const [localCollapsed, setLocalCollapsed] = useState(() => /* @__PURE__ */ new Set());
20
+ const collapsed = options.collapsed?.[0] ?? localCollapsed;
21
+ const writeCollapsed = options.collapsed?.[1] ?? setLocalCollapsed;
22
+ const [renamingId, setRenamingId] = useState(() => options.initialRenamingId);
23
+ const [dragId, setDragId] = useState();
24
+ const [drop, setDrop] = useState();
25
+ const toggle = (id) => {
26
+ const next = new Set(collapsed);
27
+ if (!next.delete(id)) next.add(id);
28
+ writeCollapsed(next);
29
+ };
30
+ const expandOne = (id) => {
31
+ if (!id || !collapsed.has(id)) return;
32
+ const next = new Set(collapsed);
33
+ next.delete(id);
34
+ writeCollapsed(next);
35
+ };
36
+ const commitRename = async (id, name) => {
37
+ await options.onRename(id, name);
38
+ setRenamingId(void 0);
39
+ };
40
+ const onDrop = async (targetId) => {
41
+ const currentDragId = dragId;
42
+ const position = drop && drop.id === targetId ? drop.position : void 0;
43
+ setDragId(void 0);
44
+ setDrop(void 0);
45
+ if (!currentDragId || !position) return;
46
+ await options.onMove(currentDragId, targetId, position);
47
+ };
48
+ /**
49
+ * The current implementation of every command, rebuilt on each render
50
+ * because each one closes over this render's state. Assigned during render
51
+ * rather than in an effect: an effect would leave one render's worth of
52
+ * rows calling last render's callbacks.
53
+ */
54
+ const implRef = useRef(void 0);
55
+ implRef.current = {
56
+ toggle,
57
+ expandOne,
58
+ beginRename: (id) => setRenamingId(id),
59
+ cancelRename: () => setRenamingId(void 0),
60
+ commitRename,
61
+ onDragStart: (id) => setDragId(id),
62
+ onDragOver: (id, position) => setDrop({
63
+ id,
64
+ position
65
+ }),
66
+ onDragEnd: () => {
67
+ setDragId(void 0);
68
+ setDrop(void 0);
69
+ },
70
+ onDrop
71
+ };
72
+ return {
73
+ collapsed,
74
+ renamingId,
75
+ dragId,
76
+ drop,
77
+ commands: useMemo(() => ({
78
+ toggle: (id) => implRef.current.toggle(id),
79
+ expandOne: (id) => implRef.current.expandOne(id),
80
+ beginRename: (id) => implRef.current.beginRename(id),
81
+ cancelRename: () => implRef.current.cancelRename(),
82
+ commitRename: (id, name) => implRef.current.commitRename(id, name),
83
+ onDragStart: (id) => implRef.current.onDragStart(id),
84
+ onDragOver: (id, position) => implRef.current.onDragOver(id, position),
85
+ onDragEnd: () => implRef.current.onDragEnd(),
86
+ onDrop: (targetId) => implRef.current.onDrop(targetId)
87
+ }), [])
88
+ };
89
+ };
90
+ //#endregion
91
+ export { useTreeState };
92
+
93
+ //# sourceMappingURL=use-tree-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-tree-state.js","names":[],"sources":["../../../src/components/tree-view/use-tree-state.ts"],"sourcesContent":["import { useMemo, useRef, useState } from \"react\";\n\nimport type { TreeDropPosition } from \"./tree-model.ts\";\n\nexport interface UseTreeStateOptions {\n /**\n * Controlled collapse state. Omit for local state.\n *\n * ⚠️ A controlled PAIR rather than an atom, a store or anything this\n * package would have to know about, and it is not a style choice.\n *\n * Collapse state can outlive the hook. A consumer whose layout renders two\n * different component types in the same position by route tears the whole\n * tree down and rebuilds it on navigation, and an `initializedRef` guard\n * survives re-renders but not that: the one-time seed runs again and\n * re-collapses everything the reader had opened. Holding the pair outside\n * the hook is what makes the state survive, and a parent's `useState`, a\n * URL, or an atom all satisfy it identically.\n */\n collapsed?: [ReadonlySet<string>, (next: ReadonlySet<string>) => void];\n /**\n * Seed for `renamingId`, read once at mount. For a consumer that creates a\n * node and navigates in the same gesture, where the new row has to open\n * straight into rename on the other side of the navigation.\n */\n initialRenamingId?: string;\n onRename: (id: string, name: string) => void | Promise<void>;\n /**\n * A legal-looking drop landed. The consumer calls `resolveDrop` itself,\n * because only it knows whether the resulting parent change is legal in\n * its own domain, and what to write.\n */\n onMove: (\n dragId: string,\n targetId: string,\n position: TreeDropPosition,\n ) => void | Promise<void>;\n}\n\nexport interface TreeStateCommands {\n toggle: (id: string) => void;\n /**\n * Expand exactly this branch, never its ancestors. For the moment after\n * creating a child inside it: the parent's own row could only have been\n * acted on while visible, so its ancestors are already open and only the\n * parent itself might be closed.\n */\n expandOne: (id?: string) => void;\n beginRename: (id: string) => void;\n cancelRename: () => void;\n commitRename: (id: string, name: string) => void | Promise<void>;\n onDragStart: (id: string) => void;\n onDragOver: (id: string, position: TreeDropPosition) => void;\n onDragEnd: () => void;\n onDrop: (targetId: string) => void | Promise<void>;\n}\n\nexport interface TreeState {\n collapsed: ReadonlySet<string>;\n renamingId?: string;\n dragId?: string;\n drop?: { id: string; position: TreeDropPosition };\n /**\n * ⚠️ Identity NEVER changes for the life of the hook. See the facade block\n * at the bottom of this file.\n */\n commands: TreeStateCommands;\n}\n\n/**\n * The state a `TreeView` needs and a consumer would otherwise write again:\n * collapse, inline rename, the drag gesture and the drop guard.\n *\n * **Selection is deliberately not here.** No two consumers hold it the same\n * way (one derives it from the URL, another from local state), so a hook that\n * owned it would need a controlled/uncontrolled pair for a value it can never\n * be the source of. `TreeView` takes `selectedId` and `onSelect` directly.\n *\n * Neither is anything that needs to know what an ancestor means in the\n * consumer's URL space: auto-expanding the branches above the selected node,\n * revealing a node by some other identifier, seeding the initial collapse set.\n * Those stay with the consumer, and `expandOne` plus the controlled pair is\n * everything they need from here.\n */\nexport const useTreeState = (options: UseTreeStateOptions): TreeState => {\n const [localCollapsed, setLocalCollapsed] = useState<ReadonlySet<string>>(\n () => new Set(),\n );\n const collapsed = options.collapsed?.[0] ?? localCollapsed;\n const writeCollapsed = options.collapsed?.[1] ?? setLocalCollapsed;\n\n // Read once, at mount: a hand-off consumed on a later render would fire\n // against whatever row happened to exist then.\n const [renamingId, setRenamingId] = useState<string | undefined>(\n () => options.initialRenamingId,\n );\n const [dragId, setDragId] = useState<string | undefined>();\n const [drop, setDrop] = useState<\n { id: string; position: TreeDropPosition } | undefined\n >();\n\n const toggle = (id: string): void => {\n const next = new Set(collapsed);\n if (!next.delete(id)) next.add(id);\n writeCollapsed(next);\n };\n\n const expandOne = (id?: string): void => {\n if (!id || !collapsed.has(id)) return;\n const next = new Set(collapsed);\n next.delete(id);\n writeCollapsed(next);\n };\n\n const commitRename = async (id: string, name: string): Promise<void> => {\n await options.onRename(id, name);\n setRenamingId(undefined);\n };\n\n const onDrop = async (targetId: string): Promise<void> => {\n const currentDragId = dragId;\n // Trust `targetId` (the row whose own `onDrop` fired) paired with\n // `drop` ONLY when the two agree on which row that is. Guards against a\n // stale `drop` left by a row the pointer passed over earlier, if the\n // browser's dragover/drop ordering ever disagrees.\n const position = drop && drop.id === targetId ? drop.position : undefined;\n setDragId(undefined);\n setDrop(undefined);\n if (!currentDragId || !position) return;\n await options.onMove(currentDragId, targetId, position);\n };\n\n /**\n * The current implementation of every command, rebuilt on each render\n * because each one closes over this render's state. Assigned during render\n * rather than in an effect: an effect would leave one render's worth of\n * rows calling last render's callbacks.\n */\n const implRef = useRef<TreeStateCommands>(undefined as never);\n implRef.current = {\n toggle,\n expandOne,\n beginRename: (id) => setRenamingId(id),\n cancelRename: () => setRenamingId(undefined),\n commitRename,\n onDragStart: (id) => setDragId(id),\n onDragOver: (id, position) => setDrop({ id, position }),\n onDragEnd: () => {\n setDragId(undefined);\n setDrop(undefined);\n },\n onDrop,\n };\n\n /**\n * The same commands behind a facade whose identity NEVER changes.\n *\n * A facade rather than `useCallback` on each command, because most of them\n * legitimately change when the data changes and a consumer holding last\n * render's copy would act on a stale set. Reading through the ref means the\n * object can be held forever and still call the current implementation.\n *\n * ⚠️ Not a micro-optimisation. An effect depending on a rebuilt command\n * object re-runs, sets parent state, re-renders, rebuilds the object: a\n * live \"Maximum update depth exceeded\" that had to be worked around with a\n * ref until the stable facade removed the need.\n */\n const commands = useMemo<TreeStateCommands>(\n () => ({\n toggle: (id) => implRef.current.toggle(id),\n expandOne: (id) => implRef.current.expandOne(id),\n beginRename: (id) => implRef.current.beginRename(id),\n cancelRename: () => implRef.current.cancelRename(),\n commitRename: (id, name) => implRef.current.commitRename(id, name),\n onDragStart: (id) => implRef.current.onDragStart(id),\n onDragOver: (id, position) => implRef.current.onDragOver(id, position),\n onDragEnd: () => implRef.current.onDragEnd(),\n onDrop: (targetId) => implRef.current.onDrop(targetId),\n }),\n [],\n );\n\n return { collapsed, renamingId, dragId, drop, commands };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAoFA,MAAa,gBAAgB,YAA4C;CACvE,MAAM,CAAC,gBAAgB,qBAAqB,+BACpC,IAAI,IAAI,CAChB;CACA,MAAM,YAAY,QAAQ,YAAY,MAAM;CAC5C,MAAM,iBAAiB,QAAQ,YAAY,MAAM;CAIjD,MAAM,CAAC,YAAY,iBAAiB,eAC5B,QAAQ,iBAChB;CACA,MAAM,CAAC,QAAQ,aAAa,SAA6B;CACzD,MAAM,CAAC,MAAM,WAAW,SAEtB;CAEF,MAAM,UAAU,OAAqB;EACnC,MAAM,OAAO,IAAI,IAAI,SAAS;EAC9B,IAAI,CAAC,KAAK,OAAO,EAAE,GAAG,KAAK,IAAI,EAAE;EACjC,eAAe,IAAI;CACrB;CAEA,MAAM,aAAa,OAAsB;EACvC,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,GAAG;EAC/B,MAAM,OAAO,IAAI,IAAI,SAAS;EAC9B,KAAK,OAAO,EAAE;EACd,eAAe,IAAI;CACrB;CAEA,MAAM,eAAe,OAAO,IAAY,SAAgC;EACtE,MAAM,QAAQ,SAAS,IAAI,IAAI;EAC/B,cAAc,KAAA,CAAS;CACzB;CAEA,MAAM,SAAS,OAAO,aAAoC;EACxD,MAAM,gBAAgB;EAKtB,MAAM,WAAW,QAAQ,KAAK,OAAO,WAAW,KAAK,WAAW,KAAA;EAChE,UAAU,KAAA,CAAS;EACnB,QAAQ,KAAA,CAAS;EACjB,IAAI,CAAC,iBAAiB,CAAC,UAAU;EACjC,MAAM,QAAQ,OAAO,eAAe,UAAU,QAAQ;CACxD;;;;;;;CAQA,MAAM,UAAU,OAA0B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;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,+BAoBF;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAiFlE,QAAA,MAAM,cAAc;;;8EAmCnB,CAAC;AAEF,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,OAAe,EACf,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,GACtB,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,+BAoBF;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
@@ -4,7 +4,7 @@ import { Button as Button$1 } from "@base-ui/react/button";
4
4
  import { cva } from "class-variance-authority";
5
5
  import { Loader2Icon } from "lucide-react";
6
6
  //#region src/components/ui/button.tsx
7
- const buttonVariants = cva("group/button focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:ring-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
7
+ const buttonVariants = cva("group/button focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:ring-3 not-disabled:active:not-aria-[haspopup]:translate-y-px disabled:cursor-not-allowed disabled:opacity-50 aria-busy:cursor-progress aria-disabled:pointer-events-none aria-invalid:ring-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
8
8
  variants: {
9
9
  variant: {
10
10
  default: "bg-primary text-primary-foreground hover:bg-primary/80",
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","names":["ButtonPrimitive"],"sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import { cn } from \"@alepha/ui/lib/utils\";\nimport { Button as ButtonPrimitive } from \"@base-ui/react/button\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Loader2Icon } from \"lucide-react\";\n\nconst buttonVariants = cva(\n \"group/button focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:ring-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline:\n \"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground aria-expanded:bg-secondary aria-expanded:text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]\",\n ghost:\n \"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground\",\n destructive:\n \"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default:\n \"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n xs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: \"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n icon: \"size-8\",\n \"icon-xs\":\n \"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\":\n \"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg\",\n \"icon-lg\": \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n loading = false,\n disabled,\n children,\n ...props\n}: ButtonPrimitive.Props &\n VariantProps<typeof buttonVariants> & {\n /**\n * When true, hides the button's content (icon + label) and shows a single\n * centered spinner in its place, disables the button, and marks it\n * `aria-busy`. The hidden content stays in the layout, so the button keeps\n * its natural width and doesn't resize while busy. Use for form submits and\n * async actions so the click can't be double-fired.\n */\n loading?: boolean;\n }) {\n return (\n <ButtonPrimitive\n data-slot=\"button\"\n data-loading={loading || undefined}\n aria-busy={loading || undefined}\n disabled={disabled || loading}\n className={cn(buttonVariants({ variant, size, className }), {\n relative: loading,\n })}\n {...props}\n >\n {loading && (\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <Loader2Icon aria-hidden className=\"animate-spin\" />\n </span>\n )}\n <span className={cn(\"contents\", { invisible: loading })}>{children}</span>\n </ButtonPrimitive>\n );\n}\n\nexport { Button, buttonVariants };\n"],"mappings":";;;;;;AAKA,MAAM,iBAAiB,IACrB,8lBACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,SACE;GACF,WACE;GACF,OACE;GACF,aACE;GACF,MAAM;EACR;EACA,MAAM;GACJ,SACE;GACF,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,WACE;GACF,WACE;GACF,WAAW;EACb;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;AAEA,SAAS,OAAO,EACd,WACA,UAAU,WACV,OAAO,WACP,UAAU,OACV,UACA,UACA,GAAG,SAWA;CACH,OACE,qBAACA,UAAD;EACE,aAAU;EACV,gBAAc,WAAW,KAAA;EACzB,aAAW,WAAW,KAAA;EACtB,UAAU,YAAY;EACtB,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM;EAAU,CAAC,GAAG,EAC1D,UAAU,QACZ,CAAC;EACD,GAAI;EARN,UAAA,CAUG,WACC,oBAAC,QAAD;GAAM,WAAU;GACd,UAAA,oBAAC,aAAD;IAAa,eAAA;IAAY,WAAU;GAAgB,CAAA;EAC/C,CAAA,GAER,oBAAC,QAAD;GAAM,WAAW,GAAG,YAAY,EAAE,WAAW,QAAQ,CAAC;GAAI;EAAe,CAAA,CAC1D;;AAErB"}
1
+ {"version":3,"file":"button.js","names":["ButtonPrimitive"],"sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import { cn } from \"@alepha/ui/lib/utils\";\nimport { Button as ButtonPrimitive } from \"@base-ui/react/button\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Loader2Icon } from \"lucide-react\";\n\n/*\n * ⚠️ `disabled:cursor-not-allowed`, NOT `disabled:pointer-events-none`, which\n * is what this used to carry and why a disabled button showed a plain arrow:\n * an element with no pointer events is never a hit target, so it can have no\n * cursor of its own.\n *\n * Dropping it costs nothing. Base UI renders a NATIVE `disabled` attribute\n * here, and the browser suppresses click and mousedown on a disabled form\n * control by itself. Every other disabled control in the kit already relies on\n * exactly that - checkbox, switch, textarea, select, command, input-otp - so\n * the button was the outlier rather than the rule.\n *\n * `aria-disabled:pointer-events-none` covers the case the native attribute\n * cannot: a `nativeButton={false}` render, an anchor, where nothing stops a\n * click from navigating.\n *\n * The price is that a disabled button now takes its variant's hover fill under\n * the pointer, at `opacity-50`. That is deliberate, and it is what a disabled\n * `select-trigger` has always done. See the warning below for why the obvious\n * fix is worse than the wart.\n *\n * ⚠️ DO NOT guard the hover utilities with `not-disabled:`. It was tried, and\n * it broke the fill of every caller that overrides one - 94 call sites, of\n * which `useDialog`'s destructive confirm was the loudest: a red delete button\n * that turned near-white the moment you reached for it.\n *\n * The variant's classes and the caller's are reconciled by tailwind-merge,\n * which decides two classes are the same thing by utility group AND modifier\n * prefix. `hover:bg-primary/80` and a caller's `hover:bg-destructive/90` match,\n * so the caller's replaces it. Prefix the variant's with `not-disabled:` and\n * they no longer match, both survive into the class list, and the browser\n * breaks the tie on specificity - where `:not(:disabled):hover` outranks a\n * plain `:hover` and the variant wins a fight it is supposed to lose.\n *\n * So: adding a class here is safe. Adding a MODIFIER PREFIX to a class callers\n * override is not. `cursor-*` has no overrides anywhere in the kit, which is\n * what makes the two above safe. `hover:bg-*` is the most overridden class in\n * it.\n *\n * `not-disabled:` on the `active:` nudge is fine for the same reason: the\n * press-down has three call sites and none of them override it. A disabled\n * button that sinks under the pointer is the one part of this worth\n * suppressing, since it promises a click that will not happen.\n *\n * `aria-busy:cursor-progress` wins while `loading`, which sets both attributes:\n * busy and forbidden are different promises. The work is happening, and the\n * button will take clicks again when it finishes.\n *\n * ---\n *\n * ℹ️ A caller that overrides the font size DOES lose the line height with it,\n * and it does NOT move the label. Both halves were measured, because the first\n * one on its own reads like a bug and is the third-most-reported thing about\n * this file.\n *\n * `text-sm` is a PAIR in Tailwind v4: font size and the line height that goes\n * with it. tailwind-merge groups it with a caller's `text-[12.5px]` and keeps\n * only the caller's, so the pair's second half is dropped and the line height\n * becomes the 1.5 default - 18.75px rather than 20px. That much is real, and\n * `size=\"sm\"` does it too, since it is `text-[0.8rem]`, also arbitrary.\n *\n * It cannot decentre anything. Half-leading is symmetric: the inline box sits\n * in the middle of the line box whatever the line height, the line box is\n * centred by `items-center`, and the fixed `h-8` is unaffected either way.\n * Measured on the reported button (Chrome, macOS, the same `-apple-system`\n * stack production resolves), ink centre against button centre:\n *\n * text-sm 20px line box +0.404px\n * text-[12.5px] 18.75px line box -0.050px\n *\n * The override is marginally BETTER centred. What remains is the font's own\n * ascent/descent asymmetry, which is under half a pixel and is the same\n * effect at every size.\n *\n * So: do not add a `leading-*` here to \"fix\" it. It would change nothing\n * visible, at 94 call sites, on a base the notes above already record as the\n * risky place to edit. See #Q2157.\n */\nconst buttonVariants = cva(\n \"group/button focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:ring-3 not-disabled:active:not-aria-[haspopup]:translate-y-px disabled:cursor-not-allowed disabled:opacity-50 aria-busy:cursor-progress aria-disabled:pointer-events-none aria-invalid:ring-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline:\n \"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground aria-expanded:bg-secondary aria-expanded:text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]\",\n ghost:\n \"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground\",\n destructive:\n \"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default:\n \"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n xs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: \"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n icon: \"size-8\",\n \"icon-xs\":\n \"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\":\n \"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg\",\n \"icon-lg\": \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n loading = false,\n disabled,\n children,\n ...props\n}: ButtonPrimitive.Props &\n VariantProps<typeof buttonVariants> & {\n /**\n * When true, hides the button's content (icon + label) and shows a single\n * centered spinner in its place, disables the button, and marks it\n * `aria-busy`. The hidden content stays in the layout, so the button keeps\n * its natural width and doesn't resize while busy. Use for form submits and\n * async actions so the click can't be double-fired.\n */\n loading?: boolean;\n }) {\n return (\n <ButtonPrimitive\n data-slot=\"button\"\n data-loading={loading || undefined}\n aria-busy={loading || undefined}\n disabled={disabled || loading}\n className={cn(buttonVariants({ variant, size, className }), {\n relative: loading,\n })}\n {...props}\n >\n {loading && (\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <Loader2Icon aria-hidden className=\"animate-spin\" />\n </span>\n )}\n <span className={cn(\"contents\", { invisible: loading })}>{children}</span>\n </ButtonPrimitive>\n );\n}\n\nexport { Button, buttonVariants };\n"],"mappings":";;;;;;AAmFA,MAAM,iBAAiB,IACrB,sqBACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,SACE;GACF,WACE;GACF,OACE;GACF,aACE;GACF,MAAM;EACR;EACA,MAAM;GACJ,SACE;GACF,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,WACE;GACF,WACE;GACF,WAAW;EACb;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;AAEA,SAAS,OAAO,EACd,WACA,UAAU,WACV,OAAO,WACP,UAAU,OACV,UACA,UACA,GAAG,SAWA;CACH,OACE,qBAACA,UAAD;EACE,aAAU;EACV,gBAAc,WAAW,KAAA;EACzB,aAAW,WAAW,KAAA;EACtB,UAAU,YAAY;EACtB,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM;EAAU,CAAC,GAAG,EAC1D,UAAU,QACZ,CAAC;EACD,GAAI;EARN,UAAA,CAUG,WACC,oBAAC,QAAD;GAAM,WAAU;GACd,UAAA,oBAAC,aAAD;IAAa,eAAA;IAAY,WAAU;GAAgB,CAAA;EAC/C,CAAA,GAER,oBAAC,QAAD;GAAM,WAAW,GAAG,YAAY,EAAE,WAAW,QAAQ,CAAC;GAAI;EAAe,CAAA,CAC1D;;AAErB"}
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","names":["MenuPrimitive"],"sources":["../../../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@alepha/ui/lib/utils\";\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\";\nimport { CheckIcon, ChevronRightIcon } from \"lucide-react\";\nimport * as React from \"react\";\n\nfunction DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {\n return <MenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {\n return <MenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {\n return <MenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n align = \"start\",\n alignOffset = 0,\n side = \"bottom\",\n sideOffset = 4,\n className,\n ...props\n}: MenuPrimitive.Popup.Props &\n Pick<\n MenuPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\"\n >) {\n return (\n <MenuPrimitive.Portal>\n <MenuPrimitive.Positioner\n className=\"isolate z-50 outline-none\"\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n >\n <MenuPrimitive.Popup\n data-slot=\"dropdown-menu-content\"\n className={cn(\n // The `w-auto` sizing is local. Re-applied by `scripts/sync.mjs`,\n // which carries the reasoning; this file is overwritten wholesale.\n \"cn-menu-target cn-menu-translucent bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 max-h-(--available-height) w-auto max-w-(--available-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1 shadow-md ring-1 duration-100 outline-none data-closed:overflow-hidden\",\n className,\n )}\n {...props}\n />\n </MenuPrimitive.Positioner>\n </MenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {\n return <MenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: MenuPrimitive.GroupLabel.Props & {\n inset?: boolean;\n}) {\n return (\n <MenuPrimitive.GroupLabel\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:pl-7\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: MenuPrimitive.Item.Props & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <MenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"group/dropdown-menu-item focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:*:[svg]:text-destructive relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {\n return <MenuPrimitive.SubmenuRoot data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: MenuPrimitive.SubmenuTrigger.Props & {\n inset?: boolean;\n}) {\n return (\n <MenuPrimitive.SubmenuTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"cn-rtl-flip ml-auto\" />\n </MenuPrimitive.SubmenuTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n align = \"start\",\n alignOffset = -3,\n side = \"right\",\n sideOffset = 0,\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuContent>) {\n return (\n <DropdownMenuContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"cn-menu-target cn-menu-translucent bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 w-auto min-w-[96px] rounded-lg p-1 shadow-lg ring-1 duration-100\",\n className,\n )}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: MenuPrimitive.CheckboxItem.Props & {\n inset?: boolean;\n}) {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n data-slot=\"dropdown-menu-checkbox-item-indicator\"\n >\n <MenuPrimitive.CheckboxItemIndicator>\n <CheckIcon />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {\n return (\n <MenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n );\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n inset,\n ...props\n}: MenuPrimitive.RadioItem.Props & {\n inset?: boolean;\n}) {\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n data-slot=\"dropdown-menu-radio-item-indicator\"\n >\n <MenuPrimitive.RadioItemIndicator>\n <CheckIcon />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </MenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: MenuPrimitive.Separator.Props) {\n return (\n <MenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"mappings":";;;;;;;AAOA,SAAS,aAAa,EAAE,GAAG,SAAmC;CAC5D,OAAO,oBAACA,KAAc,MAAf;EAAoB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACnE;AAEA,SAAS,mBAAmB,EAAE,GAAG,SAAqC;CACpE,OAAO,oBAACA,KAAc,QAAf;EAAsB,aAAU;EAAuB,GAAI;CAAQ,CAAA;AAC5E;AAEA,SAAS,oBAAoB,EAAE,GAAG,SAAsC;CACtE,OAAO,oBAACA,KAAc,SAAf;EAAuB,aAAU;EAAwB,GAAI;CAAQ,CAAA;AAC9E;AAEA,SAAS,oBAAoB,EAC3B,QAAQ,SACR,cAAc,GACd,OAAO,UACP,aAAa,GACb,WACA,GAAG,SAKA;CACH,OACE,oBAACA,KAAc,QAAf,EAAA,UACE,oBAACA,KAAc,YAAf;EACE,WAAU;EACH;EACM;EACP;EACM;EAEZ,UAAA,oBAACA,KAAc,OAAf;GACE,aAAU;GACV,WAAW,GAGT,srBACA,SACF;GACA,GAAI;EACL,CAAA;CACuB,CAAA,EACN,CAAA;AAE1B;AAEA,SAAS,kBAAkB,EAAE,GAAG,SAAoC;CAClE,OAAO,oBAACA,KAAc,OAAf;EAAqB,aAAU;E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BAAuB,EAAE,GAAG,SAAyC;CAC5E,OACE,oBAACA,KAAc,YAAf;EACE,aAAU;EACV,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,sBAAsB,EAC7B,WACA,UACA,OACA,GAAG,SAGF;CACD,OACE,qBAACA,KAAc,WAAf;EACE,aAAU;EACV,cAAY;EACZ,WAAW,GACT,8VACA,SACF;EACA,GAAI;EAPN,UAAA,CASE,oBAAC,QAAD;GACE,WAAU;GACV,aAAU;GAEV,UAAA,oBAACA,KAAc,oBAAf,EAAA,UACE,oBAAC,WAAD,CAAY,CAAA,EACoB,CAAA;EAC9B,CAAA,GACL,QACsB;;AAE7B;AAEA,SAAS,sBAAsB,EAC7B,WACA,GAAG,SAC6B;CAChC,OACE,oBAACA,KAAc,WAAf;EACE,aAAU;EACV,WAAW,GAAG,6BAA6B,SAAS;EACpD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,qBAAqB,EAC5B,WACA,GAAG,SAC4B;CAC/B,OACE,oBAAC,QAAD;EACE,aAAU;EACV,WAAW,GACT,+GACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"dropdown-menu.js","names":["MenuPrimitive"],"sources":["../../../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@alepha/ui/lib/utils\";\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\";\nimport { CheckIcon, ChevronRightIcon } from \"lucide-react\";\nimport * as React from \"react\";\n\nfunction DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {\n return <MenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {\n return <MenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {\n return <MenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n align = \"start\",\n alignOffset = 0,\n side = \"bottom\",\n sideOffset = 4,\n className,\n ...props\n}: MenuPrimitive.Popup.Props &\n Pick<\n MenuPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\"\n >) {\n return (\n <MenuPrimitive.Portal>\n <MenuPrimitive.Positioner\n className=\"isolate z-50 outline-none\"\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n >\n <MenuPrimitive.Popup\n data-slot=\"dropdown-menu-content\"\n className={cn(\n // The `w-auto` sizing is local. Re-applied by `scripts/sync.ts`,\n // which carries the reasoning; this file is overwritten wholesale.\n \"cn-menu-target cn-menu-translucent bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 max-h-(--available-height) w-auto max-w-(--available-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1 shadow-md ring-1 duration-100 outline-none data-closed:overflow-hidden\",\n className,\n )}\n {...props}\n />\n </MenuPrimitive.Positioner>\n </MenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {\n return <MenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: MenuPrimitive.GroupLabel.Props & {\n inset?: boolean;\n}) {\n return (\n <MenuPrimitive.GroupLabel\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:pl-7\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: MenuPrimitive.Item.Props & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <MenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"group/dropdown-menu-item focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:*:[svg]:text-destructive relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {\n return <MenuPrimitive.SubmenuRoot data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: MenuPrimitive.SubmenuTrigger.Props & {\n inset?: boolean;\n}) {\n return (\n <MenuPrimitive.SubmenuTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"cn-rtl-flip ml-auto\" />\n </MenuPrimitive.SubmenuTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n align = \"start\",\n alignOffset = -3,\n side = \"right\",\n sideOffset = 0,\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuContent>) {\n return (\n <DropdownMenuContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"cn-menu-target cn-menu-translucent bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 w-auto min-w-[96px] rounded-lg p-1 shadow-lg ring-1 duration-100\",\n className,\n )}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: MenuPrimitive.CheckboxItem.Props & {\n inset?: boolean;\n}) {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n data-slot=\"dropdown-menu-checkbox-item-indicator\"\n >\n <MenuPrimitive.CheckboxItemIndicator>\n <CheckIcon />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {\n return (\n <MenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n );\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n inset,\n ...props\n}: MenuPrimitive.RadioItem.Props & {\n inset?: boolean;\n}) {\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n data-slot=\"dropdown-menu-radio-item-indicator\"\n >\n <MenuPrimitive.RadioItemIndicator>\n <CheckIcon />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </MenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: MenuPrimitive.Separator.Props) {\n return (\n <MenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"mappings":";;;;;;;AAOA,SAAS,aAAa,EAAE,GAAG,SAAmC;C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;CACL,CAAA;AAEL;AAEA,SAAS,qBAAqB,EAC5B,WACA,GAAG,SAC4B;CAC/B,OACE,oBAAC,QAAD;EACE,aAAU;EACV,WAAW,GACT,+GACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
@@ -1,5 +1,12 @@
1
1
  import { Select as SelectPrimitive } from "@base-ui/react/select";
2
2
  import * as React from "react";
3
+ /**
4
+ * @deprecated Reach for `Control` (or `ControlSelect`) instead. This is the
5
+ * raw Base UI primitive: it renders the raw VALUE on its trigger, carries no
6
+ * label, no description, no error slot and no form binding, and every surface
7
+ * that used it grew the same three workarounds by hand. It is kept only until
8
+ * the last call site is gone (feedback #P2121).
9
+ */
3
10
  declare const Select: typeof SelectPrimitive.Root;
4
11
  declare function SelectGroup({ className, ...props }: SelectPrimitive.Group.Props): React.JSX.Element;
5
12
  declare function SelectValue({ className, ...props }: SelectPrimitive.Value.Props): React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/ui/select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,QAAA,MAAM,MAAM,6BAAuB,CAAC;AAEpC,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAQxE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAQxE;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,IAAgB,EAChB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,GAAG;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACzB,qBAmBA;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,IAAe,EACf,UAAc,EACd,KAAgB,EAChB,WAAe,EACf,oBAA2B,EAC3B,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,GAC5B,IAAI,CACF,eAAe,CAAC,UAAU,CAAC,KAAK,EAChC,OAAO,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,sBAAsB,CACzE,qBA2BF;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,UAAU,CAAC,KAAK,qBAQlC;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,qBAsB5B;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,SAAS,CAAC,KAAK,qBAQjC;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,aAAa,CAAC,qBAa5D;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,eAAe,CAAC,qBAa9D;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAC"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/ui/select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;GAMG;AACH,QAAA,MAAM,MAAM,6BAAuB,CAAC;AAEpC,iBAAS,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AAC,eAAe,CAAC,qBAa9D;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAC"}
@@ -5,6 +5,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
6
6
  import { Select as Select$1 } from "@base-ui/react/select";
7
7
  //#region src/components/ui/select.tsx
8
+ /**
9
+ * @deprecated Reach for `Control` (or `ControlSelect`) instead. This is the
10
+ * raw Base UI primitive: it renders the raw VALUE on its trigger, carries no
11
+ * label, no description, no error slot and no form binding, and every surface
12
+ * that used it grew the same three workarounds by hand. It is kept only until
13
+ * the last call site is gone (feedback #P2121).
14
+ */
8
15
  const Select = Select$1.Root;
9
16
  function SelectGroup({ className, ...props }) {
10
17
  return /* @__PURE__ */ jsx(Select$1.Group, {
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","names":["SelectPrimitive"],"sources":["../../../src/components/ui/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@alepha/ui/lib/utils\";\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\";\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\";\nimport * as React from \"react\";\n\nconst Select = SelectPrimitive.Root;\n\nfunction SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {\n return (\n <SelectPrimitive.Group\n data-slot=\"select-group\"\n className={cn(\"scroll-my-1 p-1\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {\n return (\n <SelectPrimitive.Value\n data-slot=\"select-value\"\n className={cn(\"flex flex-1 text-left\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: SelectPrimitive.Trigger.Props & {\n size?: \"sm\" | \"default\";\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex w-fit items-center justify-between gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon\n render={\n <ChevronDownIcon className=\"text-muted-foreground pointer-events-none size-4\" />\n }\n />\n </SelectPrimitive.Trigger>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n alignItemWithTrigger = true,\n ...props\n}: SelectPrimitive.Popup.Props &\n Pick<\n SelectPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"alignItemWithTrigger\"\n >) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className=\"isolate z-50\"\n >\n <SelectPrimitive.Popup\n data-slot=\"select-content\"\n data-align-trigger={alignItemWithTrigger}\n className={cn(\n \"cn-menu-target cn-menu-translucent bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none\",\n className,\n )}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.List>{children}</SelectPrimitive.List>\n <SelectScrollDownButton />\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n );\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: SelectPrimitive.GroupLabel.Props) {\n return (\n <SelectPrimitive.GroupLabel\n data-slot=\"select-label\"\n className={cn(\"text-muted-foreground px-1.5 py-1 text-xs\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: SelectPrimitive.Item.Props) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n className,\n )}\n {...props}\n >\n <SelectPrimitive.ItemText className=\"flex flex-1 shrink-0 gap-2 whitespace-nowrap\">\n {children}\n </SelectPrimitive.ItemText>\n <SelectPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />\n }\n >\n <CheckIcon className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n );\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: SelectPrimitive.Separator.Props) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"bg-border pointer-events-none -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {\n return (\n <SelectPrimitive.ScrollUpArrow\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpArrow>\n );\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {\n return (\n <SelectPrimitive.ScrollDownArrow\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownArrow>\n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n"],"mappings":";;;;;;;AAOA,MAAM,SAASA,SAAgB;AAE/B,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,mBAAmB,SAAS;EAC1C,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,yBAAyB,SAAS;EAChD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cAAc,EACrB,WACA,OAAO,WACP,UACA,GA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AClC,OACE,oBAACA,SAAgB,WAAjB;EACE,aAAU;EACV,WAAW,GAAG,iDAAiD,SAAS;EACxE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,qBAAqB,EAC5B,WACA,GAAG,SAC0D;CAC7D,OACE,oBAACA,SAAgB,eAAjB;EACE,aAAU;EACV,WAAW,GACT,0HACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,eAAD,CAAgB,CAAA;CACa,CAAA;AAEnC;AAEA,SAAS,uBAAuB,EAC9B,WACA,GAAG,SAC4D;CAC/D,OACE,oBAACA,SAAgB,iBAAjB;EACE,aAAU;EACV,WAAW,GACT,6HACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,iBAAD,CAAkB,CAAA;CACa,CAAA;AAErC"}
1
+ {"version":3,"file":"select.js","names":["SelectPrimitive"],"sources":["../../../src/components/ui/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@alepha/ui/lib/utils\";\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\";\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\";\nimport * as React from \"react\";\n\n/**\n * @deprecated Reach for `Control` (or `ControlSelect`) instead. This is the\n * raw Base UI primitive: it renders the raw VALUE on its trigger, carries no\n * label, no description, no error slot and no form binding, and every surface\n * that used it grew the same three workarounds by hand. It is kept only until\n * the last call site is gone (feedback #P2121).\n */\nconst Select = SelectPrimitive.Root;\n\nfunction SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {\n return (\n <SelectPrimitive.Group\n data-slot=\"select-group\"\n className={cn(\"scroll-my-1 p-1\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {\n return (\n <SelectPrimitive.Value\n data-slot=\"select-value\"\n className={cn(\"flex flex-1 text-left\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: SelectPrimitive.Trigger.Props & {\n size?: \"sm\" | \"default\";\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex w-fit items-center justify-between gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon\n render={\n <ChevronDownIcon className=\"text-muted-foreground pointer-events-none size-4\" />\n }\n />\n </SelectPrimitive.Trigger>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n alignItemWithTrigger = true,\n ...props\n}: SelectPrimitive.Popup.Props &\n Pick<\n SelectPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"alignItemWithTrigger\"\n >) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className=\"isolate z-50\"\n >\n <SelectPrimitive.Popup\n data-slot=\"select-content\"\n data-align-trigger={alignItemWithTrigger}\n className={cn(\n \"cn-menu-target cn-menu-translucent bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none\",\n className,\n )}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.List>{children}</SelectPrimitive.List>\n <SelectScrollDownButton />\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n );\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: SelectPrimitive.GroupLabel.Props) {\n return (\n <SelectPrimitive.GroupLabel\n data-slot=\"select-label\"\n className={cn(\"text-muted-foreground px-1.5 py-1 text-xs\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: SelectPrimitive.Item.Props) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n className,\n )}\n {...props}\n >\n <SelectPrimitive.ItemText className=\"flex flex-1 shrink-0 gap-2 whitespace-nowrap\">\n {children}\n </SelectPrimitive.ItemText>\n <SelectPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />\n }\n >\n <CheckIcon className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n );\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: SelectPrimitive.Separator.Props) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"bg-border pointer-events-none -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {\n return (\n <SelectPrimitive.ScrollUpArrow\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpArrow>\n );\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {\n return (\n <SelectPrimitive.ScrollDownArrow\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownArrow>\n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,SAASA,SAAgB;AAE/B,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,mBAAmB,SAAS;EAC1C,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,yBAAyB,SAAS;EAChD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,c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gBAAgB,EACvB,WACA,GAAG,SAC+B;CAClC,OACE,oBAACA,SAAgB,WAAjB;EACE,aAAU;EACV,WAAW,GAAG,iDAAiD,SAAS;EACxE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,qBAAqB,EAC5B,WACA,GAAG,SAC0D;CAC7D,OACE,oBAACA,SAAgB,eAAjB;EACE,aAAU;EACV,WAAW,GACT,0HACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,eAAD,CAAgB,CAAA;CACa,CAAA;AAEnC;AAEA,SAAS,uBAAuB,EAC9B,WACA,GAAG,SAC4D;CAC/D,OACE,oBAACA,SAAgB,iBAAjB;EACE,aAAU;EACV,WAAW,GACT,6HACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,iBAAD,CAAkB,CAAA;CACa,CAAA;AAErC"}
@@ -15,7 +15,7 @@ import { mergeProps } from "@base-ui/react/merge-props";
15
15
  import { useRender } from "@base-ui/react/use-render";
16
16
  //#region src/components/ui/sidebar.tsx
17
17
  const SIDEBAR_COOKIE_NAME = "sidebar_state";
18
- const SIDEBAR_COOKIE_MAX_AGE = 3600 * 24 * 7;
18
+ const SIDEBAR_COOKIE_MAX_AGE = 604800;
19
19
  const SIDEBAR_WIDTH = "16rem";
20
20
  const SIDEBAR_WIDTH_MOBILE = "18rem";
21
21
  const SIDEBAR_WIDTH_ICON = "3rem";