@peasant-labs/fairtrade 0.0.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 (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +85 -0
  3. package/dist/lib/README.md +13 -0
  4. package/dist/lib/base.css +48 -0
  5. package/dist/lib/components.css +2 -0
  6. package/dist/lib/fonts.css +28 -0
  7. package/dist/lib/tokens.css +184 -0
  8. package/dist/lib/tokens.json +768 -0
  9. package/dist/lib/types/Accordion.d.ts +47 -0
  10. package/dist/lib/types/Accordion.stories.d.ts +91 -0
  11. package/dist/lib/types/Avatar.d.ts +94 -0
  12. package/dist/lib/types/Avatar.stories.d.ts +160 -0
  13. package/dist/lib/types/BrandMark.d.ts +25 -0
  14. package/dist/lib/types/BrandMark.stories.d.ts +75 -0
  15. package/dist/lib/types/Breadcrumb.d.ts +66 -0
  16. package/dist/lib/types/Breadcrumb.stories.d.ts +91 -0
  17. package/dist/lib/types/Button.d.ts +86 -0
  18. package/dist/lib/types/Button.stories.d.ts +129 -0
  19. package/dist/lib/types/Card.d.ts +145 -0
  20. package/dist/lib/types/Card.stories.d.ts +70 -0
  21. package/dist/lib/types/Chart.stories.d.ts +55 -0
  22. package/dist/lib/types/ChartBar.d.ts +51 -0
  23. package/dist/lib/types/ChartLine.d.ts +54 -0
  24. package/dist/lib/types/Checkbox.d.ts +132 -0
  25. package/dist/lib/types/Checkbox.stories.d.ts +75 -0
  26. package/dist/lib/types/Chip.d.ts +85 -0
  27. package/dist/lib/types/Chip.stories.d.ts +190 -0
  28. package/dist/lib/types/CliOnboard.d.ts +68 -0
  29. package/dist/lib/types/CliOnboard.stories.d.ts +24 -0
  30. package/dist/lib/types/CommandPalette.d.ts +6 -0
  31. package/dist/lib/types/CommandPalette.stories.d.ts +94 -0
  32. package/dist/lib/types/CommitGraph.d.ts +71 -0
  33. package/dist/lib/types/CommitGraph.stories.d.ts +17 -0
  34. package/dist/lib/types/ConnectionState.d.ts +82 -0
  35. package/dist/lib/types/ConnectionState.stories.d.ts +117 -0
  36. package/dist/lib/types/ConsentDialog.d.ts +97 -0
  37. package/dist/lib/types/ConsentDialog.stories.d.ts +61 -0
  38. package/dist/lib/types/DataTable.d.ts +116 -0
  39. package/dist/lib/types/DataTable.stories.d.ts +240 -0
  40. package/dist/lib/types/DateRange.d.ts +242 -0
  41. package/dist/lib/types/DateRange.stories.d.ts +272 -0
  42. package/dist/lib/types/Dialog.d.ts +9 -0
  43. package/dist/lib/types/Dialog.stories.d.ts +121 -0
  44. package/dist/lib/types/DiffView.d.ts +39 -0
  45. package/dist/lib/types/DiffView.stories.d.ts +118 -0
  46. package/dist/lib/types/EmptyState.d.ts +28 -0
  47. package/dist/lib/types/EmptyState.stories.d.ts +130 -0
  48. package/dist/lib/types/EvidenceCaption.d.ts +39 -0
  49. package/dist/lib/types/EvidenceCaption.stories.d.ts +43 -0
  50. package/dist/lib/types/Explainer.d.ts +82 -0
  51. package/dist/lib/types/Explainer.stories.d.ts +22 -0
  52. package/dist/lib/types/FacetRail.d.ts +13 -0
  53. package/dist/lib/types/FacetRail.stories.d.ts +28 -0
  54. package/dist/lib/types/Feedback.d.ts +222 -0
  55. package/dist/lib/types/Feedback.stories.d.ts +81 -0
  56. package/dist/lib/types/GroupedMultiSelect.d.ts +67 -0
  57. package/dist/lib/types/GroupedMultiSelect.stories.d.ts +59 -0
  58. package/dist/lib/types/Input.d.ts +158 -0
  59. package/dist/lib/types/Input.stories.d.ts +181 -0
  60. package/dist/lib/types/Intensity.d.ts +55 -0
  61. package/dist/lib/types/Intensity.stories.d.ts +108 -0
  62. package/dist/lib/types/MapCanvas.d.ts +89 -0
  63. package/dist/lib/types/MapCanvas.stories.d.ts +174 -0
  64. package/dist/lib/types/Menu.d.ts +62 -0
  65. package/dist/lib/types/Menu.stories.d.ts +173 -0
  66. package/dist/lib/types/ModerationQueue.d.ts +135 -0
  67. package/dist/lib/types/ModerationQueue.stories.d.ts +34 -0
  68. package/dist/lib/types/Pager.d.ts +47 -0
  69. package/dist/lib/types/Pager.stories.d.ts +100 -0
  70. package/dist/lib/types/Pagination.d.ts +50 -0
  71. package/dist/lib/types/Pagination.stories.d.ts +193 -0
  72. package/dist/lib/types/PolicySelect.d.ts +80 -0
  73. package/dist/lib/types/PolicySelect.stories.d.ts +130 -0
  74. package/dist/lib/types/ProviderIcon.d.ts +83 -0
  75. package/dist/lib/types/ProviderIcon.stories.d.ts +44 -0
  76. package/dist/lib/types/RailShell.d.ts +199 -0
  77. package/dist/lib/types/RailShell.stories.d.ts +32 -0
  78. package/dist/lib/types/Redaction.d.ts +53 -0
  79. package/dist/lib/types/Redaction.stories.d.ts +120 -0
  80. package/dist/lib/types/RoleRoster.d.ts +97 -0
  81. package/dist/lib/types/RoleRoster.stories.d.ts +23 -0
  82. package/dist/lib/types/SignIn.d.ts +78 -0
  83. package/dist/lib/types/SignIn.stories.d.ts +57 -0
  84. package/dist/lib/types/Sparkline.d.ts +19 -0
  85. package/dist/lib/types/StatTiles.d.ts +115 -0
  86. package/dist/lib/types/StatTiles.stories.d.ts +31 -0
  87. package/dist/lib/types/StepWizard.d.ts +92 -0
  88. package/dist/lib/types/StepWizard.stories.d.ts +18 -0
  89. package/dist/lib/types/StepsWaterfall.d.ts +67 -0
  90. package/dist/lib/types/StepsWaterfall.stories.d.ts +94 -0
  91. package/dist/lib/types/Switch.d.ts +63 -0
  92. package/dist/lib/types/Switch.stories.d.ts +134 -0
  93. package/dist/lib/types/Tabs.d.ts +48 -0
  94. package/dist/lib/types/Tabs.stories.d.ts +75 -0
  95. package/dist/lib/types/TimeStrip.d.ts +12 -0
  96. package/dist/lib/types/TimeStrip.stories.d.ts +30 -0
  97. package/dist/lib/types/Timeline.d.ts +192 -0
  98. package/dist/lib/types/Timeline.stories.d.ts +974 -0
  99. package/dist/lib/types/ToastHost.d.ts +70 -0
  100. package/dist/lib/types/ToastHost.stories.d.ts +115 -0
  101. package/dist/lib/types/ToolRenderers.d.ts +24 -0
  102. package/dist/lib/types/ToolRenderers.stories.d.ts +138 -0
  103. package/dist/lib/types/Tooltip.d.ts +80 -0
  104. package/dist/lib/types/Tooltip.stories.d.ts +116 -0
  105. package/dist/lib/types/Tour.d.ts +37 -0
  106. package/dist/lib/types/Tour.stories.d.ts +39 -0
  107. package/dist/lib/types/TranscriptMarkers.d.ts +50 -0
  108. package/dist/lib/types/TranscriptMarkers.stories.d.ts +48 -0
  109. package/dist/lib/types/Treemap.d.ts +77 -0
  110. package/dist/lib/types/Treemap.stories.d.ts +101 -0
  111. package/dist/lib/types/VisibilityControl.d.ts +54 -0
  112. package/dist/lib/types/VisibilityControl.stories.d.ts +126 -0
  113. package/dist/lib/types/chart-shared.d.ts +63 -0
  114. package/dist/lib/types/index.d.ts +53 -0
  115. package/dist/lib/types/story-frame.d.ts +12 -0
  116. package/dist/lib/ui.js +8707 -0
  117. package/package.json +67 -0
@@ -0,0 +1,57 @@
1
+ export default meta;
2
+ export namespace SplitButton {
3
+ let name: string;
4
+ let decorators: Function[];
5
+ namespace args {
6
+ let onSignIn: import("storybook/test").Mock<(...args: any[]) => any>;
7
+ }
8
+ function render(args: any): any;
9
+ function play({ canvasElement, args }: {
10
+ canvasElement: any;
11
+ args: any;
12
+ }): Promise<void>;
13
+ }
14
+ export namespace HandleClaimStory {
15
+ let name_1: string;
16
+ export { name_1 as name };
17
+ let decorators_1: Function[];
18
+ export { decorators_1 as decorators };
19
+ export namespace args_1 {
20
+ let onSubmit: import("storybook/test").Mock<(...args: any[]) => any>;
21
+ let suggestedFrom: string;
22
+ }
23
+ export { args_1 as args };
24
+ export function render_1(args: any): any;
25
+ export { render_1 as render };
26
+ export function play_1({ canvasElement }: {
27
+ canvasElement: any;
28
+ }): Promise<void>;
29
+ export { play_1 as play };
30
+ }
31
+ export namespace States {
32
+ let decorators_2: Function[];
33
+ export { decorators_2 as decorators };
34
+ export function render_2(): any;
35
+ export { render_2 as render };
36
+ }
37
+ export namespace Combined {
38
+ let name_2: string;
39
+ export { name_2 as name };
40
+ let decorators_3: Function[];
41
+ export { decorators_3 as decorators };
42
+ export function render_3(): any;
43
+ export { render_3 as render };
44
+ export function play_2({ canvasElement }: {
45
+ canvasElement: any;
46
+ }): Promise<void>;
47
+ export { play_2 as play };
48
+ }
49
+ declare namespace meta {
50
+ export let title: string;
51
+ export { SignInProviders as component };
52
+ export let tags: string[];
53
+ export namespace parameters {
54
+ let layout: string;
55
+ }
56
+ }
57
+ import { SignInProviders } from './SignIn.jsx';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @param {Object} props
3
+ * @param {Array<number|Object>} props.data numbers, or objects with a `value` key.
4
+ * @param {'line'|'bar'} [props.type='line'] line or mini-bar.
5
+ * @param {'teal'|'olive'|'clay'|'mauve'|'amber'|1|2|3|4} [props.color='teal'] token colour.
6
+ * @param {number} [props.width=88] px width.
7
+ * @param {number} [props.height=24] px height.
8
+ * @param {string} props.label accessible name (e.g. "sessions, last 8 weeks, trending up"). required.
9
+ * @param {string} [props.className] extra class.
10
+ */
11
+ export default function Sparkline({ data, type, color, width, height, label, className }: {
12
+ data: Array<number | any>;
13
+ type?: "line" | "bar";
14
+ color?: "teal" | "olive" | "clay" | "mauve" | "amber" | 1 | 2 | 3 | 4;
15
+ width?: number;
16
+ height?: number;
17
+ label: string;
18
+ className?: string;
19
+ }): any;
@@ -0,0 +1,115 @@
1
+ /**
2
+ * StatTile — one KPI: a mono eyebrow label, a big tabular display number, an optional sub line.
3
+ *
4
+ * @param {object} props
5
+ * @param {string} props.label - the metric name (lowercase chrome; e.g. "transcripts").
6
+ * @param {React.ReactNode} props.value - the headline figure (USER CONTENT — pre-formatted, e.g. "4.2M").
7
+ * @param {React.ReactNode} [props.sub] - an optional secondary line under the value (e.g. "9,610 turns").
8
+ * @param {React.ComponentType<{className?: string}>} [props.icon] - optional lucide icon for the label row.
9
+ * @param {string} [props.className] - extra classes appended to the root.
10
+ */
11
+ export function StatTile({ label, value, sub, icon: Icon, className, ...rest }: {
12
+ label: string;
13
+ value: React.ReactNode;
14
+ sub?: React.ReactNode;
15
+ icon?: React.ComponentType<{
16
+ className?: string;
17
+ }>;
18
+ className?: string;
19
+ }): any;
20
+ /**
21
+ * @typedef {object} TileSpec
22
+ * @property {string} key - stable key for the tile.
23
+ * @property {string} label - the metric name.
24
+ * @property {React.ReactNode} value - the headline figure.
25
+ * @property {React.ReactNode} [sub] - optional sub line.
26
+ * @property {React.ComponentType<{className?: string}>} [icon] - optional label icon.
27
+ */
28
+ /**
29
+ * StatGrid — an auto-fit responsive grid of StatTiles (columns min ~160px, equal gaps).
30
+ *
31
+ * @param {object} props
32
+ * @param {TileSpec[]} props.tiles - the KPI tiles to render, in order.
33
+ * @param {string} [props.className] - extra classes appended to the grid.
34
+ */
35
+ export function StatGrid({ tiles, className, ...rest }: {
36
+ tiles: TileSpec[];
37
+ className?: string;
38
+ }): any;
39
+ /**
40
+ * GovTile — a governance fact: a mono eyebrow label, an icon, and a value that may carry one
41
+ * scarce earth-tone accent (e.g. amber for a "members only" / scarce policy). The value is mono,
42
+ * not the big display number — governance reads as a stated setting, not a metric.
43
+ *
44
+ * @param {object} props
45
+ * @param {string} props.label - the governance dimension (e.g. "access", "your role").
46
+ * @param {React.ReactNode} props.value - the setting (USER CONTENT — e.g. "members only", "contributor").
47
+ * @param {React.ComponentType<{className?: string}>} [props.icon] - optional lucide icon for the label row.
48
+ * @param {'amber'|'teal'|'olive'|'clay'|'mauve'} [props.tone] - optional earth-tone accent on the value.
49
+ * @param {string} [props.className] - extra classes appended to the root.
50
+ */
51
+ export function GovTile({ label, value, icon: Icon, tone, className, ...rest }: {
52
+ label: string;
53
+ value: React.ReactNode;
54
+ icon?: React.ComponentType<{
55
+ className?: string;
56
+ }>;
57
+ tone?: "amber" | "teal" | "olive" | "clay" | "mauve";
58
+ className?: string;
59
+ }): any;
60
+ /**
61
+ * @typedef {object} ProviderDatum
62
+ * @property {string} label - provider name (USER CONTENT — case preserved; e.g. "claude-code").
63
+ * @property {number} value - this provider's count.
64
+ */
65
+ /**
66
+ * ProviderBars — a labeled horizontal distribution. Each row is a provider name, a monochrome bar
67
+ * whose width is its share of `total`, and a tabular %. Bars are one ink weight (no per-row hue):
68
+ * the eye reads length + label + the written %, so the distribution survives greyscale and AT.
69
+ *
70
+ * @param {object} props
71
+ * @param {ProviderDatum[]} props.data - the providers, in the order to display (caller pre-sorts).
72
+ * @param {number} [props.total] - the denominator for the shares; defaults to the sum of values.
73
+ * @param {string} [props.label='provider distribution'] - accessible name for the list (lowercase chrome).
74
+ * @param {string} [props.className] - extra classes appended to the root.
75
+ */
76
+ export function ProviderBars({ data, total, label, className, ...rest }: {
77
+ data: ProviderDatum[];
78
+ total?: number;
79
+ label?: string;
80
+ className?: string;
81
+ }): any;
82
+ export type TileSpec = {
83
+ /**
84
+ * - stable key for the tile.
85
+ */
86
+ key: string;
87
+ /**
88
+ * - the metric name.
89
+ */
90
+ label: string;
91
+ /**
92
+ * - the headline figure.
93
+ */
94
+ value: React.ReactNode;
95
+ /**
96
+ * - optional sub line.
97
+ */
98
+ sub?: React.ReactNode;
99
+ /**
100
+ * - optional label icon.
101
+ */
102
+ icon?: React.ComponentType<{
103
+ className?: string;
104
+ }>;
105
+ };
106
+ export type ProviderDatum = {
107
+ /**
108
+ * - provider name (USER CONTENT — case preserved; e.g. "claude-code").
109
+ */
110
+ label: string;
111
+ /**
112
+ * - this provider's count.
113
+ */
114
+ value: number;
115
+ };
@@ -0,0 +1,31 @@
1
+ export default meta;
2
+ export namespace KPIs {
3
+ let decorators: Function[];
4
+ function render(): any;
5
+ }
6
+ export namespace Governance {
7
+ let decorators_1: Function[];
8
+ export { decorators_1 as decorators };
9
+ export function render_1(): any;
10
+ export { render_1 as render };
11
+ }
12
+ export namespace ProviderDistribution {
13
+ let decorators_2: Function[];
14
+ export { decorators_2 as decorators };
15
+ export function render_2(): any;
16
+ export { render_2 as render };
17
+ }
18
+ export namespace SingleTile {
19
+ let decorators_3: Function[];
20
+ export { decorators_3 as decorators };
21
+ export function render_3(): any;
22
+ export { render_3 as render };
23
+ }
24
+ declare namespace meta {
25
+ export let title: string;
26
+ export { StatTile as component };
27
+ export namespace parameters {
28
+ let layout: string;
29
+ }
30
+ }
31
+ import { StatTile } from './StatTiles.jsx';
@@ -0,0 +1,92 @@
1
+ /**
2
+ * @typedef {Object} WizardStep
3
+ * @property {string} id stable id for the step (aria wiring + completed/reachable sets)
4
+ * @property {React.ReactNode} label the step's lowercase chrome label, shown under its number
5
+ */
6
+ /**
7
+ * The rail alone: numbered square markers joined by connector lines. Pure/controlled — it owns no
8
+ * state. current = amber fill + bold near-black number + aria-current="step"; completed = olive +
9
+ * check glyph (clickable to jump back); future/unreachable = hairline + --ink-4 + aria-disabled
10
+ * (not clickable). Completed steps are always reachable.
11
+ *
12
+ * @param {Object} props
13
+ * @param {WizardStep[]} props.steps the ordered steps
14
+ * @param {string} props.current id of the active step
15
+ * @param {Set<string>} [props.completed] ids of finished steps (olive + check, jump-back enabled)
16
+ * @param {Set<string>} [props.reachable] ids the user may jump to (the gate). current + completed are implicitly reachable
17
+ * @param {(id: string) => void} [props.onJump] called with a step id when a reachable/complete marker is activated
18
+ * @param {string} [props['aria-label']] accessible name for the rail (default "progress")
19
+ */
20
+ export function StepIndicator({ steps, current, completed, reachable, onJump, "aria-label": ariaLabel, }: {
21
+ steps: WizardStep[];
22
+ current: string;
23
+ completed?: Set<string>;
24
+ reachable?: Set<string>;
25
+ onJump?: (id: string) => void;
26
+ }): any;
27
+ /**
28
+ * @typedef {Object} WizardBodyArgs
29
+ * @property {WizardStep} step the active step descriptor
30
+ * @property {number} index its zero-based position
31
+ * @property {boolean} isLast whether it's the final step
32
+ * @property {(valid: boolean) => void} setValid report whether the step may advance (gates continue)
33
+ */
34
+ /**
35
+ * Uncontrolled wizard: the rail + a per-step body slot + a sticky footer action bar.
36
+ * Tracks current / completed / reachable internally. Continue advances, marks the step complete,
37
+ * and unlocks the next step; on the last step its primary action reads "submit" and fires
38
+ * onComplete. Back is enabled on every step except the first.
39
+ *
40
+ * Step bodies come from either `children` (an array, one node per step — index-aligned to `steps`)
41
+ * or a `renderStep` render-prop called with {step, index, isLast, setValid}. A step is advanceable
42
+ * unless its render-prop has reported setValid(false); plain-children bodies are always valid.
43
+ *
44
+ * @param {Object} props
45
+ * @param {WizardStep[]} props.steps the ordered steps (>= 1)
46
+ * @param {(args: { completed: Set<string> }) => void} [props.onComplete] fired when the last step's submit is activated
47
+ * @param {(args: WizardBodyArgs) => React.ReactNode} [props.renderStep] render-prop for the active step's body
48
+ * @param {React.ReactNode[]} [props.children] index-aligned step bodies (alternative to renderStep)
49
+ * @param {string} [props.continueLabel='continue'] primary label for non-final steps
50
+ * @param {string} [props.submitLabel='submit'] primary label for the final step
51
+ * @param {string} [props.backLabel='back'] secondary (back) label
52
+ * @param {string} [props['aria-label']] accessible name for the rail
53
+ */
54
+ export default function StepWizard({ steps, onComplete, renderStep, children, continueLabel, submitLabel, backLabel, "aria-label": ariaLabel, }: {
55
+ steps: WizardStep[];
56
+ onComplete?: (args: {
57
+ completed: Set<string>;
58
+ }) => void;
59
+ renderStep?: (args: WizardBodyArgs) => React.ReactNode;
60
+ children?: React.ReactNode[];
61
+ continueLabel?: string;
62
+ submitLabel?: string;
63
+ backLabel?: string;
64
+ }): any;
65
+ export type WizardStep = {
66
+ /**
67
+ * stable id for the step (aria wiring + completed/reachable sets)
68
+ */
69
+ id: string;
70
+ /**
71
+ * the step's lowercase chrome label, shown under its number
72
+ */
73
+ label: React.ReactNode;
74
+ };
75
+ export type WizardBodyArgs = {
76
+ /**
77
+ * the active step descriptor
78
+ */
79
+ step: WizardStep;
80
+ /**
81
+ * its zero-based position
82
+ */
83
+ index: number;
84
+ /**
85
+ * whether it's the final step
86
+ */
87
+ isLast: boolean;
88
+ /**
89
+ * report whether the step may advance (gates continue)
90
+ */
91
+ setValid: (valid: boolean) => void;
92
+ };
@@ -0,0 +1,18 @@
1
+ export default meta;
2
+ export namespace Default {
3
+ function render(): any;
4
+ function play({ canvasElement }: {
5
+ canvasElement: any;
6
+ }): Promise<void>;
7
+ }
8
+ export namespace Indicator {
9
+ export function render_1(): any;
10
+ export { render_1 as render };
11
+ }
12
+ declare namespace meta {
13
+ export let title: string;
14
+ export { StepWizard as component };
15
+ export let tags: string[];
16
+ export let decorators: Function[];
17
+ }
18
+ import StepWizard from './StepWizard.jsx';
@@ -0,0 +1,67 @@
1
+ /** Human-readable ms duration: "4.2s", "42s", "2m 14s", "1.5h". Tabular-friendly, no leading zeros. */
2
+ export function formatDuration(ms: any): string;
3
+ /**
4
+ * @typedef {object} Task
5
+ * @property {string} id - stable key; passed back to onJump (e.g. the prompt turn id).
6
+ * @property {number} [index] - the displayed task number (#1). Falls back to row order + 1.
7
+ * @property {string} prompt - the user prompt that opened the task (USER CONTENT — case preserved).
8
+ * @property {number} durationMs - how long the task took, in ms (drives the bar + the label).
9
+ * @property {number} [tools] - tool calls in the task (shown as "n tools" when no `turns`).
10
+ * @property {number} [turns] - assistant turns in the task (shown as "n turns").
11
+ * @property {'ok'|'error'} [outcome] - 'error' draws the clay marker + the "error" word/icon.
12
+ * @property {string} [error] - a short error label; shown in place of "error" when present.
13
+ */
14
+ /**
15
+ * StepsWaterfall — render `tasks` as a duration waterfall: a header (total + count + collapse-all)
16
+ * over a list of selectable rows, each with a monochrome duration bar.
17
+ *
18
+ * @param {object} props
19
+ * @param {Task[]} props.tasks - the tasks, in order; one row each.
20
+ * @param {(id: string) => void} [props.onJump] - called with a task id when its row is chosen.
21
+ * @param {number} [props.totalMs] - total session time; defaults to the sum of task durations.
22
+ * @param {boolean} [props.defaultCollapsed=false] - start with the rows collapsed.
23
+ * @param {string} [props.label='steps by duration'] - accessible name for the list (lowercase chrome).
24
+ * @param {string} [props.className] - extra classes appended to the root.
25
+ */
26
+ export default function StepsWaterfall({ tasks, onJump, totalMs, defaultCollapsed, label, className, ...rest }: {
27
+ tasks: Task[];
28
+ onJump?: (id: string) => void;
29
+ totalMs?: number;
30
+ defaultCollapsed?: boolean;
31
+ label?: string;
32
+ className?: string;
33
+ }): any;
34
+ export type Task = {
35
+ /**
36
+ * - stable key; passed back to onJump (e.g. the prompt turn id).
37
+ */
38
+ id: string;
39
+ /**
40
+ * - the displayed task number (#1). Falls back to row order + 1.
41
+ */
42
+ index?: number;
43
+ /**
44
+ * - the user prompt that opened the task (USER CONTENT — case preserved).
45
+ */
46
+ prompt: string;
47
+ /**
48
+ * - how long the task took, in ms (drives the bar + the label).
49
+ */
50
+ durationMs: number;
51
+ /**
52
+ * - tool calls in the task (shown as "n tools" when no `turns`).
53
+ */
54
+ tools?: number;
55
+ /**
56
+ * - assistant turns in the task (shown as "n turns").
57
+ */
58
+ turns?: number;
59
+ /**
60
+ * - 'error' draws the clay marker + the "error" word/icon.
61
+ */
62
+ outcome?: "ok" | "error";
63
+ /**
64
+ * - a short error label; shown in place of "error" when present.
65
+ */
66
+ error?: string;
67
+ };
@@ -0,0 +1,94 @@
1
+ export default meta;
2
+ export namespace Default {
3
+ namespace args {
4
+ export { TASKS as tasks };
5
+ export let totalMs: number;
6
+ }
7
+ function play({ args, canvasElement }: {
8
+ args: any;
9
+ canvasElement: any;
10
+ }): Promise<void>;
11
+ }
12
+ export namespace Dense {
13
+ export namespace args_1 {
14
+ export { DENSE as tasks };
15
+ }
16
+ export { args_1 as args };
17
+ }
18
+ export namespace WithError {
19
+ export namespace args_2 {
20
+ export { WITH_ERROR as tasks };
21
+ }
22
+ export { args_2 as args };
23
+ }
24
+ export namespace Collapsed {
25
+ export namespace args_3 {
26
+ export { TASKS as tasks };
27
+ let totalMs_1: number;
28
+ export { totalMs_1 as totalMs };
29
+ export let defaultCollapsed: boolean;
30
+ }
31
+ export { args_3 as args };
32
+ }
33
+ declare namespace meta {
34
+ export let title: string;
35
+ export { StepsWaterfall as component };
36
+ export let decorators: Function[];
37
+ export namespace parameters {
38
+ let layout: string;
39
+ }
40
+ export namespace args_4 {
41
+ let onJump: import("storybook/test").Mock<(...args: any[]) => any>;
42
+ }
43
+ export { args_4 as args };
44
+ }
45
+ declare const TASKS: ({
46
+ id: string;
47
+ index: number;
48
+ prompt: string;
49
+ durationMs: number;
50
+ turns: number;
51
+ outcome: string;
52
+ error?: undefined;
53
+ } | {
54
+ id: string;
55
+ index: number;
56
+ prompt: string;
57
+ durationMs: number;
58
+ turns: number;
59
+ outcome: string;
60
+ error: string;
61
+ })[];
62
+ declare const DENSE: ({
63
+ id: string;
64
+ prompt: string;
65
+ durationMs: number;
66
+ tools: number;
67
+ outcome?: undefined;
68
+ error?: undefined;
69
+ } | {
70
+ id: string;
71
+ prompt: string;
72
+ durationMs: number;
73
+ tools: number;
74
+ outcome: string;
75
+ error: string;
76
+ })[];
77
+ declare const WITH_ERROR: ({
78
+ id: string;
79
+ index: number;
80
+ prompt: string;
81
+ durationMs: number;
82
+ turns: number;
83
+ outcome: string;
84
+ error?: undefined;
85
+ } | {
86
+ id: string;
87
+ index: number;
88
+ prompt: string;
89
+ durationMs: number;
90
+ turns: number;
91
+ outcome: string;
92
+ error: string;
93
+ })[];
94
+ import StepsWaterfall from './StepsWaterfall.jsx';
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @typedef {Object} SwitchProps
3
+ * @property {boolean} [checked] controlled on/off state; pair with onChange.
4
+ * @property {boolean} [defaultChecked=false] initial state when uncontrolled.
5
+ * @property {(next: boolean) => void} [onChange] called with the next state on toggle.
6
+ * @property {boolean} [disabled=false] real `disabled` attribute (dim, not focusable).
7
+ * @property {boolean} [busy=false] sets aria-busy; pairs with an aria-live marker.
8
+ * @property {React.ReactNode} [label] text rendered in the associated .sw-label.
9
+ * @property {string} [onText='on'] state-marker text shown when checked.
10
+ * @property {string} [offText='off'] state-marker text shown when unchecked.
11
+ * @property {React.ComponentType<{size?: number}>} [stateIcon] override icon for the
12
+ * .sw-state marker; defaults to CircleCheck (on) / Circle (off).
13
+ * @property {string} [id] id for the control; links the label's `for`.
14
+ */
15
+ /**
16
+ * @param {SwitchProps} props
17
+ */
18
+ export default function Switch({ checked, defaultChecked, onChange, disabled, busy, label, onText, offText, stateIcon: StateIcon, id, }: SwitchProps): any;
19
+ export type SwitchProps = {
20
+ /**
21
+ * controlled on/off state; pair with onChange.
22
+ */
23
+ checked?: boolean;
24
+ /**
25
+ * initial state when uncontrolled.
26
+ */
27
+ defaultChecked?: boolean;
28
+ /**
29
+ * called with the next state on toggle.
30
+ */
31
+ onChange?: (next: boolean) => void;
32
+ /**
33
+ * real `disabled` attribute (dim, not focusable).
34
+ */
35
+ disabled?: boolean;
36
+ /**
37
+ * sets aria-busy; pairs with an aria-live marker.
38
+ */
39
+ busy?: boolean;
40
+ /**
41
+ * text rendered in the associated .sw-label.
42
+ */
43
+ label?: React.ReactNode;
44
+ /**
45
+ * state-marker text shown when checked.
46
+ */
47
+ onText?: string;
48
+ /**
49
+ * state-marker text shown when unchecked.
50
+ */
51
+ offText?: string;
52
+ /**
53
+ * override icon for the
54
+ * .sw-state marker; defaults to CircleCheck (on) / Circle (off).
55
+ */
56
+ stateIcon?: React.ComponentType<{
57
+ size?: number;
58
+ }>;
59
+ /**
60
+ * id for the control; links the label's `for`.
61
+ */
62
+ id?: string;
63
+ };
@@ -0,0 +1,134 @@
1
+ export default meta;
2
+ export const Playground: {};
3
+ export namespace On {
4
+ namespace args {
5
+ let label: string;
6
+ let defaultChecked: boolean;
7
+ }
8
+ }
9
+ export namespace Off {
10
+ export namespace args_1 {
11
+ let label_1: string;
12
+ export { label_1 as label };
13
+ let defaultChecked_1: boolean;
14
+ export { defaultChecked_1 as defaultChecked };
15
+ }
16
+ export { args_1 as args };
17
+ }
18
+ export namespace Disabled {
19
+ export namespace args_2 {
20
+ let label_2: string;
21
+ export { label_2 as label };
22
+ let defaultChecked_2: boolean;
23
+ export { defaultChecked_2 as defaultChecked };
24
+ export let disabled: boolean;
25
+ }
26
+ export { args_2 as args };
27
+ }
28
+ export namespace Busy {
29
+ export namespace args_3 {
30
+ let label_3: string;
31
+ export { label_3 as label };
32
+ let defaultChecked_3: boolean;
33
+ export { defaultChecked_3 as defaultChecked };
34
+ export let busy: boolean;
35
+ export let onText: string;
36
+ }
37
+ export { args_3 as args };
38
+ }
39
+ export namespace CustomStateIcon {
40
+ export namespace args_4 {
41
+ let label_4: string;
42
+ export { label_4 as label };
43
+ export { EyeOff as stateIcon };
44
+ let onText_1: string;
45
+ export { onText_1 as onText };
46
+ export let offText: string;
47
+ }
48
+ export { args_4 as args };
49
+ }
50
+ export namespace NoLabel {
51
+ export namespace args_5 {
52
+ let label_5: any;
53
+ export { label_5 as label };
54
+ }
55
+ export { args_5 as args };
56
+ }
57
+ export namespace DisabledOff {
58
+ export namespace args_6 {
59
+ let label_6: string;
60
+ export { label_6 as label };
61
+ let defaultChecked_4: boolean;
62
+ export { defaultChecked_4 as defaultChecked };
63
+ let disabled_1: boolean;
64
+ export { disabled_1 as disabled };
65
+ }
66
+ export { args_6 as args };
67
+ }
68
+ export namespace Toggles {
69
+ function render(): any;
70
+ function play({ canvasElement }: {
71
+ canvasElement: any;
72
+ }): Promise<void>;
73
+ }
74
+ declare namespace meta {
75
+ export let title: string;
76
+ export { Switch as component };
77
+ export let tags: string[];
78
+ export let decorators: Function[];
79
+ export namespace argTypes {
80
+ export namespace checked {
81
+ let control: string;
82
+ }
83
+ export namespace defaultChecked_5 {
84
+ let control_1: string;
85
+ export { control_1 as control };
86
+ }
87
+ export { defaultChecked_5 as defaultChecked };
88
+ export namespace disabled_2 {
89
+ let control_2: string;
90
+ export { control_2 as control };
91
+ }
92
+ export { disabled_2 as disabled };
93
+ export namespace busy_1 {
94
+ let control_3: string;
95
+ export { control_3 as control };
96
+ }
97
+ export { busy_1 as busy };
98
+ export namespace label_7 {
99
+ let control_4: string;
100
+ export { control_4 as control };
101
+ }
102
+ export { label_7 as label };
103
+ export namespace onText_2 {
104
+ let control_5: string;
105
+ export { control_5 as control };
106
+ }
107
+ export { onText_2 as onText };
108
+ export namespace offText_1 {
109
+ let control_6: string;
110
+ export { control_6 as control };
111
+ }
112
+ export { offText_1 as offText };
113
+ export namespace onChange {
114
+ let action: string;
115
+ }
116
+ }
117
+ export namespace args_7 {
118
+ let label_8: string;
119
+ export { label_8 as label };
120
+ let defaultChecked_6: boolean;
121
+ export { defaultChecked_6 as defaultChecked };
122
+ let disabled_3: boolean;
123
+ export { disabled_3 as disabled };
124
+ let busy_2: boolean;
125
+ export { busy_2 as busy };
126
+ let onText_3: string;
127
+ export { onText_3 as onText };
128
+ let offText_2: string;
129
+ export { offText_2 as offText };
130
+ }
131
+ export { args_7 as args };
132
+ }
133
+ import { EyeOff } from 'lucide-react';
134
+ import Switch from './Switch.jsx';