@alepha/ui 0.32.0 → 0.34.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 (402) hide show
  1. package/dist/account/AccountConnections.js +1 -1
  2. package/dist/account/AccountConnections.js.map +1 -1
  3. package/dist/account/AccountDeleteDialog.d.ts.map +1 -1
  4. package/dist/account/AccountDeleteDialog.js +17 -17
  5. package/dist/account/AccountDeleteDialog.js.map +1 -1
  6. package/dist/account/AccountKeys.js +2 -2
  7. package/dist/account/AccountKeys.js.map +1 -1
  8. package/dist/account/AccountMfaDialog.d.ts.map +1 -1
  9. package/dist/account/AccountMfaDialog.js +19 -25
  10. package/dist/account/AccountMfaDialog.js.map +1 -1
  11. package/dist/account/AccountPasswordDialog.d.ts.map +1 -1
  12. package/dist/account/AccountPasswordDialog.js +25 -24
  13. package/dist/account/AccountPasswordDialog.js.map +1 -1
  14. package/dist/account/AccountProfile.d.ts.map +1 -1
  15. package/dist/account/AccountProfile.js +17 -24
  16. package/dist/account/AccountProfile.js.map +1 -1
  17. package/dist/account/AccountSecurity.d.ts.map +1 -1
  18. package/dist/account/AccountSecurity.js +21 -19
  19. package/dist/account/AccountSecurity.js.map +1 -1
  20. package/dist/account/AccountSessions.js +1 -1
  21. package/dist/account/AccountSessions.js.map +1 -1
  22. package/dist/account/ApiKeyCreateDialog.d.ts.map +1 -1
  23. package/dist/account/ApiKeyCreateDialog.js +8 -12
  24. package/dist/account/ApiKeyCreateDialog.js.map +1 -1
  25. package/dist/admin/AdminFiles.js +1 -1
  26. package/dist/admin/AdminFiles.js.map +1 -1
  27. package/dist/admin/AdminJobs.js +1 -1
  28. package/dist/admin/AdminJobs.js.map +1 -1
  29. package/dist/admin/AdminKeys.js +1 -1
  30. package/dist/admin/AdminKeys.js.map +1 -1
  31. package/dist/admin/AdminParameters.d.ts.map +1 -1
  32. package/dist/admin/AdminParameters.js +7 -5
  33. package/dist/admin/AdminParameters.js.map +1 -1
  34. package/dist/admin/AdminParametersTreeFooterActions.d.ts +2 -2
  35. package/dist/admin/AdminParametersTreeFooterActions.d.ts.map +1 -1
  36. package/dist/admin/AdminParametersTreeFooterActions.js.map +1 -1
  37. package/dist/admin/AdminParametersTreePane.d.ts +2 -2
  38. package/dist/admin/AdminParametersTreePane.d.ts.map +1 -1
  39. package/dist/admin/AdminParametersTreePane.js.map +1 -1
  40. package/dist/admin/AdminRouter.d.ts +1 -3
  41. package/dist/admin/AdminRouter.d.ts.map +1 -1
  42. package/dist/admin/AdminRouter.js +2 -4
  43. package/dist/admin/AdminRouter.js.map +1 -1
  44. package/dist/admin/AdminSessions.js +1 -1
  45. package/dist/admin/AdminSessions.js.map +1 -1
  46. package/dist/admin/AdminUserAvatarControl.d.ts.map +1 -1
  47. package/dist/admin/AdminUserAvatarControl.js +9 -16
  48. package/dist/admin/AdminUserAvatarControl.js.map +1 -1
  49. package/dist/admin/AdminUserDetail.js +4 -4
  50. package/dist/admin/AdminUserDetail.js.map +1 -1
  51. package/dist/admin/AdminUsers.d.ts.map +1 -1
  52. package/dist/admin/AdminUsers.js +10 -12
  53. package/dist/admin/AdminUsers.js.map +1 -1
  54. package/dist/admin/AdminUsersRolesPicker.d.ts +5 -1
  55. package/dist/admin/AdminUsersRolesPicker.d.ts.map +1 -1
  56. package/dist/admin/AdminUsersRolesPicker.js +2 -3
  57. package/dist/admin/AdminUsersRolesPicker.js.map +1 -1
  58. package/dist/admin/analytics/AdvancedSection.d.ts.map +1 -1
  59. package/dist/admin/analytics/AdvancedSection.js +7 -3
  60. package/dist/admin/analytics/AdvancedSection.js.map +1 -1
  61. package/dist/admin/analytics/AnalyticsChart.d.ts +1 -0
  62. package/dist/admin/analytics/AnalyticsChart.d.ts.map +1 -1
  63. package/dist/admin/analytics/AnalyticsChart.js +3 -1
  64. package/dist/admin/analytics/AnalyticsChart.js.map +1 -1
  65. package/dist/admin/analytics/AnalyticsChartHeader.d.ts +5 -0
  66. package/dist/admin/analytics/AnalyticsChartHeader.d.ts.map +1 -1
  67. package/dist/admin/analytics/AnalyticsChartHeader.js +7 -2
  68. package/dist/admin/analytics/AnalyticsChartHeader.js.map +1 -1
  69. package/dist/admin/analytics/AnalyticsChartLine.d.ts +5 -0
  70. package/dist/admin/analytics/AnalyticsChartLine.d.ts.map +1 -1
  71. package/dist/admin/analytics/AnalyticsChartLine.js +6 -2
  72. package/dist/admin/analytics/AnalyticsChartLine.js.map +1 -1
  73. package/dist/admin/analytics/CoarsenedBadge.d.ts +15 -0
  74. package/dist/admin/analytics/CoarsenedBadge.d.ts.map +1 -0
  75. package/dist/admin/analytics/CoarsenedBadge.js +30 -0
  76. package/dist/admin/analytics/CoarsenedBadge.js.map +1 -0
  77. package/dist/admin/analytics/CompareNote.d.ts +5 -0
  78. package/dist/admin/analytics/CompareNote.d.ts.map +1 -1
  79. package/dist/admin/analytics/CompareNote.js +5 -1
  80. package/dist/admin/analytics/CompareNote.js.map +1 -1
  81. package/dist/admin/analytics/FilterEditor.d.ts +1 -0
  82. package/dist/admin/analytics/FilterEditor.d.ts.map +1 -1
  83. package/dist/admin/analytics/FilterEditor.js +1 -0
  84. package/dist/admin/analytics/FilterEditor.js.map +1 -1
  85. package/dist/admin/analytics/GroupByChips.d.ts +17 -11
  86. package/dist/admin/analytics/GroupByChips.d.ts.map +1 -1
  87. package/dist/admin/analytics/GroupByChips.js +21 -20
  88. package/dist/admin/analytics/GroupByChips.js.map +1 -1
  89. package/dist/admin/analytics/MeasureChips.d.ts +11 -6
  90. package/dist/admin/analytics/MeasureChips.d.ts.map +1 -1
  91. package/dist/admin/analytics/MeasureChips.js +13 -16
  92. package/dist/admin/analytics/MeasureChips.js.map +1 -1
  93. package/dist/admin/analytics/QueryPanel.d.ts.map +1 -1
  94. package/dist/admin/analytics/QueryPanel.js +10 -6
  95. package/dist/admin/analytics/QueryPanel.js.map +1 -1
  96. package/dist/admin/analytics/RangeControl.d.ts +11 -7
  97. package/dist/admin/analytics/RangeControl.d.ts.map +1 -1
  98. package/dist/admin/analytics/RangeControl.js +83 -30
  99. package/dist/admin/analytics/RangeControl.js.map +1 -1
  100. package/dist/admin/analytics/ResultsPane.d.ts.map +1 -1
  101. package/dist/admin/analytics/ResultsPane.js +13 -9
  102. package/dist/admin/analytics/ResultsPane.js.map +1 -1
  103. package/dist/admin/analytics/ResultsTable.d.ts.map +1 -1
  104. package/dist/admin/analytics/ResultsTable.js +3 -3
  105. package/dist/admin/analytics/ResultsTable.js.map +1 -1
  106. package/dist/admin/analytics/TotalsCards.d.ts +2 -1
  107. package/dist/admin/analytics/TotalsCards.d.ts.map +1 -1
  108. package/dist/admin/analytics/TotalsCards.js +9 -10
  109. package/dist/admin/analytics/TotalsCards.js.map +1 -1
  110. package/dist/admin/analytics/analyticsModel.d.ts +126 -17
  111. package/dist/admin/analytics/analyticsModel.d.ts.map +1 -1
  112. package/dist/admin/analytics/analyticsModel.js +283 -48
  113. package/dist/admin/analytics/analyticsModel.js.map +1 -1
  114. package/dist/admin/analytics/analyticsTypes.d.ts +55 -4
  115. package/dist/admin/analytics/analyticsTypes.d.ts.map +1 -1
  116. package/dist/admin/analytics/chartModel.d.ts +38 -3
  117. package/dist/admin/analytics/chartModel.d.ts.map +1 -1
  118. package/dist/admin/analytics/chartModel.js +86 -16
  119. package/dist/admin/analytics/chartModel.js.map +1 -1
  120. package/dist/admin/analytics/instantRangeSchema.d.ts +8 -0
  121. package/dist/admin/analytics/instantRangeSchema.d.ts.map +1 -0
  122. package/dist/admin/analytics/instantRangeSchema.js +13 -0
  123. package/dist/admin/analytics/instantRangeSchema.js.map +1 -0
  124. package/dist/admin/analytics/useAnalyticsQuery.d.ts +13 -3
  125. package/dist/admin/analytics/useAnalyticsQuery.d.ts.map +1 -1
  126. package/dist/admin/analytics/useAnalyticsQuery.js +60 -21
  127. package/dist/admin/analytics/useAnalyticsQuery.js.map +1 -1
  128. package/dist/admin/analytics/useFilterValues.d.ts +4 -0
  129. package/dist/admin/analytics/useFilterValues.d.ts.map +1 -1
  130. package/dist/admin/analytics/useFilterValues.js +6 -6
  131. package/dist/admin/analytics/useFilterValues.js.map +1 -1
  132. package/dist/admin/useConfirmedAction.d.ts +8 -2
  133. package/dist/admin/useConfirmedAction.d.ts.map +1 -1
  134. package/dist/admin/useConfirmedAction.js +15 -4
  135. package/dist/admin/useConfirmedAction.js.map +1 -1
  136. package/dist/ai/AiChat.d.ts +30 -0
  137. package/dist/ai/AiChat.d.ts.map +1 -0
  138. package/dist/ai/AiChat.js +116 -0
  139. package/dist/ai/AiChat.js.map +1 -0
  140. package/dist/ai/AiChatConfirmCard.d.ts +17 -0
  141. package/dist/ai/AiChatConfirmCard.d.ts.map +1 -0
  142. package/dist/ai/AiChatConfirmCard.js +47 -0
  143. package/dist/ai/AiChatConfirmCard.js.map +1 -0
  144. package/dist/ai/AiChatHistory.d.ts +14 -0
  145. package/dist/ai/AiChatHistory.d.ts.map +1 -0
  146. package/dist/ai/AiChatHistory.js +40 -0
  147. package/dist/ai/AiChatHistory.js.map +1 -0
  148. package/dist/ai/AiChatMessage.d.ts +10 -0
  149. package/dist/ai/AiChatMessage.d.ts.map +1 -0
  150. package/dist/ai/AiChatMessage.js +38 -0
  151. package/dist/ai/AiChatMessage.js.map +1 -0
  152. package/dist/ai/AiFormRegistry.d.ts +37 -0
  153. package/dist/ai/AiFormRegistry.d.ts.map +1 -0
  154. package/dist/ai/AiFormRegistry.js +59 -0
  155. package/dist/ai/AiFormRegistry.js.map +1 -0
  156. package/dist/ai/aiChatMessageFormSchema.d.ts +7 -0
  157. package/dist/ai/aiChatMessageFormSchema.d.ts.map +1 -0
  158. package/dist/ai/aiChatMessageFormSchema.js +13 -0
  159. package/dist/ai/aiChatMessageFormSchema.js.map +1 -0
  160. package/dist/ai/aiContextAtom.d.ts +16 -0
  161. package/dist/ai/aiContextAtom.d.ts.map +1 -0
  162. package/dist/ai/aiContextAtom.js +25 -0
  163. package/dist/ai/aiContextAtom.js.map +1 -0
  164. package/dist/ai/index.d.ts +18 -0
  165. package/dist/ai/index.d.ts.map +1 -0
  166. package/dist/ai/index.js +10 -0
  167. package/dist/ai/useAiChat.d.ts +82 -0
  168. package/dist/ai/useAiChat.d.ts.map +1 -0
  169. package/dist/ai/useAiChat.js +256 -0
  170. package/dist/ai/useAiChat.js.map +1 -0
  171. package/dist/ai/useAiContext.d.ts +33 -0
  172. package/dist/ai/useAiContext.d.ts.map +1 -0
  173. package/dist/ai/useAiContext.js +52 -0
  174. package/dist/ai/useAiContext.js.map +1 -0
  175. package/dist/auth/AuthLogin.d.ts.map +1 -1
  176. package/dist/auth/AuthLogin.js +4 -4
  177. package/dist/auth/AuthLogin.js.map +1 -1
  178. package/dist/auth/AuthRegister.js.map +1 -1
  179. package/dist/core/Breadcrumb.js +1 -1
  180. package/dist/core/Breadcrumb.js.map +1 -1
  181. package/dist/core/Sheet.d.ts +6 -1
  182. package/dist/core/Sheet.d.ts.map +1 -1
  183. package/dist/core/Sheet.js +2 -2
  184. package/dist/core/Sheet.js.map +1 -1
  185. package/dist/core/Sidebar.d.ts +7 -1
  186. package/dist/core/Sidebar.d.ts.map +1 -1
  187. package/dist/core/Sidebar.js +22 -17
  188. package/dist/core/Sidebar.js.map +1 -1
  189. package/dist/core/index.js +2 -2
  190. package/dist/form/AutoForm.js +1 -1
  191. package/dist/form/AutoForm.js.map +1 -1
  192. package/dist/form/Control.d.ts +14 -0
  193. package/dist/form/Control.d.ts.map +1 -1
  194. package/dist/form/Control.js +10 -4
  195. package/dist/form/Control.js.map +1 -1
  196. package/dist/form/ControlArray.js +5 -5
  197. package/dist/form/ControlArray.js.map +1 -1
  198. package/dist/form/ControlDate.d.ts +11 -0
  199. package/dist/form/ControlDate.d.ts.map +1 -1
  200. package/dist/form/ControlDate.js +20 -2
  201. package/dist/form/ControlDate.js.map +1 -1
  202. package/dist/form/ControlDatePopover.d.ts +3 -0
  203. package/dist/form/ControlDatePopover.d.ts.map +1 -1
  204. package/dist/form/ControlDatePopover.js +1 -0
  205. package/dist/form/ControlDatePopover.js.map +1 -1
  206. package/dist/form/ControlMonthPopover.d.ts +25 -0
  207. package/dist/form/ControlMonthPopover.d.ts.map +1 -0
  208. package/dist/form/ControlMonthPopover.js +112 -0
  209. package/dist/form/ControlMonthPopover.js.map +1 -0
  210. package/dist/form/ControlSelect.d.ts +7 -0
  211. package/dist/form/ControlSelect.d.ts.map +1 -1
  212. package/dist/form/ControlSelect.js +39 -2
  213. package/dist/form/ControlSelect.js.map +1 -1
  214. package/dist/form/ControlUpload.d.ts +1 -1
  215. package/dist/form/ControlUpload.js.map +1 -1
  216. package/dist/i18n/fr/uiFr.d.ts.map +1 -1
  217. package/dist/i18n/fr/uiFr.js +31 -10
  218. package/dist/i18n/fr/uiFr.js.map +1 -1
  219. package/dist/organizations/MyOrganizationInvitations.js +2 -2
  220. package/dist/organizations/MyOrganizationInvitations.js.map +1 -1
  221. package/dist/organizations/OrganizationInviteDialog.js +1 -1
  222. package/dist/organizations/OrganizationInviteDialog.js.map +1 -1
  223. package/dist/organizations/OrganizationMembers.js +1 -1
  224. package/dist/organizations/OrganizationMembers.js.map +1 -1
  225. package/dist/organizations/OrganizationPendingInvitations.js +1 -1
  226. package/dist/organizations/OrganizationPendingInvitations.js.map +1 -1
  227. package/dist/organizations/OrganizationRanks.js +3 -3
  228. package/dist/organizations/OrganizationRanks.js.map +1 -1
  229. package/dist/organizations/useInviteOrganizationMember.d.ts +6 -1
  230. package/dist/organizations/useInviteOrganizationMember.d.ts.map +1 -1
  231. package/dist/organizations/useInviteOrganizationMember.js +13 -13
  232. package/dist/organizations/useInviteOrganizationMember.js.map +1 -1
  233. package/dist/organizations/useRevokeOrganizationInvitation.d.ts +7 -1
  234. package/dist/organizations/useRevokeOrganizationInvitation.d.ts.map +1 -1
  235. package/dist/organizations/useRevokeOrganizationInvitation.js +13 -2
  236. package/dist/organizations/useRevokeOrganizationInvitation.js.map +1 -1
  237. package/dist/shell/AppShellNavCollapse.d.ts +4 -0
  238. package/dist/shell/AppShellNavCollapse.d.ts.map +1 -1
  239. package/dist/shell/AppShellNavCollapse.js +1 -0
  240. package/dist/shell/AppShellNavCollapse.js.map +1 -1
  241. package/dist/shell/AppShellSidebarNavItem.d.ts.map +1 -1
  242. package/dist/shell/AppShellSidebarNavItem.js +13 -9
  243. package/dist/shell/AppShellSidebarNavItem.js.map +1 -1
  244. package/dist/shell/AppShellStatefulSidebarTrigger.d.ts.map +1 -1
  245. package/dist/shell/AppShellStatefulSidebarTrigger.js +5 -2
  246. package/dist/shell/AppShellStatefulSidebarTrigger.js.map +1 -1
  247. package/dist/shell/ButtonUser.d.ts +1 -2
  248. package/dist/shell/ButtonUser.d.ts.map +1 -1
  249. package/dist/shell/ButtonUser.js +14 -42
  250. package/dist/shell/ButtonUser.js.map +1 -1
  251. package/dist/shell/ButtonUserContent.d.ts +13 -0
  252. package/dist/shell/ButtonUserContent.d.ts.map +1 -0
  253. package/dist/shell/ButtonUserContent.js +52 -0
  254. package/dist/shell/ButtonUserContent.js.map +1 -0
  255. package/dist/shell/ButtonUserPlaceholder.d.ts +14 -0
  256. package/dist/shell/ButtonUserPlaceholder.d.ts.map +1 -0
  257. package/dist/shell/ButtonUserPlaceholder.js +17 -0
  258. package/dist/shell/ButtonUserPlaceholder.js.map +1 -0
  259. package/dist/styles.css +31 -0
  260. package/dist/table/DataTable.d.ts.map +1 -1
  261. package/dist/table/DataTable.js +3 -2
  262. package/dist/table/DataTable.js.map +1 -1
  263. package/dist/table/DataTableFilterBar.js +2 -2
  264. package/dist/table/DataTableFilterBar.js.map +1 -1
  265. package/dist/table/DataTableToolbar.d.ts +7 -3
  266. package/dist/table/DataTableToolbar.d.ts.map +1 -1
  267. package/dist/table/DataTableToolbar.js +7 -3
  268. package/dist/table/DataTableToolbar.js.map +1 -1
  269. package/dist/table/dataTableBaseProps.d.ts +18 -1
  270. package/dist/table/dataTableBaseProps.d.ts.map +1 -1
  271. package/dist/table/dataTableTypes.d.ts +3 -3
  272. package/dist/table/dataTableTypes.d.ts.map +1 -1
  273. package/dist/table/useDataTableData.d.ts.map +1 -1
  274. package/dist/table/useDataTableData.js +3 -1
  275. package/dist/table/useDataTableData.js.map +1 -1
  276. package/dist/table/useDataTableRefresh.js +2 -2
  277. package/dist/table/useDataTableRefresh.js.map +1 -1
  278. package/dist/table/useDataTableSummary.d.ts.map +1 -1
  279. package/dist/table/useDataTableSummary.js +2 -1
  280. package/dist/table/useDataTableSummary.js.map +1 -1
  281. package/docs/packages-alepha-ui-account.md +29 -0
  282. package/docs/packages-alepha-ui-admin.md +35 -0
  283. package/docs/packages-alepha-ui-ai.md +29 -0
  284. package/docs/packages-alepha-ui-auth.md +23 -0
  285. package/docs/packages-alepha-ui-calendar.md +24 -0
  286. package/docs/packages-alepha-ui-chart.md +23 -0
  287. package/docs/packages-alepha-ui-command.md +24 -0
  288. package/docs/packages-alepha-ui-core.md +40 -0
  289. package/docs/packages-alepha-ui-form.md +29 -0
  290. package/docs/packages-alepha-ui-i18n-fr.md +31 -0
  291. package/docs/packages-alepha-ui-markdown.md +27 -0
  292. package/docs/packages-alepha-ui-organizations.md +20 -0
  293. package/docs/packages-alepha-ui-otp.md +22 -0
  294. package/docs/packages-alepha-ui-overview.md +337 -0
  295. package/docs/packages-alepha-ui-resizable.md +22 -0
  296. package/docs/packages-alepha-ui-settings.md +23 -0
  297. package/docs/packages-alepha-ui-shell.md +41 -0
  298. package/docs/packages-alepha-ui-table.md +37 -0
  299. package/docs/packages-alepha-ui-tree.md +31 -0
  300. package/package.json +18 -8
  301. package/src/account/AccountConnections.tsx +1 -1
  302. package/src/account/AccountDeleteDialog.tsx +25 -31
  303. package/src/account/AccountKeys.tsx +2 -2
  304. package/src/account/AccountMfaDialog.tsx +33 -27
  305. package/src/account/AccountPasswordDialog.tsx +36 -39
  306. package/src/account/AccountProfile.tsx +29 -43
  307. package/src/account/AccountSecurity.tsx +57 -64
  308. package/src/account/AccountSessions.tsx +1 -1
  309. package/src/account/ApiKeyCreateDialog.tsx +12 -20
  310. package/src/account/__tests__/AccountRouter.spec.ts +2 -1
  311. package/src/admin/AdminFiles.tsx +1 -1
  312. package/src/admin/AdminJobs.tsx +1 -1
  313. package/src/admin/AdminKeys.tsx +1 -1
  314. package/src/admin/AdminParameters.tsx +7 -5
  315. package/src/admin/AdminParametersTreeFooterActions.tsx +2 -2
  316. package/src/admin/AdminParametersTreePane.tsx +2 -2
  317. package/src/admin/AdminRouter.tsx +2 -4
  318. package/src/admin/AdminSessions.tsx +1 -1
  319. package/src/admin/AdminUserAvatarControl.tsx +17 -22
  320. package/src/admin/AdminUserDetail.tsx +4 -4
  321. package/src/admin/AdminUsers.tsx +10 -12
  322. package/src/admin/AdminUsersRolesPicker.tsx +11 -4
  323. package/src/admin/__tests__/AdminRouter.spec.ts +3 -2
  324. package/src/admin/analytics/AdvancedSection.tsx +39 -30
  325. package/src/admin/analytics/AnalyticsChart.tsx +7 -1
  326. package/src/admin/analytics/AnalyticsChartHeader.tsx +22 -7
  327. package/src/admin/analytics/AnalyticsChartLine.tsx +15 -2
  328. package/src/admin/analytics/CoarsenedBadge.tsx +38 -0
  329. package/src/admin/analytics/CompareNote.tsx +16 -5
  330. package/src/admin/analytics/FilterEditor.tsx +2 -0
  331. package/src/admin/analytics/GroupByChips.tsx +40 -27
  332. package/src/admin/analytics/MeasureChips.tsx +19 -11
  333. package/src/admin/analytics/QueryPanel.tsx +11 -6
  334. package/src/admin/analytics/RangeControl.tsx +91 -27
  335. package/src/admin/analytics/ResultsPane.tsx +20 -6
  336. package/src/admin/analytics/ResultsTable.tsx +9 -5
  337. package/src/admin/analytics/TotalsCards.tsx +24 -11
  338. package/src/admin/analytics/analyticsModel.spec.ts +167 -36
  339. package/src/admin/analytics/analyticsModel.ts +358 -49
  340. package/src/admin/analytics/analyticsTypes.ts +56 -4
  341. package/src/admin/analytics/chartModel.ts +139 -20
  342. package/src/admin/analytics/instantRangeSchema.ts +9 -0
  343. package/src/admin/analytics/useAnalyticsQuery.ts +98 -35
  344. package/src/admin/analytics/useFilterValues.ts +16 -5
  345. package/src/admin/useConfirmedAction.tsx +24 -10
  346. package/src/ai/AiChat.tsx +151 -0
  347. package/src/ai/AiChatConfirmCard.tsx +64 -0
  348. package/src/ai/AiChatHistory.tsx +60 -0
  349. package/src/ai/AiChatMessage.tsx +57 -0
  350. package/src/ai/AiFormRegistry.ts +78 -0
  351. package/src/ai/__tests__/AiChat.browser.spec.tsx +391 -0
  352. package/src/ai/aiChatMessageFormSchema.ts +8 -0
  353. package/src/ai/aiContextAtom.ts +23 -0
  354. package/src/ai/index.ts +18 -0
  355. package/src/ai/useAiChat.ts +343 -0
  356. package/src/ai/useAiContext.ts +74 -0
  357. package/src/auth/AuthLogin.tsx +10 -9
  358. package/src/auth/AuthRegister.tsx +2 -2
  359. package/src/core/Breadcrumb.tsx +1 -1
  360. package/src/core/Sheet.tsx +9 -2
  361. package/src/core/Sidebar.tsx +45 -22
  362. package/src/form/AutoForm.tsx +1 -1
  363. package/src/form/Control.tsx +27 -2
  364. package/src/form/ControlArray.tsx +5 -5
  365. package/src/form/ControlDate.tsx +37 -2
  366. package/src/form/ControlDatePopover.tsx +4 -1
  367. package/src/form/ControlMonthPopover.tsx +169 -0
  368. package/src/form/ControlSelect.tsx +64 -2
  369. package/src/form/ControlUpload.tsx +1 -1
  370. package/src/form/__tests__/ControlArrayChildChange.browser.spec.tsx +1 -1
  371. package/src/form/__tests__/ControlChoices.browser.spec.tsx +130 -0
  372. package/src/i18n/fr/uiFr.ts +36 -11
  373. package/src/organizations/MyOrganizationInvitations.tsx +2 -2
  374. package/src/organizations/OrganizationInviteDialog.tsx +1 -1
  375. package/src/organizations/OrganizationMembers.tsx +1 -1
  376. package/src/organizations/OrganizationPendingInvitations.tsx +1 -1
  377. package/src/organizations/OrganizationRanks.tsx +3 -3
  378. package/src/organizations/useInviteOrganizationMember.ts +22 -15
  379. package/src/organizations/useRevokeOrganizationInvitation.ts +23 -4
  380. package/src/shell/AppShellNavCollapse.tsx +5 -0
  381. package/src/shell/AppShellSidebarNavItem.tsx +23 -10
  382. package/src/shell/AppShellStatefulSidebarTrigger.tsx +10 -2
  383. package/src/shell/ButtonUser.tsx +14 -79
  384. package/src/shell/ButtonUserContent.tsx +92 -0
  385. package/src/shell/ButtonUserPlaceholder.tsx +25 -0
  386. package/src/shell/__tests__/ActionErrorToaster.browser.spec.tsx +1 -1
  387. package/src/shell/__tests__/ActionErrorToasterHandled.browser.spec.tsx +1 -2
  388. package/src/shell/__tests__/AppShell.pageCache.spec.tsx +67 -0
  389. package/src/shell/__tests__/AppShellDirection.browser.spec.tsx +95 -0
  390. package/src/styles.css +31 -0
  391. package/src/table/DataTable.tsx +3 -1
  392. package/src/table/DataTableFilterBar.tsx +2 -2
  393. package/src/table/DataTableToolbar.tsx +18 -3
  394. package/src/table/__tests__/DataTableFilterDateRange.browser.spec.tsx +1 -1
  395. package/src/table/__tests__/DataTableLeading.browser.spec.tsx +130 -0
  396. package/src/table/__tests__/DataTableQuerySeed.browser.spec.tsx +1 -1
  397. package/src/table/__tests__/DataTableShareFilters.browser.spec.tsx +1 -1
  398. package/src/table/dataTableBaseProps.ts +18 -1
  399. package/src/table/dataTableTypes.ts +3 -3
  400. package/src/table/useDataTableData.ts +2 -0
  401. package/src/table/useDataTableRefresh.ts +3 -3
  402. package/src/table/useDataTableSummary.ts +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AppShellSidebarNavItem.js","names":[],"sources":["../../src/shell/AppShellSidebarNavItem.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { Link } from \"alepha/react/router\";\nimport { ChevronRight, Lock, Minus, Plus } from \"lucide-react\";\nimport { useState } from \"react\";\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuTrigger,\n} from \"../core/DropdownMenu.tsx\";\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from \"../core/HoverCard.tsx\";\nimport {\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n useSidebar,\n} from \"../core/Sidebar.tsx\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../core/Tooltip.tsx\";\nimport {\n hasActiveDescendant,\n isOpenPathPrefix,\n type NavAccordion,\n type NavItem,\n renderNavIcon,\n} from \"./appShellNav.tsx\";\nimport { AppShellNavCollapse } from \"./AppShellNavCollapse.tsx\";\nimport { AppShellNavDropdownItems } from \"./AppShellNavDropdownItems.tsx\";\n\nexport interface AppShellSidebarNavItemProps {\n item: NavItem;\n /**\n * This item's position in `nav`, used only by the accordion. See\n * {@link NavAccordion}.\n */\n path: number[];\n /**\n * Present when `navAccordion` is on, and then it OWNS the open state: the\n * local `useState` below is still declared (hooks cannot be conditional) but\n * nothing reads it.\n */\n accordion?: NavAccordion;\n /**\n * `navAnimate`, threaded down so a nested group animates like its parent.\n */\n animate: boolean;\n /**\n * `navToggleIcon`, threaded down for the same reason.\n */\n toggleIcon: \"caret\" | \"plusMinus\";\n}\n\nexport const AppShellSidebarNavItem = (props: AppShellSidebarNavItemProps) => {\n const { item, path, accordion, animate, toggleIcon } = props;\n const { state, isMobile } = useSidebar();\n const children = item.children;\n const isGroup = !!children && children.length > 0;\n const hasActive = isGroup && hasActiveDescendant(item);\n const [localOpen, setLocalOpen] = useState(item.defaultOpen ?? hasActive);\n // Reveal a collapsed group when navigation makes one of its descendants\n // active — SPA nav, spotlight (⌘K), breadcrumb, or a deep-link that doesn't\n // remount this item (useState's initializer runs only at mount, so without\n // this the group stays stuck closed and the active page is hidden — petition\n // #4). Only OPENS; never auto-collapses, so a manual toggle is preserved.\n //\n // Accordion mode does the same job in `AppShell` instead, from the tree, and\n // skips this: the state lives there, and a child cannot write it mid-render.\n const [wasActive, setWasActive] = useState(hasActive);\n if (!accordion && hasActive !== wasActive) {\n setWasActive(hasActive);\n if (hasActive) setLocalOpen(true);\n }\n\n const open = accordion\n ? isOpenPathPrefix(path, accordion.openPath)\n : localOpen;\n\n // Closing means handing the branch back to this item's PARENT, not clearing\n // it: a nested group that closed itself by emptying the path would collapse\n // every ancestor along with it.\n const toggle = () => {\n if (accordion) {\n accordion.setOpenPath(open ? path.slice(0, -1) : path);\n } else {\n setLocalOpen((v) => !v);\n }\n };\n\n if (!isGroup) {\n // Disabled rows render with a muted, dashed-border treatment plus a\n // Lock affordance on the trailing edge. Clicks are swallowed. When a\n // `tooltip` is provided, the row opens a HoverCard dropdown on hover\n // so the explanation has space to breathe regardless of sidebar\n // state.\n if (item.disabled) {\n // Bypass SidebarMenuButton — it self-wraps in a Tooltip when given\n // a `tooltip` prop, which would swallow the HoverCard pointer\n // events. A plain styled <div> keeps cursor-not-allowed and lets\n // the row act as the HoverCard trigger.\n const row = (\n <div\n aria-disabled=\"true\"\n className=\"border-muted-foreground/40 bg-muted/40 text-muted-foreground flex h-8 w-full items-center gap-2 rounded-md border border-dashed px-2 text-sm\"\n style={{ cursor: \"not-allowed\" }}\n >\n {renderNavIcon(item.icon, \"size-4 shrink-0\")}\n <span className=\"flex-1 truncate text-left\">{item.label}</span>\n <Lock className=\"size-3.5 shrink-0 opacity-70\" />\n </div>\n );\n return (\n <SidebarMenuItem>\n {item.tooltip ? (\n <HoverCard>\n <HoverCardTrigger render={row} />\n <HoverCardContent side=\"right\" align=\"start\" className=\"text-sm\">\n {item.tooltip}\n </HoverCardContent>\n </HoverCard>\n ) : (\n row\n )}\n </SidebarMenuItem>\n );\n }\n\n const link = (\n <SidebarMenuButton\n isActive={item.active}\n tooltip={typeof item.label === \"string\" ? item.label : undefined}\n /*\n `aria-current` beside the styling's `data-active`, so a screen\n reader announces the page the reader is on, and a test can find the\n lit entry by role rather than by a styling hook.\n */\n render={\n <Link\n href={item.href ?? \"#\"}\n aria-current={item.active ? \"page\" : undefined}\n />\n }\n >\n {renderNavIcon(item.icon, \"size-4\")}\n <span>{item.label}</span>\n </SidebarMenuButton>\n );\n\n const row = item.tooltip ? (\n <Tooltip>\n <TooltipTrigger render={link} />\n <TooltipContent side=\"right\">{item.tooltip}</TooltipContent>\n </Tooltip>\n ) : (\n link\n );\n\n return (\n <SidebarMenuItem>\n {row}\n {item.badge != null && item.badge !== false && (\n <SidebarMenuBadge>{item.badge}</SidebarMenuBadge>\n )}\n </SidebarMenuItem>\n );\n }\n\n // Collapsed to icons, the expanded branch below is a dead button: it still\n // flips `open`, but what `open` reveals is a `SidebarMenuSub`, which carries\n // `group-data-[collapsible=icon]:hidden`. The group has no `href` either, so\n // there is no fallback — every child is simply unreachable. A dropdown is the\n // standard answer, and it belongs here rather than in any one app because\n // this hits EVERY `NavItem` with children.\n //\n // Mobile is excluded: it uses the sheet, not icon mode, so the sub renders\n // normally there.\n if (isGroup && state === \"collapsed\" && !isMobile) {\n return (\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n // No `tooltip` here on purpose. `SidebarMenuButton` turns itself\n // into a `TooltipTrigger` when given one, and layering the\n // dropdown trigger on top makes hover and click fight over the\n // same element. The menu names itself with a label instead.\n //\n // `hasActive` joins `item.active` so the trigger still reads as\n // current when a descendant is — collapsed, it is the only clue\n // which group holds the open page.\n <SidebarMenuButton isActive={item.active || hasActive} />\n }\n >\n {renderNavIcon(item.icon, \"size-4\")}\n <span className=\"flex-1 text-left\">{item.label}</span>\n <ChevronRight className=\"size-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent side=\"right\" align=\"start\" className=\"min-w-48\">\n {/*\n The group wrapper is required, not cosmetic: `DropdownMenuLabel`\n is Base UI's `Menu.GroupLabel`, which reads `MenuGroupContext` and\n THROWS outside a `Menu.Group`. Nothing types this — the label\n compiles fine, and the whole app-shell crashes at the first click\n on the trigger, because the throw happens when the menu opens\n rather than when it mounts.\n */}\n <DropdownMenuGroup>\n <DropdownMenuLabel>{item.label}</DropdownMenuLabel>\n <AppShellNavDropdownItems items={children} />\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n );\n }\n\n return (\n <SidebarMenuItem>\n <SidebarMenuButton\n onClick={toggle}\n isActive={item.active}\n tooltip={typeof item.label === \"string\" ? item.label : undefined}\n >\n {renderNavIcon(item.icon, \"size-4\")}\n <span className=\"flex-1 text-left\">{item.label}</span>\n {/*\n Plus and minus are SWAPPED, never rotated: a plus turned 45° is a\n close button, which is a different promise. The caret is the one\n that turns, and it stays the default because it is what every app\n using this shell already had.\n */}\n {toggleIcon === \"plusMinus\" ? (\n open ? (\n <Minus className=\"size-4\" />\n ) : (\n <Plus className=\"size-4\" />\n )\n ) : (\n <ChevronRight\n className={`size-4 transition-transform ${open ? \"rotate-90\" : \"\"}`}\n />\n )}\n </SidebarMenuButton>\n <AppShellNavCollapse open={open} animate={animate}>\n <SidebarMenuSub>\n {children.map((child, ci) => (\n <SidebarMenuSubItem key={child.href ?? ci}>\n {child.children && child.children.length > 0 ? (\n <AppShellSidebarNavItem\n item={child}\n path={[...path, ci]}\n accordion={accordion}\n animate={animate}\n toggleIcon={toggleIcon}\n />\n ) : (\n <SidebarMenuSubButton\n isActive={child.active}\n render={\n <Link\n href={child.href ?? \"#\"}\n aria-current={child.active ? \"page\" : undefined}\n />\n }\n >\n {renderNavIcon(child.icon, \"size-4\")}\n <span>{child.label}</span>\n </SidebarMenuSubButton>\n )}\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n </AppShellNavCollapse>\n </SidebarMenuItem>\n );\n};\n"],"mappings":"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"}
