@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
@@ -1 +1 @@
1
- {"version":3,"file":"control-date.js","names":["CalendarIcon","ChevronDownIcon","Calendar"],"sources":["../../../src/components/control-date/control-date.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { FormField } from \"@alepha/ui/components/control-base/form-field\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport { Calendar } from \"@alepha/ui/components/ui/calendar\";\nimport { Input } from \"@alepha/ui/components/ui/input\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@alepha/ui/components/ui/popover\";\nimport { cn } from \"@alepha/ui/lib/utils\";\nimport {\n type BaseInputField,\n parseField,\n useFieldValue,\n useFormState,\n} from \"alepha/react/form\";\nimport {\n Calendar as CalendarIcon,\n ChevronDown as ChevronDownIcon,\n Clock,\n X,\n} from \"lucide-react\";\nimport { useState } from \"react\";\n\nexport interface ControlDateProps {\n /**\n * Bound `InputField` from `useForm`. Stores an ISO string.\n */\n input: BaseInputField;\n /**\n * Field label. Falls back to schema `title`.\n */\n label?: string;\n /**\n * Helper text shown below the picker.\n */\n description?: string;\n /**\n * Force date-only mode regardless of schema format.\n */\n date?: boolean;\n /**\n * Force date-time mode regardless of schema format.\n */\n datetime?: boolean;\n /**\n * Force time-only mode regardless of schema format.\n */\n time?: boolean;\n /**\n * Disable the picker.\n */\n disabled?: boolean;\n /**\n * Offer a way back to empty once a date is picked.\n *\n * A calendar has no \"none\" cell, so without this an optional date field is\n * one-way: pick a day and there is no gesture that unsets it. Every other\n * control in the kit spells this `clearable`, so this one does too.\n */\n clearable?: boolean;\n}\n\nexport const ControlDate = (props: ControlDateProps) => {\n const form = useFormState(props.input, [\"error\"]);\n const [value, setValue] = useFieldValue(props.input);\n\n if (!props.input?.props) return null;\n\n const meta = parseField(props.input, {\n label: props.label,\n description: props.description,\n error: form.error,\n });\n\n const isDateTime = props.datetime || meta.format === \"date-time\";\n const isTime = props.time || meta.format === \"time\";\n\n if (isTime) {\n return (\n <FormField\n id={meta.id}\n label={meta.label}\n description={meta.description}\n error={meta.error}\n required={meta.required}\n >\n <div className=\"relative\">\n <Clock className=\"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2\" />\n <Input\n id={meta.id}\n name={props.input.props.name}\n type=\"time\"\n className=\"pl-9\"\n disabled={props.disabled}\n value={value ?? \"\"}\n onChange={(e) => setValue(e.target.value)}\n />\n </div>\n </FormField>\n );\n }\n\n return (\n <FormField\n id={meta.id}\n label={meta.label}\n description={meta.description}\n error={meta.error}\n required={meta.required}\n >\n <DatePopover\n id={meta.id}\n value={value}\n withTime={isDateTime}\n disabled={props.disabled}\n clearable={props.clearable}\n onChange={(v) => setValue(v)}\n />\n </FormField>\n );\n};\n\ninterface DatePopoverProps {\n id?: string;\n value?: string;\n withTime: boolean;\n disabled?: boolean;\n clearable?: boolean;\n onChange: (value: string | undefined) => void;\n}\n\n/**\n * A date-only value (`YYYY-MM-DD`) names a calendar day, so it is parsed\n * and formatted in local parts: `new Date(\"2026-08-23\")` is UTC midnight,\n * which displays as the 22nd west of Greenwich, and `toISOString()` on a\n * local midnight stores the previous day east of it.\n */\nconst parseDateOnly = (value: string): Date => {\n const [year, month, day] = value.split(\"-\").map(Number);\n return new Date(year, month - 1, day);\n};\n\nconst formatDateOnly = (date: Date): string => {\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${date.getFullYear()}-${month}-${day}`;\n};\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nconst DatePopover = (props: DatePopoverProps) => {\n const [open, setOpen] = useState(false);\n const date = props.value\n ? !props.withTime && DATE_ONLY.test(props.value)\n ? parseDateOnly(props.value)\n : new Date(props.value)\n : undefined;\n\n const formatted = date\n ? props.withTime\n ? date.toLocaleString()\n : date.toLocaleDateString()\n : \"\";\n\n const handleDate = (d: Date | undefined) => {\n if (!d) {\n props.onChange(undefined);\n return;\n }\n if (props.withTime) {\n props.onChange(d.toISOString());\n } else {\n props.onChange(formatDateOnly(d));\n setOpen(false);\n }\n };\n\n const handleTime = (timeStr: string) => {\n if (!date) return;\n const [h, m] = timeStr.split(\":\").map(Number);\n const next = new Date(date);\n next.setHours(h ?? 0, m ?? 0, 0, 0);\n props.onChange(next.toISOString());\n };\n\n const timeValue =\n date && props.withTime\n ? `${String(date.getHours()).padStart(2, \"0\")}:${String(date.getMinutes()).padStart(2, \"0\")}`\n : \"\";\n\n const showClear = props.clearable && !!date && !props.disabled;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n {/* The clear button sits BESIDE the trigger, not inside it: a button\n nested in a button is invalid, and Base UI's popover trigger would\n swallow its click anyway. */}\n <div className=\"flex w-full items-center gap-1\">\n <PopoverTrigger\n render={\n <Button\n id={props.id}\n variant=\"outline\"\n disabled={props.disabled}\n className={cn(\n \"flex-1 justify-start text-left font-normal\",\n !date && \"text-muted-foreground\",\n )}\n />\n }\n >\n <CalendarIcon className=\"mr-2 size-4\" />\n {formatted || \"Pick a date\"}\n {/* Same trailing caret a select trigger carries, for the same\n reason: this opens a popover, and without it the control reads\n as a text field that happens to have a calendar glyph. `ml-auto`\n rather than `justify-between` so the calendar icon and the text\n stay together on the left. */}\n <ChevronDownIcon className=\"text-muted-foreground pointer-events-none ml-auto size-4 shrink-0\" />\n </PopoverTrigger>\n {showClear && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n aria-label=\"Clear date\"\n onClick={() => props.onChange(undefined)}\n >\n <X className=\"size-4\" />\n </Button>\n )}\n </div>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar mode=\"single\" selected={date} onSelect={handleDate} />\n {props.withTime && (\n <div className=\"border-t p-3\">\n <Input\n type=\"time\"\n value={timeValue}\n onChange={(e) => handleTime(e.target.value)}\n />\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n};\n"],"mappings":";;;;;;;;;;;AAmEA,MAAa,eAAe,UAA4B;CACtD,MAAM,OAAO,aAAa,MAAM,OAAO,CAAC,OAAO,CAAC;CAChD,MAAM,CAAC,OAAO,YAAY,cAAc,MAAM,KAAK;CAEnD,IAAI,CAAC,MAAM,OAAO,OAAO,OAAO;CAEhC,MAAM,OAAO,WAAW,MAAM,OAAO;EACnC,OAAO,MAAM;EACb,aAAa,MAAM;EACnB,OAAO,KAAK;CACd,CAAC;CAED,MAAM,aAAa,MAAM,YAAY,KAAK,WAAW;CAGrD,IAFe,MAAM,QAAQ,KAAK,WAAW,QAG3C,OACE,oBAAC,WAAD;EACE,IAAI,KAAK;EACT,OAAO,KAAK;EACZ,aAAa,KAAK;EAClB,OAAO,KAAK;EACZ,UAAU,KAAK;EAEf,UAAA,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA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EACL,CAAA,GAAA,qBAAC,gBAAD;GAAgB,WAAU;GAAa,OAAM;GAA7C,UAAA,CACE,oBAACC,YAAD;IAAU,MAAK;IAAS,UAAU;IAAM,UAAU;GAAa,CAAA,GAC9D,MAAM,YACL,oBAAC,OAAD;IAAK,WAAU;IACb,UAAA,oBAAC,OAAD;KACE,MAAK;KACL,OAAO;KACP,WAAW,MAAM,WAAW,EAAE,OAAO,KAAK;IAC3C,CAAA;GACE,CAAA,CAEO;EACT,CAAA,CAAA;;AAEb"}
1
+ {"version":3,"file":"control-date.js","names":["CalendarIcon","ChevronDownIcon","Calendar"],"sources":["../../../src/components/control-date/control-date.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { FormField } from \"@alepha/ui/components/control-base/form-field\";\nimport {\n DATE_ONLY,\n formatDateOnly,\n parseDateOnly,\n} from \"@alepha/ui/components/control-date/date-only.ts\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport { Calendar } from \"@alepha/ui/components/ui/calendar\";\nimport { Input } from \"@alepha/ui/components/ui/input\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@alepha/ui/components/ui/popover\";\nimport { cn } from \"@alepha/ui/lib/utils\";\nimport {\n type BaseInputField,\n parseField,\n useFieldValue,\n useFormState,\n} from \"alepha/react/form\";\nimport {\n Calendar as CalendarIcon,\n ChevronDown as ChevronDownIcon,\n Clock,\n X,\n} from \"lucide-react\";\nimport { useState } from \"react\";\nimport type { DayPickerProps } from \"react-day-picker\";\n\n/** How many years back a `birthdate` picker offers. Covers every living\n * person; the oldest verified human reached 122. */\nconst BIRTHDATE_YEARS = 120;\n\nexport interface ControlDateProps {\n /**\n * Bound `InputField` from `useForm`. Stores an ISO string.\n */\n input: BaseInputField;\n /**\n * Field label. Falls back to schema `title`.\n */\n label?: string;\n /**\n * Helper text shown below the picker.\n */\n description?: string;\n /**\n * Force date-only mode regardless of schema format.\n */\n date?: boolean;\n /**\n * Force date-time mode regardless of schema format.\n */\n datetime?: boolean;\n /**\n * Force time-only mode regardless of schema format.\n */\n time?: boolean;\n /**\n * Disable the picker.\n */\n disabled?: boolean;\n /**\n * Offer a way back to empty once a date is picked.\n *\n * A calendar has no \"none\" cell, so without this an optional date field is\n * one-way: pick a day and there is no gesture that unsets it. Every other\n * control in the kit spells this `clearable`, so this one does too.\n */\n clearable?: boolean;\n /**\n * Caption style. `\"label\"` (the default) shows the month name with\n * previous/next arrows; `\"dropdown\"` swaps both for month and year selects.\n *\n * Arrows are fine for a date near today and hopeless for one that is not:\n * reaching a 1988 birthday costs about 450 clicks on `<`. Pair `\"dropdown\"`\n * with {@link startMonth} / {@link endMonth}, or use {@link birthdate},\n * which sets both.\n */\n captionLayout?: DayPickerProps[\"captionLayout\"];\n /**\n * First selectable month. Also bounds the year dropdown, which otherwise\n * offers a narrow range around today.\n */\n startMonth?: Date;\n /** Last selectable month. */\n endMonth?: Date;\n /**\n * Shorthand for a date of birth: a year dropdown covering the last\n * {@link BIRTHDATE_YEARS} years, ending this year.\n *\n * Sugar over `captionLayout` + `startMonth` / `endMonth`, which stay\n * available for any other historical field. An explicit value for one of\n * those wins over what this sets.\n */\n birthdate?: boolean;\n}\n\nexport const ControlDate = (props: ControlDateProps) => {\n const form = useFormState(props.input, [\"error\"]);\n const [value, setValue] = useFieldValue(props.input);\n\n if (!props.input?.props) return null;\n\n const meta = parseField(props.input, {\n label: props.label,\n description: props.description,\n error: form.error,\n });\n\n const isDateTime = props.datetime || meta.format === \"date-time\";\n const isTime = props.time || meta.format === \"time\";\n\n if (isTime) {\n return (\n <FormField\n id={meta.id}\n label={meta.label}\n description={meta.description}\n error={meta.error}\n required={meta.required}\n >\n <div className=\"relative\">\n <Clock className=\"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2\" />\n <Input\n id={meta.id}\n name={props.input.props.name}\n type=\"time\"\n className=\"pl-9\"\n disabled={props.disabled}\n value={value ?? \"\"}\n onChange={(e) => setValue(e.target.value)}\n />\n </div>\n </FormField>\n );\n }\n\n const thisYear = new Date().getFullYear();\n\n return (\n <FormField\n id={meta.id}\n label={meta.label}\n description={meta.description}\n error={meta.error}\n required={meta.required}\n >\n <DatePopover\n id={meta.id}\n value={value}\n withTime={isDateTime}\n disabled={props.disabled}\n clearable={props.clearable}\n captionLayout={\n props.captionLayout ?? (props.birthdate ? \"dropdown\" : undefined)\n }\n startMonth={\n props.startMonth ??\n (props.birthdate\n ? new Date(thisYear - BIRTHDATE_YEARS, 0, 1)\n : undefined)\n }\n endMonth={\n props.endMonth ??\n (props.birthdate ? new Date(thisYear, 11, 31) : undefined)\n }\n onChange={(v) => setValue(v)}\n />\n </FormField>\n );\n};\n\ninterface DatePopoverProps {\n id?: string;\n value?: string;\n withTime: boolean;\n disabled?: boolean;\n clearable?: boolean;\n captionLayout?: DayPickerProps[\"captionLayout\"];\n startMonth?: Date;\n endMonth?: Date;\n onChange: (value: string | undefined) => void;\n}\n\nconst DatePopover = (props: DatePopoverProps) => {\n const [open, setOpen] = useState(false);\n const date = props.value\n ? !props.withTime && DATE_ONLY.test(props.value)\n ? parseDateOnly(props.value)\n : new Date(props.value)\n : undefined;\n\n const formatted = date\n ? props.withTime\n ? date.toLocaleString()\n : date.toLocaleDateString()\n : \"\";\n\n const handleDate = (d: Date | undefined) => {\n if (!d) {\n props.onChange(undefined);\n return;\n }\n if (props.withTime) {\n props.onChange(d.toISOString());\n } else {\n props.onChange(formatDateOnly(d));\n setOpen(false);\n }\n };\n\n const handleTime = (timeStr: string) => {\n if (!date) return;\n const [h, m] = timeStr.split(\":\").map(Number);\n const next = new Date(date);\n next.setHours(h ?? 0, m ?? 0, 0, 0);\n props.onChange(next.toISOString());\n };\n\n const timeValue =\n date && props.withTime\n ? `${String(date.getHours()).padStart(2, \"0\")}:${String(date.getMinutes()).padStart(2, \"0\")}`\n : \"\";\n\n const showClear = props.clearable && !!date && !props.disabled;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n {/* The clear button sits BESIDE the trigger, not inside it: a button\n nested in a button is invalid, and Base UI's popover trigger would\n swallow its click anyway. */}\n <div className=\"flex w-full items-center gap-1\">\n <PopoverTrigger\n render={\n <Button\n id={props.id}\n // A FIELD trigger, not a button, and the distinction is load\n // bearing: `styles.css` gives the `--input-hover` border to a\n // list of `data-slot`s, and this one was not on it, so the date\n // control was the only field in the kit that did not darken its\n // border under the pointer. Overriding Base UI's own\n // `data-slot=\"button\"` is safe - nothing selects on it.\n data-slot=\"date-trigger\"\n variant=\"outline\"\n disabled={props.disabled}\n className={cn(\n \"flex-1 justify-start text-left font-normal\",\n // ⚠️ **`border-input`, overriding the outline variant's\n // `border-border`.** Both tokens hold the same value today,\n // so this changes nothing on screen - and that is exactly why\n // it is written down. Rendering as a Button means inheriting\n // `buttonVariants.outline`, which reaches for `--border`;\n // right for a BUTTON, whose edge is decoration beside a fill\n // and a label, and wrong for a FIELD, whose edge is the only\n // thing saying where it is.\n //\n // The alias is what makes the mistake invisible. It was split\n // once (#Q2149) and this control was immediately the only one\n // of the six field slots on the wrong side of it, while\n // `input`, `textarea`, `select-trigger`, `input-group` and\n // `combobox-trigger` all followed `--input` on their own.\n // Same reason the comment above claims\n // `data-slot=\"date-trigger\"` rather than leaving it a button.\n \"border-input\",\n // Undo the outline variant's hover fill AND its open-state\n // fill. A select trigger shades for neither: the border is the\n // affordance in both cases, and a field that greys out while\n // its own popover is open reads as disabled at the moment it\n // is most active. Neither `select-trigger` nor\n // `combobox-trigger` carries an `aria-expanded:bg-*` rule at\n // all, which is the behaviour being matched.\n //\n // ⚠️ Each modifier has to match the variant's own EXACTLY -\n // `hover:` and `aria-expanded:` - or tailwind-merge keeps both\n // rules and the winner is down to specificity, which the\n // longer modifier chain wins.\n \"hover:bg-background aria-expanded:bg-background\",\n // Same reasoning for the placeholder: a select leaves it muted\n // under the pointer. With a value the text is already\n // `foreground`, so this only matters while empty.\n !date &&\n \"text-muted-foreground hover:text-muted-foreground aria-expanded:text-muted-foreground\",\n )}\n />\n }\n >\n {/*\n Muted whatever the field holds, matching `InputGroupAddon`, which\n paints every other leading icon in the kit `text-muted-foreground`\n on the container.\n\n Without the class this icon simply inherits the trigger's `color`,\n which the control swaps between muted and foreground to grey the\n PLACEHOLDER - so the icon brightened when a date was picked. That\n looked deliberate and was not: an icon says what kind of field this\n is, which does not change when you fill it, and the text beside it\n already carries filled-versus-empty.\n */}\n <CalendarIcon className=\"text-muted-foreground mr-2 size-4\" />\n {formatted || \"Pick a date\"}\n {/* Same trailing caret a select trigger carries, for the same\n reason: this opens a popover, and without it the control reads\n as a text field that happens to have a calendar glyph. `ml-auto`\n rather than `justify-between` so the calendar icon and the text\n stay together on the left. */}\n <ChevronDownIcon className=\"text-muted-foreground pointer-events-none ml-auto size-4 shrink-0\" />\n </PopoverTrigger>\n {showClear && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n aria-label=\"Clear date\"\n onClick={() => props.onChange(undefined)}\n >\n <X className=\"size-4\" />\n </Button>\n )}\n </div>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar\n mode=\"single\"\n selected={date}\n onSelect={handleDate}\n captionLayout={props.captionLayout}\n startMonth={props.startMonth}\n endMonth={props.endMonth}\n />\n {props.withTime && (\n <div className=\"border-t p-3\">\n <Input\n type=\"time\"\n value={timeValue}\n onChange={(e) => handleTime(e.target.value)}\n />\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAoCA,MAAM,kBAAkB;AAmExB,MAAa,eAAe,UAA4B;CACtD,MAAM,OAAO,aAAa,MAAM,OAAO,CAAC,OAAO,CAAC;CAChD,MAAM,CAAC,OAAO,YAAY,cAAc,MAAM,KAAK;CAEnD,IAAI,CAAC,MAAM,OAAO,OAAO,OAAO;CAEhC,MAAM,OAAO,WAAW,MAAM,OAAO;EACnC,OAAO,MAAM;EACb,aAAa,MAAM;EACnB,OAAO,KAAK;CACd,CAAC;CAED,MAAM,aAAa,MAAM,YAAY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AAS;IAEvC,UAAA,oBAAC,GAAD,EAAG,WAAU,SAAU,CAAA;GACjB,CAAA,CAEP;EACL,CAAA,GAAA,qBAAC,gBAAD;GAAgB,WAAU;GAAa,OAAM;GAA7C,UAAA,CACE,oBAACC,YAAD;IACE,MAAK;IACL,UAAU;IACV,UAAU;IACV,eAAe,MAAM;IACrB,YAAY,MAAM;IAClB,UAAU,MAAM;GACjB,CAAA,GACA,MAAM,YACL,oBAAC,OAAD;IAAK,WAAU;IACb,UAAA,oBAAC,OAAD;KACE,MAAK;KACL,OAAO;KACP,WAAW,MAAM,WAAW,EAAE,OAAO,KAAK;IAC3C,CAAA;GACE,CAAA,CAEO;EACT,CAAA,CAAA;;AAEb"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * A date-only value (`YYYY-MM-DD`) names a calendar DAY, not an instant, so
3
+ * it is parsed and formatted in local parts.
4
+ *
5
+ * ⚠️ This is not a stylistic preference. `new Date("2026-08-23")` is UTC
6
+ * midnight, which displays as the 22nd west of Greenwich, and
7
+ * `toISOString()` on a local midnight stores the previous day east of it. A
8
+ * control that mixes the two shifts every value it renders by a day for half
9
+ * the world.
10
+ *
11
+ * Extracted so `ControlDate` and `ControlDateRange` share one answer: two
12
+ * copies of this reasoning is two chances to get the timezone wrong, and the
13
+ * one that drifts is the one nobody is looking at.
14
+ */
15
+ export declare const parseDateOnly: (value: string) => Date;
16
+ export declare const formatDateOnly: (date: Date) => string;
17
+ export declare const DATE_ONLY: RegExp;
18
+ //# sourceMappingURL=date-only.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-only.d.ts","sourceRoot":"","sources":["../../../src/components/control-date/date-only.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,UAAW,MAAM,KAAG,IAG7C,CAAC;AAEF,eAAO,MAAM,cAAc,SAAU,IAAI,KAAG,MAI3C,CAAC;AAEF,eAAO,MAAM,SAAS,QAAwB,CAAC"}
@@ -0,0 +1,29 @@
1
+ //#region src/components/control-date/date-only.ts
2
+ /**
3
+ * A date-only value (`YYYY-MM-DD`) names a calendar DAY, not an instant, so
4
+ * it is parsed and formatted in local parts.
5
+ *
6
+ * ⚠️ This is not a stylistic preference. `new Date("2026-08-23")` is UTC
7
+ * midnight, which displays as the 22nd west of Greenwich, and
8
+ * `toISOString()` on a local midnight stores the previous day east of it. A
9
+ * control that mixes the two shifts every value it renders by a day for half
10
+ * the world.
11
+ *
12
+ * Extracted so `ControlDate` and `ControlDateRange` share one answer: two
13
+ * copies of this reasoning is two chances to get the timezone wrong, and the
14
+ * one that drifts is the one nobody is looking at.
15
+ */
16
+ const parseDateOnly = (value) => {
17
+ const [year, month, day] = value.split("-").map(Number);
18
+ return new Date(year, month - 1, day);
19
+ };
20
+ const formatDateOnly = (date) => {
21
+ const month = String(date.getMonth() + 1).padStart(2, "0");
22
+ const day = String(date.getDate()).padStart(2, "0");
23
+ return `${date.getFullYear()}-${month}-${day}`;
24
+ };
25
+ const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
26
+ //#endregion
27
+ export { DATE_ONLY, formatDateOnly, parseDateOnly };
28
+
29
+ //# sourceMappingURL=date-only.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-only.js","names":[],"sources":["../../../src/components/control-date/date-only.ts"],"sourcesContent":["/**\n * A date-only value (`YYYY-MM-DD`) names a calendar DAY, not an instant, so\n * it is parsed and formatted in local parts.\n *\n * ⚠️ This is not a stylistic preference. `new Date(\"2026-08-23\")` is UTC\n * midnight, which displays as the 22nd west of Greenwich, and\n * `toISOString()` on a local midnight stores the previous day east of it. A\n * control that mixes the two shifts every value it renders by a day for half\n * the world.\n *\n * Extracted so `ControlDate` and `ControlDateRange` share one answer: two\n * copies of this reasoning is two chances to get the timezone wrong, and the\n * one that drifts is the one nobody is looking at.\n */\nexport const parseDateOnly = (value: string): Date => {\n const [year, month, day] = value.split(\"-\").map(Number);\n return new Date(year, month - 1, day);\n};\n\nexport const formatDateOnly = (date: Date): string => {\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${date.getFullYear()}-${month}-${day}`;\n};\n\nexport const DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,iBAAiB,UAAwB;CACpD,MAAM,CAAC,MAAM,OAAO,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM;CACtD,OAAO,IAAI,KAAK,MAAM,QAAQ,GAAG,GAAG;AACtC;AAEA,MAAa,kBAAkB,SAAuB;CACpD,MAAM,QAAQ,OAAO,KAAK,SAAS,IAAI,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG;CACzD,MAAM,MAAM,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG;CAClD,OAAO,GAAG,KAAK,YAAY,EAAE,GAAG,MAAM,GAAG;AAC3C;AAEA,MAAa,YAAY"}
@@ -0,0 +1,56 @@
1
+ import * as React from "react";
2
+ import { type BaseInputField } from "alepha/react/form";
3
+ export interface ControlDateRangeProps {
4
+ /**
5
+ * Bound `InputField` from `useForm`. Stores `[start, end]`, two date-only
6
+ * strings, or nothing at all.
7
+ */
8
+ input: BaseInputField;
9
+ label?: string;
10
+ description?: string;
11
+ disabled?: boolean;
12
+ /**
13
+ * Offer a way back to empty once a range is picked.
14
+ *
15
+ * A calendar has no "none" cell, so without this an optional range field is
16
+ * one-way. Spelled `clearable` like every other control in the kit.
17
+ */
18
+ clearable?: boolean;
19
+ /**
20
+ * Shown on the trigger while the field is empty.
21
+ */
22
+ placeholder?: string;
23
+ /**
24
+ * Extra classes on the trigger button. A filter bar sizes its slots, and a
25
+ * range trigger holds two dates rather than one, so it usually wants to be
26
+ * wider than its neighbours.
27
+ */
28
+ triggerClassName?: string;
29
+ }
30
+ /**
31
+ * A closed range of calendar days, as one field.
32
+ *
33
+ * `z.dateRange()` makes both ends mandatory, so this control never writes a
34
+ * half-range: `.optional()` on the schema is the only way to say "no filter",
35
+ * and there is nothing in between.
36
+ *
37
+ * ⚠️ **The field is written on the second CLICK, not on the first complete
38
+ * range**, and the difference is measured rather than assumed. The trap this
39
+ * was written for is DayPicker handing back `{ from }` with no `to`
40
+ * mid-gesture; react-day-picker ^10 does something else, which is worse for a
41
+ * naive control: the first click answers `{ from: d, to: d }`, a complete
42
+ * one-day range. A control that wrote whenever both ends existed would
43
+ * therefore take the start date as the whole range and slam the popover shut
44
+ * before the reader picked an end.
45
+ *
46
+ * So `pending` counts the gesture instead of reading its shape, and it
47
+ * handles both behaviours: a genuinely half range holds, and a
48
+ * DayPicker-completed first click holds too. `control-date-range.browser
49
+ * .spec.tsx` drives two real clicks, which is what found this.
50
+ *
51
+ * ⚠️ **Local parts, never `new Date(value)`.** A date-only string is a
52
+ * calendar day; parsing it as an instant shifts it by one west of Greenwich.
53
+ * The two helpers are `control-date`'s own, shared rather than copied.
54
+ */
55
+ export declare const ControlDateRange: (props: ControlDateRangeProps) => React.JSX.Element | null;
56
+ //# sourceMappingURL=control-date-range.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-date-range.d.ts","sourceRoot":"","sources":["../../../src/components/control-date-range/control-date-range.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,mBAAmB,CAAC;AAS3B,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,6BAoJ5D,CAAC"}
@@ -0,0 +1,148 @@
1
+ import { cn } from "../../lib/utils.js";
2
+ import { Button } from "../ui/button.js";
3
+ import { FormField } from "../control-base/form-field.js";
4
+ import { DATE_ONLY, formatDateOnly, parseDateOnly } from "../control-date/date-only.js";
5
+ import { Calendar as Calendar$1 } from "../ui/calendar.js";
6
+ import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover.js";
7
+ import { useState } from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { Calendar, ChevronDown, X } from "lucide-react";
10
+ import { parseField, useFieldValue, useFormState } from "alepha/react/form";
11
+ //#region src/components/control-date-range/control-date-range.tsx
12
+ /**
13
+ * A closed range of calendar days, as one field.
14
+ *
15
+ * `z.dateRange()` makes both ends mandatory, so this control never writes a
16
+ * half-range: `.optional()` on the schema is the only way to say "no filter",
17
+ * and there is nothing in between.
18
+ *
19
+ * ⚠️ **The field is written on the second CLICK, not on the first complete
20
+ * range**, and the difference is measured rather than assumed. The trap this
21
+ * was written for is DayPicker handing back `{ from }` with no `to`
22
+ * mid-gesture; react-day-picker ^10 does something else, which is worse for a
23
+ * naive control: the first click answers `{ from: d, to: d }`, a complete
24
+ * one-day range. A control that wrote whenever both ends existed would
25
+ * therefore take the start date as the whole range and slam the popover shut
26
+ * before the reader picked an end.
27
+ *
28
+ * So `pending` counts the gesture instead of reading its shape, and it
29
+ * handles both behaviours: a genuinely half range holds, and a
30
+ * DayPicker-completed first click holds too. `control-date-range.browser
31
+ * .spec.tsx` drives two real clicks, which is what found this.
32
+ *
33
+ * ⚠️ **Local parts, never `new Date(value)`.** A date-only string is a
34
+ * calendar day; parsing it as an instant shifts it by one west of Greenwich.
35
+ * The two helpers are `control-date`'s own, shared rather than copied.
36
+ */
37
+ const ControlDateRange = (props) => {
38
+ const form = useFormState(props.input, ["error"]);
39
+ const [value, setValue] = useFieldValue(props.input);
40
+ const [open, setOpen] = useState(false);
41
+ /**
42
+ * Whether a selection gesture is half-made: one click in, waiting for the
43
+ * other end. Reset whenever the popover opens, so an abandoned gesture
44
+ * cannot make the next popover's first click look like a second one.
45
+ */
46
+ const [pending, setPending] = useState(false);
47
+ const stored = toRange(value);
48
+ const storedKey = Array.isArray(value) ? value.join(",") : "";
49
+ const [draft, setDraft] = useState(stored);
50
+ const [seenKey, setSeenKey] = useState(storedKey);
51
+ if (seenKey !== storedKey) {
52
+ setSeenKey(storedKey);
53
+ setDraft(stored);
54
+ }
55
+ if (!props.input?.props) return null;
56
+ const meta = parseField(props.input, {
57
+ label: props.label,
58
+ description: props.description,
59
+ error: form.error
60
+ });
61
+ const shown = draft ?? stored;
62
+ const formatted = shown?.from ? shown.to ? `${shown.from.toLocaleDateString()} - ${shown.to.toLocaleDateString()}` : shown.from.toLocaleDateString() : "";
63
+ const handleSelect = (next) => {
64
+ setDraft(next);
65
+ if (!next?.from) {
66
+ setPending(false);
67
+ return;
68
+ }
69
+ if (!next.to || !pending) {
70
+ setPending(true);
71
+ return;
72
+ }
73
+ setPending(false);
74
+ setValue([formatDateOnly(next.from), formatDateOnly(next.to)]);
75
+ setOpen(false);
76
+ };
77
+ const showClear = props.clearable && !!stored?.from && !props.disabled;
78
+ return /* @__PURE__ */ jsx(FormField, {
79
+ id: meta.id,
80
+ label: meta.label,
81
+ description: meta.description,
82
+ error: meta.error,
83
+ required: meta.required,
84
+ children: /* @__PURE__ */ jsxs(Popover, {
85
+ open,
86
+ onOpenChange: (next) => {
87
+ setOpen(next);
88
+ if (next) setPending(false);
89
+ },
90
+ children: [/* @__PURE__ */ jsxs("div", {
91
+ className: "flex w-full items-center gap-1",
92
+ children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
93
+ render: /* @__PURE__ */ jsx(Button, {
94
+ id: meta.id,
95
+ "data-slot": "date-trigger",
96
+ variant: "outline",
97
+ disabled: props.disabled,
98
+ name: props.input.props.name,
99
+ className: cn("flex-1 justify-start text-left font-normal", "border-input", "hover:bg-background aria-expanded:bg-background", !formatted && "text-muted-foreground hover:text-muted-foreground aria-expanded:text-muted-foreground", props.triggerClassName)
100
+ }),
101
+ children: [
102
+ /* @__PURE__ */ jsx(Calendar, { className: "text-muted-foreground mr-2 size-4" }),
103
+ formatted || props.placeholder || "Pick a date range",
104
+ /* @__PURE__ */ jsx(ChevronDown, { className: "text-muted-foreground pointer-events-none ml-auto size-4 shrink-0" })
105
+ ]
106
+ }), showClear && /* @__PURE__ */ jsx(Button, {
107
+ type: "button",
108
+ variant: "ghost",
109
+ size: "icon",
110
+ "aria-label": "Clear date range",
111
+ onClick: () => {
112
+ setDraft(void 0);
113
+ setValue(void 0);
114
+ },
115
+ children: /* @__PURE__ */ jsx(X, { className: "size-4" })
116
+ })]
117
+ }), /* @__PURE__ */ jsx(PopoverContent, {
118
+ className: "w-auto p-0",
119
+ align: "start",
120
+ children: /* @__PURE__ */ jsx(Calendar$1, {
121
+ mode: "range",
122
+ selected: shown,
123
+ onSelect: handleSelect
124
+ })
125
+ })]
126
+ })
127
+ });
128
+ };
129
+ /**
130
+ * The stored pair as DayPicker's own shape, or nothing.
131
+ *
132
+ * Anything that is not two parseable date-only strings reads as empty rather
133
+ * than as half a range: the value comes off a URL as often as off a form, and
134
+ * a malformed one is the schema's to reject, not this control's to render.
135
+ */
136
+ const toRange = (value) => {
137
+ if (!Array.isArray(value) || value.length !== 2) return void 0;
138
+ const [from, to] = value;
139
+ if (!from || !to || !DATE_ONLY.test(from) || !DATE_ONLY.test(to)) return;
140
+ return {
141
+ from: parseDateOnly(from),
142
+ to: parseDateOnly(to)
143
+ };
144
+ };
145
+ //#endregion
146
+ export { ControlDateRange };
147
+
148
+ //# sourceMappingURL=control-date-range.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-date-range.js","names":["CalendarIcon","ChevronDownIcon","Calendar"],"sources":["../../../src/components/control-date-range/control-date-range.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { FormField } from \"@alepha/ui/components/control-base/form-field\";\nimport {\n DATE_ONLY,\n formatDateOnly,\n parseDateOnly,\n} from \"@alepha/ui/components/control-date/date-only.ts\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport { Calendar } from \"@alepha/ui/components/ui/calendar\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@alepha/ui/components/ui/popover\";\nimport { cn } from \"@alepha/ui/lib/utils\";\nimport {\n type BaseInputField,\n parseField,\n useFieldValue,\n useFormState,\n} from \"alepha/react/form\";\nimport {\n Calendar as CalendarIcon,\n ChevronDown as ChevronDownIcon,\n X,\n} from \"lucide-react\";\nimport { useState } from \"react\";\nimport type { DateRange } from \"react-day-picker\";\n\nexport interface ControlDateRangeProps {\n /**\n * Bound `InputField` from `useForm`. Stores `[start, end]`, two date-only\n * strings, or nothing at all.\n */\n input: BaseInputField;\n label?: string;\n description?: string;\n disabled?: boolean;\n /**\n * Offer a way back to empty once a range is picked.\n *\n * A calendar has no \"none\" cell, so without this an optional range field is\n * one-way. Spelled `clearable` like every other control in the kit.\n */\n clearable?: boolean;\n /**\n * Shown on the trigger while the field is empty.\n */\n placeholder?: string;\n /**\n * Extra classes on the trigger button. A filter bar sizes its slots, and a\n * range trigger holds two dates rather than one, so it usually wants to be\n * wider than its neighbours.\n */\n triggerClassName?: string;\n}\n\n/**\n * A closed range of calendar days, as one field.\n *\n * `z.dateRange()` makes both ends mandatory, so this control never writes a\n * half-range: `.optional()` on the schema is the only way to say \"no filter\",\n * and there is nothing in between.\n *\n * ⚠️ **The field is written on the second CLICK, not on the first complete\n * range**, and the difference is measured rather than assumed. The trap this\n * was written for is DayPicker handing back `{ from }` with no `to`\n * mid-gesture; react-day-picker ^10 does something else, which is worse for a\n * naive control: the first click answers `{ from: d, to: d }`, a complete\n * one-day range. A control that wrote whenever both ends existed would\n * therefore take the start date as the whole range and slam the popover shut\n * before the reader picked an end.\n *\n * So `pending` counts the gesture instead of reading its shape, and it\n * handles both behaviours: a genuinely half range holds, and a\n * DayPicker-completed first click holds too. `control-date-range.browser\n * .spec.tsx` drives two real clicks, which is what found this.\n *\n * ⚠️ **Local parts, never `new Date(value)`.** A date-only string is a\n * calendar day; parsing it as an instant shifts it by one west of Greenwich.\n * The two helpers are `control-date`'s own, shared rather than copied.\n */\nexport const ControlDateRange = (props: ControlDateRangeProps) => {\n const form = useFormState(props.input, [\"error\"]);\n const [value, setValue] = useFieldValue(props.input);\n const [open, setOpen] = useState(false);\n /**\n * Whether a selection gesture is half-made: one click in, waiting for the\n * other end. Reset whenever the popover opens, so an abandoned gesture\n * cannot make the next popover's first click look like a second one.\n */\n const [pending, setPending] = useState(false);\n\n const stored = toRange(value as unknown);\n const storedKey = Array.isArray(value) ? (value as string[]).join(\",\") : \"\";\n // The gesture in progress. Seeded from the field, and re-seeded whenever\n // the field moves underneath it - a form reset, or a value arriving from\n // the URL after the first paint.\n const [draft, setDraft] = useState<DateRange | undefined>(stored);\n const [seenKey, setSeenKey] = useState(storedKey);\n if (seenKey !== storedKey) {\n // ⚠️ Adjusted DURING render, not in an effect. React documents this as\n // the way to reset state when an input changes, and the effect version is\n // a lint error here (`react(set-state-in-effect)`) for the reason the\n // rule gives: it renders once with the stale draft and again with the new\n // one, so a value arriving from the URL is visibly wrong for a frame.\n //\n // Keyed on the joined VALUE, never on `stored`: `toRange` builds a new\n // object every render, so comparing objects would reset the draft on\n // every keystroke elsewhere in the form and discard a half-made\n // selection.\n setSeenKey(storedKey);\n setDraft(stored);\n }\n\n if (!props.input?.props) return null;\n\n const meta = parseField(props.input, {\n label: props.label,\n description: props.description,\n error: form.error,\n });\n\n const shown = draft ?? stored;\n const formatted = shown?.from\n ? shown.to\n ? `${shown.from.toLocaleDateString()} - ${shown.to.toLocaleDateString()}`\n : shown.from.toLocaleDateString()\n : \"\";\n\n const handleSelect = (next: DateRange | undefined) => {\n setDraft(next);\n if (!next?.from) {\n setPending(false);\n return;\n }\n if (!next.to || !pending) {\n // The first click of a gesture, whichever shape DayPicker gave it. The\n // field keeps whatever it had: writing now would either fail the schema\n // (half a range) or record the start day as the whole range, and\n // clearing would destroy the old range before the new one exists.\n setPending(true);\n return;\n }\n setPending(false);\n setValue([formatDateOnly(next.from), formatDateOnly(next.to)]);\n setOpen(false);\n };\n\n const showClear = props.clearable && !!stored?.from && !props.disabled;\n\n return (\n <FormField\n id={meta.id}\n label={meta.label}\n description={meta.description}\n error={meta.error}\n required={meta.required}\n >\n <Popover\n open={open}\n onOpenChange={(next) => {\n setOpen(next);\n if (next) setPending(false);\n }}\n >\n {/* The clear button sits BESIDE the trigger, not inside it: a button\n nested in a button is invalid, and Base UI's popover trigger would\n swallow its click anyway. Same arrangement as `ControlDate`. */}\n <div className=\"flex w-full items-center gap-1\">\n <PopoverTrigger\n render={\n <Button\n id={meta.id}\n // `date-trigger`, the same slot `ControlDate` claims, so this\n // control gets the kit's `--input-hover` border rule rather\n // than being the one field that does not darken.\n data-slot=\"date-trigger\"\n variant=\"outline\"\n disabled={props.disabled}\n // `name` only, never the whole `input.props` spread: those\n // are an `<input>`'s props and this is a button, so their\n // `onChange` signature is genuinely incompatible. The name is\n // what `AutoForm`'s scroll-to-first-error looks a field up by.\n name={props.input.props.name}\n className={cn(\n \"flex-1 justify-start text-left font-normal\",\n // `border-input`, for the reason `ControlDate` spells out:\n // rendering as a Button means inheriting the outline\n // variant's `border-border`, which is right for a button\n // and wrong for a field. A no-op while the two tokens are\n // aliased, which is why it is worth stating.\n \"border-input\",\n \"hover:bg-background aria-expanded:bg-background\",\n !formatted &&\n \"text-muted-foreground hover:text-muted-foreground aria-expanded:text-muted-foreground\",\n props.triggerClassName,\n )}\n />\n }\n >\n <CalendarIcon className=\"text-muted-foreground mr-2 size-4\" />\n {formatted || props.placeholder || \"Pick a date range\"}\n <ChevronDownIcon className=\"text-muted-foreground pointer-events-none ml-auto size-4 shrink-0\" />\n </PopoverTrigger>\n {showClear && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n aria-label=\"Clear date range\"\n onClick={() => {\n setDraft(undefined);\n setValue(undefined);\n }}\n >\n <X className=\"size-4\" />\n </Button>\n )}\n </div>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n {/* The range visuals were built and unused: `calendar.tsx` passes\n `...props` straight to DayPicker and already defines\n `range_start` / `range_middle` / `range_end`, which its custom\n `DayButton` reads into styled data attributes. */}\n <Calendar mode=\"range\" selected={shown} onSelect={handleSelect} />\n </PopoverContent>\n </Popover>\n </FormField>\n );\n};\n\n/**\n * The stored pair as DayPicker's own shape, or nothing.\n *\n * Anything that is not two parseable date-only strings reads as empty rather\n * than as half a range: the value comes off a URL as often as off a form, and\n * a malformed one is the schema's to reject, not this control's to render.\n */\nconst toRange = (value: unknown): DateRange | undefined => {\n if (!Array.isArray(value) || value.length !== 2) return undefined;\n const [from, to] = value as string[];\n if (!from || !to || !DATE_ONLY.test(from) || !DATE_ONLY.test(to)) {\n return undefined;\n }\n return { from: parseDateOnly(from), to: parseDateOnly(to) };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,MAAa,oBAAoB,UAAiC;CAChE,MAAM,OAAO,aAAa,MAAM,OAAO,CAAC,OAAO,CAAC;CAChD,MAAM,CAAC,OAAO,YAAY,cAAc,MAAM,KAAK;CACnD,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;;;;;;CAMtC,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAE5C,MAAM,SAAS,QAAQ,KAAgB;CACvC,MAAM,YAAY,MAAM,QAAQ,KAAK,IAAK,MAAmB,KAAK,GAAG,IAAI;CAIzE,MAAM,CAAC,OAAO,YAAY,SAAgC,MAAM;CAChE,MAAM,CAAC,SAAS,cAAc,SAAS,SAAS;CAChD,IAAI,YAAY,WAAW;EAWzB,WAAW,SAAS;EACpB,SAAS,MAAM;CACjB;CAEA,IAAI,CAAC,MAAM,OAAO,OAAO,OA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ClF;IACf,CAAA,GAAA,aACC,oBAAC,QAAD;KACE,MAAK;KACL,SAAQ;KACR,MAAK;KACL,cAAW;KACX,eAAe;MACb,SAAS,KAAA,CAAS;MAClB,SAAS,KAAA,CAAS;KACpB;KAEA,UAAA,oBAAC,GAAD,EAAG,WAAU,SAAU,CAAA;IACjB,CAAA,CAEP;GACL,CAAA,GAAA,oBAAC,gBAAD;IAAgB,WAAU;IAAa,OAAM;IAK3C,UAAA,oBAACC,YAAD;KAAU,MAAK;KAAQ,UAAU;KAAO,UAAU;IAAe,CAAA;GACnD,CAAA,CACT;;CACA,CAAA;AAEf;;;;;;;;AASA,MAAM,WAAW,UAA0C;CACzD,IAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,MAAM,WAAW,GAAG,OAAO,KAAA;CACxD,MAAM,CAAC,MAAM,MAAM;CACnB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,KAAK,IAAI,KAAK,CAAC,UAAU,KAAK,EAAE,GAC7D;CAEF,OAAO;EAAE,MAAM,cAAc,IAAI;EAAG,IAAI,cAAc,EAAE;CAAE;AAC5D"}
@@ -36,8 +36,9 @@ const ControlObject = (props) => {
36
36
  ...resolveFieldI18n(tr, props.i18nPrefix, name, props.controlProps?.[name] ?? {}),
37
37
  i18nPrefix: childI18nPrefix(props.i18nPrefix, name)
38
38
  };
