@momoi-labs/kiso-react 0.24.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.
package/dist/index.js CHANGED
@@ -8,9 +8,11 @@ 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";
15
+ export * from "./combobox.js";
14
16
  export * from "./code-editor.js";
15
17
  export * from "./filter-input.js";
16
18
  export * from "./filter-expression.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));
@@ -292,6 +292,12 @@
292
292
  }
293
293
  [data-slot="select-viewport"] { min-height: 0; }
294
294
 
295
+ /* The combobox list matches the input width and fits the space Radix measures, up to 20rem. */
296
+ .combobox-content {
297
+ width: var(--radix-popover-trigger-width);
298
+ max-height: min(20rem, var(--radix-popover-content-available-height));
299
+ }
300
+
295
301
  /* Portalled surfaces: above the page, never wider than it. */
296
302
  .kiso-react-floating {
297
303
  z-index: 70;
@@ -470,8 +476,8 @@
470
476
  flex-direction: column;
471
477
  --frame-fill: var(--color-elevated-surface);
472
478
  background-color: color-mix(in srgb, var(--frame-fill) calc((1 - var(--appearance-expressive, 0)) * (1 - var(--pixel-enabled, 0)) * 100%), transparent);
473
- border: 1px var(--appearance-panel-border, solid) var(--appearance-border-color, var(--corner-border-color, var(--color-border)));
474
- 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));
475
481
  }
476
482
  .kiso-react-drawer[data-placement="side"] {
477
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.24.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.2.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",