@orangecheck/app-design 1.5.0 → 1.6.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/components.d.mts +60 -2
- package/dist/components.d.ts +60 -2
- package/dist/components.js +386 -15
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +378 -16
- package/dist/components.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +392 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +386 -39
- package/dist/index.mjs.map +1 -1
- package/dist/mdx.js.map +1 -1
- package/dist/mdx.mjs.map +1 -1
- package/dist/styles/chart.css +76 -0
- package/dist/styles/theme.css +7 -0
- package/dist/styles/tokens.css +18 -0
- package/dist/styles.css +1 -0
- package/dist/tokens.d.mts +314 -21
- package/dist/tokens.d.ts +314 -21
- package/dist/tokens.js +166 -26
- package/dist/tokens.js.map +1 -1
- package/dist/tokens.mjs +165 -27
- package/dist/tokens.mjs.map +1 -1
- package/package.json +2 -2
package/dist/components.js
CHANGED
|
@@ -12,13 +12,16 @@ var SeparatorPrimitive = require('@radix-ui/react-separator');
|
|
|
12
12
|
require('next-themes');
|
|
13
13
|
require('sonner');
|
|
14
14
|
var Link = require('next/link');
|
|
15
|
+
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
16
|
+
var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
|
17
|
+
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
18
|
+
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
15
19
|
var router = require('next/compat/router');
|
|
16
20
|
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
17
21
|
var LabelPrimitive = require('@radix-ui/react-label');
|
|
18
22
|
var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
|
19
23
|
var SelectPrimitive = require('@radix-ui/react-select');
|
|
20
24
|
var SwitchPrimitive = require('@radix-ui/react-switch');
|
|
21
|
-
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
22
25
|
|
|
23
26
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
27
|
|
|
@@ -43,12 +46,15 @@ function _interopNamespace(e) {
|
|
|
43
46
|
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
44
47
|
var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
|
|
45
48
|
var Link__default = /*#__PURE__*/_interopDefault(Link);
|
|
49
|
+
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
50
|
+
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
51
|
+
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
52
|
+
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
|
|
46
53
|
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
47
54
|
var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
|
|
48
55
|
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
49
56
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
50
57
|
var SwitchPrimitive__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitive);
|
|
51
|
-
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
52
58
|
|
|
53
59
|
var merge = tailwindMerge.extendTailwindMerge({
|
|
54
60
|
extend: {
|
|
@@ -564,7 +570,7 @@ var JS_TAG = /<\/?(?=[A-Za-z])/y;
|
|
|
564
570
|
var JS_TAG_NAME = /[A-Za-z][\w$.:-]*/y;
|
|
565
571
|
var JS_PUNCT = /=>|\.\.\.|[{}()[\];,.<>=+\-*/%!?:&|^~#]/y;
|
|
566
572
|
var JSX_BEFORE = /* @__PURE__ */ new Set(["(", ",", "=", "?", ":", "{", "[", ";", ">", "&&", "||", "=>", "return"]);
|
|
567
|
-
function scanJs(src, emit,
|
|
573
|
+
function scanJs(src, emit, jsx38) {
|
|
568
574
|
let i = 0;
|
|
569
575
|
let prev = "";
|
|
570
576
|
let tagDepth = 0;
|
|
@@ -590,7 +596,7 @@ function scanJs(src, emit, jsx36) {
|
|
|
590
596
|
sig('"');
|
|
591
597
|
continue;
|
|
592
598
|
}
|
|
593
|
-
if (
|
|
599
|
+
if (jsx38 && tagDepth === 0 && (m = at(JS_TAG, src, i)) && (prev === "" || JSX_BEFORE.has(prev))) {
|
|
594
600
|
const name = at(JS_TAG_NAME, src, i + m.length);
|
|
595
601
|
if (name) {
|
|
596
602
|
emit(m);
|
|
@@ -602,7 +608,7 @@ function scanJs(src, emit, jsx36) {
|
|
|
602
608
|
continue;
|
|
603
609
|
}
|
|
604
610
|
}
|
|
605
|
-
if (
|
|
611
|
+
if (jsx38 && tagDepth > 0 && braceInTag === 0) {
|
|
606
612
|
if (src.startsWith("/>", i) || src[i] === ">") {
|
|
607
613
|
const close = src[i] === ">" ? ">" : "/>";
|
|
608
614
|
emit(close);
|
|
@@ -622,7 +628,7 @@ function scanJs(src, emit, jsx36) {
|
|
|
622
628
|
continue;
|
|
623
629
|
}
|
|
624
630
|
if (src[i] === "{") braceInTag = 1;
|
|
625
|
-
} else if (
|
|
631
|
+
} else if (jsx38 && tagDepth > 0 && braceInTag > 0) {
|
|
626
632
|
if (src[i] === "{") braceInTag++;
|
|
627
633
|
else if (src[i] === "}") braceInTag--;
|
|
628
634
|
}
|
|
@@ -1207,7 +1213,22 @@ function PageHeader({
|
|
|
1207
1213
|
] });
|
|
1208
1214
|
}
|
|
1209
1215
|
var InStatGrid = react.createContext(false);
|
|
1210
|
-
function
|
|
1216
|
+
function Delta({ value, suffix = "", good = "up", label }) {
|
|
1217
|
+
const dir = value > 0 ? "up" : value < 0 ? "down" : "flat";
|
|
1218
|
+
const tone = dir === "flat" ? "text-muted-foreground" : dir === good ? "text-success" : "text-destructive";
|
|
1219
|
+
const sign = value > 0 ? "+" : value < 0 ? "\u2212" : "";
|
|
1220
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("inline-flex items-baseline gap-1 text-[0.8125rem] font-normal tracking-normal oca-tabular", tone), children: [
|
|
1221
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: dir === "up" ? "\u2191" : dir === "down" ? "\u2193" : "\xB7" }),
|
|
1222
|
+
sign,
|
|
1223
|
+
Math.abs(value).toLocaleString("en-US", { maximumFractionDigits: 2 }),
|
|
1224
|
+
suffix,
|
|
1225
|
+
label ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
|
|
1226
|
+
" ",
|
|
1227
|
+
label
|
|
1228
|
+
] }) : null
|
|
1229
|
+
] });
|
|
1230
|
+
}
|
|
1231
|
+
function StatCard({ label, value, hint, size, delta, className }) {
|
|
1211
1232
|
const inGrid = react.useContext(InStatGrid);
|
|
1212
1233
|
const density = useDensity();
|
|
1213
1234
|
const sm = (size ?? (density === "compact" ? "sm" : "md")) === "sm";
|
|
@@ -1225,15 +1246,19 @@ function StatCard({ label, value, hint, size, className }) {
|
|
|
1225
1246
|
),
|
|
1226
1247
|
children: [
|
|
1227
1248
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("leading-snug text-muted-foreground", sm ? "text-[0.8125rem]" : "text-[0.875rem]"), children: label }),
|
|
1228
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1249
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1229
1250
|
"span",
|
|
1230
1251
|
{
|
|
1231
1252
|
className: cn(
|
|
1232
1253
|
"break-words oca-tabular leading-tight tracking-[-0.02em]",
|
|
1233
1254
|
sm ? "text-[1.25rem]" : "text-[1.5rem] md:text-[1.75rem]",
|
|
1234
|
-
inGrid && "self-end"
|
|
1255
|
+
inGrid && "self-end",
|
|
1256
|
+
delta && "flex flex-wrap items-baseline gap-x-2"
|
|
1235
1257
|
),
|
|
1236
|
-
children:
|
|
1258
|
+
children: [
|
|
1259
|
+
value,
|
|
1260
|
+
delta ? /* @__PURE__ */ jsxRuntime.jsx(Delta, { ...delta }) : null
|
|
1261
|
+
]
|
|
1237
1262
|
}
|
|
1238
1263
|
),
|
|
1239
1264
|
hint ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.8125rem] leading-snug text-muted-foreground", children: hint }) : inGrid ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true }) : null
|
|
@@ -1322,6 +1347,13 @@ function StatGrid({ columns, empty, isEmpty, className, children, ...props }) {
|
|
|
1322
1347
|
}
|
|
1323
1348
|
) });
|
|
1324
1349
|
}
|
|
1350
|
+
var TONE_TEXT = {
|
|
1351
|
+
good: "text-success",
|
|
1352
|
+
caution: "text-warning",
|
|
1353
|
+
bad: "text-destructive",
|
|
1354
|
+
brand: "text-oca-accent-ink",
|
|
1355
|
+
muted: "text-muted-foreground"
|
|
1356
|
+
};
|
|
1325
1357
|
function KeyValueList({
|
|
1326
1358
|
items,
|
|
1327
1359
|
dense,
|
|
@@ -1340,15 +1372,19 @@ function KeyValueList({
|
|
|
1340
1372
|
),
|
|
1341
1373
|
children: [
|
|
1342
1374
|
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: cn("shrink-0 text-muted-foreground", tight ? "text-[0.8125rem] @md:w-36" : "text-[0.875rem] @md:w-48"), children: it.label }),
|
|
1343
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1375
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1344
1376
|
"dd",
|
|
1345
1377
|
{
|
|
1346
1378
|
className: cn(
|
|
1347
1379
|
"min-w-0 break-words",
|
|
1348
1380
|
tight ? "text-[0.875rem]" : "text-[0.9375rem]",
|
|
1349
|
-
it.mono && (tight ? "font-mono text-[0.8125rem]" : "font-mono text-[0.875rem]")
|
|
1381
|
+
it.mono && (tight ? "font-mono text-[0.8125rem]" : "font-mono text-[0.875rem]"),
|
|
1382
|
+
it.tone && !it.note && TONE_TEXT[it.tone]
|
|
1350
1383
|
),
|
|
1351
|
-
children:
|
|
1384
|
+
children: [
|
|
1385
|
+
it.value,
|
|
1386
|
+
it.note ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("ml-2 font-sans text-[0.8125rem]", TONE_TEXT[it.tone ?? "muted"]), children: it.note }) : null
|
|
1387
|
+
]
|
|
1352
1388
|
}
|
|
1353
1389
|
)
|
|
1354
1390
|
]
|
|
@@ -2631,6 +2667,335 @@ function LockedPreview({
|
|
|
2631
2667
|
] })
|
|
2632
2668
|
] });
|
|
2633
2669
|
}
|
|
2670
|
+
var Dialog = DialogPrimitive__namespace.Root;
|
|
2671
|
+
var overlayClass = "oca-animate-fade fixed inset-0 z-50 bg-[rgb(10_10_10/0.38)] backdrop-blur-[2px] data-[state=closed]:opacity-0";
|
|
2672
|
+
var DialogContent = react.forwardRef(function DialogContent2({ className, children, hideClose, ...props }, ref) {
|
|
2673
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
|
|
2674
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, { className: overlayClass }),
|
|
2675
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2676
|
+
DialogPrimitive__namespace.Content,
|
|
2677
|
+
{
|
|
2678
|
+
ref,
|
|
2679
|
+
className: cn(
|
|
2680
|
+
"oca-animate-rise fixed left-1/2 top-1/2 z-50 w-[min(92vw,34rem)] -translate-x-1/2 -translate-y-1/2",
|
|
2681
|
+
"max-h-[88vh] overflow-y-auto rounded-[1.5rem] border border-border bg-popover p-6 text-popover-foreground shadow-xl md:p-8",
|
|
2682
|
+
"outline-none",
|
|
2683
|
+
className
|
|
2684
|
+
),
|
|
2685
|
+
...props,
|
|
2686
|
+
children: [
|
|
2687
|
+
children,
|
|
2688
|
+
hideClose ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2689
|
+
DialogPrimitive__namespace.Close,
|
|
2690
|
+
{
|
|
2691
|
+
className: "absolute right-4 top-4 inline-flex size-9 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
2692
|
+
"aria-label": "Close",
|
|
2693
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-4" })
|
|
2694
|
+
}
|
|
2695
|
+
)
|
|
2696
|
+
]
|
|
2697
|
+
}
|
|
2698
|
+
)
|
|
2699
|
+
] });
|
|
2700
|
+
});
|
|
2701
|
+
var DialogTitle = react.forwardRef(function DialogTitle2({ className, ...props }, ref) {
|
|
2702
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2703
|
+
DialogPrimitive__namespace.Title,
|
|
2704
|
+
{
|
|
2705
|
+
ref,
|
|
2706
|
+
className: cn("text-[1.5rem] font-normal leading-tight tracking-[-0.02em]", className),
|
|
2707
|
+
...props
|
|
2708
|
+
}
|
|
2709
|
+
);
|
|
2710
|
+
});
|
|
2711
|
+
var DialogDescription = react.forwardRef(function DialogDescription2({ className, ...props }, ref) {
|
|
2712
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Description, { ref, className: cn("oca-body", className), ...props });
|
|
2713
|
+
});
|
|
2714
|
+
var sheetSide = {
|
|
2715
|
+
right: "inset-y-0 right-0 h-full w-[min(88vw,24rem)] border-l",
|
|
2716
|
+
left: "inset-y-0 left-0 h-full w-[min(88vw,24rem)] border-r",
|
|
2717
|
+
bottom: "inset-x-0 bottom-0 max-h-[88vh] rounded-t-[1.5rem] border-t"
|
|
2718
|
+
};
|
|
2719
|
+
react.forwardRef(function SheetContent2({ className, children, side = "right", ...props }, ref) {
|
|
2720
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
|
|
2721
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, { className: overlayClass }),
|
|
2722
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2723
|
+
DialogPrimitive__namespace.Content,
|
|
2724
|
+
{
|
|
2725
|
+
ref,
|
|
2726
|
+
className: cn(
|
|
2727
|
+
"oca-animate-fade fixed z-50 flex flex-col gap-4 overflow-y-auto border-border bg-popover p-6 text-popover-foreground shadow-xl outline-none",
|
|
2728
|
+
sheetSide[side],
|
|
2729
|
+
className
|
|
2730
|
+
),
|
|
2731
|
+
...props,
|
|
2732
|
+
children: [
|
|
2733
|
+
children,
|
|
2734
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2735
|
+
DialogPrimitive__namespace.Close,
|
|
2736
|
+
{
|
|
2737
|
+
className: "absolute right-4 top-4 inline-flex size-9 items-center justify-center rounded-full text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
2738
|
+
"aria-label": "Close",
|
|
2739
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-4" })
|
|
2740
|
+
}
|
|
2741
|
+
)
|
|
2742
|
+
]
|
|
2743
|
+
}
|
|
2744
|
+
)
|
|
2745
|
+
] });
|
|
2746
|
+
});
|
|
2747
|
+
var Popover = PopoverPrimitive__namespace.Root;
|
|
2748
|
+
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
2749
|
+
var PopoverContent = react.forwardRef(function PopoverContent2({ className, align = "center", sideOffset = 8, ...props }, ref) {
|
|
2750
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2751
|
+
PopoverPrimitive__namespace.Content,
|
|
2752
|
+
{
|
|
2753
|
+
ref,
|
|
2754
|
+
align,
|
|
2755
|
+
sideOffset,
|
|
2756
|
+
className: cn(
|
|
2757
|
+
"oca-animate-fade z-50 w-72 rounded-2xl border border-border bg-popover p-4 text-popover-foreground shadow-lg outline-none",
|
|
2758
|
+
className
|
|
2759
|
+
),
|
|
2760
|
+
...props
|
|
2761
|
+
}
|
|
2762
|
+
) });
|
|
2763
|
+
});
|
|
2764
|
+
react.forwardRef(function TooltipContent2({ className, sideOffset = 6, ...props }, ref) {
|
|
2765
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2766
|
+
TooltipPrimitive__namespace.Content,
|
|
2767
|
+
{
|
|
2768
|
+
ref,
|
|
2769
|
+
sideOffset,
|
|
2770
|
+
className: cn(
|
|
2771
|
+
"oca-animate-fade z-50 max-w-xs rounded-lg bg-oca-ink px-2.5 py-1.5 text-[0.8125rem] leading-snug text-oca-ink-foreground",
|
|
2772
|
+
className
|
|
2773
|
+
),
|
|
2774
|
+
...props
|
|
2775
|
+
}
|
|
2776
|
+
) });
|
|
2777
|
+
});
|
|
2778
|
+
react.forwardRef(function DropdownMenuContent2({ className, sideOffset = 8, ...props }, ref) {
|
|
2779
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2780
|
+
DropdownMenuPrimitive__namespace.Content,
|
|
2781
|
+
{
|
|
2782
|
+
ref,
|
|
2783
|
+
sideOffset,
|
|
2784
|
+
className: cn(
|
|
2785
|
+
"oca-animate-fade z-50 min-w-56 overflow-hidden rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-lg",
|
|
2786
|
+
className
|
|
2787
|
+
),
|
|
2788
|
+
...props
|
|
2789
|
+
}
|
|
2790
|
+
) });
|
|
2791
|
+
});
|
|
2792
|
+
react.forwardRef(function DropdownMenuItem2({ className, destructive, ...props }, ref) {
|
|
2793
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2794
|
+
DropdownMenuPrimitive__namespace.Item,
|
|
2795
|
+
{
|
|
2796
|
+
ref,
|
|
2797
|
+
className: cn(
|
|
2798
|
+
"flex h-10 cursor-default select-none items-center gap-2.5 rounded-xl px-3 text-[0.9375rem] outline-none",
|
|
2799
|
+
"data-[highlighted]:bg-accent data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:text-muted-foreground",
|
|
2800
|
+
destructive && "text-destructive [&_svg]:text-destructive",
|
|
2801
|
+
className
|
|
2802
|
+
),
|
|
2803
|
+
...props
|
|
2804
|
+
}
|
|
2805
|
+
);
|
|
2806
|
+
});
|
|
2807
|
+
react.forwardRef(function DropdownMenuLabel2({ className, ...props }, ref) {
|
|
2808
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2809
|
+
DropdownMenuPrimitive__namespace.Label,
|
|
2810
|
+
{
|
|
2811
|
+
ref,
|
|
2812
|
+
className: cn("px-3 pb-1.5 pt-2 text-[0.8125rem] text-muted-foreground", className),
|
|
2813
|
+
...props
|
|
2814
|
+
}
|
|
2815
|
+
);
|
|
2816
|
+
});
|
|
2817
|
+
react.forwardRef(function DropdownMenuSeparator2({ className, ...props }, ref) {
|
|
2818
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Separator, { ref, className: cn("my-1.5 h-px bg-border", className), ...props });
|
|
2819
|
+
});
|
|
2820
|
+
function chartColor(series) {
|
|
2821
|
+
if (typeof series === "string") return `var(--oca-chart-${series})`;
|
|
2822
|
+
const n = series >= 1 && series <= 4 && Number.isInteger(series) ? series : (series % 4 + 4) % 4 + 1;
|
|
2823
|
+
return `var(--oca-chart-${n})`;
|
|
2824
|
+
}
|
|
2825
|
+
function ChartFrame({
|
|
2826
|
+
legend,
|
|
2827
|
+
caption,
|
|
2828
|
+
children,
|
|
2829
|
+
className
|
|
2830
|
+
}) {
|
|
2831
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: cn("oca-chart flex min-w-0 flex-col gap-3", className), children: [
|
|
2832
|
+
legend && legend.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "oca-chart-legend", "aria-label": "Legend", children: legend.map((l, i) => {
|
|
2833
|
+
const c = typeof l.color === "number" || ["neutral", "up", "down"].includes(String(l.color)) ? chartColor(l.color) : String(l.color);
|
|
2834
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
|
|
2835
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, "data-swatch": l.dashed ? "dashed" : "", style: { "--swatch": c } }),
|
|
2836
|
+
l.label
|
|
2837
|
+
] }, i);
|
|
2838
|
+
}) }) : null,
|
|
2839
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative min-w-0", children }),
|
|
2840
|
+
caption ? /* @__PURE__ */ jsxRuntime.jsx("figcaption", { className: "text-[0.8125rem] leading-snug text-muted-foreground", children: caption }) : null
|
|
2841
|
+
] });
|
|
2842
|
+
}
|
|
2843
|
+
function Sparkline({
|
|
2844
|
+
values,
|
|
2845
|
+
label,
|
|
2846
|
+
tone = "ink",
|
|
2847
|
+
area = false,
|
|
2848
|
+
width = 96,
|
|
2849
|
+
height = 24,
|
|
2850
|
+
className
|
|
2851
|
+
}) {
|
|
2852
|
+
const gradient = react.useId().replace(/[^a-zA-Z0-9]/g, "");
|
|
2853
|
+
const pts = values.filter((v) => Number.isFinite(v));
|
|
2854
|
+
const lo = Math.min(...pts);
|
|
2855
|
+
const hi = Math.max(...pts);
|
|
2856
|
+
const span = hi - lo || 1;
|
|
2857
|
+
const pad3 = 1.5;
|
|
2858
|
+
const x = (i) => pts.length < 2 ? width / 2 : i / (pts.length - 1) * width;
|
|
2859
|
+
const y = (v) => pad3 + (1 - (v - lo) / span) * (height - pad3 * 2);
|
|
2860
|
+
const line = pts.map((v, i) => `${i === 0 ? "M" : "L"}${x(i).toFixed(2)},${y(v).toFixed(2)}`).join(" ");
|
|
2861
|
+
const color = tone === "ink" ? "var(--foreground)" : tone === "muted" ? "var(--muted-foreground)" : tone === "trend" ? chartColor(pts.length > 1 && pts[pts.length - 1] < pts[0] ? "down" : "up") : chartColor(tone);
|
|
2862
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2863
|
+
"svg",
|
|
2864
|
+
{
|
|
2865
|
+
role: "img",
|
|
2866
|
+
"aria-label": label,
|
|
2867
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
2868
|
+
preserveAspectRatio: "none",
|
|
2869
|
+
width,
|
|
2870
|
+
height,
|
|
2871
|
+
className: cn("block overflow-visible", className),
|
|
2872
|
+
style: { color },
|
|
2873
|
+
children: pts.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2874
|
+
area ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2875
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradient, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2876
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0", stopColor: "currentColor", stopOpacity: 0.22 }),
|
|
2877
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "1", stopColor: "currentColor", stopOpacity: 0 })
|
|
2878
|
+
] }) }),
|
|
2879
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: `${line} L${x(pts.length - 1).toFixed(2)},${height} L${x(0).toFixed(2)},${height} Z`, fill: `url(#${gradient})` })
|
|
2880
|
+
] }) : null,
|
|
2881
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: line, fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinejoin: "round", strokeLinecap: "round", vectorEffect: "non-scaling-stroke" })
|
|
2882
|
+
] }) : null
|
|
2883
|
+
}
|
|
2884
|
+
);
|
|
2885
|
+
}
|
|
2886
|
+
function SourceNote({ source, href, detail, updated, variant = "popover", className }) {
|
|
2887
|
+
const name = href ? /* @__PURE__ */ jsxRuntime.jsxs("a", { href, className: "text-foreground underline decoration-foreground/35 underline-offset-4 hover:decoration-foreground", rel: "noreferrer", target: "_blank", children: [
|
|
2888
|
+
source,
|
|
2889
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: " (opens in a new tab)" })
|
|
2890
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground", children: source });
|
|
2891
|
+
if (variant === "line") {
|
|
2892
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn("text-[0.75rem] leading-snug text-muted-foreground", className), children: [
|
|
2893
|
+
"Source: ",
|
|
2894
|
+
name,
|
|
2895
|
+
updated ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2896
|
+
" \xB7 ",
|
|
2897
|
+
updated
|
|
2898
|
+
] }) : null
|
|
2899
|
+
] });
|
|
2900
|
+
}
|
|
2901
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
2902
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2903
|
+
PopoverTrigger,
|
|
2904
|
+
{
|
|
2905
|
+
className: cn(
|
|
2906
|
+
"inline-flex h-7 items-center gap-1 rounded-full px-2 text-[0.75rem] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
2907
|
+
className
|
|
2908
|
+
),
|
|
2909
|
+
children: [
|
|
2910
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Info, { "aria-hidden": true, className: "size-3.5" }),
|
|
2911
|
+
"Source"
|
|
2912
|
+
]
|
|
2913
|
+
}
|
|
2914
|
+
),
|
|
2915
|
+
/* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { align: "start", className: "flex w-[min(calc(100vw-2rem),20rem)] flex-col gap-2 p-4 text-[0.875rem]", children: [
|
|
2916
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[0.75rem] text-muted-foreground", children: "Where this number comes from" }),
|
|
2917
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium", children: name }),
|
|
2918
|
+
detail ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[0.8125rem] leading-snug text-muted-foreground [&_code]:font-mono", children: detail }) : null,
|
|
2919
|
+
updated ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[0.8125rem] text-muted-foreground", children: updated }) : null
|
|
2920
|
+
] })
|
|
2921
|
+
] });
|
|
2922
|
+
}
|
|
2923
|
+
function Panel({
|
|
2924
|
+
title,
|
|
2925
|
+
description,
|
|
2926
|
+
actions,
|
|
2927
|
+
source,
|
|
2928
|
+
expandable = false,
|
|
2929
|
+
children,
|
|
2930
|
+
className
|
|
2931
|
+
}) {
|
|
2932
|
+
const [open, setOpen] = react.useState(false);
|
|
2933
|
+
const body = (expanded) => typeof children === "function" ? children(expanded) : children;
|
|
2934
|
+
const head = (expanded) => /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "flex flex-wrap items-start justify-between gap-x-4 gap-y-2", children: [
|
|
2935
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2936
|
+
expanded ? /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "text-[1.0625rem] font-medium leading-snug", children: title }) : /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[1rem] font-medium leading-snug", children: title }),
|
|
2937
|
+
description ? expanded ? /* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { className: "text-[0.875rem] leading-snug text-muted-foreground", children: description }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[0.875rem] leading-snug text-muted-foreground", children: description }) : null
|
|
2938
|
+
] }),
|
|
2939
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
2940
|
+
actions,
|
|
2941
|
+
expandable && !expanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2942
|
+
"button",
|
|
2943
|
+
{
|
|
2944
|
+
type: "button",
|
|
2945
|
+
onClick: () => setOpen(true),
|
|
2946
|
+
"aria-label": "Open full screen",
|
|
2947
|
+
className: "inline-flex size-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
2948
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, { "aria-hidden": true, className: "size-4" })
|
|
2949
|
+
}
|
|
2950
|
+
) : null
|
|
2951
|
+
] })
|
|
2952
|
+
] });
|
|
2953
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: cn("flex min-w-0 flex-col gap-4 rounded-[1.25rem] border border-border bg-card p-5 md:p-6", className), children: [
|
|
2954
|
+
head(false),
|
|
2955
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: body(false) }),
|
|
2956
|
+
source ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "-mb-1 border-t border-border pt-3", children: source }) : null,
|
|
2957
|
+
expandable ? /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2958
|
+
DialogContent,
|
|
2959
|
+
{
|
|
2960
|
+
...description ? {} : { "aria-describedby": void 0 },
|
|
2961
|
+
className: "flex h-[min(92dvh,56rem)] w-[min(96vw,80rem)] max-w-none flex-col gap-4 overflow-y-auto",
|
|
2962
|
+
children: [
|
|
2963
|
+
head(true),
|
|
2964
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 min-w-0 flex-1", children: open ? body(true) : null }),
|
|
2965
|
+
source ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border pt-3", children: source }) : null
|
|
2966
|
+
]
|
|
2967
|
+
}
|
|
2968
|
+
) }) : null
|
|
2969
|
+
] });
|
|
2970
|
+
}
|
|
2971
|
+
function HudCard({
|
|
2972
|
+
eyebrow,
|
|
2973
|
+
live = false,
|
|
2974
|
+
title,
|
|
2975
|
+
children,
|
|
2976
|
+
footer,
|
|
2977
|
+
className
|
|
2978
|
+
}) {
|
|
2979
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2980
|
+
"div",
|
|
2981
|
+
{
|
|
2982
|
+
"data-oca-hud": "",
|
|
2983
|
+
className: cn(
|
|
2984
|
+
"flex w-60 max-w-[calc(100vw-2rem)] flex-col gap-2 rounded-xl border border-border bg-background/85 p-3 text-[0.8125rem] shadow-sm backdrop-blur-md",
|
|
2985
|
+
className
|
|
2986
|
+
),
|
|
2987
|
+
children: [
|
|
2988
|
+
eyebrow ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex items-center gap-1.5 text-[0.75rem] text-muted-foreground", children: [
|
|
2989
|
+
live ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "size-1.5 rounded-full bg-oca-orange-deep motion-safe:animate-pulse" }) : null,
|
|
2990
|
+
eyebrow
|
|
2991
|
+
] }) : null,
|
|
2992
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[1.125rem] font-medium leading-tight oca-tabular", children: title }) : null,
|
|
2993
|
+
children,
|
|
2994
|
+
footer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border pt-2", children: footer }) : null
|
|
2995
|
+
]
|
|
2996
|
+
}
|
|
2997
|
+
);
|
|
2998
|
+
}
|
|
2634
2999
|
function IsoCheck({ size = 360, settle = false, shadow = true, tilt = false, title, className }) {
|
|
2635
3000
|
const ref = react.useRef(null);
|
|
2636
3001
|
react.useEffect(() => {
|
|
@@ -3119,7 +3484,7 @@ var Textarea = react.forwardRef(
|
|
|
3119
3484
|
);
|
|
3120
3485
|
}
|
|
3121
3486
|
);
|
|
3122
|
-
var
|
|
3487
|
+
var Label2 = react.forwardRef(function Label3({ className, ...props }, ref) {
|
|
3123
3488
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3124
3489
|
LabelPrimitive__namespace.Root,
|
|
3125
3490
|
{
|
|
@@ -3142,7 +3507,7 @@ function Field({ label, hint, optional, error, children, id: fixedId, className,
|
|
|
3142
3507
|
const control = typeof children === "function" ? children(wiring) : react.isValidElement(children) ? react.cloneElement(children, { ...wiring }) : children;
|
|
3143
3508
|
const hintNode = hint ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: hintId, className: "text-[0.8125rem] leading-snug text-muted-foreground", children: hint }) : null;
|
|
3144
3509
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
3145
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3510
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Label2, { htmlFor: id, className: hideLabel ? "sr-only" : "flex items-baseline gap-2", children: [
|
|
3146
3511
|
label,
|
|
3147
3512
|
optional ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.8125rem] font-normal text-muted-foreground", children: "Optional" }) : null
|
|
3148
3513
|
] }),
|
|
@@ -4903,6 +5268,7 @@ exports.Breadcrumbs = Breadcrumbs;
|
|
|
4903
5268
|
exports.BrowserFrame = BrowserFrame;
|
|
4904
5269
|
exports.Callout = Callout;
|
|
4905
5270
|
exports.CardGrid = CardGrid;
|
|
5271
|
+
exports.ChartFrame = ChartFrame;
|
|
4906
5272
|
exports.Closing = Closing;
|
|
4907
5273
|
exports.CodeBlock = CodeBlock;
|
|
4908
5274
|
exports.CodeTabs = CodeTabs;
|
|
@@ -4933,6 +5299,7 @@ exports.FloatChip = FloatChip;
|
|
|
4933
5299
|
exports.Footnote = Footnote;
|
|
4934
5300
|
exports.FormSection = FormSection;
|
|
4935
5301
|
exports.HashChip = HashChip;
|
|
5302
|
+
exports.HudCard = HudCard;
|
|
4936
5303
|
exports.InstallTabs = InstallTabs;
|
|
4937
5304
|
exports.KeyValueList = KeyValueList;
|
|
4938
5305
|
exports.Lead = Lead;
|
|
@@ -4948,6 +5315,7 @@ exports.OnThisPage = OnThisPage;
|
|
|
4948
5315
|
exports.PackageCard = PackageCard;
|
|
4949
5316
|
exports.PageHeader = PageHeader;
|
|
4950
5317
|
exports.PageHero = PageHero;
|
|
5318
|
+
exports.Panel = Panel;
|
|
4951
5319
|
exports.PhoneFrame = PhoneFrame;
|
|
4952
5320
|
exports.PlanCard = PlanCard;
|
|
4953
5321
|
exports.ProgressSteps = ProgressSteps;
|
|
@@ -4966,6 +5334,8 @@ exports.Section = Section;
|
|
|
4966
5334
|
exports.SectionHeading = SectionHeading;
|
|
4967
5335
|
exports.SectionIntro = SectionIntro;
|
|
4968
5336
|
exports.SignMessage = SignMessage;
|
|
5337
|
+
exports.SourceNote = SourceNote;
|
|
5338
|
+
exports.Sparkline = Sparkline;
|
|
4969
5339
|
exports.SpecCard = SpecCard;
|
|
4970
5340
|
exports.SplitBar = SplitBar;
|
|
4971
5341
|
exports.StatCard = StatCard;
|
|
@@ -4981,6 +5351,7 @@ exports.TruthTable = TruthTable;
|
|
|
4981
5351
|
exports.UsdApprox = UsdApprox;
|
|
4982
5352
|
exports.VerifyBox = VerifyBox;
|
|
4983
5353
|
exports.VerifyReport = VerifyReport;
|
|
5354
|
+
exports.chartColor = chartColor;
|
|
4984
5355
|
exports.createStateBadge = createStateBadge;
|
|
4985
5356
|
exports.languageName = languageName;
|
|
4986
5357
|
exports.monogramGround = monogramGround;
|