39
+ const width = widthFor(field, fieldProps.width);
39
40
  return /* @__PURE__ */ jsx("div", {
40
- className: spanClass(widthFor(field, fieldProps.width)),
41
+ className: spanClass(width),
41
42
  children: /* @__PURE__ */ jsx(Control, {
42
43
  input: field,
43
44
  disabled: props.disabled,
@@ -1 +1 @@
1
- {"version":3,"file":"control-object.js","names":[],"sources":["../../../src/components/control-object/control-object.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { spanClass, widthFor } from \"@alepha/ui/components/control-base/grid\";\nimport {\n Control,\n type ControlProps,\n} from \"@alepha/ui/components/control/control\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport { type ZObject, z } from \"alepha\";\nimport {\n type BaseInputField,\n type ObjectInputField,\n parseField,\n useFieldValue,\n useFormState,\n} from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { ChevronDown, ChevronRight, Plus, Trash2 } from \"lucide-react\";\nimport { useState } from \"react\";\n\nimport {\n childI18nPrefix,\n resolveFieldI18n,\n} from \"../control-base/field-i18n.ts\";\n\nexport interface ControlObjectProps {\n /**\n * Bound object `InputField` from `useForm`.\n */\n input: BaseInputField;\n /**\n * Field label. Falls back to schema `title`.\n */\n label?: string;\n /**\n * Helper text shown below the group.\n */\n description?: string;\n /**\n * Number of grid columns. @default 1\n */\n columns?: 1 | 2 | 3 | 4;\n /**\n * \"fieldset\" wraps in a bordered container with legend. \"plain\" renders fields only.\n */\n variant?: \"fieldset\" | \"plain\";\n /**\n * Per-field control props override, keyed by field name.\n */\n controlProps?: Record<string, Partial<Omit<ControlProps, \"input\">>>;\n /**\n * Disable the group and all inner controls.\n */\n disabled?: boolean;\n /**\n * Default expanded state. @default true\n */\n defaultExpanded?: boolean;\n /**\n * Dictionary prefix for this object's children (see `resolveFieldI18n`).\n */\n i18nPrefix?: string;\n /**\n * Take the clear button away from an optional object.\n *\n * The schema decides by default: an optional or nullable object that has\n * been initialised offers the button, and `false` opts out - the same way\n * round as a text field's `clearable`, and for the same reason. Pass\n * `false` when clearing is not something the API can honour, so the button\n * does not promise an edit that silently does nothing.\n *\n * This used to be opt-IN, which made the button unreachable: `Control` is\n * the only thing that mounts this component and it never passed the prop,\n * so an initialised optional object could not be cleared from the UI at\n * all.\n */\n clearable?: boolean;\n}\n\nexport const ControlObject = (props: ControlObjectProps) => {\n const form = useFormState(props.input, [\"error\"]);\n const [value, setValue] = useFieldValue(props.input);\n const [expanded, setExpanded] = useState(props.defaultExpanded ?? true);\n const { tr } = useI18n();\n\n if (!props.input?.props) return null;\n\n const meta = parseField(props.input, {\n label: props.label,\n description: props.description,\n error: form.error,\n });\n\n // The field schema may be wrapped (optional/nullable/default); peel to the\n // ZodObject before reading its shape.\n const schema = z.schema.unwrap(props.input.schema) as ZObject;\n if (!z.schema.isObject(schema)) return null;\n\n // ── Init / clear ────────────────────────────────────────────────\n const isInitialized = value != null && typeof value === \"object\";\n\n // `clearable !== false`, not `clearable === true`: the schema is the\n // answer, and a caller opts out. A required object has nothing to clear to.\n const showClear =\n isInitialized &&\n !meta.required &&\n !props.disabled &&\n props.clearable !== false;\n\n const fieldNames = Object.keys(z.schema.shape(schema));\n const nestedItems = (props.input as ObjectInputField<ZObject>).items as\n | Record<string, BaseInputField>\n | undefined;\n\n const grid = (\n <div className=\"grid grid-cols-12 gap-3\">\n {fieldNames.map((name) => {\n const field = nestedItems?.[name];\n if (!field) return null;\n const fieldProps = {\n ...props.controlProps?.[name],\n ...resolveFieldI18n(\n tr as never,\n props.i18nPrefix,\n name,\n props.controlProps?.[name] ?? {},\n ),\n i18nPrefix: childI18nPrefix(props.i18nPrefix, name),\n };\n const width = widthFor(field, fieldProps.width as number | undefined);\n return (\n <div key={name} className={spanClass(width)}>\n <Control input={field} disabled={props.disabled} {...fieldProps} />\n </div>\n );\n })}\n </div>\n );\n\n if (props.variant === \"plain\") return grid;\n\n return (\n <fieldset\n className={`rounded-md border p-3 ${\n meta.error ? \"border-destructive\" : \"border-border\"\n }`}\n >\n <div className=\"flex items-start gap-3\">\n {!isInitialized && !props.disabled ? (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon\"\n className=\"size-8 shrink-0\"\n aria-label={tr(\"controlObject.initialize\", {\n default: \"Initialize\",\n })}\n onClick={() => setValue({})}\n >\n <Plus className=\"size-4\" />\n </Button>\n ) : showClear ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-8 shrink-0\"\n aria-label={tr(\"controlObject.clear\", { default: \"Clear\" })}\n onClick={() => setValue(undefined)}\n >\n <Trash2 className=\"size-4\" />\n </Button>\n ) : (\n <div className=\"size-8 shrink-0\" />\n )}\n <div className=\"flex min-w-0 flex-1 flex-col\">\n {meta.label && (\n <legend className=\"text-sm leading-tight font-medium\">\n {meta.label}\n {meta.required && (\n <span className=\"text-destructive ml-0.5\">*</span>\n )}\n </legend>\n )}\n {meta.description && (\n <p className=\"text-muted-foreground text-xs leading-tight\">\n {meta.description}\n </p>\n )}\n {meta.error && (\n <p className=\"text-destructive text-xs leading-tight\">\n {meta.error}\n </p>\n )}\n </div>\n {isInitialized && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-8 shrink-0\"\n aria-label={\n expanded\n ? tr(\"controlObject.collapse\", { default: \"Collapse\" })\n : tr(\"controlObject.expand\", { default: \"Expand\" })\n }\n onClick={() => setExpanded((e) => !e)}\n >\n {expanded ? (\n <ChevronDown className=\"size-4\" />\n ) : (\n <ChevronRight className=\"size-4\" />\n )}\n </Button>\n )}\n </div>\n {expanded && isInitialized && <div className=\"mt-3\">{grid}</div>}\n </fieldset>\n );\n};\n"],"mappings":";;;;;;;;;;;AAiFA,MAAa,iBAAiB,UAA8B;CAC1D,MAAM,OAAO,aAAa,MAAM,OAAO,CAAC,OAAO,CAAC;CAChD,MAAM,CAAC,OAAO,YAAY,cAAc,MAAM,KAAK;CACnD,MAAM,CAAC,UAAU,eAAe,SAAS,MAAM,mBAAmB,IAAI;CACtE,MAAM,EAAE,OAAO,QAAQ;CAEvB,IAAI,CAAC,MAAM,OAAO,OAAO,OAAO;CAEhC,MAAM,OAAO,WAAW,MAAM,OAAO;EACnC,OAAO,MAAM;EACb,aAAa,MAAM;EACnB,OAAO,KAAK;CACd,CAAC;CAID,MAAM,SAAS,EAAE,OAAO,OAAO,MAAM,MAAM,MAAM;CACjD,IAAI,CAAC,EAAE,OAAO,SAAS,MAAM,GAAG,OAAO;CAGvC,MAAM,gBAAgB,SAAS,QAAQ,OAAO,UAAU;CAIxD,MAAM,YACJ,iBACA,CAAC,KAAK,YACN,CAAC,MAAM,YACP,MAAM,cAAc;CAE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AAD;KAAK,WAAU;KAAf,UAAA;MACG,KAAK,SACJ,qBAAC,UAAD;OAAQ,WAAU;OAAlB,UAAA,CACG,KAAK,OACL,KAAK,YACJ,oBAAC,QAAD;QAAM,WAAU;QAA0B,UAAA;OAAO,CAAA,CAE7C;;MAET,KAAK,eACJ,oBAAC,KAAD;OAAG,WAAU;OACV,UAAA,KAAK;MACL,CAAA;MAEJ,KAAK,SACJ,oBAAC,KAAD;OAAG,WAAU;OACV,UAAA,KAAK;MACL,CAAA;KAEF;;IACJ,iBACC,oBAAC,QAAD;KACE,MAAK;KACL,SAAQ;KACR,MAAK;KACL,WAAU;KACV,cACE,WACI,GAAG,0BAA0B,EAAE,SAAS,WAAW,CAAC,IACpD,GAAG,wBAAwB,EAAE,SAAS,SAAS,CAAC;KAEtD,eAAe,aAAa,MAAM,CAAC,CAAC;KAEnC,UAAA,WACC,oBAAC,aAAD,EAAa,WAAU,SAAU,CAAA,IAEjC,oBAAC,cAAD,EAAc,WAAU,SAAU,CAAA;IAE9B,CAAA;GAEP;EACJ,CAAA,GAAA,YAAY,iBAAiB,oBAAC,OAAD;GAAK,WAAU;GAAQ,UAAA;EAAU,CAAA,CACvD;;AAEd"}
1
+ {"version":3,"file":"control-object.js","names":[],"sources":["../../../src/components/control-object/control-object.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { spanClass, widthFor } from \"@alepha/ui/components/control-base/grid\";\nimport {\n Control,\n type ControlProps,\n} from \"@alepha/ui/components/control/control\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport { type ZObject, z } from \"alepha\";\nimport {\n type BaseInputField,\n type ObjectInputField,\n parseField,\n useFieldValue,\n useFormState,\n} from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { ChevronDown, ChevronRight, Plus, Trash2 } from \"lucide-react\";\nimport { useState } from \"react\";\n\nimport {\n childI18nPrefix,\n resolveFieldI18n,\n} from \"../control-base/field-i18n.ts\";\n\nexport interface ControlObjectProps {\n /**\n * Bound object `InputField` from `useForm`.\n */\n input: BaseInputField;\n /**\n * Field label. Falls back to schema `title`.\n */\n label?: string;\n /**\n * Helper text shown below the group.\n */\n description?: string;\n /**\n * Number of grid columns. @default 1\n */\n columns?: 1 | 2 | 3 | 4;\n /**\n * \"fieldset\" wraps in a bordered container with legend. \"plain\" renders fields only.\n */\n variant?: \"fieldset\" | \"plain\";\n /**\n * Per-field control props override, keyed by field name.\n */\n controlProps?: Record<string, Partial<Omit<ControlProps, \"input\">>>;\n /**\n * Disable the group and all inner controls.\n */\n disabled?: boolean;\n /**\n * Default expanded state. @default true\n */\n defaultExpanded?: boolean;\n /**\n * Dictionary prefix for this object's children (see `resolveFieldI18n`).\n */\n i18nPrefix?: string;\n /**\n * Take the clear button away from an optional object.\n *\n * The schema decides by default: an optional or nullable object that has\n * been initialised offers the button, and `false` opts out - the same way\n * round as a text field's `clearable`, and for the same reason. Pass\n * `false` when clearing is not something the API can honour, so the button\n * does not promise an edit that silently does nothing.\n *\n * This used to be opt-IN, which made the button unreachable: `Control` is\n * the only thing that mounts this component and it never passed the prop,\n * so an initialised optional object could not be cleared from the UI at\n * all.\n */\n clearable?: boolean;\n}\n\nexport const ControlObject = (props: ControlObjectProps) => {\n const form = useFormState(props.input, [\"error\"]);\n const [value, setValue] = useFieldValue(props.input);\n const [expanded, setExpanded] = useState(props.defaultExpanded ?? true);\n const { tr } = useI18n();\n\n if (!props.input?.props) return null;\n\n const meta = parseField(props.input, {\n label: props.label,\n description: props.description,\n error: form.error,\n });\n\n // The field schema may be wrapped (optional/nullable/default); peel to the\n // ZodObject before reading its shape.\n const schema = z.schema.unwrap(props.input.schema) as ZObject;\n if (!z.schema.isObject(schema)) return null;\n\n // ── Init / clear ────────────────────────────────────────────────\n const isInitialized = value != null && typeof value === \"object\";\n\n // `clearable !== false`, not `clearable === true`: the schema is the\n // answer, and a caller opts out. A required object has nothing to clear to.\n const showClear =\n isInitialized &&\n !meta.required &&\n !props.disabled &&\n props.clearable !== false;\n\n const fieldNames = Object.keys(z.schema.shape(schema));\n const nestedItems = (props.input as ObjectInputField<ZObject>).items as\n | Record<string, BaseInputField>\n | undefined;\n\n const grid = (\n <div className=\"grid grid-cols-12 gap-3\">\n {fieldNames.map((name) => {\n const field = nestedItems?.[name];\n if (!field) return null;\n const fieldProps = {\n ...props.controlProps?.[name],\n ...resolveFieldI18n(\n tr as never,\n props.i18nPrefix,\n name,\n props.controlProps?.[name] ?? {},\n ),\n i18nPrefix: childI18nPrefix(props.i18nPrefix, name),\n };\n const width = widthFor(field, fieldProps.width as number | undefined);\n return (\n <div key={name} className={spanClass(width)}>\n <Control input={field} disabled={props.disabled} {...fieldProps} />\n </div>\n );\n })}\n </div>\n );\n\n if (props.variant === \"plain\") return grid;\n\n return (\n <fieldset\n className={`rounded-md border p-3 ${\n meta.error ? \"border-destructive\" : \"border-border\"\n }`}\n >\n <div className=\"flex items-start gap-3\">\n {!isInitialized && !props.disabled ? (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon\"\n className=\"size-8 shrink-0\"\n aria-label={tr(\"controlObject.initialize\", {\n default: \"Initialize\",\n })}\n onClick={() => setValue({})}\n >\n <Plus className=\"size-4\" />\n </Button>\n ) : showClear ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-8 shrink-0\"\n aria-label={tr(\"controlObject.clear\", { default: \"Clear\" })}\n onClick={() => setValue(undefined)}\n >\n <Trash2 className=\"size-4\" />\n </Button>\n ) : (\n <div className=\"size-8 shrink-0\" />\n )}\n <div className=\"flex min-w-0 flex-1 flex-col\">\n {meta.label && (\n <legend className=\"text-sm leading-tight font-medium\">\n {meta.label}\n {meta.required && (\n <span className=\"text-destructive ml-0.5\">*</span>\n )}\n </legend>\n )}\n {meta.description && (\n <p className=\"text-muted-foreground text-xs leading-tight\">\n {meta.description}\n </p>\n )}\n {meta.error && (\n <p className=\"text-destructive text-xs leading-tight\">\n {meta.error}\n </p>\n )}\n </div>\n {isInitialized && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-8 shrink-0\"\n aria-label={\n expanded\n ? tr(\"controlObject.collapse\", { default: \"Collapse\" })\n : tr(\"controlObject.expand\", { default: \"Expand\" })\n }\n onClick={() => setExpanded((e) => !e)}\n >\n {expanded ? (\n <ChevronDown className=\"size-4\" />\n ) : (\n <ChevronRight className=\"size-4\" />\n )}\n </Button>\n )}\n </div>\n {expanded && isInitialized && <div className=\"mt-3\">{grid}</div>}\n </fieldset>\n );\n};\n"],"mappings":";;;;;;;;;;;AAiFA,MAAa,iBAAiB,UAA8B;CAC1D,MAAM,OAAO,aAAa,MAAM,OAAO,CAAC,OAAO,CAAC;CAChD,MAAM,CAAC,OAAO,YAAY,cAAc,MAAM,KAAK;CACnD,MAAM,CAAC,UAAU,eAAe,SAAS,MAAM,mBAAmB,IAAI;CACtE,MAAM,EAAE,OAAO,QAAQ;CAEvB,IAAI,CAAC,MAAM,OAAO,OAAO,OAAO;CAEhC,MAAM,OAAO,WAAW,MAAM,OAAO;EACnC,OAAO,MAAM;EACb,aAAa,MAAM;EACnB,OAAO,KAAK;CACd,CAAC;CAID,MAAM,SAAS,EAAE,OAAO,OAAO,MAAM,MAAM,MAAM;CACjD,IAAI,CAAC,EAAE,OAAO,SAAS,MAAM,GAAG,OAAO;CAGvC,MAAM,gBAAgB,SAAS,QAAQ,OAAO,UAAU;CAIxD,MAAM,YACJ,iBACA,CAAC,KAAK,YACN,CAAC,MAAM,YACP,MAAM,cAAc;CAEtB,MAAM,aAAa,OAAO,KAAK,EAAE,OAAO,MAAM,MAAM,CAAC;CACrD,MAAM,cAAe,MAAM,MAAoC;CAI/D,MAAM,OACJ,oBAAC,OAAD;EAAK,WAAU;EACZ,UAAA,WAAW,KAAK,SAAS;GACxB,MAAM,QAAQ,cAAc;GAC5B,IAAI,CAAC,OAAO,OAAO;GACnB,MAAM,aAAa;IACjB,GAAG,MAAM,eAAe;IACxB,GAAG,iBAC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,oBAAC,KAAD;OAAG,WAAU;OACV,UAAA,KAAK;MACL,CAAA;KAEF;;IACJ,iBACC,oBAAC,QAAD;KACE,MAAK;KACL,SAAQ;KACR,MAAK;KACL,WAAU;KACV,cACE,WACI,GAAG,0BAA0B,EAAE,SAAS,WAAW,CAAC,IACpD,GAAG,wBAAwB,EAAE,SAAS,SAAS,CAAC;KAEtD,eAAe,aAAa,MAAM,CAAC,CAAC;KAEnC,UAAA,WACC,oBAAC,aAAD,EAAa,WAAU,SAAU,CAAA,IAEjC,oBAAC,cAAD,EAAc,WAAU,SAAU,CAAA;IAE9B,CAAA;GAEP;EACJ,CAAA,GAAA,YAAY,iBAAiB,oBAAC,OAAD;GAAK,WAAU;GAAQ,UAAA;EAAU,CAAA,CACvD;;AAEd"}
@@ -1 +1 @@
1
- {"version":3,"file":"control-select.d.ts","sourceRoot":"","sources":["../../../src/components/control-select/control-select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAYlF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,KAAK,SAAS,EAA6B,MAAM,OAAO,CAAC;AAElE,MAAM,MAAM,YAAY,GACpB,MAAM,GACN;IACE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAIN;;;;;;GAMG;AACH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BAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IAC3C;;;;;OAKG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AA8CD,eAAO,MAAM,aAAa,UAAW,kBAAkB,6BAyLtD,CAAC"}
1
+ {"version":3,"file":"control-select.d.ts","sourceRoot":"","sources":["../../../src/components/control-select/control-select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAYlF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,KAAK,SAAS,EAA6B,MAAM,OAAO,CAAC;AAElE,MAAM,MAAM,YAAY,GACpB,MAAM,GACN;IACE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAIN;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;AAgFxD,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MA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