@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.
- package/CHANGELOG.md +53 -0
- package/README.md +85 -15
- package/consumer-ai/SKILL.md +12 -0
- package/consumer-ai/api-index.json +103754 -0
- package/consumer-ai/package-context.json +409 -0
- package/dist/ai/action/ExecutionHistory.cjs.map +1 -1
- package/dist/ai/action/ExecutionHistory.d.cts +32 -2
- package/dist/ai/action/ExecutionHistory.d.ts +32 -2
- package/dist/ai/action/ExecutionHistory.js.map +1 -1
- package/dist/ai/action/ScreenActionContext.cjs.map +1 -1
- package/dist/ai/action/ScreenActionContext.d.cts +15 -2
- package/dist/ai/action/ScreenActionContext.d.ts +15 -2
- package/dist/ai/action/ScreenActionContext.js.map +1 -1
- package/dist/ai/action/context.cjs.map +1 -1
- package/dist/ai/action/context.d.cts +19 -3
- package/dist/ai/action/context.d.ts +19 -3
- package/dist/ai/action/context.js.map +1 -1
- package/dist/ai/action/types.d.cts +35 -3
- package/dist/ai/action/types.d.ts +35 -3
- package/dist/ai/action/use-execution-session.cjs.map +1 -1
- package/dist/ai/action/use-execution-session.d.cts +17 -1
- package/dist/ai/action/use-execution-session.d.ts +17 -1
- package/dist/ai/action/use-execution-session.js.map +1 -1
- package/dist/ai/action/use-screen-action-registry.cjs.map +1 -1
- package/dist/ai/action/use-screen-action-registry.d.cts +77 -8
- package/dist/ai/action/use-screen-action-registry.d.ts +77 -8
- package/dist/ai/action/use-screen-action-registry.js.map +1 -1
- package/dist/ai/action/use-screen-action.cjs.map +1 -1
- package/dist/ai/action/use-screen-action.d.cts +23 -6
- package/dist/ai/action/use-screen-action.d.ts +23 -6
- package/dist/ai/action/use-screen-action.js.map +1 -1
- package/dist/ai/action/use-screen-context.cjs.map +1 -1
- package/dist/ai/action/use-screen-context.d.cts +42 -5
- package/dist/ai/action/use-screen-context.d.ts +42 -5
- package/dist/ai/action/use-screen-context.js.map +1 -1
- package/dist/ai/ai-chat/transport.cjs.map +1 -1
- package/dist/ai/ai-chat/transport.d.cts +35 -8
- package/dist/ai/ai-chat/transport.d.ts +35 -8
- package/dist/ai/ai-chat/transport.js.map +1 -1
- package/dist/ai/generative-ui/GenerativeUIRenderer.cjs.map +1 -1
- package/dist/ai/generative-ui/GenerativeUIRenderer.d.cts +21 -3
- package/dist/ai/generative-ui/GenerativeUIRenderer.d.ts +21 -3
- package/dist/ai/generative-ui/GenerativeUIRenderer.js.map +1 -1
- package/dist/ai/generative-ui/error-boundary.cjs.map +1 -1
- package/dist/ai/generative-ui/error-boundary.d.cts +98 -2
- package/dist/ai/generative-ui/error-boundary.d.ts +98 -2
- package/dist/ai/generative-ui/error-boundary.js.map +1 -1
- package/dist/ai/generative-ui/registry.cjs.map +1 -1
- package/dist/ai/generative-ui/registry.d.cts +96 -7
- package/dist/ai/generative-ui/registry.d.ts +96 -7
- package/dist/ai/generative-ui/registry.js.map +1 -1
- package/dist/ai/proposal/ProposalFieldReview.cjs.map +1 -1
- package/dist/ai/proposal/ProposalFieldReview.d.cts +170 -8
- package/dist/ai/proposal/ProposalFieldReview.d.ts +170 -8
- package/dist/ai/proposal/ProposalFieldReview.js.map +1 -1
- package/dist/ai/proposal/types.d.cts +97 -26
- package/dist/ai/proposal/types.d.ts +97 -26
- package/dist/ai/proposal/use-proposal-batch-review.cjs.map +1 -1
- package/dist/ai/proposal/use-proposal-batch-review.d.cts +133 -7
- package/dist/ai/proposal/use-proposal-batch-review.d.ts +133 -7
- package/dist/ai/proposal/use-proposal-batch-review.js.map +1 -1
- package/dist/ai/proposal/use-proposal-review.cjs.map +1 -1
- package/dist/ai/proposal/use-proposal-review.d.cts +47 -5
- package/dist/ai/proposal/use-proposal-review.d.ts +47 -5
- package/dist/ai/proposal/use-proposal-review.js.map +1 -1
- package/dist/avatar.svg +1 -0
- package/dist/consumer-ai/SKILL.md +6 -0
- package/dist/consumer-ai/api-index.json +103754 -0
- package/dist/consumer-ai/package-context.json +5 -3
- package/dist/mockServiceWorker.js +361 -0
- package/dist/styles.css +1 -1
- package/dist/tools/components/auth/AuthForms.cjs.map +1 -1
- package/dist/tools/components/auth/AuthForms.d.cts +131 -81
- package/dist/tools/components/auth/AuthForms.d.ts +131 -81
- package/dist/tools/components/auth/AuthForms.js.map +1 -1
- package/dist/tools/components/auth/AuthGuard.cjs.map +1 -1
- package/dist/tools/components/auth/AuthGuard.d.cts +31 -4
- package/dist/tools/components/auth/AuthGuard.d.ts +31 -4
- package/dist/tools/components/auth/AuthGuard.js.map +1 -1
- package/dist/tools/components/auth/AuthProvider.cjs.map +1 -1
- package/dist/tools/components/auth/AuthProvider.d.cts +39 -42
- package/dist/tools/components/auth/AuthProvider.d.ts +39 -42
- package/dist/tools/components/auth/AuthProvider.js.map +1 -1
- package/dist/tools/components/auth/ProtectedRoute.cjs.map +1 -1
- package/dist/tools/components/auth/ProtectedRoute.d.cts +75 -60
- package/dist/tools/components/auth/ProtectedRoute.d.ts +75 -60
- package/dist/tools/components/auth/ProtectedRoute.js.map +1 -1
- package/dist/tools/components/auth/SignInButton.cjs.map +1 -1
- package/dist/tools/components/auth/SignInButton.d.cts +26 -18
- package/dist/tools/components/auth/SignInButton.d.ts +26 -18
- package/dist/tools/components/auth/SignInButton.js.map +1 -1
- package/dist/tools/components/auth/UserProfileProvider.cjs.map +1 -1
- package/dist/tools/components/auth/UserProfileProvider.d.cts +48 -20
- package/dist/tools/components/auth/UserProfileProvider.d.ts +48 -20
- package/dist/tools/components/auth/UserProfileProvider.js.map +1 -1
- package/dist/tools/components/auth/adapters/better-auth-adapter.cjs.map +1 -1
- package/dist/tools/components/auth/adapters/better-auth-adapter.d.cts +371 -51
- package/dist/tools/components/auth/adapters/better-auth-adapter.d.ts +371 -51
- package/dist/tools/components/auth/adapters/better-auth-adapter.js.map +1 -1
- package/dist/tools/components/auth/adapters/mock-adapter.cjs.map +1 -1
- package/dist/tools/components/auth/adapters/mock-adapter.d.cts +149 -28
- package/dist/tools/components/auth/adapters/mock-adapter.d.ts +149 -28
- package/dist/tools/components/auth/adapters/mock-adapter.js.map +1 -1
- package/dist/tools/components/auth/auth-session.cjs.map +1 -1
- package/dist/tools/components/auth/auth-session.d.cts +147 -1
- package/dist/tools/components/auth/auth-session.d.ts +147 -1
- package/dist/tools/components/auth/auth-session.js.map +1 -1
- package/dist/tools/components/auth/session-cache.cjs.map +1 -1
- package/dist/tools/components/auth/session-cache.d.cts +88 -24
- package/dist/tools/components/auth/session-cache.d.ts +88 -24
- package/dist/tools/components/auth/session-cache.js.map +1 -1
- package/dist/tools/components/auth/types.cjs.map +1 -1
- package/dist/tools/components/auth/types.d.cts +329 -106
- package/dist/tools/components/auth/types.d.ts +329 -106
- package/dist/tools/components/auth/types.js.map +1 -1
- package/dist/tools/components/auth/useAuth.cjs.map +1 -1
- package/dist/tools/components/auth/useAuth.d.cts +110 -17
- package/dist/tools/components/auth/useAuth.d.ts +110 -17
- package/dist/tools/components/auth/useAuth.js.map +1 -1
- package/dist/tools/components/auth/useAuthGuard.cjs.map +1 -1
- package/dist/tools/components/auth/useAuthGuard.d.cts +49 -38
- package/dist/tools/components/auth/useAuthGuard.d.ts +49 -38
- package/dist/tools/components/auth/useAuthGuard.js.map +1 -1
- package/dist/tools/components/auth/useRoleCheck.cjs.map +1 -1
- package/dist/tools/components/auth/useRoleCheck.d.cts +48 -1
- package/dist/tools/components/auth/useRoleCheck.d.ts +48 -1
- package/dist/tools/components/auth/useRoleCheck.js.map +1 -1
- package/dist/tools/components/auth/useUserProfile.cjs.map +1 -1
- package/dist/tools/components/auth/useUserProfile.d.cts +66 -1
- package/dist/tools/components/auth/useUserProfile.d.ts +66 -1
- package/dist/tools/components/auth/useUserProfile.js.map +1 -1
- package/dist/tools/components/barcode/BarcodeGenerator.cjs.map +1 -1
- package/dist/tools/components/barcode/BarcodeGenerator.d.cts +32 -18
- package/dist/tools/components/barcode/BarcodeGenerator.d.ts +32 -18
- package/dist/tools/components/barcode/BarcodeGenerator.js.map +1 -1
- package/dist/tools/components/barcode/QRCodeGenerator.cjs +1 -1
- package/dist/tools/components/barcode/QRCodeGenerator.cjs.map +1 -1
- package/dist/tools/components/barcode/QRCodeGenerator.d.cts +20 -13
- package/dist/tools/components/barcode/QRCodeGenerator.d.ts +20 -13
- package/dist/tools/components/barcode/QRCodeGenerator.js +1 -1
- package/dist/tools/components/barcode/QRCodeGenerator.js.map +1 -1
- package/dist/tools/components/barcode/QRCodeScanner.cjs.map +1 -1
- package/dist/tools/components/barcode/QRCodeScanner.d.cts +32 -1
- package/dist/tools/components/barcode/QRCodeScanner.d.ts +32 -1
- package/dist/tools/components/barcode/QRCodeScanner.js.map +1 -1
- package/dist/tools/components/calendar/ResourceCalendar.cjs.map +1 -1
- package/dist/tools/components/calendar/ResourceCalendar.d.cts +17 -42
- package/dist/tools/components/calendar/ResourceCalendar.d.ts +17 -42
- package/dist/tools/components/calendar/ResourceCalendar.js.map +1 -1
- package/dist/tools/components/calendar/views/ResourceView.cjs +1 -1
- package/dist/tools/components/calendar/views/ResourceView.cjs.map +1 -1
- package/dist/tools/components/calendar/views/ResourceView.js +2 -2
- package/dist/tools/components/calendar/views/ResourceView.js.map +1 -1
- package/dist/tools/components/chart/ComposedChart.cjs.map +1 -1
- package/dist/tools/components/chart/ComposedChart.d.cts +54 -1
- package/dist/tools/components/chart/ComposedChart.d.ts +54 -1
- package/dist/tools/components/chart/ComposedChart.js.map +1 -1
- package/dist/tools/components/chart/SimpleAreaChart.cjs.map +1 -1
- package/dist/tools/components/chart/SimpleAreaChart.d.cts +41 -1
- package/dist/tools/components/chart/SimpleAreaChart.d.ts +41 -1
- package/dist/tools/components/chart/SimpleAreaChart.js.map +1 -1
- package/dist/tools/components/chart/SimpleBarChart.cjs.map +1 -1
- package/dist/tools/components/chart/SimpleBarChart.d.cts +34 -24
- package/dist/tools/components/chart/SimpleBarChart.d.ts +34 -24
- package/dist/tools/components/chart/SimpleBarChart.js.map +1 -1
- package/dist/tools/components/chart/SimpleLineChart.cjs.map +1 -1
- package/dist/tools/components/chart/SimpleLineChart.d.cts +31 -28
- package/dist/tools/components/chart/SimpleLineChart.d.ts +31 -28
- package/dist/tools/components/chart/SimpleLineChart.js.map +1 -1
- package/dist/tools/components/chart/SimplePieChart.cjs.map +1 -1
- package/dist/tools/components/chart/SimplePieChart.d.cts +28 -22
- package/dist/tools/components/chart/SimplePieChart.d.ts +28 -22
- package/dist/tools/components/chart/SimplePieChart.js.map +1 -1
- package/dist/tools/components/chart/SimpleRadarChart.cjs.map +1 -1
- package/dist/tools/components/chart/SimpleRadarChart.d.cts +38 -1
- package/dist/tools/components/chart/SimpleRadarChart.d.ts +38 -1
- package/dist/tools/components/chart/SimpleRadarChart.js.map +1 -1
- package/dist/tools/components/chart/SimpleScatterChart.cjs.map +1 -1
- package/dist/tools/components/chart/SimpleScatterChart.d.cts +44 -1
- package/dist/tools/components/chart/SimpleScatterChart.d.ts +44 -1
- package/dist/tools/components/chart/SimpleScatterChart.js.map +1 -1
- package/dist/tools/components/chart/StackedBarChart.cjs.map +1 -1
- package/dist/tools/components/chart/StackedBarChart.d.cts +38 -1
- package/dist/tools/components/chart/StackedBarChart.d.ts +38 -1
- package/dist/tools/components/chart/StackedBarChart.js.map +1 -1
- package/dist/tools/components/data-table/data-table.cjs +1 -1
- package/dist/tools/components/data-table/data-table.cjs.map +1 -1
- package/dist/tools/components/data-table/data-table.js +286 -263
- package/dist/tools/components/data-table/data-table.js.map +1 -1
- package/dist/tools/components/data-table/table-utils.cjs.map +1 -1
- package/dist/tools/components/data-table/table-utils.d.cts +45 -35
- package/dist/tools/components/data-table/table-utils.d.ts +45 -35
- package/dist/tools/components/data-table/table-utils.js.map +1 -1
- package/dist/tools/components/editable-table/editable-table.cjs +1 -1
- package/dist/tools/components/editable-table/editable-table.cjs.map +1 -1
- package/dist/tools/components/editable-table/editable-table.js +15 -2
- package/dist/tools/components/editable-table/editable-table.js.map +1 -1
- package/dist/tools/components/error/ErrorDialog.cjs +1 -1
- package/dist/tools/components/error/ErrorDialog.cjs.map +1 -1
- package/dist/tools/components/error/ErrorDialog.js +1 -1
- package/dist/tools/components/error/ErrorDialog.js.map +1 -1
- package/dist/tools/components/error/ErrorInline.cjs +1 -1
- package/dist/tools/components/error/ErrorInline.cjs.map +1 -1
- package/dist/tools/components/error/ErrorInline.js +1 -1
- package/dist/tools/components/error/ErrorInline.js.map +1 -1
- package/dist/tools/components/error/ErrorNotification.cjs +1 -1
- package/dist/tools/components/error/ErrorNotification.cjs.map +1 -1
- package/dist/tools/components/error/ErrorNotification.js +10 -10
- package/dist/tools/components/error/ErrorNotification.js.map +1 -1
- package/dist/tools/components/file-browser/FilePreview.cjs +1 -1
- package/dist/tools/components/file-browser/FilePreview.cjs.map +1 -1
- package/dist/tools/components/file-browser/FilePreview.js +28 -26
- package/dist/tools/components/file-browser/FilePreview.js.map +1 -1
- package/dist/tools/components/filter/filter.cjs.map +1 -1
- package/dist/tools/components/filter/filter.d.cts +23 -34
- package/dist/tools/components/filter/filter.d.ts +23 -34
- package/dist/tools/components/filter/filter.js.map +1 -1
- package/dist/tools/components/form/EnhancedDetailPage.cjs.map +1 -1
- package/dist/tools/components/form/EnhancedDetailPage.d.cts +47 -42
- package/dist/tools/components/form/EnhancedDetailPage.d.ts +47 -42
- package/dist/tools/components/form/EnhancedDetailPage.js.map +1 -1
- package/dist/tools/components/form/form-grid.cjs.map +1 -1
- package/dist/tools/components/form/form-grid.d.cts +44 -22
- package/dist/tools/components/form/form-grid.d.ts +44 -22
- package/dist/tools/components/form/form-grid.js.map +1 -1
- package/dist/tools/components/gantt/GanttChart.cjs +1 -1
- package/dist/tools/components/gantt/GanttChart.cjs.map +1 -1
- package/dist/tools/components/gantt/GanttChart.d.cts +20 -1
- package/dist/tools/components/gantt/GanttChart.d.ts +20 -1
- package/dist/tools/components/gantt/GanttChart.js +3 -0
- package/dist/tools/components/gantt/GanttChart.js.map +1 -1
- package/dist/tools/components/gantt/components/GanttTaskBar.cjs +1 -1
- package/dist/tools/components/gantt/components/GanttTaskBar.cjs.map +1 -1
- package/dist/tools/components/gantt/components/GanttTaskBar.js +2 -1
- package/dist/tools/components/gantt/components/GanttTaskBar.js.map +1 -1
- package/dist/tools/components/header/header.cjs +1 -1
- package/dist/tools/components/header/header.cjs.map +1 -1
- package/dist/tools/components/header/header.d.cts +103 -40
- package/dist/tools/components/header/header.d.ts +103 -40
- package/dist/tools/components/header/header.js +1 -1
- package/dist/tools/components/header/header.js.map +1 -1
- package/dist/tools/components/i18n/LanguageSwitcher.cjs.map +1 -1
- package/dist/tools/components/i18n/LanguageSwitcher.d.cts +18 -14
- package/dist/tools/components/i18n/LanguageSwitcher.d.ts +18 -14
- package/dist/tools/components/i18n/LanguageSwitcher.js.map +1 -1
- package/dist/tools/components/kanban/KanbanBoard.cjs +1 -1
- package/dist/tools/components/kanban/KanbanBoard.cjs.map +1 -1
- package/dist/tools/components/kanban/KanbanBoard.d.cts +16 -34
- package/dist/tools/components/kanban/KanbanBoard.d.ts +16 -34
- package/dist/tools/components/kanban/KanbanBoard.js +3 -0
- package/dist/tools/components/kanban/KanbanBoard.js.map +1 -1
- package/dist/tools/components/kanban/KanbanColumn.cjs +1 -1
- package/dist/tools/components/kanban/KanbanColumn.cjs.map +1 -1
- package/dist/tools/components/kanban/KanbanColumn.js +1 -1
- package/dist/tools/components/kanban/KanbanColumn.js.map +1 -1
- package/dist/tools/components/kanban/kanban-compound.cjs +1 -1
- package/dist/tools/components/kanban/kanban-compound.cjs.map +1 -1
- package/dist/tools/components/kanban/kanban-compound.js +4 -1
- package/dist/tools/components/kanban/kanban-compound.js.map +1 -1
- package/dist/tools/components/kanban/kanban-primitives.cjs +1 -1
- package/dist/tools/components/kanban/kanban-primitives.cjs.map +1 -1
- package/dist/tools/components/kanban/kanban-primitives.js +0 -1
- package/dist/tools/components/kanban/kanban-primitives.js.map +1 -1
- package/dist/tools/components/priority-queue/PriorityCard.cjs +1 -1
- package/dist/tools/components/priority-queue/PriorityCard.cjs.map +1 -1
- package/dist/tools/components/priority-queue/PriorityCard.js +3 -1
- package/dist/tools/components/priority-queue/PriorityCard.js.map +1 -1
- package/dist/tools/components/sidebar/SmartSidebar.cjs.map +1 -1
- package/dist/tools/components/sidebar/SmartSidebar.d.cts +41 -43
- package/dist/tools/components/sidebar/SmartSidebar.d.ts +41 -43
- package/dist/tools/components/sidebar/SmartSidebar.js.map +1 -1
- package/dist/tools/components/splash/SplashScreen.cjs.map +1 -1
- package/dist/tools/components/splash/SplashScreen.d.cts +43 -68
- package/dist/tools/components/splash/SplashScreen.d.ts +43 -68
- package/dist/tools/components/splash/SplashScreen.js.map +1 -1
- package/dist/tools/components/workflow/WorkflowStatusPanel.cjs +1 -1
- package/dist/tools/components/workflow/WorkflowStatusPanel.cjs.map +1 -1
- package/dist/tools/components/workflow/WorkflowStatusPanel.js +2 -2
- package/dist/tools/components/workflow/WorkflowStatusPanel.js.map +1 -1
- package/dist/tools/lib/data-access/data-access-context.cjs.map +1 -1
- package/dist/tools/lib/data-access/data-access-context.d.cts +15 -6
- package/dist/tools/lib/data-access/data-access-context.d.ts +15 -6
- package/dist/tools/lib/data-access/data-access-context.js.map +1 -1
- package/dist/tools/lib/data-access/react-query-provider.cjs.map +1 -1
- package/dist/tools/lib/data-access/react-query-provider.d.cts +19 -2
- package/dist/tools/lib/data-access/react-query-provider.d.ts +19 -2
- package/dist/tools/lib/data-access/react-query-provider.js.map +1 -1
- package/dist/tools/lib/data-access/react-query.cjs.map +1 -1
- package/dist/tools/lib/data-access/react-query.d.cts +365 -90
- package/dist/tools/lib/data-access/react-query.d.ts +365 -90
- package/dist/tools/lib/data-access/react-query.js.map +1 -1
- package/dist/tools/lib/error/AppError.cjs.map +1 -1
- package/dist/tools/lib/error/AppError.d.cts +157 -63
- package/dist/tools/lib/error/AppError.d.ts +157 -63
- package/dist/tools/lib/error/AppError.js.map +1 -1
- package/dist/tools/lib/hooks/useAsyncWithTimeout.cjs.map +1 -1
- package/dist/tools/lib/hooks/useAsyncWithTimeout.d.cts +79 -26
- package/dist/tools/lib/hooks/useAsyncWithTimeout.d.ts +79 -26
- package/dist/tools/lib/hooks/useAsyncWithTimeout.js.map +1 -1
- package/dist/tools/lib/hooks/useError.cjs.map +1 -1
- package/dist/tools/lib/hooks/useError.d.cts +51 -16
- package/dist/tools/lib/hooks/useError.d.ts +51 -16
- package/dist/tools/lib/hooks/useError.js.map +1 -1
- package/dist/tools/lib/schema/ajv.cjs +1 -1
- package/dist/tools/lib/schema/ajv.cjs.map +1 -1
- package/dist/tools/lib/schema/ajv.d.cts +19 -8
- package/dist/tools/lib/schema/ajv.d.ts +19 -8
- package/dist/tools/lib/schema/ajv.js +2 -1
- package/dist/tools/lib/schema/ajv.js.map +1 -1
- package/dist/tools/lib/state/error-store.cjs.map +1 -1
- package/dist/tools/lib/state/error-store.d.cts +61 -10
- package/dist/tools/lib/state/error-store.d.ts +61 -10
- package/dist/tools/lib/state/error-store.js.map +1 -1
- package/dist/tools/lib/state/store-factory.cjs.map +1 -1
- package/dist/tools/lib/state/store-factory.d.cts +25 -4
- package/dist/tools/lib/state/store-factory.d.ts +25 -4
- package/dist/tools/lib/state/store-factory.js.map +1 -1
- package/dist/tools/lib/state/ui-store.cjs.map +1 -1
- package/dist/tools/lib/state/ui-store.d.cts +39 -0
- package/dist/tools/lib/state/ui-store.d.ts +39 -0
- package/dist/tools/lib/state/ui-store.js.map +1 -1
- package/dist/ui/components/theme/theme-context.cjs.map +1 -1
- package/dist/ui/components/theme/theme-context.d.cts +171 -1
- package/dist/ui/components/theme/theme-context.d.ts +171 -1
- package/dist/ui/components/theme/theme-context.js.map +1 -1
- package/dist/ui/components/theme/theme-provider.cjs.map +1 -1
- package/dist/ui/components/theme/theme-provider.d.cts +31 -19
- package/dist/ui/components/theme/theme-provider.d.ts +31 -19
- package/dist/ui/components/theme/theme-provider.js.map +1 -1
- package/dist/ui/components/theme/theme-script.cjs.map +1 -1
- package/dist/ui/components/theme/theme-script.d.cts +16 -1
- package/dist/ui/components/theme/theme-script.d.ts +16 -1
- package/dist/ui/components/theme/theme-script.js.map +1 -1
- package/dist/ui/components/theme/theme-switcher.cjs +1 -1
- package/dist/ui/components/theme/theme-switcher.cjs.map +1 -1
- package/dist/ui/components/theme/theme-switcher.d.cts +82 -13
- package/dist/ui/components/theme/theme-switcher.d.ts +82 -13
- package/dist/ui/components/theme/theme-switcher.js +8 -0
- package/dist/ui/components/theme/theme-switcher.js.map +1 -1
- package/dist/ui/components/ui/accordion.cjs.map +1 -1
- package/dist/ui/components/ui/accordion.d.cts +60 -0
- package/dist/ui/components/ui/accordion.d.ts +60 -0
- package/dist/ui/components/ui/accordion.js.map +1 -1
- package/dist/ui/components/ui/adjustable-pane.cjs.map +1 -1
- package/dist/ui/components/ui/adjustable-pane.d.cts +44 -26
- package/dist/ui/components/ui/adjustable-pane.d.ts +44 -26
- package/dist/ui/components/ui/adjustable-pane.js.map +1 -1
- package/dist/ui/components/ui/alert-dialog.cjs.map +1 -1
- package/dist/ui/components/ui/alert-dialog.d.cts +179 -2
- package/dist/ui/components/ui/alert-dialog.d.ts +179 -2
- package/dist/ui/components/ui/alert-dialog.js.map +1 -1
- package/dist/ui/components/ui/alert.cjs.map +1 -1
- package/dist/ui/components/ui/alert.d.cts +52 -4
- package/dist/ui/components/ui/alert.d.ts +52 -4
- package/dist/ui/components/ui/alert.js.map +1 -1
- package/dist/ui/components/ui/aspect-ratio.cjs.map +1 -1
- package/dist/ui/components/ui/aspect-ratio.d.cts +16 -1
- package/dist/ui/components/ui/aspect-ratio.d.ts +16 -1
- package/dist/ui/components/ui/aspect-ratio.js.map +1 -1
- package/dist/ui/components/ui/avatar.cjs.map +1 -1
- package/dist/ui/components/ui/avatar.d.cts +87 -3
- package/dist/ui/components/ui/avatar.d.ts +87 -3
- package/dist/ui/components/ui/avatar.js.map +1 -1
- package/dist/ui/components/ui/badge-components.cjs.map +1 -1
- package/dist/ui/components/ui/badge-components.d.cts +13 -1
- package/dist/ui/components/ui/badge-components.d.ts +13 -1
- package/dist/ui/components/ui/badge-components.js.map +1 -1
- package/dist/ui/components/ui/badge-variants.cjs.map +1 -1
- package/dist/ui/components/ui/badge-variants.d.cts +15 -0
- package/dist/ui/components/ui/badge-variants.d.ts +15 -0
- package/dist/ui/components/ui/badge-variants.js.map +1 -1
- package/dist/ui/components/ui/breadcrumb.cjs.map +1 -1
- package/dist/ui/components/ui/breadcrumb.d.cts +91 -7
- package/dist/ui/components/ui/breadcrumb.d.ts +91 -7
- package/dist/ui/components/ui/breadcrumb.js.map +1 -1
- package/dist/ui/components/ui/button-components.cjs.map +1 -1
- package/dist/ui/components/ui/button-components.d.cts +18 -6
- package/dist/ui/components/ui/button-components.d.ts +18 -6
- package/dist/ui/components/ui/button-components.js.map +1 -1
- package/dist/ui/components/ui/button-group-components.cjs.map +1 -1
- package/dist/ui/components/ui/button-group-components.d.cts +39 -3
- package/dist/ui/components/ui/button-group-components.d.ts +39 -3
- package/dist/ui/components/ui/button-group-components.js.map +1 -1
- package/dist/ui/components/ui/button-group-variants.cjs.map +1 -1
- package/dist/ui/components/ui/button-group-variants.d.cts +15 -0
- package/dist/ui/components/ui/button-group-variants.d.ts +15 -0
- package/dist/ui/components/ui/button-group-variants.js.map +1 -1
- package/dist/ui/components/ui/button-variants.cjs.map +1 -1
- package/dist/ui/components/ui/button-variants.d.cts +13 -2
- package/dist/ui/components/ui/button-variants.d.ts +13 -2
- package/dist/ui/components/ui/button-variants.js.map +1 -1
- package/dist/ui/components/ui/card.cjs.map +1 -1
- package/dist/ui/components/ui/card.d.cts +106 -2
- package/dist/ui/components/ui/card.d.ts +106 -2
- package/dist/ui/components/ui/card.js.map +1 -1
- package/dist/ui/components/ui/checkbox-group.cjs.map +1 -1
- package/dist/ui/components/ui/checkbox-group.d.cts +13 -1
- package/dist/ui/components/ui/checkbox-group.d.ts +13 -1
- package/dist/ui/components/ui/checkbox-group.js.map +1 -1
- package/dist/ui/components/ui/checkbox.cjs.map +1 -1
- package/dist/ui/components/ui/checkbox.d.cts +17 -6
- package/dist/ui/components/ui/checkbox.d.ts +17 -6
- package/dist/ui/components/ui/checkbox.js.map +1 -1
- package/dist/ui/components/ui/collapsible.cjs.map +1 -1
- package/dist/ui/components/ui/collapsible.d.cts +39 -3
- package/dist/ui/components/ui/collapsible.d.ts +39 -3
- package/dist/ui/components/ui/collapsible.js.map +1 -1
- package/dist/ui/components/ui/combobox-components.cjs.map +1 -1
- package/dist/ui/components/ui/combobox-components.d.cts +209 -14
- package/dist/ui/components/ui/combobox-components.d.ts +209 -14
- package/dist/ui/components/ui/combobox-components.js.map +1 -1
- package/dist/ui/components/ui/combobox-hooks.cjs.map +1 -1
- package/dist/ui/components/ui/combobox-hooks.d.cts +13 -1
- package/dist/ui/components/ui/combobox-hooks.d.ts +13 -1
- package/dist/ui/components/ui/combobox-hooks.js.map +1 -1
- package/dist/ui/components/ui/command.cjs.map +1 -1
- package/dist/ui/components/ui/command.d.cts +132 -9
- package/dist/ui/components/ui/command.d.ts +132 -9
- package/dist/ui/components/ui/command.js.map +1 -1
- package/dist/ui/components/ui/context-menu.cjs.map +1 -1
- package/dist/ui/components/ui/context-menu.d.cts +233 -2
- package/dist/ui/components/ui/context-menu.d.ts +233 -2
- package/dist/ui/components/ui/context-menu.js.map +1 -1
- package/dist/ui/components/ui/dialog.cjs.map +1 -1
- package/dist/ui/components/ui/dialog.d.cts +157 -5
- package/dist/ui/components/ui/dialog.d.ts +157 -5
- package/dist/ui/components/ui/dialog.js.map +1 -1
- package/dist/ui/components/ui/drawer.cjs.map +1 -1
- package/dist/ui/components/ui/drawer.d.cts +130 -10
- package/dist/ui/components/ui/drawer.d.ts +130 -10
- package/dist/ui/components/ui/drawer.js.map +1 -1
- package/dist/ui/components/ui/dropdown-menu.cjs.map +1 -1
- package/dist/ui/components/ui/dropdown-menu.d.cts +225 -6
- package/dist/ui/components/ui/dropdown-menu.d.ts +225 -6
- package/dist/ui/components/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/components/ui/empty.cjs.map +1 -1
- package/dist/ui/components/ui/empty.d.cts +78 -6
- package/dist/ui/components/ui/empty.d.ts +78 -6
- package/dist/ui/components/ui/empty.js.map +1 -1
- package/dist/ui/components/ui/field.cjs.map +1 -1
- package/dist/ui/components/ui/field.d.cts +180 -6
- package/dist/ui/components/ui/field.d.ts +180 -6
- package/dist/ui/components/ui/field.js.map +1 -1
- package/dist/ui/components/ui/file-icon.cjs.map +1 -1
- package/dist/ui/components/ui/file-icon.d.cts +32 -4
- package/dist/ui/components/ui/file-icon.d.ts +32 -4
- package/dist/ui/components/ui/file-icon.js.map +1 -1
- package/dist/ui/components/ui/hover-card.cjs.map +1 -1
- package/dist/ui/components/ui/hover-card.d.cts +39 -3
- package/dist/ui/components/ui/hover-card.d.ts +39 -3
- package/dist/ui/components/ui/hover-card.js.map +1 -1
- package/dist/ui/components/ui/input-group.cjs.map +1 -1
- package/dist/ui/components/ui/input-group.d.cts +84 -6
- package/dist/ui/components/ui/input-group.d.ts +84 -6
- package/dist/ui/components/ui/input-group.js.map +1 -1
- package/dist/ui/components/ui/input-otp.cjs.map +1 -1
- package/dist/ui/components/ui/input-otp.d.cts +58 -4
- package/dist/ui/components/ui/input-otp.d.ts +58 -4
- package/dist/ui/components/ui/input-otp.js.map +1 -1
- package/dist/ui/components/ui/input.cjs.map +1 -1
- package/dist/ui/components/ui/input.d.cts +18 -10
- package/dist/ui/components/ui/input.d.ts +18 -10
- package/dist/ui/components/ui/input.js.map +1 -1
- package/dist/ui/components/ui/item.cjs.map +1 -1
- package/dist/ui/components/ui/item.d.cts +130 -10
- package/dist/ui/components/ui/item.d.ts +130 -10
- package/dist/ui/components/ui/item.js.map +1 -1
- package/dist/ui/components/ui/kbd.cjs.map +1 -1
- package/dist/ui/components/ui/kbd.d.cts +26 -2
- package/dist/ui/components/ui/kbd.d.ts +26 -2
- package/dist/ui/components/ui/kbd.js.map +1 -1
- package/dist/ui/components/ui/label.cjs.map +1 -1
- package/dist/ui/components/ui/label.d.cts +15 -0
- package/dist/ui/components/ui/label.d.ts +15 -0
- package/dist/ui/components/ui/label.js.map +1 -1
- package/dist/ui/components/ui/layout.cjs +1 -1
- package/dist/ui/components/ui/layout.cjs.map +1 -1
- package/dist/ui/components/ui/layout.d.cts +45 -11
- package/dist/ui/components/ui/layout.d.ts +45 -11
- package/dist/ui/components/ui/layout.js +22 -20
- package/dist/ui/components/ui/layout.js.map +1 -1
- package/dist/ui/components/ui/menubar.cjs.map +1 -1
- package/dist/ui/components/ui/menubar.d.cts +220 -16
- package/dist/ui/components/ui/menubar.d.ts +220 -16
- package/dist/ui/components/ui/menubar.js.map +1 -1
- package/dist/ui/components/ui/meter.cjs.map +1 -1
- package/dist/ui/components/ui/meter.d.cts +52 -4
- package/dist/ui/components/ui/meter.d.ts +52 -4
- package/dist/ui/components/ui/meter.js.map +1 -1
- package/dist/ui/components/ui/mobile-form-variants.cjs.map +1 -1
- package/dist/ui/components/ui/mobile-form-variants.d.cts +30 -0
- package/dist/ui/components/ui/mobile-form-variants.d.ts +30 -0
- package/dist/ui/components/ui/mobile-form-variants.js.map +1 -1
- package/dist/ui/components/ui/mobile-form.cjs.map +1 -1
- package/dist/ui/components/ui/mobile-form.d.cts +186 -9
- package/dist/ui/components/ui/mobile-form.d.ts +186 -9
- package/dist/ui/components/ui/mobile-form.js.map +1 -1
- package/dist/ui/components/ui/navigation-menu-components.cjs.map +1 -1
- package/dist/ui/components/ui/navigation-menu-components.d.cts +104 -8
- package/dist/ui/components/ui/navigation-menu-components.d.ts +104 -8
- package/dist/ui/components/ui/navigation-menu-components.js.map +1 -1
- package/dist/ui/components/ui/navigation-menu-variants.cjs.map +1 -1
- package/dist/ui/components/ui/navigation-menu-variants.d.cts +15 -0
- package/dist/ui/components/ui/navigation-menu-variants.d.ts +15 -0
- package/dist/ui/components/ui/navigation-menu-variants.js.map +1 -1
- package/dist/ui/components/ui/number-field.cjs.map +1 -1
- package/dist/ui/components/ui/number-field.d.cts +78 -6
- package/dist/ui/components/ui/number-field.d.ts +78 -6
- package/dist/ui/components/ui/number-field.js.map +1 -1
- package/dist/ui/components/ui/pagination.cjs.map +1 -1
- package/dist/ui/components/ui/pagination.d.cts +99 -7
- package/dist/ui/components/ui/pagination.d.ts +99 -7
- package/dist/ui/components/ui/pagination.js.map +1 -1
- package/dist/ui/components/ui/password-input.cjs.map +1 -1
- package/dist/ui/components/ui/password-input.d.cts +10 -7
- package/dist/ui/components/ui/password-input.d.ts +10 -7
- package/dist/ui/components/ui/password-input.js.map +1 -1
- package/dist/ui/components/ui/popover.cjs.map +1 -1
- package/dist/ui/components/ui/popover.d.cts +86 -2
- package/dist/ui/components/ui/popover.d.ts +86 -2
- package/dist/ui/components/ui/popover.js.map +1 -1
- package/dist/ui/components/ui/progress.cjs.map +1 -1
- package/dist/ui/components/ui/progress.d.cts +72 -2
- package/dist/ui/components/ui/progress.d.ts +72 -2
- package/dist/ui/components/ui/progress.js.map +1 -1
- package/dist/ui/components/ui/radio-card.cjs.map +1 -1
- package/dist/ui/components/ui/radio-card.d.cts +32 -4
- package/dist/ui/components/ui/radio-card.d.ts +32 -4
- package/dist/ui/components/ui/radio-card.js.map +1 -1
- package/dist/ui/components/ui/radio-group.cjs.map +1 -1
- package/dist/ui/components/ui/radio-group.d.cts +28 -2
- package/dist/ui/components/ui/radio-group.d.ts +28 -2
- package/dist/ui/components/ui/radio-group.js.map +1 -1
- package/dist/ui/components/ui/resizable.cjs.map +1 -1
- package/dist/ui/components/ui/resizable.d.cts +42 -3
- package/dist/ui/components/ui/resizable.d.ts +42 -3
- package/dist/ui/components/ui/resizable.js.map +1 -1
- package/dist/ui/components/ui/responsive-list.cjs.map +1 -1
- package/dist/ui/components/ui/responsive-list.d.cts +176 -13
- package/dist/ui/components/ui/responsive-list.d.ts +176 -13
- package/dist/ui/components/ui/responsive-list.js.map +1 -1
- package/dist/ui/components/ui/scroll-area.cjs.map +1 -1
- package/dist/ui/components/ui/scroll-area.d.cts +28 -1
- package/dist/ui/components/ui/scroll-area.d.ts +28 -1
- package/dist/ui/components/ui/scroll-area.js.map +1 -1
- package/dist/ui/components/ui/searchable-select-input.cjs.map +1 -1
- package/dist/ui/components/ui/searchable-select-input.d.cts +199 -49
- package/dist/ui/components/ui/searchable-select-input.d.ts +199 -49
- package/dist/ui/components/ui/searchable-select-input.js.map +1 -1
- package/dist/ui/components/ui/select.cjs.map +1 -1
- package/dist/ui/components/ui/select.d.cts +205 -40
- package/dist/ui/components/ui/select.d.ts +205 -40
- package/dist/ui/components/ui/select.js.map +1 -1
- package/dist/ui/components/ui/separator.cjs.map +1 -1
- package/dist/ui/components/ui/separator.d.cts +13 -2
- package/dist/ui/components/ui/separator.d.ts +13 -2
- package/dist/ui/components/ui/separator.js.map +1 -1
- package/dist/ui/components/ui/sheet.cjs.map +1 -1
- package/dist/ui/components/ui/sheet.d.cts +128 -3
- package/dist/ui/components/ui/sheet.d.ts +128 -3
- package/dist/ui/components/ui/sheet.js.map +1 -1
- package/dist/ui/components/ui/skeleton.cjs.map +1 -1
- package/dist/ui/components/ui/skeleton.d.cts +13 -1
- package/dist/ui/components/ui/skeleton.d.ts +13 -1
- package/dist/ui/components/ui/skeleton.js.map +1 -1
- package/dist/ui/components/ui/slider.cjs.map +1 -1
- package/dist/ui/components/ui/slider.d.cts +13 -7
- package/dist/ui/components/ui/slider.d.ts +13 -7
- package/dist/ui/components/ui/slider.js.map +1 -1
- package/dist/ui/components/ui/spinner.cjs.map +1 -1
- package/dist/ui/components/ui/spinner.d.cts +13 -1
- package/dist/ui/components/ui/spinner.d.ts +13 -1
- package/dist/ui/components/ui/spinner.js.map +1 -1
- package/dist/ui/components/ui/switch.cjs.map +1 -1
- package/dist/ui/components/ui/switch.d.cts +26 -0
- package/dist/ui/components/ui/switch.d.ts +26 -0
- package/dist/ui/components/ui/switch.js.map +1 -1
- package/dist/ui/components/ui/table.cjs.map +1 -1
- package/dist/ui/components/ui/table.d.cts +118 -2
- package/dist/ui/components/ui/table.d.ts +118 -2
- package/dist/ui/components/ui/table.js.map +1 -1
- package/dist/ui/components/ui/tabs-components.cjs.map +1 -1
- package/dist/ui/components/ui/tabs-components.d.cts +52 -5
- package/dist/ui/components/ui/tabs-components.d.ts +52 -5
- package/dist/ui/components/ui/tabs-components.js.map +1 -1
- package/dist/ui/components/ui/tabs-variants.cjs.map +1 -1
- package/dist/ui/components/ui/tabs-variants.d.cts +15 -0
- package/dist/ui/components/ui/tabs-variants.d.ts +15 -0
- package/dist/ui/components/ui/tabs-variants.js.map +1 -1
- package/dist/ui/components/ui/textarea.cjs.map +1 -1
- package/dist/ui/components/ui/textarea.d.cts +23 -0
- package/dist/ui/components/ui/textarea.d.ts +23 -0
- package/dist/ui/components/ui/textarea.js.map +1 -1
- package/dist/ui/components/ui/toast.cjs.map +1 -1
- package/dist/ui/components/ui/toast.d.cts +136 -0
- package/dist/ui/components/ui/toast.d.ts +136 -0
- package/dist/ui/components/ui/toast.js.map +1 -1
- package/dist/ui/components/ui/toaster.cjs.map +1 -1
- package/dist/ui/components/ui/toaster.d.cts +12 -3
- package/dist/ui/components/ui/toaster.d.ts +12 -3
- package/dist/ui/components/ui/toaster.js.map +1 -1
- package/dist/ui/components/ui/toggle-components.cjs.map +1 -1
- package/dist/ui/components/ui/toggle-components.d.cts +15 -0
- package/dist/ui/components/ui/toggle-components.d.ts +15 -0
- package/dist/ui/components/ui/toggle-components.js.map +1 -1
- package/dist/ui/components/ui/toggle-group.cjs.map +1 -1
- package/dist/ui/components/ui/toggle-group.d.cts +33 -0
- package/dist/ui/components/ui/toggle-group.d.ts +33 -0
- package/dist/ui/components/ui/toggle-group.js.map +1 -1
- package/dist/ui/components/ui/toggle-variants.cjs.map +1 -1
- package/dist/ui/components/ui/toggle-variants.d.cts +15 -0
- package/dist/ui/components/ui/toggle-variants.d.ts +15 -0
- package/dist/ui/components/ui/toggle-variants.js.map +1 -1
- package/dist/ui/components/ui/toolbar.cjs.map +1 -1
- package/dist/ui/components/ui/toolbar.d.cts +94 -7
- package/dist/ui/components/ui/toolbar.d.ts +94 -7
- package/dist/ui/components/ui/toolbar.js.map +1 -1
- package/dist/ui/components/ui/tooltip.cjs.map +1 -1
- package/dist/ui/components/ui/tooltip.d.cts +54 -3
- package/dist/ui/components/ui/tooltip.d.ts +54 -3
- package/dist/ui/components/ui/tooltip.js.map +1 -1
- package/dist/ui/lib/hooks/use-gps.cjs.map +1 -1
- package/dist/ui/lib/hooks/use-gps.d.cts +29 -4
- package/dist/ui/lib/hooks/use-gps.d.ts +29 -4
- package/dist/ui/lib/hooks/use-gps.js.map +1 -1
- package/dist/ui/lib/hooks/use-is-client.cjs.map +1 -1
- package/dist/ui/lib/hooks/use-is-client.d.cts +11 -2
- package/dist/ui/lib/hooks/use-is-client.d.ts +11 -2
- package/dist/ui/lib/hooks/use-is-client.js.map +1 -1
- package/dist/ui/lib/hooks/use-keyboard-shortcut.cjs.map +1 -1
- package/dist/ui/lib/hooks/use-keyboard-shortcut.d.cts +48 -18
- package/dist/ui/lib/hooks/use-keyboard-shortcut.d.ts +48 -18
- package/dist/ui/lib/hooks/use-keyboard-shortcut.js.map +1 -1
- package/dist/ui/lib/hooks/use-mobile.cjs.map +1 -1
- package/dist/ui/lib/hooks/use-mobile.d.cts +11 -3
- package/dist/ui/lib/hooks/use-mobile.d.ts +11 -3
- package/dist/ui/lib/hooks/use-mobile.js.map +1 -1
- package/dist/ui/lib/hooks/use-toast.cjs.map +1 -1
- package/dist/ui/lib/hooks/use-toast.d.cts +184 -15
- package/dist/ui/lib/hooks/use-toast.d.ts +184 -15
- package/dist/ui/lib/hooks/use-toast.js.map +1 -1
- package/dist/ui/lib/ime-utils.cjs.map +1 -1
- package/dist/ui/lib/ime-utils.d.cts +40 -13
- package/dist/ui/lib/ime-utils.d.ts +40 -13
- package/dist/ui/lib/ime-utils.js.map +1 -1
- package/dist/ui/lib/utils.cjs.map +1 -1
- package/dist/ui/lib/utils.d.cts +9 -6
- package/dist/ui/lib/utils.d.ts +9 -6
- package/dist/ui/lib/utils.js.map +1 -1
- package/docs/ai.md +34 -1
- package/docs/exports.md +5 -1
- package/docs/index.md +89 -16
- package/docs/migration.md +268 -0
- package/docs/request-form.md +4 -1
- package/docs/tools.md +4 -1
- package/docs/ui.md +4 -1
- package/llms-full.txt +499 -36
- package/llms.txt +4 -0
- package/package.json +35 -5
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Host inputs and presentation settings for QRCodeGenerator.
|
|
4
|
+
* @see QRCodeGenerator
|
|
4
5
|
*/
|
|
5
6
|
interface QRCodeGeneratorProps {
|
|
6
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Text passed unchanged to the encoder; format/value validity is determined by the optional encoding library.
|
|
9
|
+
*/
|
|
7
10
|
value: string;
|
|
8
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Card heading.
|
|
13
|
+
* @defaultValue Scan to Check In
|
|
14
|
+
*/
|
|
9
15
|
title?: string;
|
|
10
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Optional supporting card text; omitted means no description.
|
|
18
|
+
*/
|
|
11
19
|
description?: string;
|
|
12
20
|
}
|
|
13
21
|
/**
|
|
14
|
-
* QR
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
22
|
+
* Loads react-qr-code on the client and renders a fixed-size QR code inside a card.
|
|
23
|
+
* @param props - Encoded value and optional card heading/description; see QRCodeGeneratorProps. Wrapper defaults: title='Scan to Check In'.
|
|
24
|
+
* @returns The rendered QRCodeGenerator composition.
|
|
25
|
+
* @remarks Import @alneas/appkit-react/styles in the rendering host. Import Appkit CSS and install the optional react-qr-code peer. The client effect loads the QR component; SSR and initial render show Loading QR.... The inner QR size is 200 with a 256 viewBox and responsive styling. Dynamic-import rejection is not caught or displayed by this wrapper. There is no download/export API or callback.
|
|
18
26
|
* @example
|
|
19
27
|
* ```tsx
|
|
20
28
|
* import { QRCodeGenerator } from '@alneas/appkit-react/tools/barcode';
|
|
29
|
+
* import '@alneas/appkit-react/styles';
|
|
21
30
|
*
|
|
22
|
-
*
|
|
23
|
-
* value="https://example.com"
|
|
24
|
-
*
|
|
25
|
-
* description="スキャンしてサイトを開く"
|
|
26
|
-
* />
|
|
31
|
+
* export function Example() {
|
|
32
|
+
* return (<QRCodeGenerator value="https://example.com/document" title="Open document" />);
|
|
33
|
+
* }
|
|
27
34
|
* ```
|
|
28
35
|
*/
|
|
29
36
|
export declare const QRCodeGenerator: React.FC<QRCodeGeneratorProps>;
|
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Host inputs and presentation settings for QRCodeGenerator.
|
|
4
|
+
* @see QRCodeGenerator
|
|
4
5
|
*/
|
|
5
6
|
interface QRCodeGeneratorProps {
|
|
6
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Text passed unchanged to the encoder; format/value validity is determined by the optional encoding library.
|
|
9
|
+
*/
|
|
7
10
|
value: string;
|
|
8
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Card heading.
|
|
13
|
+
* @defaultValue Scan to Check In
|
|
14
|
+
*/
|
|
9
15
|
title?: string;
|
|
10
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Optional supporting card text; omitted means no description.
|
|
18
|
+
*/
|
|
11
19
|
description?: string;
|
|
12
20
|
}
|
|
13
21
|
/**
|
|
14
|
-
* QR
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
22
|
+
* Loads react-qr-code on the client and renders a fixed-size QR code inside a card.
|
|
23
|
+
* @param props - Encoded value and optional card heading/description; see QRCodeGeneratorProps. Wrapper defaults: title='Scan to Check In'.
|
|
24
|
+
* @returns The rendered QRCodeGenerator composition.
|
|
25
|
+
* @remarks Import @alneas/appkit-react/styles in the rendering host. Import Appkit CSS and install the optional react-qr-code peer. The client effect loads the QR component; SSR and initial render show Loading QR.... The inner QR size is 200 with a 256 viewBox and responsive styling. Dynamic-import rejection is not caught or displayed by this wrapper. There is no download/export API or callback.
|
|
18
26
|
* @example
|
|
19
27
|
* ```tsx
|
|
20
28
|
* import { QRCodeGenerator } from '@alneas/appkit-react/tools/barcode';
|
|
29
|
+
* import '@alneas/appkit-react/styles';
|
|
21
30
|
*
|
|
22
|
-
*
|
|
23
|
-
* value="https://example.com"
|
|
24
|
-
*
|
|
25
|
-
* description="スキャンしてサイトを開く"
|
|
26
|
-
* />
|
|
31
|
+
* export function Example() {
|
|
32
|
+
* return (<QRCodeGenerator value="https://example.com/document" title="Open document" />);
|
|
33
|
+
* }
|
|
27
34
|
* ```
|
|
28
35
|
*/
|
|
29
36
|
export declare const QRCodeGenerator: React.FC<QRCodeGeneratorProps>;
|
|
@@ -23,7 +23,7 @@ var c = ({ value: c, title: l = "Scan to Check In", description: u }) => {
|
|
|
23
23
|
},
|
|
24
24
|
viewBox: "0 0 256 256"
|
|
25
25
|
}) : /* @__PURE__ */ a("div", {
|
|
26
|
-
className: "text-
|
|
26
|
+
className: "text-neutral-700 italic",
|
|
27
27
|
children: "Loading QR..."
|
|
28
28
|
})
|
|
29
29
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QRCodeGenerator.js","names":["React","QRCodeGenerator","QRCodeComponent","setQRCodeComponent","m","Card","CardHeader","CardTitle","title","description","CardDescription","CardContent"],"sources":["../../../../src/tools/components/barcode/QRCodeGenerator.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Card, CardContent, CardHeader, CardTitle, CardDescription } from '../ui/card';\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"QRCodeGenerator.js","names":["React","QRCodeGenerator","QRCodeComponent","setQRCodeComponent","m","Card","CardHeader","CardTitle","title","description","CardDescription","CardContent"],"sources":["../../../../src/tools/components/barcode/QRCodeGenerator.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Card, CardContent, CardHeader, CardTitle, CardDescription } from '../ui/card';\n\n/**\n * Host inputs and presentation settings for QRCodeGenerator.\n * @see QRCodeGenerator\n */\ninterface QRCodeGeneratorProps {\n /**\n * Text passed unchanged to the encoder; format/value validity is determined by the optional encoding library.\n */\n value: string;\n /**\n * Card heading.\n * @defaultValue Scan to Check In\n */\n title?: string;\n /**\n * Optional supporting card text; omitted means no description.\n */\n description?: string;\n}\n\n/**\n * Loads react-qr-code on the client and renders a fixed-size QR code inside a card.\n * @param props - Encoded value and optional card heading/description; see QRCodeGeneratorProps. Wrapper defaults: title='Scan to Check In'.\n * @returns The rendered QRCodeGenerator composition.\n * @remarks Import @alneas/appkit-react/styles in the rendering host. Import Appkit CSS and install the optional react-qr-code peer. The client effect loads the QR component; SSR and initial render show Loading QR.... The inner QR size is 200 with a 256 viewBox and responsive styling. Dynamic-import rejection is not caught or displayed by this wrapper. There is no download/export API or callback.\n * @example\n * ```tsx\n * import { QRCodeGenerator } from '@alneas/appkit-react/tools/barcode';\n * import '@alneas/appkit-react/styles';\n *\n * export function Example() {\n * return (<QRCodeGenerator value=\"https://example.com/document\" title=\"Open document\" />);\n * }\n * ```\n */\nexport const QRCodeGenerator: React.FC<QRCodeGeneratorProps> = ({\n value,\n title = 'Scan to Check In',\n description,\n}) => {\n const [QRCodeComponent, setQRCodeComponent] = React.useState<React.ComponentType<{\n value: string;\n size?: number;\n style?: React.CSSProperties;\n viewBox?: string;\n }> | null>(null);\n\n React.useEffect(() => {\n import('react-qr-code').then((m) => setQRCodeComponent(() => m.default));\n }, []);\n\n return (\n <Card className='w-[300px] mx-auto text-center'>\n <CardHeader>\n <CardTitle>{title}</CardTitle>\n {description && <CardDescription>{description}</CardDescription>}\n </CardHeader>\n <CardContent className='flex justify-center p-6 rounded-b-lg'>\n {/* Keep the QR and loading label on the same scanner-friendly white surface. */}\n <div className='bg-white p-4 rounded-lg flex items-center justify-center min-h-[200px]'>\n {QRCodeComponent ? (\n <QRCodeComponent\n value={value}\n size={200}\n style={{ height: 'auto', maxWidth: '100%', width: '100%' }}\n viewBox={`0 0 256 256`}\n />\n ) : (\n <div className='text-neutral-700 italic'>Loading QR...</div>\n )}\n </div>\n </CardContent>\n </Card>\n );\n};\n"],"mappings":";;;;;AAuCA,IAAaC,KAAmD,EAC9D,UACA,WAAQ,oBACR,qBACI;CACJ,IAAM,CAACC,GAAiBC,KAAsBH,EAAM,SAKzC,IAAI;CAMf,OAJAA,EAAM,gBAAgB;EACpB,OAAO,gBAAgB,CAAC,MAAM,MAAMG,QAAyBC,EAAE,OAAO,CAAC;CACzE,GAAG,CAAC,CAAC,GAGH,kBAACC,GAAD;EAAM,WAAU;EAAhB,UAAA,CACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UAAYC,EAAiB,CAAA,GAC5BC,KAAe,kBAACC,GAAD,EAAA,UAAkBD,EAA6B,CAAA,CACrD,EAAA,CAAA,GACZ,kBAACE,GAAD;GAAa,WAAU;GAErB,UAAA,kBAAC,OAAD;IAAK,WAAU;IACZ,UAAAT,IACC,kBAACA,GAAD;KACS;KACP,MAAM;KACN,OAAO;MAAE,QAAQ;MAAQ,UAAU;MAAQ,OAAO;KAAO;KACzD,SAAS;IACV,CAAA,IAED,kBAAC,OAAD;KAAK,WAAU;KAA0B,UAAA;IAAkB,CAAA;GAE1D,CAAA;EACM,CAAA,CACT;;AAEV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QRCodeScanner.cjs","names":["useState","Card","CardHeader","CardTitle","CardContent","Alert","CheckCircle2","AlertTitle","AlertDescription","_Fragment","Button","AlertCircle","require_runtime","require_ui_components_ui_button_components","require_ui_components_ui_alert","require_ui_components_ui_card","react_jsx_runtime","react","lucide_react","QRCodeScanner","scannedResult","setScannedResult","error","setError","paused","setPaused","ScannerComponent","setScannerComponent","m","handleScan","text","onScan","reset","title","result","scanError","showSuccess","successMessage"],"sources":["../../../../src/tools/components/barcode/QRCodeScanner.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { Button } from '../ui/button';\nimport { Card, CardContent, CardHeader, CardTitle } from '../ui/card';\nimport { Alert, AlertDescription, AlertTitle } from '../ui/alert';\nimport { CheckCircle2, AlertCircle } from 'lucide-react';\n\ninterface QRCodeScannerProps {\n onScan: (text: string) => Promise<void> | void;\n title?: string;\n successMessage?: string;\n showSuccess?: boolean;\n}\n\ninterface ScanResult {\n rawValue: string;\n}\n\ninterface ScannerComponentProps {\n onScan: (result: ScanResult[]) => void;\n onError: (error: unknown) => void;\n components?: {\n finder?: boolean;\n };\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"QRCodeScanner.cjs","names":["useState","Card","CardHeader","CardTitle","CardContent","Alert","CheckCircle2","AlertTitle","AlertDescription","_Fragment","Button","AlertCircle","require_runtime","require_ui_components_ui_button_components","require_ui_components_ui_alert","require_ui_components_ui_card","react_jsx_runtime","react","lucide_react","QRCodeScanner","scannedResult","setScannedResult","error","setError","paused","setPaused","ScannerComponent","setScannerComponent","m","handleScan","text","onScan","reset","title","result","scanError","showSuccess","successMessage"],"sources":["../../../../src/tools/components/barcode/QRCodeScanner.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { Button } from '../ui/button';\nimport { Card, CardContent, CardHeader, CardTitle } from '../ui/card';\nimport { Alert, AlertDescription, AlertTitle } from '../ui/alert';\nimport { CheckCircle2, AlertCircle } from 'lucide-react';\n\n/**\n * Host inputs and presentation settings for QRCodeScanner.\n * @see QRCodeScanner\n */\ninterface QRCodeScannerProps {\n /**\n * Called and awaited for the first decoded nonempty raw value; rejection is caught into the error alert. The host owns authorization and processing.\n * @param text - Host callback input described above.\n * @returns No value after host processing completes; reject or throw to show an error alert.\n */\n onScan: (text: string) => Promise<void> | void;\n /**\n * Card heading.\n * @defaultValue QR Scanner\n */\n title?: string;\n /**\n * Optional success text replacing Processed code: VALUE.\n */\n successMessage?: string;\n /**\n * Shows the success alert and Scan Next reset button; defaults to true. false removes that successful reset path.\n */\n showSuccess?: boolean;\n}\n\ninterface ScanResult {\n rawValue: string;\n}\n\ninterface ScannerComponentProps {\n onScan: (result: ScanResult[]) => void;\n onError: (error: unknown) => void;\n components?: {\n finder?: boolean;\n };\n}\n\n/**\n * Loads the camera scanner, processes the first decoded value and pauses until its local reset action.\n * @param props - Scan handler, card heading and success-display settings; see QRCodeScannerProps. Wrapper defaults: title='QR Scanner', showSuccess=true.\n * @returns The rendered QRCodeScanner composition.\n * @remarks Import @alneas/appkit-react/styles in the rendering host. Import Appkit CSS and install the optional @yudiel/react-qr-scanner peer. Camera access requires a supporting browser, secure context and permission; upstream owns camera setup/teardown. Only the first result is processed. The scanner unmounts after a result, and success content appears before onScan settles. onScan rejection is caught and displayed; camera errors are only logged and dynamic-import rejection is not caught. With showSuccess=false, successful scans offer no local reset button and remain paused; remount or use the error retry path. This component neither verifies identity nor persists decoded data.\n * @example\n * ```tsx\n * import { QRCodeScanner } from '@alneas/appkit-react/tools/barcode';\n * import '@alneas/appkit-react/styles';\n *\n * export function Example({ handleCode }: { handleCode: (text: string) => Promise<void> }) {\n * return (<QRCodeScanner onScan={handleCode} title=\"Scan document code\" />);\n * }\n * ```\n */\nexport const QRCodeScanner: React.FC<QRCodeScannerProps> = ({\n onScan,\n title = 'QR Scanner',\n successMessage,\n showSuccess = true,\n}) => {\n const [scannedResult, setScannedResult] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [paused, setPaused] = useState(false);\n const [ScannerComponent, setScannerComponent] =\n useState<React.ComponentType<ScannerComponentProps> | null>(null);\n\n React.useEffect(() => {\n import('@yudiel/react-qr-scanner').then((m) => setScannerComponent(() => m.Scanner));\n }, []);\n\n const handleScan = async (text: string) => {\n if (paused || !text) return;\n\n setPaused(true);\n setScannedResult(text);\n setError(null);\n\n try {\n await onScan(text);\n } catch (e) {\n setError(e instanceof Error ? e.message : 'Scan failed');\n }\n };\n\n const reset = () => {\n setScannedResult(null);\n setError(null);\n setPaused(false);\n };\n\n return (\n <Card className='max-w-md mx-auto'>\n <CardHeader>\n <CardTitle>{title}</CardTitle>\n </CardHeader>\n <CardContent className='space-y-4'>\n {!scannedResult && (\n <div className='aspect-square overflow-hidden rounded-lg border bg-black flex items-center justify-center'>\n {ScannerComponent ? (\n <ScannerComponent\n onScan={(result: ScanResult[]) => result[0] && handleScan(result[0].rawValue)}\n onError={(scanError: unknown) => console.error(scanError)}\n components={{ finder: true }}\n />\n ) : (\n <div className='text-white'>Loading scanner...</div>\n )}\n </div>\n )}\n\n {showSuccess && scannedResult && !error && (\n <Alert className='border-primary bg-primary/10 text-primary'>\n <CheckCircle2 className='h-4 w-4' />\n <AlertTitle>Success</AlertTitle>\n <AlertDescription>\n {successMessage ? (\n successMessage\n ) : (\n <>\n Processed code: <span className='font-mono text-foreground'>{scannedResult}</span>\n </>\n )}\n </AlertDescription>\n <Button onClick={reset} className='mt-2' variant='outline' size='sm'>\n Scan Next\n </Button>\n </Alert>\n )}\n\n {error && (\n <Alert variant='destructive'>\n <AlertCircle className='h-4 w-4' />\n <AlertTitle>Error</AlertTitle>\n <AlertDescription>{error}</AlertDescription>\n <Button onClick={reset} className='mt-2' variant='outline' size='sm'>\n Try Again\n </Button>\n </Alert>\n )}\n </CardContent>\n </Card>\n );\n};\n"],"mappings":"A,8YA4DA,IAAamB,GAA+C,CAC1D,SACA,QAAQ,aACR,iBACA,cAAc,MACV,CACJ,GAAM,CAACC,EAAeC,IAAA,EAAoBrB,EAAAA,SAAAA,CAAwB,IAAI,EAChE,CAACsB,EAAOC,IAAA,EAAYvB,EAAAA,SAAAA,CAAwB,IAAI,EAChD,CAACwB,EAAQC,IAAA,EAAazB,EAAAA,SAAAA,CAAS,EAAK,EACpC,CAAC0B,EAAkBC,IAAA,EACvB3B,EAAAA,SAAAA,CAA4D,IAAI,EAElEiB,EAAA,QAAM,cAAgB,CACpB,OAAO,2BAA2B,CAAC,KAAM,GAAMU,MAA0BC,EAAE,OAAO,CAAC,CACrF,EAAG,CAAC,CAAC,EAEL,IAAMC,EAAa,KAAO,IAAiB,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AAAA,SAAA,CAAA,SAAA,CAAE,oBACgB,EAAAO,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,4BAA6B,SAAAI,CAAoB,CAAA,CACjF,CAAA,CAAA,CAEY,CAAA,GAClB,EAAAJ,EAAA,IAAA,CAACN,EAAAA,OAAD,CAAQ,QAASsB,EAAO,UAAU,OAAO,QAAQ,UAAU,KAAK,KAAK,SAAA,WAE7D,CAAA,CACH,C,GAGRV,IACC,EAAAN,EAAA,KAAA,CAACX,EAAAA,MAAD,CAAO,QAAQ,cAAf,SAAA,EACE,EAAAW,EAAA,IAAA,CAACL,EAAAA,YAAD,CAAa,UAAU,SAAW,CAAA,GAClC,EAAAK,EAAA,IAAA,CAACT,EAAAA,WAAD,CAAA,SAAY,OAAiB,CAAA,GAC7B,EAAAS,EAAA,IAAA,CAACR,EAAAA,iBAAD,CAAA,SAAmBc,CAAwB,CAAA,GAC3C,EAAAN,EAAA,IAAA,CAACN,EAAAA,OAAD,CAAQ,QAASsB,EAAO,UAAU,OAAO,QAAQ,UAAU,KAAK,KAAK,SAAA,WAE7D,CAAA,CACH,C,EAEE,CACT,CAAA,CAAA,C,EAEV,E"}
|
|
@@ -1,12 +1,43 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Host inputs and presentation settings for QRCodeScanner.
|
|
4
|
+
* @see QRCodeScanner
|
|
5
|
+
*/
|
|
2
6
|
interface QRCodeScannerProps {
|
|
7
|
+
/**
|
|
8
|
+
* Called and awaited for the first decoded nonempty raw value; rejection is caught into the error alert. The host owns authorization and processing.
|
|
9
|
+
* @param text - Host callback input described above.
|
|
10
|
+
* @returns No value after host processing completes; reject or throw to show an error alert.
|
|
11
|
+
*/
|
|
3
12
|
onScan: (text: string) => Promise<void> | void;
|
|
13
|
+
/**
|
|
14
|
+
* Card heading.
|
|
15
|
+
* @defaultValue QR Scanner
|
|
16
|
+
*/
|
|
4
17
|
title?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional success text replacing Processed code: VALUE.
|
|
20
|
+
*/
|
|
5
21
|
successMessage?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Shows the success alert and Scan Next reset button; defaults to true. false removes that successful reset path.
|
|
24
|
+
*/
|
|
6
25
|
showSuccess?: boolean;
|
|
7
26
|
}
|
|
8
27
|
/**
|
|
9
|
-
*
|
|
28
|
+
* Loads the camera scanner, processes the first decoded value and pauses until its local reset action.
|
|
29
|
+
* @param props - Scan handler, card heading and success-display settings; see QRCodeScannerProps. Wrapper defaults: title='QR Scanner', showSuccess=true.
|
|
30
|
+
* @returns The rendered QRCodeScanner composition.
|
|
31
|
+
* @remarks Import @alneas/appkit-react/styles in the rendering host. Import Appkit CSS and install the optional @yudiel/react-qr-scanner peer. Camera access requires a supporting browser, secure context and permission; upstream owns camera setup/teardown. Only the first result is processed. The scanner unmounts after a result, and success content appears before onScan settles. onScan rejection is caught and displayed; camera errors are only logged and dynamic-import rejection is not caught. With showSuccess=false, successful scans offer no local reset button and remain paused; remount or use the error retry path. This component neither verifies identity nor persists decoded data.
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* import { QRCodeScanner } from '@alneas/appkit-react/tools/barcode';
|
|
35
|
+
* import '@alneas/appkit-react/styles';
|
|
36
|
+
*
|
|
37
|
+
* export function Example({ handleCode }: { handleCode: (text: string) => Promise<void> }) {
|
|
38
|
+
* return (<QRCodeScanner onScan={handleCode} title="Scan document code" />);
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
10
41
|
*/
|
|
11
42
|
export declare const QRCodeScanner: React.FC<QRCodeScannerProps>;
|
|
12
43
|
export {};
|
|
@@ -1,12 +1,43 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Host inputs and presentation settings for QRCodeScanner.
|
|
4
|
+
* @see QRCodeScanner
|
|
5
|
+
*/
|
|
2
6
|
interface QRCodeScannerProps {
|
|
7
|
+
/**
|
|
8
|
+
* Called and awaited for the first decoded nonempty raw value; rejection is caught into the error alert. The host owns authorization and processing.
|
|
9
|
+
* @param text - Host callback input described above.
|
|
10
|
+
* @returns No value after host processing completes; reject or throw to show an error alert.
|
|
11
|
+
*/
|
|
3
12
|
onScan: (text: string) => Promise<void> | void;
|
|
13
|
+
/**
|
|
14
|
+
* Card heading.
|
|
15
|
+
* @defaultValue QR Scanner
|
|
16
|
+
*/
|
|
4
17
|
title?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional success text replacing Processed code: VALUE.
|
|
20
|
+
*/
|
|
5
21
|
successMessage?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Shows the success alert and Scan Next reset button; defaults to true. false removes that successful reset path.
|
|
24
|
+
*/
|
|
6
25
|
showSuccess?: boolean;
|
|
7
26
|
}
|
|
8
27
|
/**
|
|
9
|
-
*
|
|
28
|
+
* Loads the camera scanner, processes the first decoded value and pauses until its local reset action.
|
|
29
|
+
* @param props - Scan handler, card heading and success-display settings; see QRCodeScannerProps. Wrapper defaults: title='QR Scanner', showSuccess=true.
|
|
30
|
+
* @returns The rendered QRCodeScanner composition.
|
|
31
|
+
* @remarks Import @alneas/appkit-react/styles in the rendering host. Import Appkit CSS and install the optional @yudiel/react-qr-scanner peer. Camera access requires a supporting browser, secure context and permission; upstream owns camera setup/teardown. Only the first result is processed. The scanner unmounts after a result, and success content appears before onScan settles. onScan rejection is caught and displayed; camera errors are only logged and dynamic-import rejection is not caught. With showSuccess=false, successful scans offer no local reset button and remain paused; remount or use the error retry path. This component neither verifies identity nor persists decoded data.
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* import { QRCodeScanner } from '@alneas/appkit-react/tools/barcode';
|
|
35
|
+
* import '@alneas/appkit-react/styles';
|
|
36
|
+
*
|
|
37
|
+
* export function Example({ handleCode }: { handleCode: (text: string) => Promise<void> }) {
|
|
38
|
+
* return (<QRCodeScanner onScan={handleCode} title="Scan document code" />);
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
10
41
|
*/
|
|
11
42
|
export declare const QRCodeScanner: React.FC<QRCodeScannerProps>;
|
|
12
43
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QRCodeScanner.js","names":["_Fragment","React","QRCodeScanner","scannedResult","setScannedResult","useState","error","setError","paused","setPaused","ScannerComponent","setScannerComponent","m","handleScan","text","onScan","reset","Card","CardHeader","CardTitle","title","CardContent","result","scanError","showSuccess","Alert","CheckCircle2","AlertTitle","AlertDescription","successMessage","Fragment","Button","AlertCircle"],"sources":["../../../../src/tools/components/barcode/QRCodeScanner.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { Button } from '../ui/button';\nimport { Card, CardContent, CardHeader, CardTitle } from '../ui/card';\nimport { Alert, AlertDescription, AlertTitle } from '../ui/alert';\nimport { CheckCircle2, AlertCircle } from 'lucide-react';\n\ninterface QRCodeScannerProps {\n onScan: (text: string) => Promise<void> | void;\n title?: string;\n successMessage?: string;\n showSuccess?: boolean;\n}\n\ninterface ScanResult {\n rawValue: string;\n}\n\ninterface ScannerComponentProps {\n onScan: (result: ScanResult[]) => void;\n onError: (error: unknown) => void;\n components?: {\n finder?: boolean;\n };\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"QRCodeScanner.js","names":["_Fragment","React","QRCodeScanner","scannedResult","setScannedResult","useState","error","setError","paused","setPaused","ScannerComponent","setScannerComponent","m","handleScan","text","onScan","reset","Card","CardHeader","CardTitle","title","CardContent","result","scanError","showSuccess","Alert","CheckCircle2","AlertTitle","AlertDescription","successMessage","Fragment","Button","AlertCircle"],"sources":["../../../../src/tools/components/barcode/QRCodeScanner.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { Button } from '../ui/button';\nimport { Card, CardContent, CardHeader, CardTitle } from '../ui/card';\nimport { Alert, AlertDescription, AlertTitle } from '../ui/alert';\nimport { CheckCircle2, AlertCircle } from 'lucide-react';\n\n/**\n * Host inputs and presentation settings for QRCodeScanner.\n * @see QRCodeScanner\n */\ninterface QRCodeScannerProps {\n /**\n * Called and awaited for the first decoded nonempty raw value; rejection is caught into the error alert. The host owns authorization and processing.\n * @param text - Host callback input described above.\n * @returns No value after host processing completes; reject or throw to show an error alert.\n */\n onScan: (text: string) => Promise<void> | void;\n /**\n * Card heading.\n * @defaultValue QR Scanner\n */\n title?: string;\n /**\n * Optional success text replacing Processed code: VALUE.\n */\n successMessage?: string;\n /**\n * Shows the success alert and Scan Next reset button; defaults to true. false removes that successful reset path.\n */\n showSuccess?: boolean;\n}\n\ninterface ScanResult {\n rawValue: string;\n}\n\ninterface ScannerComponentProps {\n onScan: (result: ScanResult[]) => void;\n onError: (error: unknown) => void;\n components?: {\n finder?: boolean;\n };\n}\n\n/**\n * Loads the camera scanner, processes the first decoded value and pauses until its local reset action.\n * @param props - Scan handler, card heading and success-display settings; see QRCodeScannerProps. Wrapper defaults: title='QR Scanner', showSuccess=true.\n * @returns The rendered QRCodeScanner composition.\n * @remarks Import @alneas/appkit-react/styles in the rendering host. Import Appkit CSS and install the optional @yudiel/react-qr-scanner peer. Camera access requires a supporting browser, secure context and permission; upstream owns camera setup/teardown. Only the first result is processed. The scanner unmounts after a result, and success content appears before onScan settles. onScan rejection is caught and displayed; camera errors are only logged and dynamic-import rejection is not caught. With showSuccess=false, successful scans offer no local reset button and remain paused; remount or use the error retry path. This component neither verifies identity nor persists decoded data.\n * @example\n * ```tsx\n * import { QRCodeScanner } from '@alneas/appkit-react/tools/barcode';\n * import '@alneas/appkit-react/styles';\n *\n * export function Example({ handleCode }: { handleCode: (text: string) => Promise<void> }) {\n * return (<QRCodeScanner onScan={handleCode} title=\"Scan document code\" />);\n * }\n * ```\n */\nexport const QRCodeScanner: React.FC<QRCodeScannerProps> = ({\n onScan,\n title = 'QR Scanner',\n successMessage,\n showSuccess = true,\n}) => {\n const [scannedResult, setScannedResult] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [paused, setPaused] = useState(false);\n const [ScannerComponent, setScannerComponent] =\n useState<React.ComponentType<ScannerComponentProps> | null>(null);\n\n React.useEffect(() => {\n import('@yudiel/react-qr-scanner').then((m) => setScannerComponent(() => m.Scanner));\n }, []);\n\n const handleScan = async (text: string) => {\n if (paused || !text) return;\n\n setPaused(true);\n setScannedResult(text);\n setError(null);\n\n try {\n await onScan(text);\n } catch (e) {\n setError(e instanceof Error ? e.message : 'Scan failed');\n }\n };\n\n const reset = () => {\n setScannedResult(null);\n setError(null);\n setPaused(false);\n };\n\n return (\n <Card className='max-w-md mx-auto'>\n <CardHeader>\n <CardTitle>{title}</CardTitle>\n </CardHeader>\n <CardContent className='space-y-4'>\n {!scannedResult && (\n <div className='aspect-square overflow-hidden rounded-lg border bg-black flex items-center justify-center'>\n {ScannerComponent ? (\n <ScannerComponent\n onScan={(result: ScanResult[]) => result[0] && handleScan(result[0].rawValue)}\n onError={(scanError: unknown) => console.error(scanError)}\n components={{ finder: true }}\n />\n ) : (\n <div className='text-white'>Loading scanner...</div>\n )}\n </div>\n )}\n\n {showSuccess && scannedResult && !error && (\n <Alert className='border-primary bg-primary/10 text-primary'>\n <CheckCircle2 className='h-4 w-4' />\n <AlertTitle>Success</AlertTitle>\n <AlertDescription>\n {successMessage ? (\n successMessage\n ) : (\n <>\n Processed code: <span className='font-mono text-foreground'>{scannedResult}</span>\n </>\n )}\n </AlertDescription>\n <Button onClick={reset} className='mt-2' variant='outline' size='sm'>\n Scan Next\n </Button>\n </Alert>\n )}\n\n {error && (\n <Alert variant='destructive'>\n <AlertCircle className='h-4 w-4' />\n <AlertTitle>Error</AlertTitle>\n <AlertDescription>{error}</AlertDescription>\n <Button onClick={reset} className='mt-2' variant='outline' size='sm'>\n Try Again\n </Button>\n </Alert>\n )}\n </CardContent>\n </Card>\n );\n};\n"],"mappings":";;;;;;;;AA4DA,IAAaE,KAA+C,EAC1D,WACA,WAAQ,cACR,mBACA,iBAAc,SACV;CACJ,IAAM,CAACC,GAAeC,KAAoBC,EAAwB,IAAI,GAChE,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A,UAAA,CAAE,oBACgB,kBAAC,QAAD;OAAM,WAAU;OAA6B,UAAAG;MAAoB,CAAA,CACjF,EAAA,CAAA,EAEY,CAAA;MAClB,kBAAC4B,GAAD;OAAQ,SAASf;OAAO,WAAU;OAAO,SAAQ;OAAU,MAAK;OAAK,UAAA;MAE7D,CAAA;KACH;;IAGRV,KACC,kBAACmB,GAAD;KAAO,SAAQ;KAAf,UAAA;MACE,kBAACO,GAAD,EAAa,WAAU,UAAW,CAAA;MAClC,kBAACL,GAAD,EAAA,UAAY,QAAiB,CAAA;MAC7B,kBAACC,GAAD,EAAA,UAAmBtB,EAAwB,CAAA;MAC3C,kBAACyB,GAAD;OAAQ,SAASf;OAAO,WAAU;OAAO,SAAQ;OAAU,MAAK;OAAK,UAAA;MAE7D,CAAA;KACH;;GAEE;EACT,CAAA,CAAA;;AAEV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceCalendar.cjs","names":["React","getLocale","calendarRange","enUS","ja","subMonths","subWeeks","subDays","addMonths","addWeeks","addDays","format","startOfWeek","CalendarOptionsContext","cn","Button","ChevronsLeft","ChevronLeft","ChevronRight","ChevronsRight","Select","SelectTrigger","SelectContent","SelectItem","LayoutGrid","_Fragment","StretchHorizontal","Users","MonthView","TimeGridView","TimelineView","AgendaView","ResourceGridView","Dialog","DialogContent","DialogHeader","DialogTitle","DialogDescription","require_runtime","require_ui_lib_utils","require_ui_components_ui_button_components","require_ui_components_ui_dialog","require_ui_components_ui_select","require_runtime$1","require_calendar_today","require_calendar_view_agenda","require_calendar_view_day","require_calendar_view_grid","require_calendar_view_month","require_calendar_view_resource","require_calendar_view_timeline","require_calendar_view_week","require_tools_components_calendar_calendar_layout","require_tools_components_calendar_calendar_context","require_tools_components_calendar_views_MonthView","require_tools_components_calendar_views_TimeGridView","require_tools_components_calendar_views_TimelineView","require_tools_components_calendar_views_AgendaView","require_tools_components_calendar_views_ResourceView","react_jsx_runtime","react","lucide_react","date_fns_locale","date_fns","ResourceCalendar","controlledView","currentDate","setCurrentDate","defaultDate","internalView","setView","defaultView","view","lastGridView","setLastGridView","timelineDuration","setTimelineDuration","selectedResourceId","setSelectedResourceId","selectedEvent","setSelectedEvent","language","range","rangeStart","rangeEnd","lastNotifiedRange","key","onRangeChange","options","components","businessHours","locale","filteredResources","resources","r","filteredEvents","events","handlePrevious","newDate","handleNext","handlePreviousLarge","handleNextLarge","handleViewChange","v","newView","onViewChange","toggleViewMode","next","mode","headerTitle","start","end","className","defaultBgColor","headerBgColor","showDoubleArrows","res","enabledViews","onEventClick","onDateSelect","resourceId","open"],"sources":["../../../../src/tools/components/calendar/ResourceCalendar.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as m from '../../paraglide/messages.js';\nimport { getLocale } from '../../paraglide/runtime.js';\nimport {\n format,\n addMonths,\n addWeeks,\n addDays,\n subMonths,\n subWeeks,\n subDays,\n startOfWeek,\n} from 'date-fns';\nimport { ja, enUS } from 'date-fns/locale';\nimport { ResourceCalendarProps, CalendarViewMode, CalendarEvent } from './types';\nimport { cn } from \"../../lib/utils\";\nimport { Button } from '../ui/button';\nimport {\n ChevronLeft,\n ChevronRight,\n ChevronsLeft,\n ChevronsRight,\n LayoutGrid,\n StretchHorizontal,\n Users,\n} from 'lucide-react';\nimport { Select, SelectContent, SelectItem, SelectTrigger } from '../ui/select';\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '../ui/dialog';\n\nimport { MonthView } from './views/MonthView';\nimport { TimeGridView } from './views/TimeGridView';\nimport { TimelineView } from './views/TimelineView';\nimport { AgendaView } from './views/AgendaView';\nimport { ResourceGridView } from './views/ResourceView';\nimport { CalendarOptionsContext } from './calendar-context';\nimport { calendarRange } from './calendar-layout';\n\n/**\n * リソースカレンダーコンポーネント\n *\n * 月・週・日・タイムライン・リソース表示に対応した多機能カレンダー。\n *\n * ## Features\n * - 6つのビューモード(month, week, day, timeline, resource, agenda)\n * - リソース別イベント表示\n * - 日付・時間枠の選択(クリック/キーボード)\n * - イベントクリック時の詳細表示\n * - 日本語/英語ローカライズ\n * - カスタムヘッダー/背景色\n *\n * ## AI/Automation Attributes\n * - `data-testid`: Container element\n * - `data-view`: Current view mode\n * - `data-event-count`: Number of events\n *\n * @example\n * ```tsx\n * import { ResourceCalendar } from '@alneas/appkit-react/tools/calendar';\n *\n * const events = [\n * {\n * id: '1',\n * title: '会議',\n * start: new Date('2024-01-15 10:00'),\n * end: new Date('2024-01-15 11:00'),\n * resourceId: 'room-a',\n * },\n * ];\n *\n * const resources = [\n * { id: 'room-a', title: '会議室A' },\n * { id: 'room-b', title: '会議室B' },\n * ];\n *\n * <ResourceCalendar\n * events={events}\n * resources={resources}\n * defaultView=\"week\"\n * onEventClick={(event) => console.log(event)}\n * />\n * ```\n *\n * @param props - {@link ResourceCalendarProps}\n * @returns リソースカレンダーコンポーネント\n */\nexport function ResourceCalendar({\n events,\n resources = [],\n defaultDate = new Date(),\n defaultView = 'week',\n view: controlledView,\n className,\n onEventClick,\n onDateSelect,\n onViewChange,\n onRangeChange,\n components,\n businessHours,\n enabledViews,\n showDoubleArrows,\n headerBgColor = 'color-mix(in srgb, hsl(var(--muted)) 50%, hsl(var(--background)))',\n headingBgColor = 'color-mix(in srgb, hsl(var(--muted)) 30%, hsl(var(--background)))',\n defaultBgColor = 'hsl(var(--background))',\n}: ResourceCalendarProps) {\n const [currentDate, setCurrentDate] = React.useState(defaultDate);\n const [internalView, setView] = React.useState<CalendarViewMode>(defaultView);\n const view = controlledView ?? internalView;\n\n const [lastGridView, setLastGridView] = React.useState<CalendarViewMode>('week');\n const [timelineDuration, setTimelineDuration] = React.useState<'day' | 'week' | 'month'>('week');\n const [selectedResourceId, setSelectedResourceId] = React.useState<string>('all');\n const [selectedEvent, setSelectedEvent] = React.useState<CalendarEvent | null>(null);\n const language = getLocale();\n const range = calendarRange(currentDate, view, timelineDuration);\n const rangeStart = +range.start;\n const rangeEnd = +range.end;\n const lastNotifiedRange = React.useRef('');\n React.useEffect(() => {\n const key = `${rangeStart}:${rangeEnd}`;\n if (onRangeChange && lastNotifiedRange.current !== key) {\n lastNotifiedRange.current = key;\n onRangeChange({ start: new Date(rangeStart), end: new Date(rangeEnd) });\n }\n }, [rangeStart, rangeEnd, onRangeChange]);\n const options = React.useMemo(() => ({ components, businessHours }), [components, businessHours]);\n\n const locale = React.useMemo(() => {\n return language === 'en' ? enUS : ja;\n }, [language]);\n\n const filteredResources = React.useMemo(() => {\n if (selectedResourceId === 'all') return resources;\n return resources.filter((r) => r.id === selectedResourceId);\n }, [resources, selectedResourceId]);\n\n const filteredEvents = React.useMemo(() => {\n if (selectedResourceId === 'all') return events;\n return events.filter((e) => e.resourceId === selectedResourceId);\n }, [events, selectedResourceId]);\n\n const handlePrevious = () => {\n let newDate: Date;\n switch (view) {\n case 'month':\n newDate = subMonths(currentDate, 1);\n break;\n case 'week':\n newDate = subWeeks(currentDate, 1);\n break;\n case 'day':\n newDate = subDays(currentDate, 1);\n break;\n case 'resource':\n newDate = subDays(currentDate, 1);\n break;\n case 'timeline':\n newDate =\n timelineDuration === 'day'\n ? subDays(currentDate, 1)\n : timelineDuration === 'month'\n ? subMonths(currentDate, 1)\n : subWeeks(currentDate, 1);\n break;\n default:\n newDate = subMonths(currentDate, 1);\n }\n setCurrentDate(newDate);\n };\n\n const handleNext = () => {\n let newDate: Date;\n switch (view) {\n case 'month':\n newDate = addMonths(currentDate, 1);\n break;\n case 'week':\n newDate = addWeeks(currentDate, 1);\n break;\n case 'day':\n newDate = addDays(currentDate, 1);\n break;\n case 'resource':\n newDate = addDays(currentDate, 1);\n break;\n case 'timeline':\n newDate =\n timelineDuration === 'day'\n ? addDays(currentDate, 1)\n : timelineDuration === 'month'\n ? addMonths(currentDate, 1)\n : addWeeks(currentDate, 1);\n break;\n default:\n newDate = addMonths(currentDate, 1);\n }\n setCurrentDate(newDate);\n };\n\n const handlePreviousLarge = () => {\n let newDate: Date;\n switch (view) {\n case 'month':\n newDate = subMonths(currentDate, 12);\n break;\n case 'week':\n newDate = subMonths(currentDate, 1);\n break;\n case 'day':\n newDate = subWeeks(currentDate, 1);\n break;\n case 'resource':\n newDate = subWeeks(currentDate, 1);\n break;\n case 'timeline':\n newDate = subMonths(currentDate, 1);\n break;\n default:\n newDate = subMonths(currentDate, 12);\n }\n setCurrentDate(newDate);\n };\n\n const handleNextLarge = () => {\n let newDate: Date;\n switch (view) {\n case 'month':\n newDate = addMonths(currentDate, 12);\n break;\n case 'week':\n newDate = addMonths(currentDate, 1);\n break;\n case 'day':\n newDate = addWeeks(currentDate, 1);\n break;\n case 'resource':\n newDate = addWeeks(currentDate, 1);\n break;\n case 'timeline':\n newDate = addMonths(currentDate, 1);\n break;\n default:\n newDate = addMonths(currentDate, 12);\n }\n setCurrentDate(newDate);\n };\n\n const handleViewChange = (v: string) => {\n if (view === 'timeline') {\n if (v === 'day' || v === 'week' || v === 'month') {\n setTimelineDuration(v as 'day' | 'week' | 'month');\n return;\n }\n }\n\n const newView = v as CalendarViewMode;\n setView(newView);\n onViewChange?.(newView);\n\n if (newView !== 'timeline' && newView !== 'agenda' && newView !== 'resource') {\n setLastGridView(newView);\n }\n };\n\n const toggleViewMode = (mode: 'grid' | 'timeline' | 'resource') => {\n const next = mode === 'grid' ? lastGridView : mode;\n setView(next);\n onViewChange?.(next);\n };\n\n const headerTitle = React.useMemo(() => {\n if (\n view === 'day' ||\n view === 'resource' ||\n (view === 'timeline' && timelineDuration === 'day')\n ) {\n return format(currentDate, language === 'en' ? 'MMMM d, yyyy' : 'yyyy年 M月 d日', { locale });\n }\n if (view === 'week' || (view === 'timeline' && timelineDuration === 'week')) {\n const start = startOfWeek(currentDate, { weekStartsOn: 0 }); // Assuming Sunday start\n // To match \"21日-27日\" style roughly\n // If same month: 10月 21日 - 27日\n // If different month: 9月 28日 - 10月 4日\n const end = addDays(start, 6);\n\n if (language === 'ja') {\n if (start.getMonth() === end.getMonth()) {\n return `${format(start, 'yyyy年 M月d日', { locale })} - ${format(end, 'd日', { locale })}`;\n }\n return `${format(start, 'yyyy年 M月d日', { locale })} - ${format(end, 'M月d日', { locale })}`;\n } else {\n if (start.getMonth() === end.getMonth()) {\n return `${format(start, 'MMM d')} - ${format(end, 'd, yyyy')}`;\n }\n return `${format(start, 'MMM d')} - ${format(end, 'MMM d, yyyy')}`;\n }\n }\n return format(currentDate, language === 'en' ? 'MMMM yyyy' : 'yyyy年 MMMM', { locale });\n }, [currentDate, locale, language, view, timelineDuration]);\n\n return (\n <CalendarOptionsContext.Provider value={options}>\n <div\n className={cn(\n 'flex flex-col h-full border overflow-hidden [border-radius:var(--radius-lg)]',\n className,\n )}\n style={{ backgroundColor: defaultBgColor }}\n >\n {/* Toolbar */}\n {components?.toolbar ? (\n components.toolbar({\n date: currentDate,\n view,\n title: headerTitle,\n range,\n timelineDuration,\n onPrevious: handlePrevious,\n onNext: handleNext,\n onToday: () => setCurrentDate(new Date()),\n onViewChange: handleViewChange,\n })\n ) : (\n <div\n className='flex items-center justify-between border-b px-4 py-2 overflow-x-auto min-h-[52px]'\n style={{ backgroundColor: headerBgColor }}\n >\n <div className='flex items-center gap-2 flex-none'>\n {showDoubleArrows && (\n <Button\n variant='outline'\n size='icon'\n onClick={handlePreviousLarge}\n aria-label={language === 'ja' ? '大きく前へ' : 'Previous large interval'}\n className='h-8 w-8'\n >\n <ChevronsLeft className='h-4 w-4' />\n </Button>\n )}\n <Button\n variant='outline'\n size='icon'\n onClick={handlePrevious}\n aria-label={language === 'ja' ? '前の期間' : 'Previous interval'}\n className='h-8 w-8'\n >\n <ChevronLeft className='h-4 w-4' />\n </Button>\n <Button variant='outline' size='sm' onClick={() => setCurrentDate(new Date())}>\n {m.calendar_today()}\n </Button>\n <Button\n variant='outline'\n size='icon'\n onClick={handleNext}\n aria-label={language === 'ja' ? '次の期間' : 'Next interval'}\n className='h-8 w-8'\n >\n <ChevronRight className='h-4 w-4' />\n </Button>\n {showDoubleArrows && (\n <Button\n variant='outline'\n size='icon'\n onClick={handleNextLarge}\n aria-label={language === 'ja' ? '大きく次へ' : 'Next large interval'}\n className='h-8 w-8'\n >\n <ChevronsRight className='h-4 w-4' />\n </Button>\n )}\n <span className='ml-2 text-lg font-semibold whitespace-nowrap'>{headerTitle}</span>\n </div>\n\n <div className='flex items-center gap-2 flex-none ml-4'>\n {resources.length > 0 && (\n <Select\n value={selectedResourceId}\n onValueChange={(v) => v && setSelectedResourceId(v)}\n >\n <SelectTrigger aria-label={language === 'ja' ? 'リソース' : 'Resource'} className='bg-background w-[200px] h-9'>\n <span>\n {selectedResourceId === 'all'\n ? language === 'ja'\n ? 'すべてのリソース'\n : 'All Resources'\n : resources.find((r) => r.id === selectedResourceId)?.title ||\n selectedResourceId}\n </span>\n </SelectTrigger>\n <SelectContent className='bg-popover'>\n <SelectItem value='all'>\n {language === 'ja' ? 'すべてのリソース' : 'All Resources'}\n </SelectItem>\n {resources.map((res) => (\n <SelectItem key={res.id} value={res.id}>\n {res.title}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n\n {/* View Type Switcher (Icon Group) */}\n <div className='flex items-center border overflow-hidden bg-background rounded-md flex-none'>\n {(!enabledViews ||\n enabledViews.includes('week') ||\n enabledViews.includes('day') ||\n enabledViews.includes('month')) && (\n <Button\n variant='ghost'\n size='icon'\n onClick={() => toggleViewMode('grid')}\n className={cn(\n 'rounded-none h-9 w-9',\n view !== 'timeline' &&\n view !== 'resource' &&\n 'bg-muted text-accent-foreground',\n )}\n title={m.calendar_view_grid({ defaultValue: 'Grid' })}\n >\n <LayoutGrid className='h-4 w-4' />\n </Button>\n )}\n {(!enabledViews || enabledViews.includes('timeline')) && (\n <>\n <div className='bg-border w-[1px] h-4' />\n <Button\n variant='ghost'\n size='icon'\n onClick={() => toggleViewMode('timeline')}\n className={cn(\n 'rounded-none h-9 w-9',\n view === 'timeline' && 'bg-muted text-accent-foreground',\n )}\n title={m.calendar_view_timeline({ defaultValue: 'Timeline' })}\n >\n <StretchHorizontal className='h-4 w-4' />\n </Button>\n </>\n )}\n {(!enabledViews || enabledViews.includes('resource')) && (\n <>\n <div className='bg-border w-[1px] h-4' />\n <Button\n variant='ghost'\n size='icon'\n onClick={() => toggleViewMode('resource')}\n className={cn(\n 'rounded-none h-9 w-9',\n view === 'resource' && 'bg-muted text-accent-foreground',\n )}\n title={m.calendar_view_resource({ defaultValue: 'Resource' })}\n >\n <Users className='h-4 w-4' />\n </Button>\n </>\n )}\n </div>\n\n {/* Time Scope Switcher (Text Group) */}\n {view !== 'resource' && (\n <div className='flex items-center border overflow-hidden bg-background rounded-md flex-none'>\n {(!enabledViews || enabledViews.includes('day')) && (\n <Button\n variant='ghost'\n size='sm'\n onClick={() => handleViewChange('day')}\n className={cn(\n 'rounded-none px-3 h-9',\n (view === 'day' || (view === 'timeline' && timelineDuration === 'day')) &&\n 'bg-muted font-medium text-accent-foreground',\n )}\n >\n {m.calendar_view_day()}\n </Button>\n )}\n {(!enabledViews || enabledViews.includes('week')) && (\n <>\n <div className='bg-border w-[1px] h-4' />\n <Button\n variant='ghost'\n size='sm'\n onClick={() => handleViewChange('week')}\n className={cn(\n 'rounded-none px-3 h-9',\n (view === 'week' ||\n (view === 'timeline' && timelineDuration === 'week')) &&\n 'bg-muted font-medium text-accent-foreground',\n )}\n >\n {m.calendar_view_week()}\n </Button>\n </>\n )}\n {(!enabledViews || enabledViews.includes('month')) && (\n <>\n <div className='bg-border w-[1px] h-4' />\n <Button\n variant='ghost'\n size='sm'\n onClick={() => handleViewChange('month')}\n className={cn(\n 'rounded-none px-3 h-9',\n (view === 'month' ||\n (view === 'timeline' && timelineDuration === 'month')) &&\n 'bg-muted font-medium text-accent-foreground',\n )}\n >\n {m.calendar_view_month()}\n </Button>\n </>\n )}\n {view !== 'timeline' && (!enabledViews || enabledViews.includes('agenda')) && (\n <>\n <div className='bg-border w-[1px] h-4' />\n <Button\n variant='ghost'\n size='sm'\n onClick={() => handleViewChange('agenda')}\n className={cn(\n 'rounded-none px-3 h-9',\n view === 'agenda' && 'bg-muted font-medium text-accent-foreground',\n )}\n >\n {m.calendar_view_agenda({ defaultValue: 'List' })}\n </Button>\n </>\n )}\n </div>\n )}\n </div>\n </div>\n )}\n {/* View Content */}\n <div className='flex-1 overflow-hidden relative min-h-0'>\n {view === 'month' && (\n <MonthView\n currentDate={currentDate}\n events={filteredEvents}\n onEventClick={(e) => {\n setSelectedEvent(e);\n onEventClick?.(e);\n }}\n onDateSelect={onDateSelect}\n locale={locale}\n headingBgColor={headingBgColor}\n defaultBgColor={defaultBgColor}\n />\n )}\n {(view === 'week' || view === 'day') && (\n <TimeGridView\n view={view}\n currentDate={currentDate}\n events={filteredEvents}\n resources={filteredResources}\n onDateSelect={onDateSelect}\n locale={locale}\n onEventClick={(e) => {\n setSelectedEvent(e);\n onEventClick?.(e);\n }}\n headingBgColor={headingBgColor}\n defaultBgColor={defaultBgColor}\n />\n )}\n {view === 'timeline' && (\n <TimelineView\n currentDate={currentDate}\n events={filteredEvents}\n resources={filteredResources}\n locale={locale}\n duration={timelineDuration}\n onEventClick={(e) => {\n setSelectedEvent(e);\n onEventClick?.(e);\n }}\n headingBgColor={headingBgColor}\n defaultBgColor={defaultBgColor}\n />\n )}\n {view === 'agenda' && (\n <AgendaView\n currentDate={currentDate}\n events={filteredEvents}\n locale={locale}\n onEventClick={(e) => {\n setSelectedEvent(e);\n onEventClick?.(e);\n }}\n headingBgColor={headingBgColor}\n defaultBgColor={defaultBgColor}\n />\n )}\n {view === 'resource' && (\n <ResourceGridView\n date={currentDate}\n events={filteredEvents}\n resources={filteredResources}\n onEmptySlotClick={\n onDateSelect\n ? (resourceId, start) =>\n onDateSelect(start, new Date(+start + 30 * 60_000), resourceId)\n : undefined\n }\n onEventClick={(e) => {\n setSelectedEvent(e);\n onEventClick?.(e);\n }}\n />\n )}\n </div>\n\n {/* Event Detail Dialog */}\n <Dialog open={!!selectedEvent} onOpenChange={(open) => !open && setSelectedEvent(null)}>\n <DialogContent className='bg-popover'>\n <DialogHeader>\n <DialogTitle className='text-xl font-bold'>{selectedEvent?.title}</DialogTitle>\n <DialogDescription className='text-sm text-muted-foreground'>\n {selectedEvent &&\n format(new Date(selectedEvent.start), 'yyyy/MM/dd HH:mm', { locale })}\n {' - '}\n {selectedEvent && format(new Date(selectedEvent.end), 'HH:mm', { locale })}\n </DialogDescription>\n </DialogHeader>\n {selectedEvent?.description && (\n <div className='py-4 text-sm whitespace-pre-wrap text-foreground'>\n {selectedEvent.description as string}\n </div>\n )}\n {selectedEvent?.resourceId && (\n <div className='mt-2 text-xs font-semibold text-muted-foreground uppercase border-t pt-2'>\n Resource: {resources.find((r) => r.id === selectedEvent.resourceId)?.title}\n </div>\n )}\n </DialogContent>\n </Dialog>\n </div>\n </CalendarOptionsContext.Provider>\n );\n}\n"],"mappings":"A,6wCAqFA,SAAgBgE,EAAiB,CAC/B,SACA,YAAY,CAAC,EACb,eAAc,IAAI,KAClB,cAAc,OACd,KAAMC,EACN,aACA,eACA,eACA,eACA,gBACA,aACA,gBACA,eACA,mBACA,iBAAgB,oEAChB,iBAAiB,oEACjB,iBAAiB,0BACO,CACxB,GAAM,CAACC,EAAaC,GAAkBnE,EAAM,SAASoE,EAAW,EAC1D,CAACC,EAAcC,GAAWtE,EAAM,SAA2BuE,CAAW,EACtEC,EAAOP,GAAkBI,EAEzB,CAACI,EAAcC,GAAmB1E,EAAM,SAA2B,MAAM,EACzE,CAAC2E,EAAkBC,GAAuB5E,EAAM,SAAmC,MAAM,EACzF,CAAC6E,EAAoBC,GAAyB9E,EAAM,SAAiB,KAAK,EAC1E,CAAC+E,EAAeC,GAAoBhF,EAAM,SAA+B,IAAI,EAC7EiF,EAAWhF,EAAAA,UAAU,EACrBiF,EAAQhF,GAAAA,cAAcgE,EAAaM,EAAMG,CAAgB,EACzDQ,EAAa,CAACD,EAAM,MACpBE,EAAW,CAACF,EAAM,IAClBG,EAAoBrF,EAAM,OAAO,EAAE,EACzC4D,EAAM,cAAgB,CACpB,IAAM0B,EAAM,GAAGH,EAAW,GA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B,EAAA,KAAA,CAACzB,EAAAA,cAAD,CAAe,UAAU,aAAzB,SAAA,EACE,EAAAyB,EAAA,KAAA,CAACxB,EAAAA,aAAD,CAAA,SAAA,EACE,EAAAwB,EAAA,IAAA,CAACvB,EAAAA,YAAD,CAAa,UAAU,oBAAqB,SAAA2C,GAAe,KAAmB,CAAA,GAC9E,EAAApB,EAAA,KAAA,CAACtB,EAAAA,kBAAD,CAAmB,UAAU,gCAA7B,SAAA,CACG0C,IAAA,EACCpE,EAAAA,OAAAA,CAAO,IAAI,KAAKoE,EAAc,KAAK,EAAG,mBAAoB,CAAE,QAAO,CAAC,EACrE,MACAA,IAAA,EAAiBpE,EAAAA,OAAAA,CAAO,IAAI,KAAKoE,EAAc,GAAG,EAAG,QAAS,CAAE,QAAO,CAAC,CACxD,CACP,CAAA,CAAA,CAAA,CAAA,EACbA,GAAe,cACd,EAAApB,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,mDACZ,SAAAoB,EAAc,WACZ,CAAA,EAENA,GAAe,aACd,EAAApB,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,2EAAf,SAAA,CAA0F,aAC7EkC,EAAU,KAAM,GAAMC,EAAE,KAAOf,EAAc,UAAU,CAAC,EAAE,KAClE,C,EAEM,C,EACT,CAAA,CACL,C,EAC0B,CAAA,CAErC,C"}
|
|
1
|
+
{"version":3,"file":"ResourceCalendar.cjs","names":["React","getLocale","calendarRange","enUS","ja","subMonths","subWeeks","subDays","addMonths","addWeeks","addDays","format","startOfWeek","CalendarOptionsContext","cn","Button","ChevronsLeft","ChevronLeft","ChevronRight","ChevronsRight","Select","SelectTrigger","SelectContent","SelectItem","LayoutGrid","_Fragment","StretchHorizontal","Users","MonthView","TimeGridView","TimelineView","AgendaView","ResourceGridView","Dialog","DialogContent","DialogHeader","DialogTitle","DialogDescription","require_runtime","require_ui_lib_utils","require_ui_components_ui_button_components","require_ui_components_ui_dialog","require_ui_components_ui_select","require_runtime$1","require_calendar_today","require_calendar_view_agenda","require_calendar_view_day","require_calendar_view_grid","require_calendar_view_month","require_calendar_view_resource","require_calendar_view_timeline","require_calendar_view_week","require_tools_components_calendar_calendar_layout","require_tools_components_calendar_calendar_context","require_tools_components_calendar_views_MonthView","require_tools_components_calendar_views_TimeGridView","require_tools_components_calendar_views_TimelineView","require_tools_components_calendar_views_AgendaView","require_tools_components_calendar_views_ResourceView","react_jsx_runtime","react","lucide_react","date_fns_locale","date_fns","ResourceCalendar","controlledView","currentDate","setCurrentDate","defaultDate","internalView","setView","defaultView","view","lastGridView","setLastGridView","timelineDuration","setTimelineDuration","selectedResourceId","setSelectedResourceId","selectedEvent","setSelectedEvent","language","range","rangeStart","rangeEnd","lastNotifiedRange","key","onRangeChange","options","components","businessHours","locale","filteredResources","resources","r","filteredEvents","events","handlePrevious","newDate","handleNext","handlePreviousLarge","handleNextLarge","handleViewChange","v","newView","onViewChange","toggleViewMode","next","mode","headerTitle","start","end","className","defaultBgColor","headerBgColor","showDoubleArrows","res","enabledViews","onEventClick","onDateSelect","resourceId","open"],"sources":["../../../../src/tools/components/calendar/ResourceCalendar.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as m from '../../paraglide/messages.js';\nimport { getLocale } from '../../paraglide/runtime.js';\nimport {\n format,\n addMonths,\n addWeeks,\n addDays,\n subMonths,\n subWeeks,\n subDays,\n startOfWeek,\n} from 'date-fns';\nimport { ja, enUS } from 'date-fns/locale';\nimport { ResourceCalendarProps, CalendarViewMode, CalendarEvent } from './types';\nimport { cn } from \"../../lib/utils\";\nimport { Button } from '../ui/button';\nimport {\n ChevronLeft,\n ChevronRight,\n ChevronsLeft,\n ChevronsRight,\n LayoutGrid,\n StretchHorizontal,\n Users,\n} from 'lucide-react';\nimport { Select, SelectContent, SelectItem, SelectTrigger } from '../ui/select';\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '../ui/dialog';\n\nimport { MonthView } from './views/MonthView';\nimport { TimeGridView } from './views/TimeGridView';\nimport { TimelineView } from './views/TimelineView';\nimport { AgendaView } from './views/AgendaView';\nimport { ResourceGridView } from './views/ResourceView';\nimport { CalendarOptionsContext } from './calendar-context';\nimport { calendarRange } from './calendar-layout';\n\n/**\n * Renders resource events in month, week, day, timeline, resource or agenda views.\n * @param props - Event/resource arrays, view settings and interaction callbacks; see {@link ResourceCalendarProps}.\n * @returns The calendar, navigation controls and optional selected-event dialog.\n * @remarks Import Appkit CSS. Event data is supplied by the host; callbacks do not persist changes.\n * resources defaults to an empty array, defaultDate to the mount-time current date and defaultView\n * to week. view controls the displayed mode when supplied; date navigation remains local state.\n * onRangeChange reports the visible date range after rendering. Locale comes from Appkit's\n * Paraglide runtime (Japanese or English); Date values use the runtime's date/time conventions.\n * The root does not expose data-testid, data-view or data-event-count and does not spread arbitrary attributes.\n * @example\n * ```tsx\n * import { ResourceCalendar } from '@alneas/appkit-react/tools/calendar';\n * import '@alneas/appkit-react/styles';\n *\n * export function RoomCalendar() {\n * return <ResourceCalendar defaultDate={new Date(2026, 0, 15)} defaultView=\"week\"\n * resources={[{ id: 'room-a', title: 'Room A' }]}\n * events={[{ id: 'meeting', title: 'Planning', resourceId: 'room-a',\n * start: new Date(2026, 0, 15, 10), end: new Date(2026, 0, 15, 11) }]} />;\n * }\n * ```\n */\nexport function ResourceCalendar({\n events,\n resources = [],\n defaultDate = new Date(),\n defaultView = 'week',\n view: controlledView,\n className,\n onEventClick,\n onDateSelect,\n onViewChange,\n onRangeChange,\n components,\n businessHours,\n enabledViews,\n showDoubleArrows,\n headerBgColor = 'color-mix(in srgb, hsl(var(--muted)) 50%, hsl(var(--background)))',\n headingBgColor = 'color-mix(in srgb, hsl(var(--muted)) 30%, hsl(var(--background)))',\n defaultBgColor = 'hsl(var(--background))',\n}: ResourceCalendarProps) {\n const [currentDate, setCurrentDate] = React.useState(defaultDate);\n const [internalView, setView] = React.useState<CalendarViewMode>(defaultView);\n const view = controlledView ?? internalView;\n\n const [lastGridView, setLastGridView] = React.useState<CalendarViewMode>('week');\n const [timelineDuration, setTimelineDuration] = React.useState<'day' | 'week' | 'month'>('week');\n const [selectedResourceId, setSelectedResourceId] = React.useState<string>('all');\n const [selectedEvent, setSelectedEvent] = React.useState<CalendarEvent | null>(null);\n const language = getLocale();\n const range = calendarRange(currentDate, view, timelineDuration);\n const rangeStart = +range.start;\n const rangeEnd = +range.end;\n const lastNotifiedRange = React.useRef('');\n React.useEffect(() => {\n const key = `${rangeStart}:${rangeEnd}`;\n if (onRangeChange && lastNotifiedRange.current !== key) {\n lastNotifiedRange.current = key;\n onRangeChange({ start: new Date(rangeStart), end: new Date(rangeEnd) });\n }\n }, [rangeStart, rangeEnd, onRangeChange]);\n const options = React.useMemo(() => ({ components, businessHours }), [components, businessHours]);\n\n const locale = React.useMemo(() => {\n return language === 'en' ? enUS : ja;\n }, [language]);\n\n const filteredResources = React.useMemo(() => {\n if (selectedResourceId === 'all') return resources;\n return resources.filter((r) => r.id === selectedResourceId);\n }, [resources, selectedResourceId]);\n\n const filteredEvents = React.useMemo(() => {\n if (selectedResourceId === 'all') return events;\n return events.filter((e) => e.resourceId === selectedResourceId);\n }, [events, selectedResourceId]);\n\n const handlePrevious = () => {\n let newDate: Date;\n switch (view) {\n case 'month':\n newDate = subMonths(currentDate, 1);\n break;\n case 'week':\n newDate = subWeeks(currentDate, 1);\n break;\n case 'day':\n newDate = subDays(currentDate, 1);\n break;\n case 'resource':\n newDate = subDays(currentDate, 1);\n break;\n case 'timeline':\n newDate =\n timelineDuration === 'day'\n ? subDays(currentDate, 1)\n : timelineDuration === 'month'\n ? subMonths(currentDate, 1)\n : subWeeks(currentDate, 1);\n break;\n default:\n newDate = subMonths(currentDate, 1);\n }\n setCurrentDate(newDate);\n };\n\n const handleNext = () => {\n let newDate: Date;\n switch (view) {\n case 'month':\n newDate = addMonths(currentDate, 1);\n break;\n case 'week':\n newDate = addWeeks(currentDate, 1);\n break;\n case 'day':\n newDate = addDays(currentDate, 1);\n break;\n case 'resource':\n newDate = addDays(currentDate, 1);\n break;\n case 'timeline':\n newDate =\n timelineDuration === 'day'\n ? addDays(currentDate, 1)\n : timelineDuration === 'month'\n ? addMonths(currentDate, 1)\n : addWeeks(currentDate, 1);\n break;\n default:\n newDate = addMonths(currentDate, 1);\n }\n setCurrentDate(newDate);\n };\n\n const handlePreviousLarge = () => {\n let newDate: Date;\n switch (view) {\n case 'month':\n newDate = subMonths(currentDate, 12);\n break;\n case 'week':\n newDate = subMonths(currentDate, 1);\n break;\n case 'day':\n newDate = subWeeks(currentDate, 1);\n break;\n case 'resource':\n newDate = subWeeks(currentDate, 1);\n break;\n case 'timeline':\n newDate = subMonths(currentDate, 1);\n break;\n default:\n newDate = subMonths(currentDate, 12);\n }\n setCurrentDate(newDate);\n };\n\n const handleNextLarge = () => {\n let newDate: Date;\n switch (view) {\n case 'month':\n newDate = addMonths(currentDate, 12);\n break;\n case 'week':\n newDate = addMonths(currentDate, 1);\n break;\n case 'day':\n newDate = addWeeks(currentDate, 1);\n break;\n case 'resource':\n newDate = addWeeks(currentDate, 1);\n break;\n case 'timeline':\n newDate = addMonths(currentDate, 1);\n break;\n default:\n newDate = addMonths(currentDate, 12);\n }\n setCurrentDate(newDate);\n };\n\n const handleViewChange = (v: string) => {\n if (view === 'timeline') {\n if (v === 'day' || v === 'week' || v === 'month') {\n setTimelineDuration(v as 'day' | 'week' | 'month');\n return;\n }\n }\n\n const newView = v as CalendarViewMode;\n setView(newView);\n onViewChange?.(newView);\n\n if (newView !== 'timeline' && newView !== 'agenda' && newView !== 'resource') {\n setLastGridView(newView);\n }\n };\n\n const toggleViewMode = (mode: 'grid' | 'timeline' | 'resource') => {\n const next = mode === 'grid' ? lastGridView : mode;\n setView(next);\n onViewChange?.(next);\n };\n\n const headerTitle = React.useMemo(() => {\n if (\n view === 'day' ||\n view === 'resource' ||\n (view === 'timeline' && timelineDuration === 'day')\n ) {\n return format(currentDate, language === 'en' ? 'MMMM d, yyyy' : 'yyyy年 M月 d日', { locale });\n }\n if (view === 'week' || (view === 'timeline' && timelineDuration === 'week')) {\n const start = startOfWeek(currentDate, { weekStartsOn: 0 }); // Assuming Sunday start\n // To match \"21日-27日\" style roughly\n // If same month: 10月 21日 - 27日\n // If different month: 9月 28日 - 10月 4日\n const end = addDays(start, 6);\n\n if (language === 'ja') {\n if (start.getMonth() === end.getMonth()) {\n return `${format(start, 'yyyy年 M月d日', { locale })} - ${format(end, 'd日', { locale })}`;\n }\n return `${format(start, 'yyyy年 M月d日', { locale })} - ${format(end, 'M月d日', { locale })}`;\n } else {\n if (start.getMonth() === end.getMonth()) {\n return `${format(start, 'MMM d')} - ${format(end, 'd, yyyy')}`;\n }\n return `${format(start, 'MMM d')} - ${format(end, 'MMM d, yyyy')}`;\n }\n }\n return format(currentDate, language === 'en' ? 'MMMM yyyy' : 'yyyy年 MMMM', { locale });\n }, [currentDate, locale, language, view, timelineDuration]);\n\n return (\n <CalendarOptionsContext.Provider value={options}>\n <div\n className={cn(\n 'flex flex-col h-full border overflow-hidden [border-radius:var(--radius-lg)]',\n className,\n )}\n style={{ backgroundColor: defaultBgColor }}\n >\n {/* Toolbar */}\n {components?.toolbar ? (\n components.toolbar({\n date: currentDate,\n view,\n title: headerTitle,\n range,\n timelineDuration,\n onPrevious: handlePrevious,\n onNext: handleNext,\n onToday: () => setCurrentDate(new Date()),\n onViewChange: handleViewChange,\n })\n ) : (\n <div\n className='flex items-center justify-between border-b px-4 py-2 overflow-x-auto min-h-[52px]'\n style={{ backgroundColor: headerBgColor }}\n >\n <div className='flex items-center gap-2 flex-none'>\n {showDoubleArrows && (\n <Button\n variant='outline'\n size='icon'\n onClick={handlePreviousLarge}\n aria-label={language === 'ja' ? '大きく前へ' : 'Previous large interval'}\n className='h-8 w-8'\n >\n <ChevronsLeft className='h-4 w-4' />\n </Button>\n )}\n <Button\n variant='outline'\n size='icon'\n onClick={handlePrevious}\n aria-label={language === 'ja' ? '前の期間' : 'Previous interval'}\n className='h-8 w-8'\n >\n <ChevronLeft className='h-4 w-4' />\n </Button>\n <Button variant='outline' size='sm' onClick={() => setCurrentDate(new Date())}>\n {m.calendar_today()}\n </Button>\n <Button\n variant='outline'\n size='icon'\n onClick={handleNext}\n aria-label={language === 'ja' ? '次の期間' : 'Next interval'}\n className='h-8 w-8'\n >\n <ChevronRight className='h-4 w-4' />\n </Button>\n {showDoubleArrows && (\n <Button\n variant='outline'\n size='icon'\n onClick={handleNextLarge}\n aria-label={language === 'ja' ? '大きく次へ' : 'Next large interval'}\n className='h-8 w-8'\n >\n <ChevronsRight className='h-4 w-4' />\n </Button>\n )}\n <span className='ml-2 text-lg font-semibold whitespace-nowrap'>{headerTitle}</span>\n </div>\n\n <div className='flex items-center gap-2 flex-none ml-4'>\n {resources.length > 0 && (\n <Select\n value={selectedResourceId}\n onValueChange={(v) => v && setSelectedResourceId(v)}\n >\n <SelectTrigger aria-label={language === 'ja' ? 'リソース' : 'Resource'} className='bg-background w-[200px] h-9'>\n <span>\n {selectedResourceId === 'all'\n ? language === 'ja'\n ? 'すべてのリソース'\n : 'All Resources'\n : resources.find((r) => r.id === selectedResourceId)?.title ||\n selectedResourceId}\n </span>\n </SelectTrigger>\n <SelectContent className='bg-popover'>\n <SelectItem value='all'>\n {language === 'ja' ? 'すべてのリソース' : 'All Resources'}\n </SelectItem>\n {resources.map((res) => (\n <SelectItem key={res.id} value={res.id}>\n {res.title}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n\n {/* View Type Switcher (Icon Group) */}\n <div className='flex items-center border overflow-hidden bg-background rounded-md flex-none'>\n {(!enabledViews ||\n enabledViews.includes('week') ||\n enabledViews.includes('day') ||\n enabledViews.includes('month')) && (\n <Button\n variant='ghost'\n size='icon'\n onClick={() => toggleViewMode('grid')}\n className={cn(\n 'rounded-none h-9 w-9',\n view !== 'timeline' &&\n view !== 'resource' &&\n 'bg-muted text-accent-foreground',\n )}\n title={m.calendar_view_grid({ defaultValue: 'Grid' })}\n >\n <LayoutGrid className='h-4 w-4' />\n </Button>\n )}\n {(!enabledViews || enabledViews.includes('timeline')) && (\n <>\n <div className='bg-border w-[1px] h-4' />\n <Button\n variant='ghost'\n size='icon'\n onClick={() => toggleViewMode('timeline')}\n className={cn(\n 'rounded-none h-9 w-9',\n view === 'timeline' && 'bg-muted text-accent-foreground',\n )}\n title={m.calendar_view_timeline({ defaultValue: 'Timeline' })}\n >\n <StretchHorizontal className='h-4 w-4' />\n </Button>\n </>\n )}\n {(!enabledViews || enabledViews.includes('resource')) && (\n <>\n <div className='bg-border w-[1px] h-4' />\n <Button\n variant='ghost'\n size='icon'\n onClick={() => toggleViewMode('resource')}\n className={cn(\n 'rounded-none h-9 w-9',\n view === 'resource' && 'bg-muted text-accent-foreground',\n )}\n title={m.calendar_view_resource({ defaultValue: 'Resource' })}\n >\n <Users className='h-4 w-4' />\n </Button>\n </>\n )}\n </div>\n\n {/* Time Scope Switcher (Text Group) */}\n {view !== 'resource' && (\n <div className='flex items-center border overflow-hidden bg-background rounded-md flex-none'>\n {(!enabledViews || enabledViews.includes('day')) && (\n <Button\n variant='ghost'\n size='sm'\n onClick={() => handleViewChange('day')}\n className={cn(\n 'rounded-none px-3 h-9',\n (view === 'day' || (view === 'timeline' && timelineDuration === 'day')) &&\n 'bg-muted font-medium text-accent-foreground',\n )}\n >\n {m.calendar_view_day()}\n </Button>\n )}\n {(!enabledViews || enabledViews.includes('week')) && (\n <>\n <div className='bg-border w-[1px] h-4' />\n <Button\n variant='ghost'\n size='sm'\n onClick={() => handleViewChange('week')}\n className={cn(\n 'rounded-none px-3 h-9',\n (view === 'week' ||\n (view === 'timeline' && timelineDuration === 'week')) &&\n 'bg-muted font-medium text-accent-foreground',\n )}\n >\n {m.calendar_view_week()}\n </Button>\n </>\n )}\n {(!enabledViews || enabledViews.includes('month')) && (\n <>\n <div className='bg-border w-[1px] h-4' />\n <Button\n variant='ghost'\n size='sm'\n onClick={() => handleViewChange('month')}\n className={cn(\n 'rounded-none px-3 h-9',\n (view === 'month' ||\n (view === 'timeline' && timelineDuration === 'month')) &&\n 'bg-muted font-medium text-accent-foreground',\n )}\n >\n {m.calendar_view_month()}\n </Button>\n </>\n )}\n {view !== 'timeline' && (!enabledViews || enabledViews.includes('agenda')) && (\n <>\n <div className='bg-border w-[1px] h-4' />\n <Button\n variant='ghost'\n size='sm'\n onClick={() => handleViewChange('agenda')}\n className={cn(\n 'rounded-none px-3 h-9',\n view === 'agenda' && 'bg-muted font-medium text-accent-foreground',\n )}\n >\n {m.calendar_view_agenda({ defaultValue: 'List' })}\n </Button>\n </>\n )}\n </div>\n )}\n </div>\n </div>\n )}\n {/* View Content */}\n <div className='flex-1 overflow-hidden relative min-h-0'>\n {view === 'month' && (\n <MonthView\n currentDate={currentDate}\n events={filteredEvents}\n onEventClick={(e) => {\n setSelectedEvent(e);\n onEventClick?.(e);\n }}\n onDateSelect={onDateSelect}\n locale={locale}\n headingBgColor={headingBgColor}\n defaultBgColor={defaultBgColor}\n />\n )}\n {(view === 'week' || view === 'day') && (\n <TimeGridView\n view={view}\n currentDate={currentDate}\n events={filteredEvents}\n resources={filteredResources}\n onDateSelect={onDateSelect}\n locale={locale}\n onEventClick={(e) => {\n setSelectedEvent(e);\n onEventClick?.(e);\n }}\n headingBgColor={headingBgColor}\n defaultBgColor={defaultBgColor}\n />\n )}\n {view === 'timeline' && (\n <TimelineView\n currentDate={currentDate}\n events={filteredEvents}\n resources={filteredResources}\n locale={locale}\n duration={timelineDuration}\n onEventClick={(e) => {\n setSelectedEvent(e);\n onEventClick?.(e);\n }}\n headingBgColor={headingBgColor}\n defaultBgColor={defaultBgColor}\n />\n )}\n {view === 'agenda' && (\n <AgendaView\n currentDate={currentDate}\n events={filteredEvents}\n locale={locale}\n onEventClick={(e) => {\n setSelectedEvent(e);\n onEventClick?.(e);\n }}\n headingBgColor={headingBgColor}\n defaultBgColor={defaultBgColor}\n />\n )}\n {view === 'resource' && (\n <ResourceGridView\n date={currentDate}\n events={filteredEvents}\n resources={filteredResources}\n onEmptySlotClick={\n onDateSelect\n ? (resourceId, start) =>\n onDateSelect(start, new Date(+start + 30 * 60_000), resourceId)\n : undefined\n }\n onEventClick={(e) => {\n setSelectedEvent(e);\n onEventClick?.(e);\n }}\n />\n )}\n </div>\n\n {/* Event Detail Dialog */}\n <Dialog open={!!selectedEvent} onOpenChange={(open) => !open && setSelectedEvent(null)}>\n <DialogContent className='bg-popover'>\n <DialogHeader>\n <DialogTitle className='text-xl font-bold'>{selectedEvent?.title}</DialogTitle>\n <DialogDescription className='text-sm text-muted-foreground'>\n {selectedEvent &&\n format(new Date(selectedEvent.start), 'yyyy/MM/dd HH:mm', { locale })}\n {' - '}\n {selectedEvent && format(new Date(selectedEvent.end), 'HH:mm', { locale })}\n </DialogDescription>\n </DialogHeader>\n {selectedEvent?.description && (\n <div className='py-4 text-sm whitespace-pre-wrap text-foreground'>\n {selectedEvent.description as string}\n </div>\n )}\n {selectedEvent?.resourceId && (\n <div className='mt-2 text-xs font-semibold text-muted-foreground uppercase border-t pt-2'>\n Resource: {resources.find((r) => r.id === selectedEvent.resourceId)?.title}\n </div>\n )}\n </DialogContent>\n </Dialog>\n </div>\n </CalendarOptionsContext.Provider>\n );\n}\n"],"mappings":"A,6wCA4DA,SAAgBgE,EAAiB,CAC/B,SACA,YAAY,CAAC,EACb,eAAc,IAAI,KAClB,cAAc,OACd,KAAMC,EACN,aACA,eACA,eACA,eACA,gBACA,aACA,gBACA,eACA,mBACA,iBAAgB,oEAChB,iBAAiB,oEACjB,iBAAiB,0BACO,CACxB,GAAM,CAACC,EAAaC,GAAkBnE,EAAM,SAASoE,EAAW,EAC1D,CAACC,EAAcC,GAAWtE,EAAM,SAA2BuE,CAAW,EACtEC,EAAOP,GAAkBI,EAEzB,CAACI,EAAcC,GAAmB1E,EAAM,SAA2B,MAAM,EACzE,CAAC2E,EAAkBC,GAAuB5E,EAAM,SAAmC,MAAM,EACzF,CAAC6E,EAAoBC,GAAyB9E,EAAM,SAAiB,KAAK,EAC1E,CAAC+E,EAAeC,GAAoBhF,EA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
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* -
|
|
13
|
-
* - 日本語/英語ローカライズ
|
|
14
|
-
* - カスタムヘッダー/背景色
|
|
15
|
-
*
|
|
16
|
-
* ## AI/Automation Attributes
|
|
17
|
-
* - `data-testid`: Container element
|
|
18
|
-
* - `data-view`: Current view mode
|
|
19
|
-
* - `data-event-count`: Number of events
|
|
20
|
-
*
|
|
4
|
+
* Renders resource events in month, week, day, timeline, resource or agenda views.
|
|
5
|
+
* @param props - Event/resource arrays, view settings and interaction callbacks; see {@link ResourceCalendarProps}.
|
|
6
|
+
* @returns The calendar, navigation controls and optional selected-event dialog.
|
|
7
|
+
* @remarks Import Appkit CSS. Event data is supplied by the host; callbacks do not persist changes.
|
|
8
|
+
* resources defaults to an empty array, defaultDate to the mount-time current date and defaultView
|
|
9
|
+
* to week. view controls the displayed mode when supplied; date navigation remains local state.
|
|
10
|
+
* onRangeChange reports the visible date range after rendering. Locale comes from Appkit's
|
|
11
|
+
* Paraglide runtime (Japanese or English); Date values use the runtime's date/time conventions.
|
|
12
|
+
* The root does not expose data-testid, data-view or data-event-count and does not spread arbitrary attributes.
|
|
21
13
|
* @example
|
|
22
14
|
* ```tsx
|
|
23
15
|
* import { ResourceCalendar } from '@alneas/appkit-react/tools/calendar';
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* title: '
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* },
|
|
33
|
-
* ];
|
|
34
|
-
*
|
|
35
|
-
* const resources = [
|
|
36
|
-
* { id: 'room-a', title: '会議室A' },
|
|
37
|
-
* { id: 'room-b', title: '会議室B' },
|
|
38
|
-
* ];
|
|
39
|
-
*
|
|
40
|
-
* <ResourceCalendar
|
|
41
|
-
* events={events}
|
|
42
|
-
* resources={resources}
|
|
43
|
-
* defaultView="week"
|
|
44
|
-
* onEventClick={(event) => console.log(event)}
|
|
45
|
-
* />
|
|
16
|
+
* import '@alneas/appkit-react/styles';
|
|
17
|
+
*
|
|
18
|
+
* export function RoomCalendar() {
|
|
19
|
+
* return <ResourceCalendar defaultDate={new Date(2026, 0, 15)} defaultView="week"
|
|
20
|
+
* resources={[{ id: 'room-a', title: 'Room A' }]}
|
|
21
|
+
* events={[{ id: 'meeting', title: 'Planning', resourceId: 'room-a',
|
|
22
|
+
* start: new Date(2026, 0, 15, 10), end: new Date(2026, 0, 15, 11) }]} />;
|
|
23
|
+
* }
|
|
46
24
|
* ```
|
|
47
|
-
*
|
|
48
|
-
* @param props - {@link ResourceCalendarProps}
|
|
49
|
-
* @returns リソースカレンダーコンポーネント
|
|
50
25
|
*/
|
|
51
26
|
export declare function ResourceCalendar({ events, resources, defaultDate, defaultView, view: controlledView, className, onEventClick, onDateSelect, onViewChange, onRangeChange, components, businessHours, enabledViews, showDoubleArrows, headerBgColor, headingBgColor, defaultBgColor, }: ResourceCalendarProps): React.JSX.Element;
|