@schemavaults/ui 0.113.1 → 0.115.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/components/ui/index.d.ts +4 -0
  2. package/dist/components/ui/index.js +2 -0
  3. package/dist/components/ui/index.js.map +1 -1
  4. package/dist/components/ui/key-value-editor/index.d.ts +6 -0
  5. package/dist/components/ui/key-value-editor/index.js +4 -0
  6. package/dist/components/ui/key-value-editor/index.js.map +1 -0
  7. package/dist/components/ui/key-value-editor/key-value-editor-variants.d.ts +9 -0
  8. package/dist/components/ui/key-value-editor/key-value-editor-variants.js +10 -0
  9. package/dist/components/ui/key-value-editor/key-value-editor-variants.js.map +1 -0
  10. package/dist/components/ui/key-value-editor/key-value-editor.d.ts +73 -0
  11. package/dist/components/ui/key-value-editor/key-value-editor.js +212 -0
  12. package/dist/components/ui/key-value-editor/key-value-editor.js.map +1 -0
  13. package/dist/components/ui/key-value-editor/parse-dotenv.d.ts +24 -0
  14. package/dist/components/ui/key-value-editor/parse-dotenv.js +77 -0
  15. package/dist/components/ui/key-value-editor/parse-dotenv.js.map +1 -0
  16. package/dist/components/ui/waffle-chart/allocate-waffle-cells.d.ts +10 -0
  17. package/dist/components/ui/waffle-chart/allocate-waffle-cells.js +37 -0
  18. package/dist/components/ui/waffle-chart/allocate-waffle-cells.js.map +1 -0
  19. package/dist/components/ui/waffle-chart/index.d.ts +4 -0
  20. package/dist/components/ui/waffle-chart/index.js +3 -0
  21. package/dist/components/ui/waffle-chart/index.js.map +1 -0
  22. package/dist/components/ui/waffle-chart/waffle-chart.d.ts +85 -0
  23. package/dist/components/ui/waffle-chart/waffle-chart.js +157 -0
  24. package/dist/components/ui/waffle-chart/waffle-chart.js.map +1 -0
  25. package/package.json +2 -2
@@ -210,6 +210,8 @@ export * from "./bar-list";
210
210
  export type * from "./bar-list";
211
211
  export * from "./treemap";
212
212
  export type * from "./treemap";
213
+ export * from "./waffle-chart";
214
+ export type * from "./waffle-chart";
213
215
  export * from "./comparison-slider";
214
216
  export type * from "./comparison-slider";
215
217
  export * from "./theme-selector";
@@ -254,3 +256,5 @@ export * from "./toolbar";
254
256
  export type * from "./toolbar";
255
257
  export * from "./attachment-card";
256
258
  export type * from "./attachment-card";
259
+ export * from "./key-value-editor";
260
+ export type * from "./key-value-editor";
@@ -104,6 +104,7 @@ export * from "./scatter-plot";
104
104
  export * from "./histogram";
105
105
  export * from "./bar-list";
106
106
  export * from "./treemap";
107
+ export * from "./waffle-chart";
107
108
  export * from "./comparison-slider";
108
109
  export * from "./theme-selector";
109
110
  export * from "./tree-view";
@@ -126,4 +127,5 @@ export * from "./split-button";
126
127
  export * from "./ribbon";
127
128
  export * from "./toolbar";
128
129
  export * from "./attachment-card";
