@alneas/appkit-react 0.1.0 → 0.2.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 (659) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +85 -15
  3. package/consumer-ai/SKILL.md +12 -0
  4. package/consumer-ai/api-index.json +103754 -0
  5. package/consumer-ai/package-context.json +409 -0
  6. package/dist/ai/action/ExecutionHistory.cjs.map +1 -1
  7. package/dist/ai/action/ExecutionHistory.d.cts +32 -2
  8. package/dist/ai/action/ExecutionHistory.d.ts +32 -2
  9. package/dist/ai/action/ExecutionHistory.js.map +1 -1
  10. package/dist/ai/action/ScreenActionContext.cjs.map +1 -1
  11. package/dist/ai/action/ScreenActionContext.d.cts +15 -2
  12. package/dist/ai/action/ScreenActionContext.d.ts +15 -2
  13. package/dist/ai/action/ScreenActionContext.js.map +1 -1
  14. package/dist/ai/action/context.cjs.map +1 -1
  15. package/dist/ai/action/context.d.cts +19 -3
  16. package/dist/ai/action/context.d.ts +19 -3
  17. package/dist/ai/action/context.js.map +1 -1
  18. package/dist/ai/action/types.d.cts +35 -3
  19. package/dist/ai/action/types.d.ts +35 -3
  20. package/dist/ai/action/use-execution-session.cjs.map +1 -1
  21. package/dist/ai/action/use-execution-session.d.cts +17 -1
  22. package/dist/ai/action/use-execution-session.d.ts +17 -1
  23. package/dist/ai/action/use-execution-session.js.map +1 -1
  24. package/dist/ai/action/use-screen-action-registry.cjs.map +1 -1
  25. package/dist/ai/action/use-screen-action-registry.d.cts +77 -8
  26. package/dist/ai/action/use-screen-action-registry.d.ts +77 -8
  27. package/dist/ai/action/use-screen-action-registry.js.map +1 -1
  28. package/dist/ai/action/use-screen-action.cjs.map +1 -1
  29. package/dist/ai/action/use-screen-action.d.cts +23 -6
  30. package/dist/ai/action/use-screen-action.d.ts +23 -6
  31. package/dist/ai/action/use-screen-action.js.map +1 -1
  32. package/dist/ai/action/use-screen-context.cjs.map +1 -1
  33. package/dist/ai/action/use-screen-context.d.cts +42 -5
  34. package/dist/ai/action/use-screen-context.d.ts +42 -5
  35. package/dist/ai/action/use-screen-context.js.map +1 -1
  36. package/dist/ai/ai-chat/transport.cjs.map +1 -1
  37. package/dist/ai/ai-chat/transport.d.cts +35 -8
  38. package/dist/ai/ai-chat/transport.d.ts +35 -8
  39. package/dist/ai/ai-chat/transport.js.map +1 -1
  40. package/dist/ai/generative-ui/GenerativeUIRenderer.cjs.map +1 -1
  41. package/dist/ai/generative-ui/GenerativeUIRenderer.d.cts +21 -3
  42. package/dist/ai/generative-ui/GenerativeUIRenderer.d.ts +21 -3
  43. package/dist/ai/generative-ui/GenerativeUIRenderer.js.map +1 -1
  44. package/dist/ai/generative-ui/error-boundary.cjs.map +1 -1
  45. package/dist/ai/generative-ui/error-boundary.d.cts +98 -2
  46. package/dist/ai/generative-ui/error-boundary.d.ts +98 -2
  47. package/dist/ai/generative-ui/error-boundary.js.map +1 -1
  48. package/dist/ai/generative-ui/registry.cjs.map +1 -1
  49. package/dist/ai/generative-ui/registry.d.cts +96 -7
  50. package/dist/ai/generative-ui/registry.d.ts +96 -7
  51. package/dist/ai/generative-ui/registry.js.map +1 -1
  52. package/dist/ai/proposal/ProposalFieldReview.cjs.map +1 -1
  53. package/dist/ai/proposal/ProposalFieldReview.d.cts +170 -8
  54. package/dist/ai/proposal/ProposalFieldReview.d.ts +170 -8
  55. package/dist/ai/proposal/ProposalFieldReview.js.map +1 -1
  56. package/dist/ai/proposal/types.d.cts +97 -26
  57. package/dist/ai/proposal/types.d.ts +97 -26
  58. package/dist/ai/proposal/use-proposal-batch-review.cjs.map +1 -1
  59. package/dist/ai/proposal/use-proposal-batch-review.d.cts +133 -7
  60. package/dist/ai/proposal/use-proposal-batch-review.d.ts +133 -7
  61. package/dist/ai/proposal/use-proposal-batch-review.js.map +1 -1
  62. package/dist/ai/proposal/use-proposal-review.cjs.map +1 -1
  63. package/dist/ai/proposal/use-proposal-review.d.cts +47 -5
  64. package/dist/ai/proposal/use-proposal-review.d.ts +47 -5
  65. package/dist/ai/proposal/use-proposal-review.js.map +1 -1
  66. package/dist/avatar.svg +1 -0
  67. package/dist/consumer-ai/SKILL.md +6 -0
  68. package/dist/consumer-ai/api-index.json +103754 -0
  69. package/dist/consumer-ai/package-context.json +5 -3
  70. package/dist/mockServiceWorker.js +361 -0
  71. package/dist/styles.css +1 -1
  72. package/dist/tools/components/auth/AuthForms.cjs.map +1 -1
  73. package/dist/tools/components/auth/AuthForms.d.cts +131 -81
  74. package/dist/tools/components/auth/AuthForms.d.ts +131 -81
  75. package/dist/tools/components/auth/AuthForms.js.map +1 -1
  76. package/dist/tools/components/auth/AuthGuard.cjs.map +1 -1
  77. package/dist/tools/components/auth/AuthGuard.d.cts +31 -4
  78. package/dist/tools/components/auth/AuthGuard.d.ts +31 -4
  79. package/dist/tools/components/auth/AuthGuard.js.map +1 -1
  80. package/dist/tools/components/auth/AuthProvider.cjs.map +1 -1
  81. package/dist/tools/components/auth/AuthProvider.d.cts +39 -42
  82. package/dist/tools/components/auth/AuthProvider.d.ts +39 -42
  83. package/dist/tools/components/auth/AuthProvider.js.map +1 -1
  84. package/dist/tools/components/auth/ProtectedRoute.cjs.map +1 -1
  85. package/dist/tools/components/auth/ProtectedRoute.d.cts +75 -60
  86. package/dist/tools/components/auth/ProtectedRoute.d.ts +75 -60
  87. package/dist/tools/components/auth/ProtectedRoute.js.map +1 -1
  88. package/dist/tools/components/auth/SignInButton.cjs.map +1 -1
  89. package/dist/tools/components/auth/SignInButton.d.cts +26 -18
  90. package/dist/tools/components/auth/SignInButton.d.ts +26 -18
  91. package/dist/tools/components/auth/SignInButton.js.map +1 -1
  92. package/dist/tools/components/auth/UserProfileProvider.cjs.map +1 -1
  93. package/dist/tools/components/auth/UserProfileProvider.d.cts +48 -20
  94. package/dist/tools/components/auth/UserProfileProvider.d.ts +48 -20
  95. package/dist/tools/components/auth/UserProfileProvider.js.map +1 -1
  96. package/dist/tools/components/auth/adapters/better-auth-adapter.cjs.map +1 -1
  97. package/dist/tools/components/auth/adapters/better-auth-adapter.d.cts +371 -51
  98. package/dist/tools/components/auth/adapters/better-auth-adapter.d.ts +371 -51
  99. package/dist/tools/components/auth/adapters/better-auth-adapter.js.map +1 -1
  100. package/dist/tools/components/auth/adapters/mock-adapter.cjs.map +1 -1
  101. package/dist/tools/components/auth/adapters/mock-adapter.d.cts +149 -28
  102. package/dist/tools/components/auth/adapters/mock-adapter.d.ts +149 -28
  103. package/dist/tools/components/auth/adapters/mock-adapter.js.map +1 -1
  104. package/dist/tools/components/auth/auth-session.cjs.map +1 -1
  105. package/dist/tools/components/auth/auth-session.d.cts +147 -1
  106. package/dist/tools/components/auth/auth-session.d.ts +147 -1
  107. package/dist/tools/components/auth/auth-session.js.map +1 -1
  108. package/dist/tools/components/auth/session-cache.cjs.map +1 -1
  109. package/dist/tools/components/auth/session-cache.d.cts +88 -24
  110. package/dist/tools/components/auth/session-cache.d.ts +88 -24
  111. package/dist/tools/components/auth/session-cache.js.map +1 -1
  112. package/dist/tools/components/auth/types.cjs.map +1 -1
  113. package/dist/tools/components/auth/types.d.cts +329 -106
  114. package/dist/tools/components/auth/types.d.ts +329 -106
  115. package/dist/tools/components/auth/types.js.map +1 -1
  116. package/dist/tools/components/auth/useAuth.cjs.map +1 -1
  117. package/dist/tools/components/auth/useAuth.d.cts +110 -17
  118. package/dist/tools/components/auth/useAuth.d.ts +110 -17
  119. package/dist/tools/components/auth/useAuth.js.map +1 -1
  120. package/dist/tools/components/auth/useAuthGuard.cjs.map +1 -1
  121. package/dist/tools/components/auth/useAuthGuard.d.cts +49 -38
  122. package/dist/tools/components/auth/useAuthGuard.d.ts +49 -38
  123. package/dist/tools/components/auth/useAuthGuard.js.map +1 -1
  124. package/dist/tools/components/auth/useRoleCheck.cjs.map +1 -1
  125. package/dist/tools/components/auth/useRoleCheck.d.cts +48 -1
  126. package/dist/tools/components/auth/useRoleCheck.d.ts +48 -1
  127. package/dist/tools/components/auth/useRoleCheck.js.map +1 -1
  128. package/dist/tools/components/auth/useUserProfile.cjs.map +1 -1
  129. package/dist/tools/components/auth/useUserProfile.d.cts +66 -1
  130. package/dist/tools/components/auth/useUserProfile.d.ts +66 -1
  131. package/dist/tools/components/auth/useUserProfile.js.map +1 -1
  132. package/dist/tools/components/barcode/BarcodeGenerator.cjs.map +1 -1
  133. package/dist/tools/components/barcode/BarcodeGenerator.d.cts +32 -18
  134. package/dist/tools/components/barcode/BarcodeGenerator.d.ts +32 -18
  135. package/dist/tools/components/barcode/BarcodeGenerator.js.map +1 -1
  136. package/dist/tools/components/barcode/QRCodeGenerator.cjs +1 -1
  137. package/dist/tools/components/barcode/QRCodeGenerator.cjs.map +1 -1
  138. package/dist/tools/components/barcode/QRCodeGenerator.d.cts +20 -13
  139. package/dist/tools/components/barcode/QRCodeGenerator.d.ts +20 -13
  140. package/dist/tools/components/barcode/QRCodeGenerator.js +1 -1
  141. package/dist/tools/components/barcode/QRCodeGenerator.js.map +1 -1
  142. package/dist/tools/components/barcode/QRCodeScanner.cjs.map +1 -1
  143. package/dist/tools/components/barcode/QRCodeScanner.d.cts +32 -1
  144. package/dist/tools/components/barcode/QRCodeScanner.d.ts +32 -1
  145. package/dist/tools/components/barcode/QRCodeScanner.js.map +1 -1
  146. package/dist/tools/components/calendar/ResourceCalendar.cjs.map +1 -1
  147. package/dist/tools/components/calendar/ResourceCalendar.d.cts +17 -42
  148. package/dist/tools/components/calendar/ResourceCalendar.d.ts +17 -42
  149. package/dist/tools/components/calendar/ResourceCalendar.js.map +1 -1
  150. package/dist/tools/components/calendar/views/ResourceView.cjs +1 -1
  151. package/dist/tools/components/calendar/views/ResourceView.cjs.map +1 -1
  152. package/dist/tools/components/calendar/views/ResourceView.js +2 -2
  153. package/dist/tools/components/calendar/views/ResourceView.js.map +1 -1
  154. package/dist/tools/components/chart/ComposedChart.cjs.map +1 -1
  155. package/dist/tools/components/chart/ComposedChart.d.cts +54 -1
  156. package/dist/tools/components/chart/ComposedChart.d.ts +54 -1
  157. package/dist/tools/components/chart/ComposedChart.js.map +1 -1
  158. package/dist/tools/components/chart/SimpleAreaChart.cjs.map +1 -1
  159. package/dist/tools/components/chart/SimpleAreaChart.d.cts +41 -1
  160. package/dist/tools/components/chart/SimpleAreaChart.d.ts +41 -1
  161. package/dist/tools/components/chart/SimpleAreaChart.js.map +1 -1
  162. package/dist/tools/components/chart/SimpleBarChart.cjs.map +1 -1
  163. package/dist/tools/components/chart/SimpleBarChart.d.cts +34 -24
  164. package/dist/tools/components/chart/SimpleBarChart.d.ts +34 -24
  165. package/dist/tools/components/chart/SimpleBarChart.js.map +1 -1
  166. package/dist/tools/components/chart/SimpleLineChart.cjs.map +1 -1
  167. package/dist/tools/components/chart/SimpleLineChart.d.cts +31 -28
  168. package/dist/tools/components/chart/SimpleLineChart.d.ts +31 -28
  169. package/dist/tools/components/chart/SimpleLineChart.js.map +1 -1
  170. package/dist/tools/components/chart/SimplePieChart.cjs.map +1 -1
  171. package/dist/tools/components/chart/SimplePieChart.d.cts +28 -22
  172. package/dist/tools/components/chart/SimplePieChart.d.ts +28 -22
  173. package/dist/tools/components/chart/SimplePieChart.js.map +1 -1
  174. package/dist/tools/components/chart/SimpleRadarChart.cjs.map +1 -1
  175. package/dist/tools/components/chart/SimpleRadarChart.d.cts +38 -1
  176. package/dist/tools/components/chart/SimpleRadarChart.d.ts +38 -1
  177. package/dist/tools/components/chart/SimpleRadarChart.js.map +1 -1
  178. package/dist/tools/components/chart/SimpleScatterChart.cjs.map +1 -1
  179. package/dist/tools/components/chart/SimpleScatterChart.d.cts +44 -1
  180. package/dist/tools/components/chart/SimpleScatterChart.d.ts +44 -1
  181. package/dist/tools/components/chart/SimpleScatterChart.js.map +1 -1
  182. package/dist/tools/components/chart/StackedBarChart.cjs.map +1 -1
  183. package/dist/tools/components/chart/StackedBarChart.d.cts +38 -1
  184. package/dist/tools/components/chart/StackedBarChart.d.ts +38 -1
  185. package/dist/tools/components/chart/StackedBarChart.js.map +1 -1
  186. package/dist/tools/components/data-table/data-table.cjs +1 -1
  187. package/dist/tools/components/data-table/data-table.cjs.map +1 -1
  188. package/dist/tools/components/data-table/data-table.js +286 -263
  189. package/dist/tools/components/data-table/data-table.js.map +1 -1
  190. package/dist/tools/components/data-table/table-utils.cjs.map +1 -1
  191. package/dist/tools/components/data-table/table-utils.d.cts +45 -35
  192. package/dist/tools/components/data-table/table-utils.d.ts +45 -35
  193. package/dist/tools/components/data-table/table-utils.js.map +1 -1
  194. package/dist/tools/components/editable-table/editable-table.cjs +1 -1
  195. package/dist/tools/components/editable-table/editable-table.cjs.map +1 -1
  196. package/dist/tools/components/editable-table/editable-table.js +15 -2
  197. package/dist/tools/components/editable-table/editable-table.js.map +1 -1
  198. package/dist/tools/components/error/ErrorDialog.cjs +1 -1
  199. package/dist/tools/components/error/ErrorDialog.cjs.map +1 -1
  200. package/dist/tools/components/error/ErrorDialog.js +1 -1
  201. package/dist/tools/components/error/ErrorDialog.js.map +1 -1
  202. package/dist/tools/components/error/ErrorInline.cjs +1 -1
  203. package/dist/tools/components/error/ErrorInline.cjs.map +1 -1
  204. package/dist/tools/components/error/ErrorInline.js +1 -1
  205. package/dist/tools/components/error/ErrorInline.js.map +1 -1
  206. package/dist/tools/components/error/ErrorNotification.cjs +1 -1
  207. package/dist/tools/components/error/ErrorNotification.cjs.map +1 -1
  208. package/dist/tools/components/error/ErrorNotification.js +10 -10
  209. package/dist/tools/components/error/ErrorNotification.js.map +1 -1
  210. package/dist/tools/components/file-browser/FilePreview.cjs +1 -1
  211. package/dist/tools/components/file-browser/FilePreview.cjs.map +1 -1
  212. package/dist/tools/components/file-browser/FilePreview.js +28 -26
  213. package/dist/tools/components/file-browser/FilePreview.js.map +1 -1
  214. package/dist/tools/components/filter/filter.cjs.map +1 -1
  215. package/dist/tools/components/filter/filter.d.cts +23 -34
  216. package/dist/tools/components/filter/filter.d.ts +23 -34
  217. package/dist/tools/components/filter/filter.js.map +1 -1
  218. package/dist/tools/components/form/EnhancedDetailPage.cjs.map +1 -1
  219. package/dist/tools/components/form/EnhancedDetailPage.d.cts +47 -42
  220. package/dist/tools/components/form/EnhancedDetailPage.d.ts +47 -42
  221. package/dist/tools/components/form/EnhancedDetailPage.js.map +1 -1
  222. package/dist/tools/components/form/form-grid.cjs.map +1 -1
  223. package/dist/tools/components/form/form-grid.d.cts +44 -22
  224. package/dist/tools/components/form/form-grid.d.ts +44 -22
  225. package/dist/tools/components/form/form-grid.js.map +1 -1
  226. package/dist/tools/components/gantt/GanttChart.cjs +1 -1
  227. package/dist/tools/components/gantt/GanttChart.cjs.map +1 -1
  228. package/dist/tools/components/gantt/GanttChart.d.cts +20 -1
  229. package/dist/tools/components/gantt/GanttChart.d.ts +20 -1
  230. package/dist/tools/components/gantt/GanttChart.js +3 -0
  231. package/dist/tools/components/gantt/GanttChart.js.map +1 -1
  232. package/dist/tools/components/gantt/components/GanttTaskBar.cjs +1 -1
  233. package/dist/tools/components/gantt/components/GanttTaskBar.cjs.map +1 -1
  234. package/dist/tools/components/gantt/components/GanttTaskBar.js +2 -1
  235. package/dist/tools/components/gantt/components/GanttTaskBar.js.map +1 -1
  236. package/dist/tools/components/header/header.cjs +1 -1
  237. package/dist/tools/components/header/header.cjs.map +1 -1
  238. package/dist/tools/components/header/header.d.cts +103 -40
  239. package/dist/tools/components/header/header.d.ts +103 -40
  240. package/dist/tools/components/header/header.js +1 -1
  241. package/dist/tools/components/header/header.js.map +1 -1
  242. package/dist/tools/components/i18n/LanguageSwitcher.cjs.map +1 -1
  243. package/dist/tools/components/i18n/LanguageSwitcher.d.cts +18 -14
  244. package/dist/tools/components/i18n/LanguageSwitcher.d.ts +18 -14
  245. package/dist/tools/components/i18n/LanguageSwitcher.js.map +1 -1
  246. package/dist/tools/components/kanban/KanbanBoard.cjs +1 -1
  247. package/dist/tools/components/kanban/KanbanBoard.cjs.map +1 -1
  248. package/dist/tools/components/kanban/KanbanBoard.d.cts +16 -34
  249. package/dist/tools/components/kanban/KanbanBoard.d.ts +16 -34
  250. package/dist/tools/components/kanban/KanbanBoard.js +3 -0
  251. package/dist/tools/components/kanban/KanbanBoard.js.map +1 -1
  252. package/dist/tools/components/kanban/KanbanColumn.cjs +1 -1
  253. package/dist/tools/components/kanban/KanbanColumn.cjs.map +1 -1
  254. package/dist/tools/components/kanban/KanbanColumn.js +1 -1
  255. package/dist/tools/components/kanban/KanbanColumn.js.map +1 -1
  256. package/dist/tools/components/kanban/kanban-compound.cjs +1 -1
  257. package/dist/tools/components/kanban/kanban-compound.cjs.map +1 -1
  258. package/dist/tools/components/kanban/kanban-compound.js +4 -1
  259. package/dist/tools/components/kanban/kanban-compound.js.map +1 -1
  260. package/dist/tools/components/kanban/kanban-primitives.cjs +1 -1
  261. package/dist/tools/components/kanban/kanban-primitives.cjs.map +1 -1
  262. package/dist/tools/components/kanban/kanban-primitives.js +0 -1
  263. package/dist/tools/components/kanban/kanban-primitives.js.map +1 -1
  264. package/dist/tools/components/priority-queue/PriorityCard.cjs +1 -1
  265. package/dist/tools/components/priority-queue/PriorityCard.cjs.map +1 -1
  266. package/dist/tools/components/priority-queue/PriorityCard.js +3 -1
  267. package/dist/tools/components/priority-queue/PriorityCard.js.map +1 -1
  268. package/dist/tools/components/sidebar/SmartSidebar.cjs.map +1 -1
  269. package/dist/tools/components/sidebar/SmartSidebar.d.cts +41 -43
  270. package/dist/tools/components/sidebar/SmartSidebar.d.ts +41 -43
  271. package/dist/tools/components/sidebar/SmartSidebar.js.map +1 -1
  272. package/dist/tools/components/splash/SplashScreen.cjs.map +1 -1
  273. package/dist/tools/components/splash/SplashScreen.d.cts +43 -68
  274. package/dist/tools/components/splash/SplashScreen.d.ts +43 -68
  275. package/dist/tools/components/splash/SplashScreen.js.map +1 -1
  276. package/dist/tools/components/workflow/WorkflowStatusPanel.cjs +1 -1
  277. package/dist/tools/components/workflow/WorkflowStatusPanel.cjs.map +1 -1
  278. package/dist/tools/components/workflow/WorkflowStatusPanel.js +2 -2
  279. package/dist/tools/components/workflow/WorkflowStatusPanel.js.map +1 -1
  280. package/dist/tools/lib/data-access/data-access-context.cjs.map +1 -1
  281. package/dist/tools/lib/data-access/data-access-context.d.cts +15 -6
  282. package/dist/tools/lib/data-access/data-access-context.d.ts +15 -6
  283. package/dist/tools/lib/data-access/data-access-context.js.map +1 -1
  284. package/dist/tools/lib/data-access/react-query-provider.cjs.map +1 -1
  285. package/dist/tools/lib/data-access/react-query-provider.d.cts +19 -2
  286. package/dist/tools/lib/data-access/react-query-provider.d.ts +19 -2
  287. package/dist/tools/lib/data-access/react-query-provider.js.map +1 -1
  288. package/dist/tools/lib/data-access/react-query.cjs.map +1 -1
  289. package/dist/tools/lib/data-access/react-query.d.cts +365 -90
  290. package/dist/tools/lib/data-access/react-query.d.ts +365 -90
  291. package/dist/tools/lib/data-access/react-query.js.map +1 -1
  292. package/dist/tools/lib/error/AppError.cjs.map +1 -1
  293. package/dist/tools/lib/error/AppError.d.cts +157 -63
  294. package/dist/tools/lib/error/AppError.d.ts +157 -63
  295. package/dist/tools/lib/error/AppError.js.map +1 -1
  296. package/dist/tools/lib/hooks/useAsyncWithTimeout.cjs.map +1 -1
  297. package/dist/tools/lib/hooks/useAsyncWithTimeout.d.cts +79 -26
  298. package/dist/tools/lib/hooks/useAsyncWithTimeout.d.ts +79 -26
  299. package/dist/tools/lib/hooks/useAsyncWithTimeout.js.map +1 -1
  300. package/dist/tools/lib/hooks/useError.cjs.map +1 -1
  301. package/dist/tools/lib/hooks/useError.d.cts +51 -16
  302. package/dist/tools/lib/hooks/useError.d.ts +51 -16
  303. package/dist/tools/lib/hooks/useError.js.map +1 -1
  304. package/dist/tools/lib/schema/ajv.cjs +1 -1
  305. package/dist/tools/lib/schema/ajv.cjs.map +1 -1
  306. package/dist/tools/lib/schema/ajv.d.cts +19 -8
  307. package/dist/tools/lib/schema/ajv.d.ts +19 -8
  308. package/dist/tools/lib/schema/ajv.js +2 -1
  309. package/dist/tools/lib/schema/ajv.js.map +1 -1
  310. package/dist/tools/lib/state/error-store.cjs.map +1 -1
  311. package/dist/tools/lib/state/error-store.d.cts +61 -10
  312. package/dist/tools/lib/state/error-store.d.ts +61 -10
  313. package/dist/tools/lib/state/error-store.js.map +1 -1
  314. package/dist/tools/lib/state/store-factory.cjs.map +1 -1
  315. package/dist/tools/lib/state/store-factory.d.cts +25 -4
  316. package/dist/tools/lib/state/store-factory.d.ts +25 -4
  317. package/dist/tools/lib/state/store-factory.js.map +1 -1
  318. package/dist/tools/lib/state/ui-store.cjs.map +1 -1
  319. package/dist/tools/lib/state/ui-store.d.cts +39 -0
  320. package/dist/tools/lib/state/ui-store.d.ts +39 -0
  321. package/dist/tools/lib/state/ui-store.js.map +1 -1
  322. package/dist/ui/components/theme/theme-context.cjs.map +1 -1
  323. package/dist/ui/components/theme/theme-context.d.cts +171 -1
  324. package/dist/ui/components/theme/theme-context.d.ts +171 -1
  325. package/dist/ui/components/theme/theme-context.js.map +1 -1
  326. package/dist/ui/components/theme/theme-provider.cjs.map +1 -1
  327. package/dist/ui/components/theme/theme-provider.d.cts +31 -19
  328. package/dist/ui/components/theme/theme-provider.d.ts +31 -19
  329. package/dist/ui/components/theme/theme-provider.js.map +1 -1
  330. package/dist/ui/components/theme/theme-script.cjs.map +1 -1
  331. package/dist/ui/components/theme/theme-script.d.cts +16 -1
  332. package/dist/ui/components/theme/theme-script.d.ts +16 -1
  333. package/dist/ui/components/theme/theme-script.js.map +1 -1
  334. package/dist/ui/components/theme/theme-switcher.cjs +1 -1
  335. package/dist/ui/components/theme/theme-switcher.cjs.map +1 -1
  336. package/dist/ui/components/theme/theme-switcher.d.cts +82 -13
  337. package/dist/ui/components/theme/theme-switcher.d.ts +82 -13
  338. package/dist/ui/components/theme/theme-switcher.js +8 -0
  339. package/dist/ui/components/theme/theme-switcher.js.map +1 -1
  340. package/dist/ui/components/ui/accordion.cjs.map +1 -1
  341. package/dist/ui/components/ui/accordion.d.cts +60 -0
  342. package/dist/ui/components/ui/accordion.d.ts +60 -0
  343. package/dist/ui/components/ui/accordion.js.map +1 -1
  344. package/dist/ui/components/ui/adjustable-pane.cjs.map +1 -1
  345. package/dist/ui/components/ui/adjustable-pane.d.cts +44 -26
  346. package/dist/ui/components/ui/adjustable-pane.d.ts +44 -26
  347. package/dist/ui/components/ui/adjustable-pane.js.map +1 -1
  348. package/dist/ui/components/ui/alert-dialog.cjs.map +1 -1
  349. package/dist/ui/components/ui/alert-dialog.d.cts +179 -2
  350. package/dist/ui/components/ui/alert-dialog.d.ts +179 -2
  351. package/dist/ui/components/ui/alert-dialog.js.map +1 -1
  352. package/dist/ui/components/ui/alert.cjs.map +1 -1
  353. package/dist/ui/components/ui/alert.d.cts +52 -4
  354. package/dist/ui/components/ui/alert.d.ts +52 -4
  355. package/dist/ui/components/ui/alert.js.map +1 -1
  356. package/dist/ui/components/ui/aspect-ratio.cjs.map +1 -1
  357. package/dist/ui/components/ui/aspect-ratio.d.cts +16 -1
  358. package/dist/ui/components/ui/aspect-ratio.d.ts +16 -1
  359. package/dist/ui/components/ui/aspect-ratio.js.map +1 -1
  360. package/dist/ui/components/ui/avatar.cjs.map +1 -1
  361. package/dist/ui/components/ui/avatar.d.cts +87 -3
  362. package/dist/ui/components/ui/avatar.d.ts +87 -3
  363. package/dist/ui/components/ui/avatar.js.map +1 -1
  364. package/dist/ui/components/ui/badge-components.cjs.map +1 -1
  365. package/dist/ui/components/ui/badge-components.d.cts +13 -1
  366. package/dist/ui/components/ui/badge-components.d.ts +13 -1
  367. package/dist/ui/components/ui/badge-components.js.map +1 -1
  368. package/dist/ui/components/ui/badge-variants.cjs.map +1 -1
  369. package/dist/ui/components/ui/badge-variants.d.cts +15 -0
  370. package/dist/ui/components/ui/badge-variants.d.ts +15 -0
  371. package/dist/ui/components/ui/badge-variants.js.map +1 -1
  372. package/dist/ui/components/ui/breadcrumb.cjs.map +1 -1
  373. package/dist/ui/components/ui/breadcrumb.d.cts +91 -7
  374. package/dist/ui/components/ui/breadcrumb.d.ts +91 -7
  375. package/dist/ui/components/ui/breadcrumb.js.map +1 -1
  376. package/dist/ui/components/ui/button-components.cjs.map +1 -1
  377. package/dist/ui/components/ui/button-components.d.cts +18 -6
  378. package/dist/ui/components/ui/button-components.d.ts +18 -6
  379. package/dist/ui/components/ui/button-components.js.map +1 -1
  380. package/dist/ui/components/ui/button-group-components.cjs.map +1 -1
  381. package/dist/ui/components/ui/button-group-components.d.cts +39 -3
  382. package/dist/ui/components/ui/button-group-components.d.ts +39 -3
  383. package/dist/ui/components/ui/button-group-components.js.map +1 -1
  384. package/dist/ui/components/ui/button-group-variants.cjs.map +1 -1
  385. package/dist/ui/components/ui/button-group-variants.d.cts +15 -0
  386. package/dist/ui/components/ui/button-group-variants.d.ts +15 -0
  387. package/dist/ui/components/ui/button-group-variants.js.map +1 -1
  388. package/dist/ui/components/ui/button-variants.cjs.map +1 -1
  389. package/dist/ui/components/ui/button-variants.d.cts +13 -2
  390. package/dist/ui/components/ui/button-variants.d.ts +13 -2
  391. package/dist/ui/components/ui/button-variants.js.map +1 -1
  392. package/dist/ui/components/ui/card.cjs.map +1 -1
  393. package/dist/ui/components/ui/card.d.cts +106 -2
  394. package/dist/ui/components/ui/card.d.ts +106 -2
  395. package/dist/ui/components/ui/card.js.map +1 -1
  396. package/dist/ui/components/ui/checkbox-group.cjs.map +1 -1
  397. package/dist/ui/components/ui/checkbox-group.d.cts +13 -1
  398. package/dist/ui/components/ui/checkbox-group.d.ts +13 -1
  399. package/dist/ui/components/ui/checkbox-group.js.map +1 -1
  400. package/dist/ui/components/ui/checkbox.cjs.map +1 -1
  401. package/dist/ui/components/ui/checkbox.d.cts +17 -6
  402. package/dist/ui/components/ui/checkbox.d.ts +17 -6
  403. package/dist/ui/components/ui/checkbox.js.map +1 -1
  404. package/dist/ui/components/ui/collapsible.cjs.map +1 -1
  405. package/dist/ui/components/ui/collapsible.d.cts +39 -3
  406. package/dist/ui/components/ui/collapsible.d.ts +39 -3
  407. package/dist/ui/components/ui/collapsible.js.map +1 -1
  408. package/dist/ui/components/ui/combobox-components.cjs.map +1 -1
  409. package/dist/ui/components/ui/combobox-components.d.cts +209 -14
  410. package/dist/ui/components/ui/combobox-components.d.ts +209 -14
  411. package/dist/ui/components/ui/combobox-components.js.map +1 -1
  412. package/dist/ui/components/ui/combobox-hooks.cjs.map +1 -1
  413. package/dist/ui/components/ui/combobox-hooks.d.cts +13 -1
  414. package/dist/ui/components/ui/combobox-hooks.d.ts +13 -1
  415. package/dist/ui/components/ui/combobox-hooks.js.map +1 -1
  416. package/dist/ui/components/ui/command.cjs.map +1 -1
  417. package/dist/ui/components/ui/command.d.cts +132 -9
  418. package/dist/ui/components/ui/command.d.ts +132 -9
  419. package/dist/ui/components/ui/command.js.map +1 -1
  420. package/dist/ui/components/ui/context-menu.cjs.map +1 -1
  421. package/dist/ui/components/ui/context-menu.d.cts +233 -2
  422. package/dist/ui/components/ui/context-menu.d.ts +233 -2
  423. package/dist/ui/components/ui/context-menu.js.map +1 -1
  424. package/dist/ui/components/ui/dialog.cjs.map +1 -1
  425. package/dist/ui/components/ui/dialog.d.cts +157 -5
  426. package/dist/ui/components/ui/dialog.d.ts +157 -5
  427. package/dist/ui/components/ui/dialog.js.map +1 -1
  428. package/dist/ui/components/ui/drawer.cjs.map +1 -1
  429. package/dist/ui/components/ui/drawer.d.cts +130 -10
  430. package/dist/ui/components/ui/drawer.d.ts +130 -10
  431. package/dist/ui/components/ui/drawer.js.map +1 -1
  432. package/dist/ui/components/ui/dropdown-menu.cjs.map +1 -1
  433. package/dist/ui/components/ui/dropdown-menu.d.cts +225 -6
  434. package/dist/ui/components/ui/dropdown-menu.d.ts +225 -6
  435. package/dist/ui/components/ui/dropdown-menu.js.map +1 -1
  436. package/dist/ui/components/ui/empty.cjs.map +1 -1
  437. package/dist/ui/components/ui/empty.d.cts +78 -6
  438. package/dist/ui/components/ui/empty.d.ts +78 -6
  439. package/dist/ui/components/ui/empty.js.map +1 -1
  440. package/dist/ui/components/ui/field.cjs.map +1 -1
  441. package/dist/ui/components/ui/field.d.cts +180 -6
  442. package/dist/ui/components/ui/field.d.ts +180 -6
  443. package/dist/ui/components/ui/field.js.map +1 -1
  444. package/dist/ui/components/ui/file-icon.cjs.map +1 -1
  445. package/dist/ui/components/ui/file-icon.d.cts +32 -4
  446. package/dist/ui/components/ui/file-icon.d.ts +32 -4
  447. package/dist/ui/components/ui/file-icon.js.map +1 -1
  448. package/dist/ui/components/ui/hover-card.cjs.map +1 -1
  449. package/dist/ui/components/ui/hover-card.d.cts +39 -3
  450. package/dist/ui/components/ui/hover-card.d.ts +39 -3
  451. package/dist/ui/components/ui/hover-card.js.map +1 -1
  452. package/dist/ui/components/ui/input-group.cjs.map +1 -1
  453. package/dist/ui/components/ui/input-group.d.cts +84 -6
  454. package/dist/ui/components/ui/input-group.d.ts +84 -6
  455. package/dist/ui/components/ui/input-group.js.map +1 -1
  456. package/dist/ui/components/ui/input-otp.cjs.map +1 -1
  457. package/dist/ui/components/ui/input-otp.d.cts +58 -4
  458. package/dist/ui/components/ui/input-otp.d.ts +58 -4
  459. package/dist/ui/components/ui/input-otp.js.map +1 -1
  460. package/dist/ui/components/ui/input.cjs.map +1 -1
  461. package/dist/ui/components/ui/input.d.cts +18 -10
  462. package/dist/ui/components/ui/input.d.ts +18 -10
  463. package/dist/ui/components/ui/input.js.map +1 -1
  464. package/dist/ui/components/ui/item.cjs.map +1 -1
  465. package/dist/ui/components/ui/item.d.cts +130 -10
  466. package/dist/ui/components/ui/item.d.ts +130 -10
  467. package/dist/ui/components/ui/item.js.map +1 -1
  468. package/dist/ui/components/ui/kbd.cjs.map +1 -1
  469. package/dist/ui/components/ui/kbd.d.cts +26 -2
  470. package/dist/ui/components/ui/kbd.d.ts +26 -2
  471. package/dist/ui/components/ui/kbd.js.map +1 -1
  472. package/dist/ui/components/ui/label.cjs.map +1 -1
  473. package/dist/ui/components/ui/label.d.cts +15 -0
  474. package/dist/ui/components/ui/label.d.ts +15 -0
  475. package/dist/ui/components/ui/label.js.map +1 -1
  476. package/dist/ui/components/ui/layout.cjs +1 -1
  477. package/dist/ui/components/ui/layout.cjs.map +1 -1
  478. package/dist/ui/components/ui/layout.d.cts +45 -11
  479. package/dist/ui/components/ui/layout.d.ts +45 -11
  480. package/dist/ui/components/ui/layout.js +22 -20
  481. package/dist/ui/components/ui/layout.js.map +1 -1
  482. package/dist/ui/components/ui/menubar.cjs.map +1 -1
  483. package/dist/ui/components/ui/menubar.d.cts +220 -16
  484. package/dist/ui/components/ui/menubar.d.ts +220 -16
  485. package/dist/ui/components/ui/menubar.js.map +1 -1
  486. package/dist/ui/components/ui/meter.cjs.map +1 -1
  487. package/dist/ui/components/ui/meter.d.cts +52 -4
  488. package/dist/ui/components/ui/meter.d.ts +52 -4
  489. package/dist/ui/components/ui/meter.js.map +1 -1
  490. package/dist/ui/components/ui/mobile-form-variants.cjs.map +1 -1
  491. package/dist/ui/components/ui/mobile-form-variants.d.cts +30 -0
  492. package/dist/ui/components/ui/mobile-form-variants.d.ts +30 -0
  493. package/dist/ui/components/ui/mobile-form-variants.js.map +1 -1
  494. package/dist/ui/components/ui/mobile-form.cjs.map +1 -1
  495. package/dist/ui/components/ui/mobile-form.d.cts +186 -9
  496. package/dist/ui/components/ui/mobile-form.d.ts +186 -9
  497. package/dist/ui/components/ui/mobile-form.js.map +1 -1
  498. package/dist/ui/components/ui/navigation-menu-components.cjs.map +1 -1
  499. package/dist/ui/components/ui/navigation-menu-components.d.cts +104 -8
  500. package/dist/ui/components/ui/navigation-menu-components.d.ts +104 -8
  501. package/dist/ui/components/ui/navigation-menu-components.js.map +1 -1
  502. package/dist/ui/components/ui/navigation-menu-variants.cjs.map +1 -1
  503. package/dist/ui/components/ui/navigation-menu-variants.d.cts +15 -0
  504. package/dist/ui/components/ui/navigation-menu-variants.d.ts +15 -0
  505. package/dist/ui/components/ui/navigation-menu-variants.js.map +1 -1
  506. package/dist/ui/components/ui/number-field.cjs.map +1 -1
  507. package/dist/ui/components/ui/number-field.d.cts +78 -6
  508. package/dist/ui/components/ui/number-field.d.ts +78 -6
  509. package/dist/ui/components/ui/number-field.js.map +1 -1
  510. package/dist/ui/components/ui/pagination.cjs.map +1 -1
  511. package/dist/ui/components/ui/pagination.d.cts +99 -7
  512. package/dist/ui/components/ui/pagination.d.ts +99 -7
  513. package/dist/ui/components/ui/pagination.js.map +1 -1
  514. package/dist/ui/components/ui/password-input.cjs.map +1 -1
  515. package/dist/ui/components/ui/password-input.d.cts +10 -7
  516. package/dist/ui/components/ui/password-input.d.ts +10 -7
  517. package/dist/ui/components/ui/password-input.js.map +1 -1
  518. package/dist/ui/components/ui/popover.cjs.map +1 -1
  519. package/dist/ui/components/ui/popover.d.cts +86 -2
  520. package/dist/ui/components/ui/popover.d.ts +86 -2
  521. package/dist/ui/components/ui/popover.js.map +1 -1
  522. package/dist/ui/components/ui/progress.cjs.map +1 -1
  523. package/dist/ui/components/ui/progress.d.cts +72 -2
  524. package/dist/ui/components/ui/progress.d.ts +72 -2
  525. package/dist/ui/components/ui/progress.js.map +1 -1
  526. package/dist/ui/components/ui/radio-card.cjs.map +1 -1
  527. package/dist/ui/components/ui/radio-card.d.cts +32 -4
  528. package/dist/ui/components/ui/radio-card.d.ts +32 -4
  529. package/dist/ui/components/ui/radio-card.js.map +1 -1
  530. package/dist/ui/components/ui/radio-group.cjs.map +1 -1
  531. package/dist/ui/components/ui/radio-group.d.cts +28 -2
  532. package/dist/ui/components/ui/radio-group.d.ts +28 -2
  533. package/dist/ui/components/ui/radio-group.js.map +1 -1
  534. package/dist/ui/components/ui/resizable.cjs.map +1 -1
  535. package/dist/ui/components/ui/resizable.d.cts +42 -3
  536. package/dist/ui/components/ui/resizable.d.ts +42 -3
  537. package/dist/ui/components/ui/resizable.js.map +1 -1
  538. package/dist/ui/components/ui/responsive-list.cjs.map +1 -1
  539. package/dist/ui/components/ui/responsive-list.d.cts +176 -13
  540. package/dist/ui/components/ui/responsive-list.d.ts +176 -13
  541. package/dist/ui/components/ui/responsive-list.js.map +1 -1
  542. package/dist/ui/components/ui/scroll-area.cjs.map +1 -1
  543. package/dist/ui/components/ui/scroll-area.d.cts +28 -1
  544. package/dist/ui/components/ui/scroll-area.d.ts +28 -1
  545. package/dist/ui/components/ui/scroll-area.js.map +1 -1
  546. package/dist/ui/components/ui/searchable-select-input.cjs.map +1 -1
  547. package/dist/ui/components/ui/searchable-select-input.d.cts +199 -49
  548. package/dist/ui/components/ui/searchable-select-input.d.ts +199 -49
  549. package/dist/ui/components/ui/searchable-select-input.js.map +1 -1
  550. package/dist/ui/components/ui/select.cjs.map +1 -1
  551. package/dist/ui/components/ui/select.d.cts +205 -40
  552. package/dist/ui/components/ui/select.d.ts +205 -40
  553. package/dist/ui/components/ui/select.js.map +1 -1
  554. package/dist/ui/components/ui/separator.cjs.map +1 -1
  555. package/dist/ui/components/ui/separator.d.cts +13 -2
  556. package/dist/ui/components/ui/separator.d.ts +13 -2
  557. package/dist/ui/components/ui/separator.js.map +1 -1
  558. package/dist/ui/components/ui/sheet.cjs.map +1 -1
  559. package/dist/ui/components/ui/sheet.d.cts +128 -3
  560. package/dist/ui/components/ui/sheet.d.ts +128 -3
  561. package/dist/ui/components/ui/sheet.js.map +1 -1
  562. package/dist/ui/components/ui/skeleton.cjs.map +1 -1
  563. package/dist/ui/components/ui/skeleton.d.cts +13 -1
  564. package/dist/ui/components/ui/skeleton.d.ts +13 -1
  565. package/dist/ui/components/ui/skeleton.js.map +1 -1
  566. package/dist/ui/components/ui/slider.cjs.map +1 -1
  567. package/dist/ui/components/ui/slider.d.cts +13 -7
  568. package/dist/ui/components/ui/slider.d.ts +13 -7
  569. package/dist/ui/components/ui/slider.js.map +1 -1
  570. package/dist/ui/components/ui/spinner.cjs.map +1 -1
  571. package/dist/ui/components/ui/spinner.d.cts +13 -1
  572. package/dist/ui/components/ui/spinner.d.ts +13 -1
  573. package/dist/ui/components/ui/spinner.js.map +1 -1
  574. package/dist/ui/components/ui/switch.cjs.map +1 -1
  575. package/dist/ui/components/ui/switch.d.cts +26 -0
  576. package/dist/ui/components/ui/switch.d.ts +26 -0
  577. package/dist/ui/components/ui/switch.js.map +1 -1
  578. package/dist/ui/components/ui/table.cjs.map +1 -1
  579. package/dist/ui/components/ui/table.d.cts +118 -2
  580. package/dist/ui/components/ui/table.d.ts +118 -2
  581. package/dist/ui/components/ui/table.js.map +1 -1
  582. package/dist/ui/components/ui/tabs-components.cjs.map +1 -1
  583. package/dist/ui/components/ui/tabs-components.d.cts +52 -5
  584. package/dist/ui/components/ui/tabs-components.d.ts +52 -5
  585. package/dist/ui/components/ui/tabs-components.js.map +1 -1
  586. package/dist/ui/components/ui/tabs-variants.cjs.map +1 -1
  587. package/dist/ui/components/ui/tabs-variants.d.cts +15 -0
  588. package/dist/ui/components/ui/tabs-variants.d.ts +15 -0
  589. package/dist/ui/components/ui/tabs-variants.js.map +1 -1
  590. package/dist/ui/components/ui/textarea.cjs.map +1 -1
  591. package/dist/ui/components/ui/textarea.d.cts +23 -0
  592. package/dist/ui/components/ui/textarea.d.ts +23 -0
  593. package/dist/ui/components/ui/textarea.js.map +1 -1
  594. package/dist/ui/components/ui/toast.cjs.map +1 -1
  595. package/dist/ui/components/ui/toast.d.cts +136 -0
  596. package/dist/ui/components/ui/toast.d.ts +136 -0
  597. package/dist/ui/components/ui/toast.js.map +1 -1
  598. package/dist/ui/components/ui/toaster.cjs.map +1 -1
  599. package/dist/ui/components/ui/toaster.d.cts +12 -3
  600. package/dist/ui/components/ui/toaster.d.ts +12 -3
  601. package/dist/ui/components/ui/toaster.js.map +1 -1
  602. package/dist/ui/components/ui/toggle-components.cjs.map +1 -1
  603. package/dist/ui/components/ui/toggle-components.d.cts +15 -0
  604. package/dist/ui/components/ui/toggle-components.d.ts +15 -0
  605. package/dist/ui/components/ui/toggle-components.js.map +1 -1
  606. package/dist/ui/components/ui/toggle-group.cjs.map +1 -1
  607. package/dist/ui/components/ui/toggle-group.d.cts +33 -0
  608. package/dist/ui/components/ui/toggle-group.d.ts +33 -0
  609. package/dist/ui/components/ui/toggle-group.js.map +1 -1
  610. package/dist/ui/components/ui/toggle-variants.cjs.map +1 -1
  611. package/dist/ui/components/ui/toggle-variants.d.cts +15 -0
  612. package/dist/ui/components/ui/toggle-variants.d.ts +15 -0
  613. package/dist/ui/components/ui/toggle-variants.js.map +1 -1
  614. package/dist/ui/components/ui/toolbar.cjs.map +1 -1
  615. package/dist/ui/components/ui/toolbar.d.cts +94 -7
  616. package/dist/ui/components/ui/toolbar.d.ts +94 -7
  617. package/dist/ui/components/ui/toolbar.js.map +1 -1
  618. package/dist/ui/components/ui/tooltip.cjs.map +1 -1
  619. package/dist/ui/components/ui/tooltip.d.cts +54 -3
  620. package/dist/ui/components/ui/tooltip.d.ts +54 -3
  621. package/dist/ui/components/ui/tooltip.js.map +1 -1
  622. package/dist/ui/lib/hooks/use-gps.cjs.map +1 -1
  623. package/dist/ui/lib/hooks/use-gps.d.cts +29 -4
  624. package/dist/ui/lib/hooks/use-gps.d.ts +29 -4
  625. package/dist/ui/lib/hooks/use-gps.js.map +1 -1
  626. package/dist/ui/lib/hooks/use-is-client.cjs.map +1 -1
  627. package/dist/ui/lib/hooks/use-is-client.d.cts +11 -2
  628. package/dist/ui/lib/hooks/use-is-client.d.ts +11 -2
  629. package/dist/ui/lib/hooks/use-is-client.js.map +1 -1
  630. package/dist/ui/lib/hooks/use-keyboard-shortcut.cjs.map +1 -1
  631. package/dist/ui/lib/hooks/use-keyboard-shortcut.d.cts +48 -18
  632. package/dist/ui/lib/hooks/use-keyboard-shortcut.d.ts +48 -18
  633. package/dist/ui/lib/hooks/use-keyboard-shortcut.js.map +1 -1
  634. package/dist/ui/lib/hooks/use-mobile.cjs.map +1 -1
  635. package/dist/ui/lib/hooks/use-mobile.d.cts +11 -3
  636. package/dist/ui/lib/hooks/use-mobile.d.ts +11 -3
  637. package/dist/ui/lib/hooks/use-mobile.js.map +1 -1
  638. package/dist/ui/lib/hooks/use-toast.cjs.map +1 -1
  639. package/dist/ui/lib/hooks/use-toast.d.cts +184 -15
  640. package/dist/ui/lib/hooks/use-toast.d.ts +184 -15
  641. package/dist/ui/lib/hooks/use-toast.js.map +1 -1
  642. package/dist/ui/lib/ime-utils.cjs.map +1 -1
  643. package/dist/ui/lib/ime-utils.d.cts +40 -13
  644. package/dist/ui/lib/ime-utils.d.ts +40 -13
  645. package/dist/ui/lib/ime-utils.js.map +1 -1
  646. package/dist/ui/lib/utils.cjs.map +1 -1
  647. package/dist/ui/lib/utils.d.cts +9 -6
  648. package/dist/ui/lib/utils.d.ts +9 -6
  649. package/dist/ui/lib/utils.js.map +1 -1
  650. package/docs/ai.md +34 -1
  651. package/docs/exports.md +5 -1
  652. package/docs/index.md +89 -16
  653. package/docs/migration.md +268 -0
  654. package/docs/request-form.md +4 -1
  655. package/docs/tools.md +4 -1
  656. package/docs/ui.md +4 -1
  657. package/llms-full.txt +499 -36
  658. package/llms.txt +4 -0
  659. package/package.json +35 -5
