@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,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A grouped tri-state multi-select tree. See GroupedMultiSelectProps.
|
|
3
|
+
* @param {GroupedMultiSelectProps} props
|
|
4
|
+
*/
|
|
5
|
+
export default function GroupedMultiSelect({ groups, value, defaultValue, onChange, tokenLabel, defaultOpen, ariaLabel, }: GroupedMultiSelectProps): any;
|
|
6
|
+
export type GMSItem = {
|
|
7
|
+
/**
|
|
8
|
+
* unique selection id (what lands in the value Set).
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* the item title — user content, rendered verbatim.
|
|
13
|
+
*/
|
|
14
|
+
label: any;
|
|
15
|
+
/**
|
|
16
|
+
* one-line secondary metadata (e.g. "42 turns · jun 3").
|
|
17
|
+
*/
|
|
18
|
+
meta?: any;
|
|
19
|
+
/**
|
|
20
|
+
* token count for the running tally; defaults to 0.
|
|
21
|
+
*/
|
|
22
|
+
tokens?: number;
|
|
23
|
+
};
|
|
24
|
+
export type GMSGroup = {
|
|
25
|
+
/**
|
|
26
|
+
* unique group id.
|
|
27
|
+
*/
|
|
28
|
+
id: string;
|
|
29
|
+
/**
|
|
30
|
+
* the group title — user content, rendered verbatim.
|
|
31
|
+
*/
|
|
32
|
+
label: any;
|
|
33
|
+
/**
|
|
34
|
+
* the group's selectable items.
|
|
35
|
+
*/
|
|
36
|
+
items: GMSItem[];
|
|
37
|
+
};
|
|
38
|
+
export type GroupedMultiSelectProps = {
|
|
39
|
+
/**
|
|
40
|
+
* the project-grouped tree to render.
|
|
41
|
+
*/
|
|
42
|
+
groups: GMSGroup[];
|
|
43
|
+
/**
|
|
44
|
+
* controlled set of selected item ids; pair with onChange.
|
|
45
|
+
*/
|
|
46
|
+
value?: Set<string>;
|
|
47
|
+
/**
|
|
48
|
+
* initial selection for uncontrolled use.
|
|
49
|
+
*/
|
|
50
|
+
defaultValue?: Set<string>;
|
|
51
|
+
/**
|
|
52
|
+
* called with the next selection Set on any toggle.
|
|
53
|
+
*/
|
|
54
|
+
onChange?: (next: Set<string>) => void;
|
|
55
|
+
/**
|
|
56
|
+
* noun for the tally (chrome, lowercased in display).
|
|
57
|
+
*/
|
|
58
|
+
tokenLabel?: string;
|
|
59
|
+
/**
|
|
60
|
+
* ids of groups expanded on first render (uncontrolled).
|
|
61
|
+
*/
|
|
62
|
+
defaultOpen?: string[];
|
|
63
|
+
/**
|
|
64
|
+
* accessible name for the tree container.
|
|
65
|
+
*/
|
|
66
|
+
ariaLabel?: string;
|
|
67
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export default meta;
|
|
2
|
+
export namespace Default {
|
|
3
|
+
namespace args {
|
|
4
|
+
export { GROUPS as groups };
|
|
5
|
+
export { SEEDED as defaultValue };
|
|
6
|
+
export let defaultOpen: string[];
|
|
7
|
+
export let tokenLabel: string;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export namespace Collapsed {
|
|
11
|
+
export namespace args_1 {
|
|
12
|
+
export { GROUPS as groups };
|
|
13
|
+
export { SEEDED as defaultValue };
|
|
14
|
+
let defaultOpen_1: any[];
|
|
15
|
+
export { defaultOpen_1 as defaultOpen };
|
|
16
|
+
let tokenLabel_1: string;
|
|
17
|
+
export { tokenLabel_1 as tokenLabel };
|
|
18
|
+
}
|
|
19
|
+
export { args_1 as args };
|
|
20
|
+
}
|
|
21
|
+
export namespace TogglesCascade {
|
|
22
|
+
export namespace args_2 {
|
|
23
|
+
export { GROUPS as groups };
|
|
24
|
+
let tokenLabel_2: string;
|
|
25
|
+
export { tokenLabel_2 as tokenLabel };
|
|
26
|
+
}
|
|
27
|
+
export { args_2 as args };
|
|
28
|
+
export function render(args: any): any;
|
|
29
|
+
export function play({ canvasElement }: {
|
|
30
|
+
canvasElement: any;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
declare namespace meta {
|
|
34
|
+
export let title: string;
|
|
35
|
+
export { GroupedMultiSelect as component };
|
|
36
|
+
export let tags: string[];
|
|
37
|
+
export let decorators: Function[];
|
|
38
|
+
export namespace argTypes {
|
|
39
|
+
export namespace tokenLabel_3 {
|
|
40
|
+
let control: string;
|
|
41
|
+
}
|
|
42
|
+
export { tokenLabel_3 as tokenLabel };
|
|
43
|
+
export namespace onChange {
|
|
44
|
+
let action: string;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
declare const GROUPS: {
|
|
49
|
+
id: string;
|
|
50
|
+
label: string;
|
|
51
|
+
items: {
|
|
52
|
+
id: string;
|
|
53
|
+
label: string;
|
|
54
|
+
meta: string;
|
|
55
|
+
tokens: number;
|
|
56
|
+
}[];
|
|
57
|
+
}[];
|
|
58
|
+
declare const SEEDED: Set<string>;
|
|
59
|
+
import GroupedMultiSelect from './GroupedMultiSelect.jsx';
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field — the label + control + hint/error wrapper (.is-field) the inputs compose into.
|
|
3
|
+
* Renders the label above, the control (children) in the middle, and a hint (.is-hint) or, when
|
|
4
|
+
* `error` is a non-empty string, an error (.is-error with a TriangleAlert icon) below. Wires the
|
|
5
|
+
* label's htmlFor and the hint/error id to the control via the {id, describedBy, invalid}
|
|
6
|
+
* render-prop args so the standalone <Field> can be used with any control. The shipped Input /
|
|
7
|
+
* Textarea / Select use this internally, so most callers never touch Field directly.
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} props
|
|
10
|
+
* @param {React.ReactNode} [props.label] - label text shown above the control. When `lock` is set it
|
|
11
|
+
* is wrapped in `.is-lk` with a leading icon.
|
|
12
|
+
* @param {React.ComponentType<{size?:number}>} [props.lock] - optional lucide icon (e.g. lock={Lock})
|
|
13
|
+
* rendered before the label inside `.is-lk` to flag a read-only/locked field.
|
|
14
|
+
* @param {string} [props.hint] - helper text rendered in `.is-hint` below the control (when no error).
|
|
15
|
+
* @param {string} [props.error] - error message; a non-empty string renders `.is-error` (TriangleAlert
|
|
16
|
+
* + message) instead of the hint and is announced via aria-describedby.
|
|
17
|
+
* @param {string} [props.id] - control id; auto-generated when omitted. Used for label htmlFor.
|
|
18
|
+
* @param {(args:{id:string,describedBy:string|undefined,invalid:boolean})=>React.ReactNode} props.children
|
|
19
|
+
* - render-prop receiving wiring ids; returns the control element.
|
|
20
|
+
* @returns {JSX.Element}
|
|
21
|
+
*/
|
|
22
|
+
export function Field({ label, lock: LockIcon, hint, error, id, children }: {
|
|
23
|
+
label?: React.ReactNode;
|
|
24
|
+
lock?: React.ComponentType<{
|
|
25
|
+
size?: number;
|
|
26
|
+
}>;
|
|
27
|
+
hint?: string;
|
|
28
|
+
error?: string;
|
|
29
|
+
id?: string;
|
|
30
|
+
children: (args: {
|
|
31
|
+
id: string;
|
|
32
|
+
describedBy: string | undefined;
|
|
33
|
+
invalid: boolean;
|
|
34
|
+
}) => React.ReactNode;
|
|
35
|
+
}): JSX.Element;
|
|
36
|
+
/**
|
|
37
|
+
* Input — a single-line text field with the full input-states wiring. When `iconLeft` is supplied the
|
|
38
|
+
* control sits inside an `.input-ico` wrapper (the icon is absolutely positioned, leaving room via the
|
|
39
|
+
* CSS padding). Error sets aria-invalid + the clay border via `.is-input[aria-invalid]` and links the
|
|
40
|
+
* message with aria-describedby. Supports controlled (`value` + `onChange`) and uncontrolled
|
|
41
|
+
* (`defaultValue`) use.
|
|
42
|
+
*
|
|
43
|
+
* Emits `<div class="is-field"><label class="label"/>[<div class="input-ico">]<input class="input is-input"/>[…]<span class="is-hint|is-error"/></div>`
|
|
44
|
+
* matching src/index.css with zero new CSS.
|
|
45
|
+
*
|
|
46
|
+
* @param {Object} props
|
|
47
|
+
* @param {React.ReactNode} [props.label] - label above the field.
|
|
48
|
+
* @param {React.ComponentType<{size?:number}>} [props.lock] - optional lucide icon shown beside the label (.is-lk).
|
|
49
|
+
* @param {string} [props.hint] - helper text under the field.
|
|
50
|
+
* @param {string} [props.error] - error message; non-empty marks the field invalid (aria-invalid, clay border, icon).
|
|
51
|
+
* @param {boolean} [props.invalid=false] - force the invalid border without a message (sets aria-invalid).
|
|
52
|
+
* @param {React.ComponentType<{size?:number}>} [props.iconLeft] - leading lucide icon component (wraps the input in .input-ico).
|
|
53
|
+
* @param {string} [props.type='text'] - native input type.
|
|
54
|
+
* @param {boolean} [props.readOnly=false] - native readonly (surface-2 fill, quiet, still selectable).
|
|
55
|
+
* @param {boolean} [props.disabled=false] - native disabled.
|
|
56
|
+
* @param {string|number} [props.value] - controlled value.
|
|
57
|
+
* @param {string|number} [props.defaultValue] - initial value for uncontrolled use.
|
|
58
|
+
* @param {(e:React.ChangeEvent<HTMLInputElement>)=>void} [props.onChange] - change handler.
|
|
59
|
+
* @param {string} [props.id] - input id; auto-generated + associated with the label when omitted.
|
|
60
|
+
* @returns {JSX.Element}
|
|
61
|
+
*/
|
|
62
|
+
export default function Input({ label, lock, hint, error, invalid, iconLeft: IconLeft, type, readOnly, disabled, value, defaultValue, onChange, id, ...rest }: {
|
|
63
|
+
label?: React.ReactNode;
|
|
64
|
+
lock?: React.ComponentType<{
|
|
65
|
+
size?: number;
|
|
66
|
+
}>;
|
|
67
|
+
hint?: string;
|
|
68
|
+
error?: string;
|
|
69
|
+
invalid?: boolean;
|
|
70
|
+
iconLeft?: React.ComponentType<{
|
|
71
|
+
size?: number;
|
|
72
|
+
}>;
|
|
73
|
+
type?: string;
|
|
74
|
+
readOnly?: boolean;
|
|
75
|
+
disabled?: boolean;
|
|
76
|
+
value?: string | number;
|
|
77
|
+
defaultValue?: string | number;
|
|
78
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
79
|
+
id?: string;
|
|
80
|
+
}): JSX.Element;
|
|
81
|
+
/**
|
|
82
|
+
* Textarea — the multi-line sibling of Input. Renders `textarea.input.is-input` (the CSS gives it an
|
|
83
|
+
* auto height with a min of one control row and vertical resize). Same label/hint/error and
|
|
84
|
+
* controlled/uncontrolled wiring as Input.
|
|
85
|
+
*
|
|
86
|
+
* @param {Object} props
|
|
87
|
+
* @param {React.ReactNode} [props.label] - label above the field.
|
|
88
|
+
* @param {React.ComponentType<{size?:number}>} [props.lock] - optional lucide icon beside the label (.is-lk).
|
|
89
|
+
* @param {string} [props.hint] - helper text under the field.
|
|
90
|
+
* @param {string} [props.error] - error message; non-empty marks the field invalid.
|
|
91
|
+
* @param {boolean} [props.invalid=false] - force the invalid border (sets aria-invalid).
|
|
92
|
+
* @param {number} [props.rows=3] - visible rows.
|
|
93
|
+
* @param {boolean} [props.readOnly=false] - native readonly.
|
|
94
|
+
* @param {boolean} [props.disabled=false] - native disabled.
|
|
95
|
+
* @param {string} [props.value] - controlled value.
|
|
96
|
+
* @param {string} [props.defaultValue] - initial value for uncontrolled use.
|
|
97
|
+
* @param {(e:React.ChangeEvent<HTMLTextAreaElement>)=>void} [props.onChange] - change handler.
|
|
98
|
+
* @param {string} [props.id] - id; auto-generated + associated with the label when omitted.
|
|
99
|
+
* @returns {JSX.Element}
|
|
100
|
+
*/
|
|
101
|
+
export function Textarea({ label, lock, hint, error, invalid, rows, readOnly, disabled, value, defaultValue, onChange, id, ...rest }: {
|
|
102
|
+
label?: React.ReactNode;
|
|
103
|
+
lock?: React.ComponentType<{
|
|
104
|
+
size?: number;
|
|
105
|
+
}>;
|
|
106
|
+
hint?: string;
|
|
107
|
+
error?: string;
|
|
108
|
+
invalid?: boolean;
|
|
109
|
+
rows?: number;
|
|
110
|
+
readOnly?: boolean;
|
|
111
|
+
disabled?: boolean;
|
|
112
|
+
value?: string;
|
|
113
|
+
defaultValue?: string;
|
|
114
|
+
onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
115
|
+
id?: string;
|
|
116
|
+
}): JSX.Element;
|
|
117
|
+
/**
|
|
118
|
+
* Select — a styled native `<select>` inside a `.select-wrap` with a trailing ChevronDown (the chevron
|
|
119
|
+
* is decorative and ignores pointer events per the CSS). Pass options either as `children` (raw
|
|
120
|
+
* `<option>` elements) or an `options` array of {value,label}. Same label/hint/error +
|
|
121
|
+
* controlled/uncontrolled wiring as Input.
|
|
122
|
+
*
|
|
123
|
+
* Emits `<div class="is-field"><label/><div class="select-wrap"><select class="select"/>chevron</div>…</div>`.
|
|
124
|
+
*
|
|
125
|
+
* @param {Object} props
|
|
126
|
+
* @param {React.ReactNode} [props.label] - label above the field.
|
|
127
|
+
* @param {React.ComponentType<{size?:number}>} [props.lock] - optional lucide icon beside the label (.is-lk).
|
|
128
|
+
* @param {string} [props.hint] - helper text under the field.
|
|
129
|
+
* @param {string} [props.error] - error message; non-empty marks the field invalid.
|
|
130
|
+
* @param {boolean} [props.invalid=false] - force the invalid border (sets aria-invalid).
|
|
131
|
+
* @param {{value:string,label:string}[]} [props.options] - option list; alternative to passing <option> children.
|
|
132
|
+
* @param {React.ReactNode} [props.children] - raw <option> elements (used when `options` is omitted).
|
|
133
|
+
* @param {boolean} [props.disabled=false] - native disabled.
|
|
134
|
+
* @param {string} [props.value] - controlled value.
|
|
135
|
+
* @param {string} [props.defaultValue] - initial value for uncontrolled use.
|
|
136
|
+
* @param {(e:React.ChangeEvent<HTMLSelectElement>)=>void} [props.onChange] - change handler.
|
|
137
|
+
* @param {string} [props.id] - id; auto-generated + associated with the label when omitted.
|
|
138
|
+
* @returns {JSX.Element}
|
|
139
|
+
*/
|
|
140
|
+
export function Select({ label, lock, hint, error, invalid, options, children, disabled, value, defaultValue, onChange, id, ...rest }: {
|
|
141
|
+
label?: React.ReactNode;
|
|
142
|
+
lock?: React.ComponentType<{
|
|
143
|
+
size?: number;
|
|
144
|
+
}>;
|
|
145
|
+
hint?: string;
|
|
146
|
+
error?: string;
|
|
147
|
+
invalid?: boolean;
|
|
148
|
+
options?: {
|
|
149
|
+
value: string;
|
|
150
|
+
label: string;
|
|
151
|
+
}[];
|
|
152
|
+
children?: React.ReactNode;
|
|
153
|
+
disabled?: boolean;
|
|
154
|
+
value?: string;
|
|
155
|
+
defaultValue?: string;
|
|
156
|
+
onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
157
|
+
id?: string;
|
|
158
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export default meta;
|
|
2
|
+
export const Playground: {};
|
|
3
|
+
export namespace WithLabel {
|
|
4
|
+
namespace args {
|
|
5
|
+
let label: string;
|
|
6
|
+
let defaultValue: string;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export namespace Hint {
|
|
10
|
+
export namespace args_1 {
|
|
11
|
+
let label_1: string;
|
|
12
|
+
export { label_1 as label };
|
|
13
|
+
let defaultValue_1: string;
|
|
14
|
+
export { defaultValue_1 as defaultValue };
|
|
15
|
+
export let hint: string;
|
|
16
|
+
}
|
|
17
|
+
export { args_1 as args };
|
|
18
|
+
}
|
|
19
|
+
export namespace Error {
|
|
20
|
+
export namespace args_2 {
|
|
21
|
+
let label_2: string;
|
|
22
|
+
export { label_2 as label };
|
|
23
|
+
let defaultValue_2: string;
|
|
24
|
+
export { defaultValue_2 as defaultValue };
|
|
25
|
+
export let error: string;
|
|
26
|
+
}
|
|
27
|
+
export { args_2 as args };
|
|
28
|
+
}
|
|
29
|
+
export namespace Invalid {
|
|
30
|
+
export namespace args_3 {
|
|
31
|
+
let label_3: string;
|
|
32
|
+
export { label_3 as label };
|
|
33
|
+
let defaultValue_3: string;
|
|
34
|
+
export { defaultValue_3 as defaultValue };
|
|
35
|
+
export let invalid: boolean;
|
|
36
|
+
let hint_1: string;
|
|
37
|
+
export { hint_1 as hint };
|
|
38
|
+
}
|
|
39
|
+
export { args_3 as args };
|
|
40
|
+
}
|
|
41
|
+
export namespace ReadOnly {
|
|
42
|
+
export namespace args_4 {
|
|
43
|
+
let label_4: string;
|
|
44
|
+
export { label_4 as label };
|
|
45
|
+
export { Lock as lock };
|
|
46
|
+
let defaultValue_4: string;
|
|
47
|
+
export { defaultValue_4 as defaultValue };
|
|
48
|
+
export let readOnly: boolean;
|
|
49
|
+
let hint_2: string;
|
|
50
|
+
export { hint_2 as hint };
|
|
51
|
+
}
|
|
52
|
+
export { args_4 as args };
|
|
53
|
+
}
|
|
54
|
+
export namespace Disabled {
|
|
55
|
+
export namespace args_5 {
|
|
56
|
+
let label_5: string;
|
|
57
|
+
export { label_5 as label };
|
|
58
|
+
let defaultValue_5: string;
|
|
59
|
+
export { defaultValue_5 as defaultValue };
|
|
60
|
+
export let disabled: boolean;
|
|
61
|
+
}
|
|
62
|
+
export { args_5 as args };
|
|
63
|
+
}
|
|
64
|
+
export namespace WithIcon {
|
|
65
|
+
export namespace args_6 {
|
|
66
|
+
let label_6: string;
|
|
67
|
+
export { label_6 as label };
|
|
68
|
+
export { Search as iconLeft };
|
|
69
|
+
export let type: string;
|
|
70
|
+
let defaultValue_6: string;
|
|
71
|
+
export { defaultValue_6 as defaultValue };
|
|
72
|
+
export let placeholder: string;
|
|
73
|
+
}
|
|
74
|
+
export { args_6 as args };
|
|
75
|
+
}
|
|
76
|
+
export namespace IconError {
|
|
77
|
+
export namespace args_7 {
|
|
78
|
+
let label_7: string;
|
|
79
|
+
export { label_7 as label };
|
|
80
|
+
export { Search as iconLeft };
|
|
81
|
+
let type_1: string;
|
|
82
|
+
export { type_1 as type };
|
|
83
|
+
let defaultValue_7: string;
|
|
84
|
+
export { defaultValue_7 as defaultValue };
|
|
85
|
+
let error_1: string;
|
|
86
|
+
export { error_1 as error };
|
|
87
|
+
}
|
|
88
|
+
export { args_7 as args };
|
|
89
|
+
}
|
|
90
|
+
export namespace IconReadOnly {
|
|
91
|
+
export namespace args_8 {
|
|
92
|
+
let label_8: string;
|
|
93
|
+
export { label_8 as label };
|
|
94
|
+
export { Search as iconLeft };
|
|
95
|
+
let type_2: string;
|
|
96
|
+
export { type_2 as type };
|
|
97
|
+
let defaultValue_8: string;
|
|
98
|
+
export { defaultValue_8 as defaultValue };
|
|
99
|
+
let readOnly_1: boolean;
|
|
100
|
+
export { readOnly_1 as readOnly };
|
|
101
|
+
let hint_3: string;
|
|
102
|
+
export { hint_3 as hint };
|
|
103
|
+
}
|
|
104
|
+
export { args_8 as args };
|
|
105
|
+
}
|
|
106
|
+
export namespace SelectStory {
|
|
107
|
+
let name: string;
|
|
108
|
+
function render(): any;
|
|
109
|
+
}
|
|
110
|
+
export namespace TextareaStory {
|
|
111
|
+
let name_1: string;
|
|
112
|
+
export { name_1 as name };
|
|
113
|
+
export function render_1(): any;
|
|
114
|
+
export { render_1 as render };
|
|
115
|
+
}
|
|
116
|
+
export namespace FieldComposed {
|
|
117
|
+
let name_2: string;
|
|
118
|
+
export { name_2 as name };
|
|
119
|
+
export function render_2(): any;
|
|
120
|
+
export { render_2 as render };
|
|
121
|
+
}
|
|
122
|
+
declare namespace meta {
|
|
123
|
+
export let title: string;
|
|
124
|
+
export { Input as component };
|
|
125
|
+
export let tags: string[];
|
|
126
|
+
export let decorators: Function[];
|
|
127
|
+
export namespace argTypes {
|
|
128
|
+
export namespace label_9 {
|
|
129
|
+
let control: string;
|
|
130
|
+
}
|
|
131
|
+
export { label_9 as label };
|
|
132
|
+
export namespace hint_4 {
|
|
133
|
+
let control_1: string;
|
|
134
|
+
export { control_1 as control };
|
|
135
|
+
}
|
|
136
|
+
export { hint_4 as hint };
|
|
137
|
+
export namespace error_2 {
|
|
138
|
+
let control_2: string;
|
|
139
|
+
export { control_2 as control };
|
|
140
|
+
}
|
|
141
|
+
export { error_2 as error };
|
|
142
|
+
export namespace type_3 {
|
|
143
|
+
let control_3: string;
|
|
144
|
+
export { control_3 as control };
|
|
145
|
+
export let options: string[];
|
|
146
|
+
}
|
|
147
|
+
export { type_3 as type };
|
|
148
|
+
export namespace invalid_1 {
|
|
149
|
+
let control_4: string;
|
|
150
|
+
export { control_4 as control };
|
|
151
|
+
}
|
|
152
|
+
export { invalid_1 as invalid };
|
|
153
|
+
export namespace readOnly_2 {
|
|
154
|
+
let control_5: string;
|
|
155
|
+
export { control_5 as control };
|
|
156
|
+
}
|
|
157
|
+
export { readOnly_2 as readOnly };
|
|
158
|
+
export namespace disabled_1 {
|
|
159
|
+
let control_6: string;
|
|
160
|
+
export { control_6 as control };
|
|
161
|
+
}
|
|
162
|
+
export { disabled_1 as disabled };
|
|
163
|
+
export namespace defaultValue_9 {
|
|
164
|
+
let control_7: string;
|
|
165
|
+
export { control_7 as control };
|
|
166
|
+
}
|
|
167
|
+
export { defaultValue_9 as defaultValue };
|
|
168
|
+
}
|
|
169
|
+
export namespace args_9 {
|
|
170
|
+
let label_10: string;
|
|
171
|
+
export { label_10 as label };
|
|
172
|
+
let defaultValue_10: string;
|
|
173
|
+
export { defaultValue_10 as defaultValue };
|
|
174
|
+
let type_4: string;
|
|
175
|
+
export { type_4 as type };
|
|
176
|
+
}
|
|
177
|
+
export { args_9 as args };
|
|
178
|
+
}
|
|
179
|
+
import { Lock } from 'lucide-react';
|
|
180
|
+
import { Search } from 'lucide-react';
|
|
181
|
+
import Input from './Input.jsx';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** clamp any number into the 0..4 ramp domain (integers only). */
|
|
2
|
+
export function clampLevel(level: any): number;
|
|
3
|
+
/**
|
|
4
|
+
* coverage ratio (recorded / total) → ramp level. 0 / unknown = none; ≥ 0.9
|
|
5
|
+
* reads as fully covered. mirrors peasant's traceabilityLevel quantiles.
|
|
6
|
+
*/
|
|
7
|
+
export function coverageLevel(recorded: any, total: any): 0 | 2 | 4 | 1 | 3;
|
|
8
|
+
/** density (0..1) → ramp level for the bottom-edge effort bar. */
|
|
9
|
+
export function effortLevel(density: any): 0 | 2 | 4 | 1 | 3;
|
|
10
|
+
/** generic value-vs-max quantization (heatmap cells, sparklines). */
|
|
11
|
+
export function quantize(value: any, max: any): 0 | 2 | 4 | 1 | 3;
|
|
12
|
+
/** loc → node size class. small files are compact; large ones get real estate. */
|
|
13
|
+
export function locSize(loc: any): "sm" | "md" | "lg" | "xs" | "xl";
|
|
14
|
+
export function IntensitySwatch({ level, accent, size, label, className, ...rest }: {
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
level?: number;
|
|
17
|
+
accent: any;
|
|
18
|
+
size: any;
|
|
19
|
+
label: any;
|
|
20
|
+
className?: string;
|
|
21
|
+
}): any;
|
|
22
|
+
export function RampLegend({ title, words, className }: {
|
|
23
|
+
title?: string;
|
|
24
|
+
words?: string[];
|
|
25
|
+
className?: string;
|
|
26
|
+
}): any;
|
|
27
|
+
export function Heatmap({ values, levels, max, labels, ariaLabel, className }: {
|
|
28
|
+
values: any;
|
|
29
|
+
levels: any;
|
|
30
|
+
max: any;
|
|
31
|
+
labels: any;
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
className?: string;
|
|
34
|
+
}): any;
|
|
35
|
+
export function MapNode({ label, loc, coverage, recorded, total, selected, violation, effortPct, size, as, onClick, className, ...rest }: {
|
|
36
|
+
[x: string]: any;
|
|
37
|
+
label: any;
|
|
38
|
+
loc: any;
|
|
39
|
+
coverage?: number;
|
|
40
|
+
recorded: any;
|
|
41
|
+
total: any;
|
|
42
|
+
selected?: boolean;
|
|
43
|
+
violation?: number;
|
|
44
|
+
effortPct: any;
|
|
45
|
+
size: any;
|
|
46
|
+
as?: string;
|
|
47
|
+
onClick: any;
|
|
48
|
+
className?: string;
|
|
49
|
+
}): any;
|
|
50
|
+
export function IntensityScope({ children, className, ...rest }: {
|
|
51
|
+
[x: string]: any;
|
|
52
|
+
children: any;
|
|
53
|
+
className?: string;
|
|
54
|
+
}): any;
|
|
55
|
+
export default MapNode;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export default meta;
|
|
2
|
+
export const Playground: {};
|
|
3
|
+
export namespace Ramp {
|
|
4
|
+
function render(): any;
|
|
5
|
+
function play({ canvasElement }: {
|
|
6
|
+
canvasElement: any;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export namespace Nodes {
|
|
10
|
+
export function render_1(): any;
|
|
11
|
+
export { render_1 as render };
|
|
12
|
+
export function play_1({ canvasElement }: {
|
|
13
|
+
canvasElement: any;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
export { play_1 as play };
|
|
16
|
+
}
|
|
17
|
+
export namespace Sizes {
|
|
18
|
+
export function render_2(): any;
|
|
19
|
+
export { render_2 as render };
|
|
20
|
+
}
|
|
21
|
+
export namespace HeatmapRow {
|
|
22
|
+
export let name: string;
|
|
23
|
+
export function render_3(): any;
|
|
24
|
+
export { render_3 as render };
|
|
25
|
+
export function play_2({ canvasElement }: {
|
|
26
|
+
canvasElement: any;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
export { play_2 as play };
|
|
29
|
+
}
|
|
30
|
+
declare namespace meta {
|
|
31
|
+
export let title: string;
|
|
32
|
+
export { MapNode as component };
|
|
33
|
+
export let tags: string[];
|
|
34
|
+
export namespace argTypes {
|
|
35
|
+
namespace label {
|
|
36
|
+
let control: string;
|
|
37
|
+
}
|
|
38
|
+
namespace loc {
|
|
39
|
+
export namespace control_1 {
|
|
40
|
+
let type: string;
|
|
41
|
+
let min: number;
|
|
42
|
+
let max: number;
|
|
43
|
+
}
|
|
44
|
+
export { control_1 as control };
|
|
45
|
+
}
|
|
46
|
+
namespace coverage {
|
|
47
|
+
export namespace control_2 {
|
|
48
|
+
let type_1: string;
|
|
49
|
+
export { type_1 as type };
|
|
50
|
+
let min_1: number;
|
|
51
|
+
export { min_1 as min };
|
|
52
|
+
let max_1: number;
|
|
53
|
+
export { max_1 as max };
|
|
54
|
+
export let step: number;
|
|
55
|
+
}
|
|
56
|
+
export { control_2 as control };
|
|
57
|
+
}
|
|
58
|
+
namespace selected {
|
|
59
|
+
let control_3: string;
|
|
60
|
+
export { control_3 as control };
|
|
61
|
+
}
|
|
62
|
+
namespace violation {
|
|
63
|
+
export namespace control_4 {
|
|
64
|
+
let type_2: string;
|
|
65
|
+
export { type_2 as type };
|
|
66
|
+
let min_2: number;
|
|
67
|
+
export { min_2 as min };
|
|
68
|
+
let max_2: number;
|
|
69
|
+
export { max_2 as max };
|
|
70
|
+
}
|
|
71
|
+
export { control_4 as control };
|
|
72
|
+
}
|
|
73
|
+
namespace effortPct {
|
|
74
|
+
export namespace control_5 {
|
|
75
|
+
let type_3: string;
|
|
76
|
+
export { type_3 as type };
|
|
77
|
+
let min_3: number;
|
|
78
|
+
export { min_3 as min };
|
|
79
|
+
let max_3: number;
|
|
80
|
+
export { max_3 as max };
|
|
81
|
+
let step_1: number;
|
|
82
|
+
export { step_1 as step };
|
|
83
|
+
}
|
|
84
|
+
export { control_5 as control };
|
|
85
|
+
}
|
|
86
|
+
namespace size {
|
|
87
|
+
let control_6: string;
|
|
88
|
+
export { control_6 as control };
|
|
89
|
+
export let options: string[];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export namespace args {
|
|
93
|
+
let label_1: string;
|
|
94
|
+
export { label_1 as label };
|
|
95
|
+
let loc_1: number;
|
|
96
|
+
export { loc_1 as loc };
|
|
97
|
+
let coverage_1: number;
|
|
98
|
+
export { coverage_1 as coverage };
|
|
99
|
+
let selected_1: boolean;
|
|
100
|
+
export { selected_1 as selected };
|
|
101
|
+
let violation_1: number;
|
|
102
|
+
export { violation_1 as violation };
|
|
103
|
+
let effortPct_1: number;
|
|
104
|
+
export { effortPct_1 as effortPct };
|
|
105
|
+
}
|
|
106
|
+
export let decorators: ((Story: any) => any)[];
|
|
107
|
+
}
|
|
108
|
+
import MapNode from './Intensity.jsx';
|