@momoi-labs/kiso-react 0.12.0 → 0.14.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/README.md +33 -0
- package/dist/accent-selector.d.ts +1 -1
- package/dist/accent-selector.js +3 -0
- package/dist/app-shell.js +3 -2
- package/dist/chart-legend.js +1 -1
- package/dist/chart-style.d.ts +19 -0
- package/dist/chart-style.js +68 -0
- package/dist/chart.d.ts +3 -1
- package/dist/chart.js +21 -9
- package/dist/chip-input.js +3 -8
- package/dist/command-palette.js +2 -1
- package/dist/detail-select.d.ts +24 -0
- package/dist/detail-select.js +56 -0
- package/dist/diagram.d.ts +54 -0
- package/dist/diagram.js +136 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/log-view.d.ts +1 -0
- package/dist/log-view.js +21 -5
- package/dist/pane-grid.d.ts +28 -0
- package/dist/pane-grid.js +488 -0
- package/dist/password-input.d.ts +15 -0
- package/dist/password-input.js +31 -0
- package/dist/search.js +2 -1
- package/dist/select.js +2 -1
- package/dist/sparkline.d.ts +3 -1
- package/dist/sparkline.js +16 -2
- package/dist/steps.js +2 -1
- package/dist/styles.css +52 -0
- package/dist/theme-selector.js +5 -4
- package/dist/time-range-control.js +2 -1
- package/package.json +6 -4
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useId, useState } from "react";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { Input } from "./input.js";
|
|
6
|
+
const defaultLabels = {
|
|
7
|
+
show: "Show", hide: "Hide",
|
|
8
|
+
showName: "Show password", hideName: "Hide password",
|
|
9
|
+
shown: "Your password is visible", hidden: "Your password is hidden",
|
|
10
|
+
};
|
|
11
|
+
export function PasswordInput({ labels, id: providedId, disabled, ...props }) {
|
|
12
|
+
const generatedId = useId();
|
|
13
|
+
const id = providedId ?? generatedId;
|
|
14
|
+
const text = { ...defaultLabels, ...labels };
|
|
15
|
+
const [revealed, setRevealed] = useState(false);
|
|
16
|
+
const [status, setStatus] = useState("");
|
|
17
|
+
// Mask again on submit so the browser never saves the value as plain text.
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const form = document.getElementById(id)?.form;
|
|
20
|
+
if (!revealed || !form)
|
|
21
|
+
return;
|
|
22
|
+
const hide = () => { setRevealed(false); setStatus(text.hidden); };
|
|
23
|
+
form.addEventListener("submit", hide);
|
|
24
|
+
return () => form.removeEventListener("submit", hide);
|
|
25
|
+
}, [id, revealed, text.hidden]);
|
|
26
|
+
function toggle() {
|
|
27
|
+
setRevealed(!revealed);
|
|
28
|
+
setStatus(revealed ? text.hidden : text.shown);
|
|
29
|
+
}
|
|
30
|
+
return (_jsxs("div", { className: "field-control password-input", "data-slot": "password-input", "data-revealed": revealed, children: [_jsx(Input, { autoComplete: "current-password", autoCapitalize: "none", autoCorrect: "off", spellCheck: false, ...props, id: id, disabled: disabled, type: revealed ? "text" : "password" }), _jsxs(Button, { size: "sm", variant: "ghost", className: "password-input-toggle", "aria-controls": id, "aria-label": revealed ? text.hideName : text.showName, disabled: disabled, onClick: toggle, children: [_jsx("span", { "aria-hidden": revealed, children: text.show }), _jsx("span", { "aria-hidden": !revealed, children: text.hide })] }), _jsx("span", { className: "password-input-status", "aria-live": "polite", children: status })] }));
|
|
31
|
+
}
|
package/dist/search.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { clsx as cn } from "clsx";
|
|
3
|
+
import { Search as SearchIcon } from "lucide-react";
|
|
3
4
|
import { Input } from "./input.js";
|
|
4
5
|
// Filters a collection that is already on screen. Global commands are
|
|
5
6
|
// CommandPalette; a single field is Input.
|
|
6
7
|
function Search({ className, containerClassName, ...props }) {
|
|
7
|
-
return (_jsxs("div", { "data-slot": "search", className: cn("input-group", containerClassName), children: [
|
|
8
|
+
return (_jsxs("div", { "data-slot": "search", className: cn("input-group", containerClassName), children: [_jsx(SearchIcon, { className: "icon", "aria-hidden": "true" }), _jsx(Input, { type: "search", className: className, ...props })] }));
|
|
8
9
|
}
|
|
9
10
|
export { Search };
|
package/dist/select.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { clsx as cn } from "clsx";
|
|
5
|
+
import { Check } from "lucide-react";
|
|
5
6
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
6
7
|
function Select({ ...props }) {
|
|
7
8
|
return _jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
@@ -22,7 +23,7 @@ function SelectLabel({ className, ...props }) {
|
|
|
22
23
|
return (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn("menu-label t-caps", className), ...props }));
|
|
23
24
|
}
|
|
24
25
|
function SelectItem({ className, children, ...props }) {
|
|
25
|
-
return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("menu-item", className), ...props, children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx(SelectPrimitive.ItemIndicator, { "data-slot": "select-item-indicator", "aria-hidden": "true", children: _jsx(
|
|
26
|
+
return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("menu-item", className), ...props, children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx(SelectPrimitive.ItemIndicator, { "data-slot": "select-item-indicator", "aria-hidden": "true", children: _jsx(Check, { className: "icon icon-sm" }) })] }));
|
|
26
27
|
}
|
|
27
28
|
function SelectSeparator({ className, ...props }) {
|
|
28
29
|
return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("menu-separator", className), ...props }));
|
package/dist/sparkline.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type ChartStyle } from "./chart-style.js";
|
|
2
3
|
export type SparklineProps = Omit<React.ComponentProps<"div">, "ref"> & {
|
|
3
4
|
values: readonly (number | null)[];
|
|
4
5
|
height?: number;
|
|
@@ -8,6 +9,7 @@ export type SparklineProps = Omit<React.ComponentProps<"div">, "ref"> & {
|
|
|
8
9
|
max?: number;
|
|
9
10
|
label?: string;
|
|
10
11
|
ref?: React.Ref<HTMLDivElement>;
|
|
12
|
+
chartStyle?: ChartStyle;
|
|
11
13
|
};
|
|
12
|
-
declare function Sparkline({ values, height, tone, fill, min, max, label, className, style, ref, ...props }: SparklineProps): React.JSX.Element | null;
|
|
14
|
+
declare function Sparkline({ values, height, tone, fill, min, max, label, className, style, ref, chartStyle, ...props }: SparklineProps): React.JSX.Element | null;
|
|
13
15
|
export { Sparkline };
|
package/dist/sparkline.js
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
// Sparkline: one metric series at cell size, no axis, grid, or tooltip.
|
|
4
|
+
// Contract: kiso/docs/components/sparkline.md. Recharts generates the path;
|
|
5
|
+
// the `.sparkline` frame in ui.css picks the color tokens.
|
|
6
|
+
import * as React from "react";
|
|
3
7
|
import { Area, AreaChart, ResponsiveContainer, YAxis } from "recharts";
|
|
4
8
|
import { clsx as cn } from "clsx";
|
|
5
|
-
|
|
9
|
+
import { ChartPattern, pixelCurve, useChartStyle } from "./chart-style.js";
|
|
10
|
+
function Sparkline({ values, height = 24, tone = "neutral", fill = false, min, max, label, className, style, ref, chartStyle, ...props }) {
|
|
11
|
+
const id = React.useId();
|
|
12
|
+
const frame = React.useRef(null);
|
|
6
13
|
// Below two samples there is no shape to show, and a flat rule across a
|
|
7
14
|
// cell reads as a border rather than as a measurement.
|
|
8
15
|
const known = values.filter((value) => value !== null && Number.isFinite(value));
|
|
16
|
+
const treatment = useChartStyle(frame, chartStyle, known.length >= 2);
|
|
9
17
|
if (known.length < 2)
|
|
10
18
|
return null;
|
|
11
19
|
// Default domain is the data's own extent; pass min and max to make
|
|
@@ -15,6 +23,12 @@ function Sparkline({ values, height = 24, tone = "neutral", fill = false, min, m
|
|
|
15
23
|
const pad = lo === hi ? Math.max(1, Math.abs(lo) * 0.1) : 0;
|
|
16
24
|
lo -= pad;
|
|
17
25
|
hi += pad;
|
|
18
|
-
return (_jsx("div", { ref:
|
|
26
|
+
return (_jsx("div", { ref: element => {
|
|
27
|
+
frame.current = element;
|
|
28
|
+
if (typeof ref === "function")
|
|
29
|
+
return ref(element);
|
|
30
|
+
if (ref)
|
|
31
|
+
ref.current = element;
|
|
32
|
+
}, "data-slot": "sparkline", "data-chart-treatment": treatment, "data-tone": tone, role: label ? "img" : undefined, "aria-label": label, "aria-hidden": label ? undefined : true, className: cn("sparkline", tone === "primary" && "primary", className), style: { height, ...style }, ...props, children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsxs(AreaChart, { data: values.map((value) => ({ value: value !== null && Number.isFinite(value) ? value : null })), margin: { top: 2, right: 0, bottom: 2, left: 0 }, children: [_jsx("defs", { children: _jsx(ChartPattern, { id: `${id}-halftone`, color: "currentColor" }) }), _jsx(YAxis, { hide: true, domain: [lo, hi] }), _jsx(Area, { type: treatment === "pixel" ? pixelCurve : treatment === "rounded" ? "monotone" : "linear", connectNulls: false, dataKey: "value", stroke: "currentColor", strokeWidth: treatment === "pixel" || treatment === "rounded" ? 2 : 1.5, strokeLinecap: treatment === "rounded" ? "round" : "butt", strokeLinejoin: treatment === "rounded" ? "round" : "miter", fill: treatment === "halftone" ? `url(#${id}-halftone)` : fill ? "currentColor" : "none", fillOpacity: treatment === "halftone" ? 0.3 : fill ? 0.12 : 0, isAnimationActive: false, dot: false, activeDot: false })] }) }) }));
|
|
19
33
|
}
|
|
20
34
|
export { Sparkline };
|
package/dist/steps.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useId, useState } from "react";
|
|
4
4
|
import { clsx as cn } from "clsx";
|
|
5
|
+
import { Check, Lock } from "lucide-react";
|
|
5
6
|
const defaultLabels = {
|
|
6
7
|
upcoming: "Upcoming", current: "Current", completed: "Completed", error: "Needs attention",
|
|
7
8
|
disabled: "Unavailable", expand: "View steps", collapse: "Hide steps",
|
|
@@ -18,7 +19,7 @@ export function Steps({ label, items, current, orientation = "horizontal", respo
|
|
|
18
19
|
const status = item.status ?? "upcoming";
|
|
19
20
|
const active = item.id === current;
|
|
20
21
|
const canNavigate = status !== "disabled" && (item.href || (item.navigable && onStepChange));
|
|
21
|
-
const content = _jsxs(_Fragment, { children: [_jsx("span", { className: "steps-marker", "aria-hidden": "true", children: status === "completed" ? _jsx(
|
|
22
|
+
const content = _jsxs(_Fragment, { children: [_jsx("span", { className: "steps-marker", "aria-hidden": "true", children: status === "completed" ? _jsx(Check, {}) : status === "disabled" ? _jsx(Lock, {}) : status === "error" ? "!" : index + 1 }), _jsxs("span", { className: "steps-copy", children: [_jsx("span", { className: "steps-label", children: item.label }), _jsx("span", { className: "steps-state", children: active ? `${text.current}${status === "error" ? `, ${text.error}` : ""}` : text[status] }), item.description != null && _jsx("span", { className: "steps-description", children: item.description })] })] });
|
|
22
23
|
return _jsx("li", { "data-state": status, "data-current": active, "aria-current": active ? "step" : undefined, children: canNavigate && item.href ? _jsx("a", { className: "steps-item", href: item.href, children: content })
|
|
23
24
|
: canNavigate ? _jsx("button", { type: "button", className: "steps-item", onClick: () => onStepChange?.(item.id), children: content })
|
|
24
25
|
: _jsx("div", { className: "steps-item", children: content }) }, item.id);
|
package/dist/styles.css
CHANGED
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
color: var(--color-foreground);
|
|
105
105
|
font-weight: var(--type-weight-medium);
|
|
106
106
|
}
|
|
107
|
+
.accent-pill:is([data-accent="gold"], [data-accent="lime"])[aria-pressed="true"] { border-color: var(--color-link); }
|
|
107
108
|
.accent-dot { width: var(--spacing-md); height: var(--spacing-md); border-radius: var(--radius-full); background: var(--color-primary); }
|
|
108
109
|
|
|
109
110
|
.accent-preview {
|
|
@@ -318,6 +319,57 @@
|
|
|
318
319
|
box-shadow: var(--shadow-md);
|
|
319
320
|
max-width: min(24rem, calc(100vw - 2 * var(--spacing-lg)));
|
|
320
321
|
}
|
|
322
|
+
|
|
323
|
+
.detail-select { display: grid; gap: var(--spacing-sm); min-width: 0; }
|
|
324
|
+
.detail-select-trigger { display: flex; align-items: center; gap: var(--spacing-sm); width: 100%; text-align: start; }
|
|
325
|
+
.detail-select-trigger > :last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
326
|
+
.detail-select-icon { display: inline-flex; flex: none; }
|
|
327
|
+
.detail-select-content {
|
|
328
|
+
gap: 0;
|
|
329
|
+
width: min(40rem, calc(100vw - 2 * var(--spacing-lg)));
|
|
330
|
+
max-width: min(40rem, calc(100vw - 2 * var(--spacing-lg)));
|
|
331
|
+
max-height: min(32rem, var(--radix-popover-content-available-height));
|
|
332
|
+
overflow-y: auto; overscroll-behavior: contain; padding: 0;
|
|
333
|
+
}
|
|
334
|
+
.detail-select-option { display: grid; grid-template-columns: minmax(0, 8rem) minmax(0, 1fr); gap: var(--spacing-lg); padding: var(--spacing-md); border-bottom: 1px solid var(--color-border); }
|
|
335
|
+
.detail-select-option:last-child { border-bottom: 0; }
|
|
336
|
+
.detail-select-option:not([data-disabled]) { cursor: pointer; }
|
|
337
|
+
@media (hover: hover) {
|
|
338
|
+
.detail-select-option:where(:not([data-disabled]):hover) { background-color: var(--color-accent-surface-hover); }
|
|
339
|
+
}
|
|
340
|
+
.detail-select-option[data-selected="true"], .detail-select-option:has(.detail-select-choice:focus-visible) { background-color: var(--color-selected); color: var(--color-selected-foreground); }
|
|
341
|
+
.detail-select-option:is([data-selected="true"], :has(.detail-select-choice:focus-visible)) :is(.detail-select-choice, .detail-select-description) { color: inherit; }
|
|
342
|
+
@media (forced-colors: active) {
|
|
343
|
+
.detail-select-option:has(.detail-select-choice:focus-visible) { outline: 2px solid Highlight; outline-offset: -2px; }
|
|
344
|
+
}
|
|
345
|
+
.detail-select-illustration { min-width: 0; align-self: start; padding-top: var(--spacing-sm); }
|
|
346
|
+
.detail-select-illustration :is(img, svg, video) { max-width: 100%; }
|
|
347
|
+
.detail-select-body { min-width: 0; overflow-wrap: anywhere; }
|
|
348
|
+
.detail-select-heading { margin: 0; }
|
|
349
|
+
.detail-select-choice { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-sm); width: 100%; min-height: var(--size-control-sm); padding: 0; border: 0; background: transparent; color: var(--color-foreground); font: inherit; font-size: var(--type-size-body); font-weight: var(--type-weight-medium); text-align: start; cursor: pointer; }
|
|
350
|
+
.detail-select-choice:focus-visible { outline: none; }
|
|
351
|
+
.detail-select-choice:disabled { color: var(--color-disabled); cursor: default; }
|
|
352
|
+
.detail-select-choice .icon { flex: none; }
|
|
353
|
+
.detail-select-description { color: var(--color-muted-foreground); font-size: var(--type-size-label); overflow-x: auto; }
|
|
354
|
+
.detail-select-description > * { margin-block: 0 var(--spacing-sm); }
|
|
355
|
+
.detail-select-description > :last-child { margin-bottom: 0; }
|
|
356
|
+
.detail-select-description a { color: var(--color-link); text-decoration: underline; text-underline-offset: var(--spacing-2xs); }
|
|
357
|
+
.detail-select-empty { padding: var(--spacing-md); margin: 0; color: var(--color-muted-foreground); }
|
|
358
|
+
@media (max-width: 480px) {
|
|
359
|
+
.detail-select-option { grid-template-columns: minmax(0, 4rem) minmax(0, 1fr); gap: var(--spacing-sm); padding: var(--spacing-sm); }
|
|
360
|
+
}
|
|
361
|
+
@media (pointer: coarse) {
|
|
362
|
+
.detail-select-choice { min-height: var(--size-touch-min); }
|
|
363
|
+
.detail-select-description a { display: inline-block; min-height: var(--size-touch-min); align-content: center; }
|
|
364
|
+
}
|
|
365
|
+
/* When frames include controls, these surfaces take the control shape, as
|
|
366
|
+
the control-sized surfaces in ui.css do. */
|
|
367
|
+
:where([data-frame-scope="all"]) :is(.kiso-react-popover, .theme-buttons, .accent-preview) {
|
|
368
|
+
border-radius: var(--radius-lg) calc(var(--radius-lg) * var(--corner-control-opposite, var(--appearance-control-opposite, 1)));
|
|
369
|
+
}
|
|
370
|
+
:where([data-frame-scope="all"]) .skeleton-text {
|
|
371
|
+
border-radius: var(--radius-sm) calc(var(--radius-sm) * var(--corner-control-opposite, var(--appearance-control-opposite, 1)));
|
|
372
|
+
}
|
|
321
373
|
[data-slot="tooltip-content"] { max-width: 28ch; }
|
|
322
374
|
|
|
323
375
|
.kiso-react-switch {
|
package/dist/theme-selector.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useId, useRef } from "react";
|
|
4
|
+
import { Monitor, Moon, Sun } from "lucide-react";
|
|
4
5
|
import { Button } from "./button.js";
|
|
5
6
|
function ThemePreview({ theme }) {
|
|
6
7
|
const schemes = theme === "system" ? ["light", "dark"] : [theme];
|
|
@@ -16,25 +17,25 @@ export function ThemeSelector({ theme, onChange, variant = "compact", }) {
|
|
|
16
17
|
label: "Follow system",
|
|
17
18
|
name: "System",
|
|
18
19
|
description: "Follow your device",
|
|
19
|
-
|
|
20
|
+
Icon: Monitor,
|
|
20
21
|
},
|
|
21
22
|
{
|
|
22
23
|
value: "light",
|
|
23
24
|
label: "Light theme",
|
|
24
25
|
name: "Light",
|
|
25
26
|
description: "Always use light colors",
|
|
26
|
-
|
|
27
|
+
Icon: Sun,
|
|
27
28
|
},
|
|
28
29
|
{
|
|
29
30
|
value: "dark",
|
|
30
31
|
label: "Dark theme",
|
|
31
32
|
name: "Dark",
|
|
32
33
|
description: "Always use dark colors",
|
|
33
|
-
|
|
34
|
+
Icon: Moon,
|
|
34
35
|
},
|
|
35
36
|
];
|
|
36
37
|
return (_jsxs("div", { "data-slot": "theme-selector", "data-variant": variant, className: cards ? "theme-selector-cards" : "theme-row", children: [_jsx("span", { className: "t-label", children: "Theme" }), _jsx("div", { className: cards ? "theme-cards" : "theme-buttons", role: "radiogroup", "aria-label": "Theme", children: options.map((option, index) => {
|
|
37
|
-
const icon = _jsx(
|
|
38
|
+
const icon = _jsx(option.Icon, { className: "icon icon-sm", "aria-hidden": "true" });
|
|
38
39
|
return (_jsx(Button, { ref: (button) => { buttons.current[index] = button; }, variant: "ghost", size: "sm", className: cards ? "theme-card" : "btn-icon", role: "radio", "aria-label": option.label, "aria-describedby": cards ? `${id}-${option.value}-description` : undefined, title: option.label, "aria-checked": theme === option.value, tabIndex: theme === option.value ? 0 : -1, onClick: () => onChange(option.value), onKeyDown: (event) => {
|
|
39
40
|
if (event.altKey || event.ctrlKey || event.metaKey)
|
|
40
41
|
return;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { clsx as cn } from "clsx";
|
|
5
|
+
import { ChevronDown } from "lucide-react";
|
|
5
6
|
import { Button } from "./button.js";
|
|
6
7
|
import { Form, FormActions } from "./form.js";
|
|
7
8
|
import { Input } from "./input.js";
|
|
@@ -31,7 +32,7 @@ export function TimeRangeControl({ value, bounds, onValueChange, label = "Time r
|
|
|
31
32
|
throw new RangeError("Time range preset durations must be positive milliseconds.");
|
|
32
33
|
}
|
|
33
34
|
const apply = (range) => { onValueChange(range); setOpen(false); };
|
|
34
|
-
return _jsxs(Popover, { open: open, onOpenChange: next => { setOpen(next); setCustom(false); }, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { disabled: disabled, className: cn("time-range-trigger", className), "aria-label": `${label}: ${dateInput(value.from).replace("T", " ")} to ${dateInput(value.to).replace("T", " ")} UTC`, children: [shortRange(value), " ", _jsx(
|
|
35
|
+
return _jsxs(Popover, { open: open, onOpenChange: next => { setOpen(next); setCustom(false); }, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { disabled: disabled, className: cn("time-range-trigger", className), "aria-label": `${label}: ${dateInput(value.from).replace("T", " ")} to ${dateInput(value.to).replace("T", " ")} UTC`, children: [shortRange(value), " ", _jsx(ChevronDown, { className: "icon icon-sm", "aria-hidden": "true" })] }) }), _jsx(PopoverContent, { className: "time-range-content", "aria-label": label, children: custom ? _jsxs("div", { className: "stack-sm", children: [_jsx(Button, { variant: "ghost", onClick: () => setCustom(false), children: "Back to presets" }), _jsx(TimeRangeForm, { value: value, bounds: bounds, onApply: apply }, `${value.from}-${value.to}-${open}`)] }) : _jsxs("div", { className: "time-range-presets", children: [_jsxs(Button, { variant: "ghost", onClick: () => apply(bounds), children: [_jsx("span", { children: "Entire run" }), _jsx("small", { children: shortRange(bounds) })] }), presets.map(preset => {
|
|
35
36
|
const range = { from: Math.max(bounds.from, bounds.to - preset.duration), to: bounds.to };
|
|
36
37
|
return _jsxs(Button, { variant: "ghost", onClick: () => apply(range), children: [_jsx("span", { children: preset.label }), _jsx("small", { children: shortRange(range) })] }, preset.label);
|
|
37
38
|
}), _jsx(Button, { variant: "ghost", onClick: () => setCustom(true), children: "Custom range" })] }) })] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momoi-labs/kiso-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.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": "^0.
|
|
35
|
+
"@momoi-labs/kiso": "^0.18.0",
|
|
36
36
|
"class-variance-authority": "0.7.1",
|
|
37
37
|
"clsx": "2.1.1",
|
|
38
38
|
"radix-ui": "1.6.7",
|
|
@@ -41,12 +41,14 @@
|
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": "^19.0.0",
|
|
44
|
-
"react-dom": "^19.0.0"
|
|
44
|
+
"react-dom": "^19.0.0",
|
|
45
|
+
"lucide-react": ">=1.0.0"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@types/react": "19.2.18",
|
|
48
49
|
"@types/react-dom": "19.2.7",
|
|
49
|
-
"typescript": "7.0.2"
|
|
50
|
+
"typescript": "7.0.2",
|
|
51
|
+
"lucide-react": "1.53.0"
|
|
50
52
|
},
|
|
51
53
|
"publishConfig": {
|
|
52
54
|
"access": "public",
|