1
+ {"version":3,"file":"AppShellSidebarNavItem.js","names":[],"sources":["../../src/shell/AppShellSidebarNavItem.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { Link } from \"alepha/react/router\";\nimport { ChevronRight, Lock, Minus, Plus } from \"lucide-react\";\nimport { useId, useState } from \"react\";\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuTrigger,\n} from \"../core/DropdownMenu.tsx\";\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from \"../core/HoverCard.tsx\";\nimport {\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n useSidebar,\n} from \"../core/Sidebar.tsx\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../core/Tooltip.tsx\";\nimport {\n hasActiveDescendant,\n isOpenPathPrefix,\n type NavAccordion,\n type NavItem,\n renderNavIcon,\n} from \"./appShellNav.tsx\";\nimport { AppShellNavCollapse } from \"./AppShellNavCollapse.tsx\";\nimport { AppShellNavDropdownItems } from \"./AppShellNavDropdownItems.tsx\";\n\nexport interface AppShellSidebarNavItemProps {\n item: NavItem;\n /**\n * This item's position in `nav`, used only by the accordion. See\n * {@link NavAccordion}.\n */\n path: number[];\n /**\n * Present when `navAccordion` is on, and then it OWNS the open state: the\n * local `useState` below is still declared (hooks cannot be conditional) but\n * nothing reads it.\n */\n accordion?: NavAccordion;\n /**\n * `navAnimate`, threaded down so a nested group animates like its parent.\n */\n animate: boolean;\n /**\n * `navToggleIcon`, threaded down for the same reason.\n */\n toggleIcon: \"caret\" | \"plusMinus\";\n}\n\nexport const AppShellSidebarNavItem = (props: AppShellSidebarNavItemProps) => {\n const { item, path, accordion, animate, toggleIcon } = props;\n const { state, isMobile } = useSidebar();\n const collapseId = useId();\n const children = item.children;\n const isGroup = !!children && children.length > 0;\n const hasActive = isGroup && hasActiveDescendant(item);\n const [localOpen, setLocalOpen] = useState(item.defaultOpen ?? hasActive);\n // Reveal a collapsed group when navigation makes one of its descendants\n // active — SPA nav, spotlight (⌘K), breadcrumb, or a deep-link that doesn't\n // remount this item (useState's initializer runs only at mount, so without\n // this the group stays stuck closed and the active page is hidden — petition\n // #4). Only OPENS; never auto-collapses, so a manual toggle is preserved.\n //\n // Accordion mode does the same job in `AppShell` instead, from the tree, and\n // skips this: the state lives there, and a child cannot write it mid-render.\n const [wasActive, setWasActive] = useState(hasActive);\n if (!accordion && hasActive !== wasActive) {\n setWasActive(hasActive);\n if (hasActive) setLocalOpen(true);\n }\n\n const open = accordion\n ? isOpenPathPrefix(path, accordion.openPath)\n : localOpen;\n\n // Closing means handing the branch back to this item's PARENT, not clearing\n // it: a nested group that closed itself by emptying the path would collapse\n // every ancestor along with it.\n const toggle = () => {\n if (accordion) {\n accordion.setOpenPath(open ? path.slice(0, -1) : path);\n } else {\n setLocalOpen((v) => !v);\n }\n };\n\n if (!isGroup) {\n // Disabled rows render with a muted, dashed-border treatment plus a\n // Lock affordance on the trailing edge. Clicks are swallowed. When a\n // `tooltip` is provided, the row opens a HoverCard dropdown on hover\n // so the explanation has space to breathe regardless of sidebar\n // state.\n if (item.disabled) {\n // Bypass SidebarMenuButton — it self-wraps in a Tooltip when given\n // a `tooltip` prop, which would swallow the HoverCard pointer\n // events. A plain styled <div> keeps cursor-not-allowed and lets\n // the row act as the HoverCard trigger.\n const row = (\n <div\n aria-disabled=\"true\"\n className=\"border-muted-foreground/40 bg-muted/40 text-muted-foreground flex h-8 w-full items-center gap-2 rounded-md border border-dashed px-2 text-sm\"\n style={{ cursor: \"not-allowed\" }}\n >\n {renderNavIcon(item.icon, \"size-4 shrink-0\")}\n <span className=\"flex-1 truncate text-start\">{item.label}</span>\n <Lock className=\"size-3.5 shrink-0 opacity-70\" />\n </div>\n );\n return (\n <SidebarMenuItem>\n {item.tooltip ? (\n <HoverCard>\n <HoverCardTrigger render={row} />\n <HoverCardContent\n side=\"inline-end\"\n align=\"start\"\n className=\"text-sm\"\n >\n {item.tooltip}\n </HoverCardContent>\n </HoverCard>\n ) : (\n row\n )}\n </SidebarMenuItem>\n );\n }\n\n const link = (\n <SidebarMenuButton\n isActive={item.active}\n tooltip={typeof item.label === \"string\" ? item.label : undefined}\n /*\n `aria-current` beside the styling's `data-active`, so a screen\n reader announces the page the reader is on, and a test can find the\n lit entry by role rather than by a styling hook.\n */\n render={\n <Link\n href={item.href ?? \"#\"}\n aria-current={item.active ? \"page\" : undefined}\n />\n }\n >\n {renderNavIcon(item.icon, \"size-4\")}\n <span>{item.label}</span>\n </SidebarMenuButton>\n );\n\n const row = item.tooltip ? (\n <Tooltip>\n <TooltipTrigger render={link} />\n <TooltipContent side=\"inline-end\">{item.tooltip}</TooltipContent>\n </Tooltip>\n ) : (\n link\n );\n\n return (\n <SidebarMenuItem>\n {row}\n {item.badge != null && item.badge !== false && (\n <SidebarMenuBadge>{item.badge}</SidebarMenuBadge>\n )}\n </SidebarMenuItem>\n );\n }\n\n // Collapsed to icons, the expanded branch below is a dead button: it still\n // flips `open`, but what `open` reveals is a `SidebarMenuSub`, which carries\n // `group-data-[collapsible=icon]:hidden`. The group has no `href` either, so\n // there is no fallback — every child is simply unreachable. A dropdown is the\n // standard answer, and it belongs here rather than in any one app because\n // this hits EVERY `NavItem` with children.\n //\n // Mobile is excluded: it uses the sheet, not icon mode, so the sub renders\n // normally there.\n if (isGroup && state === \"collapsed\" && !isMobile) {\n return (\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n // No `tooltip` here on purpose. `SidebarMenuButton` turns itself\n // into a `TooltipTrigger` when given one, and layering the\n // dropdown trigger on top makes hover and click fight over the\n // same element. The menu names itself with a label instead.\n //\n // `hasActive` joins `item.active` so the trigger still reads as\n // current when a descendant is — collapsed, it is the only clue\n // which group holds the open page.\n <SidebarMenuButton isActive={item.active || hasActive} />\n }\n >\n {renderNavIcon(item.icon, \"size-4\")}\n <span className=\"flex-1 text-start\">{item.label}</span>\n <ChevronRight className=\"size-4 rtl:-scale-x-100\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent\n side=\"inline-end\"\n align=\"start\"\n className=\"min-w-48\"\n >\n {/*\n The group wrapper is required, not cosmetic: `DropdownMenuLabel`\n is Base UI's `Menu.GroupLabel`, which reads `MenuGroupContext` and\n THROWS outside a `Menu.Group`. Nothing types this — the label\n compiles fine, and the whole app-shell crashes at the first click\n on the trigger, because the throw happens when the menu opens\n rather than when it mounts.\n */}\n <DropdownMenuGroup>\n <DropdownMenuLabel>{item.label}</DropdownMenuLabel>\n <AppShellNavDropdownItems items={children} />\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n );\n }\n\n return (\n <SidebarMenuItem>\n <SidebarMenuButton\n onClick={toggle}\n // The group is a disclosure: its state and what it opens, for\n // assistive technology (and a test finding the open group by role).\n aria-expanded={open}\n aria-controls={collapseId}\n isActive={item.active}\n tooltip={typeof item.label === \"string\" ? item.label : undefined}\n >\n {renderNavIcon(item.icon, \"size-4\")}\n <span className=\"flex-1 text-start\">{item.label}</span>\n {/*\n Plus and minus are SWAPPED, never rotated: a plus turned 45° is a\n close button, which is a different promise. The caret is the one\n that turns, and it stays the default because it is what every app\n using this shell already had.\n */}\n {toggleIcon === \"plusMinus\" ? (\n open ? (\n <Minus className=\"size-4\" />\n ) : (\n <Plus className=\"size-4\" />\n )\n ) : (\n <ChevronRight\n className={`size-4 transition-transform rtl:-scale-x-100 ${open ? \"rotate-90\" : \"\"}`}\n />\n )}\n </SidebarMenuButton>\n <AppShellNavCollapse id={collapseId} open={open} animate={animate}>\n <SidebarMenuSub>\n {children.map((child, ci) => (\n <SidebarMenuSubItem key={child.href ?? ci}>\n {child.children && child.children.length > 0 ? (\n <AppShellSidebarNavItem\n item={child}\n path={[...path, ci]}\n accordion={accordion}\n animate={animate}\n toggleIcon={toggleIcon}\n />\n ) : (\n <SidebarMenuSubButton\n isActive={child.active}\n render={\n <Link\n href={child.href ?? \"#\"}\n aria-current={child.active ? \"page\" : undefined}\n />\n }\n >\n {renderNavIcon(child.icon, \"size-4\")}\n <span>{child.label}</span>\n </SidebarMenuSubButton>\n )}\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n </AppShellNavCollapse>\n </SidebarMenuItem>\n );\n};\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"AppShellStatefulSidebarTrigger.d.ts","sourceRoot":"","sources":["../../src/shell/AppShellStatefulSidebarTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,eAAO,MAAM,8BAA8B,yBAe1C,CAAC"}
1
+ {"version":3,"file":"AppShellStatefulSidebarTrigger.d.ts","sourceRoot":"","sources":["../../src/shell/AppShellStatefulSidebarTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,eAAO,MAAM,8BAA8B,yBAsB1C,CAAC"}
@@ -1,19 +1,22 @@
1
1
  import { Button } from "../core/Button.js";
2
2
  import { useSidebar } from "../core/Sidebar.js";
3
+ import { useI18n } from "alepha/react/i18n";
3
4
  import { PanelLeftClose, PanelLeftOpen } from "lucide-react";
4
5
  import "react";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  //#region src/shell/AppShellStatefulSidebarTrigger.tsx
7
8
  const AppShellStatefulSidebarTrigger = () => {
8
9
  const { toggleSidebar, isMobile, openMobile, state } = useSidebar();
10
+ const { tr } = useI18n();
9
11
  const open = isMobile ? openMobile : state === "expanded";
12
+ const Icon = open ? PanelLeftClose : PanelLeftOpen;
10
13
  return /* @__PURE__ */ jsx(Button, {
11
14
  variant: "minimal",
12
15
  size: "icon",
13
16
  onClick: toggleSidebar,
14
- "aria-label": open ? "Collapse sidebar" : "Expand sidebar",
17
+ "aria-label": open ? tr("nav.sidebar.collapse", { default: "Collapse sidebar" }) : tr("nav.sidebar.expand", { default: "Expand sidebar" }),
15
18
  className: "size-8",
16
- children: /* @__PURE__ */ jsx(open ? PanelLeftClose : PanelLeftOpen, { className: "size-4" })
19
+ children: /* @__PURE__ */ jsx(Icon, { className: "size-4 rtl:-scale-x-100" })
17
20
  });
18
21
  };
19
22
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"AppShellStatefulSidebarTrigger.js","names":[],"sources":["../../src/shell/AppShellStatefulSidebarTrigger.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { PanelLeftClose, PanelLeftOpen } from \"lucide-react\";\n\nimport { Button } from \"../core/Button.tsx\";\nimport { useSidebar } from \"../core/Sidebar.tsx\";\n\nexport const AppShellStatefulSidebarTrigger = () => {\n const { toggleSidebar, isMobile, openMobile, state } = useSidebar();\n const open = isMobile ? openMobile : state === \"expanded\";\n const Icon = open ? PanelLeftClose : PanelLeftOpen;\n return (\n <Button\n variant=\"minimal\"\n size=\"icon\"\n onClick={toggleSidebar}\n aria-label={open ? \"Collapse sidebar\" : \"Expand sidebar\"}\n className=\"size-8\"\n >\n <Icon className=\"size-4\" />\n </Button>\n );\n};\n"],"mappings":";;;;;;AASA,MAAa,uCAAuC;CAClD,MAAM,EAAE,eAAe,UAAU,YAAY,UAAU,WAAW;CAClE,MAAM,OAAO,WAAW,aAAa,UAAU;CAE/C,OACE,oBAAC,QAAD;EACE,SAAQ;EACR,MAAK;EACL,SAAS;EACT,cAAY,OAAO,qBAAqB;EACxC,WAAU;EAEV,UAAA,oBATS,OAAO,iBAAiB,eASjC,EAAM,WAAU,SAAU,CAAA;CACpB,CAAA;AAEZ"}
1
+ {"version":3,"file":"AppShellStatefulSidebarTrigger.js","names":[],"sources":["../../src/shell/AppShellStatefulSidebarTrigger.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { useI18n } from \"alepha/react/i18n\";\nimport { PanelLeftClose, PanelLeftOpen } from \"lucide-react\";\n\nimport { Button } from \"../core/Button.tsx\";\nimport { useSidebar } from \"../core/Sidebar.tsx\";\n\nexport const AppShellStatefulSidebarTrigger = () => {\n const { toggleSidebar, isMobile, openMobile, state } = useSidebar();\n const { tr } = useI18n();\n const open = isMobile ? openMobile : state === \"expanded\";\n const Icon = open ? PanelLeftClose : PanelLeftOpen;\n return (\n <Button\n variant=\"minimal\"\n size=\"icon\"\n onClick={toggleSidebar}\n aria-label={\n open\n ? tr(\"nav.sidebar.collapse\", { default: \"Collapse sidebar\" })\n : tr(\"nav.sidebar.expand\", { default: \"Expand sidebar\" })\n }\n className=\"size-8\"\n >\n {/* The panel glyph points at the sidebar's edge: mirrored when the\n page reads right to left. */}\n <Icon className=\"size-4 rtl:-scale-x-100\" />\n </Button>\n );\n};\n"],"mappings":";;;;;;;AAUA,MAAa,uCAAuC;CAClD,MAAM,EAAE,eAAe,UAAU,YAAY,UAAU,WAAW;CAClE,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,OAAO,WAAW,aAAa,UAAU;CAC/C,MAAM,OAAO,OAAO,iBAAiB;CACrC,OACE,oBAAC,QAAD;EACE,SAAQ;EACR,MAAK;EACL,SAAS;EACT,cACE,OACI,GAAG,wBAAwB,EAAE,SAAS,mBAAmB,CAAC,IAC1D,GAAG,sBAAsB,EAAE,SAAS,iBAAiB,CAAC;EAE5D,WAAU;EAIV,UAAA,oBAAC,MAAD,EAAM,WAAU,0BAA2B,CAAA;CACrC,CAAA;AAEZ"}
@@ -1,4 +1,3 @@
1
- import * as React from "react";
2
1
  import type { ReactNode } from "react";
3
2
  import { ButtonUserAccountMenuItem } from "./ButtonUserAccountMenuItem.tsx";
4
3
  import { ButtonUserAdminMenuItem } from "./ButtonUserAdminMenuItem.tsx";
@@ -70,7 +69,7 @@ export interface ButtonUserProps {
70
69
  */
71
70
  avatar?: ReactNode;
72
71
  }
73
- export declare function ButtonUser(props: ButtonUserProps): React.JSX.Element;
72
+ export declare function ButtonUser(props: ButtonUserProps): import("react").JSX.Element;
74
73
  export declare namespace ButtonUser {
75
74
  export { ButtonUserEmail as Email };
76
75
  export { ButtonUserAdminMenuItem as AdminMenuItem };
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonUser.d.ts","sourceRoot":"","sources":["../../src/shell/ButtonUser.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;mCAoB0B,KAAK,EAAE,eAAe;;aAiE9B,eAAe;aACP,uBAAuB;aACrB,yBAAyB;aAC1B,wBAAwB"}
1
+ {"version":3,"file":"ButtonUser.d.ts","sourceRoot":"","sources":["../../src/shell/ButtonUser.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAG1E,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;mCA0B0B,KAAK,EAAE,eAAe;;aAM9B,eAAe;aACP,uBAAuB;aACrB,yBAAyB;aAC1B,wBAAwB"}
@@ -1,16 +1,11 @@
1
- import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "../core/DropdownMenu.js";
2
- import { UserAvatar } from "../core/UserAvatar.js";
3
- import { Button } from "../core/Button.js";
4
- import { Tooltip, TooltipContent, TooltipTrigger } from "../core/Tooltip.js";
5
1
  import { ButtonUserAccountMenuItem } from "./ButtonUserAccountMenuItem.js";
6
2
  import { ButtonUserAdminMenuItem } from "./ButtonUserAdminMenuItem.js";
7
3
  import { ButtonUserEmail } from "./ButtonUserEmail.js";
8
4
  import { ButtonUserLogoutMenuItem } from "./ButtonUserLogoutMenuItem.js";
9
- import { ButtonUserDefaultMenu } from "./ButtonUserDefaultMenu.js";
10
- import { LogIn, User } from "lucide-react";
11
- import "react";
12
- import { jsx, jsxs } from "react/jsx-runtime";
13
- import { useAuth } from "alepha/react/auth";
5
+ import { ButtonUserContent } from "./ButtonUserContent.js";
6
+ import { ButtonUserPlaceholder } from "./ButtonUserPlaceholder.js";
7
+ import { jsx } from "react/jsx-runtime";
8
+ import { Personal } from "alepha/react";
14
9
  //#region src/shell/ButtonUser.tsx
15
10
  /**
16
11
  * Account button: shows a sign-in icon when logged out, a user icon with a
@@ -29,40 +24,17 @@ import { useAuth } from "alepha/react/auth";
29
24
  * <DropdownMenuSeparator />
30
25
  * <ButtonUser.LogoutMenuItem />
31
26
  * </ButtonUser>
27
+ *
28
+ * The button reads the visitor, so it is wrapped in `<Personal>`: a page
29
+ * showing it is still cached for everyone (#E78), with a placeholder of the
30
+ * same size in the shared HTML, replaced by the real button right after
31
+ * hydration from the visitor's own state. On a page that is personal anyway,
32
+ * the server renders the real button.
32
33
  */
33
- const ButtonUser = (props) => {
34
- const auth = useAuth();
35
- if (!auth.user) {
36
- const signInLabel = props.signInLabel ?? "Sign in";
37
- return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
38
- render: /* @__PURE__ */ jsx(Button, {
39
- variant: props.variant ?? "minimal",
40
- size: "icon",
41
- "aria-label": signInLabel,
42
- disabled: !props.onSignIn,
43
- onClick: props.onSignIn
44
- }),
45
- children: /* @__PURE__ */ jsx(LogIn, { className: "size-4" })
46
- }), /* @__PURE__ */ jsx(TooltipContent, { children: signInLabel })] });
47
- }
48
- const menuLabel = props.menuLabel ?? "Account menu";
49
- const face = props.avatar ?? (auth.user.picture ? /* @__PURE__ */ jsx(UserAvatar, {
50
- fileId: auth.user.picture,
51
- className: "size-7"
52
- }) : /* @__PURE__ */ jsx(User, { className: "size-4" }));
53
- return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
54
- render: /* @__PURE__ */ jsx(DropdownMenuTrigger, { render: /* @__PURE__ */ jsx(Button, {
55
- variant: props.variant ?? "minimal",
56
- size: "icon",
57
- "aria-label": menuLabel
58
- }) }),
59
- children: face
60
- }), /* @__PURE__ */ jsx(TooltipContent, { children: menuLabel })] }), /* @__PURE__ */ jsx(DropdownMenuContent, {
61
- align: "end",
62
- className: "w-56",
63
- children: props.children ?? /* @__PURE__ */ jsx(ButtonUserDefaultMenu, { onAdminClick: props.onAdminClick })
64
- })] });
65
- };
34
+ const ButtonUser = (props) => /* @__PURE__ */ jsx(Personal, {
35
+ fallback: /* @__PURE__ */ jsx(ButtonUserPlaceholder, { variant: props.variant }),
36
+ children: /* @__PURE__ */ jsx(ButtonUserContent, { ...props })
37
+ });
66
38
  ButtonUser.Email = ButtonUserEmail;
