@camstack/ui-library 1.2.263 → 1.2.265

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.
@@ -18,7 +18,7 @@ export type { NetworkLinkBadgeProps, NetworkLinkStatusLike } from "./network-lin
18
18
  export { NetworkLinkBadge } from "./network-link-badge";
19
19
  export { NODE_COLOR_IDS, assignNodeColorId, nodeColorClass, nodeTextColorClass } from "./node-color";
20
20
  export type { NodeColorId } from "./node-color";
21
- export type { RoleNodePillProps } from "./role-node-pill";
21
+ export type { PipelineRoleId, RoleNodePillProps } from "./role-node-pill";
22
22
  export { RoleNodePill } from "./role-node-pill";
23
23
  export * from "./breadcrumb";
24
24
  export type { AdaptiveHintsReport, AdaptiveOfferPhase, ApplyDownlinkProbe, DownlinkProbeAnswer } from "./adaptive-downlink";
@@ -1,14 +1,19 @@
1
1
  /**
2
- * RoleNodePill — a node tinted by its palette colour (agent-settings `color`,
3
- * else stable hash). With a `roleLabel`, shows role · node · colour (Assignments).
4
- * Without, colour icon + name only (Nodes selector and similar).
2
+ * RoleNodePill — with a role: chrome tinted by ROLE (Detection / Decode /
3
+ * Audio) and a trailing node-colour dot. Without a role: colour icon + name
4
+ * only (Nodes selector and similar).
5
5
  */
6
6
  import type { NodeColorId } from "@camstack/types";
7
7
  import type { JSX, ReactNode } from "react";
