@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.
- package/LICENSE +21 -0
- package/README.md +85 -0
- package/dist/lib/README.md +13 -0
- package/dist/lib/base.css +48 -0
- package/dist/lib/components.css +2 -0
- package/dist/lib/fonts.css +28 -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/Accordion.stories.d.ts +91 -0
- package/dist/lib/types/Avatar.d.ts +94 -0
- package/dist/lib/types/Avatar.stories.d.ts +160 -0
- package/dist/lib/types/BrandMark.d.ts +25 -0
- package/dist/lib/types/BrandMark.stories.d.ts +75 -0
- package/dist/lib/types/Breadcrumb.d.ts +66 -0
- package/dist/lib/types/Breadcrumb.stories.d.ts +91 -0
- package/dist/lib/types/Button.d.ts +86 -0
- package/dist/lib/types/Button.stories.d.ts +129 -0
- package/dist/lib/types/Card.d.ts +145 -0
- package/dist/lib/types/Card.stories.d.ts +70 -0
- package/dist/lib/types/Chart.stories.d.ts +55 -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/Checkbox.stories.d.ts +75 -0
- package/dist/lib/types/Chip.d.ts +85 -0
- package/dist/lib/types/Chip.stories.d.ts +190 -0
- package/dist/lib/types/CliOnboard.d.ts +68 -0
- package/dist/lib/types/CliOnboard.stories.d.ts +24 -0
- package/dist/lib/types/CommandPalette.d.ts +6 -0
- package/dist/lib/types/CommandPalette.stories.d.ts +94 -0
- package/dist/lib/types/CommitGraph.d.ts +71 -0
- package/dist/lib/types/CommitGraph.stories.d.ts +17 -0
- package/dist/lib/types/ConnectionState.d.ts +82 -0
- package/dist/lib/types/ConnectionState.stories.d.ts +117 -0
- package/dist/lib/types/ConsentDialog.d.ts +97 -0
- package/dist/lib/types/ConsentDialog.stories.d.ts +61 -0
- package/dist/lib/types/DataTable.d.ts +116 -0
- package/dist/lib/types/DataTable.stories.d.ts +240 -0
- package/dist/lib/types/DateRange.d.ts +242 -0
- package/dist/lib/types/DateRange.stories.d.ts +272 -0
- package/dist/lib/types/Dialog.d.ts +9 -0
- package/dist/lib/types/Dialog.stories.d.ts +121 -0
- package/dist/lib/types/DiffView.d.ts +39 -0
- package/dist/lib/types/DiffView.stories.d.ts +118 -0
- package/dist/lib/types/EmptyState.d.ts +28 -0
- package/dist/lib/types/EmptyState.stories.d.ts +130 -0
- package/dist/lib/types/EvidenceCaption.d.ts +39 -0
- package/dist/lib/types/EvidenceCaption.stories.d.ts +43 -0
- package/dist/lib/types/Explainer.d.ts +82 -0
- package/dist/lib/types/Explainer.stories.d.ts +22 -0
- package/dist/lib/types/FacetRail.d.ts +13 -0
- package/dist/lib/types/FacetRail.stories.d.ts +28 -0
- package/dist/lib/types/Feedback.d.ts +222 -0
- package/dist/lib/types/Feedback.stories.d.ts +81 -0
- package/dist/lib/types/GroupedMultiSelect.d.ts +67 -0
- package/dist/lib/types/GroupedMultiSelect.stories.d.ts +59 -0
- package/dist/lib/types/Input.d.ts +158 -0
- package/dist/lib/types/Input.stories.d.ts +181 -0
- package/dist/lib/types/Intensity.d.ts +55 -0
- package/dist/lib/types/Intensity.stories.d.ts +108 -0
- package/dist/lib/types/MapCanvas.d.ts +89 -0
- package/dist/lib/types/MapCanvas.stories.d.ts +174 -0
- package/dist/lib/types/Menu.d.ts +62 -0
- package/dist/lib/types/Menu.stories.d.ts +173 -0
- package/dist/lib/types/ModerationQueue.d.ts +135 -0
- package/dist/lib/types/ModerationQueue.stories.d.ts +34 -0
- package/dist/lib/types/Pager.d.ts +47 -0
- package/dist/lib/types/Pager.stories.d.ts +100 -0
- package/dist/lib/types/Pagination.d.ts +50 -0
- package/dist/lib/types/Pagination.stories.d.ts +193 -0
- package/dist/lib/types/PolicySelect.d.ts +80 -0
- package/dist/lib/types/PolicySelect.stories.d.ts +130 -0
- package/dist/lib/types/ProviderIcon.d.ts +83 -0
- package/dist/lib/types/ProviderIcon.stories.d.ts +44 -0
- package/dist/lib/types/RailShell.d.ts +199 -0
- package/dist/lib/types/RailShell.stories.d.ts +32 -0
- package/dist/lib/types/Redaction.d.ts +53 -0
- package/dist/lib/types/Redaction.stories.d.ts +120 -0
- package/dist/lib/types/RoleRoster.d.ts +97 -0
- package/dist/lib/types/RoleRoster.stories.d.ts +23 -0
- package/dist/lib/types/SignIn.d.ts +78 -0
- package/dist/lib/types/SignIn.stories.d.ts +57 -0
- package/dist/lib/types/Sparkline.d.ts +19 -0
- package/dist/lib/types/StatTiles.d.ts +115 -0
- package/dist/lib/types/StatTiles.stories.d.ts +31 -0
- package/dist/lib/types/StepWizard.d.ts +92 -0
- package/dist/lib/types/StepWizard.stories.d.ts +18 -0
- package/dist/lib/types/StepsWaterfall.d.ts +67 -0
- package/dist/lib/types/StepsWaterfall.stories.d.ts +94 -0
- package/dist/lib/types/Switch.d.ts +63 -0
- package/dist/lib/types/Switch.stories.d.ts +134 -0
- package/dist/lib/types/Tabs.d.ts +48 -0
- package/dist/lib/types/Tabs.stories.d.ts +75 -0
- package/dist/lib/types/TimeStrip.d.ts +12 -0
- package/dist/lib/types/TimeStrip.stories.d.ts +30 -0
- package/dist/lib/types/Timeline.d.ts +192 -0
- package/dist/lib/types/Timeline.stories.d.ts +974 -0
- package/dist/lib/types/ToastHost.d.ts +70 -0
- package/dist/lib/types/ToastHost.stories.d.ts +115 -0
- package/dist/lib/types/ToolRenderers.d.ts +24 -0
- package/dist/lib/types/ToolRenderers.stories.d.ts +138 -0
- package/dist/lib/types/Tooltip.d.ts +80 -0
- package/dist/lib/types/Tooltip.stories.d.ts +116 -0
- package/dist/lib/types/Tour.d.ts +37 -0
- package/dist/lib/types/Tour.stories.d.ts +39 -0
- package/dist/lib/types/TranscriptMarkers.d.ts +50 -0
- package/dist/lib/types/TranscriptMarkers.stories.d.ts +48 -0
- package/dist/lib/types/Treemap.d.ts +77 -0
- package/dist/lib/types/Treemap.stories.d.ts +101 -0
- package/dist/lib/types/VisibilityControl.d.ts +54 -0
- package/dist/lib/types/VisibilityControl.stories.d.ts +126 -0
- package/dist/lib/types/chart-shared.d.ts +63 -0
- package/dist/lib/types/index.d.ts +53 -0
- package/dist/lib/types/story-frame.d.ts +12 -0
- package/dist/lib/ui.js +8707 -0
- package/package.json +67 -0
|
@@ -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,129 @@
|
|
|
1
|
+
export default meta;
|
|
2
|
+
export const Playground: {};
|
|
3
|
+
export namespace Primary {
|
|
4
|
+
namespace args {
|
|
5
|
+
let variant: string;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export namespace Loading {
|
|
9
|
+
export namespace args_1 {
|
|
10
|
+
let variant_1: string;
|
|
11
|
+
export { variant_1 as variant };
|
|
12
|
+
export let loading: boolean;
|
|
13
|
+
export let children: string;
|
|
14
|
+
}
|
|
15
|
+
export { args_1 as args };
|
|
16
|
+
}
|
|
17
|
+
export namespace Disabled {
|
|
18
|
+
export namespace args_2 {
|
|
19
|
+
let disabled: boolean;
|
|
20
|
+
}
|
|
21
|
+
export { args_2 as args };
|
|
22
|
+
}
|
|
23
|
+
export namespace DisabledStates {
|
|
24
|
+
function render(): any;
|
|
25
|
+
}
|
|
26
|
+
export namespace LoadingDisabled {
|
|
27
|
+
export namespace args_3 {
|
|
28
|
+
let variant_2: string;
|
|
29
|
+
export { variant_2 as variant };
|
|
30
|
+
let loading_1: boolean;
|
|
31
|
+
export { loading_1 as loading };
|
|
32
|
+
let disabled_1: boolean;
|
|
33
|
+
export { disabled_1 as disabled };
|
|
34
|
+
let children_1: string;
|
|
35
|
+
export { children_1 as children };
|
|
36
|
+
}
|
|
37
|
+
export { args_3 as args };
|
|
38
|
+
}
|
|
39
|
+
export namespace DisabledLink {
|
|
40
|
+
export namespace args_4 {
|
|
41
|
+
export let as: string;
|
|
42
|
+
export let href: string;
|
|
43
|
+
let disabled_2: boolean;
|
|
44
|
+
export { disabled_2 as disabled };
|
|
45
|
+
let children_2: string;
|
|
46
|
+
export { children_2 as children };
|
|
47
|
+
}
|
|
48
|
+
export { args_4 as args };
|
|
49
|
+
}
|
|
50
|
+
export namespace WithIcon {
|
|
51
|
+
export namespace args_5 {
|
|
52
|
+
let variant_3: string;
|
|
53
|
+
export { variant_3 as variant };
|
|
54
|
+
export { Download as icon };
|
|
55
|
+
let children_3: string;
|
|
56
|
+
export { children_3 as children };
|
|
57
|
+
}
|
|
58
|
+
export { args_5 as args };
|
|
59
|
+
}
|
|
60
|
+
export namespace IconOnly {
|
|
61
|
+
let args_6: {
|
|
62
|
+
icon: react.ForwardRefExoticComponent<any>;
|
|
63
|
+
'aria-label': string;
|
|
64
|
+
children: any;
|
|
65
|
+
};
|
|
66
|
+
export { args_6 as args };
|
|
67
|
+
}
|
|
68
|
+
export namespace Small {
|
|
69
|
+
export namespace args_7 {
|
|
70
|
+
let size: string;
|
|
71
|
+
}
|
|
72
|
+
export { args_7 as args };
|
|
73
|
+
}
|
|
74
|
+
export namespace Group {
|
|
75
|
+
export function render_1(): any;
|
|
76
|
+
export { render_1 as render };
|
|
77
|
+
}
|
|
78
|
+
export namespace SegmentedControl {
|
|
79
|
+
export function render_2(): any;
|
|
80
|
+
export { render_2 as render };
|
|
81
|
+
}
|
|
82
|
+
declare namespace meta {
|
|
83
|
+
export let title: string;
|
|
84
|
+
export { Button as component };
|
|
85
|
+
export let tags: string[];
|
|
86
|
+
export namespace argTypes {
|
|
87
|
+
export namespace variant_4 {
|
|
88
|
+
let control: string;
|
|
89
|
+
let options: string[];
|
|
90
|
+
}
|
|
91
|
+
export { variant_4 as variant };
|
|
92
|
+
export namespace size_1 {
|
|
93
|
+
let control_1: string;
|
|
94
|
+
export { control_1 as control };
|
|
95
|
+
let options_1: string[];
|
|
96
|
+
export { options_1 as options };
|
|
97
|
+
}
|
|
98
|
+
export { size_1 as size };
|
|
99
|
+
export namespace disabled_3 {
|
|
100
|
+
let control_2: string;
|
|
101
|
+
export { control_2 as control };
|
|
102
|
+
}
|
|
103
|
+
export { disabled_3 as disabled };
|
|
104
|
+
export namespace loading_2 {
|
|
105
|
+
let control_3: string;
|
|
106
|
+
export { control_3 as control };
|
|
107
|
+
}
|
|
108
|
+
export { loading_2 as loading };
|
|
109
|
+
export namespace children_4 {
|
|
110
|
+
let control_4: string;
|
|
111
|
+
export { control_4 as control };
|
|
112
|
+
}
|
|
113
|
+
export { children_4 as children };
|
|
114
|
+
}
|
|
115
|
+
export namespace args_8 {
|
|
116
|
+
let children_5: string;
|
|
117
|
+
export { children_5 as children };
|
|
118
|
+
let variant_5: string;
|
|
119
|
+
export { variant_5 as variant };
|
|
120
|
+
let size_2: string;
|
|
121
|
+
export { size_2 as size };
|
|
122
|
+
}
|
|
123
|
+
export { args_8 as args };
|
|
124
|
+
export namespace parameters {
|
|
125
|
+
let layout: string;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
import { Download } from 'lucide-react';
|
|
129
|
+
import Button from './Button.jsx';
|
|
@@ -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,70 @@
|
|
|
1
|
+
export default meta;
|
|
2
|
+
export const Playground: {};
|
|
3
|
+
export namespace AsLink {
|
|
4
|
+
namespace args {
|
|
5
|
+
let link: boolean;
|
|
6
|
+
let href: string;
|
|
7
|
+
let children: any;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export namespace Imagery {
|
|
11
|
+
function render(): any;
|
|
12
|
+
}
|
|
13
|
+
export namespace Redacted {
|
|
14
|
+
export function render_1(): any;
|
|
15
|
+
export { render_1 as render };
|
|
16
|
+
}
|
|
17
|
+
export namespace Minimal {
|
|
18
|
+
export function render_2(): any;
|
|
19
|
+
export { render_2 as render };
|
|
20
|
+
}
|
|
21
|
+
export namespace DenseRow {
|
|
22
|
+
export function render_3(): any;
|
|
23
|
+
export { render_3 as render };
|
|
24
|
+
}
|
|
25
|
+
export namespace RowList {
|
|
26
|
+
export function render_4(): any;
|
|
27
|
+
export { render_4 as render };
|
|
28
|
+
}
|
|
29
|
+
export namespace MetaItems {
|
|
30
|
+
export function render_5(): any;
|
|
31
|
+
export { render_5 as render };
|
|
32
|
+
}
|
|
33
|
+
export namespace Focused {
|
|
34
|
+
function play({ canvasElement }: {
|
|
35
|
+
canvasElement: any;
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
export namespace Slots {
|
|
39
|
+
export function render_6(): any;
|
|
40
|
+
export { render_6 as render };
|
|
41
|
+
}
|
|
42
|
+
declare namespace meta {
|
|
43
|
+
export let title: string;
|
|
44
|
+
export { Card as component };
|
|
45
|
+
export let tags: string[];
|
|
46
|
+
export let decorators: Function[];
|
|
47
|
+
export namespace argTypes {
|
|
48
|
+
export namespace link_1 {
|
|
49
|
+
let control: string;
|
|
50
|
+
}
|
|
51
|
+
export { link_1 as link };
|
|
52
|
+
export namespace className {
|
|
53
|
+
let control_1: string;
|
|
54
|
+
export { control_1 as control };
|
|
55
|
+
}
|
|
56
|
+
export namespace children_1 {
|
|
57
|
+
let control_2: boolean;
|
|
58
|
+
export { control_2 as control };
|
|
59
|
+
}
|
|
60
|
+
export { children_1 as children };
|
|
61
|
+
}
|
|
62
|
+
export namespace args_1 {
|
|
63
|
+
let link_2: boolean;
|
|
64
|
+
export { link_2 as link };
|
|
65
|
+
let children_2: any;
|
|
66
|
+
export { children_2 as children };
|
|
67
|
+
}
|
|
68
|
+
export { args_1 as args };
|
|
69
|
+
}
|
|
70
|
+
import Card from './Card.jsx';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let title: string;
|
|
3
|
+
namespace parameters {
|
|
4
|
+
let layout: string;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export default _default;
|
|
8
|
+
export namespace Bar {
|
|
9
|
+
let decorators: ((Story: any) => any)[];
|
|
10
|
+
function render(): any;
|
|
11
|
+
function play({ canvasElement }: {
|
|
12
|
+
canvasElement: any;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export namespace GroupedBars {
|
|
16
|
+
let decorators_1: ((Story: any) => any)[];
|
|
17
|
+
export { decorators_1 as decorators };
|
|
18
|
+
export function render_1(): any;
|
|
19
|
+
export { render_1 as render };
|
|
20
|
+
}
|
|
21
|
+
export namespace StackedBars {
|
|
22
|
+
let decorators_2: ((Story: any) => any)[];
|
|
23
|
+
export { decorators_2 as decorators };
|
|
24
|
+
export function render_2(): any;
|
|
25
|
+
export { render_2 as render };
|
|
26
|
+
}
|
|
27
|
+
export namespace LineArea {
|
|
28
|
+
export let name: string;
|
|
29
|
+
let decorators_3: ((Story: any) => any)[];
|
|
30
|
+
export { decorators_3 as decorators };
|
|
31
|
+
export function render_3(): any;
|
|
32
|
+
export { render_3 as render };
|
|
33
|
+
export function play_1({ canvasElement }: {
|
|
34
|
+
canvasElement: any;
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
export { play_1 as play };
|
|
37
|
+
}
|
|
38
|
+
export namespace MultiLine {
|
|
39
|
+
let name_1: string;
|
|
40
|
+
export { name_1 as name };
|
|
41
|
+
let decorators_4: ((Story: any) => any)[];
|
|
42
|
+
export { decorators_4 as decorators };
|
|
43
|
+
export function render_4(): any;
|
|
44
|
+
export { render_4 as render };
|
|
45
|
+
}
|
|
46
|
+
export namespace Sparklines {
|
|
47
|
+
let decorators_5: ((Story: any) => any)[];
|
|
48
|
+
export { decorators_5 as decorators };
|
|
49
|
+
export function render_5(): any;
|
|
50
|
+
export { render_5 as render };
|
|
51
|
+
export function play_2({ canvasElement }: {
|
|
52
|
+
canvasElement: any;
|
|
53
|
+
}): Promise<void>;
|
|
54
|
+
export { play_2 as play };
|
|
55
|
+
}
|
|
@@ -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
|
+
};
|