@momoi-labs/kiso-react 0.25.0 → 0.26.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.
@@ -5,7 +5,7 @@ declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDial
5
5
  declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): React.JSX.Element;
6
6
  declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): React.JSX.Element;
7
7
  declare function AlertDialogOverlay({ className, onMouseDown, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): React.JSX.Element;
8
- declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): React.JSX.Element;
8
+ declare function AlertDialogContent({ className, children, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): React.JSX.Element;
9
9
  declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
10
  declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
11
  declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
@@ -4,6 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import { clsx as cn } from "clsx";
5
5
  import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
6
6
  import { Button } from "./button.js";
7
+ import { PanelShadow } from "./panel-shadow.js";
7
8
  function AlertDialog({ ...props }) {
8
9
  return _jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
9
10
  }
@@ -21,8 +22,8 @@ function AlertDialogOverlay({ className, onMouseDown, ...props }) {
21
22
  event.preventDefault();
22
23
  }, className: cn("kiso-react-overlay", className), ...props }));
23
24
  }
24
- function AlertDialogContent({ className, ...props }) {
25
- return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { "aria-modal": "true", "data-slot": "alert-dialog-content", className: cn("kiso-react-dialog marked", className), ...props })] }));
25
+ function AlertDialogContent({ className, children, ...props }) {
26
+ return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsxs(AlertDialogPrimitive.Content, { "aria-modal": "true", "data-slot": "alert-dialog-content", className: cn("kiso-react-dialog marked", className), ...props, children: [_jsx(PanelShadow, {}), children] })] }));
26
27
  }
27
28
  function AlertDialogHeader({ className, ...props }) {
28
29
  return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn("dialog-header", className), ...props }));
@@ -4,7 +4,7 @@ import { Header } from "./header.js";
4
4
  declare function AppShell({ className, variant, ...props }: React.ComponentProps<"div"> & {
5
5
  variant?: "default" | "inset";
6
6
  }): React.JSX.Element;
7
- declare function AppShellMain({ className, ...props }: React.ComponentProps<"main">): React.JSX.Element;
7
+ declare function AppShellMain({ className, children, ...props }: React.ComponentProps<"main">): React.JSX.Element;
8
8
  declare function AppShellPanel({ className, ...props }: React.ComponentProps<"aside">): React.JSX.Element;
9
9
  declare function AppShellPanelToggle({ className, placement, children, "aria-label": label, ...props }: React.ComponentProps<typeof Button> & {
10
10
  placement?: "header" | "floating";
package/dist/app-shell.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // Adapted from shadcn/ui new-york-v4. See ../SHADCN-LICENSE.
2
2
  "use client";
3
3
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ import { PanelShadow } from "./panel-shadow.js";
4
5
  import * as React from "react";
5
6
  import { clsx as cn } from "clsx";
6
7
  import { Ellipsis, Menu, PanelLeftClose, PanelLeftOpen, PanelRight } from "lucide-react";
@@ -17,8 +18,8 @@ function AppShell({ className, variant, ...props }) {
17
18
  }
18
19
  /* `grow` carries the `min-width: 0` the main column needs so a wide table or
19
20
  log line cannot push the sidebar off the screen. */
20
- function AppShellMain({ className, ...props }) {
21
- return (_jsx("main", { "data-slot": "app-shell-main", className: cn("grow", className), ...props }));
21
+ function AppShellMain({ className, children, ...props }) {
22
+ return (_jsxs("main", { "data-slot": "app-shell-main", className: cn("grow", className), ...props, children: [_jsx(PanelShadow, {}), children] }));
22
23
  }
23
24
  function AppShellPanel({ className, ...props }) {
24
25
  return _jsx("aside", { "data-slot": "app-shell-panel", className: cn("app-shell-panel", className), ...props });
package/dist/card.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- declare function Card({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
2
+ declare function Card({ className, children, ...props }: React.ComponentProps<"div">): React.JSX.Element;
3
3
  declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
4
4
  declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
5
5
  declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
package/dist/card.js CHANGED
@@ -1,7 +1,8 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PanelShadow } from "./panel-shadow.js";
2
3
  import { clsx as cn } from "clsx";
3
- function Card({ className, ...props }) {
4
- return (_jsx("div", { "data-slot": "card", className: cn("card", className), ...props }));
4
+ function Card({ className, children, ...props }) {
5
+ return (_jsxs("div", { "data-slot": "card", className: cn("card", className), ...props, children: [_jsx(PanelShadow, {}), children] }));
5
6
  }
6
7
  function CardHeader({ className, ...props }) {
7
8
  return (_jsx("div", { "data-slot": "card-header", className: cn("card-header", className), ...props }));
@@ -12,6 +12,8 @@ export type ChartSeries = {
12
12
  export declare const chartStrokes: readonly [undefined, "8 4", "2 3", "8 3 2 3", "12 3 2 3 2 3"];
13
13
  export declare const chartSlot: (series: ChartSeries, index: number) => number;
14
14
  export declare const chartColor: (slot: number) => string;
15
+ export type DiagramSeries = number | "neutral";
16
+ export declare const seriesColor: (series: DiagramSeries) => string;
15
17
  export declare const measured: (value: number | null | undefined) => value is number;
16
18
  export declare function validateChart(data: readonly ChartSample[], series: readonly ChartSeries[]): void;
17
19
  export type ChartSummaryStat = "min" | "max" | "avg" | "current" | "p50" | "p75" | "p90" | "p95" | "p99";
@@ -15,6 +15,7 @@ export const chartColor = (slot) => {
15
15
  const shift = extra >= gapHues.length && extra % 2 ? 0.08 : 0;
16
16
  return `light-dark(oklch(${0.55 - shift} 0.13 ${hue}), oklch(${0.8 + shift} 0.12 ${hue}))`;
17
17
  };
18
+ export const seriesColor = (series) => series === "neutral" ? "var(--color-muted-foreground)" : chartColor(series);
18
19
  export const measured = (value) => typeof value === "number" && Number.isFinite(value);
19
20
  export function validateChart(data, series) {
20
21
  if (series.length < 1)
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { PanelShadow } from "./panel-shadow.js";
3
4
  import { cloneElement, createElement, isValidElement, useState } from "react";
4
5
  import { clsx as cn } from "clsx";
5
6
  import { Check, Copy } from "lucide-react";
@@ -144,5 +145,5 @@ export function CodeBlock({ code, highlight, title, terminal = false, lineNumber
144
145
  body.push(line(folded));
145
146
  index = to - 1;
146
147
  }
147
- return (_jsxs("figure", { className: cn("code-block", className), "data-slot": "code-block", "data-terminal": terminal || undefined, style: { "--code-block-digits": String(lines.length).length }, ...props, children: [(title != null || terminal || copy) && _jsxs(Header, { className: "code-block-header", children: [terminal && _jsx(TerminalIcon, {}), title != null && _jsx("span", { className: "code-block-title", children: title }), copy && _jsx(CopyButton, { code: code, label: copy })] }), _jsx("pre", { children: _jsx("code", { children: body }) })] }));
148
+ return (_jsxs("figure", { className: cn("code-block", className), "data-slot": "code-block", "data-terminal": terminal || undefined, style: { "--code-block-digits": String(lines.length).length }, ...props, children: [_jsx(PanelShadow, {}), (title != null || terminal || copy) && _jsxs(Header, { className: "code-block-header", children: [terminal && _jsx(TerminalIcon, {}), title != null && _jsx("span", { className: "code-block-title", children: title }), copy && _jsx(CopyButton, { code: code, label: copy })] }), _jsx("pre", { children: _jsx("code", { children: body }) })] }));
148
149
  }
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { PanelShadow } from "./panel-shadow.js";
3
4
  import * as React from "react";
4
5
  import { clsx as cn } from "clsx";
5
6
  import { Search } from "lucide-react";
@@ -42,7 +43,7 @@ function CommandPalette({ className, label = "Command palette", children, ...pro
42
43
  }, onEscapeKeyDown: (event) => {
43
44
  if (composing.current || event.isComposing || event.keyCode === 229)
44
45
  event.preventDefault();
45
- }, "data-slot": "command-palette-content", className: cn("palette kiso-react-palette", className), children: [_jsx(VisuallyHidden.Root, { asChild: true, children: _jsx(DialogPrimitive.Title, { children: label }) }), _jsx(CommandPaletteContext.Provider, { value: { composing, activeId, setActiveId, listId, listRef }, children: children })] })] }) }));
46
+ }, "data-slot": "command-palette-content", className: cn("palette kiso-react-palette", className), children: [_jsx(PanelShadow, {}), _jsx(VisuallyHidden.Root, { asChild: true, children: _jsx(DialogPrimitive.Title, { children: label }) }), _jsx(CommandPaletteContext.Provider, { value: { composing, activeId, setActiveId, listId, listRef }, children: children })] })] }) }));
46
47
  }