67
39
  ButtonUser.AdminMenuItem = ButtonUserAdminMenuItem;
68
40
  ButtonUser.AccountMenuItem = ButtonUserAccountMenuItem;
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonUser.js","names":[],"sources":["../../src/shell/ButtonUser.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { useAuth } from \"alepha/react/auth\";\nimport { LogIn, User } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\n\nimport { Button } from \"../core/Button.tsx\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuTrigger,\n} from \"../core/DropdownMenu.tsx\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../core/Tooltip.tsx\";\nimport { UserAvatar } from \"../core/UserAvatar.tsx\";\nimport { ButtonUserAccountMenuItem } from \"./ButtonUserAccountMenuItem.tsx\";\nimport { ButtonUserAdminMenuItem } from \"./ButtonUserAdminMenuItem.tsx\";\nimport { ButtonUserDefaultMenu } from \"./ButtonUserDefaultMenu.tsx\";\nimport { ButtonUserEmail } from \"./ButtonUserEmail.tsx\";\nimport { ButtonUserLogoutMenuItem } from \"./ButtonUserLogoutMenuItem.tsx\";\n\nexport interface ButtonUserProps {\n /**\n * Custom menu items rendered between the email header and the logout\n * footer. When omitted, a default menu is rendered: email + account + admin\n * (when permitted) + logout. When provided, the consumer is responsible for the\n * full layout — use `ButtonUser.Email`, `ButtonUser.AdminMenuItem`,\n * `ButtonUser.LogoutMenuItem` as building blocks.\n */\n children?: ReactNode;\n /**\n * Called when the user clicks the sign-in icon (logged-out state). When\n * absent, the icon button is disabled.\n */\n onSignIn?: () => void;\n /**\n * Called when the user clicks the default \"Admin Panel\" menu item. Has no\n * effect when `children` are provided. When absent, the admin item is\n * hidden even if the user has the permission.\n */\n onAdminClick?: () => void;\n /**\n * Aria-label and tooltip text for the logged-out (sign-in) state.\n * Defaults to `\"Sign in\"`.\n */\n signInLabel?: string;\n /**\n * Aria-label and tooltip text for the logged-in (account menu) state.\n * Defaults to `\"Account menu\"`.\n */\n menuLabel?: string;\n /**\n * Visual variant. Defaults to `\"minimal\"`. Pass `\"outlined\"` for a\n * bordered toolbar look.\n */\n variant?: \"minimal\" | \"outlined\";\n\n /**\n * Overrides what the signed-in button shows. Rarely needed: by default the\n * button already draws the viewer's own avatar (feedback #P2138, #Q2229).\n *\n * **The default.** When `useAuth().user.picture` is set, the button draws\n * {@link UserAvatar} at `size-7` inside the `size-9` icon button, so the\n * face fills the control the way the `size-4` glyph it replaces does not.\n * A viewer with NO picture keeps the bare `User` glyph rather than a glyph\n * in a filled circle: beside the ghost icons of `AppActions`, a filled\n * circle reads as a different kind of control. A picture that fails to\n * load lands on `UserAvatar`'s own fallback.\n *\n * **Which file route, and why.** `user.picture` is a file id in the\n * `avatars` bucket, and both routes that serve it belong to\n * `alepha/api/files`, not to an application, so the kit can build the URL\n * itself. It uses the AUTHENTICATED `/api/files/:id`: the default\n * `FileAccessProvider` lets the uploader and an admin read there with no\n * opt-in, while the anonymous `/api/public/files/:id` refuses everything\n * until the application opens the bucket in `assertPublic`, so a\n * `public` default would show the glyph in every application that did\n * not. The cost is edge caching, and for the viewer's OWN avatar it is\n * close to nothing: the response is `private, max-age=1y, immutable`, so\n * the browser keeps it across pages, and an edge cache would only have\n * shared it with viewers who never ask for it. One case still falls back\n * to the glyph under the default provider: an avatar an ADMIN set, whose\n * uploader is the admin rather than the viewer.\n *\n * Only reached when signed in - the signed-out branch returns above.\n */\n avatar?: ReactNode;\n}\n\n/**\n * Account button: shows a sign-in icon when logged out, a user icon with a\n * dropdown menu when logged in. Reads auth state via `useAuth()`.\n *\n * @example\n * // Default menu\n * <ButtonUser onSignIn={() => router.push(\"login\")} onAdminClick={() => router.push(\"admin\")} />\n *\n * @example\n * // Custom menu\n * <ButtonUser onSignIn={() => router.push(\"login\")}>\n * <ButtonUser.Email />\n * <ButtonUser.AdminMenuItem onClick={() => router.push(\"admin\")} />\n * <DropdownMenuItem onClick={() => router.push(\"me\")}>Profile</DropdownMenuItem>\n * <DropdownMenuSeparator />\n * <ButtonUser.LogoutMenuItem />\n * </ButtonUser>\n */\nexport const ButtonUser = (props: ButtonUserProps) => {\n const auth = useAuth();\n\n if (!auth.user) {\n const signInLabel = props.signInLabel ?? \"Sign in\";\n return (\n <Tooltip>\n <TooltipTrigger\n render={\n <Button\n variant={props.variant ?? \"minimal\"}\n size=\"icon\"\n aria-label={signInLabel}\n disabled={!props.onSignIn}\n onClick={props.onSignIn}\n />\n }\n >\n <LogIn className=\"size-4\" />\n </TooltipTrigger>\n <TooltipContent>{signInLabel}</TooltipContent>\n </Tooltip>\n );\n }\n\n const menuLabel = props.menuLabel ?? \"Account menu\";\n const face =\n props.avatar ??\n (auth.user.picture ? (\n <UserAvatar fileId={auth.user.picture} className=\"size-7\" />\n ) : (\n <User className=\"size-4\" />\n ));\n return (\n <DropdownMenu>\n <Tooltip>\n <TooltipTrigger\n render={\n <DropdownMenuTrigger\n render={\n <Button\n variant={props.variant ?? \"minimal\"}\n size=\"icon\"\n aria-label={menuLabel}\n />\n }\n />\n }\n >\n {/* The tooltip and `aria-label` are untouched by the avatar: a\n face is not a label, and \"Account menu\" is still the accessible\n name of the button. */}\n {face}\n </TooltipTrigger>\n <TooltipContent>{menuLabel}</TooltipContent>\n </Tooltip>\n <DropdownMenuContent align=\"end\" className=\"w-56\">\n {props.children ?? (\n <ButtonUserDefaultMenu onAdminClick={props.onAdminClick} />\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n\nButtonUser.Email = ButtonUserEmail;\nButtonUser.AdminMenuItem = ButtonUserAdminMenuItem;\nButtonUser.AccountMenuItem = ButtonUserAccountMenuItem;\nButtonUser.LogoutMenuItem = ButtonUserLogoutMenuItem;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GA,MAAa,cAAc,UAA2B;CACpD,MAAM,OAAO,QAAQ;CAErB,IAAI,CAAC,KAAK,MAAM;EACd,MAAM,cAAc,MAAM,eAAe;EACzC,OACE,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;GACE,QACE,oBAAC,QAAD;IACE,SAAS,MAAM,WAAW;IAC1B,MAAK;IACL,cAAY;IACZ,UAAU,CAAC,MAAM;IACjB,SAAS,MAAM;GAChB,CAAA;GAGH,UAAA,oBAAC,OAAD,EAAO,WAAU,SAAU,CAAA;EACb,CAAA,GAChB,oBAAC,gBAAD,EAAA,UAAiB,YAA4B,CAAA,CACtC,EAAA,CAAA;CAEb;CAEA,MAAM,YAAY,MAAM,aAAa;CACrC,MAAM,OACJ,MAAM,WACL,KAAK,KAAK,UACT,oBAAC,YAAD;EAAY,QAAQ,KAAK,KAAK;EAAS,WAAU;CAAU,CAAA,IAE3D,oBAAC,MAAD,EAAM,WAAU,SAAU,CAAA;CAE9B,OACE,qBAAC,cAAD,EAAA,UAAA,CACE,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;EACE,QACE,oBAAC,qBAAD,EACE,QACE,oBAAC,QAAD;GACE,SAAS,MAAM,WAAW;GAC1B,MAAK;GACL,cAAY;EACb,CAAA,EAEJ,CAAA;EAMF,UAAA;CACa,CAAA,GAChB,oBAAC,gBAAD,EAAA,UAAiB,UAA0B,CAAA,CACpC,EAAA,CAAA,GACT,oBAAC,qBAAD;EAAqB,OAAM;EAAM,WAAU;EACxC,UAAA,MAAM,YACL,oBAAC,uBAAD,EAAuB,cAAc,MAAM,aAAe,CAAA;CAEzC,CAAA,CACT,EAAA,CAAA;AAElB;AAEA,WAAW,QAAQ;AACnB,WAAW,gBAAgB;AAC3B,WAAW,kBAAkB;AAC7B,WAAW,iBAAiB"}
1
+ {"version":3,"file":"ButtonUser.js","names":[],"sources":["../../src/shell/ButtonUser.tsx"],"sourcesContent":["import { Personal } from \"alepha/react\";\nimport type { ReactNode } from \"react\";\n\nimport { ButtonUserAccountMenuItem } from \"./ButtonUserAccountMenuItem.tsx\";\nimport { ButtonUserAdminMenuItem } from \"./ButtonUserAdminMenuItem.tsx\";\nimport { ButtonUserContent } from \"./ButtonUserContent.tsx\";\nimport { ButtonUserEmail } from \"./ButtonUserEmail.tsx\";\nimport { ButtonUserLogoutMenuItem } from \"./ButtonUserLogoutMenuItem.tsx\";\nimport { ButtonUserPlaceholder } from \"./ButtonUserPlaceholder.tsx\";\n\nexport interface ButtonUserProps {\n /**\n * Custom menu items rendered between the email header and the logout\n * footer. When omitted, a default menu is rendered: email + account + admin\n * (when permitted) + logout. When provided, the consumer is responsible for the\n * full layout — use `ButtonUser.Email`, `ButtonUser.AdminMenuItem`,\n * `ButtonUser.LogoutMenuItem` as building blocks.\n */\n children?: ReactNode;\n /**\n * Called when the user clicks the sign-in icon (logged-out state). When\n * absent, the icon button is disabled.\n */\n onSignIn?: () => void;\n /**\n * Called when the user clicks the default \"Admin Panel\" menu item. Has no\n * effect when `children` are provided. When absent, the admin item is\n * hidden even if the user has the permission.\n */\n onAdminClick?: () => void;\n /**\n * Aria-label and tooltip text for the logged-out (sign-in) state.\n * Defaults to `\"Sign in\"`.\n */\n signInLabel?: string;\n /**\n * Aria-label and tooltip text for the logged-in (account menu) state.\n * Defaults to `\"Account menu\"`.\n */\n menuLabel?: string;\n /**\n * Visual variant. Defaults to `\"minimal\"`. Pass `\"outlined\"` for a\n * bordered toolbar look.\n */\n variant?: \"minimal\" | \"outlined\";\n\n /**\n * Overrides what the signed-in button shows. Rarely needed: by default the\n * button already draws the viewer's own avatar (feedback #P2138, #Q2229).\n *\n * **The default.** When `useAuth().user.picture` is set, the button draws\n * {@link UserAvatar} at `size-7` inside the `size-9` icon button, so the\n * face fills the control the way the `size-4` glyph it replaces does not.\n * A viewer with NO picture keeps the bare `User` glyph rather than a glyph\n * in a filled circle: beside the ghost icons of `AppActions`, a filled\n * circle reads as a different kind of control. A picture that fails to\n * load lands on `UserAvatar`'s own fallback.\n *\n * **Which file route, and why.** `user.picture` is a file id in the\n * `avatars` bucket, and both routes that serve it belong to\n * `alepha/api/files`, not to an application, so the kit can build the URL\n * itself. It uses the AUTHENTICATED `/api/files/:id`: the default\n * `FileAccessProvider` lets the uploader and an admin read there with no\n * opt-in, while the anonymous `/api/public/files/:id` refuses everything\n * until the application opens the bucket in `assertPublic`, so a\n * `public` default would show the glyph in every application that did\n * not. The cost is edge caching, and for the viewer's OWN avatar it is\n * close to nothing: the response is `private, max-age=1y, immutable`, so\n * the browser keeps it across pages, and an edge cache would only have\n * shared it with viewers who never ask for it. One case still falls back\n * to the glyph under the default provider: an avatar an ADMIN set, whose\n * uploader is the admin rather than the viewer.\n *\n * Only reached when signed in - the signed-out branch returns above.\n */\n avatar?: ReactNode;\n}\n\n/**\n * Account button: shows a sign-in icon when logged out, a user icon with a\n * dropdown menu when logged in. Reads auth state via `useAuth()`.\n *\n * @example\n * // Default menu\n * <ButtonUser onSignIn={() => router.push(\"login\")} onAdminClick={() => router.push(\"admin\")} />\n *\n * @example\n * // Custom menu\n * <ButtonUser onSignIn={() => router.push(\"login\")}>\n * <ButtonUser.Email />\n * <ButtonUser.AdminMenuItem onClick={() => router.push(\"admin\")} />\n * <DropdownMenuItem onClick={() => router.push(\"me\")}>Profile</DropdownMenuItem>\n * <DropdownMenuSeparator />\n * <ButtonUser.LogoutMenuItem />\n * </ButtonUser>\n *\n * The button reads the visitor, so it is wrapped in `<Personal>`: a page\n * showing it is still cached for everyone (#E78), with a placeholder of the\n * same size in the shared HTML, replaced by the real button right after\n * hydration from the visitor's own state. On a page that is personal anyway,\n * the server renders the real button.\n */\nexport const ButtonUser = (props: ButtonUserProps) => (\n <Personal fallback={<ButtonUserPlaceholder variant={props.variant} />}>\n <ButtonUserContent {...props} />\n </Personal>\n);\n\nButtonUser.Email = ButtonUserEmail;\nButtonUser.AdminMenuItem = ButtonUserAdminMenuItem;\nButtonUser.AccountMenuItem = ButtonUserAccountMenuItem;\nButtonUser.LogoutMenuItem = ButtonUserLogoutMenuItem;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsGA,MAAa,cAAc,UACzB,oBAAC,UAAD;CAAU,UAAU,oBAAC,uBAAD,EAAuB,SAAS,MAAM,QAAU,CAAA;CAClE,UAAA,oBAAC,mBAAD,EAAmB,GAAI,MAAQ,CAAA;AACvB,CAAA;AAGZ,WAAW,QAAQ;AACnB,WAAW,gBAAgB;AAC3B,WAAW,kBAAkB;AAC7B,WAAW,iBAAiB"}
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import type { ButtonUserProps } from "./ButtonUser.tsx";
3
+ /**
4
+ * The account button itself. See {@link ButtonUserProps}.
5
+ */
6
+ export type ButtonUserContentProps = ButtonUserProps;
7
+ /**
8
+ * What `ButtonUser` renders once it may read the visitor: the sign-in icon
9
+ * when logged out, the avatar and its menu when logged in. Wrapped in
10
+ * `<Personal>` by `ButtonUser`, so a page showing it stays shareable.
11
+ */
12
+ export declare const ButtonUserContent: (props: ButtonUserContentProps) => React.JSX.Element;
13
+ //# sourceMappingURL=ButtonUserContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonUserContent.d.ts","sourceRoot":"","sources":["../../src/shell/ButtonUserContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,UAAW,sBAAsB,sBA+D9D,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "../core/DropdownMenu.js";
2
+ import { UserAvatar } from "../core/UserAvatar.js";
3
+ import { Button } from "../core/Button.js";
4
+ import { Tooltip, TooltipContent, TooltipTrigger } from "../core/Tooltip.js";
5
+ import { ButtonUserDefaultMenu } from "./ButtonUserDefaultMenu.js";
6
+ import { LogIn, User } from "lucide-react";
7
+ import "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { useAuth } from "alepha/react/auth";
10
+ //#region src/shell/ButtonUserContent.tsx
11
+ /**
12
+ * What `ButtonUser` renders once it may read the visitor: the sign-in icon
13
+ * when logged out, the avatar and its menu when logged in. Wrapped in
14
+ * `<Personal>` by `ButtonUser`, so a page showing it stays shareable.
15
+ */
16
+ const ButtonUserContent = (props) => {
17
+ const auth = useAuth();
18
+ if (!auth.user) {
19
+ const signInLabel = props.signInLabel ?? "Sign in";
20
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
21
+ render: /* @__PURE__ */ jsx(Button, {
22
+ variant: props.variant ?? "minimal",
23
+ size: "icon",
24
+ "aria-label": signInLabel,
25
+ disabled: !props.onSignIn,
26
+ onClick: props.onSignIn
27
+ }),
28
+ children: /* @__PURE__ */ jsx(LogIn, { className: "size-4" })
29
+ }), /* @__PURE__ */ jsx(TooltipContent, { children: signInLabel })] });
30
+ }
31
+ const menuLabel = props.menuLabel ?? "Account menu";
32
+ const face = props.avatar ?? (auth.user.picture ? /* @__PURE__ */ jsx(UserAvatar, {
33
+ fileId: auth.user.picture,
34
+ className: "size-7"
35
+ }) : /* @__PURE__ */ jsx(User, { className: "size-4" }));
36
+ return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
37
+ render: /* @__PURE__ */ jsx(DropdownMenuTrigger, { render: /* @__PURE__ */ jsx(Button, {
38
+ variant: props.variant ?? "minimal",
39
+ size: "icon",
40
+ "aria-label": menuLabel
41
+ }) }),
42
+ children: face
43
+ }), /* @__PURE__ */ jsx(TooltipContent, { children: menuLabel })] }), /* @__PURE__ */ jsx(DropdownMenuContent, {
44
+ align: "end",
45
+ className: "w-56",
46
+ children: props.children ?? /* @__PURE__ */ jsx(ButtonUserDefaultMenu, { onAdminClick: props.onAdminClick })
47
+ })] });
48
+ };
49
+ //#endregion
50
+ export { ButtonUserContent };
51
+
52
+ //# sourceMappingURL=ButtonUserContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonUserContent.js","names":[],"sources":["../../src/shell/ButtonUserContent.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { useAuth } from \"alepha/react/auth\";\nimport { LogIn, User } from \"lucide-react\";\n\nimport { Button } from \"../core/Button.tsx\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuTrigger,\n} from \"../core/DropdownMenu.tsx\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../core/Tooltip.tsx\";\nimport { UserAvatar } from \"../core/UserAvatar.tsx\";\nimport type { ButtonUserProps } from \"./ButtonUser.tsx\";\nimport { ButtonUserDefaultMenu } from \"./ButtonUserDefaultMenu.tsx\";\n\n/**\n * The account button itself. See {@link ButtonUserProps}.\n */\nexport type ButtonUserContentProps = ButtonUserProps;\n\n/**\n * What `ButtonUser` renders once it may read the visitor: the sign-in icon\n * when logged out, the avatar and its menu when logged in. Wrapped in\n * `<Personal>` by `ButtonUser`, so a page showing it stays shareable.\n */\nexport const ButtonUserContent = (props: ButtonUserContentProps) => {\n const auth = useAuth();\n\n if (!auth.user) {\n const signInLabel = props.signInLabel ?? \"Sign in\";\n return (\n <Tooltip>\n <TooltipTrigger\n render={\n <Button\n variant={props.variant ?? \"minimal\"}\n size=\"icon\"\n aria-label={signInLabel}\n disabled={!props.onSignIn}\n onClick={props.onSignIn}\n />\n }\n >\n <LogIn className=\"size-4\" />\n </TooltipTrigger>\n <TooltipContent>{signInLabel}</TooltipContent>\n </Tooltip>\n );\n }\n\n const menuLabel = props.menuLabel ?? \"Account menu\";\n const face =\n props.avatar ??\n (auth.user.picture ? (\n <UserAvatar fileId={auth.user.picture} className=\"size-7\" />\n ) : (\n <User className=\"size-4\" />\n ));\n return (\n <DropdownMenu>\n <Tooltip>\n <TooltipTrigger\n render={\n <DropdownMenuTrigger\n render={\n <Button\n variant={props.variant ?? \"minimal\"}\n size=\"icon\"\n aria-label={menuLabel}\n />\n }\n />\n }\n >\n {/* The tooltip and `aria-label` are untouched by the avatar: a\n face is not a label, and \"Account menu\" is still the accessible\n name of the button. */}\n {face}\n </TooltipTrigger>\n <TooltipContent>{menuLabel}</TooltipContent>\n </Tooltip>\n <DropdownMenuContent align=\"end\" className=\"w-56\">\n {props.children ?? (\n <ButtonUserDefaultMenu onAdminClick={props.onAdminClick} />\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAa,qBAAqB,UAAkC;CAClE,MAAM,OAAO,QAAQ;CAErB,IAAI,CAAC,KAAK,MAAM;EACd,MAAM,cAAc,MAAM,eAAe;EACzC,OACE,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;GACE,QACE,oBAAC,QAAD;IACE,SAAS,MAAM,WAAW;IAC1B,MAAK;IACL,cAAY;IACZ,UAAU,CAAC,MAAM;IACjB,SAAS,MAAM;GAChB,CAAA;GAGH,UAAA,oBAAC,OAAD,EAAO,WAAU,SAAU,CAAA;EACb,CAAA,GAChB,oBAAC,gBAAD,EAAA,UAAiB,YAA4B,CAAA,CACtC,EAAA,CAAA;CAEb;CAEA,MAAM,YAAY,MAAM,aAAa;CACrC,MAAM,OACJ,MAAM,WACL,KAAK,KAAK,UACT,oBAAC,YAAD;EAAY,QAAQ,KAAK,KAAK;EAAS,WAAU;CAAU,CAAA,IAE3D,oBAAC,MAAD,EAAM,WAAU,SAAU,CAAA;CAE9B,OACE,qBAAC,cAAD,EAAA,UAAA,CACE,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;EACE,QACE,oBAAC,qBAAD,EACE,QACE,oBAAC,QAAD;GACE,SAAS,MAAM,WAAW;GAC1B,MAAK;GACL,cAAY;EACb,CAAA,EAEJ,CAAA;EAMF,UAAA;CACa,CAAA,GAChB,oBAAC,gBAAD,EAAA,UAAiB,UAA0B,CAAA,CACpC,EAAA,CAAA,GACT,oBAAC,qBAAD;EAAqB,OAAM;EAAM,WAAU;EACxC,UAAA,MAAM,YACL,oBAAC,uBAAD,EAAuB,cAAc,MAAM,aAAe,CAAA;CAEzC,CAAA,CACT,EAAA,CAAA;AAElB"}
@@ -0,0 +1,14 @@
1
+ export interface ButtonUserPlaceholderProps {
2
+ /**
3
+ * The variant of the button it stands for: an outlined button keeps its
4
+ * border, so the swap moves nothing.
5
+ */
6
+ variant?: "minimal" | "outlined";
7
+ }
8
+ /**
9
+ * What a shared page shows where `ButtonUser` goes, before hydration: an
10
+ * empty slot the size of the icon button. Neither the sign-in icon nor an
11
+ * avatar, since the shared page cannot know which one its visitor gets.
12
+ */
13
+ export declare const ButtonUserPlaceholder: (props: ButtonUserPlaceholderProps) => import("react").JSX.Element;
14
+ //# sourceMappingURL=ButtonUserPlaceholder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonUserPlaceholder.d.ts","sourceRoot":"","sources":["../../src/shell/ButtonUserPlaceholder.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CAClC;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,UAAW,0BAA0B,gCAStE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { cn } from "../core/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/shell/ButtonUserPlaceholder.tsx
4
+ /**
5
+ * What a shared page shows where `ButtonUser` goes, before hydration: an
6
+ * empty slot the size of the icon button. Neither the sign-in icon nor an
7
+ * avatar, since the shared page cannot know which one its visitor gets.
8
+ */
9
+ const ButtonUserPlaceholder = (props) => /* @__PURE__ */ jsx("span", {
10
+ "aria-hidden": true,
11
+ "data-slot": "button-user-placeholder",
12
+ className: cn("inline-block size-9 shrink-0 rounded-md", props.variant === "outlined" && "border")
13
+ });
14
+ //#endregion
15
+ export { ButtonUserPlaceholder };
16
+
17
+ //# sourceMappingURL=ButtonUserPlaceholder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonUserPlaceholder.js","names":[],"sources":["../../src/shell/ButtonUserPlaceholder.tsx"],"sourcesContent":["import { cn } from \"../core/utils.ts\";\n\nexport interface ButtonUserPlaceholderProps {\n /**\n * The variant of the button it stands for: an outlined button keeps its\n * border, so the swap moves nothing.\n */\n variant?: \"minimal\" | \"outlined\";\n}\n\n/**\n * What a shared page shows where `ButtonUser` goes, before hydration: an\n * empty slot the size of the icon button. Neither the sign-in icon nor an\n * avatar, since the shared page cannot know which one its visitor gets.\n */\nexport const ButtonUserPlaceholder = (props: ButtonUserPlaceholderProps) => (\n <span\n aria-hidden\n data-slot=\"button-user-placeholder\"\n className={cn(\n \"inline-block size-9 shrink-0 rounded-md\",\n props.variant === \"outlined\" && \"border\",\n )}\n />\n);\n"],"mappings":";;;;;;;;AAeA,MAAa,yBAAyB,UACpC,oBAAC,QAAD;CACE,eAAA;CACA,aAAU;CACV,WAAW,GACT,2CACA,MAAM,YAAY,cAAc,QAClC;AACD,CAAA"}
package/dist/styles.css CHANGED
@@ -893,3 +893,34 @@
893
893
  ) {
894
894
  border-color: var(--border-hover);
895
895
  }
