@sero-ai/ui 0.3.0 → 0.3.2
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/dist/components/ai-elements/agent.cjs +89 -0
- package/dist/components/ai-elements/agent.d.cts +32 -0
- package/dist/components/ai-elements/agent.d.ts +32 -0
- package/dist/components/ai-elements/agent.js +89 -0
- package/dist/components/ai-elements/artifact.cjs +121 -0
- package/dist/components/ai-elements/artifact.d.cts +29 -0
- package/dist/components/ai-elements/artifact.d.ts +29 -0
- package/dist/components/ai-elements/artifact.js +121 -0
- package/dist/components/ai-elements/attachments.cjs +283 -0
- package/dist/components/ai-elements/attachments.d.cts +60 -0
- package/dist/components/ai-elements/attachments.d.ts +60 -0
- package/dist/components/ai-elements/attachments.js +283 -0
- package/dist/components/ai-elements/audio-player.cjs +174 -0
- package/dist/components/ai-elements/audio-player.d.cts +33 -0
- package/dist/components/ai-elements/audio-player.d.ts +33 -0
- package/dist/components/ai-elements/audio-player.js +174 -0
- package/dist/components/ai-elements/canvas.cjs +23 -0
- package/dist/components/ai-elements/canvas.d.cts +10 -0
- package/dist/components/ai-elements/canvas.d.ts +10 -0
- package/dist/components/ai-elements/canvas.js +23 -0
- package/dist/components/ai-elements/chain-of-thought.cjs +170 -0
- package/dist/components/ai-elements/chain-of-thought.d.cts +37 -0
- package/dist/components/ai-elements/chain-of-thought.d.ts +37 -0
- package/dist/components/ai-elements/chain-of-thought.js +170 -0
- package/dist/components/ai-elements/checkpoint.cjs +49 -0
- package/dist/components/ai-elements/checkpoint.d.cts +18 -0
- package/dist/components/ai-elements/checkpoint.d.ts +18 -0
- package/dist/components/ai-elements/checkpoint.js +49 -0
- package/dist/components/ai-elements/code-block.cjs +380 -0
- package/dist/components/ai-elements/code-block.d.cts +51 -0
- package/dist/components/ai-elements/code-block.d.ts +51 -0
- package/dist/components/ai-elements/code-block.js +380 -0
- package/dist/components/ai-elements/commit.cjs +337 -0
- package/dist/components/ai-elements/commit.d.cts +71 -0
- package/dist/components/ai-elements/commit.d.ts +71 -0
- package/dist/components/ai-elements/commit.js +337 -0
- package/dist/components/ai-elements/confirmation.cjs +82 -0
- package/dist/components/ai-elements/confirmation.d.cts +54 -0
- package/dist/components/ai-elements/confirmation.d.ts +54 -0
- package/dist/components/ai-elements/confirmation.js +82 -0
- package/dist/components/ai-elements/connection.cjs +33 -0
- package/dist/components/ai-elements/connection.d.cts +5 -0
- package/dist/components/ai-elements/connection.d.ts +5 -0
- package/dist/components/ai-elements/connection.js +33 -0
- package/dist/components/ai-elements/context.cjs +329 -0
- package/dist/components/ai-elements/context.d.cts +39 -0
- package/dist/components/ai-elements/context.d.ts +39 -0
- package/dist/components/ai-elements/context.js +329 -0
- package/dist/components/ai-elements/controls.cjs +18 -0
- package/dist/components/ai-elements/controls.d.cts +8 -0
- package/dist/components/ai-elements/controls.d.ts +8 -0
- package/dist/components/ai-elements/controls.js +18 -0
- package/dist/components/ai-elements/conversation.cjs +124 -0
- package/dist/components/ai-elements/conversation.d.cts +32 -0
- package/dist/components/ai-elements/conversation.d.ts +32 -0
- package/dist/components/ai-elements/conversation.js +124 -0
- package/dist/components/ai-elements/edge.cjs +116 -0
- package/dist/components/ai-elements/edge.d.cts +9 -0
- package/dist/components/ai-elements/edge.d.ts +9 -0
- package/dist/components/ai-elements/edge.js +116 -0
- package/dist/components/ai-elements/environment-variables.cjs +227 -0
- package/dist/components/ai-elements/environment-variables.d.cts +45 -0
- package/dist/components/ai-elements/environment-variables.d.ts +45 -0
- package/dist/components/ai-elements/environment-variables.js +227 -0
- package/dist/components/ai-elements/file-tree.cjs +217 -0
- package/dist/components/ai-elements/file-tree.d.cts +30 -0
- package/dist/components/ai-elements/file-tree.d.ts +30 -0
- package/dist/components/ai-elements/file-tree.js +217 -0
- package/dist/components/ai-elements/image.cjs +22 -0
- package/dist/components/ai-elements/image.d.cts +10 -0
- package/dist/components/ai-elements/image.d.ts +10 -0
- package/dist/components/ai-elements/image.js +22 -0
- package/dist/components/ai-elements/inline-citation.cjs +223 -0
- package/dist/components/ai-elements/inline-citation.d.cts +47 -0
- package/dist/components/ai-elements/inline-citation.d.ts +47 -0
- package/dist/components/ai-elements/inline-citation.js +223 -0
- package/dist/components/ai-elements/jsx-preview.cjs +176 -0
- package/dist/components/ai-elements/jsx-preview.d.cts +31 -0
- package/dist/components/ai-elements/jsx-preview.d.ts +31 -0
- package/dist/components/ai-elements/jsx-preview.js +176 -0
- package/dist/components/ai-elements/message.cjs +287 -0
- package/dist/components/ai-elements/message.d.cts +46 -0
- package/dist/components/ai-elements/message.d.ts +46 -0
- package/dist/components/ai-elements/message.js +287 -0
- package/dist/components/ai-elements/mic-selector.cjs +275 -0
- package/dist/components/ai-elements/mic-selector.d.cts +54 -0
- package/dist/components/ai-elements/mic-selector.d.ts +54 -0
- package/dist/components/ai-elements/mic-selector.js +275 -0
- package/dist/components/ai-elements/model-selector.cjs +100 -0
- package/dist/components/ai-elements/model-selector.d.cts +41 -0
- package/dist/components/ai-elements/model-selector.d.ts +41 -0
- package/dist/components/ai-elements/model-selector.js +100 -0
- package/dist/components/ai-elements/node.cjs +54 -0
- package/dist/components/ai-elements/node.d.cts +25 -0
- package/dist/components/ai-elements/node.d.ts +25 -0
- package/dist/components/ai-elements/node.js +54 -0
- package/dist/components/ai-elements/open-in-chat.cjs +353 -0
- package/dist/components/ai-elements/open-in-chat.d.cts +33 -0
- package/dist/components/ai-elements/open-in-chat.d.ts +33 -0
- package/dist/components/ai-elements/open-in-chat.js +353 -0
- package/dist/components/ai-elements/package-info.cjs +171 -0
- package/dist/components/ai-elements/package-info.d.cts +32 -0
- package/dist/components/ai-elements/package-info.d.ts +32 -0
- package/dist/components/ai-elements/package-info.js +171 -0
- package/dist/components/ai-elements/panel.cjs +16 -0
- package/dist/components/ai-elements/panel.d.cts +8 -0
- package/dist/components/ai-elements/panel.d.ts +8 -0
- package/dist/components/ai-elements/panel.js +16 -0
- package/dist/components/ai-elements/persona.cjs +202 -0
- package/dist/components/ai-elements/persona.d.cts +50 -0
- package/dist/components/ai-elements/persona.d.ts +50 -0
- package/dist/components/ai-elements/persona.js +202 -0
- package/dist/components/ai-elements/plan.cjs +90 -0
- package/dist/components/ai-elements/plan.d.cts +30 -0
- package/dist/components/ai-elements/plan.d.ts +30 -0
- package/dist/components/ai-elements/plan.js +90 -0
- package/dist/components/ai-elements/prompt-input-context.cjs +161 -0
- package/dist/components/ai-elements/prompt-input-context.d.cts +58 -0
- package/dist/components/ai-elements/prompt-input-context.d.ts +58 -0
- package/dist/components/ai-elements/prompt-input-context.js +161 -0
- package/dist/components/ai-elements/prompt-input-elements.cjs +246 -0
- package/dist/components/ai-elements/prompt-input-elements.d.cts +88 -0
- package/dist/components/ai-elements/prompt-input-elements.d.ts +88 -0
- package/dist/components/ai-elements/prompt-input-elements.js +246 -0
- package/dist/components/ai-elements/prompt-input-textarea.cjs +89 -0
- package/dist/components/ai-elements/prompt-input-textarea.d.cts +11 -0
- package/dist/components/ai-elements/prompt-input-textarea.d.ts +11 -0
- package/dist/components/ai-elements/prompt-input-textarea.js +89 -0
- package/dist/components/ai-elements/prompt-input.cjs +306 -0
- package/dist/components/ai-elements/prompt-input.d.cts +39 -0
- package/dist/components/ai-elements/prompt-input.d.ts +39 -0
- package/dist/components/ai-elements/prompt-input.js +306 -0
- package/dist/components/ai-elements/queue.cjs +193 -0
- package/dist/components/ai-elements/queue.d.cts +68 -0
- package/dist/components/ai-elements/queue.d.ts +68 -0
- package/dist/components/ai-elements/queue.js +193 -0
- package/dist/components/ai-elements/reasoning.cjs +178 -0
- package/dist/components/ai-elements/reasoning.d.cts +31 -0
- package/dist/components/ai-elements/reasoning.d.ts +31 -0
- package/dist/components/ai-elements/reasoning.js +178 -0
- package/dist/components/ai-elements/sandbox.cjs +114 -0
- package/dist/components/ai-elements/sandbox.d.cts +31 -0
- package/dist/components/ai-elements/sandbox.d.ts +31 -0
- package/dist/components/ai-elements/sandbox.js +114 -0
- package/dist/components/ai-elements/schema-display.cjs +330 -0
- package/dist/components/ai-elements/schema-display.d.cts +61 -0
- package/dist/components/ai-elements/schema-display.d.ts +61 -0
- package/dist/components/ai-elements/schema-display.js +330 -0
- package/dist/components/ai-elements/shimmer.cjs +55 -0
- package/dist/components/ai-elements/shimmer.d.cts +14 -0
- package/dist/components/ai-elements/shimmer.d.ts +14 -0
- package/dist/components/ai-elements/shimmer.js +55 -0
- package/dist/components/ai-elements/snippet.cjs +105 -0
- package/dist/components/ai-elements/snippet.d.cts +25 -0
- package/dist/components/ai-elements/snippet.d.ts +25 -0
- package/dist/components/ai-elements/snippet.js +105 -0
- package/dist/components/ai-elements/sources.cjs +70 -0
- package/dist/components/ai-elements/sources.d.cts +17 -0
- package/dist/components/ai-elements/sources.d.ts +17 -0
- package/dist/components/ai-elements/sources.js +70 -0
- package/dist/components/ai-elements/speech-input.cjs +207 -0
- package/dist/components/ai-elements/speech-input.d.cts +59 -0
- package/dist/components/ai-elements/speech-input.d.ts +59 -0
- package/dist/components/ai-elements/speech-input.js +207 -0
- package/dist/components/ai-elements/stack-trace.cjs +403 -0
- package/dist/components/ai-elements/stack-trace.d.cts +45 -0
- package/dist/components/ai-elements/stack-trace.d.ts +45 -0
- package/dist/components/ai-elements/stack-trace.js +403 -0
- package/dist/components/ai-elements/suggestion.cjs +46 -0
- package/dist/components/ai-elements/suggestion.d.cts +17 -0
- package/dist/components/ai-elements/suggestion.d.ts +17 -0
- package/dist/components/ai-elements/suggestion.js +46 -0
- package/dist/components/ai-elements/task.cjs +62 -0
- package/dist/components/ai-elements/task.d.cts +19 -0
- package/dist/components/ai-elements/task.d.ts +19 -0
- package/dist/components/ai-elements/task.js +62 -0
- package/dist/components/ai-elements/terminal.cjs +220 -0
- package/dist/components/ai-elements/terminal.d.cts +33 -0
- package/dist/components/ai-elements/terminal.d.ts +33 -0
- package/dist/components/ai-elements/terminal.js +220 -0
- package/dist/components/ai-elements/test-results.cjs +376 -0
- package/dist/components/ai-elements/test-results.d.cts +62 -0
- package/dist/components/ai-elements/test-results.d.ts +62 -0
- package/dist/components/ai-elements/test-results.js +376 -0
- package/dist/components/ai-elements/tool.cjs +130 -0
- package/dist/components/ai-elements/tool.d.cts +36 -0
- package/dist/components/ai-elements/tool.d.ts +36 -0
- package/dist/components/ai-elements/tool.js +130 -0
- package/dist/components/ai-elements/toolbar.cjs +17 -0
- package/dist/components/ai-elements/toolbar.d.cts +8 -0
- package/dist/components/ai-elements/toolbar.d.ts +8 -0
- package/dist/components/ai-elements/toolbar.js +17 -0
- package/dist/components/ai-elements/transcription.cjs +92 -0
- package/dist/components/ai-elements/transcription.d.cts +19 -0
- package/dist/components/ai-elements/transcription.d.ts +19 -0
- package/dist/components/ai-elements/transcription.js +92 -0
- package/dist/components/ai-elements/voice-selector-accent.cjs +11 -0
- package/dist/components/ai-elements/voice-selector-accent.d.cts +10 -0
- package/dist/components/ai-elements/voice-selector-accent.d.ts +10 -0
- package/dist/components/ai-elements/voice-selector-accent.js +11 -0
- package/dist/components/ai-elements/voice-selector.cjs +246 -0
- package/dist/components/ai-elements/voice-selector.d.cts +66 -0
- package/dist/components/ai-elements/voice-selector.d.ts +66 -0
- package/dist/components/ai-elements/voice-selector.js +246 -0
- package/dist/components/ai-elements/web-preview.cjs +237 -0
- package/dist/components/ai-elements/web-preview.d.cts +40 -0
- package/dist/components/ai-elements/web-preview.d.ts +40 -0
- package/dist/components/ai-elements/web-preview.js +237 -0
- package/dist/components/model-selection/available-model-picker.cjs +172 -0
- package/dist/components/model-selection/available-model-picker.d.cts +18 -0
- package/dist/components/model-selection/available-model-picker.d.ts +18 -0
- package/dist/components/model-selection/available-model-picker.js +172 -0
- package/dist/components/model-selection/model-warning-list.cjs +24 -0
- package/dist/components/model-selection/model-warning-list.d.cts +10 -0
- package/dist/components/model-selection/model-warning-list.d.ts +10 -0
- package/dist/components/model-selection/model-warning-list.js +24 -0
- package/dist/components/model-selection/thinking-level-picker.cjs +39 -0
- package/dist/components/model-selection/thinking-level-picker.d.cts +14 -0
- package/dist/components/model-selection/thinking-level-picker.d.ts +14 -0
- package/dist/components/model-selection/thinking-level-picker.js +39 -0
- package/dist/components/ui/accordion.cjs +64 -0
- package/dist/components/ui/accordion.d.cts +10 -0
- package/dist/components/ui/accordion.d.ts +10 -0
- package/dist/components/ui/accordion.js +64 -0
- package/dist/components/ui/alert-dialog.cjs +178 -0
- package/dist/components/ui/alert-dialog.d.cts +23 -0
- package/dist/components/ui/alert-dialog.d.ts +23 -0
- package/dist/components/ui/alert-dialog.js +178 -0
- package/dist/components/ui/alert.cjs +66 -0
- package/dist/components/ui/alert.d.cts +13 -0
- package/dist/components/ui/alert.d.ts +13 -0
- package/dist/components/ui/alert.js +66 -0
- package/dist/components/ui/aspect-ratio.cjs +11 -0
- package/dist/components/ui/aspect-ratio.d.cts +6 -0
- package/dist/components/ui/aspect-ratio.d.ts +6 -0
- package/dist/components/ui/aspect-ratio.js +11 -0
- package/dist/components/ui/avatar.cjs +103 -0
- package/dist/components/ui/avatar.d.cts +14 -0
- package/dist/components/ui/avatar.d.ts +14 -0
- package/dist/components/ui/avatar.js +103 -0
- package/dist/components/ui/badge.cjs +43 -0
- package/dist/components/ui/badge.d.cts +13 -0
- package/dist/components/ui/badge.d.ts +13 -0
- package/dist/components/ui/badge.js +43 -0
- package/dist/components/ui/breadcrumb.cjs +103 -0
- package/dist/components/ui/breadcrumb.d.cts +14 -0
- package/dist/components/ui/breadcrumb.d.ts +14 -0
- package/dist/components/ui/breadcrumb.js +103 -0
- package/dist/components/ui/button-group.cjs +76 -0
- package/dist/components/ui/button-group.d.cts +17 -0
- package/dist/components/ui/button-group.d.ts +17 -0
- package/dist/components/ui/button-group.js +76 -0
- package/dist/components/ui/button.cjs +56 -0
- package/dist/components/ui/button.d.cts +14 -0
- package/dist/components/ui/button.d.ts +14 -0
- package/dist/components/ui/button.js +56 -0
- package/dist/components/ui/calendar.cjs +194 -0
- package/dist/components/ui/calendar.d.cts +13 -0
- package/dist/components/ui/calendar.d.ts +13 -0
- package/dist/components/ui/calendar.js +194 -0
- package/dist/components/ui/card.cjs +90 -0
- package/dist/components/ui/card.d.cts +12 -0
- package/dist/components/ui/card.d.ts +12 -0
- package/dist/components/ui/card.js +90 -0
- package/dist/components/ui/carousel.cjs +198 -0
- package/dist/components/ui/carousel.d.cts +24 -0
- package/dist/components/ui/carousel.d.ts +24 -0
- package/dist/components/ui/carousel.js +198 -0
- package/dist/components/ui/chart.cjs +242 -0
- package/dist/components/ui/chart.d.cts +43 -0
- package/dist/components/ui/chart.d.ts +43 -0
- package/dist/components/ui/chart.js +242 -0
- package/dist/components/ui/checkbox.cjs +32 -0
- package/dist/components/ui/checkbox.d.cts +7 -0
- package/dist/components/ui/checkbox.d.ts +7 -0
- package/dist/components/ui/checkbox.js +32 -0
- package/dist/components/ui/collapsible.cjs +34 -0
- package/dist/components/ui/collapsible.d.cts +8 -0
- package/dist/components/ui/collapsible.d.ts +8 -0
- package/dist/components/ui/collapsible.js +34 -0
- package/dist/components/ui/combobox.cjs +297 -0
- package/dist/components/ui/combobox.d.cts +27 -0
- package/dist/components/ui/combobox.d.ts +27 -0
- package/dist/components/ui/combobox.js +297 -0
- package/dist/components/ui/command.cjs +177 -0
- package/dist/components/ui/command.d.cts +22 -0
- package/dist/components/ui/command.d.ts +22 -0
- package/dist/components/ui/command.js +177 -0
- package/dist/components/ui/context-menu.cjs +224 -0
- package/dist/components/ui/context-menu.d.cts +28 -0
- package/dist/components/ui/context-menu.d.ts +28 -0
- package/dist/components/ui/context-menu.js +224 -0
- package/dist/components/ui/dialog.cjs +147 -0
- package/dist/components/ui/dialog.d.cts +20 -0
- package/dist/components/ui/dialog.d.ts +20 -0
- package/dist/components/ui/dialog.js +147 -0
- package/dist/components/ui/direction.cjs +15 -0
- package/dist/components/ui/direction.d.cts +10 -0
- package/dist/components/ui/direction.d.ts +10 -0
- package/dist/components/ui/direction.js +15 -0
- package/dist/components/ui/drawer.cjs +128 -0
- package/dist/components/ui/drawer.d.cts +16 -0
- package/dist/components/ui/drawer.d.ts +16 -0
- package/dist/components/ui/drawer.js +128 -0
- package/dist/components/ui/dropdown-menu.cjs +232 -0
- package/dist/components/ui/dropdown-menu.d.cts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.js +232 -0
- package/dist/components/ui/empty.cjs +102 -0
- package/dist/components/ui/empty.d.cts +15 -0
- package/dist/components/ui/empty.d.ts +15 -0
- package/dist/components/ui/empty.js +102 -0
- package/dist/components/ui/field.cjs +230 -0
- package/dist/components/ui/field.d.cts +30 -0
- package/dist/components/ui/field.d.ts +30 -0
- package/dist/components/ui/field.js +230 -0
- package/dist/components/ui/form.cjs +121 -0
- package/dist/components/ui/form.d.cts +27 -0
- package/dist/components/ui/form.d.ts +27 -0
- package/dist/components/ui/form.js +121 -0
- package/dist/components/ui/hover-card.cjs +38 -0
- package/dist/components/ui/hover-card.d.cts +9 -0
- package/dist/components/ui/hover-card.d.ts +9 -0
- package/dist/components/ui/hover-card.js +38 -0
- package/dist/components/ui/input-group.cjs +154 -0
- package/dist/components/ui/input-group.d.cts +20 -0
- package/dist/components/ui/input-group.d.ts +20 -0
- package/dist/components/ui/input-group.js +154 -0
- package/dist/components/ui/input-otp.cjs +67 -0
- package/dist/components/ui/input-otp.d.cts +14 -0
- package/dist/components/ui/input-otp.d.ts +14 -0
- package/dist/components/ui/input-otp.js +67 -0
- package/dist/components/ui/input.cjs +23 -0
- package/dist/components/ui/input.d.cts +6 -0
- package/dist/components/ui/input.d.ts +6 -0
- package/dist/components/ui/input.js +23 -0
- package/dist/components/ui/item.cjs +187 -0
- package/dist/components/ui/item.d.cts +28 -0
- package/dist/components/ui/item.d.ts +28 -0
- package/dist/components/ui/item.js +187 -0
- package/dist/components/ui/kbd.cjs +31 -0
- package/dist/components/ui/kbd.d.cts +6 -0
- package/dist/components/ui/kbd.d.ts +6 -0
- package/dist/components/ui/kbd.js +31 -0
- package/dist/components/ui/label.cjs +22 -0
- package/dist/components/ui/label.d.cts +7 -0
- package/dist/components/ui/label.d.ts +7 -0
- package/dist/components/ui/label.js +22 -0
- package/dist/components/ui/menubar.cjs +252 -0
- package/dist/components/ui/menubar.d.cts +29 -0
- package/dist/components/ui/menubar.d.ts +29 -0
- package/dist/components/ui/menubar.js +252 -0
- package/dist/components/ui/native-select.cjs +63 -0
- package/dist/components/ui/native-select.d.cts +10 -0
- package/dist/components/ui/native-select.d.ts +10 -0
- package/dist/components/ui/native-select.js +63 -0
- package/dist/components/ui/navigation-menu.cjs +170 -0
- package/dist/components/ui/navigation-menu.d.cts +18 -0
- package/dist/components/ui/navigation-menu.d.ts +18 -0
- package/dist/components/ui/navigation-menu.js +170 -0
- package/dist/components/ui/pagination.cjs +122 -0
- package/dist/components/ui/pagination.d.cts +18 -0
- package/dist/components/ui/pagination.d.ts +18 -0
- package/dist/components/ui/pagination.js +122 -0
- package/dist/components/ui/plugin-safety-disclaimer.cjs +26 -0
- package/dist/components/ui/plugin-safety-disclaimer.d.cts +8 -0
- package/dist/components/ui/plugin-safety-disclaimer.d.ts +8 -0
- package/dist/components/ui/plugin-safety-disclaimer.js +26 -0
- package/dist/components/ui/popover.cjs +80 -0
- package/dist/components/ui/popover.d.cts +13 -0
- package/dist/components/ui/popover.d.ts +13 -0
- package/dist/components/ui/popover.js +80 -0
- package/dist/components/ui/progress.cjs +32 -0
- package/dist/components/ui/progress.d.cts +7 -0
- package/dist/components/ui/progress.d.ts +7 -0
- package/dist/components/ui/progress.js +32 -0
- package/dist/components/ui/radio-group.cjs +45 -0
- package/dist/components/ui/radio-group.d.cts +8 -0
- package/dist/components/ui/radio-group.d.ts +8 -0
- package/dist/components/ui/radio-group.js +45 -0
- package/dist/components/ui/resizable.cjs +47 -0
- package/dist/components/ui/resizable.d.cts +10 -0
- package/dist/components/ui/resizable.d.ts +10 -0
- package/dist/components/ui/resizable.js +47 -0
- package/dist/components/ui/scroll-area.cjs +60 -0
- package/dist/components/ui/scroll-area.d.cts +8 -0
- package/dist/components/ui/scroll-area.d.ts +8 -0
- package/dist/components/ui/scroll-area.js +60 -0
- package/dist/components/ui/search-input.cjs +39 -0
- package/dist/components/ui/search-input.d.cts +12 -0
- package/dist/components/ui/search-input.d.ts +12 -0
- package/dist/components/ui/search-input.js +39 -0
- package/dist/components/ui/select.cjs +179 -0
- package/dist/components/ui/select.d.cts +18 -0
- package/dist/components/ui/select.d.ts +18 -0
- package/dist/components/ui/select.js +179 -0
- package/dist/components/ui/separator.cjs +27 -0
- package/dist/components/ui/separator.d.cts +7 -0
- package/dist/components/ui/separator.d.ts +7 -0
- package/dist/components/ui/separator.js +27 -0
- package/dist/components/ui/sheet.cjs +129 -0
- package/dist/components/ui/sheet.d.cts +18 -0
- package/dist/components/ui/sheet.d.ts +18 -0
- package/dist/components/ui/sheet.js +129 -0
- package/dist/components/ui/sidebar.cjs +649 -0
- package/dist/components/ui/sidebar.d.cts +74 -0
- package/dist/components/ui/sidebar.d.ts +74 -0
- package/dist/components/ui/sidebar.js +649 -0
- package/dist/components/ui/skeleton.cjs +15 -0
- package/dist/components/ui/skeleton.d.cts +5 -0
- package/dist/components/ui/skeleton.d.ts +5 -0
- package/dist/components/ui/skeleton.js +15 -0
- package/dist/components/ui/slider.cjs +68 -0
- package/dist/components/ui/slider.d.cts +7 -0
- package/dist/components/ui/slider.d.ts +7 -0
- package/dist/components/ui/slider.js +68 -0
- package/dist/components/ui/sonner.cjs +38 -0
- package/dist/components/ui/sonner.d.cts +6 -0
- package/dist/components/ui/sonner.d.ts +6 -0
- package/dist/components/ui/sonner.js +38 -0
- package/dist/components/ui/spinner.cjs +17 -0
- package/dist/components/ui/spinner.d.cts +5 -0
- package/dist/components/ui/spinner.d.ts +5 -0
- package/dist/components/ui/spinner.js +17 -0
- package/dist/components/ui/switch.cjs +33 -0
- package/dist/components/ui/switch.d.cts +9 -0
- package/dist/components/ui/switch.d.ts +9 -0
- package/dist/components/ui/switch.js +33 -0
- package/dist/components/ui/table.cjs +115 -0
- package/dist/components/ui/table.d.cts +13 -0
- package/dist/components/ui/table.d.ts +13 -0
- package/dist/components/ui/table.js +115 -0
- package/dist/components/ui/tabs.cjs +92 -0
- package/dist/components/ui/tabs.d.cts +15 -0
- package/dist/components/ui/tabs.d.ts +15 -0
- package/dist/components/ui/tabs.js +92 -0
- package/dist/components/ui/textarea.cjs +20 -0
- package/dist/components/ui/textarea.d.cts +6 -0
- package/dist/components/ui/textarea.d.ts +6 -0
- package/dist/components/ui/textarea.js +20 -0
- package/dist/components/ui/toggle-group.cjs +69 -0
- package/dist/components/ui/toggle-group.d.cts +13 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.js +69 -0
- package/dist/components/ui/toggle.cjs +44 -0
- package/dist/components/ui/toggle.d.cts +13 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.js +44 -0
- package/dist/components/ui/tooltip.cjs +56 -0
- package/dist/components/ui/tooltip.d.cts +10 -0
- package/dist/components/ui/tooltip.d.ts +10 -0
- package/dist/components/ui/tooltip.js +56 -0
- package/dist/components/ui/tree.cjs +131 -0
- package/dist/components/ui/tree.d.cts +35 -0
- package/dist/components/ui/tree.d.ts +35 -0
- package/dist/components/ui/tree.js +131 -0
- package/dist/hooks/use-mobile.cjs +16 -0
- package/dist/hooks/use-mobile.d.cts +3 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/index.cjs +121 -15527
- package/dist/index.d.cts +145 -2246
- package/dist/index.d.ts +145 -2246
- package/dist/index.js +118 -14982
- package/dist/lib/utils.cjs +8 -0
- package/dist/lib/utils.d.cts +5 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +8 -0
- package/dist/styles/globals.css +438 -0
- package/dist/styles/plugin.css +4 -0
- package/dist/theme/apply-theme.cjs +221 -0
- package/dist/theme/apply-theme.d.cts +13 -0
- package/dist/theme/apply-theme.d.ts +13 -0
- package/dist/theme/apply-theme.js +221 -0
- package/dist/theme/index.cjs +2 -0
- package/dist/theme/index.d.cts +2 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/types.cjs +90 -0
- package/dist/theme/types.d.cts +133 -0
- package/dist/theme/types.d.ts +133 -0
- package/dist/theme/types.js +90 -0
- package/package.json +22 -5
- package/tsup.config.ts +18 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }const COLOR_TOKEN_TO_CSS = {
|
|
2
|
+
bgBase: "--bg-base",
|
|
3
|
+
bgSurface: "--bg-surface",
|
|
4
|
+
bgElevated: "--bg-elevated",
|
|
5
|
+
bgOverlay: "--bg-overlay",
|
|
6
|
+
bgMuted: "--bg-muted",
|
|
7
|
+
borderSubtle: "--border-subtle",
|
|
8
|
+
borderDefault: "--border-default",
|
|
9
|
+
borderFocus: "--border-focus",
|
|
10
|
+
textPrimary: "--text-primary",
|
|
11
|
+
textSecondary: "--text-secondary",
|
|
12
|
+
textMuted: "--text-muted",
|
|
13
|
+
textInverse: "--text-inverse",
|
|
14
|
+
brandPrimary: "--brand-primary",
|
|
15
|
+
brandPrimaryHover: "--brand-primary-hover",
|
|
16
|
+
brandPrimaryForeground: "--brand-primary-foreground",
|
|
17
|
+
brandSecondary: "--brand-secondary",
|
|
18
|
+
brandSecondaryHover: "--brand-secondary-hover",
|
|
19
|
+
brandSecondaryForeground: "--brand-secondary-foreground",
|
|
20
|
+
accentPrimary: "--accent-primary",
|
|
21
|
+
accentHover: "--accent-hover",
|
|
22
|
+
accentMuted: "--accent-muted",
|
|
23
|
+
accentCode: "--accent-code",
|
|
24
|
+
statusSuccess: "--status-success",
|
|
25
|
+
statusWarning: "--status-warning",
|
|
26
|
+
statusError: "--status-error",
|
|
27
|
+
statusInfo: "--status-info",
|
|
28
|
+
collabPrimary: "--collab-primary",
|
|
29
|
+
voiceRecording: "--voice-recording",
|
|
30
|
+
voiceProcessing: "--voice-processing",
|
|
31
|
+
bannerPrimary: "--banner-primary"
|
|
32
|
+
};
|
|
33
|
+
const DERIVED_OPACITY_VARS = [
|
|
34
|
+
["--brand-primary-muted", "brandPrimary", 10],
|
|
35
|
+
["--brand-primary-subtle", "brandPrimary", 15],
|
|
36
|
+
["--brand-primary-faint", "brandPrimary", 3],
|
|
37
|
+
["--brand-primary-border", "brandPrimary", 20],
|
|
38
|
+
["--brand-secondary-muted", "brandSecondary", 10],
|
|
39
|
+
["--brand-secondary-subtle", "brandSecondary", 15],
|
|
40
|
+
["--brand-secondary-faint", "brandSecondary", 3],
|
|
41
|
+
["--brand-secondary-border", "brandSecondary", 20],
|
|
42
|
+
["--status-success-muted", "statusSuccess", 10],
|
|
43
|
+
["--status-success-subtle", "statusSuccess", 15],
|
|
44
|
+
["--status-success-faint", "statusSuccess", 3],
|
|
45
|
+
["--status-success-border", "statusSuccess", 20],
|
|
46
|
+
["--status-warning-muted", "statusWarning", 10],
|
|
47
|
+
["--status-warning-subtle", "statusWarning", 15],
|
|
48
|
+
["--status-warning-faint", "statusWarning", 3],
|
|
49
|
+
["--status-warning-border", "statusWarning", 20],
|
|
50
|
+
["--status-error-muted", "statusError", 10],
|
|
51
|
+
["--status-error-subtle", "statusError", 15],
|
|
52
|
+
["--status-error-faint", "statusError", 3],
|
|
53
|
+
["--status-error-border", "statusError", 20],
|
|
54
|
+
["--status-info-muted", "statusInfo", 10],
|
|
55
|
+
["--status-info-subtle", "statusInfo", 15],
|
|
56
|
+
["--status-info-faint", "statusInfo", 3],
|
|
57
|
+
["--status-info-border", "statusInfo", 20],
|
|
58
|
+
["--collab-primary-muted", "collabPrimary", 10],
|
|
59
|
+
["--collab-primary-subtle", "collabPrimary", 15],
|
|
60
|
+
["--collab-primary-border", "collabPrimary", 20],
|
|
61
|
+
["--voice-recording-muted", "voiceRecording", 20],
|
|
62
|
+
["--voice-processing-muted", "voiceProcessing", 15],
|
|
63
|
+
["--banner-primary-muted", "bannerPrimary", 10],
|
|
64
|
+
["--banner-primary-subtle", "bannerPrimary", 15],
|
|
65
|
+
["--banner-primary-border", "bannerPrimary", 20]
|
|
66
|
+
];
|
|
67
|
+
function tint(color, percentage) {
|
|
68
|
+
return `color-mix(in srgb, ${color} ${percentage}%, transparent)`;
|
|
69
|
+
}
|
|
70
|
+
function applyThemePreset(preset, mode, options = {}) {
|
|
71
|
+
const root = document.documentElement;
|
|
72
|
+
const colors = mode === "dark" ? preset.colors.dark : preset.colors.light;
|
|
73
|
+
for (const [key, cssVar] of Object.entries(COLOR_TOKEN_TO_CSS)) {
|
|
74
|
+
const value = colors[key];
|
|
75
|
+
if (value) root.style.setProperty(cssVar, value);
|
|
76
|
+
}
|
|
77
|
+
for (const [cssVar, baseKey, percentage] of DERIVED_OPACITY_VARS) {
|
|
78
|
+
const baseColor = colors[baseKey];
|
|
79
|
+
if (baseColor) root.style.setProperty(cssVar, tint(baseColor, percentage));
|
|
80
|
+
}
|
|
81
|
+
if (_optionalChain([preset, 'access', _ => _.typography, 'optionalAccess', _2 => _2.fontSans])) {
|
|
82
|
+
_optionalChain([options, 'access', _3 => _3.loadFont, 'optionalCall', _4 => _4(preset.typography.fontSans)]);
|
|
83
|
+
root.style.setProperty("--font-sans", preset.typography.fontSans);
|
|
84
|
+
}
|
|
85
|
+
if (_optionalChain([preset, 'access', _5 => _5.typography, 'optionalAccess', _6 => _6.fontMono])) {
|
|
86
|
+
_optionalChain([options, 'access', _7 => _7.loadFont, 'optionalCall', _8 => _8(preset.typography.fontMono)]);
|
|
87
|
+
root.style.setProperty("--font-mono", preset.typography.fontMono);
|
|
88
|
+
}
|
|
89
|
+
if (_optionalChain([preset, 'access', _9 => _9.typography, 'optionalAccess', _10 => _10.fontSizeBase])) {
|
|
90
|
+
root.style.setProperty("--font-size-base", preset.typography.fontSizeBase);
|
|
91
|
+
}
|
|
92
|
+
if (_optionalChain([preset, 'access', _11 => _11.spacing, 'optionalAccess', _12 => _12.md])) {
|
|
93
|
+
const mdPx = parseFloat(preset.spacing.md);
|
|
94
|
+
if (Number.isFinite(mdPx) && mdPx > 0) {
|
|
95
|
+
root.style.setProperty("--spacing", `${(mdPx / 3).toFixed(3)}px`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (_optionalChain([preset, 'access', _13 => _13.radius, 'optionalAccess', _14 => _14.md])) {
|
|
99
|
+
root.style.setProperty("--radius", preset.radius.md);
|
|
100
|
+
}
|
|
101
|
+
root.classList.toggle("dark", mode === "dark");
|
|
102
|
+
}
|
|
103
|
+
const ALL_MANAGED_VARS = [
|
|
104
|
+
...Object.values(COLOR_TOKEN_TO_CSS),
|
|
105
|
+
...DERIVED_OPACITY_VARS.map(([v]) => v),
|
|
106
|
+
"--font-sans",
|
|
107
|
+
"--font-mono",
|
|
108
|
+
"--font-size-base",
|
|
109
|
+
"--spacing",
|
|
110
|
+
"--radius"
|
|
111
|
+
];
|
|
112
|
+
function resetTheme() {
|
|
113
|
+
const root = document.documentElement;
|
|
114
|
+
for (const cssVar of ALL_MANAGED_VARS) {
|
|
115
|
+
root.style.removeProperty(cssVar);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const LEGACY_REQUIRED_COLOR_KEYS = [
|
|
119
|
+
"bgBase",
|
|
120
|
+
"bgSurface",
|
|
121
|
+
"bgElevated",
|
|
122
|
+
"bgOverlay",
|
|
123
|
+
"bgMuted",
|
|
124
|
+
"borderSubtle",
|
|
125
|
+
"borderDefault",
|
|
126
|
+
"borderFocus",
|
|
127
|
+
"textPrimary",
|
|
128
|
+
"textSecondary",
|
|
129
|
+
"textMuted",
|
|
130
|
+
"textInverse",
|
|
131
|
+
"accentPrimary",
|
|
132
|
+
"accentHover",
|
|
133
|
+
"accentMuted",
|
|
134
|
+
"accentCode",
|
|
135
|
+
"statusSuccess",
|
|
136
|
+
"statusWarning",
|
|
137
|
+
"statusError",
|
|
138
|
+
"statusInfo",
|
|
139
|
+
"collabPrimary",
|
|
140
|
+
"voiceRecording",
|
|
141
|
+
"voiceProcessing",
|
|
142
|
+
"bannerPrimary"
|
|
143
|
+
];
|
|
144
|
+
function isColorValue(v) {
|
|
145
|
+
if (typeof v !== "string") return false;
|
|
146
|
+
return /^(#[0-9a-fA-F]{3,8}|rgba?\(|oklch\(|hsla?\(|color-mix\()/.test(v.trim());
|
|
147
|
+
}
|
|
148
|
+
function optionalColor(o, key) {
|
|
149
|
+
const value = o[key];
|
|
150
|
+
return isColorValue(value) ? value : void 0;
|
|
151
|
+
}
|
|
152
|
+
function normaliseColorTokens(obj) {
|
|
153
|
+
if (!obj || typeof obj !== "object") return null;
|
|
154
|
+
const o = obj;
|
|
155
|
+
if (!LEGACY_REQUIRED_COLOR_KEYS.every((k) => isColorValue(o[k]))) return null;
|
|
156
|
+
const legacy = o;
|
|
157
|
+
return {
|
|
158
|
+
...legacy,
|
|
159
|
+
brandPrimary: _nullishCoalesce(optionalColor(o, "brandPrimary"), () => ( legacy.statusSuccess)),
|
|
160
|
+
brandPrimaryHover: _nullishCoalesce(optionalColor(o, "brandPrimaryHover"), () => ( legacy.statusSuccess)),
|
|
161
|
+
brandPrimaryForeground: _nullishCoalesce(optionalColor(o, "brandPrimaryForeground"), () => ( legacy.textInverse)),
|
|
162
|
+
brandSecondary: _nullishCoalesce(optionalColor(o, "brandSecondary"), () => ( legacy.accentCode)),
|
|
163
|
+
brandSecondaryHover: _nullishCoalesce(optionalColor(o, "brandSecondaryHover"), () => ( legacy.accentHover)),
|
|
164
|
+
brandSecondaryForeground: _nullishCoalesce(optionalColor(o, "brandSecondaryForeground"), () => ( legacy.textInverse))
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function sanitiseTypography(raw) {
|
|
168
|
+
if (!raw || typeof raw !== "object") return void 0;
|
|
169
|
+
const o = raw;
|
|
170
|
+
const result = {};
|
|
171
|
+
for (const key of ["fontSans", "fontMono", "fontSizeBase"]) {
|
|
172
|
+
if (typeof o[key] === "string") result[key] = o[key];
|
|
173
|
+
}
|
|
174
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
175
|
+
}
|
|
176
|
+
function sanitiseSpacing(raw) {
|
|
177
|
+
if (!raw || typeof raw !== "object") return void 0;
|
|
178
|
+
const o = raw;
|
|
179
|
+
const result = {};
|
|
180
|
+
for (const key of ["xs", "sm", "md", "lg", "xl"]) {
|
|
181
|
+
if (typeof o[key] === "string") result[key] = o[key];
|
|
182
|
+
}
|
|
183
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
184
|
+
}
|
|
185
|
+
function sanitiseRadius(raw) {
|
|
186
|
+
if (!raw || typeof raw !== "object") return void 0;
|
|
187
|
+
const o = raw;
|
|
188
|
+
const result = {};
|
|
189
|
+
for (const key of ["sm", "md", "lg"]) {
|
|
190
|
+
if (typeof o[key] === "string") result[key] = o[key];
|
|
191
|
+
}
|
|
192
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
193
|
+
}
|
|
194
|
+
function validateThemePreset(data) {
|
|
195
|
+
if (!data || typeof data !== "object") return null;
|
|
196
|
+
const d = data;
|
|
197
|
+
if (typeof d.id !== "string" || !d.id) return null;
|
|
198
|
+
if (typeof d.name !== "string" || !d.name) return null;
|
|
199
|
+
if (d.version !== 1) return null;
|
|
200
|
+
const colors = d.colors;
|
|
201
|
+
const light = normaliseColorTokens(_optionalChain([colors, 'optionalAccess', _15 => _15.light]));
|
|
202
|
+
const dark = normaliseColorTokens(_optionalChain([colors, 'optionalAccess', _16 => _16.dark]));
|
|
203
|
+
if (!light || !dark) return null;
|
|
204
|
+
return {
|
|
205
|
+
id: d.id,
|
|
206
|
+
name: d.name,
|
|
207
|
+
description: typeof d.description === "string" ? d.description : void 0,
|
|
208
|
+
author: typeof d.author === "string" ? d.author : void 0,
|
|
209
|
+
version: 1,
|
|
210
|
+
builtin: d.builtin === true,
|
|
211
|
+
colors: { light, dark },
|
|
212
|
+
typography: sanitiseTypography(d.typography),
|
|
213
|
+
spacing: sanitiseSpacing(d.spacing),
|
|
214
|
+
radius: sanitiseRadius(d.radius)
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
exports.applyThemePreset = applyThemePreset; exports.resetTheme = resetTheme; exports.validateThemePreset = validateThemePreset;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ThemePreset } from './types.cjs';
|
|
2
|
+
|
|
3
|
+
interface ApplyThemeOptions {
|
|
4
|
+
loadFont?: (fontStack: string) => void;
|
|
5
|
+
}
|
|
6
|
+
/** Apply a theme preset for the given mode. */
|
|
7
|
+
declare function applyThemePreset(preset: ThemePreset, mode: 'light' | 'dark', options?: ApplyThemeOptions): void;
|
|
8
|
+
/** Remove all inline theme overrides, reverting to CSS defaults. */
|
|
9
|
+
declare function resetTheme(): void;
|
|
10
|
+
/** Validate and normalise an unknown value into a ThemePreset. */
|
|
11
|
+
declare function validateThemePreset(data: unknown): ThemePreset | null;
|
|
12
|
+
|
|
13
|
+
export { type ApplyThemeOptions, applyThemePreset, resetTheme, validateThemePreset };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ThemePreset } from './types.js';
|
|
2
|
+
|
|
3
|
+
interface ApplyThemeOptions {
|
|
4
|
+
loadFont?: (fontStack: string) => void;
|
|
5
|
+
}
|
|
6
|
+
/** Apply a theme preset for the given mode. */
|
|
7
|
+
declare function applyThemePreset(preset: ThemePreset, mode: 'light' | 'dark', options?: ApplyThemeOptions): void;
|
|
8
|
+
/** Remove all inline theme overrides, reverting to CSS defaults. */
|
|
9
|
+
declare function resetTheme(): void;
|
|
10
|
+
/** Validate and normalise an unknown value into a ThemePreset. */
|
|
11
|
+
declare function validateThemePreset(data: unknown): ThemePreset | null;
|
|
12
|
+
|
|
13
|
+
export { type ApplyThemeOptions, applyThemePreset, resetTheme, validateThemePreset };
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
const COLOR_TOKEN_TO_CSS = {
|
|
2
|
+
bgBase: "--bg-base",
|
|
3
|
+
bgSurface: "--bg-surface",
|
|
4
|
+
bgElevated: "--bg-elevated",
|
|
5
|
+
bgOverlay: "--bg-overlay",
|
|
6
|
+
bgMuted: "--bg-muted",
|
|
7
|
+
borderSubtle: "--border-subtle",
|
|
8
|
+
borderDefault: "--border-default",
|
|
9
|
+
borderFocus: "--border-focus",
|
|
10
|
+
textPrimary: "--text-primary",
|
|
11
|
+
textSecondary: "--text-secondary",
|
|
12
|
+
textMuted: "--text-muted",
|
|
13
|
+
textInverse: "--text-inverse",
|
|
14
|
+
brandPrimary: "--brand-primary",
|
|
15
|
+
brandPrimaryHover: "--brand-primary-hover",
|
|
16
|
+
brandPrimaryForeground: "--brand-primary-foreground",
|
|
17
|
+
brandSecondary: "--brand-secondary",
|
|
18
|
+
brandSecondaryHover: "--brand-secondary-hover",
|
|
19
|
+
brandSecondaryForeground: "--brand-secondary-foreground",
|
|
20
|
+
accentPrimary: "--accent-primary",
|
|
21
|
+
accentHover: "--accent-hover",
|
|
22
|
+
accentMuted: "--accent-muted",
|
|
23
|
+
accentCode: "--accent-code",
|
|
24
|
+
statusSuccess: "--status-success",
|
|
25
|
+
statusWarning: "--status-warning",
|
|
26
|
+
statusError: "--status-error",
|
|
27
|
+
statusInfo: "--status-info",
|
|
28
|
+
collabPrimary: "--collab-primary",
|
|
29
|
+
voiceRecording: "--voice-recording",
|
|
30
|
+
voiceProcessing: "--voice-processing",
|
|
31
|
+
bannerPrimary: "--banner-primary"
|
|
32
|
+
};
|
|
33
|
+
const DERIVED_OPACITY_VARS = [
|
|
34
|
+
["--brand-primary-muted", "brandPrimary", 10],
|
|
35
|
+
["--brand-primary-subtle", "brandPrimary", 15],
|
|
36
|
+
["--brand-primary-faint", "brandPrimary", 3],
|
|
37
|
+
["--brand-primary-border", "brandPrimary", 20],
|
|
38
|
+
["--brand-secondary-muted", "brandSecondary", 10],
|
|
39
|
+
["--brand-secondary-subtle", "brandSecondary", 15],
|
|
40
|
+
["--brand-secondary-faint", "brandSecondary", 3],
|
|
41
|
+
["--brand-secondary-border", "brandSecondary", 20],
|
|
42
|
+
["--status-success-muted", "statusSuccess", 10],
|
|
43
|
+
["--status-success-subtle", "statusSuccess", 15],
|
|
44
|
+
["--status-success-faint", "statusSuccess", 3],
|
|
45
|
+
["--status-success-border", "statusSuccess", 20],
|
|
46
|
+
["--status-warning-muted", "statusWarning", 10],
|
|
47
|
+
["--status-warning-subtle", "statusWarning", 15],
|
|
48
|
+
["--status-warning-faint", "statusWarning", 3],
|
|
49
|
+
["--status-warning-border", "statusWarning", 20],
|
|
50
|
+
["--status-error-muted", "statusError", 10],
|
|
51
|
+
["--status-error-subtle", "statusError", 15],
|
|
52
|
+
["--status-error-faint", "statusError", 3],
|
|
53
|
+
["--status-error-border", "statusError", 20],
|
|
54
|
+
["--status-info-muted", "statusInfo", 10],
|
|
55
|
+
["--status-info-subtle", "statusInfo", 15],
|
|
56
|
+
["--status-info-faint", "statusInfo", 3],
|
|
57
|
+
["--status-info-border", "statusInfo", 20],
|
|
58
|
+
["--collab-primary-muted", "collabPrimary", 10],
|
|
59
|
+
["--collab-primary-subtle", "collabPrimary", 15],
|
|
60
|
+
["--collab-primary-border", "collabPrimary", 20],
|
|
61
|
+
["--voice-recording-muted", "voiceRecording", 20],
|
|
62
|
+
["--voice-processing-muted", "voiceProcessing", 15],
|
|
63
|
+
["--banner-primary-muted", "bannerPrimary", 10],
|
|
64
|
+
["--banner-primary-subtle", "bannerPrimary", 15],
|
|
65
|
+
["--banner-primary-border", "bannerPrimary", 20]
|
|
66
|
+
];
|
|
67
|
+
function tint(color, percentage) {
|
|
68
|
+
return `color-mix(in srgb, ${color} ${percentage}%, transparent)`;
|
|
69
|
+
}
|
|
70
|
+
function applyThemePreset(preset, mode, options = {}) {
|
|
71
|
+
const root = document.documentElement;
|
|
72
|
+
const colors = mode === "dark" ? preset.colors.dark : preset.colors.light;
|
|
73
|
+
for (const [key, cssVar] of Object.entries(COLOR_TOKEN_TO_CSS)) {
|
|
74
|
+
const value = colors[key];
|
|
75
|
+
if (value) root.style.setProperty(cssVar, value);
|
|
76
|
+
}
|
|
77
|
+
for (const [cssVar, baseKey, percentage] of DERIVED_OPACITY_VARS) {
|
|
78
|
+
const baseColor = colors[baseKey];
|
|
79
|
+
if (baseColor) root.style.setProperty(cssVar, tint(baseColor, percentage));
|
|
80
|
+
}
|
|
81
|
+
if (preset.typography?.fontSans) {
|
|
82
|
+
options.loadFont?.(preset.typography.fontSans);
|
|
83
|
+
root.style.setProperty("--font-sans", preset.typography.fontSans);
|
|
84
|
+
}
|
|
85
|
+
if (preset.typography?.fontMono) {
|
|
86
|
+
options.loadFont?.(preset.typography.fontMono);
|
|
87
|
+
root.style.setProperty("--font-mono", preset.typography.fontMono);
|
|
88
|
+
}
|
|
89
|
+
if (preset.typography?.fontSizeBase) {
|
|
90
|
+
root.style.setProperty("--font-size-base", preset.typography.fontSizeBase);
|
|
91
|
+
}
|
|
92
|
+
if (preset.spacing?.md) {
|
|
93
|
+
const mdPx = parseFloat(preset.spacing.md);
|
|
94
|
+
if (Number.isFinite(mdPx) && mdPx > 0) {
|
|
95
|
+
root.style.setProperty("--spacing", `${(mdPx / 3).toFixed(3)}px`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (preset.radius?.md) {
|
|
99
|
+
root.style.setProperty("--radius", preset.radius.md);
|
|
100
|
+
}
|
|
101
|
+
root.classList.toggle("dark", mode === "dark");
|
|
102
|
+
}
|
|
103
|
+
const ALL_MANAGED_VARS = [
|
|
104
|
+
...Object.values(COLOR_TOKEN_TO_CSS),
|
|
105
|
+
...DERIVED_OPACITY_VARS.map(([v]) => v),
|
|
106
|
+
"--font-sans",
|
|
107
|
+
"--font-mono",
|
|
108
|
+
"--font-size-base",
|
|
109
|
+
"--spacing",
|
|
110
|
+
"--radius"
|
|
111
|
+
];
|
|
112
|
+
function resetTheme() {
|
|
113
|
+
const root = document.documentElement;
|
|
114
|
+
for (const cssVar of ALL_MANAGED_VARS) {
|
|
115
|
+
root.style.removeProperty(cssVar);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const LEGACY_REQUIRED_COLOR_KEYS = [
|
|
119
|
+
"bgBase",
|
|
120
|
+
"bgSurface",
|
|
121
|
+
"bgElevated",
|
|
122
|
+
"bgOverlay",
|
|
123
|
+
"bgMuted",
|
|
124
|
+
"borderSubtle",
|
|
125
|
+
"borderDefault",
|
|
126
|
+
"borderFocus",
|
|
127
|
+
"textPrimary",
|
|
128
|
+
"textSecondary",
|
|
129
|
+
"textMuted",
|
|
130
|
+
"textInverse",
|
|
131
|
+
"accentPrimary",
|
|
132
|
+
"accentHover",
|
|
133
|
+
"accentMuted",
|
|
134
|
+
"accentCode",
|
|
135
|
+
"statusSuccess",
|
|
136
|
+
"statusWarning",
|
|
137
|
+
"statusError",
|
|
138
|
+
"statusInfo",
|
|
139
|
+
"collabPrimary",
|
|
140
|
+
"voiceRecording",
|
|
141
|
+
"voiceProcessing",
|
|
142
|
+
"bannerPrimary"
|
|
143
|
+
];
|
|
144
|
+
function isColorValue(v) {
|
|
145
|
+
if (typeof v !== "string") return false;
|
|
146
|
+
return /^(#[0-9a-fA-F]{3,8}|rgba?\(|oklch\(|hsla?\(|color-mix\()/.test(v.trim());
|
|
147
|
+
}
|
|
148
|
+
function optionalColor(o, key) {
|
|
149
|
+
const value = o[key];
|
|
150
|
+
return isColorValue(value) ? value : void 0;
|
|
151
|
+
}
|
|
152
|
+
function normaliseColorTokens(obj) {
|
|
153
|
+
if (!obj || typeof obj !== "object") return null;
|
|
154
|
+
const o = obj;
|
|
155
|
+
if (!LEGACY_REQUIRED_COLOR_KEYS.every((k) => isColorValue(o[k]))) return null;
|
|
156
|
+
const legacy = o;
|
|
157
|
+
return {
|
|
158
|
+
...legacy,
|
|
159
|
+
brandPrimary: optionalColor(o, "brandPrimary") ?? legacy.statusSuccess,
|
|
160
|
+
brandPrimaryHover: optionalColor(o, "brandPrimaryHover") ?? legacy.statusSuccess,
|
|
161
|
+
brandPrimaryForeground: optionalColor(o, "brandPrimaryForeground") ?? legacy.textInverse,
|
|
162
|
+
brandSecondary: optionalColor(o, "brandSecondary") ?? legacy.accentCode,
|
|
163
|
+
brandSecondaryHover: optionalColor(o, "brandSecondaryHover") ?? legacy.accentHover,
|
|
164
|
+
brandSecondaryForeground: optionalColor(o, "brandSecondaryForeground") ?? legacy.textInverse
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function sanitiseTypography(raw) {
|
|
168
|
+
if (!raw || typeof raw !== "object") return void 0;
|
|
169
|
+
const o = raw;
|
|
170
|
+
const result = {};
|
|
171
|
+
for (const key of ["fontSans", "fontMono", "fontSizeBase"]) {
|
|
172
|
+
if (typeof o[key] === "string") result[key] = o[key];
|
|
173
|
+
}
|
|
174
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
175
|
+
}
|
|
176
|
+
function sanitiseSpacing(raw) {
|
|
177
|
+
if (!raw || typeof raw !== "object") return void 0;
|
|
178
|
+
const o = raw;
|
|
179
|
+
const result = {};
|
|
180
|
+
for (const key of ["xs", "sm", "md", "lg", "xl"]) {
|
|
181
|
+
if (typeof o[key] === "string") result[key] = o[key];
|
|
182
|
+
}
|
|
183
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
184
|
+
}
|
|
185
|
+
function sanitiseRadius(raw) {
|
|
186
|
+
if (!raw || typeof raw !== "object") return void 0;
|
|
187
|
+
const o = raw;
|
|
188
|
+
const result = {};
|
|
189
|
+
for (const key of ["sm", "md", "lg"]) {
|
|
190
|
+
if (typeof o[key] === "string") result[key] = o[key];
|
|
191
|
+
}
|
|
192
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
193
|
+
}
|
|
194
|
+
function validateThemePreset(data) {
|
|
195
|
+
if (!data || typeof data !== "object") return null;
|
|
196
|
+
const d = data;
|
|
197
|
+
if (typeof d.id !== "string" || !d.id) return null;
|
|
198
|
+
if (typeof d.name !== "string" || !d.name) return null;
|
|
199
|
+
if (d.version !== 1) return null;
|
|
200
|
+
const colors = d.colors;
|
|
201
|
+
const light = normaliseColorTokens(colors?.light);
|
|
202
|
+
const dark = normaliseColorTokens(colors?.dark);
|
|
203
|
+
if (!light || !dark) return null;
|
|
204
|
+
return {
|
|
205
|
+
id: d.id,
|
|
206
|
+
name: d.name,
|
|
207
|
+
description: typeof d.description === "string" ? d.description : void 0,
|
|
208
|
+
author: typeof d.author === "string" ? d.author : void 0,
|
|
209
|
+
version: 1,
|
|
210
|
+
builtin: d.builtin === true,
|
|
211
|
+
colors: { light, dark },
|
|
212
|
+
typography: sanitiseTypography(d.typography),
|
|
213
|
+
spacing: sanitiseSpacing(d.spacing),
|
|
214
|
+
radius: sanitiseRadius(d.radius)
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
export {
|
|
218
|
+
applyThemePreset,
|
|
219
|
+
resetTheme,
|
|
220
|
+
validateThemePreset
|
|
221
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _types = require('./types'); _createStarExport(_types);
|
|
2
|
+
var _applytheme = require('./apply-theme'); _createStarExport(_applytheme);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ColorTokens, DEFAULT_DARK_COLORS, DEFAULT_LIGHT_COLORS, DEFAULT_RADIUS, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_TYPOGRAPHY, RadiusTokens, SpacingTokens, TerminalColorTokens, ThemeMode, ThemePreset, ThemePresetMeta, TypographyTokens } from './types.cjs';
|
|
2
|
+
export { ApplyThemeOptions, applyThemePreset, resetTheme, validateThemePreset } from './apply-theme.cjs';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ColorTokens, DEFAULT_DARK_COLORS, DEFAULT_LIGHT_COLORS, DEFAULT_RADIUS, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_TYPOGRAPHY, RadiusTokens, SpacingTokens, TerminalColorTokens, ThemeMode, ThemePreset, ThemePresetMeta, TypographyTokens } from './types.js';
|
|
2
|
+
export { ApplyThemeOptions, applyThemePreset, resetTheme, validateThemePreset } from './apply-theme.js';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});const DEFAULT_THEME_ID = "default";
|
|
2
|
+
const DEFAULT_LIGHT_COLORS = {
|
|
3
|
+
bgBase: "#ffffff",
|
|
4
|
+
bgSurface: "#f4f5f7",
|
|
5
|
+
bgElevated: "#eaecf0",
|
|
6
|
+
bgOverlay: "#dde0e6",
|
|
7
|
+
bgMuted: "#c8ccd4",
|
|
8
|
+
borderSubtle: "#d4d8e0",
|
|
9
|
+
borderDefault: "#bcc1cc",
|
|
10
|
+
borderFocus: "#059669",
|
|
11
|
+
textPrimary: "#0f1117",
|
|
12
|
+
textSecondary: "#3b4252",
|
|
13
|
+
textMuted: "#6b7280",
|
|
14
|
+
textInverse: "#fafafa",
|
|
15
|
+
brandPrimary: "#059669",
|
|
16
|
+
brandPrimaryHover: "#047857",
|
|
17
|
+
brandPrimaryForeground: "#ffffff",
|
|
18
|
+
brandSecondary: "#7c3aed",
|
|
19
|
+
brandSecondaryHover: "#6d28d9",
|
|
20
|
+
brandSecondaryForeground: "#ffffff",
|
|
21
|
+
accentPrimary: "#7c3aed",
|
|
22
|
+
accentHover: "#6d28d9",
|
|
23
|
+
accentMuted: "#7c3aed1a",
|
|
24
|
+
accentCode: "#7c3aed",
|
|
25
|
+
statusSuccess: "#16a34a",
|
|
26
|
+
statusWarning: "#d97706",
|
|
27
|
+
statusError: "#dc2626",
|
|
28
|
+
statusInfo: "#2563eb",
|
|
29
|
+
collabPrimary: "#7c3aed",
|
|
30
|
+
voiceRecording: "#f43f5e",
|
|
31
|
+
voiceProcessing: "#06b6d4",
|
|
32
|
+
bannerPrimary: "#7c3aed"
|
|
33
|
+
};
|
|
34
|
+
const DEFAULT_TYPOGRAPHY = {
|
|
35
|
+
fontSans: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
|
|
36
|
+
fontMono: "'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace",
|
|
37
|
+
fontSizeBase: "14px"
|
|
38
|
+
};
|
|
39
|
+
const DEFAULT_SPACING = {
|
|
40
|
+
xs: "4px",
|
|
41
|
+
sm: "8px",
|
|
42
|
+
md: "12px",
|
|
43
|
+
lg: "16px",
|
|
44
|
+
xl: "32px"
|
|
45
|
+
};
|
|
46
|
+
const DEFAULT_RADIUS = {
|
|
47
|
+
sm: "4px",
|
|
48
|
+
md: "8px",
|
|
49
|
+
lg: "12px"
|
|
50
|
+
};
|
|
51
|
+
const DEFAULT_DARK_COLORS = {
|
|
52
|
+
bgBase: "#0a0a0b",
|
|
53
|
+
bgSurface: "#111113",
|
|
54
|
+
bgElevated: "#18181b",
|
|
55
|
+
bgOverlay: "#1f1f23",
|
|
56
|
+
bgMuted: "#27272a",
|
|
57
|
+
borderSubtle: "#27272a",
|
|
58
|
+
borderDefault: "#3f3f46",
|
|
59
|
+
borderFocus: "#34d399",
|
|
60
|
+
textPrimary: "#fafafa",
|
|
61
|
+
textSecondary: "#a1a1aa",
|
|
62
|
+
textMuted: "#71717a",
|
|
63
|
+
textInverse: "#09090b",
|
|
64
|
+
brandPrimary: "#34d399",
|
|
65
|
+
brandPrimaryHover: "#6ee7b7",
|
|
66
|
+
brandPrimaryForeground: "#052e1c",
|
|
67
|
+
brandSecondary: "#c4b5fd",
|
|
68
|
+
brandSecondaryHover: "#ddd6fe",
|
|
69
|
+
brandSecondaryForeground: "#1e1038",
|
|
70
|
+
accentPrimary: "#c4b5fd",
|
|
71
|
+
accentHover: "#ddd6fe",
|
|
72
|
+
accentMuted: "#c4b5fd33",
|
|
73
|
+
accentCode: "#c4b5fd",
|
|
74
|
+
statusSuccess: "#22c55e",
|
|
75
|
+
statusWarning: "#f59e0b",
|
|
76
|
+
statusError: "#ef4444",
|
|
77
|
+
statusInfo: "#3b82f6",
|
|
78
|
+
collabPrimary: "#a78bfa",
|
|
79
|
+
voiceRecording: "#fb7185",
|
|
80
|
+
voiceProcessing: "#22d3ee",
|
|
81
|
+
bannerPrimary: "#c4b5fd"
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
exports.DEFAULT_DARK_COLORS = DEFAULT_DARK_COLORS; exports.DEFAULT_LIGHT_COLORS = DEFAULT_LIGHT_COLORS; exports.DEFAULT_RADIUS = DEFAULT_RADIUS; exports.DEFAULT_SPACING = DEFAULT_SPACING; exports.DEFAULT_THEME_ID = DEFAULT_THEME_ID; exports.DEFAULT_TYPOGRAPHY = DEFAULT_TYPOGRAPHY;
|