@adea-ai/ui 0.60.4 → 0.61.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/README.md +108 -34
- package/dist/components/composites/account-menu/account-menu.d.ts +48 -0
- package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -0
- package/dist/components/composites/account-menu/account-menu.js +119 -0
- package/dist/components/composites/account-menu/account-menu.js.map +1 -0
- package/dist/components/composites/account-menu/index.d.ts +2 -0
- package/dist/components/composites/account-menu/index.d.ts.map +1 -0
- package/dist/components/composites/list-row/index.d.ts +2 -0
- package/dist/components/composites/list-row/index.d.ts.map +1 -0
- package/dist/components/composites/list-row/list-row.d.ts +44 -0
- package/dist/components/composites/list-row/list-row.d.ts.map +1 -0
- package/dist/components/composites/list-row/list-row.js +124 -0
- package/dist/components/composites/list-row/list-row.js.map +1 -0
- package/dist/components/composites/settings/index.d.ts +2 -0
- package/dist/components/composites/settings/index.d.ts.map +1 -0
- package/dist/components/composites/settings/settings.d.ts +49 -0
- package/dist/components/composites/settings/settings.d.ts.map +1 -0
- package/dist/components/composites/settings/settings.js +148 -0
- package/dist/components/composites/settings/settings.js.map +1 -0
- package/dist/components/composites/stat/index.d.ts +2 -0
- package/dist/components/composites/stat/index.d.ts.map +1 -0
- package/dist/components/composites/stat/stat.d.ts +48 -0
- package/dist/components/composites/stat/stat.d.ts.map +1 -0
- package/dist/components/composites/stat/stat.js +148 -0
- package/dist/components/composites/stat/stat.js.map +1 -0
- package/dist/components/composites/update-dialog/index.d.ts +2 -0
- package/dist/components/composites/update-dialog/index.d.ts.map +1 -0
- package/dist/components/composites/update-dialog/update-dialog.d.ts +108 -0
- package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -0
- package/dist/components/composites/update-dialog/update-dialog.js +452 -0
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -0
- package/dist/components/composites/workspace-mark/index.d.ts +2 -0
- package/dist/components/composites/workspace-mark/index.d.ts.map +1 -0
- package/dist/components/composites/workspace-mark/workspace-mark.d.ts +24 -0
- package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -0
- package/dist/components/composites/workspace-mark/workspace-mark.js +76 -0
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -0
- package/dist/components/conversation/conversation-avatar.d.ts +21 -0
- package/dist/components/conversation/conversation-avatar.d.ts.map +1 -0
- package/dist/components/conversation/conversation-avatar.js +52 -0
- package/dist/components/conversation/conversation-avatar.js.map +1 -0
- package/dist/components/conversation/conversation-surface.d.ts +27 -0
- package/dist/components/conversation/conversation-surface.d.ts.map +1 -0
- package/dist/components/conversation/conversation-surface.js +118 -0
- package/dist/components/conversation/conversation-surface.js.map +1 -0
- package/dist/components/conversation/index.d.ts +6 -0
- package/dist/components/conversation/index.d.ts.map +1 -0
- package/dist/components/conversation/message-composer.d.ts +70 -0
- package/dist/components/conversation/message-composer.d.ts.map +1 -0
- package/dist/components/conversation/message-composer.js +235 -0
- package/dist/components/conversation/message-composer.js.map +1 -0
- package/dist/components/conversation/message-row.d.ts +101 -0
- package/dist/components/conversation/message-row.d.ts.map +1 -0
- package/dist/components/conversation/message-row.js +389 -0
- package/dist/components/conversation/message-row.js.map +1 -0
- package/dist/components/conversation/thread-panel.d.ts +45 -0
- package/dist/components/conversation/thread-panel.d.ts.map +1 -0
- package/dist/components/conversation/thread-panel.js +123 -0
- package/dist/components/conversation/thread-panel.js.map +1 -0
- package/dist/components/layout/app-shell/app-shell.d.ts +45 -0
- package/dist/components/layout/app-shell/app-shell.d.ts.map +1 -0
- package/dist/components/layout/app-shell/app-shell.js +89 -0
- package/dist/components/layout/app-shell/app-shell.js.map +1 -0
- package/dist/components/layout/app-shell/index.d.ts +2 -0
- package/dist/components/layout/app-shell/index.d.ts.map +1 -0
- package/dist/components/layout/page/index.d.ts +2 -0
- package/dist/components/layout/page/index.d.ts.map +1 -0
- package/dist/components/layout/page/page.d.ts +31 -0
- package/dist/components/layout/page/page.d.ts.map +1 -0
- package/dist/components/layout/page/page.js +143 -0
- package/dist/components/layout/page/page.js.map +1 -0
- package/dist/components/layout/panel/index.d.ts +2 -0
- package/dist/components/layout/panel/index.d.ts.map +1 -0
- package/dist/components/layout/panel/panel.d.ts +44 -0
- package/dist/components/layout/panel/panel.d.ts.map +1 -0
- package/dist/components/layout/panel/panel.js +151 -0
- package/dist/components/layout/panel/panel.js.map +1 -0
- package/dist/components/layout/side-rail/index.d.ts +3 -0
- package/dist/components/layout/side-rail/index.d.ts.map +1 -0
- package/dist/components/layout/side-rail/side-rail-context.d.ts +23 -0
- package/dist/components/layout/side-rail/side-rail-context.d.ts.map +1 -0
- package/dist/components/layout/side-rail/side-rail-context.js +18 -0
- package/dist/components/layout/side-rail/side-rail-context.js.map +1 -0
- package/dist/components/layout/side-rail/side-rail.d.ts +101 -0
- package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -0
- package/dist/components/layout/side-rail/side-rail.js +336 -0
- package/dist/components/layout/side-rail/side-rail.js.map +1 -0
- package/dist/components/layout/sidebar-nav/index.d.ts +2 -0
- package/dist/components/layout/sidebar-nav/index.d.ts.map +1 -0
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts +62 -0
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -0
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +231 -0
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -0
- package/dist/components/layout/status-bar/index.d.ts +2 -0
- package/dist/components/layout/status-bar/index.d.ts.map +1 -0
- package/dist/components/layout/status-bar/status-bar.d.ts +23 -0
- package/dist/components/layout/status-bar/status-bar.d.ts.map +1 -0
- package/dist/components/layout/status-bar/status-bar.js +68 -0
- package/dist/components/layout/status-bar/status-bar.js.map +1 -0
- package/dist/components/layout/top-bar/index.d.ts +2 -0
- package/dist/components/layout/top-bar/index.d.ts.map +1 -0
- package/dist/components/layout/top-bar/top-bar.d.ts +59 -0
- package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -0
- package/dist/components/layout/top-bar/top-bar.js +118 -0
- package/dist/components/layout/top-bar/top-bar.js.map +1 -0
- package/dist/components/motion/index.d.ts +3 -0
- package/dist/components/motion/index.d.ts.map +1 -0
- package/dist/components/motion/index.js +3 -0
- package/dist/components/motion/presence.d.ts +29 -0
- package/dist/components/motion/presence.d.ts.map +1 -0
- package/dist/components/motion/presence.js +10 -0
- package/dist/components/motion/presence.js.map +1 -0
- package/dist/components/theme/appearance-panel.d.ts +25 -0
- package/dist/components/theme/appearance-panel.d.ts.map +1 -0
- package/dist/components/theme/appearance-panel.js +162 -0
- package/dist/components/theme/appearance-panel.js.map +1 -0
- package/dist/components/theme/index.d.ts +5 -0
- package/dist/components/theme/index.d.ts.map +1 -0
- package/dist/components/theme/theme-picker.d.ts +54 -0
- package/dist/components/theme/theme-picker.d.ts.map +1 -0
- package/dist/components/theme/theme-picker.js +156 -0
- package/dist/components/theme/theme-picker.js.map +1 -0
- package/dist/components/theme/theme-provider.d.ts +130 -0
- package/dist/components/theme/theme-provider.d.ts.map +1 -0
- package/dist/components/theme/theme-provider.js +164 -0
- package/dist/components/theme/theme-provider.js.map +1 -0
- package/dist/components/theme/theme-toggle.d.ts +19 -0
- package/dist/components/theme/theme-toggle.d.ts.map +1 -0
- package/dist/components/theme/theme-toggle.js +69 -0
- package/dist/components/theme/theme-toggle.js.map +1 -0
- package/dist/components/ui/accordion/accordion.d.ts +18 -0
- package/dist/components/ui/accordion/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion/accordion.js +60 -0
- package/dist/components/ui/accordion/accordion.js.map +1 -0
- package/dist/components/ui/accordion/index.d.ts +2 -0
- package/dist/components/ui/accordion/index.d.ts.map +1 -0
- package/dist/components/ui/alert/alert.d.ts +26 -0
- package/dist/components/ui/alert/alert.d.ts.map +1 -0
- package/dist/components/ui/alert/alert.js +89 -0
- package/dist/components/ui/alert/alert.js.map +1 -0
- package/dist/components/ui/alert/index.d.ts +2 -0
- package/dist/components/ui/alert/index.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts +29 -0
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog/alert-dialog.js +155 -0
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert-dialog/index.d.ts +2 -0
- package/dist/components/ui/alert-dialog/index.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio/aspect-ratio.d.ts +22 -0
- package/dist/components/ui/aspect-ratio/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio/aspect-ratio.js +29 -0
- package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -0
- package/dist/components/ui/aspect-ratio/index.d.ts +2 -0
- package/dist/components/ui/aspect-ratio/index.d.ts.map +1 -0
- package/dist/components/ui/avatar/avatar.d.ts +41 -0
- package/dist/components/ui/avatar/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar/avatar.js +106 -0
- package/dist/components/ui/avatar/avatar.js.map +1 -0
- package/dist/components/ui/avatar/index.d.ts +2 -0
- package/dist/components/ui/avatar/index.d.ts.map +1 -0
- package/dist/components/ui/badge/badge.d.ts +22 -0
- package/dist/components/ui/badge/badge.d.ts.map +1 -0
- package/dist/components/ui/badge/badge.js +58 -0
- package/dist/components/ui/badge/badge.js.map +1 -0
- package/dist/components/ui/badge/index.d.ts +2 -0
- package/dist/components/ui/badge/index.d.ts.map +1 -0
- package/dist/components/ui/board/board.d.ts +78 -0
- package/dist/components/ui/board/board.d.ts.map +1 -0
- package/dist/components/ui/board/board.js +200 -0
- package/dist/components/ui/board/board.js.map +1 -0
- package/dist/components/ui/board/index.d.ts +2 -0
- package/dist/components/ui/board/index.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts +24 -0
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb/breadcrumb.js +109 -0
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/ui/breadcrumb/index.d.ts +2 -0
- package/dist/components/ui/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/ui/button/button.d.ts +30 -0
- package/dist/components/ui/button/button.d.ts.map +1 -0
- package/dist/components/ui/button/button.js +80 -0
- package/dist/components/ui/button/button.js.map +1 -0
- package/dist/components/ui/button/index.d.ts +2 -0
- package/dist/components/ui/button/index.d.ts.map +1 -0
- package/dist/components/ui/button-group/button-group.d.ts +39 -0
- package/dist/components/ui/button-group/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group/button-group.js +63 -0
- package/dist/components/ui/button-group/button-group.js.map +1 -0
- package/dist/components/ui/button-group/index.d.ts +2 -0
- package/dist/components/ui/button-group/index.d.ts.map +1 -0
- package/dist/components/ui/calendar/calendar.d.ts +93 -0
- package/dist/components/ui/calendar/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar/calendar.js +243 -0
- package/dist/components/ui/calendar/calendar.js.map +1 -0
- package/dist/components/ui/calendar/index.d.ts +2 -0
- package/dist/components/ui/calendar/index.d.ts.map +1 -0
- package/dist/components/ui/card/card.d.ts +23 -0
- package/dist/components/ui/card/card.d.ts.map +1 -0
- package/dist/components/ui/card/card.js +98 -0
- package/dist/components/ui/card/card.js.map +1 -0
- package/dist/components/ui/card/index.d.ts +2 -0
- package/dist/components/ui/card/index.d.ts.map +1 -0
- package/dist/components/ui/carousel/carousel.d.ts +66 -0
- package/dist/components/ui/carousel/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel/carousel.js +178 -0
- package/dist/components/ui/carousel/carousel.js.map +1 -0
- package/dist/components/ui/carousel/index.d.ts +2 -0
- package/dist/components/ui/carousel/index.d.ts.map +1 -0
- package/dist/components/ui/chart/chart.d.ts +154 -0
- package/dist/components/ui/chart/chart.d.ts.map +1 -0
- package/dist/components/ui/chart/chart.js +373 -0
- package/dist/components/ui/chart/chart.js.map +1 -0
- package/dist/components/ui/chart/index.d.ts +2 -0
- package/dist/components/ui/chart/index.d.ts.map +1 -0
- package/dist/components/ui/checkbox/checkbox.d.ts +33 -0
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox/checkbox.js +76 -0
- package/dist/components/ui/checkbox/checkbox.js.map +1 -0
- package/dist/components/ui/checkbox/index.d.ts +2 -0
- package/dist/components/ui/checkbox/index.d.ts.map +1 -0
- package/dist/components/ui/code-block/code-block.d.ts +75 -0
- package/dist/components/ui/code-block/code-block.d.ts.map +1 -0
- package/dist/components/ui/code-block/code-block.js +186 -0
- package/dist/components/ui/code-block/code-block.js.map +1 -0
- package/dist/components/ui/code-block/index.d.ts +2 -0
- package/dist/components/ui/code-block/index.d.ts.map +1 -0
- package/dist/components/ui/collapsible/collapsible.d.ts +17 -0
- package/dist/components/ui/collapsible/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible/collapsible.js +38 -0
- package/dist/components/ui/collapsible/collapsible.js.map +1 -0
- package/dist/components/ui/collapsible/index.d.ts +2 -0
- package/dist/components/ui/collapsible/index.d.ts.map +1 -0
- package/dist/components/ui/combobox/combobox.d.ts +28 -0
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox/combobox.js +102 -0
- package/dist/components/ui/combobox/combobox.js.map +1 -0
- package/dist/components/ui/combobox/index.d.ts +2 -0
- package/dist/components/ui/combobox/index.d.ts.map +1 -0
- package/dist/components/ui/command/command.d.ts +53 -0
- package/dist/components/ui/command/command.d.ts.map +1 -0
- package/dist/components/ui/command/command.js +137 -0
- package/dist/components/ui/command/command.js.map +1 -0
- package/dist/components/ui/command/index.d.ts +2 -0
- package/dist/components/ui/command/index.d.ts.map +1 -0
- package/dist/components/ui/context-menu/context-menu.d.ts +32 -0
- package/dist/components/ui/context-menu/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu/context-menu.js +119 -0
- package/dist/components/ui/context-menu/context-menu.js.map +1 -0
- package/dist/components/ui/context-menu/index.d.ts +2 -0
- package/dist/components/ui/context-menu/index.d.ts.map +1 -0
- package/dist/components/ui/detail-panel/detail-panel.d.ts +61 -0
- package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -0
- package/dist/components/ui/detail-panel/detail-panel.js +132 -0
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -0
- package/dist/components/ui/detail-panel/index.d.ts +2 -0
- package/dist/components/ui/detail-panel/index.d.ts.map +1 -0
- package/dist/components/ui/dialog/dialog.d.ts +40 -0
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog/dialog.js +125 -0
- package/dist/components/ui/dialog/dialog.js.map +1 -0
- package/dist/components/ui/dialog/index.d.ts +2 -0
- package/dist/components/ui/dialog/index.d.ts.map +1 -0
- package/dist/components/ui/diff-block/diff-block.d.ts +95 -0
- package/dist/components/ui/diff-block/diff-block.d.ts.map +1 -0
- package/dist/components/ui/diff-block/diff-block.js +230 -0
- package/dist/components/ui/diff-block/diff-block.js.map +1 -0
- package/dist/components/ui/diff-block/diff-block.test.d.ts +2 -0
- package/dist/components/ui/diff-block/diff-block.test.d.ts.map +1 -0
- package/dist/components/ui/diff-block/index.d.ts +2 -0
- package/dist/components/ui/diff-block/index.d.ts.map +1 -0
- package/dist/components/ui/drawer/drawer.d.ts +39 -0
- package/dist/components/ui/drawer/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer/drawer.js +106 -0
- package/dist/components/ui/drawer/drawer.js.map +1 -0
- package/dist/components/ui/drawer/index.d.ts +2 -0
- package/dist/components/ui/drawer/index.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +48 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +151 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +2 -0
- package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -0
- package/dist/components/ui/empty/empty.d.ts +27 -0
- package/dist/components/ui/empty/empty.d.ts.map +1 -0
- package/dist/components/ui/{empty.js → empty/empty.js} +28 -23
- package/dist/components/ui/empty/empty.js.map +1 -0
- package/dist/components/ui/empty/index.d.ts +2 -0
- package/dist/components/ui/empty/index.d.ts.map +1 -0
- package/dist/components/ui/entity-icon/entity-icon.d.ts +59 -0
- package/dist/components/ui/entity-icon/entity-icon.d.ts.map +1 -0
- package/dist/components/ui/entity-icon/entity-icon.js +145 -0
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -0
- package/dist/components/ui/entity-icon/index.d.ts +2 -0
- package/dist/components/ui/entity-icon/index.d.ts.map +1 -0
- package/dist/components/ui/field/field.d.ts +39 -0
- package/dist/components/ui/field/field.d.ts.map +1 -0
- package/dist/components/ui/field/field.js +111 -0
- package/dist/components/ui/field/field.js.map +1 -0
- package/dist/components/ui/field/index.d.ts +2 -0
- package/dist/components/ui/field/index.d.ts.map +1 -0
- package/dist/components/ui/hover-card/hover-card.d.ts +17 -0
- package/dist/components/ui/hover-card/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card/hover-card.js +40 -0
- package/dist/components/ui/hover-card/hover-card.js.map +1 -0
- package/dist/components/ui/hover-card/index.d.ts +2 -0
- package/dist/components/ui/hover-card/index.d.ts.map +1 -0
- package/dist/components/ui/input/index.d.ts +2 -0
- package/dist/components/ui/input/index.d.ts.map +1 -0
- package/dist/components/ui/input/input.d.ts +15 -0
- package/dist/components/ui/input/input.d.ts.map +1 -0
- package/dist/components/ui/input/input.js +36 -0
- package/dist/components/ui/input/input.js.map +1 -0
- package/dist/components/ui/input-group/index.d.ts +2 -0
- package/dist/components/ui/input-group/index.d.ts.map +1 -0
- package/dist/components/ui/input-group/input-group.d.ts +34 -0
- package/dist/components/ui/input-group/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group/input-group.js +93 -0
- package/dist/components/ui/input-group/input-group.js.map +1 -0
- package/dist/components/ui/input-otp/index.d.ts +2 -0
- package/dist/components/ui/input-otp/index.d.ts.map +1 -0
- package/dist/components/ui/input-otp/input-otp.d.ts +37 -0
- package/dist/components/ui/input-otp/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp/input-otp.js +92 -0
- package/dist/components/ui/input-otp/input-otp.js.map +1 -0
- package/dist/components/ui/item/index.d.ts +2 -0
- package/dist/components/ui/item/index.d.ts.map +1 -0
- package/dist/components/ui/item/item.d.ts +49 -0
- package/dist/components/ui/item/item.d.ts.map +1 -0
- package/dist/components/ui/item/item.js +163 -0
- package/dist/components/ui/item/item.js.map +1 -0
- package/dist/components/ui/kbd/index.d.ts +2 -0
- package/dist/components/ui/kbd/index.d.ts.map +1 -0
- package/dist/components/ui/kbd/kbd.d.ts +14 -0
- package/dist/components/ui/kbd/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd/kbd.js +40 -0
- package/dist/components/ui/kbd/kbd.js.map +1 -0
- package/dist/components/ui/label/index.d.ts +2 -0
- package/dist/components/ui/label/index.d.ts.map +1 -0
- package/dist/components/ui/label/label.d.ts +17 -0
- package/dist/components/ui/label/label.d.ts.map +1 -0
- package/dist/components/ui/label/label.js +33 -0
- package/dist/components/ui/label/label.js.map +1 -0
- package/dist/components/ui/menubar/index.d.ts +2 -0
- package/dist/components/ui/menubar/index.d.ts.map +1 -0
- package/dist/components/ui/menubar/menubar.d.ts +38 -0
- package/dist/components/ui/menubar/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar/menubar.js +138 -0
- package/dist/components/ui/menubar/menubar.js.map +1 -0
- package/dist/components/ui/modal-dialog/index.d.ts +2 -0
- package/dist/components/ui/modal-dialog/index.d.ts.map +1 -0
- package/dist/components/ui/modal-dialog/modal-dialog.d.ts +35 -0
- package/dist/components/ui/modal-dialog/modal-dialog.d.ts.map +1 -0
- package/dist/components/ui/modal-dialog/modal-dialog.js +78 -0
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -0
- package/dist/components/ui/navigation-menu/index.d.ts +2 -0
- package/dist/components/ui/navigation-menu/index.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts +77 -0
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu/navigation-menu.js +116 -0
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -0
- package/dist/components/ui/pagination/index.d.ts +2 -0
- package/dist/components/ui/pagination/index.d.ts.map +1 -0
- package/dist/components/ui/pagination/pagination.d.ts +33 -0
- package/dist/components/ui/pagination/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination/pagination.js +92 -0
- package/dist/components/ui/pagination/pagination.js.map +1 -0
- package/dist/components/ui/popover/index.d.ts +2 -0
- package/dist/components/ui/popover/index.d.ts.map +1 -0
- package/dist/components/ui/popover/popover.d.ts +26 -0
- package/dist/components/ui/popover/popover.d.ts.map +1 -0
- package/dist/components/ui/popover/popover.js +66 -0
- package/dist/components/ui/popover/popover.js.map +1 -0
- package/dist/components/ui/progress/index.d.ts +2 -0
- package/dist/components/ui/progress/index.d.ts.map +1 -0
- package/dist/components/ui/progress/progress.d.ts +29 -0
- package/dist/components/ui/progress/progress.d.ts.map +1 -0
- package/dist/components/ui/progress/progress.js +53 -0
- package/dist/components/ui/progress/progress.js.map +1 -0
- package/dist/components/ui/radio-group/index.d.ts +2 -0
- package/dist/components/ui/radio-group/index.d.ts.map +1 -0
- package/dist/components/ui/radio-group/radio-group.d.ts +26 -0
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group/radio-group.js +77 -0
- package/dist/components/ui/radio-group/radio-group.js.map +1 -0
- package/dist/components/ui/resizable/index.d.ts +2 -0
- package/dist/components/ui/resizable/index.d.ts.map +1 -0
- package/dist/components/ui/resizable/resizable.d.ts +33 -0
- package/dist/components/ui/resizable/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable/resizable.js +57 -0
- package/dist/components/ui/resizable/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area/index.d.ts +2 -0
- package/dist/components/ui/scroll-area/index.d.ts.map +1 -0
- package/dist/components/ui/scroll-area/scroll-area.d.ts +26 -0
- package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area/scroll-area.js +36 -0
- package/dist/components/ui/scroll-area/scroll-area.js.map +1 -0
- package/dist/components/ui/select/index.d.ts +2 -0
- package/dist/components/ui/select/index.d.ts.map +1 -0
- package/dist/components/ui/select/select.d.ts +63 -0
- package/dist/components/ui/select/select.d.ts.map +1 -0
- package/dist/components/ui/select/select.js +142 -0
- package/dist/components/ui/select/select.js.map +1 -0
- package/dist/components/ui/separator/index.d.ts +2 -0
- package/dist/components/ui/separator/index.d.ts.map +1 -0
- package/dist/components/ui/separator/separator.d.ts +17 -0
- package/dist/components/ui/separator/separator.d.ts.map +1 -0
- package/dist/components/ui/separator/separator.js +24 -0
- package/dist/components/ui/separator/separator.js.map +1 -0
- package/dist/components/ui/sheet/index.d.ts +2 -0
- package/dist/components/ui/sheet/index.d.ts.map +1 -0
- package/dist/components/ui/sheet/sheet.d.ts +32 -0
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet/sheet.js +118 -0
- package/dist/components/ui/sheet/sheet.js.map +1 -0
- package/dist/components/ui/skeleton/index.d.ts +2 -0
- package/dist/components/ui/skeleton/index.d.ts.map +1 -0
- package/dist/components/ui/skeleton/skeleton.d.ts +15 -0
- package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton/skeleton.js +31 -0
- package/dist/components/ui/skeleton/skeleton.js.map +1 -0
- package/dist/components/ui/slider/index.d.ts +2 -0
- package/dist/components/ui/slider/index.d.ts.map +1 -0
- package/dist/components/ui/slider/slider.d.ts +22 -0
- package/dist/components/ui/slider/slider.d.ts.map +1 -0
- package/dist/components/ui/slider/slider.js +59 -0
- package/dist/components/ui/slider/slider.js.map +1 -0
- package/dist/components/ui/spinner/index.d.ts +2 -0
- package/dist/components/ui/spinner/index.d.ts.map +1 -0
- package/dist/components/ui/spinner/spinner.d.ts +25 -0
- package/dist/components/ui/spinner/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner/spinner.js +57 -0
- package/dist/components/ui/spinner/spinner.js.map +1 -0
- package/dist/components/ui/status-chip/index.d.ts +2 -0
- package/dist/components/ui/status-chip/index.d.ts.map +1 -0
- package/dist/components/ui/status-chip/status-chip.d.ts +70 -0
- package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -0
- package/dist/components/ui/status-chip/status-chip.js +140 -0
- package/dist/components/ui/status-chip/status-chip.js.map +1 -0
- package/dist/components/ui/switch/index.d.ts +2 -0
- package/dist/components/ui/switch/index.d.ts.map +1 -0
- package/dist/components/ui/switch/switch.d.ts +36 -0
- package/dist/components/ui/switch/switch.d.ts.map +1 -0
- package/dist/components/ui/switch/switch.js +74 -0
- package/dist/components/ui/switch/switch.js.map +1 -0
- package/dist/components/ui/table/index.d.ts +2 -0
- package/dist/components/ui/table/index.d.ts.map +1 -0
- package/dist/components/ui/table/table.d.ts +29 -0
- package/dist/components/ui/table/table.d.ts.map +1 -0
- package/dist/components/ui/table/table.js +129 -0
- package/dist/components/ui/table/table.js.map +1 -0
- package/dist/components/ui/tabs/index.d.ts +2 -0
- package/dist/components/ui/tabs/index.d.ts.map +1 -0
- package/dist/components/ui/tabs/tabs.d.ts +23 -0
- package/dist/components/ui/tabs/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs/tabs.js +43 -0
- package/dist/components/ui/tabs/tabs.js.map +1 -0
- package/dist/components/ui/textarea/index.d.ts +2 -0
- package/dist/components/ui/textarea/index.d.ts.map +1 -0
- package/dist/components/ui/textarea/textarea.d.ts +14 -0
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea/textarea.js +30 -0
- package/dist/components/ui/textarea/textarea.js.map +1 -0
- package/dist/components/ui/toast/index.d.ts +2 -0
- package/dist/components/ui/toast/index.d.ts.map +1 -0
- package/dist/components/ui/toast/toast.d.ts +68 -0
- package/dist/components/ui/toast/toast.d.ts.map +1 -0
- package/dist/components/ui/toast/toast.js +186 -0
- package/dist/components/ui/toast/toast.js.map +1 -0
- package/dist/components/ui/toggle/index.d.ts +2 -0
- package/dist/components/ui/toggle/index.d.ts.map +1 -0
- package/dist/components/ui/toggle/toggle.d.ts +22 -0
- package/dist/components/ui/toggle/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle/toggle.js +64 -0
- package/dist/components/ui/toggle/toggle.js.map +1 -0
- package/dist/components/ui/toggle-group/index.d.ts +2 -0
- package/dist/components/ui/toggle-group/index.d.ts.map +1 -0
- package/dist/components/ui/toggle-group/toggle-group.d.ts +35 -0
- package/dist/components/ui/toggle-group/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group/toggle-group.js +38 -0
- package/dist/components/ui/toggle-group/toggle-group.js.map +1 -0
- package/dist/components/ui/tooltip/index.d.ts +2 -0
- package/dist/components/ui/tooltip/index.d.ts.map +1 -0
- package/dist/components/ui/tooltip/tooltip.d.ts +18 -0
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip/tooltip.js +67 -0
- package/dist/components/ui/tooltip/tooltip.js.map +1 -0
- package/dist/index.d.ts +96 -19
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +90 -20
- package/dist/lib/keyed-rows.d.ts +36 -0
- package/dist/lib/keyed-rows.d.ts.map +1 -0
- package/dist/lib/keyed-rows.js +53 -0
- package/dist/lib/keyed-rows.js.map +1 -0
- package/dist/lib/keyed-rows.test.d.ts +2 -0
- package/dist/lib/keyed-rows.test.d.ts.map +1 -0
- package/dist/lib/overlay.d.ts +44 -0
- package/dist/lib/overlay.d.ts.map +1 -0
- package/dist/lib/overlay.js +57 -0
- package/dist/lib/overlay.js.map +1 -0
- package/dist/lib/themes.d.ts +197 -0
- package/dist/lib/themes.d.ts.map +1 -0
- package/dist/lib/themes.js +303 -0
- package/dist/lib/themes.js.map +1 -0
- package/dist/lib/tokens.d.ts +103 -0
- package/dist/lib/tokens.d.ts.map +1 -0
- package/dist/lib/tokens.js +805 -0
- package/dist/lib/tokens.js.map +1 -0
- package/dist/lib/utils.d.ts +27 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +61 -3
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/variants.d.ts +57 -0
- package/dist/lib/variants.d.ts.map +1 -0
- package/dist/lib/variants.js +49 -0
- package/dist/lib/variants.js.map +1 -0
- package/dist/lib/version-notes.d.ts +24 -0
- package/dist/lib/version-notes.d.ts.map +1 -0
- package/dist/lib/version-notes.js +41 -1
- package/dist/lib/version-notes.js.map +1 -0
- package/dist/r/accordion.json +23 -0
- package/dist/r/account-menu.json +25 -0
- package/dist/r/alert-dialog.json +22 -0
- package/dist/r/alert.json +22 -0
- package/dist/r/app-shell.json +20 -0
- package/dist/r/aspect-ratio.json +20 -0
- package/dist/r/avatar.json +20 -0
- package/dist/r/badge.json +22 -0
- package/dist/r/board.json +20 -0
- package/dist/r/breadcrumb.json +22 -0
- package/dist/r/button-group.json +22 -0
- package/dist/r/button.json +22 -0
- package/dist/r/calendar.json +25 -0
- package/dist/r/card.json +20 -0
- package/dist/r/carousel.json +26 -0
- package/dist/r/chart.json +23 -0
- package/dist/r/checkbox.json +23 -0
- package/dist/r/code-block.json +24 -0
- package/dist/r/collapsible.json +22 -0
- package/dist/r/combobox.json +23 -0
- package/dist/r/command.json +23 -0
- package/dist/r/context-menu.json +23 -0
- package/dist/r/conversation.json +48 -0
- package/dist/r/detail-panel.json +24 -0
- package/dist/r/dialog.json +23 -0
- package/dist/r/diff-block.json +20 -0
- package/dist/r/drawer.json +22 -0
- package/dist/r/dropdown-menu.json +23 -0
- package/dist/r/empty.json +20 -0
- package/dist/r/entity-icon.json +20 -0
- package/dist/r/field.json +22 -0
- package/dist/r/hover-card.json +22 -0
- package/dist/r/input-group.json +20 -0
- package/dist/r/input-otp.json +22 -0
- package/dist/r/input.json +20 -0
- package/dist/r/item.json +20 -0
- package/dist/r/kbd.json +20 -0
- package/dist/r/label.json +20 -0
- package/dist/r/list-row.json +22 -0
- package/dist/r/menubar.json +23 -0
- package/dist/r/modal-dialog.json +22 -0
- package/dist/r/navigation-menu.json +23 -0
- package/dist/r/page.json +20 -0
- package/dist/r/pagination.json +23 -0
- package/dist/r/panel.json +20 -0
- package/dist/r/popover.json +22 -0
- package/dist/r/progress.json +22 -0
- package/dist/r/radio-group.json +23 -0
- package/dist/r/registry.json +1676 -0
- package/dist/r/resizable.json +23 -0
- package/dist/r/scroll-area.json +20 -0
- package/dist/r/select.json +23 -0
- package/dist/r/separator.json +22 -0
- package/dist/r/settings.json +20 -0
- package/dist/r/sheet.json +25 -0
- package/dist/r/side-rail.json +27 -0
- package/dist/r/sidebar-nav.json +23 -0
- package/dist/r/skeleton.json +20 -0
- package/dist/r/slider.json +22 -0
- package/dist/r/spinner.json +22 -0
- package/dist/r/stat.json +22 -0
- package/dist/r/status-bar.json +20 -0
- package/dist/r/status-chip.json +22 -0
- package/dist/r/switch.json +22 -0
- package/dist/r/table.json +20 -0
- package/dist/r/tabs.json +22 -0
- package/dist/r/textarea.json +20 -0
- package/dist/r/theme.json +36 -0
- package/dist/r/toast.json +23 -0
- package/dist/r/toggle-group.json +24 -0
- package/dist/r/toggle.json +22 -0
- package/dist/r/tooltip.json +22 -0
- package/dist/r/top-bar.json +20 -0
- package/dist/r/update-dialog.json +27 -0
- package/dist/r/workspace-mark.json +22 -0
- package/package.json +75 -21
- package/registry.json +1676 -0
- package/src/components/composites/account-menu/account-menu.tsx +150 -0
- package/src/components/composites/account-menu/index.ts +1 -0
- package/src/components/composites/list-row/index.ts +1 -0
- package/src/components/composites/list-row/list-row.tsx +116 -0
- package/src/components/composites/settings/index.ts +1 -0
- package/src/components/composites/settings/settings.tsx +142 -0
- package/src/components/composites/stat/index.ts +9 -0
- package/src/components/composites/stat/stat.tsx +155 -0
- package/src/components/composites/update-dialog/index.ts +7 -0
- package/src/components/composites/update-dialog/update-dialog.tsx +529 -0
- package/src/components/composites/workspace-mark/index.ts +1 -0
- package/src/components/composites/workspace-mark/workspace-mark.tsx +72 -0
- package/src/components/conversation/conversation-avatar.tsx +60 -0
- package/src/components/conversation/conversation-surface.tsx +107 -0
- package/src/components/conversation/index.ts +25 -0
- package/src/components/conversation/message-composer.tsx +239 -0
- package/src/components/conversation/message-row.tsx +387 -0
- package/src/components/conversation/thread-panel.tsx +141 -0
- package/src/components/layout/app-shell/app-shell.tsx +92 -0
- package/src/components/layout/app-shell/index.ts +1 -0
- package/src/components/layout/page/index.ts +9 -0
- package/src/components/layout/page/page.tsx +122 -0
- package/src/components/layout/panel/index.ts +12 -0
- package/src/components/layout/panel/panel.tsx +166 -0
- package/src/components/layout/side-rail/index.ts +12 -0
- package/src/components/layout/side-rail/side-rail-context.ts +42 -0
- package/src/components/layout/side-rail/side-rail.tsx +405 -0
- package/src/components/layout/sidebar-nav/index.ts +14 -0
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +244 -0
- package/src/components/layout/status-bar/index.ts +1 -0
- package/src/components/layout/status-bar/status-bar.tsx +73 -0
- package/src/components/layout/top-bar/index.ts +10 -0
- package/src/components/layout/top-bar/top-bar.tsx +166 -0
- package/src/components/motion/index.ts +2 -0
- package/src/components/motion/presence.tsx +32 -0
- package/src/components/theme/appearance-panel.tsx +179 -0
- package/src/components/theme/index.ts +22 -0
- package/src/components/theme/theme-picker.tsx +174 -0
- package/src/components/theme/theme-provider.tsx +309 -0
- package/src/components/theme/theme-toggle.tsx +64 -0
- package/src/components/ui/accordion/accordion.tsx +66 -0
- package/src/components/ui/accordion/index.ts +1 -0
- package/src/components/ui/alert/alert.tsx +95 -0
- package/src/components/ui/alert/index.ts +1 -0
- package/src/components/ui/alert-dialog/alert-dialog.tsx +176 -0
- package/src/components/ui/alert-dialog/index.ts +13 -0
- package/src/components/ui/aspect-ratio/aspect-ratio.tsx +38 -0
- package/src/components/ui/aspect-ratio/index.ts +1 -0
- package/src/components/ui/avatar/avatar.tsx +114 -0
- package/src/components/ui/avatar/index.ts +9 -0
- package/src/components/ui/badge/badge.tsx +59 -0
- package/src/components/ui/badge/index.ts +1 -0
- package/src/components/ui/board/board.tsx +254 -0
- package/src/components/ui/board/index.ts +10 -0
- package/src/components/ui/breadcrumb/breadcrumb.tsx +117 -0
- package/src/components/ui/breadcrumb/index.ts +9 -0
- package/src/components/ui/button/button.tsx +89 -0
- package/src/components/ui/button/index.ts +1 -0
- package/src/components/ui/button-group/button-group.tsx +92 -0
- package/src/components/ui/button-group/index.ts +6 -0
- package/src/components/ui/calendar/calendar.tsx +277 -0
- package/src/components/ui/calendar/index.ts +1 -0
- package/src/components/ui/card/card.tsx +82 -0
- package/src/components/ui/card/index.ts +10 -0
- package/src/components/ui/carousel/carousel.tsx +209 -0
- package/src/components/ui/carousel/index.ts +1 -0
- package/src/components/ui/chart/chart.tsx +413 -0
- package/src/components/ui/chart/index.ts +17 -0
- package/src/components/ui/checkbox/checkbox.tsx +99 -0
- package/src/components/ui/checkbox/index.ts +1 -0
- package/src/components/ui/code-block/code-block.tsx +238 -0
- package/src/components/ui/code-block/index.ts +1 -0
- package/src/components/ui/collapsible/collapsible.tsx +54 -0
- package/src/components/ui/collapsible/index.ts +1 -0
- package/src/components/ui/combobox/combobox.tsx +142 -0
- package/src/components/ui/combobox/index.ts +10 -0
- package/src/components/ui/command/command.tsx +214 -0
- package/src/components/ui/command/index.ts +12 -0
- package/src/components/ui/context-menu/context-menu.tsx +163 -0
- package/src/components/ui/context-menu/index.ts +15 -0
- package/src/components/ui/detail-panel/detail-panel.tsx +161 -0
- package/src/components/ui/detail-panel/index.ts +9 -0
- package/src/components/ui/dialog/dialog.tsx +138 -0
- package/src/components/ui/dialog/index.ts +14 -0
- package/src/components/ui/diff-block/diff-block.tsx +286 -0
- package/src/components/ui/diff-block/index.ts +11 -0
- package/src/components/ui/drawer/drawer.tsx +144 -0
- package/src/components/ui/drawer/index.ts +13 -0
- package/src/components/ui/dropdown-menu/dropdown-menu.tsx +203 -0
- package/src/components/ui/dropdown-menu/index.ts +18 -0
- package/src/components/ui/empty/empty.tsx +104 -0
- package/src/components/ui/empty/index.ts +10 -0
- package/src/components/ui/entity-icon/entity-icon.tsx +154 -0
- package/src/components/ui/entity-icon/index.ts +1 -0
- package/src/components/ui/field/field.tsx +131 -0
- package/src/components/ui/field/index.ts +11 -0
- package/src/components/ui/hover-card/hover-card.tsx +48 -0
- package/src/components/ui/hover-card/index.ts +1 -0
- package/src/components/ui/input/index.ts +1 -0
- package/src/components/ui/input/input.tsx +41 -0
- package/src/components/ui/input-group/index.ts +8 -0
- package/src/components/ui/input-group/input-group.tsx +111 -0
- package/src/components/ui/input-otp/index.ts +1 -0
- package/src/components/ui/input-otp/input-otp.tsx +108 -0
- package/src/components/ui/item/index.ts +10 -0
- package/src/components/ui/item/item.tsx +146 -0
- package/src/components/ui/kbd/index.ts +1 -0
- package/src/components/ui/kbd/kbd.tsx +42 -0
- package/src/components/ui/label/index.ts +1 -0
- package/src/components/ui/label/label.tsx +36 -0
- package/src/components/ui/menubar/index.ts +16 -0
- package/src/components/ui/menubar/menubar.tsx +190 -0
- package/src/components/ui/modal-dialog/index.ts +1 -0
- package/src/components/ui/modal-dialog/modal-dialog.tsx +95 -0
- package/src/components/ui/navigation-menu/index.ts +13 -0
- package/src/components/ui/navigation-menu/navigation-menu.tsx +229 -0
- package/src/components/ui/pagination/index.ts +8 -0
- package/src/components/ui/pagination/pagination.tsx +144 -0
- package/src/components/ui/popover/index.ts +10 -0
- package/src/components/ui/popover/popover.tsx +81 -0
- package/src/components/ui/progress/index.ts +1 -0
- package/src/components/ui/progress/progress.tsx +67 -0
- package/src/components/ui/radio-group/index.ts +1 -0
- package/src/components/ui/radio-group/radio-group.tsx +78 -0
- package/src/components/ui/resizable/index.ts +6 -0
- package/src/components/ui/resizable/resizable.tsx +74 -0
- package/src/components/ui/scroll-area/index.ts +1 -0
- package/src/components/ui/scroll-area/scroll-area.tsx +66 -0
- package/src/components/ui/select/index.ts +11 -0
- package/src/components/ui/select/select.tsx +188 -0
- package/src/components/ui/separator/index.ts +1 -0
- package/src/components/ui/separator/separator.tsx +40 -0
- package/src/components/ui/sheet/index.ts +13 -0
- package/src/components/ui/sheet/sheet.tsx +132 -0
- package/src/components/ui/skeleton/index.ts +1 -0
- package/src/components/ui/skeleton/skeleton.tsx +28 -0
- package/src/components/ui/slider/index.ts +1 -0
- package/src/components/ui/slider/slider.tsx +81 -0
- package/src/components/ui/spinner/index.ts +1 -0
- package/src/components/ui/spinner/spinner.tsx +58 -0
- package/src/components/ui/status-chip/index.ts +8 -0
- package/src/components/ui/status-chip/status-chip.tsx +142 -0
- package/src/components/ui/switch/index.ts +1 -0
- package/src/components/ui/switch/switch.tsx +100 -0
- package/src/components/ui/table/index.ts +11 -0
- package/src/components/ui/table/table.tsx +125 -0
- package/src/components/ui/tabs/index.ts +8 -0
- package/src/components/ui/tabs/tabs.tsx +77 -0
- package/src/components/ui/textarea/index.ts +1 -0
- package/src/components/ui/textarea/textarea.tsx +36 -0
- package/src/components/ui/toast/index.ts +1 -0
- package/src/components/ui/toast/toast.tsx +220 -0
- package/src/components/ui/toggle/index.ts +1 -0
- package/src/components/ui/toggle/toggle.tsx +60 -0
- package/src/components/ui/toggle-group/index.ts +6 -0
- package/src/components/ui/toggle-group/toggle-group.tsx +66 -0
- package/src/components/ui/tooltip/index.ts +9 -0
- package/src/components/ui/tooltip/tooltip.tsx +102 -0
- package/src/index.ts +154 -0
- package/src/lib/keyed-rows.ts +68 -0
- package/src/lib/overlay.ts +70 -0
- package/src/lib/themes.ts +490 -0
- package/src/lib/tokens.ts +688 -0
- package/src/lib/utils.ts +74 -4
- package/src/lib/variants.ts +62 -0
- package/src/lib/version-notes.ts +35 -0
- package/src/styles/base.css +489 -484
- package/src/styles/fonts.css +26 -0
- package/src/styles/globals.css +14 -3
- package/src/styles/theme.css +838 -229
- package/LICENSE +0 -201
- package/dist/components/account-drawer.d.ts +0 -11
- package/dist/components/account-drawer.js +0 -120
- package/dist/components/appearance.d.ts +0 -261
- package/dist/components/appearance.js +0 -802
- package/dist/components/on-screen-controls.d.ts +0 -8
- package/dist/components/on-screen-controls.js +0 -162
- package/dist/components/scene-settings.d.ts +0 -33
- package/dist/components/scene-settings.js +0 -253
- package/dist/components/theme-preview.d.ts +0 -40
- package/dist/components/theme-preview.js +0 -210
- package/dist/components/theme-provider.d.ts +0 -52
- package/dist/components/theme-provider.js +0 -128
- package/dist/components/theme-swatch.d.ts +0 -12
- package/dist/components/theme-swatch.js +0 -66
- package/dist/components/theme-toggle.d.ts +0 -7
- package/dist/components/theme-toggle.js +0 -64
- package/dist/components/ui/badge.d.ts +0 -8
- package/dist/components/ui/badge.js +0 -34
- package/dist/components/ui/button.d.ts +0 -9
- package/dist/components/ui/button.js +0 -52
- package/dist/components/ui/card.d.ts +0 -4
- package/dist/components/ui/card.js +0 -28
- package/dist/components/ui/dialog.d.ts +0 -15
- package/dist/components/ui/dialog.js +0 -104
- package/dist/components/ui/drawer.d.ts +0 -24
- package/dist/components/ui/drawer.js +0 -120
- package/dist/components/ui/dropdown-menu.d.ts +0 -35
- package/dist/components/ui/dropdown-menu.js +0 -180
- package/dist/components/ui/empty.d.ts +0 -12
- package/dist/components/ui/field.d.ts +0 -25
- package/dist/components/ui/field.js +0 -188
- package/dist/components/ui/input.d.ts +0 -3
- package/dist/components/ui/input.js +0 -22
- package/dist/components/ui/label.d.ts +0 -3
- package/dist/components/ui/label.js +0 -17
- package/dist/components/ui/radio-group.d.ts +0 -5
- package/dist/components/ui/radio-group.js +0 -39
- package/dist/components/ui/separator.d.ts +0 -7
- package/dist/components/ui/separator.js +0 -20
- package/dist/components/ui/skeleton.d.ts +0 -3
- package/dist/components/ui/skeleton.js +0 -17
- package/dist/components/ui/spinner.d.ts +0 -5
- package/dist/components/ui/spinner.js +0 -17
- package/dist/components/ui/switch.d.ts +0 -8
- package/dist/components/ui/switch.js +0 -59
- package/dist/components/ui/tabs.d.ts +0 -11
- package/dist/components/ui/tabs.js +0 -57
- package/dist/components/ui/toggle-group.d.ts +0 -13
- package/dist/components/ui/toggle-group.js +0 -95
- package/dist/components/ui/toggle.d.ts +0 -10
- package/dist/components/ui/toggle.js +0 -41
- package/dist/components/ui/tooltip.d.ts +0 -15
- package/dist/components/ui/tooltip.js +0 -55
- package/dist/components/version-dialog.d.ts +0 -25
- package/dist/components/version-dialog.js +0 -330
- package/dist/components/workspace-brand.d.ts +0 -5
- package/dist/components/workspace-brand.js +0 -13
- package/dist/components/workspace-logo.d.ts +0 -3
- package/dist/components/workspace-logo.js +0 -17
- package/src/components/account-drawer.tsx +0 -114
- package/src/components/appearance.ts +0 -1112
- package/src/components/on-screen-controls.tsx +0 -149
- package/src/components/scene-settings.tsx +0 -199
- package/src/components/theme-preview.tsx +0 -170
- package/src/components/theme-provider.tsx +0 -214
- package/src/components/theme-swatch.tsx +0 -49
- package/src/components/theme-toggle.tsx +0 -48
- package/src/components/ui/badge.tsx +0 -40
- package/src/components/ui/button.tsx +0 -58
- package/src/components/ui/card.tsx +0 -21
- package/src/components/ui/dialog.tsx +0 -132
- package/src/components/ui/drawer.tsx +0 -168
- package/src/components/ui/dropdown-menu.tsx +0 -235
- package/src/components/ui/empty.tsx +0 -97
- package/src/components/ui/field.tsx +0 -220
- package/src/components/ui/input.tsx +0 -20
- package/src/components/ui/label.tsx +0 -19
- package/src/components/ui/radio-group.tsx +0 -41
- package/src/components/ui/separator.tsx +0 -28
- package/src/components/ui/skeleton.tsx +0 -16
- package/src/components/ui/spinner.tsx +0 -20
- package/src/components/ui/switch.tsx +0 -59
- package/src/components/ui/tabs.tsx +0 -76
- package/src/components/ui/toggle-group.tsx +0 -98
- package/src/components/ui/toggle.tsx +0 -42
- package/src/components/ui/tooltip.tsx +0 -61
- package/src/components/version-dialog.tsx +0 -368
- package/src/components/workspace-brand.tsx +0 -18
- package/src/components/workspace-logo.tsx +0 -21
- package/src/index.tsx +0 -53
- package/src/styles/auth-shell.css +0 -167
- package/src/styles/conventional-workspace.css +0 -2858
- package/src/styles/dev-view.css +0 -899
- package/src/styles/workspace-shell.css +0 -82
- package/tsconfig.json +0 -11
|
@@ -1,1112 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026 Wing
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*
|
|
5
|
-
* Appearance domain model substantially translated from Zeron
|
|
6
|
-
* crates/theme/src/lib.rs and crates/ui/src/appearance.rs, revision
|
|
7
|
-
* 30a9a9537c5ec96226c87f4bf349b6f77c5dfb59: color math with WCAG contrast,
|
|
8
|
-
* accent role derivation, independent light/dark theme selection, the
|
|
9
|
-
* system/light/dark mode resolver, surface preference resolution, the theme
|
|
10
|
-
* registry with deterministic built-in fallback, and its validation rules.
|
|
11
|
-
* Modified for TypeScript, Adea's token layer, custom accent validation,
|
|
12
|
-
* the translucent surface capability, and the user reduced-transparency
|
|
13
|
-
* policy Zeron lacks. See NOTICE and docs/research/dev-view-donor-audit.md.
|
|
14
|
-
*
|
|
15
|
-
* This module is the declared token layer for the built-in theme palette
|
|
16
|
-
* data: the color string literals below are the theme itself, exactly like
|
|
17
|
-
* the declarations in `styles/theme.css` (see
|
|
18
|
-
* `scripts/check-theme-colors.mjs`).
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The versioned client appearance preference (Dev Runtime spec,
|
|
23
|
-
* "Appearance and App Library"). Stored as one JSON document; the legacy
|
|
24
|
-
* single `theme` key migrates into it without deleting the old value.
|
|
25
|
-
*/
|
|
26
|
-
export type AppearancePreferencesV2 = Readonly<{
|
|
27
|
-
version: 2
|
|
28
|
-
mode: AppearanceMode
|
|
29
|
-
lightThemeId: string
|
|
30
|
-
darkThemeId: string
|
|
31
|
-
/** `'theme'`, a built-in preset id, or a validated `#rrggbb` color. */
|
|
32
|
-
accent: 'theme' | string
|
|
33
|
-
surface: 'opaque' | 'frosted' | 'translucent'
|
|
34
|
-
reduceTransparency: boolean
|
|
35
|
-
}>
|
|
36
|
-
|
|
37
|
-
export type AppearanceMode = 'system' | 'light' | 'dark'
|
|
38
|
-
export type ResolvedAppearance = 'light' | 'dark'
|
|
39
|
-
export type SurfacePreference = 'opaque' | 'frosted' | 'translucent'
|
|
40
|
-
|
|
41
|
-
export const APPEARANCE_STORAGE_KEY = 'appearance'
|
|
42
|
-
/** The pre-#425 key. Migration reads it and never deletes it. */
|
|
43
|
-
export const LEGACY_THEME_STORAGE_KEY = 'theme'
|
|
44
|
-
/**
|
|
45
|
-
* Recovery envelope for unread preference documents (Dev Runtime spec,
|
|
46
|
-
* "Compatibility, migrations, and waivers": a failed migration retains the
|
|
47
|
-
* original record; it never silently rewrites or deletes the input). A
|
|
48
|
-
* malformed or future-version document is quarantined here — before any
|
|
49
|
-
* write can touch the main key — so saving valid preferences later can never
|
|
50
|
-
* destroy the user's unread data.
|
|
51
|
-
*/
|
|
52
|
-
export const APPEARANCE_RECOVERY_STORAGE_KEY = 'appearance.recovery'
|
|
53
|
-
|
|
54
|
-
export type AppearanceRecoveryEnvelope = Readonly<{
|
|
55
|
-
schemaVersion: 1
|
|
56
|
-
reason: 'corrupt_json' | 'unsupported_record'
|
|
57
|
-
capturedAt: string
|
|
58
|
-
raw: string
|
|
59
|
-
}>
|
|
60
|
-
|
|
61
|
-
export const DARK_QUERY = '(prefers-color-scheme: dark)'
|
|
62
|
-
export const REDUCED_TRANSPARENCY_QUERY = '(prefers-reduced-transparency: reduce)'
|
|
63
|
-
|
|
64
|
-
export const defaultAppearancePreferences: AppearancePreferencesV2 = Object.freeze({
|
|
65
|
-
version: 2,
|
|
66
|
-
mode: 'system',
|
|
67
|
-
lightThemeId: 'adea-light',
|
|
68
|
-
darkThemeId: 'adea-dark',
|
|
69
|
-
accent: 'theme',
|
|
70
|
-
surface: 'opaque',
|
|
71
|
-
reduceTransparency: false,
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Combine the user's choice with the OS state. A pinned mode ignores the OS;
|
|
76
|
-
* `system` follows it. (Zeron `resolve`.)
|
|
77
|
-
*/
|
|
78
|
-
export function resolveAppearanceMode(
|
|
79
|
-
mode: AppearanceMode,
|
|
80
|
-
system: ResolvedAppearance
|
|
81
|
-
): ResolvedAppearance {
|
|
82
|
-
if (mode === 'system') return system
|
|
83
|
-
return mode
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/*
|
|
87
|
-
* Color math — Zeron `Color`, translated. Values are `#rgb`, `#rgba`,
|
|
88
|
-
* `#rrggbb`, or `#rrggbbaa` strings.
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
export type RgbColor = Readonly<{ r: number; g: number; b: number; a: number }>
|
|
92
|
-
|
|
93
|
-
export class ColorParseError extends Error {
|
|
94
|
-
constructor() {
|
|
95
|
-
super('expected a CSS hex color (#rgb, #rgba, #rrggbb, or #rrggbbaa)')
|
|
96
|
-
this.name = 'ColorParseError'
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const NIBBLES: Record<string, number> = {
|
|
101
|
-
'0': 0,
|
|
102
|
-
'1': 1,
|
|
103
|
-
'2': 2,
|
|
104
|
-
'3': 3,
|
|
105
|
-
'4': 4,
|
|
106
|
-
'5': 5,
|
|
107
|
-
'6': 6,
|
|
108
|
-
'7': 7,
|
|
109
|
-
'8': 8,
|
|
110
|
-
'9': 9,
|
|
111
|
-
a: 10,
|
|
112
|
-
b: 11,
|
|
113
|
-
c: 12,
|
|
114
|
-
d: 13,
|
|
115
|
-
e: 14,
|
|
116
|
-
f: 15,
|
|
117
|
-
A: 10,
|
|
118
|
-
B: 11,
|
|
119
|
-
C: 12,
|
|
120
|
-
D: 13,
|
|
121
|
-
E: 14,
|
|
122
|
-
F: 15,
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function expandNibble(nibble: number): number {
|
|
126
|
-
return (nibble << 4) | nibble
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function parseByte(high: number, low: number): number {
|
|
130
|
-
return (high << 4) | low
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/** Parse a hex color. Returns `undefined` for anything unsupported. */
|
|
134
|
-
export function parseColor(value: string): RgbColor | undefined {
|
|
135
|
-
const trimmed = value.trim()
|
|
136
|
-
if (!trimmed.startsWith('#')) return undefined
|
|
137
|
-
const bytes = trimmed.slice(1)
|
|
138
|
-
if (bytes.length === 3 || bytes.length === 4) {
|
|
139
|
-
const nibbles: number[] = []
|
|
140
|
-
for (const character of bytes) {
|
|
141
|
-
const nibble = NIBBLES[character]
|
|
142
|
-
if (nibble === undefined) return undefined
|
|
143
|
-
nibbles.push(nibble)
|
|
144
|
-
}
|
|
145
|
-
return {
|
|
146
|
-
r: expandNibble(nibbles[0]!),
|
|
147
|
-
g: expandNibble(nibbles[1]!),
|
|
148
|
-
b: expandNibble(nibbles[2]!),
|
|
149
|
-
a: nibbles.length === 4 ? expandNibble(nibbles[3]!) : 255,
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
if (bytes.length === 6 || bytes.length === 8) {
|
|
153
|
-
const nibbles: number[] = []
|
|
154
|
-
for (const character of bytes) {
|
|
155
|
-
const nibble = NIBBLES[character]
|
|
156
|
-
if (nibble === undefined) return undefined
|
|
157
|
-
nibbles.push(nibble)
|
|
158
|
-
}
|
|
159
|
-
const pair = (index: number) => parseByte(nibbles[index]!, nibbles[index + 1]!)
|
|
160
|
-
return {
|
|
161
|
-
r: pair(0),
|
|
162
|
-
g: pair(2),
|
|
163
|
-
b: pair(4),
|
|
164
|
-
a: nibbles.length === 8 ? pair(6) : 255,
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return undefined
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function toHexByte(value: number): string {
|
|
171
|
-
return value.toString(16).padStart(2, '0')
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export function colorToHex(color: RgbColor): string {
|
|
175
|
-
if (color.a === 255) return `#${toHexByte(color.r)}${toHexByte(color.g)}${toHexByte(color.b)}`
|
|
176
|
-
return `#${toHexByte(color.r)}${toHexByte(color.g)}${toHexByte(color.b)}${toHexByte(color.a)}`
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function blendOver(foreground: RgbColor, background: RgbColor): RgbColor {
|
|
180
|
-
const alpha = foreground.a / 255
|
|
181
|
-
const blend = (front: number, back: number) => Math.round(front * alpha + back * (1 - alpha))
|
|
182
|
-
return {
|
|
183
|
-
r: blend(foreground.r, background.r),
|
|
184
|
-
g: blend(foreground.g, background.g),
|
|
185
|
-
b: blend(foreground.b, background.b),
|
|
186
|
-
a: 255,
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function mixColors(left: RgbColor, right: RgbColor, amount: number): RgbColor {
|
|
191
|
-
const clamped = Math.min(1, Math.max(0, amount))
|
|
192
|
-
const mix = (a: number, b: number) => Math.round(a + (b - a) * clamped)
|
|
193
|
-
return { r: mix(left.r, right.r), g: mix(left.g, right.g), b: mix(left.b, right.b), a: 255 }
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function linearChannel(channel: number): number {
|
|
197
|
-
const value = channel / 255
|
|
198
|
-
return value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function relativeLuminance(color: RgbColor): number {
|
|
202
|
-
return (
|
|
203
|
-
0.2126 * linearChannel(color.r) +
|
|
204
|
-
0.7152 * linearChannel(color.g) +
|
|
205
|
-
0.0722 * linearChannel(color.b)
|
|
206
|
-
)
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/** WCAG contrast ratio between two colors. Alpha composites over the background first. */
|
|
210
|
-
export function contrastRatio(
|
|
211
|
-
foreground: RgbColor | string,
|
|
212
|
-
background: RgbColor | string
|
|
213
|
-
): number {
|
|
214
|
-
const front = typeof foreground === 'string' ? parseColor(foreground) : foreground
|
|
215
|
-
const back = typeof background === 'string' ? parseColor(background) : background
|
|
216
|
-
if (!front || !back) return 0
|
|
217
|
-
const opaqueFront = front.a === 255 ? front : blendOver(front, back)
|
|
218
|
-
const a = relativeLuminance(opaqueFront)
|
|
219
|
-
const b = relativeLuminance(back)
|
|
220
|
-
return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05)
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function bestOnColor(color: RgbColor): RgbColor {
|
|
224
|
-
return contrastRatio(WHITE, color) >= contrastRatio(BLACK, color) ? WHITE : BLACK
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
const WHITE: RgbColor = { r: 255, g: 255, b: 255, a: 255 }
|
|
228
|
-
const BLACK: RgbColor = { r: 0, g: 0, b: 0, a: 255 }
|
|
229
|
-
|
|
230
|
-
/** Move toward black or white until the requested contrast is met. (Zeron `ensure_contrast`.) */
|
|
231
|
-
function ensureContrast(color: RgbColor, background: RgbColor, minimum: number): RgbColor {
|
|
232
|
-
if (contrastRatio(color, background) >= minimum) return color
|
|
233
|
-
const target =
|
|
234
|
-
contrastRatio(BLACK, background) >= contrastRatio(WHITE, background) ? BLACK : WHITE
|
|
235
|
-
for (let step = 1; step <= 20; step++) {
|
|
236
|
-
const candidate = mixColors(color, target, step / 20)
|
|
237
|
-
if (contrastRatio(candidate, background) >= minimum) return candidate
|
|
238
|
-
}
|
|
239
|
-
return target
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/*
|
|
243
|
-
* Accent — Zeron `AccentPreset`/`AccentSelection`/`AccentRoles` with Adea's
|
|
244
|
-
* custom-color validation. Presets carry per-appearance values; a custom
|
|
245
|
-
* color is normalized to the 3:1 interaction minimum instead of rejected
|
|
246
|
-
* outright, and unparseable values fall back to the theme default.
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
export type AccentPreset = Readonly<{
|
|
250
|
-
id: string
|
|
251
|
-
label: string
|
|
252
|
-
dark: string
|
|
253
|
-
light: string
|
|
254
|
-
}>
|
|
255
|
-
|
|
256
|
-
export const accentPresets: readonly AccentPreset[] = Object.freeze([
|
|
257
|
-
{ id: 'violet', label: 'Violet', dark: '#a78bfa', light: '#6d28d9' },
|
|
258
|
-
{ id: 'blue', label: 'Blue', dark: '#60a5fa', light: '#2563eb' },
|
|
259
|
-
{ id: 'green', label: 'Green', dark: '#4ade80', light: '#15803d' },
|
|
260
|
-
{ id: 'amber', label: 'Amber', dark: '#fbbf24', light: '#b45309' },
|
|
261
|
-
{ id: 'cyan', label: 'Cyan', dark: '#22d3ee', light: '#0e7490' },
|
|
262
|
-
{ id: 'pink', label: 'Pink', dark: '#f472b6', light: '#be185d' },
|
|
263
|
-
])
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Normalize a custom accent color against a variant background: unparseable
|
|
267
|
-
* input is rejected (`undefined`), and any accepted color is raised to the
|
|
268
|
-
* 3:1 interaction minimum so an accent can never ship unreadable.
|
|
269
|
-
*/
|
|
270
|
-
export function normalizeAccentValue(value: string, background: string): string | undefined {
|
|
271
|
-
const parsed = parseColor(value)
|
|
272
|
-
if (!parsed) return undefined
|
|
273
|
-
const backdrop = parseColor(background) ?? WHITE
|
|
274
|
-
return colorToHex(ensureContrast(parsed, backdrop, 3))
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
export function accentPresetById(id: string): AccentPreset | undefined {
|
|
278
|
-
return accentPresets.find((preset) => preset.id === id)
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
export type AccentRoles = Readonly<{
|
|
282
|
-
/** Interactive primary. */
|
|
283
|
-
primary: string
|
|
284
|
-
/** Text drawn on `primary`-filled controls; ≥ 4.5:1 against it. */
|
|
285
|
-
onPrimary: string
|
|
286
|
-
/** Hover/press emphasis derived from the primary. */
|
|
287
|
-
strong: string
|
|
288
|
-
/** Focus ring color. */
|
|
289
|
-
ring: string
|
|
290
|
-
/** False when the selection is the variant's own accent and no role should be overridden. */
|
|
291
|
-
overrides: boolean
|
|
292
|
-
}>
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Derive the accent roles for a selection against a variant. `'theme'` keeps
|
|
296
|
-
* the variant's own accent; presets and custom colors are normalized to the
|
|
297
|
-
* 3:1 interaction minimum (Zeron `AccentRoles::derive`, thresholds preserved).
|
|
298
|
-
*/
|
|
299
|
-
export function deriveAccentRoles(selection: string, variant: ThemeVariant): AccentRoles {
|
|
300
|
-
const background = variant.colors.background
|
|
301
|
-
let primary = variant.colors.primary
|
|
302
|
-
let overrides = false
|
|
303
|
-
if (selection !== 'theme') {
|
|
304
|
-
const preset = accentPresetById(selection)
|
|
305
|
-
const requested = preset
|
|
306
|
-
? parseColor(variant.appearance === 'dark' ? preset.dark : preset.light)
|
|
307
|
-
: parseColor(selection)
|
|
308
|
-
if (requested) {
|
|
309
|
-
primary = colorToHex(ensureContrast(requested, parseColor(background)!, 3))
|
|
310
|
-
overrides = true
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
const primaryRgb = parseColor(primary)!
|
|
314
|
-
const onPrimary = colorToHex(bestOnColor(primaryRgb))
|
|
315
|
-
let strong = primary
|
|
316
|
-
if (contrastRatio(onPrimary, strong) < 4.5) {
|
|
317
|
-
strong = colorToHex(ensureContrast(primaryRgb, parseColor(onPrimary)!, 4.5))
|
|
318
|
-
}
|
|
319
|
-
return { primary, onPrimary, strong, ring: strong, overrides }
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/*
|
|
323
|
-
* Surface — Zeron `SurfacePreference.resolve` extended with Adea's
|
|
324
|
-
* translucent capability gate and the reduced-transparency policy: the OS
|
|
325
|
-
* setting or the user preference forces an accessible opaque fallback, and a
|
|
326
|
-
* translucent request on a host without native translucency renders the
|
|
327
|
-
* tokenized frosted surface instead of pretending to OS vibrancy.
|
|
328
|
-
*/
|
|
329
|
-
export type EffectiveSurface = 'opaque' | 'frosted' | 'translucent'
|
|
330
|
-
|
|
331
|
-
export function resolveSurface(
|
|
332
|
-
preference: SurfacePreference,
|
|
333
|
-
environment: Readonly<{
|
|
334
|
-
osReducedTransparency: boolean
|
|
335
|
-
userReducedTransparency: boolean
|
|
336
|
-
nativeTranslucency: boolean
|
|
337
|
-
}>
|
|
338
|
-
): EffectiveSurface {
|
|
339
|
-
if (environment.osReducedTransparency || environment.userReducedTransparency) return 'opaque'
|
|
340
|
-
if (preference === 'translucent' && !environment.nativeTranslucency) return 'frosted'
|
|
341
|
-
return preference
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/*
|
|
345
|
-
* Theme registry — Zeron `ThemeVariant`/`ThemeRegistry`, narrowed to Adea's
|
|
346
|
-
* semantic roles. Every runtime component consumes the CSS custom properties
|
|
347
|
-
* declared here; terminal ANSI and editor roles come from the same manifest
|
|
348
|
-
* so a theme switch updates them live without remounting a terminal or
|
|
349
|
-
* editor.
|
|
350
|
-
*/
|
|
351
|
-
|
|
352
|
-
export type ThemeTerminalPalette = Readonly<{
|
|
353
|
-
background: string
|
|
354
|
-
foreground: string
|
|
355
|
-
cursor: string
|
|
356
|
-
selection: string
|
|
357
|
-
/** The 16 xterm ANSI slots, in protocol order. */
|
|
358
|
-
ansi: readonly string[]
|
|
359
|
-
}>
|
|
360
|
-
|
|
361
|
-
export type ThemeEditorRoles = Readonly<{
|
|
362
|
-
keyword: string
|
|
363
|
-
string: string
|
|
364
|
-
number: string
|
|
365
|
-
comment: string
|
|
366
|
-
function: string
|
|
367
|
-
variable: string
|
|
368
|
-
type: string
|
|
369
|
-
tag: string
|
|
370
|
-
attribute: string
|
|
371
|
-
operator: string
|
|
372
|
-
heading: string
|
|
373
|
-
link: string
|
|
374
|
-
diffAdd: string
|
|
375
|
-
diffDelete: string
|
|
376
|
-
diffHunk: string
|
|
377
|
-
searchMatch: string
|
|
378
|
-
}>
|
|
379
|
-
|
|
380
|
-
export type ThemeChartRoles = Readonly<{
|
|
381
|
-
chart1: string
|
|
382
|
-
chart2: string
|
|
383
|
-
chart3: string
|
|
384
|
-
chart4: string
|
|
385
|
-
chart5: string
|
|
386
|
-
chart6: string
|
|
387
|
-
}>
|
|
388
|
-
|
|
389
|
-
export type ThemeColors = Readonly<{
|
|
390
|
-
background: string
|
|
391
|
-
foreground: string
|
|
392
|
-
card: string
|
|
393
|
-
cardForeground: string
|
|
394
|
-
popover: string
|
|
395
|
-
popoverForeground: string
|
|
396
|
-
primary: string
|
|
397
|
-
primaryForeground: string
|
|
398
|
-
secondary: string
|
|
399
|
-
secondaryForeground: string
|
|
400
|
-
muted: string
|
|
401
|
-
mutedForeground: string
|
|
402
|
-
accent: string
|
|
403
|
-
accentForeground: string
|
|
404
|
-
destructive: string
|
|
405
|
-
success: string
|
|
406
|
-
border: string
|
|
407
|
-
input: string
|
|
408
|
-
ring: string
|
|
409
|
-
}>
|
|
410
|
-
|
|
411
|
-
export type ThemeVariant = Readonly<{
|
|
412
|
-
id: string
|
|
413
|
-
familyId: string
|
|
414
|
-
familyName: string
|
|
415
|
-
name: string
|
|
416
|
-
appearance: ResolvedAppearance
|
|
417
|
-
colors: ThemeColors
|
|
418
|
-
terminal: ThemeTerminalPalette
|
|
419
|
-
editor: ThemeEditorRoles
|
|
420
|
-
charts: ThemeChartRoles
|
|
421
|
-
}>
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* The independent per-appearance theme selection (Zeron `ThemeSelection`,
|
|
425
|
-
* carrying the V2 preference's field names).
|
|
426
|
-
*/
|
|
427
|
-
export type ThemeSelection = Readonly<{ lightThemeId: string; darkThemeId: string }>
|
|
428
|
-
|
|
429
|
-
export function themeSelectionVariantId(
|
|
430
|
-
selection: ThemeSelection,
|
|
431
|
-
appearance: ResolvedAppearance
|
|
432
|
-
): string {
|
|
433
|
-
return appearance === 'dark' ? selection.darkThemeId : selection.lightThemeId
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
export type ValidationIssue = Readonly<{
|
|
437
|
-
variantId: string
|
|
438
|
-
severity: 'error' | 'warning'
|
|
439
|
-
message: string
|
|
440
|
-
}>
|
|
441
|
-
|
|
442
|
-
/**
|
|
443
|
-
* Registry validation, ported from Zeron `ThemeRegistry::validate`: core text
|
|
444
|
-
* and muted text must reach 4.5:1, the accent 3:1, on-accent 4.5:1, the
|
|
445
|
-
* terminal foreground 4.5:1, and every chromatic ANSI slot 3:1 (slots 0 and 8
|
|
446
|
-
* are structural black/dim colors). Provenance completeness is a Zeron
|
|
447
|
-
* library concept; M12 ships only built-ins, so the structural check here is
|
|
448
|
-
* id/non-empty-color integrity.
|
|
449
|
-
*/
|
|
450
|
-
export function validateThemeRegistry(registry: readonly ThemeVariant[]): ValidationIssue[] {
|
|
451
|
-
const issues: ValidationIssue[] = []
|
|
452
|
-
const seen = new Set<string>()
|
|
453
|
-
for (const variant of registry) {
|
|
454
|
-
if (variant.id.trim().length === 0 || seen.has(variant.id)) {
|
|
455
|
-
issues.push({
|
|
456
|
-
variantId: variant.id,
|
|
457
|
-
severity: 'error',
|
|
458
|
-
message: 'variant id must be unique',
|
|
459
|
-
})
|
|
460
|
-
}
|
|
461
|
-
seen.add(variant.id)
|
|
462
|
-
const check = (role: string, foreground: string, background: string, minimum: number) => {
|
|
463
|
-
const actual = contrastRatio(foreground, background)
|
|
464
|
-
if (actual < minimum) {
|
|
465
|
-
issues.push({
|
|
466
|
-
variantId: variant.id,
|
|
467
|
-
severity: 'error',
|
|
468
|
-
message: `${role} contrast is ${actual.toFixed(2)}:1; expected ${minimum.toFixed(1)}:1`,
|
|
469
|
-
})
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
check('text', variant.colors.foreground, variant.colors.background, 4.5)
|
|
473
|
-
check('muted text', variant.colors.mutedForeground, variant.colors.background, 4.5)
|
|
474
|
-
check('primary', variant.colors.primary, variant.colors.background, 3)
|
|
475
|
-
check('on-primary', variant.colors.primaryForeground, variant.colors.primary, 4.5)
|
|
476
|
-
check('terminal foreground', variant.terminal.foreground, variant.terminal.background, 4.5)
|
|
477
|
-
for (const [index, color] of variant.terminal.ansi.entries()) {
|
|
478
|
-
if (index % 8 === 0) continue
|
|
479
|
-
const actual = contrastRatio(color, variant.terminal.background)
|
|
480
|
-
if (actual < 3) {
|
|
481
|
-
issues.push({
|
|
482
|
-
variantId: variant.id,
|
|
483
|
-
severity: 'warning',
|
|
484
|
-
message: `terminal ANSI slot ${index} is below 3:1`,
|
|
485
|
-
})
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
check('editor comment', variant.editor.comment, variant.colors.background, 4.5)
|
|
489
|
-
check('diff delete', variant.editor.diffDelete, variant.colors.background, 3)
|
|
490
|
-
check('diff add', variant.editor.diffAdd, variant.colors.background, 3)
|
|
491
|
-
}
|
|
492
|
-
return issues
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* Resolve the variant for a selection, falling back deterministically to the
|
|
497
|
-
* default variant of the same appearance when the stored id is missing or
|
|
498
|
-
* broken — a corrupt preference degrades the palette, never the UI.
|
|
499
|
-
* (Zeron `ThemeRegistry::resolve`.)
|
|
500
|
-
*/
|
|
501
|
-
export function resolveThemeVariant(
|
|
502
|
-
registry: readonly ThemeVariant[],
|
|
503
|
-
selection: ThemeSelection,
|
|
504
|
-
appearance: ResolvedAppearance
|
|
505
|
-
): ThemeVariant {
|
|
506
|
-
const wanted = themeSelectionVariantId(selection, appearance)
|
|
507
|
-
const found = registry.find((variant) => variant.id === wanted)
|
|
508
|
-
if (found) return found
|
|
509
|
-
const fallbackId =
|
|
510
|
-
appearance === 'dark'
|
|
511
|
-
? defaultAppearancePreferences.darkThemeId
|
|
512
|
-
: defaultAppearancePreferences.lightThemeId
|
|
513
|
-
const fallback = registry.find((variant) => variant.id === fallbackId)
|
|
514
|
-
if (fallback) return fallback
|
|
515
|
-
const sameAppearance = registry.find((variant) => variant.appearance === appearance)
|
|
516
|
-
if (sameAppearance) return sameAppearance
|
|
517
|
-
return registry[0]!
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
/*
|
|
521
|
-
* Built-in registry — Adea's curated M12 set. `adea-light`/`adea-dark` mirror
|
|
522
|
-
* the token declarations in `styles/theme.css` (which stay authoritative for
|
|
523
|
-
* the defaults so first paint never shifts); `slate` is a cool quiet pair and
|
|
524
|
-
* `contrast` an AA-emphasized pair. Terminal/editor/charts ship one curated
|
|
525
|
-
* template per appearance so every variant keeps ANSI/syntax/diff legibility.
|
|
526
|
-
*/
|
|
527
|
-
|
|
528
|
-
const lightTerminal: ThemeTerminalPalette = Object.freeze({
|
|
529
|
-
background: '#ffffff',
|
|
530
|
-
foreground: '#1b1f24',
|
|
531
|
-
cursor: '#24292f',
|
|
532
|
-
selection: '#b6c7ff',
|
|
533
|
-
ansi: Object.freeze([
|
|
534
|
-
'#1b1f24',
|
|
535
|
-
'#b91c1c',
|
|
536
|
-
'#116a2e',
|
|
537
|
-
'#8a5a1b',
|
|
538
|
-
'#0b57d0',
|
|
539
|
-
'#a0186f',
|
|
540
|
-
'#0e7490',
|
|
541
|
-
'#57606a',
|
|
542
|
-
'#57606a',
|
|
543
|
-
'#c94d4d',
|
|
544
|
-
'#1f9d4f',
|
|
545
|
-
'#a9752c',
|
|
546
|
-
'#3b82f6',
|
|
547
|
-
'#c04a92',
|
|
548
|
-
'#0891b2',
|
|
549
|
-
'#24292f',
|
|
550
|
-
]),
|
|
551
|
-
})
|
|
552
|
-
|
|
553
|
-
const darkTerminal: ThemeTerminalPalette = Object.freeze({
|
|
554
|
-
background: '#0d1117',
|
|
555
|
-
foreground: '#e6edf3',
|
|
556
|
-
cursor: '#e6edf3',
|
|
557
|
-
selection: '#264f78',
|
|
558
|
-
ansi: Object.freeze([
|
|
559
|
-
'#2f3742',
|
|
560
|
-
'#ff8183',
|
|
561
|
-
'#56d364',
|
|
562
|
-
'#e3b341',
|
|
563
|
-
'#6ca4f8',
|
|
564
|
-
'#db61a2',
|
|
565
|
-
'#39c5cf',
|
|
566
|
-
'#d5dde5',
|
|
567
|
-
'#57606a',
|
|
568
|
-
'#ff9494',
|
|
569
|
-
'#79dd8a',
|
|
570
|
-
'#f0c264',
|
|
571
|
-
'#8db9ff',
|
|
572
|
-
'#e87cb4',
|
|
573
|
-
'#66d3dc',
|
|
574
|
-
'#eef2f6',
|
|
575
|
-
]),
|
|
576
|
-
})
|
|
577
|
-
|
|
578
|
-
const lightEditor: ThemeEditorRoles = Object.freeze({
|
|
579
|
-
keyword: '#0b57d0',
|
|
580
|
-
string: '#116a2e',
|
|
581
|
-
number: '#8a5a1b',
|
|
582
|
-
comment: '#57606a',
|
|
583
|
-
function: '#a0186f',
|
|
584
|
-
variable: '#1b1f24',
|
|
585
|
-
type: '#0e7490',
|
|
586
|
-
tag: '#b91c1c',
|
|
587
|
-
attribute: '#8a5a1b',
|
|
588
|
-
operator: '#1b1f24',
|
|
589
|
-
heading: '#1b1f24',
|
|
590
|
-
link: '#0b57d0',
|
|
591
|
-
diffAdd: '#116a2e',
|
|
592
|
-
diffDelete: '#b91c1c',
|
|
593
|
-
diffHunk: '#57606a',
|
|
594
|
-
searchMatch: '#8a5a1b',
|
|
595
|
-
})
|
|
596
|
-
|
|
597
|
-
const darkEditor: ThemeEditorRoles = Object.freeze({
|
|
598
|
-
keyword: '#6ca4f8',
|
|
599
|
-
string: '#56d364',
|
|
600
|
-
number: '#e3b341',
|
|
601
|
-
comment: '#8b949e',
|
|
602
|
-
function: '#db61a2',
|
|
603
|
-
variable: '#e6edf3',
|
|
604
|
-
type: '#39c5cf',
|
|
605
|
-
tag: '#ff8183',
|
|
606
|
-
attribute: '#e3b341',
|
|
607
|
-
operator: '#e6edf3',
|
|
608
|
-
heading: '#e6edf3',
|
|
609
|
-
link: '#6ca4f8',
|
|
610
|
-
diffAdd: '#56d364',
|
|
611
|
-
diffDelete: '#ff8183',
|
|
612
|
-
diffHunk: '#8b949e',
|
|
613
|
-
searchMatch: '#e3b341',
|
|
614
|
-
})
|
|
615
|
-
|
|
616
|
-
const lightCharts: ThemeChartRoles = Object.freeze({
|
|
617
|
-
chart1: '#0b57d0',
|
|
618
|
-
chart2: '#116a2e',
|
|
619
|
-
chart3: '#8a5a1b',
|
|
620
|
-
chart4: '#a0186f',
|
|
621
|
-
chart5: '#0e7490',
|
|
622
|
-
chart6: '#57606a',
|
|
623
|
-
})
|
|
624
|
-
|
|
625
|
-
const darkCharts: ThemeChartRoles = Object.freeze({
|
|
626
|
-
chart1: '#6ca4f8',
|
|
627
|
-
chart2: '#56d364',
|
|
628
|
-
chart3: '#e3b341',
|
|
629
|
-
chart4: '#db61a2',
|
|
630
|
-
chart5: '#39c5cf',
|
|
631
|
-
chart6: '#8b949e',
|
|
632
|
-
})
|
|
633
|
-
|
|
634
|
-
function defineVariant(
|
|
635
|
-
id: string,
|
|
636
|
-
familyId: string,
|
|
637
|
-
familyName: string,
|
|
638
|
-
name: string,
|
|
639
|
-
appearance: ResolvedAppearance,
|
|
640
|
-
colors: ThemeColors
|
|
641
|
-
): ThemeVariant {
|
|
642
|
-
const light = appearance === 'light'
|
|
643
|
-
return {
|
|
644
|
-
id,
|
|
645
|
-
familyId,
|
|
646
|
-
familyName,
|
|
647
|
-
name,
|
|
648
|
-
appearance,
|
|
649
|
-
colors,
|
|
650
|
-
terminal: light ? lightTerminal : darkTerminal,
|
|
651
|
-
editor: light ? lightEditor : darkEditor,
|
|
652
|
-
charts: light ? lightCharts : darkCharts,
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
/** The `adea-light`/`adea-dark` entries mirror `styles/theme.css`. */
|
|
657
|
-
export const builtinThemeRegistry: readonly ThemeVariant[] = Object.freeze([
|
|
658
|
-
defineVariant('adea-light', 'adea', 'Adea', 'Adea Light', 'light', {
|
|
659
|
-
background: '#ffffff',
|
|
660
|
-
foreground: '#252525',
|
|
661
|
-
card: '#ffffff',
|
|
662
|
-
cardForeground: '#252525',
|
|
663
|
-
popover: '#ffffff',
|
|
664
|
-
popoverForeground: '#252525',
|
|
665
|
-
primary: '#343434',
|
|
666
|
-
primaryForeground: '#fcfcfc',
|
|
667
|
-
secondary: '#f7f7f7',
|
|
668
|
-
secondaryForeground: '#343434',
|
|
669
|
-
muted: '#f7f7f7',
|
|
670
|
-
mutedForeground: '#6f6f6f',
|
|
671
|
-
accent: '#f7f7f7',
|
|
672
|
-
accentForeground: '#343434',
|
|
673
|
-
destructive: '#c53c2b',
|
|
674
|
-
success: '#1a7f37',
|
|
675
|
-
border: '#ebebeb',
|
|
676
|
-
input: '#ebebeb',
|
|
677
|
-
ring: '#a3a3a3',
|
|
678
|
-
}),
|
|
679
|
-
defineVariant('adea-dark', 'adea', 'Adea', 'Adea Dark', 'dark', {
|
|
680
|
-
background: '#252525',
|
|
681
|
-
foreground: '#fcfcfc',
|
|
682
|
-
card: '#343434',
|
|
683
|
-
cardForeground: '#fcfcfc',
|
|
684
|
-
popover: '#343434',
|
|
685
|
-
popoverForeground: '#fcfcfc',
|
|
686
|
-
primary: '#ebebeb',
|
|
687
|
-
primaryForeground: '#343434',
|
|
688
|
-
secondary: '#444444',
|
|
689
|
-
secondaryForeground: '#fcfcfc',
|
|
690
|
-
muted: '#444444',
|
|
691
|
-
mutedForeground: '#a3a3a3',
|
|
692
|
-
accent: '#444444',
|
|
693
|
-
accentForeground: '#fcfcfc',
|
|
694
|
-
destructive: '#e07060',
|
|
695
|
-
success: '#3fb950',
|
|
696
|
-
border: 'rgba(255, 255, 255, 0.16)',
|
|
697
|
-
input: 'rgba(255, 255, 255, 0.2)',
|
|
698
|
-
ring: '#7c7c7c',
|
|
699
|
-
}),
|
|
700
|
-
defineVariant('slate-light', 'slate', 'Slate', 'Slate Light', 'light', {
|
|
701
|
-
background: '#f8fafc',
|
|
702
|
-
foreground: '#0f172a',
|
|
703
|
-
card: '#ffffff',
|
|
704
|
-
cardForeground: '#0f172a',
|
|
705
|
-
popover: '#ffffff',
|
|
706
|
-
popoverForeground: '#0f172a',
|
|
707
|
-
primary: '#0f172a',
|
|
708
|
-
primaryForeground: '#f8fafc',
|
|
709
|
-
secondary: '#e2e8f0',
|
|
710
|
-
secondaryForeground: '#0f172a',
|
|
711
|
-
muted: '#e2e8f0',
|
|
712
|
-
mutedForeground: '#475569',
|
|
713
|
-
accent: '#e2e8f0',
|
|
714
|
-
accentForeground: '#0f172a',
|
|
715
|
-
destructive: '#b91c1c',
|
|
716
|
-
success: '#15803d',
|
|
717
|
-
border: '#cbd5e1',
|
|
718
|
-
input: '#cbd5e1',
|
|
719
|
-
ring: '#64748b',
|
|
720
|
-
}),
|
|
721
|
-
defineVariant('slate-dark', 'slate', 'Slate', 'Slate Dark', 'dark', {
|
|
722
|
-
background: '#0f172a',
|
|
723
|
-
foreground: '#f1f5f9',
|
|
724
|
-
card: '#1e293b',
|
|
725
|
-
cardForeground: '#f1f5f9',
|
|
726
|
-
popover: '#1e293b',
|
|
727
|
-
popoverForeground: '#f1f5f9',
|
|
728
|
-
primary: '#e2e8f0',
|
|
729
|
-
primaryForeground: '#0f172a',
|
|
730
|
-
secondary: '#334155',
|
|
731
|
-
secondaryForeground: '#f1f5f9',
|
|
732
|
-
muted: '#334155',
|
|
733
|
-
mutedForeground: '#94a3b8',
|
|
734
|
-
accent: '#334155',
|
|
735
|
-
accentForeground: '#f1f5f9',
|
|
736
|
-
destructive: '#f87171',
|
|
737
|
-
success: '#4ade80',
|
|
738
|
-
border: 'rgba(148, 163, 184, 0.2)',
|
|
739
|
-
input: 'rgba(148, 163, 184, 0.25)',
|
|
740
|
-
ring: '#64748b',
|
|
741
|
-
}),
|
|
742
|
-
defineVariant('contrast-light', 'contrast', 'High Contrast', 'High Contrast Light', 'light', {
|
|
743
|
-
background: '#ffffff',
|
|
744
|
-
foreground: '#000000',
|
|
745
|
-
card: '#ffffff',
|
|
746
|
-
cardForeground: '#000000',
|
|
747
|
-
popover: '#ffffff',
|
|
748
|
-
popoverForeground: '#000000',
|
|
749
|
-
primary: '#143d8f',
|
|
750
|
-
primaryForeground: '#ffffff',
|
|
751
|
-
secondary: '#f0f0f0',
|
|
752
|
-
secondaryForeground: '#000000',
|
|
753
|
-
muted: '#f0f0f0',
|
|
754
|
-
mutedForeground: '#333333',
|
|
755
|
-
accent: '#f0f0f0',
|
|
756
|
-
accentForeground: '#000000',
|
|
757
|
-
destructive: '#b91c1c',
|
|
758
|
-
success: '#14532d',
|
|
759
|
-
border: '#767676',
|
|
760
|
-
input: '#767676',
|
|
761
|
-
ring: '#000000',
|
|
762
|
-
}),
|
|
763
|
-
defineVariant('contrast-dark', 'contrast', 'High Contrast', 'High Contrast Dark', 'dark', {
|
|
764
|
-
background: '#000000',
|
|
765
|
-
foreground: '#ffffff',
|
|
766
|
-
card: '#0a0a0a',
|
|
767
|
-
cardForeground: '#ffffff',
|
|
768
|
-
popover: '#0a0a0a',
|
|
769
|
-
popoverForeground: '#ffffff',
|
|
770
|
-
primary: '#8ab4ff',
|
|
771
|
-
primaryForeground: '#000000',
|
|
772
|
-
secondary: '#1a1a1a',
|
|
773
|
-
secondaryForeground: '#ffffff',
|
|
774
|
-
muted: '#1a1a1a',
|
|
775
|
-
mutedForeground: '#e5e5e5',
|
|
776
|
-
accent: '#1a1a1a',
|
|
777
|
-
accentForeground: '#ffffff',
|
|
778
|
-
destructive: '#ff6b6b',
|
|
779
|
-
success: '#4ade80',
|
|
780
|
-
border: '#8f8f8f',
|
|
781
|
-
input: '#8f8f8f',
|
|
782
|
-
ring: '#ffffff',
|
|
783
|
-
}),
|
|
784
|
-
])
|
|
785
|
-
|
|
786
|
-
/*
|
|
787
|
-
* Preference storage: normalization, legacy migration, corrupt retention.
|
|
788
|
-
*/
|
|
789
|
-
|
|
790
|
-
function normalizeMode(value: unknown): AppearanceMode {
|
|
791
|
-
return value === 'light' || value === 'dark' || value === 'system' ? value : 'system'
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
function normalizeSurface(value: unknown): SurfacePreference {
|
|
795
|
-
return value === 'frosted' || value === 'translucent' || value === 'opaque' ? value : 'opaque'
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
function normalizeThemeId(value: unknown, fallback: string): string {
|
|
799
|
-
return typeof value === 'string' && value.trim().length > 0 ? value : fallback
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
function normalizeAccent(value: unknown): string {
|
|
803
|
-
if (value === 'theme') return 'theme'
|
|
804
|
-
if (typeof value !== 'string') return 'theme'
|
|
805
|
-
if (accentPresetById(value)) return value
|
|
806
|
-
const parsed = parseColor(value)
|
|
807
|
-
return parsed ? colorToHex(parsed) : 'theme'
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
export type NormalizedPreferences = Readonly<{
|
|
811
|
-
/** The strict v2 document, with every unknown field corrected to defaults. */
|
|
812
|
-
value: AppearancePreferencesV2
|
|
813
|
-
/**
|
|
814
|
-
* The raw stored document when it was not a valid v2 record. Retained so a
|
|
815
|
-
* future version (or a repaired write) never loses the user's data.
|
|
816
|
-
*/
|
|
817
|
-
retainedRaw?: unknown
|
|
818
|
-
}>
|
|
819
|
-
|
|
820
|
-
/**
|
|
821
|
-
* Parse a stored appearance document. Anything that is not a strict version-2
|
|
822
|
-
* record falls back to the defaults and keeps the raw value for retention;
|
|
823
|
-
* individual unknown values inside a v2 record are corrected field by field.
|
|
824
|
-
*/
|
|
825
|
-
export function normalizeAppearancePreferences(raw: unknown): NormalizedPreferences {
|
|
826
|
-
if (typeof raw !== 'object' || raw === null || (raw as { version?: unknown }).version !== 2) {
|
|
827
|
-
return { value: defaultAppearancePreferences, retainedRaw: raw }
|
|
828
|
-
}
|
|
829
|
-
const record = raw as Record<string, unknown>
|
|
830
|
-
return {
|
|
831
|
-
value: {
|
|
832
|
-
version: 2,
|
|
833
|
-
mode: normalizeMode(record.mode),
|
|
834
|
-
lightThemeId: normalizeThemeId(
|
|
835
|
-
record.lightThemeId,
|
|
836
|
-
defaultAppearancePreferences.lightThemeId
|
|
837
|
-
),
|
|
838
|
-
darkThemeId: normalizeThemeId(record.darkThemeId, defaultAppearancePreferences.darkThemeId),
|
|
839
|
-
accent: normalizeAccent(record.accent),
|
|
840
|
-
surface: normalizeSurface(record.surface),
|
|
841
|
-
reduceTransparency: record.reduceTransparency === true,
|
|
842
|
-
},
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
/** The legacy single-key preference, mapped into v2 during migration. */
|
|
847
|
-
export function migrateLegacyThemeValue(
|
|
848
|
-
stored: string | null
|
|
849
|
-
): AppearancePreferencesV2 | undefined {
|
|
850
|
-
if (stored !== 'light' && stored !== 'dark' && stored !== 'system') return undefined
|
|
851
|
-
return { ...defaultAppearancePreferences, mode: stored }
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
type AppearanceStorage = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>
|
|
855
|
-
|
|
856
|
-
/**
|
|
857
|
-
* Quarantine an unread raw document into the recovery envelope. Runs at read
|
|
858
|
-
* time — before any later write can overwrite the main key — and is
|
|
859
|
-
* idempotent: re-reading the same unread value refreshes the capture without
|
|
860
|
-
* losing it.
|
|
861
|
-
*/
|
|
862
|
-
function retainRecoveryEnvelope(
|
|
863
|
-
storage: AppearanceStorage,
|
|
864
|
-
raw: string,
|
|
865
|
-
reason: AppearanceRecoveryEnvelope['reason']
|
|
866
|
-
): void {
|
|
867
|
-
try {
|
|
868
|
-
const envelope: AppearanceRecoveryEnvelope = {
|
|
869
|
-
schemaVersion: 1,
|
|
870
|
-
reason,
|
|
871
|
-
capturedAt: new Date().toISOString(),
|
|
872
|
-
raw,
|
|
873
|
-
}
|
|
874
|
-
storage.setItem(APPEARANCE_RECOVERY_STORAGE_KEY, JSON.stringify(envelope))
|
|
875
|
-
} catch {
|
|
876
|
-
// Quarantine is best-effort; the active preference still fails closed.
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
/**
|
|
881
|
-
* Read the appearance preferences: the v2 key first, then the legacy `theme`
|
|
882
|
-
* key, then defaults. A malformed or future-version document is quarantined
|
|
883
|
-
* into the recovery envelope and the defaults are returned; storage failures
|
|
884
|
-
* degrade to defaults like every other blocked-storage consumer.
|
|
885
|
-
*/
|
|
886
|
-
export function readAppearancePreferences(
|
|
887
|
-
storage: AppearanceStorage | undefined
|
|
888
|
-
): AppearancePreferencesV2 {
|
|
889
|
-
if (!storage) return defaultAppearancePreferences
|
|
890
|
-
try {
|
|
891
|
-
const raw = storage.getItem(APPEARANCE_STORAGE_KEY)
|
|
892
|
-
if (raw !== null) {
|
|
893
|
-
let parsed: unknown
|
|
894
|
-
try {
|
|
895
|
-
parsed = JSON.parse(raw)
|
|
896
|
-
} catch {
|
|
897
|
-
retainRecoveryEnvelope(storage, raw, 'corrupt_json')
|
|
898
|
-
return defaultAppearancePreferences
|
|
899
|
-
}
|
|
900
|
-
const normalized = normalizeAppearancePreferences(parsed)
|
|
901
|
-
if (normalized.retainedRaw !== undefined) {
|
|
902
|
-
retainRecoveryEnvelope(
|
|
903
|
-
storage,
|
|
904
|
-
raw,
|
|
905
|
-
typeof parsed === 'object' && parsed !== null ? 'unsupported_record' : 'corrupt_json'
|
|
906
|
-
)
|
|
907
|
-
}
|
|
908
|
-
return normalized.value
|
|
909
|
-
}
|
|
910
|
-
return (
|
|
911
|
-
migrateLegacyThemeValue(storage.getItem(LEGACY_THEME_STORAGE_KEY)) ??
|
|
912
|
-
defaultAppearancePreferences
|
|
913
|
-
)
|
|
914
|
-
} catch {
|
|
915
|
-
return defaultAppearancePreferences
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
export function writeAppearancePreferences(
|
|
920
|
-
storage: AppearanceStorage | undefined,
|
|
921
|
-
preferences: AppearancePreferencesV2
|
|
922
|
-
): void {
|
|
923
|
-
if (!storage) return
|
|
924
|
-
try {
|
|
925
|
-
storage.setItem(APPEARANCE_STORAGE_KEY, JSON.stringify(preferences))
|
|
926
|
-
} catch {
|
|
927
|
-
// Persistence is best-effort: private modes and full quotas keep the
|
|
928
|
-
// in-memory preference.
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
/*
|
|
933
|
-
* Document application. Both the provider and the no-flash inline script
|
|
934
|
-
* resolve preferences to the same document shape, so a pre-paint restore and
|
|
935
|
-
* a live change cannot disagree.
|
|
936
|
-
*/
|
|
937
|
-
|
|
938
|
-
export type ResolvedAppearanceState = Readonly<{
|
|
939
|
-
resolvedMode: ResolvedAppearance
|
|
940
|
-
variant: ThemeVariant
|
|
941
|
-
accent: AccentRoles
|
|
942
|
-
effectiveSurface: EffectiveSurface
|
|
943
|
-
reduceTransparencyActive: boolean
|
|
944
|
-
}>
|
|
945
|
-
|
|
946
|
-
/** Resolve preferences against the environment into the applied document state. */
|
|
947
|
-
export function resolveAppearanceState(
|
|
948
|
-
preferences: AppearancePreferencesV2,
|
|
949
|
-
environment: Readonly<{
|
|
950
|
-
systemAppearance: ResolvedAppearance
|
|
951
|
-
osReducedTransparency: boolean
|
|
952
|
-
nativeTranslucency: boolean
|
|
953
|
-
}>,
|
|
954
|
-
registry: readonly ThemeVariant[] = builtinThemeRegistry
|
|
955
|
-
): ResolvedAppearanceState {
|
|
956
|
-
const resolvedMode = resolveAppearanceMode(preferences.mode, environment.systemAppearance)
|
|
957
|
-
const variant = resolveThemeVariant(registry, preferences, resolvedMode)
|
|
958
|
-
return {
|
|
959
|
-
resolvedMode,
|
|
960
|
-
variant,
|
|
961
|
-
accent: deriveAccentRoles(preferences.accent, variant),
|
|
962
|
-
effectiveSurface: resolveSurface(preferences.surface, {
|
|
963
|
-
osReducedTransparency: environment.osReducedTransparency,
|
|
964
|
-
userReducedTransparency: preferences.reduceTransparency,
|
|
965
|
-
nativeTranslucency: environment.nativeTranslucency,
|
|
966
|
-
}),
|
|
967
|
-
reduceTransparencyActive: environment.osReducedTransparency || preferences.reduceTransparency,
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
const SURFACE_BACKGROUND_ALPHA: Record<EffectiveSurface, string> = {
|
|
972
|
-
opaque: '1',
|
|
973
|
-
frosted: '0.92',
|
|
974
|
-
translucent: '0.8',
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
/**
|
|
978
|
-
* The custom properties a non-default variant owns, as a flat map. This one
|
|
979
|
-
* mapping feeds both the live provider and the pre-paint no-flash script, so
|
|
980
|
-
* a restored first paint and a later live switch cannot disagree. Default
|
|
981
|
-
* variants return an empty map: `styles/theme.css` declares those tokens.
|
|
982
|
-
*/
|
|
983
|
-
export function flatVariantTokens(variant: ThemeVariant): Record<string, string> {
|
|
984
|
-
if (isDefaultVariant(variant)) return {}
|
|
985
|
-
const tokens: Record<string, string> = {}
|
|
986
|
-
for (const [role, value] of Object.entries(variant.colors)) {
|
|
987
|
-
tokens[`--${kebabCase(role)}`] = value
|
|
988
|
-
}
|
|
989
|
-
const terminal = variant.terminal
|
|
990
|
-
tokens['--terminal-background'] = terminal.background
|
|
991
|
-
tokens['--terminal-foreground'] = terminal.foreground
|
|
992
|
-
tokens['--terminal-cursor'] = terminal.cursor
|
|
993
|
-
tokens['--terminal-selection'] = terminal.selection
|
|
994
|
-
const ansiNames = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']
|
|
995
|
-
for (const [index, color] of terminal.ansi.entries()) {
|
|
996
|
-
const name = ansiNames[index % 8]!
|
|
997
|
-
tokens[index < 8 ? `--terminal-ansi-${name}` : `--terminal-ansi-bright-${name}`] = color
|
|
998
|
-
}
|
|
999
|
-
for (const [role, value] of Object.entries(variant.editor)) {
|
|
1000
|
-
tokens[`--editor-${kebabCase(role)}`] = value
|
|
1001
|
-
}
|
|
1002
|
-
for (const [index, value] of Object.values(variant.charts).entries()) {
|
|
1003
|
-
tokens[`--chart-${index + 1}`] = value
|
|
1004
|
-
}
|
|
1005
|
-
return tokens
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
/**
|
|
1009
|
-
* Apply a resolved state to a document: the `dark` class and color scheme for
|
|
1010
|
-
* the palette, the diagnostic data attributes, the accent role overrides, and
|
|
1011
|
-
* the resolved variant's semantic tokens (including terminal ANSI and editor
|
|
1012
|
-
* roles). CSS custom properties cascade, so terminals and editors update live
|
|
1013
|
-
* without remounting.
|
|
1014
|
-
*
|
|
1015
|
-
* The default `adea-light`/`adea-dark` variants skip the palette override —
|
|
1016
|
-
* `styles/theme.css` declares those tokens already, and leaving them CSS-owned
|
|
1017
|
-
* keeps first paint byte-identical to the pre-#425 app.
|
|
1018
|
-
*/
|
|
1019
|
-
export function applyAppearanceToDocument(
|
|
1020
|
-
document: Document,
|
|
1021
|
-
state: ResolvedAppearanceState
|
|
1022
|
-
): void {
|
|
1023
|
-
const root = document.documentElement
|
|
1024
|
-
const style = root.style
|
|
1025
|
-
|
|
1026
|
-
root.classList.toggle('dark', state.resolvedMode === 'dark')
|
|
1027
|
-
style.colorScheme = state.resolvedMode
|
|
1028
|
-
root.dataset.theme = state.variant.id
|
|
1029
|
-
root.dataset.appearanceMode = state.resolvedMode
|
|
1030
|
-
root.dataset.surface = state.effectiveSurface
|
|
1031
|
-
root.dataset.accent = state.accent.overrides ? 'custom' : 'theme'
|
|
1032
|
-
root.dataset.reduceTransparency = state.reduceTransparencyActive ? 'true' : 'false'
|
|
1033
|
-
|
|
1034
|
-
const setToken = (name: string, value: string) => style.setProperty(name, value)
|
|
1035
|
-
setToken('--surface-alpha', SURFACE_BACKGROUND_ALPHA[state.effectiveSurface])
|
|
1036
|
-
// `theme` keeps every interactive role CSS-owned; an override touches only
|
|
1037
|
-
// the accent roles, never the surface or text palette. Returning to
|
|
1038
|
-
// `theme` must also *remove* a previous override's inline properties — they
|
|
1039
|
-
// beat the stylesheet, so leaving them behind made "Theme default" look like
|
|
1040
|
-
// a dead button after any preset or custom accent had been used.
|
|
1041
|
-
if (state.accent.overrides) {
|
|
1042
|
-
setToken('--primary', state.accent.primary)
|
|
1043
|
-
setToken('--primary-foreground', state.accent.onPrimary)
|
|
1044
|
-
setToken('--ring', state.accent.ring)
|
|
1045
|
-
} else {
|
|
1046
|
-
style.removeProperty('--primary')
|
|
1047
|
-
style.removeProperty('--primary-foreground')
|
|
1048
|
-
style.removeProperty('--ring')
|
|
1049
|
-
}
|
|
1050
|
-
for (const [name, value] of Object.entries(flatVariantTokens(state.variant))) {
|
|
1051
|
-
setToken(name, value)
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
/**
|
|
1056
|
-
* The no-flash preload script rendered in the document head. It re-resolves
|
|
1057
|
-
* the stored (or legacy) preference against the OS before first paint and
|
|
1058
|
-
* applies the same palette state the provider would, so hydration never shows
|
|
1059
|
-
* the wrong palette. Accent overrides land with the provider: they decorate
|
|
1060
|
-
* the resolved palette and cannot produce a wrong-palette flash.
|
|
1061
|
-
*/
|
|
1062
|
-
export function appearanceThemeScript(): string {
|
|
1063
|
-
const preload = builtinThemeRegistry.map((variant) => ({
|
|
1064
|
-
id: variant.id,
|
|
1065
|
-
dark: variant.appearance === 'dark',
|
|
1066
|
-
tokens: flatVariantTokens(variant),
|
|
1067
|
-
}))
|
|
1068
|
-
const registry = JSON.stringify(preload)
|
|
1069
|
-
const alpha = JSON.stringify(SURFACE_BACKGROUND_ALPHA)
|
|
1070
|
-
return `(function(){try{
|
|
1071
|
-
var prefs=null;var raw=null;
|
|
1072
|
-
try{raw=localStorage.getItem('${APPEARANCE_STORAGE_KEY}')}catch(e){}
|
|
1073
|
-
if(raw){try{var parsed=JSON.parse(raw);if(parsed&&parsed.version===2)prefs=parsed}catch(e){}}
|
|
1074
|
-
var mode='system';
|
|
1075
|
-
if(prefs){if(prefs.mode==='light'||prefs.mode==='dark')mode=prefs.mode}
|
|
1076
|
-
else{try{var t=localStorage.getItem('${LEGACY_THEME_STORAGE_KEY}');if(t==='light'||t==='dark')mode=t}catch(e){}}
|
|
1077
|
-
var dark=mode==='dark'||(mode==='system'&&window.matchMedia('${DARK_QUERY}').matches);
|
|
1078
|
-
var registry=${registry};
|
|
1079
|
-
var wanted=dark?(prefs&&prefs.darkThemeId)||'${defaultAppearancePreferences.darkThemeId}':(prefs&&prefs.lightThemeId)||'${defaultAppearancePreferences.lightThemeId}';
|
|
1080
|
-
var variant=null;
|
|
1081
|
-
for(var i=0;i<registry.length;i++){if(registry[i].id===wanted)variant=registry[i]}
|
|
1082
|
-
if(!variant){for(var j=0;j<registry.length;j++){if(registry[j].dark===dark)variant=registry[j]}}
|
|
1083
|
-
if(!variant)variant=registry[0];
|
|
1084
|
-
var reduce=window.matchMedia('${REDUCED_TRANSPARENCY_QUERY}').matches||!!(prefs&&prefs.reduceTransparency);
|
|
1085
|
-
/* Pre-hydration the host translucency capability is unknown, so the script
|
|
1086
|
-
resolves every glass request to the conservative frosted tokens; the
|
|
1087
|
-
provider re-resolves with the real capability once mounted. */
|
|
1088
|
-
var surface=reduce?'opaque':(prefs&&prefs.surface==='frosted'||prefs&&prefs.surface==='translucent'?'frosted':'opaque');
|
|
1089
|
-
if(surface!=='opaque'&&surface!=='frosted')surface='opaque';
|
|
1090
|
-
var r=document.documentElement,s=r.style;
|
|
1091
|
-
r.classList.toggle('dark',dark);
|
|
1092
|
-
s.colorScheme=dark?'dark':'light';
|
|
1093
|
-
r.dataset.theme=variant.id;
|
|
1094
|
-
r.dataset.appearanceMode=mode;
|
|
1095
|
-
r.dataset.surface=surface;
|
|
1096
|
-
r.dataset.reduceTransparency=reduce?'true':'false';
|
|
1097
|
-
s.setProperty('--surface-alpha',${alpha}[surface]||'1');
|
|
1098
|
-
var tokens=variant.tokens||{};
|
|
1099
|
-
for(var name in tokens){s.setProperty(name,tokens[name])}
|
|
1100
|
-
}catch(e){}})();`
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
function isDefaultVariant(variant: ThemeVariant): boolean {
|
|
1104
|
-
return (
|
|
1105
|
-
variant.id === defaultAppearancePreferences.lightThemeId ||
|
|
1106
|
-
variant.id === defaultAppearancePreferences.darkThemeId
|
|
1107
|
-
)
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
function kebabCase(value: string): string {
|
|
1111
|
-
return value.replaceAll(/[A-Z]/g, (character) => `-${character.toLocaleLowerCase()}`)
|
|
1112
|
-
}
|