@sero-ai/ui 0.3.2 → 0.4.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 (190) hide show
  1. package/.turbo/turbo-build.log +628 -0
  2. package/.turbo/turbo-typecheck.log +1 -1
  3. package/CHANGELOG.md +38 -0
  4. package/dist/components/context-editor/CapabilitySection.cjs +57 -0
  5. package/dist/components/context-editor/CapabilitySection.d.cts +20 -0
  6. package/dist/components/context-editor/CapabilitySection.d.ts +20 -0
  7. package/dist/components/context-editor/CapabilitySection.js +57 -0
  8. package/dist/components/context-editor/ContextEditor.cjs +108 -0
  9. package/dist/components/context-editor/ContextEditor.d.cts +26 -0
  10. package/dist/components/context-editor/ContextEditor.d.ts +26 -0
  11. package/dist/components/context-editor/ContextEditor.js +108 -0
  12. package/dist/components/context-editor/PresetBar.cjs +71 -0
  13. package/dist/components/context-editor/PresetBar.d.cts +19 -0
  14. package/dist/components/context-editor/PresetBar.d.ts +19 -0
  15. package/dist/components/context-editor/PresetBar.js +71 -0
  16. package/dist/components/context-editor/SkillsSection.cjs +31 -0
  17. package/dist/components/context-editor/SkillsSection.d.cts +14 -0
  18. package/dist/components/context-editor/SkillsSection.d.ts +14 -0
  19. package/dist/components/context-editor/SkillsSection.js +31 -0
  20. package/dist/components/context-editor/SystemPromptSection.cjs +58 -0
  21. package/dist/components/context-editor/SystemPromptSection.d.cts +25 -0
  22. package/dist/components/context-editor/SystemPromptSection.d.ts +25 -0
  23. package/dist/components/context-editor/SystemPromptSection.js +58 -0
  24. package/dist/components/context-editor/ToolsSection.cjs +31 -0
  25. package/dist/components/context-editor/ToolsSection.d.cts +14 -0
  26. package/dist/components/context-editor/ToolsSection.d.ts +14 -0
  27. package/dist/components/context-editor/ToolsSection.js +31 -0
  28. package/dist/components/context-editor/index.cjs +8 -0
  29. package/dist/components/context-editor/index.d.cts +5 -0
  30. package/dist/components/context-editor/index.d.ts +5 -0
  31. package/dist/components/context-editor/index.js +8 -0
  32. package/dist/components/context-editor/parts.cjs +184 -0
  33. package/dist/components/context-editor/parts.d.cts +32 -0
  34. package/dist/components/context-editor/parts.d.ts +32 -0
  35. package/dist/components/context-editor/parts.js +184 -0
  36. package/dist/components/context-editor/use-context-editor-model.cjs +194 -0
  37. package/dist/components/context-editor/use-context-editor-model.d.cts +57 -0
  38. package/dist/components/context-editor/use-context-editor-model.d.ts +57 -0
  39. package/dist/components/context-editor/use-context-editor-model.js +194 -0
  40. package/dist/components/dashboard/activity-list.cjs +59 -0
  41. package/dist/components/dashboard/activity-list.d.cts +27 -0
  42. package/dist/components/dashboard/activity-list.d.ts +27 -0
  43. package/dist/components/dashboard/activity-list.js +59 -0
  44. package/dist/components/dashboard/catalog.cjs +322 -0
  45. package/dist/components/dashboard/catalog.d.cts +14 -0
  46. package/dist/components/dashboard/catalog.d.ts +14 -0
  47. package/dist/components/dashboard/catalog.js +322 -0
  48. package/dist/components/dashboard/data-boundary.cjs +29 -0
  49. package/dist/components/dashboard/data-boundary.d.cts +21 -0
  50. package/dist/components/dashboard/data-boundary.d.ts +21 -0
  51. package/dist/components/dashboard/data-boundary.js +29 -0
  52. package/dist/components/dashboard/empty-state.cjs +49 -0
  53. package/dist/components/dashboard/empty-state.d.cts +20 -0
  54. package/dist/components/dashboard/empty-state.d.ts +20 -0
  55. package/dist/components/dashboard/empty-state.js +49 -0
  56. package/dist/components/dashboard/icon-button.cjs +40 -0
  57. package/dist/components/dashboard/icon-button.d.cts +24 -0
  58. package/dist/components/dashboard/icon-button.d.ts +24 -0
  59. package/dist/components/dashboard/icon-button.js +40 -0
  60. package/dist/components/dashboard/index.cjs +15 -0
  61. package/dist/components/dashboard/index.d.cts +24 -0
  62. package/dist/components/dashboard/index.d.ts +24 -0
  63. package/dist/components/dashboard/index.js +15 -0
  64. package/dist/components/dashboard/item-list.cjs +71 -0
  65. package/dist/components/dashboard/item-list.d.cts +28 -0
  66. package/dist/components/dashboard/item-list.d.ts +28 -0
  67. package/dist/components/dashboard/item-list.js +71 -0
  68. package/dist/components/dashboard/key-value.cjs +39 -0
  69. package/dist/components/dashboard/key-value.d.cts +17 -0
  70. package/dist/components/dashboard/key-value.d.ts +17 -0
  71. package/dist/components/dashboard/key-value.js +39 -0
  72. package/dist/components/dashboard/layout.cjs +193 -0
  73. package/dist/components/dashboard/layout.d.cts +91 -0
  74. package/dist/components/dashboard/layout.d.ts +91 -0
  75. package/dist/components/dashboard/layout.js +193 -0
  76. package/dist/components/dashboard/metric.cjs +98 -0
  77. package/dist/components/dashboard/metric.d.cts +44 -0
  78. package/dist/components/dashboard/metric.d.ts +44 -0
  79. package/dist/components/dashboard/metric.js +98 -0
  80. package/dist/components/dashboard/progress-ring.cjs +77 -0
  81. package/dist/components/dashboard/progress-ring.d.cts +25 -0
  82. package/dist/components/dashboard/progress-ring.d.ts +25 -0
  83. package/dist/components/dashboard/progress-ring.js +77 -0
  84. package/dist/components/dashboard/skeletons.cjs +54 -0
  85. package/dist/components/dashboard/skeletons.d.cts +15 -0
  86. package/dist/components/dashboard/skeletons.d.ts +15 -0
  87. package/dist/components/dashboard/skeletons.js +54 -0
  88. package/dist/components/dashboard/spacing.cjs +10 -0
  89. package/dist/components/dashboard/spacing.d.cts +4 -0
  90. package/dist/components/dashboard/spacing.d.ts +4 -0
  91. package/dist/components/dashboard/spacing.js +10 -0
  92. package/dist/components/dashboard/stale-indicator.cjs +42 -0
  93. package/dist/components/dashboard/stale-indicator.d.cts +15 -0
  94. package/dist/components/dashboard/stale-indicator.d.ts +15 -0
  95. package/dist/components/dashboard/stale-indicator.js +42 -0
  96. package/dist/components/dashboard/status.cjs +62 -0
  97. package/dist/components/dashboard/status.d.cts +15 -0
  98. package/dist/components/dashboard/status.d.ts +15 -0
  99. package/dist/components/dashboard/status.js +62 -0
  100. package/dist/components/dashboard/tone.cjs +26 -0
  101. package/dist/components/dashboard/tone.d.cts +9 -0
  102. package/dist/components/dashboard/tone.d.ts +9 -0
  103. package/dist/components/dashboard/tone.js +26 -0
  104. package/dist/components/dashboard/typography.cjs +99 -0
  105. package/dist/components/dashboard/typography.d.cts +57 -0
  106. package/dist/components/dashboard/typography.d.ts +57 -0
  107. package/dist/components/dashboard/typography.js +99 -0
  108. package/dist/components/reference/ActivityExample.cjs +47 -0
  109. package/dist/components/reference/ActivityExample.d.cts +5 -0
  110. package/dist/components/reference/ActivityExample.d.ts +5 -0
  111. package/dist/components/reference/ActivityExample.js +47 -0
  112. package/dist/components/reference/ResourceExample.cjs +54 -0
  113. package/dist/components/reference/ResourceExample.d.cts +5 -0
  114. package/dist/components/reference/ResourceExample.d.ts +5 -0
  115. package/dist/components/reference/ResourceExample.js +54 -0
  116. package/dist/components/reference/SchedulerExample.cjs +68 -0
  117. package/dist/components/reference/SchedulerExample.d.cts +5 -0
  118. package/dist/components/reference/SchedulerExample.d.ts +5 -0
  119. package/dist/components/reference/SchedulerExample.js +68 -0
  120. package/dist/components/reference/StarterExample.cjs +34 -0
  121. package/dist/components/reference/StarterExample.d.cts +5 -0
  122. package/dist/components/reference/StarterExample.d.ts +5 -0
  123. package/dist/components/reference/StarterExample.js +34 -0
  124. package/dist/components/reference/index.cjs +10 -0
  125. package/dist/components/reference/index.d.cts +5 -0
  126. package/dist/components/reference/index.d.ts +5 -0
  127. package/dist/components/reference/index.js +10 -0
  128. package/dist/components/ui/badge.cjs +5 -1
  129. package/dist/components/ui/badge.d.cts +1 -1
  130. package/dist/components/ui/badge.d.ts +1 -1
  131. package/dist/components/ui/badge.js +5 -1
  132. package/dist/dashboard-catalog.cjs +8 -0
  133. package/dist/dashboard-catalog.d.cts +1 -0
  134. package/dist/dashboard-catalog.d.ts +1 -0
  135. package/dist/dashboard-catalog.js +8 -0
  136. package/dist/index.cjs +1 -0
  137. package/dist/index.d.cts +15 -0
  138. package/dist/index.d.ts +15 -0
  139. package/dist/index.js +1 -0
  140. package/dist/reference.cjs +12 -0
  141. package/dist/reference.d.cts +5 -0
  142. package/dist/reference.d.ts +5 -0
  143. package/dist/reference.js +12 -0
  144. package/dist/styles/glass-board.css +43 -0
  145. package/dist/styles/globals.css +59 -0
  146. package/package.json +70 -41
  147. package/src/components/context-editor/CapabilitySection.tsx +85 -0
  148. package/src/components/context-editor/ContextEditor.tsx +138 -0
  149. package/src/components/context-editor/PresetBar.tsx +94 -0
  150. package/src/components/context-editor/SkillsSection.tsx +37 -0
  151. package/src/components/context-editor/SystemPromptSection.tsx +88 -0
  152. package/src/components/context-editor/ToolsSection.tsx +37 -0
  153. package/src/components/context-editor/index.ts +7 -0
  154. package/src/components/context-editor/parts.tsx +217 -0
  155. package/src/components/context-editor/use-context-editor-model.ts +296 -0
  156. package/src/components/dashboard/__tests__/catalog.test.ts +57 -0
  157. package/src/components/dashboard/__tests__/glass.test.tsx +42 -0
  158. package/src/components/dashboard/__tests__/state.test.tsx +110 -0
  159. package/src/components/dashboard/__tests__/variants.test.tsx +95 -0
  160. package/src/components/dashboard/activity-list.tsx +99 -0
  161. package/src/components/dashboard/catalog.ts +351 -0
  162. package/src/components/dashboard/data-boundary.tsx +54 -0
  163. package/src/components/dashboard/empty-state.tsx +70 -0
  164. package/src/components/dashboard/icon-button.tsx +58 -0
  165. package/src/components/dashboard/index.ts +21 -0
  166. package/src/components/dashboard/item-list.tsx +106 -0
  167. package/src/components/dashboard/key-value.tsx +54 -0
  168. package/src/components/dashboard/layout.tsx +286 -0
  169. package/src/components/dashboard/metric.tsx +139 -0
  170. package/src/components/dashboard/progress-ring.tsx +100 -0
  171. package/src/components/dashboard/skeletons.tsx +73 -0
  172. package/src/components/dashboard/spacing.ts +14 -0
  173. package/src/components/dashboard/stale-indicator.tsx +55 -0
  174. package/src/components/dashboard/status.tsx +75 -0
  175. package/src/components/dashboard/tone.ts +35 -0
  176. package/src/components/dashboard/typography.tsx +151 -0
  177. package/src/components/reference/ActivityExample.tsx +68 -0
  178. package/src/components/reference/ResourceExample.tsx +78 -0
  179. package/src/components/reference/SchedulerExample.tsx +88 -0
  180. package/src/components/reference/StarterExample.tsx +48 -0
  181. package/src/components/reference/index.ts +10 -0
  182. package/src/components/ui/badge.tsx +6 -0
  183. package/src/dashboard-catalog.ts +13 -0
  184. package/src/index.ts +5 -0
  185. package/src/reference.ts +15 -0
  186. package/src/styles/glass-board.css +43 -0
  187. package/src/styles/globals.css +59 -0
  188. package/tsup.config.ts +6 -2
  189. package/vitest.config.ts +8 -0
  190. package/LICENSE +0 -201
