@handled-ai/design-system 0.9.28 → 0.11.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/dist/components/account-contacts-popover.d.ts +22 -0
- package/dist/components/account-contacts-popover.js +180 -0
- package/dist/components/account-contacts-popover.js.map +1 -0
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/compliance-badge.d.ts +10 -0
- package/dist/components/compliance-badge.js +95 -0
- package/dist/components/compliance-badge.js.map +1 -0
- package/dist/components/contact-chip.d.ts +12 -0
- package/dist/components/contact-chip.js +98 -0
- package/dist/components/contact-chip.js.map +1 -0
- package/dist/components/draft-feedback-inline.d.ts +11 -0
- package/dist/components/draft-feedback-inline.js +153 -0
- package/dist/components/draft-feedback-inline.js.map +1 -0
- package/dist/components/empty-state.d.ts +11 -0
- package/dist/components/empty-state.js +46 -0
- package/dist/components/empty-state.js.map +1 -0
- package/dist/components/filter-chip.d.ts +9 -0
- package/dist/components/filter-chip.js +67 -0
- package/dist/components/filter-chip.js.map +1 -0
- package/dist/components/inline-banner.d.ts +10 -0
- package/dist/components/inline-banner.js +97 -0
- package/dist/components/inline-banner.js.map +1 -0
- package/dist/components/kbd-hint.d.ts +5 -0
- package/dist/components/kbd-hint.js +51 -0
- package/dist/components/kbd-hint.js.map +1 -0
- package/dist/components/rich-text-toolbar.d.ts +9 -0
- package/dist/components/rich-text-toolbar.js +103 -0
- package/dist/components/rich-text-toolbar.js.map +1 -0
- package/dist/components/step-timeline.d.ts +19 -0
- package/dist/components/step-timeline.js +134 -0
- package/dist/components/step-timeline.js.map +1 -0
- package/dist/components/sticky-action-bar.d.ts +10 -0
- package/dist/components/sticky-action-bar.js +56 -0
- package/dist/components/sticky-action-bar.js.map +1 -0
- package/dist/components/suggested-actions.js +2 -304
- package/dist/components/suggested-actions.js.map +1 -1
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.js +66 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/variable-autocomplete.d.ts +21 -0
- package/dist/components/variable-autocomplete.js +171 -0
- package/dist/components/variable-autocomplete.js.map +1 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/components/__tests__/compliance-badge.test.tsx +88 -0
- package/src/components/__tests__/contact-chip.test.tsx +88 -0
- package/src/components/__tests__/empty-state.test.tsx +76 -0
- package/src/components/__tests__/filter-chip.test.tsx +73 -0
- package/src/components/__tests__/inline-banner.test.tsx +110 -0
- package/src/components/__tests__/kbd-hint.test.tsx +29 -0
- package/src/components/__tests__/rich-text-toolbar.test.tsx +92 -0
- package/src/components/__tests__/step-timeline.test.tsx +174 -0
- package/src/components/__tests__/sticky-action-bar.test.tsx +52 -0
- package/src/components/__tests__/switch.test.tsx +39 -0
- package/src/components/__tests__/variable-autocomplete.test.tsx +155 -0
- package/src/components/account-contacts-popover.tsx +192 -0
- package/src/components/compliance-badge.tsx +68 -0
- package/src/components/contact-chip.tsx +68 -0
- package/src/components/draft-feedback-inline.tsx +193 -0
- package/src/components/empty-state.tsx +37 -0
- package/src/components/filter-chip.tsx +37 -0
- package/src/components/inline-banner.tsx +69 -0
- package/src/components/kbd-hint.tsx +21 -0
- package/src/components/rich-text-toolbar.tsx +90 -0
- package/src/components/step-timeline.tsx +149 -0
- package/src/components/sticky-action-bar.tsx +36 -0
- package/src/components/suggested-actions.tsx +2 -363
- package/src/components/switch.tsx +29 -0
- package/src/components/variable-autocomplete.tsx +178 -0
- package/src/index.ts +16 -1
- package/src/styles/globals.css +60 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
"use client";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defProps = Object.defineProperties;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
import { jsx } from "react/jsx-runtime";
|
|
36
|
+
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
37
|
+
import { cn } from "../lib/utils.js";
|
|
38
|
+
function Switch(_a) {
|
|
39
|
+
var _b = _a, {
|
|
40
|
+
className
|
|
41
|
+
} = _b, props = __objRest(_b, [
|
|
42
|
+
"className"
|
|
43
|
+
]);
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
SwitchPrimitive.Root,
|
|
46
|
+
__spreadProps(__spreadValues({
|
|
47
|
+
"data-slot": "switch",
|
|
48
|
+
className: cn(
|
|
49
|
+
"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-xs transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background",
|
|
50
|
+
className
|
|
51
|
+
)
|
|
52
|
+
}, props), {
|
|
53
|
+
children: /* @__PURE__ */ jsx(
|
|
54
|
+
SwitchPrimitive.Thumb,
|
|
55
|
+
{
|
|
56
|
+
"data-slot": "switch-thumb",
|
|
57
|
+
className: "pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
Switch
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/switch.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Switch as SwitchPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../lib/utils\"\n\nfunction Switch({\n className,\n ...props\n}: React.ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n \"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-xs transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background\",\n className\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0\"\n />\n </SwitchPrimitive.Root>\n )\n}\n\nexport { Switch }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBM;AAjBN,SAAS,UAAU,uBAAuB;AAE1C,SAAS,UAAU;AAEnB,SAAS,OAAO,IAGsC;AAHtC,eACd;AAAA;AAAA,EARF,IAOgB,IAEX,kBAFW,IAEX;AAAA,IADH;AAAA;AAGA,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,OACI,QANL;AAAA,MAQC;AAAA,QAAC,gBAAgB;AAAA,QAAhB;AAAA,UACC,aAAU;AAAA,UACV,WAAU;AAAA;AAAA,MACZ;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface VariableDef {
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
source?: string;
|
|
7
|
+
}
|
|
8
|
+
interface VariableGroup {
|
|
9
|
+
label: string;
|
|
10
|
+
variables: VariableDef[];
|
|
11
|
+
}
|
|
12
|
+
interface VariableAutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
13
|
+
groups: VariableGroup[];
|
|
14
|
+
filter?: string;
|
|
15
|
+
onSelect: (variable: VariableDef) => void;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
maxResults?: number;
|
|
18
|
+
}
|
|
19
|
+
declare function VariableAutocomplete({ groups, filter, onSelect, onClose, maxResults, className, ...rest }: VariableAutocompleteProps): React.JSX.Element | null;
|
|
20
|
+
|
|
21
|
+
export { VariableAutocomplete, type VariableAutocompleteProps, type VariableDef, type VariableGroup };
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
"use client";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defProps = Object.defineProperties;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
36
|
+
import * as React from "react";
|
|
37
|
+
import { cn } from "../lib/utils.js";
|
|
38
|
+
function VariableAutocomplete(_a) {
|
|
39
|
+
var _b = _a, {
|
|
40
|
+
groups,
|
|
41
|
+
filter = "",
|
|
42
|
+
onSelect,
|
|
43
|
+
onClose,
|
|
44
|
+
maxResults = 10,
|
|
45
|
+
className
|
|
46
|
+
} = _b, rest = __objRest(_b, [
|
|
47
|
+
"groups",
|
|
48
|
+
"filter",
|
|
49
|
+
"onSelect",
|
|
50
|
+
"onClose",
|
|
51
|
+
"maxResults",
|
|
52
|
+
"className"
|
|
53
|
+
]);
|
|
54
|
+
const containerRef = React.useRef(null);
|
|
55
|
+
const [activeIndex, setActiveIndex] = React.useState(-1);
|
|
56
|
+
const filteredGroups = React.useMemo(
|
|
57
|
+
() => groups.map((group) => __spreadProps(__spreadValues({}, group), {
|
|
58
|
+
variables: group.variables.filter(
|
|
59
|
+
(v) => v.name.toLowerCase().startsWith(filter.toLowerCase())
|
|
60
|
+
)
|
|
61
|
+
})).filter((group) => group.variables.length > 0),
|
|
62
|
+
[groups, filter]
|
|
63
|
+
);
|
|
64
|
+
const allFiltered = React.useMemo(() => {
|
|
65
|
+
const result = [];
|
|
66
|
+
for (const group of filteredGroups) {
|
|
67
|
+
for (const variable of group.variables) {
|
|
68
|
+
if (result.length >= maxResults) break;
|
|
69
|
+
result.push({ group, variable });
|
|
70
|
+
}
|
|
71
|
+
if (result.length >= maxResults) break;
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
}, [filteredGroups, maxResults]);
|
|
75
|
+
React.useEffect(() => {
|
|
76
|
+
setActiveIndex(-1);
|
|
77
|
+
}, [filter]);
|
|
78
|
+
React.useEffect(() => {
|
|
79
|
+
function handleMouseDown(e) {
|
|
80
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
81
|
+
onClose();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function handleKeyDown(e) {
|
|
85
|
+
if (e.key === "Escape") {
|
|
86
|
+
onClose();
|
|
87
|
+
}
|
|
88
|
+
if (e.key === "ArrowDown") {
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
setActiveIndex((prev) => prev < allFiltered.length - 1 ? prev + 1 : 0);
|
|
91
|
+
}
|
|
92
|
+
if (e.key === "ArrowUp") {
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
setActiveIndex((prev) => prev > 0 ? prev - 1 : allFiltered.length - 1);
|
|
95
|
+
}
|
|
96
|
+
if (e.key === "Enter" && activeIndex >= 0 && activeIndex < allFiltered.length) {
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
onSelect(allFiltered[activeIndex].variable);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
document.addEventListener("mousedown", handleMouseDown);
|
|
102
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
103
|
+
return () => {
|
|
104
|
+
document.removeEventListener("mousedown", handleMouseDown);
|
|
105
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
106
|
+
};
|
|
107
|
+
}, [onClose, onSelect, allFiltered, activeIndex]);
|
|
108
|
+
if (allFiltered.length === 0) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
const groupsToRender = [];
|
|
112
|
+
let flatIndex = 0;
|
|
113
|
+
for (const group of filteredGroups) {
|
|
114
|
+
const items = [];
|
|
115
|
+
for (const variable of group.variables) {
|
|
116
|
+
if (flatIndex >= maxResults) break;
|
|
117
|
+
items.push({ variable, flatIndex });
|
|
118
|
+
flatIndex++;
|
|
119
|
+
}
|
|
120
|
+
if (items.length > 0) {
|
|
121
|
+
groupsToRender.push({ label: group.label, items });
|
|
122
|
+
}
|
|
123
|
+
if (flatIndex >= maxResults) break;
|
|
124
|
+
}
|
|
125
|
+
return /* @__PURE__ */ jsxs(
|
|
126
|
+
"div",
|
|
127
|
+
__spreadProps(__spreadValues({
|
|
128
|
+
ref: containerRef,
|
|
129
|
+
"data-slot": "variable-autocomplete",
|
|
130
|
+
className: cn(
|
|
131
|
+
"absolute z-50 bg-popover border border-border rounded-lg shadow-lg w-64 overflow-hidden",
|
|
132
|
+
className
|
|
133
|
+
)
|
|
134
|
+
}, rest), {
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ jsx("div", { "data-slot": "variable-autocomplete-header", className: "px-3 py-1.5 border-b border-border", children: /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wider", children: "Insert variable" }) }),
|
|
137
|
+
/* @__PURE__ */ jsx("div", { role: "listbox", "aria-label": "Variables", className: "overflow-y-auto", style: { maxHeight: "312px" }, children: groupsToRender.map((group) => /* @__PURE__ */ jsxs("div", { role: "group", "aria-label": group.label, children: [
|
|
138
|
+
/* @__PURE__ */ jsx("div", { "data-slot": "variable-autocomplete-group-label", className: "px-3 py-1 text-[10px] font-medium text-muted-foreground/60 uppercase tracking-wider", children: group.label }),
|
|
139
|
+
group.items.map(({ variable, flatIndex: idx }) => /* @__PURE__ */ jsxs(
|
|
140
|
+
"button",
|
|
141
|
+
{
|
|
142
|
+
type: "button",
|
|
143
|
+
role: "option",
|
|
144
|
+
"aria-selected": idx === activeIndex,
|
|
145
|
+
"data-slot": "variable-autocomplete-item",
|
|
146
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
147
|
+
onClick: () => onSelect(variable),
|
|
148
|
+
onMouseEnter: () => setActiveIndex(idx),
|
|
149
|
+
className: cn(
|
|
150
|
+
"w-full text-left px-3 py-2 cursor-pointer transition-colors flex items-start justify-between gap-2",
|
|
151
|
+
idx === activeIndex ? "bg-muted/50" : "hover:bg-muted/30"
|
|
152
|
+
),
|
|
153
|
+
children: [
|
|
154
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
155
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs font-mono text-blue-600", children: `{{${variable.name}}}` }),
|
|
156
|
+
variable.description && /* @__PURE__ */ jsx("div", { className: "text-[10px] text-muted-foreground", children: variable.description })
|
|
157
|
+
] }),
|
|
158
|
+
variable.source && /* @__PURE__ */ jsx("span", { className: "text-[9px] px-1.5 py-0.5 rounded bg-muted/30 text-muted-foreground shrink-0 mt-0.5 capitalize", children: variable.source })
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
`${group.label}:${variable.name}`
|
|
162
|
+
))
|
|
163
|
+
] }, group.label)) })
|
|
164
|
+
]
|
|
165
|
+
})
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
export {
|
|
169
|
+
VariableAutocomplete
|
|
170
|
+
};
|
|
171
|
+
//# sourceMappingURL=variable-autocomplete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/variable-autocomplete.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"../lib/utils\"\n\ninterface VariableDef {\n name: string\n description?: string\n source?: string\n}\n\ninterface VariableGroup {\n label: string\n variables: VariableDef[]\n}\n\ninterface VariableAutocompleteProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onSelect\"> {\n groups: VariableGroup[]\n filter?: string\n onSelect: (variable: VariableDef) => void\n onClose: () => void\n maxResults?: number\n}\n\nfunction VariableAutocomplete({\n groups,\n filter = \"\",\n onSelect,\n onClose,\n maxResults = 10,\n className,\n ...rest\n}: VariableAutocompleteProps) {\n const containerRef = React.useRef<HTMLDivElement>(null)\n const [activeIndex, setActiveIndex] = React.useState(-1)\n\n // Build filtered results preserving group structure\n const filteredGroups = React.useMemo(\n () =>\n groups\n .map((group) => ({\n ...group,\n variables: group.variables.filter((v) =>\n v.name.toLowerCase().startsWith(filter.toLowerCase())\n ),\n }))\n .filter((group) => group.variables.length > 0),\n [groups, filter]\n )\n\n // Flatten for indexing / keyboard navigation, respecting maxResults\n const allFiltered = React.useMemo(() => {\n const result: { group: VariableGroup; variable: VariableDef }[] = []\n for (const group of filteredGroups) {\n for (const variable of group.variables) {\n if (result.length >= maxResults) break\n result.push({ group, variable })\n }\n if (result.length >= maxResults) break\n }\n return result\n }, [filteredGroups, maxResults])\n\n // Reset active index when results change\n React.useEffect(() => {\n setActiveIndex(-1)\n }, [filter])\n\n React.useEffect(() => {\n function handleMouseDown(e: MouseEvent) {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n onClose()\n }\n }\n function handleKeyDown(e: KeyboardEvent) {\n if (e.key === \"Escape\") {\n onClose()\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault()\n setActiveIndex((prev) => (prev < allFiltered.length - 1 ? prev + 1 : 0))\n }\n if (e.key === \"ArrowUp\") {\n e.preventDefault()\n setActiveIndex((prev) => (prev > 0 ? prev - 1 : allFiltered.length - 1))\n }\n if (e.key === \"Enter\" && activeIndex >= 0 && activeIndex < allFiltered.length) {\n e.preventDefault()\n onSelect(allFiltered[activeIndex].variable)\n }\n }\n document.addEventListener(\"mousedown\", handleMouseDown)\n document.addEventListener(\"keydown\", handleKeyDown)\n return () => {\n document.removeEventListener(\"mousedown\", handleMouseDown)\n document.removeEventListener(\"keydown\", handleKeyDown)\n }\n }, [onClose, onSelect, allFiltered, activeIndex])\n\n if (allFiltered.length === 0) {\n return null\n }\n\n // Group the capped results back for rendering\n const groupsToRender: { label: string; items: { variable: VariableDef; flatIndex: number }[] }[] = []\n let flatIndex = 0\n for (const group of filteredGroups) {\n const items: { variable: VariableDef; flatIndex: number }[] = []\n for (const variable of group.variables) {\n if (flatIndex >= maxResults) break\n items.push({ variable, flatIndex })\n flatIndex++\n }\n if (items.length > 0) {\n groupsToRender.push({ label: group.label, items })\n }\n if (flatIndex >= maxResults) break\n }\n\n return (\n <div\n ref={containerRef}\n data-slot=\"variable-autocomplete\"\n className={cn(\n \"absolute z-50 bg-popover border border-border rounded-lg shadow-lg w-64 overflow-hidden\",\n className\n )}\n {...rest}\n >\n <div data-slot=\"variable-autocomplete-header\" className=\"px-3 py-1.5 border-b border-border\">\n <span className=\"text-[10px] font-medium text-muted-foreground uppercase tracking-wider\">\n Insert variable\n </span>\n </div>\n <div role=\"listbox\" aria-label=\"Variables\" className=\"overflow-y-auto\" style={{ maxHeight: \"312px\" }}>\n {groupsToRender.map((group) => (\n <div key={group.label} role=\"group\" aria-label={group.label}>\n <div data-slot=\"variable-autocomplete-group-label\" className=\"px-3 py-1 text-[10px] font-medium text-muted-foreground/60 uppercase tracking-wider\">\n {group.label}\n </div>\n {group.items.map(({ variable, flatIndex: idx }) => (\n <button\n type=\"button\"\n key={`${group.label}:${variable.name}`}\n role=\"option\"\n aria-selected={idx === activeIndex}\n data-slot=\"variable-autocomplete-item\"\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => onSelect(variable)}\n onMouseEnter={() => setActiveIndex(idx)}\n className={cn(\n \"w-full text-left px-3 py-2 cursor-pointer transition-colors flex items-start justify-between gap-2\",\n idx === activeIndex ? \"bg-muted/50\" : \"hover:bg-muted/30\"\n )}\n >\n <div className=\"min-w-0\">\n <div className=\"text-xs font-mono text-blue-600\">{`{{${variable.name}}}`}</div>\n {variable.description && (\n <div className=\"text-[10px] text-muted-foreground\">{variable.description}</div>\n )}\n </div>\n {variable.source && (\n <span className=\"text-[9px] px-1.5 py-0.5 rounded bg-muted/30 text-muted-foreground shrink-0 mt-0.5 capitalize\">\n {variable.source}\n </span>\n )}\n </button>\n ))}\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport { VariableAutocomplete, type VariableAutocompleteProps, type VariableDef, type VariableGroup }\n"],"mappings":"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","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, Ava
|
|
|
9
9
|
export { Badge, badgeVariants } from './components/badge.js';
|
|
10
10
|
export { Button, buttonVariants } from './components/button.js';
|
|
11
11
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './components/card.js';
|
|
12
|
+
export { ComplianceBadge, ComplianceBadgeProps, ComplianceStatus } from './components/compliance-badge.js';
|
|
13
|
+
export { ContactChip, ContactChipProps } from './components/contact-chip.js';
|
|
12
14
|
export { ContactChannel, ContactItem, ContactList, ContactListProps } from './components/contact-list.js';
|
|
13
15
|
export { CheckInsCard, RecentlyCompletedCard, TopTasksCard, UpcomingMeetingsCard } from './components/dashboard-cards.js';
|
|
14
16
|
export { DataRow, DataTable, DataTableProps } from './components/data-table.js';
|
|
@@ -19,15 +21,19 @@ export { DataTableToolbar } from './components/data-table-toolbar.js';
|
|
|
19
21
|
export { Citation, DetailViewHeader, DetailViewSummary, DetailViewThread, SourceDef, SourceList, ThreadMessage } from './components/detail-view.js';
|
|
20
22
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from './components/dialog.js';
|
|
21
23
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './components/dropdown-menu.js';
|
|
24
|
+
export { EmptyState, EmptyStateProps } from './components/empty-state.js';
|
|
22
25
|
export { ActivityItem, ConnectedApps, EntityActivityItem, EntityDetails, EntityMetadataField, EntityMetadataGrid, EntityPanel, EntityPanelBrandIcons, EntityPanelHeader, EntityPanelTabs, EntitySection, PotentialContacts, RecentActivity, SystemActivity } from './components/entity-panel.js';
|
|
26
|
+
export { FilterChip, FilterChipProps } from './components/filter-chip.js';
|
|
23
27
|
export { InboxGroupHeader, InboxRow, InboxRowProps } from './components/inbox-row.js';
|
|
24
28
|
export { AssigneeFilter, InboxFilterCategory, InboxToolbar, InboxToolbarProps } from './components/inbox-toolbar.js';
|
|
29
|
+
export { InlineBanner, InlineBannerProps } from './components/inline-banner.js';
|
|
25
30
|
export { Input } from './components/input.js';
|
|
26
31
|
export { FilterDefinition, InsightsFilterBar, InsightsFilterBarProps } from './components/insights-filter-bar.js';
|
|
27
32
|
export { GroupedListGroup, GroupedListView, GroupedListViewProps, ItemList } from './components/item-list.js';
|
|
28
33
|
export { ItemListDisplay, ItemListDisplayState, ItemListGrouping, ItemListViewMode } from './components/item-list-display.js';
|
|
29
34
|
export { ItemListFilter, ItemListFilterCategory } from './components/item-list-filter.js';
|
|
30
35
|
export { ItemListQuickView, ItemListToolbar } from './components/item-list-toolbar.js';
|
|
36
|
+
export { KbdHint } from './components/kbd-hint.js';
|
|
31
37
|
export { Label } from './components/label.js';
|
|
32
38
|
export { Message, MessageAvatar, MessageAvatarProps, MessageContent, MessageContentProps, MessageProps } from './components/message.js';
|
|
33
39
|
export { MetricCard, MetricCardProps, MetricDataPoint } from './components/metric-card.js';
|
|
@@ -39,6 +45,7 @@ export { QuickActionModal, QuickActionPriority, QuickActionTaskDraft, QuickActio
|
|
|
39
45
|
export { ActiveVariant, QuickActionSidebarNav, SidebarNavItem, SidebarNavSection, SidebarUserProfile, UserMenuItem } from './components/quick-action-sidebar-nav.js';
|
|
40
46
|
export { RecommendedAction, RecommendedActionsSection } from './components/recommended-actions-section.js';
|
|
41
47
|
export { ReportCard, ReportCardProps } from './components/report-card.js';
|
|
48
|
+
export { RichTextAction, RichTextToolbar, RichTextToolbarProps } from './components/rich-text-toolbar.js';
|
|
42
49
|
export { ScoreAnalysisModal, ScoreAnalysisModalProps, ScoreAnalysisPanel } from './components/score-analysis-modal.js';
|
|
43
50
|
export { ScoreBreakdown, ScoreBreakdownProps, ScoreFactor } from './components/score-breakdown.js';
|
|
44
51
|
export { ScoreFeedback, useScoreFeedback } from './components/score-feedback.js';
|
|
@@ -50,17 +57,23 @@ export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHe
|
|
|
50
57
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from './components/sidebar.js';
|
|
51
58
|
export { ApprovalState, SignalApproval, SignalApprovalActions, SignalApprovalContextValue, SignalApprovalGate, SignalApprovalLabels, SignalApprovalRoot, SignalApprovalRootProps, useSignalApproval } from './components/signal-feedback-inline.js';
|
|
52
59
|
export { SimpleDataTable, SimpleDataTableProps } from './components/simple-data-table.js';
|
|
53
|
-
export { VirtualizedDataTable, VirtualizedDataTableProps } from './components/virtualized-data-table.js';
|
|
54
60
|
export { Skeleton } from './components/skeleton.js';
|
|
55
61
|
export { StatusBadge, StatusBadgeProps, StatusType } from './components/status-badge.js';
|
|
62
|
+
export { StepTimeline, StepTimelineProps, StepType, TimelineStep } from './components/step-timeline.js';
|
|
63
|
+
export { StickyActionBar, StickyActionBarProps } from './components/sticky-action-bar.js';
|
|
56
64
|
export { StyledBarItem, StyledBarList, StyledBarListProps } from './components/styled-bar-list.js';
|
|
65
|
+
export { DraftFeedbackInline, DraftFeedbackInlineProps } from './components/draft-feedback-inline.js';
|
|
66
|
+
export { AccountContactsPopover, AccountContactsPopoverProps, BrandIcon } from './components/account-contacts-popover.js';
|
|
57
67
|
export { SuggestedAction, SuggestedActionBrowserMeta, SuggestedActionCallMeta, SuggestedActionEmailMeta, SuggestedActionFollowUp, SuggestedActionManualMeta, SuggestedActionReplyTo, SuggestedActionThreadMessage, SuggestedActionTicket, SuggestedActions, SuggestedActionsIconMap, SuggestedActionsProps, SuggestedContact } from './components/suggested-actions.js';
|
|
68
|
+
export { Switch } from './components/switch.js';
|
|
58
69
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './components/table.js';
|
|
59
70
|
export { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants } from './components/tabs.js';
|
|
60
71
|
export { Textarea } from './components/textarea.js';
|
|
61
72
|
export { TimelineActivity, TimelineActivityProps, TimelineEvent } from './components/timeline-activity.js';
|
|
62
73
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './components/tooltip.js';
|
|
74
|
+
export { VariableAutocomplete, VariableAutocompleteProps, VariableDef, VariableGroup } from './components/variable-autocomplete.js';
|
|
63
75
|
export { ViewMode, ViewModeToggle, ViewModeToggleProps } from './components/view-mode-toggle.js';
|
|
76
|
+
export { VirtualizedDataTable, VirtualizedDataTableProps } from './components/virtualized-data-table.js';
|
|
64
77
|
export { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from './charts/chart.js';
|
|
65
78
|
export { CHART_CURSOR_STYLE, CHART_TOOLTIP_STYLE, ChartTooltipEntry, SimpleChartTooltip, SimpleChartTooltipProps } from './charts/chart-tooltip.js';
|
|
66
79
|
export { BarChartComponent, BarChartComponentProps, BarSeries } from './charts/bar-chart-component.js';
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,8 @@ export * from "./components/avatar.js";
|
|
|
9
9
|
export * from "./components/badge.js";
|
|
10
10
|
export * from "./components/button.js";
|
|
11
11
|
export * from "./components/card.js";
|
|
12
|
+
export * from "./components/compliance-badge.js";
|
|
13
|
+
export * from "./components/contact-chip.js";
|
|
12
14
|
export * from "./components/contact-list.js";
|
|
13
15
|
export * from "./components/dashboard-cards.js";
|
|
14
16
|
export * from "./components/data-table.js";
|
|
@@ -19,15 +21,19 @@ export * from "./components/data-table-toolbar.js";
|
|
|
19
21
|
export * from "./components/detail-view.js";
|
|
20
22
|
export * from "./components/dialog.js";
|
|
21
23
|
export * from "./components/dropdown-menu.js";
|
|
24
|
+
export * from "./components/empty-state.js";
|
|
22
25
|
export * from "./components/entity-panel.js";
|
|
26
|
+
export * from "./components/filter-chip.js";
|
|
23
27
|
export * from "./components/inbox-row.js";
|
|
24
28
|
export * from "./components/inbox-toolbar.js";
|
|
29
|
+
export * from "./components/inline-banner.js";
|
|
25
30
|
export * from "./components/input.js";
|
|
26
31
|
export * from "./components/insights-filter-bar.js";
|
|
27
32
|
export * from "./components/item-list.js";
|
|
28
33
|
export * from "./components/item-list-display.js";
|
|
29
34
|
export * from "./components/item-list-filter.js";
|
|
30
35
|
export * from "./components/item-list-toolbar.js";
|
|
36
|
+
export * from "./components/kbd-hint.js";
|
|
31
37
|
export * from "./components/label.js";
|
|
32
38
|
export * from "./components/message.js";
|
|
33
39
|
export * from "./components/metric-card.js";
|
|
@@ -41,6 +47,7 @@ import {
|
|
|
41
47
|
export * from "./components/quick-action-sidebar-nav.js";
|
|
42
48
|
export * from "./components/recommended-actions-section.js";
|
|
43
49
|
export * from "./components/report-card.js";
|
|
50
|
+
export * from "./components/rich-text-toolbar.js";
|
|
44
51
|
export * from "./components/score-analysis-modal.js";
|
|
45
52
|
export * from "./components/score-breakdown.js";
|
|
46
53
|
export * from "./components/score-feedback.js";
|
|
@@ -52,17 +59,23 @@ export * from "./components/sheet.js";
|
|
|
52
59
|
export * from "./components/sidebar.js";
|
|
53
60
|
export * from "./components/signal-feedback-inline.js";
|
|
54
61
|
export * from "./components/simple-data-table.js";
|
|
55
|
-
export * from "./components/virtualized-data-table.js";
|
|
56
62
|
export * from "./components/skeleton.js";
|
|
57
63
|
export * from "./components/status-badge.js";
|
|
64
|
+
export * from "./components/step-timeline.js";
|
|
65
|
+
export * from "./components/sticky-action-bar.js";
|
|
58
66
|
export * from "./components/styled-bar-list.js";
|
|
67
|
+
import { DraftFeedbackInline } from "./components/draft-feedback-inline.js";
|
|
68
|
+
import { AccountContactsPopover, BrandIcon } from "./components/account-contacts-popover.js";
|
|
59
69
|
export * from "./components/suggested-actions.js";
|
|
70
|
+
export * from "./components/switch.js";
|
|
60
71
|
export * from "./components/table.js";
|
|
61
72
|
export * from "./components/tabs.js";
|
|
62
73
|
export * from "./components/textarea.js";
|
|
63
74
|
export * from "./components/timeline-activity.js";
|
|
64
75
|
export * from "./components/tooltip.js";
|
|
76
|
+
export * from "./components/variable-autocomplete.js";
|
|
65
77
|
export * from "./components/view-mode-toggle.js";
|
|
78
|
+
export * from "./components/virtualized-data-table.js";
|
|
66
79
|
export * from "./charts/index.js";
|
|
67
80
|
export * from "./prototype/prototype-config.js";
|
|
68
81
|
export * from "./prototype/prototype-shell.js";
|
|
@@ -72,7 +85,10 @@ export * from "./prototype/prototype-accounts-view.js";
|
|
|
72
85
|
export * from "./prototype/prototype-admin-view.js";
|
|
73
86
|
export * from "./prototype/prototype-work-queue-view.js";
|
|
74
87
|
export {
|
|
88
|
+
AccountContactsPopover,
|
|
75
89
|
BRAND_ICONS,
|
|
90
|
+
BrandIcon,
|
|
91
|
+
DraftFeedbackInline,
|
|
76
92
|
QuickActionModal,
|
|
77
93
|
cn,
|
|
78
94
|
useIsMobile
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @handled-ai/design-system\n * UI components and utilities (shadcn-style, New York)\n */\n\n// Utilities\nexport { cn } from \"./lib/utils\"\nexport { BRAND_ICONS } from \"./lib/icons\"\n\n// Hooks\nexport { useIsMobile } from \"./hooks/use-mobile\"\n\n// Components (light — no recharts/nivo/three transitive deps)\nexport * from \"./components/activity-detail\"\nexport * from \"./components/activity-log\"\nexport * from \"./components/agent-popover\"\nexport * from \"./components/agent-widget\"\nexport * from \"./components/avatar\"\nexport * from \"./components/badge\"\nexport * from \"./components/button\"\nexport * from \"./components/card\"\nexport * from \"./components/contact-list\"\nexport * from \"./components/dashboard-cards\"\nexport * from \"./components/data-table\"\nexport * from \"./components/data-table-display\"\nexport * from \"./components/data-table-filter\"\nexport * from \"./components/data-table-quick-views\"\nexport * from \"./components/data-table-toolbar\"\nexport * from \"./components/detail-view\"\nexport * from \"./components/dialog\"\nexport * from \"./components/dropdown-menu\"\nexport * from \"./components/entity-panel\"\nexport * from \"./components/inbox-row\"\nexport * from \"./components/inbox-toolbar\"\nexport * from \"./components/input\"\nexport * from \"./components/insights-filter-bar\"\nexport * from \"./components/item-list\"\nexport * from \"./components/item-list-display\"\nexport * from \"./components/item-list-filter\"\nexport * from \"./components/item-list-toolbar\"\nexport * from \"./components/label\"\nexport * from \"./components/message\"\nexport * from \"./components/metric-card\"\nexport * from \"./components/performance-metrics-table\"\nexport * from \"./components/preview-list\"\nexport * from \"./components/progress\"\nexport * from \"./components/quick-action-chat-area\"\nexport {\n QuickActionModal,\n type QuickActionPriority,\n type QuickActionTaskDraft,\n type QuickActionTemplate,\n} from \"./components/quick-action-modal\"\nexport * from \"./components/quick-action-sidebar-nav\"\nexport * from \"./components/recommended-actions-section\"\nexport * from \"./components/report-card\"\nexport * from \"./components/score-analysis-modal\"\nexport * from \"./components/score-breakdown\"\nexport * from \"./components/score-feedback\"\nexport * from \"./components/score-ring\"\nexport * from \"./components/scroll-area\"\nexport * from \"./components/select\"\nexport * from \"./components/separator\"\nexport * from \"./components/sheet\"\nexport * from \"./components/sidebar\"\nexport * from \"./components/signal-feedback-inline\"\nexport * from \"./components/simple-data-table\"\nexport * from \"./components/
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @handled-ai/design-system\n * UI components and utilities (shadcn-style, New York)\n */\n\n// Utilities\nexport { cn } from \"./lib/utils\"\nexport { BRAND_ICONS } from \"./lib/icons\"\n\n// Hooks\nexport { useIsMobile } from \"./hooks/use-mobile\"\n\n// Components (light — no recharts/nivo/three transitive deps)\nexport * from \"./components/activity-detail\"\nexport * from \"./components/activity-log\"\nexport * from \"./components/agent-popover\"\nexport * from \"./components/agent-widget\"\nexport * from \"./components/avatar\"\nexport * from \"./components/badge\"\nexport * from \"./components/button\"\nexport * from \"./components/card\"\nexport * from \"./components/compliance-badge\"\nexport * from \"./components/contact-chip\"\nexport * from \"./components/contact-list\"\nexport * from \"./components/dashboard-cards\"\nexport * from \"./components/data-table\"\nexport * from \"./components/data-table-display\"\nexport * from \"./components/data-table-filter\"\nexport * from \"./components/data-table-quick-views\"\nexport * from \"./components/data-table-toolbar\"\nexport * from \"./components/detail-view\"\nexport * from \"./components/dialog\"\nexport * from \"./components/dropdown-menu\"\nexport * from \"./components/empty-state\"\nexport * from \"./components/entity-panel\"\nexport * from \"./components/filter-chip\"\nexport * from \"./components/inbox-row\"\nexport * from \"./components/inbox-toolbar\"\nexport * from \"./components/inline-banner\"\nexport * from \"./components/input\"\nexport * from \"./components/insights-filter-bar\"\nexport * from \"./components/item-list\"\nexport * from \"./components/item-list-display\"\nexport * from \"./components/item-list-filter\"\nexport * from \"./components/item-list-toolbar\"\nexport * from \"./components/kbd-hint\"\nexport * from \"./components/label\"\nexport * from \"./components/message\"\nexport * from \"./components/metric-card\"\nexport * from \"./components/performance-metrics-table\"\nexport * from \"./components/preview-list\"\nexport * from \"./components/progress\"\nexport * from \"./components/quick-action-chat-area\"\nexport {\n QuickActionModal,\n type QuickActionPriority,\n type QuickActionTaskDraft,\n type QuickActionTemplate,\n} from \"./components/quick-action-modal\"\nexport * from \"./components/quick-action-sidebar-nav\"\nexport * from \"./components/recommended-actions-section\"\nexport * from \"./components/report-card\"\nexport * from \"./components/rich-text-toolbar\"\nexport * from \"./components/score-analysis-modal\"\nexport * from \"./components/score-breakdown\"\nexport * from \"./components/score-feedback\"\nexport * from \"./components/score-ring\"\nexport * from \"./components/scroll-area\"\nexport * from \"./components/select\"\nexport * from \"./components/separator\"\nexport * from \"./components/sheet\"\nexport * from \"./components/sidebar\"\nexport * from \"./components/signal-feedback-inline\"\nexport * from \"./components/simple-data-table\"\nexport * from \"./components/skeleton\"\nexport * from \"./components/status-badge\"\nexport * from \"./components/step-timeline\"\nexport * from \"./components/sticky-action-bar\"\nexport * from \"./components/styled-bar-list\"\nexport { DraftFeedbackInline } from \"./components/draft-feedback-inline\"\nexport type { DraftFeedbackInlineProps } from \"./components/draft-feedback-inline\"\nexport { AccountContactsPopover, BrandIcon } from \"./components/account-contacts-popover\"\nexport type { AccountContactsPopoverProps } from \"./components/account-contacts-popover\"\nexport * from \"./components/suggested-actions\"\nexport * from \"./components/switch\"\nexport * from \"./components/table\"\nexport * from \"./components/tabs\"\nexport * from \"./components/textarea\"\nexport * from \"./components/timeline-activity\"\nexport * from \"./components/tooltip\"\nexport * from \"./components/variable-autocomplete\"\nexport * from \"./components/view-mode-toggle\"\nexport * from \"./components/virtualized-data-table\"\n\n// Charts (re-exported for backward compatibility with root imports)\nexport * from \"./charts/index\"\n\n// Prototype template system (re-exported for backward compatibility)\nexport * from \"./prototype/prototype-config\"\nexport * from \"./prototype/prototype-shell\"\nexport * from \"./prototype/prototype-inbox-view\"\nexport * from \"./prototype/prototype-insights-view\"\nexport * from \"./prototype/prototype-accounts-view\"\nexport * from \"./prototype/prototype-admin-view\"\nexport * from \"./prototype/prototype-work-queue-view\"\n"],"mappings":"AAMA,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAG5B,SAAS,mBAAmB;AAG5B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,OAIK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,2BAA2B;AAEpC,SAAS,wBAAwB,iBAAiB;AAElD,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@handled-ai/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Handled UI component library (shadcn-style, New York)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@9.12.0",
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
"typecheck": "tsc --noEmit",
|
|
104
104
|
"lint": "next lint",
|
|
105
105
|
"registry:build": "shadcn build",
|
|
106
|
+
"test": "vitest run",
|
|
106
107
|
"prepublishOnly": "npm run build:lib"
|
|
107
108
|
},
|
|
108
109
|
"peerDependencies": {
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { render, screen } from "@testing-library/react";
|
|
4
|
+
import { ComplianceBadge } from "../compliance-badge";
|
|
5
|
+
|
|
6
|
+
describe("ComplianceBadge", () => {
|
|
7
|
+
it("renders with data-slot='compliance-badge'", () => {
|
|
8
|
+
const { container } = render(<ComplianceBadge status="verified" />);
|
|
9
|
+
const el = container.querySelector('[data-slot="compliance-badge"]');
|
|
10
|
+
expect(el).not.toBeNull();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("defaults to variant='line'", () => {
|
|
14
|
+
const { container } = render(<ComplianceBadge status="verified" />);
|
|
15
|
+
const el = container.querySelector('[data-slot="compliance-badge"]')!;
|
|
16
|
+
expect(el.getAttribute("data-variant")).toBe("line");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("verified line variant shows 'Compliance verified' text", () => {
|
|
20
|
+
render(<ComplianceBadge status="verified" variant="line" />);
|
|
21
|
+
expect(screen.getByText("Compliance verified")).not.toBeNull();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("verified pill variant shows 'Verified' text", () => {
|
|
25
|
+
render(<ComplianceBadge status="verified" variant="pill" />);
|
|
26
|
+
expect(screen.getByText("Verified")).not.toBeNull();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("pending line variant shows 'Pending compliance review'", () => {
|
|
30
|
+
render(<ComplianceBadge status="pending" variant="line" />);
|
|
31
|
+
expect(screen.getByText("Pending compliance review")).not.toBeNull();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("pending pill variant shows 'Pending review'", () => {
|
|
35
|
+
render(<ComplianceBadge status="pending" variant="pill" />);
|
|
36
|
+
expect(screen.getByText("Pending review")).not.toBeNull();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("changed_since_verified line variant shows 'Changed since last verification'", () => {
|
|
40
|
+
render(<ComplianceBadge status="changed_since_verified" variant="line" />);
|
|
41
|
+
expect(screen.getByText("Changed since last verification")).not.toBeNull();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("changed_since_verified pill variant shows 'Changed'", () => {
|
|
45
|
+
render(<ComplianceBadge status="changed_since_verified" variant="pill" />);
|
|
46
|
+
expect(screen.getByText("Changed")).not.toBeNull();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("never_verified shows 'Never verified' for both variants", () => {
|
|
50
|
+
const { unmount } = render(<ComplianceBadge status="never_verified" variant="line" />);
|
|
51
|
+
expect(screen.getByText("Never verified")).not.toBeNull();
|
|
52
|
+
unmount();
|
|
53
|
+
|
|
54
|
+
render(<ComplianceBadge status="never_verified" variant="pill" />);
|
|
55
|
+
expect(screen.getByText("Never verified")).not.toBeNull();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("sets data-status attribute correctly for each status", () => {
|
|
59
|
+
const statuses = ["verified", "pending", "changed_since_verified", "never_verified"] as const;
|
|
60
|
+
for (const status of statuses) {
|
|
61
|
+
const { container, unmount } = render(<ComplianceBadge status={status} />);
|
|
62
|
+
const el = container.querySelector('[data-slot="compliance-badge"]')!;
|
|
63
|
+
expect(el.getAttribute("data-status")).toBe(status);
|
|
64
|
+
unmount();
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("sets data-variant attribute correctly", () => {
|
|
69
|
+
const { container: c1, unmount: u1 } = render(
|
|
70
|
+
<ComplianceBadge status="verified" variant="line" />
|
|
71
|
+
);
|
|
72
|
+
expect(c1.querySelector('[data-slot="compliance-badge"]')!.getAttribute("data-variant")).toBe("line");
|
|
73
|
+
u1();
|
|
74
|
+
|
|
75
|
+
const { container: c2 } = render(
|
|
76
|
+
<ComplianceBadge status="verified" variant="pill" />
|
|
77
|
+
);
|
|
78
|
+
expect(c2.querySelector('[data-slot="compliance-badge"]')!.getAttribute("data-variant")).toBe("pill");
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("merges custom className", () => {
|
|
82
|
+
const { container } = render(
|
|
83
|
+
<ComplianceBadge status="verified" className="my-custom-class" />
|
|
84
|
+
);
|
|
85
|
+
const el = container.querySelector('[data-slot="compliance-badge"]')!;
|
|
86
|
+
expect(el.classList.contains("my-custom-class")).toBe(true);
|
|
87
|
+
});
|
|
88
|
+
});
|