@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,90 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Requested document mode: system follows prefers-color-scheme; light/dark are explicit.
|
|
3
|
+
*
|
|
4
|
+
* @see ThemeProvider for setup and usage.
|
|
5
|
+
*/
|
|
1
6
|
export type Theme = 'dark' | 'light' | 'system';
|
|
7
|
+
/**
|
|
8
|
+
* Palette name used as theme-{name} on documentElement; custom names require host CSS.
|
|
9
|
+
*
|
|
10
|
+
* @see ThemeProvider for setup and usage.
|
|
11
|
+
*/
|
|
2
12
|
export type ColorTheme = 'default' | 'blue' | 'green' | 'rose' | 'orange' | string;
|
|
13
|
+
/**
|
|
14
|
+
* Document density class suffix applied by ThemeProvider.
|
|
15
|
+
*
|
|
16
|
+
* @see ThemeProvider for setup and usage.
|
|
17
|
+
*/
|
|
3
18
|
export type SpacingTheme = 'compact' | 'normal' | 'comfortable';
|
|
19
|
+
/**
|
|
20
|
+
* Optional raw CSS values written to documentElement as --{property} variables.
|
|
21
|
+
*
|
|
22
|
+
* @remarks Values are not parsed or validated. Omitted or empty values are not applied;
|
|
23
|
+
* the provider removes supplied variable names on cleanup.
|
|
24
|
+
*
|
|
25
|
+
* @see ThemeProvider for the customColors input and lifecycle.
|
|
26
|
+
*/
|
|
4
27
|
export interface CustomThemeColors {
|
|
28
|
+
/** Optional CSS value for --primary; no value is written when omitted. */
|
|
5
29
|
primary?: string;
|
|
30
|
+
/** Optional CSS value for --primary-foreground; no value is written when omitted. */
|
|
6
31
|
'primary-foreground'?: string;
|
|
32
|
+
/** Optional CSS value for --secondary; no value is written when omitted. */
|
|
7
33
|
secondary?: string;
|
|
34
|
+
/** Optional CSS value for --secondary-foreground; no value is written when omitted. */
|
|
8
35
|
'secondary-foreground'?: string;
|
|
36
|
+
/** Optional CSS value for --accent; no value is written when omitted. */
|
|
9
37
|
accent?: string;
|
|
38
|
+
/** Optional CSS value for --accent-foreground; no value is written when omitted. */
|
|
10
39
|
'accent-foreground'?: string;
|
|
40
|
+
/** Optional CSS value for --muted; no value is written when omitted. */
|
|
11
41
|
muted?: string;
|
|
42
|
+
/** Optional CSS value for --muted-foreground; no value is written when omitted. */
|
|
12
43
|
'muted-foreground'?: string;
|
|
44
|
+
/** Optional CSS value for --destructive; no value is written when omitted. */
|
|
13
45
|
destructive?: string;
|
|
46
|
+
/** Optional CSS value for --destructive-foreground; no value is written when omitted. */
|
|
14
47
|
'destructive-foreground'?: string;
|
|
48
|
+
/** Optional CSS value for --background; no value is written when omitted. */
|
|
15
49
|
background?: string;
|
|
50
|
+
/** Optional CSS value for --foreground; no value is written when omitted. */
|
|
16
51
|
foreground?: string;
|
|
52
|
+
/** Optional CSS value for --card; no value is written when omitted. */
|
|
17
53
|
card?: string;
|
|
54
|
+
/** Optional CSS value for --card-foreground; no value is written when omitted. */
|
|
18
55
|
'card-foreground'?: string;
|
|
56
|
+
/** Optional CSS value for --popover; no value is written when omitted. */
|
|
19
57
|
popover?: string;
|
|
58
|
+
/** Optional CSS value for --popover-foreground; no value is written when omitted. */
|
|
20
59
|
'popover-foreground'?: string;
|
|
60
|
+
/** Optional CSS value for --border; no value is written when omitted. */
|
|
21
61
|
border?: string;
|
|
62
|
+
/** Optional CSS value for --input; no value is written when omitted. */
|
|
22
63
|
input?: string;
|
|
64
|
+
/** Optional CSS value for --ring; no value is written when omitted. */
|
|
23
65
|
ring?: string;
|
|
66
|
+
/** Optional CSS value for --spacing-0; no value is written when omitted. */
|
|
24
67
|
'spacing-0'?: string;
|
|
68
|
+
/** Optional CSS value for --spacing-1; no value is written when omitted. */
|
|
25
69
|
'spacing-1'?: string;
|
|
70
|
+
/** Optional CSS value for --spacing-2; no value is written when omitted. */
|
|
26
71
|
'spacing-2'?: string;
|
|
72
|
+
/** Optional CSS value for --spacing-3; no value is written when omitted. */
|
|
27
73
|
'spacing-3'?: string;
|
|
74
|
+
/** Optional CSS value for --spacing-4; no value is written when omitted. */
|
|
28
75
|
'spacing-4'?: string;
|
|
76
|
+
/** Optional CSS value for --spacing-6; no value is written when omitted. */
|
|
29
77
|
'spacing-6'?: string;
|
|
78
|
+
/** Optional CSS value for --spacing-8; no value is written when omitted. */
|
|
30
79
|
'spacing-8'?: string;
|
|
80
|
+
/** Optional CSS value for --spacing-12; no value is written when omitted. */
|
|
31
81
|
'spacing-12'?: string;
|
|
82
|
+
/** Optional CSS value for --spacing-16; no value is written when omitted. */
|
|
32
83
|
'spacing-16'?: string;
|
|
84
|
+
/** Optional CSS value for --spacing-24; no value is written when omitted. */
|
|
33
85
|
'spacing-24'?: string;
|
|
86
|
+
/** Optional CSS value for --spacing-32; no value is written when omitted. */
|
|
34
87
|
'spacing-32'?: string;
|
|
88
|
+
/** Optional CSS value for --radius; no value is written when omitted. */
|
|
35
89
|
radius?: string;
|
|
90
|
+
/** Optional CSS value for --radius-sm; no value is written when omitted. */
|
|
36
91
|
'radius-sm'?: string;
|
|
92
|
+
/** Optional CSS value for --radius-md; no value is written when omitted. */
|
|
37
93
|
'radius-md'?: string;
|
|
94
|
+
/** Optional CSS value for --radius-lg; no value is written when omitted. */
|
|
38
95
|
'radius-lg'?: string;
|
|
96
|
+
/** Optional CSS value for --radius-xl; no value is written when omitted. */
|
|
39
97
|
'radius-xl'?: string;
|
|
98
|
+
/** Optional CSS value for --radius-2xl; no value is written when omitted. */
|
|
40
99
|
'radius-2xl'?: string;
|
|
100
|
+
/** Optional CSS value for --radius-full; no value is written when omitted. */
|
|
41
101
|
'radius-full'?: string;
|
|
102
|
+
/** Optional CSS value for --shadow-sm; no value is written when omitted. */
|
|
42
103
|
'shadow-sm'?: string;
|
|
104
|
+
/** Optional CSS value for --shadow-md; no value is written when omitted. */
|
|
43
105
|
'shadow-md'?: string;
|
|
106
|
+
/** Optional CSS value for --shadow-lg; no value is written when omitted. */
|
|
44
107
|
'shadow-lg'?: string;
|
|
108
|
+
/** Optional CSS value for --shadow-xl; no value is written when omitted. */
|
|
45
109
|
'shadow-xl'?: string;
|
|
110
|
+
/** Optional CSS value for --shadow-2xl; no value is written when omitted. */
|
|
46
111
|
'shadow-2xl'?: string;
|
|
112
|
+
/** Optional CSS value for --font-sans; no value is written when omitted. */
|
|
47
113
|
'font-sans'?: string;
|
|
114
|
+
/** Optional CSS value for --font-serif; no value is written when omitted. */
|
|
48
115
|
'font-serif'?: string;
|
|
116
|
+
/** Optional CSS value for --font-mono; no value is written when omitted. */
|
|
49
117
|
'font-mono'?: string;
|
|
118
|
+
/** Optional CSS value for --text-xs; no value is written when omitted. */
|
|
50
119
|
'text-xs'?: string;
|
|
120
|
+
/** Optional CSS value for --text-sm; no value is written when omitted. */
|
|
51
121
|
'text-sm'?: string;
|
|
122
|
+
/** Optional CSS value for --text-base; no value is written when omitted. */
|
|
52
123
|
'text-base'?: string;
|
|
124
|
+
/** Optional CSS value for --text-lg; no value is written when omitted. */
|
|
53
125
|
'text-lg'?: string;
|
|
126
|
+
/** Optional CSS value for --text-xl; no value is written when omitted. */
|
|
54
127
|
'text-xl'?: string;
|
|
128
|
+
/** Optional CSS value for --text-2xl; no value is written when omitted. */
|
|
55
129
|
'text-2xl'?: string;
|
|
130
|
+
/** Optional CSS value for --text-3xl; no value is written when omitted. */
|
|
56
131
|
'text-3xl'?: string;
|
|
132
|
+
/** Optional CSS value for --text-4xl; no value is written when omitted. */
|
|
57
133
|
'text-4xl'?: string;
|
|
134
|
+
/** Optional CSS value for --font-weight-normal; no value is written when omitted. */
|
|
58
135
|
'font-weight-normal'?: string;
|
|
136
|
+
/** Optional CSS value for --font-weight-medium; no value is written when omitted. */
|
|
59
137
|
'font-weight-medium'?: string;
|
|
138
|
+
/** Optional CSS value for --font-weight-semibold; no value is written when omitted. */
|
|
60
139
|
'font-weight-semibold'?: string;
|
|
140
|
+
/** Optional CSS value for --font-weight-bold; no value is written when omitted. */
|
|
61
141
|
'font-weight-bold'?: string;
|
|
142
|
+
/** Optional CSS value for --tracking-tight; no value is written when omitted. */
|
|
62
143
|
'tracking-tight'?: string;
|
|
144
|
+
/** Optional CSS value for --tracking-normal; no value is written when omitted. */
|
|
63
145
|
'tracking-normal'?: string;
|
|
146
|
+
/** Optional CSS value for --tracking-wide; no value is written when omitted. */
|
|
64
147
|
'tracking-wide'?: string;
|
|
148
|
+
/** Optional CSS value for --leading-none; no value is written when omitted. */
|
|
65
149
|
'leading-none'?: string;
|
|
150
|
+
/** Optional CSS value for --leading-tight; no value is written when omitted. */
|
|
66
151
|
'leading-tight'?: string;
|
|
152
|
+
/** Optional CSS value for --leading-normal; no value is written when omitted. */
|
|
67
153
|
'leading-normal'?: string;
|
|
154
|
+
/** Optional CSS value for --leading-relaxed; no value is written when omitted. */
|
|
68
155
|
'leading-relaxed'?: string;
|
|
156
|
+
/** Optional CSS value for --breakpoint-sm; no value is written when omitted. */
|
|
69
157
|
'breakpoint-sm'?: string;
|
|
158
|
+
/** Optional CSS value for --breakpoint-md; no value is written when omitted. */
|
|
70
159
|
'breakpoint-md'?: string;
|
|
160
|
+
/** Optional CSS value for --breakpoint-lg; no value is written when omitted. */
|
|
71
161
|
'breakpoint-lg'?: string;
|
|
162
|
+
/** Optional CSS value for --breakpoint-xl; no value is written when omitted. */
|
|
72
163
|
'breakpoint-xl'?: string;
|
|
164
|
+
/** Optional CSS value for --breakpoint-2xl; no value is written when omitted. */
|
|
73
165
|
'breakpoint-2xl'?: string;
|
|
74
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Theme state and setters exposed by ThemeProvider.
|
|
169
|
+
*
|
|
170
|
+
* @remarks Mode/palette/density setters write localStorage and may throw on access failure;
|
|
171
|
+
* customColors updates are in memory.
|
|
172
|
+
*
|
|
173
|
+
* @see useTheme for consumption.
|
|
174
|
+
*/
|
|
75
175
|
export type ThemeProviderState = {
|
|
176
|
+
/**
|
|
177
|
+
* Requested mode, initially system outside a provider.
|
|
178
|
+
*/
|
|
76
179
|
theme: Theme;
|
|
180
|
+
/**
|
|
181
|
+
* Resolved light/dark mode; initially light, then updated by provider effects.
|
|
182
|
+
*/
|
|
77
183
|
resolvedTheme: 'light' | 'dark';
|
|
184
|
+
/**
|
|
185
|
+
* Update mode and persist it under the provider storage key.
|
|
186
|
+
*
|
|
187
|
+
* @param theme - Requested light, dark or system mode.
|
|
188
|
+
*
|
|
189
|
+
* @returns No value after writing storage and scheduling state.
|
|
190
|
+
*/
|
|
78
191
|
setTheme: (theme: Theme) => void;
|
|
192
|
+
/**
|
|
193
|
+
* Active palette name, initially default outside a provider.
|
|
194
|
+
*/
|
|
79
195
|
colorTheme: ColorTheme;
|
|
196
|
+
/**
|
|
197
|
+
* Update the palette class suffix and persist it.
|
|
198
|
+
*
|
|
199
|
+
* @param colorTheme - Palette name; custom names require corresponding host CSS.
|
|
200
|
+
*
|
|
201
|
+
* @returns No value after writing storage and scheduling state.
|
|
202
|
+
*/
|
|
80
203
|
setColorTheme: (colorTheme: ColorTheme) => void;
|
|
204
|
+
/**
|
|
205
|
+
* Active density, initially normal outside a provider.
|
|
206
|
+
*/
|
|
81
207
|
spacingTheme: SpacingTheme;
|
|
208
|
+
/**
|
|
209
|
+
* Update document density and persist it.
|
|
210
|
+
*
|
|
211
|
+
* @param spacingTheme - Compact, normal or comfortable density.
|
|
212
|
+
*
|
|
213
|
+
* @returns No value after writing storage and scheduling state.
|
|
214
|
+
*/
|
|
82
215
|
setSpacingTheme: (spacingTheme: SpacingTheme) => void;
|
|
216
|
+
/**
|
|
217
|
+
* Current optional custom variable values.
|
|
218
|
+
*/
|
|
83
219
|
customColors?: CustomThemeColors;
|
|
220
|
+
/**
|
|
221
|
+
* Replace the in-memory custom CSS variable map.
|
|
222
|
+
*
|
|
223
|
+
* @param colors - CSS values to apply; old map variables are removed by effect cleanup.
|
|
224
|
+
*
|
|
225
|
+
* @returns No value; does not persist colors to localStorage.
|
|
226
|
+
*/
|
|
84
227
|
setCustomColors: (colors: CustomThemeColors) => void;
|
|
85
228
|
};
|
|
229
|
+
/**
|
|
230
|
+
* React context carrying document theme state.
|
|
231
|
+
*
|
|
232
|
+
* @remarks Its default value is an inert system/default/normal state with no-op setters.
|
|
233
|
+
* Use ThemeProvider to apply and persist changes.
|
|
234
|
+
*
|
|
235
|
+
* @see useTheme for consumption.
|
|
236
|
+
*/
|
|
86
237
|
export declare const ThemeProviderContext: import('react').Context<ThemeProviderState>;
|
|
87
238
|
/**
|
|
88
|
-
*
|
|
239
|
+
* Reads theme state and setters from the nearest ThemeProvider.
|
|
240
|
+
*
|
|
241
|
+
* @returns Current provider state, or inert system/default/normal defaults outside a provider.
|
|
242
|
+
*
|
|
243
|
+
* @throws If a custom context provider explicitly supplies undefined.
|
|
244
|
+
*
|
|
245
|
+
* @remarks ThemeProvider supplies active setters; import @alneas/appkit-react/styles to
|
|
246
|
+
* style Appkit palettes and density. The context has a defined default, so a missing
|
|
247
|
+
* provider does not normally throw. localStorage failures from active setters propagate.
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```tsx
|
|
251
|
+
* import '@alneas/appkit-react/styles';
|
|
252
|
+
* import { ThemeProvider, useTheme } from '@alneas/appkit-react/ui/theme';
|
|
253
|
+
* function Toggle() {
|
|
254
|
+
* const { theme, setTheme } = useTheme();
|
|
255
|
+
* return <button onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>Theme</button>;
|
|
256
|
+
* }
|
|
257
|
+
* export function ThemeExample() { return <ThemeProvider><Toggle /></ThemeProvider>; }
|
|
258
|
+
* ```
|
|
89
259
|
*/
|
|
90
260
|
export declare const useTheme: () => ThemeProviderState;
|
|
@@ -1,90 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Requested document mode: system follows prefers-color-scheme; light/dark are explicit.
|
|
3
|
+
*
|
|
4
|
+
* @see ThemeProvider for setup and usage.
|
|
5
|
+
*/
|
|
1
6
|
export type Theme = 'dark' | 'light' | 'system';
|
|
7
|
+
/**
|
|
8
|
+
* Palette name used as theme-{name} on documentElement; custom names require host CSS.
|
|
9
|
+
*
|
|
10
|
+
* @see ThemeProvider for setup and usage.
|
|
11
|
+
*/
|
|
2
12
|
export type ColorTheme = 'default' | 'blue' | 'green' | 'rose' | 'orange' | string;
|
|
13
|
+
/**
|
|
14
|
+
* Document density class suffix applied by ThemeProvider.
|
|
15
|
+
*
|
|
16
|
+
* @see ThemeProvider for setup and usage.
|
|
17
|
+
*/
|
|
3
18
|
export type SpacingTheme = 'compact' | 'normal' | 'comfortable';
|
|
19
|
+
/**
|
|
20
|
+
* Optional raw CSS values written to documentElement as --{property} variables.
|
|
21
|
+
*
|
|
22
|
+
* @remarks Values are not parsed or validated. Omitted or empty values are not applied;
|
|
23
|
+
* the provider removes supplied variable names on cleanup.
|
|
24
|
+
*
|
|
25
|
+
* @see ThemeProvider for the customColors input and lifecycle.
|
|
26
|
+
*/
|
|
4
27
|
export interface CustomThemeColors {
|
|
28
|
+
/** Optional CSS value for --primary; no value is written when omitted. */
|
|
5
29
|
primary?: string;
|
|
30
|
+
/** Optional CSS value for --primary-foreground; no value is written when omitted. */
|
|
6
31
|
'primary-foreground'?: string;
|
|
32
|
+
/** Optional CSS value for --secondary; no value is written when omitted. */
|
|
7
33
|
secondary?: string;
|
|
34
|
+
/** Optional CSS value for --secondary-foreground; no value is written when omitted. */
|
|
8
35
|
'secondary-foreground'?: string;
|
|
36
|
+
/** Optional CSS value for --accent; no value is written when omitted. */
|
|
9
37
|
accent?: string;
|
|
38
|
+
/** Optional CSS value for --accent-foreground; no value is written when omitted. */
|
|
10
39
|
'accent-foreground'?: string;
|
|
40
|
+
/** Optional CSS value for --muted; no value is written when omitted. */
|
|
11
41
|
muted?: string;
|
|
42
|
+
/** Optional CSS value for --muted-foreground; no value is written when omitted. */
|
|
12
43
|
'muted-foreground'?: string;
|
|
44
|
+
/** Optional CSS value for --destructive; no value is written when omitted. */
|
|
13
45
|
destructive?: string;
|
|
46
|
+
/** Optional CSS value for --destructive-foreground; no value is written when omitted. */
|
|
14
47
|
'destructive-foreground'?: string;
|
|
48
|
+
/** Optional CSS value for --background; no value is written when omitted. */
|
|
15
49
|
background?: string;
|
|
50
|
+
/** Optional CSS value for --foreground; no value is written when omitted. */
|
|
16
51
|
foreground?: string;
|
|
52
|
+
/** Optional CSS value for --card; no value is written when omitted. */
|
|
17
53
|
card?: string;
|
|
54
|
+
/** Optional CSS value for --card-foreground; no value is written when omitted. */
|
|
18
55
|
'card-foreground'?: string;
|
|
56
|
+
/** Optional CSS value for --popover; no value is written when omitted. */
|
|
19
57
|
popover?: string;
|
|
58
|
+
/** Optional CSS value for --popover-foreground; no value is written when omitted. */
|
|
20
59
|
'popover-foreground'?: string;
|
|
60
|
+
/** Optional CSS value for --border; no value is written when omitted. */
|
|
21
61
|
border?: string;
|
|
62
|
+
/** Optional CSS value for --input; no value is written when omitted. */
|
|
22
63
|
input?: string;
|
|
64
|
+
/** Optional CSS value for --ring; no value is written when omitted. */
|
|
23
65
|
ring?: string;
|
|
66
|
+
/** Optional CSS value for --spacing-0; no value is written when omitted. */
|
|
24
67
|
'spacing-0'?: string;
|
|
68
|
+
/** Optional CSS value for --spacing-1; no value is written when omitted. */
|
|
25
69
|
'spacing-1'?: string;
|
|
70
|
+
/** Optional CSS value for --spacing-2; no value is written when omitted. */
|
|
26
71
|
'spacing-2'?: string;
|
|
72
|
+
/** Optional CSS value for --spacing-3; no value is written when omitted. */
|
|
27
73
|
'spacing-3'?: string;
|
|
74
|
+
/** Optional CSS value for --spacing-4; no value is written when omitted. */
|
|
28
75
|
'spacing-4'?: string;
|
|
76
|
+
/** Optional CSS value for --spacing-6; no value is written when omitted. */
|
|
29
77
|
'spacing-6'?: string;
|
|
78
|
+
/** Optional CSS value for --spacing-8; no value is written when omitted. */
|
|
30
79
|
'spacing-8'?: string;
|
|
80
|
+
/** Optional CSS value for --spacing-12; no value is written when omitted. */
|
|
31
81
|
'spacing-12'?: string;
|
|
82
|
+
/** Optional CSS value for --spacing-16; no value is written when omitted. */
|
|
32
83
|
'spacing-16'?: string;
|
|
84
|
+
/** Optional CSS value for --spacing-24; no value is written when omitted. */
|
|
33
85
|
'spacing-24'?: string;
|
|
86
|
+
/** Optional CSS value for --spacing-32; no value is written when omitted. */
|
|
34
87
|
'spacing-32'?: string;
|
|
88
|
+
/** Optional CSS value for --radius; no value is written when omitted. */
|
|
35
89
|
radius?: string;
|
|
90
|
+
/** Optional CSS value for --radius-sm; no value is written when omitted. */
|
|
36
91
|
'radius-sm'?: string;
|
|
92
|
+
/** Optional CSS value for --radius-md; no value is written when omitted. */
|
|
37
93
|
'radius-md'?: string;
|
|
94
|
+
/** Optional CSS value for --radius-lg; no value is written when omitted. */
|
|
38
95
|
'radius-lg'?: string;
|
|
96
|
+
/** Optional CSS value for --radius-xl; no value is written when omitted. */
|
|
39
97
|
'radius-xl'?: string;
|
|
98
|
+
/** Optional CSS value for --radius-2xl; no value is written when omitted. */
|
|
40
99
|
'radius-2xl'?: string;
|
|
100
|
+
/** Optional CSS value for --radius-full; no value is written when omitted. */
|
|
41
101
|
'radius-full'?: string;
|
|
102
|
+
/** Optional CSS value for --shadow-sm; no value is written when omitted. */
|
|
42
103
|
'shadow-sm'?: string;
|
|
104
|
+
/** Optional CSS value for --shadow-md; no value is written when omitted. */
|
|
43
105
|
'shadow-md'?: string;
|
|
106
|
+
/** Optional CSS value for --shadow-lg; no value is written when omitted. */
|
|
44
107
|
'shadow-lg'?: string;
|
|
108
|
+
/** Optional CSS value for --shadow-xl; no value is written when omitted. */
|
|
45
109
|
'shadow-xl'?: string;
|
|
110
|
+
/** Optional CSS value for --shadow-2xl; no value is written when omitted. */
|
|
46
111
|
'shadow-2xl'?: string;
|
|
112
|
+
/** Optional CSS value for --font-sans; no value is written when omitted. */
|
|
47
113
|
'font-sans'?: string;
|
|
114
|
+
/** Optional CSS value for --font-serif; no value is written when omitted. */
|
|
48
115
|
'font-serif'?: string;
|
|
116
|
+
/** Optional CSS value for --font-mono; no value is written when omitted. */
|
|
49
117
|
'font-mono'?: string;
|
|
118
|
+
/** Optional CSS value for --text-xs; no value is written when omitted. */
|
|
50
119
|
'text-xs'?: string;
|
|
120
|
+
/** Optional CSS value for --text-sm; no value is written when omitted. */
|
|
51
121
|
'text-sm'?: string;
|
|
122
|
+
/** Optional CSS value for --text-base; no value is written when omitted. */
|
|
52
123
|
'text-base'?: string;
|
|
124
|
+
/** Optional CSS value for --text-lg; no value is written when omitted. */
|
|
53
125
|
'text-lg'?: string;
|
|
126
|
+
/** Optional CSS value for --text-xl; no value is written when omitted. */
|
|
54
127
|
'text-xl'?: string;
|
|
128
|
+
/** Optional CSS value for --text-2xl; no value is written when omitted. */
|
|
55
129
|
'text-2xl'?: string;
|
|
130
|
+
/** Optional CSS value for --text-3xl; no value is written when omitted. */
|
|
56
131
|
'text-3xl'?: string;
|
|
132
|
+
/** Optional CSS value for --text-4xl; no value is written when omitted. */
|
|
57
133
|
'text-4xl'?: string;
|
|
134
|
+
/** Optional CSS value for --font-weight-normal; no value is written when omitted. */
|
|
58
135
|
'font-weight-normal'?: string;
|
|
136
|
+
/** Optional CSS value for --font-weight-medium; no value is written when omitted. */
|
|
59
137
|
'font-weight-medium'?: string;
|
|
138
|
+
/** Optional CSS value for --font-weight-semibold; no value is written when omitted. */
|
|
60
139
|
'font-weight-semibold'?: string;
|
|
140
|
+
/** Optional CSS value for --font-weight-bold; no value is written when omitted. */
|
|
61
141
|
'font-weight-bold'?: string;
|
|
142
|
+
/** Optional CSS value for --tracking-tight; no value is written when omitted. */
|
|
62
143
|
'tracking-tight'?: string;
|
|
144
|
+
/** Optional CSS value for --tracking-normal; no value is written when omitted. */
|
|
63
145
|
'tracking-normal'?: string;
|
|
146
|
+
/** Optional CSS value for --tracking-wide; no value is written when omitted. */
|
|
64
147
|
'tracking-wide'?: string;
|
|
148
|
+
/** Optional CSS value for --leading-none; no value is written when omitted. */
|
|
65
149
|
'leading-none'?: string;
|
|
150
|
+
/** Optional CSS value for --leading-tight; no value is written when omitted. */
|
|
66
151
|
'leading-tight'?: string;
|
|
152
|
+
/** Optional CSS value for --leading-normal; no value is written when omitted. */
|
|
67
153
|
'leading-normal'?: string;
|
|
154
|
+
/** Optional CSS value for --leading-relaxed; no value is written when omitted. */
|
|
68
155
|
'leading-relaxed'?: string;
|
|
156
|
+
/** Optional CSS value for --breakpoint-sm; no value is written when omitted. */
|
|
69
157
|
'breakpoint-sm'?: string;
|
|
158
|
+
/** Optional CSS value for --breakpoint-md; no value is written when omitted. */
|
|
70
159
|
'breakpoint-md'?: string;
|
|
160
|
+
/** Optional CSS value for --breakpoint-lg; no value is written when omitted. */
|
|
71
161
|
'breakpoint-lg'?: string;
|
|
162
|
+
/** Optional CSS value for --breakpoint-xl; no value is written when omitted. */
|
|
72
163
|
'breakpoint-xl'?: string;
|
|
164
|
+
/** Optional CSS value for --breakpoint-2xl; no value is written when omitted. */
|
|
73
165
|
'breakpoint-2xl'?: string;
|
|
74
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Theme state and setters exposed by ThemeProvider.
|
|
169
|
+
*
|
|
170
|
+
* @remarks Mode/palette/density setters write localStorage and may throw on access failure;
|
|
171
|
+
* customColors updates are in memory.
|
|
172
|
+
*
|
|
173
|
+
* @see useTheme for consumption.
|
|
174
|
+
*/
|
|
75
175
|
export type ThemeProviderState = {
|
|
176
|
+
/**
|
|
177
|
+
* Requested mode, initially system outside a provider.
|
|
178
|
+
*/
|
|
76
179
|
theme: Theme;
|
|
180
|
+
/**
|
|
181
|
+
* Resolved light/dark mode; initially light, then updated by provider effects.
|
|
182
|
+
*/
|
|
77
183
|
resolvedTheme: 'light' | 'dark';
|
|
184
|
+
/**
|
|
185
|
+
* Update mode and persist it under the provider storage key.
|
|
186
|
+
*
|
|
187
|
+
* @param theme - Requested light, dark or system mode.
|
|
188
|
+
*
|
|
189
|
+
* @returns No value after writing storage and scheduling state.
|
|
190
|
+
*/
|
|
78
191
|
setTheme: (theme: Theme) => void;
|
|
192
|
+
/**
|
|
193
|
+
* Active palette name, initially default outside a provider.
|
|
194
|
+
*/
|
|
79
195
|
colorTheme: ColorTheme;
|
|
196
|
+
/**
|
|
197
|
+
* Update the palette class suffix and persist it.
|
|
198
|
+
*
|
|
199
|
+
* @param colorTheme - Palette name; custom names require corresponding host CSS.
|
|
200
|
+
*
|
|
201
|
+
* @returns No value after writing storage and scheduling state.
|
|
202
|
+
*/
|
|
80
203
|
setColorTheme: (colorTheme: ColorTheme) => void;
|
|
204
|
+
/**
|
|
205
|
+
* Active density, initially normal outside a provider.
|
|
206
|
+
*/
|
|
81
207
|
spacingTheme: SpacingTheme;
|
|
208
|
+
/**
|
|
209
|
+
* Update document density and persist it.
|
|
210
|
+
*
|
|
211
|
+
* @param spacingTheme - Compact, normal or comfortable density.
|
|
212
|
+
*
|
|
213
|
+
* @returns No value after writing storage and scheduling state.
|
|
214
|
+
*/
|
|
82
215
|
setSpacingTheme: (spacingTheme: SpacingTheme) => void;
|
|
216
|
+
/**
|
|
217
|
+
* Current optional custom variable values.
|
|
218
|
+
*/
|
|
83
219
|
customColors?: CustomThemeColors;
|
|
220
|
+
/**
|
|
221
|
+
* Replace the in-memory custom CSS variable map.
|
|
222
|
+
*
|
|
223
|
+
* @param colors - CSS values to apply; old map variables are removed by effect cleanup.
|
|
224
|
+
*
|
|
225
|
+
* @returns No value; does not persist colors to localStorage.
|
|
226
|
+
*/
|
|
84
227
|
setCustomColors: (colors: CustomThemeColors) => void;
|
|
85
228
|
};
|
|
229
|
+
/**
|
|
230
|
+
* React context carrying document theme state.
|
|
231
|
+
*
|
|
232
|
+
* @remarks Its default value is an inert system/default/normal state with no-op setters.
|
|
233
|
+
* Use ThemeProvider to apply and persist changes.
|
|
234
|
+
*
|
|
235
|
+
* @see useTheme for consumption.
|
|
236
|
+
*/
|
|
86
237
|
export declare const ThemeProviderContext: import('react').Context<ThemeProviderState>;
|
|
87
238
|
/**
|
|
88
|
-
*
|
|
239
|
+
* Reads theme state and setters from the nearest ThemeProvider.
|
|
240
|
+
*
|
|
241
|
+
* @returns Current provider state, or inert system/default/normal defaults outside a provider.
|
|
242
|
+
*
|
|
243
|
+
* @throws If a custom context provider explicitly supplies undefined.
|
|
244
|
+
*
|
|
245
|
+
* @remarks ThemeProvider supplies active setters; import @alneas/appkit-react/styles to
|
|
246
|
+
* style Appkit palettes and density. The context has a defined default, so a missing
|
|
247
|
+
* provider does not normally throw. localStorage failures from active setters propagate.
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```tsx
|
|
251
|
+
* import '@alneas/appkit-react/styles';
|
|
252
|
+
* import { ThemeProvider, useTheme } from '@alneas/appkit-react/ui/theme';
|
|
253
|
+
* function Toggle() {
|
|
254
|
+
* const { theme, setTheme } = useTheme();
|
|
255
|
+
* return <button onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>Theme</button>;
|
|
256
|
+
* }
|
|
257
|
+
* export function ThemeExample() { return <ThemeProvider><Toggle /></ThemeProvider>; }
|
|
258
|
+
* ```
|
|
89
259
|
*/
|
|
90
260
|
export declare const useTheme: () => ThemeProviderState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-context.js","names":["ThemeProviderContext","createContext","useTheme","context","useContext"],"sources":["../../../../src/ui/components/theme/theme-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type Theme = 'dark' | 'light' | 'system';\nexport type ColorTheme = 'default' | 'blue' | 'green' | 'rose' | 'orange' | string;\nexport type SpacingTheme = 'compact' | 'normal' | 'comfortable';\n\nexport interface CustomThemeColors {\n // Color tokens\n primary?: string;\n 'primary-foreground'?: string;\n secondary?: string;\n 'secondary-foreground'?: string;\n accent?: string;\n 'accent-foreground'?: string;\n muted?: string;\n 'muted-foreground'?: string;\n destructive?: string;\n 'destructive-foreground'?: string;\n background?: string;\n foreground?: string;\n card?: string;\n 'card-foreground'?: string;\n popover?: string;\n 'popover-foreground'?: string;\n border?: string;\n input?: string;\n ring?: string;\n\n // Spacing & sizing\n 'spacing-0'?: string;\n 'spacing-1'?: string;\n 'spacing-2'?: string;\n 'spacing-3'?: string;\n 'spacing-4'?: string;\n 'spacing-6'?: string;\n 'spacing-8'?: string;\n 'spacing-12'?: string;\n 'spacing-16'?: string;\n 'spacing-24'?: string;\n 'spacing-32'?: string;\n\n // Border radius\n radius?: string;\n 'radius-sm'?: string;\n 'radius-md'?: string;\n 'radius-lg'?: string;\n 'radius-xl'?: string;\n 'radius-2xl'?: string;\n 'radius-full'?: string;\n\n // Shadows\n 'shadow-sm'?: string;\n 'shadow-md'?: string;\n 'shadow-lg'?: string;\n 'shadow-xl'?: string;\n 'shadow-2xl'?: string;\n\n // Typography\n 'font-sans'?: string;\n 'font-serif'?: string;\n 'font-mono'?: string;\n 'text-xs'?: string;\n 'text-sm'?: string;\n 'text-base'?: string;\n 'text-lg'?: string;\n 'text-xl'?: string;\n 'text-2xl'?: string;\n 'text-3xl'?: string;\n 'text-4xl'?: string;\n 'font-weight-normal'?: string;\n 'font-weight-medium'?: string;\n 'font-weight-semibold'?: string;\n 'font-weight-bold'?: string;\n 'tracking-tight'?: string;\n 'tracking-normal'?: string;\n 'tracking-wide'?: string;\n 'leading-none'?: string;\n 'leading-tight'?: string;\n 'leading-normal'?: string;\n 'leading-relaxed'?: string;\n\n // Breakpoints\n 'breakpoint-sm'?: string;\n 'breakpoint-md'?: string;\n 'breakpoint-lg'?: string;\n 'breakpoint-xl'?: string;\n 'breakpoint-2xl'?: string;\n}\n\nexport type ThemeProviderState = {\n theme: Theme;\n resolvedTheme: 'light' | 'dark';\n setTheme: (theme: Theme) => void;\n colorTheme: ColorTheme;\n setColorTheme: (colorTheme: ColorTheme) => void;\n spacingTheme: SpacingTheme;\n setSpacingTheme: (spacingTheme: SpacingTheme) => void;\n customColors?: CustomThemeColors;\n setCustomColors: (colors: CustomThemeColors) => void;\n};\n\nconst initialState: ThemeProviderState = {\n theme: 'system',\n resolvedTheme: 'light',\n setTheme: () => null,\n colorTheme: 'default',\n setColorTheme: () => null,\n spacingTheme: 'normal',\n setSpacingTheme: () => null,\n setCustomColors: () => null,\n};\n\nexport const ThemeProviderContext = createContext<ThemeProviderState>(initialState);\n\n/**\n * テーマコンテキストを取得するフック\n */\nexport const useTheme = () => {\n const context = useContext(ThemeProviderContext);\n\n if (context === undefined) throw new Error('useTheme must be used within a ThemeProvider');\n\n return context;\n};\n"],"mappings":";;AAgHA,IAAaA,IAAuBC,EAAkC;CAVpE,OAAO;CACP,eAAe;CACf,gBAAgB;CAChB,YAAY;CACZ,qBAAqB;CACrB,cAAc;CACd,uBAAuB;CACvB,uBAAuB;AAG6C,CAAY,GAKrEC,UAAiB;CAC5B,IAAMC,IAAUC,EAAWJ,CAAoB;CAE/C,IAAIG,MAAY,KAAA,GAAW,MAAU,MAAM,8CAA8C;CAEzF,OAAOA;AACT"}
|
|
1
|
+
{"version":3,"file":"theme-context.js","names":["ThemeProviderContext","createContext","useTheme","context","useContext"],"sources":["../../../../src/ui/components/theme/theme-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\n/**\n * Requested document mode: system follows prefers-color-scheme; light/dark are explicit.\n *\n * @see ThemeProvider for setup and usage.\n */\nexport type Theme = 'dark' | 'light' | 'system';\n/**\n * Palette name used as theme-{name} on documentElement; custom names require host CSS.\n *\n * @see ThemeProvider for setup and usage.\n */\nexport type ColorTheme = 'default' | 'blue' | 'green' | 'rose' | 'orange' | string;\n/**\n * Document density class suffix applied by ThemeProvider.\n *\n * @see ThemeProvider for setup and usage.\n */\nexport type SpacingTheme = 'compact' | 'normal' | 'comfortable';\n\n/**\n * Optional raw CSS values written to documentElement as --{property} variables.\n *\n * @remarks Values are not parsed or validated. Omitted or empty values are not applied;\n * the provider removes supplied variable names on cleanup.\n *\n * @see ThemeProvider for the customColors input and lifecycle.\n */\nexport interface CustomThemeColors {\n // Color tokens\n /** Optional CSS value for --primary; no value is written when omitted. */\n primary?: string;\n /** Optional CSS value for --primary-foreground; no value is written when omitted. */\n 'primary-foreground'?: string;\n /** Optional CSS value for --secondary; no value is written when omitted. */\n secondary?: string;\n /** Optional CSS value for --secondary-foreground; no value is written when omitted. */\n 'secondary-foreground'?: string;\n /** Optional CSS value for --accent; no value is written when omitted. */\n accent?: string;\n /** Optional CSS value for --accent-foreground; no value is written when omitted. */\n 'accent-foreground'?: string;\n /** Optional CSS value for --muted; no value is written when omitted. */\n muted?: string;\n /** Optional CSS value for --muted-foreground; no value is written when omitted. */\n 'muted-foreground'?: string;\n /** Optional CSS value for --destructive; no value is written when omitted. */\n destructive?: string;\n /** Optional CSS value for --destructive-foreground; no value is written when omitted. */\n 'destructive-foreground'?: string;\n /** Optional CSS value for --background; no value is written when omitted. */\n background?: string;\n /** Optional CSS value for --foreground; no value is written when omitted. */\n foreground?: string;\n /** Optional CSS value for --card; no value is written when omitted. */\n card?: string;\n /** Optional CSS value for --card-foreground; no value is written when omitted. */\n 'card-foreground'?: string;\n /** Optional CSS value for --popover; no value is written when omitted. */\n popover?: string;\n /** Optional CSS value for --popover-foreground; no value is written when omitted. */\n 'popover-foreground'?: string;\n /** Optional CSS value for --border; no value is written when omitted. */\n border?: string;\n /** Optional CSS value for --input; no value is written when omitted. */\n input?: string;\n /** Optional CSS value for --ring; no value is written when omitted. */\n ring?: string;\n\n // Spacing & sizing\n /** Optional CSS value for --spacing-0; no value is written when omitted. */\n 'spacing-0'?: string;\n /** Optional CSS value for --spacing-1; no value is written when omitted. */\n 'spacing-1'?: string;\n /** Optional CSS value for --spacing-2; no value is written when omitted. */\n 'spacing-2'?: string;\n /** Optional CSS value for --spacing-3; no value is written when omitted. */\n 'spacing-3'?: string;\n /** Optional CSS value for --spacing-4; no value is written when omitted. */\n 'spacing-4'?: string;\n /** Optional CSS value for --spacing-6; no value is written when omitted. */\n 'spacing-6'?: string;\n /** Optional CSS value for --spacing-8; no value is written when omitted. */\n 'spacing-8'?: string;\n /** Optional CSS value for --spacing-12; no value is written when omitted. */\n 'spacing-12'?: string;\n /** Optional CSS value for --spacing-16; no value is written when omitted. */\n 'spacing-16'?: string;\n /** Optional CSS value for --spacing-24; no value is written when omitted. */\n 'spacing-24'?: string;\n /** Optional CSS value for --spacing-32; no value is written when omitted. */\n 'spacing-32'?: string;\n\n // Border radius\n /** Optional CSS value for --radius; no value is written when omitted. */\n radius?: string;\n /** Optional CSS value for --radius-sm; no value is written when omitted. */\n 'radius-sm'?: string;\n /** Optional CSS value for --radius-md; no value is written when omitted. */\n 'radius-md'?: string;\n /** Optional CSS value for --radius-lg; no value is written when omitted. */\n 'radius-lg'?: string;\n /** Optional CSS value for --radius-xl; no value is written when omitted. */\n 'radius-xl'?: string;\n /** Optional CSS value for --radius-2xl; no value is written when omitted. */\n 'radius-2xl'?: string;\n /** Optional CSS value for --radius-full; no value is written when omitted. */\n 'radius-full'?: string;\n\n // Shadows\n /** Optional CSS value for --shadow-sm; no value is written when omitted. */\n 'shadow-sm'?: string;\n /** Optional CSS value for --shadow-md; no value is written when omitted. */\n 'shadow-md'?: string;\n /** Optional CSS value for --shadow-lg; no value is written when omitted. */\n 'shadow-lg'?: string;\n /** Optional CSS value for --shadow-xl; no value is written when omitted. */\n 'shadow-xl'?: string;\n /** Optional CSS value for --shadow-2xl; no value is written when omitted. */\n 'shadow-2xl'?: string;\n\n // Typography\n /** Optional CSS value for --font-sans; no value is written when omitted. */\n 'font-sans'?: string;\n /** Optional CSS value for --font-serif; no value is written when omitted. */\n 'font-serif'?: string;\n /** Optional CSS value for --font-mono; no value is written when omitted. */\n 'font-mono'?: string;\n /** Optional CSS value for --text-xs; no value is written when omitted. */\n 'text-xs'?: string;\n /** Optional CSS value for --text-sm; no value is written when omitted. */\n 'text-sm'?: string;\n /** Optional CSS value for --text-base; no value is written when omitted. */\n 'text-base'?: string;\n /** Optional CSS value for --text-lg; no value is written when omitted. */\n 'text-lg'?: string;\n /** Optional CSS value for --text-xl; no value is written when omitted. */\n 'text-xl'?: string;\n /** Optional CSS value for --text-2xl; no value is written when omitted. */\n 'text-2xl'?: string;\n /** Optional CSS value for --text-3xl; no value is written when omitted. */\n 'text-3xl'?: string;\n /** Optional CSS value for --text-4xl; no value is written when omitted. */\n 'text-4xl'?: string;\n /** Optional CSS value for --font-weight-normal; no value is written when omitted. */\n 'font-weight-normal'?: string;\n /** Optional CSS value for --font-weight-medium; no value is written when omitted. */\n 'font-weight-medium'?: string;\n /** Optional CSS value for --font-weight-semibold; no value is written when omitted. */\n 'font-weight-semibold'?: string;\n /** Optional CSS value for --font-weight-bold; no value is written when omitted. */\n 'font-weight-bold'?: string;\n /** Optional CSS value for --tracking-tight; no value is written when omitted. */\n 'tracking-tight'?: string;\n /** Optional CSS value for --tracking-normal; no value is written when omitted. */\n 'tracking-normal'?: string;\n /** Optional CSS value for --tracking-wide; no value is written when omitted. */\n 'tracking-wide'?: string;\n /** Optional CSS value for --leading-none; no value is written when omitted. */\n 'leading-none'?: string;\n /** Optional CSS value for --leading-tight; no value is written when omitted. */\n 'leading-tight'?: string;\n /** Optional CSS value for --leading-normal; no value is written when omitted. */\n 'leading-normal'?: string;\n /** Optional CSS value for --leading-relaxed; no value is written when omitted. */\n 'leading-relaxed'?: string;\n\n // Breakpoints\n /** Optional CSS value for --breakpoint-sm; no value is written when omitted. */\n 'breakpoint-sm'?: string;\n /** Optional CSS value for --breakpoint-md; no value is written when omitted. */\n 'breakpoint-md'?: string;\n /** Optional CSS value for --breakpoint-lg; no value is written when omitted. */\n 'breakpoint-lg'?: string;\n /** Optional CSS value for --breakpoint-xl; no value is written when omitted. */\n 'breakpoint-xl'?: string;\n /** Optional CSS value for --breakpoint-2xl; no value is written when omitted. */\n 'breakpoint-2xl'?: string;\n}\n\n/**\n * Theme state and setters exposed by ThemeProvider.\n *\n * @remarks Mode/palette/density setters write localStorage and may throw on access failure;\n * customColors updates are in memory.\n *\n * @see useTheme for consumption.\n */\nexport type ThemeProviderState = {\n /**\n * Requested mode, initially system outside a provider.\n */\n theme: Theme;\n /**\n * Resolved light/dark mode; initially light, then updated by provider effects.\n */\n resolvedTheme: 'light' | 'dark';\n /**\n * Update mode and persist it under the provider storage key.\n *\n * @param theme - Requested light, dark or system mode.\n *\n * @returns No value after writing storage and scheduling state.\n */\n setTheme: (theme: Theme) => void;\n /**\n * Active palette name, initially default outside a provider.\n */\n colorTheme: ColorTheme;\n /**\n * Update the palette class suffix and persist it.\n *\n * @param colorTheme - Palette name; custom names require corresponding host CSS.\n *\n * @returns No value after writing storage and scheduling state.\n */\n setColorTheme: (colorTheme: ColorTheme) => void;\n /**\n * Active density, initially normal outside a provider.\n */\n spacingTheme: SpacingTheme;\n /**\n * Update document density and persist it.\n *\n * @param spacingTheme - Compact, normal or comfortable density.\n *\n * @returns No value after writing storage and scheduling state.\n */\n setSpacingTheme: (spacingTheme: SpacingTheme) => void;\n /**\n * Current optional custom variable values.\n */\n customColors?: CustomThemeColors;\n /**\n * Replace the in-memory custom CSS variable map.\n *\n * @param colors - CSS values to apply; old map variables are removed by effect cleanup.\n *\n * @returns No value; does not persist colors to localStorage.\n */\n setCustomColors: (colors: CustomThemeColors) => void;\n};\n\nconst initialState: ThemeProviderState = {\n theme: 'system',\n resolvedTheme: 'light',\n setTheme: () => null,\n colorTheme: 'default',\n setColorTheme: () => null,\n spacingTheme: 'normal',\n setSpacingTheme: () => null,\n setCustomColors: () => null,\n};\n\n/**\n * React context carrying document theme state.\n *\n * @remarks Its default value is an inert system/default/normal state with no-op setters.\n * Use ThemeProvider to apply and persist changes.\n *\n * @see useTheme for consumption.\n */\nexport const ThemeProviderContext = createContext<ThemeProviderState>(initialState);\n\n/**\n * Reads theme state and setters from the nearest ThemeProvider.\n *\n * @returns Current provider state, or inert system/default/normal defaults outside a provider.\n *\n * @throws If a custom context provider explicitly supplies undefined.\n *\n * @remarks ThemeProvider supplies active setters; import @alneas/appkit-react/styles to\n * style Appkit palettes and density. The context has a defined default, so a missing\n * provider does not normally throw. localStorage failures from active setters propagate.\n *\n * @example\n * ```tsx\n * import '@alneas/appkit-react/styles';\n * import { ThemeProvider, useTheme } from '@alneas/appkit-react/ui/theme';\n * function Toggle() {\n * const { theme, setTheme } = useTheme();\n * return <button onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>Theme</button>;\n * }\n * export function ThemeExample() { return <ThemeProvider><Toggle /></ThemeProvider>; }\n * ```\n */\nexport const useTheme = () => {\n const context = useContext(ThemeProviderContext);\n\n if (context === undefined) throw new Error('useTheme must be used within a ThemeProvider');\n\n return context;\n};\n"],"mappings":";;AAuQA,IAAaA,IAAuBC,EAAkC;CAlBpE,OAAO;CACP,eAAe;CACf,gBAAgB;CAChB,YAAY;CACZ,qBAAqB;CACrB,cAAc;CACd,uBAAuB;CACvB,uBAAuB;AAW6C,CAAY,GAwBrEC,UAAiB;CAC5B,IAAMC,IAAUC,EAAWJ,CAAoB;CAE/C,IAAIG,MAAY,KAAA,GAAW,MAAU,MAAM,8CAA8C;CAEzF,OAAOA;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-provider.cjs","names":["useState","ThemeProviderContext","require_ui_components_theme_theme_context","react_jsx_runtime","react","ThemeProvider","initialCustomColors","props","theme","setTheme","defaultTheme","storageKey","colorTheme","setColorTheme","defaultColorTheme","colorThemeStorageKey","spacingTheme","setSpacingTheme","defaultSpacingTheme","spacingThemeStorageKey","resolvedTheme","setResolvedTheme","customColors","setCustomColors","root","applyTheme","systemTheme","mediaQuery","handleChange","key","value"],"sources":["../../../../src/ui/components/theme/theme-provider.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport {\n type Theme,\n type ColorTheme,\n type SpacingTheme,\n type CustomThemeColors,\n ThemeProviderContext,\n} from './theme-context';\n\nexport type ThemeProviderProps = {\n children: React.ReactNode;\n defaultTheme?: Theme;\n defaultColorTheme?: ColorTheme;\n defaultSpacingTheme?: SpacingTheme;\n customColors?: CustomThemeColors;\n storageKey?: string;\n colorThemeStorageKey?: string;\n spacingThemeStorageKey?: string;\n};\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"theme-provider.cjs","names":["useState","ThemeProviderContext","require_ui_components_theme_theme_context","react_jsx_runtime","react","ThemeProvider","initialCustomColors","props","theme","setTheme","defaultTheme","storageKey","colorTheme","setColorTheme","defaultColorTheme","colorThemeStorageKey","spacingTheme","setSpacingTheme","defaultSpacingTheme","spacingThemeStorageKey","resolvedTheme","setResolvedTheme","customColors","setCustomColors","root","applyTheme","systemTheme","mediaQuery","handleChange","key","value"],"sources":["../../../../src/ui/components/theme/theme-provider.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport {\n type Theme,\n type ColorTheme,\n type SpacingTheme,\n type CustomThemeColors,\n ThemeProviderContext,\n} from './theme-context';\n\n/**\n * Initial theme settings and browser storage keys; see ThemeProvider for usage.\n * @see ThemeProvider for the canonical usage example.\n */\nexport type ThemeProviderProps = {\n /** Descendants that consume theme state. */\n children: React.ReactNode;\n /** Initial mode when storage is empty; defaults to 'system'. */\n defaultTheme?: Theme;\n /** Initial palette when storage is empty; defaults to 'default'. */\n defaultColorTheme?: ColorTheme;\n /** Initial density when storage is empty; defaults to 'normal'. */\n defaultSpacingTheme?: SpacingTheme;\n /** Initial custom CSS variable values; subsequent prop changes do not replace state. */\n customColors?: CustomThemeColors;\n /** Mode localStorage key; defaults to 'vite-ui-theme'. */\n storageKey?: string;\n /** Palette localStorage key; defaults to 'vite-ui-color-theme'. */\n colorThemeStorageKey?: string;\n /** Density localStorage key; defaults to 'vite-ui-spacing-theme'. */\n spacingThemeStorageKey?: string;\n};\n\n/**\n * Provides browser theme state and applies mode, palette and density to documentElement.\n *\n * @param props - Children, initial settings, custom CSS variables and storage keys.\n *\n * @returns Theme context for descendants.\n *\n * @throws Browser localStorage access failures during initialization or setter calls propagate.\n *\n * @remarks Import @alneas/appkit-react/styles in the host for Appkit theme styling.\n * No query/auth provider is required. Stored values override defaults on the client;\n * server rendering uses defaults, so stored preferences can differ at hydration.\n * Effects update root classes and custom CSS variables after mount. System mode listens\n * for media-query changes and removes that listener on cleanup. Custom CSS variables\n * are removed on cleanup; root theme classes remain. Mode/palette/density setters persist\n * to localStorage; custom colors are in-memory state. Coordinate multiple providers\n * because they write the same document root. Stored values are cast without validation.\n *\n * @example\n * ```tsx\n * import type { ReactNode } from 'react';\n * import '@alneas/appkit-react/styles';\n * import { ThemeProvider } from '@alneas/appkit-react/ui/theme';\n * export function ThemeRoot({ children }: { children: ReactNode }) {\n * return <ThemeProvider defaultTheme=\"system\" defaultColorTheme=\"blue\">{children}</ThemeProvider>;\n * }\n * ```\n */\nexport function ThemeProvider({\n children,\n defaultTheme = 'system',\n defaultColorTheme = 'default',\n defaultSpacingTheme = 'normal',\n customColors: initialCustomColors,\n storageKey = 'vite-ui-theme',\n colorThemeStorageKey = 'vite-ui-color-theme',\n spacingThemeStorageKey = 'vite-ui-spacing-theme',\n ...props\n}: ThemeProviderProps) {\n // Initialize with defaults to avoid SSR ReferenceError and Hydration Mismatch\n const [theme, setTheme] = useState<Theme>(() => {\n if (typeof window === 'undefined') return defaultTheme;\n return (localStorage.getItem(storageKey) as Theme) || defaultTheme;\n });\n const [colorTheme, setColorTheme] = useState<ColorTheme>(() => {\n if (typeof window === 'undefined') return defaultColorTheme;\n return (localStorage.getItem(colorThemeStorageKey) as ColorTheme) || defaultColorTheme;\n });\n const [spacingTheme, setSpacingTheme] = useState<SpacingTheme>(() => {\n if (typeof window === 'undefined') return defaultSpacingTheme;\n return (localStorage.getItem(spacingThemeStorageKey) as SpacingTheme) || defaultSpacingTheme;\n });\n\n const [resolvedTheme, setResolvedTheme] = useState<'light' | 'dark'>('light');\n\n const [customColors, setCustomColors] = useState<CustomThemeColors | undefined>(\n initialCustomColors,\n );\n\n useEffect(() => {\n const root = window.document.documentElement;\n\n const applyTheme = (t: Theme) => {\n root.classList.remove('light', 'dark');\n\n if (t === 'system') {\n const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light';\n\n root.classList.add(systemTheme);\n setResolvedTheme(systemTheme);\n return;\n }\n\n root.classList.add(t);\n setResolvedTheme(t as 'light' | 'dark');\n };\n\n applyTheme(theme);\n\n // Listen for system changes if set to system\n if (theme === 'system') {\n const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n const handleChange = () => applyTheme('system');\n\n mediaQuery.addEventListener('change', handleChange);\n return () => mediaQuery.removeEventListener('change', handleChange);\n }\n }, [theme]);\n\n useEffect(() => {\n const root = window.document.documentElement;\n\n // 既存のカラーテーマクラスを削除\n root.classList.remove('theme-blue', 'theme-green', 'theme-rose', 'theme-orange', 'theme-future');\n\n // デフォルト以外の場合はクラスを追加\n if (colorTheme !== 'default') {\n root.classList.add(`theme-${colorTheme}`);\n }\n }, [colorTheme]);\n\n // スペーシングテーマを適用\n useEffect(() => {\n const root = window.document.documentElement;\n\n // 既存のスペーシングクラスを削除\n root.classList.remove('spacing-compact', 'spacing-normal', 'spacing-comfortable');\n\n // スペーシングテーマクラスを追加\n root.classList.add(`spacing-${spacingTheme}`);\n }, [spacingTheme]);\n\n // カスタムカラーをCSS変数として適用\n useEffect(() => {\n const root = window.document.documentElement;\n\n if (customColors) {\n // CSS変数を設定\n Object.entries(customColors).forEach(([key, value]) => {\n if (value) {\n root.style.setProperty(`--${key}`, value);\n }\n });\n }\n\n // クリーンアップ: カスタムカラーが削除された場合は元に戻す\n return () => {\n if (customColors) {\n Object.keys(customColors).forEach((key) => {\n root.style.removeProperty(`--${key}`);\n });\n }\n };\n }, [customColors]);\n\n const value = {\n theme,\n resolvedTheme,\n setTheme: (theme: Theme) => {\n localStorage.setItem(storageKey, theme);\n setTheme(theme);\n },\n colorTheme,\n setColorTheme: (colorTheme: ColorTheme) => {\n localStorage.setItem(colorThemeStorageKey, colorTheme);\n setColorTheme(colorTheme);\n },\n spacingTheme,\n setSpacingTheme: (spacingTheme: SpacingTheme) => {\n localStorage.setItem(spacingThemeStorageKey, spacingTheme);\n setSpacingTheme(spacingTheme);\n },\n customColors,\n setCustomColors,\n };\n\n return (\n <ThemeProviderContext.Provider {...props} value={value}>\n {children}\n </ThemeProviderContext.Provider>\n );\n}\n"],"mappings":"A,6KA4DA,SAAgBK,EAAc,CAC5B,WACA,eAAe,SACf,oBAAoB,UACpB,sBAAsB,SACtB,aAAcC,EACd,aAAa,gBACb,uBAAuB,sBACvB,yBAAyB,wBACzB,GAAGC,GACkB,CAErB,GAAM,CAACC,EAAOC,IAAA,EAAYT,EAAAA,SAAAA,KACpB,OAAO,OAAW,IAAoBU,EAClC,aAAa,QAAQC,CAAU,GAAeD,CACvD,EACK,CAACE,EAAYC,IAAA,EAAiBb,EAAAA,SAAAA,KAC9B,OAAO,OAAW,IAAoBc,EAClC,aAAa,QAAQC,CAAoB,GAAoBD,CACtE,EACK,CAACE,EAAcC,IAAA,EAAmBjB,EAAAA,SAAAA,KAClC,OAAO,OAAW,IAAoBkB,EAClC,aAAa,QAAQC,CAAsB,GAAsBD,CAC1E,EAEK,CAACE,EAAeC,IAAA,EAAoBrB,EAAAA,SAAAA,CAA2B,OAAO,EAEtE,CAACsB,EAAcC,IAAA,EAAmBvB,EAAAA,SAAAA,CACtCM,CACF,GAEA,EAAAF,EAAA,UAAA,KAAgB,CACd,IAAMoB,EAAO,OAAO,SAAS,gBAEvBC,EAAc,GAAa,CAG/B,GAFAD,EAAK,UAAU,OAAO,QAAS,MAAM,EAEjC,IAAM,SAAU,CAClB,IAAME,EAAc,OAAO,WAAW,8BAA8B,CAAC,CAAC,QAClE,OACA,QAEJF,EAAK,UAAU,IAAIE,CAAW,EAC9BL,EAAiBK,CAAW,CAE9B,MAEAF,EAAK,UAAU,IAAI,CAAC,EACpBH,EAAiB,CAAqB,CACxC,EAKA,GAHAI,EAAWjB,CAAK,EAGZA,IAAU,SAAU,CACtB,IAAMmB,EAAa,OAAO,WAAW,8BAA8B,EAC7DC,MAAqBH,EAAW,QAAQ,EAG9C,OADAE,EAAW,iBAAiB,SAAUC,CAAY,MACrCD,EAAW,oBAAoB,SAAUC,CAAY,CACpE,CACF,EAAG,CAACpB,CAAK,CAAC,GAEV,EAAAJ,EAAA,UAAA,KAAgB,CACd,IAAMoB,EAAO,OAAO,SAAS,gBAG7BA,EAAK,UAAU,OAAO,aAAc,cAAe,aAAc,eAAgB,cAAc,EAG3FZ,IAAe,WACjBY,EAAK,UAAU,IAAI,SAASZ,GAAY,CAE5C,EAAG,CAACA,CAAU,CAAC,GAGf,EAAAR,EAAA,UAAA,KAAgB,CACd,IAAMoB,EAAO,OAAO,SAAS,gBAG7BA,EAAK,UAAU,OAAO,kBAAmB,iBAAkB,qBAAqB,EAGhFA,EAAK,UAAU,IAAI,WAAWR,GAAc,CAC9C,EAAG,CAACA,CAAY,CAAC,GAGjB,EAAAZ,EAAA,UAAA,KAAgB,CACd,IAAMoB,EAAO,OAAO,SAAS,gBAY7B,OAVIF,GAEF,OAAO,QAAQA,CAAY,CAAC,CAAC,SAAS,CAACO,EAAKC,KAAW,CACjDA,GACFN,EAAK,MAAM,YAAY,KAAKK,IAAOC,CAAK,CAE5C,CAAC,MAIU,CACPR,GACF,OAAO,KAAKA,CAAY,CAAC,CAAC,QAAS,GAAQ,CACzCE,EAAK,MAAM,eAAe,KAAKK,GAAK,CACtC,CAAC,CAEL,CACF,EAAG,CAACP,CAAY,CAAC,EAEjB,IAAMQ,EAAQ,CACZ,QACA,gBACA,SAAW,GAAiB,CAC1B,aAAa,QAAQnB,EAAYH,CAAK,EACtCC,EAASD,CAAK,CAChB,EACA,aACA,cAAgB,GAA2B,CACzC,aAAa,QAAQO,EAAsBH,CAAU,EACrDC,EAAcD,CAAU,CAC1B,EACA,eACA,gBAAkB,GAA+B,CAC/C,aAAa,QAAQO,EAAwBH,CAAY,EACzDC,EAAgBD,CAAY,CAC9B,EACA,eACA,iBACF,EAEA,OACE,EAAAb,EAAA,IAAA,CAACF,EAAAA,qBAAqB,SAAtB,CAA+B,GAAIM,EAAc,QAC9C,UAC4B,CAAA,CAEnC,C"}
|