@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,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* formatRange({from,to}) -> a lowercase, tabular display string.
|
|
3
|
+
* {from:'2026-06-01', to:'2026-06-14'} -> "jun 1 – jun 14, 2026"
|
|
4
|
+
* same month is collapsed; a single day drops the dash; an open value returns "".
|
|
5
|
+
* @param {{from:string|null,to:string|null}} value
|
|
6
|
+
* @param {{long?:boolean}} [opts] long=true spells the month ("june" not "jun")
|
|
7
|
+
*/
|
|
8
|
+
export function formatRange(value: {
|
|
9
|
+
from: string | null;
|
|
10
|
+
to: string | null;
|
|
11
|
+
}, opts?: {
|
|
12
|
+
long?: boolean;
|
|
13
|
+
}): string;
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {Object} CalendarProps
|
|
16
|
+
* @property {{from:string|null,to:string|null}} [value] controlled ISO range
|
|
17
|
+
* @property {{from:string|null,to:string|null}} [defaultValue] uncontrolled seed
|
|
18
|
+
* @property {(v:{from:string|null,to:string|null}) => void} [onChange] fires on a committed range
|
|
19
|
+
* @property {(v:{from:string|null,to:string|null}) => void} [onDraftChange] fires on each in-grid change before commit
|
|
20
|
+
* @property {string} [min] ISO lower bound (inclusive); out-of-range days are aria-disabled
|
|
21
|
+
* @property {string} [max] ISO upper bound (inclusive)
|
|
22
|
+
* @property {1|2} [numberOfMonths] months shown side by side (collapses to 1 under ~560px via container query)
|
|
23
|
+
* @property {0|1|2|3|4|5|6} [weekStartsOn] first column weekday (1 = monday, ISO default)
|
|
24
|
+
* @property {string} [className] extra classes on the .dr-cal wrapper (e.g. "is-static" for embeds)
|
|
25
|
+
* @property {(focusedISO:string) => void} [onAutoFocus] internal: notified when the grid focuses a day
|
|
26
|
+
* @property {boolean} [autoFocus] move DOM focus into the focused day on mount
|
|
27
|
+
*/
|
|
28
|
+
export function DateRangeCalendar({ value, defaultValue, onChange, onDraftChange, min, max, numberOfMonths, weekStartsOn, className, autoFocus, gridLabelId, }: {
|
|
29
|
+
value: any;
|
|
30
|
+
defaultValue?: {
|
|
31
|
+
from: any;
|
|
32
|
+
to: any;
|
|
33
|
+
};
|
|
34
|
+
onChange: any;
|
|
35
|
+
onDraftChange: any;
|
|
36
|
+
min: any;
|
|
37
|
+
max: any;
|
|
38
|
+
numberOfMonths?: number;
|
|
39
|
+
weekStartsOn?: number;
|
|
40
|
+
className?: string;
|
|
41
|
+
autoFocus?: boolean;
|
|
42
|
+
gridLabelId: any;
|
|
43
|
+
}): any;
|
|
44
|
+
/**
|
|
45
|
+
* @typedef {Object} DateRangeProps
|
|
46
|
+
* @property {{from:string|null,to:string|null}} [value] controlled ISO range
|
|
47
|
+
* @property {{from:string|null,to:string|null}} [defaultValue] uncontrolled seed
|
|
48
|
+
* @property {(v:{from:string|null,to:string|null}) => void} [onChange] fires only on a committed range / preset / clear
|
|
49
|
+
* @property {(v:{from:string|null,to:string|null}) => void} [onDraftChange] fires on each in-popover change before commit
|
|
50
|
+
* @property {{id:string,label:string,range:() => ({from:string,to:string})}[]} [presets] quick ranges; [] hides the rail
|
|
51
|
+
* @property {string} [min] ISO lower bound (inclusive)
|
|
52
|
+
* @property {string} [max] ISO upper bound (inclusive)
|
|
53
|
+
* @property {1|2} [numberOfMonths] desktop month count (auto-collapses to 1 under ~560px)
|
|
54
|
+
* @property {0|1|2|3|4|5|6} [weekStartsOn] first column weekday (1 = monday)
|
|
55
|
+
* @property {string} [placeholder] trigger label when empty (lowercase chrome)
|
|
56
|
+
* @property {string} [label] optional .label rendered above (form use)
|
|
57
|
+
* @property {'start'|'end'} [align] which trigger edge the popover aligns to
|
|
58
|
+
* @property {'md'|'sm'} [size] trigger height (36 / 28px)
|
|
59
|
+
* @property {boolean} [disabled]
|
|
60
|
+
* @property {boolean} [clearable] show a clear (X) action in the footer when a range is set
|
|
61
|
+
* @property {string} [id] trigger id; popover id derives `${id}-pop`
|
|
62
|
+
*/
|
|
63
|
+
export default function DateRange({ value, defaultValue, onChange, onDraftChange, presets, min, max, numberOfMonths, weekStartsOn, placeholder, label, align, size, disabled, clearable, id, }: {
|
|
64
|
+
value: any;
|
|
65
|
+
defaultValue?: {
|
|
66
|
+
from: any;
|
|
67
|
+
to: any;
|
|
68
|
+
};
|
|
69
|
+
onChange: any;
|
|
70
|
+
onDraftChange: any;
|
|
71
|
+
presets?: {
|
|
72
|
+
id: string;
|
|
73
|
+
label: string;
|
|
74
|
+
range: () => {
|
|
75
|
+
from: any;
|
|
76
|
+
to: any;
|
|
77
|
+
};
|
|
78
|
+
}[];
|
|
79
|
+
min: any;
|
|
80
|
+
max: any;
|
|
81
|
+
numberOfMonths?: number;
|
|
82
|
+
weekStartsOn?: number;
|
|
83
|
+
placeholder?: string;
|
|
84
|
+
label: any;
|
|
85
|
+
align?: string;
|
|
86
|
+
size?: string;
|
|
87
|
+
disabled?: boolean;
|
|
88
|
+
clearable?: boolean;
|
|
89
|
+
id: any;
|
|
90
|
+
}): any;
|
|
91
|
+
/**
|
|
92
|
+
* DATE_PRESETS - the default quick-range list. each `range()` is evaluated at open time
|
|
93
|
+
* against today's local date, so "last 7 days" always tracks the real calendar.
|
|
94
|
+
*/
|
|
95
|
+
export const DATE_PRESETS: {
|
|
96
|
+
id: string;
|
|
97
|
+
label: string;
|
|
98
|
+
range: () => {
|
|
99
|
+
from: any;
|
|
100
|
+
to: any;
|
|
101
|
+
};
|
|
102
|
+
}[];
|
|
103
|
+
export type CalendarProps = {
|
|
104
|
+
/**
|
|
105
|
+
* controlled ISO range
|
|
106
|
+
*/
|
|
107
|
+
value?: {
|
|
108
|
+
from: string | null;
|
|
109
|
+
to: string | null;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* uncontrolled seed
|
|
113
|
+
*/
|
|
114
|
+
defaultValue?: {
|
|
115
|
+
from: string | null;
|
|
116
|
+
to: string | null;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* fires on a committed range
|
|
120
|
+
*/
|
|
121
|
+
onChange?: (v: {
|
|
122
|
+
from: string | null;
|
|
123
|
+
to: string | null;
|
|
124
|
+
}) => void;
|
|
125
|
+
/**
|
|
126
|
+
* fires on each in-grid change before commit
|
|
127
|
+
*/
|
|
128
|
+
onDraftChange?: (v: {
|
|
129
|
+
from: string | null;
|
|
130
|
+
to: string | null;
|
|
131
|
+
}) => void;
|
|
132
|
+
/**
|
|
133
|
+
* ISO lower bound (inclusive); out-of-range days are aria-disabled
|
|
134
|
+
*/
|
|
135
|
+
min?: string;
|
|
136
|
+
/**
|
|
137
|
+
* ISO upper bound (inclusive)
|
|
138
|
+
*/
|
|
139
|
+
max?: string;
|
|
140
|
+
/**
|
|
141
|
+
* months shown side by side (collapses to 1 under ~560px via container query)
|
|
142
|
+
*/
|
|
143
|
+
numberOfMonths?: 1 | 2;
|
|
144
|
+
/**
|
|
145
|
+
* first column weekday (1 = monday, ISO default)
|
|
146
|
+
*/
|
|
147
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
148
|
+
/**
|
|
149
|
+
* extra classes on the .dr-cal wrapper (e.g. "is-static" for embeds)
|
|
150
|
+
*/
|
|
151
|
+
className?: string;
|
|
152
|
+
/**
|
|
153
|
+
* internal: notified when the grid focuses a day
|
|
154
|
+
*/
|
|
155
|
+
onAutoFocus?: (focusedISO: string) => void;
|
|
156
|
+
/**
|
|
157
|
+
* move DOM focus into the focused day on mount
|
|
158
|
+
*/
|
|
159
|
+
autoFocus?: boolean;
|
|
160
|
+
};
|
|
161
|
+
export type DateRangeProps = {
|
|
162
|
+
/**
|
|
163
|
+
* controlled ISO range
|
|
164
|
+
*/
|
|
165
|
+
value?: {
|
|
166
|
+
from: string | null;
|
|
167
|
+
to: string | null;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* uncontrolled seed
|
|
171
|
+
*/
|
|
172
|
+
defaultValue?: {
|
|
173
|
+
from: string | null;
|
|
174
|
+
to: string | null;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* fires only on a committed range / preset / clear
|
|
178
|
+
*/
|
|
179
|
+
onChange?: (v: {
|
|
180
|
+
from: string | null;
|
|
181
|
+
to: string | null;
|
|
182
|
+
}) => void;
|
|
183
|
+
/**
|
|
184
|
+
* fires on each in-popover change before commit
|
|
185
|
+
*/
|
|
186
|
+
onDraftChange?: (v: {
|
|
187
|
+
from: string | null;
|
|
188
|
+
to: string | null;
|
|
189
|
+
}) => void;
|
|
190
|
+
/**
|
|
191
|
+
* quick ranges; [] hides the rail
|
|
192
|
+
*/
|
|
193
|
+
presets?: {
|
|
194
|
+
id: string;
|
|
195
|
+
label: string;
|
|
196
|
+
range: () => ({
|
|
197
|
+
from: string;
|
|
198
|
+
to: string;
|
|
199
|
+
});
|
|
200
|
+
}[];
|
|
201
|
+
/**
|
|
202
|
+
* ISO lower bound (inclusive)
|
|
203
|
+
*/
|
|
204
|
+
min?: string;
|
|
205
|
+
/**
|
|
206
|
+
* ISO upper bound (inclusive)
|
|
207
|
+
*/
|
|
208
|
+
max?: string;
|
|
209
|
+
/**
|
|
210
|
+
* desktop month count (auto-collapses to 1 under ~560px)
|
|
211
|
+
*/
|
|
212
|
+
numberOfMonths?: 1 | 2;
|
|
213
|
+
/**
|
|
214
|
+
* first column weekday (1 = monday)
|
|
215
|
+
*/
|
|
216
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
217
|
+
/**
|
|
218
|
+
* trigger label when empty (lowercase chrome)
|
|
219
|
+
*/
|
|
220
|
+
placeholder?: string;
|
|
221
|
+
/**
|
|
222
|
+
* optional .label rendered above (form use)
|
|
223
|
+
*/
|
|
224
|
+
label?: string;
|
|
225
|
+
/**
|
|
226
|
+
* which trigger edge the popover aligns to
|
|
227
|
+
*/
|
|
228
|
+
align?: "start" | "end";
|
|
229
|
+
/**
|
|
230
|
+
* trigger height (36 / 28px)
|
|
231
|
+
*/
|
|
232
|
+
size?: "md" | "sm";
|
|
233
|
+
disabled?: boolean;
|
|
234
|
+
/**
|
|
235
|
+
* show a clear (X) action in the footer when a range is set
|
|
236
|
+
*/
|
|
237
|
+
clearable?: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* trigger id; popover id derives `${id}-pop`
|
|
240
|
+
*/
|
|
241
|
+
id?: string;
|
|
242
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiffView — a unified hunk diff. two shapes, one chassis:
|
|
3
|
+
*
|
|
4
|
+
* default: pass `hunks` = [{ header, lines: [{ type:'add'|'del'|'ctx', oldNo, newNo, text }] }].
|
|
5
|
+
* renders a file header (path + +N/−N churn) then each hunk's `@@` row and lines.
|
|
6
|
+
*
|
|
7
|
+
* redaction: variant="redaction", pass `matches` = [{ category, confidence, original,
|
|
8
|
+
* replacement, oldNo, newNo }]. each match is a del→add pair with a category·
|
|
9
|
+
* confidence badge and a per-match keep/revert button.
|
|
10
|
+
*
|
|
11
|
+
* @param {object} props
|
|
12
|
+
* @param {string} props.file - the file path shown in the header (mono, not lowercased)
|
|
13
|
+
* @param {Array<{header?:string, lines:Array<{type:'add'|'del'|'ctx', oldNo?:number|string, newNo?:number|string, text:string}>}>} [props.hunks] - structured hunks (default variant)
|
|
14
|
+
* @param {Array<{category:string, confidence:number, original:string, replacement:string, oldNo?:number|string, newNo?:number|string}>} [props.matches] - redaction matches (redaction variant)
|
|
15
|
+
* @param {'default'|'redaction'} [props.variant='default']
|
|
16
|
+
* @param {string} [props.className]
|
|
17
|
+
*/
|
|
18
|
+
export default function DiffView({ file, hunks, matches, variant, className, ...rest }: {
|
|
19
|
+
file: string;
|
|
20
|
+
hunks?: Array<{
|
|
21
|
+
header?: string;
|
|
22
|
+
lines: Array<{
|
|
23
|
+
type: "add" | "del" | "ctx";
|
|
24
|
+
oldNo?: number | string;
|
|
25
|
+
newNo?: number | string;
|
|
26
|
+
text: string;
|
|
27
|
+
}>;
|
|
28
|
+
}>;
|
|
29
|
+
matches?: Array<{
|
|
30
|
+
category: string;
|
|
31
|
+
confidence: number;
|
|
32
|
+
original: string;
|
|
33
|
+
replacement: string;
|
|
34
|
+
oldNo?: number | string;
|
|
35
|
+
newNo?: number | string;
|
|
36
|
+
}>;
|
|
37
|
+
variant?: "default" | "redaction";
|
|
38
|
+
className?: string;
|
|
39
|
+
}): any;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('react').ReactNode} ReactNode
|
|
3
|
+
* @typedef {import('react').ComponentType<{ size?: number, 'aria-hidden'?: boolean }>} IconComponent
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* EmptyState — left-aligned empty/zero-state block: a ringed icon, title,
|
|
7
|
+
* message, and an optional action slot. Emits the exact `.empty` markup the
|
|
8
|
+
* existing `src/index.css` styles (left-aligned by design).
|
|
9
|
+
*
|
|
10
|
+
* @param {object} props
|
|
11
|
+
* @param {IconComponent} [props.icon] - lucide-react icon component reference (e.g. `Compass`); rendered decoratively inside the `.ring`. The CSS sizes `.ring .lucide` to --ic-lg (18px).
|
|
12
|
+
* @param {ReactNode} props.title - short heading, rendered by the `as` element (default `h3`).
|
|
13
|
+
* @param {ReactNode} [props.message] - supporting copy, rendered in `p`. Omitted if not provided.
|
|
14
|
+
* @param {ReactNode} [props.action] - optional action slot (e.g. a button). Takes precedence over `children`.
|
|
15
|
+
* @param {ReactNode} [props.children] - fallback action slot, used only when `action` is not provided.
|
|
16
|
+
* @param {keyof JSX.IntrinsicElements} [props.as='h3'] - heading element/level for the title, so the component can fit the surrounding heading outline (e.g. `h2`).
|
|
17
|
+
* @returns {JSX.Element}
|
|
18
|
+
*/
|
|
19
|
+
export default function EmptyState({ icon: Icon, title, message, action, children, as: Heading }: {
|
|
20
|
+
icon?: IconComponent;
|
|
21
|
+
title: ReactNode;
|
|
22
|
+
message?: ReactNode;
|
|
23
|
+
action?: ReactNode;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
as?: keyof JSX.IntrinsicElements;
|
|
26
|
+
}): JSX.Element;
|
|
27
|
+
export type ReactNode = any;
|
|
28
|
+
export type IconComponent = any;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EvidenceCaption — the recap sentence assembled from fragments.
|
|
3
|
+
*
|
|
4
|
+
* @param {object} props
|
|
5
|
+
* @param {Array<{text: string, anchorId?: string, label?: string}>} props.fragments
|
|
6
|
+
* the ordered fragments. a fragment WITH `anchorId` is a clickable proof link (jumps to the
|
|
7
|
+
* <EvidenceTarget id={anchorId}> and flashes it); `label` names the destination for AT
|
|
8
|
+
* (defaults to the anchorId). a fragment without `anchorId` is plain prose.
|
|
9
|
+
* @param {(anchorId: string) => void} [props.onJump] - called with the anchorId when a fragment is
|
|
10
|
+
* activated (in addition to the built-in scroll + highlight).
|
|
11
|
+
* @param {string} [props['aria-label']] - accessible label for the recap region (default: "recap").
|
|
12
|
+
* @param {string} [props.className]
|
|
13
|
+
*/
|
|
14
|
+
export function EvidenceCaption({ fragments, onJump, "aria-label": ariaLabel, className, ...rest }: {
|
|
15
|
+
fragments: Array<{
|
|
16
|
+
text: string;
|
|
17
|
+
anchorId?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
}>;
|
|
20
|
+
onJump?: (anchorId: string) => void;
|
|
21
|
+
}): any;
|
|
22
|
+
/**
|
|
23
|
+
* EvidenceTarget — the proof block a fragment jumps to. it owns the `id` the caption scrolls to and
|
|
24
|
+
* the `data-ec-flash` attribute the CSS animates on arrival. give it an `eyebrow` (a small mono
|
|
25
|
+
* anchor label, lowercased chrome) so the reader sees which evidence they landed on.
|
|
26
|
+
*
|
|
27
|
+
* @param {object} props
|
|
28
|
+
* @param {string} props.id - the anchor id; a fragment's `anchorId` points here.
|
|
29
|
+
* @param {string} [props.eyebrow] - the small anchor label shown above the block (chrome → mono).
|
|
30
|
+
* @param {React.ReactNode} props.children - the evidence content.
|
|
31
|
+
* @param {string} [props.className]
|
|
32
|
+
*/
|
|
33
|
+
export function EvidenceTarget({ id, eyebrow, children, className, ...rest }: {
|
|
34
|
+
id: string;
|
|
35
|
+
eyebrow?: string;
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
className?: string;
|
|
38
|
+
}): any;
|
|
39
|
+
export default EvidenceCaption;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} ExplainerProps
|
|
3
|
+
* @property {React.ReactNode} children the explanatory PROSE (rendered in var(--font-body)); may contain <Term> words.
|
|
4
|
+
* @property {React.ReactNode} [title='what am i looking at?'] the toggle-row heading (mono chrome, lowercased by css).
|
|
5
|
+
* @property {boolean} [defaultOpen=false] initial open state when nothing is persisted.
|
|
6
|
+
* @property {string} [storageKey] when given, open/closed persists to localStorage under this surface key.
|
|
7
|
+
* @property {'card'|'inline'} [tone='card'] 'card' = bordered panel; 'inline' = a quieter ghost (no fill/border).
|
|
8
|
+
* @property {string} [className] extra class on the root.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The "what am i looking at?" block — one per surface. A square "?" / heading toggle row reveals or
|
|
12
|
+
* hides a short prose body (the heading reads aria-expanded; the body is the toggle's aria-controls
|
|
13
|
+
* region). The toggle target is the whole row (>= the 24px minimum). Open state persists per surface
|
|
14
|
+
* when `storageKey` is set. Two tones: a bordered `card` panel, or a quieter `inline` ghost.
|
|
15
|
+
* It is never a modal and never steals focus.
|
|
16
|
+
*/
|
|
17
|
+
export default function Explainer({ children, title, defaultOpen, storageKey, tone, className, }: {
|
|
18
|
+
children: any;
|
|
19
|
+
title?: string;
|
|
20
|
+
defaultOpen?: boolean;
|
|
21
|
+
storageKey: any;
|
|
22
|
+
tone?: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
}): any;
|
|
25
|
+
/**
|
|
26
|
+
* @typedef {Object} TermProps
|
|
27
|
+
* @property {string} def the plain-language definition shown in the tooltip (mono chrome).
|
|
28
|
+
* @property {React.ReactNode} children the inline word(s) to underline.
|
|
29
|
+
* @property {string} [className] extra class on the trigger.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Inline glossary term: a dotted-underline word that reveals a small square tooltip with its
|
|
33
|
+
* definition on hover AND keyboard focus (and on tap, for touch). The trigger is a real <button> so
|
|
34
|
+
* it's reachable and operable from the keyboard; the bubble is wired via aria-describedby so the
|
|
35
|
+
* definition reinforces — never solely names — the word. A tooltip is reinforcement, so anything
|
|
36
|
+
* load-bearing must also live in visible copy.
|
|
37
|
+
*/
|
|
38
|
+
export function Term({ def, children, className }: {
|
|
39
|
+
def: any;
|
|
40
|
+
children: any;
|
|
41
|
+
className?: string;
|
|
42
|
+
}): any;
|
|
43
|
+
export type ExplainerProps = {
|
|
44
|
+
/**
|
|
45
|
+
* the explanatory PROSE (rendered in var(--font-body)); may contain <Term> words.
|
|
46
|
+
*/
|
|
47
|
+
children: React.ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* the toggle-row heading (mono chrome, lowercased by css).
|
|
50
|
+
*/
|
|
51
|
+
title?: React.ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* initial open state when nothing is persisted.
|
|
54
|
+
*/
|
|
55
|
+
defaultOpen?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* when given, open/closed persists to localStorage under this surface key.
|
|
58
|
+
*/
|
|
59
|
+
storageKey?: string;
|
|
60
|
+
/**
|
|
61
|
+
* 'card' = bordered panel; 'inline' = a quieter ghost (no fill/border).
|
|
62
|
+
*/
|
|
63
|
+
tone?: "card" | "inline";
|
|
64
|
+
/**
|
|
65
|
+
* extra class on the root.
|
|
66
|
+
*/
|
|
67
|
+
className?: string;
|
|
68
|
+
};
|
|
69
|
+
export type TermProps = {
|
|
70
|
+
/**
|
|
71
|
+
* the plain-language definition shown in the tooltip (mono chrome).
|
|
72
|
+
*/
|
|
73
|
+
def: string;
|
|
74
|
+
/**
|
|
75
|
+
* the inline word(s) to underline.
|
|
76
|
+
*/
|
|
77
|
+
children: React.ReactNode;
|
|
78
|
+
/**
|
|
79
|
+
* extra class on the trigger.
|
|
80
|
+
*/
|
|
81
|
+
className?: string;
|
|
82
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default function FacetRail({ order, onOrder, providers, activeProviders, onProvider, topics, activeTopics, onTopic, onClear, className, ...rest }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
order?: string;
|
|
4
|
+
onOrder: any;
|
|
5
|
+
providers?: any[];
|
|
6
|
+
activeProviders?: Set<any>;
|
|
7
|
+
onProvider: any;
|
|
8
|
+
topics?: any[];
|
|
9
|
+
activeTopics?: Set<any>;
|
|
10
|
+
onTopic: any;
|
|
11
|
+
onClear: any;
|
|
12
|
+
className?: string;
|
|
13
|
+
}): any;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skeleton — a placeholder block that mirrors the shape of loading content.
|
|
3
|
+
* @typedef {Object} SkeletonProps
|
|
4
|
+
* @property {string} [label='loading'] aria-label announcing what is loading.
|
|
5
|
+
* @property {boolean} [avatar=true] render the leading 32px avatar block + two
|
|
6
|
+
* stacked lines (w-40 / w-70) at the top.
|
|
7
|
+
* @property {number} [lines=2] number of full-width body lines below the row;
|
|
8
|
+
* they cycle through w-90 / w-70 widths.
|
|
9
|
+
* @property {string} [className] extra classes appended to the .fb-skel root.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* @param {SkeletonProps} props
|
|
13
|
+
*/
|
|
14
|
+
export function Skeleton({ label, avatar, lines, className }: SkeletonProps): any;
|
|
15
|
+
/**
|
|
16
|
+
* Progress — a determinate progress bar with a labelled head + tabular percent.
|
|
17
|
+
* @typedef {Object} ProgressProps
|
|
18
|
+
* @property {number} [value=0] current value, 0–100 (clamped); drives the fill
|
|
19
|
+
* width and aria-valuenow + the displayed percent.
|
|
20
|
+
* @property {number} [min=0] aria-valuemin.
|
|
21
|
+
* @property {number} [max=100] aria-valuemax.
|
|
22
|
+
* @property {React.ReactNode} [label] caption shown at the left of the head row.
|
|
23
|
+
* @property {string} [ariaLabel] accessible name for the track (progressbar);
|
|
24
|
+
* falls back to the string `label` when omitted.
|
|
25
|
+
* @property {boolean} [showPct=true] render the tabular percent on the right.
|
|
26
|
+
* @property {string} [className] extra classes appended to the .fb-prog root.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* @param {ProgressProps} props
|
|
30
|
+
*/
|
|
31
|
+
export function Progress({ value, min, max, label, ariaLabel, showPct, className, }: ProgressProps): any;
|
|
32
|
+
/**
|
|
33
|
+
* Spinner — an inline busy marker: spinning icon + lowercase label, in a live region.
|
|
34
|
+
* @typedef {Object} SpinnerProps
|
|
35
|
+
* @property {React.ReactNode} [children] label text beside the icon (the live message).
|
|
36
|
+
* @property {React.ComponentType} [icon=LoaderCircle] icon component reference; the CSS
|
|
37
|
+
* spins .lucide only under no-preference + aria-busy.
|
|
38
|
+
* @property {string} [className] extra classes appended to the .fb-spin root.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* @param {SpinnerProps} props
|
|
42
|
+
*/
|
|
43
|
+
export function Spinner({ children, icon: Icon, className }: SpinnerProps): any;
|
|
44
|
+
/**
|
|
45
|
+
* Toast — a transient notification: icon + title + message + dismiss button.
|
|
46
|
+
* Render inside an aria-live region (e.g. a wrapper with aria-live="polite") for the
|
|
47
|
+
* announcement; the toast itself carries role status (ok) or alert (error).
|
|
48
|
+
* @typedef {Object} ToastProps
|
|
49
|
+
* @property {'ok'|'err'} [variant='ok'] tone; 'ok' = circle-check/olive + role=status,
|
|
50
|
+
* 'err' = circle-x/clay + role=alert.
|
|
51
|
+
* @property {React.ReactNode} title the .fb-toast-title line.
|
|
52
|
+
* @property {React.ReactNode} [children] the body message (.fb-toast-msg).
|
|
53
|
+
* @property {React.ComponentType} [icon] override the leading icon component reference.
|
|
54
|
+
* @property {() => void} [onClose] called when the dismiss button is clicked; when
|
|
55
|
+
* omitted the close button is not rendered.
|
|
56
|
+
* @property {string} [closeLabel='dismiss notification'] aria-label for the close button.
|
|
57
|
+
* @property {string} [className] extra classes appended to the .fb-toast root.
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* @param {ToastProps} props
|
|
61
|
+
*/
|
|
62
|
+
export function Toast({ variant, title, children, icon: Icon, onClose, closeLabel, className, }: ToastProps): any;
|
|
63
|
+
/**
|
|
64
|
+
* FeedbackPanel — a centred inline state surface (loading / error / empty), with an
|
|
65
|
+
* icon tile, lowercase title and a message. Loading sets aria-busy + role=status;
|
|
66
|
+
* error sets role=alert; the neutral (empty / resolved) panel has no role.
|
|
67
|
+
* @typedef {Object} FeedbackPanelProps
|
|
68
|
+
* @property {'loading'|'error'|'empty'} [variant='empty'] which surface to render; picks
|
|
69
|
+
* the default icon, role and .is-err styling.
|
|
70
|
+
* @property {React.ReactNode} [title] the .fb-panel-title (defaults per variant).
|
|
71
|
+
* @property {React.ReactNode} [children] the message body (.fb-panel-msg).
|
|
72
|
+
* @property {React.ComponentType} [icon] override the icon component reference; defaults
|
|
73
|
+
* to loader-circle / circle-alert / search-x.
|
|
74
|
+
* @property {string} [className] extra classes appended to the .fb-panel root.
|
|
75
|
+
*/
|
|
76
|
+
/**
|
|
77
|
+
* @param {FeedbackPanelProps} props
|
|
78
|
+
*/
|
|
79
|
+
export function FeedbackPanel({ variant, title, children, icon: Icon, className }: FeedbackPanelProps): any;
|
|
80
|
+
export default Spinner;
|
|
81
|
+
/**
|
|
82
|
+
* Skeleton — a placeholder block that mirrors the shape of loading content.
|
|
83
|
+
*/
|
|
84
|
+
export type SkeletonProps = {
|
|
85
|
+
/**
|
|
86
|
+
* aria-label announcing what is loading.
|
|
87
|
+
*/
|
|
88
|
+
label?: string;
|
|
89
|
+
/**
|
|
90
|
+
* render the leading 32px avatar block + two
|
|
91
|
+
* stacked lines (w-40 / w-70) at the top.
|
|
92
|
+
*/
|
|
93
|
+
avatar?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* number of full-width body lines below the row;
|
|
96
|
+
* they cycle through w-90 / w-70 widths.
|
|
97
|
+
*/
|
|
98
|
+
lines?: number;
|
|
99
|
+
/**
|
|
100
|
+
* extra classes appended to the .fb-skel root.
|
|
101
|
+
*/
|
|
102
|
+
className?: string;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Progress — a determinate progress bar with a labelled head + tabular percent.
|
|
106
|
+
*/
|
|
107
|
+
export type ProgressProps = {
|
|
108
|
+
/**
|
|
109
|
+
* current value, 0–100 (clamped); drives the fill
|
|
110
|
+
* width and aria-valuenow + the displayed percent.
|
|
111
|
+
*/
|
|
112
|
+
value?: number;
|
|
113
|
+
/**
|
|
114
|
+
* aria-valuemin.
|
|
115
|
+
*/
|
|
116
|
+
min?: number;
|
|
117
|
+
/**
|
|
118
|
+
* aria-valuemax.
|
|
119
|
+
*/
|
|
120
|
+
max?: number;
|
|
121
|
+
/**
|
|
122
|
+
* caption shown at the left of the head row.
|
|
123
|
+
*/
|
|
124
|
+
label?: React.ReactNode;
|
|
125
|
+
/**
|
|
126
|
+
* accessible name for the track (progressbar);
|
|
127
|
+
* falls back to the string `label` when omitted.
|
|
128
|
+
*/
|
|
129
|
+
ariaLabel?: string;
|
|
130
|
+
/**
|
|
131
|
+
* render the tabular percent on the right.
|
|
132
|
+
*/
|
|
133
|
+
showPct?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* extra classes appended to the .fb-prog root.
|
|
136
|
+
*/
|
|
137
|
+
className?: string;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Spinner — an inline busy marker: spinning icon + lowercase label, in a live region.
|
|
141
|
+
*/
|
|
142
|
+
export type SpinnerProps = {
|
|
143
|
+
/**
|
|
144
|
+
* label text beside the icon (the live message).
|
|
145
|
+
*/
|
|
146
|
+
children?: React.ReactNode;
|
|
147
|
+
/**
|
|
148
|
+
* icon component reference; the CSS
|
|
149
|
+
* spins .lucide only under no-preference + aria-busy.
|
|
150
|
+
*/
|
|
151
|
+
icon?: React.ComponentType;
|
|
152
|
+
/**
|
|
153
|
+
* extra classes appended to the .fb-spin root.
|
|
154
|
+
*/
|
|
155
|
+
className?: string;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Toast — a transient notification: icon + title + message + dismiss button.
|
|
159
|
+
* Render inside an aria-live region (e.g. a wrapper with aria-live="polite") for the
|
|
160
|
+
* announcement; the toast itself carries role status (ok) or alert (error).
|
|
161
|
+
*/
|
|
162
|
+
export type ToastProps = {
|
|
163
|
+
/**
|
|
164
|
+
* tone; 'ok' = circle-check/olive + role=status,
|
|
165
|
+
* 'err' = circle-x/clay + role=alert.
|
|
166
|
+
*/
|
|
167
|
+
variant?: "ok" | "err";
|
|
168
|
+
/**
|
|
169
|
+
* the .fb-toast-title line.
|
|
170
|
+
*/
|
|
171
|
+
title: React.ReactNode;
|
|
172
|
+
/**
|
|
173
|
+
* the body message (.fb-toast-msg).
|
|
174
|
+
*/
|
|
175
|
+
children?: React.ReactNode;
|
|
176
|
+
/**
|
|
177
|
+
* override the leading icon component reference.
|
|
178
|
+
*/
|
|
179
|
+
icon?: React.ComponentType;
|
|
180
|
+
/**
|
|
181
|
+
* called when the dismiss button is clicked; when
|
|
182
|
+
* omitted the close button is not rendered.
|
|
183
|
+
*/
|
|
184
|
+
onClose?: () => void;
|
|
185
|
+
/**
|
|
186
|
+
* aria-label for the close button.
|
|
187
|
+
*/
|
|
188
|
+
closeLabel?: string;
|
|
189
|
+
/**
|
|
190
|
+
* extra classes appended to the .fb-toast root.
|
|
191
|
+
*/
|
|
192
|
+
className?: string;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* FeedbackPanel — a centred inline state surface (loading / error / empty), with an
|
|
196
|
+
* icon tile, lowercase title and a message. Loading sets aria-busy + role=status;
|
|
197
|
+
* error sets role=alert; the neutral (empty / resolved) panel has no role.
|
|
198
|
+
*/
|
|
199
|
+
export type FeedbackPanelProps = {
|
|
200
|
+
/**
|
|
201
|
+
* which surface to render; picks
|
|
202
|
+
* the default icon, role and .is-err styling.
|
|
203
|
+
*/
|
|
204
|
+
variant?: "loading" | "error" | "empty";
|
|
205
|
+
/**
|
|
206
|
+
* the .fb-panel-title (defaults per variant).
|
|
207
|
+
*/
|
|
208
|
+
title?: React.ReactNode;
|
|
209
|
+
/**
|
|
210
|
+
* the message body (.fb-panel-msg).
|
|
211
|
+
*/
|
|
212
|
+
children?: React.ReactNode;
|
|
213
|
+
/**
|
|
214
|
+
* override the icon component reference; defaults
|
|
215
|
+
* to loader-circle / circle-alert / search-x.
|
|
216
|
+
*/
|
|
217
|
+
icon?: React.ComponentType;
|
|
218
|
+
/**
|
|
219
|
+
* extra classes appended to the .fb-panel root.
|
|
220
|
+
*/
|
|
221
|
+
className?: string;
|
|
222
|
+
};
|