@acronis-platform/ui-react 0.46.0 → 0.50.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/ui/alert/alert.js +99 -0
- package/dist/components/ui/alert/alert.js.map +1 -0
- package/dist/components/ui/chart/chart.js +213 -0
- package/dist/components/ui/chart/chart.js.map +1 -0
- package/dist/components/ui/combobox/combobox.js +149 -0
- package/dist/components/ui/combobox/combobox.js.map +1 -0
- package/dist/components/ui/field/field.js +189 -0
- package/dist/components/ui/field/field.js.map +1 -0
- package/dist/components/ui/form/form.js +16 -0
- package/dist/components/ui/form/form.js.map +1 -0
- package/dist/components/ui/skeleton/skeleton.js +22 -0
- package/dist/components/ui/skeleton/skeleton.js.map +1 -0
- package/dist/index.js +292 -251
- package/dist/index.js.map +1 -1
- package/dist/react.js +292 -251
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/alert/alert.d.ts +14 -0
- package/dist/src/components/ui/alert/index.d.ts +2 -0
- package/dist/src/components/ui/button/button.d.ts +1 -1
- package/dist/src/components/ui/chart/chart.d.ts +55 -0
- package/dist/src/components/ui/chart/index.d.ts +2 -0
- package/dist/src/components/ui/combobox/combobox.d.ts +28 -0
- package/dist/src/components/ui/combobox/index.d.ts +2 -0
- package/dist/src/components/ui/field/field.d.ts +39 -0
- package/dist/src/components/ui/field/field.docs.d.ts +27 -0
- package/dist/src/components/ui/field/index.d.ts +2 -0
- package/dist/src/components/ui/form/form.d.ts +6 -0
- package/dist/src/components/ui/form/index.d.ts +1 -0
- package/dist/src/components/ui/sheet/sheet.d.ts +1 -1
- package/dist/src/components/ui/skeleton/index.d.ts +1 -0
- package/dist/src/components/ui/skeleton/skeleton.d.ts +4 -0
- package/dist/src/components/ui/tag/tag.d.ts +1 -1
- package/dist/src/index.d.ts +7 -0
- package/dist/ui-react.css +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import { cva as i } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { cn as o } from "../../../lib/utils.js";
|
|
5
|
+
const l = i(
|
|
6
|
+
"relative flex w-full items-start gap-3 rounded-md border p-4 text-foreground",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
info: "border-[var(--ui-background-status-strong-info)] bg-[var(--ui-background-status-info)] [&_[data-slot=alert-icon]]:text-[var(--ui-background-status-strong-info)]",
|
|
11
|
+
success: "border-[var(--ui-background-status-strong-success)] bg-[var(--ui-background-status-success)] [&_[data-slot=alert-icon]]:text-[var(--ui-background-status-strong-success)]",
|
|
12
|
+
warning: "border-[var(--ui-background-status-strong-warning)] bg-[var(--ui-background-status-warning)] [&_[data-slot=alert-icon]]:text-[var(--ui-background-status-strong-warning)]",
|
|
13
|
+
critical: "border-[var(--ui-background-status-strong-critical)] bg-[var(--ui-background-status-critical)] [&_[data-slot=alert-icon]]:text-[var(--ui-background-status-strong-critical)]",
|
|
14
|
+
destructive: "border-[var(--ui-background-status-strong-danger)] bg-[var(--ui-background-status-danger)] [&_[data-slot=alert-icon]]:text-[var(--ui-background-status-strong-danger)]",
|
|
15
|
+
ai: "border-[var(--ui-text-on-status-ai)] bg-[var(--ui-background-status-ai)] [&_[data-slot=alert-icon]]:text-[var(--ui-text-on-status-ai)]",
|
|
16
|
+
neutral: "border-[var(--ui-background-status-strong-neutral)] bg-[var(--ui-background-status-neutral)] [&_[data-slot=alert-icon]]:text-[var(--ui-background-status-strong-neutral)]"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: "info"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
), u = e.forwardRef(
|
|
24
|
+
({ className: t, variant: a, ...r }, n) => /* @__PURE__ */ s(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
ref: n,
|
|
28
|
+
role: "alert",
|
|
29
|
+
"data-slot": "alert",
|
|
30
|
+
className: o(l({ variant: a }), t),
|
|
31
|
+
...r
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
);
|
|
35
|
+
u.displayName = "Alert";
|
|
36
|
+
const c = e.forwardRef(({ className: t, ...a }, r) => (
|
|
37
|
+
// Color is set by the Alert variant (targets [data-slot=alert-icon]). The icon
|
|
38
|
+
// sits in a line-height-matched box (h-6 = leading-6) and is centered in it, so
|
|
39
|
+
// it optically aligns with the first line of the title/description.
|
|
40
|
+
/* @__PURE__ */ s(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
ref: r,
|
|
44
|
+
"data-slot": "alert-icon",
|
|
45
|
+
className: o("flex h-6 shrink-0 items-center", t),
|
|
46
|
+
...a
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
));
|
|
50
|
+
c.displayName = "AlertIcon";
|
|
51
|
+
const d = e.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ s(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
ref: r,
|
|
55
|
+
"data-slot": "alert-content",
|
|
56
|
+
className: o("flex min-w-0 flex-1 flex-col gap-0.5", t),
|
|
57
|
+
...a
|
|
58
|
+
}
|
|
59
|
+
));
|
|
60
|
+
d.displayName = "AlertContent";
|
|
61
|
+
const g = e.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ s(
|
|
62
|
+
"h5",
|
|
63
|
+
{
|
|
64
|
+
ref: r,
|
|
65
|
+
"data-slot": "alert-title",
|
|
66
|
+
className: o("mb-0 text-sm font-semibold leading-6", t),
|
|
67
|
+
...a
|
|
68
|
+
}
|
|
69
|
+
));
|
|
70
|
+
g.displayName = "AlertTitle";
|
|
71
|
+
const b = e.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ s(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
ref: r,
|
|
75
|
+
"data-slot": "alert-description",
|
|
76
|
+
className: o("text-sm font-normal leading-6", t),
|
|
77
|
+
...a
|
|
78
|
+
}
|
|
79
|
+
));
|
|
80
|
+
b.displayName = "AlertDescription";
|
|
81
|
+
const f = e.forwardRef(({ className: t, ...a }, r) => /* @__PURE__ */ s(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
ref: r,
|
|
85
|
+
"data-slot": "alert-actions",
|
|
86
|
+
className: o("flex items-center gap-2", t),
|
|
87
|
+
...a
|
|
88
|
+
}
|
|
89
|
+
));
|
|
90
|
+
f.displayName = "AlertActions";
|
|
91
|
+
export {
|
|
92
|
+
u as Alert,
|
|
93
|
+
f as AlertActions,
|
|
94
|
+
d as AlertContent,
|
|
95
|
+
b as AlertDescription,
|
|
96
|
+
c as AlertIcon,
|
|
97
|
+
g as AlertTitle
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","sources":["../../../../src/components/ui/alert/alert.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform/shadcn-uikit`'s `alert`\n// (packages/ui-legacy/src/components/ui/alert.tsx) and reconciled with the Figma\n// design (node 5337-71774): a rounded banner with a *full* border in the strong\n// status color, a pale status surface, foreground text, and only the icon tinted\n// with the status color. No Base UI primitive — semantic markup with\n// `role=\"alert\"`. Each variant maps to the `--ui-*` status tokens: the pale\n// surface (`--ui-background-status-*`) + the saturated border/icon\n// (`--ui-background-status-strong-*`). `destructive` uses the danger tokens; `ai`\n// has no `strong` surface token, so it uses its solid text token for the\n// border + icon.\nconst alertVariants = cva(\n 'relative flex w-full items-start gap-3 rounded-md border p-4 text-foreground',\n {\n variants: {\n variant: {\n info: 'border-[var(--ui-background-status-strong-info)] bg-[var(--ui-background-status-info)] [&_[data-slot=alert-icon]]:text-[var(--ui-background-status-strong-info)]',\n success:\n 'border-[var(--ui-background-status-strong-success)] bg-[var(--ui-background-status-success)] [&_[data-slot=alert-icon]]:text-[var(--ui-background-status-strong-success)]',\n warning:\n 'border-[var(--ui-background-status-strong-warning)] bg-[var(--ui-background-status-warning)] [&_[data-slot=alert-icon]]:text-[var(--ui-background-status-strong-warning)]',\n critical:\n 'border-[var(--ui-background-status-strong-critical)] bg-[var(--ui-background-status-critical)] [&_[data-slot=alert-icon]]:text-[var(--ui-background-status-strong-critical)]',\n destructive:\n 'border-[var(--ui-background-status-strong-danger)] bg-[var(--ui-background-status-danger)] [&_[data-slot=alert-icon]]:text-[var(--ui-background-status-strong-danger)]',\n ai: 'border-[var(--ui-text-on-status-ai)] bg-[var(--ui-background-status-ai)] [&_[data-slot=alert-icon]]:text-[var(--ui-text-on-status-ai)]',\n neutral:\n 'border-[var(--ui-background-status-strong-neutral)] bg-[var(--ui-background-status-neutral)] [&_[data-slot=alert-icon]]:text-[var(--ui-background-status-strong-neutral)]',\n },\n },\n defaultVariants: {\n variant: 'info',\n },\n }\n);\n\nexport interface AlertProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof alertVariants> {}\n\nconst Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n ({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n role=\"alert\"\n data-slot=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n )\n);\nAlert.displayName = 'Alert';\n\nconst AlertIcon = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n // Color is set by the Alert variant (targets [data-slot=alert-icon]). The icon\n // sits in a line-height-matched box (h-6 = leading-6) and is centered in it, so\n // it optically aligns with the first line of the title/description.\n <div\n ref={ref}\n data-slot=\"alert-icon\"\n className={cn('flex h-6 shrink-0 items-center', className)}\n {...props}\n />\n));\nAlertIcon.displayName = 'AlertIcon';\n\nconst AlertContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"alert-content\"\n className={cn('flex min-w-0 flex-1 flex-col gap-0.5', className)}\n {...props}\n />\n));\nAlertContent.displayName = 'AlertContent';\n\nconst AlertTitle = React.forwardRef<\n HTMLHeadingElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n data-slot=\"alert-title\"\n className={cn('mb-0 text-sm font-semibold leading-6', className)}\n {...props}\n />\n));\nAlertTitle.displayName = 'AlertTitle';\n\nconst AlertDescription = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"alert-description\"\n className={cn('text-sm font-normal leading-6', className)}\n {...props}\n />\n));\nAlertDescription.displayName = 'AlertDescription';\n\n// Action slot for alert buttons. Two placements (see the Figma): as a direct\n// child of Alert after AlertContent it sits at the right edge (AlertContent is\n// flex-1) — add `self-center` to center it vertically; placed inside AlertContent\n// (under the description) it flows below the text.\nconst AlertActions = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"alert-actions\"\n className={cn('flex items-center gap-2', className)}\n {...props}\n />\n));\nAlertActions.displayName = 'AlertActions';\n\nexport {\n Alert,\n AlertIcon,\n AlertContent,\n AlertTitle,\n AlertDescription,\n AlertActions,\n};\n"],"names":["alertVariants","cva","Alert","React","className","variant","props","ref","jsx","cn","AlertIcon","AlertContent","AlertTitle","AlertDescription","AlertActions"],"mappings":";;;;AAeA,MAAMA,IAAgBC;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,MAAM;AAAA,QACN,SACE;AAAA,QACF,SACE;AAAA,QACF,UACE;AAAA,QACF,aACE;AAAA,QACF,IAAI;AAAA,QACJ,SACE;AAA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7B,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE,EAAG,iCAAiCL,CAAS;AAAA,IACvD,GAAGE;AAAA,EAAA;AACN,CACD;AACDO,EAAiB,cAAc;AAM/B,MAAMC,IAAeX,EAAM,WAGzB,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE,EAAG,2BAA2BL,CAAS;AAAA,IACjD,GAAGE;AAAA,EAAA;AACN,CACD;AACDQ,EAAa,cAAc;"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { jsx as c, jsxs as v, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import * as b from "react";
|
|
3
|
+
import * as C from "recharts";
|
|
4
|
+
import { cn as d } from "../../../lib/utils.js";
|
|
5
|
+
const I = { light: "", dark: "[data-theme='dark']" }, $ = b.createContext(null);
|
|
6
|
+
function L() {
|
|
7
|
+
const s = b.useContext($);
|
|
8
|
+
if (!s)
|
|
9
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
10
|
+
return s;
|
|
11
|
+
}
|
|
12
|
+
function M({
|
|
13
|
+
id: s,
|
|
14
|
+
className: e,
|
|
15
|
+
children: r,
|
|
16
|
+
config: o,
|
|
17
|
+
...n
|
|
18
|
+
}) {
|
|
19
|
+
const i = b.useId(), a = `chart-${s || i.replace(/:/g, "")}`;
|
|
20
|
+
return /* @__PURE__ */ c($.Provider, { value: { config: o }, children: /* @__PURE__ */ v(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
id: s,
|
|
24
|
+
"data-slot": "chart",
|
|
25
|
+
"data-chart": a,
|
|
26
|
+
className: d(
|
|
27
|
+
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
|
|
28
|
+
e
|
|
29
|
+
),
|
|
30
|
+
...n,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ c(R, { id: a, config: o }),
|
|
33
|
+
/* @__PURE__ */ c(C.ResponsiveContainer, { children: r })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
) });
|
|
37
|
+
}
|
|
38
|
+
const R = ({ id: s, config: e }) => {
|
|
39
|
+
const r = Object.entries(e).filter(
|
|
40
|
+
([, o]) => o.theme || o.color
|
|
41
|
+
);
|
|
42
|
+
return r.length ? /* @__PURE__ */ c("style", { children: Object.entries(I).map(
|
|
43
|
+
([o, n]) => `
|
|
44
|
+
${n} [data-chart=${s}] {
|
|
45
|
+
${r.map(([i, a]) => {
|
|
46
|
+
var l;
|
|
47
|
+
const h = ((l = a.theme) == null ? void 0 : l[o]) || a.color;
|
|
48
|
+
return h ? ` --color-${i}: ${h};` : null;
|
|
49
|
+
}).join(`
|
|
50
|
+
`)}
|
|
51
|
+
}
|
|
52
|
+
`
|
|
53
|
+
).join(`
|
|
54
|
+
`) }) : null;
|
|
55
|
+
}, O = C.Tooltip;
|
|
56
|
+
function q({
|
|
57
|
+
active: s,
|
|
58
|
+
payload: e,
|
|
59
|
+
label: r,
|
|
60
|
+
className: o,
|
|
61
|
+
indicator: n = "dot",
|
|
62
|
+
hideLabel: i = !1,
|
|
63
|
+
hideIndicator: a = !1,
|
|
64
|
+
labelFormatter: h,
|
|
65
|
+
formatter: l,
|
|
66
|
+
labelClassName: p,
|
|
67
|
+
color: P,
|
|
68
|
+
nameKey: T,
|
|
69
|
+
labelKey: _
|
|
70
|
+
}) {
|
|
71
|
+
const { config: m } = L(), N = b.useMemo(() => {
|
|
72
|
+
if (i || !(e != null && e.length))
|
|
73
|
+
return null;
|
|
74
|
+
const [t] = e, k = `${_ || (t == null ? void 0 : t.dataKey) || (t == null ? void 0 : t.name) || "value"}`, f = w(m, t, k), u = (() => {
|
|
75
|
+
var j;
|
|
76
|
+
const g = !_ && typeof r == "string" ? ((j = m[r]) == null ? void 0 : j.label) ?? r : f == null ? void 0 : f.label;
|
|
77
|
+
return typeof g == "string" || typeof g == "number" ? g : void 0;
|
|
78
|
+
})();
|
|
79
|
+
return h ? /* @__PURE__ */ c("div", { className: d("font-medium", p), children: h(u, e) }) : u ? /* @__PURE__ */ c("div", { className: d("font-medium", p), children: u }) : null;
|
|
80
|
+
}, [
|
|
81
|
+
r,
|
|
82
|
+
h,
|
|
83
|
+
e,
|
|
84
|
+
i,
|
|
85
|
+
p,
|
|
86
|
+
m,
|
|
87
|
+
_
|
|
88
|
+
]);
|
|
89
|
+
if (!s || !(e != null && e.length))
|
|
90
|
+
return null;
|
|
91
|
+
const x = e.length === 1 && n !== "dot";
|
|
92
|
+
return /* @__PURE__ */ v(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
className: d(
|
|
96
|
+
"grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1.5 text-xs text-foreground shadow-xl",
|
|
97
|
+
o
|
|
98
|
+
),
|
|
99
|
+
children: [
|
|
100
|
+
x ? null : N,
|
|
101
|
+
/* @__PURE__ */ c("div", { className: "grid gap-1.5", children: e.map((t, k) => {
|
|
102
|
+
const f = `${T || t.name || t.dataKey || "value"}`, u = w(m, t, f), g = P || t.payload.fill || t.color;
|
|
103
|
+
return /* @__PURE__ */ c(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
className: d(
|
|
107
|
+
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
108
|
+
n === "dot" && "items-center"
|
|
109
|
+
),
|
|
110
|
+
children: l && (t == null ? void 0 : t.value) !== void 0 && t.name ? l(t.value, t.name, t, k, e) : /* @__PURE__ */ v(E, { children: [
|
|
111
|
+
u != null && u.icon ? /* @__PURE__ */ c(u.icon, {}) : !a && /* @__PURE__ */ c(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
className: d(
|
|
115
|
+
"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
|
|
116
|
+
{
|
|
117
|
+
"h-2.5 w-2.5": n === "dot",
|
|
118
|
+
"h-4 w-1": n === "line",
|
|
119
|
+
"h-4 w-0 border-[1.5px] border-dashed bg-transparent": n === "dashed",
|
|
120
|
+
"my-0.5": x && n === "dashed"
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
style: {
|
|
124
|
+
"--color-bg": g,
|
|
125
|
+
"--color-border": g
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ v(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
className: d(
|
|
133
|
+
"flex flex-1 justify-between leading-none",
|
|
134
|
+
x ? "items-end" : "items-center"
|
|
135
|
+
),
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ v("div", { className: "grid gap-1.5", children: [
|
|
138
|
+
x ? N : null,
|
|
139
|
+
/* @__PURE__ */ c("span", { className: "text-muted-foreground", children: (u == null ? void 0 : u.label) || t.name })
|
|
140
|
+
] }),
|
|
141
|
+
t.value != null && /* @__PURE__ */ c("span", { className: "font-mono font-medium tabular-nums text-foreground", children: t.value.toLocaleString() })
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] })
|
|
146
|
+
},
|
|
147
|
+
f
|
|
148
|
+
);
|
|
149
|
+
}) })
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
const H = C.Legend;
|
|
155
|
+
function z({
|
|
156
|
+
className: s,
|
|
157
|
+
hideIcon: e = !1,
|
|
158
|
+
payload: r,
|
|
159
|
+
verticalAlign: o = "bottom",
|
|
160
|
+
nameKey: n
|
|
161
|
+
}) {
|
|
162
|
+
const { config: i } = L();
|
|
163
|
+
return r != null && r.length ? /* @__PURE__ */ c(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
className: d(
|
|
167
|
+
"flex items-center justify-center gap-4",
|
|
168
|
+
o === "top" ? "pb-3" : "pt-3",
|
|
169
|
+
s
|
|
170
|
+
),
|
|
171
|
+
children: r.map((a) => {
|
|
172
|
+
const h = `${n || a.dataKey || "value"}`, l = w(i, a, h);
|
|
173
|
+
return /* @__PURE__ */ v(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
className: d(
|
|
177
|
+
"flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"
|
|
178
|
+
),
|
|
179
|
+
children: [
|
|
180
|
+
l != null && l.icon && !e ? /* @__PURE__ */ c(l.icon, {}) : /* @__PURE__ */ c(
|
|
181
|
+
"div",
|
|
182
|
+
{
|
|
183
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
184
|
+
style: {
|
|
185
|
+
backgroundColor: a.color
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
l == null ? void 0 : l.label
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
a.value
|
|
193
|
+
);
|
|
194
|
+
})
|
|
195
|
+
}
|
|
196
|
+
) : null;
|
|
197
|
+
}
|
|
198
|
+
function w(s, e, r) {
|
|
199
|
+
if (typeof e != "object" || e === null)
|
|
200
|
+
return;
|
|
201
|
+
const o = "payload" in e && typeof e.payload == "object" && e.payload !== null ? e.payload : void 0;
|
|
202
|
+
let n = r;
|
|
203
|
+
return r in e && typeof e[r] == "string" ? n = e[r] : o && r in o && typeof o[r] == "string" && (n = o[r]), n in s ? s[n] : s[r];
|
|
204
|
+
}
|
|
205
|
+
export {
|
|
206
|
+
M as ChartContainer,
|
|
207
|
+
H as ChartLegend,
|
|
208
|
+
z as ChartLegendContent,
|
|
209
|
+
R as ChartStyle,
|
|
210
|
+
O as ChartTooltip,
|
|
211
|
+
q as ChartTooltipContent
|
|
212
|
+
};
|
|
213
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","sources":["../../../../src/components/ui/chart/chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as RechartsPrimitive from 'recharts';\nimport type { LegendPayload } from 'recharts/types/component/DefaultLegendContent';\nimport {\n NameType,\n Payload,\n ValueType,\n} from 'recharts/types/component/DefaultTooltipContent';\nimport type { Props as LegendProps } from 'recharts/types/component/Legend';\nimport { TooltipContentProps } from 'recharts/types/component/Tooltip';\n\nimport { cn } from '@/lib/utils';\n\n// Format: { THEME_NAME: CSS_SELECTOR }. ui-react flips light/dark via the\n// `[data-theme]` attribute (the tokens resolve `light-dark()` through\n// `color-scheme`), not the legacy `.dark` class — so per-series `theme` colors\n// scope their dark value under `[data-theme='dark']`.\nconst THEMES = { light: '', dark: \"[data-theme='dark']\" } as const;\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & (\n | { color?: string; theme?: never }\n | { color?: never; theme: Record<keyof typeof THEMES, string> }\n );\n};\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nexport type ChartTooltipContentProps = Partial<\n TooltipContentProps<ValueType, NameType>\n> & {\n className?: string;\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n labelFormatter?: (\n label: TooltipContentProps<number, string>['label'],\n payload: TooltipContentProps<number, string>['payload']\n ) => React.ReactNode;\n formatter?: (\n value: number | string,\n name: string,\n item: Payload<number | string, string>,\n index: number,\n payload: ReadonlyArray<Payload<number | string, string>>\n ) => React.ReactNode;\n labelClassName?: string;\n color?: string;\n};\n\nexport type ChartLegendContentProps = {\n className?: string;\n hideIcon?: boolean;\n verticalAlign?: LegendProps['verticalAlign'];\n payload?: LegendPayload[];\n nameKey?: string;\n};\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\nexport interface ChartContainerProps extends React.ComponentProps<'div'> {\n config: ChartConfig;\n children: React.ComponentProps<\n typeof RechartsPrimitive.ResponsiveContainer\n >['children'];\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n ...props\n}: ChartContainerProps) {\n const uniqueId = React.useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n id={id}\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(\n ([, config]) => config.theme || config.color\n );\n\n if (!colorConfig.length) {\n return null;\n }\n\n // Rendered as a text child (not dangerouslySetInnerHTML): React sets it via\n // textContent, which the browser does not HTML-parse, so a `</style>` in a\n // config color can't break out of the tag.\n return (\n <style>\n {Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n ${prefix} [data-chart=${id}] {\n ${colorConfig\n .map(([key, itemConfig]) => {\n const color =\n itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||\n itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join('\\n')}\n }\n `\n )\n .join('\\n')}\n </style>\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n label,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n labelFormatter,\n formatter,\n labelClassName,\n color,\n nameKey,\n labelKey,\n}: ChartTooltipContentProps) {\n const { config } = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey || item?.dataKey || item?.name || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value = (() => {\n const v =\n !labelKey && typeof label === 'string'\n ? (config[label as keyof typeof config]?.label ?? label)\n : itemConfig?.label;\n\n return typeof v === 'string' || typeof v === 'number' ? v : undefined;\n })();\n\n if (labelFormatter) {\n return (\n <div className={cn('font-medium', labelClassName)}>\n {labelFormatter(value, payload)}\n </div>\n );\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [\n label,\n labelFormatter,\n payload,\n hideLabel,\n labelClassName,\n config,\n labelKey,\n ]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n className={cn(\n 'grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1.5 text-xs text-foreground shadow-xl',\n className\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload.map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || item.payload.fill || item.color;\n\n return (\n <div\n key={key}\n className={cn(\n 'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',\n indicator === 'dot' && 'items-center'\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\n 'shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)',\n {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'h-4 w-1': indicator === 'line',\n 'h-4 w-0 border-[1.5px] border-dashed bg-transparent':\n indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n }\n )}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center'\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">\n {itemConfig?.label || item.name}\n </span>\n </div>\n {item.value != null && (\n <span className=\"font-mono font-medium tabular-nums text-foreground\">\n {item.value.toLocaleString()}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey,\n}: ChartLegendContentProps) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n className={cn(\n 'flex items-center justify-center gap-4',\n verticalAlign === 'top' ? 'pb-3' : 'pt-3',\n className\n )}\n >\n {payload.map((item) => {\n const key = `${nameKey || item.dataKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={item.value}\n className={cn(\n 'flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground'\n )}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\n// Helper to extract item config from a payload.\nfunction getPayloadConfigFromPayload(\n config: ChartConfig,\n payload: unknown,\n key: string\n) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n 'payload' in payload &&\n typeof payload.payload === 'object' &&\n payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (\n key in payload &&\n typeof payload[key as keyof typeof payload] === 'string'\n ) {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[\n key as keyof typeof payloadPayload\n ] as string;\n }\n\n return configLabelKey in config\n ? config[configLabelKey]\n : config[key as keyof typeof config];\n}\n\nexport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n};\n"],"names":["THEMES","ChartContext","React","useChart","context","ChartContainer","id","className","children","config","props","uniqueId","chartId","jsxs","cn","jsx","ChartStyle","RechartsPrimitive","colorConfig","theme","prefix","key","itemConfig","color","_a","ChartTooltip","ChartTooltipContent","active","payload","label","indicator","hideLabel","hideIndicator","labelFormatter","formatter","labelClassName","nameKey","labelKey","tooltipLabel","item","getPayloadConfigFromPayload","value","v","nestLabel","index","indicatorColor","Fragment","ChartLegend","ChartLegendContent","hideIcon","verticalAlign","payloadPayload","configLabelKey"],"mappings":";;;;AAmBA,MAAMA,IAAS,EAAE,OAAO,IAAI,MAAM,sBAAA,GAgD5BC,IAAeC,EAAM,cAAwC,IAAI;AAEvE,SAASC,IAAW;AAClB,QAAMC,IAAUF,EAAM,WAAWD,CAAY;AAE7C,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,mDAAmD;AAGrE,SAAOA;AACT;AASA,SAASC,EAAe;AAAA,EACtB,IAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,GAAGC;AACL,GAAwB;AACtB,QAAMC,IAAWT,EAAM,MAAA,GACjBU,IAAU,SAASN,KAAMK,EAAS,QAAQ,MAAM,EAAE,CAAC;AAEzD,2BACGV,EAAa,UAAb,EAAsB,OAAO,EAAE,QAAAQ,KAC9B,UAAA,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAAP;AAAA,MACA,aAAU;AAAA,MACV,cAAYM;AAAA,MACZ,WAAWE;AAAA,QACT;AAAA,QACAP;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAK,EAACC,GAAA,EAAW,IAAIJ,GAAS,QAAAH,EAAA,CAAgB;AAAA,QACzC,gBAAAM,EAACE,EAAkB,qBAAlB,EACE,UAAAT,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA,MAAMQ,IAAa,CAAC,EAAE,IAAAV,GAAI,QAAAG,QAAkD;AAC1E,QAAMS,IAAc,OAAO,QAAQT,CAAM,EAAE;AAAA,IACzC,CAAC,CAAA,EAAGA,CAAM,MAAMA,EAAO,SAASA,EAAO;AAA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;AACvC;"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { Combobox as o } from "@base-ui/react/combobox";
|
|
4
|
+
import { TimesIcon as b, ChevronDownIcon as m, CheckIcon as x } from "@acronis-platform/icons-react/stroke-mono";
|
|
5
|
+
import { cn as a } from "../../../lib/utils.js";
|
|
6
|
+
function v(r) {
|
|
7
|
+
return /* @__PURE__ */ e(o.Root, { ...r });
|
|
8
|
+
}
|
|
9
|
+
v.displayName = "Combobox";
|
|
10
|
+
const g = n.forwardRef(({ className: r, containerClassName: i, clearable: t, ...l }, d) => (
|
|
11
|
+
// InputGroup (not a plain div) is the popup's anchor, so the dropdown aligns to
|
|
12
|
+
// the box's left edge rather than to the bare input inside the box padding.
|
|
13
|
+
/* @__PURE__ */ s(
|
|
14
|
+
o.InputGroup,
|
|
15
|
+
{
|
|
16
|
+
className: a(
|
|
17
|
+
"group flex h-[var(--ui-input-select-global-box-height)] w-full min-w-0 items-center gap-[var(--ui-input-select-global-box-gap)] rounded-[var(--ui-input-select-global-box-border-radius)] border bg-[var(--ui-input-select-global-box-color-idle)] border-[var(--ui-input-select-normal-box-border-color-idle)] px-[var(--ui-input-select-global-box-padding-x)] text-sm leading-6 transition-colors",
|
|
18
|
+
"not-has-disabled:hover:bg-[var(--ui-input-select-global-box-color-hover)] not-has-disabled:hover:border-[var(--ui-input-select-normal-box-border-color-hover)]",
|
|
19
|
+
"has-[input:focus-visible]:border-[var(--ui-input-select-normal-box-border-color-hover)] has-[input:focus-visible]:ring-[3px] has-[input:focus-visible]:ring-[var(--ui-focus-primary)]",
|
|
20
|
+
"has-disabled:cursor-not-allowed has-disabled:border-[var(--ui-input-select-normal-box-border-color-disabled)] has-disabled:bg-[var(--ui-input-select-global-box-color-disabled)]",
|
|
21
|
+
"has-[input[aria-invalid=true]]:border-[var(--ui-input-select-error-box-border-color-idle)] has-[input[aria-invalid=true]:focus-visible]:ring-[var(--ui-focus-error)]",
|
|
22
|
+
i
|
|
23
|
+
),
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ e(
|
|
26
|
+
o.Input,
|
|
27
|
+
{
|
|
28
|
+
ref: d,
|
|
29
|
+
className: a(
|
|
30
|
+
"min-w-0 flex-1 bg-transparent text-[var(--ui-input-select-global-value-color-idle)] outline-none placeholder:text-[var(--ui-input-select-global-placeholder-color-idle)] disabled:cursor-not-allowed disabled:text-[var(--ui-input-select-global-value-color-disabled)]",
|
|
31
|
+
r
|
|
32
|
+
),
|
|
33
|
+
...l
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
t && /* @__PURE__ */ e(
|
|
37
|
+
o.Clear,
|
|
38
|
+
{
|
|
39
|
+
"aria-label": "Clear",
|
|
40
|
+
className: "flex shrink-0 cursor-pointer items-center text-[var(--ui-input-select-normal-icon-expand-color-idle)] outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] data-[disabled]:hidden",
|
|
41
|
+
children: /* @__PURE__ */ e(b, { size: 16 })
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ e(
|
|
45
|
+
o.Trigger,
|
|
46
|
+
{
|
|
47
|
+
"aria-label": "Toggle",
|
|
48
|
+
className: "flex shrink-0 cursor-pointer items-center text-[var(--ui-input-select-normal-icon-expand-color-idle)] outline-none group-has-disabled:text-[var(--ui-input-select-normal-icon-expand-color-disabled)]",
|
|
49
|
+
children: /* @__PURE__ */ e(
|
|
50
|
+
m,
|
|
51
|
+
{
|
|
52
|
+
size: 16,
|
|
53
|
+
className: "transition-transform group-has-[input[aria-expanded=true]]:rotate-180"
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
));
|
|
62
|
+
g.displayName = "ComboboxInput";
|
|
63
|
+
const h = n.forwardRef(
|
|
64
|
+
({ className: r, children: i, sideOffset: t = 4, align: l = "start", side: d = "bottom", portalContainer: c, ...u }, p) => /* @__PURE__ */ e(o.Portal, { container: c, children: /* @__PURE__ */ e(
|
|
65
|
+
o.Positioner,
|
|
66
|
+
{
|
|
67
|
+
sideOffset: t,
|
|
68
|
+
align: l,
|
|
69
|
+
side: d,
|
|
70
|
+
className: "z-50 outline-none",
|
|
71
|
+
children: /* @__PURE__ */ e(
|
|
72
|
+
o.Popup,
|
|
73
|
+
{
|
|
74
|
+
ref: p,
|
|
75
|
+
className: a(
|
|
76
|
+
"max-h-[var(--available-height)] min-w-[var(--anchor-width)] overflow-y-auto rounded-[var(--ui-input-select-dropdown-container-border-radius)] border border-[var(--ui-input-select-dropdown-container-border-color)] bg-[var(--ui-input-select-dropdown-container-color)] py-[var(--ui-input-select-dropdown-container-padding-y)] text-sm shadow-md outline-none",
|
|
77
|
+
r
|
|
78
|
+
),
|
|
79
|
+
...u,
|
|
80
|
+
children: i
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
) })
|
|
85
|
+
);
|
|
86
|
+
h.displayName = "ComboboxContent";
|
|
87
|
+
const f = n.forwardRef(({ className: r, ...i }, t) => /* @__PURE__ */ e(
|
|
88
|
+
o.List,
|
|
89
|
+
{
|
|
90
|
+
ref: t,
|
|
91
|
+
className: a("flex flex-col", r),
|
|
92
|
+
...i
|
|
93
|
+
}
|
|
94
|
+
));
|
|
95
|
+
f.displayName = "ComboboxList";
|
|
96
|
+
const w = n.forwardRef(({ className: r, children: i, ...t }, l) => /* @__PURE__ */ s(
|
|
97
|
+
o.Item,
|
|
98
|
+
{
|
|
99
|
+
ref: l,
|
|
100
|
+
className: a(
|
|
101
|
+
"relative flex cursor-default items-center gap-[var(--ui-input-select-dropdown-item-global-container-gap)] px-[var(--ui-input-select-dropdown-item-global-container-padding-x)] py-[var(--ui-input-select-dropdown-item-global-container-padding-y)] leading-6 text-[var(--ui-input-select-dropdown-item-global-label-color)] outline-none select-none",
|
|
102
|
+
"bg-[var(--ui-input-select-dropdown-item-unselected-container-color-idle)] data-[highlighted]:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-hover)]",
|
|
103
|
+
"data-[selected]:bg-[var(--ui-input-select-dropdown-item-selected-container-color-idle)] data-[selected]:data-[highlighted]:bg-[var(--ui-input-select-dropdown-item-selected-container-color-hover)]",
|
|
104
|
+
"data-[disabled]:pointer-events-none data-[disabled]:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-disabled)]",
|
|
105
|
+
r
|
|
106
|
+
),
|
|
107
|
+
...t,
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: i }),
|
|
110
|
+
/* @__PURE__ */ e(o.ItemIndicator, { className: "flex shrink-0 items-center text-[var(--ui-input-select-normal-icon-expand-color-hover)]", children: /* @__PURE__ */ e(x, { size: 16 }) })
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
));
|
|
114
|
+
w.displayName = "ComboboxItem";
|
|
115
|
+
const y = n.forwardRef(({ className: r, ...i }, t) => /* @__PURE__ */ e(
|
|
116
|
+
o.Empty,
|
|
117
|
+
{
|
|
118
|
+
ref: t,
|
|
119
|
+
className: a(
|
|
120
|
+
"px-[var(--ui-input-select-dropdown-item-global-container-padding-x)] py-[var(--ui-input-select-dropdown-item-global-container-padding-y)] text-center text-sm leading-6 text-[var(--ui-input-select-normal-description-color-idle)] empty:m-0 empty:p-0",
|
|
121
|
+
r
|
|
122
|
+
),
|
|
123
|
+
...i
|
|
124
|
+
}
|
|
125
|
+
));
|
|
126
|
+
y.displayName = "ComboboxEmpty";
|
|
127
|
+
const L = o.Group, C = n.forwardRef(({ className: r, ...i }, t) => /* @__PURE__ */ e(
|
|
128
|
+
o.GroupLabel,
|
|
129
|
+
{
|
|
130
|
+
ref: t,
|
|
131
|
+
className: a(
|
|
132
|
+
"px-[var(--ui-input-select-dropdown-section-container-header-padding-x)] py-[var(--ui-input-select-dropdown-section-container-header-padding-y)] text-sm font-semibold leading-6 text-[var(--ui-input-select-dropdown-section-label-group-color)]",
|
|
133
|
+
r
|
|
134
|
+
),
|
|
135
|
+
...i
|
|
136
|
+
}
|
|
137
|
+
));
|
|
138
|
+
C.displayName = "ComboboxGroupLabel";
|
|
139
|
+
export {
|
|
140
|
+
v as Combobox,
|
|
141
|
+
h as ComboboxContent,
|
|
142
|
+
y as ComboboxEmpty,
|
|
143
|
+
L as ComboboxGroup,
|
|
144
|
+
C as ComboboxGroupLabel,
|
|
145
|
+
g as ComboboxInput,
|
|
146
|
+
w as ComboboxItem,
|
|
147
|
+
f as ComboboxList
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=combobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox.js","sources":["../../../../src/components/ui/combobox/combobox.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox';\nimport {\n CheckIcon,\n ChevronDownIcon,\n TimesIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// A searchable single/multi-select built on Base UI's Combobox primitive. The\n// legacy `combobox` was only a hardcoded Popover + cmdk demo; this is a real,\n// reusable component. There is no `--ui-combobox-*` tier, so it reuses the\n// `--ui-input-select-*` tokens (already imported) — the field box, dropdown\n// container, and items match InputSelect, the non-searchable sibling. The Root\n// auto-extracts `{ value, label }` items and filters them by the input value.\n\nfunction Combobox<Value, Multiple extends boolean | undefined = false>(\n props: ComboboxPrimitive.Root.Props<Value, Multiple>\n) {\n return <ComboboxPrimitive.Root {...props} />;\n}\nCombobox.displayName = 'Combobox';\n\nexport interface ComboboxInputProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Input>,\n 'className'\n > {\n className?: string;\n /** Wrapper (box) className. */\n containerClassName?: string;\n /** Show a clear (✕) button while the field has a value. */\n clearable?: boolean;\n}\n\n// The field box: a typeable input + a clear button (optional) + a chevron trigger.\nconst ComboboxInput = React.forwardRef<\n HTMLInputElement,\n ComboboxInputProps\n>(({ className, containerClassName, clearable, ...props }, ref) => (\n // InputGroup (not a plain div) is the popup's anchor, so the dropdown aligns to\n // the box's left edge rather than to the bare input inside the box padding.\n <ComboboxPrimitive.InputGroup\n className={cn(\n 'group flex h-[var(--ui-input-select-global-box-height)] w-full min-w-0 items-center gap-[var(--ui-input-select-global-box-gap)] rounded-[var(--ui-input-select-global-box-border-radius)] border bg-[var(--ui-input-select-global-box-color-idle)] border-[var(--ui-input-select-normal-box-border-color-idle)] px-[var(--ui-input-select-global-box-padding-x)] text-sm leading-6 transition-colors',\n 'not-has-disabled:hover:bg-[var(--ui-input-select-global-box-color-hover)] not-has-disabled:hover:border-[var(--ui-input-select-normal-box-border-color-hover)]',\n 'has-[input:focus-visible]:border-[var(--ui-input-select-normal-box-border-color-hover)] has-[input:focus-visible]:ring-[3px] has-[input:focus-visible]:ring-[var(--ui-focus-primary)]',\n 'has-disabled:cursor-not-allowed has-disabled:border-[var(--ui-input-select-normal-box-border-color-disabled)] has-disabled:bg-[var(--ui-input-select-global-box-color-disabled)]',\n 'has-[input[aria-invalid=true]]:border-[var(--ui-input-select-error-box-border-color-idle)] has-[input[aria-invalid=true]:focus-visible]:ring-[var(--ui-focus-error)]',\n containerClassName\n )}\n >\n <ComboboxPrimitive.Input\n ref={ref}\n className={cn(\n 'min-w-0 flex-1 bg-transparent text-[var(--ui-input-select-global-value-color-idle)] outline-none placeholder:text-[var(--ui-input-select-global-placeholder-color-idle)] disabled:cursor-not-allowed disabled:text-[var(--ui-input-select-global-value-color-disabled)]',\n className\n )}\n {...props}\n />\n {clearable && (\n <ComboboxPrimitive.Clear\n aria-label=\"Clear\"\n className=\"flex shrink-0 cursor-pointer items-center text-[var(--ui-input-select-normal-icon-expand-color-idle)] outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] data-[disabled]:hidden\"\n >\n <TimesIcon size={16} />\n </ComboboxPrimitive.Clear>\n )}\n <ComboboxPrimitive.Trigger\n aria-label=\"Toggle\"\n className=\"flex shrink-0 cursor-pointer items-center text-[var(--ui-input-select-normal-icon-expand-color-idle)] outline-none group-has-disabled:text-[var(--ui-input-select-normal-icon-expand-color-disabled)]\"\n >\n <ChevronDownIcon\n size={16}\n className=\"transition-transform group-has-[input[aria-expanded=true]]:rotate-180\"\n />\n </ComboboxPrimitive.Trigger>\n </ComboboxPrimitive.InputGroup>\n));\nComboboxInput.displayName = 'ComboboxInput';\n\nexport interface ComboboxContentProps\n extends React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Popup> {\n sideOffset?: number;\n align?: ComboboxPrimitive.Positioner.Props['align'];\n side?: ComboboxPrimitive.Positioner.Props['side'];\n /** Container to portal into (e.g. a shadow root, so the popup inherits styles). */\n portalContainer?: ComboboxPrimitive.Portal.Props['container'];\n}\n\nconst ComboboxContent = React.forwardRef<\n React.ElementRef<typeof ComboboxPrimitive.Popup>,\n ComboboxContentProps\n>(\n (\n { className, children, sideOffset = 4, align = 'start', side = 'bottom', portalContainer, ...props },\n ref\n ) => (\n <ComboboxPrimitive.Portal container={portalContainer}>\n <ComboboxPrimitive.Positioner\n sideOffset={sideOffset}\n align={align}\n side={side}\n className=\"z-50 outline-none\"\n >\n <ComboboxPrimitive.Popup\n ref={ref}\n className={cn(\n 'max-h-[var(--available-height)] min-w-[var(--anchor-width)] overflow-y-auto rounded-[var(--ui-input-select-dropdown-container-border-radius)] border border-[var(--ui-input-select-dropdown-container-border-color)] bg-[var(--ui-input-select-dropdown-container-color)] py-[var(--ui-input-select-dropdown-container-padding-y)] text-sm shadow-md outline-none',\n className\n )}\n {...props}\n >\n {children}\n </ComboboxPrimitive.Popup>\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n);\nComboboxContent.displayName = 'ComboboxContent';\n\nconst ComboboxList = React.forwardRef<\n React.ElementRef<typeof ComboboxPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.List>\n>(({ className, ...props }, ref) => (\n <ComboboxPrimitive.List\n ref={ref}\n className={cn('flex flex-col', className)}\n {...props}\n />\n));\nComboboxList.displayName = 'ComboboxList';\n\nconst ComboboxItem = React.forwardRef<\n React.ElementRef<typeof ComboboxPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <ComboboxPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default items-center gap-[var(--ui-input-select-dropdown-item-global-container-gap)] px-[var(--ui-input-select-dropdown-item-global-container-padding-x)] py-[var(--ui-input-select-dropdown-item-global-container-padding-y)] leading-6 text-[var(--ui-input-select-dropdown-item-global-label-color)] outline-none select-none',\n 'bg-[var(--ui-input-select-dropdown-item-unselected-container-color-idle)] data-[highlighted]:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-hover)]',\n 'data-[selected]:bg-[var(--ui-input-select-dropdown-item-selected-container-color-idle)] data-[selected]:data-[highlighted]:bg-[var(--ui-input-select-dropdown-item-selected-container-color-hover)]',\n 'data-[disabled]:pointer-events-none data-[disabled]:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-disabled)]',\n className\n )}\n {...props}\n >\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n <ComboboxPrimitive.ItemIndicator className=\"flex shrink-0 items-center text-[var(--ui-input-select-normal-icon-expand-color-hover)]\">\n <CheckIcon size={16} />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n));\nComboboxItem.displayName = 'ComboboxItem';\n\nconst ComboboxEmpty = React.forwardRef<\n React.ElementRef<typeof ComboboxPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Empty>\n>(({ className, ...props }, ref) => (\n <ComboboxPrimitive.Empty\n ref={ref}\n className={cn(\n 'px-[var(--ui-input-select-dropdown-item-global-container-padding-x)] py-[var(--ui-input-select-dropdown-item-global-container-padding-y)] text-center text-sm leading-6 text-[var(--ui-input-select-normal-description-color-idle)] empty:m-0 empty:p-0',\n className\n )}\n {...props}\n />\n));\nComboboxEmpty.displayName = 'ComboboxEmpty';\n\nconst ComboboxGroup = ComboboxPrimitive.Group;\n\nconst ComboboxGroupLabel = React.forwardRef<\n React.ElementRef<typeof ComboboxPrimitive.GroupLabel>,\n React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.GroupLabel>\n>(({ className, ...props }, ref) => (\n <ComboboxPrimitive.GroupLabel\n ref={ref}\n className={cn(\n 'px-[var(--ui-input-select-dropdown-section-container-header-padding-x)] py-[var(--ui-input-select-dropdown-section-container-header-padding-y)] text-sm font-semibold leading-6 text-[var(--ui-input-select-dropdown-section-label-group-color)]',\n className\n )}\n {...props}\n />\n));\nComboboxGroupLabel.displayName = 'ComboboxGroupLabel';\n\nexport {\n Combobox,\n ComboboxInput,\n ComboboxContent,\n ComboboxList,\n ComboboxItem,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxGroupLabel,\n};\n"],"names":["Combobox","props","jsx","ComboboxPrimitive","ComboboxInput","React","className","containerClassName","clearable","ref","jsxs","cn","TimesIcon","ChevronDownIcon","ComboboxContent","children","sideOffset","align","side","portalContainer","ComboboxList","ComboboxItem","CheckIcon","ComboboxEmpty","ComboboxGroup","ComboboxGroupLabel"],"mappings":";;;;;AAmBA,SAASA,EACPC,GACA;AACA,SAAO,gBAAAC,EAACC,EAAkB,MAAlB,EAAwB,GAAGF,EAAA,CAAO;AAC5C;AACAD,EAAS,cAAc;AAevB,MAAMI,IAAgBC,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,oBAAAC,GAAoB,WAAAC,GAAW,GAAGP,EAAA,GAASQ;AAAA;AAAA;AAAA,EAGzD,gBAAAC;AAAA,IAACP,EAAkB;AAAA,IAAlB;AAAA,MACC,WAAWQ;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA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