@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,14 @@
1
+ import { Tabs as TabsPrimitive } from '@base-ui/react/tabs';
2
+ /**
3
+ * `default` is shadcn's pill list (a raised background slides between tabs).
4
+ * `underline` is Vibe's tab list: text on a hairline, with a 2px primary bar under the active tab.
5
+ * `inverted` is a segmented control: a dark pill (`bg-inverted`) slides across a grey track.
6
+ */
7
+ type TabsVariant = 'default' | 'underline' | 'inverted';
8
+ declare function Tabs({ className, ...props }: TabsPrimitive.Root.Props): import("react").JSX.Element;
9
+ declare function TabsList({ className, variant, ...props }: TabsPrimitive.List.Props & {
10
+ variant?: TabsVariant;
11
+ }): import("react").JSX.Element;
12
+ declare function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props): import("react").JSX.Element;
13
+ declare function TabsContent({ className, ...props }: TabsPrimitive.Panel.Props): import("react").JSX.Element;
14
+ export { Tabs, TabsList, TabsTrigger, TabsContent, type TabsVariant };
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createContext, useContext, useId } from 'react';
3
+ import { Tabs as TabsPrimitive } from '@base-ui/react/tabs';
4
+ import { LayoutGroup, motion } from '../../motion/index.js';
5
+ import { transitions } from '../../motion/config.js';
6
+ import { cn } from '../../lib/utils.js';
7
+ const TabsVariantContext = createContext('default');
8
+ function Tabs({ className, ...props }) {
9
+ return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", className: cn('flex flex-col gap-2', className), ...props }));
10
+ }
11
+ function TabsList({ className, variant = 'default', ...props }) {
12
+ const id = useId();
13
+ return (_jsx(TabsVariantContext, { value: variant, children: _jsx(LayoutGroup, { id: id, children: _jsx(TabsPrimitive.List, { "data-slot": "tabs-list", "data-variant": variant, className: cn(variant === 'underline'
14
+ ? 'flex items-stretch border-b border-border text-muted-foreground'
15
+ : variant === 'inverted'
16
+ ? 'inline-flex w-fit items-center justify-center gap-1 rounded-lg bg-secondary p-1 text-muted-foreground'
17
+ : 'inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground', className), ...props }) }) }));
18
+ }
19
+ /**
20
+ * Render function for a tab trigger. Defined at module scope (stable reference).
21
+ * Conditionally renders a shared-layout motion span that slides between tabs.
22
+ * Base UI's TabsTabState uses `active` (not `selected`) for the current tab.
23
+ */
24
+ const pillTabTrigger = (indicatorClassName) => (props, state) => {
25
+ const { children, ...rest } = props;
26
+ return (_jsxs("button", { ...rest, children: [state.active && (_jsx(motion.span, { layoutId: "tabs-active-bg", layout: true,
27
+ // It slides between tabs through `layoutId` as it remounts. Re-measuring on every render
28
+ // would have it chase a tab list that is itself moving (a dialog or sheet arriving).
29
+ layoutDependency: 0, transition: transitions.layout, "aria-hidden": "true", className: cn('absolute inset-0 rounded-md', indicatorClassName) })), _jsx("span", { className: "relative", children: children })] }));
30
+ };
31
+ const renderTabTrigger = pillTabTrigger('bg-background shadow-sm');
32
+ const renderInvertedTabTrigger = pillTabTrigger('bg-inverted');
33
+ /** Same as `renderTabTrigger`, with the indicator drawn as Vibe's bar under the active tab. */
34
+ function renderUnderlineTabTrigger(props, state) {
35
+ const { children, ...rest } = props;
36
+ return (_jsxs("button", { ...rest, children: [_jsx("span", { className: "relative", children: children }), state.active && (_jsx(motion.span, { layoutId: "tabs-active-underline", layout: true, layoutDependency: 0, transition: transitions.layout, "aria-hidden": "true",
37
+ // -bottom-px covers the list's hairline so the bar reads as sitting on it.
38
+ className: "absolute inset-x-0 -bottom-px h-0.5 bg-primary" }))] }));
39
+ }
40
+ function TabsTrigger({ className, ...props }) {
41
+ const variant = useContext(TabsVariantContext);
42
+ return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", render: variant === 'underline'
43
+ ? renderUnderlineTabTrigger
44
+ : variant === 'inverted'
45
+ ? renderInvertedTabTrigger
46
+ : renderTabTrigger, className: cn('relative inline-flex items-center justify-center whitespace-nowrap outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50', variant === 'underline'
47
+ ? 'h-10 rounded-t-sm px-4 text-sm font-normal hover:bg-accent hover:text-foreground data-active:text-primary'
48
+ : variant === 'inverted'
49
+ ? 'h-8 rounded-md px-4 text-compact font-semibold data-active:text-inverted-foreground'
50
+ : 'rounded-md px-3 py-1 text-sm font-medium data-active:text-foreground', className), ...props }));
51
+ }
52
+ function TabsContent({ className, ...props }) {
53
+ return (_jsx(TabsPrimitive.Panel, { "data-slot": "tabs-content", className: cn('flex-1 outline-none', className), ...props }));
54
+ }
55
+ export { Tabs, TabsList, TabsTrigger, TabsContent };
@@ -0,0 +1,27 @@
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ /**
4
+ * Token-backed typography primitive.
5
+ *
6
+ * Mirrors Vibe's `type` / `color` / `weight` prop surface so existing call
7
+ * sites migrate without style regressions. Heading types (`h1`–`h6`) render
8
+ * as the correct HTML element by default; text types render as `<span>`.
9
+ * Use the `render` prop to swap the underlying element without losing variants.
10
+ */
11
+ declare const textVariants: (props?: ({
12
+ type?: "h3" | "base" | "h1" | "h2" | "h4" | "h5" | "h6" | "sm" | "lg" | "xl" | "xs" | null | undefined;
13
+ color?: "inherit" | "destructive" | "muted" | "primary" | "foreground" | "accent" | null | undefined;
14
+ weight?: "bold" | "medium" | "normal" | "semibold" | null | undefined;
15
+ size?: "default" | "sm" | "lg" | null | undefined;
16
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
17
+ type TextProps = useRender.ComponentProps<'span'> & VariantProps<typeof textVariants> & {
18
+ /** Truncate overflowing text with an ellipsis. Shows a tooltip with the full text by default. */
19
+ ellipsis?: boolean;
20
+ /**
21
+ * Only with `ellipsis`. `false` turns the tooltip off; a string overrides its content (needed
22
+ * when the children are not plain text). Default: the children's text.
23
+ */
24
+ tooltip?: boolean | string;
25
+ };
26
+ declare function Text({ className, type, color, weight, size, render, ellipsis, tooltip, ...props }: TextProps): import("react").JSX.Element;
27
+ export { Text, textVariants, type TextProps };
@@ -0,0 +1,100 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { mergeProps } from '@base-ui/react/merge-props';
3
+ import { useRender } from '@base-ui/react/use-render';
4
+ import { useRef } from 'react';
5
+ import { cva } from 'class-variance-authority';
6
+ import { cn } from '../../lib/utils.js';
7
+ import { TruncationTooltip, useTruncationTooltip } from './truncate.js';
8
+ /**
9
+ * Token-backed typography primitive.
10
+ *
11
+ * Mirrors Vibe's `type` / `color` / `weight` prop surface so existing call
12
+ * sites migrate without style regressions. Heading types (`h1`–`h6`) render
13
+ * as the correct HTML element by default; text types render as `<span>`.
14
+ * Use the `render` prop to swap the underlying element without losing variants.
15
+ */
16
+ const textVariants = cva('', {
17
+ variants: {
18
+ /**
19
+ * Typography scale. Heading types (`h1`–`h6`) carry `scroll-m-20`,
20
+ * `tracking-tight`, and `font-semibold`; text types set only line-height.
21
+ * Pass `weight` to override the weight on any type.
22
+ */
23
+ type: {
24
+ h1: 'scroll-m-20 text-4xl font-semibold tracking-tight',
25
+ h2: 'scroll-m-20 text-3xl font-semibold tracking-tight',
26
+ h3: 'scroll-m-20 text-2xl font-semibold tracking-tight',
27
+ h4: 'scroll-m-20 text-xl font-semibold tracking-tight',
28
+ h5: 'scroll-m-20 text-lg font-semibold tracking-tight',
29
+ h6: 'scroll-m-20 text-base font-semibold tracking-tight',
30
+ xl: 'text-xl leading-relaxed',
31
+ lg: 'text-lg leading-relaxed',
32
+ base: 'text-base leading-normal',
33
+ sm: 'text-sm leading-normal',
34
+ xs: 'text-xs leading-normal',
35
+ },
36
+ /** Semantic colour mapped to a design-token utility. Never a raw hex. */
37
+ color: {
38
+ foreground: 'text-foreground',
39
+ muted: 'text-muted-foreground',
40
+ primary: 'text-primary',
41
+ destructive: 'text-destructive',
42
+ accent: 'text-accent-foreground',
43
+ inherit: 'text-inherit',
44
+ },
45
+ /** Font weight. Overrides any weight baked into the `type` variant. */
46
+ weight: {
47
+ normal: 'font-normal',
48
+ medium: 'font-medium',
49
+ semibold: 'font-semibold',
50
+ bold: 'font-bold',
51
+ },
52
+ /** Body size scale. Maps to design token text-body-* utilities. */
53
+ size: {
54
+ sm: 'text-body-3',
55
+ default: 'text-body-2',
56
+ lg: 'text-body-1',
57
+ },
58
+ },
59
+ defaultVariants: {
60
+ type: 'base',
61
+ color: 'foreground',
62
+ // weight has no default — when unset, the type variant's weight (font-semibold
63
+ // on headings) applies. Explicitly passing weight overrides it via tailwind-merge.
64
+ // size has no default — it only applies when explicitly passed.
65
+ },
66
+ });
67
+ /**
68
+ * Returns the default HTML element for a given `type` variant.
69
+ * Heading types map to the matching heading element; all others use `span`.
70
+ */
71
+ function tagForType(type) {
72
+ if (type === 'h1')
73
+ return 'h1';
74
+ if (type === 'h2')
75
+ return 'h2';
76
+ if (type === 'h3')
77
+ return 'h3';
78
+ if (type === 'h4')
79
+ return 'h4';
80
+ if (type === 'h5')
81
+ return 'h5';
82
+ if (type === 'h6')
83
+ return 'h6';
84
+ return 'span';
85
+ }
86
+ function Text({ className, type = 'base', color = 'foreground', weight, size, render, ellipsis = false, tooltip = true, ...props }) {
87
+ const ref = useRef(null);
88
+ const truncation = useTruncationTooltip(ref, ellipsis, tooltip, props.children);
89
+ const element = useRender({
90
+ defaultTagName: tagForType(type),
91
+ ref,
92
+ props: mergeProps({
93
+ className: cn(textVariants({ type, color, weight, size }), ellipsis && 'block max-w-full truncate', className),
94
+ }, props),
95
+ render,
96
+ state: { slot: 'text', type, color, weight, size },
97
+ });
98
+ return (_jsx(TruncationTooltip, { text: truncation.text, truncated: truncation.truncated, children: element }));
99
+ }
100
+ export { Text, textVariants };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare function Textarea({ className, ...props }: React.ComponentProps<'textarea'>): React.JSX.Element;
3
+ export { Textarea };
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { cn } from '../../lib/utils.js';
4
+ function Textarea({ className, ...props }) {
5
+ return (_jsx("textarea", { "data-slot": "textarea", className: cn('flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-placeholder focus-visible:border-ring disabled:cursor-not-allowed disabled:bg-disabled disabled:text-disabled-foreground disabled:opacity-100 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40', className), ...props }));
6
+ }
7
+ export { Textarea };
@@ -0,0 +1,21 @@
1
+ import { type Theme } from '../../theme/index.js';
2
+ interface ThemeToggleProps {
3
+ labels: {
4
+ legend: string;
5
+ system: string;
6
+ light: string;
7
+ dark: string;
8
+ };
9
+ className?: string;
10
+ /**
11
+ * Dense 28px icon hits for menus (account menu, browser toolbar). Default matches
12
+ * the Settings Appearance card.
13
+ */
14
+ compact?: boolean;
15
+ /** When set, names the group instead of `labels.legend` (visible label beside the toggles). */
16
+ labelledBy?: string;
17
+ /** Fired after the theme preference changes (Settings analytics). */
18
+ onThemeChange?: (theme: Theme) => void;
19
+ }
20
+ declare function ThemeToggle({ labels, className, compact, labelledBy, onThemeChange, }: ThemeToggleProps): import("react").JSX.Element;
21
+ export { ThemeToggle, type ThemeToggleProps };
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../../lib/utils.js';
3
+ import { Sun, Moon, Monitor } from '../../icons/index.js';
4
+ import { useTheme } from '../../theme/index.js';
5
+ import { ToggleGroup, ToggleGroupItem } from './toggle-group.js';
6
+ function ThemeToggle({ labels, className, compact = false, labelledBy, onThemeChange, }) {
7
+ const { theme, setTheme } = useTheme();
8
+ const itemClass = compact ? 'size-7 shrink-0 p-0' : undefined;
9
+ return (_jsxs(ToggleGroup, { "aria-label": labelledBy ? undefined : labels.legend, "aria-labelledby": labelledBy, value: [theme], onValueChange: (vals) => {
10
+ const next = vals[vals.length - 1];
11
+ if (!next)
12
+ return;
13
+ setTheme(next);
14
+ onThemeChange?.(next);
15
+ }, className: cn('gap-0.5', className), children: [_jsx(ToggleGroupItem, { value: "system", "aria-label": labels.system, title: labels.system, className: itemClass, children: _jsx(Monitor, { className: "size-3.5" }) }), _jsx(ToggleGroupItem, { value: "light", "aria-label": labels.light, title: labels.light, className: itemClass, children: _jsx(Sun, { className: "size-3.5" }) }), _jsx(ToggleGroupItem, { value: "dark", "aria-label": labels.dark, title: labels.dark, className: itemClass, children: _jsx(Moon, { className: "size-3.5" }) })] }));
16
+ }
17
+ export { ThemeToggle };
@@ -0,0 +1,6 @@
1
+ import { ToggleGroup as ToggleGroupPrimitive } from '@base-ui/react/toggle-group';
2
+ import { Toggle } from '@base-ui/react/toggle';
3
+ /** `multiple` allows several items pressed simultaneously (toolbar-style); default is single-select. */
4
+ declare function ToggleGroup<Value extends string>({ className, ...props }: ToggleGroupPrimitive.Props<Value>): import("react").JSX.Element;
5
+ declare function ToggleGroupItem<Value extends string>({ className, ...props }: Toggle.Props<Value>): import("react").JSX.Element;
6
+ export { ToggleGroup, ToggleGroupItem };
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ToggleGroup as ToggleGroupPrimitive } from '@base-ui/react/toggle-group';
3
+ import { Toggle } from '@base-ui/react/toggle';
4
+ import { cn } from '../../lib/utils.js';
5
+ /** `multiple` allows several items pressed simultaneously (toolbar-style); default is single-select. */
6
+ function ToggleGroup({ className, ...props }) {
7
+ return (_jsx(ToggleGroupPrimitive, { "data-slot": "toggle-group", className: cn('inline-flex items-center justify-center gap-1 rounded-md', className), ...props }));
8
+ }
9
+ function ToggleGroupItem({ className, ...props }) {
10
+ return (_jsx(Toggle, { "data-slot": "toggle-group-item", className: cn('inline-flex items-center justify-center rounded-sm px-3 py-1.5 text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-pressed:bg-accent data-pressed:text-accent-foreground', className), ...props }));
11
+ }
12
+ export { ToggleGroup, ToggleGroupItem };
@@ -0,0 +1,11 @@
1
+ import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
2
+ import { type PopupVariant } from '../../motion/popup.js';
3
+ declare function TooltipProvider({ delay, ...props }: TooltipPrimitive.Provider.Props): import("react").JSX.Element;
4
+ declare function Tooltip({ actionsRef, onOpenChange, ...props }: TooltipPrimitive.Root.Props): import("react").JSX.Element;
5
+ declare function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props): import("react").JSX.Element;
6
+ declare function TooltipContent({ className, side, sideOffset, // Vibe: the arrow sits 10px off the trigger
7
+ align, alignOffset, collisionAvoidance, motion, children, ...props }: TooltipPrimitive.Popup.Props & {
8
+ /** `drift-tip` fades and rises without the scale, for a tip on a dense form. */
9
+ motion?: Extract<PopupVariant, 'scale' | 'drift-tip'>;
10
+ } & Pick<TooltipPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset' | 'collisionAvoidance'>): import("react").JSX.Element;
11
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
4
+ import { cn } from '../../lib/utils.js';
5
+ import { PopupExitContext, usePopupExit, usePopupRender } from '../../motion/popup.js';
6
+ function TooltipProvider({ delay = 0, ...props }) {
7
+ return _jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delay: delay, ...props });
8
+ }
9
+ function Tooltip({ actionsRef, onOpenChange, ...props }) {
10
+ const exit = usePopupExit(actionsRef, onOpenChange);
11
+ return (_jsx(PopupExitContext, { value: exit.unmount, children: _jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props, actionsRef: exit.actionsRef, onOpenChange: exit.onOpenChange }) }));
12
+ }
13
+ function TooltipTrigger({ ...props }) {
14
+ return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
15
+ }
16
+ function TooltipContent({ className, side = 'top', sideOffset = 10, // Vibe: the arrow sits 10px off the trigger
17
+ align = 'center', alignOffset = 0, collisionAvoidance, motion = 'scale', children, ...props }) {
18
+ const renderPopup = usePopupRender(motion);
19
+ return (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, collisionAvoidance: collisionAvoidance, className: "isolate z-(--z-dropdown)", children: _jsxs(TooltipPrimitive.Popup, { render: renderPopup, "data-slot": "tooltip-content", className: cn('z-(--z-dropdown) inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-[4px] bg-inverted px-4 py-2 text-body-2 text-inverted-foreground shadow-md has-data-[slot=kbd]:pr-3 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-10 **:data-[slot=kbd]:rounded-sm', className), ...props, children: [children, _jsx(TooltipPrimitive.Arrow, { className: "z-10 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-inverted fill-inverted data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })] }) }) }));
20
+ }
21
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -0,0 +1,24 @@
1
+ import { type ComponentProps } from 'react';
2
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './collapsible.js';
3
+ type TraceStatus = 'running' | 'done' | 'error' | 'pending';
4
+ /** shadcn Trace, adapted: a semantic list of steps. Each step is a `TraceItem` holding a `TraceLine`. */
5
+ declare function Trace({ className, ...props }: ComponentProps<'ul'>): import("react").JSX.Element;
6
+ declare function TraceItem({ className, ...props }: ComponentProps<'li'>): import("react").JSX.Element;
7
+ type TraceLineProps = ComponentProps<'span'> & {
8
+ status?: TraceStatus;
9
+ /** Screen-reader text for the status ("Done", "In progress"). The icon itself is hidden. */
10
+ statusLabel?: string;
11
+ };
12
+ declare function TraceLine({ className, status, statusLabel, children, ...props }: TraceLineProps): import("react").JSX.Element;
13
+ declare function TraceIcon({ className, ...props }: ComponentProps<'span'>): import("react").JSX.Element;
14
+ /** The icon for the enclosing line's status: spinner, check, alert, or a quiet dot. */
15
+ declare function TraceStatusIcon({ className, ...props }: ComponentProps<'span'>): import("react").JSX.Element;
16
+ /** The line's label. While the line is `running` and the label is a string it shimmers. */
17
+ declare function TraceTitle({ className, children, ...props }: ComponentProps<'span'>): import("react").JSX.Element;
18
+ declare function TraceDescription({ className, ...props }: ComponentProps<'span'>): import("react").JSX.Element;
19
+ declare function TraceCollapsible({ className, ...props }: ComponentProps<typeof Collapsible>): import("react").JSX.Element;
20
+ /** A real button holding a `TraceLine` and a turning chevron. Never nest another button inside. */
21
+ declare function TraceCollapsibleTrigger({ className, children, ...props }: ComponentProps<typeof CollapsibleTrigger>): import("react").JSX.Element;
22
+ /** Opens and shuts with the shared collapse motion; closed content is not in the DOM. */
23
+ declare function TraceCollapsibleContent({ className, children, ...props }: ComponentProps<typeof CollapsibleContent>): import("react").JSX.Element;
24
+ export { Trace, TraceItem, TraceLine, TraceIcon, TraceStatusIcon, TraceTitle, TraceDescription, TraceCollapsible, TraceCollapsibleTrigger, TraceCollapsibleContent, type TraceStatus, type TraceLineProps, };
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createContext, useContext } from 'react';
3
+ import { cn } from '../../lib/utils.js';
4
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './collapsible.js';
5
+ import { ShimmerText } from './shimmer-text.js';
6
+ import { Check, ChevronRight, CircleAlert, LoaderCircle } from '../../icons/index.js';
7
+ import { motion, useReducedMotion } from '../../motion/index.js';
8
+ import { loopAnimate, loopTransition } from '../../motion/config.js';
9
+ const TraceLineContext = createContext(undefined);
10
+ /** shadcn Trace, adapted: a semantic list of steps. Each step is a `TraceItem` holding a `TraceLine`. */
11
+ function Trace({ className, ...props }) {
12
+ return (_jsx("ul", { "data-slot": "trace", className: cn('m-0 flex w-full min-w-0 list-none flex-col gap-1.5 p-0', className), ...props }));
13
+ }
14
+ function TraceItem({ className, ...props }) {
15
+ return _jsx("li", { "data-slot": "trace-item", className: cn('min-w-0', className), ...props });
16
+ }
17
+ // `relative` keeps the `sr-only` status label (absolute) inside its own line; otherwise it escapes a
18
+ // non-positioned scroll box around a long trail and adds phantom height to the scroller above.
19
+ function TraceLine({ className, status, statusLabel, children, ...props }) {
20
+ return (_jsx(TraceLineContext.Provider, { value: status, children: _jsxs("span", { "data-slot": "trace-line", "data-status": status, className: cn('relative flex w-fit max-w-full min-w-0 items-center gap-2 text-sm text-muted-foreground transition-colors in-[a,button]:cursor-pointer in-[a:hover,button:hover]:text-foreground data-[status=error]:text-destructive data-[status=error]:in-[a:hover,button:hover]:text-destructive data-[status=pending]:opacity-60', className), ...props, children: [children, statusLabel ? _jsx("span", { className: "sr-only", children: statusLabel }) : null] }) }));
21
+ }
22
+ function TraceIcon({ className, ...props }) {
23
+ return (_jsx("span", { "data-slot": "trace-icon", "aria-hidden": "true", className: cn('flex size-4 shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4', className), ...props }));
24
+ }
25
+ /** The icon for the enclosing line's status: spinner, check, alert, or a quiet dot. */
26
+ function TraceStatusIcon({ className, ...props }) {
27
+ const status = useContext(TraceLineContext);
28
+ const reduceMotion = useReducedMotion();
29
+ return (_jsx(TraceIcon, { className: className, ...props, children: status === 'running' ? (
30
+ // Same stable bags as `Spinner` (`loopAnimate` / `loopTransition`): opacity pulse + WAAPI
31
+ // spin when motion is allowed. Inline animate objects restart the loop on every agent
32
+ // chunk re-render — leaving a stream and coming back looked frozen until a full refresh.
33
+ _jsx(motion.span, { className: "inline-flex", animate: reduceMotion ? loopAnimate.spinnerReduced : loopAnimate.spinner, transition: loopTransition.spinner, children: _jsx(LoaderCircle, { className: "size-3.5" }) })) : status === 'done' ? (_jsx(Check, { className: "size-3.5" })) : status === 'error' ? (_jsx(CircleAlert, { className: "size-3.5" })) : (_jsx("span", { className: "size-1.5 rounded-full bg-current opacity-60" })) }));
34
+ }
35
+ /** The line's label. While the line is `running` and the label is a string it shimmers. */
36
+ function TraceTitle({ className, children, ...props }) {
37
+ const status = useContext(TraceLineContext);
38
+ if (status === 'running' && typeof children === 'string') {
39
+ return (_jsx(ShimmerText, { "data-slot": "trace-title", className: cn('min-w-0', className), ...props, children: children }));
40
+ }
41
+ return (_jsx("span", { "data-slot": "trace-title", className: cn('min-w-0 truncate', className), ...props, children: children }));
42
+ }
43
+ function TraceDescription({ className, ...props }) {
44
+ return (_jsx("span", { "data-slot": "trace-description", className: cn('shrink-0 text-muted-foreground/70 tabular-nums', className), ...props }));
45
+ }
46
+ function TraceCollapsible({ className, ...props }) {
47
+ return (_jsx(Collapsible, { "data-slot": "trace-collapsible", className: cn('flex w-full min-w-0 flex-col', className), ...props }));
48
+ }
49
+ /** A real button holding a `TraceLine` and a turning chevron. Never nest another button inside. */
50
+ function TraceCollapsibleTrigger({ className, children, ...props }) {
51
+ return (_jsxs(CollapsibleTrigger, { "data-slot": "trace-collapsible-trigger", className: cn('group/trace-collapsible-trigger flex w-fit max-w-full min-w-0 cursor-pointer items-center gap-1 rounded-md text-start text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 has-[[data-status=error]]:text-destructive', className), ...props, children: [children, _jsx(TraceIcon, { className: "group-aria-expanded/trace-collapsible-trigger:rotate-90", children: _jsx(ChevronRight, {}) })] }));
52
+ }
53
+ /** Opens and shuts with the shared collapse motion; closed content is not in the DOM. */
54
+ function TraceCollapsibleContent({ className, children, ...props }) {
55
+ return (_jsx(CollapsibleContent, { "data-slot": "trace-collapsible-content", className: "min-w-0", ...props, children: _jsx("div", { "data-slot": "trace-collapsible-content-inner", className: cn('mt-2 mb-1 ms-[calc(--spacing(2)-1px)] min-w-0 border-s ps-4 pe-1 leading-relaxed wrap-break-word text-muted-foreground', className), children: children }) }));
56
+ }
57
+ export { Trace, TraceItem, TraceLine, TraceIcon, TraceStatusIcon, TraceTitle, TraceDescription, TraceCollapsible, TraceCollapsibleTrigger, TraceCollapsibleContent, };
@@ -0,0 +1,93 @@
1
+ export interface TrendLinePoint {
2
+ label: string;
3
+ value: number;
4
+ }
5
+ /** One shared timestamp with a value per series (multi-series mode). */
6
+ export interface TrendLineSeriesPoint {
7
+ /** Epoch milliseconds. Sets the x position, so uneven intervals are never stretched. */
8
+ timestamp: number;
9
+ /** Names the point in the tooltip, the focus label and the hidden table ("Oct 14"). */
10
+ label: string;
11
+ /** Shorter label under the axis for the first and last point; defaults to `label`. */
12
+ axisLabel?: string;
13
+ /** One value per entry of `names`, in the same order. */
14
+ values: readonly number[];
15
+ /** Extra sentence for the tooltip and the focus label ("Count at the start of the range"). */
16
+ note?: string;
17
+ /**
18
+ * Makes the point activatable (click, Enter, Space) and adds this phrase to its focus label
19
+ * ("Show weekly detail"). Points without it never call `onPointActivate`.
20
+ */
21
+ activateLabel?: string;
22
+ }
23
+ /** Two or three lines on one shared zero-based integer axis. */
24
+ export interface TrendLineMultiSeries {
25
+ /** Series names, already localized. The first is solid, the second dashed, the third dotted. */
26
+ names: readonly string[];
27
+ /** Sorted by `timestamp`. */
28
+ points: readonly TrendLineSeriesPoint[];
29
+ }
30
+ interface TrendLineBaseProps extends Omit<React.ComponentProps<'figure'>, 'children'> {
31
+ /** Names the chart for assistive tech ("Cycles closed per day"). Required. */
32
+ 'aria-label': string;
33
+ /** Formats values in the tooltip and the axis; defaults to `String`. */
34
+ formatValue?: (value: number) => string;
35
+ }
36
+ export interface TrendLineProps extends TrendLineBaseProps {
37
+ points: readonly TrendLinePoint[];
38
+ /**
39
+ * Optional secondary string under the hover readout (e.g. exact spend when cents rounding
40
+ * hid precision). Axis labels still use `formatValue` only.
41
+ */
42
+ formatValueDetail?: (value: number) => string | undefined;
43
+ /**
44
+ * Optional projection points continuing after `points`. Drawn as a dashed line from the last
45
+ * real point through the projection; no area under it.
46
+ */
47
+ projection?: readonly TrendLinePoint[];
48
+ /**
49
+ * Label suffix appended to projected data points in hover readouts and the hidden table.
50
+ * Defaults to `'projected'`.
51
+ */
52
+ projectedLabel?: string;
53
+ multiSeries?: never;
54
+ onPointActivate?: never;
55
+ }
56
+ export interface TrendLineMultiProps extends TrendLineBaseProps {
57
+ /** Multi-series mode: mutually exclusive with `points` and `projection`. */
58
+ multiSeries: TrendLineMultiSeries;
59
+ /** Called with the point index when an activatable point is clicked or Enter/Space is pressed. */
60
+ onPointActivate?: (index: number) => void;
61
+ points?: never;
62
+ formatValueDetail?: never;
63
+ projection?: never;
64
+ projectedLabel?: never;
65
+ }
66
+ /**
67
+ * Single-series (default): a line with a soft area under it and an optional dashed `projection`;
68
+ * see `SingleSeriesTrendLine`.
69
+ *
70
+ * Multi-series (`multiSeries`, mutually exclusive with `points`/`projection`): two or three lines
71
+ * sharing one zero-based integer axis and one set of timestamps. Points sit at their timestamp's
72
+ * share of the span (partial intervals are not stretched), there is no projection and no area,
73
+ * series differ in colour, dash and dot shape, a persistent legend names them, and each timestamp
74
+ * is one tooltip and focus target listing every series. `onPointActivate` makes points that carry
75
+ * an `activateLabel` clickable and keyboard-activatable.
76
+ */
77
+ declare function TrendLine(props: TrendLineMultiProps): React.JSX.Element;
78
+ declare function TrendLine(props: TrendLineProps): React.JSX.Element;
79
+ export interface TrendLineSkeletonProps extends Omit<React.ComponentProps<'div'>, 'children'> {
80
+ /**
81
+ * Legend entries of a multi-series line. Leave it out for a single series, whose axis labels
82
+ * hang below the plot: pass the same `className` (for example `mb-5`) as the host passes to
83
+ * `TrendLine`.
84
+ */
85
+ legendItems?: number;
86
+ }
87
+ /**
88
+ * The loading shape of `TrendLine`: y-axis stubs, three dashed grid lines, a soft area and
89
+ * x-axis stubs, in the same 160 px plot. With `legendItems` it also draws the legend line of the
90
+ * multi-series variant.
91
+ */
92
+ declare function TrendLineSkeleton({ legendItems, className, ...props }: TrendLineSkeletonProps): import("react").JSX.Element;
93
+ export { TrendLine, TrendLineSkeleton };