@@ -2,159 +2,209 @@ import { default as React } from 'react';
2
2
  import { OAuthProvider } from './types.js';
3
3
  import * as z from 'zod';
4
4
  /**
5
- * ソーシャルログインプロバイダーの設定
5
+ * OAuth button configuration rendered by LoginForm.
6
6
  *
7
- * @example
8
- * ```tsx
9
- * const providers: SocialProviderConfig[] = [
10
- * { provider: 'google', label: 'Login with Google' },
11
- * { provider: 'line-oidc', label: 'LINEでログイン', icon: <LineIcon /> },
12
- * ];
13
- * ```
7
+ * @see LoginForm for complete provider setup.
14
8
  */
15
9
  export interface SocialProviderConfig {
16
- /** プロバイダー識別子(組み込みまたはカスタム OIDC プロバイダー名) */
10
+ /**
11
+ * Identifier passed to adapter.loginWithProvider; actual support is host-configured.
12
+ */
17
13
  provider: OAuthProvider;
18
- /** ボタンに表示するラベル */
14
+ /**
15
+ * Visible button text.
16
+ */
19
17
  label: string;
20
- /** アイコン(ReactNode)。省略時はデフォルトアイコンを使用 */
18
+ /**
19
+ * Optional icon; omission uses Apple/Google artwork or a generic globe.
20
+ */
21
21
  icon?: React.ReactNode;
22
22
  }
