@acronis-platform/ui-react 0.57.1 → 0.58.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/area-chart/area-chart.js +149 -0
- package/dist/components/ui/area-chart/area-chart.js.map +1 -0
- package/dist/components/ui/bar-chart/bar-chart.js +152 -77
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/button-icon-input/button-icon-input.js +36 -0
- package/dist/components/ui/button-icon-input/button-icon-input.js.map +1 -0
- package/dist/components/ui/button-menu/button-menu.js +1 -1
- package/dist/components/ui/button-menu/button-menu.js.map +1 -1
- package/dist/components/ui/card-filter/card-filter.js +40 -27
- package/dist/components/ui/card-filter/card-filter.js.map +1 -1
- package/dist/components/ui/chart-state/chart-state.js +42 -0
- package/dist/components/ui/chart-state/chart-state.js.map +1 -0
- package/dist/components/ui/chip/chip.js +13 -13
- package/dist/components/ui/chip/chip.js.map +1 -1
- package/dist/components/ui/composed-chart/composed-chart.js +107 -0
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -0
- package/dist/components/ui/confidence-cone/confidence-cone.js +195 -0
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -0
- package/dist/components/ui/date-range-picker/date-range-picker.js +21 -21
- package/dist/components/ui/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js +250 -78
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/dialog-footer-default/dialog-footer-default.js +26 -0
- package/dist/components/ui/dialog-footer-default/dialog-footer-default.js.map +1 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +21 -21
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/filter-search/filter-search.js +91 -90
- package/dist/components/ui/filter-search/filter-search.js.map +1 -1
- package/dist/components/ui/funnel-chart/funnel-chart.js +87 -0
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -0
- package/dist/components/ui/histogram/histogram.js +108 -0
- package/dist/components/ui/histogram/histogram.js.map +1 -0
- package/dist/components/ui/input-otp/input-otp.js +104 -0
- package/dist/components/ui/input-otp/input-otp.js.map +1 -0
- package/dist/components/ui/input-password/input-password.js +120 -0
- package/dist/components/ui/input-password/input-password.js.map +1 -0
- package/dist/components/ui/input-text/input-text.js +9 -9
- package/dist/components/ui/input-text/input-text.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +206 -0
- package/dist/components/ui/line-chart/line-chart.js.map +1 -0
- package/dist/components/ui/link/link.js +5 -5
- package/dist/components/ui/link/link.js.map +1 -1
- package/dist/components/ui/loading/loading.js +79 -0
- package/dist/components/ui/loading/loading.js.map +1 -0
- package/dist/components/ui/meter/meter.js +93 -0
- package/dist/components/ui/meter/meter.js.map +1 -0
- package/dist/components/ui/metric/metric.js +185 -0
- package/dist/components/ui/metric/metric.js.map +1 -0
- package/dist/components/ui/pie-chart/pie-chart.js +113 -0
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -0
- package/dist/components/ui/popover/popover.js +57 -27
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +74 -0
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -0
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +69 -0
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -0
- package/dist/components/ui/scatter-chart/scatter-chart.js +102 -0
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -0
- package/dist/components/ui/search/search.js +16 -16
- package/dist/components/ui/search/search.js.map +1 -1
- package/dist/components/ui/sheet/sheet-details.js +16 -16
- package/dist/components/ui/sheet/sheet-details.js.map +1 -1
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/timeline/timeline.js +175 -0
- package/dist/components/ui/timeline/timeline.js.map +1 -0
- package/dist/components/ui/treemap/treemap.js +83 -0
- package/dist/components/ui/treemap/treemap.js.map +1 -0
- package/dist/components/ui/trend-indicator/trend-indicator.js +97 -0
- package/dist/components/ui/trend-indicator/trend-indicator.js.map +1 -0
- package/dist/index.js +423 -384
- package/dist/index.js.map +1 -1
- package/dist/react.js +423 -384
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/area-chart/area-chart.d.ts +49 -0
- package/dist/src/components/ui/area-chart/index.d.ts +1 -0
- package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +42 -2
- package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/button-icon-input/button-icon-input.d.ts +21 -0
- package/dist/src/components/ui/button-icon-input/index.d.ts +1 -0
- package/dist/src/components/ui/card-filter/card-filter.d.ts +5 -0
- package/dist/src/components/ui/chart-state/chart-state.d.ts +11 -0
- package/dist/src/components/ui/chart-state/index.d.ts +1 -0
- package/dist/src/components/ui/composed-chart/composed-chart.d.ts +48 -0
- package/dist/src/components/ui/composed-chart/index.d.ts +1 -0
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +79 -0
- package/dist/src/components/ui/confidence-cone/index.d.ts +1 -0
- package/dist/src/components/ui/dialog/dialog.d.ts +105 -9
- package/dist/src/components/ui/dialog/dialog.docs.d.ts +82 -5
- package/dist/src/components/ui/dialog/index.d.ts +1 -1
- package/dist/src/components/ui/dialog-footer-default/dialog-footer-default.d.ts +11 -0
- package/dist/src/components/ui/dialog-footer-default/index.d.ts +1 -0
- package/dist/src/components/ui/filter-search/filter-search.d.ts +1 -1
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +39 -0
- package/dist/src/components/ui/funnel-chart/index.d.ts +1 -0
- package/dist/src/components/ui/histogram/histogram.d.ts +55 -0
- package/dist/src/components/ui/histogram/index.d.ts +1 -0
- package/dist/src/components/ui/input-otp/index.d.ts +1 -0
- package/dist/src/components/ui/input-otp/input-otp.d.ts +23 -0
- package/dist/src/components/ui/input-password/index.d.ts +1 -0
- package/dist/src/components/ui/input-password/input-password.d.ts +21 -0
- package/dist/src/components/ui/line-chart/index.d.ts +1 -0
- package/dist/src/components/ui/line-chart/line-chart.d.ts +83 -0
- package/dist/src/components/ui/loading/index.d.ts +1 -0
- package/dist/src/components/ui/loading/loading.d.ts +13 -0
- package/dist/src/components/ui/meter/index.d.ts +1 -0
- package/dist/src/components/ui/meter/meter.d.ts +25 -0
- package/dist/src/components/ui/metric/index.d.ts +1 -0
- package/dist/src/components/ui/metric/metric.d.ts +37 -0
- package/dist/src/components/ui/pie-chart/index.d.ts +1 -0
- package/dist/src/components/ui/pie-chart/pie-chart.d.ts +54 -0
- package/dist/src/components/ui/popover/index.d.ts +1 -1
- package/dist/src/components/ui/popover/popover.d.ts +13 -1
- package/dist/src/components/ui/radar-chart/index.d.ts +1 -0
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +40 -0
- package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -0
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +45 -0
- package/dist/src/components/ui/scatter-chart/index.d.ts +1 -0
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +50 -0
- package/dist/src/components/ui/stack/stack.d.ts +1 -1
- package/dist/src/components/ui/timeline/index.d.ts +1 -0
- package/dist/src/components/ui/timeline/timeline.d.ts +41 -0
- package/dist/src/components/ui/treemap/index.d.ts +1 -0
- package/dist/src/components/ui/treemap/treemap.d.ts +44 -0
- package/dist/src/components/ui/trend-indicator/index.d.ts +1 -0
- package/dist/src/components/ui/trend-indicator/trend-indicator.d.ts +32 -0
- package/dist/src/index.d.ts +22 -2
- package/dist/ui-react.css +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { RadialBarChart as L, RadialBar as N, Cell as $ } from "recharts";
|
|
4
|
+
import { cn as b } from "../../../lib/utils.js";
|
|
5
|
+
import { ChartContainer as j, ChartTooltip as A, ChartTooltipContent as T, ChartLegend as k, ChartLegendContent as z } from "../chart/chart.js";
|
|
6
|
+
const D = x.forwardRef(
|
|
7
|
+
({
|
|
8
|
+
className: l,
|
|
9
|
+
config: e,
|
|
10
|
+
data: n,
|
|
11
|
+
dataKey: i,
|
|
12
|
+
nameKey: a,
|
|
13
|
+
innerRadius: s = 30,
|
|
14
|
+
outerRadius: c = 110,
|
|
15
|
+
startAngle: d = 90,
|
|
16
|
+
endAngle: h = -270,
|
|
17
|
+
cornerRadius: m = 4,
|
|
18
|
+
showBackground: C = !0,
|
|
19
|
+
showTooltip: f = !0,
|
|
20
|
+
showLegend: p = !0,
|
|
21
|
+
tooltipContent: u,
|
|
22
|
+
...R
|
|
23
|
+
}, B) => {
|
|
24
|
+
const o = n.map((t) => ({
|
|
25
|
+
...t,
|
|
26
|
+
fill: `var(--color-${t[a]})`
|
|
27
|
+
}));
|
|
28
|
+
return /* @__PURE__ */ r("div", { ref: B, className: b(l), ...R, children: /* @__PURE__ */ r(j, { config: e, className: "size-full", children: /* @__PURE__ */ g(
|
|
29
|
+
L,
|
|
30
|
+
{
|
|
31
|
+
data: o,
|
|
32
|
+
dataKey: i,
|
|
33
|
+
innerRadius: s,
|
|
34
|
+
outerRadius: c,
|
|
35
|
+
startAngle: d,
|
|
36
|
+
endAngle: h,
|
|
37
|
+
children: [
|
|
38
|
+
f && /* @__PURE__ */ r(
|
|
39
|
+
A,
|
|
40
|
+
{
|
|
41
|
+
content: u ?? /* @__PURE__ */ r(T, { nameKey: a, hideLabel: !0 })
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ r(
|
|
45
|
+
N,
|
|
46
|
+
{
|
|
47
|
+
dataKey: i,
|
|
48
|
+
background: C,
|
|
49
|
+
cornerRadius: m,
|
|
50
|
+
isAnimationActive: !1,
|
|
51
|
+
children: o.map((t, v) => (
|
|
52
|
+
// Keyed by index, not the name: two arcs could share a nameKey
|
|
53
|
+
// value, which would collide as a React key. Same-named arcs
|
|
54
|
+
// intentionally share a color/config entry via `--color-<name>`.
|
|
55
|
+
/* @__PURE__ */ r($, { fill: `var(--color-${t[a]})` }, v)
|
|
56
|
+
))
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
p && /* @__PURE__ */ r(k, { content: /* @__PURE__ */ r(z, { nameKey: a }) })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
) }) });
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
D.displayName = "RadialBarChart";
|
|
66
|
+
export {
|
|
67
|
+
D as RadialBarChart
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=radial-bar-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radial-bar-chart.js","sources":["../../../../src/components/ui/radial-bar-chart/radial-bar-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Cell, RadialBar, RadialBarChart as RechartsRadialBarChart } from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives (a polar/radial\n// type). Rows become concentric arcs sized by `dataKey`, each colored from its\n// `--color-<name>` var. Like ScatterChart/ComposedChart there's no CVA variant:\n// a radial bar's expressiveness is geometry (angles/radii, plain props) and the\n// data mapping, not a visual \"mode\". The angular sweep is exposed as\n// startAngle/endAngle props so a caller can build a gauge or a full ring.\nexport interface RadialBarChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'> {\n /** Row-per-arc data. Each object holds the arc's `nameKey` label + its `dataKey` numeric value. */\n data: ReadonlyArray<Record<string, string | number>>;\n /**\n * Per-arc map of `label` / `color`, keyed by the arc's `nameKey` value\n * (imported from the shared `Chart` primitives). Turned into `--color-<name>`\n * custom properties. Colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Numeric field that sizes each arc. */\n dataKey: string;\n /**\n * Label field that names each arc (drives the legend, tooltip, and\n * `--color-<name>` lookup). Values should be unique per chart (arcs sharing a\n * name share one `config`/color entry) and CSS-safe — they become part of a\n * custom-property name.\n */\n nameKey: string;\n /** Inner radius of the innermost arc. */\n innerRadius?: number;\n /** Outer radius of the outermost arc. */\n outerRadius?: number;\n /** Angle (degrees) the arcs sweep from. */\n startAngle?: number;\n /** Angle (degrees) the arcs sweep to (default is a full clockwise circle). */\n endAngle?: number;\n /** Corner radius on each arc's ends. */\n cornerRadius?: number;\n /** Render a muted background track behind each arc. */\n showBackground?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` —\n * to customize formatting, per-arc rows, or extra fields without composing\n * recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n}\n\nconst RadialBarChart = React.forwardRef<HTMLDivElement, RadialBarChartProps>(\n (\n {\n className,\n config,\n data,\n dataKey,\n nameKey,\n innerRadius = 30,\n outerRadius = 110,\n startAngle = 90,\n endAngle = -270,\n cornerRadius = 4,\n showBackground = true,\n showTooltip = true,\n showLegend = true,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n // Stamp each row with its `fill` (the shadcn data-driven pattern) so a real\n // hover resolves the arc color in the tooltip — recharts' RadialBar, like\n // Funnel, carries no per-arc color on the tooltip payload item.\n const seriesData: Record<string, string | number>[] = data.map((row) => ({\n ...row,\n fill: `var(--color-${row[nameKey]})`,\n }));\n\n return (\n <div ref={ref} className={cn(className)} {...props}>\n <ChartContainer config={config} className=\"size-full\">\n <RechartsRadialBarChart\n data={seriesData}\n dataKey={dataKey}\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n startAngle={startAngle}\n endAngle={endAngle}\n >\n {showTooltip && (\n <ChartTooltip\n content={\n tooltipContent ?? (\n <ChartTooltipContent nameKey={nameKey} hideLabel />\n )\n }\n />\n )}\n <RadialBar\n dataKey={dataKey}\n background={showBackground}\n cornerRadius={cornerRadius}\n isAnimationActive={false}\n >\n {seriesData.map((entry, index) => (\n // Keyed by index, not the name: two arcs could share a nameKey\n // value, which would collide as a React key. Same-named arcs\n // intentionally share a color/config entry via `--color-<name>`.\n <Cell key={index} fill={`var(--color-${entry[nameKey]})`} />\n ))}\n </RadialBar>\n {showLegend && (\n <ChartLegend content={<ChartLegendContent nameKey={nameKey} />} />\n )}\n </RechartsRadialBarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nRadialBarChart.displayName = 'RadialBarChart';\n\nexport { RadialBarChart };\n"],"names":["RadialBarChart","React","className","config","data","dataKey","nameKey","innerRadius","outerRadius","startAngle","endAngle","cornerRadius","showBackground","showTooltip","showLegend","tooltipContent","props","ref","seriesData","row","jsx","cn","ChartContainer","jsxs","RechartsRadialBarChart","ChartTooltip","ChartTooltipContent","RadialBar","entry","index","Cell","ChartLegend","ChartLegendContent"],"mappings":";;;;;AAgEA,MAAMA,IAAiBC,EAAM;AAAA,EAC3B,CACE;AAAA,IACE,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,aAAAC,IAAc;AAAA,IACd,YAAAC,IAAa;AAAA,IACb,UAAAC,IAAW;AAAA,IACX,cAAAC,IAAe;AAAA,IACf,gBAAAC,IAAiB;AAAA,IACjB,aAAAC,IAAc;AAAA,IACd,YAAAC,IAAa;AAAA,IACb,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AAIH,UAAMC,IAAgDd,EAAK,IAAI,CAACe,OAAS;AAAA,MACvE,GAAGA;AAAA,MACH,MAAM,eAAeA,EAAIb,CAAO,CAAC;AAAA,IAAA,EACjC;AAEF,WACE,gBAAAc,EAAC,OAAA,EAAI,KAAAH,GAAU,WAAWI,EAAGnB,CAAS,GAAI,GAAGc,GAC3C,UAAA,gBAAAI,EAACE,GAAA,EAAe,QAAAnB,GAAgB,WAAU,aACxC,UAAA,gBAAAoB;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,MAAMN;AAAA,QACN,SAAAb;AAAA,QACA,aAAAE;AAAA,QACA,aAAAC;AAAA,QACA,YAAAC;AAAA,QACA,UAAAC;AAAA,QAEC,UAAA;AAAA,UAAAG,KACC,gBAAAO;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,SACEV,KACE,gBAAAK,EAACM,GAAA,EAAoB,SAAApB,GAAkB,WAAS,GAAA,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,UAKzD,gBAAAc;AAAA,YAACO;AAAA,YAAA;AAAA,cACC,SAAAtB;AAAA,cACA,YAAYO;AAAA,cACZ,cAAAD;AAAA,cACA,mBAAmB;AAAA,cAElB,UAAAO,EAAW,IAAI,CAACU,GAAOC;AAAA;AAAA;AAAA;AAAA,gBAItB,gBAAAT,EAACU,KAAiB,MAAM,eAAeF,EAAMtB,CAAO,CAAC,OAA1CuB,CAA+C;AAAA,eAC3D;AAAA,YAAA;AAAA,UAAA;AAAA,UAEFf,KACC,gBAAAM,EAACW,GAAA,EAAY,SAAS,gBAAAX,EAACY,GAAA,EAAmB,SAAA1B,GAAkB,EAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAGtE,EAAA,CACF;AAAA,EAEJ;AACF;AACAN,EAAe,cAAc;"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as t, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import * as A from "react";
|
|
3
|
+
import { ScatterChart as T, CartesianGrid as b, XAxis as L, YAxis as N, ZAxis as j, Scatter as w } from "recharts";
|
|
4
|
+
import { cn as M } from "../../../lib/utils.js";
|
|
5
|
+
import { ChartContainer as R, ChartTooltip as $, ChartTooltipContent as B, ChartLegend as D, ChartLegendContent as G } from "../chart/chart.js";
|
|
6
|
+
const X = A.forwardRef(
|
|
7
|
+
({
|
|
8
|
+
className: l,
|
|
9
|
+
config: s,
|
|
10
|
+
series: c,
|
|
11
|
+
xKey: n,
|
|
12
|
+
yKey: o,
|
|
13
|
+
zKey: a,
|
|
14
|
+
zRange: m = [60, 400],
|
|
15
|
+
shape: d = "circle",
|
|
16
|
+
xAxisLabel: r,
|
|
17
|
+
yAxisLabel: i,
|
|
18
|
+
xUnit: f,
|
|
19
|
+
yUnit: h,
|
|
20
|
+
showGrid: p = !0,
|
|
21
|
+
showTooltip: u = !0,
|
|
22
|
+
showLegend: C = !0,
|
|
23
|
+
tooltipContent: g,
|
|
24
|
+
...v
|
|
25
|
+
}, k) => {
|
|
26
|
+
const y = r ? { value: r, position: "insideBottom", offset: -8 } : void 0, x = i ? {
|
|
27
|
+
value: i,
|
|
28
|
+
angle: -90,
|
|
29
|
+
position: "insideLeft",
|
|
30
|
+
style: { textAnchor: "middle" }
|
|
31
|
+
} : void 0;
|
|
32
|
+
return /* @__PURE__ */ t("div", { ref: k, className: M(l), ...v, children: /* @__PURE__ */ t(
|
|
33
|
+
R,
|
|
34
|
+
{
|
|
35
|
+
config: s,
|
|
36
|
+
className: "size-full [&_.recharts-label]:fill-foreground",
|
|
37
|
+
children: /* @__PURE__ */ S(
|
|
38
|
+
T,
|
|
39
|
+
{
|
|
40
|
+
margin: { top: 16, right: 16, bottom: 16, left: 16 },
|
|
41
|
+
children: [
|
|
42
|
+
p && /* @__PURE__ */ t(b, {}),
|
|
43
|
+
/* @__PURE__ */ t(
|
|
44
|
+
L,
|
|
45
|
+
{
|
|
46
|
+
type: "number",
|
|
47
|
+
dataKey: n,
|
|
48
|
+
name: n,
|
|
49
|
+
unit: f,
|
|
50
|
+
tickLine: !1,
|
|
51
|
+
axisLine: !1,
|
|
52
|
+
tickMargin: 8,
|
|
53
|
+
height: r ? 48 : void 0,
|
|
54
|
+
label: y
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ t(
|
|
58
|
+
N,
|
|
59
|
+
{
|
|
60
|
+
type: "number",
|
|
61
|
+
dataKey: o,
|
|
62
|
+
name: o,
|
|
63
|
+
unit: h,
|
|
64
|
+
tickLine: !1,
|
|
65
|
+
axisLine: !1,
|
|
66
|
+
tickMargin: 8,
|
|
67
|
+
width: i ? 72 : void 0,
|
|
68
|
+
label: x
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
a && /* @__PURE__ */ t(j, { type: "number", dataKey: a, range: m, name: a }),
|
|
72
|
+
u && /* @__PURE__ */ t(
|
|
73
|
+
$,
|
|
74
|
+
{
|
|
75
|
+
cursor: { strokeDasharray: "3 3" },
|
|
76
|
+
content: g ?? /* @__PURE__ */ t(B, {})
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
C && /* @__PURE__ */ t(D, { content: /* @__PURE__ */ t(G, {}) }),
|
|
80
|
+
c.map((e) => /* @__PURE__ */ t(
|
|
81
|
+
w,
|
|
82
|
+
{
|
|
83
|
+
name: e.key,
|
|
84
|
+
data: e.data,
|
|
85
|
+
fill: `var(--color-${e.key})`,
|
|
86
|
+
shape: d,
|
|
87
|
+
isAnimationActive: !1
|
|
88
|
+
},
|
|
89
|
+
e.key
|
|
90
|
+
))
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
) });
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
X.displayName = "ScatterChart";
|
|
99
|
+
export {
|
|
100
|
+
X as ScatterChart
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=scatter-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scatter-chart.js","sources":["../../../../src/components/ui/scatter-chart/scatter-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n CartesianGrid,\n Scatter,\n ScatterChart as RechartsScatterChart,\n XAxis,\n YAxis,\n ZAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. Unlike the\n// other chart types, a scatter has no visual \"mode\" to model as a CVA variant —\n// its shape is fixed (x/y points, optionally sized by z) and its expressiveness\n// comes from the data mapping. So there is no `cva` axis here (matches the\n// skill's \"usually none\"); marker `shape` and bubble sizing are plain props.\n// Each series carries its own point array (points aren't columns of a shared\n// row the way bar/line/area series are), so the API takes a `series` list rather\n// than `dataKeys` over one `data` array.\nexport type ScatterMarkerShape =\n | 'circle'\n | 'cross'\n | 'diamond'\n | 'square'\n | 'star'\n | 'triangle'\n | 'wye';\n\nexport interface ScatterSeries {\n /** Series key — must match a `config` entry; drives its `--color-<key>` fill and legend label. */\n key: string;\n /** This series' points — each row holds at least `xKey` and `yKey` (and `zKey` when used). */\n data: ReadonlyArray<Record<string, number>>;\n}\n\nexport interface ScatterChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'> {\n /** One `<Scatter>` per entry — each with its own point array. Use a single entry for an ungrouped scatter. */\n series: ScatterSeries[];\n /**\n * Per-series map of `label` / `color`, keyed by `series[].key` (imported from\n * the shared `Chart` primitives). Turned into `--color-<key>` custom\n * properties. Colors are caller-supplied — reference an existing semantic\n * `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Numeric field for the horizontal axis. */\n xKey: string;\n /** Numeric field for the vertical axis. */\n yKey: string;\n /** Title rendered beneath the horizontal (X) axis. */\n xAxisLabel?: string;\n /** Title rendered beside the vertical (Y) axis (rotated). */\n yAxisLabel?: string;\n /** Unit suffix appended to X-axis tick values (recharts `unit`). */\n xUnit?: string;\n /** Unit suffix appended to Y-axis tick values (recharts `unit`). */\n yUnit?: string;\n /** Optional numeric field mapped to point size (a bubble chart), via recharts `ZAxis`. */\n zKey?: string;\n /** Point-size range `[min, max]` the `zKey` maps into. Ignored when `zKey` is unset (points use recharts' default size). */\n zRange?: [number, number];\n /** Marker shape for every point. */\n shape?: ScatterMarkerShape;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` /\n * `indicator` — to customize formatting, per-series rows, or extra fields\n * without composing recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n}\n\nconst ScatterChart = React.forwardRef<HTMLDivElement, ScatterChartProps>(\n (\n {\n className,\n config,\n series,\n xKey,\n yKey,\n zKey,\n zRange = [60, 400],\n shape = 'circle',\n xAxisLabel,\n yAxisLabel,\n xUnit,\n yUnit,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = xAxisLabel\n ? { value: xAxisLabel, position: 'insideBottom' as const, offset: -8 }\n : undefined;\n const yAxisTitle = yAxisLabel\n ? {\n value: yAxisLabel,\n angle: -90,\n position: 'insideLeft' as const,\n style: { textAnchor: 'middle' as const },\n }\n : undefined;\n\n return (\n <div ref={ref} className={cn(className)} {...props}>\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsScatterChart\n margin={{ top: 16, right: 16, bottom: 16, left: 16 }}\n >\n {showGrid && <CartesianGrid />}\n <XAxis\n type=\"number\"\n dataKey={xKey}\n name={xKey}\n unit={xUnit}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n height={xAxisLabel ? 48 : undefined}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n dataKey={yKey}\n name={yKey}\n unit={yUnit}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {zKey && (\n <ZAxis type=\"number\" dataKey={zKey} range={zRange} name={zKey} />\n )}\n {showTooltip && (\n <ChartTooltip\n cursor={{ strokeDasharray: '3 3' }}\n content={tooltipContent ?? <ChartTooltipContent />}\n />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n {series.map((s) => (\n <Scatter\n key={s.key}\n name={s.key}\n data={s.data as Record<string, number>[]}\n fill={`var(--color-${s.key})`}\n shape={shape}\n isAnimationActive={false}\n />\n ))}\n </RechartsScatterChart>\n </ChartContainer>\n </div>\n );\n }\n);\nScatterChart.displayName = 'ScatterChart';\n\nexport { ScatterChart };\n"],"names":["ScatterChart","React","className","config","series","xKey","yKey","zKey","zRange","shape","xAxisLabel","yAxisLabel","xUnit","yUnit","showGrid","showTooltip","showLegend","tooltipContent","props","ref","xAxisTitle","yAxisTitle","jsx","cn","ChartContainer","jsxs","RechartsScatterChart","CartesianGrid","XAxis","YAxis","ZAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","s","Scatter"],"mappings":";;;;;AAuFA,MAAMA,IAAeC,EAAM;AAAA,EACzB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC,IAAS,CAAC,IAAI,GAAG;AAAA,IACjB,OAAAC,IAAQ;AAAA,IACR,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,aAAAC,IAAc;AAAA,IACd,YAAAC,IAAa;AAAA,IACb,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AAIH,UAAMC,IAAaV,IACf,EAAE,OAAOA,GAAY,UAAU,gBAAyB,QAAQ,GAAA,IAChE,QACEW,IAAaV,IACf;AAAA,MACE,OAAOA;AAAA,MACP,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OAAO,EAAE,YAAY,SAAA;AAAA,IAAkB,IAEzC;AAEJ,WACE,gBAAAW,EAAC,SAAI,KAAAH,GAAU,WAAWI,EAAGrB,CAAS,GAAI,GAAGgB,GAC3C,UAAA,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,QAAArB;AAAA,QACA,WAAU;AAAA,QAEV,UAAA,gBAAAsB;AAAA,UAACC;AAAAA,UAAA;AAAA,YACC,QAAQ,EAAE,KAAK,IAAI,OAAO,IAAI,QAAQ,IAAI,MAAM,GAAA;AAAA,YAE/C,UAAA;AAAA,cAAAZ,uBAAaa,GAAA,EAAc;AAAA,cAC5B,gBAAAL;AAAA,gBAACM;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,SAASvB;AAAA,kBACT,MAAMA;AAAA,kBACN,MAAMO;AAAA,kBACN,UAAU;AAAA,kBACV,UAAU;AAAA,kBACV,YAAY;AAAA,kBACZ,QAAQF,IAAa,KAAK;AAAA,kBAC1B,OAAOU;AAAA,gBAAA;AAAA,cAAA;AAAA,cAET,gBAAAE;AAAA,gBAACO;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,SAASvB;AAAA,kBACT,MAAMA;AAAA,kBACN,MAAMO;AAAA,kBACN,UAAU;AAAA,kBACV,UAAU;AAAA,kBACV,YAAY;AAAA,kBACZ,OAAOF,IAAa,KAAK;AAAA,kBACzB,OAAOU;AAAA,gBAAA;AAAA,cAAA;AAAA,cAERd,KACC,gBAAAe,EAACQ,GAAA,EAAM,MAAK,UAAS,SAASvB,GAAM,OAAOC,GAAQ,MAAMD,EAAA,CAAM;AAAA,cAEhEQ,KACC,gBAAAO;AAAA,gBAACS;AAAA,gBAAA;AAAA,kBACC,QAAQ,EAAE,iBAAiB,MAAA;AAAA,kBAC3B,SAASd,KAAkB,gBAAAK,EAACU,GAAA,CAAA,CAAoB;AAAA,gBAAA;AAAA,cAAA;AAAA,cAGnDhB,KAAc,gBAAAM,EAACW,GAAA,EAAY,SAAS,gBAAAX,EAACY,KAAmB,GAAI;AAAA,cAC5D9B,EAAO,IAAI,CAAC+B,MACX,gBAAAb;AAAA,gBAACc;AAAA,gBAAA;AAAA,kBAEC,MAAMD,EAAE;AAAA,kBACR,MAAMA,EAAE;AAAA,kBACR,MAAM,eAAeA,EAAE,GAAG;AAAA,kBAC1B,OAAA1B;AAAA,kBACA,mBAAmB;AAAA,gBAAA;AAAA,gBALd0B,EAAE;AAAA,cAAA,CAOV;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AACAnC,EAAa,cAAc;"}
|
|
@@ -6,20 +6,20 @@ const j = t.forwardRef(
|
|
|
6
6
|
({
|
|
7
7
|
className: p,
|
|
8
8
|
type: v = "search",
|
|
9
|
-
disabled:
|
|
10
|
-
onClear:
|
|
9
|
+
disabled: n,
|
|
10
|
+
onClear: s,
|
|
11
11
|
onChange: c,
|
|
12
12
|
value: r,
|
|
13
13
|
defaultValue: u,
|
|
14
|
-
...
|
|
14
|
+
...g
|
|
15
15
|
}, i) => {
|
|
16
|
-
const d = t.useRef(null), [
|
|
16
|
+
const d = t.useRef(null), [f, l] = t.useState(
|
|
17
17
|
() => String(r ?? u ?? "").length > 0
|
|
18
18
|
);
|
|
19
19
|
t.useEffect(() => {
|
|
20
20
|
r !== void 0 && l(String(r).length > 0);
|
|
21
21
|
}, [r]);
|
|
22
|
-
const
|
|
22
|
+
const x = t.useCallback(
|
|
23
23
|
(e) => {
|
|
24
24
|
d.current = e, typeof i == "function" ? i(e) : i && (i.current = e);
|
|
25
25
|
},
|
|
@@ -27,24 +27,24 @@ const j = t.forwardRef(
|
|
|
27
27
|
), m = (e) => {
|
|
28
28
|
l(e.target.value.length > 0), c == null || c(e);
|
|
29
29
|
}, y = () => {
|
|
30
|
-
var
|
|
30
|
+
var b, h;
|
|
31
31
|
const e = d.current;
|
|
32
32
|
if (!e) return;
|
|
33
33
|
let a;
|
|
34
34
|
try {
|
|
35
|
-
a = (
|
|
36
|
-
(
|
|
35
|
+
a = (h = Object.getOwnPropertyDescriptor(
|
|
36
|
+
(b = globalThis.HTMLInputElement) == null ? void 0 : b.prototype,
|
|
37
37
|
"value"
|
|
38
|
-
)) == null ? void 0 :
|
|
38
|
+
)) == null ? void 0 : h.set;
|
|
39
39
|
} catch {
|
|
40
40
|
a = void 0;
|
|
41
41
|
}
|
|
42
|
-
a ? a.call(e, "") : e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })), l(!1), e.focus(),
|
|
42
|
+
a ? a.call(e, "") : e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })), l(!1), e.focus(), s == null || s();
|
|
43
43
|
};
|
|
44
44
|
return /* @__PURE__ */ w(
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
|
-
"data-disabled":
|
|
47
|
+
"data-disabled": n || void 0,
|
|
48
48
|
className: N(
|
|
49
49
|
"group inline-flex h-[var(--ui-input-search-box-height)] w-full min-w-0 items-center gap-[var(--ui-input-search-box-gap)] rounded-[var(--ui-input-search-box-border-radius)] border bg-[var(--ui-input-search-box-color-idle)] border-[var(--ui-input-search-border-color-idle)] px-[var(--ui-input-search-box-padding-x)] text-sm leading-6 text-[var(--ui-input-search-value-color-idle)] transition-colors not-data-[disabled]:hover:bg-[var(--ui-input-search-box-color-hover)] not-data-[disabled]:hover:border-[var(--ui-input-search-border-color-hover)] focus-within:border-[var(--ui-input-search-border-color-hover)] focus-within:ring-[3px] focus-within:ring-[var(--ui-focus-primary)] data-[disabled]:cursor-not-allowed data-[disabled]:border-[var(--ui-input-search-border-color-disabled)] data-[disabled]:bg-[var(--ui-input-search-box-color-disabled)] data-[disabled]:text-[var(--ui-input-search-value-color-disabled)]",
|
|
50
50
|
p
|
|
@@ -60,24 +60,24 @@ const j = t.forwardRef(
|
|
|
60
60
|
/* @__PURE__ */ o(
|
|
61
61
|
"input",
|
|
62
62
|
{
|
|
63
|
-
ref:
|
|
63
|
+
ref: x,
|
|
64
64
|
type: v,
|
|
65
|
-
disabled:
|
|
65
|
+
disabled: n,
|
|
66
66
|
value: r,
|
|
67
67
|
defaultValue: u,
|
|
68
68
|
onChange: m,
|
|
69
69
|
"aria-label": "Search",
|
|
70
70
|
className: "h-full min-w-0 flex-1 border-0 bg-transparent p-0 text-inherit outline-none placeholder:text-[var(--ui-input-search-placeholder-color-idle)] disabled:cursor-not-allowed [&::-webkit-search-cancel-button]:appearance-none",
|
|
71
|
-
...
|
|
71
|
+
...g
|
|
72
72
|
}
|
|
73
73
|
),
|
|
74
|
-
|
|
74
|
+
f && !n && /* @__PURE__ */ o(
|
|
75
75
|
"button",
|
|
76
76
|
{
|
|
77
77
|
type: "button",
|
|
78
78
|
"aria-label": "Clear search",
|
|
79
79
|
onClick: y,
|
|
80
|
-
className: "inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm text-[var(--ui-button-icon-global-icon-color-idle)] outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)] [&>svg]:size-4",
|
|
80
|
+
className: "inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm p-0.5 text-[var(--ui-button-icon-global-icon-color-idle)] outline-none hover:bg-[var(--ui-button-icon-global-container-color-hover)] active:bg-[var(--ui-button-icon-global-container-color-active)] focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)] [&>svg]:size-4",
|
|
81
81
|
children: /* @__PURE__ */ o(k, { size: 16 })
|
|
82
82
|
}
|
|
83
83
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sources":["../../../../src/components/ui/search/search.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n MagnifierIcon,\n TimesIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// Internal primitive: the bare search box behind the public `InputSearch` field\n// (which is also exported as `Search`). Not exported from the package; consumed\n// by `input-search`. A bordered box (the dedicated `--ui-input-search-*` token\n// tier) holding a leading magnifier, a borderless native input, and a trailing\n// clear button shown once there's a value. The box owns the visual state via\n// `focus-within` (the input-search tier has no focus/active border token, so the\n// focused border reuses `--ui-input-search-border-color-hover` plus a 3px\n// `--ui-focus-primary` ring) / hover / disabled; the magnifier uses\n// `--ui-input-search-icon-search-color-{idle,disabled}` (via the `group`) and the\n// clear button is a ghost ButtonIcon, so its glyph uses\n// `--ui-button-icon-global-icon-color-idle` (the input-search tier dropped its own\n// clear-icon token in the Figma sync).\n\nexport interface SearchBoxProps extends React.ComponentPropsWithoutRef<'input'> {\n /** Called when the clear (×) button is pressed, after the value is cleared. */\n onClear?: () => void;\n}\n\nconst SearchBox = React.forwardRef<HTMLInputElement, SearchBoxProps>(\n (\n {\n className,\n type = 'search',\n disabled,\n onClear,\n onChange,\n value,\n defaultValue,\n ...props\n },\n forwardedRef\n ) => {\n const innerRef = React.useRef<HTMLInputElement>(null);\n const [hasValue, setHasValue] = React.useState(\n () => String(value ?? defaultValue ?? '').length > 0\n );\n\n // Keep the clear button in sync when the value is controlled externally.\n React.useEffect(() => {\n if (value !== undefined) setHasValue(String(value).length > 0);\n }, [value]);\n\n const setRefs = React.useCallback(\n (node: HTMLInputElement | null) => {\n innerRef.current = node;\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef]\n );\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n setHasValue(event.target.value.length > 0);\n onChange?.(event);\n };\n\n const handleClear = () => {\n const input = innerRef.current;\n if (!input) return;\n // Use the native value setter when available + dispatch a real input event\n // so React's onChange fires for both controlled and uncontrolled usage.\n let setter: ((this: HTMLInputElement, value: string) => void) | undefined;\n try {\n setter = Object.getOwnPropertyDescriptor(\n globalThis.HTMLInputElement?.prototype,\n 'value'\n )?.set;\n } catch {\n setter = undefined;\n }\n\n if (setter) setter.call(input, '');\n else input.value = '';\n\n input.dispatchEvent(new Event('input', { bubbles: true }));\n setHasValue(false);\n input.focus();\n onClear?.();\n };\n\n return (\n <div\n data-disabled={disabled || undefined}\n className={cn(\n 'group inline-flex h-[var(--ui-input-search-box-height)] w-full min-w-0 items-center gap-[var(--ui-input-search-box-gap)] rounded-[var(--ui-input-search-box-border-radius)] border bg-[var(--ui-input-search-box-color-idle)] border-[var(--ui-input-search-border-color-idle)] px-[var(--ui-input-search-box-padding-x)] text-sm leading-6 text-[var(--ui-input-search-value-color-idle)] transition-colors not-data-[disabled]:hover:bg-[var(--ui-input-search-box-color-hover)] not-data-[disabled]:hover:border-[var(--ui-input-search-border-color-hover)] focus-within:border-[var(--ui-input-search-border-color-hover)] focus-within:ring-[3px] focus-within:ring-[var(--ui-focus-primary)] data-[disabled]:cursor-not-allowed data-[disabled]:border-[var(--ui-input-search-border-color-disabled)] data-[disabled]:bg-[var(--ui-input-search-box-color-disabled)] data-[disabled]:text-[var(--ui-input-search-value-color-disabled)]',\n className\n )}\n >\n <MagnifierIcon\n size={16}\n className=\"shrink-0 text-[var(--ui-input-search-icon-search-color-idle)] group-data-[disabled]:text-[var(--ui-input-search-icon-search-color-disabled)]\"\n />\n <input\n ref={setRefs}\n type={type}\n disabled={disabled}\n value={value}\n defaultValue={defaultValue}\n onChange={handleChange}\n aria-label=\"Search\"\n className=\"h-full min-w-0 flex-1 border-0 bg-transparent p-0 text-inherit outline-none placeholder:text-[var(--ui-input-search-placeholder-color-idle)] disabled:cursor-not-allowed [&::-webkit-search-cancel-button]:appearance-none\"\n {...props}\n />\n {hasValue && !disabled && (\n <button\n type=\"button\"\n aria-label=\"Clear search\"\n onClick={handleClear}\n className=\"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm text-[var(--ui-button-icon-global-icon-color-idle)] outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)] [&>svg]:size-4\"\n >\n <TimesIcon size={16} />\n </button>\n )}\n </div>\n );\n }\n);\nSearchBox.displayName = 'SearchBox';\n\nexport { SearchBox };\n"],"names":["SearchBox","React","className","type","disabled","onClear","onChange","value","defaultValue","props","forwardedRef","innerRef","hasValue","setHasValue","setRefs","node","handleChange","event","handleClear","input","setter","_b","_a","jsxs","cn","jsx","MagnifierIcon","TimesIcon"],"mappings":";;;;AA0BA,MAAMA,IAAYC,EAAM;AAAA,EACtB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAWV,EAAM,OAAyB,IAAI,GAC9C,CAACW,GAAUC,CAAW,IAAIZ,EAAM;AAAA,MACpC,MAAM,OAAOM,KAASC,KAAgB,EAAE,EAAE,SAAS;AAAA,IAAA;AAIrD,IAAAP,EAAM,UAAU,MAAM;AACpB,MAAIM,MAAU,UAAWM,EAAY,OAAON,CAAK,EAAE,SAAS,CAAC;AAAA,IAC/D,GAAG,CAACA,CAAK,CAAC;AAEV,UAAMO,IAAUb,EAAM;AAAA,MACpB,CAACc,MAAkC;AACjC,QAAAJ,EAAS,UAAUI,GACf,OAAOL,KAAiB,aAAYA,EAAaK,CAAI,IAChDL,QAA2B,UAAUK;AAAA,MAChD;AAAA,MACA,CAACL,CAAY;AAAA,IAAA,GAGTM,IAAe,CAACC,MAA+C;AACnE,MAAAJ,EAAYI,EAAM,OAAO,MAAM,SAAS,CAAC,GACzCX,KAAA,QAAAA,EAAWW;AAAA,IACb,GAEMC,IAAc,MAAM;;AACxB,YAAMC,IAAQR,EAAS;AACvB,UAAI,CAACQ,EAAO;AAGZ,UAAIC;AACJ,UAAI;AACF,QAAAA,KAASC,IAAA,OAAO;AAAA,WACdC,IAAA,WAAW,qBAAX,gBAAAA,EAA6B;AAAA,UAC7B;AAAA,QAAA,MAFO,gBAAAD,EAGN;AAAA,MACL,QAAQ;AACN,QAAAD,IAAS;AAAA,MACX;AAEA,MAAIA,IAAQA,EAAO,KAAKD,GAAO,EAAE,MACtB,QAAQ,IAEnBA,EAAM,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,GAAA,CAAM,CAAC,GACzDN,EAAY,EAAK,GACjBM,EAAM,MAAA,GACNd,KAAA,QAAAA;AAAA,IACF;AAEA,WACE,gBAAAkB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,iBAAenB,KAAY;AAAA,QAC3B,WAAWoB;AAAA,UACT;AAAA,UACAtB;AAAA,QAAA;AAAA,QAGF,UAAA;AAAA,UAAA,gBAAAuB;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAM;AAAA,cACN,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,UAEZ,gBAAAD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAKX;AAAA,cACL,MAAAX;AAAA,cACA,UAAAC;AAAA,cACA,OAAAG;AAAA,cACA,cAAAC;AAAA,cACA,UAAUQ;AAAA,cACV,cAAW;AAAA,cACX,WAAU;AAAA,cACT,GAAGP;AAAA,YAAA;AAAA,UAAA;AAAA,UAELG,KAAY,CAACR,KACZ,gBAAAqB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,cAAW;AAAA,cACX,SAASP;AAAA,cACT,WAAU;AAAA,cAEV,UAAA,gBAAAO,EAACE,GAAA,EAAU,MAAM,GAAA,CAAI;AAAA,YAAA;AAAA,UAAA;AAAA,QACvB;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACA3B,EAAU,cAAc;"}
|
|
1
|
+
{"version":3,"file":"search.js","sources":["../../../../src/components/ui/search/search.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n MagnifierIcon,\n TimesIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// Internal primitive: the bare search box behind the public `InputSearch` field\n// (which is also exported as `Search`). Not exported from the package; consumed\n// by `input-search`. A bordered box (the dedicated `--ui-input-search-*` token\n// tier) holding a leading magnifier, a borderless native input, and a trailing\n// clear button shown once there's a value. The box owns the visual state via\n// `focus-within` (the input-search tier has no focus/active border token, so the\n// focused border reuses `--ui-input-search-border-color-hover` plus a 3px\n// `--ui-focus-primary` ring) / hover / disabled; the magnifier uses\n// `--ui-input-search-icon-search-color-{idle,disabled}` (via the `group`) and the\n// clear button is a ghost ButtonIcon, so its glyph uses\n// `--ui-button-icon-global-icon-color-idle` (the input-search tier dropped its own\n// clear-icon token in the Figma sync).\n\nexport interface SearchBoxProps extends React.ComponentPropsWithoutRef<'input'> {\n /** Called when the clear (×) button is pressed, after the value is cleared. */\n onClear?: () => void;\n}\n\nconst SearchBox = React.forwardRef<HTMLInputElement, SearchBoxProps>(\n (\n {\n className,\n type = 'search',\n disabled,\n onClear,\n onChange,\n value,\n defaultValue,\n ...props\n },\n forwardedRef\n ) => {\n const innerRef = React.useRef<HTMLInputElement>(null);\n const [hasValue, setHasValue] = React.useState(\n () => String(value ?? defaultValue ?? '').length > 0\n );\n\n // Keep the clear button in sync when the value is controlled externally.\n React.useEffect(() => {\n if (value !== undefined) setHasValue(String(value).length > 0);\n }, [value]);\n\n const setRefs = React.useCallback(\n (node: HTMLInputElement | null) => {\n innerRef.current = node;\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef]\n );\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n setHasValue(event.target.value.length > 0);\n onChange?.(event);\n };\n\n const handleClear = () => {\n const input = innerRef.current;\n if (!input) return;\n // Use the native value setter when available + dispatch a real input event\n // so React's onChange fires for both controlled and uncontrolled usage.\n let setter: ((this: HTMLInputElement, value: string) => void) | undefined;\n try {\n setter = Object.getOwnPropertyDescriptor(\n globalThis.HTMLInputElement?.prototype,\n 'value'\n )?.set;\n } catch {\n setter = undefined;\n }\n\n if (setter) setter.call(input, '');\n else input.value = '';\n\n input.dispatchEvent(new Event('input', { bubbles: true }));\n setHasValue(false);\n input.focus();\n onClear?.();\n };\n\n return (\n <div\n data-disabled={disabled || undefined}\n className={cn(\n 'group inline-flex h-[var(--ui-input-search-box-height)] w-full min-w-0 items-center gap-[var(--ui-input-search-box-gap)] rounded-[var(--ui-input-search-box-border-radius)] border bg-[var(--ui-input-search-box-color-idle)] border-[var(--ui-input-search-border-color-idle)] px-[var(--ui-input-search-box-padding-x)] text-sm leading-6 text-[var(--ui-input-search-value-color-idle)] transition-colors not-data-[disabled]:hover:bg-[var(--ui-input-search-box-color-hover)] not-data-[disabled]:hover:border-[var(--ui-input-search-border-color-hover)] focus-within:border-[var(--ui-input-search-border-color-hover)] focus-within:ring-[3px] focus-within:ring-[var(--ui-focus-primary)] data-[disabled]:cursor-not-allowed data-[disabled]:border-[var(--ui-input-search-border-color-disabled)] data-[disabled]:bg-[var(--ui-input-search-box-color-disabled)] data-[disabled]:text-[var(--ui-input-search-value-color-disabled)]',\n className\n )}\n >\n <MagnifierIcon\n size={16}\n className=\"shrink-0 text-[var(--ui-input-search-icon-search-color-idle)] group-data-[disabled]:text-[var(--ui-input-search-icon-search-color-disabled)]\"\n />\n <input\n ref={setRefs}\n type={type}\n disabled={disabled}\n value={value}\n defaultValue={defaultValue}\n onChange={handleChange}\n aria-label=\"Search\"\n className=\"h-full min-w-0 flex-1 border-0 bg-transparent p-0 text-inherit outline-none placeholder:text-[var(--ui-input-search-placeholder-color-idle)] disabled:cursor-not-allowed [&::-webkit-search-cancel-button]:appearance-none\"\n {...props}\n />\n {hasValue && !disabled && (\n <button\n type=\"button\"\n aria-label=\"Clear search\"\n onClick={handleClear}\n className=\"inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm p-0.5 text-[var(--ui-button-icon-global-icon-color-idle)] outline-none hover:bg-[var(--ui-button-icon-global-container-color-hover)] active:bg-[var(--ui-button-icon-global-container-color-active)] focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)] [&>svg]:size-4\"\n >\n <TimesIcon size={16} />\n </button>\n )}\n </div>\n );\n }\n);\nSearchBox.displayName = 'SearchBox';\n\nexport { SearchBox };\n"],"names":["SearchBox","React","className","type","disabled","onClear","onChange","value","defaultValue","props","forwardedRef","innerRef","hasValue","setHasValue","setRefs","node","handleChange","event","handleClear","input","setter","_b","_a","jsxs","cn","jsx","MagnifierIcon","TimesIcon"],"mappings":";;;;AA0BA,MAAMA,IAAYC,EAAM;AAAA,EACtB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAWV,EAAM,OAAyB,IAAI,GAC9C,CAACW,GAAUC,CAAW,IAAIZ,EAAM;AAAA,MACpC,MAAM,OAAOM,KAASC,KAAgB,EAAE,EAAE,SAAS;AAAA,IAAA;AAIrD,IAAAP,EAAM,UAAU,MAAM;AACpB,MAAIM,MAAU,UAAWM,EAAY,OAAON,CAAK,EAAE,SAAS,CAAC;AAAA,IAC/D,GAAG,CAACA,CAAK,CAAC;AAEV,UAAMO,IAAUb,EAAM;AAAA,MACpB,CAACc,MAAkC;AACjC,QAAAJ,EAAS,UAAUI,GACf,OAAOL,KAAiB,aAAYA,EAAaK,CAAI,IAChDL,QAA2B,UAAUK;AAAA,MAChD;AAAA,MACA,CAACL,CAAY;AAAA,IAAA,GAGTM,IAAe,CAACC,MAA+C;AACnE,MAAAJ,EAAYI,EAAM,OAAO,MAAM,SAAS,CAAC,GACzCX,KAAA,QAAAA,EAAWW;AAAA,IACb,GAEMC,IAAc,MAAM;;AACxB,YAAMC,IAAQR,EAAS;AACvB,UAAI,CAACQ,EAAO;AAGZ,UAAIC;AACJ,UAAI;AACF,QAAAA,KAASC,IAAA,OAAO;AAAA,WACdC,IAAA,WAAW,qBAAX,gBAAAA,EAA6B;AAAA,UAC7B;AAAA,QAAA,MAFO,gBAAAD,EAGN;AAAA,MACL,QAAQ;AACN,QAAAD,IAAS;AAAA,MACX;AAEA,MAAIA,IAAQA,EAAO,KAAKD,GAAO,EAAE,MACtB,QAAQ,IAEnBA,EAAM,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,GAAA,CAAM,CAAC,GACzDN,EAAY,EAAK,GACjBM,EAAM,MAAA,GACNd,KAAA,QAAAA;AAAA,IACF;AAEA,WACE,gBAAAkB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,iBAAenB,KAAY;AAAA,QAC3B,WAAWoB;AAAA,UACT;AAAA,UACAtB;AAAA,QAAA;AAAA,QAGF,UAAA;AAAA,UAAA,gBAAAuB;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAM;AAAA,cACN,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,UAEZ,gBAAAD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAKX;AAAA,cACL,MAAAX;AAAA,cACA,UAAAC;AAAA,cACA,OAAAG;AAAA,cACA,cAAAC;AAAA,cACA,UAAUQ;AAAA,cACV,cAAW;AAAA,cACX,WAAU;AAAA,cACT,GAAGP;AAAA,YAAA;AAAA,UAAA;AAAA,UAELG,KAAY,CAACR,KACZ,gBAAAqB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,cAAW;AAAA,cACX,SAASP;AAAA,cACT,WAAU;AAAA,cAEV,UAAA,gBAAAO,EAACE,GAAA,EAAU,MAAM,GAAA,CAAI;AAAA,YAAA;AAAA,UAAA;AAAA,QACvB;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACA3B,EAAU,cAAc;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as l, jsx as e, Fragment as
|
|
2
|
-
import { Sheet as
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as l, jsx as e, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { Sheet as S, SheetTrigger as D, SheetContent as x, SheetHeader as L, SheetTitle as N, SheetCloseButton as E, SheetBody as T, SheetFooter as b } from "./sheet.js";
|
|
3
|
+
import { Loading as j } from "../loading/loading.js";
|
|
4
4
|
import { Empty as w, EmptyHeader as B, EmptyTitle as v, EmptyDescription as C } from "../empty/empty.js";
|
|
5
5
|
import { DescriptionList as F, DescriptionListItem as H, DescriptionListLabel as I, DescriptionListValue as V } from "../description-list/description-list.js";
|
|
6
6
|
function k({
|
|
7
7
|
contentState: t,
|
|
8
8
|
properties: i,
|
|
9
9
|
children: n,
|
|
10
|
-
emptyTitle:
|
|
11
|
-
emptyDescription:
|
|
10
|
+
emptyTitle: d,
|
|
11
|
+
emptyDescription: h,
|
|
12
12
|
errorTitle: m,
|
|
13
13
|
errorDescription: s
|
|
14
14
|
}) {
|
|
@@ -17,11 +17,11 @@ function k({
|
|
|
17
17
|
if (t === "empty" || t === "error") {
|
|
18
18
|
const r = t === "error";
|
|
19
19
|
return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ l(B, { children: [
|
|
20
|
-
/* @__PURE__ */ e(v, { children: r ? m ?? "Something went wrong" :
|
|
21
|
-
/* @__PURE__ */ e(C, { children: r ? s ?? "The details could not be loaded." :
|
|
20
|
+
/* @__PURE__ */ e(v, { children: r ? m ?? "Something went wrong" : d ?? "Nothing to show" }),
|
|
21
|
+
/* @__PURE__ */ e(C, { children: r ? s ?? "The details could not be loaded." : h ?? "There are no details to display yet." })
|
|
22
22
|
] }) });
|
|
23
23
|
}
|
|
24
|
-
return n ? /* @__PURE__ */ e(
|
|
24
|
+
return n ? /* @__PURE__ */ e(p, { children: n }) : i != null && i.length ? /* @__PURE__ */ e(
|
|
25
25
|
F,
|
|
26
26
|
{
|
|
27
27
|
className: "-mx-6",
|
|
@@ -37,8 +37,8 @@ function q({
|
|
|
37
37
|
open: t,
|
|
38
38
|
defaultOpen: i,
|
|
39
39
|
onOpenChange: n,
|
|
40
|
-
title:
|
|
41
|
-
side:
|
|
40
|
+
title: d,
|
|
41
|
+
side: h = "right",
|
|
42
42
|
contentState: m = "content",
|
|
43
43
|
properties: s,
|
|
44
44
|
children: r,
|
|
@@ -48,14 +48,14 @@ function q({
|
|
|
48
48
|
emptyDescription: u,
|
|
49
49
|
errorTitle: f,
|
|
50
50
|
errorDescription: y,
|
|
51
|
-
portalContainer:
|
|
51
|
+
portalContainer: g
|
|
52
52
|
}) {
|
|
53
|
-
return /* @__PURE__ */ l(
|
|
53
|
+
return /* @__PURE__ */ l(S, { open: t, defaultOpen: i, onOpenChange: n, children: [
|
|
54
54
|
c ? /* @__PURE__ */ e(D, { render: c }) : null,
|
|
55
|
-
/* @__PURE__ */ l(x, { side:
|
|
56
|
-
/* @__PURE__ */ l(
|
|
57
|
-
/* @__PURE__ */ e(
|
|
58
|
-
/* @__PURE__ */ e(
|
|
55
|
+
/* @__PURE__ */ l(x, { side: h, portalContainer: g, children: [
|
|
56
|
+
/* @__PURE__ */ l(L, { children: [
|
|
57
|
+
/* @__PURE__ */ e(N, { children: d }),
|
|
58
|
+
/* @__PURE__ */ e(E, {})
|
|
59
59
|
] }),
|
|
60
60
|
/* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(
|
|
61
61
|
k,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet-details.js","sources":["../../../../src/components/ui/sheet/sheet-details.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n DescriptionList,\n DescriptionListItem,\n DescriptionListLabel,\n DescriptionListValue,\n} from '../description-list';\nimport {\n Empty,\n EmptyDescription,\n EmptyHeader,\n EmptyTitle,\n} from '../empty';\nimport {
|
|
1
|
+
{"version":3,"file":"sheet-details.js","sources":["../../../../src/components/ui/sheet/sheet-details.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n DescriptionList,\n DescriptionListItem,\n DescriptionListLabel,\n DescriptionListValue,\n} from '../description-list';\nimport {\n Empty,\n EmptyDescription,\n EmptyHeader,\n EmptyTitle,\n} from '../empty';\nimport { Loading } from '../loading';\nimport {\n Sheet,\n SheetBody,\n SheetCloseButton,\n type SheetContentProps,\n SheetContent,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from './sheet';\n\n// `SheetDetails` is the preset for the `sheet-detail-panel` usage pattern — the\n// \"easy path that IS the pattern\". It bakes a right-anchored Sheet's header\n// (title + close), a body that switches by `contentState`\n// (loading → Loading, empty/error → Empty, else a key/value property list or\n// custom children), and an optional footer of actions — so consumers don't\n// re-assemble (or hand-roll) the recipe. For anything outside the recipe, compose\n// the `Sheet*` parts directly. (React composition of the Vue kit's `Details`.)\n\nexport interface SheetDetailsProperty {\n label: React.ReactNode;\n value: React.ReactNode;\n}\n\nexport type SheetDetailsContentState = 'content' | 'loading' | 'empty' | 'error';\n\nexport interface SheetDetailsProps {\n /** Controlled open state. Pair with `onOpenChange`. */\n open?: boolean;\n /** Initial open state when uncontrolled. */\n defaultOpen?: boolean;\n /** Fires when the sheet opens or closes. */\n onOpenChange?: (open: boolean, eventDetails: unknown) => void;\n /** Panel title (header). Also the accessible name. */\n title: React.ReactNode;\n /** Edge the panel anchors to. Defaults to `right`. */\n side?: SheetContentProps['side'];\n /** Which body view to show. Defaults to `content`. */\n contentState?: SheetDetailsContentState;\n /** Key/value rows rendered as the body in the `content` state (unless `children`). */\n properties?: SheetDetailsProperty[];\n /** Custom body for the `content` state — overrides `properties`. */\n children?: React.ReactNode;\n /** Footer action(s). Omit for no footer. */\n actions?: React.ReactNode;\n /** Optional trigger element (rendered via the Sheet trigger's `render`). */\n trigger?: React.ReactElement;\n /** Empty-state copy (`contentState=\"empty\"`). */\n emptyTitle?: React.ReactNode;\n emptyDescription?: React.ReactNode;\n /** Error-state copy (`contentState=\"error\"`). */\n errorTitle?: React.ReactNode;\n errorDescription?: React.ReactNode;\n /** Portal container (shadow-root mount for isolated previews). */\n portalContainer?: SheetContentProps['portalContainer'];\n}\n\nfunction SheetDetailsBody({\n contentState,\n properties,\n children,\n emptyTitle,\n emptyDescription,\n errorTitle,\n errorDescription,\n}: Pick<\n SheetDetailsProps,\n | 'contentState'\n | 'properties'\n | 'children'\n | 'emptyTitle'\n | 'emptyDescription'\n | 'errorTitle'\n | 'errorDescription'\n>) {\n if (contentState === 'loading') {\n return (\n <div className=\"flex h-40 items-center justify-center\">\n <Loading />\n </div>\n );\n }\n if (contentState === 'empty' || contentState === 'error') {\n const isError = contentState === 'error';\n return (\n <Empty>\n <EmptyHeader>\n <EmptyTitle>\n {isError\n ? (errorTitle ?? 'Something went wrong')\n : (emptyTitle ?? 'Nothing to show')}\n </EmptyTitle>\n <EmptyDescription>\n {isError\n ? (errorDescription ?? 'The details could not be loaded.')\n : (emptyDescription ?? 'There are no details to display yet.')}\n </EmptyDescription>\n </EmptyHeader>\n </Empty>\n );\n }\n if (children) return <>{children}</>;\n if (properties?.length) {\n // Render through DescriptionList. `-mx-6` cancels the SheetBody padding so\n // the row dividers go full-bleed while the content stays aligned at the\n // panel's 24px inset; the label column is tightened for the narrow panel.\n return (\n <DescriptionList\n className=\"-mx-6\"\n style={{ '--description-list-label': '9rem' } as React.CSSProperties}\n >\n {properties.map((p, i) => (\n <DescriptionListItem key={i}>\n <DescriptionListLabel className=\"text-muted-foreground\">\n {p.label}\n </DescriptionListLabel>\n <DescriptionListValue className=\"font-medium\">\n {p.value}\n </DescriptionListValue>\n </DescriptionListItem>\n ))}\n </DescriptionList>\n );\n }\n return null;\n}\n\nfunction SheetDetails({\n open,\n defaultOpen,\n onOpenChange,\n title,\n side = 'right',\n contentState = 'content',\n properties,\n children,\n actions,\n trigger,\n emptyTitle,\n emptyDescription,\n errorTitle,\n errorDescription,\n portalContainer,\n}: SheetDetailsProps) {\n return (\n <Sheet open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n {trigger ? <SheetTrigger render={trigger} /> : null}\n <SheetContent side={side} portalContainer={portalContainer}>\n <SheetHeader>\n <SheetTitle>{title}</SheetTitle>\n <SheetCloseButton />\n </SheetHeader>\n <SheetBody>\n <SheetDetailsBody\n contentState={contentState}\n properties={properties}\n emptyTitle={emptyTitle}\n emptyDescription={emptyDescription}\n errorTitle={errorTitle}\n errorDescription={errorDescription}\n >\n {children}\n </SheetDetailsBody>\n </SheetBody>\n {actions ? <SheetFooter>{actions}</SheetFooter> : null}\n </SheetContent>\n </Sheet>\n );\n}\nSheetDetails.displayName = 'SheetDetails';\n\nexport { SheetDetails };\n"],"names":["SheetDetailsBody","contentState","properties","children","emptyTitle","emptyDescription","errorTitle","errorDescription","jsx","Loading","isError","Empty","jsxs","EmptyHeader","EmptyTitle","EmptyDescription","Fragment","DescriptionList","p","i","DescriptionListItem","DescriptionListLabel","DescriptionListValue","SheetDetails","open","defaultOpen","onOpenChange","title","side","actions","trigger","portalContainer","Sheet","SheetTrigger","SheetContent","SheetHeader","SheetTitle","SheetCloseButton","SheetBody","SheetFooter"],"mappings":";;;;;AAyEA,SAASA,EAAiB;AAAA,EACxB,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,kBAAAC;AACF,GASG;AACD,MAAIN,MAAiB;AACnB,6BACG,OAAA,EAAI,WAAU,yCACb,UAAA,gBAAAO,EAACC,KAAQ,GACX;AAGJ,MAAIR,MAAiB,WAAWA,MAAiB,SAAS;AACxD,UAAMS,IAAUT,MAAiB;AACjC,WACE,gBAAAO,EAACG,GAAA,EACC,UAAA,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAL,EAACM,GAAA,EACE,UAAAJ,IACIJ,KAAc,yBACdF,KAAc,mBACrB;AAAA,wBACCW,GAAA,EACE,UAAAL,IACIH,KAAoB,qCACpBF,KAAoB,uCAAA,CAC3B;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAEJ;AACA,SAAIF,IAAiB,gBAAAK,EAAAQ,GAAA,EAAG,UAAAb,EAAA,CAAS,IAC7BD,KAAA,QAAAA,EAAY,SAKZ,gBAAAM;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,4BAA4B,OAAA;AAAA,MAEpC,YAAW,IAAI,CAACC,GAAGC,wBACjBC,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAZ,EAACa,GAAA,EAAqB,WAAU,yBAC7B,UAAAH,EAAE,OACL;AAAA,QACA,gBAAAV,EAACc,GAAA,EAAqB,WAAU,eAC7B,YAAE,MAAA,CACL;AAAA,MAAA,EAAA,GANwBH,CAO1B,CACD;AAAA,IAAA;AAAA,EAAA,IAIA;AACT;AAEA,SAASI,EAAa;AAAA,EACpB,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,cAAA3B,IAAe;AAAA,EACf,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAA0B;AAAA,EACA,SAAAC;AAAA,EACA,YAAA1B;AAAA,EACA,kBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,iBAAAwB;AACF,GAAsB;AACpB,SACE,gBAAAnB,EAACoB,GAAA,EAAM,MAAAR,GAAY,aAAAC,GAA0B,cAAAC,GAC1C,UAAA;AAAA,IAAAI,IAAU,gBAAAtB,EAACyB,GAAA,EAAa,QAAQH,EAAA,CAAS,IAAK;AAAA,IAC/C,gBAAAlB,EAACsB,GAAA,EAAa,MAAAN,GAAY,iBAAAG,GACxB,UAAA;AAAA,MAAA,gBAAAnB,EAACuB,GAAA,EACC,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,KAAY,UAAAT,EAAA,CAAM;AAAA,0BAClBU,GAAA,CAAA,CAAiB;AAAA,MAAA,GACpB;AAAA,wBACCC,GAAA,EACC,UAAA,gBAAA9B;AAAA,QAACR;AAAA,QAAA;AAAA,UACC,cAAAC;AAAA,UACA,YAAAC;AAAA,UACA,YAAAE;AAAA,UACA,kBAAAC;AAAA,UACA,YAAAC;AAAA,UACA,kBAAAC;AAAA,UAEC,UAAAJ;AAAA,QAAA;AAAA,MAAA,GAEL;AAAA,MACC0B,IAAU,gBAAArB,EAAC+B,GAAA,EAAa,UAAAV,EAAA,CAAQ,IAAiB;AAAA,IAAA,EAAA,CACpD;AAAA,EAAA,GACF;AAEJ;AACAN,EAAa,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","sources":["../../../../src/components/ui/spinner/spinner.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 `spinner`\n// (packages/ui-legacy/src/components/ui/spinner.tsx). A CSS loading spinner — no\n// Base UI primitive. No `--ui-spinner-*` tier; the ring color defaults to the\n// brand action blue via `text-secondary` (--ui-background-brand-secondary, used\n// through `border-current`), replacing the legacy `--spinner-color` var.\n// Override the color with a `text-*` class. `size` mirrors the legacy scale.\nconst spinnerVariants = cva(\n 'inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent text-secondary',\n {\n variants: {\n size: {\n sm: 'size-4',\n md: 'size-6',\n lg: 'size-8',\n xl: 'size-12',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n }\n);\n\nexport interface SpinnerProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof spinnerVariants> {}\n\nconst Spinner = React.forwardRef<HTMLDivElement, SpinnerProps>(\n ({ className, size, ...props }, ref) => (\n <div\n ref={ref}\n role=\"status\"\n aria-label=\"Loading\"\n className={cn(spinnerVariants({ size }), className)}\n {...props}\n >\n <span className=\"sr-only\">Loading…</span>\n </div>\n )\n);\nSpinner.displayName = 'Spinner';\n\nexport { Spinner, spinnerVariants };\n"],"names":["spinnerVariants","cva","Spinner","React","className","size","props","ref","jsx","cn"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"spinner.js","sources":["../../../../src/components/ui/spinner/spinner.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 `spinner`\n// (packages/ui-legacy/src/components/ui/spinner.tsx). A CSS loading spinner — no\n// Base UI primitive. No `--ui-spinner-*` tier; the ring color defaults to the\n// brand action blue via `text-secondary` (--ui-background-brand-secondary, used\n// through `border-current`), replacing the legacy `--spinner-color` var.\n// Override the color with a `text-*` class. `size` mirrors the legacy scale.\n//\n// Internal primitive — deliberately NOT re-exported from `src/index.ts` (mirrors\n// the InputBox/SearchBox pattern). Consumed by `Loading` (its icon), `Toast` (a\n// small inline icon), and `ChartState`. Apps building a standalone loading\n// state should use `Loading`, which wraps this ring with a label and\n// placement-context container tokens.\nconst spinnerVariants = cva(\n 'inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent text-secondary',\n {\n variants: {\n size: {\n sm: 'size-4',\n md: 'size-6',\n lg: 'size-8',\n xl: 'size-12',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n }\n);\n\nexport interface SpinnerProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof spinnerVariants> {}\n\nconst Spinner = React.forwardRef<HTMLDivElement, SpinnerProps>(\n ({ className, size, ...props }, ref) => (\n <div\n ref={ref}\n role=\"status\"\n aria-label=\"Loading\"\n className={cn(spinnerVariants({ size }), className)}\n {...props}\n >\n <span className=\"sr-only\">Loading…</span>\n </div>\n )\n);\nSpinner.displayName = 'Spinner';\n\nexport { Spinner, spinnerVariants };\n"],"names":["spinnerVariants","cva","Spinner","React","className","size","props","ref","jsx","cn"],"mappings":";;;;AAiBA,MAAMA,IAAkBC;AAAA,EACtB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ,GAMMC,IAAUC,EAAM;AAAA,EACpB,CAAC,EAAE,WAAAC,GAAW,MAAAC,GAAM,GAAGC,EAAA,GAASC,MAC9B,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,MAAK;AAAA,MACL,cAAW;AAAA,MACX,WAAWE,EAAGT,EAAgB,EAAE,MAAAK,EAAA,CAAM,GAAGD,CAAS;AAAA,MACjD,GAAGE;AAAA,MAEJ,UAAA,gBAAAE,EAAC,QAAA,EAAK,WAAU,WAAU,UAAA,WAAA,CAAQ;AAAA,IAAA;AAAA,EAAA;AAGxC;AACAN,EAAQ,cAAc;"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { jsxs as x, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { cva as C } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
5
|
+
const b = a.createContext({
|
|
6
|
+
size: "medium",
|
|
7
|
+
density: "default"
|
|
8
|
+
}), z = C("flex flex-col", {
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
small: "text-xs",
|
|
12
|
+
medium: "text-sm"
|
|
13
|
+
},
|
|
14
|
+
density: {
|
|
15
|
+
compact: "",
|
|
16
|
+
default: ""
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
size: "medium",
|
|
21
|
+
density: "default"
|
|
22
|
+
}
|
|
23
|
+
}), p = a.forwardRef(
|
|
24
|
+
({ className: d, size: s, density: n, children: o, ...u }, r) => {
|
|
25
|
+
const i = a.useMemo(
|
|
26
|
+
() => ({ size: s ?? "medium", density: n ?? "default" }),
|
|
27
|
+
[s, n]
|
|
28
|
+
);
|
|
29
|
+
return /* @__PURE__ */ t(b.Provider, { value: i, children: /* @__PURE__ */ t(
|
|
30
|
+
"ol",
|
|
31
|
+
{
|
|
32
|
+
ref: r,
|
|
33
|
+
"data-size": i.size,
|
|
34
|
+
"data-density": i.density,
|
|
35
|
+
className: e(
|
|
36
|
+
z({ size: s, density: n }),
|
|
37
|
+
// Hide the connector on the last item — nothing follows it.
|
|
38
|
+
"[&>li:last-child_[data-slot=timeline-connector]]:hidden",
|
|
39
|
+
d
|
|
40
|
+
),
|
|
41
|
+
...u,
|
|
42
|
+
children: o
|
|
43
|
+
}
|
|
44
|
+
) });
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
p.displayName = "Timeline";
|
|
48
|
+
const T = {
|
|
49
|
+
neutral: {
|
|
50
|
+
dot: "bg-[var(--ui-text-on-status-neutral)]",
|
|
51
|
+
ring: "border-[var(--ui-text-on-status-neutral)]",
|
|
52
|
+
ringColor: "ring-[var(--ui-text-on-status-neutral)]",
|
|
53
|
+
badge: "bg-[var(--ui-background-status-neutral-pressed)] text-[var(--ui-text-on-status-neutral)]"
|
|
54
|
+
},
|
|
55
|
+
info: {
|
|
56
|
+
dot: "bg-[var(--ui-text-on-status-info)]",
|
|
57
|
+
ring: "border-[var(--ui-text-on-status-info)]",
|
|
58
|
+
ringColor: "ring-[var(--ui-text-on-status-info)]",
|
|
59
|
+
badge: "bg-[var(--ui-background-status-info-pressed)] text-[var(--ui-text-on-status-info)]"
|
|
60
|
+
},
|
|
61
|
+
success: {
|
|
62
|
+
dot: "bg-[var(--ui-text-on-status-success)]",
|
|
63
|
+
ring: "border-[var(--ui-text-on-status-success)]",
|
|
64
|
+
ringColor: "ring-[var(--ui-text-on-status-success)]",
|
|
65
|
+
badge: "bg-[var(--ui-background-status-success-pressed)] text-[var(--ui-text-on-status-success)]"
|
|
66
|
+
},
|
|
67
|
+
warning: {
|
|
68
|
+
dot: "bg-[var(--ui-text-on-status-warning)]",
|
|
69
|
+
ring: "border-[var(--ui-text-on-status-warning)]",
|
|
70
|
+
ringColor: "ring-[var(--ui-text-on-status-warning)]",
|
|
71
|
+
badge: "bg-[var(--ui-background-status-warning-pressed)] text-[var(--ui-text-on-status-warning)]"
|
|
72
|
+
},
|
|
73
|
+
danger: {
|
|
74
|
+
dot: "bg-[var(--ui-text-on-status-danger)]",
|
|
75
|
+
ring: "border-[var(--ui-text-on-status-danger)]",
|
|
76
|
+
ringColor: "ring-[var(--ui-text-on-status-danger)]",
|
|
77
|
+
badge: "bg-[var(--ui-background-status-danger-pressed)] text-[var(--ui-text-on-status-danger)]"
|
|
78
|
+
},
|
|
79
|
+
critical: {
|
|
80
|
+
dot: "bg-[var(--ui-text-on-status-critical)]",
|
|
81
|
+
ring: "border-[var(--ui-text-on-status-critical)]",
|
|
82
|
+
ringColor: "ring-[var(--ui-text-on-status-critical)]",
|
|
83
|
+
badge: "bg-[var(--ui-background-status-critical-pressed)] text-[var(--ui-text-on-status-critical)]"
|
|
84
|
+
}
|
|
85
|
+
}, y = { small: "size-2", medium: "size-2.5" }, E = { small: "size-6", medium: "size-7" }, _ = { small: 14, medium: 16 }, I = { compact: "pb-4", default: "pb-6" }, h = a.forwardRef(
|
|
86
|
+
({
|
|
87
|
+
className: d,
|
|
88
|
+
timestamp: s,
|
|
89
|
+
title: n,
|
|
90
|
+
description: o,
|
|
91
|
+
status: u = "neutral",
|
|
92
|
+
icon: r,
|
|
93
|
+
metadata: i,
|
|
94
|
+
actions: v,
|
|
95
|
+
current: c = !1,
|
|
96
|
+
disabled: g = !1,
|
|
97
|
+
children: f,
|
|
98
|
+
...N
|
|
99
|
+
}, k) => {
|
|
100
|
+
const { size: m, density: w } = a.useContext(b), l = T[u];
|
|
101
|
+
return /* @__PURE__ */ x(
|
|
102
|
+
"li",
|
|
103
|
+
{
|
|
104
|
+
ref: k,
|
|
105
|
+
"data-status": u,
|
|
106
|
+
"data-current": c || void 0,
|
|
107
|
+
"data-disabled": g || void 0,
|
|
108
|
+
"aria-disabled": g || void 0,
|
|
109
|
+
className: e(
|
|
110
|
+
"flex gap-3",
|
|
111
|
+
g && "opacity-60 pointer-events-none",
|
|
112
|
+
d
|
|
113
|
+
),
|
|
114
|
+
...N,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ x("div", { className: "flex flex-col items-center", children: [
|
|
117
|
+
r != null ? /* @__PURE__ */ t(
|
|
118
|
+
"span",
|
|
119
|
+
{
|
|
120
|
+
"aria-hidden": !0,
|
|
121
|
+
className: e(
|
|
122
|
+
"flex shrink-0 items-center justify-center rounded-full [&_svg]:shrink-0",
|
|
123
|
+
E[m],
|
|
124
|
+
l.badge,
|
|
125
|
+
// Ring the badge for a `current` item (same emphasis as the dot).
|
|
126
|
+
c && e(
|
|
127
|
+
"ring-2 ring-offset-2 ring-offset-background",
|
|
128
|
+
l.ringColor
|
|
129
|
+
)
|
|
130
|
+
),
|
|
131
|
+
children: a.isValidElement(r) ? a.cloneElement(
|
|
132
|
+
r,
|
|
133
|
+
{ size: _[m] }
|
|
134
|
+
) : r
|
|
135
|
+
}
|
|
136
|
+
) : /* @__PURE__ */ t(
|
|
137
|
+
"span",
|
|
138
|
+
{
|
|
139
|
+
"aria-hidden": !0,
|
|
140
|
+
className: e(
|
|
141
|
+
"mt-1 shrink-0 rounded-full",
|
|
142
|
+
y[m],
|
|
143
|
+
c ? e("border-2 bg-background", l.ring) : l.dot
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
/* @__PURE__ */ t(
|
|
148
|
+
"span",
|
|
149
|
+
{
|
|
150
|
+
"data-slot": "timeline-connector",
|
|
151
|
+
"aria-hidden": !0,
|
|
152
|
+
className: "mt-1 w-px flex-1 bg-border"
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
] }),
|
|
156
|
+
/* @__PURE__ */ x("div", { className: e("min-w-0 flex-1", I[w]), children: [
|
|
157
|
+
s != null && /* @__PURE__ */ t("div", { className: "text-xs leading-tight text-muted-foreground", children: s }),
|
|
158
|
+
/* @__PURE__ */ t("div", { className: "font-medium leading-snug text-foreground", children: n }),
|
|
159
|
+
o != null && /* @__PURE__ */ t("div", { className: "mt-0.5 text-muted-foreground", children: o }),
|
|
160
|
+
i != null && /* @__PURE__ */ t("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: i }),
|
|
161
|
+
v != null && /* @__PURE__ */ t("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: v }),
|
|
162
|
+
f != null && /* @__PURE__ */ t("div", { className: "mt-2", children: f })
|
|
163
|
+
] })
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
h.displayName = "Timeline.Item";
|
|
170
|
+
const S = Object.assign(p, { Item: h });
|
|
171
|
+
export {
|
|
172
|
+
S as Timeline,
|
|
173
|
+
h as TimelineItem
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=timeline.js.map
|