@@ -0,0 +1,26 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});const toneColor = {
2
+ neutral: "text-[var(--text-muted)]",
3
+ success: "text-[var(--status-success)]",
4
+ warning: "text-[var(--status-warning)]",
5
+ error: "text-[var(--status-error)]",
6
+ info: "text-[var(--status-info)]"
7
+ };
8
+ const toneDot = {
9
+ neutral: "bg-[var(--text-muted)]",
10
+ success: "bg-[var(--status-success)]",
11
+ warning: "bg-[var(--status-warning)]",
12
+ error: "bg-[var(--status-error)]",
13
+ info: "bg-[var(--status-info)]"
14
+ };
15
+ const tonePill = {
16
+ neutral: "bg-[var(--surface-flat)] text-[var(--text-secondary)]",
17
+ success: "bg-[var(--status-success-muted)] text-[var(--status-success)]",
18
+ warning: "bg-[var(--status-warning-muted)] text-[var(--status-warning)]",
19
+ error: "bg-[var(--status-error-muted)] text-[var(--status-error)]",
20
+ info: "bg-[var(--status-info-muted)] text-[var(--status-info)]"
21
+ };
22
+
23
+
24
+
25
+
26
+ exports.toneColor = toneColor; exports.toneDot = toneDot; exports.tonePill = tonePill;
@@ -0,0 +1,9 @@
1
+ type Tone = "neutral" | "success" | "warning" | "error" | "info";
2
+ /** Solid foreground colour for a tone (dots, icons, emphasised text). */
3
+ declare const toneColor: Record<Tone, string>;
4
+ /** Solid background colour for a tone (status dots). */
5
+ declare const toneDot: Record<Tone, string>;
6
+ /** Muted tinted background + matching text for a tone (pills, chips). */
7
+ declare const tonePill: Record<Tone, string>;
8
+
9
+ export { type Tone, toneColor, toneDot, tonePill };
@@ -0,0 +1,9 @@
1
+ type Tone = "neutral" | "success" | "warning" | "error" | "info";
2
+ /** Solid foreground colour for a tone (dots, icons, emphasised text). */
3
+ declare const toneColor: Record<Tone, string>;
4
+ /** Solid background colour for a tone (status dots). */
5
+ declare const toneDot: Record<Tone, string>;
6
+ /** Muted tinted background + matching text for a tone (pills, chips). */
7
+ declare const tonePill: Record<Tone, string>;
8
+
9
+ export { type Tone, toneColor, toneDot, tonePill };
@@ -0,0 +1,26 @@
1
+ const toneColor = {
2
+ neutral: "text-[var(--text-muted)]",
3
+ success: "text-[var(--status-success)]",
4
+ warning: "text-[var(--status-warning)]",
5
+ error: "text-[var(--status-error)]",
6
+ info: "text-[var(--status-info)]"
7
+ };
8
+ const toneDot = {
9
+ neutral: "bg-[var(--text-muted)]",
10
+ success: "bg-[var(--status-success)]",
11
+ warning: "bg-[var(--status-warning)]",
12
+ error: "bg-[var(--status-error)]",
13
+ info: "bg-[var(--status-info)]"
14
+ };
15
+ const tonePill = {
16
+ neutral: "bg-[var(--surface-flat)] text-[var(--text-secondary)]",
17
+ success: "bg-[var(--status-success-muted)] text-[var(--status-success)]",
18
+ warning: "bg-[var(--status-warning-muted)] text-[var(--status-warning)]",
19
+ error: "bg-[var(--status-error-muted)] text-[var(--status-error)]",
20
+ info: "bg-[var(--status-info-muted)] text-[var(--status-info)]"
21
+ };
22
+ export {
23
+ toneColor,
24
+ toneDot,
25
+ tonePill
26
+ };
@@ -0,0 +1,99 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _jsxruntime = require('react/jsx-runtime');
2
+ var _classvarianceauthority = require('class-variance-authority');
3
+ var _utils = require('../../lib/utils');
4
+ var _tone = require('./tone');
5
+ const textVariants = _classvarianceauthority.cva.call(void 0, "min-w-0", {
6
+ variants: {
7
+ variant: {
8
+ body: "text-sm text-[var(--text-primary)]",
9
+ label: "text-[11px] font-semibold uppercase tracking-wider text-[var(--text-muted)]",
10
+ supporting: "text-xs text-[var(--text-secondary)]",
11
+ muted: "text-xs text-[var(--text-muted)]",
12
+ numeric: "text-sm font-semibold tabular-nums text-[var(--text-primary)]"
13
+ }
14
+ },
15
+ defaultVariants: { variant: "body" }
16
+ });
17
+ const clampClass = {
18
+ 1: "line-clamp-1",
19
+ 2: "line-clamp-2",
20
+ 3: "line-clamp-3"
21
+ };
22
+ function Text({
23
+ className,
24
+ variant,
25
+ truncate,
26
+ clamp,
27
+ tone,
28
+ ...props
29
+ }) {
30
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
31
+ "span",
32
+ {
33
+ "data-slot": "text",
34
+ className: _utils.cn.call(void 0,
35
+ textVariants({ variant }),
36
+ clamp ? clampClass[clamp] : truncate && "truncate",
37
+ tone && _tone.toneColor[tone],
38
+ className
39
+ ),
40
+ ...props
41
+ }
42
+ );
43
+ }
44
+ const headingSize = {
45
+ sm: "text-xs font-semibold",
46
+ md: "text-sm font-semibold",
47
+ lg: "text-base font-semibold"
48
+ };
49
+ function Heading({
50
+ className,
51
+ level = 2,
52
+ size = "md",
53
+ truncate,
54
+ ...props
55
+ }) {
56
+ const Tag = `h${level}`;
57
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
58
+ Tag,
59
+ {
60
+ "data-slot": "heading",
61
+ className: _utils.cn.call(void 0,
62
+ "leading-snug text-[var(--text-primary)]",
63
+ headingSize[size],
64
+ truncate && "truncate",
65
+ className
66
+ ),
67
+ ...props
68
+ }
69
+ );
70
+ }
71
+ const iconSize = {
72
+ xs: "size-3",
73
+ sm: "size-3.5",
74
+ md: "size-4",
75
+ lg: "size-5"
76
+ };
77
+ function Icon({ className, icon: IconCmp, size = "md", tone, label, ...props }) {
78
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
79
+ "span",
80
+ {
81
+ "data-slot": "icon",
82
+ role: label ? "img" : void 0,
83
+ "aria-label": label,
84
+ "aria-hidden": label ? void 0 : true,
85
+ className: _utils.cn.call(void 0,
86
+ "inline-flex shrink-0 items-center justify-center",
87
+ tone ? _tone.toneColor[tone] : "text-[var(--text-muted)]",
88
+ className
89
+ ),
90
+ ...props,
91
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, IconCmp, { className: iconSize[size] })
92
+ }
93
+ );
94
+ }
95
+
96
+
97
+
98
+
99
+ exports.Heading = Heading; exports.Icon = Icon; exports.Text = Text;
@@ -0,0 +1,57 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as React from 'react';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import { Tone } from './tone.cjs';
6
+
7
+ declare const textVariants: (props?: ({
8
+ variant?: "body" | "label" | "numeric" | "muted" | "supporting" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+ interface TextProps extends Omit<React.ComponentProps<"span">, "color">, VariantProps<typeof textVariants> {
11
+ /** Truncate to a single line with an ellipsis. */
12
+ truncate?: boolean;
13
+ /** Clamp to N lines. Overrides `truncate`. */
14
+ clamp?: 1 | 2 | 3;
15
+ /** Semantic colour override (e.g. a numeric value that turns red on error). */
16
+ tone?: Tone;
17
+ asChild?: boolean;
18
+ }
19
+ /** Semantic text with truncation, line-clamp and optional tone. */
20
+ declare function Text({ className, variant, truncate, clamp, tone, ...props }: TextProps): react_jsx_runtime.JSX.Element;
21
+ declare const headingSize: {
22
+ readonly sm: "text-xs font-semibold";
23
+ readonly md: "text-sm font-semibold";
24
+ readonly lg: "text-base font-semibold";
25
+ };
26
+ interface HeadingProps extends React.ComponentProps<"h2"> {
27
+ /** HTML heading level for correct document semantics (1–4). */
28
+ level?: 1 | 2 | 3 | 4;
29
+ /** Visual size, decoupled from the semantic level. */
30
+ size?: keyof typeof headingSize;
31
+ truncate?: boolean;
32
+ }
33
+ /** Compact heading with correct HTML semantics decoupled from visual size. */
34
+ declare function Heading({ className, level, size, truncate, ...props }: HeadingProps): react_jsx_runtime.JSX.Element;
35
+ declare const iconSize: {
36
+ readonly xs: "size-3";
37
+ readonly sm: "size-3.5";
38
+ readonly md: "size-4";
39
+ readonly lg: "size-5";
40
+ };
41
+ interface IconProps extends React.ComponentProps<"span"> {
42
+ /** The icon component to render (e.g. a lucide-react icon). */
43
+ icon: React.ComponentType<{
44
+ className?: string;
45
+ }>;
46
+ size?: keyof typeof iconSize;
47
+ tone?: Tone;
48
+ /**
49
+ * Accessible label. When omitted the icon is decorative and hidden from
50
+ * assistive tech; when provided it is exposed as an image with this name.
51
+ */
52
+ label?: string;
53
+ }
54
+ /** Consistent icon wrapper for size, tone and accessibility. */
55
+ declare function Icon({ className, icon: IconCmp, size, tone, label, ...props }: IconProps): react_jsx_runtime.JSX.Element;
56
+
57
+ export { Heading, type HeadingProps, Icon, type IconProps, Text, type TextProps };
@@ -0,0 +1,57 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as React from 'react';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import { Tone } from './tone.js';
6
+
7
+ declare const textVariants: (props?: ({
8
+ variant?: "body" | "label" | "numeric" | "muted" | "supporting" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+ interface TextProps extends Omit<React.ComponentProps<"span">, "color">, VariantProps<typeof textVariants> {
11
+ /** Truncate to a single line with an ellipsis. */
12
+ truncate?: boolean;
13
+ /** Clamp to N lines. Overrides `truncate`. */
14
+ clamp?: 1 | 2 | 3;
15
+ /** Semantic colour override (e.g. a numeric value that turns red on error). */
16
+ tone?: Tone;
17
+ asChild?: boolean;
18
+ }
19
+ /** Semantic text with truncation, line-clamp and optional tone. */
20
+ declare function Text({ className, variant, truncate, clamp, tone, ...props }: TextProps): react_jsx_runtime.JSX.Element;
21
+ declare const headingSize: {
22
+ readonly sm: "text-xs font-semibold";
23
+ readonly md: "text-sm font-semibold";
24
+ readonly lg: "text-base font-semibold";
25
+ };
26
+ interface HeadingProps extends React.ComponentProps<"h2"> {
27
+ /** HTML heading level for correct document semantics (1–4). */
28
+ level?: 1 | 2 | 3 | 4;
29
+ /** Visual size, decoupled from the semantic level. */
30
+ size?: keyof typeof headingSize;
31
+ truncate?: boolean;
32
+ }
33
+ /** Compact heading with correct HTML semantics decoupled from visual size. */
34
+ declare function Heading({ className, level, size, truncate, ...props }: HeadingProps): react_jsx_runtime.JSX.Element;
35
+ declare const iconSize: {
36
+ readonly xs: "size-3";
37
+ readonly sm: "size-3.5";
38
+ readonly md: "size-4";
39
+ readonly lg: "size-5";
40
+ };
41
+ interface IconProps extends React.ComponentProps<"span"> {
42
+ /** The icon component to render (e.g. a lucide-react icon). */
43
+ icon: React.ComponentType<{
44
+ className?: string;
45
+ }>;
46
+ size?: keyof typeof iconSize;
47
+ tone?: Tone;
48
+ /**
49
+ * Accessible label. When omitted the icon is decorative and hidden from
50
+ * assistive tech; when provided it is exposed as an image with this name.
51
+ */
52
+ label?: string;
53
+ }
54
+ /** Consistent icon wrapper for size, tone and accessibility. */
55
+ declare function Icon({ className, icon: IconCmp, size, tone, label, ...props }: IconProps): react_jsx_runtime.JSX.Element;
56
+
57
+ export { Heading, type HeadingProps, Icon, type IconProps, Text, type TextProps };
@@ -0,0 +1,99 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { cn } from "../../lib/utils";
4
+ import { toneColor } from "./tone";
5
+ const textVariants = cva("min-w-0", {
6
+ variants: {
7
+ variant: {
8
+ body: "text-sm text-[var(--text-primary)]",
9
+ label: "text-[11px] font-semibold uppercase tracking-wider text-[var(--text-muted)]",
10
+ supporting: "text-xs text-[var(--text-secondary)]",
11
+ muted: "text-xs text-[var(--text-muted)]",
12
+ numeric: "text-sm font-semibold tabular-nums text-[var(--text-primary)]"
13
+ }
14
+ },
15
+ defaultVariants: { variant: "body" }
16
+ });
17
+ const clampClass = {
18
+ 1: "line-clamp-1",
19
+ 2: "line-clamp-2",
20
+ 3: "line-clamp-3"
21
+ };
22
+ function Text({
23
+ className,
24
+ variant,
25
+ truncate,
26
+ clamp,
27
+ tone,
28
+ ...props
29
+ }) {
30
+ return /* @__PURE__ */ jsx(
31
+ "span",
32
+ {
33
+ "data-slot": "text",
34
+ className: cn(
35
+ textVariants({ variant }),
36
+ clamp ? clampClass[clamp] : truncate && "truncate",
37
+ tone && toneColor[tone],
38
+ className
39
+ ),
40
+ ...props
41
+ }
42
+ );
43
+ }
44
+ const headingSize = {
45
+ sm: "text-xs font-semibold",
46
+ md: "text-sm font-semibold",
47
+ lg: "text-base font-semibold"
48
+ };
49
+ function Heading({
50
+ className,
51
+ level = 2,
52
+ size = "md",
53
+ truncate,
54
+ ...props
55
+ }) {
56
+ const Tag = `h${level}`;
57
+ return /* @__PURE__ */ jsx(
58
+ Tag,
59
+ {
60
+ "data-slot": "heading",
61
+ className: cn(
62
+ "leading-snug text-[var(--text-primary)]",
63
+ headingSize[size],
64
+ truncate && "truncate",
65
+ className
66
+ ),
67
+ ...props
68
+ }
69
+ );
70
+ }
71
+ const iconSize = {
72
+ xs: "size-3",
73
+ sm: "size-3.5",
74
+ md: "size-4",
75
+ lg: "size-5"
76
+ };
77
+ function Icon({ className, icon: IconCmp, size = "md", tone, label, ...props }) {
78
+ return /* @__PURE__ */ jsx(
79
+ "span",
80
+ {
81
+ "data-slot": "icon",
82
+ role: label ? "img" : void 0,
83
+ "aria-label": label,
84
+ "aria-hidden": label ? void 0 : true,
85
+ className: cn(
86
+ "inline-flex shrink-0 items-center justify-center",
87
+ tone ? toneColor[tone] : "text-[var(--text-muted)]",
88
+ className
89
+ ),
90
+ ...props,
91
+ children: /* @__PURE__ */ jsx(IconCmp, { className: iconSize[size] })
92
+ }
93
+ );
94
+ }
95
+ export {
96
+ Heading,
97
+ Icon,
98
+ Text
99
+ };
@@ -0,0 +1,47 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _jsxruntime = require('react/jsx-runtime');
2
+ var _lucidereact = require('lucide-react');
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+ var _dashboard = require('../dashboard');
13
+ var _badge = require('../ui/badge');
14
+ const ITEMS = [
15
+ { id: "1", title: "quarterly-report.pdf", meta: "2h", badge: "PDF" },
16
+ { id: "2", title: "design-tokens.json", meta: "5h", badge: "JSON" },
17
+ { id: "3", title: "release-notes.md", meta: "1d", badge: "MD" }
18
+ ];
19
+ function ActivityExample() {
20
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.WidgetContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _dashboard.Stack, { gap: "sm", fill: true, children: [
21
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Inline, { justify: "between", align: "center", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _dashboard.Inline, { gap: "xs", align: "center", children: [
22
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Text, { variant: "label", children: "Recent files" }),
23
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _badge.Badge, { variant: "info", children: ITEMS.length })
24
+ ] }) }),
25
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Stack, { gap: "none", scroll: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.ItemList, { children: ITEMS.map((f) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
26
+ _dashboard.ItemListItem,
27
+ {
28
+ leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.FileText, { className: "size-4 text-[var(--text-muted)]" }),
29
+ primary: f.title,
30
+ trailing: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _dashboard.Inline, { gap: "xs", align: "center", children: [
31
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _badge.Badge, { variant: "secondary", children: f.badge }),
32
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: f.meta })
33
+ ] })
34
+ },
35
+ f.id
36
+ )) }) }),
37
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _dashboard.Inline, { justify: "between", align: "center", children: [
38
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Status, { tone: "info", variant: "pill", children: "Synced" }),
39
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.StaleIndicator, { lastUpdated: "Synced 30s ago" })
40
+ ] })
41
+ ] }) });
42
+ }
43
+ var ActivityExample_default = ActivityExample;
44
+
45
+
46
+
47
+ exports.ActivityExample = ActivityExample; exports.default = ActivityExample_default;
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function ActivityExample(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { ActivityExample, ActivityExample as default };
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function ActivityExample(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { ActivityExample, ActivityExample as default };
@@ -0,0 +1,47 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { FileText } from "lucide-react";
3
+ import {
4
+ Inline,
5
+ ItemList,
6
+ ItemListItem,
7
+ Stack,
8
+ StaleIndicator,
9
+ Status,
10
+ Text,
11
+ WidgetContent
12
+ } from "../dashboard";
13
+ import { Badge } from "../ui/badge";
14
+ const ITEMS = [
15
+ { id: "1", title: "quarterly-report.pdf", meta: "2h", badge: "PDF" },
16
+ { id: "2", title: "design-tokens.json", meta: "5h", badge: "JSON" },
17
+ { id: "3", title: "release-notes.md", meta: "1d", badge: "MD" }
18
+ ];
19
+ function ActivityExample() {
20
+ return /* @__PURE__ */ jsx(WidgetContent, { children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", fill: true, children: [
21
+ /* @__PURE__ */ jsx(Inline, { justify: "between", align: "center", children: /* @__PURE__ */ jsxs(Inline, { gap: "xs", align: "center", children: [
22
+ /* @__PURE__ */ jsx(Text, { variant: "label", children: "Recent files" }),
23
+ /* @__PURE__ */ jsx(Badge, { variant: "info", children: ITEMS.length })
24
+ ] }) }),
25
+ /* @__PURE__ */ jsx(Stack, { gap: "none", scroll: true, children: /* @__PURE__ */ jsx(ItemList, { children: ITEMS.map((f) => /* @__PURE__ */ jsx(
26
+ ItemListItem,
27
+ {
28
+ leading: /* @__PURE__ */ jsx(FileText, { className: "size-4 text-[var(--text-muted)]" }),
29
+ primary: f.title,
30
+ trailing: /* @__PURE__ */ jsxs(Inline, { gap: "xs", align: "center", children: [
31
+ /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: f.badge }),
32
+ /* @__PURE__ */ jsx("span", { children: f.meta })
33
+ ] })
34
+ },
35
+ f.id
36
+ )) }) }),
37
+ /* @__PURE__ */ jsxs(Inline, { justify: "between", align: "center", children: [
38
+ /* @__PURE__ */ jsx(Status, { tone: "info", variant: "pill", children: "Synced" }),
39
+ /* @__PURE__ */ jsx(StaleIndicator, { lastUpdated: "Synced 30s ago" })
40
+ ] })
41
+ ] }) });
42
+ }
43
+ var ActivityExample_default = ActivityExample;
44
+ export {
45
+ ActivityExample,
46
+ ActivityExample_default as default
47
+ };
@@ -0,0 +1,54 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _jsxruntime = require('react/jsx-runtime');
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+ var _dashboard = require('../dashboard');
17
+ function Ring({
18
+ value,
19
+ label,
20
+ tone
21
+ }) {
22
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _dashboard.Stack, { gap: "xs", align: "center", children: [
23
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.ProgressRing, { value, label, tone }),
24
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Text, { variant: "muted", children: label })
25
+ ] });
26
+ }
27
+ function ResourceExample() {
28
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.WidgetContent, { scroll: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _dashboard.Stack, { gap: "sm", children: [
29
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Heading, { level: 2, size: "md", children: "Resources" }),
30
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _dashboard.MetricGroup, { children: [
31
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Metric, { label: "CPU", value: "42%", tone: "success" }),
32
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Metric, { label: "Memory", value: "6.1 GB" }),
33
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Metric, { label: "Disk", value: "71%", tone: "warning" })
34
+ ] }),
35
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Divider, {}),
36
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Section, { heading: "Usage", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _dashboard.Grid, { columns: 3, gap: "sm", children: [
37
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ring, { value: 42, label: "CPU", tone: "success" }),
38
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ring, { value: 61, label: "Memory", tone: "info" }),
39
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ring, { value: 71, label: "Disk", tone: "warning" })
40
+ ] }) }),
41
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Divider, {}),
42
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Section, { heading: "Host", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _dashboard.KeyValueList, { children: [
43
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.KeyValue, { label: "Region", value: "eu-west-1", mono: true }),
44
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.KeyValue, { label: "Instance", value: "c7g.xlarge", mono: true }),
45
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.KeyValue, { label: "Uptime", value: "14d 6h", mono: true }),
46
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.KeyValue, { label: "Status", value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _dashboard.Status, { tone: "success", children: "Healthy" }) })
47
+ ] }) })
48
+ ] }) });
49
+ }
50
+ var ResourceExample_default = ResourceExample;
51
+
52
+
53
+
54
+ exports.ResourceExample = ResourceExample; exports.default = ResourceExample_default;
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function ResourceExample(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { ResourceExample, ResourceExample as default };
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function ResourceExample(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { ResourceExample, ResourceExample as default };
@@ -0,0 +1,54 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import {
3
+ Divider,
4
+ Grid,
5
+ Heading,
6
+ KeyValue,
7
+ KeyValueList,
8
+ Metric,
9
+ MetricGroup,
10
+ ProgressRing,
11
+ Section,
12
+ Stack,
13
+ Status,
14
+ Text,
15
+ WidgetContent
16
+ } from "../dashboard";
17
+ function Ring({
18
+ value,
19
+ label,
20
+ tone
21
+ }) {
22
+ return /* @__PURE__ */ jsxs(Stack, { gap: "xs", align: "center", children: [
23
+ /* @__PURE__ */ jsx(ProgressRing, { value, label, tone }),
24
+ /* @__PURE__ */ jsx(Text, { variant: "muted", children: label })
25
+ ] });
26
+ }
27
+ function ResourceExample() {
28
+ return /* @__PURE__ */ jsx(WidgetContent, { scroll: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
29
+ /* @__PURE__ */ jsx(Heading, { level: 2, size: "md", children: "Resources" }),
30
+ /* @__PURE__ */ jsxs(MetricGroup, { children: [
31
+ /* @__PURE__ */ jsx(Metric, { label: "CPU", value: "42%", tone: "success" }),
32
+ /* @__PURE__ */ jsx(Metric, { label: "Memory", value: "6.1 GB" }),
33
+ /* @__PURE__ */ jsx(Metric, { label: "Disk", value: "71%", tone: "warning" })
34
+ ] }),
35
+ /* @__PURE__ */ jsx(Divider, {}),
36
+ /* @__PURE__ */ jsx(Section, { heading: "Usage", children: /* @__PURE__ */ jsxs(Grid, { columns: 3, gap: "sm", children: [
37
+ /* @__PURE__ */ jsx(Ring, { value: 42, label: "CPU", tone: "success" }),
38
+ /* @__PURE__ */ jsx(Ring, { value: 61, label: "Memory", tone: "info" }),
39
+ /* @__PURE__ */ jsx(Ring, { value: 71, label: "Disk", tone: "warning" })
40
+ ] }) }),
41
+ /* @__PURE__ */ jsx(Divider, {}),
42
+ /* @__PURE__ */ jsx(Section, { heading: "Host", children: /* @__PURE__ */ jsxs(KeyValueList, { children: [
43
+ /* @__PURE__ */ jsx(KeyValue, { label: "Region", value: "eu-west-1", mono: true }),
44
+ /* @__PURE__ */ jsx(KeyValue, { label: "Instance", value: "c7g.xlarge", mono: true }),
45
+ /* @__PURE__ */ jsx(KeyValue, { label: "Uptime", value: "14d 6h", mono: true }),
46
+ /* @__PURE__ */ jsx(KeyValue, { label: "Status", value: /* @__PURE__ */ jsx(Status, { tone: "success", children: "Healthy" }) })
47
+ ] }) })
48
+ ] }) });
49
+ }
50
+ var ResourceExample_default = ResourceExample;
51
+ export {
52
+ ResourceExample,
53
+ ResourceExample_default as default
54
+ };