23
23
  /**
24
- * ログイン用のフォームコンポーネント。メールアドレスとパスワードによる認証、およびソーシャルログインに対応します。
24
+ * Renders email/password login and optional OAuth provider buttons.
25
25
  *
26
- * @param props - コンポーネントのプロパティ
27
- * @param props.onSuccess - ログイン成功時のコールバック
28
- * @param props.socialProviders - ソーシャルログインプロバイダーの設定(省略時は Apple + Google)
29
- * @param props.showRegisterLink - 新規登録リンクを表示するか(デフォルト: true)
30
- * @param props.showEmailLogin - メールアドレスとパスワードのログイン欄を表示するか(デフォルト: true)
31
- * @param props.redirectTo - ソーシャルログイン後の移動先(デフォルト: 現在のドメインの `/`)
32
- * @param props.onRegisterClick - 新規登録リンククリック時のコールバック(設定するとリンクが表示される)
26
+ * @param props - Success/navigation callbacks, provider buttons and optional visibility settings.
27
+ *
28
+ * @returns Login form with validation, pending state and an error alert.
29
+ *
30
+ * @throws Error without AuthProvider; email/OAuth action failures are caught and shown as messages.
31
+ *
32
+ * @remarks Requires AuthProvider inside QueryClientProvider, React Hook Form, Zod and Appkit
33
+ * styles. Email must be valid and password at least six characters before submission.
34
+ * Email success invokes onSuccess; OAuth success does not. OAuth buttons exist only
35
+ * when the adapter supplies loginWithProvider. The host configures real authentication.
33
36
  *
34
37
  * @example
35
38
  * ```tsx
36
- * <LoginForm
37
- * onSuccess={() => navigate('/dashboard')}
38
- * socialProviders={[{ provider: 'google', label: 'Googleでログイン' }]}
39
- * />
39
+ * import '@alneas/appkit-react/styles';
40
+ * import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
41
+ * import { AuthProvider, LoginForm, type AuthAdapter } from '@alneas/appkit-react/tools/auth';
42
+ * export function FormExample({ adapter, queryClient }: { adapter: AuthAdapter; queryClient: QueryClient }) {
43
+ * return <QueryClientProvider client={queryClient}><AuthProvider adapter={adapter}><LoginForm socialProviders={[{ provider: 'google', label: 'Google' }]} /></AuthProvider></QueryClientProvider>;
44
+ * }
40
45
  * ```
41
46
  */
