@streamsai/ui 0.0.0-stage → 0.1.1

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 (206) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -2
  3. package/dist/components/ui/agent-avatar.d.ts +50 -0
  4. package/dist/components/ui/agent-avatar.js +38 -0
  5. package/dist/components/ui/alert-dialog.d.ts +12 -0
  6. package/dist/components/ui/alert-dialog.js +37 -0
  7. package/dist/components/ui/alert.d.ts +10 -0
  8. package/dist/components/ui/alert.js +28 -0
  9. package/dist/components/ui/assets/loader.json.js +1 -0
  10. package/dist/components/ui/avatar-frame.d.ts +11 -0
  11. package/dist/components/ui/avatar-frame.js +20 -0
  12. package/dist/components/ui/avatar.d.ts +23 -0
  13. package/dist/components/ui/avatar.js +54 -0
  14. package/dist/components/ui/badge.d.ts +7 -0
  15. package/dist/components/ui/badge.js +36 -0
  16. package/dist/components/ui/bar-list.d.ts +40 -0
  17. package/dist/components/ui/bar-list.js +37 -0
  18. package/dist/components/ui/breadcrumb.d.ts +8 -0
  19. package/dist/components/ui/breadcrumb.js +21 -0
  20. package/dist/components/ui/button-group.d.ts +10 -0
  21. package/dist/components/ui/button-group.js +41 -0
  22. package/dist/components/ui/button.d.ts +9 -0
  23. package/dist/components/ui/button.js +39 -0
  24. package/dist/components/ui/card.d.ts +9 -0
  25. package/dist/components/ui/card.js +25 -0
  26. package/dist/components/ui/checkbox.d.ts +3 -0
  27. package/dist/components/ui/checkbox.js +16 -0
  28. package/dist/components/ui/chip.d.ts +13 -0
  29. package/dist/components/ui/chip.js +22 -0
  30. package/dist/components/ui/clickable.d.ts +27 -0
  31. package/dist/components/ui/clickable.js +54 -0
  32. package/dist/components/ui/code-block.d.ts +68 -0
  33. package/dist/components/ui/code-block.js +112 -0
  34. package/dist/components/ui/code-view.d.ts +21 -0
  35. package/dist/components/ui/code-view.js +20 -0
  36. package/dist/components/ui/collapsible.d.ts +6 -0
  37. package/dist/components/ui/collapsible.js +18 -0
  38. package/dist/components/ui/combobox.d.ts +14 -0
  39. package/dist/components/ui/combobox.js +37 -0
  40. package/dist/components/ui/command.d.ts +15 -0
  41. package/dist/components/ui/command.js +34 -0
  42. package/dist/components/ui/context-menu.d.ts +21 -0
  43. package/dist/components/ui/context-menu.js +60 -0
  44. package/dist/components/ui/counter.d.ts +11 -0
  45. package/dist/components/ui/counter.js +20 -0
  46. package/dist/components/ui/dialog.d.ts +17 -0
  47. package/dist/components/ui/dialog.js +41 -0
  48. package/dist/components/ui/disabled-reason.d.ts +22 -0
  49. package/dist/components/ui/disabled-reason.js +16 -0
  50. package/dist/components/ui/dropdown-menu.d.ts +33 -0
  51. package/dist/components/ui/dropdown-menu.js +58 -0
  52. package/dist/components/ui/editable-text.d.ts +95 -0
  53. package/dist/components/ui/editable-text.js +191 -0
  54. package/dist/components/ui/heading.d.ts +24 -0
  55. package/dist/components/ui/heading.js +92 -0
  56. package/dist/components/ui/hover-card.d.ts +9 -0
  57. package/dist/components/ui/hover-card.js +16 -0
  58. package/dist/components/ui/icon-button.d.ts +23 -0
  59. package/dist/components/ui/icon-button.js +32 -0
  60. package/dist/components/ui/input.d.ts +3 -0
  61. package/dist/components/ui/input.js +8 -0
  62. package/dist/components/ui/kbd.d.ts +12 -0
  63. package/dist/components/ui/kbd.js +12 -0
  64. package/dist/components/ui/label.d.ts +3 -0
  65. package/dist/components/ui/label.js +7 -0
  66. package/dist/components/ui/loader.d.ts +19 -0
  67. package/dist/components/ui/loader.js +157 -0
  68. package/dist/components/ui/message-toolbar.d.ts +20 -0
  69. package/dist/components/ui/message-toolbar.js +17 -0
  70. package/dist/components/ui/modal.d.ts +30 -0
  71. package/dist/components/ui/modal.js +41 -0
  72. package/dist/components/ui/nav-item.d.ts +25 -0
  73. package/dist/components/ui/nav-item.js +66 -0
  74. package/dist/components/ui/panel-section.d.ts +22 -0
  75. package/dist/components/ui/panel-section.js +26 -0
  76. package/dist/components/ui/popover.d.ts +14 -0
  77. package/dist/components/ui/popover.js +30 -0
  78. package/dist/components/ui/progress.d.ts +5 -0
  79. package/dist/components/ui/progress.js +16 -0
  80. package/dist/components/ui/provider-badge.d.ts +22 -0
  81. package/dist/components/ui/provider-badge.js +38 -0
  82. package/dist/components/ui/radio-group.d.ts +5 -0
  83. package/dist/components/ui/radio-group.js +21 -0
  84. package/dist/components/ui/reply-summary.d.ts +16 -0
  85. package/dist/components/ui/reply-summary.js +8 -0
  86. package/dist/components/ui/resizable.d.ts +8 -0
  87. package/dist/components/ui/resizable.js +15 -0
  88. package/dist/components/ui/rich-text-editor.d.ts +447 -0
  89. package/dist/components/ui/rich-text-editor.js +2419 -0
  90. package/dist/components/ui/running-indicator.d.ts +17 -0
  91. package/dist/components/ui/running-indicator.js +34 -0
  92. package/dist/components/ui/sandboxed-frame.d.ts +29 -0
  93. package/dist/components/ui/sandboxed-frame.js +77 -0
  94. package/dist/components/ui/scroll-area.d.ts +14 -0
  95. package/dist/components/ui/scroll-area.js +17 -0
  96. package/dist/components/ui/section-header.d.ts +12 -0
  97. package/dist/components/ui/section-header.js +12 -0
  98. package/dist/components/ui/select.d.ts +15 -0
  99. package/dist/components/ui/select.js +40 -0
  100. package/dist/components/ui/separator.d.ts +3 -0
  101. package/dist/components/ui/separator.js +13 -0
  102. package/dist/components/ui/sheet.d.ts +23 -0
  103. package/dist/components/ui/sheet.js +48 -0
  104. package/dist/components/ui/shimmer-text.d.ts +26 -0
  105. package/dist/components/ui/shimmer-text.js +32 -0
  106. package/dist/components/ui/sidebar.d.ts +63 -0
  107. package/dist/components/ui/sidebar.js +283 -0
  108. package/dist/components/ui/skeleton.d.ts +14 -0
  109. package/dist/components/ui/skeleton.js +12 -0
  110. package/dist/components/ui/sonner.d.ts +4 -0
  111. package/dist/components/ui/sonner.js +14 -0
  112. package/dist/components/ui/spark-bars.d.ts +29 -0
  113. package/dist/components/ui/spark-bars.js +24 -0
  114. package/dist/components/ui/spinner.d.ts +16 -0
  115. package/dist/components/ui/spinner.js +26 -0
  116. package/dist/components/ui/stacked-bar.d.ts +37 -0
  117. package/dist/components/ui/stacked-bar.js +56 -0
  118. package/dist/components/ui/status-dot.d.ts +16 -0
  119. package/dist/components/ui/status-dot.js +32 -0
  120. package/dist/components/ui/switch.d.ts +5 -0
  121. package/dist/components/ui/switch.js +13 -0
  122. package/dist/components/ui/tabs.d.ts +14 -0
  123. package/dist/components/ui/tabs.js +55 -0
  124. package/dist/components/ui/text.d.ts +27 -0
  125. package/dist/components/ui/text.js +100 -0
  126. package/dist/components/ui/textarea.d.ts +3 -0
  127. package/dist/components/ui/textarea.js +7 -0
  128. package/dist/components/ui/theme-toggle.d.ts +21 -0
  129. package/dist/components/ui/theme-toggle.js +17 -0
  130. package/dist/components/ui/toggle-group.d.ts +6 -0
  131. package/dist/components/ui/toggle-group.js +12 -0
  132. package/dist/components/ui/tooltip.d.ts +11 -0
  133. package/dist/components/ui/tooltip.js +21 -0
  134. package/dist/components/ui/trace.d.ts +24 -0
  135. package/dist/components/ui/trace.js +57 -0
  136. package/dist/components/ui/trend-line.d.ts +93 -0
  137. package/dist/components/ui/trend-line.js +215 -0
  138. package/dist/components/ui/truncate.d.ts +30 -0
  139. package/dist/components/ui/truncate.js +54 -0
  140. package/dist/components/ui/viewer-shell.d.ts +55 -0
  141. package/dist/components/ui/viewer-shell.js +15 -0
  142. package/dist/components/ui/virtual-list.d.ts +91 -0
  143. package/dist/components/ui/virtual-list.js +406 -0
  144. package/dist/components/ui/visually-hidden.d.ts +15 -0
  145. package/dist/components/ui/visually-hidden.js +19 -0
  146. package/dist/direction/index.d.ts +19 -0
  147. package/dist/direction/index.js +32 -0
  148. package/dist/hooks/use-code-highlighting.d.ts +22 -0
  149. package/dist/hooks/use-code-highlighting.js +47 -0
  150. package/dist/hooks/use-is-truncated.d.ts +7 -0
  151. package/dist/hooks/use-is-truncated.js +23 -0
  152. package/dist/hooks/use-mobile.d.ts +2 -0
  153. package/dist/hooks/use-mobile.js +15 -0
  154. package/dist/icons/custom.d.ts +29 -0
  155. package/dist/icons/custom.js +48 -0
  156. package/dist/icons/index.d.ts +49 -0
  157. package/dist/icons/index.js +50 -0
  158. package/dist/icons/provider-logos.d.ts +17 -0
  159. package/dist/icons/provider-logos.js +28 -0
  160. package/dist/icons/providers.d.ts +9 -0
  161. package/dist/icons/providers.js +51 -0
  162. package/dist/index.d.ts +102 -0
  163. package/dist/index.js +124 -0
  164. package/dist/lib/code-highlighter.d.ts +9 -0
  165. package/dist/lib/code-highlighter.js +65 -0
  166. package/dist/lib/code-language.d.ts +13 -0
  167. package/dist/lib/code-language.js +103 -0
  168. package/dist/lib/code-tokens.d.ts +9 -0
  169. package/dist/lib/code-tokens.js +27 -0
  170. package/dist/lib/copy-text.d.ts +6 -0
  171. package/dist/lib/copy-text.js +46 -0
  172. package/dist/lib/home-tile.d.ts +12 -0
  173. package/dist/lib/home-tile.js +45 -0
  174. package/dist/lib/reveal-mask.d.ts +9 -0
  175. package/dist/lib/reveal-mask.js +16 -0
  176. package/dist/lib/text-direction.d.ts +28 -0
  177. package/dist/lib/text-direction.js +119 -0
  178. package/dist/lib/utils.d.ts +11 -0
  179. package/dist/lib/utils.js +30 -0
  180. package/dist/motion/components.d.ts +184 -0
  181. package/dist/motion/components.js +211 -0
  182. package/dist/motion/config.d.ts +849 -0
  183. package/dist/motion/config.js +429 -0
  184. package/dist/motion/index.d.ts +8 -0
  185. package/dist/motion/index.js +8 -0
  186. package/dist/motion/modal-presence.d.ts +5 -0
  187. package/dist/motion/modal-presence.js +27 -0
  188. package/dist/motion/popup.d.ts +77 -0
  189. package/dist/motion/popup.js +103 -0
  190. package/dist/platform/index.d.ts +29 -0
  191. package/dist/platform/index.js +63 -0
  192. package/dist/styles/base.css +319 -0
  193. package/dist/styles/fonts/Figtree-Variable.woff2 +0 -0
  194. package/dist/styles/fonts/OFL.txt +93 -0
  195. package/dist/styles/fonts/Poppins-Medium.woff2 +0 -0
  196. package/dist/styles/fonts/Poppins-Regular.woff2 +0 -0
  197. package/dist/styles/fonts/Poppins-SemiBold.woff2 +0 -0
  198. package/dist/styles/fonts.css +28 -0
  199. package/dist/styles/globals.css +8 -0
  200. package/dist/styles/mcp-host.css +76 -0
  201. package/dist/styles/tokens.css +387 -0
  202. package/dist/styles/tokens.d.mts +57 -0
  203. package/dist/styles/tokens.mjs +59 -0
  204. package/dist/theme/index.d.ts +28 -0
  205. package/dist/theme/index.js +65 -0
  206. package/package.json +136 -3
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @no-story Context provider — renders no UI; sets data-platform on document.documentElement.
3
+ */
4
+ import { type ReactNode } from 'react';
5
+ type Platform = 'web' | 'mobile';
6
+ interface PlatformContextValue {
7
+ platform: Platform;
8
+ }
9
+ interface PlatformProviderProps {
10
+ /** Explicit override — native shell sets this; omit to fall back to ?mode=mobile. */
11
+ platform?: Platform;
12
+ children: ReactNode;
13
+ }
14
+ /**
15
+ * Resolves the active platform (`'web'` | `'mobile'`) and writes
16
+ * `data-platform` to `document.documentElement` so the
17
+ * `:root:where([data-platform='mobile'])` token scope activates.
18
+ *
19
+ * Priority: explicit prop → `?mode=mobile` query param → `'web'`.
20
+ */
21
+ declare function PlatformProvider({ platform: platformProp, children }: PlatformProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<PlatformContextValue | null>>;
22
+ /**
23
+ * Returns the active `platform` value set by the nearest `PlatformProvider`.
24
+ *
25
+ * @throws if called outside a `PlatformProvider`.
26
+ */
27
+ declare function usePlatform(): PlatformContextValue;
28
+ export type { Platform, PlatformProviderProps };
29
+ export { PlatformProvider, usePlatform };
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @no-story Context provider — renders no UI; sets data-platform on document.documentElement.
3
+ */
4
+ import { createContext, createElement, useContext, useInsertionEffect, useMemo, } from 'react';
5
+ const PlatformContext = createContext(null);
6
+ function resolveQueryParam() {
7
+ // SSR / no-document guard
8
+ if (typeof document === 'undefined')
9
+ return 'web';
10
+ try {
11
+ const params = new URLSearchParams(window.location.search);
12
+ return params.get('mode') === 'mobile' ? 'mobile' : 'web';
13
+ }
14
+ catch {
15
+ return 'web';
16
+ }
17
+ }
18
+ /**
19
+ * Resolves the active platform (`'web'` | `'mobile'`) and writes
20
+ * `data-platform` to `document.documentElement` so the
21
+ * `:root:where([data-platform='mobile'])` token scope activates.
22
+ *
23
+ * Priority: explicit prop → `?mode=mobile` query param → `'web'`.
24
+ */
25
+ function PlatformProvider({ platform: platformProp, children }) {
26
+ const platform = useMemo(() => platformProp ?? resolveQueryParam(), [platformProp]);
27
+ // Not a passive effect: row virtualizers measure in ref callbacks, which run before it.
28
+ useInsertionEffect(() => {
29
+ if (typeof document === 'undefined')
30
+ return;
31
+ const root = document.documentElement;
32
+ const previous = root.dataset['platform'];
33
+ if (platform === 'mobile') {
34
+ root.dataset['platform'] = 'mobile';
35
+ }
36
+ else {
37
+ delete root.dataset['platform'];
38
+ }
39
+ // A provider that unmounts (mweb shell → desktop shell on resize) hands the attribute back.
40
+ return () => {
41
+ if (previous === undefined)
42
+ delete root.dataset['platform'];
43
+ else
44
+ root.dataset['platform'] = previous;
45
+ };
46
+ }, [platform]);
47
+ const value = useMemo(() => ({ platform }), [platform]);
48
+ return createElement(PlatformContext.Provider, { value }, children);
49
+ }
50
+ /**
51
+ * Returns the active `platform` value set by the nearest `PlatformProvider`.
52
+ *
53
+ * @throws if called outside a `PlatformProvider`.
54
+ */
55
+ function usePlatform() {
56
+ const ctx = useContext(PlatformContext);
57
+ if (ctx === null) {
58
+ throw new Error('usePlatform() must be called inside a <PlatformProvider>. ' +
59
+ 'Wrap your app (or the relevant subtree) with <PlatformProvider>.');
60
+ }
61
+ return ctx;
62
+ }
63
+ export { PlatformProvider, usePlatform };
@@ -0,0 +1,319 @@
1
+ /*
2
+ * Tokens, the Tailwind bridge and base styles, with no fonts and no
3
+ * `@source` list. `globals.css` is the app entry (this plus those); an MCP Apps view imports this and
4
+ * declares only the sources it renders, so the bundle stays small and needs no font files.
5
+ */
6
+ @import 'tailwindcss';
7
+ @import './tokens.css';
8
+
9
+ /*
10
+ * `:where()` keeps this at (0,1,0) so it ties with the token scopes in tokens.css.
11
+ * Matching `.dark` itself as well as its descendants is what lets `:root.dark` win.
12
+ */
13
+ @custom-variant dark (&:where(.dark, .dark *));
14
+
15
+ /*
16
+ * `inline` is required, not stylistic. Plain `@theme` emits a var() that freezes to
17
+ * the :root value, so `.dark` and `[data-platform]` overrides would never apply and
18
+ * opacity modifiers (bg-primary/50) would break.
19
+ */
20
+ @theme inline {
21
+ --color-background: var(--background);
22
+ --color-foreground: var(--foreground);
23
+
24
+ --color-card: var(--card);
25
+ --color-card-foreground: var(--card-foreground);
26
+ --color-popover: var(--popover);
27
+ --color-popover-foreground: var(--popover-foreground);
28
+
29
+ --color-primary: var(--primary);
30
+ --color-primary-foreground: var(--primary-foreground);
31
+ --color-secondary: var(--secondary);
32
+ --color-secondary-foreground: var(--secondary-foreground);
33
+ --color-muted: var(--muted);
34
+ --color-muted-foreground: var(--muted-foreground);
35
+ --color-accent: var(--accent);
36
+ --color-accent-foreground: var(--accent-foreground);
37
+ --color-destructive: var(--destructive);
38
+ --color-destructive-foreground: var(--destructive-foreground);
39
+
40
+ --color-border: var(--border);
41
+ --color-input: var(--input);
42
+ --color-ring: var(--ring);
43
+
44
+ --color-sidebar: var(--sidebar);
45
+ --color-sidebar-foreground: var(--sidebar-foreground);
46
+ --color-sidebar-primary: var(--sidebar-primary);
47
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
48
+ --color-sidebar-accent: var(--sidebar-accent);
49
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
50
+ --color-sidebar-border: var(--sidebar-border);
51
+ --color-sidebar-ring: var(--sidebar-ring);
52
+
53
+ --color-surface-1: var(--surface-1);
54
+
55
+ --color-selected: var(--selected);
56
+ --color-selected-foreground: var(--selected-foreground);
57
+ --color-highlight: var(--highlight);
58
+ --color-icon: var(--icon);
59
+ --color-disabled: var(--disabled);
60
+ --color-disabled-foreground: var(--disabled-foreground);
61
+ --color-placeholder: var(--placeholder);
62
+ --color-inverted: var(--inverted);
63
+ --color-inverted-foreground: var(--inverted-foreground);
64
+ --color-surface-primary: var(--surface-primary);
65
+ --color-primary-hover: var(--primary-hover);
66
+ --color-status-idle: var(--status-idle);
67
+ --color-status-working: var(--status-working);
68
+ --color-status-done: var(--status-done);
69
+ --color-status-stuck: var(--status-stuck);
70
+ --color-warning: var(--warning);
71
+ --color-warning-foreground: var(--warning-foreground);
72
+ --color-positive: var(--positive);
73
+ --color-positive-foreground: var(--positive-foreground);
74
+ --color-subtle-foreground: var(--subtle-foreground);
75
+ --color-accent-teal: var(--accent-teal);
76
+ --color-accent-yellow: var(--accent-yellow);
77
+ --color-aquamarine: var(--aquamarine);
78
+ --color-accent-purple: var(--accent-purple);
79
+ --color-negative: var(--negative);
80
+ --color-run-stopped: var(--run-stopped);
81
+ --color-avatar-person: var(--avatar-person);
82
+ --color-avatar-agent: var(--avatar-agent);
83
+ --color-home-canvas: var(--home-canvas);
84
+ --color-home-card: var(--home-card);
85
+ --color-home-chip: var(--home-chip);
86
+ --color-home-chip-selected: var(--home-chip-selected);
87
+ --color-home-chip-selected-foreground: var(--home-chip-selected-foreground);
88
+ --color-home-skeleton: var(--home-skeleton);
89
+ --color-home-offline-banner: var(--home-offline-banner);
90
+ --color-home-running: var(--home-running);
91
+ --color-home-running-halo: var(--home-running-halo);
92
+ --color-home-tile-1: var(--home-tile-1);
93
+ --color-home-tile-2: var(--home-tile-2);
94
+ --color-home-tile-3: var(--home-tile-3);
95
+ --color-home-tile-4: var(--home-tile-4);
96
+
97
+ --spacing-nav: var(--nav-w);
98
+ --spacing-nav-icon: var(--nav-w-icon);
99
+
100
+ --font-heading: var(--font-heading);
101
+
102
+ --text-body-1: var(--type-body-1);
103
+ --text-body-1--line-height: var(--type-body-1-lh);
104
+ --text-body-2: var(--type-body-2);
105
+ --text-body-2--line-height: var(--type-body-2-lh);
106
+ --text-body-3: var(--type-body-3);
107
+ --text-body-3--line-height: var(--type-body-3-lh);
108
+ /* 13px between body-3 (12) and body-2 (14): dialog hints, segmented controls and tabs from the Agents design. */
109
+ --text-compact: 0.8125rem;
110
+ --text-compact--line-height: 1.25rem;
111
+ /* 15px between body-2 (14) and body-1 (16): the Figma "Body 15 Regular" of the mweb menu. */
112
+ --text-body-15: 0.9375rem;
113
+ --text-body-15--line-height: 1.25rem;
114
+ --text-h3: var(--type-h3);
115
+ --text-h3--line-height: var(--type-h3-lh);
116
+ --text-h3--letter-spacing: var(--type-h3-tracking);
117
+
118
+ /* Charts: `bg-chart-1` … `bg-chart-5`, `stroke-chart-1`, `fill-chart-1`. */
119
+ --color-chart-1: var(--chart-1);
120
+ --color-chart-2: var(--chart-2);
121
+ --color-chart-3: var(--chart-3);
122
+ --color-chart-4: var(--chart-4);
123
+ --color-chart-5: var(--chart-5);
124
+
125
+ /* Layout: `max-w-content`, `h-bar`, `w-panel`, `w-panel-lg`, `min-w-chat`, `text-message`. */
126
+ --container-content: var(--content-max);
127
+
128
+ /*
129
+ * Chat-width container breakpoints (the chat pane's own width, not the viewport; Material 3
130
+ * window-size boundaries). `tight` < 600px (phones, narrow panes) · `compact` 600-839px
131
+ * (laptop with panels open) · `wide` >= 840px. Only `tight` is used so far, as the
132
+ * `@max-chat-compact:` variant. Change a number here and every user follows. Container
133
+ * queries cannot read `var()`, so these stay literals.
134
+ */
135
+ --container-chat-compact: 37.5rem; /* tight below this, compact from it */
136
+ /* --container-chat-wide: 52.5rem; wide from here; uncomment when something needs it */
137
+ --spacing-bar: var(--bar-h);
138
+ --spacing-panel: var(--panel-w);
139
+ --spacing-panel-lg: var(--panel-w-lg);
140
+ --spacing-chat: var(--chat-min);
141
+ --text-message: var(--message-size);
142
+ --text-message--line-height: 1.375rem; /* 16/22 */
143
+ --text-message-jumbo: calc(var(--message-size) + 0.25rem); /* a message of only emoji: +4px */
144
+ --text-message-jumbo--line-height: 1.625rem; /* 20/26 */
145
+
146
+ --radius-sm: calc(var(--radius) - 4px);
147
+ --radius-md: calc(var(--radius) - 2px);
148
+ --radius-lg: var(--radius);
149
+ --radius-xl: calc(var(--radius) + 4px);
150
+ --radius-2xl: 1rem; /* 16px. The white page card (PageSurface), one step past radius-xl. */
151
+
152
+ --spacing-tap: var(--tap-target);
153
+ --spacing-safe-bottom: var(--safe-area-bottom);
154
+
155
+ /* Type: drives `font-sans` / `font-mono`. Sourced from `--font-ui`/`--font-code`
156
+ * rather than same-named tokens, which would make these entries circular. */
157
+ --font-sans: var(--font-ui);
158
+ --font-mono: var(--font-code);
159
+ --font-emoji: var(--font-emoji-stack);
160
+
161
+ /* Elevation: drives `shadow-xs` … `shadow-lg`, overriding Tailwind's defaults so
162
+ * shadows pick up the active theme's neutral instead of a fixed black. */
163
+ --shadow-xs: var(--elevation-xs);
164
+ --shadow-sm: var(--elevation-sm);
165
+ --shadow-md: var(--elevation-md);
166
+ --shadow-lg: var(--elevation-lg);
167
+ --shadow-card: var(--elevation-card);
168
+ --shadow-pill: var(--elevation-pill);
169
+ }
170
+
171
+ /* The only CSS motion left is hover/focus/press feedback (`transition-colors`, `-opacity`,
172
+ * `-shadow`); everything else is motion.dev (src/motion/config.ts). Those transitions carry no
173
+ * duration or easing class, so they all run on `duration.fast` / `ease.standard` from here. */
174
+ @theme {
175
+ --default-transition-duration: var(--motion-fast);
176
+ --default-transition-timing-function: var(--motion-ease);
177
+ }
178
+
179
+ /*
180
+ * Padding for a surface pinned to the whole viewport (`fixed inset-0`: a maximized card, a full
181
+ * screen preview, a lightbox). Such a surface ignores the layout, so on a phone its edges land under
182
+ * the notch and the home indicator. Put `safe-overlay` on the fixed element and its content stays
183
+ * clear of them; `--overlay-gutter` (default 0) is the breathing room wanted on top of that. Do not
184
+ * add the iOS host's nav bar height by hand: the host's top inset already includes it.
185
+ */
186
+ @utility safe-overlay {
187
+ padding-top: calc(env(safe-area-inset-top, 0px) + var(--overlay-gutter, 0px));
188
+ padding-right: max(var(--overlay-gutter, 0px), env(safe-area-inset-right, 0px));
189
+ padding-bottom: max(var(--overlay-gutter, 0px), env(safe-area-inset-bottom, 0px));
190
+ padding-left: max(var(--overlay-gutter, 0px), env(safe-area-inset-left, 0px));
191
+ }
192
+
193
+ /*
194
+ * The same insets as a transparent border, for an edge-pinned surface that has its own padding
195
+ * (a sheet). A border is painted over by the surface's background, so it looks like padding, but a
196
+ * caller's `p-*` / `pb-*` cannot override it, so the inset survives however the content is padded.
197
+ * `safe-overlay` is the padding form for a surface that fills the viewport.
198
+ */
199
+ @utility safe-border-t {
200
+ border-top: env(safe-area-inset-top, 0px) solid transparent;
201
+ }
202
+ @utility safe-border-r {
203
+ border-right: env(safe-area-inset-right, 0px) solid transparent;
204
+ }
205
+ @utility safe-border-b {
206
+ border-bottom: env(safe-area-inset-bottom, 0px) solid transparent;
207
+ }
208
+ @utility safe-border-l {
209
+ border-left: env(safe-area-inset-left, 0px) solid transparent;
210
+ }
211
+
212
+ @layer base {
213
+ * {
214
+ @apply border-border outline-ring/50;
215
+ }
216
+
217
+ body {
218
+ @apply bg-background text-foreground text-body-2 font-sans antialiased;
219
+ }
220
+
221
+ /* The thumb stays. The track behind it has no fill and no stroke. */
222
+ * {
223
+ scrollbar-color: color-mix(in srgb, var(--icon) 55%, transparent) transparent;
224
+ }
225
+
226
+ *::-webkit-scrollbar {
227
+ width: 10px;
228
+ height: 10px;
229
+ background: transparent;
230
+ }
231
+
232
+ *::-webkit-scrollbar-track,
233
+ *::-webkit-scrollbar-corner {
234
+ background: transparent;
235
+ border: none;
236
+ }
237
+
238
+ *::-webkit-scrollbar-thumb {
239
+ background: color-mix(in srgb, var(--icon) 55%, transparent);
240
+ border: none;
241
+ border-radius: 999px;
242
+ }
243
+
244
+ /* Touch: no grey tap flash, and no double-tap-zoom delay on controls. */
245
+ html {
246
+ -webkit-tap-highlight-color: transparent;
247
+ }
248
+
249
+ :where(button, [role='button'], a[href], summary, select, label[for], [role='menuitem']) {
250
+ touch-action: manipulation;
251
+ }
252
+
253
+ h1,
254
+ h2,
255
+ h3 {
256
+ @apply font-heading;
257
+ }
258
+
259
+ /* Tailwind's preflight leaves buttons on the arrow cursor. Anything clickable shows the
260
+ * pointer instead, and disabled controls show not-allowed. Utilities still override both. */
261
+ :where(
262
+ button,
263
+ [role='button'],
264
+ a[href],
265
+ summary,
266
+ select,
267
+ label[for],
268
+ [role='menuitem'],
269
+ [role='menuitemcheckbox'],
270
+ [role='menuitemradio'],
271
+ [role='option'],
272
+ [role='tab'],
273
+ [role='switch'],
274
+ [role='checkbox'],
275
+ [role='radio'],
276
+ input[type='checkbox'],
277
+ input[type='radio'],
278
+ input[type='file']
279
+ ) {
280
+ cursor: pointer;
281
+ }
282
+
283
+ :where(
284
+ button:disabled,
285
+ select:disabled,
286
+ input:disabled,
287
+ [role='button'][aria-disabled='true'],
288
+ [role='menuitem'][aria-disabled='true'],
289
+ [role='option'][aria-disabled='true'],
290
+ [role='tab'][aria-disabled='true'],
291
+ [role='switch'][aria-disabled='true'],
292
+ [role='checkbox'][aria-disabled='true'],
293
+ [role='radio'][aria-disabled='true']
294
+ ) {
295
+ cursor: not-allowed;
296
+ }
297
+ }
298
+
299
+ /* Reduced motion for the little CSS still animates (the JS side is `MotionProvider`): hover
300
+ * feedback, third-party widgets and the mobile View Transitions collapse to an instant change.
301
+ * Transitions keep 1ms rather than 0 so Base UI's transitionend waits still resolve. */
302
+ @media (prefers-reduced-motion: reduce) {
303
+ *,
304
+ ::before,
305
+ ::after {
306
+ animation-duration: 1ms !important;
307
+ animation-iteration-count: 1 !important;
308
+ transition-duration: 1ms !important;
309
+ scroll-behavior: auto !important;
310
+ }
311
+
312
+ ::view-transition-group(*),
313
+ ::view-transition-old(*),
314
+ ::view-transition-new(*) {
315
+ animation: none !important;
316
+ }
317
+ }
318
+
319
+ @source '../**/*.js';
@@ -0,0 +1,93 @@
1
+ Copyright 2022 The Figtree Project Authors (https://github.com/erikdkennedy/figtree)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,28 @@
1
+ @font-face {
2
+ font-family: 'Figtree';
3
+ font-style: normal;
4
+ font-weight: 300 900;
5
+ font-display: swap;
6
+ src: url('./fonts/Figtree-Variable.woff2') format('woff2');
7
+ }
8
+ @font-face {
9
+ font-family: 'Poppins';
10
+ font-style: normal;
11
+ font-weight: 400;
12
+ font-display: swap;
13
+ src: url('./fonts/Poppins-Regular.woff2') format('woff2');
14
+ }
15
+ @font-face {
16
+ font-family: 'Poppins';
17
+ font-style: normal;
18
+ font-weight: 500;
19
+ font-display: swap;
20
+ src: url('./fonts/Poppins-Medium.woff2') format('woff2');
21
+ }
22
+ @font-face {
23
+ font-family: 'Poppins';
24
+ font-style: normal;
25
+ font-weight: 600;
26
+ font-display: swap;
27
+ src: url('./fonts/Poppins-SemiBold.woff2') format('woff2');
28
+ }
@@ -0,0 +1,8 @@
1
+ /*
2
+ * The published `styles/globals.css` (copied over `globals.css` by scripts/build-package.mjs).
3
+ * Same entry as the app's, but built on the published `base.css`, which scans the compiled `.js`
4
+ * for utility classes instead of the TypeScript sources, and without the monorepo-only `@source`
5
+ * for @streams/mcp-apps.
6
+ */
7
+ @import './base.css';
8
+ @import './fonts.css';
@@ -0,0 +1,76 @@
1
+ /*
2
+ * MCP Apps host theming. The MCP Apps spec lets a host hand a view a set of standard CSS variables
3
+ * (`McpUiStyleVariableKey`: `--color-background-primary`, `--font-sans`, `--border-radius-md` ...).
4
+ * The view applies them on <html> (`applyHostStyleVariables`); this sheet points our semantic
5
+ * tokens at them, each with the Streams value as the fallback, so:
6
+ *
7
+ * - a host that sends none of them (or sends a subset) renders exactly like the app, and
8
+ * - a host that sends them (Claude Desktop, ChatGPT, VS Code ...) gets a form in its own colours.
9
+ *
10
+ * Imported only by MCP Apps views, never by the app shell. The brand `--primary` is deliberately
11
+ * not mapped: the spec has no brand colour, and a primary button should stay recognisable.
12
+ * Keep the host names in sync with the spec; mcp-host.test.ts in packages/mcp-apps checks them.
13
+ */
14
+ :root {
15
+ --background: var(--color-background-primary, var(--vibe-primary-background-color));
16
+ --card: var(--color-background-primary, var(--vibe-primary-background-color));
17
+ --popover: var(--color-background-primary, var(--vibe-primary-background-color));
18
+ --muted: var(--color-background-secondary, var(--vibe-grey-background-color));
19
+ --surface-1: var(--color-background-secondary, var(--vibe-grey-background-color));
20
+ --secondary: var(--color-background-tertiary, var(--vibe-ui-background-color));
21
+ --disabled: var(--color-background-disabled, var(--vibe-disabled-background-color));
22
+ --inverted: var(--color-background-inverse, var(--vibe-inverted-color-background));
23
+
24
+ --foreground: var(--color-text-primary, var(--vibe-primary-text-color));
25
+ --card-foreground: var(--color-text-primary, var(--vibe-primary-text-color));
26
+ --popover-foreground: var(--color-text-primary, var(--vibe-primary-text-color));
27
+ --secondary-foreground: var(--color-text-primary, var(--vibe-primary-text-color));
28
+ --accent-foreground: var(--color-text-primary, var(--vibe-primary-text-color));
29
+ --selected-foreground: var(--color-text-primary, var(--vibe-primary-text-color));
30
+ --muted-foreground: var(--color-text-secondary, var(--vibe-secondary-text-color));
31
+ --placeholder: var(--color-text-tertiary, var(--vibe-placeholder-color));
32
+ --disabled-foreground: var(--color-text-disabled, var(--vibe-disabled-text-color));
33
+ --inverted-foreground: var(--color-text-inverse, var(--vibe-text-color-on-inverted));
34
+ --destructive: var(--color-text-danger, var(--vibe-color-stuck-red));
35
+
36
+ --border: var(--color-border-primary, var(--vibe-layout-border-color));
37
+ --input: var(--color-border-primary, var(--vibe-ui-border-color));
38
+ --ring: var(--color-ring-primary, var(--vibe-primary-color));
39
+
40
+ /* Fonts need no mapping: base.css bridges `font-sans` / `font-mono` to `--font-sans` /
41
+ * `--font-mono`, which are the spec's own names, so a host value set on <html> wins and our
42
+ * stack is the default. (Mapping them through --font-ui would be a var() cycle.) */
43
+ --font-heading: var(--font-sans, var(--font-ui));
44
+
45
+ --type-body-1: var(--font-text-md-size, 1rem);
46
+ --type-body-1-lh: var(--font-text-md-line-height, 1.375rem);
47
+ --type-body-2: var(--font-text-sm-size, 0.875rem);
48
+ --type-body-2-lh: var(--font-text-sm-line-height, 1.25rem);
49
+ --type-body-3: var(--font-text-xs-size, 0.75rem);
50
+ --type-body-3-lh: var(--font-text-xs-line-height, 1rem);
51
+ --type-h3: var(--font-heading-xs-size, 1.125rem);
52
+ --type-h3-lh: var(--font-heading-xs-line-height, 1.5rem);
53
+
54
+ --radius: var(--border-radius-md, 0.5rem);
55
+ }
56
+
57
+ /*
58
+ * Fonts. base.css compiles `font-sans` and the body rule to the Streams stack directly
59
+ * (`@theme inline`), so a host's `--font-sans` / `--font-mono` would never reach the text. Unlayered
60
+ * rules beat every layer, so they set the family from the host variable, with our stack as fallback.
61
+ * (Reading the host variable inside --font-ui instead would be a var() cycle.)
62
+ */
63
+ body,
64
+ button,
65
+ input,
66
+ select,
67
+ textarea {
68
+ font-family: var(--font-sans, var(--font-ui));
69
+ }
70
+
71
+ code,
72
+ kbd,
73
+ pre,
74
+ samp {
75
+ font-family: var(--font-mono, var(--font-code));
76
+ }