896
+
897
+ /*
898
+ * A collapsed sidebar before hydration (#E78).
899
+ *
900
+ * The server renders the shell expanded for every visitor, so the page cache
901
+ * can share it; the visitor's preference reaches React only on the first
902
+ * commit after hydration. The boot script has already set
903
+ * `data-sidebar="collapsed"` on `<html>` from the `alepha-ui` cookie, so an
904
+ * EXPANDED sidebar under that attribute is the pre-hydration frame: it is held
905
+ * at the icon width, labels clipped, until React renders it collapsed. A
906
+ * sidebar the visitor expands again updates the attribute with it, so the rule
907
+ * never fights React after hydration.
908
+ */
909
+ html[data-sidebar="collapsed"]
910
+ [data-slot="sidebar"][data-state="expanded"]
911
+ [data-slot="sidebar-gap"],
912
+ html[data-sidebar="collapsed"]
913
+ [data-slot="sidebar"][data-state="expanded"]
914
+ [data-slot="sidebar-container"] {
915
+ width: var(--sidebar-width-icon);
916
+ overflow: hidden;
917
+ }
918
+
919
+ html[data-sidebar="collapsed"]
920
+ [data-slot="sidebar"][data-state="expanded"]:is(
921
+ [data-variant="floating"],
922
+ [data-variant="inset"]
923
+ )
924
+ :is([data-slot="sidebar-gap"], [data-slot="sidebar-container"]) {
925
+ width: calc(var(--sidebar-width-icon) + 1rem + 2px);
926
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../src/table/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAelE,OAAO,KAAK,EAEV,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EAIhB,MAAM,qBAAqB,CAAC;AAU7B,MAAM,MAAM,cAAc,CACxB,CAAC,EACD,CAAC,SAAS,qBAAqB,GAAG,uBAAuB,IACvD,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAErD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GACpB,CAAC,EACD,KAAK,CAAC,CAAC,SAAS,qBAAqB,GAAG,uBAAuB,SAExD,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,sBAmjB5B,CAAC"}
1
+ {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../src/table/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAelE,OAAO,KAAK,EAEV,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EAIhB,MAAM,qBAAqB,CAAC;AAU7B,MAAM,MAAM,cAAc,CACxB,CAAC,EACD,CAAC,SAAS,qBAAqB,GAAG,uBAAuB,IACvD,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAErD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GACpB,CAAC,EACD,KAAK,CAAC,CAAC,SAAS,qBAAqB,GAAG,uBAAuB,SAExD,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,sBAqjB5B,CAAC"}
@@ -181,7 +181,7 @@ const DataTable = (props) => {
181
181
  * Filter VALUES are deliberately not reset here: `useForm` captures its
182
182
  * `initialValues` once, so resetting them is form surgery rather than a
183
183
  * state assignment. They are also not clobbered - the filter-persist effect
184
- * writes only on `form:change` / `form:submit:success`, never on mount - so
184
+ * writes only on `form:changed` / `form:submit:success`, never on mount - so
185
185
  * the stored filters of the project you left stay its own.
186
186
  */
187
187
  const scopeRef = useRef(props.persistenceKey);
@@ -233,7 +233,7 @@ const DataTable = (props) => {
233
233
  const canResetFilters = hasActiveFilters || filterVisibility.differsFromDeclaration;
234
234
  const isEmptyState = !loading && data.length === 0;
235
235
  const hasHelp = props.help != null && props.help !== false && props.help !== "";
236
- const showToolbar = Boolean(props.filters) || Boolean(props.toolbar) || Boolean(props.actions?.length) || hasHelp || !props.hideColumnPicker || !props.hideActionsMenu;
236
+ const showToolbar = Boolean(props.filters) || Boolean(props.leading) || Boolean(props.toolbar) || Boolean(props.actions?.length) || hasHelp || !props.hideColumnPicker || !props.hideActionsMenu;
237
237
  const rawSummaryContent = props.summary?.content;
238
238
  const summaryContent = typeof rawSummaryContent === "function" ? rawSummaryContent({ refreshKey }) : rawSummaryContent;
239
239
  const hasSummaryContent = summaryContent != null && summaryContent !== false && summaryContent !== "";
@@ -273,6 +273,7 @@ const DataTable = (props) => {
273
273
  shownFilters: filterVisibility.shown,
274
274
  onShownFiltersChange: filterVisibility.setShown,
275
275
  canResetFilters,
276
+ leading: props.leading,
276
277
  toolbar: props.toolbar,
277
278
  actions: props.actions,
278
279
  help: hasHelp ? props.help : void 0,