@handled-ai/design-system 0.18.18 → 0.18.20
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/charts/chart.d.ts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/data-table.js +1 -0
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/pill.d.ts +1 -1
- package/dist/components/score-analysis-modal.d.ts +8 -2
- package/dist/components/score-analysis-modal.js +19 -6
- package/dist/components/score-analysis-modal.js.map +1 -1
- package/dist/components/score-breakdown.d.ts +3 -1
- package/dist/components/score-breakdown.js +5 -6
- package/dist/components/score-breakdown.js.map +1 -1
- package/dist/components/score-ring.d.ts +6 -3
- package/dist/components/score-ring.js +30 -6
- package/dist/components/score-ring.js.map +1 -1
- package/dist/components/score-semantics.d.ts +24 -0
- package/dist/components/score-semantics.js +143 -0
- package/dist/components/score-semantics.js.map +1 -0
- package/dist/components/score-why-chips.d.ts +3 -2
- package/dist/components/score-why-chips.js +10 -21
- package/dist/components/score-why-chips.js.map +1 -1
- package/dist/components/signal-priority-popover.d.ts +1 -0
- package/dist/components/signal-priority-popover.js +20 -20
- package/dist/components/signal-priority-popover.js.map +1 -1
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/virtualized-data-table.js +13 -13
- package/dist/components/virtualized-data-table.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/prototype/index.d.ts +1 -0
- package/dist/prototype/prototype-accounts-view.d.ts +1 -0
- package/dist/prototype/prototype-admin-view.d.ts +1 -0
- package/dist/prototype/prototype-config.d.ts +1 -0
- package/dist/prototype/prototype-inbox-view.d.ts +1 -0
- package/dist/prototype/prototype-insights-view.d.ts +1 -0
- package/dist/prototype/prototype-shell.d.ts +1 -0
- package/package.json +1 -5
- package/src/components/__tests__/score-analysis-modal.test.tsx +55 -0
- package/src/components/__tests__/score-breakdown-intent.test.tsx +47 -0
- package/src/components/__tests__/score-ring.test.tsx +43 -0
- package/src/components/__tests__/score-semantics.test.ts +101 -0
- package/src/components/__tests__/signal-priority-popover.test.tsx +7 -5
- package/src/components/__tests__/virtualized-data-table.test.tsx +53 -0
- package/src/components/data-table.tsx +1 -0
- package/src/components/score-analysis-modal.tsx +22 -5
- package/src/components/score-breakdown.tsx +7 -6
- package/src/components/score-ring.tsx +36 -5
- package/src/components/score-semantics.ts +154 -0
- package/src/components/score-why-chips.tsx +12 -23
- package/src/components/signal-priority-popover.tsx +21 -21
- package/src/components/virtualized-data-table.tsx +25 -19
- package/src/index.ts +1 -0
|
@@ -22,7 +22,7 @@ import { cn } from "../lib/utils"
|
|
|
22
22
|
import { FeedbackFooter, InlineFeedbackControl } from "./feedback-primitives"
|
|
23
23
|
import type { FeedbackChipTree, FeedbackSubmitData, PersistedFeedbackData } from "./feedback-primitives"
|
|
24
24
|
import type { SignalScoreUrgencyLabel } from "../prototype/prototype-config"
|
|
25
|
-
import {
|
|
25
|
+
import { SCORE_TONE_CLASSES, URGENCY_SCORE_CLASSES, getUrgencyLevel, getUrgencyRange } from "./score-semantics"
|
|
26
26
|
|
|
27
27
|
// ---------------------------------------------------------------------------
|
|
28
28
|
// Types
|
|
@@ -75,28 +75,28 @@ export interface SignalPriorityPopoverProps {
|
|
|
75
75
|
// ---------------------------------------------------------------------------
|
|
76
76
|
|
|
77
77
|
const URGENCY_TRIGGER_DEFAULT: Record<SignalScoreUrgencyLabel, string> = {
|
|
78
|
-
Urgent:
|
|
79
|
-
High:
|
|
80
|
-
Medium:
|
|
81
|
-
Low:
|
|
78
|
+
Urgent: URGENCY_SCORE_CLASSES.Urgent.trigger,
|
|
79
|
+
High: URGENCY_SCORE_CLASSES.High.trigger,
|
|
80
|
+
Medium: URGENCY_SCORE_CLASSES.Medium.trigger,
|
|
81
|
+
Low: URGENCY_SCORE_CLASSES.Low.trigger,
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
const URGENCY_TRIGGER_HOVER: Record<SignalScoreUrgencyLabel, string> = {
|
|
85
|
-
Urgent:
|
|
86
|
-
High:
|
|
87
|
-
Medium:
|
|
88
|
-
Low:
|
|
85
|
+
Urgent: URGENCY_SCORE_CLASSES.Urgent.hover,
|
|
86
|
+
High: URGENCY_SCORE_CLASSES.High.hover,
|
|
87
|
+
Medium: URGENCY_SCORE_CLASSES.Medium.hover,
|
|
88
|
+
Low: URGENCY_SCORE_CLASSES.Low.hover,
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
const URGENCY_TRIGGER_OPEN: Record<SignalScoreUrgencyLabel, string> = {
|
|
92
|
-
Urgent:
|
|
93
|
-
High:
|
|
94
|
-
Medium:
|
|
95
|
-
Low:
|
|
92
|
+
Urgent: URGENCY_SCORE_CLASSES.Urgent.open,
|
|
93
|
+
High: URGENCY_SCORE_CLASSES.High.open,
|
|
94
|
+
Medium: URGENCY_SCORE_CLASSES.Medium.open,
|
|
95
|
+
Low: URGENCY_SCORE_CLASSES.Low.open,
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
/** Re-use shared tone classes from score-
|
|
99
|
-
const TONE_ICON_CLASSES: Record<PriorityFactor["tone"], string> =
|
|
98
|
+
/** Re-use shared tone classes from score-semantics. */
|
|
99
|
+
const TONE_ICON_CLASSES: Record<PriorityFactor["tone"], string> = SCORE_TONE_CLASSES as Record<PriorityFactor["tone"], string>
|
|
100
100
|
|
|
101
101
|
const DIRECTION_CLASSES: Record<PriorityFactor["direction"], string> = {
|
|
102
102
|
raises: "text-red-600",
|
|
@@ -124,10 +124,10 @@ const FACTOR_ICONS: Record<string, LucideIcon> = {
|
|
|
124
124
|
// ---------------------------------------------------------------------------
|
|
125
125
|
|
|
126
126
|
const URGENCY_DOT_CLASSES: Record<SignalScoreUrgencyLabel, string> = {
|
|
127
|
-
Urgent:
|
|
128
|
-
High:
|
|
129
|
-
Medium:
|
|
130
|
-
Low:
|
|
127
|
+
Urgent: URGENCY_SCORE_CLASSES.Urgent.dot,
|
|
128
|
+
High: URGENCY_SCORE_CLASSES.High.dot,
|
|
129
|
+
Medium: URGENCY_SCORE_CLASSES.Medium.dot,
|
|
130
|
+
Low: URGENCY_SCORE_CLASSES.Low.dot,
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
// ---------------------------------------------------------------------------
|
|
@@ -283,8 +283,8 @@ export function SignalPriorityPopover({
|
|
|
283
283
|
onFactorFeedback,
|
|
284
284
|
initialPriorityFeedback,
|
|
285
285
|
}: SignalPriorityPopoverProps) {
|
|
286
|
-
const urgencyLabel =
|
|
287
|
-
const scoreRange =
|
|
286
|
+
const urgencyLabel = providedLabel ?? getUrgencyLevel(score)
|
|
287
|
+
const scoreRange = getUrgencyRange(urgencyLabel)
|
|
288
288
|
|
|
289
289
|
const [open, setOpen] = React.useState(false)
|
|
290
290
|
const [feedback, setFeedback] = React.useState<"positive" | "negative" | null>(null)
|
|
@@ -258,9 +258,9 @@ export function VirtualizedDataTable<TData>({
|
|
|
258
258
|
|
|
259
259
|
const sortIcon = (() => {
|
|
260
260
|
if (!canServerSort) return null
|
|
261
|
-
if (activeSortColumn === sortKey && activeSortDirection === "asc") return <ArrowUp className="w-3 h-3" />
|
|
262
|
-
if (activeSortColumn === sortKey && activeSortDirection === "desc") return <ArrowDown className="w-3 h-3" />
|
|
263
|
-
return <ArrowUpDown className="w-3 h-3 opacity-40" />
|
|
261
|
+
if (activeSortColumn === sortKey && activeSortDirection === "asc") return <ArrowUp className="w-3 h-3 shrink-0" />
|
|
262
|
+
if (activeSortColumn === sortKey && activeSortDirection === "desc") return <ArrowDown className="w-3 h-3 shrink-0" />
|
|
263
|
+
return <ArrowUpDown className="w-3 h-3 shrink-0 opacity-40" />
|
|
264
264
|
})()
|
|
265
265
|
|
|
266
266
|
const handleHeaderClick = canServerSort ? () => {
|
|
@@ -274,7 +274,7 @@ export function VirtualizedDataTable<TData>({
|
|
|
274
274
|
<div
|
|
275
275
|
key={header.id}
|
|
276
276
|
className={cn(
|
|
277
|
-
"group/header h-9 px-3 flex items-center text-xs font-medium text-muted-foreground whitespace-nowrap relative",
|
|
277
|
+
"group/header h-9 min-w-0 px-3 flex items-center text-xs font-medium text-muted-foreground whitespace-nowrap relative",
|
|
278
278
|
header.column.getCanResize() && "pr-4",
|
|
279
279
|
)}
|
|
280
280
|
style={{
|
|
@@ -290,42 +290,48 @@ export function VirtualizedDataTable<TData>({
|
|
|
290
290
|
{canServerSort ? (
|
|
291
291
|
<button
|
|
292
292
|
type="button"
|
|
293
|
-
className="
|
|
293
|
+
className="flex min-w-0 flex-1 items-center gap-1 hover:text-foreground transition-colors"
|
|
294
294
|
onClick={handleHeaderClick}
|
|
295
295
|
>
|
|
296
|
-
|
|
296
|
+
<span className="min-w-0 truncate">
|
|
297
|
+
{flexRender(header.column.columnDef.header, header.getContext())}
|
|
298
|
+
</span>
|
|
297
299
|
{sortIcon}
|
|
298
300
|
</button>
|
|
299
301
|
) : header.column.getCanSort() ? (
|
|
300
302
|
<button
|
|
301
303
|
type="button"
|
|
302
|
-
className="
|
|
304
|
+
className="flex min-w-0 flex-1 items-center gap-1 hover:text-foreground transition-colors"
|
|
303
305
|
onClick={header.column.getToggleSortingHandler()}
|
|
304
306
|
>
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
307
|
+
<span className="min-w-0 truncate">
|
|
308
|
+
{flexRender(
|
|
309
|
+
header.column.columnDef.header,
|
|
310
|
+
header.getContext(),
|
|
311
|
+
)}
|
|
312
|
+
</span>
|
|
309
313
|
{header.column.getIsSorted() === "asc" ? (
|
|
310
|
-
<ArrowUp className="w-3 h-3" />
|
|
314
|
+
<ArrowUp className="w-3 h-3 shrink-0" />
|
|
311
315
|
) : header.column.getIsSorted() === "desc" ? (
|
|
312
|
-
<ArrowDown className="w-3 h-3" />
|
|
316
|
+
<ArrowDown className="w-3 h-3 shrink-0" />
|
|
313
317
|
) : (
|
|
314
|
-
<ArrowUpDown className="w-3 h-3 opacity-40" />
|
|
318
|
+
<ArrowUpDown className="w-3 h-3 shrink-0 opacity-40" />
|
|
315
319
|
)}
|
|
316
320
|
</button>
|
|
317
321
|
) : (
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
+
<span className="min-w-0 flex-1 truncate">
|
|
323
|
+
{flexRender(
|
|
324
|
+
header.column.columnDef.header,
|
|
325
|
+
header.getContext(),
|
|
326
|
+
)}
|
|
327
|
+
</span>
|
|
322
328
|
)}
|
|
323
329
|
{(canServerSort || header.column.getCanSort() || header.column.getCanHide()) && (
|
|
324
330
|
<DropdownMenu>
|
|
325
331
|
<DropdownMenuTrigger asChild>
|
|
326
332
|
<button
|
|
327
333
|
type="button"
|
|
328
|
-
className="ml-1 inline-flex items-center hover:text-foreground transition-all opacity-0 group-hover/header:opacity-100"
|
|
334
|
+
className="ml-1 inline-flex shrink-0 items-center hover:text-foreground transition-all opacity-0 group-hover/header:opacity-100"
|
|
329
335
|
aria-label="Column actions"
|
|
330
336
|
>
|
|
331
337
|
<ChevronDown className="w-3 h-3" />
|
package/src/index.ts
CHANGED
|
@@ -77,6 +77,7 @@ export * from "./components/rich-text-toolbar"
|
|
|
77
77
|
export * from "./components/score-analysis-modal"
|
|
78
78
|
export * from "./components/score-breakdown"
|
|
79
79
|
export * from "./components/score-feedback"
|
|
80
|
+
export * from "./components/score-semantics"
|
|
80
81
|
export * from "./components/score-why-chips"
|
|
81
82
|
export * from "./components/score-ring"
|
|
82
83
|
export * from "./components/scroll-area"
|