@inf-monkeys-tech/monkeys-design 1.0.56 → 1.0.60

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.
@@ -11330,6 +11330,22 @@ function WorkbenchAssetGallery({
11330
11330
  }
11331
11331
  ) });
11332
11332
  }
11333
+
11334
+ // src/components/workbench/workbenchVisualizationTone.ts
11335
+ var toneVariable = {
11336
+ primary: "--radar-series-one",
11337
+ secondary: "--radar-series-two",
11338
+ accent: "--radar-series-three",
11339
+ muted: "--radar-series-four"
11340
+ };
11341
+ var toneFallback = {
11342
+ primary: "var(--primary)",
11343
+ secondary: "var(--secondary-foreground)",
11344
+ accent: "var(--accent-foreground)",
11345
+ muted: "var(--muted-foreground)"
11346
+ };
11347
+ var workbenchVisualizationToneColor = (tone) => `hsl(var(${toneVariable[tone]}, ${toneFallback[tone]}))`;
11348
+ var workbenchVisualizationToneColorWithAlpha = (tone, alpha) => `hsl(var(${toneVariable[tone]}, ${toneFallback[tone]}) / ${alpha})`;
11333
11349
  var radarWorkspaceStyle = {
11334
11350
  backgroundColor: "hsl(var(--radar-canvas, var(--background)))",
11335
11351
  color: "hsl(var(--foreground))"
@@ -11494,24 +11510,166 @@ function WorkbenchRadarInspectorSection({
11494
11510
  }
11495
11511
  );
11496
11512
  }