42
47
  export declare function LoginForm({ onSuccess, socialProviders, showRegisterLink, showEmailLogin, redirectTo, onRegisterClick, }: {
48
+ /**
49
+ * Optional synchronous callback after successful email/password login; thrown errors become form error messages.
50
+ */
43
51
  onSuccess?: () => void;
52
+ /**
53
+ * OAuth button definitions; omission uses Apple and Google, empty array hides buttons.
54
+ */
44
55
  socialProviders?: SocialProviderConfig[];
56
+ /**
57
+ * Show the register action only when onRegisterClick also exists; defaults to true.
58
+ */
45
59
  showRegisterLink?: boolean;
60
+ /**
61
+ * Show email/password fields and submit button; defaults to true.
62
+ */
46
63
  showEmailLogin?: boolean;
64
+ /**
65
+ * OAuth destination resolved against window.location.origin; defaults to /.
66
+ */
47
67
  redirectTo?: string;
68
+ /**
69
+ * Optional synchronous click handler for the register action.
70
+ */
48
71
  onRegisterClick?: () => void;
49
72
  }): React.JSX.Element;
50
73
  /**
51
- * ユーザー登録フォームの既存フィールド(name/email/password)の表示設定。
52
- * 各フィールドの表示/非表示、ラベル、プレースホルダーを個別にカスタマイズできます。
74
+ * Visibility, label and placeholder overrides for the three built-in registration fields.
53
75
  *
54
- * @example
55
- * ```tsx
56
- * // name フィールドを非表示にして、email のラベルを変更
57
- * <RegisterForm fields={{ name: { show: false }, email: { label: 'Email Address' } }} />
58
- * ```
76
+ * @remarks All fields default to visible; labels/placeholders are localized. Hiding email
77
+ * or password does not remove their required schema validation.
78
+ *
79
+ * @see RegisterForm for usage.
59
80
  */
60
81
  export interface RegisterFieldConfig {
61
- /** 名前フィールドの設定 */
82
+ /**
83
+ * Overrides for optional display-name input.
84
+ */
62
85
  name?: {
86
+ /** Visibility override; defaults to true. */
63
87
  show?: boolean;
88
+ /** Localized label override. */
64
89
  label?: string;
90
+ /** Placeholder override. */
65
91
  placeholder?: string;
66
92
  };
67
- /** メールアドレスフィールドの設定 */
93
+ /**
94
+ * Overrides for required email input; hiding it does not skip validation.
95
+ */
68
96
  email?: {
97
+ /** Visibility override; defaults to true. */
69
98
  show?: boolean;
99
+ /** Localized label override. */
70
100
  label?: string;
101
+ /** Placeholder override. */
71
102
  placeholder?: string;
72
103
  };
73
- /** パスワードフィールドの設定 */
104
+ /**
105
+ * Overrides for required password input; hiding it does not skip validation.
106
+ */
74
107
  password?: {
108
+ /** Visibility override; defaults to true. */
75
109
  show?: boolean;
110
+ /** Localized label override. */
76
111
  label?: string;
112
+ /** Placeholder override. */
77
113
  placeholder?: string;
78
114
  };
79
115
  }
80
116
  /**
81
- * 登録フォームに追加するカスタムフィールドの設定。
82
- * `type` に応じて適切な入力 UI が自動選択され、`validation` で Zod スキーマを指定すると
83
- * 自動生成のバリデーションを上書きできます。
117
+ * Additional registration input rendered and validated locally by RegisterForm.
84
118
  *
85
- * @example
86
- * ```tsx
87
- * const extraFields: RegisterExtraField[] = [
88
- * { name: 'phone', label: 'Phone', type: 'tel', required: true },
89
- * { name: 'birthDate', label: 'Birth Date', type: 'date' },
90
- * { name: 'company', label: 'Company', type: 'text' },
91
- * { name: 'role', label: 'Role', type: 'select', required: true,
92
- * options: [{ label: 'Admin', value: 'admin' }, { label: 'User', value: 'user' }] },
93
- * { name: 'agreement', label: 'Agree to terms', type: 'checkbox', required: true },
94
- * ];
95
- * ```
119
+ * @remarks These values are not passed to AuthAdapter.register: the bundled form sends
120
+ * only email, password and name. Use host-owned persistence to save other fields.
121
+ * Custom validation overrides automatic type/required rules.
96
122
  *
97
- * カスタムバリデーション:
98
- * ```tsx
99
- * { name: 'phone', label: 'Phone', type: 'tel', required: true,
100
- * validation: z.string().regex(/^0[0-9]{9,10}$/, 'Invalid phone number') }
101
- * ```
123
+ * @see RegisterForm for complete usage.
102
124
  */
103
125
  export interface RegisterExtraField {
104
- /** フィールドのキー名(フォームデータのプロパティ名) */
126
+ /**
127
+ * Unique form-data key; avoid built-in email/password/name collisions unless intentionally replacing their schema.
128
+ */
105
129
  name: string;
106
- /** ラベル */
130
+ /**
131
+ * Visible field label.
132
+ */
107
133
  label: string;
108
- /** 入力 UI の種類。`date` はネイティブの日付ピッカー、`tel` はテンキー入力に対応 */
134
+ /**
135
+ * Input presentation, default text. tel/url use text input modes, date uses schema date format.
136
+ */
109
137
  type?: 'text' | 'email' | 'tel' | 'date' | 'number' | 'url' | 'password' | 'textarea' | 'select' | 'checkbox';
110
- /** プレースホルダー */
138
+ /**
139
+ * Optional input hint passed where supported by the rendered control.
140
+ */
111
141
  placeholder?: string;
112
- /** 必須フィールドとするか */
142
+ /**
143
+ * Add required default validation; omission is optional except optional checkbox still expects a boolean.
144
+ */
113
145
  required?: boolean;
114
- /** autocomplete 属性 */
146
+ /**
147
+ * Optional browser autocomplete hint where supported.
148
+ */
115
149
  autoComplete?: string;
116
- /** `type='select'` の場合の選択肢 */
150
+ /**
151
+ * Select choices; defaults to an empty list for a select without options.
152
+ */
117
153
  options?: {
154
+ /** Display text. */
118
155
  label: string;
156
+ /** Submitted choice value. */
119
157
  value: string;
120
158
  }[];
121
159
  /**
122
- * カスタム Zod バリデーション。
123
- * 省略時は `type` と `required` から自動生成されます。
124
- * @example z.string().regex(/^0[0-9]{9,10}$/)
160
+ * Optional Zod schema replacing generated validation for this field.
125
161
  */
126
162
  validation?: z.ZodTypeAny;
127
163
  }
