@handled-ai/design-system 0.7.0 → 0.8.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/index.d.ts CHANGED
@@ -1481,6 +1481,7 @@ interface InboxViewConfig {
1481
1481
  quickFilterTabs?: Array<{
1482
1482
  id: string;
1483
1483
  label: string;
1484
+ matchValue?: string;
1484
1485
  count?: number;
1485
1486
  }>;
1486
1487
  hideAccountsButton?: boolean;
@@ -1703,7 +1704,7 @@ declare function PrototypeInsightsView({ tabs, coaching, metrics, expandedMetric
1703
1704
 
1704
1705
  interface PrototypeAccountsViewProps extends AccountsViewConfig {
1705
1706
  headerActions?: React.ReactNode;
1706
- onRowClick?: () => void;
1707
+ onRowClick?: (row: DataRow) => void;
1707
1708
  }
1708
1709
  declare function PrototypeAccountsView({ filterTabs, headerActions, onRowClick, rows, filterCategories, quickViews, moreQuickViews, quickViewFilters, iconMap, entityUrlBuilder, onScoreFactorFeedback, onScoreApproveFeedback, onScoreDismissFeedback, }: PrototypeAccountsViewProps): React.JSX.Element;
1709
1710
 
package/dist/index.js CHANGED
@@ -9286,6 +9286,8 @@ function PrototypeInboxView({
9286
9286
  const [selectedTask, setSelectedTask] = React58.useState(items[0]);
9287
9287
  const [inboxAssignee, setInboxAssignee] = React58.useState("me");
9288
9288
  const [inboxFilters, setInboxFilters] = React58.useState({});
9289
+ const [activeQuickFilter, setActiveQuickFilter] = React58.useState("all");
9290
+ const [splitViewSearch, setSplitViewSearch] = React58.useState("");
9289
9291
  const sections = React58.useMemo(
9290
9292
  () => __spreadValues(__spreadValues({}, DEFAULT_DETAIL_SECTIONS), detailSections),
9291
9293
  [detailSections]
@@ -9319,14 +9321,83 @@ function PrototypeInboxView({
9319
9321
  () => getSignalScoreProp != null ? getSignalScoreProp : (() => DEFAULT_SIGNAL_SCORE),
9320
9322
  [getSignalScoreProp]
9321
9323
  );
9324
+ const filterFieldMap = React58.useMemo(() => {
9325
+ const map = {};
9326
+ for (const cat of resolvedFilterCategories) {
9327
+ switch (cat.id) {
9328
+ case "category":
9329
+ case "signalType":
9330
+ map[cat.id] = (item, v) => item.tag1.toLowerCase() === v.toLowerCase();
9331
+ break;
9332
+ case "account":
9333
+ map[cat.id] = (item, v) => item.company.toLowerCase() === v.toLowerCase();
9334
+ break;
9335
+ default:
9336
+ map[cat.id] = (item, v) => {
9337
+ const lv = v.toLowerCase();
9338
+ return item.tag1.toLowerCase() === lv || item.company.toLowerCase() === lv || item.title.toLowerCase().includes(lv) || item.details.toLowerCase().includes(lv);
9339
+ };
9340
+ }
9341
+ }
9342
+ return map;
9343
+ }, [resolvedFilterCategories]);
9344
+ const filteredItems = React58.useMemo(() => {
9345
+ const activeFilters = Object.entries(inboxFilters).filter(
9346
+ ([, value]) => value && value !== "all"
9347
+ );
9348
+ if (activeFilters.length === 0) return items;
9349
+ return items.filter(
9350
+ (item) => activeFilters.every(([key, value]) => {
9351
+ const matcher = filterFieldMap[key];
9352
+ return matcher ? matcher(item, value) : true;
9353
+ })
9354
+ );
9355
+ }, [items, inboxFilters, filterFieldMap]);
9356
+ const resolvedQuickFilterTabs = React58.useMemo(() => {
9357
+ if (quickFilterTabs) return quickFilterTabs;
9358
+ const uniqueTags = [...new Set(items.map((i) => i.tag1))];
9359
+ return uniqueTags.map((tag) => ({
9360
+ id: tag.toLowerCase().replace(/\s+/g, "-"),
9361
+ label: tag
9362
+ }));
9363
+ }, [quickFilterTabs, items]);
9364
+ const quickFilterTabCounts = React58.useMemo(() => {
9365
+ var _a2;
9366
+ const counts = {};
9367
+ for (const tab of resolvedQuickFilterTabs) {
9368
+ const match = ((_a2 = tab.matchValue) != null ? _a2 : tab.label).toLowerCase();
9369
+ counts[tab.id] = items.filter((i) => i.tag1.toLowerCase() === match).length;
9370
+ }
9371
+ return counts;
9372
+ }, [resolvedQuickFilterTabs, items]);
9373
+ const splitViewItems = React58.useMemo(() => {
9374
+ var _a2;
9375
+ let filtered = items;
9376
+ if (activeQuickFilter !== "all") {
9377
+ const activeTab = resolvedQuickFilterTabs.find((t) => t.id === activeQuickFilter);
9378
+ if (activeTab) {
9379
+ const match = ((_a2 = activeTab.matchValue) != null ? _a2 : activeTab.label).toLowerCase();
9380
+ filtered = filtered.filter(
9381
+ (item) => item.tag1.toLowerCase() === match
9382
+ );
9383
+ }
9384
+ }
9385
+ if (splitViewSearch.trim()) {
9386
+ const q = splitViewSearch.trim().toLowerCase();
9387
+ filtered = filtered.filter(
9388
+ (item) => item.tag1.toLowerCase().includes(q) || item.company.toLowerCase().includes(q) || item.title.toLowerCase().includes(q)
9389
+ );
9390
+ }
9391
+ return filtered;
9392
+ }, [items, activeQuickFilter, resolvedQuickFilterTabs, splitViewSearch]);
9322
9393
  const inboxGroups = React58.useMemo(() => {
9323
- const urgent = items.filter((i) => i.statusColor === "red");
9324
- const active = items.filter((i) => i.statusColor !== "red");
9394
+ const urgent = filteredItems.filter((i) => i.statusColor === "red");
9395
+ const active = filteredItems.filter((i) => i.statusColor !== "red");
9325
9396
  return [
9326
9397
  { key: "urgent", label: "Urgent", items: urgent },
9327
9398
  { key: "active", label: "Active", items: active }
9328
9399
  ].filter((g) => g.items.length > 0);
9329
- }, [items]);
9400
+ }, [filteredItems]);
9330
9401
  const renderInboxRow = React58.useCallback(
9331
9402
  (item) => /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement("span", { className: `h-2 w-2 shrink-0 rounded-full ${item.statusColor === "red" ? "bg-[#f43f5e]" : "bg-[#3b82f6]"}` }), /* @__PURE__ */ React58.createElement("span", { className: "w-[80px] shrink-0 font-mono text-xs text-muted-foreground/80" }, item.id), /* @__PURE__ */ React58.createElement("span", { className: "shrink-0 rounded-md border border-border bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground whitespace-nowrap" }, item.tag1), /* @__PURE__ */ React58.createElement("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-foreground" }, item.title), /* @__PURE__ */ React58.createElement("span", { className: "w-[120px] shrink-0 truncate text-xs font-medium text-foreground" }, item.company), /* @__PURE__ */ React58.createElement("span", { className: "w-[80px] shrink-0 text-right text-xs text-muted-foreground" }, item.time)),
9332
9403
  []
@@ -9422,7 +9493,39 @@ function PrototypeInboxView({
9422
9493
  }
9423
9494
  )) : (
9424
9495
  /* Split view */
9425
- /* @__PURE__ */ React58.createElement("div", { className: "flex h-full min-h-0 w-full flex-1" }, /* @__PURE__ */ React58.createElement("div", { className: "flex h-full min-w-[380px] w-[380px] flex-col border-r border-border bg-background shadow-sm z-10" }, /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col gap-4 border-b border-border p-4 shrink-0" }, !hideToolbarActions && /* @__PURE__ */ React58.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "icon", className: "h-8 w-8 text-muted-foreground" }, /* @__PURE__ */ React58.createElement(Eye, { className: "w-4 h-4" })), /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "icon", className: "h-8 w-8 text-muted-foreground" }, /* @__PURE__ */ React58.createElement(FileText, { className: "w-4 h-4" })), /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "icon", className: "h-8 w-8 text-muted-foreground" }, /* @__PURE__ */ React58.createElement(Clock, { className: "w-4 h-4" })), /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "icon", className: "h-8 w-8 text-muted-foreground" }, /* @__PURE__ */ React58.createElement(CheckSquare, { className: "w-4 h-4" }))), /* @__PURE__ */ React58.createElement(Button, { size: "sm", className: "h-8 px-4 bg-foreground text-background hover:bg-foreground/90 text-xs font-semibold gap-1.5 rounded-md" }, /* @__PURE__ */ React58.createElement(Plus, { className: "w-4 h-4" }), " Add Task")), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React58.createElement("div", { className: "relative flex-1" }, /* @__PURE__ */ React58.createElement(Filter, { className: "absolute left-2.5 top-1.5 w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React58.createElement(Input, { className: "h-8 pl-8 text-xs bg-background border-border rounded-md shadow-none", placeholder: "Categories" })), !hideAccountsButton && /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "sm", className: "h-8 text-xs font-medium rounded-md shadow-none" }, /* @__PURE__ */ React58.createElement(Building, { className: "w-3.5 h-3.5 mr-1.5" }), " ", accountDetailsLabel != null ? accountDetailsLabel : "Accounts")), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-1.5 overflow-x-auto pb-1 mt-1 scrollbar-hide" }, quickFilterTabs ? /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(Button, { size: "sm", className: "h-7 rounded-full px-3.5 text-[11px] font-semibold bg-foreground text-background hover:bg-foreground/90 shadow-none" }, "All"), quickFilterTabs.map((tab) => /* @__PURE__ */ React58.createElement(Button, { key: tab.id, variant: "outline", size: "sm", className: "h-7 rounded-full px-3.5 text-[11px] font-medium bg-transparent border-border text-muted-foreground hover:text-foreground shadow-none" }, tab.label, tab.count != null ? ` (${tab.count})` : ""))) : /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(Button, { size: "sm", className: "h-7 rounded-full px-3.5 text-[11px] font-semibold bg-foreground text-background hover:bg-foreground/90 shadow-none" }, "All"), /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "sm", className: "h-7 rounded-full px-3.5 text-[11px] font-medium bg-transparent border-border text-muted-foreground hover:text-foreground shadow-none" }, "Outbound (10)"), /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "sm", className: "h-7 rounded-full px-3.5 text-[11px] font-medium bg-transparent border-border text-muted-foreground hover:text-foreground shadow-none" }, "Retention (12)"), /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "sm", className: "h-7 rounded-full px-3.5 text-[11px] font-medium bg-transparent border-border text-muted-foreground hover:text-foreground shadow-none" }, "Relationship (9)")))), /* @__PURE__ */ React58.createElement("div", { className: "flex-1 overflow-y-auto" }, items.map((item) => /* @__PURE__ */ React58.createElement(
9496
+ /* @__PURE__ */ React58.createElement("div", { className: "flex h-full min-h-0 w-full flex-1" }, /* @__PURE__ */ React58.createElement("div", { className: "flex h-full min-w-[380px] w-[380px] flex-col border-r border-border bg-background shadow-sm z-10" }, /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col gap-4 border-b border-border p-4 shrink-0" }, !hideToolbarActions && /* @__PURE__ */ React58.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "icon", className: "h-8 w-8 text-muted-foreground" }, /* @__PURE__ */ React58.createElement(Eye, { className: "w-4 h-4" })), /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "icon", className: "h-8 w-8 text-muted-foreground" }, /* @__PURE__ */ React58.createElement(FileText, { className: "w-4 h-4" })), /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "icon", className: "h-8 w-8 text-muted-foreground" }, /* @__PURE__ */ React58.createElement(Clock, { className: "w-4 h-4" })), /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "icon", className: "h-8 w-8 text-muted-foreground" }, /* @__PURE__ */ React58.createElement(CheckSquare, { className: "w-4 h-4" }))), /* @__PURE__ */ React58.createElement(Button, { size: "sm", className: "h-8 px-4 bg-foreground text-background hover:bg-foreground/90 text-xs font-semibold gap-1.5 rounded-md" }, /* @__PURE__ */ React58.createElement(Plus, { className: "w-4 h-4" }), " Add Task")), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React58.createElement("div", { className: "relative flex-1" }, /* @__PURE__ */ React58.createElement(Filter, { className: "absolute left-2.5 top-1.5 w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React58.createElement(
9497
+ Input,
9498
+ {
9499
+ className: "h-8 pl-8 text-xs bg-background border-border rounded-md shadow-none",
9500
+ placeholder: "Filter by category...",
9501
+ value: splitViewSearch,
9502
+ onChange: (e) => setSplitViewSearch(e.target.value)
9503
+ }
9504
+ )), !hideAccountsButton && /* @__PURE__ */ React58.createElement(Button, { variant: "outline", size: "sm", className: "h-8 text-xs font-medium rounded-md shadow-none" }, /* @__PURE__ */ React58.createElement(Building, { className: "w-3.5 h-3.5 mr-1.5" }), " ", accountDetailsLabel != null ? accountDetailsLabel : "Accounts")), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-1.5 overflow-x-auto pb-1 mt-1 scrollbar-hide" }, /* @__PURE__ */ React58.createElement(
9505
+ Button,
9506
+ {
9507
+ size: "sm",
9508
+ variant: activeQuickFilter === "all" ? "default" : "outline",
9509
+ className: `h-7 rounded-full px-3.5 text-[11px] font-semibold shadow-none ${activeQuickFilter === "all" ? "bg-foreground text-background hover:bg-foreground/90" : "bg-transparent border-border text-muted-foreground hover:text-foreground"}`,
9510
+ onClick: () => setActiveQuickFilter("all")
9511
+ },
9512
+ "All"
9513
+ ), resolvedQuickFilterTabs.map((tab) => {
9514
+ var _a2;
9515
+ const count = (_a2 = tab.count) != null ? _a2 : quickFilterTabCounts[tab.id];
9516
+ return /* @__PURE__ */ React58.createElement(
9517
+ Button,
9518
+ {
9519
+ key: tab.id,
9520
+ size: "sm",
9521
+ variant: activeQuickFilter === tab.id ? "default" : "outline",
9522
+ className: `h-7 rounded-full px-3.5 text-[11px] font-medium shadow-none ${activeQuickFilter === tab.id ? "bg-foreground text-background hover:bg-foreground/90" : "bg-transparent border-border text-muted-foreground hover:text-foreground"}`,
9523
+ onClick: () => setActiveQuickFilter(tab.id)
9524
+ },
9525
+ tab.label,
9526
+ count != null && count > 0 ? ` (${count})` : ""
9527
+ );
9528
+ }))), /* @__PURE__ */ React58.createElement("div", { className: "flex-1 overflow-y-auto" }, splitViewItems.map((item) => /* @__PURE__ */ React58.createElement(
9426
9529
  "div",
9427
9530
  {
9428
9531
  key: item.id,
@@ -9795,7 +9898,7 @@ function PrototypeShell({
9795
9898
  },
9796
9899
  [navigableViews, onNavigate]
9797
9900
  );
9798
- const handleOpenEntityPanel = React58.useCallback(() => setIsEntityPanelOpen(true), []);
9901
+ const handleOpenEntityPanel = React58.useCallback((_entity) => setIsEntityPanelOpen(true), []);
9799
9902
  const handleOpenRecentActivity = React58.useCallback(() => {
9800
9903
  setIsEntityPanelOpen(true);
9801
9904
  setTimeout(() => {