@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,77 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _jsxruntime = require('react/jsx-runtime');
2
+ var _utils = require('../../lib/utils');
3
+ var _tone = require('./tone');
4
+ function ProgressRing({
5
+ className,
6
+ value,
7
+ max = 100,
8
+ size = 44,
9
+ thickness = 4,
10
+ tone = "info",
11
+ label,
12
+ showValue = true,
13
+ children,
14
+ ...props
15
+ }) {
16
+ const clamped = Math.min(Math.max(value, 0), max);
17
+ const pct = max > 0 ? clamped / max : 0;
18
+ const radius = (size - thickness) / 2;
19
+ const circumference = 2 * Math.PI * radius;
20
+ const dashOffset = circumference * (1 - pct);
21
+ const center = size / 2;
22
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
23
+ "div",
24
+ {
25
+ "data-slot": "progress-ring",
26
+ role: "progressbar",
27
+ "aria-label": label,
28
+ "aria-valuenow": Math.round(clamped),
29
+ "aria-valuemin": 0,
30
+ "aria-valuemax": max,
31
+ className: _utils.cn.call(void 0,
32
+ "relative inline-flex shrink-0 items-center justify-center",
33
+ _tone.toneColor[tone],
34
+ className
35
+ ),
36
+ style: { width: size, height: size },
37
+ ...props,
38
+ children: [
39
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: size, height: size, className: "-rotate-90", children: [
40
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
41
+ "circle",
42
+ {
43
+ cx: center,
44
+ cy: center,
45
+ r: radius,
46
+ fill: "none",
47
+ stroke: "var(--surface-line)",
48
+ strokeWidth: thickness
49
+ }
50
+ ),
51
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
52
+ "circle",
53
+ {
54
+ cx: center,
55
+ cy: center,
56
+ r: radius,
57
+ fill: "none",
58
+ stroke: "currentColor",
59
+ strokeWidth: thickness,
60
+ strokeLinecap: "round",
61
+ strokeDasharray: circumference,
62
+ strokeDashoffset: dashOffset,
63
+ className: "transition-[stroke-dashoffset] duration-500"
64
+ }
65
+ )
66
+ ] }),
67
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "absolute inset-0 flex items-center justify-center text-[var(--text-primary)]", children: _nullishCoalesce(children, () => ( (showValue && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-xs font-semibold tabular-nums", children: [
68
+ Math.round(pct * 100),
69
+ "%"
70
+ ] })))) })
71
+ ]
72
+ }
73
+ );
74
+ }
75
+
76
+
77
+ exports.ProgressRing = ProgressRing;
@@ -0,0 +1,25 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { Tone } from './tone.cjs';
4
+
5
+ interface ProgressRingProps extends Omit<React.ComponentProps<"div">, "children"> {
6
+ /** Current value. */
7
+ value: number;
8
+ /** Maximum value the ring represents. */
9
+ max?: number;
10
+ /** Outer diameter in pixels. */
11
+ size?: number;
12
+ /** Stroke width in pixels. */
13
+ thickness?: number;
14
+ tone?: Tone;
15
+ /** Accessible name for the gauge. */
16
+ label?: string;
17
+ /** Show the percentage in the centre when no children are provided. */
18
+ showValue?: boolean;
19
+ /** Custom centre content (overrides `showValue`). */
20
+ children?: React.ReactNode;
21
+ }
22
+ /** Circular progress / donut gauge for a bounded value. */
23
+ declare function ProgressRing({ className, value, max, size, thickness, tone, label, showValue, children, ...props }: ProgressRingProps): react_jsx_runtime.JSX.Element;
24
+
25
+ export { ProgressRing, type ProgressRingProps };
@@ -0,0 +1,25 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { Tone } from './tone.js';
4
+
5
+ interface ProgressRingProps extends Omit<React.ComponentProps<"div">, "children"> {
6
+ /** Current value. */
7
+ value: number;
8
+ /** Maximum value the ring represents. */
9
+ max?: number;
10
+ /** Outer diameter in pixels. */
11
+ size?: number;
12
+ /** Stroke width in pixels. */
13
+ thickness?: number;
14
+ tone?: Tone;
15
+ /** Accessible name for the gauge. */
16
+ label?: string;
17
+ /** Show the percentage in the centre when no children are provided. */
18
+ showValue?: boolean;
19
+ /** Custom centre content (overrides `showValue`). */
20
+ children?: React.ReactNode;
21
+ }
22
+ /** Circular progress / donut gauge for a bounded value. */
23
+ declare function ProgressRing({ className, value, max, size, thickness, tone, label, showValue, children, ...props }: ProgressRingProps): react_jsx_runtime.JSX.Element;
24
+
25
+ export { ProgressRing, type ProgressRingProps };
@@ -0,0 +1,77 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/utils";
3
+ import { toneColor } from "./tone";
4
+ function ProgressRing({
5
+ className,
6
+ value,
7
+ max = 100,
8
+ size = 44,
9
+ thickness = 4,
10
+ tone = "info",
11
+ label,
12
+ showValue = true,
13
+ children,
14
+ ...props
15
+ }) {
16
+ const clamped = Math.min(Math.max(value, 0), max);
17
+ const pct = max > 0 ? clamped / max : 0;
18
+ const radius = (size - thickness) / 2;
19
+ const circumference = 2 * Math.PI * radius;
20
+ const dashOffset = circumference * (1 - pct);
21
+ const center = size / 2;
22
+ return /* @__PURE__ */ jsxs(
23
+ "div",
24
+ {
25
+ "data-slot": "progress-ring",
26
+ role: "progressbar",
27
+ "aria-label": label,
28
+ "aria-valuenow": Math.round(clamped),
29
+ "aria-valuemin": 0,
30
+ "aria-valuemax": max,
31
+ className: cn(
32
+ "relative inline-flex shrink-0 items-center justify-center",
33
+ toneColor[tone],
34
+ className
35
+ ),
36
+ style: { width: size, height: size },
37
+ ...props,
38
+ children: [
39
+ /* @__PURE__ */ jsxs("svg", { width: size, height: size, className: "-rotate-90", children: [
40
+ /* @__PURE__ */ jsx(
41
+ "circle",
42
+ {
43
+ cx: center,
44
+ cy: center,
45
+ r: radius,
46
+ fill: "none",
47
+ stroke: "var(--surface-line)",
48
+ strokeWidth: thickness
49
+ }
50
+ ),
51
+ /* @__PURE__ */ jsx(
52
+ "circle",
53
+ {
54
+ cx: center,
55
+ cy: center,
56
+ r: radius,
57
+ fill: "none",
58
+ stroke: "currentColor",
59
+ strokeWidth: thickness,
60
+ strokeLinecap: "round",
61
+ strokeDasharray: circumference,
62
+ strokeDashoffset: dashOffset,
63
+ className: "transition-[stroke-dashoffset] duration-500"
64
+ }
65
+ )
66
+ ] }),
67
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center text-[var(--text-primary)]", children: children ?? (showValue && /* @__PURE__ */ jsxs("span", { className: "text-xs font-semibold tabular-nums", children: [
68
+ Math.round(pct * 100),
69
+ "%"
70
+ ] })) })
71
+ ]
72
+ }
73
+ );
74
+ }
75
+ export {
76
+ ProgressRing
77
+ };
@@ -0,0 +1,54 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _jsxruntime = require('react/jsx-runtime');
2
+ var _utils = require('../../lib/utils');
3
+ var _skeleton = require('../ui/skeleton');
4
+ function MetricSkeleton({ className, count = 3, ...props }) {
5
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6
+ "div",
7
+ {
8
+ "data-slot": "metric-skeleton",
9
+ className: _utils.cn.call(void 0, "flex gap-4", className),
10
+ ...props,
11
+ children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-1 flex-col gap-1.5", children: [
12
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _skeleton.Skeleton, { className: "h-2.5 w-12" }),
13
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _skeleton.Skeleton, { className: "h-5 w-8" })
14
+ ] }, i))
15
+ }
16
+ );
17
+ }
18
+ function ListSkeleton({ className, count = 4, ...props }) {
19
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
20
+ "div",
21
+ {
22
+ "data-slot": "list-skeleton",
23
+ className: _utils.cn.call(void 0, "flex flex-col gap-1", className),
24
+ ...props,
25
+ children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 rounded-md p-2", children: [
26
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _skeleton.Skeleton, { className: "size-2 rounded-full" }),
27
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _skeleton.Skeleton, { className: "h-3 flex-1" }),
28
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _skeleton.Skeleton, { className: "h-3 w-8" })
29
+ ] }, i))
30
+ }
31
+ );
32
+ }
33
+ function ActivitySkeleton({ className, count = 4, ...props }) {
34
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
35
+ "div",
36
+ {
37
+ "data-slot": "activity-skeleton",
38
+ className: _utils.cn.call(void 0, "flex flex-col gap-2", className),
39
+ ...props,
40
+ children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-start gap-2", children: [
41
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _skeleton.Skeleton, { className: "mt-0.5 size-2 rounded-full" }),
42
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-1 flex-col gap-1", children: [
43
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _skeleton.Skeleton, { className: "h-3 w-3/4" }),
44
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _skeleton.Skeleton, { className: "h-2.5 w-1/2" })
45
+ ] })
46
+ ] }, i))
47
+ }
48
+ );
49
+ }
50
+
51
+
52
+
53
+
54
+ exports.ActivitySkeleton = ActivitySkeleton; exports.ListSkeleton = ListSkeleton; exports.MetricSkeleton = MetricSkeleton;
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ interface SkeletonPatternProps extends React.ComponentProps<"div"> {
5
+ /** Number of rows / cells to render. */
6
+ count?: number;
7
+ }
8
+ /** A row of metric placeholders (label + value stacks). */
9
+ declare function MetricSkeleton({ className, count, ...props }: SkeletonPatternProps): react_jsx_runtime.JSX.Element;
10
+ /** A stack of list-row placeholders. */
11
+ declare function ListSkeleton({ className, count, ...props }: SkeletonPatternProps): react_jsx_runtime.JSX.Element;
12
+ /** A stack of activity-row placeholders (marker + label + timestamp). */
13
+ declare function ActivitySkeleton({ className, count, ...props }: SkeletonPatternProps): react_jsx_runtime.JSX.Element;
14
+
15
+ export { ActivitySkeleton, ListSkeleton, MetricSkeleton, type SkeletonPatternProps };
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ interface SkeletonPatternProps extends React.ComponentProps<"div"> {
5
+ /** Number of rows / cells to render. */
6
+ count?: number;
7
+ }
8
+ /** A row of metric placeholders (label + value stacks). */
9
+ declare function MetricSkeleton({ className, count, ...props }: SkeletonPatternProps): react_jsx_runtime.JSX.Element;
10
+ /** A stack of list-row placeholders. */
11
+ declare function ListSkeleton({ className, count, ...props }: SkeletonPatternProps): react_jsx_runtime.JSX.Element;
12
+ /** A stack of activity-row placeholders (marker + label + timestamp). */
13
+ declare function ActivitySkeleton({ className, count, ...props }: SkeletonPatternProps): react_jsx_runtime.JSX.Element;
14
+
15
+ export { ActivitySkeleton, ListSkeleton, MetricSkeleton, type SkeletonPatternProps };
@@ -0,0 +1,54 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/utils";
3
+ import { Skeleton } from "../ui/skeleton";
4
+ function MetricSkeleton({ className, count = 3, ...props }) {
5
+ return /* @__PURE__ */ jsx(
6
+ "div",
7
+ {
8
+ "data-slot": "metric-skeleton",
9
+ className: cn("flex gap-4", className),
10
+ ...props,
11
+ children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-1.5", children: [
12
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-2.5 w-12" }),
13
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-8" })
14
+ ] }, i))
15
+ }
16
+ );
17
+ }
18
+ function ListSkeleton({ className, count = 4, ...props }) {
19
+ return /* @__PURE__ */ jsx(
20
+ "div",
21
+ {
22
+ "data-slot": "list-skeleton",
23
+ className: cn("flex flex-col gap-1", className),
24
+ ...props,
25
+ children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 rounded-md p-2", children: [
26
+ /* @__PURE__ */ jsx(Skeleton, { className: "size-2 rounded-full" }),
27
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 flex-1" }),
28
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-8" })
29
+ ] }, i))
30
+ }
31
+ );
32
+ }
33
+ function ActivitySkeleton({ className, count = 4, ...props }) {
34
+ return /* @__PURE__ */ jsx(
35
+ "div",
36
+ {
37
+ "data-slot": "activity-skeleton",
38
+ className: cn("flex flex-col gap-2", className),
39
+ ...props,
40
+ children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
41
+ /* @__PURE__ */ jsx(Skeleton, { className: "mt-0.5 size-2 rounded-full" }),
42
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-1", children: [
43
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-3/4" }),
44
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-2.5 w-1/2" })
45
+ ] })
46
+ ] }, i))
47
+ }
48
+ );
49
+ }
50
+ export {
51
+ ActivitySkeleton,
52
+ ListSkeleton,
53
+ MetricSkeleton
54
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});const gapClass = {
2
+ none: "gap-0",
3
+ xs: "gap-1",
4
+ sm: "gap-2",
5
+ md: "gap-3",
6
+ lg: "gap-4"
7
+ };
8
+
9
+
10
+ exports.gapClass = gapClass;
@@ -0,0 +1,4 @@
1
+ type Gap = "none" | "xs" | "sm" | "md" | "lg";
2
+ declare const gapClass: Record<Gap, string>;
3
+
4
+ export { type Gap, gapClass };
@@ -0,0 +1,4 @@
1
+ type Gap = "none" | "xs" | "sm" | "md" | "lg";
2
+ declare const gapClass: Record<Gap, string>;
3
+
4
+ export { type Gap, gapClass };
@@ -0,0 +1,10 @@
1
+ const gapClass = {
2
+ none: "gap-0",
3
+ xs: "gap-1",
4
+ sm: "gap-2",
5
+ md: "gap-3",
6
+ lg: "gap-4"
7
+ };
8
+ export {
9
+ gapClass
10
+ };
@@ -0,0 +1,42 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _jsxruntime = require('react/jsx-runtime');
2
+ var _lucidereact = require('lucide-react');
3
+ var _utils = require('../../lib/utils');
4
+ var _typography = require('./typography');
5
+ var _iconbutton = require('./icon-button');
6
+ function StaleIndicator({
7
+ className,
8
+ lastUpdated,
9
+ onRefresh,
10
+ refreshing = false,
11
+ ...props
12
+ }) {
13
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
14
+ "div",
15
+ {
16
+ "data-slot": "stale-indicator",
17
+ className: _utils.cn.call(void 0,
18
+ "flex items-center gap-1.5 text-[11px] text-[var(--text-muted)]",
19
+ className
20
+ ),
21
+ ...props,
22
+ children: [
23
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _typography.Icon, { icon: _lucidereact.Clock, size: "xs", tone: "warning" }),
24
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "truncate", children: _nullishCoalesce(lastUpdated, () => ( "Data may be out of date")) }),
25
+ onRefresh && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
26
+ _iconbutton.IconButton,
27
+ {
28
+ icon: _lucidereact.RotateCw,
29
+ label: "Refresh",
30
+ size: "xs",
31
+ onClick: onRefresh,
32
+ className: _utils.cn.call(void 0, "ml-auto", refreshing && "animate-spin"),
33
+ disabled: refreshing
34
+ }
35
+ )
36
+ ]
37
+ }
38
+ );
39
+ }
40
+
41
+
42
+ exports.StaleIndicator = StaleIndicator;
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ interface StaleIndicatorProps extends React.ComponentProps<"div"> {
5
+ /** Pre-formatted last-updated value, e.g. "Updated 5m ago". */
6
+ lastUpdated?: React.ReactNode;
7
+ /** Refresh handler. When provided, a refresh button is shown. */
8
+ onRefresh?: () => void;
9
+ /** Spin the refresh icon while a refresh is in flight. */
10
+ refreshing?: boolean;
11
+ }
12
+ /** Compact "data may be stale" indicator with optional refresh. */
13
+ declare function StaleIndicator({ className, lastUpdated, onRefresh, refreshing, ...props }: StaleIndicatorProps): react_jsx_runtime.JSX.Element;
14
+
15
+ export { StaleIndicator, type StaleIndicatorProps };
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ interface StaleIndicatorProps extends React.ComponentProps<"div"> {
5
+ /** Pre-formatted last-updated value, e.g. "Updated 5m ago". */
6
+ lastUpdated?: React.ReactNode;
7
+ /** Refresh handler. When provided, a refresh button is shown. */
8
+ onRefresh?: () => void;
9
+ /** Spin the refresh icon while a refresh is in flight. */
10
+ refreshing?: boolean;
11
+ }
12
+ /** Compact "data may be stale" indicator with optional refresh. */
13
+ declare function StaleIndicator({ className, lastUpdated, onRefresh, refreshing, ...props }: StaleIndicatorProps): react_jsx_runtime.JSX.Element;
14
+
15
+ export { StaleIndicator, type StaleIndicatorProps };
@@ -0,0 +1,42 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Clock, RotateCw } from "lucide-react";
3
+ import { cn } from "../../lib/utils";
4
+ import { Icon } from "./typography";
5
+ import { IconButton } from "./icon-button";
6
+ function StaleIndicator({
7
+ className,
8
+ lastUpdated,
9
+ onRefresh,
10
+ refreshing = false,
11
+ ...props
12
+ }) {
13
+ return /* @__PURE__ */ jsxs(
14
+ "div",
15
+ {
16
+ "data-slot": "stale-indicator",
17
+ className: cn(
18
+ "flex items-center gap-1.5 text-[11px] text-[var(--text-muted)]",
19
+ className
20
+ ),
21
+ ...props,
22
+ children: [
23
+ /* @__PURE__ */ jsx(Icon, { icon: Clock, size: "xs", tone: "warning" }),
24
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: lastUpdated ?? "Data may be out of date" }),
25
+ onRefresh && /* @__PURE__ */ jsx(
26
+ IconButton,
27
+ {
28
+ icon: RotateCw,
29
+ label: "Refresh",
30
+ size: "xs",
31
+ onClick: onRefresh,
32
+ className: cn("ml-auto", refreshing && "animate-spin"),
33
+ disabled: refreshing
34
+ }
35
+ )
36
+ ]
37
+ }
38
+ );
39
+ }
40
+ export {
41
+ StaleIndicator
42
+ };
@@ -0,0 +1,62 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _jsxruntime = require('react/jsx-runtime');
2
+ var _utils = require('../../lib/utils');
3
+ var _tone = require('./tone');
4
+ function Status({
5
+ className,
6
+ tone = "neutral",
7
+ variant = "dot",
8
+ pulse = false,
9
+ children,
10
+ ...props
11
+ }) {
12
+ const hasLabel = children != null && children !== "";
13
+ if (variant === "pill") {
14
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
15
+ "span",
16
+ {
17
+ "data-slot": "status",
18
+ "data-tone": tone,
19
+ className: _utils.cn.call(void 0,
20
+ "inline-flex w-fit items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium",
21
+ _tone.tonePill[tone],
22
+ className
23
+ ),
24
+ ...props,
25
+ children: [
26
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _utils.cn.call(void 0, "size-1.5 shrink-0 rounded-full", _tone.toneDot[tone]) }),
27
+ children
28
+ ]
29
+ }
30
+ );
31
+ }
32
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
33
+ "span",
34
+ {
35
+ "data-slot": "status",
36
+ "data-tone": tone,
37
+ role: hasLabel ? void 0 : "status",
38
+ className: _utils.cn.call(void 0,
39
+ "inline-flex items-center gap-1.5 text-xs font-medium text-[var(--text-secondary)]",
40
+ className
41
+ ),
42
+ ...props,
43
+ children: [
44
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
45
+ "span",
46
+ {
47
+ className: _utils.cn.call(void 0,
48
+ "size-2 shrink-0 rounded-full",
49
+ _tone.toneDot[tone],
50
+ // ring-current picks up the tone's text colour for a matching glow.
51
+ pulse && _utils.cn.call(void 0, _tone.toneColor[tone], "ring-2 ring-current/25")
52
+ )
53
+ }
54
+ ),
55
+ children
56
+ ]
57
+ }
58
+ );
59
+ }
60
+
61
+
62
+ exports.Status = Status;
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { Tone } from './tone.cjs';
4
+
5
+ interface StatusProps extends React.ComponentProps<"span"> {
6
+ tone?: Tone;
7
+ /** Presentation: coloured dot + label, a tinted pill, or a bare dot. */
8
+ variant?: "dot" | "pill";
9
+ /** Add a soft glow to the dot (e.g. a live/active indicator). */
10
+ pulse?: boolean;
11
+ }
12
+ /** Semantic status dot, label or pill with neutral/success/warning/error/info tones. */
13
+ declare function Status({ className, tone, variant, pulse, children, ...props }: StatusProps): react_jsx_runtime.JSX.Element;
14
+
15
+ export { Status, type StatusProps };
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { Tone } from './tone.js';
4
+
5
+ interface StatusProps extends React.ComponentProps<"span"> {
6
+ tone?: Tone;
7
+ /** Presentation: coloured dot + label, a tinted pill, or a bare dot. */
8
+ variant?: "dot" | "pill";
9
+ /** Add a soft glow to the dot (e.g. a live/active indicator). */
10
+ pulse?: boolean;
11
+ }
12
+ /** Semantic status dot, label or pill with neutral/success/warning/error/info tones. */
13
+ declare function Status({ className, tone, variant, pulse, children, ...props }: StatusProps): react_jsx_runtime.JSX.Element;
14
+
15
+ export { Status, type StatusProps };
@@ -0,0 +1,62 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/utils";
3
+ import { toneColor, toneDot, tonePill } from "./tone";
4
+ function Status({
5
+ className,
6
+ tone = "neutral",
7
+ variant = "dot",
8
+ pulse = false,
9
+ children,
10
+ ...props
11
+ }) {
12
+ const hasLabel = children != null && children !== "";
13
+ if (variant === "pill") {
14
+ return /* @__PURE__ */ jsxs(
15
+ "span",
16
+ {
17
+ "data-slot": "status",
18
+ "data-tone": tone,
19
+ className: cn(
20
+ "inline-flex w-fit items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium",
21
+ tonePill[tone],
22
+ className
23
+ ),
24
+ ...props,
25
+ children: [
26
+ /* @__PURE__ */ jsx("span", { className: cn("size-1.5 shrink-0 rounded-full", toneDot[tone]) }),
27
+ children
28
+ ]
29
+ }
30
+ );
31
+ }
32
+ return /* @__PURE__ */ jsxs(
33
+ "span",
34
+ {
35
+ "data-slot": "status",
36
+ "data-tone": tone,
37
+ role: hasLabel ? void 0 : "status",
38
+ className: cn(
39
+ "inline-flex items-center gap-1.5 text-xs font-medium text-[var(--text-secondary)]",
40
+ className
41
+ ),
42
+ ...props,
43
+ children: [
44
+ /* @__PURE__ */ jsx(
45
+ "span",
46
+ {
47
+ className: cn(
48
+ "size-2 shrink-0 rounded-full",
49
+ toneDot[tone],
50
+ // ring-current picks up the tone's text colour for a matching glow.
51
+ pulse && cn(toneColor[tone], "ring-2 ring-current/25")
52
+ )
53
+ }
54
+ ),
55
+ children
56
+ ]
57
+ }
58
+ );
59
+ }
60
+ export {
61
+ Status
62
+ };