@calliopelabs/ui 0.13.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +192 -4
  2. package/dist/agent/AgentChat.d.ts +63 -0
  3. package/dist/agent/AgentChat.js +117 -0
  4. package/dist/agent/AgentLauncher.d.ts +25 -0
  5. package/dist/agent/AgentLauncher.js +25 -0
  6. package/dist/agent/AgentProvider.d.ts +82 -0
  7. package/dist/agent/AgentProvider.js +176 -0
  8. package/dist/agent/CalliopeAgent.d.ts +43 -0
  9. package/dist/agent/CalliopeAgent.js +111 -0
  10. package/dist/agent/WorkflowRenderers.d.ts +61 -0
  11. package/dist/agent/WorkflowRenderers.js +102 -0
  12. package/dist/agent/controller.d.ts +167 -0
  13. package/dist/agent/controller.js +496 -0
  14. package/dist/agent/copilotkit/CopilotKitAgentProvider.d.ts +41 -0
  15. package/dist/agent/copilotkit/CopilotKitAgentProvider.js +145 -0
  16. package/dist/agent/copilotkit/index.d.ts +6 -0
  17. package/dist/agent/copilotkit/index.js +6 -0
  18. package/dist/agent/engine.d.ts +41 -0
  19. package/dist/agent/engine.js +93 -0
  20. package/dist/agent/index.d.ts +17 -0
  21. package/dist/agent/index.js +17 -0
  22. package/dist/agent/mock.d.ts +56 -0
  23. package/dist/agent/mock.js +143 -0
  24. package/dist/agent/renderers.d.ts +49 -0
  25. package/dist/agent/renderers.js +27 -0
  26. package/dist/agent/surface.d.ts +30 -0
  27. package/dist/agent/surface.js +90 -0
  28. package/dist/agent/tool.d.ts +98 -0
  29. package/dist/agent/tool.js +81 -0
  30. package/dist/appearance/brands.d.ts +31 -12
  31. package/dist/appearance/brands.js +32 -51
  32. package/dist/chat/AgentProgress.d.ts +19 -0
  33. package/dist/chat/AgentProgress.js +34 -0
  34. package/dist/chat/Composer.d.ts +31 -0
  35. package/dist/chat/Composer.js +44 -0
  36. package/dist/chat/MessageBubble.d.ts +23 -0
  37. package/dist/chat/MessageBubble.js +26 -0
  38. package/dist/chat/MessageList.d.ts +43 -0
  39. package/dist/chat/MessageList.js +71 -0
  40. package/dist/chat/ModelPicker.d.ts +17 -0
  41. package/dist/chat/ModelPicker.js +13 -0
  42. package/dist/chat/ToolCallCard.d.ts +27 -0
  43. package/dist/chat/ToolCallCard.js +52 -0
  44. package/dist/chat/model.d.ts +123 -0
  45. package/dist/chat/model.js +337 -0
  46. package/dist/chat/patch.d.ts +12 -0
  47. package/dist/chat/patch.js +149 -0
  48. package/dist/chat/useAgUiRun.d.ts +52 -0
  49. package/dist/chat/useAgUiRun.js +137 -0
  50. package/dist/css/appearance.js +1 -1
  51. package/dist/css/calliope.css +5 -0
  52. package/dist/css/tokens.css +5 -0
  53. package/dist/index.d.ts +15 -1
  54. package/dist/index.js +16 -1
  55. package/dist/primitives/Badge.d.ts +14 -0
  56. package/dist/primitives/Badge.js +25 -0
  57. package/dist/primitives/Button.d.ts +1 -1
  58. package/dist/primitives/ContextMenu.d.ts +18 -0
  59. package/dist/primitives/ContextMenu.js +34 -0
  60. package/dist/primitives/ScrollArea.d.ts +16 -0
  61. package/dist/primitives/ScrollArea.js +11 -0
  62. package/dist/primitives/Toast.d.ts +37 -0
  63. package/dist/primitives/Toast.js +43 -0
  64. package/dist/primitives/Tooltip.d.ts +16 -0
  65. package/dist/primitives/Tooltip.js +26 -0
  66. package/dist/provider/messages.d.ts +135 -0
  67. package/dist/provider/messages.js +131 -0
  68. package/dist/theme/css-layer.js +2 -1
  69. package/dist/theme/mappings/palette.d.ts +52 -0
  70. package/dist/theme/mappings/palette.js +208 -0
  71. package/dist/theme/mappings/render.d.ts +9 -0
  72. package/dist/theme/mappings/render.js +520 -0
  73. package/dist/theme/mappings/targets.d.ts +43 -0
  74. package/dist/theme/mappings/targets.js +222 -0
  75. package/dist/theme/tokens.d.ts +10 -9
  76. package/dist/theme/tokens.generated.d.ts +356 -0
  77. package/dist/theme/tokens.generated.js +360 -0
  78. package/dist/theme/tokens.js +20 -264
  79. package/dist/tokens/README.jupyterlab.md +125 -0
  80. package/dist/tokens/README.md +15 -0
  81. package/dist/tokens/README.native.md +29 -0
  82. package/dist/tokens/README.plain.md +84 -0
  83. package/dist/tokens/README.python.md +33 -0
  84. package/dist/tokens/README.vscode.md +114 -0
  85. package/dist/tokens/jupyterlab.css +1710 -0
  86. package/dist/tokens/plain.css +930 -0
  87. package/dist/tokens/tokens.native.d.ts +85 -0
  88. package/dist/tokens/tokens.native.js +773 -0
  89. package/dist/tokens/tokens.py +1043 -0
  90. package/dist/tokens/vscode.css +1138 -0
  91. package/dist/workbench/FileBrowser.d.ts +62 -0
  92. package/dist/workbench/FileBrowser.js +117 -0
  93. package/dist/workbench/FileGrid.d.ts +13 -0
  94. package/dist/workbench/FileGrid.js +114 -0
  95. package/dist/workbench/FileIcon.d.ts +10 -0
  96. package/dist/workbench/FileIcon.js +24 -0
  97. package/dist/workbench/FileList.d.ts +35 -0
  98. package/dist/workbench/FileList.js +160 -0
  99. package/dist/workbench/FilePreview.d.ts +66 -0
  100. package/dist/workbench/FilePreview.js +108 -0
  101. package/dist/workbench/FileTree.d.ts +37 -0
  102. package/dist/workbench/FileTree.js +218 -0
  103. package/dist/workbench/UploadDropzone.d.ts +52 -0
  104. package/dist/workbench/UploadDropzone.js +115 -0
  105. package/dist/workbench/dnd.d.ts +17 -0
  106. package/dist/workbench/dnd.js +77 -0
  107. package/dist/workbench/index.d.ts +16 -0
  108. package/dist/workbench/index.js +16 -0
  109. package/dist/workbench/model.d.ts +72 -0
  110. package/dist/workbench/model.js +214 -0
  111. package/dist/workbench/selection.d.ts +16 -0
  112. package/dist/workbench/selection.js +46 -0
  113. package/dist/workbench/typeahead.d.ts +15 -0
  114. package/dist/workbench/typeahead.js +22 -0
  115. package/package.json +39 -2