128
164
  /**
129
- * ユーザー登録用のフォームコンポーネント。メールアドレス、パスワード、および任意の氏名の入力を受け付けます。
130
- * `fields` で既存フィールドの表示/非表示やラベルを、`extraFields` で任意の追加項目を設定できます。
165
+ * Renders account registration with built-in field overrides and optional local extra inputs.
166
+ *
167
+ * @param props - Registration success/navigation callbacks and field presentation settings.
168
+ *
169
+ * @returns Validated form, pending submit button and error feedback.
131
170
  *
132
- * @param props - コンポーネントのプロパティ
133
- * @param props.onSuccess - 登録成功時のコールバック
134
- * @param props.fields - 既存フィールド(name/email/password)の表示カスタマイズ
135
- * @param props.extraFields - 追加フィールドの定義(電話番号、生年月日など任意の項目)
136
- * @param props.showLoginLink - ログインページへのリンクを表示するか(デフォルト: true)
137
- * @param props.onLoginClick - ログインリンククリック時のコールバック
171
+ * @throws Error without AuthProvider; registration and onSuccess failures are shown as form errors.
172
+ *
173
+ * @remarks Requires AuthProvider inside QueryClientProvider, React Hook Form, Zod and Appkit
174
+ * styles. Email must be valid; password requires six characters; name is optional.
175
+ * Extra inputs are validated and rendered but not persisted by this component: only
176
+ * email, password and {name} reach adapter.register. Hidden built-in fields remain in
177
+ * validation. Custom extra schemas can override built-in names, so avoid collisions.
138
178
  *
139
179
  * @example
140
180
  * ```tsx
141
- * // 基本
142
- * <RegisterForm onSuccess={() => navigate('/login')} />
143
- *
144
- * // name 非表示 + 追加フィールド
145
- * <RegisterForm
146
- * fields={{ name: { show: false } }}
147
- * extraFields={[
148
- * { name: 'phone', label: 'Phone', type: 'tel', required: true },
149
- * { name: 'birthDate', label: 'Birth Date', type: 'date' },
150
- * ]}
151
- * />
181
+ * import '@alneas/appkit-react/styles';
182
+ * import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
183
+ * import { AuthProvider, RegisterForm, type AuthAdapter } from '@alneas/appkit-react/tools/auth';
184
+ * export function FormExample({ adapter, queryClient }: { adapter: AuthAdapter; queryClient: QueryClient }) {
185
+ * return <QueryClientProvider client={queryClient}><AuthProvider adapter={adapter}><RegisterForm fields={{ name: { label: 'Display name' } }} /></AuthProvider></QueryClientProvider>;
186
+ * }
152
187
  * ```
153
188
  */
154
189
  export declare function RegisterForm({ onSuccess, fields, extraFields, showLoginLink, onLoginClick, }: {
190
+ /**
191
+ * Optional synchronous callback after registration; thrown errors become form errors.
192
+ */
155
193
  onSuccess?: () => void;
194
+ /**
195
+ * Optional visibility/label/placeholder overrides for name, email and password.
196
+ */
156
197
  fields?: RegisterFieldConfig;
198
+ /**
199
+ * Optional extra input definitions; validated locally but not forwarded to register.
200
+ */
157
201
  extraFields?: RegisterExtraField[];
202
+ /**
203
+ * Show login action when onLoginClick exists; defaults to true.
204
+ */
158
205
  showLoginLink?: boolean;
206
+ /**
207
+ * Optional synchronous click handler for the login action.
208
+ */
159
209
  onLoginClick?: () => void;
160
210
  }): React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"AuthForms.js","names":["z","m.auth_validation_invalidEmail","m.auth_validation_passwordLength","m.auth_loginWithApple","m.auth_loginWithGoogle","m.auth_failedToLogin","m.auth_socialLoginFailed","_Fragment","m.auth_orContinueWith","m.auth_email","m.auth_emailPlaceholder","m.auth_password","m.auth_loggingIn","m.signIn","m.auth_dontHaveAccount","m.signUp","m.auth_name","m.auth_namePlaceholder","m.auth_validation_invalidNumber","m.auth_validation_required","m.auth_failedToRegister","m.auth_registering","m.auth_alreadyHaveAccount","auth_alreadyhaveaccount2","auth_donthaveaccount2","auth_emailplaceholder1","auth_failedtologin2","auth_failedtoregister2","auth_loggingin1","auth_loginwithapple2","auth_loginwithgoogle2","auth_nameplaceholder1","auth_orcontinuewith2","auth_socialloginfailed2","auth_validation_invalidemail1","auth_validation_invalidnumber1","auth_validation_passwordlength1","signin1","signup1","React","z$1","loginSchema","registerSchema","AppleIcon","GoogleIcon","DefaultProviderIcon","builtInIcons","defaultSocialProviders","LoginForm","useAuth","error","setError","useState","isPending","setIsPending","useForm","zodResolver","onSubmit","login","values","onSuccess","err","handleSocialLogin","loginWithProvider","provider","redirectTo","providers","socialProviders","Form","handleSubmit","Alert","AlertCircle","AlertDescription","Fragment","Button","isSubmitting","config","showEmailLogin","FieldSeparator","AutoFormField","auth_email","auth_password","showRegisterLink","onRegisterClick","defaultFieldConfig","auth_name","resolveFieldConfig","cfg","fields","key","buildExtraFieldSchema","shape","field","auth_validation_required","renderExtraField","commonProps","inputProps","supportedType","RegisterForm","extraFieldSchema","extraFields","finalSchema","f","acc","register","nameCfg","emailCfg","passwordCfg","control","auth_registering","showLoginLink","onLoginClick"],"sources":["../../../../src/tools/components/auth/AuthForms.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport * as z from 'zod';\nimport { useAuth } from './useAuth';\nimport { Button } from '../ui/button';\nimport { Form, AutoFormField } from '../ui/form';\nimport { FieldSeparator } from '../ui/field';\nimport { Alert, AlertDescription } from '../ui/alert';\nimport { OAuthProvider } from './types';\nimport { AlertCircle } from 'lucide-react';\nimport * as m from '../../paraglide/messages.js';\n\nconst loginSchema = z.object({\n email: z.string().email({ message: m.auth_validation_invalidEmail() }),\n password: z.string().min(6, { message: m.auth_validation_passwordLength() }),\n});\n\nconst registerSchema = z.object({\n email: z.string().email({ message: m.auth_validation_invalidEmail() }),\n password: z.string().min(6, { message: m.auth_validation_passwordLength() }),\n name: z.string().optional(),\n});\n\n/**\n * ソーシャルログインプロバイダーの設定\n *\n * @example\n * ```tsx\n * const providers: SocialProviderConfig[] = [\n * { provider: 'google', label: 'Login with Google' },\n * { provider: 'line-oidc', label: 'LINEでログイン', icon: <LineIcon /> },\n * ];\n * ```\n */\nexport interface SocialProviderConfig {\n /** プロバイダー識別子(組み込みまたはカスタム OIDC プロバイダー名) */\n provider: OAuthProvider;\n /** ボタンに表示するラベル */\n label: string;\n /** アイコン(ReactNode)。省略時はデフォルトアイコンを使用 */\n icon?: React.ReactNode;\n}\n\n/** Apple のデフォルトアイコン */\nconst AppleIcon = () => (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' className='mr-2 h-4 w-4'>\n <path\n d='M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701'\n fill='currentColor'\n />\n </svg>\n);\n\n/** Google のデフォルトアイコン */\nconst GoogleIcon = () => (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' className='mr-2 h-4 w-4'>\n <path\n d='M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z'\n fill='currentColor'\n />\n </svg>\n);\n\n/** カスタムプロバイダー用のデフォルトアイコン(Globe) */\nconst DefaultProviderIcon = () => (\n <svg\n xmlns='http://www.w3.org/2000/svg'\n viewBox='0 0 24 24'\n fill='none'\n stroke='currentColor'\n strokeWidth='2'\n strokeLinecap='round'\n strokeLinejoin='round'\n className='mr-2 h-4 w-4'\n >\n <circle cx='12' cy='12' r='10' />\n <path d='M2 12h20' />\n <path d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z' />\n </svg>\n);\n\n/** 組み込みプロバイダーのデフォルトアイコンマップ */\nconst builtInIcons: Record<string, React.ReactNode> = {\n apple: <AppleIcon />,\n google: <GoogleIcon />,\n};\n\n/** デフォルトのソーシャルプロバイダー設定(後方互換用) */\nconst defaultSocialProviders: SocialProviderConfig[] = [\n { provider: 'apple', label: m.auth_loginWithApple() },\n { provider: 'google', label: m.auth_loginWithGoogle() },\n];\n\n/**\n * ログイン用のフォームコンポーネント。メールアドレスとパスワードによる認証、およびソーシャルログインに対応します。\n *\n * @param props - コンポーネントのプロパティ\n * @param props.onSuccess - ログイン成功時のコールバック\n * @param props.socialProviders - ソーシャルログインプロバイダーの設定(省略時は Apple + Google)\n * @param props.showRegisterLink - 新規登録リンクを表示するか(デフォルト: true)\n * @param props.showEmailLogin - メールアドレスとパスワードのログイン欄を表示するか(デフォルト: true)\n * @param props.redirectTo - ソーシャルログイン後の移動先(デフォルト: 現在のドメインの `/`)\n * @param props.onRegisterClick - 新規登録リンククリック時のコールバック(設定するとリンクが表示される)\n *\n * @example\n * ```tsx\n * <LoginForm\n * onSuccess={() => navigate('/dashboard')}\n * socialProviders={[{ provider: 'google', label: 'Googleでログイン' }]}\n * />\n * ```\n */\nexport function LoginForm({\n onSuccess,\n socialProviders,\n showRegisterLink = true,\n showEmailLogin = true,\n redirectTo = '/',\n onRegisterClick,\n}: {\n onSuccess?: () => void;\n socialProviders?: SocialProviderConfig[];\n showRegisterLink?: boolean;\n showEmailLogin?: boolean;\n redirectTo?: string;\n onRegisterClick?: () => void;\n}) {\n const { login, loginWithProvider } = useAuth();\n const [error, setError] = useState<string | null>(null);\n const [isPending, setIsPending] = useState(false);\n\n const form = useForm<z.infer<typeof loginSchema>>({\n resolver: zodResolver(loginSchema),\n defaultValues: {\n email: '',\n password: '',\n },\n });\n\n const {\n handleSubmit,\n control,\n formState: { isSubmitting },\n } = form;\n\n async function onSubmit(values: z.infer<typeof loginSchema>) {\n try {\n setIsPending(true);\n setError(null);\n await login(values.email, values.password);\n if (onSuccess) onSuccess();\n } catch (err) {\n setError(err instanceof Error ? err.message : m.auth_failedToLogin());\n } finally {\n setIsPending(false);\n }\n }\n\n const handleSocialLogin = async (provider: OAuthProvider) => {\n if (!loginWithProvider) return;\n\n try {\n setError(null);\n await loginWithProvider(provider, {\n redirectTo: new URL(redirectTo, window.location.origin).href,\n });\n } catch (err) {\n setError(err instanceof Error ? err.message : m.auth_socialLoginFailed());\n }\n };\n\n const providers = socialProviders ?? defaultSocialProviders;\n\n return (\n <Form.Root onSubmit={handleSubmit(onSubmit)} className='space-y-4'>\n {error && (\n <Alert variant='destructive'>\n <AlertCircle className='h-4 w-4' />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n {loginWithProvider && providers.length > 0 && (\n <>\n <div className='flex flex-col gap-2'>\n {providers.map((config) => (\n <Button\n key={config.provider}\n variant='outline'\n type='button'\n disabled={isPending || isSubmitting}\n onClick={() => handleSocialLogin(config.provider)}\n >\n {config.icon ?? builtInIcons[config.provider] ?? <DefaultProviderIcon />}\n {config.label}\n </Button>\n ))}\n </div>\n\n {showEmailLogin && (\n <FieldSeparator className='*:data-[slot=field-separator-content]:bg-card'>\n {m.auth_orContinueWith()}\n </FieldSeparator>\n )}\n </>\n )}\n\n {showEmailLogin && (\n <>\n <AutoFormField\n control={control}\n name='email'\n label={m.auth_email()}\n inputProps={{ placeholder: m.auth_emailPlaceholder() }}\n />\n\n <AutoFormField\n control={control}\n name='password'\n label={m.auth_password()}\n type='password'\n inputProps={{ autoComplete: 'current-password' }}\n />\n\n <Button type='submit' className='w-full' disabled={isPending || isSubmitting}>\n {isPending ? m.auth_loggingIn() : m.signIn()}\n </Button>\n </>\n )}\n\n {showRegisterLink && onRegisterClick && (\n <div className='text-center text-sm text-muted-foreground'>\n {m.auth_dontHaveAccount()}{' '}\n <Button type='button' variant='link' className='p-0 h-auto' onClick={onRegisterClick}>\n {m.signUp()}\n </Button>\n </div>\n )}\n </Form.Root>\n );\n}\n\n/**\n * ユーザー登録フォームの既存フィールド(name/email/password)の表示設定。\n * 各フィールドの表示/非表示、ラベル、プレースホルダーを個別にカスタマイズできます。\n *\n * @example\n * ```tsx\n * // name フィールドを非表示にして、email のラベルを変更\n * <RegisterForm fields={{ name: { show: false }, email: { label: 'Email Address' } }} />\n * ```\n */\nexport interface RegisterFieldConfig {\n /** 名前フィールドの設定 */\n name?: { show?: boolean; label?: string; placeholder?: string };\n /** メールアドレスフィールドの設定 */\n email?: { show?: boolean; label?: string; placeholder?: string };\n /** パスワードフィールドの設定 */\n password?: { show?: boolean; label?: string; placeholder?: string };\n}\n\n/**\n * 登録フォームに追加するカスタムフィールドの設定。\n * `type` に応じて適切な入力 UI が自動選択され、`validation` で Zod スキーマを指定すると\n * 自動生成のバリデーションを上書きできます。\n *\n * @example\n * ```tsx\n * const extraFields: RegisterExtraField[] = [\n * { name: 'phone', label: 'Phone', type: 'tel', required: true },\n * { name: 'birthDate', label: 'Birth Date', type: 'date' },\n * { name: 'company', label: 'Company', type: 'text' },\n * { name: 'role', label: 'Role', type: 'select', required: true,\n * options: [{ label: 'Admin', value: 'admin' }, { label: 'User', value: 'user' }] },\n * { name: 'agreement', label: 'Agree to terms', type: 'checkbox', required: true },\n * ];\n * ```\n *\n * カスタムバリデーション:\n * ```tsx\n * { name: 'phone', label: 'Phone', type: 'tel', required: true,\n * validation: z.string().regex(/^0[0-9]{9,10}$/, 'Invalid phone number') }\n * ```\n */\nexport interface RegisterExtraField {\n /** フィールドのキー名(フォームデータのプロパティ名) */\n name: string;\n /** ラベル */\n label: string;\n /** 入力 UI の種類。`date` はネイティブの日付ピッカー、`tel` はテンキー入力に対応 */\n type?: 'text' | 'email' | 'tel' | 'date' | 'number' | 'url' | 'password' | 'textarea' | 'select' | 'checkbox';\n /** プレースホルダー */\n placeholder?: string;\n /** 必須フィールドとするか */\n required?: boolean;\n /** autocomplete 属性 */\n autoComplete?: string;\n /** `type='select'` の場合の選択肢 */\n options?: { label: string; value: string }[];\n /**\n * カスタム Zod バリデーション。\n * 省略時は `type` と `required` から自動生成されます。\n * @example z.string().regex(/^0[0-9]{9,10}$/)\n */\n validation?: z.ZodTypeAny;\n}\n\nconst defaultFieldConfig = {\n name: { show: true, label: m.auth_name(), placeholder: m.auth_namePlaceholder() },\n email: { show: true, label: m.auth_email(), placeholder: m.auth_emailPlaceholder() },\n password: { show: true, label: m.auth_password(), placeholder: '' },\n};\n\nfunction resolveFieldConfig(\n fields: RegisterFieldConfig | undefined,\n key: keyof RegisterFieldConfig,\n) {\n const cfg = fields?.[key];\n if (!cfg) return defaultFieldConfig[key];\n return {\n show: cfg.show ?? defaultFieldConfig[key].show,\n label: cfg.label ?? defaultFieldConfig[key].label,\n placeholder: cfg.placeholder ?? defaultFieldConfig[key].placeholder,\n };\n}\n\nfunction buildExtraFieldSchema(fields: RegisterExtraField[]): z.ZodObject<any> {\n const shape: Record<string, z.ZodTypeAny> = {};\n for (const field of fields) {\n if (field.validation) {\n shape[field.name] = field.validation;\n } else if (field.type === 'email') {\n shape[field.name] = field.required\n ? z.string().email({ message: m.auth_validation_invalidEmail() })\n : z.string().email({ message: m.auth_validation_invalidEmail() }).optional().or(z.literal(''));\n } else if (field.type === 'number') {\n shape[field.name] = field.required\n ? z.coerce.number({ message: m.auth_validation_invalidNumber() })\n : z.coerce.number({ message: m.auth_validation_invalidNumber() }).optional();\n } else if (field.type === 'checkbox') {\n shape[field.name] = field.required\n ? z.literal(true, { message: m.auth_validation_required() })\n : z.boolean();\n } else {\n shape[field.name] = field.required\n ? z.string().min(1, m.auth_validation_required())\n : z.string().optional();\n }\n }\n return z.object(shape);\n}\n\nfunction renderExtraField(field: RegisterExtraField, control: any) {\n const commonProps = {\n control,\n name: field.name,\n label: field.label,\n required: field.required,\n };\n\n const inputProps: Record<string, any> = {};\n if (field.placeholder) inputProps.placeholder = field.placeholder;\n if (field.autoComplete) inputProps.autoComplete = field.autoComplete;\n\n if (field.type === 'date') {\n return (\n <AutoFormField\n {...commonProps}\n jsonSchema={{ type: 'string', format: 'date' }}\n />\n );\n }\n\n if (field.type === 'select') {\n return (\n <AutoFormField\n {...commonProps}\n type='select'\n options={field.options ?? []}\n />\n );\n }\n\n if (field.type === 'checkbox') {\n return <AutoFormField {...commonProps} type='checkbox' />;\n }\n\n if (field.type === 'textarea') {\n return (\n <AutoFormField\n {...commonProps}\n type='textarea'\n inputProps={inputProps}\n />\n );\n }\n\n if (field.type === 'tel') inputProps.inputMode = 'tel';\n if (field.type === 'url') inputProps.inputMode = 'url';\n\n const supportedType = ['text', 'number', 'email', 'password'].includes(field.type ?? 'text')\n ? (field.type as 'text' | 'number' | 'email' | 'password')\n : 'text';\n\n return (\n <AutoFormField\n {...commonProps}\n type={supportedType}\n inputProps={Object.keys(inputProps).length > 0 ? inputProps : undefined}\n />\n );\n}\n\n/**\n * ユーザー登録用のフォームコンポーネント。メールアドレス、パスワード、および任意の氏名の入力を受け付けます。\n * `fields` で既存フィールドの表示/非表示やラベルを、`extraFields` で任意の追加項目を設定できます。\n *\n * @param props - コンポーネントのプロパティ\n * @param props.onSuccess - 登録成功時のコールバック\n * @param props.fields - 既存フィールド(name/email/password)の表示カスタマイズ\n * @param props.extraFields - 追加フィールドの定義(電話番号、生年月日など任意の項目)\n * @param props.showLoginLink - ログインページへのリンクを表示するか(デフォルト: true)\n * @param props.onLoginClick - ログインリンククリック時のコールバック\n *\n * @example\n * ```tsx\n * // 基本\n * <RegisterForm onSuccess={() => navigate('/login')} />\n *\n * // name 非表示 + 追加フィールド\n * <RegisterForm\n * fields={{ name: { show: false } }}\n * extraFields={[\n * { name: 'phone', label: 'Phone', type: 'tel', required: true },\n * { name: 'birthDate', label: 'Birth Date', type: 'date' },\n * ]}\n * />\n * ```\n */\nexport function RegisterForm({\n onSuccess,\n fields,\n extraFields,\n showLoginLink = true,\n onLoginClick,\n}: {\n onSuccess?: () => void;\n fields?: RegisterFieldConfig;\n extraFields?: RegisterExtraField[];\n showLoginLink?: boolean;\n onLoginClick?: () => void;\n}) {\n const { register } = useAuth();\n const [error, setError] = useState<string | null>(null);\n const [isPending, setIsPending] = useState(false);\n\n const extraFieldSchema = extraFields?.length ? buildExtraFieldSchema(extraFields) : null;\n const finalSchema = extraFieldSchema ? registerSchema.extend(extraFieldSchema.shape) : registerSchema;\n\n const form = useForm<any>({\n resolver: zodResolver(finalSchema),\n defaultValues: {\n email: '',\n password: '',\n name: '',\n ...(extraFields?.reduce((acc, f) => {\n acc[f.name] = f.type === 'checkbox' ? false : '';\n return acc;\n }, {} as Record<string, any>)),\n },\n });\n\n const {\n handleSubmit,\n control,\n formState: { isSubmitting },\n } = form;\n\n async function onSubmit(values: any) {\n try {\n setIsPending(true);\n setError(null);\n await register(values.email, values.password, { name: values.name });\n if (onSuccess) onSuccess();\n } catch (err) {\n setError(err instanceof Error ? err.message : m.auth_failedToRegister());\n } finally {\n setIsPending(false);\n }\n }\n\n return (\n <Form.Root onSubmit={handleSubmit(onSubmit)} className='space-y-4'>\n {error && (\n <Alert variant='destructive'>\n <AlertCircle className='h-4 w-4' />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n {(() => {\n const nameCfg = resolveFieldConfig(fields, 'name');\n const emailCfg = resolveFieldConfig(fields, 'email');\n const passwordCfg = resolveFieldConfig(fields, 'password');\n return (\n <>\n {nameCfg.show && (\n <AutoFormField\n control={control}\n name='name'\n label={nameCfg.label}\n inputProps={{ placeholder: nameCfg.placeholder }}\n />\n )}\n {emailCfg.show && (\n <AutoFormField\n control={control}\n name='email'\n label={emailCfg.label}\n inputProps={{ placeholder: emailCfg.placeholder }}\n />\n )}\n {passwordCfg.show && (\n <AutoFormField\n control={control}\n name='password'\n label={passwordCfg.label}\n type='password'\n inputProps={{ autoComplete: 'new-password', placeholder: passwordCfg.placeholder || undefined }}\n />\n )}\n </>\n );\n })()}\n\n {extraFields?.length ? (\n <div className='space-y-4'>\n {extraFields.map((field) => (\n <React.Fragment key={field.name}>\n {renderExtraField(field, control)}\n </React.Fragment>\n ))}\n </div>\n ) : null}\n\n <Button type='submit' className='w-full' disabled={isPending || isSubmitting}>\n {isPending ? m.auth_registering() : m.signUp()}\n </Button>\n\n {showLoginLink && onLoginClick && (\n <div className='text-center text-sm text-muted-foreground'>\n {m.auth_alreadyHaveAccount()}{' '}\n <Button type='button' variant='link' className='p-0 h-auto' onClick={onLoginClick}>\n {m.signIn()}\n </Button>\n </div>\n )}\n </Form.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMyC,IAAczC,EAAE,OAAO;CAC3B,OAAOA,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,SAASC,EAA+B,EAAE,CAAC;CACr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B,CAAO,EAClB,GAFKhB,EAAM,IAEX,CACjB;GACE,CAAA,IACH;GAEJ,kBAAClB,GAAD;IAAQ,MAAK;IAAS,WAAU;IAAS,UAAUrB,KAAasB;IAC7D,UAAAtB,IAAYhC,EAAmB,IAAIN,EAAS;GACvC,CAAA;GAEP+F,KAAiBC,KAChB,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACGzF,EAA0B;KAAG;KAC9B,kBAACoD,GAAD;MAAQ,MAAK;MAAS,SAAQ;MAAO,WAAU;MAAa,SAASqC;MAClE,UAAAlG,EAAS;KACJ,CAAA;IACL;;EAEE;;AAEf"}