11513
+ function assertValidRadarFilterRowProps(props) {
11514
+ const { disclosure, onSelect } = props;
11515
+ const invalid = !disclosure && !onSelect || disclosure?.mode === "integrated" && (Boolean(onSelect) || props.selected !== void 0) || disclosure?.mode === "separate" && !onSelect;
11516
+ if (invalid) {
11517
+ throw new Error("Invalid WorkbenchRadarFilterRow props.");
11518
+ }
11519
+ }
11520
+ function WorkbenchRadarFilterRow(props) {
11521
+ assertValidRadarFilterRowProps(props);
11522
+ const {
11523
+ label,
11524
+ value,
11525
+ icon,
11526
+ selected,
11527
+ disabled = false,
11528
+ tone,
11529
+ onSelect,
11530
+ disclosure,
11531
+ className
11532
+ } = props;
11533
+ const isSelected = selected ?? false;
11534
+ const selectedClasses = isSelected ? void 0 : "monkeys-workbench-radar-filter-row--idle";
11535
+ const disabledClasses = disabled ? "monkeys-workbench-radar-filter-disabled" : void 0;
11536
+ const resolvedTone = tone ?? "primary";
11537
+ const toneColor = workbenchVisualizationToneColor(resolvedTone);
11538
+ const style = {
11539
+ "--workbench-radar-filter-tone": toneColor,
11540
+ "--tw-ring-color": tone ? toneColor : "hsl(var(--ring))",
11541
+ ...isSelected || tone ? {
11542
+ backgroundColor: workbenchVisualizationToneColorWithAlpha(
11543
+ resolvedTone,
11544
+ isSelected ? 0.14 : 0.08
11545
+ ),
11546
+ borderColor: toneColor
11547
+ } : {}
11548
+ };
11549
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
11550
+ hasRenderableNode(icon) ? /* @__PURE__ */ jsx(
11551
+ "span",
11552
+ {
11553
+ className: cn(
11554
+ "flex size-4 shrink-0 items-center justify-center",
11555
+ tone ? "text-[var(--workbench-radar-filter-tone)]" : "text-muted-foreground"
11556
+ ),
11557
+ "aria-hidden": "true",
11558
+ children: icon
11559
+ }
11560
+ ) : null,
11561
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: label }),
11562
+ hasRenderableNode(value) ? /* @__PURE__ */ jsx("span", { className: "ml-auto shrink-0 tabular-nums text-muted-foreground", children: value }) : null
11563
+ ] });
11564
+ const disclosureIcon = disclosure ? /* @__PURE__ */ jsx(
11565
+ "span",
11566
+ {
11567
+ "aria-hidden": "true",
11568
+ className: cn(
11569
+ "text-lg leading-none transition-transform motion-reduce:transition-none",
11570
+ disclosure.expanded && "rotate-90"
11571
+ ),
11572
+ children: "\u203A"
11573
+ }
11574
+ ) : null;
11575
+ if (disclosure?.mode === "separate") {
11576
+ const disclosureLabel2 = disclosure.expanded ? disclosure.collapseLabel : disclosure.expandLabel;
11577
+ return /* @__PURE__ */ jsxs(
11578
+ "div",
11579
+ {
11580
+ "data-monkeys-component": "workbench-radar-filter-row",
11581
+ className: cn(
11582
+ "monkeys-workbench-radar-filter-row monkeys-workbench-radar-filter-row--separate",
11583
+ selectedClasses,
11584
+ disabledClasses,
11585
+ className
11586
+ ),
11587
+ style,
11588
+ children: [
11589
+ /* @__PURE__ */ jsx(
11590
+ "button",
11591
+ {
11592
+ type: "button",
11593
+ "aria-pressed": selected,
11594
+ disabled,
11595
+ onClick: onSelect,
11596
+ className: cn(
11597
+ "monkeys-workbench-radar-filter-control monkeys-workbench-radar-filter-row__action",
11598
+ disabledClasses
11599
+ ),
11600
+ children: content
11601
+ }
11602
+ ),
11603
+ /* @__PURE__ */ jsx(
11604
+ "button",
11605
+ {
11606
+ type: "button",
11607
+ "aria-expanded": disclosure.expanded,
11608
+ "aria-controls": disclosure.controls,
11609
+ "aria-label": disclosureLabel2,
11610
+ disabled,
11611
+ onClick: disclosure.onToggle,
11612
+ className: cn(
11613
+ "monkeys-workbench-radar-filter-row__disclosure",
11614
+ disabledClasses
11615
+ ),
11616
+ children: disclosureIcon
11617
+ }
11618
+ )
11619
+ ]
11620
+ }
11621
+ );
11622
+ }
11623
+ const integratedDisclosure = disclosure?.mode === "integrated" ? disclosure : void 0;
11624
+ const disclosureLabel = integratedDisclosure ? integratedDisclosure.expanded ? integratedDisclosure.collapseLabel : integratedDisclosure.expandLabel : void 0;
11625
+ return /* @__PURE__ */ jsxs(
11626
+ "button",
11627
+ {
11628
+ type: "button",
11629
+ "data-monkeys-component": "workbench-radar-filter-row",
11630
+ "aria-label": disclosureLabel,
11631
+ "aria-pressed": integratedDisclosure ? void 0 : selected,
11632
+ "aria-expanded": integratedDisclosure?.expanded,
11633
+ "aria-controls": integratedDisclosure?.controls,
11634
+ disabled,
11635
+ onClick: integratedDisclosure?.onToggle ?? onSelect,
11636
+ className: cn(
11637
+ "monkeys-workbench-radar-filter-control monkeys-workbench-radar-filter-row",
11638
+ selectedClasses,
11639
+ disabledClasses,
11640
+ className
11641
+ ),
11642
+ style,
11643
+ children: [
11644
+ content,
11645
+ integratedDisclosure ? /* @__PURE__ */ jsx("span", { className: "ml-auto shrink-0 text-muted-foreground", children: disclosureIcon }) : null
11646
+ ]
11647
+ }
11648
+ );
11649
+ }
11497
11650
  function WorkbenchRadarFilterChip({
11498
11651
  label,
11499
11652
  value,
11500
11653
  icon,
11501
11654
  selected = false,
11655
+ disabled = false,
11502
11656
  onSelect,
11503
11657
  className
11504
11658
  }) {
11505
- const Comp = onSelect ? "button" : "div";
11659
+ const interactive = Boolean(onSelect) || disabled;
11660
+ const Comp = interactive ? "button" : "div";
11506
11661
  return /* @__PURE__ */ jsxs(
11507
11662
  Comp,
11508
11663
  {
11509
- type: onSelect ? "button" : void 0,
11510
- "aria-pressed": onSelect ? selected : void 0,
11664
+ type: interactive ? "button" : void 0,
11665
+ "aria-pressed": onSelect && !disabled ? selected : void 0,
11666
+ disabled: interactive ? disabled : void 0,
11511
11667
  onClick: onSelect,
11512
11668
  className: cn(
11513
- "flex min-h-9 min-w-0 items-center gap-2 rounded-full border px-3 text-xs font-semibold outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",
11669
+ "flex min-w-0 items-center border text-xs font-semibold outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",
11670
+ "monkeys-workbench-radar-filter-control rounded-full",
11514
11671
  selected ? "border-primary bg-primary/20 text-primary" : "border-border bg-background/40 text-foreground hover:border-primary/60 hover:bg-primary/10",
11672
+ disabled && "cursor-not-allowed opacity-50",
11515
11673
  className
11516
11674
  ),
11517
11675
  children: [
@@ -11532,20 +11690,6 @@ var getDomain2 = (values, min, max) => {
11532
11690
  };
11533
11691
  var scale2 = (value, domain, start, end) => start + (value - domain[0]) / (domain[1] - domain[0]) * (end - start);
11534
11692
  var clamp5 = (value, min, max) => Math.min(max, Math.max(min, value));
11535
- var toneVariable = {
11536
- primary: "--radar-series-one",
11537
- secondary: "--radar-series-two",
11538
- accent: "--radar-series-three",
11539
- muted: "--radar-series-four"
11540
- };
11541
- var toneFallback = {
11542
- primary: "var(--primary)",
11543
- secondary: "var(--secondary-foreground)",
11544
- accent: "var(--accent-foreground)",
11545
- muted: "var(--muted-foreground)"
11546
- };
11547
- var toneColor = (tone) => `hsl(var(${toneVariable[tone]}, ${toneFallback[tone]}))`;
11548
- var toneColorWithAlpha = (tone, alpha) => `hsl(var(${toneVariable[tone]}, ${toneFallback[tone]}) / ${alpha})`;
11549
11693
  var activatePoint2 = (event, point, onPointSelect) => {
11550
11694
  if (!onPointSelect || event.key !== "Enter" && event.key !== " ") return;
11551
11695
  event.preventDefault();
@@ -11720,12 +11864,12 @@ function WorkbenchRadarMatrix({
11720
11864
  const radius = labelled ? clamp5(scale2(point.size ?? 1, sizeDomain, 5, 9), 5, 9) : 3.5;
11721
11865
  const fontSize = labelled ? clamp5(scale2(point.size ?? 1, sizeDomain, 14, 31), 14, 31) : 0;
11722
11866
  const pointStyle = {
11723
- fill: toneColor(tone),
11867
+ fill: workbenchVisualizationToneColor(tone),
11724
11868
  stroke: "hsl(var(--foreground) / 0.74)"
11725
11869
  };
11726
11870
  const labelStyle = {
11727
- fill: toneColor(tone),
11728
- filter: `drop-shadow(0 0 0.65rem ${toneColorWithAlpha(tone, 0.72)})`
11871
+ fill: workbenchVisualizationToneColor(tone),
11872
+ filter: `drop-shadow(0 0 0.65rem ${workbenchVisualizationToneColorWithAlpha(tone, 0.72)})`
11729
11873
  };
11730
11874
  return /* @__PURE__ */ jsxs(
11731
11875
  "g",
@@ -11745,7 +11889,7 @@ function WorkbenchRadarMatrix({
11745
11889
  r: radius + 10,
11746
11890
  fill: "none",
11747
11891
  strokeWidth: "2",
11748
- style: { stroke: toneColorWithAlpha(tone, 0.48) }
11892
+ style: { stroke: workbenchVisualizationToneColorWithAlpha(tone, 0.48) }
11749
11893
  }
11750
11894
  ) : null,
11751
11895
  /* @__PURE__ */ jsx("circle", { r: radius, strokeWidth: "1.25", style: pointStyle }),
@@ -11823,7 +11967,7 @@ function WorkbenchRadarMatrix({
11823
11967
  cx: clamp5(scale2(point.x, xDomain, 40, width - 40), 40, width - 40),
11824
11968
  cy: clamp5(scale2(point.y, yDomain, height - 48, 54), 54, height - 48),
11825
11969
  r: "8",
11826
- style: { fill: toneColor(point.tone || (index % 2 === 0 ? "primary" : "accent")) }
11970
+ style: { fill: workbenchVisualizationToneColor(point.tone || (index % 2 === 0 ? "primary" : "accent")) }
11827
11971
  },
11828
11972
  point.id
11829
11973
  )),
@@ -11846,7 +11990,7 @@ function WorkbenchRadarMatrix({
11846
11990
  legend.length ? /* @__PURE__ */ jsx("div", { className: "absolute bottom-4 left-1/2 hidden -translate-x-1/2 items-center gap-4 rounded-full border border-border bg-card/95 px-4 py-2 text-xs font-semibold shadow-xl md:flex", children: legend.map((item) => {
11847
11991
  const tone = item.tone || "muted";
11848
11992
  return /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-muted-foreground", children: [
11849
- /* @__PURE__ */ jsx("span", { className: "size-2 rounded-full", style: { backgroundColor: toneColor(tone) } }),
11993
+ /* @__PURE__ */ jsx("span", { className: "size-2 rounded-full", style: { backgroundColor: workbenchVisualizationToneColor(tone) } }),
11850
11994
  item.label
11851
11995
  ] }, item.id);
11852
11996
  }) }) : null
@@ -11855,6 +11999,6 @@ function WorkbenchRadarMatrix({
11855
11999
  );
11856
12000
  }
11857
12001
 
11858
- export { InteractiveTable, InteractiveTableEditableTextCell, InteractiveTableReadonlyCell, InteractiveTableSelectCell, WorkbenchAssetGallery, WorkbenchCollection, WorkbenchContentPane, WorkbenchContentToolbar, WorkbenchDetailSidebar, WorkbenchEvidenceList, WorkbenchGalleryCard, WorkbenchGallerySettingsButton, WorkbenchGallerySettingsPanel, WorkbenchGallerySkeleton, WorkbenchGalleryView, WorkbenchJourneyNavigation, WorkbenchLaneView, WorkbenchMasonryLayout, WorkbenchMetricGrid, WorkbenchPageSkeleton, WorkbenchRadarFilterChip, WorkbenchRadarInspectorSection, WorkbenchRadarMatrix, WorkbenchRadarNavigation, WorkbenchRadarWorkspace, WorkbenchRankedList, WorkbenchRelationshipGraph, WorkbenchResizableSidebar, WorkbenchScatterPlot, WorkbenchSelectionTray, WorkbenchTableView };
12002
+ export { InteractiveTable, InteractiveTableEditableTextCell, InteractiveTableReadonlyCell, InteractiveTableSelectCell, WorkbenchAssetGallery, WorkbenchCollection, WorkbenchContentPane, WorkbenchContentToolbar, WorkbenchDetailSidebar, WorkbenchEvidenceList, WorkbenchGalleryCard, WorkbenchGallerySettingsButton, WorkbenchGallerySettingsPanel, WorkbenchGallerySkeleton, WorkbenchGalleryView, WorkbenchJourneyNavigation, WorkbenchLaneView, WorkbenchMasonryLayout, WorkbenchMetricGrid, WorkbenchPageSkeleton, WorkbenchRadarFilterChip, WorkbenchRadarFilterRow, WorkbenchRadarInspectorSection, WorkbenchRadarMatrix, WorkbenchRadarNavigation, WorkbenchRadarWorkspace, WorkbenchRankedList, WorkbenchRelationshipGraph, WorkbenchResizableSidebar, WorkbenchScatterPlot, WorkbenchSelectionTray, WorkbenchTableView };
11859
12003
  //# sourceMappingURL=index.mjs.map
11860
12004
  //# sourceMappingURL=index.mjs.map