@@ -0,0 +1,125 @@
1
+ # JupyterLab: `jupyterlab.css`
2
+
3
+ Maps the library tokens onto JupyterLab's theme variables, for JupyterLab 4 and Notebook 7 (JunoHub's lab).
4
+
5
+ ## Use
6
+
7
+ In a theme extension, import it after the stock variables in the theme's `style/variables.css`:
8
+
9
+ ```css
10
+ @import "@jupyterlab/theme-dark-extension/style/variables.css";
11
+ @import "@calliopelabs/ui/tokens/jupyterlab.css";
12
+ ```
13
+
14
+ Or, without an extension, serve the file and add it to the lab page after JupyterLab's styles (a `custom.css`, or the page template).
15
+
16
+ With no `data-ground`, the ground follows JupyterLab's own theme switch: Black under a dark theme, Paper under a light one (JupyterLab sets `data-jp-theme-light` on `<body>`). To choose, set `data-ground` and `data-accent` on `<html>`; pick a ground whose mode matches the JupyterLab theme you load:
17
+
18
+ ```js
19
+ document.documentElement.dataset.ground = "charcoal";
20
+ document.documentElement.dataset.accent = "copper";
21
+ ```
22
+
23
+ Grounds: `black` (dark), `charcoal` (dark), `graphite` (dark), `emerald` (dark), `navy` (dark), `paper` (light), `mist` (light). Accents: `green`, `copper`, `ice`, `periwinkle`, `amber`. The ground carries the mode, so there is no `data-mode`; `:root` paints `black` with `green`. The CSS layer's `appearance.js` stamps the same `data-ground` and `data-accent` attributes from the person's stored choice.
24
+
25
+ Left as JupyterLab ships them: syntax colours (`--jp-mirror-editor-*`), the search highlight, collaborator and completer colours, scrollbars, font sizes, and the red "warn" dialog button set, whose white label the family's dark danger red cannot carry.
26
+
27
+ ## Mapping
28
+
29
+ Layout colours run from the page (0) outwards; font colours from strongest (0) to faintest (3); state colours from text (0) and marks (1) to the tinted hairline (2) and the fill (3).
30
+
31
+ | Variable | Library token | Black, green | Paper, green | Note |
32
+ | --- | --- | --- | --- | --- |
33
+ | `--jp-layout-color0` | `--background` | `#000000` | `#faf6ee` | Main area and notebook |
34
+ | `--jp-layout-color1` | `--card` | `#0a0a0a` | `#fffdf9` | Panels, active tab, toolbars |
35
+ | `--jp-layout-color2` | `--secondary` | `#161616` | `#f3eee4` | Tab bar, side panel headers |
36
+ | `--jp-layout-color3` | `--accent` | `#1b1b1b` | `#f0e6da` | The hover and selected surface |
37
+ | `--jp-layout-color4` | `--muted-foreground` | `#848b88` | `#5c5b58` | Strongest layout tone |
38
+ | `--jp-inverse-layout-color0` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
39
+ | `--jp-inverse-layout-color1` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
40
+ | `--jp-inverse-layout-color2` | `--muted-foreground` | `#848b88` | `#5c5b58` | |
41
+ | `--jp-inverse-layout-color3` | `--muted-foreground` | `#848b88` | `#5c5b58` | |
42
+ | `--jp-inverse-layout-color4` | `--muted-foreground` | `#848b88` | `#5c5b58` | |
43
+ | `--jp-border-color0` | `--input` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | Inputs and cell borders |
44
+ | `--jp-border-color1` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
45
+ | `--jp-border-color2` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
46
+ | `--jp-border-color3` | `--sidebar-border` | `rgba(255, 255, 255, 0.08)` | `#dedad2` | The faintest hairline |
47
+ | `--jp-inverse-border-color` | `--muted-foreground` | `#848b88` | `#5c5b58` | |
48
+ | `--jp-ui-font-color0` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
49
+ | `--jp-ui-font-color1` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
50
+ | `--jp-ui-font-color2` | `--muted-foreground` | `#848b88` | `#5c5b58` | |
51
+ | `--jp-ui-font-color3` | `--muted-foreground` | `#848b88` | `#5c5b58` | No separate disabled ink |
52
+ | `--jp-ui-inverse-font-color0` | `--primary-foreground` | `#04241b` | `#f3fbf7` | Ink on brand fills |
53
+ | `--jp-ui-inverse-font-color1` | `--primary-foreground` | `#04241b` | `#f3fbf7` | |
54
+ | `--jp-ui-inverse-font-color2` | `--primary-foreground` | `#04241b` | `#f3fbf7` | |
55
+ | `--jp-ui-inverse-font-color3` | `--primary-foreground` | `#04241b` | `#f3fbf7` | |
56
+ | `--jp-content-font-color0` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
57
+ | `--jp-content-font-color1` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
58
+ | `--jp-content-font-color2` | `--muted-foreground` | `#848b88` | `#5c5b58` | |
59
+ | `--jp-content-font-color3` | `--muted-foreground` | `#848b88` | `#5c5b58` | |
60
+ | `--jp-content-link-color` | `--primary` | `#2f9e52` | `#26803f` | |
61
+ | `--jp-brand-color0` | `--primary` | `#2f9e52` | `#26803f` | |
62
+ | `--jp-brand-color1` | `--primary` | `#2f9e52` | `#26803f` | Active cell, focus, selection marks |
63
+ | `--jp-brand-color2` | `--primary` | `#2f9e52` | `#26803f` | |
64
+ | `--jp-brand-color3` | `--sidebar-accent` | `rgba(47, 158, 82, 0.16)` | `#f0e6da` | The accent tint |
65
+ | `--jp-brand-color4` | `--sidebar-accent` | `rgba(47, 158, 82, 0.16)` | `#f0e6da` | |
66
+ | `--jp-accent-color0` | `--chart-2` | `#8fd82a` | `#5c9c1a` | The family's second series |
67
+ | `--jp-accent-color1` | `--chart-2` | `#8fd82a` | `#5c9c1a` | |
68
+ | `--jp-accent-color2` | `--chart-2` | `#8fd82a` | `#5c9c1a` | |
69
+ | `--jp-accent-color3` | `--chart-2` | `#8fd82a` | `#5c9c1a` | |
70
+ | `--jp-warn-color0` | `--warning-fg` | `#f0c34e` | `#824c12` | Text |
71
+ | `--jp-warn-color1` | `--warning` | `#f0c34e` | `#cb7a00` | Marks |
72
+ | `--jp-warn-color2` | `--warning-border` | `rgba(240, 195, 78, 0.35)` | `#e8c184` | |
73
+ | `--jp-warn-color3` | `--warning-bg` | `rgba(240, 195, 78, 0.1)` | `#fef0d4` | Fills |
74
+ | `--jp-error-color0` | `--danger-fg` | `#ff8a8a` | `#bb0916` | Text |
75
+ | `--jp-error-color1` | `--danger` | `#ff6b6b` | `#df2225` | Marks |
76
+ | `--jp-error-color2` | `--danger-border` | `rgba(255, 107, 107, 0.35)` | `#ffb1aa` | |
77
+ | `--jp-error-color3` | `--danger-bg` | `rgba(255, 107, 107, 0.1)` | `#ffeae9` | Fills |
78
+ | `--jp-success-color0` | `--success-fg` | `#a6e34d` | `#305a12` | Text |
79
+ | `--jp-success-color1` | `--success` | `#8fd82a` | `#508d23` | Marks |
80
+ | `--jp-success-color2` | `--success-border` | `rgba(143, 216, 42, 0.35)` | `#b4d7a2` | |
81
+ | `--jp-success-color3` | `--success-bg` | `rgba(143, 216, 42, 0.1)` | `#e3f5da` | Fills |
82
+ | `--jp-info-color0` | `--info-fg` | `#5cbb79` | `#1b622d` | Text |
83
+ | `--jp-info-color1` | `--info` | `#2f9e52` | `#2f8543` | Marks |
84
+ | `--jp-info-color2` | `--info-border` | `rgba(47, 158, 82, 0.4)` | `#acd8b1` | |
85
+ | `--jp-info-color3` | `--info-bg` | `rgba(47, 158, 82, 0.14)` | `#e2f4e3` | Fills |
86
+ | `--jp-cell-editor-background` | `--muted` | `#111111` | `#f3eee4` | |
87
+ | `--jp-cell-editor-border-color` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
88
+ | `--jp-cell-editor-active-background` | `--card` | `#0a0a0a` | `#fffdf9` | |
89
+ | `--jp-cell-editor-active-border-color` | `--ring` | `#2f9e52` | `#26803f` | |
90
+ | `--jp-cell-inprompt-font-color` | `--primary` | `#2f9e52` | `#26803f` | |
91
+ | `--jp-cell-outprompt-font-color` | `--chart-4` | `#e0b34a` | `#b8860b` | |
92
+ | `--jp-notebook-select-background` | `--accent` | `#1b1b1b` | `#f0e6da` | |
93
+ | `--jp-notebook-multiselected-color` | `--sidebar-accent` | `rgba(47, 158, 82, 0.16)` | `#f0e6da` | |
94
+ | `--jp-rendermime-error-background` | `--danger-bg` | `rgba(255, 107, 107, 0.1)` | `#ffeae9` | |
95
+ | `--jp-rendermime-table-row-background` | `--muted` | `#111111` | `#f3eee4` | |
96
+ | `--jp-rendermime-table-row-hover-background` | `--accent` | `#1b1b1b` | `#f0e6da` | |
97
+ | `--jp-toolbar-background` | `--card` | `#0a0a0a` | `#fffdf9` | |
98
+ | `--jp-toolbar-border-color` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
99
+ | `--jp-toolbar-active-background` | `--accent` | `#1b1b1b` | `#f0e6da` | |
100
+ | `--jp-input-background` | `--background` | `#000000` | `#faf6ee` | |
101
+ | `--jp-input-active-background` | `--background` | `#000000` | `#faf6ee` | |
102
+ | `--jp-input-hover-background` | `--secondary` | `#161616` | `#f3eee4` | |
103
+ | `--jp-input-border-color` | `--input` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
104
+ | `--jp-input-active-border-color` | `--ring` | `#2f9e52` | `#26803f` | |
105
+ | `--jp-input-active-box-shadow-color` | `--sidebar-accent` | `rgba(47, 158, 82, 0.16)` | `#f0e6da` | |
106
+ | `--jp-editor-selected-background` | `--accent` | `#1b1b1b` | `#f0e6da` | |
107
+ | `--jp-editor-selected-focused-background` | `--sidebar-accent` | `rgba(47, 158, 82, 0.16)` | `#f0e6da` | |
108
+ | `--jp-editor-cursor-color` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
109
+ | `--jp-focus-outline-color` | `--ring` | `#2f9e52` | `#26803f` | |
110
+ | `--jp-accept-color-normal` | `--primary` | `#2f9e52` | `#26803f` | Primary dialog button |
111
+ | `--jp-accept-color-hover` | `--primary` | `#2f9e52` | `#26803f` | |
112
+ | `--jp-accept-color-active` | `--primary` | `#2f9e52` | `#26803f` | |
113
+ | `--jp-accept-color-foreground` | `--primary-foreground` | `#04241b` | `#f3fbf7` | |
114
+ | `--jp-accept-outline-color` | `--ring` | `#2f9e52` | `#26803f` | |
115
+ | `--jp-reject-color-normal` | `--secondary` | `#161616` | `#f3eee4` | Secondary dialog button |
116
+ | `--jp-reject-color-hover` | `--accent` | `#1b1b1b` | `#f0e6da` | |
117
+ | `--jp-reject-color-active` | `--accent` | `#1b1b1b` | `#f0e6da` | |
118
+ | `--jp-reject-color-foreground` | `--secondary-foreground` | `#f0f2f1` | `#1e1d1b` | |
119
+ | `--jp-reject-outline-color` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
120
+ | `--jp-border-radius` | `--radius` | `2px` | same | Every ground |
121
+ | `--jp-ui-font-family` | `--font-sans` | `var(--font-plex-sans, "IBM Plex Sans"), system-ui, sans-serif` | same | Every ground |
122
+ | `--jp-content-font-family` | `--font-sans` | `var(--font-plex-sans, "IBM Plex Sans"), system-ui, sans-serif` | same | Every ground |
123
+ | `--jp-code-font-family` | `--font-mono` | `var(--font-plex-mono, "IBM Plex Mono"), ui-monospace, SFMono-Regular, Menlo, monospace` | same | Every ground |
124
+
125
+ Generated by `npm run theme` from the design tokens (`tokens/*.json`), like the preset; a test holds every value to the preset's on every ground and accent.
@@ -0,0 +1,15 @@
1
+ # @calliopelabs/ui tokens
2
+
3
+ The family's tokens for stacks that cannot use the Tailwind preset or the CSS layer, generated from the same token table. Each value is what the preset paints on that ground with that accent and no product brand.
4
+
5
+ | File | For | Guide |
6
+ | --- | --- | --- |
7
+ | `jupyterlab.css` | JupyterLab and Jupyter Notebook 7 (`--jp-*`) | [README.jupyterlab.md](README.jupyterlab.md) |
8
+ | `vscode.css` | VS Code webviews outside VS Code (`--vscode-*` fallbacks) | [README.vscode.md](README.vscode.md) |
9
+ | `tokens.py` | Python (the installer): RGB triplets and accessors | [README.python.md](README.python.md) |
10
+ | `tokens.native.js`, `tokens.native.d.ts` | React Native | [README.native.md](README.native.md) |
11
+ | `plain.css` | Sites and apps that read plain variables (Cykick) | [README.plain.md](README.plain.md) |
12
+
13
+ Server-rendered apps that want the components as well take the CSS layer (`@calliopelabs/ui/css/*`) instead.
14
+
15
+ Generated by `npm run theme` from the design tokens (`tokens/*.json`), like the preset; a test holds every value to the preset's on every ground and accent.
@@ -0,0 +1,29 @@
1
+ # React Native: `tokens.native.js`
2
+
3
+ Every colour token of every ground and accent as objects React Native's `StyleSheet` takes as they are (`#rrggbb` or `rgba()`), keyed in camelCase, with types.
4
+
5
+ ## Use
6
+
7
+ ```ts
8
+ import { palette, charcoal, radius, fonts, GROUNDS } from "@calliopelabs/ui/tokens/native";
9
+
10
+ const c = palette("paper", "copper");
11
+ const styles = StyleSheet.create({
12
+ screen: { flex: 1, backgroundColor: c.background },
13
+ title: { color: c.foreground, fontFamily: fonts.head },
14
+ button: { backgroundColor: c.primary, borderRadius: radius },
15
+ buttonLabel: { color: c.primaryForeground },
16
+ hint: { color: c.mutedForeground },
17
+ });
18
+
19
+ // charcoal is palette("charcoal") with the default accent.
20
+ const statusBar = GROUNDS.charcoal.mode === "dark" ? "light-content" : "dark-content";
21
+ ```
22
+
23
+ Each ground is exported by name (`black`, `charcoal`, `graphite`, `emerald`, `navy`, `paper`, `mist`) with the default accent; `palette(ground, accent)` gives any combination and throws on an unknown one. Keys follow the CSS names in camelCase: `background`, `card`, `primary`, `primaryForeground`, `mutedForeground`, `border`, `ring`, `chart1`, `sidebarAccent`, `success`, `successFg`, `dangerBg` and so on. `radius` is in points, `motion` in milliseconds, and `fonts` holds family names; the app loads the fonts (IBM Plex Sans, IBM Plex Mono, DM Sans).
24
+
25
+ The package is ESM; Metro resolves the `@calliopelabs/ui/tokens/native` subpath through `exports` (on by default since React Native 0.79). Or copy the two files into the app.
26
+
27
+ Grounds: `black` (dark), `charcoal` (dark), `graphite` (dark), `emerald` (dark), `navy` (dark), `paper` (light), `mist` (light). Accents: `green`, `copper`, `ice`, `periwinkle`, `amber`.
28
+
29
+ Generated by `npm run theme` from the design tokens (`tokens/*.json`), like the preset; a test holds every value to the preset's on every ground and accent.
@@ -0,0 +1,84 @@
1
+ # Plain CSS: `plain.css`
2
+
3
+ Every colour token under its own name (`--background`, `--primary`, `--success-fg`, ...) as a concrete value, plus `--radius`, `--motion-*` and `--font-sans`, `--font-mono`, `--font-head`. No `var()` chains, no `color-mix`, no product or brand machinery, and `color-scheme` set per ground: for static sites and apps that only read variables (Cykick, the marketing sites).
4
+
5
+ ## Use
6
+
7
+ ```html
8
+ <html data-ground="charcoal" data-accent="ice">
9
+ <link rel="stylesheet" href="/static/calliope/plain.css" />
10
+ ```
11
+
12
+ ```css
13
+ body { background: var(--background); color: var(--foreground); font-family: var(--font-sans); }
14
+ .button { background: var(--primary); color: var(--primary-foreground); border-radius: var(--radius); }
15
+ ```
16
+
17
+ Any element can carry the attributes, so a section can sit on another ground. Grounds: `black` (dark), `charcoal` (dark), `graphite` (dark), `emerald` (dark), `navy` (dark), `paper` (light), `mist` (light). Accents: `green`, `copper`, `ice`, `periwinkle`, `amber`. The ground carries the mode, so there is no `data-mode`; `:root` paints `black` with `green`. The CSS layer's `appearance.js` stamps the same `data-ground` and `data-accent` attributes from the person's stored choice.
18
+
19
+ When to take the CSS layer (`@calliopelabs/ui/css/tokens.css`) instead: when the page needs product brands (the branded sidebar, a product's own accent), a custom accent colour, density or corners settings, or the class-based components. `plain.css` carries the family accents only.
20
+
21
+ ## Variables
22
+
23
+ | Variable | Library token | Black, green | Paper, green | Note |
24
+ | --- | --- | --- | --- | --- |
25
+ | `--background` | `--background` | `#000000` | `#faf6ee` | |
26
+ | `--foreground` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
27
+ | `--card` | `--card` | `#0a0a0a` | `#fffdf9` | |
28
+ | `--card-foreground` | `--card-foreground` | `#f0f2f1` | `#1e1d1b` | |
29
+ | `--popover` | `--popover` | `#141414` | `#fffdf9` | |
30
+ | `--popover-foreground` | `--popover-foreground` | `#f0f2f1` | `#1e1d1b` | |
31
+ | `--primary` | `--primary` | `#2f9e52` | `#26803f` | |
32
+ | `--primary-foreground` | `--primary-foreground` | `#04241b` | `#f3fbf7` | |
33
+ | `--secondary` | `--secondary` | `#161616` | `#f3eee4` | |
34
+ | `--secondary-foreground` | `--secondary-foreground` | `#f0f2f1` | `#1e1d1b` | |
35
+ | `--muted` | `--muted` | `#111111` | `#f3eee4` | |
36
+ | `--muted-foreground` | `--muted-foreground` | `#848b88` | `#5c5b58` | |
37
+ | `--accent` | `--accent` | `#1b1b1b` | `#f0e6da` | |
38
+ | `--accent-foreground` | `--accent-foreground` | `#f0f2f1` | `#1e1d1b` | |
39
+ | `--destructive` | `--destructive` | `#ff6b6b` | `#d40c1a` | |
40
+ | `--border` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
41
+ | `--input` | `--input` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
42
+ | `--ring` | `--ring` | `#2f9e52` | `#26803f` | |
43
+ | `--chart-1` | `--chart-1` | `#2f9e52` | `#26803f` | |
44
+ | `--chart-2` | `--chart-2` | `#8fd82a` | `#5c9c1a` | |
45
+ | `--chart-3` | `--chart-3` | `#cbf39d` | `#8a7a5c` | |
46
+ | `--chart-4` | `--chart-4` | `#e0b34a` | `#b8860b` | |
47
+ | `--chart-5` | `--chart-5` | `#0b6644` | `#26803f` | |
48
+ | `--sidebar` | `--sidebar` | `#0a0a0a` | `#f5f0e4` | |
49
+ | `--sidebar-foreground` | `--sidebar-foreground` | `#f0f2f1` | `#1e1d1b` | |
50
+ | `--sidebar-primary` | `--sidebar-primary` | `#2f9e52` | `#26803f` | |
51
+ | `--sidebar-primary-foreground` | `--sidebar-primary-foreground` | `#04241b` | `#f3fbf7` | |
52
+ | `--sidebar-accent` | `--sidebar-accent` | `rgba(47, 158, 82, 0.16)` | `#f0e6da` | |
53
+ | `--sidebar-accent-foreground` | `--sidebar-accent-foreground` | `#f0f2f1` | `#1e1d1b` | |
54
+ | `--sidebar-border` | `--sidebar-border` | `rgba(255, 255, 255, 0.08)` | `#dedad2` | |
55
+ | `--sidebar-ring` | `--sidebar-ring` | `#2f9e52` | `#26803f` | |
56
+ | `--sidebar-muted-foreground` | `--sidebar-muted-foreground` | `#848b88` | `#5c5b58` | |
57
+ | `--surface-0` | `--surface-0` | `#000000` | `#faf6ee` | |
58
+ | `--surface-1` | `--surface-1` | `#0a0a0a` | `#fffdf9` | |
59
+ | `--surface-2` | `--surface-2` | `#141414` | `#fffdf9` | |
60
+ | `--success` | `--success` | `#8fd82a` | `#508d23` | |
61
+ | `--success-fg` | `--success-fg` | `#a6e34d` | `#305a12` | |
62
+ | `--success-bg` | `--success-bg` | `rgba(143, 216, 42, 0.1)` | `#e3f5da` | |
63
+ | `--success-border` | `--success-border` | `rgba(143, 216, 42, 0.35)` | `#b4d7a2` | |
64
+ | `--warning` | `--warning` | `#f0c34e` | `#cb7a00` | |
65
+ | `--warning-fg` | `--warning-fg` | `#f0c34e` | `#824c12` | |
66
+ | `--warning-bg` | `--warning-bg` | `rgba(240, 195, 78, 0.1)` | `#fef0d4` | |
67
+ | `--warning-border` | `--warning-border` | `rgba(240, 195, 78, 0.35)` | `#e8c184` | |
68
+ | `--info` | `--info` | `#2f9e52` | `#2f8543` | |
69
+ | `--info-fg` | `--info-fg` | `#5cbb79` | `#1b622d` | |
70
+ | `--info-bg` | `--info-bg` | `rgba(47, 158, 82, 0.14)` | `#e2f4e3` | |
71
+ | `--info-border` | `--info-border` | `rgba(47, 158, 82, 0.4)` | `#acd8b1` | |
72
+ | `--danger` | `--danger` | `#ff6b6b` | `#df2225` | |
73
+ | `--danger-fg` | `--danger-fg` | `#ff8a8a` | `#bb0916` | |
74
+ | `--danger-bg` | `--danger-bg` | `rgba(255, 107, 107, 0.1)` | `#ffeae9` | |
75
+ | `--danger-border` | `--danger-border` | `rgba(255, 107, 107, 0.35)` | `#ffb1aa` | |
76
+ | `--radius` | `--radius` | `2px` | same | Every ground |
77
+ | `--motion-fast` | `--motion-fast` | `120ms` | same | Every ground |
78
+ | `--motion-base` | `--motion-base` | `200ms` | same | Every ground |
79
+ | `--motion-slow` | `--motion-slow` | `320ms` | same | Every ground |
80
+ | `--font-sans` | `--font-sans` | `var(--font-plex-sans, "IBM Plex Sans"), system-ui, sans-serif` | same | Every ground |
81
+ | `--font-mono` | `--font-mono` | `var(--font-plex-mono, "IBM Plex Mono"), ui-monospace, SFMono-Regular, Menlo, monospace` | same | Every ground |
82
+ | `--font-head` | `--font-head` | `var(--font-dm-sans, "DM Sans"), system-ui, sans-serif` | same | Every ground |
83
+
84
+ Generated by `npm run theme` from the design tokens (`tokens/*.json`), like the preset; a test holds every value to the preset's on every ground and accent.
@@ -0,0 +1,33 @@
1
+ # Python: `tokens.py`
2
+
3
+ Every colour token of every ground and accent as RGB triplets, with a few accessors. Standard library only, Python 3.9 and up.
4
+
5
+ ## Use
6
+
7
+ Copy (vendor) the file into the package under a module name of your choice, for example `calliope_tokens.py`:
8
+
9
+ ```sh
10
+ cp node_modules/@calliopelabs/ui/dist/tokens/tokens.py installer/wizard/calliope_tokens.py
11
+ ```
12
+
13
+ ```python
14
+ from calliope_tokens import GROUNDS, palette, rgb, rgba, triplet, hex
15
+
16
+ rgb("background", "charcoal") # (14, 15, 16)
17
+ triplet("primary", "paper", "copper") # "156 87 48"
18
+ rgba("border", "black") # (255, 255, 255, 0.1)
19
+ hex("border", "black") # "#1a1a1a", laid on the background
20
+ palette("emerald", "ice") # {"background": (5, 11, 8), ...}
21
+ ```
22
+
23
+ `triplet` is the `R G B` channel form CSS reads in `rgb(var(--x-rgb) / 0.18)`, so a stylesheet built in Python can take any alpha of any token:
24
+
25
+ ```python
26
+ css = "\n".join(f" --{name}-rgb: {' '.join(map(str, value))};" for name, value in palette(ground).items())
27
+ ```
28
+
29
+ Tokens are named as in CSS, without the dashes: `background`, `card`, `primary`, `primary-foreground`, `muted-foreground`, `border`, `ring`, `success`, `success-fg`, `danger-bg` and so on (`TOKENS` lists them all). Translucent tokens (hairlines, tints) come two ways: `rgb`, `triplet`, `hex` and `palette` lay them on their surface (`sidebar-*` on the sidebar, the rest on the background), for targets with no alpha; `rgba` keeps the alpha. `RADIUS_PX`, `MOTION_MS` and `FONTS` carry the rest.
30
+
31
+ Grounds: `black` (dark), `charcoal` (dark), `graphite` (dark), `emerald` (dark), `navy` (dark), `paper` (light), `mist` (light). Accents: `green`, `copper`, `ice`, `periwinkle`, `amber`. The ground carries the mode, so there is no `data-mode`; `:root` paints `black` with `green`.
32
+
33
+ Generated by `npm run theme` from the design tokens (`tokens/*.json`), like the preset; a test holds every value to the preset's on every ground and accent.
@@ -0,0 +1,114 @@
1
+ # VS Code webviews: `vscode.css`
2
+
3
+ Calliope AI values for the `--vscode-*` variables a webview reads ([theme colour ids](https://code.visualstudio.com/api/references/theme-color), dots as dashes).
4
+
5
+ ## Use
6
+
7
+ Link it in the webview's HTML before the webview's own styles:
8
+
9
+ ```html
10
+ <link rel="stylesheet" href="${webview.asWebviewUri(vscodeCss)}" />
11
+ ```
12
+
13
+ Inside VS Code the host sets every `--vscode-*` variable inline on `<html>`, so the editor's theme always wins and these never show. Outside VS Code (a browser preview of the webview, Storybook, a test in jsdom) they stand in, so a webview written against `--vscode-*` renders in the family's colours.
14
+
15
+ To go the other way, and paint the library's own tokens from the editor's theme with these as the fallback, read them through:
16
+
17
+ ```css
18
+ :root {
19
+ --background: var(--vscode-editor-background);
20
+ --foreground: var(--vscode-foreground);
21
+ --primary: var(--vscode-button-background);
22
+ }
23
+ ```
24
+
25
+ Grounds: `black` (dark), `charcoal` (dark), `graphite` (dark), `emerald` (dark), `navy` (dark), `paper` (light), `mist` (light). Accents: `green`, `copper`, `ice`, `periwinkle`, `amber`. The ground carries the mode, so there is no `data-mode`; `:root` paints `black` with `green`. The CSS layer's `appearance.js` stamps the same `data-ground` and `data-accent` attributes from the person's stored choice.
26
+
27
+ VS Code's `--vscode-font-size` and `--vscode-editor-font-size` are left to the host. Left alone: colours the family has no hue for (`charts.blue`, `charts.purple`, `charts.orange`; info is green) and scrollbars.
28
+
29
+ ## Mapping
30
+
31
+ | Variable | Library token | Black, green | Paper, green | Note |
32
+ | --- | --- | --- | --- | --- |
33
+ | `--vscode-foreground` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
34
+ | `--vscode-descriptionForeground` | `--muted-foreground` | `#848b88` | `#5c5b58` | |
35
+ | `--vscode-disabledForeground` | `--muted-foreground` | `#848b88` | `#5c5b58` | |
36
+ | `--vscode-errorForeground` | `--danger-fg` | `#ff8a8a` | `#bb0916` | |
37
+ | `--vscode-focusBorder` | `--ring` | `#2f9e52` | `#26803f` | |
38
+ | `--vscode-widget-border` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
39
+ | `--vscode-selection-background` | `--sidebar-accent` | `rgba(47, 158, 82, 0.16)` | `#f0e6da` | The accent tint |
40
+ | `--vscode-icon-foreground` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
41
+ | `--vscode-textLink-foreground` | `--primary` | `#2f9e52` | `#26803f` | |
42
+ | `--vscode-textLink-activeForeground` | `--primary` | `#2f9e52` | `#26803f` | |
43
+ | `--vscode-textPreformat-foreground` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
44
+ | `--vscode-textBlockQuote-background` | `--muted` | `#111111` | `#f3eee4` | |
45
+ | `--vscode-textCodeBlock-background` | `--muted` | `#111111` | `#f3eee4` | |
46
+ | `--vscode-textSeparator-foreground` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
47
+ | `--vscode-editor-background` | `--background` | `#000000` | `#faf6ee` | |
48
+ | `--vscode-editor-foreground` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
49
+ | `--vscode-editorWidget-background` | `--popover` | `#141414` | `#fffdf9` | |
50
+ | `--vscode-editorWidget-foreground` | `--popover-foreground` | `#f0f2f1` | `#1e1d1b` | |
51
+ | `--vscode-editorWidget-border` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
52
+ | `--vscode-editorHoverWidget-background` | `--popover` | `#141414` | `#fffdf9` | |
53
+ | `--vscode-editorHoverWidget-border` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
54
+ | `--vscode-editorError-foreground` | `--danger` | `#ff6b6b` | `#df2225` | |
55
+ | `--vscode-editorWarning-foreground` | `--warning` | `#f0c34e` | `#cb7a00` | |
56
+ | `--vscode-editorInfo-foreground` | `--info` | `#2f9e52` | `#2f8543` | |
57
+ | `--vscode-button-background` | `--primary` | `#2f9e52` | `#26803f` | |
58
+ | `--vscode-button-foreground` | `--primary-foreground` | `#04241b` | `#f3fbf7` | |
59
+ | `--vscode-button-hoverBackground` | `--primary` | `#2f9e52` | `#26803f` | No separate hover fill |
60
+ | `--vscode-button-secondaryBackground` | `--secondary` | `#161616` | `#f3eee4` | |
61
+ | `--vscode-button-secondaryForeground` | `--secondary-foreground` | `#f0f2f1` | `#1e1d1b` | |
62
+ | `--vscode-button-secondaryHoverBackground` | `--accent` | `#1b1b1b` | `#f0e6da` | |
63
+ | `--vscode-input-background` | `--background` | `#000000` | `#faf6ee` | |
64
+ | `--vscode-input-foreground` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
65
+ | `--vscode-input-border` | `--input` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
66
+ | `--vscode-input-placeholderForeground` | `--muted-foreground` | `#848b88` | `#5c5b58` | |
67
+ | `--vscode-inputOption-activeBorder` | `--ring` | `#2f9e52` | `#26803f` | |
68
+ | `--vscode-inputValidation-errorBackground` | `--danger-bg` | `rgba(255, 107, 107, 0.1)` | `#ffeae9` | |
69
+ | `--vscode-inputValidation-errorBorder` | `--danger-border` | `rgba(255, 107, 107, 0.35)` | `#ffb1aa` | |
70
+ | `--vscode-notificationsErrorIcon-foreground` | `--danger` | `#ff6b6b` | `#df2225` | |
71
+ | `--vscode-inputValidation-warningBackground` | `--warning-bg` | `rgba(240, 195, 78, 0.1)` | `#fef0d4` | |
72
+ | `--vscode-inputValidation-warningBorder` | `--warning-border` | `rgba(240, 195, 78, 0.35)` | `#e8c184` | |
73
+ | `--vscode-notificationsWarningIcon-foreground` | `--warning` | `#f0c34e` | `#cb7a00` | |
74
+ | `--vscode-inputValidation-infoBackground` | `--info-bg` | `rgba(47, 158, 82, 0.14)` | `#e2f4e3` | |
75
+ | `--vscode-inputValidation-infoBorder` | `--info-border` | `rgba(47, 158, 82, 0.4)` | `#acd8b1` | |
76
+ | `--vscode-notificationsInfoIcon-foreground` | `--info` | `#2f9e52` | `#2f8543` | |
77
+ | `--vscode-dropdown-background` | `--popover` | `#141414` | `#fffdf9` | |
78
+ | `--vscode-dropdown-foreground` | `--popover-foreground` | `#f0f2f1` | `#1e1d1b` | |
79
+ | `--vscode-dropdown-border` | `--input` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
80
+ | `--vscode-checkbox-background` | `--background` | `#000000` | `#faf6ee` | |
81
+ | `--vscode-checkbox-foreground` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
82
+ | `--vscode-checkbox-border` | `--input` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
83
+ | `--vscode-badge-background` | `--secondary` | `#161616` | `#f3eee4` | Neutral, like StatusBadge |
84
+ | `--vscode-badge-foreground` | `--secondary-foreground` | `#f0f2f1` | `#1e1d1b` | |
85
+ | `--vscode-progressBar-background` | `--primary` | `#2f9e52` | `#26803f` | |
86
+ | `--vscode-list-activeSelectionBackground` | `--accent` | `#1b1b1b` | `#f0e6da` | |
87
+ | `--vscode-list-activeSelectionForeground` | `--accent-foreground` | `#f0f2f1` | `#1e1d1b` | |
88
+ | `--vscode-list-inactiveSelectionBackground` | `--secondary` | `#161616` | `#f3eee4` | |
89
+ | `--vscode-list-hoverBackground` | `--accent` | `#1b1b1b` | `#f0e6da` | |
90
+ | `--vscode-list-focusOutline` | `--ring` | `#2f9e52` | `#26803f` | |
91
+ | `--vscode-menu-background` | `--popover` | `#141414` | `#fffdf9` | |
92
+ | `--vscode-menu-foreground` | `--popover-foreground` | `#f0f2f1` | `#1e1d1b` | |
93
+ | `--vscode-menu-selectionBackground` | `--accent` | `#1b1b1b` | `#f0e6da` | |
94
+ | `--vscode-quickInput-background` | `--popover` | `#141414` | `#fffdf9` | |
95
+ | `--vscode-quickInput-foreground` | `--popover-foreground` | `#f0f2f1` | `#1e1d1b` | |
96
+ | `--vscode-notifications-background` | `--popover` | `#141414` | `#fffdf9` | |
97
+ | `--vscode-notifications-foreground` | `--popover-foreground` | `#f0f2f1` | `#1e1d1b` | |
98
+ | `--vscode-notifications-border` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
99
+ | `--vscode-sideBar-background` | `--sidebar` | `#0a0a0a` | `#f5f0e4` | |
100
+ | `--vscode-sideBar-foreground` | `--sidebar-foreground` | `#f0f2f1` | `#1e1d1b` | |
101
+ | `--vscode-sideBar-border` | `--sidebar-border` | `rgba(255, 255, 255, 0.08)` | `#dedad2` | |
102
+ | `--vscode-panel-background` | `--card` | `#0a0a0a` | `#fffdf9` | |
103
+ | `--vscode-panel-border` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
104
+ | `--vscode-toolbar-hoverBackground` | `--accent` | `#1b1b1b` | `#f0e6da` | |
105
+ | `--vscode-testing-iconPassed` | `--success` | `#8fd82a` | `#508d23` | |
106
+ | `--vscode-charts-foreground` | `--foreground` | `#f0f2f1` | `#1e1d1b` | |
107
+ | `--vscode-charts-lines` | `--border` | `rgba(255, 255, 255, 0.1)` | `#dedad2` | |
108
+ | `--vscode-charts-red` | `--danger` | `#ff6b6b` | `#df2225` | |
109
+ | `--vscode-charts-yellow` | `--warning` | `#f0c34e` | `#cb7a00` | |
110
+ | `--vscode-charts-green` | `--success` | `#8fd82a` | `#508d23` | |
111
+ | `--vscode-font-family` | `--font-sans` | `var(--font-plex-sans, "IBM Plex Sans"), system-ui, sans-serif` | same | Every ground |
112
+ | `--vscode-editor-font-family` | `--font-mono` | `var(--font-plex-mono, "IBM Plex Mono"), ui-monospace, SFMono-Regular, Menlo, monospace` | same | Every ground |
113
+
114
+ Generated by `npm run theme` from the design tokens (`tokens/*.json`), like the preset; a test holds every value to the preset's on every ground and accent.