130
+ export * from "./key-value-editor";
129
131
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAGzB,cAAc,uBAAuB,CAAC;AAGtC,cAAc,aAAa,CAAC;AAG5B,cAAc,eAAe,CAAC;AAG9B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,mBAAmB,CAAC;AAGlC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,UAAU,CAAC;AAGzB,cAAc,SAAS,CAAC;AAGxB,cAAc,kBAAkB,CAAC;AAGjC,cAAc,aAAa,CAAC;AAG5B,cAAc,kCAAkC,CAAC;AAGjD,cAAc,cAAc,CAAC;AAG7B,cAAc,YAAY,CAAC;AAG3B,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC;AAG1B,cAAc,YAAY,CAAC;AAG3B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,QAAQ,CAAC;AAGvB,cAAc,QAAQ,C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AAC;AAG1B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { KeyValueEditor, KeyValueEditor as default, keyValueEditorInputVariants, keyValueEditorIconButtonVariants, } from "./key-value-editor";
2
+ export type { KeyValueEditorProps, KeyValueEntry } from "./key-value-editor";
3
+ export { keyValueEditorSizeIds, keyValueEditorKeyFormatIds, } from "./key-value-editor-variants";
4
+ export type { KeyValueEditorSize, KeyValueEditorKeyFormat, } from "./key-value-editor-variants";
5
+ export { parseDotenv, serializeDotenv, toEnvVarName } from "./parse-dotenv";
6
+ export type { DotenvEntry } from "./parse-dotenv";
@@ -0,0 +1,4 @@
1
+ export { KeyValueEditor, KeyValueEditor as default, keyValueEditorInputVariants, keyValueEditorIconButtonVariants, } from "./key-value-editor";
2
+ export { keyValueEditorSizeIds, keyValueEditorKeyFormatIds, } from "./key-value-editor-variants";
3
+ export { parseDotenv, serializeDotenv, toEnvVarName } from "./parse-dotenv";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/key-value-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,IAAI,OAAO,EACzB,2BAA2B,EAC3B,gCAAgC,GACjC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const keyValueEditorSizeIds: readonly ["sm", "default", "lg"];
2
+ export type KeyValueEditorSize = (typeof keyValueEditorSizeIds)[number];
3
+ export declare const keyValueEditorKeyFormatIds: readonly ["none", "env"];
4
+ /**
5
+ * How keys are normalised as they are typed.
6
+ * - `none` — keys are kept verbatim.
7
+ * - `env` — keys are forced to `UPPER_SNAKE_CASE` environment-variable names.
8
+ */
9
+ export type KeyValueEditorKeyFormat = (typeof keyValueEditorKeyFormatIds)[number];
@@ -0,0 +1,10 @@
1
+ export const keyValueEditorSizeIds = [
2
+ "sm",
3
+ "default",
4
+ "lg",
5
+ ];
6
+ export const keyValueEditorKeyFormatIds = [
7
+ "none",
8
+ "env",
9
+ ];
10
+ //# sourceMappingURL=key-value-editor-variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-value-editor-variants.js","sourceRoot":"","sources":["../../../../src/components/ui/key-value-editor/key-value-editor-variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI;IACJ,SAAS;IACT,IAAI;CACgC,CAAC;AAIvC,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,MAAM;IACN,KAAK;CAC+B,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ import { keyValueEditorKeyFormatIds, keyValueEditorSizeIds, type KeyValueEditorKeyFormat, type KeyValueEditorSize } from "./key-value-editor-variants";
3
+ declare const keyValueEditorInputVariants: (props?: ({
4
+ size?: "sm" | "default" | "lg" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare const keyValueEditorIconButtonVariants: (props?: ({
7
+ size?: "sm" | "default" | "lg" | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
+ export interface KeyValueEntry {
10
+ key: string;
11
+ value: string;
12
+ /** Marks the value as sensitive: it is masked until revealed. */
13
+ secret?: boolean;
14
+ }
15
+ export interface KeyValueEditorProps {
16
+ /** Controlled list of entries. Provide alongside `onValueChange`. */
17
+ value?: readonly KeyValueEntry[];
18
+ /** Initial entries for uncontrolled usage. */
19
+ defaultValue?: readonly KeyValueEntry[];
20
+ /** Fires whenever any entry is added, removed or edited. */
21
+ onValueChange?: (entries: KeyValueEntry[]) => void;
22
+ /** Visual size of the row inputs and buttons. */
23
+ size?: KeyValueEditorSize;
24
+ /** How keys are normalised as they are typed. Defaults to `none`. */
25
+ keyFormat?: KeyValueEditorKeyFormat;
26
+ /**
27
+ * Keys that don't match are flagged invalid. Empty keys are never
28
+ * checked against it.
29
+ */
30
+ keyPattern?: RegExp;
31
+ /** Message shown under a key that fails `keyPattern`. */
32
+ keyPatternMessage?: string;
33
+ /** Flag rows whose key repeats an earlier row's key. Defaults to `true`. */
34
+ validateDuplicates?: boolean;
35
+ /** Show a per-row toggle for marking a value secret. Defaults to `false`. */
36
+ allowSecrets?: boolean;
37
+ /**
38
+ * Split pasted `.env` text (`KEY=value` lines) into rows when it is
39
+ * pasted into a key field. Defaults to `true`.
40
+ */
41
+ parseDotenvOnPaste?: boolean;
42
+ /** Maximum number of rows. The add button disables at the cap. */
43
+ maxRows?: number;
44
+ /** Header label above the key column. Defaults to `"Key"`. */
45
+ keyLabel?: string;
46
+ /** Header label above the value column. Defaults to `"Value"`. */
47
+ valueLabel?: string;
48
+ /** Hide the column header row. */
49
+ hideHeader?: boolean;
50
+ keyPlaceholder?: string;
51
+ valuePlaceholder?: string;
52
+ /** Label for the add-row button. Defaults to `"Add row"`. */
53
+ addLabel?: string;
54
+ /** Rendered in place of the rows when there are none. */
55
+ emptyState?: ReactNode;
56
+ /** Dims the editor and disables every control. */
57
+ disabled?: boolean;
58
+ /** Shows entries without letting them be changed. */
59
+ readOnly?: boolean;
60
+ /** Accessible name for the editor group. */
61
+ ariaLabel?: string;
62
+ /** Form field name; each row submits `name[i][key]` / `name[i][value]`. */
63
+ name?: string;
64
+ className?: string;
65
+ }
66
+ declare function KeyValueEditor({ value, defaultValue, onValueChange, size, keyFormat, keyPattern, keyPatternMessage, validateDuplicates, allowSecrets, parseDotenvOnPaste, maxRows, keyLabel, valueLabel, hideHeader, keyPlaceholder, valuePlaceholder, addLabel, emptyState, disabled, readOnly, ariaLabel, name, className, }: KeyValueEditorProps): ReactElement;
67
+ declare namespace KeyValueEditor {
68
+ var displayName: string;
69
+ }
70
+ export { KeyValueEditor };
71
+ export { keyValueEditorInputVariants, keyValueEditorIconButtonVariants, keyValueEditorKeyFormatIds, keyValueEditorSizeIds, };
72
+ export type { KeyValueEditorKeyFormat, KeyValueEditorSize };
73
+ export default KeyValueEditor;
@@ -0,0 +1,212 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useEffect, useId, useMemo, useRef, useState, } from "react";
4
+ import { cva } from "class-variance-authority";
5
+ import { Eye, EyeOff, Lock, LockOpen, Plus, Trash2 } from "lucide-react";
6
+ import { cn } from "../../../lib/utils";
7
+ import { parseDotenv, toEnvVarName } from "./parse-dotenv";
8
+ import { keyValueEditorKeyFormatIds, keyValueEditorSizeIds, } from "./key-value-editor-variants";
9
+ const keyValueEditorInputVariants = cva("w-full min-w-0 rounded-md border border-input bg-background px-3 ring-offset-background transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 read-only:bg-muted/40 aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-visible:ring-destructive", {
10
+ variants: {
11
+ size: {
12
+ sm: "h-8 text-xs",
13
+ default: "h-10 text-sm",
14
+ lg: "h-12 text-base",
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ size: "default",
19
+ },
20
+ });
21
+ const keyValueEditorIconButtonVariants = cva("inline-flex shrink-0 items-center justify-center rounded-md text-muted-foreground ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4", {
22
+ variants: {
23
+ size: {
24
+ sm: "size-8",
25
+ default: "size-10",
26
+ lg: "size-12",
27
+ },
28
+ },
29
+ defaultVariants: {
30
+ size: "default",
31
+ },
32
+ });
33
+ // Header spacers line the column labels up with the row action buttons.
34
+ const actionSpacerClass = {
35
+ sm: "w-8 shrink-0",
36
+ default: "w-10 shrink-0",
37
+ lg: "w-12 shrink-0",
38
+ };
39
+ let rowIdCounter = 0;
40
+ function nextRowId() {
41
+ rowIdCounter += 1;
42
+ return `kv-row-${rowIdCounter}`;
43
+ }
44
+ function syncRowIds(ids, length) {
45
+ if (ids.length === length)
46
+ return ids;
47
+ if (ids.length > length)
48
+ return ids.slice(0, length);
49
+ const next = [...ids];
50
+ while (next.length < length)
51
+ next.push(nextRowId());
52
+ return next;
53
+ }
54
+ function KeyValueEditor({ value, defaultValue, onValueChange, size = "default", keyFormat = "none", keyPattern, keyPatternMessage = "Invalid key", validateDuplicates = true, allowSecrets = false, parseDotenvOnPaste = true, maxRows, keyLabel = "Key", valueLabel = "Value", hideHeader = false, keyPlaceholder = "KEY", valuePlaceholder = "value", addLabel = "Add row", emptyState, disabled = false, readOnly = false, ariaLabel, name, className, }) {
55
+ const isControlled = value !== undefined;
56
+ const [internalEntries, setInternalEntries] = useState(() => defaultValue ? defaultValue.map((e) => ({ ...e })) : []);
57
+ const entries = isControlled
58
+ ? value
59
+ : internalEntries;
60
+ // Stable React keys per row, kept parallel to `entries`. Mutations below
61
+ // splice this array in step with the entries; an external length change
62
+ // (controlled mode) pads or trims it.
63
+ const rowIdsRef = useRef([]);
64
+ rowIdsRef.current = syncRowIds(rowIdsRef.current, entries.length);
65
+ const rowIds = rowIdsRef.current;
66
+ const [revealed, setRevealed] = useState(() => new Set());
67
+ const keyInputRefs = useRef(new Map());
68
+ const [pendingFocusId, setPendingFocusId] = useState(null);
69
+ const reactId = useId();
70
+ const editable = !disabled && !readOnly;
71
+ const atCap = maxRows !== undefined && entries.length >= maxRows;
72
+ useEffect(() => {
73
+ if (pendingFocusId === null)
74
+ return;
75
+ keyInputRefs.current.get(pendingFocusId)?.focus();
76
+ setPendingFocusId(null);
77
+ }, [pendingFocusId]);
78
+ const commit = useCallback((next, nextIds) => {
79
+ rowIdsRef.current = nextIds;
80
+ if (!isControlled)
81
+ setInternalEntries(next);
82
+ onValueChange?.(next);
83
+ }, [isControlled, onValueChange]);
84
+ const formatKey = useCallback((raw) => (keyFormat === "env" ? toEnvVarName(raw) : raw), [keyFormat]);
85
+ const updateEntry = (index, patch) => {
86
+ const next = entries.map((entry, i) => i === index ? { ...entry, ...patch } : entry);
87
+ commit(next, rowIds);
88
+ };
89
+ const insertEntries = (at, inserted, replaceCount = 0) => {
90
+ const room = maxRows === undefined
91
+ ? inserted.length
92
+ : Math.max(0, maxRows - entries.length + replaceCount);
93
+ const accepted = inserted.slice(0, room);
94
+ const newIds = accepted.map(() => nextRowId());
95
+ const next = [...entries];
96
+ next.splice(at, replaceCount, ...accepted);
97
+ const nextIds = [...rowIds];
98
+ nextIds.splice(at, replaceCount, ...newIds);
99
+ commit(next, nextIds);
100
+ return newIds;
101
+ };
102
+ const addRow = () => {
103
+ if (!editable || atCap)
104
+ return;
105
+ const [id] = insertEntries(entries.length, [{ key: "", value: "" }]);
106
+ if (id)
107
+ setPendingFocusId(id);
108
+ };
109
+ const removeRow = (index) => {
110
+ if (!editable)
111
+ return;
112
+ const nextIds = rowIds.filter((_, i) => i !== index);
113
+ commit(entries.filter((_, i) => i !== index), nextIds);
114
+ const focusId = nextIds[Math.min(index, nextIds.length - 1)];
115
+ if (focusId)
116
+ setPendingFocusId(focusId);
117
+ };
118
+ const toggleRevealed = (id) => {
119
+ setRevealed((prev) => {
120
+ const next = new Set(prev);
121
+ if (next.has(id))
122
+ next.delete(id);
123
+ else
124
+ next.add(id);
125
+ return next;
126
+ });
127
+ };
128
+ const handleKeyPaste = (index, event) => {
129
+ if (!parseDotenvOnPaste || !editable)
130
+ return;
131
+ const text = event.clipboardData.getData("text");
132
+ if (!text.includes("="))
133
+ return;
134
+ const parsed = parseDotenv(text);
135
+ if (parsed.length === 0)
136
+ return;
137
+ event.preventDefault();
138
+ const current = entries[index];
139
+ const replaceCurrent = current !== undefined &&
140
+ current.key.length === 0 &&
141
+ current.value.length === 0;
142
+ insertEntries(replaceCurrent ? index : index + 1, parsed.map((p) => ({ key: formatKey(p.key), value: p.value })), replaceCurrent ? 1 : 0);
143
+ };
144
+ const handleValueKeyDown = (index, event) => {
145
+ if (event.key !== "Enter" || !editable)
146
+ return;
147
+ event.preventDefault();
148
+ if (index === entries.length - 1) {
149
+ addRow();
150
+ return;
151
+ }
152
+ const nextId = rowIds[index + 1];
153
+ if (nextId)
154
+ keyInputRefs.current.get(nextId)?.focus();
155
+ };
156
+ const issues = useMemo(() => {
157
+ const seen = new Set();
158
+ return entries.map((entry) => {
159
+ const key = entry.key.trim();
160
+ if (key.length === 0) {
161
+ return entry.value.length > 0 ? { message: "Key is required" } : null;
162
+ }
163
+ if (validateDuplicates && seen.has(key)) {
164
+ return { message: `Duplicate key "${key}"` };
165
+ }
166
+ seen.add(key);
167
+ if (keyPattern && !keyPattern.test(key)) {
168
+ return { message: keyPatternMessage };
169
+ }
170
+ return null;
171
+ });
172
+ }, [entries, keyPattern, keyPatternMessage, validateDuplicates]);
173
+ const keyHeaderId = `${reactId}-key-header`;
174
+ const valueHeaderId = `${reactId}-value-header`;
175
+ const actionCount = (allowSecrets ? 1 : 0) +
176
+ (allowSecrets && !readOnly ? 1 : 0) +
177
+ (editable ? 1 : 0);
178
+ const iconButtonClass = keyValueEditorIconButtonVariants({ size });
179
+ return (_jsxs("div", { role: "group", "aria-label": ariaLabel, "aria-disabled": disabled || undefined, "data-slot": "key-value-editor", "data-disabled": disabled || undefined, className: cn("flex w-full flex-col gap-2 text-sm data-[disabled=true]:opacity-60", className), children: [!hideHeader && entries.length > 0 && (_jsxs("div", { "aria-hidden": true, "data-slot": "key-value-editor-header", className: "flex items-center gap-2 px-0.5 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: [_jsx("span", { id: keyHeaderId, className: "flex-1 basis-0", children: keyLabel }), _jsx("span", { id: valueHeaderId, className: "flex-[1.5] basis-0", children: valueLabel }), _jsx("span", { className: "flex shrink-0 gap-0.5", children: Array.from({ length: actionCount }, (_, i) => (_jsx("span", { className: actionSpacerClass[size] }, i))) })] })), entries.length === 0 && (_jsx("div", { "data-slot": "key-value-editor-empty", className: "rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground", children: emptyState ?? "No entries yet." })), _jsx("ul", { className: "flex flex-col gap-2", "data-slot": "key-value-editor-rows", children: entries.map((entry, index) => {
180
+ const id = rowIds[index];
181
+ const issue = issues[index];
182
+ const issueId = issue ? `${reactId}-${id}-issue` : undefined;
183
+ const isSecret = allowSecrets && entry.secret === true;
184
+ const isRevealed = revealed.has(id);
185
+ const rowLabel = entry.key.trim() || `row ${index + 1}`;
186
+ return (_jsxs("li", { "data-slot": "key-value-editor-row", "data-invalid": issue ? true : undefined, className: "flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("input", { ref: (el) => {
187
+ if (el)
188
+ keyInputRefs.current.set(id, el);
189
+ else
190
+ keyInputRefs.current.delete(id);
191
+ }, type: "text", name: name ? `${name}[${index}][key]` : undefined, value: entry.key, placeholder: keyPlaceholder, disabled: disabled, readOnly: readOnly, spellCheck: false, autoComplete: "off", "aria-label": `${keyLabel} ${index + 1}`, "aria-invalid": issue ? true : undefined, "aria-describedby": issueId, onChange: (e) => updateEntry(index, { key: formatKey(e.target.value) }), onPaste: (e) => handleKeyPaste(index, e), className: cn(keyValueEditorInputVariants({ size }), "flex-1 basis-0 font-mono") }), _jsx("input", { type: isSecret && !isRevealed ? "password" : "text", name: name ? `${name}[${index}][value]` : undefined, value: entry.value, placeholder: valuePlaceholder, disabled: disabled, readOnly: readOnly, spellCheck: false, autoComplete: "off", "aria-label": `${valueLabel} for ${rowLabel}`, onChange: (e) => updateEntry(index, { value: e.target.value }), onKeyDown: (e) => handleValueKeyDown(index, e), className: cn(keyValueEditorInputVariants({ size }), "flex-[1.5] basis-0 font-mono") }), actionCount > 0 && (_jsxs("div", { className: "flex shrink-0 items-center gap-0.5", children: [allowSecrets && (_jsx("button", { type: "button", disabled: disabled || (readOnly && !isSecret), "aria-pressed": readOnly ? undefined : isSecret, "aria-label": readOnly
192
+ ? isRevealed
193
+ ? `Hide value of ${rowLabel}`
194
+ : `Reveal value of ${rowLabel}`
195
+ : isSecret
196
+ ? `Mark ${rowLabel} as not secret`
197
+ : `Mark ${rowLabel} as secret`, title: isSecret ? "Secret" : "Not secret", onClick: () => {
198
+ if (readOnly) {
199
+ toggleRevealed(id);
200
+ return;
201
+ }
202
+ updateEntry(index, { secret: !isSecret });
203
+ }, className: cn(iconButtonClass, isSecret && "text-primary", readOnly && !isSecret && "invisible"), children: readOnly ? (isRevealed ? (_jsx(EyeOff, {})) : (_jsx(Eye, {}))) : isSecret ? (_jsx(Lock, {})) : (_jsx(LockOpen, {})) })), allowSecrets && !readOnly && (_jsx("button", { type: "button", disabled: disabled || !isSecret, "aria-label": isRevealed
204
+ ? `Hide value of ${rowLabel}`
205
+ : `Reveal value of ${rowLabel}`, "aria-hidden": !isSecret || undefined, tabIndex: isSecret ? undefined : -1, onClick: () => toggleRevealed(id), className: cn(iconButtonClass, !isSecret && "invisible"), children: isRevealed ? _jsx(EyeOff, {}) : _jsx(Eye, {}) })), editable && (_jsx("button", { type: "button", "aria-label": `Remove ${rowLabel}`, onClick: () => removeRow(index), className: cn(iconButtonClass, "hover:bg-destructive/10 hover:text-destructive"), children: _jsx(Trash2, {}) }))] }))] }), issue && (_jsx("p", { id: issueId, role: "alert", className: "px-0.5 text-xs font-medium text-destructive", children: issue.message }))] }, id));
206
+ }) }), editable && (_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("button", { type: "button", onClick: addRow, disabled: atCap, "data-slot": "key-value-editor-add", className: "inline-flex h-9 items-center gap-1.5 rounded-md border border-dashed border-input px-3 text-sm font-medium text-muted-foreground ring-offset-background transition-colors hover:border-primary hover:bg-primary/5 hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4", children: [_jsx(Plus, { "aria-hidden": true }), addLabel] }), maxRows !== undefined && (_jsxs("span", { className: "text-xs tabular-nums text-muted-foreground", "aria-live": "polite", children: [entries.length, " / ", maxRows] }))] }))] }));
207
+ }
208
+ KeyValueEditor.displayName = "KeyValueEditor";
209
+ export { KeyValueEditor };
210
+ export { keyValueEditorInputVariants, keyValueEditorIconButtonVariants, keyValueEditorKeyFormatIds, keyValueEditorSizeIds, };
211
+ export default KeyValueEditor;
212
+ //# sourceMappingURL=key-value-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-value-editor.js","sourceRoot":"","sources":["../../../../src/components/ui/key-value-editor/key-value-editor.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,GAKT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GAGtB,MAAM,6BAA6B,CAAC;AAErC,MAAM,2BAA2B,GAAG,GAAG,CACrC,oaAAoa,EACpa;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,EAAE,EAAE,aAAa;YACjB,OAAO,EAAE,cAAc;YACvB,EAAE,EAAE,gBAAgB;SACwB;KAC/C;IACD,eAAe,EAAE;QACf,IAAI,EAAE,SAAS;KAChB;CACF,CACF,CAAC;AAEF,MAAM,gCAAgC,GAAG,GAAG,CAC1C,6UAA6U,EAC7U;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,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C,aACtD,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,KAAK,eACL,sBAAsB,EAChC,SAAS,EAAC,0YAA0Y,aAEpZ,KAAC,IAAI,0BAAe,EACnB,QAAQ,IACF,EACR,OAAO,KAAK,SAAS,IAAI,CACxB,gBACE,SAAS,EAAC,4CAA4C,eAC5C,QAAQ,aAEjB,OAAO,CAAC,MAAM,SAAK,OAAO,IACtB,CACR,IACG,CACP,IACG,CACP,CAAC;AACJ,CAAC;AAED,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,OAAO,EACL,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,qBAAqB,GACtB,CAAC;AAGF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,24 @@
1
+ export interface DotenvEntry {
2
+ key: string;
3
+ value: string;
4
+ }
5
+ /**
6
+ * Parses `.env`-style text (`KEY=value` per line) into ordered entries.
7
+ *
8
+ * Blank lines and `#` comments are skipped, a leading `export ` is dropped,
9
+ * and single/double quoted values are unwrapped. Lines without an `=` are
10
+ * ignored. Duplicate keys are kept in order — the caller decides how to
11
+ * surface them.
12
+ */
13
+ export declare function parseDotenv(text: string): DotenvEntry[];
14
+ /**
15
+ * Serialises entries back into `.env` text. Rows with an empty key are
16
+ * dropped; values containing whitespace, quotes, `#` or `=` are double
17
+ * quoted so `parseDotenv(serializeDotenv(x))` round-trips.
18
+ */
19
+ export declare function serializeDotenv(entries: readonly DotenvEntry[]): string;
20
+ /**
21
+ * Normalises free text into an `UPPER_SNAKE_CASE` environment-variable name:
22
+ * `"api key"` → `"API_KEY"`, `"db-url"` → `"DB_URL"`.
23
+ */
24
+ export declare function toEnvVarName(raw: string): string;
@@ -0,0 +1,77 @@
1
+ function unquote(raw) {
2
+ const trimmed = raw.trim();
3
+ if (trimmed.length >= 2) {
4
+ const first = trimmed[0];
5
+ const last = trimmed[trimmed.length - 1];
6
+ if (first === '"' && last === '"') {
7
+ return trimmed
8
+ .slice(1, -1)
9
+ .replace(/\\n/g, "\n")
10
+ .replace(/\\"/g, '"')
11
+ .replace(/\\\\/g, "\\");
12
+ }
13
+ if (first === "'" && last === "'") {
14
+ return trimmed.slice(1, -1);
15
+ }
16
+ }
17
+ // Unquoted values may carry a trailing ` # comment`.
18
+ const commentAt = trimmed.search(/\s#/);
19
+ return commentAt === -1 ? trimmed : trimmed.slice(0, commentAt).trimEnd();
20
+ }
21
+ /**
22
+ * Parses `.env`-style text (`KEY=value` per line) into ordered entries.
23
+ *
24
+ * Blank lines and `#` comments are skipped, a leading `export ` is dropped,
25
+ * and single/double quoted values are unwrapped. Lines without an `=` are
26
+ * ignored. Duplicate keys are kept in order — the caller decides how to
27
+ * surface them.
28
+ */
29
+ export function parseDotenv(text) {
30
+ const entries = [];
31
+ for (const rawLine of text.split(/\r?\n/)) {
32
+ const line = rawLine.trim();
33
+ if (line.length === 0 || line.startsWith("#"))
34
+ continue;
35
+ const withoutExport = line.replace(/^export\s+/, "");
36
+ const eq = withoutExport.indexOf("=");
37
+ if (eq <= 0)
38
+ continue;
39
+ const key = withoutExport.slice(0, eq).trim();
40
+ if (key.length === 0)
41
+ continue;
42
+ entries.push({ key, value: unquote(withoutExport.slice(eq + 1)) });
43
+ }
44
+ return entries;
45
+ }
46
+ function quoteIfNeeded(value) {
47
+ if (value.length === 0)
48
+ return "";
49
+ if (!/[\s#"'\\=]/.test(value))
50
+ return value;
51
+ return `"${value
52
+ .replace(/\\/g, "\\\\")
53
+ .replace(/"/g, '\\"')
54
+ .replace(/\n/g, "\\n")}"`;
55
+ }
56
+ /**
57
+ * Serialises entries back into `.env` text. Rows with an empty key are
58
+ * dropped; values containing whitespace, quotes, `#` or `=` are double
59
+ * quoted so `parseDotenv(serializeDotenv(x))` round-trips.
60
+ */
61
+ export function serializeDotenv(entries) {
62
+ return entries
63
+ .filter((entry) => entry.key.trim().length > 0)
64
+ .map((entry) => `${entry.key.trim()}=${quoteIfNeeded(entry.value)}`)
65
+ .join("\n");
66
+ }
67
+ /**
68
+ * Normalises free text into an `UPPER_SNAKE_CASE` environment-variable name:
69
+ * `"api key"` → `"API_KEY"`, `"db-url"` → `"DB_URL"`.
70
+ */
71
+ export function toEnvVarName(raw) {
72
+ return raw
73
+ .toUpperCase()
74
+ .replace(/[^A-Z0-9_]+/g, "_")
75
+ .replace(/^(\d)/, "_$1");
76
+ }
77
+ //# sourceMappingURL=parse-dotenv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-dotenv.js","sourceRoot":"","sources":["../../../../src/components/ui/key-value-editor/parse-dotenv.ts"],"names":[],"mappings":"AAKA,SAAS,OAAO,CAAC,GAAW;IAC1B,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,IAAI,KAAK,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YAClC,OAAO,OAAO;iBACX,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;iBACZ,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;iBACrB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;iBACpB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC;QACD,IAAI,KAAK,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YAClC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IACD,qDAAqD;IACrD,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACx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,EAAE,MAAM,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,OAA+B;IAC7D,OAAO,OAAO;SACX,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;SAC9C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;SACnE,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,GAAG;SACP,WAAW,EAAE;SACb,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;SAC5B,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Splits a fixed number of grid cells between values in proportion to their
3
+ * share of `total`, using the largest-remainder (Hamilton) method so the
4
+ * counts always add up exactly and no value is off by more than one cell.
5
+ *
6
+ * When `total` exceeds the sum of `values`, the leftover share stays
7
+ * unallocated (the returned counts sum to less than `cellCount`). A `total`
8
+ * below the sum is ignored and the sum is used instead.
9
+ */
10
+ export declare function allocateWaffleCells(values: readonly number[], cellCount: number, total?: number): number[];
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Splits a fixed number of grid cells between values in proportion to their
3
+ * share of `total`, using the largest-remainder (Hamilton) method so the
4
+ * counts always add up exactly and no value is off by more than one cell.
5
+ *
6
+ * When `total` exceeds the sum of `values`, the leftover share stays
7
+ * unallocated (the returned counts sum to less than `cellCount`). A `total`
8
+ * below the sum is ignored and the sum is used instead.
9
+ */
10
+ export function allocateWaffleCells(values, cellCount, total) {
11
+ const cells = Math.max(0, Math.floor(cellCount));
12
+ const clean = values.map((v) => Number.isFinite(v) && v > 0 ? v : 0);
13
+ const sum = clean.reduce((acc, v) => acc + v, 0);
14
+ const denominator = total !== undefined && Number.isFinite(total) && total > sum ? total : sum;
15
+ if (cells === 0 || denominator <= 0)
16
+ return clean.map(() => 0);
17
+ const exact = clean.map((v) => (v / denominator) * cells);
18
+ const counts = exact.map((x) => Math.floor(x));
19
+ // Cells the values are owed in total; less than `cells` when there is a remainder.
20
+ const target = Math.round((sum / denominator) * cells);
21
+ let leftover = target - counts.reduce((acc, c) => acc + c, 0);
22
+ // Hand out the leftover cells to the largest fractional parts, ties to the
23
+ // earlier value so the result is stable.
24
+ const order = exact
25
+ .map((_, i) => i)
26
+ .sort((a, b) => exact[b] - counts[b] - (exact[a] - counts[a]) || a - b);
27
+ for (const i of order) {
28
+ if (leftover <= 0)
29
+ break;
30
+ if (clean[i] <= 0)
31
+ continue;
32
+ counts[i] += 1;
33
+ leftover -= 1;
34
+ }
35
+ return counts;
36
+ }
37
+ //# sourceMappingURL=allocate-waffle-cells.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allocate-waffle-cells.js","sourceRoot":"","sources":["../../../../src/components/ui/waffle-chart/allocate-waffle-cells.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAyB,EACzB,SAAiB,EACjB,KAAc;IAEd,MAAM,KAAK,GAAW,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,MAAM,KAAK,GAAa,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACvC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CACpC,CAAC;IACF,MA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M,CAAC,CAAC,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9E,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,QAAQ,IAAI,CAAC;YAAE,MAAM;QACzB,IAAI,KAAK,CAAC,CAAC,CAAE,IAAI,CAAC;YAAE,SAAS;QAC7B,MAAM,CAAC,CAAC,CAAE,IAAI,CAAC,CAAC;QAChB,QAAQ,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./waffle-chart";
2
+ export type * from "./waffle-chart";
3
+ export * from "./allocate-waffle-cells";
4
+ export type * from "./allocate-waffle-cells";
@@ -0,0 +1,3 @@
1
+ export * from "./waffle-chart";
2
+ export * from "./allocate-waffle-cells";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/waffle-chart/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAG/B,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,85 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import type { HTMLAttributes, MouseEvent, ReactElement, Ref } from "react";
3
+ import { type ChartColorId } from "../../ui/chart-primitives/chart-colors";
4
+ export declare const waffleChartShapeIds: ["rounded", "square", "circle"];
5
+ export type WaffleChartShapeId = (typeof waffleChartShapeIds)[number];
6
+ export declare const waffleChartGapIds: ["none", "sm", "default", "lg"];
7
+ export type WaffleChartGapId = (typeof waffleChartGapIds)[number];
8
+ export declare const waffleChartFillDirectionIds: ["row", "column"];
9
+ export type WaffleChartFillDirectionId = (typeof waffleChartFillDirectionIds)[number];
10
+ export declare const waffleChartGridVariants: (props?: ({
11
+ gap?: "sm" | "default" | "lg" | "none" | null | undefined;
12
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
+ export declare const waffleChartCellVariants: (props?: ({
14
+ shape?: "circle" | "square" | "rounded" | null | undefined;
15
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
+ export interface WaffleChartSegment {
17
+ /** Stable identifier; React key, colour-scale key and click payload. */
18
+ id: string;
19
+ /** Label for the legend, cell titles and the data table. Defaults to `id`. */
20
+ label?: string;
21
+ /** Non-negative size. Non-positive and non-finite values are skipped. */
22
+ value: number;
23
+ /** Preset from the shared chart palette. Ignored if `fill` is set. */
24
+ color?: ChartColorId;
25
+ /** Raw CSS colour that overrides the preset (e.g. `"#7c3aed"`). */
26
+ fill?: string;
27
+ }
28
+ export interface WaffleChartProps extends Omit<HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof waffleChartGridVariants>, VariantProps<typeof waffleChartCellVariants> {
29
+ /** Segments to render, filled in order. */
30
+ segments: ReadonlyArray<WaffleChartSegment>;
31
+ /** Accessible name for the chart and caption of its hidden data table. */
32
+ label: string;
33
+ /**
34
+ * Whole the segments are measured against. Defaults to the sum of segment
35
+ * values. When it exceeds the sum, the leftover cells stay empty — useful
36
+ * for "62 of 100 seats taken".
37
+ */
38
+ total?: number;
39
+ /** Number of cells in the grid. Defaults to `100`, one cell per percent. */
40
+ cells?: number;
41
+ /** Number of columns. Defaults to `10`. */
42
+ columns?: number;
43
+ /**
44
+ * `"row"` (default) fills left to right, then top to bottom; `"column"`
45
+ * fills top to bottom, then left to right.
46
+ */
47
+ fillDirection?: WaffleChartFillDirectionId;
48
+ /**
49
+ * The full list of segment ids the chart can show, so a segment keeps its
50
+ * colour when others are filtered out. Without it, colour follows position.
51
+ */
52
+ segmentOrder?: readonly string[];
53
+ /** Render the legend below the grid. Defaults to `true`. */
54
+ showLegend?: boolean;
55
+ /** Show each segment's value in the legend. Defaults to `false`. */
56
+ showLegendValues?: boolean;
57
+ /** Show each segment's share of the total in the legend. Defaults to `true`. */
58
+ showLegendPercentages?: boolean;
59
+ /** Label for the empty-cell legend entry when `total` leaves a remainder. */
60
+ remainderLabel?: string;
61
+ /** Format a value for the legend, titles and data table. */
62
+ formatValue?: (value: number) => string;
63
+ /**
64
+ * Dim every other segment while a cell or legend entry is hovered or
65
+ * focused. Defaults to `true`.
66
+ */
67
+ highlightOnHover?: boolean;
68
+ /** Fade cells in, in fill order, on mount. Respects reduced motion. Defaults to `true`. */
69
+ animate?: boolean;
70
+ /**
71
+ * Makes legend entries buttons that report the segment. Cells stay
72
+ * pointer-only so the grid is not dozens of tab stops.
73
+ */
74
+ onSegmentClick?: (segment: WaffleChartSegment, event: MouseEvent<HTMLElement>) => void;
75
+ /** Extra classes for the grid element. */
76
+ gridClassName?: string;
77
+ /** Extra classes for the legend list. */
78
+ legendClassName?: string;
79
+ ref?: Ref<HTMLDivElement>;
80
+ }
81
+ declare function WaffleChart({ segments, label, total, cells, columns, fillDirection, segmentOrder, gap, shape, showLegend, showLegendValues, showLegendPercentages, remainderLabel, formatValue, highlightOnHover, animate, onSegmentClick, className, gridClassName, legendClassName, ref, ...props }: WaffleChartProps): ReactElement;
82
+ declare namespace WaffleChart {
83
+ var displayName: string;
84
+ }
85
+ export { WaffleChart };
@@ -0,0 +1,157 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cva } from "class-variance-authority";
4
+ import { useState } from "react";
5
+ import { cn } from "../../../lib/utils";
6
+ import { chartPaintClass, chartPaintSwatchStyle, createChartColorScale, getChartSeriesColorId, } from "../../ui/chart-primitives/chart-colors";
7
+ import { ChartDataTable } from "../../ui/chart-primitives/chart-data-table";
8
+ import { formatChartNumber } from "../../ui/chart-primitives/chart-format";
9
+ import { allocateWaffleCells } from "./allocate-waffle-cells";
10
+ export const waffleChartShapeIds = [
11
+ "rounded",
12
+ "square",
13
+ "circle",
14
+ ];
15
+ export const waffleChartGapIds = [
16
+ "none",
17
+ "sm",
18
+ "default",
19
+ "lg",
20
+ ];
21
+ export const waffleChartFillDirectionIds = [
22
+ "row",
23
+ "column",
24
+ ];
25
+ export const waffleChartGridVariants = cva("grid w-full", {
26
+ variants: {
27
+ gap: {
28
+ none: "gap-0",
29
+ sm: "gap-px",
30
+ default: "gap-0.5",
31
+ lg: "gap-1",
32
+ },
33
+ },
34
+ defaultVariants: {
35
+ gap: "default",
36
+ },
37
+ });
38
+ export const waffleChartCellVariants = cva("aspect-square w-full", {
39
+ variants: {
40
+ shape: {
41
+ rounded: "rounded-[2px]",
42
+ square: "rounded-none",
43
+ circle: "rounded-full",
44
+ },
45
+ },
46
+ defaultVariants: {
47
+ shape: "rounded",
48
+ },
49
+ });
50
+ const SHARE_FORMAT = new Intl.NumberFormat("en-US", {
51
+ style: "percent",
52
+ maximumFractionDigits: 1,
53
+ });
54
+ /** Highlight key shared by the empty cells and their legend entry. */
55
+ const REMAINDER_ID = "__remainder__";
56
+ /** Total stagger for the mount animation, spread over every cell. */
57
+ const ANIMATION_SPREAD_MS = 600;
58
+ function WaffleChart({ segments, label, total, cells = 100, columns = 10, fillDirection = "row", segmentOrder, gap, shape, showLegend = true, showLegendValues = false, showLegendPercentages = true, remainderLabel = "Remaining", formatValue = formatChartNumber, highlightOnHover = true, animate = true, onSegmentClick, className, gridClassName, legendClassName, ref, ...props }) {
59
+ const [activeId, setActiveId] = useState(null);
60
+ const cellCount = Math.max(0, Math.floor(cells));
61
+ const columnCount = Math.max(1, Math.floor(columns));
62
+ const rowCount = Math.ceil(cellCount / columnCount);
63
+ // Each segment keeps its position in `segments`, so its default colour
64
+ // slot doesn't shift when an earlier segment is zero.
65
+ const valid = segments
66
+ .map((segment, slot) => ({ segment, slot }))
67
+ .filter(({ segment: s }) => Number.isFinite(s.value) && s.value > 0);
68
+ const segmentsTotal = valid.reduce((acc, { segment }) => acc + segment.value, 0);
69
+ const effectiveTotal = total !== undefined && Number.isFinite(total) && total > segmentsTotal
70
+ ? total
71
+ : segmentsTotal;
72
+ const remainder = effectiveTotal - segmentsTotal;
73
+ const counts = allocateWaffleCells(valid.map(({ segment }) => segment.value), cellCount, total);
74
+ const colorScale = segmentOrder
75
+ ? createChartColorScale(segmentOrder)
76
+ : null;
77
+ const resolved = valid.map(({ segment, slot }, index) => ({
78
+ segment,
79
+ label: segment.label ?? segment.id,
80
+ cellCount: counts[index],
81
+ paint: {
82
+ colorId: segment.color ??
83
+ (colorScale ? colorScale(segment.id) : getChartSeriesColorId(slot)),
84
+ value: segment.fill,
85
+ },
86
+ }));
87
+ // One entry per cell, in fill order; `null` is an empty cell.
88
+ const cellOwners = (() => {
89
+ const owners = [];
90
+ for (const r of resolved) {
91
+ for (let i = 0; i < r.cellCount; i += 1)
92
+ owners.push(r);
93
+ }
94
+ while (owners.length < cellCount)
95
+ owners.push(null);
96
+ return owners;
97
+ })();
98
+ const share = (value) => effectiveTotal > 0 ? SHARE_FORMAT.format(value / effectiveTotal) : "—";
99
+ const describe = (name, value) => `${name}: ${formatValue(value)} (${share(value)})`;
100
+ const highlight = (id) => {
101
+ if (highlightOnHover)
102
+ setActiveId(id);
103
+ };
104
+ const isDimmed = (id) => activeId !== null && id !== activeId;
105
+ const gridStyle = fillDirection === "column"
106
+ ? {
107
+ gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))`,
108
+ gridTemplateRows: `repeat(${rowCount}, auto)`,
109
+ gridAutoFlow: "column",
110
+ }
111
+ : { gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))` };
112
+ const legendEntry = (id, name, value, swatch, segment) => {
113
+ const body = (_jsxs(_Fragment, { children: [swatch, _jsx("span", { className: "font-medium text-foreground", children: name }), showLegendValues && (_jsx("span", { className: "tabular-nums text-muted-foreground", children: formatValue(value) })), showLegendPercentages && (_jsx("span", { className: "tabular-nums text-muted-foreground", children: showLegendValues ? `(${share(value)})` : share(value) }))] }));
114
+ const entryClass = cn("inline-flex items-center gap-1.5 transition-opacity motion-reduce:transition-none", isDimmed(id) && "opacity-40");
115
+ return (_jsx("li", { "data-slot": "waffle-chart-legend-item", "data-segment-id": id, onMouseEnter: () => highlight(id), onMouseLeave: () => highlight(null), children: segment && onSegmentClick ? (_jsx("button", { type: "button", className: cn(entryClass, "rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"), onClick: (event) => onSegmentClick(segment, event), onFocus: () => highlight(id), onBlur: () => highlight(null), children: body })) : (_jsx("span", { className: entryClass, children: body })) }, id));
116
+ };
117
+ return (_jsxs("div", { ref: ref, "data-slot": "waffle-chart", className: cn("flex w-full flex-col gap-3", className), ...props, children: [_jsx("div", { role: "img", "aria-label": `${label}: ${[
118
+ ...resolved.map((r) => describe(r.label, r.segment.value)),
119
+ ...(remainder > 0 ? [describe(remainderLabel, remainder)] : []),
120
+ ].join(", ")}`, "data-slot": "waffle-chart-grid", className: cn(waffleChartGridVariants({ gap }), gridClassName), style: gridStyle, onMouseLeave: () => highlight(null), children: cellOwners.map((owner, index) => {
121
+ const ownerId = owner
122
+ ? owner.segment.id
123
+ : remainder > 0
124
+ ? REMAINDER_ID
125
+ : null;
126
+ return (_jsx("div", { "aria-hidden": "true", "data-slot": "waffle-chart-cell", "data-segment-id": owner ? owner.segment.id : undefined, "data-empty": owner ? undefined : "", title: owner
127
+ ? describe(owner.label, owner.segment.value)
128
+ : remainder > 0
129
+ ? describe(remainderLabel, remainder)
130
+ : undefined, onMouseEnter: () => highlight(ownerId), className: cn(waffleChartCellVariants({ shape }), "transition-opacity duration-150 motion-reduce:transition-none", owner ? chartPaintClass(owner.paint, "bg") : "bg-secondary", isDimmed(ownerId) && "opacity-25", animate &&
131
+ "motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-50 motion-safe:fill-mode-both motion-safe:duration-300"), style: {
132
+ ...(owner ? chartPaintSwatchStyle(owner.paint) : undefined),
133
+ ...(animate && cellCount > 1
134
+ ? {
135
+ animationDelay: `${Math.round((index / (cellCount - 1)) * ANIMATION_SPREAD_MS)}ms`,
136
+ }
137
+ : undefined),
138
+ } }, index));
139
+ }) }), showLegend && resolved.length > 0 && (_jsxs("ul", { "aria-label": "Legend", "data-slot": "waffle-chart-legend", className: cn("flex flex-wrap items-center gap-x-4 gap-y-1 text-xs", legendClassName), children: [resolved.map((r) => legendEntry(r.segment.id, r.label, r.segment.value, _jsx("span", { "aria-hidden": "true", className: cn(waffleChartCellVariants({ shape }), "inline-block size-2.5 shrink-0", chartPaintClass(r.paint, "bg")), style: chartPaintSwatchStyle(r.paint) }), r.segment)), remainder > 0 &&
140
+ legendEntry(REMAINDER_ID, remainderLabel, remainder, _jsx("span", { "aria-hidden": "true", className: cn(waffleChartCellVariants({ shape }), "inline-block size-2.5 shrink-0 bg-secondary") }), null)] })), resolved.length > 0 && (_jsx(ChartDataTable, { caption: label, columns: ["Segment", "Value", "Share"], rows: [
141
+ ...resolved.map((r) => ({
142
+ key: r.segment.id,
143
+ cells: [r.label, formatValue(r.segment.value), share(r.segment.value)],
144
+ })),
145
+ ...(remainder > 0
146
+ ? [
147
+ {
148
+ key: REMAINDER_ID,
149
+ cells: [remainderLabel, formatValue(remainder), share(remainder)],
150
+ },
151
+ ]
152
+ : []),
153
+ ] }))] }));
154
+ }
155
+ WaffleChart.displayName = "WaffleChart";
156
+ export { WaffleChart };
157
+ //# sourceMappingURL=waffle-chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waffle-chart.js","sourceRoot":"","sources":["../../../../src/components/ui/waffle-chart/waffle-chart.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AASlE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GAGtB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CA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AA6C,CAC9C,GACD,EACF,IAAI,CACL,IACA,CACN,EACA,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CACtB,KAAC,cAAc,IACb,OAAO,EAAE,KAAK,EACd,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EACtC,IAAI,EAAE;oBACJ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;wBACtB,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE;wBACjB,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;qBACvE,CAAC,CAAC;oBACH,GAAG,CAAC,SAAS,GAAG,CAAC;wBACf,CAAC,CAAC;4BACE;gCACE,GAAG,EAAE,YAAY;gCACjB,KAAK,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;6BAClE;yBACF;wBACH,CAAC,CAAC,EAAE,CAAC;iBACR,GACD,CACH,IACG,CACP,CAAC;AACJ,CAAC;AACD,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schemavaults/ui",
3
- "version": "0.113.1",
3
+ "version": "0.115.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "React.js UI components for SchemaVaults frontend applications",
@@ -48,7 +48,7 @@
48
48
  "tailwind-merge": "3.0.2"
49
49
  },
50
50
  "devDependencies": {
51
- "@schemavaults/send-email": "0.1.0",
51
+ "@schemavaults/send-email": "0.6.0",
52
52
  "@storybook/addon-docs": "10.5.3",
53
53
  "@storybook/addon-webpack5-compiler-swc": "4.0.3",
54
54
  "@storybook/react": "10.5.3",