@usetheo/ui 0.30.0 → 0.32.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.
|
@@ -31,7 +31,24 @@ export interface TrendSeries {
|
|
|
31
31
|
export declare function linScale(domain: [number, number], range: [number, number]): (v: number) => number;
|
|
32
32
|
/** A clean upper Y bound ≥ max(values). Returns 0 when there is no positive value. */
|
|
33
33
|
export declare function niceMax(values: number[]): number;
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* SVG path `d` for a polyline over the given scales. A non-finite point is a GAP: the path BREAKS
|
|
36
|
+
* there and resumes with a new `M` subpath.
|
|
37
|
+
*
|
|
38
|
+
* M144 — this used to `filter(Number.isFinite)` and then join everything with `L`, which drew a
|
|
39
|
+
* continuous line straight over the hole. The filter is what made it wrong: it erased the
|
|
40
|
+
* information of WHERE the gap was, so the line could not break even in principle.
|
|
41
|
+
*
|
|
42
|
+
* Breaking is what every serious charting library does by default — `spanGaps` (Chart.js),
|
|
43
|
+
* `connectNulls` (Highcharts, ECharts, Recharts) and `connectgaps` (Plotly) all default to `false`,
|
|
44
|
+
* and Grafana ships "Connect null values: Never". It is also the only honest reading: connecting
|
|
45
|
+
* asserts continuity the data does not have, and the rest of THIS file already treats a non-finite
|
|
46
|
+
* `y` as absent (`niceMax` filters it, `hasData` filters it, and the accessible table renders `—`
|
|
47
|
+
* for a period a series has no point for).
|
|
48
|
+
*
|
|
49
|
+
* A run of one point emits a lone `M` and no `L` — a one-point line has no length, and the sparse
|
|
50
|
+
* marker is what makes it visible.
|
|
51
|
+
*/
|
|
35
52
|
export declare function seriesPath(points: TrendPoint[], xScale: (x: number) => number, yScale: (y: number) => number): string;
|
|
36
53
|
export interface TrendChartProps extends HTMLAttributes<HTMLElement> {
|
|
37
54
|
title: string;
|
|
@@ -3,7 +3,10 @@ import type { ComponentPropsWithoutRef, HTMLAttributes } from "react";
|
|
|
3
3
|
interface ContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
4
4
|
hideCloseButton?: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare const Dialog:
|
|
6
|
+
declare const Dialog: {
|
|
7
|
+
(props: ComponentPropsWithoutRef<typeof DialogPrimitive.Root>): import("react").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
} & {
|
|
7
10
|
Trigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
11
|
Close: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
9
12
|
Content: import("react").ForwardRefExoticComponent<ContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,57 +1,33 @@
|
|
|
1
1
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
import type { ComponentPropsWithoutRef, HTMLAttributes } from "react";
|
|
4
|
-
/**
|
|
5
|
-
* Sheet — slide-in side panel built on Radix Dialog.
|
|
6
|
-
*
|
|
7
|
-
* Same Radix primitive as Dialog, but Content slides from an edge instead of
|
|
8
|
-
* fading from center. Used for: workspace overlays (Memory, Observability,
|
|
9
|
-
* Sub-agents), Settings, contextual filters.
|
|
10
|
-
*
|
|
11
|
-
* Composition:
|
|
12
|
-
* <Sheet>
|
|
13
|
-
* <Sheet.Trigger>Open</Sheet.Trigger>
|
|
14
|
-
* <Sheet.Content side="right">
|
|
15
|
-
* <Sheet.Header>
|
|
16
|
-
* <Sheet.Title>Memory</Sheet.Title>
|
|
17
|
-
* <Sheet.Description>Episodes and wiki pages</Sheet.Description>
|
|
18
|
-
* </Sheet.Header>
|
|
19
|
-
* <Sheet.Body>…</Sheet.Body>
|
|
20
|
-
* <Sheet.Footer>…</Sheet.Footer>
|
|
21
|
-
* </Sheet.Content>
|
|
22
|
-
* </Sheet>
|
|
23
|
-
*/
|
|
24
|
-
declare const Overlay: import("react").ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
4
|
declare const sheetVariants: (props?: ({
|
|
26
5
|
side?: "bottom" | "left" | "right" | "top" | null | undefined;
|
|
27
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
28
7
|
interface ContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
29
8
|
hideCloseButton?: boolean;
|
|
30
9
|
}
|
|
31
|
-
declare const
|
|
32
|
-
|
|
33
|
-
({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
10
|
+
declare const Sheet: {
|
|
11
|
+
(props: ComponentPropsWithoutRef<typeof DialogPrimitive.Root>): import("react").JSX.Element;
|
|
34
12
|
displayName: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Title: typeof Title;
|
|
55
|
-
Description: typeof Description;
|
|
13
|
+
} & {
|
|
14
|
+
Trigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
Close: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
Content: import("react").ForwardRefExoticComponent<ContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
+
Overlay: import("react").ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
Header: {
|
|
19
|
+
({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
Body: {
|
|
23
|
+
({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
Footer: {
|
|
27
|
+
({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
30
|
+
Title: import("react").ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
31
|
+
Description: import("react").ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
56
32
|
};
|
|
57
33
|
export { Sheet, sheetVariants };
|
package/dist/index.js
CHANGED
|
@@ -1729,7 +1729,9 @@ var Description3 = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1729
1729
|
}
|
|
1730
1730
|
));
|
|
1731
1731
|
Description3.displayName = "Dialog.Description";
|
|
1732
|
-
var
|
|
1732
|
+
var Root7 = (props) => /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...props });
|
|
1733
|
+
Root7.displayName = "Dialog";
|
|
1734
|
+
var Dialog = /* @__PURE__ */ Object.assign(Root7, {
|
|
1733
1735
|
Trigger: DialogPrimitive.Trigger,
|
|
1734
1736
|
Close: DialogPrimitive.Close,
|
|
1735
1737
|
Content: Content3,
|
|
@@ -1793,7 +1795,7 @@ var Tabs = /* @__PURE__ */ Object.assign(TabsPrimitive.Root, {
|
|
|
1793
1795
|
Content: Content5
|
|
1794
1796
|
});
|
|
1795
1797
|
var Provider2 = TooltipPrimitive.Provider;
|
|
1796
|
-
var
|
|
1798
|
+
var Root10 = TooltipPrimitive.Root;
|
|
1797
1799
|
var Trigger5 = TooltipPrimitive.Trigger;
|
|
1798
1800
|
var Content7 = forwardRef(({ className, sideOffset = 6, ...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
1799
1801
|
TooltipPrimitive.Content,
|
|
@@ -1821,13 +1823,13 @@ var Tooltip = ({
|
|
|
1821
1823
|
delayDuration = 200,
|
|
1822
1824
|
children,
|
|
1823
1825
|
...rootProps
|
|
1824
|
-
}) => /* @__PURE__ */ jsx(Provider2, { delayDuration, children: /* @__PURE__ */ jsxs(
|
|
1826
|
+
}) => /* @__PURE__ */ jsx(Provider2, { delayDuration, children: /* @__PURE__ */ jsxs(Root10, { ...rootProps, children: [
|
|
1825
1827
|
/* @__PURE__ */ jsx(Trigger5, { asChild: true, children }),
|
|
1826
1828
|
/* @__PURE__ */ jsx(Content7, { side, align, children: label })
|
|
1827
1829
|
] }) });
|
|
1828
1830
|
var TooltipWithStatics = Tooltip;
|
|
1829
1831
|
TooltipWithStatics.Provider = Provider2;
|
|
1830
|
-
TooltipWithStatics.Root =
|
|
1832
|
+
TooltipWithStatics.Root = Root10;
|
|
1831
1833
|
TooltipWithStatics.Trigger = Trigger5;
|
|
1832
1834
|
TooltipWithStatics.Content = Content7;
|
|
1833
1835
|
var ScrollAreaRoot = forwardRef(
|
|
@@ -2679,7 +2681,7 @@ var Textarea = forwardRef(
|
|
|
2679
2681
|
)
|
|
2680
2682
|
);
|
|
2681
2683
|
Textarea.displayName = "Textarea";
|
|
2682
|
-
var
|
|
2684
|
+
var Root20 = forwardRef(
|
|
2683
2685
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2684
2686
|
"aside",
|
|
2685
2687
|
{
|
|
@@ -2693,7 +2695,7 @@ var Root19 = forwardRef(
|
|
|
2693
2695
|
}
|
|
2694
2696
|
)
|
|
2695
2697
|
);
|
|
2696
|
-
|
|
2698
|
+
Root20.displayName = "Sidebar";
|
|
2697
2699
|
var Header3 = forwardRef(
|
|
2698
2700
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2699
2701
|
"div",
|
|
@@ -2795,13 +2797,13 @@ var Footer3 = forwardRef(
|
|
|
2795
2797
|
)
|
|
2796
2798
|
);
|
|
2797
2799
|
Footer3.displayName = "Sidebar.Footer";
|
|
2798
|
-
var Sidebar = /* @__PURE__ */ Object.assign(
|
|
2800
|
+
var Sidebar = /* @__PURE__ */ Object.assign(Root20, {
|
|
2799
2801
|
Header: Header3,
|
|
2800
2802
|
Section,
|
|
2801
2803
|
Item: Item6,
|
|
2802
2804
|
Footer: Footer3
|
|
2803
2805
|
});
|
|
2804
|
-
var
|
|
2806
|
+
var Root21 = forwardRef(
|
|
2805
2807
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2806
2808
|
"header",
|
|
2807
2809
|
{
|
|
@@ -2815,7 +2817,7 @@ var Root20 = forwardRef(
|
|
|
2815
2817
|
}
|
|
2816
2818
|
)
|
|
2817
2819
|
);
|
|
2818
|
-
|
|
2820
|
+
Root21.displayName = "TopNav";
|
|
2819
2821
|
var Left = forwardRef(
|
|
2820
2822
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2821
2823
|
"div",
|
|
@@ -2950,7 +2952,7 @@ var ModeSwitcher = forwardRef(
|
|
|
2950
2952
|
}
|
|
2951
2953
|
);
|
|
2952
2954
|
ModeSwitcher.displayName = "TopNav.ModeSwitcher";
|
|
2953
|
-
var TopNav = /* @__PURE__ */ Object.assign(
|
|
2955
|
+
var TopNav = /* @__PURE__ */ Object.assign(Root21, {
|
|
2954
2956
|
Left,
|
|
2955
2957
|
Center,
|
|
2956
2958
|
Right,
|
|
@@ -3064,16 +3066,19 @@ var Description6 = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
3064
3066
|
}
|
|
3065
3067
|
));
|
|
3066
3068
|
Description6.displayName = "Sheet.Description";
|
|
3067
|
-
var
|
|
3068
|
-
|
|
3069
|
-
Sheet
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3069
|
+
var Root23 = (props) => /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...props });
|
|
3070
|
+
Root23.displayName = "Sheet";
|
|
3071
|
+
var Sheet = /* @__PURE__ */ Object.assign(Root23, {
|
|
3072
|
+
Trigger: DialogPrimitive.Trigger,
|
|
3073
|
+
Close: DialogPrimitive.Close,
|
|
3074
|
+
Content: Content10,
|
|
3075
|
+
Overlay: Overlay4,
|
|
3076
|
+
Header: Header4,
|
|
3077
|
+
Body: Body3,
|
|
3078
|
+
Footer: Footer4,
|
|
3079
|
+
Title: Title6,
|
|
3080
|
+
Description: Description6
|
|
3081
|
+
});
|
|
3077
3082
|
var INTENT_FILL = {
|
|
3078
3083
|
default: "bg-primary",
|
|
3079
3084
|
success: "bg-success",
|
|
@@ -3246,7 +3251,7 @@ var alignClass = {
|
|
|
3246
3251
|
center: "text-center",
|
|
3247
3252
|
right: "text-right"
|
|
3248
3253
|
};
|
|
3249
|
-
var
|
|
3254
|
+
var Root24 = forwardRef(
|
|
3250
3255
|
({ className, density = "default", children, ...props }, ref) => /* @__PURE__ */ jsx(TableDensityContext.Provider, { value: density, children: /* @__PURE__ */ jsx(
|
|
3251
3256
|
"table",
|
|
3252
3257
|
{
|
|
@@ -3258,7 +3263,7 @@ var Root22 = forwardRef(
|
|
|
3258
3263
|
}
|
|
3259
3264
|
) })
|
|
3260
3265
|
);
|
|
3261
|
-
|
|
3266
|
+
Root24.displayName = "Table";
|
|
3262
3267
|
var Header5 = forwardRef(
|
|
3263
3268
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3264
3269
|
"thead",
|
|
@@ -3378,7 +3383,7 @@ var HeaderCell = forwardRef(
|
|
|
3378
3383
|
}
|
|
3379
3384
|
);
|
|
3380
3385
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
3381
|
-
var Table = Object.assign(
|
|
3386
|
+
var Table = Object.assign(Root24, { Header: Header5, Body: Body4, Row, Cell, HeaderCell });
|
|
3382
3387
|
|
|
3383
3388
|
// src/lib/env.ts
|
|
3384
3389
|
function readNodeEnv() {
|
|
@@ -3659,7 +3664,7 @@ var StatTile = forwardRef(
|
|
|
3659
3664
|
}
|
|
3660
3665
|
);
|
|
3661
3666
|
StatTile.displayName = "StatTile";
|
|
3662
|
-
var
|
|
3667
|
+
var Root25 = forwardRef(
|
|
3663
3668
|
({ className, title = "Danger Zone", children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3664
3669
|
"section",
|
|
3665
3670
|
{
|
|
@@ -3675,7 +3680,7 @@ var Root23 = forwardRef(
|
|
|
3675
3680
|
}
|
|
3676
3681
|
)
|
|
3677
3682
|
);
|
|
3678
|
-
|
|
3683
|
+
Root25.displayName = "DangerZone";
|
|
3679
3684
|
var Action2 = forwardRef(
|
|
3680
3685
|
({ className, title, description, action, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3681
3686
|
"div",
|
|
@@ -3698,7 +3703,7 @@ var Action2 = forwardRef(
|
|
|
3698
3703
|
)
|
|
3699
3704
|
);
|
|
3700
3705
|
Action2.displayName = "DangerZone.Action";
|
|
3701
|
-
var DangerZone = Object.assign(
|
|
3706
|
+
var DangerZone = Object.assign(Root25, { Action: Action2 });
|
|
3702
3707
|
var ConfirmDialog = forwardRef(
|
|
3703
3708
|
({
|
|
3704
3709
|
open,
|
|
@@ -5090,9 +5095,17 @@ function niceMax(values) {
|
|
|
5090
5095
|
return Number((Math.ceil(m / pow) * pow).toPrecision(12));
|
|
5091
5096
|
}
|
|
5092
5097
|
function seriesPath(points, xScale, yScale) {
|
|
5093
|
-
const
|
|
5094
|
-
|
|
5095
|
-
|
|
5098
|
+
const out = [];
|
|
5099
|
+
let emTrecho = false;
|
|
5100
|
+
for (const p of points) {
|
|
5101
|
+
if (!Number.isFinite(p.y)) {
|
|
5102
|
+
emTrecho = false;
|
|
5103
|
+
continue;
|
|
5104
|
+
}
|
|
5105
|
+
out.push(`${emTrecho ? "L" : "M"}${xScale(p.x).toFixed(2)},${yScale(p.y).toFixed(2)}`);
|
|
5106
|
+
emTrecho = true;
|
|
5107
|
+
}
|
|
5108
|
+
return out.join(" ");
|
|
5096
5109
|
}
|
|
5097
5110
|
var VIEW_W = 600;
|
|
5098
5111
|
var PAD = { top: 8, right: 8, bottom: 4, left: 40 };
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usetheo/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"packageManager": "pnpm@10.32.1+sha512.a706938f0e89ac1456b6563eab4edf1d1faf3368d1191fc5c59790e96dc918e4456ab2e67d613de1043d2e8c81f87303e6b40d4ffeca9df15ef1ad567348f2be",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"description": "Violet Forge design system
|
|
7
|
+
"description": "Violet Forge design system \u2014 generic React components + primitives (the non-AI foundation of @theokit/ui).",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|