8
+ /** Stable ids for the three camera roles on Assignments. */
9
+ export type PipelineRoleId = "detection" | "decode" | "audio";
8
10
  export interface RoleNodePillProps {
9
11
  /** When omitted, the pill is colour icon + node name only. */
10
12
  readonly roleLabel?: string;
13
+ /** When set with a role label, chrome uses role tones instead of node palette. */
14
+ readonly roleId?: PipelineRoleId;
11
15
  readonly nodeName: string;
16
+ /** Node palette — trailing host dot (and full chrome when there is no roleId). */
12
17
  readonly colorId: NodeColorId;
13
18
  readonly emphasized?: boolean;
14
19
  readonly pinned?: boolean;
@@ -18,4 +23,4 @@ export interface RoleNodePillProps {
18
23
  /** Extra trailing content inside the pill (e.g. "offline"). */
19
24
  readonly trailing?: ReactNode;
20
25
  }
21
- export declare function RoleNodePill({ roleLabel, nodeName, colorId, emphasized, pinned, onSelect, disabled, trailing }: RoleNodePillProps): JSX.Element;
26
+ export declare function RoleNodePill({ roleLabel, roleId, nodeName, colorId, emphasized, pinned, onSelect, disabled, trailing }: RoleNodePillProps): JSX.Element;
package/dist/index.cjs CHANGED
@@ -32837,6 +32837,16 @@ function nodeTextColorClass(id) {
32837
32837
  }
32838
32838
  //#endregion
32839
32839
  //#region src/composites/role-node-pill.tsx
32840
+ var ROLE_SOFT_CLASS = {
32841
+ detection: "bg-info/12 text-info ring-info/35",
32842
+ decode: "bg-warning/12 text-warning ring-warning/35",
32843
+ audio: "bg-success/12 text-success ring-success/35"
32844
+ };
32845
+ var ROLE_EMPHASIZED_CLASS = {
32846
+ detection: "bg-info/22 text-info ring-info/55",
32847
+ decode: "bg-warning/22 text-warning ring-warning/55",
32848
+ audio: "bg-success/22 text-success ring-success/55"
32849
+ };
32840
32850
  /** Full class strings so Tailwind v4 JIT retains node palette opacity utilities. */
32841
32851
  var NODE_BG_SOFT_CLASS = {
32842
32852
  "node-a": "bg-node-a/12",
@@ -32868,9 +32878,10 @@ var NODE_RING_CLASS = {
32868
32878
  "node-g": "ring-node-g/45",
32869
32879
  "node-h": "ring-node-h/45"
32870
32880
  };
32871
- function RoleNodePill({ roleLabel, nodeName, colorId, emphasized = false, pinned = false, onSelect, disabled = false, trailing }) {
32881
+ function RoleNodePill({ roleLabel, roleId, nodeName, colorId, emphasized = false, pinned = false, onSelect, disabled = false, trailing }) {
32872
32882
  const title = roleLabel !== void 0 ? pinned ? `${roleLabel} pinned on ${nodeName}` : `${roleLabel} on ${nodeName}` : nodeName;
32873
- const className = cn("inline-flex max-w-full items-center gap-1 rounded-full px-2 py-0.5 text-[10px] leading-tight ring-1 ring-inset", emphasized ? cn("role-node-pill-emphasized font-semibold ring-2", NODE_BG_EMPHASIZED_CLASS[colorId], NODE_RING_CLASS[colorId], nodeTextColorClass(colorId)) : cn("font-medium text-foreground-muted ring-border/60", NODE_BG_SOFT_CLASS[colorId]), onSelect !== void 0 && !disabled && "cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40", disabled && "cursor-not-allowed opacity-50");
32883
+ const roleChrome = roleLabel !== void 0 && roleId !== void 0;
32884
+ const className = cn("inline-flex max-w-full items-center gap-1 rounded-full px-2 py-0.5 text-[10px] leading-tight ring-1 ring-inset", roleChrome ? emphasized ? cn("role-node-pill-emphasized font-semibold ring-2", ROLE_EMPHASIZED_CLASS[roleId]) : cn("font-medium", ROLE_SOFT_CLASS[roleId]) : emphasized ? cn("role-node-pill-emphasized font-semibold ring-2", NODE_BG_EMPHASIZED_CLASS[colorId], NODE_RING_CLASS[colorId], nodeTextColorClass(colorId)) : cn("font-medium text-foreground-muted ring-border/60", NODE_BG_SOFT_CLASS[colorId]), onSelect !== void 0 && !disabled && "cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40", disabled && "cursor-not-allowed opacity-50");
32874
32885
  const colorIcon = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
32875
32886
  className: cn("h-1.5 w-1.5 shrink-0 rounded-full", nodeColorClass(colorId)),
32876
32887
  "aria-hidden": true
@@ -32885,7 +32896,7 @@ function RoleNodePill({ roleLabel, nodeName, colorId, emphasized = false, pinned
32885
32896
  children: roleLabel
32886
32897
  }),
32887
32898
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
32888
- className: cn("min-w-0 truncate", emphasized ? nodeTextColorClass(colorId) : "text-foreground-subtle"),
32899
+ className: cn("min-w-0 truncate", roleChrome ? "opacity-80" : emphasized ? nodeTextColorClass(colorId) : "text-foreground-subtle"),
32889
32900
  children: nodeName
32890
32901
  }),
32891
32902
  colorIcon
@@ -32902,6 +32913,7 @@ function RoleNodePill({ roleLabel, nodeName, colorId, emphasized = false, pinned
32902
32913
  role: "tab",
32903
32914
  "aria-selected": emphasized,
32904
32915
  "data-testid": "role-node-pill",
32916
+ "data-role": roleId,
32905
32917
  title,
32906
32918
  disabled,
32907
32919
  onClick: onSelect,
@@ -32910,6 +32922,7 @@ function RoleNodePill({ roleLabel, nodeName, colorId, emphasized = false, pinned
32910
32922
  });
32911
32923
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
32912
32924
  "data-testid": "role-node-pill",
32925
+ "data-role": roleId,
32913
32926
  title,
32914
32927
  className,
32915
32928
  children: body
package/dist/index.js CHANGED
@@ -32813,6 +32813,16 @@ function nodeTextColorClass(id) {
32813
32813
  }
32814
32814
  //#endregion
32815
32815
  //#region src/composites/role-node-pill.tsx
32816
+ var ROLE_SOFT_CLASS = {
32817
+ detection: "bg-info/12 text-info ring-info/35",
32818
+ decode: "bg-warning/12 text-warning ring-warning/35",
32819
+ audio: "bg-success/12 text-success ring-success/35"
32820
+ };
32821
+ var ROLE_EMPHASIZED_CLASS = {
32822
+ detection: "bg-info/22 text-info ring-info/55",
32823
+ decode: "bg-warning/22 text-warning ring-warning/55",
32824
+ audio: "bg-success/22 text-success ring-success/55"
32825
+ };
32816
32826
  /** Full class strings so Tailwind v4 JIT retains node palette opacity utilities. */
32817
32827
  var NODE_BG_SOFT_CLASS = {
32818
32828
  "node-a": "bg-node-a/12",
@@ -32844,9 +32854,10 @@ var NODE_RING_CLASS = {
32844
32854
  "node-g": "ring-node-g/45",
32845
32855
  "node-h": "ring-node-h/45"
32846
32856
  };
32847
- function RoleNodePill({ roleLabel, nodeName, colorId, emphasized = false, pinned = false, onSelect, disabled = false, trailing }) {
32857
+ function RoleNodePill({ roleLabel, roleId, nodeName, colorId, emphasized = false, pinned = false, onSelect, disabled = false, trailing }) {
32848
32858
  const title = roleLabel !== void 0 ? pinned ? `${roleLabel} pinned on ${nodeName}` : `${roleLabel} on ${nodeName}` : nodeName;
32849
- const className = cn("inline-flex max-w-full items-center gap-1 rounded-full px-2 py-0.5 text-[10px] leading-tight ring-1 ring-inset", emphasized ? cn("role-node-pill-emphasized font-semibold ring-2", NODE_BG_EMPHASIZED_CLASS[colorId], NODE_RING_CLASS[colorId], nodeTextColorClass(colorId)) : cn("font-medium text-foreground-muted ring-border/60", NODE_BG_SOFT_CLASS[colorId]), onSelect !== void 0 && !disabled && "cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40", disabled && "cursor-not-allowed opacity-50");
32859
+ const roleChrome = roleLabel !== void 0 && roleId !== void 0;
32860
+ const className = cn("inline-flex max-w-full items-center gap-1 rounded-full px-2 py-0.5 text-[10px] leading-tight ring-1 ring-inset", roleChrome ? emphasized ? cn("role-node-pill-emphasized font-semibold ring-2", ROLE_EMPHASIZED_CLASS[roleId]) : cn("font-medium", ROLE_SOFT_CLASS[roleId]) : emphasized ? cn("role-node-pill-emphasized font-semibold ring-2", NODE_BG_EMPHASIZED_CLASS[colorId], NODE_RING_CLASS[colorId], nodeTextColorClass(colorId)) : cn("font-medium text-foreground-muted ring-border/60", NODE_BG_SOFT_CLASS[colorId]), onSelect !== void 0 && !disabled && "cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40", disabled && "cursor-not-allowed opacity-50");
32850
32861
  const colorIcon = /* @__PURE__ */ jsx("span", {
32851
32862
  className: cn("h-1.5 w-1.5 shrink-0 rounded-full", nodeColorClass(colorId)),
32852
32863
  "aria-hidden": true
@@ -32861,7 +32872,7 @@ function RoleNodePill({ roleLabel, nodeName, colorId, emphasized = false, pinned
32861
32872
  children: roleLabel
32862
32873
  }),
32863
32874
  /* @__PURE__ */ jsx("span", {
32864
- className: cn("min-w-0 truncate", emphasized ? nodeTextColorClass(colorId) : "text-foreground-subtle"),
32875
+ className: cn("min-w-0 truncate", roleChrome ? "opacity-80" : emphasized ? nodeTextColorClass(colorId) : "text-foreground-subtle"),
32865
32876
  children: nodeName
32866
32877
  }),
32867
32878
  colorIcon
@@ -32878,6 +32889,7 @@ function RoleNodePill({ roleLabel, nodeName, colorId, emphasized = false, pinned
32878
32889
  role: "tab",
32879
32890
  "aria-selected": emphasized,
32880
32891
  "data-testid": "role-node-pill",
32892
+ "data-role": roleId,
32881
32893
  title,
32882
32894
  disabled,
32883
32895
  onClick: onSelect,
@@ -32886,6 +32898,7 @@ function RoleNodePill({ roleLabel, nodeName, colorId, emphasized = false, pinned
32886
32898
  });
32887
32899
  return /* @__PURE__ */ jsx("span", {
32888
32900
  "data-testid": "role-node-pill",
32901
+ "data-role": roleId,
32889
32902
  title,
32890
32903
  className,
32891
32904
  children: body
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/ui-library",
3
- "version": "1.2.263",
3
+ "version": "1.2.265",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",