@acronis-platform/ui-react 4.1.0 → 5.1.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 +191 -85
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +288 -225
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/card-widget-carousel/card-widget-carousel.js +85 -0
- package/dist/components/ui/card-widget-carousel/card-widget-carousel.js.map +1 -0
- package/dist/components/ui/card-widget-carousel/card-widget.js +82 -0
- package/dist/components/ui/card-widget-carousel/card-widget.js.map +1 -0
- package/dist/components/ui/category-bar/category-bar.js.map +1 -1
- package/dist/components/ui/chart/chart-format.js +25 -22
- package/dist/components/ui/chart/chart-format.js.map +1 -1
- package/dist/components/ui/chart/chart-palette.js +9 -8
- package/dist/components/ui/chart/chart-palette.js.map +1 -1
- package/dist/components/ui/chart/chart.js +127 -89
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/funnel-chart/funnel-chart.js +189 -113
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/input-select/input-select.js +18 -9
- package/dist/components/ui/input-select/input-select.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +194 -86
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +76 -66
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/scatter-chart/scatter-chart.js +5 -2
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/separator/separator.js +52 -10
- package/dist/components/ui/separator/separator.js.map +1 -1
- package/dist/components/ui/sidebar-secondary/sidebar-secondary.js +144 -121
- package/dist/components/ui/sidebar-secondary/sidebar-secondary.js.map +1 -1
- package/dist/components/ui/tree-item/tree-item.js +67 -0
- package/dist/components/ui/tree-item/tree-item.js.map +1 -0
- package/dist/components/ui/treemap/treemap.js +73 -66
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/index.js +109 -107
- package/dist/llms/area-chart.md +2 -1
- package/dist/llms/bar-chart.md +132 -33
- package/dist/llms/card-widget-carousel.md +252 -0
- package/dist/llms/category-bar.md +2 -2
- package/dist/llms/funnel-chart.md +269 -101
- package/dist/llms/input-select.md +175 -1
- package/dist/llms/line-chart.md +2 -1
- package/dist/llms/metric.md +10 -5
- package/dist/llms/radar-chart.md +15 -5
- package/dist/llms/scatter-chart.md +2 -1
- package/dist/llms/separator.md +27 -8
- package/dist/llms/sidebar-secondary.md +235 -4
- package/dist/llms/tree-item.md +359 -0
- package/dist/llms/treemap.md +47 -36
- package/dist/llms.txt +5 -4
- package/dist/react.js +109 -107
- package/dist/src/components/ui/area-chart/area-chart.d.ts +10 -0
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +75 -10
- package/dist/src/components/ui/bar-chart/bar-chart.docs.d.ts +146 -0
- package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/card-widget-carousel/card-widget-carousel.d.ts +9 -0
- package/dist/src/components/ui/card-widget-carousel/card-widget.d.ts +43 -0
- package/dist/src/components/ui/card-widget-carousel/index.d.ts +2 -0
- package/dist/src/components/ui/chart/chart-format.d.ts +9 -1
- package/dist/src/components/ui/chart/chart-palette.d.ts +38 -10
- package/dist/src/components/ui/chart/chart.d.ts +8 -1
- package/dist/src/components/ui/chart/index.d.ts +2 -2
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +92 -26
- package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
- package/dist/src/components/ui/input-select/input-select.d.ts +34 -2
- package/dist/src/components/ui/line-chart/line-chart.d.ts +11 -1
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +42 -9
- package/dist/src/components/ui/separator/separator.d.ts +9 -1
- package/dist/src/components/ui/sidebar-secondary/sidebar-secondary.d.ts +23 -3
- package/dist/src/components/ui/tree-item/index.d.ts +1 -0
- package/dist/src/components/ui/tree-item/tree-item.d.ts +64 -0
- package/dist/src/components/ui/treemap/treemap.d.ts +16 -5
- package/dist/src/index.d.ts +2 -1
- package/dist/ui-react.css +1 -1
- package/package.json +1 -1
- package/dist/components/ui/meter/meter.js +0 -79
- package/dist/components/ui/meter/meter.js.map +0 -1
- package/dist/llms/meter.md +0 -177
- package/dist/src/components/ui/meter/index.d.ts +0 -1
- package/dist/src/components/ui/meter/meter.d.ts +0 -25
|
@@ -1,16 +1,58 @@
|
|
|
1
1
|
import { cn as e } from "../../../lib/utils.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { cva as t } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { Separator as i } from "@base-ui/react/separator";
|
|
5
6
|
//#region src/components/ui/separator/separator.tsx
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
var a = t("shrink-0 bg-[var(--ui-border-on-surface-divider)]", {
|
|
8
|
+
variants: {
|
|
9
|
+
orientation: {
|
|
10
|
+
horizontal: "h-px w-full",
|
|
11
|
+
vertical: "h-full w-px"
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
S1: "",
|
|
15
|
+
S2: "",
|
|
16
|
+
S3: ""
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
compoundVariants: [
|
|
20
|
+
{
|
|
21
|
+
orientation: "horizontal",
|
|
22
|
+
size: "S2",
|
|
23
|
+
class: "my-[var(--ui-gap-4)]"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
orientation: "horizontal",
|
|
27
|
+
size: "S3",
|
|
28
|
+
class: "my-[var(--ui-gap-8)]"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
orientation: "vertical",
|
|
32
|
+
size: "S2",
|
|
33
|
+
class: "mx-[var(--ui-gap-4)]"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
orientation: "vertical",
|
|
37
|
+
size: "S3",
|
|
38
|
+
class: "mx-[var(--ui-gap-8)]"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
orientation: "horizontal",
|
|
43
|
+
size: "S1"
|
|
44
|
+
}
|
|
45
|
+
}), o = n.forwardRef(({ className: t, orientation: n = "horizontal", size: o = "S1", ...s }, c) => /* @__PURE__ */ r(i, {
|
|
46
|
+
ref: c,
|
|
47
|
+
orientation: n,
|
|
48
|
+
className: e(a({
|
|
49
|
+
orientation: n,
|
|
50
|
+
size: o
|
|
51
|
+
}), t),
|
|
52
|
+
...s
|
|
11
53
|
}));
|
|
12
|
-
|
|
54
|
+
o.displayName = "Separator";
|
|
13
55
|
//#endregion
|
|
14
|
-
export {
|
|
56
|
+
export { o as Separator };
|
|
15
57
|
|
|
16
58
|
//# sourceMappingURL=separator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.js","names":[],"sources":["../../../../src/components/ui/separator/separator.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Separator as SeparatorPrimitive } from '@base-ui/react/separator';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform/shadcn-uikit`'s `separator`\n// (packages/ui-legacy/src/components/ui/separator.tsx). A thin divider built on\n// the Base UI Separator primitive (sets the `separator` role + aria-orientation).\n// No `--ui-separator-*` tier; the line uses the shared divider token
|
|
1
|
+
{"version":3,"file":"separator.js","names":[],"sources":["../../../../src/components/ui/separator/separator.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Separator as SeparatorPrimitive } from '@base-ui/react/separator';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform/shadcn-uikit`'s `separator`\n// (packages/ui-legacy/src/components/ui/separator.tsx). A thin divider built on\n// the Base UI Separator primitive (sets the `separator` role + aria-orientation).\n// No `--ui-separator-*` tier; the line uses the shared divider token\n// `--ui-border-on-surface-divider` directly, matching every other divider\n// consumer in this package (Card, Wizard, Section, ...) rather than the\n// `bg-border` bridge (`--ui-border-on-surface-border`), a distinct semantic role\n// that happens to share the same value today.\n// `size` (Figma: S1/S2/S3) is the surrounding spacing Figma bakes into the\n// component itself; S1 (default) has none.\n\nconst separatorVariants = cva('shrink-0 bg-[var(--ui-border-on-surface-divider)]', {\n variants: {\n orientation: {\n horizontal: 'h-px w-full',\n vertical: 'h-full w-px',\n },\n size: {\n S1: '',\n S2: '',\n S3: '',\n },\n },\n compoundVariants: [\n { orientation: 'horizontal', size: 'S2', class: 'my-[var(--ui-gap-4)]' },\n { orientation: 'horizontal', size: 'S3', class: 'my-[var(--ui-gap-8)]' },\n { orientation: 'vertical', size: 'S2', class: 'mx-[var(--ui-gap-4)]' },\n { orientation: 'vertical', size: 'S3', class: 'mx-[var(--ui-gap-8)]' },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n size: 'S1',\n },\n});\n\ninterface SeparatorProps\n extends React.ComponentPropsWithoutRef<typeof SeparatorPrimitive>,\n Pick<VariantProps<typeof separatorVariants>, 'size'> {}\n\nconst Separator = React.forwardRef<React.ElementRef<typeof SeparatorPrimitive>, SeparatorProps>(\n ({ className, orientation = 'horizontal', size = 'S1', ...props }, ref) => (\n <SeparatorPrimitive\n ref={ref}\n orientation={orientation}\n className={cn(separatorVariants({ orientation, size }), className)}\n {...props}\n />\n )\n);\nSeparator.displayName = 'Separator';\n\nexport { Separator };\n"],"mappings":";;;;;;AAiBA,IAAM,IAAoB,EAAI,qDAAqD;CACjF,UAAU;EACR,aAAa;GACX,YAAY;GACZ,UAAU;EACZ;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,kBAAkB;EAChB;GAAE,aAAa;GAAc,MAAM;GAAM,OAAO;EAAuB;EACvE;GAAE,aAAa;GAAc,MAAM;GAAM,OAAO;EAAuB;EACvE;GAAE,aAAa;GAAY,MAAM;GAAM,OAAO;EAAuB;EACrE;GAAE,aAAa;GAAY,MAAM;GAAM,OAAO;EAAuB;CACvE;CACA,iBAAiB;EACf,aAAa;EACb,MAAM;CACR;AACF,CAAC,GAMK,IAAY,EAAM,YACrB,EAAE,cAAW,iBAAc,cAAc,UAAO,MAAM,GAAG,KAAS,MACjE,kBAAC,GAAD;CACO;CACQ;CACb,WAAW,EAAG,EAAkB;EAAE;EAAa;CAAK,CAAC,GAAG,CAAS;CACjE,GAAI;AACL,CAAA,CAEL;AACA,EAAU,cAAc"}
|
|
@@ -42,6 +42,18 @@ var g = 256, _ = g * 2, v = /* @__PURE__ */ l(s, { children: [
|
|
|
42
42
|
}),
|
|
43
43
|
" Double click"
|
|
44
44
|
] }), y = /* @__PURE__ */ l(s, { children: [
|
|
45
|
+
/* @__PURE__ */ c("span", {
|
|
46
|
+
className: "font-semibold",
|
|
47
|
+
children: "Resize:"
|
|
48
|
+
}),
|
|
49
|
+
" Drag",
|
|
50
|
+
/* @__PURE__ */ c("br", {}),
|
|
51
|
+
/* @__PURE__ */ c("span", {
|
|
52
|
+
className: "font-semibold",
|
|
53
|
+
children: "Reset size:"
|
|
54
|
+
}),
|
|
55
|
+
" Double click"
|
|
56
|
+
] }), b = /* @__PURE__ */ l(s, { children: [
|
|
45
57
|
/* @__PURE__ */ c("span", {
|
|
46
58
|
className: "font-semibold",
|
|
47
59
|
children: "Resize:"
|
|
@@ -53,11 +65,15 @@ var g = 256, _ = g * 2, v = /* @__PURE__ */ l(s, { children: [
|
|
|
53
65
|
children: "Expand:"
|
|
54
66
|
}),
|
|
55
67
|
" Click"
|
|
56
|
-
] }),
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
] }), x = /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
|
|
69
|
+
className: "font-semibold",
|
|
70
|
+
children: "Reset size:"
|
|
71
|
+
}), " Double click"] }), S = o.createContext(null);
|
|
72
|
+
function C() {
|
|
73
|
+
return o.useContext(S) ?? {
|
|
59
74
|
expanded: !0,
|
|
60
75
|
toggleExpanded: () => {},
|
|
76
|
+
collapsible: !0,
|
|
61
77
|
resizable: !1,
|
|
62
78
|
width: g,
|
|
63
79
|
setWidth: () => {},
|
|
@@ -70,25 +86,25 @@ function x() {
|
|
|
70
86
|
setSelectedLabel: () => {},
|
|
71
87
|
resizeAriaLabel: "Resize sidebar",
|
|
72
88
|
resizeTooltipExpanded: v,
|
|
73
|
-
resizeTooltipCollapsed:
|
|
89
|
+
resizeTooltipCollapsed: b
|
|
74
90
|
};
|
|
75
91
|
}
|
|
76
|
-
function
|
|
92
|
+
function w(e, t, n) {
|
|
77
93
|
let [r, i] = o.useState(t), a = e !== void 0;
|
|
78
94
|
return [a ? e : r, o.useCallback((e) => {
|
|
79
95
|
a || i(e), n?.(e);
|
|
80
96
|
}, [a, n])];
|
|
81
97
|
}
|
|
82
|
-
function
|
|
83
|
-
let t =
|
|
84
|
-
|
|
85
|
-
let
|
|
98
|
+
function T() {
|
|
99
|
+
let t = C(), { expanded: s, toggleExpanded: u, resizable: d, collapsible: f } = t, p = n(), m = o.useRef(t);
|
|
100
|
+
m.current = t;
|
|
101
|
+
let h = o.useRef(!1), [g, _] = o.useState(!1), [v, y] = o.useState(!1), b = o.useRef(null);
|
|
86
102
|
return o.useEffect(() => () => {
|
|
87
|
-
|
|
103
|
+
b.current && clearTimeout(b.current);
|
|
88
104
|
}, []), d ? /* @__PURE__ */ l(r, {
|
|
89
|
-
open:
|
|
105
|
+
open: g,
|
|
90
106
|
onOpenChange: (e) => {
|
|
91
|
-
|
|
107
|
+
v || _(e);
|
|
92
108
|
},
|
|
93
109
|
trackCursorAxis: "y",
|
|
94
110
|
children: [/* @__PURE__ */ c(a, { render: /* @__PURE__ */ c("div", {
|
|
@@ -98,103 +114,109 @@ function C() {
|
|
|
98
114
|
className: e("absolute end-0 top-0 h-full w-[17px] ltr:translate-x-1/2 rtl:-translate-x-1/2 cursor-[var(--ui-resizable-cursor,ew-resize)] z-10", "after:absolute after:inset-y-0 after:inset-x-0 after:mx-auto after:w-0 after:pointer-events-none", "after:[border-inline-start-width:var(--ui-resizable-border-width,1px)] after:border-solid after:border-transparent", "focus-visible:outline-none focus-visible:after:[border-inline-start-color:var(--ui-resizable-border-color-active)] focus-visible:after:[box-shadow:0_0_0_3px_var(--ui-focus-primary)]"),
|
|
99
115
|
tabIndex: 0,
|
|
100
116
|
onKeyDown: (e) => {
|
|
101
|
-
let { minWidth: t, maxWidth: n, defaultWidth: r, width: i, setWidth: a, expanded: o, toggleExpanded: s } =
|
|
102
|
-
if (e.key ===
|
|
103
|
-
else if (e.key ===
|
|
104
|
-
else if (e.key ===
|
|
117
|
+
let { minWidth: t, maxWidth: n, defaultWidth: r, width: i, setWidth: a, expanded: o, toggleExpanded: s, collapsible: c } = m.current, l = p === "rtl" ? "ArrowLeft" : "ArrowRight", u = p === "rtl" ? "ArrowRight" : "ArrowLeft";
|
|
118
|
+
if (e.key === l && o) e.preventDefault(), a(Math.min(i + 16, n));
|
|
119
|
+
else if (e.key === l && !o) e.preventDefault(), c && s();
|
|
120
|
+
else if (e.key === u && o) {
|
|
105
121
|
e.preventDefault();
|
|
106
122
|
let n = i - 16;
|
|
107
|
-
n < t ? s() : a(n);
|
|
108
|
-
} else e.key === "Enter" || e.key === " " ? (e.preventDefault(), s()) : e.key === "Home" && (e.preventDefault(), o
|
|
123
|
+
n < t ? c ? s() : a(t) : a(n);
|
|
124
|
+
} else e.key === "Enter" || e.key === " " ? (e.preventDefault(), c && s()) : e.key === "Home" && (e.preventDefault(), !o && c && s(), a(r));
|
|
109
125
|
},
|
|
110
126
|
onPointerDown: (e) => {
|
|
111
127
|
e.preventDefault();
|
|
112
128
|
let t = e.currentTarget;
|
|
113
|
-
t.setPointerCapture(e.pointerId),
|
|
129
|
+
t.setPointerCapture(e.pointerId), h.current = !1, y(!0), _(!1);
|
|
114
130
|
let n = t.closest("[data-state]");
|
|
115
131
|
if (!n) {
|
|
116
|
-
|
|
132
|
+
y(!1), t.releasePointerCapture(e.pointerId);
|
|
117
133
|
return;
|
|
118
134
|
}
|
|
119
135
|
n.style.transitionProperty = "none";
|
|
120
|
-
let r = getComputedStyle(n).direction === "rtl", i = n.getBoundingClientRect(), { minWidth: a, maxWidth: o } =
|
|
121
|
-
|
|
122
|
-
let t = r ? i.right - e.clientX : e.clientX - i.left, { expanded: n } =
|
|
123
|
-
n ? t < s ?
|
|
136
|
+
let r = getComputedStyle(n).direction === "rtl", i = n.getBoundingClientRect(), { minWidth: a, maxWidth: o } = m.current, s = a / 2, c = (e) => {
|
|
137
|
+
h.current = !0;
|
|
138
|
+
let t = r ? i.right - e.clientX : e.clientX - i.left, { expanded: n, collapsible: c } = m.current;
|
|
139
|
+
n ? t < s && c ? m.current.toggleExpanded() : m.current.setWidth(Math.min(Math.max(t, a), o)) : t > s && c && m.current.toggleExpanded();
|
|
124
140
|
}, l = () => {
|
|
125
|
-
|
|
141
|
+
y(!1), n && (n.style.transitionProperty = ""), window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", l);
|
|
126
142
|
};
|
|
127
143
|
window.addEventListener("pointermove", c), window.addEventListener("pointerup", l);
|
|
128
144
|
},
|
|
129
145
|
onClick: () => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}, 250));
|
|
146
|
+
f && (h.current || (b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
147
|
+
m.current.collapsible && m.current.toggleExpanded();
|
|
148
|
+
}, 250)));
|
|
133
149
|
},
|
|
134
150
|
onDoubleClick: () => {
|
|
135
|
-
|
|
151
|
+
b.current &&= (clearTimeout(b.current), null), !s && f && u(), m.current.setWidth(m.current.defaultWidth);
|
|
136
152
|
}
|
|
137
153
|
}) }), (s ? t.resizeTooltipExpanded : t.resizeTooltipCollapsed) != null && /* @__PURE__ */ c(i, {
|
|
138
|
-
side:
|
|
154
|
+
side: p === "rtl" ? "left" : "right",
|
|
139
155
|
align: "center",
|
|
140
156
|
children: s ? t.resizeTooltipExpanded : t.resizeTooltipCollapsed
|
|
141
157
|
})]
|
|
142
158
|
}) : null;
|
|
143
159
|
}
|
|
144
|
-
var
|
|
145
|
-
let [
|
|
146
|
-
|
|
147
|
-
}, [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
160
|
+
var E = o.forwardRef(({ className: t, expanded: n, defaultExpanded: r = !0, onExpandedChange: i, collapsible: a = !0, resizable: u = !0, width: d, onWidthChange: f, resizeAriaLabel: h = "Resize sidebar", resizeTooltipExpanded: C = a ? v : y, resizeTooltipCollapsed: E = a ? b : x, "aria-label": D = "Section navigation", render: O, children: A, ...j }, M) => {
|
|
161
|
+
let [N, P] = w(n, r, i), [F, I] = o.useState(g), L = d !== void 0, R = L ? d : F, z = o.useCallback((e) => {
|
|
162
|
+
e !== R && (L || I(e), f?.(e));
|
|
163
|
+
}, [
|
|
164
|
+
L,
|
|
165
|
+
f,
|
|
166
|
+
R
|
|
167
|
+
]), [B, V] = o.useState(void 0), [H, U] = o.useState(void 0), W = o.useMemo(() => ({
|
|
168
|
+
expanded: N,
|
|
169
|
+
toggleExpanded: () => P(!N),
|
|
170
|
+
collapsible: a,
|
|
171
|
+
resizable: u,
|
|
172
|
+
width: R,
|
|
173
|
+
setWidth: z,
|
|
153
174
|
minWidth: g,
|
|
154
175
|
maxWidth: _,
|
|
155
176
|
defaultWidth: g,
|
|
156
|
-
headerLabel:
|
|
157
|
-
setHeaderLabel:
|
|
158
|
-
selectedLabel:
|
|
159
|
-
setSelectedLabel:
|
|
160
|
-
resizeAriaLabel:
|
|
161
|
-
resizeTooltipExpanded:
|
|
162
|
-
resizeTooltipCollapsed:
|
|
177
|
+
headerLabel: B,
|
|
178
|
+
setHeaderLabel: V,
|
|
179
|
+
selectedLabel: H,
|
|
180
|
+
setSelectedLabel: U,
|
|
181
|
+
resizeAriaLabel: h,
|
|
182
|
+
resizeTooltipExpanded: C,
|
|
183
|
+
resizeTooltipCollapsed: E
|
|
163
184
|
}), [
|
|
164
|
-
|
|
165
|
-
|
|
185
|
+
N,
|
|
186
|
+
P,
|
|
166
187
|
a,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
L,
|
|
188
|
+
u,
|
|
189
|
+
R,
|
|
170
190
|
z,
|
|
171
|
-
|
|
191
|
+
B,
|
|
192
|
+
H,
|
|
172
193
|
h,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
194
|
+
C,
|
|
195
|
+
E
|
|
196
|
+
]), G = p({
|
|
197
|
+
render: O,
|
|
198
|
+
ref: M,
|
|
177
199
|
defaultTagName: "nav",
|
|
178
200
|
props: m({
|
|
179
|
-
"aria-label":
|
|
180
|
-
"data-state":
|
|
181
|
-
style:
|
|
182
|
-
className: e("group/sidebar relative flex h-full flex-col bg-[var(--ui-sidebar-secondary-global-container-color)] border-e border-[var(--ui-sidebar-secondary-global-container-border-color)] [border-inline-end-width:var(--ui-sidebar-secondary-global-container-border-width)] w-[var(--ui-sidebar-secondary-collapsed-container-width)] data-[state=expanded]:w-[var(--ui-sidebar-secondary-expanded-container-width)] transition-[width]",
|
|
201
|
+
"aria-label": D,
|
|
202
|
+
"data-state": N ? "expanded" : "collapsed",
|
|
203
|
+
style: u && N && (L || R !== g) ? { width: R } : void 0,
|
|
204
|
+
className: e("group/sidebar relative flex h-full flex-col bg-[var(--ui-sidebar-secondary-global-container-color)] border-e border-[var(--ui-sidebar-secondary-global-container-border-color)] [border-inline-end-width:var(--ui-sidebar-secondary-global-container-border-width)] w-[var(--ui-sidebar-secondary-collapsed-container-width)] data-[state=expanded]:w-[var(--ui-sidebar-secondary-expanded-container-width)] transition-[width]", u && "transition-[width,border-color] has-[[role=separator]:hover]:[border-inline-end-color:var(--ui-resizable-border-color-hover)] has-[[role=separator]:active]:[border-inline-end-color:var(--ui-resizable-border-color-active)] has-[[role=separator]:focus-visible]:[border-inline-end-color:var(--ui-resizable-border-color-active)]", t),
|
|
183
205
|
children: /* @__PURE__ */ l(s, { children: [
|
|
184
|
-
/* @__PURE__ */ c(
|
|
185
|
-
|
|
186
|
-
/* @__PURE__ */ c(
|
|
206
|
+
/* @__PURE__ */ c(k, {}),
|
|
207
|
+
A,
|
|
208
|
+
/* @__PURE__ */ c(T, {})
|
|
187
209
|
] })
|
|
188
|
-
},
|
|
210
|
+
}, j)
|
|
189
211
|
});
|
|
190
|
-
return /* @__PURE__ */ c(
|
|
191
|
-
value:
|
|
192
|
-
children:
|
|
212
|
+
return /* @__PURE__ */ c(S.Provider, {
|
|
213
|
+
value: W,
|
|
214
|
+
children: G
|
|
193
215
|
});
|
|
194
216
|
});
|
|
195
|
-
|
|
196
|
-
var
|
|
197
|
-
let { setHeaderLabel: s } =
|
|
217
|
+
E.displayName = "SidebarSecondary";
|
|
218
|
+
var D = o.forwardRef(({ className: t, label: n, children: r, ...i }, a) => {
|
|
219
|
+
let { setHeaderLabel: s } = C(), l = n ?? r;
|
|
198
220
|
return o.useEffect(() => {
|
|
199
221
|
s(l);
|
|
200
222
|
}, [l, s]), /* @__PURE__ */ c("div", {
|
|
@@ -207,15 +229,15 @@ var T = o.forwardRef(({ className: t, label: n, children: r, ...i }, a) => {
|
|
|
207
229
|
})
|
|
208
230
|
});
|
|
209
231
|
});
|
|
210
|
-
|
|
211
|
-
var
|
|
232
|
+
D.displayName = "SidebarSecondaryHeader";
|
|
233
|
+
var O = o.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ c("div", {
|
|
212
234
|
ref: r,
|
|
213
235
|
className: e("flex flex-1 flex-col overflow-y-auto gap-[var(--ui-sidebar-secondary-global-section-list-gap)]", "hidden group-data-[state=expanded]/sidebar:flex", t),
|
|
214
236
|
...n
|
|
215
237
|
}));
|
|
216
|
-
|
|
217
|
-
var
|
|
218
|
-
let { headerLabel: s, selectedLabel: d } =
|
|
238
|
+
O.displayName = "SidebarSecondaryContent";
|
|
239
|
+
var k = o.forwardRef(({ className: t, parentLabel: n, currentLabel: r, separator: i, ...a }, o) => {
|
|
240
|
+
let { headerLabel: s, selectedLabel: d } = C(), f = n ?? s, p = r ?? d;
|
|
219
241
|
return /* @__PURE__ */ l("div", {
|
|
220
242
|
ref: o,
|
|
221
243
|
className: e("flex flex-1 flex-col items-center min-h-0", "gap-[var(--ui-sidebar-secondary-collapsed-container-content-gap)] py-[var(--ui-sidebar-secondary-collapsed-container-content-padding-y)]", "flex group-data-[state=expanded]/sidebar:hidden", t),
|
|
@@ -237,17 +259,17 @@ var D = o.forwardRef(({ className: t, parentLabel: n, currentLabel: r, separator
|
|
|
237
259
|
]
|
|
238
260
|
});
|
|
239
261
|
});
|
|
240
|
-
|
|
241
|
-
var
|
|
262
|
+
k.displayName = "SidebarSecondaryCollapsedBreadcrumb";
|
|
263
|
+
var A = o.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ c("div", {
|
|
242
264
|
ref: r,
|
|
243
265
|
className: e("flex flex-col shrink-0", "border-t border-[var(--ui-sidebar-secondary-global-container-footer-border-color)] [border-top-width:var(--ui-sidebar-secondary-global-container-footer-border-width)]", "py-[var(--ui-sidebar-secondary-section-container-padding-y)]", t),
|
|
244
266
|
...n
|
|
245
267
|
}));
|
|
246
|
-
|
|
247
|
-
var
|
|
268
|
+
A.displayName = "SidebarSecondaryFooter";
|
|
269
|
+
var j = o.createContext({ expandable: !1 }), M = { expandable: !1 }, N = { expandable: !0 }, P = o.forwardRef(({ className: t, expandable: n = !1, open: r, defaultOpen: i = !0, onOpenChange: a, children: o, ...s }, l) => {
|
|
248
270
|
let u = e("flex flex-col py-[var(--ui-sidebar-secondary-section-container-padding-y)]", t);
|
|
249
|
-
return n ? /* @__PURE__ */ c(
|
|
250
|
-
value:
|
|
271
|
+
return n ? /* @__PURE__ */ c(j.Provider, {
|
|
272
|
+
value: N,
|
|
251
273
|
children: /* @__PURE__ */ c(f.Root, {
|
|
252
274
|
ref: l,
|
|
253
275
|
open: r,
|
|
@@ -257,8 +279,8 @@ var k = o.createContext({ expandable: !1 }), A = { expandable: !1 }, j = { expan
|
|
|
257
279
|
...s,
|
|
258
280
|
children: o
|
|
259
281
|
})
|
|
260
|
-
}) : /* @__PURE__ */ c(
|
|
261
|
-
value:
|
|
282
|
+
}) : /* @__PURE__ */ c(j.Provider, {
|
|
283
|
+
value: M,
|
|
262
284
|
children: /* @__PURE__ */ c("div", {
|
|
263
285
|
ref: l,
|
|
264
286
|
className: u,
|
|
@@ -267,9 +289,9 @@ var k = o.createContext({ expandable: !1 }), A = { expandable: !1 }, j = { expan
|
|
|
267
289
|
})
|
|
268
290
|
});
|
|
269
291
|
});
|
|
270
|
-
|
|
271
|
-
var
|
|
272
|
-
let { expandable: _ } = o.useContext(
|
|
292
|
+
P.displayName = "SidebarSecondarySection";
|
|
293
|
+
var F = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-sidebar-secondary-section-label-section-color)]", I = "min-h-[var(--ui-sidebar-secondary-menu-item-global-container-height-min)] py-[var(--ui-sidebar-secondary-section-container-header-padding-y)] px-[var(--ui-sidebar-secondary-section-container-header-padding-x)]", L = o.forwardRef(({ className: t, actions: s, unreadRollup: d, children: p, ...m }, g) => {
|
|
294
|
+
let { expandable: _ } = o.useContext(j), v = n(), y = o.useRef(null), b = o.useRef(null), x = h(b, { enabled: !0 }), S = (e) => {
|
|
273
295
|
y.current = e, typeof g == "function" ? g(e) : g && (g.current = e);
|
|
274
296
|
}, C = /* @__PURE__ */ l(r, {
|
|
275
297
|
disabled: !x,
|
|
@@ -286,7 +308,7 @@ var N = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-si
|
|
|
286
308
|
})]
|
|
287
309
|
});
|
|
288
310
|
if (!_) {
|
|
289
|
-
let n = e(
|
|
311
|
+
let n = e(F, I, t);
|
|
290
312
|
return s == null ? /* @__PURE__ */ c("div", {
|
|
291
313
|
ref: S,
|
|
292
314
|
className: e(n, "flex items-center"),
|
|
@@ -304,10 +326,10 @@ var N = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-si
|
|
|
304
326
|
}
|
|
305
327
|
return /* @__PURE__ */ l("div", {
|
|
306
328
|
ref: S,
|
|
307
|
-
className: e("flex items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)]",
|
|
329
|
+
className: e("flex items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)]", I, t),
|
|
308
330
|
...m,
|
|
309
331
|
children: [/* @__PURE__ */ l(f.Trigger, {
|
|
310
|
-
className: e("group/section flex min-w-0 flex-1 items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)] text-start cursor-pointer",
|
|
332
|
+
className: e("group/section flex min-w-0 flex-1 items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)] text-start cursor-pointer", F, "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-brand)] focus-visible:ring-inset"),
|
|
311
333
|
children: [
|
|
312
334
|
/* @__PURE__ */ c(u, {
|
|
313
335
|
size: 16,
|
|
@@ -326,37 +348,37 @@ var N = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-si
|
|
|
326
348
|
})]
|
|
327
349
|
});
|
|
328
350
|
});
|
|
329
|
-
|
|
330
|
-
var
|
|
331
|
-
let { expandable: i } = o.useContext(
|
|
351
|
+
L.displayName = "SidebarSecondarySectionLabel";
|
|
352
|
+
var R = o.forwardRef(({ className: t, ...n }, r) => {
|
|
353
|
+
let { expandable: i } = o.useContext(j), a = /* @__PURE__ */ c("ul", {
|
|
332
354
|
ref: r,
|
|
333
355
|
className: e("flex flex-col gap-[var(--ui-sidebar-secondary-section-menu-item-list-gap)]", t),
|
|
334
356
|
...n
|
|
335
357
|
});
|
|
336
358
|
return i ? /* @__PURE__ */ c(f.Panel, { children: a }) : a;
|
|
337
359
|
});
|
|
338
|
-
|
|
339
|
-
var
|
|
360
|
+
R.displayName = "SidebarSecondaryMenu";
|
|
361
|
+
var z = t("group/row flex w-full items-start gap-[var(--ui-sidebar-secondary-menu-item-global-container-gap)] min-h-[var(--ui-sidebar-secondary-menu-item-global-container-height-min)] px-[var(--ui-sidebar-secondary-menu-item-global-container-padding-x)] py-[var(--ui-sidebar-secondary-menu-item-global-container-padding-y)] no-underline ui-sidebar-secondary-menu-item-global-label-text-style transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-brand)] focus-visible:ring-inset text-[var(--ui-sidebar-secondary-menu-item-global-label-color-color)] [&_svg]:shrink-0 [&_svg]:size-[var(--ui-sidebar-secondary-menu-item-global-icon-size)] [&_svg]:text-[var(--ui-sidebar-secondary-menu-item-global-icon-color-color)]", {
|
|
340
362
|
variants: { variant: {
|
|
341
363
|
unselected: "bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-idle)] hover:bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-hover)] active:bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-active)]",
|
|
342
364
|
selected: "bg-[var(--ui-sidebar-secondary-menu-item-selected-container-color-idle)] hover:bg-[var(--ui-sidebar-secondary-menu-item-selected-container-color-hover)] active:bg-[var(--ui-sidebar-secondary-menu-item-selected-container-color-active)]"
|
|
343
365
|
} },
|
|
344
366
|
defaultVariants: { variant: "unselected" }
|
|
345
|
-
}),
|
|
346
|
-
let { expanded: b, setSelectedLabel:
|
|
367
|
+
}), B = o.forwardRef(({ className: t, selected: u = !1, icon: d, extras: f, render: g, children: _, ...v }, y) => {
|
|
368
|
+
let { expanded: b, setSelectedLabel: x } = C(), { expandable: S } = o.useContext(j), w = n(), T = o.useRef(null), E = o.useRef(null), D = h(E, { enabled: b });
|
|
347
369
|
o.useEffect(() => {
|
|
348
|
-
u &&
|
|
370
|
+
u && x(_);
|
|
349
371
|
}, [
|
|
350
372
|
u,
|
|
351
373
|
_,
|
|
352
|
-
|
|
374
|
+
x
|
|
353
375
|
]);
|
|
354
376
|
let O = p({
|
|
355
377
|
render: g,
|
|
356
378
|
ref: [y, T],
|
|
357
379
|
defaultTagName: "a",
|
|
358
380
|
props: m({
|
|
359
|
-
className: e(
|
|
381
|
+
className: e(z({ variant: u ? "selected" : "unselected" }), S && "ps-[calc(var(--ui-sidebar-secondary-menu-item-global-container-padding-x)+var(--ui-sidebar-secondary-section-container-header-gap)+16px)]", t),
|
|
360
382
|
"aria-current": u ? "page" : void 0,
|
|
361
383
|
onKeyDown: (e) => {
|
|
362
384
|
e.key === " " && (e.preventDefault(), e.currentTarget.click());
|
|
@@ -395,9 +417,9 @@ var L = t("group/row flex w-full items-start gap-[var(--ui-sidebar-secondary-men
|
|
|
395
417
|
})
|
|
396
418
|
});
|
|
397
419
|
});
|
|
398
|
-
|
|
399
|
-
var
|
|
400
|
-
let { expanded: u } =
|
|
420
|
+
B.displayName = "SidebarSecondaryMenuItem";
|
|
421
|
+
var V = o.forwardRef(({ className: t, variant: n, shortcut: r, tag: i, children: a, ...o }, s) => {
|
|
422
|
+
let { expanded: u } = C(), f = n === "tag" || n === "tag-externalLink", p = n === "externalLink" || n === "tag-externalLink", m = n === "shortcut";
|
|
401
423
|
return /* @__PURE__ */ l("span", {
|
|
402
424
|
ref: s,
|
|
403
425
|
className: e("inline-flex items-center shrink-0 min-h-6 overflow-clip gap-[var(--ui-sidebar-secondary-menu-item-extras-global-container-gap)]", !u && "hidden", t),
|
|
@@ -415,35 +437,36 @@ var z = o.forwardRef(({ className: t, variant: n, shortcut: r, tag: i, children:
|
|
|
415
437
|
]
|
|
416
438
|
});
|
|
417
439
|
});
|
|
418
|
-
|
|
419
|
-
var
|
|
420
|
-
let { expanded:
|
|
440
|
+
V.displayName = "SidebarSecondaryMenuItemExtras";
|
|
441
|
+
var H = o.forwardRef(({ className: t, icon: s, expandTooltip: u = "Expand", extras: d, children: f, onClick: p, disabled: m, ...g }, _) => {
|
|
442
|
+
let { expanded: v, toggleExpanded: y, collapsible: b } = C(), x = n(), S = o.useRef(null), w = o.useRef(null), T = h(w, { enabled: v }), E = /* @__PURE__ */ l("button", {
|
|
421
443
|
ref: (e) => {
|
|
422
|
-
|
|
444
|
+
S.current = e, typeof _ == "function" ? _(e) : _ && (_.current = e);
|
|
423
445
|
},
|
|
424
446
|
type: "button",
|
|
425
|
-
"aria-expanded":
|
|
426
|
-
|
|
447
|
+
"aria-expanded": b ? v : void 0,
|
|
448
|
+
disabled: m || !b,
|
|
449
|
+
className: e(z({ variant: "unselected" }), "text-start", "disabled:cursor-not-allowed disabled:text-[var(--ui-text-on-surface-disabled)] disabled:[&_svg]:text-[var(--ui-text-on-surface-disabled)] disabled:hover:bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-idle)] disabled:active:bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-idle)]", t),
|
|
427
450
|
onClick: (e) => {
|
|
428
|
-
p?.(e), e.defaultPrevented
|
|
451
|
+
p?.(e), !e.defaultPrevented && b && y();
|
|
429
452
|
},
|
|
430
|
-
...
|
|
453
|
+
...g,
|
|
431
454
|
children: [
|
|
432
455
|
s != null && /* @__PURE__ */ c("span", {
|
|
433
|
-
className: e("flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)] transition-transform",
|
|
456
|
+
className: e("flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)] transition-transform", v ? "rtl:rotate-180" : "ltr:rotate-180"),
|
|
434
457
|
children: s
|
|
435
458
|
}),
|
|
436
459
|
/* @__PURE__ */ l(r, {
|
|
437
|
-
disabled: !
|
|
460
|
+
disabled: !T,
|
|
438
461
|
children: [/* @__PURE__ */ c(a, {
|
|
439
462
|
render: /* @__PURE__ */ c("span", {
|
|
440
|
-
ref:
|
|
441
|
-
className: e("flex-1 min-w-[60px] truncate", !
|
|
463
|
+
ref: w,
|
|
464
|
+
className: e("flex-1 min-w-[60px] truncate", !v && "sr-only")
|
|
442
465
|
}),
|
|
443
466
|
children: f
|
|
444
467
|
}), /* @__PURE__ */ c(i, {
|
|
445
|
-
anchor:
|
|
446
|
-
side:
|
|
468
|
+
anchor: S,
|
|
469
|
+
side: x === "rtl" ? "left" : "right",
|
|
447
470
|
children: f
|
|
448
471
|
})]
|
|
449
472
|
}),
|
|
@@ -453,16 +476,16 @@ var B = o.forwardRef(({ className: t, icon: s, expandTooltip: u = "Expand", extr
|
|
|
453
476
|
return /* @__PURE__ */ c("li", {
|
|
454
477
|
className: "contents",
|
|
455
478
|
children: /* @__PURE__ */ l(r, {
|
|
456
|
-
disabled:
|
|
457
|
-
children: [/* @__PURE__ */ c(a, { render:
|
|
458
|
-
side:
|
|
479
|
+
disabled: v || !b,
|
|
480
|
+
children: [/* @__PURE__ */ c(a, { render: E }), /* @__PURE__ */ c(i, {
|
|
481
|
+
side: x === "rtl" ? "left" : "right",
|
|
459
482
|
children: u
|
|
460
483
|
})]
|
|
461
484
|
})
|
|
462
485
|
});
|
|
463
486
|
});
|
|
464
|
-
|
|
487
|
+
H.displayName = "SidebarSecondaryCollapseTrigger";
|
|
465
488
|
//#endregion
|
|
466
|
-
export {
|
|
489
|
+
export { E as SidebarSecondary, H as SidebarSecondaryCollapseTrigger, k as SidebarSecondaryCollapsedBreadcrumb, O as SidebarSecondaryContent, A as SidebarSecondaryFooter, D as SidebarSecondaryHeader, R as SidebarSecondaryMenu, B as SidebarSecondaryMenuItem, V as SidebarSecondaryMenuItemExtras, P as SidebarSecondarySection, L as SidebarSecondarySectionLabel, z as sidebarSecondaryMenuItemVariants };
|
|
467
490
|
|
|
468
491
|
//# sourceMappingURL=sidebar-secondary.js.map
|