@peasant-labs/fairtrade 0.0.1 → 0.0.3
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.
- package/dist/lib/base.css +54 -0
- package/dist/lib/components.css +2 -0
- package/dist/lib/fonts.css +28 -0
- package/dist/lib/icons.js +1 -0
- package/dist/lib/tokens.css +184 -0
- package/dist/lib/tokens.json +768 -0
- package/dist/lib/types/Accordion.d.ts +47 -0
- package/dist/lib/types/Avatar.d.ts +94 -0
- package/dist/lib/types/BrandMark.d.ts +25 -0
- package/dist/lib/types/Breadcrumb.d.ts +66 -0
- package/dist/lib/types/Button.d.ts +86 -0
- package/dist/lib/types/Card.d.ts +145 -0
- package/dist/lib/types/ChartBar.d.ts +51 -0
- package/dist/lib/types/ChartLine.d.ts +54 -0
- package/dist/lib/types/Checkbox.d.ts +132 -0
- package/dist/lib/types/Chip.d.ts +85 -0
- package/dist/lib/types/CliOnboard.d.ts +68 -0
- package/dist/lib/types/CommandPalette.d.ts +6 -0
- package/dist/lib/types/CommitGraph.d.ts +71 -0
- package/dist/lib/types/ConnectionState.d.ts +82 -0
- package/dist/lib/types/ConsentDialog.d.ts +97 -0
- package/dist/lib/types/DataTable.d.ts +116 -0
- package/dist/lib/types/DateRange.d.ts +242 -0
- package/dist/lib/types/Dialog.d.ts +9 -0
- package/dist/lib/types/DiffView.d.ts +39 -0
- package/dist/lib/types/EmptyState.d.ts +28 -0
- package/dist/lib/types/EvidenceCaption.d.ts +39 -0
- package/dist/lib/types/Explainer.d.ts +82 -0
- package/dist/lib/types/FacetRail.d.ts +13 -0
- package/dist/lib/types/Feedback.d.ts +222 -0
- package/dist/lib/types/GroupedMultiSelect.d.ts +67 -0
- package/dist/lib/types/Input.d.ts +158 -0
- package/dist/lib/types/Intensity.d.ts +55 -0
- package/dist/lib/types/MapCanvas.d.ts +89 -0
- package/dist/lib/types/Menu.d.ts +62 -0
- package/dist/lib/types/ModerationQueue.d.ts +135 -0
- package/dist/lib/types/Pager.d.ts +47 -0
- package/dist/lib/types/Pagination.d.ts +50 -0
- package/dist/lib/types/PolicySelect.d.ts +80 -0
- package/dist/lib/types/ProviderIcon.d.ts +84 -0
- package/dist/lib/types/RailShell.d.ts +199 -0
- package/dist/lib/types/Redaction.d.ts +53 -0
- package/dist/lib/types/RoleRoster.d.ts +97 -0
- package/dist/lib/types/SignIn.d.ts +78 -0
- package/dist/lib/types/Sparkline.d.ts +19 -0
- package/dist/lib/types/StatTiles.d.ts +118 -0
- package/dist/lib/types/StepWizard.d.ts +92 -0
- package/dist/lib/types/StepsWaterfall.d.ts +67 -0
- package/dist/lib/types/Switch.d.ts +63 -0
- package/dist/lib/types/Tabs.d.ts +48 -0
- package/dist/lib/types/TimeStrip.d.ts +12 -0
- package/dist/lib/types/Timeline.d.ts +192 -0
- package/dist/lib/types/ToastHost.d.ts +70 -0
- package/dist/lib/types/ToolRenderers.d.ts +24 -0
- package/dist/lib/types/Tooltip.d.ts +80 -0
- package/dist/lib/types/Tour.d.ts +37 -0
- package/dist/lib/types/TranscriptMarkers.d.ts +50 -0
- package/dist/lib/types/Treemap.d.ts +77 -0
- package/dist/lib/types/VisibilityControl.d.ts +54 -0
- package/dist/lib/types/chart-shared.d.ts +63 -0
- package/dist/lib/types/icons.d.ts +1 -0
- package/dist/lib/types/index.d.ts +55 -0
- package/dist/lib/types/transcript/CheckRow.d.ts +15 -0
- package/dist/lib/types/transcript/DiffEntryCard.d.ts +27 -0
- package/dist/lib/types/transcript/FilterSection.d.ts +11 -0
- package/dist/lib/types/transcript/FiltersRail.d.ts +41 -0
- package/dist/lib/types/transcript/LabelPopover.d.ts +14 -0
- package/dist/lib/types/transcript/Markdown.d.ts +7 -0
- package/dist/lib/types/transcript/OutlineRail.d.ts +13 -0
- package/dist/lib/types/transcript/Scorecard.d.ts +8 -0
- package/dist/lib/types/transcript/Scrubber.d.ts +17 -0
- package/dist/lib/types/transcript/TaskBody.d.ts +8 -0
- package/dist/lib/types/transcript/Thinking.d.ts +9 -0
- package/dist/lib/types/transcript/ToolBody.d.ts +8 -0
- package/dist/lib/types/transcript/ToolCall.d.ts +12 -0
- package/dist/lib/types/transcript/TranscriptViewer.d.ts +6 -0
- package/dist/lib/types/transcript/TurnCard.d.ts +31 -0
- package/dist/lib/types/transcript/ViewSwitch.d.ts +11 -0
- package/dist/lib/types/transcript/adapter.d.ts +90 -0
- package/dist/lib/types/transcript/adapter.parse.d.ts +75 -0
- package/dist/lib/types/transcript/analytics.d.ts +216 -0
- package/dist/lib/types/transcript/graph/GraphLegend.d.ts +49 -0
- package/dist/lib/types/transcript/graph/GraphSubagentBranch.d.ts +24 -0
- package/dist/lib/types/transcript/graph/GraphToolNode.d.ts +56 -0
- package/dist/lib/types/transcript/graph/GraphTurnNode.d.ts +76 -0
- package/dist/lib/types/transcript/graph/index.d.ts +10 -0
- package/dist/lib/types/transcript/index.d.ts +69 -0
- package/dist/lib/types/transcript/state-capabilities.d.ts +161 -0
- package/dist/lib/types/transcript/view-model.d.ts +563 -0
- package/dist/lib/types/transcript/wire-types.d.ts +325 -0
- package/dist/lib/ui.js +12693 -0
- package/package.json +11 -5
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} AccordionItem
|
|
3
|
+
* @property {string} id stable id for the item (used for the header/region aria wiring)
|
|
4
|
+
* @property {React.ReactNode} title the header's visible label (not force-lowercased)
|
|
5
|
+
* @property {React.ComponentType<any>} [icon] optional leading lucide icon component (e.g. icon={Boxes})
|
|
6
|
+
* @property {React.ReactNode} content the panel body, shown when the item is open
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Accordion - a stack of collapsible, hairline panels.
|
|
10
|
+
*
|
|
11
|
+
* Uncontrolled only (manages its own open set seeded from `defaultOpen`). With
|
|
12
|
+
* allowMultiple=false (default) opening one item closes the others; with
|
|
13
|
+
* allowMultiple=true any number may be open at once.
|
|
14
|
+
*
|
|
15
|
+
* @param {Object} props
|
|
16
|
+
* @param {AccordionItem[]} props.items the items to render (each needs a unique id)
|
|
17
|
+
* @param {string|string[]} [props.defaultOpen] id(s) open on mount; a lone string or an array.
|
|
18
|
+
* when allowMultiple is false only the first matching id is honoured (default: none open)
|
|
19
|
+
* @param {boolean} [props.allowMultiple=false] allow several items open simultaneously
|
|
20
|
+
* @param {number} [props.headingLevel=3] heading level (1-6) for each item header,
|
|
21
|
+
* so the accordion fits the surrounding document outline (default: h3)
|
|
22
|
+
* @param {string} [props['aria-label']] accessible name for the accordion group
|
|
23
|
+
*/
|
|
24
|
+
export default function Accordion({ items, defaultOpen, allowMultiple, headingLevel, "aria-label": ariaLabel }: {
|
|
25
|
+
items: AccordionItem[];
|
|
26
|
+
defaultOpen?: string | string[];
|
|
27
|
+
allowMultiple?: boolean;
|
|
28
|
+
headingLevel?: number;
|
|
29
|
+
}): any;
|
|
30
|
+
export type AccordionItem = {
|
|
31
|
+
/**
|
|
32
|
+
* stable id for the item (used for the header/region aria wiring)
|
|
33
|
+
*/
|
|
34
|
+
id: string;
|
|
35
|
+
/**
|
|
36
|
+
* the header's visible label (not force-lowercased)
|
|
37
|
+
*/
|
|
38
|
+
title: React.ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* optional leading lucide icon component (e.g. icon={Boxes})
|
|
41
|
+
*/
|
|
42
|
+
icon?: React.ComponentType<any>;
|
|
43
|
+
/**
|
|
44
|
+
* the panel body, shown when the item is open
|
|
45
|
+
*/
|
|
46
|
+
content: React.ReactNode;
|
|
47
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {'sm' | 'md' | 'lg'} AvatarSize
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* a single avatar tile: initials, or a photo with the initials as the fallback beneath it.
|
|
6
|
+
* the base .avatar is 18px (inline meta); size scales it up for standalone use.
|
|
7
|
+
*
|
|
8
|
+
* @param {object} props
|
|
9
|
+
* @param {string} props.name - the person's name; used as the accessible label and to derive initials when none are given.
|
|
10
|
+
* @param {string} [props.initials] - explicit initials to render; defaults to the first letters of `name`.
|
|
11
|
+
* @param {AvatarSize} [props.size] - one of 'sm' | 'md' | 'lg' (24 / 32 / 44px). omit for the bare 18px base.
|
|
12
|
+
* @param {string} [props.src] - optional photo url; when set the tile becomes an .av-img with the photo over the initials.
|
|
13
|
+
* @param {boolean} [props.more] - render the amber "+N overflow" tile (.av-more); `initials` carries the "+5" text.
|
|
14
|
+
* @param {string} [props.className] - extra class names appended after the avatar classes.
|
|
15
|
+
*/
|
|
16
|
+
export function Avatar({ name, initials, size, src, more, className, ...rest }: {
|
|
17
|
+
name: string;
|
|
18
|
+
initials?: string;
|
|
19
|
+
size?: AvatarSize;
|
|
20
|
+
src?: string;
|
|
21
|
+
more?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
}): any;
|
|
24
|
+
/**
|
|
25
|
+
* a stacked, overlapping run of avatars with an optional +N overflow tile.
|
|
26
|
+
* pass <Avatar> children directly; the .av-group nth-child rules handle overlap + z-order.
|
|
27
|
+
*
|
|
28
|
+
* @param {object} props
|
|
29
|
+
* @param {string} props.label - accessible name for the group (e.g. "9 contributors").
|
|
30
|
+
* @param {React.ReactNode} props.children - the <Avatar> tiles (include an `more` avatar last for overflow).
|
|
31
|
+
* @param {string} [props.className] - extra class names appended after .av-group.
|
|
32
|
+
*/
|
|
33
|
+
export function AvatarGroup({ label, children, className, ...rest }: {
|
|
34
|
+
label: string;
|
|
35
|
+
children: React.ReactNode;
|
|
36
|
+
className?: string;
|
|
37
|
+
}): any;
|
|
38
|
+
/**
|
|
39
|
+
* a real <kbd> styled as a single keyboard key. accepts text children or a lucide icon (e.g. icon={ArrowUp}).
|
|
40
|
+
* the CSS sizes the icon (.kbd-key .lucide), so render it plainly.
|
|
41
|
+
*
|
|
42
|
+
* @param {object} props
|
|
43
|
+
* @param {React.ComponentType} [props.icon] - a lucide icon component reference, rendered in place of text.
|
|
44
|
+
* @param {string} [props.label] - accessible name for an icon-only key (the glyph is aria-hidden, so a bare icon key would otherwise announce empty).
|
|
45
|
+
* @param {React.ReactNode} [props.children] - the key label (e.g. "esc", "enter", "K").
|
|
46
|
+
* @param {string} [props.className] - extra class names appended after .kbd-key.
|
|
47
|
+
*/
|
|
48
|
+
export function Kbd({ icon: Icon, label, children, className, ...rest }: {
|
|
49
|
+
icon?: React.ComponentType;
|
|
50
|
+
label?: string;
|
|
51
|
+
children?: React.ReactNode;
|
|
52
|
+
className?: string;
|
|
53
|
+
}): any;
|
|
54
|
+
/**
|
|
55
|
+
* a keyboard chord: several <Kbd> keys joined by a faint, aria-hidden "+" that is not itself a key.
|
|
56
|
+
* the spoken form lives in `label` (e.g. "command k"); the visible "+" is decorative.
|
|
57
|
+
*
|
|
58
|
+
* @param {object} props
|
|
59
|
+
* @param {string} props.label - the accessible spelling of the chord (e.g. "control shift p").
|
|
60
|
+
* @param {React.ReactNode} props.children - the <Kbd> keys to join.
|
|
61
|
+
* @param {string} [props.className] - extra class names appended after .kbd-chord.
|
|
62
|
+
*/
|
|
63
|
+
export function KbdChord({ label, children, className, ...rest }: {
|
|
64
|
+
label: string;
|
|
65
|
+
children: React.ReactNode;
|
|
66
|
+
className?: string;
|
|
67
|
+
}): any;
|
|
68
|
+
/**
|
|
69
|
+
* a tag / label token. may carry a leading swatch dot (color pairs with the word, never color alone),
|
|
70
|
+
* a leading lucide icon, a selected (amber) state, and an optional dismiss button.
|
|
71
|
+
*
|
|
72
|
+
* @param {object} props
|
|
73
|
+
* @param {React.ReactNode} props.children - the tag label (sentence/case passed in is preserved; chrome is lowercased by CSS).
|
|
74
|
+
* @param {string} [props.brand] - a provider/company name (claude, gemini, openai, cursor, opencode, or an alias).
|
|
75
|
+
* When the tag names a company, pass this instead of `icon`: it leads with the real brand mark, never a generic glyph.
|
|
76
|
+
* @param {React.ComponentType} [props.icon] - a lucide icon component reference rendered before the label (ignored when `brand` is set).
|
|
77
|
+
* @param {string} [props.dot] - a color value for the leading swatch dot (set as --tag-c).
|
|
78
|
+
* @param {boolean} [props.selected] - apply the amber .tag-on state.
|
|
79
|
+
* @param {() => void} [props.onRemove] - when set, render a real, labelled remove button (.tag-x).
|
|
80
|
+
* @param {string} [props.removeLabel] - accessible label for the remove button; falls back to "remove tag".
|
|
81
|
+
* @param {string} [props.className] - extra class names appended after .tag.
|
|
82
|
+
*/
|
|
83
|
+
export function Tag({ children, brand, icon: Icon, dot, selected, onRemove, removeLabel, className, ...rest }: {
|
|
84
|
+
children: React.ReactNode;
|
|
85
|
+
brand?: string;
|
|
86
|
+
icon?: React.ComponentType;
|
|
87
|
+
dot?: string;
|
|
88
|
+
selected?: boolean;
|
|
89
|
+
onRemove?: () => void;
|
|
90
|
+
removeLabel?: string;
|
|
91
|
+
className?: string;
|
|
92
|
+
}): any;
|
|
93
|
+
export default Avatar;
|
|
94
|
+
export type AvatarSize = "sm" | "md" | "lg";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* resolve any accepted name/alias to a canonical mark key, or null when unknown.
|
|
3
|
+
* @param {string} name
|
|
4
|
+
* @returns {('claude'|'gemini'|'openai'|'cursor'|'opencode')|null}
|
|
5
|
+
*/
|
|
6
|
+
export function resolveBrand(name: string): ("claude" | "gemini" | "openai" | "cursor" | "opencode") | null;
|
|
7
|
+
/**
|
|
8
|
+
* BrandMark - a single-color, currentColor-tinted company/provider logo.
|
|
9
|
+
*
|
|
10
|
+
* @param {object} props
|
|
11
|
+
* @param {'claude'|'gemini'|'openai'|'cursor'|'opencode'|'anthropic'|'google'|'codex'|string} props.name
|
|
12
|
+
* the company/product; aliases resolve (anthropic->claude, google->gemini, codex->openai).
|
|
13
|
+
* @param {number} [props.size] explicit px size; omit to inherit the contextual icon-token size
|
|
14
|
+
* from the `.brand` rules in src/index.css (so a mark in a chip/tag/button matches its neighbours).
|
|
15
|
+
* @param {string} [props.label] when set, the mark is INFORMATIVE: role="img" + this aria-label.
|
|
16
|
+
* omit when a visible text label already names the provider (the mark is then decorative).
|
|
17
|
+
* @param {string} [props.className] extra classes appended after `.brand`.
|
|
18
|
+
* @returns {JSX.Element|null} null when `name` does not resolve to a known mark.
|
|
19
|
+
*/
|
|
20
|
+
export default function BrandMark({ name, size, label, className, ...rest }: {
|
|
21
|
+
name: "claude" | "gemini" | "openai" | "cursor" | "opencode" | "anthropic" | "google" | "codex" | string;
|
|
22
|
+
size?: number;
|
|
23
|
+
label?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}): JSX.Element | null;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} CrumbItem
|
|
3
|
+
* @property {string} label - the crumb text
|
|
4
|
+
* @property {string} [href] - optional link target; when present the crumb renders as an <a>
|
|
5
|
+
* @property {React.ComponentType<{className?: string}>} [icon] - optional leading lucide icon component (e.g. icon={Folder})
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Breadcrumb — names the path back. Items are joined by ChevronRight separators;
|
|
9
|
+
* the last item is marked `.cur` (bold ink) as the current location.
|
|
10
|
+
*
|
|
11
|
+
* Emits `<nav><div class="crumb">…</div></nav>` matching src/index.css with zero new CSS.
|
|
12
|
+
*
|
|
13
|
+
* @param {Object} props
|
|
14
|
+
* @param {CrumbItem[]} props.items - ordered crumbs from root to current; the last is the current page.
|
|
15
|
+
* @param {string} [props.label='breadcrumb'] - aria-label for the nav landmark.
|
|
16
|
+
* @returns {JSX.Element}
|
|
17
|
+
*/
|
|
18
|
+
export default function Breadcrumb({ items, label }: {
|
|
19
|
+
items: CrumbItem[];
|
|
20
|
+
label?: string;
|
|
21
|
+
}): JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* @typedef {Object} StepItem
|
|
24
|
+
* @property {string} label - the step text
|
|
25
|
+
* @property {'done'|'cur'|'todo'} [status='todo'] - 'done' shows a Check, 'cur' is the active step, 'todo' shows its number.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Steps — a step wizard marking progress through a flow. Completed steps show a Check,
|
|
29
|
+
* the current step is highlighted (amber number), pending steps show their index.
|
|
30
|
+
* Steps are joined by `.step-line` dividers. State reads from icon/number, never color alone.
|
|
31
|
+
*
|
|
32
|
+
* Emits `<div class="steps">…</div>` matching src/index.css with zero new CSS.
|
|
33
|
+
*
|
|
34
|
+
* @param {Object} props
|
|
35
|
+
* @param {StepItem[]} props.steps - ordered steps; numbering is derived from position (1-based).
|
|
36
|
+
* @returns {JSX.Element}
|
|
37
|
+
*/
|
|
38
|
+
export function Steps({ steps }: {
|
|
39
|
+
steps: StepItem[];
|
|
40
|
+
}): JSX.Element;
|
|
41
|
+
export type CrumbItem = {
|
|
42
|
+
/**
|
|
43
|
+
* - the crumb text
|
|
44
|
+
*/
|
|
45
|
+
label: string;
|
|
46
|
+
/**
|
|
47
|
+
* - optional link target; when present the crumb renders as an <a>
|
|
48
|
+
*/
|
|
49
|
+
href?: string;
|
|
50
|
+
/**
|
|
51
|
+
* - optional leading lucide icon component (e.g. icon={Folder})
|
|
52
|
+
*/
|
|
53
|
+
icon?: React.ComponentType<{
|
|
54
|
+
className?: string;
|
|
55
|
+
}>;
|
|
56
|
+
};
|
|
57
|
+
export type StepItem = {
|
|
58
|
+
/**
|
|
59
|
+
* - the step text
|
|
60
|
+
*/
|
|
61
|
+
label: string;
|
|
62
|
+
/**
|
|
63
|
+
* - 'done' shows a Check, 'cur' is the active step, 'todo' shows its number.
|
|
64
|
+
*/
|
|
65
|
+
status?: "done" | "cur" | "todo";
|
|
66
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* a single control. icon-only when there are no text children (renders .btn-icon).
|
|
3
|
+
* loading swaps the leading icon for the .bs-spin ring and sets aria-busy; pressed turns it into a
|
|
4
|
+
* toggle (.bs-toggle + aria-pressed). renders as a <button> or, with as="a", a real <a>.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @param {ButtonVariant} [props.variant='secondary'] - visual treatment
|
|
8
|
+
* @param {ButtonSize} [props.size='md'] - md = 36px, sm = 28px (.btn-sm)
|
|
9
|
+
* @param {React.ElementType} [props.icon] - lucide component rendered before the label
|
|
10
|
+
* @param {React.ElementType} [props.iconRight] - lucide component rendered after the label
|
|
11
|
+
* @param {boolean} [props.loading=false] - shows the .bs-spin ring + aria-busy="true"
|
|
12
|
+
* @param {boolean} [props.disabled=false] - native disabled (button) / aria-disabled (anchor)
|
|
13
|
+
* @param {boolean} [props.pressed] - toggle button: when defined adds .bs-toggle + aria-pressed
|
|
14
|
+
* @param {'button'|'a'} [props.as='button'] - element to render
|
|
15
|
+
* @param {string} [props.className] - extra classes appended after the computed ones
|
|
16
|
+
* @param {React.ReactNode} [props.children] - the label; omit for an icon-only button (then aria-label is required so the control still has an accessible name)
|
|
17
|
+
*/
|
|
18
|
+
export default function Button({ variant, size, icon: Icon, iconRight: IconRight, loading, disabled, pressed, as, className, children, ...rest }: {
|
|
19
|
+
variant?: ButtonVariant;
|
|
20
|
+
size?: ButtonSize;
|
|
21
|
+
icon?: React.ElementType;
|
|
22
|
+
iconRight?: React.ElementType;
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
pressed?: boolean;
|
|
26
|
+
as?: "button" | "a";
|
|
27
|
+
className?: string;
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}): any;
|
|
30
|
+
/**
|
|
31
|
+
* groups a set of related buttons into one track with shared seams (.bs-group). pass real Button
|
|
32
|
+
* children. carries role="group"; give it an aria-label naming the action set.
|
|
33
|
+
*
|
|
34
|
+
* @param {object} props
|
|
35
|
+
* @param {string} [props.label] - aria-label for the group (recommended)
|
|
36
|
+
* @param {string} [props.className] - extra classes appended after .bs-group
|
|
37
|
+
* @param {React.ReactNode} props.children - the buttons in the group
|
|
38
|
+
*/
|
|
39
|
+
export function ButtonGroup({ label, className, children, ...rest }: {
|
|
40
|
+
label?: string;
|
|
41
|
+
className?: string;
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
}): any;
|
|
44
|
+
/**
|
|
45
|
+
* @typedef {object} SegmentedOption
|
|
46
|
+
* @property {string} value - the option's value, compared against the control's value
|
|
47
|
+
* @property {string} label - the option's lowercase label text
|
|
48
|
+
* @property {React.ElementType} [icon] - lucide component shown before the label
|
|
49
|
+
*/
|
|
50
|
+
/**
|
|
51
|
+
* a segmented control (.bs-seg): a single track of mutually-exclusive options. the selected option
|
|
52
|
+
* carries aria-pressed="true" and the amber fill, so the choice never rides on color alone.
|
|
53
|
+
* controlled (value + onChange) or uncontrolled (defaultValue).
|
|
54
|
+
*
|
|
55
|
+
* @param {object} props
|
|
56
|
+
* @param {SegmentedOption[]} props.options - the choices
|
|
57
|
+
* @param {string} [props.value] - controlled selected value
|
|
58
|
+
* @param {string} [props.defaultValue] - initial value when uncontrolled
|
|
59
|
+
* @param {(value: string) => void} [props.onChange] - called with the next value on select
|
|
60
|
+
* @param {string} [props.label] - aria-label for the group (recommended)
|
|
61
|
+
* @param {string} [props.className] - extra classes appended after .bs-seg
|
|
62
|
+
*/
|
|
63
|
+
export function Segmented({ options, value, defaultValue, onChange, label, className, ...rest }: {
|
|
64
|
+
options: SegmentedOption[];
|
|
65
|
+
value?: string;
|
|
66
|
+
defaultValue?: string;
|
|
67
|
+
onChange?: (value: string) => void;
|
|
68
|
+
label?: string;
|
|
69
|
+
className?: string;
|
|
70
|
+
}): any;
|
|
71
|
+
export type SegmentedOption = {
|
|
72
|
+
/**
|
|
73
|
+
* - the option's value, compared against the control's value
|
|
74
|
+
*/
|
|
75
|
+
value: string;
|
|
76
|
+
/**
|
|
77
|
+
* - the option's lowercase label text
|
|
78
|
+
*/
|
|
79
|
+
label: string;
|
|
80
|
+
/**
|
|
81
|
+
* - lucide component shown before the label
|
|
82
|
+
*/
|
|
83
|
+
icon?: React.ElementType;
|
|
84
|
+
};
|
|
85
|
+
export type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";
|
|
86
|
+
export type ButtonSize = "md" | "sm";
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} CardProps
|
|
3
|
+
* @property {React.ReactNode} [children] - card contents (slotted, e.g. a <CardImg/> or arbitrary markup).
|
|
4
|
+
* @property {boolean} [link=false] - render the card as an <a> (one big target) instead of a <div>.
|
|
5
|
+
* @property {string} [className] - extra classes appended after the base `card`.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Base card surface. Pass `link` to render as an <a> (the ref-01 cards are a single anchor target).
|
|
9
|
+
* Slot content via children, or compose with <CardImg/> for the imagery-on-top variant.
|
|
10
|
+
* @param {CardProps & React.HTMLAttributes<HTMLElement>} props
|
|
11
|
+
*/
|
|
12
|
+
export default function Card({ children, link, className, ...rest }: CardProps & React.HTMLAttributes<HTMLElement>): any;
|
|
13
|
+
/**
|
|
14
|
+
* @typedef {Object} CardImgProps
|
|
15
|
+
* @property {React.ReactNode} [thumb] - decorative imagery rendered inside `.card-thumb` (e.g. an <AsciiImage/>).
|
|
16
|
+
* @property {React.ReactNode} [head] - the `.card-head` row. When it names a provider it MUST lead with the real brand mark via <BrandMark name="claude" /> (a label beside a visible name is decorative), never a generic glyph. A trailing icon may follow as a meta indicator.
|
|
17
|
+
* @property {React.ReactNode} [title] - the card title; rendered inside an <h3> when provided.
|
|
18
|
+
* @property {React.ReactNode} [desc] - the short summary; rendered inside `<p class="desc">` when provided.
|
|
19
|
+
* @property {React.ReactNode[]} [bullets] - bullet metadata; rendered as `<ul class="bullets"><li>…`.
|
|
20
|
+
* @property {React.ReactNode} [foot] - the `.card-foot` row (avatar + tabular metaitems).
|
|
21
|
+
* @property {boolean} [link=true] - render as an <a> (the whole card is one target); set false for a <div>.
|
|
22
|
+
* @property {string} [className] - extra classes appended after `card card-img`.
|
|
23
|
+
* @property {React.ReactNode} [children] - extra body content appended after the slots, if any.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Imagery-on-top card: `.card.card-img` with a `.card-thumb` slot and a `.card-body` carrying the
|
|
27
|
+
* head, title, desc, bullets and foot. Provide imagery via `thumb` (decorative — caller passes the
|
|
28
|
+
* already-aria-hidden specimen, e.g. <AsciiImage/>). All text slots are optional.
|
|
29
|
+
* @param {CardImgProps & React.HTMLAttributes<HTMLElement>} props
|
|
30
|
+
*/
|
|
31
|
+
export function CardImg({ thumb, head, title, desc, bullets, foot, link, className, children, ...rest }: CardImgProps & React.HTMLAttributes<HTMLElement>): any;
|
|
32
|
+
/**
|
|
33
|
+
* @typedef {Object} RowProps
|
|
34
|
+
* @property {React.ReactNode} [children] - row contents: metaitems, a `.grow` label, an avatar, etc.
|
|
35
|
+
* @property {boolean} [link=false] - render the row as an <a> (a focusable, navigable target). Only an interactive row shows the hover affordance; a plain row stays static.
|
|
36
|
+
* @property {string} [className] - extra classes appended after the base `row`.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Compact dense-list row. The base `.row` styles the surface and border; stacked rows collapse
|
|
40
|
+
* their shared border automatically (`.row + .row`). Use a child with the `grow` class for the
|
|
41
|
+
* flexible label column. Pass `link` (with an href) when the row is navigable so it becomes a
|
|
42
|
+
* focusable <a> that earns its hover affordance and the global focus ring; a plain row is static.
|
|
43
|
+
* @param {RowProps & React.HTMLAttributes<HTMLElement>} props
|
|
44
|
+
*/
|
|
45
|
+
export function Row({ children, link, className, ...rest }: RowProps & React.HTMLAttributes<HTMLElement>): any;
|
|
46
|
+
/**
|
|
47
|
+
* @typedef {Object} MetaItemProps
|
|
48
|
+
* @property {React.ComponentType<{ size?: number }>} [icon] - leading icon component reference (e.g. icon={Clock}). Icon size is owned by the `.metaitem .lucide` token rule (`--ic-sm`); it is not configurable per-instance.
|
|
49
|
+
* @property {React.ReactNode} [value] - emphasised tabular value, rendered as `<b class="tnum">` before the children.
|
|
50
|
+
* @property {React.ReactNode} [children] - the trailing label / units.
|
|
51
|
+
* @property {string} [className] - extra classes appended after the base `metaitem` (e.g. `mono`).
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* A single piece of card / row metadata: an optional leading icon, an optional bold tabular value and a
|
|
55
|
+
* label. The icon and a `<b>` value pick up `.metaitem` styling (icon sized via `--ic-sm`, `<b>` tinted).
|
|
56
|
+
* Decorative icon gets aria-hidden. Pass `value` for counts/durations so they render in the tnum face.
|
|
57
|
+
* @param {MetaItemProps & React.HTMLAttributes<HTMLSpanElement>} props
|
|
58
|
+
*/
|
|
59
|
+
export function MetaItem({ icon: Icon, value, children, className, ...rest }: MetaItemProps & React.HTMLAttributes<HTMLSpanElement>): any;
|
|
60
|
+
export type CardProps = {
|
|
61
|
+
/**
|
|
62
|
+
* - card contents (slotted, e.g. a <CardImg/> or arbitrary markup).
|
|
63
|
+
*/
|
|
64
|
+
children?: React.ReactNode;
|
|
65
|
+
/**
|
|
66
|
+
* - render the card as an <a> (one big target) instead of a <div>.
|
|
67
|
+
*/
|
|
68
|
+
link?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* - extra classes appended after the base `card`.
|
|
71
|
+
*/
|
|
72
|
+
className?: string;
|
|
73
|
+
};
|
|
74
|
+
export type CardImgProps = {
|
|
75
|
+
/**
|
|
76
|
+
* - decorative imagery rendered inside `.card-thumb` (e.g. an <AsciiImage/>).
|
|
77
|
+
*/
|
|
78
|
+
thumb?: React.ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* - the `.card-head` row. When it names a provider it MUST lead with the real brand mark via <BrandMark name="claude" /> (a label beside a visible name is decorative), never a generic glyph. A trailing icon may follow as a meta indicator.
|
|
81
|
+
*/
|
|
82
|
+
head?: React.ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
* - the card title; rendered inside an <h3> when provided.
|
|
85
|
+
*/
|
|
86
|
+
title?: React.ReactNode;
|
|
87
|
+
/**
|
|
88
|
+
* - the short summary; rendered inside `<p class="desc">` when provided.
|
|
89
|
+
*/
|
|
90
|
+
desc?: React.ReactNode;
|
|
91
|
+
/**
|
|
92
|
+
* - bullet metadata; rendered as `<ul class="bullets"><li>…`.
|
|
93
|
+
*/
|
|
94
|
+
bullets?: React.ReactNode[];
|
|
95
|
+
/**
|
|
96
|
+
* - the `.card-foot` row (avatar + tabular metaitems).
|
|
97
|
+
*/
|
|
98
|
+
foot?: React.ReactNode;
|
|
99
|
+
/**
|
|
100
|
+
* - render as an <a> (the whole card is one target); set false for a <div>.
|
|
101
|
+
*/
|
|
102
|
+
link?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* - extra classes appended after `card card-img`.
|
|
105
|
+
*/
|
|
106
|
+
className?: string;
|
|
107
|
+
/**
|
|
108
|
+
* - extra body content appended after the slots, if any.
|
|
109
|
+
*/
|
|
110
|
+
children?: React.ReactNode;
|
|
111
|
+
};
|
|
112
|
+
export type RowProps = {
|
|
113
|
+
/**
|
|
114
|
+
* - row contents: metaitems, a `.grow` label, an avatar, etc.
|
|
115
|
+
*/
|
|
116
|
+
children?: React.ReactNode;
|
|
117
|
+
/**
|
|
118
|
+
* - render the row as an <a> (a focusable, navigable target). Only an interactive row shows the hover affordance; a plain row stays static.
|
|
119
|
+
*/
|
|
120
|
+
link?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* - extra classes appended after the base `row`.
|
|
123
|
+
*/
|
|
124
|
+
className?: string;
|
|
125
|
+
};
|
|
126
|
+
export type MetaItemProps = {
|
|
127
|
+
/**
|
|
128
|
+
* - leading icon component reference (e.g. icon={Clock}). Icon size is owned by the `.metaitem .lucide` token rule (`--ic-sm`); it is not configurable per-instance.
|
|
129
|
+
*/
|
|
130
|
+
icon?: React.ComponentType<{
|
|
131
|
+
size?: number;
|
|
132
|
+
}>;
|
|
133
|
+
/**
|
|
134
|
+
* - emphasised tabular value, rendered as `<b class="tnum">` before the children.
|
|
135
|
+
*/
|
|
136
|
+
value?: React.ReactNode;
|
|
137
|
+
/**
|
|
138
|
+
* - the trailing label / units.
|
|
139
|
+
*/
|
|
140
|
+
children?: React.ReactNode;
|
|
141
|
+
/**
|
|
142
|
+
* - extra classes appended after the base `metaitem` (e.g. `mono`).
|
|
143
|
+
*/
|
|
144
|
+
className?: string;
|
|
145
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} BarSeries
|
|
3
|
+
* @property {string} key the data key this series reads from each row.
|
|
4
|
+
* @property {string} [name] legend/tooltip label (defaults to key); lowercased by css.
|
|
5
|
+
* @property {'teal'|'olive'|'clay'|'mauve'|'amber'|1|2|3|4} [color] series colour; defaults along the earth ramp.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @param {Object} props
|
|
9
|
+
* @param {Object[]} props.data row objects.
|
|
10
|
+
* @param {string} props.xKey the category key on the x axis.
|
|
11
|
+
* @param {BarSeries[]} props.series one or more bar series.
|
|
12
|
+
* @param {boolean} [props.stacked=false] stack series instead of grouping them.
|
|
13
|
+
* @param {React.ComponentType} [props.icon] a lucide icon for the head.
|
|
14
|
+
* @param {React.ReactNode} [props.title] chart title (lowercase chrome).
|
|
15
|
+
* @param {React.ReactNode} [props.aside] a tabular summary shown at the head's right.
|
|
16
|
+
* @param {React.ReactNode} [props.sub] a sub line under the head.
|
|
17
|
+
* @param {number} [props.height=200] plot height in px.
|
|
18
|
+
* @param {number[]} [props.yTicks] explicit y ticks; omit to auto-pick integers.
|
|
19
|
+
* @param {(v:any)=>React.ReactNode} [props.xFormatter] format x tick + tooltip label.
|
|
20
|
+
* @param {(v:any)=>React.ReactNode} [props.valueFormatter] format the tooltip value.
|
|
21
|
+
* @param {string} [props.className] extra class on the chart frame.
|
|
22
|
+
*/
|
|
23
|
+
export default function ChartBar({ data, xKey, series, stacked, icon, title, aside, sub, height, yTicks, xFormatter, valueFormatter, className, }: {
|
|
24
|
+
data: any[];
|
|
25
|
+
xKey: string;
|
|
26
|
+
series: BarSeries[];
|
|
27
|
+
stacked?: boolean;
|
|
28
|
+
icon?: React.ComponentType;
|
|
29
|
+
title?: React.ReactNode;
|
|
30
|
+
aside?: React.ReactNode;
|
|
31
|
+
sub?: React.ReactNode;
|
|
32
|
+
height?: number;
|
|
33
|
+
yTicks?: number[];
|
|
34
|
+
xFormatter?: (v: any) => React.ReactNode;
|
|
35
|
+
valueFormatter?: (v: any) => React.ReactNode;
|
|
36
|
+
className?: string;
|
|
37
|
+
}): any;
|
|
38
|
+
export type BarSeries = {
|
|
39
|
+
/**
|
|
40
|
+
* the data key this series reads from each row.
|
|
41
|
+
*/
|
|
42
|
+
key: string;
|
|
43
|
+
/**
|
|
44
|
+
* legend/tooltip label (defaults to key); lowercased by css.
|
|
45
|
+
*/
|
|
46
|
+
name?: string;
|
|
47
|
+
/**
|
|
48
|
+
* series colour; defaults along the earth ramp.
|
|
49
|
+
*/
|
|
50
|
+
color?: "teal" | "olive" | "clay" | "mauve" | "amber" | 1 | 2 | 3 | 4;
|
|
51
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} LineSeries
|
|
3
|
+
* @property {string} key data key.
|
|
4
|
+
* @property {string} [name] legend/tooltip label (defaults to key).
|
|
5
|
+
* @property {'teal'|'olive'|'clay'|'mauve'|'amber'|1|2|3|4} [color] series colour; defaults along the earth ramp.
|
|
6
|
+
* @property {boolean} [area] fill the region under the line.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @param {Object} props
|
|
10
|
+
* @param {Object[]} props.data row objects.
|
|
11
|
+
* @param {string} props.xKey the x-axis key.
|
|
12
|
+
* @param {LineSeries[]} props.series one or more line/area series.
|
|
13
|
+
* @param {React.ComponentType} [props.icon] a lucide icon for the head.
|
|
14
|
+
* @param {React.ReactNode} [props.title] chart title (lowercase chrome).
|
|
15
|
+
* @param {React.ReactNode} [props.aside] a tabular summary at the head's right.
|
|
16
|
+
* @param {React.ReactNode} [props.sub] a sub line under the head.
|
|
17
|
+
* @param {number} [props.height=200] plot height in px.
|
|
18
|
+
* @param {number[]} [props.yTicks] explicit y ticks; omit to auto-pick integers.
|
|
19
|
+
* @param {(v:any)=>React.ReactNode} [props.xFormatter] format x tick + tooltip label.
|
|
20
|
+
* @param {(v:any)=>React.ReactNode} [props.valueFormatter] format the tooltip value.
|
|
21
|
+
* @param {string} [props.className] extra class on the chart frame.
|
|
22
|
+
*/
|
|
23
|
+
export default function ChartLine({ data, xKey, series, icon, title, aside, sub, height, yTicks, xFormatter, valueFormatter, className, }: {
|
|
24
|
+
data: any[];
|
|
25
|
+
xKey: string;
|
|
26
|
+
series: LineSeries[];
|
|
27
|
+
icon?: React.ComponentType;
|
|
28
|
+
title?: React.ReactNode;
|
|
29
|
+
aside?: React.ReactNode;
|
|
30
|
+
sub?: React.ReactNode;
|
|
31
|
+
height?: number;
|
|
32
|
+
yTicks?: number[];
|
|
33
|
+
xFormatter?: (v: any) => React.ReactNode;
|
|
34
|
+
valueFormatter?: (v: any) => React.ReactNode;
|
|
35
|
+
className?: string;
|
|
36
|
+
}): any;
|
|
37
|
+
export type LineSeries = {
|
|
38
|
+
/**
|
|
39
|
+
* data key.
|
|
40
|
+
*/
|
|
41
|
+
key: string;
|
|
42
|
+
/**
|
|
43
|
+
* legend/tooltip label (defaults to key).
|
|
44
|
+
*/
|
|
45
|
+
name?: string;
|
|
46
|
+
/**
|
|
47
|
+
* series colour; defaults along the earth ramp.
|
|
48
|
+
*/
|
|
49
|
+
color?: "teal" | "olive" | "clay" | "mauve" | "amber" | 1 | 2 | 3 | 4;
|
|
50
|
+
/**
|
|
51
|
+
* fill the region under the line.
|
|
52
|
+
*/
|
|
53
|
+
area?: boolean;
|
|
54
|
+
};
|