47
48
  function CommandPaletteInput({ className, onKeyDown, onCompositionStart, onCompositionEnd, ...props }) {
48
49
  const { composing, activeId, setActiveId, listId, listRef } = useCommandPalette();
@@ -96,6 +96,7 @@ function classify(source, target) {
96
96
  return overlapX ? "down" : "drop";
97
97
  return null;
98
98
  }
99
+ const keyOf = (pair) => `${pair.edge.key}:${pair.up ? pair.target.id : pair.source.id}`;
99
100
  /* Picks a point for each exit along a source's bottom: as close to an even
100
101
  spread as it can, in the order of their targets, and clear of every node
101
102
  its straight run passes, so a trunk never runs through a node. */
@@ -157,25 +158,28 @@ function routeGrid(measured, nodes, frames, stages, backward) {
157
158
  && node.top >= source.bottom - 1 && node.bottom <= target.top + 1 && node.right > lo && node.left < hi);
158
159
  const pairs = [];
159
160
  for (const { edge, target, sources } of measured) {
160
- sources.forEach((source, index) => {
161
- if (source.id === target.id)
161
+ sources.forEach((start, index) => {
162
+ if (start.id === target.id)
162
163
  return;
163
- let kind = edge.route ?? classify(source, target);
164
+ const up = edge.route !== "side" && !classify(start, target) && !!classify(target, start);
165
+ const [source, end] = up ? [target, start] : [start, target];
166
+ let kind = edge.route ?? classify(source, end);
164
167
  let blocked = false;
165
- if (stages && !edge.route && kind === "drop" && !between(source, target, Math.min(source.left, target.left), Math.max(source.right, target.right)))
168
+ if (stages && !edge.route && kind === "drop" && !between(source, end, Math.min(source.left, end.left), Math.max(source.right, end.right)))
166
169
  kind = "down";
167
170
  else if (stages && !edge.route && kind === "down")
168
- blocked = between(source, target, Math.max(source.left, target.left), Math.min(source.right, target.right));
171
+ blocked = between(source, end, Math.max(source.left, end.left), Math.min(source.right, end.right));
169
172
  if (kind)
170
- pairs.push({ edge, source, target, kind, labelled: index === 0, blocked });
173
+ pairs.push({ edge, source, target: end, kind, labelled: index === 0, blocked, up });
171
174
  else
172
- warn(`${edge.key}:${backward}`, `Diagram: the edge ${source.id} -> ${target.id} goes ${backward}, so it is not drawn. Put the target ${backward === "up" ? "lower" : "further right"}.`);
175
+ warn(`${edge.key}:${backward}`, `Diagram: the edge ${start.id} -> ${target.id} goes ${backward}, so it is not drawn. Put the target ${backward === "up" ? "lower" : "further right"}.`);
173
176
  });
174
177
  }
175
178
  // Edges down from one source with one series share an exit and a trunk.
176
179
  const groups = new Map();
177
180
  for (const pair of pairs.filter((item) => item.kind !== "side")) {
178
- const key = `${pair.source.id}\n${pair.edge.series ?? (stages ? "plain" : `#${pair.edge.key}`)}`;
181
+ // An edge up keeps its own exit: it never shares a trunk.
182
+ const key = pair.up ? `^${keyOf(pair)}` : `${pair.source.id}\n${pair.edge.series ?? (stages ? "plain" : `#${pair.edge.key}`)}`;
179
183
  groups.set(key, [...(groups.get(key) ?? []), pair]);
180
184
  }
181
185
  for (const list of groups.values())
@@ -299,8 +303,8 @@ function routeGrid(measured, nodes, frames, stages, backward) {
299
303
  for (const plan of plans) {
300
304
  const { pair } = plan;
301
305
  const { edge, source, target } = pair;
302
- const key = `${edge.key}:${source.id}`;
303
- const ends = [source.id, target.id];
306
+ const key = keyOf(pair);
307
+ const ends = pair.up ? [target.id, source.id] : [source.id, target.id];
304
308
  let points;
305
309
  const at = entry.get(plan);
306
310
  if (pair.kind === "side") {
@@ -352,13 +356,17 @@ function routeGrid(measured, nodes, frames, stages, backward) {
352
356
  const list = [...exitOf.keys()].find((item) => item.includes(pair));
353
357
  splits.set(list, Math.max(splits.get(list) ?? 0, dot[1] - source.bottom + RADIUS));
354
358
  }
355
- const run = longestVertical(points);
359
+ let run = longestVertical(points);
360
+ if (pair.up) {
361
+ points = points.reverse();
362
+ run = points.length - 2 - run;
363
+ }
356
364
  routes.push({ key, points, arrow: true, look: look(edge), ends, dot, label: pair.labelled && edge.label ? { text: edge.label, run } : undefined });
357
365
  }
358
366
  // The far edge's label keeps clear of the stub above its splits.
359
367
  for (const [list, from] of splits) {
360
368
  const far = list[list.length - 1];
361
- const route = routes.find((item) => item.key === `${far.edge.key}:${far.source.id}`);
369
+ const route = routes.find((item) => item.key === keyOf(far));
362
370
  if (route?.label && route.label.run === 0)
363
371
  route.label.from = from + 4;
364
372
  }
@@ -388,7 +396,6 @@ function reshape(route, points) {
388
396
  A trunk whose edges differ in look is drawn plain up to where the last
389
397
  branch leaves it, whatever way the branches go. */
390
398
  function fork(routes, plans, listOf) {
391
- const keyOf = (pair) => `${pair.edge.key}:${pair.source.id}`;
392
399
  for (const list of new Set(listOf.values())) {
393
400
  if (list.length < 2)
394
401
  continue;
package/dist/diagram.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { type LucideIcon } from "lucide-react";
3
+ import { type DiagramSeries } from "./chart-data.js";
3
4
  import { type DiagramArrow, type DiagramCrossings, type DiagramEdgeLine, type DiagramEdgeRoute, type DiagramEdgeShape, type DiagramEdgeTone, type DiagramLabels } from "./diagram-routes.js";
4
- export type { DiagramArrow, DiagramCrossings, DiagramEdgeLine, DiagramEdgeRoute, DiagramEdgeShape, DiagramEdgeTone, DiagramLabels };
5
+ export type { DiagramArrow, DiagramCrossings, DiagramEdgeLine, DiagramEdgeRoute, DiagramEdgeShape, DiagramEdgeTone, DiagramLabels, DiagramSeries };
5
6
  export type DiagramKind = "route" | "service" | "repository" | "image" | "database";
6
7
  export type DiagramBackground = "solid" | "dots" | "grid" | "crosses" | "construction" | "guides" | "fibers";
7
8
  export type DiagramStatus = "stopped" | "failed";
@@ -10,7 +11,9 @@ export type DiagramBorderStyle = "solid" | "none" | "rail" | "dash" | "bevel" |
10
11
  export type DiagramCornerStyle = "square" | "rounded" | "asym" | "pixel";
11
12
  export type DiagramCornerSize = "off" | "small" | "medium" | "large";
12
13
  export type DiagramCornerMarks = "none" | "ticks" | "brackets" | "arcs" | "diagonal" | "dots";
14
+ export type DiagramShadowStyle = "auto" | "none" | "hard" | "soft";
13
15
  export type DiagramFrameProps = {
16
+ shadowStyle?: DiagramShadowStyle;
14
17
  borderStyle?: DiagramBorderStyle;
15
18
  cornerStyle?: DiagramCornerStyle;
16
19
  cornerSize?: DiagramCornerSize;
@@ -44,7 +47,7 @@ export type DiagramProps = Omit<React.ComponentProps<"div">, "children"> & Diagr
44
47
  strength?: "quiet" | "visible";
45
48
  children: React.ReactNode;
46
49
  };
47
- declare function Diagram({ label, direction, columns, crossings, labels, edges: shape, arrow, footer, background, strength, borderStyle, cornerStyle, cornerSize, cornerMarks, className, children, ...props }: DiagramProps): React.JSX.Element;
50
+ declare function Diagram({ label, direction, columns, crossings, labels, edges: shape, arrow, footer, background, strength, borderStyle, cornerStyle, cornerSize, cornerMarks, shadowStyle, className, children, ...props }: DiagramProps): React.JSX.Element;
48
51
  declare function DiagramColumn({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
49
52
  export type DiagramRowProps = React.ComponentProps<"div"> & {
50
53
  /** Where the row's nodes sit across the drawing. Center by default. */
@@ -71,7 +74,7 @@ export type DiagramGroupProps = Omit<React.ComponentProps<"div">, "title"> & {
71
74
  };
72
75
  declare function DiagramGroup({ label, title, footer, line, tone, collapsible, defaultOpen, className, style, children, ...props }: DiagramGroupProps): React.JSX.Element;
73
76
  export type DiagramNodeGroupProps = React.ComponentProps<"div"> & DiagramFrameProps;
74
- declare function DiagramNodeGroup({ borderStyle, cornerStyle, cornerSize, cornerMarks, className, ...props }: DiagramNodeGroupProps): React.JSX.Element;
77
+ declare function DiagramNodeGroup({ borderStyle, cornerStyle, cornerSize, cornerMarks, shadowStyle, className, ...props }: DiagramNodeGroupProps): React.JSX.Element;
75
78
  export type DiagramNodeProps = Omit<React.ComponentProps<"div">, "title" | "children"> & DiagramFrameProps & {
76
79
  /** Edges refer to the node by this id. Unique within the Diagram. */
77
80
  id: string;
@@ -90,7 +93,7 @@ export type DiagramNodeProps = Omit<React.ComponentProps<"div">, "title" | "chil
90
93
  Elements, such as facts or a fold, render as they are. */
91
94
  children?: React.ReactNode;
92
95
  };
93
- declare function DiagramNode({ id, title, kind, icon, label, accent, status, borderStyle, cornerStyle, cornerSize, cornerMarks, className, children, ...props }: DiagramNodeProps): React.JSX.Element;
96
+ declare function DiagramNode({ id, title, kind, icon, label, accent, status, borderStyle, cornerStyle, cornerSize, cornerMarks, shadowStyle, className, children, ...props }: DiagramNodeProps): React.JSX.Element;
94
97
  export type DiagramFactProps = Omit<React.ComponentProps<"div">, "children"> & {
95
98
  icon?: LucideIcon;
96
99
  label: string;
@@ -156,16 +159,18 @@ export type DiagramEdgeProps = {
156
159
  flow?: never;
157
160
  }
158
161
  /** A kind of link, such as replication or backups: the chart colour of the
159
- slot and a dash of its own. `flow` moves the dash toward the target. */
162
+ slot and a dash of its own, or `"neutral"`, grey with its own dash.
163
+ `flow` moves the dash toward the target. */
160
164
  | {
161
- series: number;
165
+ series: DiagramSeries;
162
166
  flow?: boolean;
163
167
  line?: never;
164
168
  tone?: never;
165
169
  });
166
- declare function DiagramEdge({ from, to, label, route, line, tone, series, flow, shape, arrow }: DiagramEdgeProps): null;
170
+ declare function DiagramEdge({ from, to, label, route, line, tone, series: named, flow, shape, arrow }: DiagramEdgeProps): null;
167
171
  export type DiagramEdgeKeyProps = Omit<React.ComponentProps<"span">, "children"> & {
168
- series: number;
172
+ /** A chart slot, or `"neutral"`. */
173
+ series: DiagramSeries;
169
174
  /** What the series means, such as "WAL to storage". */
170
175
  children: React.ReactNode;
171
176
  };
package/dist/diagram.js CHANGED
@@ -1,17 +1,25 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PanelShadow } from "./panel-shadow.js";
2
3
  import * as React from "react";
3
4
  import { clsx as cn } from "clsx";
4
5
  import { ChevronDown, ChevronUp, Container, Database, GitBranch, Route, Server } from "lucide-react";
5
6
  import { Badge } from "./badge.js";
6
7
  import { Card } from "./card.js";
7
- import { chartColor } from "./chart-data.js";
8
+ import { seriesColor } from "./chart-data.js";
8
9
  import { StatusBadge } from "./status-badge.js";
9
10
  import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
10
11
  import { draw, route, } from "./diagram-routes.js";
11
12
  /* The number of dash patterns in ui.css. Series past it reuse a dash with a
12
13
  new colour, so the pair stays unique. */
13
14
  const DASHES = 5;
14
- const dashOf = (series) => ((Math.max(1, Math.round(series)) - 1) % DASHES) + 1;
15
+ /* The router keys series by number, so the neutral series travels through
16
+ it as this slot. No chart slot is below 1. */
17
+ const NEUTRAL = -1;
18
+ const slotOf = (series) => series === "neutral" ? NEUTRAL : series;
19
+ const seriesOf = (slot) => slot === NEUTRAL ? "neutral" : slot;
20
+ /* The neutral series has a dash of its own, outside the five. */
21
+ const dashOf = (series) => series === "neutral" ? "neutral" : ((Math.max(1, Math.round(series)) - 1) % DASHES) + 1;
22
+ const colorOf = (slot) => seriesColor(seriesOf(slot));
15
23
  const DiagramContext = React.createContext(null);
16
24
  function useRegistry(part) {
17
25
  const registry = React.useContext(DiagramContext);
@@ -42,7 +50,7 @@ const statuses = {
42
50
  stopped: { label: "Stopped", tone: "neutral" },
43
51
  failed: { label: "Failed", tone: "danger" },
44
52
  };
45
- function Diagram({ label, direction = "right", columns, crossings = "none", labels = "auto", edges: shape, arrow, footer, background, strength, borderStyle, cornerStyle, cornerSize, cornerMarks, className, children, ...props }) {
53
+ function Diagram({ label, direction = "right", columns, crossings = "none", labels = "auto", edges: shape, arrow, footer, background, strength, borderStyle, cornerStyle, cornerSize, cornerMarks, shadowStyle, className, children, ...props }) {
46
54
  const frame = React.useRef(null);
47
55
  const scroll = React.useRef(null);
48
56
  const lanes = React.useRef(null);
@@ -247,17 +255,17 @@ function Diagram({ label, direction = "right", columns, crossings = "none", labe
247
255
  fonts?.removeEventListener("loadingdone", refont);
248
256
  };
249
257
  }, [direction, crossings, labels, shape, arrow, registered, nodes, version]);
250
- return (_jsx(DiagramContext.Provider, { value: context, children: _jsxs("div", { ...props, "data-slot": "diagram", className: cn("card diagram", className), "data-direction": direction, "data-background-style": background, "data-background-strength": strength, children: [_jsx("div", { ref: scroll, "data-slot": "diagram-scroll", className: "diagram-scroll", role: "group", "aria-label": label, tabIndex: 0, children: _jsxs("div", { ref: frame, "data-slot": "diagram-canvas", className: "diagram-canvas", children: [_jsx("div", { ref: lanes, "data-slot": "diagram-lanes", className: "diagram-lanes", "data-direction": direction, style: direction === "grid" && columns ? { "--diagram-columns": columns } : undefined, "data-border-style": borderStyle, "data-corner-style": cornerStyle, "data-corner-size": cornerSize, "data-corner-marks": cornerMarks, "data-edge-labels": registered.some((edge) => edge.label) || undefined, children: children }), _jsxs("svg", { ref: svg, className: "diagram-edges", "aria-hidden": "true", children: [_jsxs("defs", { children: [["neutral", "success", "danger"].map((tone) => (_jsx("marker", { id: `${marker}-${tone}`, className: "diagram-arrow", "data-tone": tone, viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "7", markerHeight: "7", orient: "auto-start-reverse", children: _jsx("path", { d: "M 0 0 L 10 5 L 0 10 z" }) }, tone))), [...new Set(registered.flatMap((edge) => edge.series ? [edge.series] : []))].map((series) => (_jsx("marker", { id: `${marker}-s${series}`, className: "diagram-arrow", style: { color: chartColor(series) }, viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "6", markerHeight: "6", orient: "auto-start-reverse", children: _jsx("path", { d: "M 0 0 L 10 5 L 0 10 z" }) }, series))), [...new Set(drawn.paths.flatMap((path) => path.arrow && path.head !== "triangle" && path.head !== "none"
258
+ return (_jsx(DiagramContext.Provider, { value: context, children: _jsxs("div", { ...props, "data-slot": "diagram", className: cn("card diagram", className), "data-direction": direction, "data-background-style": background, "data-background-strength": strength, children: [_jsx(PanelShadow, {}), _jsx("div", { ref: scroll, "data-slot": "diagram-scroll", className: "diagram-scroll", role: "group", "aria-label": label, tabIndex: 0, children: _jsxs("div", { ref: frame, "data-slot": "diagram-canvas", className: "diagram-canvas", children: [_jsx("div", { ref: lanes, "data-slot": "diagram-lanes", className: "diagram-lanes", "data-direction": direction, style: direction === "grid" && columns ? { "--diagram-columns": columns } : undefined, "data-border-style": borderStyle, "data-corner-style": cornerStyle, "data-corner-size": cornerSize, "data-corner-marks": cornerMarks, "data-shadow-style": shadowStyle, "data-edge-labels": registered.some((edge) => edge.label) || undefined, children: children }), _jsxs("svg", { ref: svg, className: "diagram-edges", "aria-hidden": "true", children: [_jsxs("defs", { children: [["neutral", "success", "danger"].map((tone) => (_jsx("marker", { id: `${marker}-${tone}`, className: "diagram-arrow", "data-tone": tone, viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "7", markerHeight: "7", orient: "auto-start-reverse", children: _jsx("path", { d: "M 0 0 L 10 5 L 0 10 z" }) }, tone))), [...new Set(registered.flatMap((edge) => edge.series ? [edge.series] : []))].map((series) => (_jsx("marker", { id: `${marker}-s${series}`, className: "diagram-arrow", style: { color: colorOf(series) }, viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "6", markerHeight: "6", orient: "auto-start-reverse", children: _jsx("path", { d: "M 0 0 L 10 5 L 0 10 z" }) }, series))), [...new Set(drawn.paths.flatMap((path) => path.arrow && path.head !== "triangle" && path.head !== "none"
251
259
  ? [`${path.head}|${path.series ? `s${path.series}` : path.tone ?? "neutral"}`] : []))].map((id) => {
252
260
  const [head, paint] = id.split("|");
253
261
  const series = paint.startsWith("s") ? Number(paint.slice(1)) : undefined;
254
262
  const size = series ? "6" : "7";
255
- return (_jsx("marker", { id: `${marker}-${head}-${paint}`, className: "diagram-arrow", "data-arrow": head, "data-tone": series ? undefined : paint, style: series ? { color: chartColor(series) } : undefined, viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: size, markerHeight: size, orient: "auto-start-reverse", children: heads[head] }, id));
263
+ return (_jsx("marker", { id: `${marker}-${head}-${paint}`, className: "diagram-arrow", "data-arrow": head, "data-tone": series ? undefined : paint, style: series ? { color: colorOf(series) } : undefined, viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: size, markerHeight: size, orient: "auto-start-reverse", children: heads[head] }, id));
256
264
  })] }), drawn.plates.map((plate) => (_jsx("rect", { className: "diagram-edge-plate", x: plate.x, y: plate.y, width: plate.width, height: plate.height }, plate.key))), drawn.paths.map((path) => {
257
265
  const series = path.series;
258
266
  const paint = series ? `s${series}` : path.tone ?? "neutral";
259
- return (_jsxs(React.Fragment, { children: [path.knock && _jsx("path", { className: "diagram-edge-knock", d: path.knock }), _jsx("path", { d: path.d, "data-shape": path.shape && path.shape !== "orthogonal" ? path.shape : undefined, "data-line": series ? undefined : path.line, "data-tone": series ? undefined : path.tone, "data-series": series, "data-dash": series ? dashOf(series) : undefined, "data-flow": (series && path.flow) || undefined, style: series ? { color: chartColor(series) } : undefined, markerEnd: !path.arrow || path.head === "none" ? undefined : `url(#${marker}-${path.head === "triangle" ? "" : `${path.head}-`}${paint})` })] }, path.key));
260
- }), drawn.dots.map((dot) => (_jsx("circle", { className: "diagram-junction", cx: dot.x, cy: dot.y, r: "3", "data-tone": dot.series ? undefined : dot.tone, style: dot.series ? { color: chartColor(dot.series) } : undefined }, dot.key))), drawn.labels.map((item) => (_jsxs(React.Fragment, { children: [item.plate && _jsx("rect", { className: "diagram-edge-plate", x: item.plate.x, y: item.plate.y, width: item.plate.width, height: item.plate.height }), _jsx("text", { x: item.x, y: item.y, className: "diagram-edge-label", "data-anchor": item.anchor, "data-orient": item.rotate ? "vertical" : item.middle ? "inline" : undefined, transform: item.rotate ? `rotate(-90 ${item.x} ${item.y})` : undefined, children: item.lines.length > 1
267
+ return (_jsxs(React.Fragment, { children: [path.knock && _jsx("path", { className: "diagram-edge-knock", d: path.knock }), _jsx("path", { d: path.d, "data-shape": path.shape && path.shape !== "orthogonal" ? path.shape : undefined, "data-line": series ? undefined : path.line, "data-tone": series ? undefined : path.tone, "data-series": series ? seriesOf(series) : undefined, "data-dash": series ? dashOf(seriesOf(series)) : undefined, "data-flow": (series && path.flow) || undefined, style: series ? { color: colorOf(series) } : undefined, markerEnd: !path.arrow || path.head === "none" ? undefined : `url(#${marker}-${path.head === "triangle" ? "" : `${path.head}-`}${paint})` })] }, path.key));
268
+ }), drawn.dots.map((dot) => (_jsx("circle", { className: "diagram-junction", cx: dot.x, cy: dot.y, r: "3", "data-tone": dot.series ? undefined : dot.tone, style: dot.series ? { color: colorOf(dot.series) } : undefined }, dot.key))), drawn.labels.map((item) => (_jsxs(React.Fragment, { children: [item.plate && _jsx("rect", { className: "diagram-edge-plate", x: item.plate.x, y: item.plate.y, width: item.plate.width, height: item.plate.height }), _jsx("text", { x: item.x, y: item.y, className: "diagram-edge-label", "data-anchor": item.anchor, "data-orient": item.rotate ? "vertical" : item.middle ? "inline" : undefined, transform: item.rotate ? `rotate(-90 ${item.x} ${item.y})` : undefined, children: item.lines.length > 1
261
269
  ? _jsxs(_Fragment, { children: [_jsx("tspan", { x: item.x, dy: "-1.2em", children: item.lines[0] }), _jsx("tspan", { x: item.x, dy: "1.2em", children: item.lines[1] })] })
262
270
  : item.lines[0] })] }, item.key)))] })] }) }), footer != null && (_jsx("div", { "data-slot": "diagram-footer", className: "diagram-footer", children: _jsx("div", { className: "diagram-footer-items", children: footer }) }))] }) }));
263
271
  }
@@ -309,10 +317,10 @@ function DiagramGroup({ label, title, footer, line, tone, collapsible = false, d
309
317
  container that receives requests with the other containers under it.
310
318
  Edges still reach each node on its own. The group carries the frame, so
311
319
  its frame props replace the nodes' own. */
312
- function DiagramNodeGroup({ borderStyle, cornerStyle, cornerSize, cornerMarks, className, ...props }) {
313
- return (_jsx(Card, { ...props, "data-slot": "diagram-node-group", className: cn("diagram-node-group", className), "data-border-style": borderStyle, "data-corner-style": cornerStyle, "data-corner-size": cornerSize, "data-corner-marks": cornerMarks }));
320
+ function DiagramNodeGroup({ borderStyle, cornerStyle, cornerSize, cornerMarks, shadowStyle, className, ...props }) {
321
+ return (_jsx(Card, { ...props, "data-slot": "diagram-node-group", className: cn("diagram-node-group", className), "data-border-style": borderStyle, "data-corner-style": cornerStyle, "data-corner-size": cornerSize, "data-corner-marks": cornerMarks, "data-shadow-style": shadowStyle }));
314
322
  }
315
- function DiagramNode({ id, title, kind, icon, label, accent, status, borderStyle, cornerStyle, cornerSize, cornerMarks, className, children, ...props }) {
323
+ function DiagramNode({ id, title, kind, icon, label, accent, status, borderStyle, cornerStyle, cornerSize, cornerMarks, shadowStyle, className, children, ...props }) {
316
324
  const { register } = useRegistry("DiagramNode");
317
325
  const ref = React.useCallback((element) => register(id, element), [id, register]);
318
326
  const spec = kind ? kinds[kind] : undefined;
@@ -322,7 +330,7 @@ function DiagramNode({ id, title, kind, icon, label, accent, status, borderStyle
322
330
  const items = React.Children.toArray(children);
323
331
  const text = items.filter((item) => typeof item === "string" || typeof item === "number");
324
332
  const parts = items.filter((item) => typeof item !== "string" && typeof item !== "number");
325
- return (_jsxs(Card, { ...props, ref: ref, "data-slot": "diagram-node", className: cn("diagram-node", className), "data-kind": kind, "data-tone": spec?.tone ?? "neutral", "data-accent": accent || undefined, "data-status": status, "data-border-style": borderStyle, "data-corner-style": cornerStyle, "data-corner-size": cornerSize, "data-corner-marks": cornerMarks, children: [caption && (_jsxs("span", { className: "diagram-node-kind", children: [glyph, _jsx("span", { className: "t-caps", children: caption })] })), title != null && (_jsxs("span", { className: "diagram-node-title", "data-lead": (!caption && !!glyph) || undefined, children: [!caption && glyph, title] })), text.length > 0 && _jsx("span", { className: "diagram-node-text mono", children: text }), status && (_jsx(StatusBadge, { tone: statuses[status].tone, className: "diagram-node-status", children: statuses[status].label })), parts] }));
333
+ return (_jsxs(Card, { ...props, ref: ref, "data-slot": "diagram-node", className: cn("diagram-node", className), "data-kind": kind, "data-tone": spec?.tone ?? "neutral", "data-accent": accent || undefined, "data-status": status, "data-border-style": borderStyle, "data-corner-style": cornerStyle, "data-corner-size": cornerSize, "data-corner-marks": cornerMarks, "data-shadow-style": shadowStyle, children: [caption && (_jsxs("span", { className: "diagram-node-kind", children: [glyph, _jsx("span", { className: "t-caps", children: caption })] })), title != null && (_jsxs("span", { className: "diagram-node-title", "data-lead": (!caption && !!glyph) || undefined, children: [!caption && glyph, title] })), text.length > 0 && _jsx("span", { className: "diagram-node-text mono", children: text }), status && (_jsx(StatusBadge, { tone: statuses[status].tone, className: "diagram-node-status", children: statuses[status].label })), parts] }));
326
334
  }
327
335
  /* One fact about a node as a line: its icon and name, the value on the
328
336
  right. Long values wrap under the name before they widen the node. */
@@ -362,8 +370,9 @@ function DiagramLine({ end, onClick, className, children, ...props }) {
362
370
  }
363
371
  /* An edge renders nothing itself: it registers with the Diagram, which draws
364
372
  it once the nodes are measured. */
365
- function DiagramEdge({ from, to, label, route, line, tone, series, flow, shape, arrow }) {
373
+ function DiagramEdge({ from, to, label, route, line, tone, series: named, flow, shape, arrow }) {
366
374
  const { addEdge } = useRegistry("DiagramEdge");
375
+ const series = named == null ? undefined : slotOf(named);
367
376
  // Ids never contain a newline, so the join is a stable dependency.
368
377
  const sources = (Array.isArray(from) ? from : [from]).join("\n");
369
378
  React.useEffect(() => addEdge({ key: `${sources}->${to}${series ? `#${series}` : ""}`, from: sources.split("\n"), to, label, route, line, tone, series, flow, shape, head: arrow }), [addEdge, sources, to, label, route, line, tone, series, flow, shape, arrow]);
@@ -372,6 +381,6 @@ function DiagramEdge({ from, to, label, route, line, tone, series, flow, shape,
372
381
  /* A sample of a series edge, its colour and dash, with what it means. The
373
382
  product lays these out as the drawing's key; the sample never moves. */
374
383
  function DiagramEdgeKey({ series, className, children, ...props }) {
375
- return (_jsxs("span", { ...props, "data-slot": "diagram-edge-key", className: cn("diagram-edge-key", className), children: [_jsx("svg", { viewBox: "0 0 28 6", "aria-hidden": "true", focusable: "false", style: { color: chartColor(series) }, children: _jsx("path", { d: "M 2 3 H 26", "data-series": series, "data-dash": dashOf(series) }) }), children] }));
384
+ return (_jsxs("span", { ...props, "data-slot": "diagram-edge-key", className: cn("diagram-edge-key", className), children: [_jsx("svg", { viewBox: "0 0 28 6", "aria-hidden": "true", focusable: "false", style: { color: seriesColor(series) }, children: _jsx("path", { d: "M 2 3 H 26", "data-series": series, "data-dash": dashOf(series) }) }), children] }));
376
385
  }
377
386
  export { Diagram, DiagramColumn, DiagramRow, DiagramGroup, DiagramEdgeKey, DiagramNodeGroup, DiagramNode, DiagramFact, DiagramFold, DiagramFilter, DiagramSection, DiagramLine, DiagramEdge };
package/dist/dialog.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // Adapted from shadcn/ui new-york-v4. See ../SHADCN-LICENSE.
2
2
  "use client";
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ import { PanelShadow } from "./panel-shadow.js";
4
5
  import { clsx as cn } from "clsx";
5
6
  import { Dialog as DialogPrimitive } from "radix-ui";
6
7
  function Dialog({ ...props }) {
@@ -19,7 +20,7 @@ function DialogOverlay({ className, ...props }) {
19
20
  return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn("kiso-react-overlay", className), ...props }));
20
21
  }
21
22
  function DialogContent({ className, children, ...props }) {
22
- return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsx(DialogPrimitive.Content, { "aria-modal": "true", "data-slot": "dialog-content", className: cn("kiso-react-dialog marked", className), ...props, children: children })] }));
23
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "aria-modal": "true", "data-slot": "dialog-content", className: cn("kiso-react-dialog marked", className), ...props, children: [_jsx(PanelShadow, {}), children] })] }));
23
24
  }
24
25
  function DialogHeader({ className, ...props }) {
25
26
  return (_jsx("div", { "data-slot": "dialog-header", className: cn("dialog-header", className), ...props }));
package/dist/drawer.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { PanelShadow } from "./panel-shadow.js";
3
4
  import { clsx as cn } from "clsx";
4
5
  import { Dialog as DialogPrimitive } from "radix-ui";
5
6
  import { DialogBody, DialogClose, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogDescription, } from "./dialog.js";
@@ -12,6 +13,6 @@ function DrawerTrigger({ ...props }) {
12
13
  return _jsx(DialogPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
13
14
  }
14
15
  function DrawerContent({ className, placement = "bottom", children, ...props }) {
15
- return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsx(DialogPrimitive.Content, { "aria-modal": "true", "data-slot": "drawer-content", "data-placement": placement, className: cn("kiso-react-drawer marked", className), ...props, children: children })] }));
16
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "aria-modal": "true", "data-slot": "drawer-content", "data-placement": placement, className: cn("kiso-react-drawer marked", className), ...props, children: [_jsx(PanelShadow, {}), children] })] }));
16
17
  }
17
18
  export { Drawer, DrawerTrigger, DrawerContent, DialogClose as DrawerClose, DialogHeader as DrawerHeader, DialogBody as DrawerBody, DialogFooter as DrawerFooter, DialogTitle as DrawerTitle, DialogDescription as DrawerDescription, };
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from "./brand-mark.js";
7
7
  export * from "./breadcrumb.js";
8
8
  export * from "./button.js";
9
9
  export * from "./card.js";
10
+ export * from "./panel-shadow.js";
10
11
  export * from "./checkbox.js";
11
12
  export * from "./chip-input.js";
12
13
  export * from "./code-block.js";
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ export * from "./brand-mark.js";
8
8
  export * from "./breadcrumb.js";
9
9
  export * from "./button.js";
10
10
  export * from "./card.js";
11
+ export * from "./panel-shadow.js";
11
12
  export * from "./checkbox.js";
12
13
  export * from "./chip-input.js";
13
14
  export * from "./code-block.js";
package/dist/log-view.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // Adapted from shadcn/ui new-york-v4. See ../SHADCN-LICENSE.
2
2
  "use client";
3
- import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ import { PanelShadow } from "./panel-shadow.js";
4
5
  import * as React from "react";
5
6
  import { cva } from "class-variance-authority";
6
7
  import { clsx as cn } from "clsx";
@@ -47,12 +48,12 @@ function LogView({ className, children, follow, onFollowChange, ref, ...props })
47
48
  el.scrollTop = el.scrollHeight;
48
49
  pinned.current = el.scrollHeight;
49
50
  }, [children, following]);
50
- return (_jsx("div", { "data-slot": "log-view", "data-follow": following, className: cn("logview", className), ...props, children: _jsx("div", { ref: scroller, "data-slot": "log-view-scroll", className: "log-scroll", onScroll: (event) => {
51
- const bottom = isAtBottom(event.currentTarget);
52
- setAtBottom(bottom);
53
- if (bottom !== following)
54
- onFollowChange?.(bottom);
55
- }, children: children }) }));
51
+ return (_jsxs("div", { "data-slot": "log-view", "data-follow": following, className: cn("logview", className), ...props, children: [_jsx(PanelShadow, {}), _jsx("div", { ref: scroller, "data-slot": "log-view-scroll", className: "log-scroll", onScroll: (event) => {
52
+ const bottom = isAtBottom(event.currentTarget);
53
+ setAtBottom(bottom);
54
+ if (bottom !== following)
55
+ onFollowChange?.(bottom);
56
+ }, children: children })] }));
56
57
  }
57
58
  function LogViewLine({ className, ...props }) {
58
59
  return (_jsx("div", { "data-slot": "log-view-line", className: cn("", className), ...props }));
@@ -0,0 +1 @@
1
+ export declare function PanelShadow(): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /* Non-box contours need a separate paint layer. Filtering this empty layer
3
+ leaves panel content, controls and translucent fills unchanged. */
4
+ export function PanelShadow() {
5
+ return _jsx("span", { className: "panel-shadow", "aria-hidden": "true", children: _jsx("span", { children: _jsx("span", {}) }) });
6
+ }
@@ -1,6 +1,20 @@
1
1
  import * as React from "react";
2
+ import type { LucideIcon } from "lucide-react";
2
3
  import { Badge } from "./badge.js";
4
+ import { type DiagramSeries } from "./chart-data.js";
3
5
  import type { StatusBadgeSpec, StatusTone } from "./generated/status-badge.js";
4
6
  export type { StatusTone };
5
- export type StatusBadgeProps = Omit<React.ComponentProps<typeof Badge>, "variant" | "asChild"> & Omit<StatusBadgeSpec, "label">;
6
- export declare function StatusBadge({ tone, pulse, children, ...props }: StatusBadgeProps): React.JSX.Element;
7
+ export type StatusBadgeProps = Omit<React.ComponentProps<typeof Badge>, "variant" | "asChild"> & Omit<StatusBadgeSpec, "label" | "tone"> & ({
8
+ tone: StatusTone;
9
+ series?: never;
10
+ icon?: never;
11
+ }
12
+ /** A state that belongs to a Diagram edge, such as "Streaming" on the
13
+ node a replication edge feeds: the edge's series colour in place of
14
+ a tone. `icon` replaces the dot and takes its pulse. */
15
+ | {
16
+ series: DiagramSeries;
17
+ icon?: LucideIcon;
18
+ tone?: never;
19
+ });
20
+ export declare function StatusBadge({ tone, series, icon: Icon, pulse, className, style, children, ...props }: StatusBadgeProps): React.JSX.Element;
@@ -1,8 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { clsx as cn } from "clsx";
2
3
  import { Badge } from "./badge.js";
4
+ import { seriesColor } from "./chart-data.js";
3
5
  import { Dot } from "./dot.js";
4
6
  /* The dot pulses while work is going, a run or a build; a thing that is
5
7
  merely up holds still. */
6
- export function StatusBadge({ tone, pulse = false, children, ...props }) {
7
- return _jsxs(Badge, { ...props, variant: tone, children: [_jsx(Dot, { pulse: pulse }), children] });
8
+ export function StatusBadge({ tone, series, icon: Icon, pulse = false, className, style, children, ...props }) {
9
+ if (series == null) {
10
+ return _jsxs(Badge, { ...props, className: className, style: style, variant: tone, children: [_jsx(Dot, { pulse: pulse }), children] });
11
+ }
12
+ return _jsxs(Badge, { ...props, "data-variant": "series", "data-series": series, className: cn("badge-series", className), style: { "--badge-series": seriesColor(series), ...style }, children: [Icon
13
+ ? _jsx("span", { className: cn("badge-series-icon", pulse && "dot-pulse"), "aria-hidden": "true", children: _jsx(Icon, { className: "icon", strokeWidth: 1.75, "aria-hidden": "true", focusable: "false" }) })
14
+ : _jsx(Dot, { pulse: pulse }), children] });
8
15
  }
package/dist/styles.css CHANGED
@@ -178,9 +178,9 @@
178
178
  width: min(32rem, calc(100vw - 2 * var(--spacing-lg)));
179
179
  --frame-fill: var(--color-elevated-surface);
180
180
  background-color: color-mix(in srgb, var(--frame-fill) calc((1 - var(--appearance-expressive, 0)) * (1 - var(--pixel-enabled, 0)) * 100%), transparent);
181
- border: 1px var(--appearance-panel-border, solid) var(--appearance-border-color, var(--corner-border-color, var(--color-border)));
181
+ border: 1px var(--appearance-panel-border, solid) var(--appearance-border-color, var(--corner-border-color, var(--appearance-cast-border, var(--color-border))));
182
182
  border-radius: var(--appearance-corners, var(--radius-surface));
183
- box-shadow: var(--appearance-frame-shadow, var(--corner-frame-shadow, var(--shadow-md)));
183
+ box-shadow: var(--panel-shadow-legacy, var(--appearance-frame-shadow, var(--corner-frame-shadow, var(--shadow-md), var(--appearance-cast-shadow, 0 0 transparent)))) var(--panel-shadow-projection, var(--panel-shadow-paint));
184
184
  }
185
185
  .dialog-scroll {
186
186
  max-height: calc(100dvh - 2 * var(--spacing-xl));
@@ -476,8 +476,8 @@
476
476
  flex-direction: column;
477
477
  --frame-fill: var(--color-elevated-surface);
478
478
  background-color: color-mix(in srgb, var(--frame-fill) calc((1 - var(--appearance-expressive, 0)) * (1 - var(--pixel-enabled, 0)) * 100%), transparent);
479
- border: 1px var(--appearance-panel-border, solid) var(--appearance-border-color, var(--corner-border-color, var(--color-border)));
480
- box-shadow: var(--appearance-frame-shadow, var(--corner-frame-shadow, var(--shadow-md)));
479
+ border: 1px var(--appearance-panel-border, solid) var(--appearance-border-color, var(--corner-border-color, var(--appearance-cast-border, var(--color-border))));
480
+ box-shadow: var(--panel-shadow-legacy, var(--appearance-frame-shadow, var(--corner-frame-shadow, var(--shadow-md), var(--appearance-cast-shadow, 0 0 transparent)))) var(--panel-shadow-projection, var(--panel-shadow-paint));
481
481
  }
482
482
  .kiso-react-drawer[data-placement="side"] {
483
483
  inset-block: 0;
package/dist/table.js CHANGED
@@ -1,9 +1,10 @@
1
1
  // Adapted from shadcn/ui new-york-v4. See ../SHADCN-LICENSE.
2
2
  "use client";
3
- import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ import { PanelShadow } from "./panel-shadow.js";
4
5
  import { clsx as cn } from "clsx";
5
6
  function TableFrame({ className, frame = "default", children, ...props }) {
6
- return _jsx("div", { "data-slot": "table-frame", "data-frame": frame, className: cn("table-wrap", className), ...props, children: _jsx("div", { className: "table-surface", children: children }) });
7
+ return _jsxs("div", { "data-slot": "table-frame", "data-frame": frame, className: cn("table-wrap", className), ...props, children: [_jsx(PanelShadow, {}), _jsx("div", { className: "table-surface", children: children })] });
7
8
  }
8
9
  function Table({ className, density, header, ...props }) {
9
10
  return (_jsx("div", { "data-slot": "table-container", className: "table-scroll", children: _jsx("table", { "data-slot": "table", "data-density": density, "data-header": header, className: cn("table", className), ...props }) }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momoi-labs/kiso-react",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "Kiso React components built with shadcn/ui and Radix",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -32,7 +32,7 @@
32
32
  "prepack": "npm run build"
33
33
  },
34
34
  "dependencies": {
35
- "@momoi-labs/kiso": "^1.3.0",
35
+ "@momoi-labs/kiso": "^1.4.0",
36
36
  "class-variance-authority": "0.7.1",
37
37
  "clsx": "2.1.1",
38
38
  "radix-ui": "1.6.7",