1
+ {"version":3,"file":"AuthForms.js","names":["z","m.auth_validation_invalidEmail","m.auth_validation_passwordLength","m.auth_loginWithApple","m.auth_loginWithGoogle","m.auth_failedToLogin","m.auth_socialLoginFailed","_Fragment","m.auth_orContinueWith","m.auth_email","m.auth_emailPlaceholder","m.auth_password","m.auth_loggingIn","m.signIn","m.auth_dontHaveAccount","m.signUp","m.auth_name","m.auth_namePlaceholder","m.auth_validation_invalidNumber","m.auth_validation_required","m.auth_failedToRegister","m.auth_registering","m.auth_alreadyHaveAccount","auth_alreadyhaveaccount2","auth_donthaveaccount2","auth_emailplaceholder1","auth_failedtologin2","auth_failedtoregister2","auth_loggingin1","auth_loginwithapple2","auth_loginwithgoogle2","auth_nameplaceholder1","auth_orcontinuewith2","auth_socialloginfailed2","auth_validation_invalidemail1","auth_validation_invalidnumber1","auth_validation_passwordlength1","signin1","signup1","React","z$1","loginSchema","registerSchema","AppleIcon","GoogleIcon","DefaultProviderIcon","builtInIcons","defaultSocialProviders","LoginForm","useAuth","error","setError","useState","isPending","setIsPending","useForm","zodResolver","onSubmit","login","values","onSuccess","err","handleSocialLogin","loginWithProvider","provider","redirectTo","providers","socialProviders","Form","handleSubmit","Alert","AlertCircle","AlertDescription","Fragment","Button","isSubmitting","config","showEmailLogin","FieldSeparator","AutoFormField","auth_email","auth_password","showRegisterLink","onRegisterClick","defaultFieldConfig","auth_name","resolveFieldConfig","cfg","fields","key","buildExtraFieldSchema","shape","field","auth_validation_required","renderExtraField","commonProps","inputProps","supportedType","RegisterForm","extraFieldSchema","extraFields","finalSchema","f","acc","register","nameCfg","emailCfg","passwordCfg","control","auth_registering","showLoginLink","onLoginClick"],"sources":["../../../../src/tools/components/auth/AuthForms.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport * as z from 'zod';\nimport { useAuth } from './useAuth';\nimport { Button } from '../ui/button';\nimport { Form, AutoFormField } from '../ui/form';\nimport { FieldSeparator } from '../ui/field';\nimport { Alert, AlertDescription } from '../ui/alert';\nimport { OAuthProvider } from './types';\nimport { AlertCircle } from 'lucide-react';\nimport * as m from '../../paraglide/messages.js';\n\nconst loginSchema = z.object({\n email: z.string().email({ message: m.auth_validation_invalidEmail() }),\n password: z.string().min(6, { message: m.auth_validation_passwordLength() }),\n});\n\nconst registerSchema = z.object({\n email: z.string().email({ message: m.auth_validation_invalidEmail() }),\n password: z.string().min(6, { message: m.auth_validation_passwordLength() }),\n name: z.string().optional(),\n});\n\n/**\n * OAuth button configuration rendered by LoginForm.\n *\n * @see LoginForm for complete provider setup.\n */\nexport interface SocialProviderConfig {\n /**\n * Identifier passed to adapter.loginWithProvider; actual support is host-configured.\n */\n provider: OAuthProvider;\n /**\n * Visible button text.\n */\n label: string;\n /**\n * Optional icon; omission uses Apple/Google artwork or a generic globe.\n */\n icon?: React.ReactNode;\n}\n\n/** Default Apple icon. */\nconst AppleIcon = () => (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' className='mr-2 h-4 w-4'>\n <path\n d='M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701'\n fill='currentColor'\n />\n </svg>\n);\n\n/** Default Google icon. */\nconst GoogleIcon = () => (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' className='mr-2 h-4 w-4'>\n <path\n d='M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z'\n fill='currentColor'\n />\n </svg>\n);\n\n/** Generic globe for custom providers. */\nconst DefaultProviderIcon = () => (\n <svg\n xmlns='http://www.w3.org/2000/svg'\n viewBox='0 0 24 24'\n fill='none'\n stroke='currentColor'\n strokeWidth='2'\n strokeLinecap='round'\n strokeLinejoin='round'\n className='mr-2 h-4 w-4'\n >\n <circle cx='12' cy='12' r='10' />\n <path d='M2 12h20' />\n <path d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z' />\n </svg>\n);\n\n/** Default artwork for known provider names. */\nconst builtInIcons: Record<string, React.ReactNode> = {\n apple: <AppleIcon />,\n google: <GoogleIcon />,\n};\n\n/** Default Apple and Google button definitions. */\nconst defaultSocialProviders: SocialProviderConfig[] = [\n { provider: 'apple', label: m.auth_loginWithApple() },\n { provider: 'google', label: m.auth_loginWithGoogle() },\n];\n\n/**\n * Renders email/password login and optional OAuth provider buttons.\n *\n * @param props - Success/navigation callbacks, provider buttons and optional visibility settings.\n *\n * @returns Login form with validation, pending state and an error alert.\n *\n * @throws Error without AuthProvider; email/OAuth action failures are caught and shown as messages.\n *\n * @remarks Requires AuthProvider inside QueryClientProvider, React Hook Form, Zod and Appkit\n * styles. Email must be valid and password at least six characters before submission.\n * Email success invokes onSuccess; OAuth success does not. OAuth buttons exist only\n * when the adapter supplies loginWithProvider. The host configures real authentication.\n *\n * @example\n * ```tsx\n * import '@alneas/appkit-react/styles';\n * import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\n * import { AuthProvider, LoginForm, type AuthAdapter } from '@alneas/appkit-react/tools/auth';\n * export function FormExample({ adapter, queryClient }: { adapter: AuthAdapter; queryClient: QueryClient }) {\n * return <QueryClientProvider client={queryClient}><AuthProvider adapter={adapter}><LoginForm socialProviders={[{ provider: 'google', label: 'Google' }]} /></AuthProvider></QueryClientProvider>;\n * }\n * ```\n */\nexport function LoginForm({\n onSuccess,\n socialProviders,\n showRegisterLink = true,\n showEmailLogin = true,\n redirectTo = '/',\n onRegisterClick,\n}: {\n /**\n * Optional synchronous callback after successful email/password login; thrown errors become form error messages.\n */\n onSuccess?: () => void;\n /**\n * OAuth button definitions; omission uses Apple and Google, empty array hides buttons.\n */\n socialProviders?: SocialProviderConfig[];\n /**\n * Show the register action only when onRegisterClick also exists; defaults to true.\n */\n showRegisterLink?: boolean;\n /**\n * Show email/password fields and submit button; defaults to true.\n */\n showEmailLogin?: boolean;\n /**\n * OAuth destination resolved against window.location.origin; defaults to /.\n */\n redirectTo?: string;\n /**\n * Optional synchronous click handler for the register action.\n */\n onRegisterClick?: () => void;\n}) {\n const { login, loginWithProvider } = useAuth();\n const [error, setError] = useState<string | null>(null);\n const [isPending, setIsPending] = useState(false);\n\n const form = useForm<z.infer<typeof loginSchema>>({\n resolver: zodResolver(loginSchema),\n defaultValues: {\n email: '',\n password: '',\n },\n });\n\n const {\n handleSubmit,\n control,\n formState: { isSubmitting },\n } = form;\n\n async function onSubmit(values: z.infer<typeof loginSchema>) {\n try {\n setIsPending(true);\n setError(null);\n await login(values.email, values.password);\n if (onSuccess) onSuccess();\n } catch (err) {\n setError(err instanceof Error ? err.message : m.auth_failedToLogin());\n } finally {\n setIsPending(false);\n }\n }\n\n const handleSocialLogin = async (provider: OAuthProvider) => {\n if (!loginWithProvider) return;\n\n try {\n setError(null);\n await loginWithProvider(provider, {\n redirectTo: new URL(redirectTo, window.location.origin).href,\n });\n } catch (err) {\n setError(err instanceof Error ? err.message : m.auth_socialLoginFailed());\n }\n };\n\n const providers = socialProviders ?? defaultSocialProviders;\n\n return (\n <Form.Root onSubmit={handleSubmit(onSubmit)} className='space-y-4'>\n {error && (\n <Alert variant='destructive'>\n <AlertCircle className='h-4 w-4' />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n {loginWithProvider && providers.length > 0 && (\n <>\n <div className='flex flex-col gap-2'>\n {providers.map((config) => (\n <Button\n key={config.provider}\n variant='outline'\n type='button'\n disabled={isPending || isSubmitting}\n onClick={() => handleSocialLogin(config.provider)}\n >\n {config.icon ?? builtInIcons[config.provider] ?? <DefaultProviderIcon />}\n {config.label}\n </Button>\n ))}\n </div>\n\n {showEmailLogin && (\n <FieldSeparator className='*:data-[slot=field-separator-content]:bg-card'>\n {m.auth_orContinueWith()}\n </FieldSeparator>\n )}\n </>\n )}\n\n {showEmailLogin && (\n <>\n <AutoFormField\n control={control}\n name='email'\n label={m.auth_email()}\n inputProps={{ placeholder: m.auth_emailPlaceholder() }}\n />\n\n <AutoFormField\n control={control}\n name='password'\n label={m.auth_password()}\n type='password'\n inputProps={{ autoComplete: 'current-password' }}\n />\n\n <Button type='submit' className='w-full' disabled={isPending || isSubmitting}>\n {isPending ? m.auth_loggingIn() : m.signIn()}\n </Button>\n </>\n )}\n\n {showRegisterLink && onRegisterClick && (\n <div className='text-center text-sm text-muted-foreground'>\n {m.auth_dontHaveAccount()}{' '}\n <Button type='button' variant='link' className='p-0 h-auto' onClick={onRegisterClick}>\n {m.signUp()}\n </Button>\n </div>\n )}\n </Form.Root>\n );\n}\n\n/**\n * Visibility, label and placeholder overrides for the three built-in registration fields.\n *\n * @remarks All fields default to visible; labels/placeholders are localized. Hiding email\n * or password does not remove their required schema validation.\n *\n * @see RegisterForm for usage.\n */\nexport interface RegisterFieldConfig {\n /**\n * Overrides for optional display-name input.\n */\n name?: {\n /** Visibility override; defaults to true. */\n show?: boolean;\n /** Localized label override. */\n label?: string;\n /** Placeholder override. */\n placeholder?: string;\n };\n /**\n * Overrides for required email input; hiding it does not skip validation.\n */\n email?: {\n /** Visibility override; defaults to true. */\n show?: boolean;\n /** Localized label override. */\n label?: string;\n /** Placeholder override. */\n placeholder?: string;\n };\n /**\n * Overrides for required password input; hiding it does not skip validation.\n */\n password?: {\n /** Visibility override; defaults to true. */\n show?: boolean;\n /** Localized label override. */\n label?: string;\n /** Placeholder override. */\n placeholder?: string;\n };\n}\n\n/**\n * Additional registration input rendered and validated locally by RegisterForm.\n *\n * @remarks These values are not passed to AuthAdapter.register: the bundled form sends\n * only email, password and name. Use host-owned persistence to save other fields.\n * Custom validation overrides automatic type/required rules.\n *\n * @see RegisterForm for complete usage.\n */\nexport interface RegisterExtraField {\n /**\n * Unique form-data key; avoid built-in email/password/name collisions unless intentionally replacing their schema.\n */\n name: string;\n /**\n * Visible field label.\n */\n label: string;\n /**\n * Input presentation, default text. tel/url use text input modes, date uses schema date format.\n */\n type?: 'text' | 'email' | 'tel' | 'date' | 'number' | 'url' | 'password' | 'textarea' | 'select' | 'checkbox';\n /**\n * Optional input hint passed where supported by the rendered control.\n */\n placeholder?: string;\n /**\n * Add required default validation; omission is optional except optional checkbox still expects a boolean.\n */\n required?: boolean;\n /**\n * Optional browser autocomplete hint where supported.\n */\n autoComplete?: string;\n /**\n * Select choices; defaults to an empty list for a select without options.\n */\n options?: {\n /** Display text. */\n label: string;\n /** Submitted choice value. */\n value: string;\n }[];\n /**\n * Optional Zod schema replacing generated validation for this field.\n */\n validation?: z.ZodTypeAny;\n}\n\nconst defaultFieldConfig = {\n name: { show: true, label: m.auth_name(), placeholder: m.auth_namePlaceholder() },\n email: { show: true, label: m.auth_email(), placeholder: m.auth_emailPlaceholder() },\n password: { show: true, label: m.auth_password(), placeholder: '' },\n};\n\nfunction resolveFieldConfig(\n fields: RegisterFieldConfig | undefined,\n key: keyof RegisterFieldConfig,\n) {\n const cfg = fields?.[key];\n if (!cfg) return defaultFieldConfig[key];\n return {\n show: cfg.show ?? defaultFieldConfig[key].show,\n label: cfg.label ?? defaultFieldConfig[key].label,\n placeholder: cfg.placeholder ?? defaultFieldConfig[key].placeholder,\n };\n}\n\nfunction buildExtraFieldSchema(fields: RegisterExtraField[]): z.ZodObject<any> {\n const shape: Record<string, z.ZodTypeAny> = {};\n for (const field of fields) {\n if (field.validation) {\n shape[field.name] = field.validation;\n } else if (field.type === 'email') {\n shape[field.name] = field.required\n ? z.string().email({ message: m.auth_validation_invalidEmail() })\n : z.string().email({ message: m.auth_validation_invalidEmail() }).optional().or(z.literal(''));\n } else if (field.type === 'number') {\n shape[field.name] = field.required\n ? z.coerce.number({ message: m.auth_validation_invalidNumber() })\n : z.coerce.number({ message: m.auth_validation_invalidNumber() }).optional();\n } else if (field.type === 'checkbox') {\n shape[field.name] = field.required\n ? z.literal(true, { message: m.auth_validation_required() })\n : z.boolean();\n } else {\n shape[field.name] = field.required\n ? z.string().min(1, m.auth_validation_required())\n : z.string().optional();\n }\n }\n return z.object(shape);\n}\n\nfunction renderExtraField(field: RegisterExtraField, control: any) {\n const commonProps = {\n control,\n name: field.name,\n label: field.label,\n required: field.required,\n };\n\n const inputProps: Record<string, any> = {};\n if (field.placeholder) inputProps.placeholder = field.placeholder;\n if (field.autoComplete) inputProps.autoComplete = field.autoComplete;\n\n if (field.type === 'date') {\n return (\n <AutoFormField\n {...commonProps}\n jsonSchema={{ type: 'string', format: 'date' }}\n />\n );\n }\n\n if (field.type === 'select') {\n return (\n <AutoFormField\n {...commonProps}\n type='select'\n options={field.options ?? []}\n />\n );\n }\n\n if (field.type === 'checkbox') {\n return <AutoFormField {...commonProps} type='checkbox' />;\n }\n\n if (field.type === 'textarea') {\n return (\n <AutoFormField\n {...commonProps}\n type='textarea'\n inputProps={inputProps}\n />\n );\n }\n\n if (field.type === 'tel') inputProps.inputMode = 'tel';\n if (field.type === 'url') inputProps.inputMode = 'url';\n\n const supportedType = ['text', 'number', 'email', 'password'].includes(field.type ?? 'text')\n ? (field.type as 'text' | 'number' | 'email' | 'password')\n : 'text';\n\n return (\n <AutoFormField\n {...commonProps}\n type={supportedType}\n inputProps={Object.keys(inputProps).length > 0 ? inputProps : undefined}\n />\n );\n}\n\n/**\n * Renders account registration with built-in field overrides and optional local extra inputs.\n *\n * @param props - Registration success/navigation callbacks and field presentation settings.\n *\n * @returns Validated form, pending submit button and error feedback.\n *\n * @throws Error without AuthProvider; registration and onSuccess failures are shown as form errors.\n *\n * @remarks Requires AuthProvider inside QueryClientProvider, React Hook Form, Zod and Appkit\n * styles. Email must be valid; password requires six characters; name is optional.\n * Extra inputs are validated and rendered but not persisted by this component: only\n * email, password and {name} reach adapter.register. Hidden built-in fields remain in\n * validation. Custom extra schemas can override built-in names, so avoid collisions.\n *\n * @example\n * ```tsx\n * import '@alneas/appkit-react/styles';\n * import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\n * import { AuthProvider, RegisterForm, type AuthAdapter } from '@alneas/appkit-react/tools/auth';\n * export function FormExample({ adapter, queryClient }: { adapter: AuthAdapter; queryClient: QueryClient }) {\n * return <QueryClientProvider client={queryClient}><AuthProvider adapter={adapter}><RegisterForm fields={{ name: { label: 'Display name' } }} /></AuthProvider></QueryClientProvider>;\n * }\n * ```\n */\nexport function RegisterForm({\n onSuccess,\n fields,\n extraFields,\n showLoginLink = true,\n onLoginClick,\n}: {\n /**\n * Optional synchronous callback after registration; thrown errors become form errors.\n */\n onSuccess?: () => void;\n /**\n * Optional visibility/label/placeholder overrides for name, email and password.\n */\n fields?: RegisterFieldConfig;\n /**\n * Optional extra input definitions; validated locally but not forwarded to register.\n */\n extraFields?: RegisterExtraField[];\n /**\n * Show login action when onLoginClick exists; defaults to true.\n */\n showLoginLink?: boolean;\n /**\n * Optional synchronous click handler for the login action.\n */\n onLoginClick?: () => void;\n}) {\n const { register } = useAuth();\n const [error, setError] = useState<string | null>(null);\n const [isPending, setIsPending] = useState(false);\n\n const extraFieldSchema = extraFields?.length ? buildExtraFieldSchema(extraFields) : null;\n const finalSchema = extraFieldSchema ? registerSchema.extend(extraFieldSchema.shape) : registerSchema;\n\n const form = useForm<any>({\n resolver: zodResolver(finalSchema),\n defaultValues: {\n email: '',\n password: '',\n name: '',\n ...(extraFields?.reduce((acc, f) => {\n acc[f.name] = f.type === 'checkbox' ? false : '';\n return acc;\n }, {} as Record<string, any>)),\n },\n });\n\n const {\n handleSubmit,\n control,\n formState: { isSubmitting },\n } = form;\n\n async function onSubmit(values: any) {\n try {\n setIsPending(true);\n setError(null);\n await register(values.email, values.password, { name: values.name });\n if (onSuccess) onSuccess();\n } catch (err) {\n setError(err instanceof Error ? err.message : m.auth_failedToRegister());\n } finally {\n setIsPending(false);\n }\n }\n\n return (\n <Form.Root onSubmit={handleSubmit(onSubmit)} className='space-y-4'>\n {error && (\n <Alert variant='destructive'>\n <AlertCircle className='h-4 w-4' />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n {(() => {\n const nameCfg = resolveFieldConfig(fields, 'name');\n const emailCfg = resolveFieldConfig(fields, 'email');\n const passwordCfg = resolveFieldConfig(fields, 'password');\n return (\n <>\n {nameCfg.show && (\n <AutoFormField\n control={control}\n name='name'\n label={nameCfg.label}\n inputProps={{ placeholder: nameCfg.placeholder }}\n />\n )}\n {emailCfg.show && (\n <AutoFormField\n control={control}\n name='email'\n label={emailCfg.label}\n inputProps={{ placeholder: emailCfg.placeholder }}\n />\n )}\n {passwordCfg.show && (\n <AutoFormField\n control={control}\n name='password'\n label={passwordCfg.label}\n type='password'\n inputProps={{ autoComplete: 'new-password', placeholder: passwordCfg.placeholder || undefined }}\n />\n )}\n </>\n );\n })()}\n\n {extraFields?.length ? (\n <div className='space-y-4'>\n {extraFields.map((field) => (\n <React.Fragment key={field.name}>\n {renderExtraField(field, control)}\n </React.Fragment>\n ))}\n </div>\n ) : null}\n\n <Button type='submit' className='w-full' disabled={isPending || isSubmitting}>\n {isPending ? m.auth_registering() : m.signUp()}\n </Button>\n\n {showLoginLink && onLoginClick && (\n <div className='text-center text-sm text-muted-foreground'>\n {m.auth_alreadyHaveAccount()}{' '}\n <Button type='button' variant='link' className='p-0 h-auto' onClick={onLoginClick}>\n {m.signIn()}\n </Button>\n </div>\n )}\n </Form.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMyC,IAAczC,EAAE,OAAO;CAC3B,OAAOA,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,SAASC,EAA+B,EAAE,CAAC;CACrE,UAAUD,EAAE,OAAO,CAAC,CAAC,IAAI,GAAG,EAAE,SAASE,EAAiC,EAAE,CAAC;AAC7E,CAAC,GAEKwC,IAAiB1C,EAAE,OAAO;CAC9B,OAAOA,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,SAASC,EAA+B,EAAE,CAAC;CACrE,UAAUD,EAAE,OAAO,CAAC,CAAC,IAAI,GAAG,EAAE,SAASE,EAAiC,EAAE,CAAC;CAC3E,MAAMF,EAAE,OAAO,CAAC,CAAC,SAAS;AAC5B,CAAC,GAuBK2C,UACJ,kBAAC,OAAD;CAAK,OAAM;CAA6B,SAAQ;CAAY,WAAU;CACpE,UAAA,kBAAC,QAAD;EACE,GAAE;EACF,MAAK;CACN,CAAA;AACE,CAAA,GAIDC,UACJ,kBAAC,OAAD;CAAK,OAAM;CAA6B,SAAQ;CAAY,WAA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AAUnB,EAAmBE,GAAQ,MAAM,GAC3CkB,IAAWpB,EAAmBE,GAAQ,OAAO,GAC7CmB,IAAcrB,EAAmBE,GAAQ,UAAU;IACzD,OACE,kBAAAjF,GAAA,EAAA,UAAA;KACGkG,EAAQ,QACP,kBAAC1B,GAAD;MACW;MACT,MAAK;MACL,OAAO0B,EAAQ;MACf,YAAY,EAAE,aAAaA,EAAQ,YAAY;KAChD,CAAA;KAEFC,EAAS,QACR,kBAAC3B,GAAD;MACW;MACT,MAAK;MACL,OAAO2B,EAAS;MAChB,YAAY,EAAE,aAAaA,EAAS,YAAY;KACjD,CAAA;KAEFC,EAAY,QACX,kBAAC5B,GAAD;MACW;MACT,MAAK;MACL,OAAO4B,EAAY;MACnB,MAAK;MACL,YAAY;OAAE,cAAc;OAAgB,aAAaA,EAAY,eAAe,KAAA;MAAU;KAC/F,CAAA;IAEH,EAAA,CAAA;GAEN,EAAA,CAAG;GAEFP,GAAa,SACZ,kBAAC,OAAD;IAAK,WAAU;IACZ,UAAAA,EAAY,KAAK,MAChB,kBAAC7D,EAAM,UAAP,EAAA,UACGuD,EAAiBF,GAAOgB,CAAO,EAClB,GAFKhB,EAAM,IAEX,CACjB;GACE,CAAA,IACH;GAEJ,kBAAClB,GAAD;IAAQ,MAAK;IAAS,WAAU;IAAS,UAAUrB,KAAasB;IAC7D,UAAAtB,IAAYhC,EAAmB,IAAIN,EAAS;GACvC,CAAA;GAEP+F,KAAiBC,KAChB,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACGzF,EAA0B;KAAG;KAC9B,kBAACoD,GAAD;MAAQ,MAAK;MAAS,SAAQ;MAAO,WAAU;MAAa,SAASqC;MAClE,UAAAlG,EAAS;KACJ,CAAA;IACL;;EAEE;;AAEf"}
@@ -1 +1 @@
1
- {"version":3,"file":"AuthGuard.cjs","names":["useAuthGuard","_Fragment","require_runtime","require_tools_components_auth_useAuthGuard","react_jsx_runtime","react","AuthGuard","options","isLoading","fallback","isAuthenticated"],"sources":["../../../../src/tools/components/auth/AuthGuard.tsx"],"sourcesContent":["import React from 'react';\nimport { useAuthGuard, type AuthGuardOptions } from './useAuthGuard';\n\n/**\n * 認証必須のラッパーコンポーネント\n *\n * 認証されていない場合は自動的にログインページへリダイレクトします。\n */\nexport interface AuthGuardProps extends AuthGuardOptions {\n children: React.ReactNode;\n /** ロード中に表示するコンポーネント */\n fallback?: React.ReactNode;\n}\n\n/**\n * 認証状態を監視し、未認証の場合はログインページなどへ自動リダイレクトするガードコンポーネント。\n */\nexport function AuthGuard({ children, fallback = null, ...options }: AuthGuardProps) {\n const { isAuthenticated, isLoading } = useAuthGuard(options);\n\n if (isLoading) {\n return <>{fallback}</>;\n }\n\n if (!isAuthenticated) {\n // リダイレクト処理は useAuthGuard 内で行われる\n return null;\n }\n\n return <>{children}</>;\n}\n"],"mappings":"A,kPAiBA,SAAgBM,EAAU,CAAE,WAAU,WAAW,KAAM,GAAGC,GAA2B,CACnF,GAAM,CAAE,kBAAiB,aAAcP,EAAAA,aAAaO,CAAO,EAW3D,OATIC,GACK,EAAAJ,EAAA,IAAA,CAAAH,EAAAA,SAAA,CAAA,SAAGQ,CAAW,CAAA,EAGlBC,GAKE,EAAAN,EAAA,IAAA,CAAAH,EAAAA,SAAA,CAAG,UAAW,CAAA,EAHZ,IAIX,C"}
1
+ {"version":3,"file":"AuthGuard.cjs","names":["useAuthGuard","_Fragment","require_runtime","require_tools_components_auth_useAuthGuard","react_jsx_runtime","react","AuthGuard","options","isLoading","fallback","isAuthenticated"],"sources":["../../../../src/tools/components/auth/AuthGuard.tsx"],"sourcesContent":["import React from 'react';\nimport { useAuthGuard, type AuthGuardOptions } from './useAuthGuard';\n\n/**\n * Children and loading fallback with useAuthGuard scheduling options.\n *\n * @see AuthGuard for rendering behavior.\n */\nexport interface AuthGuardProps extends AuthGuardOptions {\n /**\n * Content displayed while the current context contains a user.\n */\n children: React.ReactNode;\n /**\n * Content during loading; defaults to null.\n */\n fallback?: React.ReactNode;\n}\n\n/**\n * Renders authenticated children and delegates scheduled expiry checks to useAuthGuard.\n *\n * @param props - Children, loading fallback and inherited check/navigation settings.\n *\n * @returns Fallback while loading, children for a current user, otherwise null.\n *\n * @throws Error when no AuthProvider exists.\n *\n * @remarks Requires AuthProvider inside QueryClientProvider; no CSS is required. There is\n * no immediate mount-only redirect: focus, visibility, optional timer or manual checks\n * trigger expiry handling. Current user state can be optimistic; enforce backend access.\n *\n * @example\n * ```tsx\n * import type { ReactNode } from 'react';\n * import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\n * import { AuthProvider, AuthGuard, type AuthAdapter } from '@alneas/appkit-react/tools/auth';\n *\n * function Content() { return <AuthGuard><span>Account</span></AuthGuard>; }\n * export function Example({ adapter, queryClient }: { adapter: AuthAdapter; queryClient: QueryClient }) {\n * return <QueryClientProvider client={queryClient}><AuthProvider adapter={adapter}><Content /></AuthProvider></QueryClientProvider>;\n * }\n * ```\n */\nexport function AuthGuard({ children, fallback = null, ...options }: AuthGuardProps) {\n const { isAuthenticated, isLoading } = useAuthGuard(options);\n\n if (isLoading) {\n return <>{fallback}</>;\n }\n\n if (!isAuthenticated) {\n // リダイレクト処理は useAuthGuard 内で行われる\n return null;\n }\n\n return <>{children}</>;\n}\n"],"mappings":"A,kPA4CA,SAAgBM,EAAU,CAAE,WAAU,WAAW,KAAM,GAAGC,GAA2B,CACnF,GAAM,CAAE,kBAAiB,aAAcP,EAAAA,aAAaO,CAAO,EAW3D,OATIC,GACK,EAAAJ,EAAA,IAAA,CAAAH,EAAAA,SAAA,CAAA,SAAGQ,CAAW,CAAA,EAGlBC,GAKE,EAAAN,EAAA,IAAA,CAAAH,EAAAA,SAAA,CAAG,UAAW,CAAA,EAHZ,IAIX,C"}
@@ -1,16 +1,43 @@
1
1
  import { default as React } from 'react';
2
2
  import { AuthGuardOptions } from './useAuthGuard.cjs';
3
3
  /**
4
- * 認証必須のラッパーコンポーネント
4
+ * Children and loading fallback with useAuthGuard scheduling options.
5
5
  *
6
- * 認証されていない場合は自動的にログインページへリダイレクトします。
6
+ * @see AuthGuard for rendering behavior.
7
7
  */
8
8
  export interface AuthGuardProps extends AuthGuardOptions {
9
+ /**
10
+ * Content displayed while the current context contains a user.
11
+ */
9
12
  children: React.ReactNode;
10
- /** ロード中に表示するコンポーネント */
13
+ /**
14
+ * Content during loading; defaults to null.
15
+ */
11
16
  fallback?: React.ReactNode;
12
17
  }
13
18
  /**
14
- * 認証状態を監視し、未認証の場合はログインページなどへ自動リダイレクトするガードコンポーネント。
19
+ * Renders authenticated children and delegates scheduled expiry checks to useAuthGuard.
20
+ *
21
+ * @param props - Children, loading fallback and inherited check/navigation settings.
22
+ *
23
+ * @returns Fallback while loading, children for a current user, otherwise null.
24
+ *
25
+ * @throws Error when no AuthProvider exists.
26
+ *
27
+ * @remarks Requires AuthProvider inside QueryClientProvider; no CSS is required. There is
28
+ * no immediate mount-only redirect: focus, visibility, optional timer or manual checks
29
+ * trigger expiry handling. Current user state can be optimistic; enforce backend access.
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * import type { ReactNode } from 'react';
34
+ * import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
35
+ * import { AuthProvider, AuthGuard, type AuthAdapter } from '@alneas/appkit-react/tools/auth';
36
+ *
37
+ * function Content() { return <AuthGuard><span>Account</span></AuthGuard>; }
38
+ * export function Example({ adapter, queryClient }: { adapter: AuthAdapter; queryClient: QueryClient }) {
39
+ * return <QueryClientProvider client={queryClient}><AuthProvider adapter={adapter}><Content /></AuthProvider></QueryClientProvider>;
40
+ * }
41
+ * ```
15
42
  */
16
43
  export declare function AuthGuard({ children, fallback, ...options }: AuthGuardProps): React.JSX.Element | null;
@@ -1,16 +1,43 @@
1
1
  import { default as React } from 'react';
2
2
  import { AuthGuardOptions } from './useAuthGuard.js';
3
3
  /**
4
- * 認証必須のラッパーコンポーネント
4
+ * Children and loading fallback with useAuthGuard scheduling options.
5
5
  *
6
- * 認証されていない場合は自動的にログインページへリダイレクトします。
6
+ * @see AuthGuard for rendering behavior.
7
7
  */
8
8
  export interface AuthGuardProps extends AuthGuardOptions {
9
+ /**
10
+ * Content displayed while the current context contains a user.
11
+ */
9
12
  children: React.ReactNode;
10
- /** ロード中に表示するコンポーネント */
13
+ /**
14
+ * Content during loading; defaults to null.
15
+ */
11
16
  fallback?: React.ReactNode;
12
17
  }
13
18
  /**
14
- * 認証状態を監視し、未認証の場合はログインページなどへ自動リダイレクトするガードコンポーネント。
19
+ * Renders authenticated children and delegates scheduled expiry checks to useAuthGuard.
20
+ *
21
+ * @param props - Children, loading fallback and inherited check/navigation settings.
22
+ *
23
+ * @returns Fallback while loading, children for a current user, otherwise null.
24
+ *
25
+ * @throws Error when no AuthProvider exists.
26
+ *
27
+ * @remarks Requires AuthProvider inside QueryClientProvider; no CSS is required. There is
28
+ * no immediate mount-only redirect: focus, visibility, optional timer or manual checks
29
+ * trigger expiry handling. Current user state can be optimistic; enforce backend access.
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * import type { ReactNode } from 'react';
34
+ * import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
35
+ * import { AuthProvider, AuthGuard, type AuthAdapter } from '@alneas/appkit-react/tools/auth';
36
+ *
37
+ * function Content() { return <AuthGuard><span>Account</span></AuthGuard>; }
38
+ * export function Example({ adapter, queryClient }: { adapter: AuthAdapter; queryClient: QueryClient }) {
39
+ * return <QueryClientProvider client={queryClient}><AuthProvider adapter={adapter}><Content /></AuthProvider></QueryClientProvider>;
40
+ * }
41
+ * ```
15
42
  */
16
43
  export declare function AuthGuard({ children, fallback, ...options }: AuthGuardProps): React.JSX.Element | null;
@@ -1 +1 @@
1
- {"version":3,"file":"AuthGuard.js","names":["_Fragment","AuthGuard","options","useAuthGuard","isLoading","Fragment","fallback","isAuthenticated"],"sources":["../../../../src/tools/components/auth/AuthGuard.tsx"],"sourcesContent":["import React from 'react';\nimport { useAuthGuard, type AuthGuardOptions } from './useAuthGuard';\n\n/**\n * 認証必須のラッパーコンポーネント\n *\n * 認証されていない場合は自動的にログインページへリダイレクトします。\n */\nexport interface AuthGuardProps extends AuthGuardOptions {\n children: React.ReactNode;\n /** ロード中に表示するコンポーネント */\n fallback?: React.ReactNode;\n}\n\n/**\n * 認証状態を監視し、未認証の場合はログインページなどへ自動リダイレクトするガードコンポーネント。\n */\nexport function AuthGuard({ children, fallback = null, ...options }: AuthGuardProps) {\n const { isAuthenticated, isLoading } = useAuthGuard(options);\n\n if (isLoading) {\n return <>{fallback}</>;\n }\n\n if (!isAuthenticated) {\n // リダイレクト処理は useAuthGuard 内で行われる\n return null;\n }\n\n return <>{children}</>;\n}\n"],"mappings":";;;;;AAiBA,SAAgBC,EAAU,EAAE,aAAU,cAAW,MAAM,GAAGC,KAA2B;CACnF,IAAM,EAAE,oBAAiB,iBAAcC,EAAaD,CAAO;CAW3D,OATIE,IACK,kBAAAJ,GAAA,EAAA,UAAGM,EAAW,CAAA,IAGlBC,IAKE,kBAAAP,GAAA,EAAG,YAAW,CAAA,IAHZ;AAIX"}
1
+ {"version":3,"file":"AuthGuard.js","names":["_Fragment","AuthGuard","options","useAuthGuard","isLoading","Fragment","fallback","isAuthenticated"],"sources":["../../../../src/tools/components/auth/AuthGuard.tsx"],"sourcesContent":["import React from 'react';\nimport { useAuthGuard, type AuthGuardOptions } from './useAuthGuard';\n\n/**\n * Children and loading fallback with useAuthGuard scheduling options.\n *\n * @see AuthGuard for rendering behavior.\n */\nexport interface AuthGuardProps extends AuthGuardOptions {\n /**\n * Content displayed while the current context contains a user.\n */\n children: React.ReactNode;\n /**\n * Content during loading; defaults to null.\n */\n fallback?: React.ReactNode;\n}\n\n/**\n * Renders authenticated children and delegates scheduled expiry checks to useAuthGuard.\n *\n * @param props - Children, loading fallback and inherited check/navigation settings.\n *\n * @returns Fallback while loading, children for a current user, otherwise null.\n *\n * @throws Error when no AuthProvider exists.\n *\n * @remarks Requires AuthProvider inside QueryClientProvider; no CSS is required. There is\n * no immediate mount-only redirect: focus, visibility, optional timer or manual checks\n * trigger expiry handling. Current user state can be optimistic; enforce backend access.\n *\n * @example\n * ```tsx\n * import type { ReactNode } from 'react';\n * import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\n * import { AuthProvider, AuthGuard, type AuthAdapter } from '@alneas/appkit-react/tools/auth';\n *\n * function Content() { return <AuthGuard><span>Account</span></AuthGuard>; }\n * export function Example({ adapter, queryClient }: { adapter: AuthAdapter; queryClient: QueryClient }) {\n * return <QueryClientProvider client={queryClient}><AuthProvider adapter={adapter}><Content /></AuthProvider></QueryClientProvider>;\n * }\n * ```\n */\nexport function AuthGuard({ children, fallback = null, ...options }: AuthGuardProps) {\n const { isAuthenticated, isLoading } = useAuthGuard(options);\n\n if (isLoading) {\n return <>{fallback}</>;\n }\n\n if (!isAuthenticated) {\n // リダイレクト処理は useAuthGuard 内で行われる\n return null;\n }\n\n return <>{children}</>;\n}\n"],"mappings":";;;;;AA4CA,SAAgBC,EAAU,EAAE,aAAU,cAAW,MAAM,GAAGC,KAA2B;CACnF,IAAM,EAAE,oBAAiB,iBAAcC,EAAaD,CAAO;CAW3D,OATIE,IACK,kBAAAJ,GAAA,EAAA,UAAGM,EAAW,CAAA,IAGlBC,IAKE,kBAAAP,GAAA,EAAG,YAAW,CAAA,IAHZ;AAIX"}