@schemavaults/ui 0.50.2 → 0.52.3
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/carousel/carousel.d.ts +53 -0
- package/dist/components/ui/carousel/carousel.js +282 -0
- package/dist/components/ui/carousel/carousel.js.map +1 -0
- package/dist/components/ui/carousel/index.d.ts +3 -0
- package/dist/components/ui/carousel/index.js +3 -0
- package/dist/components/ui/carousel/index.js.map +1 -0
- package/dist/components/ui/index.d.ts +4 -0
- package/dist/components/ui/index.js +2 -0
- package/dist/components/ui/index.js.map +1 -1
- package/dist/components/ui/tree-view/index.d.ts +3 -0
- package/dist/components/ui/tree-view/index.js +3 -0
- package/dist/components/ui/tree-view/index.js.map +1 -0
- package/dist/components/ui/tree-view/tree-view-variants.d.ts +4 -0
- package/dist/components/ui/tree-view/tree-view-variants.js +10 -0
- package/dist/components/ui/tree-view/tree-view-variants.js.map +1 -0
- package/dist/components/ui/tree-view/tree-view.d.ts +61 -0
- package/dist/components/ui/tree-view/tree-view.js +269 -0
- package/dist/components/ui/tree-view/tree-view.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
export declare const carouselSizeIds: readonly ["sm", "default", "lg"];
|
|
4
|
+
export type CarouselSizeId = (typeof carouselSizeIds)[number];
|
|
5
|
+
export declare const carouselArrowPositionIds: readonly ["inside", "outside"];
|
|
6
|
+
export type CarouselArrowPositionId = (typeof carouselArrowPositionIds)[number];
|
|
7
|
+
declare const arrowButtonVariants: (props?: ({
|
|
8
|
+
size?: "sm" | "default" | "lg" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export interface CarouselProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange">, VariantProps<typeof arrowButtonVariants> {
|
|
11
|
+
/** Each child is rendered as one full-width slide. */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/** Controlled active slide index. Pair with `onIndexChange`. */
|
|
14
|
+
index?: number;
|
|
15
|
+
/** Initial active slide index when uncontrolled. Default: `0`. */
|
|
16
|
+
defaultIndex?: number;
|
|
17
|
+
/** Called whenever the active slide changes. */
|
|
18
|
+
onIndexChange?: (index: number) => void;
|
|
19
|
+
/** Wrap around past the first/last slide. Default: `false`. */
|
|
20
|
+
loop?: boolean;
|
|
21
|
+
/** Advance automatically. Disabled when the user prefers reduced motion. Default: `false`. */
|
|
22
|
+
autoplay?: boolean;
|
|
23
|
+
/** Milliseconds between autoplay advances. Default: `4000`. */
|
|
24
|
+
autoplayInterval?: number;
|
|
25
|
+
/** Pause autoplay while the pointer is over the carousel. Default: `true`. */
|
|
26
|
+
pauseOnHover?: boolean;
|
|
27
|
+
/** Show the previous/next arrow buttons. Default: `true`. */
|
|
28
|
+
showArrows?: boolean;
|
|
29
|
+
/** Show the dot indicators. Default: `true`. */
|
|
30
|
+
showIndicators?: boolean;
|
|
31
|
+
/** Where to render the arrow buttons relative to the viewport. Default: `"inside"`. */
|
|
32
|
+
arrowPosition?: CarouselArrowPositionId;
|
|
33
|
+
/** Control + indicator sizing. Default: `"default"`. */
|
|
34
|
+
size?: CarouselSizeId;
|
|
35
|
+
/** Accessible label for the carousel region. */
|
|
36
|
+
"aria-label"?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function Carousel({ className, children, index, defaultIndex, onIndexChange, loop, autoplay, autoplayInterval, pauseOnHover, showArrows, showIndicators, arrowPosition, size, ...props }: CarouselProps): ReactElement;
|
|
39
|
+
export declare namespace Carousel {
|
|
40
|
+
var displayName: string;
|
|
41
|
+
}
|
|
42
|
+
export interface CarouselItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Optional convenience slide. You can pass any element to <Carousel /> directly,
|
|
47
|
+
* but <CarouselItem> gives you a theme-aware, centered card panel out of the box.
|
|
48
|
+
*/
|
|
49
|
+
export declare function CarouselItem({ className, children, ...props }: CarouselItemProps): ReactElement;
|
|
50
|
+
export declare namespace CarouselItem {
|
|
51
|
+
var displayName: string;
|
|
52
|
+
}
|
|
53
|
+
export default Carousel;
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Children, useCallback, useEffect, useRef, useState, } from "react";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
6
|
+
import { animate, m, useMotionValue, useReducedMotion } from "../../../framer-motion";
|
|
7
|
+
import { cn } from "../../../lib/utils";
|
|
8
|
+
export const carouselSizeIds = [
|
|
9
|
+
"sm",
|
|
10
|
+
"default",
|
|
11
|
+
"lg",
|
|
12
|
+
];
|
|
13
|
+
export const carouselArrowPositionIds = [
|
|
14
|
+
"inside",
|
|
15
|
+
"outside",
|
|
16
|
+
];
|
|
17
|
+
const arrowButtonVariants = cva("absolute top-1/2 z-20 flex -translate-y-1/2 items-center justify-center rounded-full border border-border bg-background/80 text-foreground shadow-sm backdrop-blur transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-40", {
|
|
18
|
+
variants: {
|
|
19
|
+
size: {
|
|
20
|
+
sm: "h-7 w-7 [&>svg]:h-3.5 [&>svg]:w-3.5",
|
|
21
|
+
default: "h-9 w-9 [&>svg]:h-4 [&>svg]:w-4",
|
|
22
|
+
lg: "h-11 w-11 [&>svg]:h-5 [&>svg]:w-5",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
size: "default",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const indicatorVariants = cva("rounded-full transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", {
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
sm: "h-1.5",
|
|
33
|
+
default: "h-2",
|
|
34
|
+
lg: "h-2.5",
|
|
35
|
+
},
|
|
36
|
+
active: {
|
|
37
|
+
true: "bg-primary",
|
|
38
|
+
false: "bg-muted-foreground/30 hover:bg-muted-foreground/50",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
size: "default",
|
|
43
|
+
active: false,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
const indicatorWidth = {
|
|
47
|
+
sm: { active: "w-4", idle: "w-1.5" },
|
|
48
|
+
default: { active: "w-5", idle: "w-2" },
|
|
49
|
+
lg: { active: "w-6", idle: "w-2.5" },
|
|
50
|
+
};
|
|
51
|
+
const SWIPE_DISTANCE_RATIO = 0.2;
|
|
52
|
+
const SWIPE_VELOCITY = 0.5;
|
|
53
|
+
const DRAG_START_THRESHOLD = 5;
|
|
54
|
+
export function Carousel({ className, children, index, defaultIndex = 0, onIndexChange, loop = false, autoplay = false, autoplayInterval = 4000, pauseOnHover = true, showArrows = true, showIndicators = true, arrowPosition = "inside", size = "default", ...props }) {
|
|
55
|
+
const prefersReducedMotion = useReducedMotion();
|
|
56
|
+
const slides = Children.toArray(children);
|
|
57
|
+
const count = slides.length;
|
|
58
|
+
const lastIndex = Math.max(0, count - 1);
|
|
59
|
+
const clamp = useCallback((value) => Math.min(Math.max(value, 0), lastIndex), [lastIndex]);
|
|
60
|
+
const isControlled = index != null;
|
|
61
|
+
const [internalIndex, setInternalIndex] = useState(clamp(defaultIndex));
|
|
62
|
+
const currentIndex = clamp(isControlled ? index : internalIndex);
|
|
63
|
+
const viewportRef = useRef(null);
|
|
64
|
+
const [width, setWidth] = useState(0);
|
|
65
|
+
const x = useMotionValue(0);
|
|
66
|
+
// Refs that gesture/autoplay handlers read without re-subscribing.
|
|
67
|
+
const widthRef = useRef(0);
|
|
68
|
+
widthRef.current = width;
|
|
69
|
+
const indexRef = useRef(currentIndex);
|
|
70
|
+
indexRef.current = currentIndex;
|
|
71
|
+
const seamJumpRef = useRef(false);
|
|
72
|
+
const animationRef = useRef(null);
|
|
73
|
+
const isPausedRef = useRef(false);
|
|
74
|
+
const moveTo = useCallback((target, instant) => {
|
|
75
|
+
animationRef.current?.stop();
|
|
76
|
+
if (instant || prefersReducedMotion) {
|
|
77
|
+
x.set(target);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
animationRef.current = animate(x, target, {
|
|
81
|
+
type: "spring",
|
|
82
|
+
stiffness: 320,
|
|
83
|
+
damping: 36,
|
|
84
|
+
});
|
|
85
|
+
}, [prefersReducedMotion, x]);
|
|
86
|
+
const commitIndex = useCallback((next) => {
|
|
87
|
+
const resolved = clamp(next);
|
|
88
|
+
if (!isControlled)
|
|
89
|
+
setInternalIndex(resolved);
|
|
90
|
+
if (resolved !== indexRef.current)
|
|
91
|
+
onIndexChange?.(resolved);
|
|
92
|
+
}, [clamp, isControlled, onIndexChange]);
|
|
93
|
+
const goTo = useCallback((target) => {
|
|
94
|
+
const resolved = clamp(target);
|
|
95
|
+
if (resolved === indexRef.current) {
|
|
96
|
+
moveTo(-resolved * widthRef.current, false);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
commitIndex(resolved);
|
|
100
|
+
}, [clamp, commitIndex, moveTo]);
|
|
101
|
+
const step = useCallback((delta) => {
|
|
102
|
+
const raw = indexRef.current + delta;
|
|
103
|
+
if (raw < 0) {
|
|
104
|
+
if (!loop)
|
|
105
|
+
return;
|
|
106
|
+
seamJumpRef.current = true;
|
|
107
|
+
commitIndex(lastIndex);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (raw > lastIndex) {
|
|
111
|
+
if (!loop)
|
|
112
|
+
return;
|
|
113
|
+
seamJumpRef.current = true;
|
|
114
|
+
commitIndex(0);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
commitIndex(raw);
|
|
118
|
+
}, [commitIndex, lastIndex, loop]);
|
|
119
|
+
// Keep slide widths in sync with the viewport.
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
const el = viewportRef.current;
|
|
122
|
+
if (!el)
|
|
123
|
+
return;
|
|
124
|
+
const measure = () => setWidth(el.clientWidth);
|
|
125
|
+
measure();
|
|
126
|
+
const observer = new ResizeObserver(measure);
|
|
127
|
+
observer.observe(el);
|
|
128
|
+
return () => observer.disconnect();
|
|
129
|
+
}, []);
|
|
130
|
+
// Reposition instantly when the viewport resizes.
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
x.set(-indexRef.current * width);
|
|
133
|
+
}, [width, x]);
|
|
134
|
+
// Animate (or jump across the loop seam) on index change.
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
const instant = seamJumpRef.current;
|
|
137
|
+
seamJumpRef.current = false;
|
|
138
|
+
moveTo(-currentIndex * width, instant);
|
|
139
|
+
}, [currentIndex, width, moveTo]);
|
|
140
|
+
// Autoplay.
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
if (!autoplay || prefersReducedMotion || count <= 1)
|
|
143
|
+
return;
|
|
144
|
+
const id = window.setInterval(() => {
|
|
145
|
+
if (isPausedRef.current)
|
|
146
|
+
return;
|
|
147
|
+
const atEnd = indexRef.current >= lastIndex;
|
|
148
|
+
if (atEnd && !loop)
|
|
149
|
+
return;
|
|
150
|
+
step(1);
|
|
151
|
+
}, Math.max(1000, autoplayInterval));
|
|
152
|
+
return () => window.clearInterval(id);
|
|
153
|
+
}, [
|
|
154
|
+
autoplay,
|
|
155
|
+
autoplayInterval,
|
|
156
|
+
count,
|
|
157
|
+
lastIndex,
|
|
158
|
+
loop,
|
|
159
|
+
prefersReducedMotion,
|
|
160
|
+
step,
|
|
161
|
+
currentIndex,
|
|
162
|
+
]);
|
|
163
|
+
// Pointer-driven swipe.
|
|
164
|
+
const dragStateRef = useRef(null);
|
|
165
|
+
const handlePointerDown = useCallback((event) => {
|
|
166
|
+
if (count <= 1 || event.button !== 0)
|
|
167
|
+
return;
|
|
168
|
+
animationRef.current?.stop();
|
|
169
|
+
isPausedRef.current = true;
|
|
170
|
+
dragStateRef.current = {
|
|
171
|
+
startX: event.clientX,
|
|
172
|
+
baseX: x.get(),
|
|
173
|
+
lastX: event.clientX,
|
|
174
|
+
lastT: event.timeStamp,
|
|
175
|
+
velocity: 0,
|
|
176
|
+
active: true,
|
|
177
|
+
moved: false,
|
|
178
|
+
};
|
|
179
|
+
}, [count, x]);
|
|
180
|
+
const handlePointerMove = useCallback((event) => {
|
|
181
|
+
const drag = dragStateRef.current;
|
|
182
|
+
if (!drag || !drag.active)
|
|
183
|
+
return;
|
|
184
|
+
const dx = event.clientX - drag.startX;
|
|
185
|
+
if (!drag.moved && Math.abs(dx) < DRAG_START_THRESHOLD)
|
|
186
|
+
return;
|
|
187
|
+
if (!drag.moved) {
|
|
188
|
+
drag.moved = true;
|
|
189
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
190
|
+
}
|
|
191
|
+
const dt = event.timeStamp - drag.lastT;
|
|
192
|
+
if (dt > 0)
|
|
193
|
+
drag.velocity = (event.clientX - drag.lastX) / dt;
|
|
194
|
+
drag.lastX = event.clientX;
|
|
195
|
+
drag.lastT = event.timeStamp;
|
|
196
|
+
let next = drag.baseX + dx;
|
|
197
|
+
const min = -lastIndex * widthRef.current;
|
|
198
|
+
const max = 0;
|
|
199
|
+
if (!loop) {
|
|
200
|
+
if (next > max)
|
|
201
|
+
next = max + (next - max) * 0.35;
|
|
202
|
+
else if (next < min)
|
|
203
|
+
next = min + (next - min) * 0.35;
|
|
204
|
+
}
|
|
205
|
+
x.set(next);
|
|
206
|
+
}, [lastIndex, loop, x]);
|
|
207
|
+
const endDrag = useCallback((event) => {
|
|
208
|
+
const drag = dragStateRef.current;
|
|
209
|
+
if (!drag || !drag.active)
|
|
210
|
+
return;
|
|
211
|
+
drag.active = false;
|
|
212
|
+
dragStateRef.current = null;
|
|
213
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
214
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
215
|
+
}
|
|
216
|
+
isPausedRef.current = false;
|
|
217
|
+
if (!drag.moved)
|
|
218
|
+
return;
|
|
219
|
+
const dx = event.clientX - drag.startX;
|
|
220
|
+
const w = widthRef.current || 1;
|
|
221
|
+
const passedDistance = Math.abs(dx) > w * SWIPE_DISTANCE_RATIO;
|
|
222
|
+
const passedVelocity = Math.abs(drag.velocity) > SWIPE_VELOCITY;
|
|
223
|
+
if (passedDistance || passedVelocity) {
|
|
224
|
+
step(dx < 0 ? 1 : -1);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
moveTo(-indexRef.current * w, false);
|
|
228
|
+
}
|
|
229
|
+
}, [moveTo, step]);
|
|
230
|
+
const handleIndicatorKeyDown = useCallback((event) => {
|
|
231
|
+
if (event.key === "ArrowLeft") {
|
|
232
|
+
event.preventDefault();
|
|
233
|
+
step(-1);
|
|
234
|
+
}
|
|
235
|
+
else if (event.key === "ArrowRight") {
|
|
236
|
+
event.preventDefault();
|
|
237
|
+
step(1);
|
|
238
|
+
}
|
|
239
|
+
else if (event.key === "Home") {
|
|
240
|
+
event.preventDefault();
|
|
241
|
+
goTo(0);
|
|
242
|
+
}
|
|
243
|
+
else if (event.key === "End") {
|
|
244
|
+
event.preventDefault();
|
|
245
|
+
goTo(lastIndex);
|
|
246
|
+
}
|
|
247
|
+
}, [goTo, lastIndex, step]);
|
|
248
|
+
const handleMouseEnter = useCallback(() => {
|
|
249
|
+
if (pauseOnHover)
|
|
250
|
+
isPausedRef.current = true;
|
|
251
|
+
}, [pauseOnHover]);
|
|
252
|
+
const handleMouseLeave = useCallback(() => {
|
|
253
|
+
if (pauseOnHover && !dragStateRef.current?.active) {
|
|
254
|
+
isPausedRef.current = false;
|
|
255
|
+
}
|
|
256
|
+
}, [pauseOnHover]);
|
|
257
|
+
const canPrev = loop || currentIndex > 0;
|
|
258
|
+
const canNext = loop || currentIndex < lastIndex;
|
|
259
|
+
const slideStyle = {
|
|
260
|
+
flex: "0 0 100%",
|
|
261
|
+
minWidth: 0,
|
|
262
|
+
};
|
|
263
|
+
return (_jsxs("div", { role: "region", "aria-roledescription": "carousel", "aria-label": props["aria-label"] ?? "Carousel", className: cn("relative", arrowPosition === "outside" && showArrows && count > 1
|
|
264
|
+
? "px-12"
|
|
265
|
+
: undefined, className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...props, children: [_jsx("div", { ref: viewportRef, className: "overflow-hidden rounded-[var(--radius)]", style: { touchAction: "pan-y" }, onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onPointerUp: endDrag, onPointerCancel: endDrag, children: _jsx(m.div, { className: "flex select-none", style: { x }, "aria-live": "polite", children: slides.map((slide, slideIndex) => (_jsx("div", { role: "group", "aria-roledescription": "slide", "aria-label": `${slideIndex + 1} of ${count}`, "aria-hidden": slideIndex !== currentIndex, style: slideStyle, children: slide }, slideIndex))) }) }), showArrows && count > 1 ? (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", "aria-label": "Previous slide", disabled: !canPrev, onClick: () => step(-1), className: cn(arrowButtonVariants({ size }), arrowPosition === "outside" ? "left-0" : "left-3"), children: _jsx(ChevronLeft, {}) }), _jsx("button", { type: "button", "aria-label": "Next slide", disabled: !canNext, onClick: () => step(1), className: cn(arrowButtonVariants({ size }), arrowPosition === "outside" ? "right-0" : "right-3"), children: _jsx(ChevronRight, {}) })] })) : null, showIndicators && count > 1 ? (_jsx("div", { className: "mt-3 flex items-center justify-center gap-2", role: "tablist", "aria-label": "Choose slide", children: slides.map((_, dotIndex) => {
|
|
266
|
+
const active = dotIndex === currentIndex;
|
|
267
|
+
return (_jsx("button", { type: "button", role: "tab", "aria-selected": active, "aria-label": `Go to slide ${dotIndex + 1}`, tabIndex: active ? 0 : -1, onClick: () => goTo(dotIndex), onKeyDown: handleIndicatorKeyDown, className: cn(indicatorVariants({ size, active }), active
|
|
268
|
+
? indicatorWidth[size].active
|
|
269
|
+
: indicatorWidth[size].idle) }, dotIndex));
|
|
270
|
+
}) })) : null, _jsxs("span", { className: "sr-only", "aria-live": "polite", children: ["Slide ", currentIndex + 1, " of ", count] })] }));
|
|
271
|
+
}
|
|
272
|
+
Carousel.displayName = "Carousel";
|
|
273
|
+
/**
|
|
274
|
+
* Optional convenience slide. You can pass any element to <Carousel /> directly,
|
|
275
|
+
* but <CarouselItem> gives you a theme-aware, centered card panel out of the box.
|
|
276
|
+
*/
|
|
277
|
+
export function CarouselItem({ className, children, ...props }) {
|
|
278
|
+
return (_jsx("div", { className: cn("flex min-h-48 flex-col items-center justify-center gap-2 rounded-[var(--radius)] border border-border bg-card p-8 text-center text-card-foreground", className), ...props, children: children }));
|
|
279
|
+
}
|
|
280
|
+
CarouselItem.displayName = "CarouselItem";
|
|
281
|
+
export default Carousel;
|
|
282
|
+
//# sourceMappingURL=carousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../../../src/components/ui/carousel/carousel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,QAAQ,EAOR,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE/E,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI;IACJ,SAAS;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AAQ,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -160,3 +160,7 @@ export * from "./comparison-slider";
|
|
|
160
160
|
export type * from "./comparison-slider";
|
|
161
161
|
export * from "./theme-selector";
|
|
162
162
|
export type * from "./theme-selector";
|
|
163
|
+
export * from "./tree-view";
|
|
164
|
+
export type * from "./tree-view";
|
|
165
|
+
export * from "./carousel";
|
|
166
|
+
export type * from "./carousel";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAGzB,cAAc,aAAa,CAAC;AAG5B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,SAAS,CAAC;AAGxB,cAAc,mBAAmB,CAAC;AAGlC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,UAAU,CAAC;AAGzB,cAAc,SAAS,CAAC;AAGxB,cAAc,kBAAkB,CAAC;AAGjC,cAAc,aAAa,CAAC;AAG5B,cAAc,kCAAkC,CAAC;AAGjD,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC;AAG1B,cAAc,YAAY,CAAC;AAG3B,cAAc,QAAQ,CAAC;AAGvB,cAAc,QAAQ,CAAC;AAGvB,cAAc,aAAa,CAAC;AAG5B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,WAAW,CAAC;AAG1B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,UAAU,CAAC;AAGzB,cAAc,WAAW,CAAC;AAG1B,cAAc,WAAW,CAAC;AAG1B,cAAc,YAAY,CAAC;AAG3B,cAAc,SAAS,CAAC;AAGxB,cAAc,aAAa,CAAC;AAG5B,cAAc,YAAY,CAAC;AAG3B,cAAc,YAAY,CAAC;AAG3B,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC;AAG9B,cAAc,Y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,cAAc,qBAAqB,CAAC;AAGpC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,QAAQ,CAAC;AAGvB,cAAc,QAAQ,CAAC;AAGvB,cAAc,UAAU,CAAC;AAGzB,cAAc,UAAU,CAAC;AAGzB,cAAc,gBAAgB,CAAC;AAG/B,cAAc,qBAAqB,CAAC;AAGpC,cAAc,SAAS,CAAC;AAGxB,cAAc,cAAc,CAAC;AAG7B,cAAc,cAAc,CAAC;AAG7B,cAAc,OAAO,CAAC;AAGtB,cAAc,eAAe,CAAC;AAG9B,cAAc,WAAW,CAAC;AAG1B,cAAc,UAAU,CAAC;AAGzB,cAAc,eAAe,CAAC;AAG9B,cAAc,aAAa,CAAC;AAG5B,cAAc,YAAY,CAAC;AAG3B,cAAc,UAAU,CAAC;AAGzB,cAAc,gBAAgB,CAAC;AAG/B,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC;AAG9B,cAAc,qBAAqB,CAAC;AAGpC,cAAc,WAAW,CAAC;AAG1B,cAAc,UAAU,CAAC;AAGzB,cAAc,QAAQ,CAAC;AAGvB,cAAc,cAAc,CAAC;AAG7B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,aAAa,CAAC;AAG5B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,aAAa,CAAC;AAG5B,cAAc,aAAa,CAAC;AAG5B,cAAc,qBAAqB,CAAC;AAGpC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,aAAa,CAAC;AAG5B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { TreeView, TreeViewItem, treeViewVariants, treeViewItemVariants, treeViewSizeIds, treeViewVariantIds, } from "./tree-view";
|
|
2
|
+
export type { TreeViewProps, TreeNode, TreeViewSize, TreeViewVariant, } from "./tree-view";
|
|
3
|
+
export { TreeView as default } from "./tree-view";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/tree-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAOrB,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const treeViewSizeIds: readonly ["sm", "default", "lg"];
|
|
2
|
+
export type TreeViewSize = (typeof treeViewSizeIds)[number];
|
|
3
|
+
export declare const treeViewVariantIds: readonly ["default", "ghost"];
|
|
4
|
+
export type TreeViewVariant = (typeof treeViewVariantIds)[number];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-view-variants.js","sourceRoot":"","sources":["../../../../src/components/ui/tree-view/tree-view-variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI;IACJ,SAAS;IACT,IAAI;CACgC,CAAC;AAGvC,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,SAAS;IACT,OAAO;CAC6B,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type ReactNode, type Ref } from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { treeViewSizeIds, treeViewVariantIds, type TreeViewSize, type TreeViewVariant } from "./tree-view-variants";
|
|
4
|
+
export { treeViewSizeIds, treeViewVariantIds };
|
|
5
|
+
export type { TreeViewSize, TreeViewVariant };
|
|
6
|
+
export interface TreeNode {
|
|
7
|
+
/** Stable unique identifier for the node. */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Visible label. Strings enable type-ahead navigation. */
|
|
10
|
+
label: ReactNode;
|
|
11
|
+
/** Optional icon rendered before the label. */
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Child nodes. A defined `children` array (even when empty) marks the
|
|
15
|
+
* node as an expandable branch; omit it for leaf nodes.
|
|
16
|
+
*/
|
|
17
|
+
children?: TreeNode[];
|
|
18
|
+
/** Disable interaction (selection / expansion) for this node. */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const treeViewVariants: (props?: ({
|
|
22
|
+
size?: "sm" | "default" | "lg" | null | undefined;
|
|
23
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
24
|
+
export declare const treeViewItemVariants: (props?: ({
|
|
25
|
+
size?: "sm" | "default" | "lg" | null | undefined;
|
|
26
|
+
variant?: "default" | "ghost" | null | undefined;
|
|
27
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
28
|
+
export interface TreeViewProps extends Omit<HTMLAttributes<HTMLUListElement>, "onSelect" | "defaultValue">, VariantProps<typeof treeViewVariants> {
|
|
29
|
+
/** Hierarchical node data. */
|
|
30
|
+
data: TreeNode[];
|
|
31
|
+
/** Controlled set of expanded node ids. */
|
|
32
|
+
expandedIds?: string[];
|
|
33
|
+
/** Initial expanded node ids when uncontrolled. */
|
|
34
|
+
defaultExpandedIds?: string[];
|
|
35
|
+
/** Called whenever the expanded set changes. */
|
|
36
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
37
|
+
/** Controlled selected node id (`null` for none). */
|
|
38
|
+
selectedId?: string | null;
|
|
39
|
+
/** Initial selected node id when uncontrolled. */
|
|
40
|
+
defaultSelectedId?: string | null;
|
|
41
|
+
/** Called when the selected node changes. */
|
|
42
|
+
onSelectionChange?: (id: string | null) => void;
|
|
43
|
+
/** Render vertical indent guide lines. Defaults to `true`. */
|
|
44
|
+
showGuides?: boolean;
|
|
45
|
+
/** Visual styling variant. */
|
|
46
|
+
variant?: TreeViewVariant;
|
|
47
|
+
ref?: Ref<HTMLUListElement>;
|
|
48
|
+
}
|
|
49
|
+
declare function TreeView({ data, className, size, variant, expandedIds: expandedProp, defaultExpandedIds, onExpandedChange, selectedId: selectedProp, defaultSelectedId, onSelectionChange, showGuides, "aria-label": ariaLabel, ref, ...props }: TreeViewProps): ReactElement;
|
|
50
|
+
declare namespace TreeView {
|
|
51
|
+
var displayName: string;
|
|
52
|
+
}
|
|
53
|
+
interface TreeViewItemProps {
|
|
54
|
+
node: TreeNode;
|
|
55
|
+
level: number;
|
|
56
|
+
}
|
|
57
|
+
declare function TreeViewItem({ node, level }: TreeViewItemProps): ReactElement;
|
|
58
|
+
declare namespace TreeViewItem {
|
|
59
|
+
var displayName: string;
|
|
60
|
+
}
|
|
61
|
+
export { TreeView, TreeViewItem };
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useCallback, useContext, useId, useMemo, useRef, useState, } from "react";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { ChevronRight } from "lucide-react";
|
|
6
|
+
import { cn } from "../../../lib/utils";
|
|
7
|
+
import { treeViewSizeIds, treeViewVariantIds, } from "./tree-view-variants";
|
|
8
|
+
export { treeViewSizeIds, treeViewVariantIds };
|
|
9
|
+
export const treeViewVariants = cva("w-full select-none", {
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
sm: "text-xs",
|
|
13
|
+
default: "text-sm",
|
|
14
|
+
lg: "text-base",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
size: "default",
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
export const treeViewItemVariants = cva("group/tree-item relative flex w-full cursor-pointer items-center gap-1.5 rounded-md outline-none ring-offset-background transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 aria-disabled:pointer-events-none aria-disabled:opacity-50", {
|
|
22
|
+
variants: {
|
|
23
|
+
size: {
|
|
24
|
+
sm: "min-h-7 py-1 pr-2 text-xs",
|
|
25
|
+
default: "min-h-8 py-1.5 pr-2.5 text-sm",
|
|
26
|
+
lg: "min-h-10 py-2 pr-3 text-base",
|
|
27
|
+
},
|
|
28
|
+
variant: {
|
|
29
|
+
default: "text-foreground hover:bg-muted aria-selected:bg-accent aria-selected:text-accent-foreground aria-selected:hover:bg-accent",
|
|
30
|
+
ghost: "text-muted-foreground hover:bg-muted hover:text-foreground aria-selected:bg-transparent aria-selected:font-semibold aria-selected:text-foreground",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
size: "default",
|
|
35
|
+
variant: "default",
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
function isBranchNode(node) {
|
|
39
|
+
return Array.isArray(node.children);
|
|
40
|
+
}
|
|
41
|
+
function flattenVisible(nodes, expanded, level, parentId, acc) {
|
|
42
|
+
for (const node of nodes) {
|
|
43
|
+
const branch = isBranchNode(node);
|
|
44
|
+
acc.push({ node, level, parentId, isBranch: branch });
|
|
45
|
+
if (branch && expanded.has(node.id) && node.children) {
|
|
46
|
+
flattenVisible(node.children, expanded, level + 1, node.id, acc);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const TreeViewContext = createContext(null);
|
|
51
|
+
function useTreeViewContext() {
|
|
52
|
+
const ctx = useContext(TreeViewContext);
|
|
53
|
+
if (!ctx) {
|
|
54
|
+
throw new Error("TreeView items must be rendered inside a <TreeView />");
|
|
55
|
+
}
|
|
56
|
+
return ctx;
|
|
57
|
+
}
|
|
58
|
+
function TreeView({ data, className, size, variant, expandedIds: expandedProp, defaultExpandedIds, onExpandedChange, selectedId: selectedProp, defaultSelectedId = null, onSelectionChange, showGuides = true, "aria-label": ariaLabel, ref, ...props }) {
|
|
59
|
+
const labelId = useId();
|
|
60
|
+
const resolvedSize = size ?? "default";
|
|
61
|
+
const resolvedVariant = variant ?? "default";
|
|
62
|
+
const [uncontrolledExpanded, setUncontrolledExpanded] = useState(() => new Set(defaultExpandedIds ?? []));
|
|
63
|
+
const isExpandedControlled = expandedProp !== undefined;
|
|
64
|
+
const expandedIds = useMemo(() => (isExpandedControlled ? new Set(expandedProp) : uncontrolledExpanded), [isExpandedControlled, expandedProp, uncontrolledExpanded]);
|
|
65
|
+
const [uncontrolledSelected, setUncontrolledSelected] = useState(defaultSelectedId);
|
|
66
|
+
const isSelectionControlled = selectedProp !== undefined;
|
|
67
|
+
const selectedId = isSelectionControlled
|
|
68
|
+
? (selectedProp ?? null)
|
|
69
|
+
: uncontrolledSelected;
|
|
70
|
+
const [focusedId, setFocusedId] = useState(null);
|
|
71
|
+
const refMap = useRef(new Map());
|
|
72
|
+
const registerRef = useCallback((id, el) => {
|
|
73
|
+
if (el) {
|
|
74
|
+
refMap.current.set(id, el);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
refMap.current.delete(id);
|
|
78
|
+
}
|
|
79
|
+
}, []);
|
|
80
|
+
const flat = useMemo(() => {
|
|
81
|
+
const acc = [];
|
|
82
|
+
flattenVisible(data, expandedIds, 0, null, acc);
|
|
83
|
+
return acc;
|
|
84
|
+
}, [data, expandedIds]);
|
|
85
|
+
const toggleExpanded = useCallback((id) => {
|
|
86
|
+
const next = new Set(expandedIds);
|
|
87
|
+
if (next.has(id)) {
|
|
88
|
+
next.delete(id);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
next.add(id);
|
|
92
|
+
}
|
|
93
|
+
if (!isExpandedControlled) {
|
|
94
|
+
setUncontrolledExpanded(next);
|
|
95
|
+
}
|
|
96
|
+
onExpandedChange?.(Array.from(next));
|
|
97
|
+
}, [expandedIds, isExpandedControlled, onExpandedChange]);
|
|
98
|
+
const setExpanded = useCallback((id, shouldExpand) => {
|
|
99
|
+
const has = expandedIds.has(id);
|
|
100
|
+
if (has === shouldExpand)
|
|
101
|
+
return;
|
|
102
|
+
toggleExpanded(id);
|
|
103
|
+
}, [expandedIds, toggleExpanded]);
|
|
104
|
+
const select = useCallback((id) => {
|
|
105
|
+
if (!isSelectionControlled) {
|
|
106
|
+
setUncontrolledSelected(id);
|
|
107
|
+
}
|
|
108
|
+
onSelectionChange?.(id);
|
|
109
|
+
}, [isSelectionControlled, onSelectionChange]);
|
|
110
|
+
const focusNode = useCallback((id) => {
|
|
111
|
+
setFocusedId(id);
|
|
112
|
+
refMap.current.get(id)?.focus();
|
|
113
|
+
}, []);
|
|
114
|
+
const handleKeyDown = useCallback((event, id) => {
|
|
115
|
+
const index = flat.findIndex((f) => f.node.id === id);
|
|
116
|
+
if (index === -1)
|
|
117
|
+
return;
|
|
118
|
+
const current = flat[index];
|
|
119
|
+
const moveTo = (target) => {
|
|
120
|
+
for (let i = target; i >= 0 && i < flat.length;) {
|
|
121
|
+
const candidate = flat[i];
|
|
122
|
+
if (!candidate.node.disabled) {
|
|
123
|
+
event.preventDefault();
|
|
124
|
+
focusNode(candidate.node.id);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
i += target >= index ? 1 : -1;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
switch (event.key) {
|
|
131
|
+
case "ArrowDown":
|
|
132
|
+
moveTo(index + 1);
|
|
133
|
+
break;
|
|
134
|
+
case "ArrowUp":
|
|
135
|
+
moveTo(index - 1);
|
|
136
|
+
break;
|
|
137
|
+
case "Home":
|
|
138
|
+
moveTo(0);
|
|
139
|
+
break;
|
|
140
|
+
case "End":
|
|
141
|
+
moveTo(flat.length - 1);
|
|
142
|
+
break;
|
|
143
|
+
case "ArrowRight": {
|
|
144
|
+
if (current.node.disabled)
|
|
145
|
+
break;
|
|
146
|
+
if (current.isBranch && !expandedIds.has(id)) {
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
setExpanded(id, true);
|
|
149
|
+
}
|
|
150
|
+
else if (current.isBranch) {
|
|
151
|
+
moveTo(index + 1);
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
case "ArrowLeft": {
|
|
156
|
+
if (current.node.disabled)
|
|
157
|
+
break;
|
|
158
|
+
if (current.isBranch && expandedIds.has(id)) {
|
|
159
|
+
event.preventDefault();
|
|
160
|
+
setExpanded(id, false);
|
|
161
|
+
}
|
|
162
|
+
else if (current.parentId) {
|
|
163
|
+
event.preventDefault();
|
|
164
|
+
focusNode(current.parentId);
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
case "Enter":
|
|
169
|
+
case " ": {
|
|
170
|
+
if (current.node.disabled)
|
|
171
|
+
break;
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
select(id);
|
|
174
|
+
if (current.isBranch) {
|
|
175
|
+
toggleExpanded(id);
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
default: {
|
|
180
|
+
if (event.key.length === 1 && /\S/.test(event.key)) {
|
|
181
|
+
const lower = event.key.toLowerCase();
|
|
182
|
+
const ordered = [
|
|
183
|
+
...flat.slice(index + 1),
|
|
184
|
+
...flat.slice(0, index + 1),
|
|
185
|
+
];
|
|
186
|
+
const match = ordered.find((f) => !f.node.disabled &&
|
|
187
|
+
typeof f.node.label === "string" &&
|
|
188
|
+
f.node.label.toLowerCase().startsWith(lower));
|
|
189
|
+
if (match) {
|
|
190
|
+
event.preventDefault();
|
|
191
|
+
focusNode(match.node.id);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}, [
|
|
197
|
+
flat,
|
|
198
|
+
expandedIds,
|
|
199
|
+
focusNode,
|
|
200
|
+
setExpanded,
|
|
201
|
+
toggleExpanded,
|
|
202
|
+
select,
|
|
203
|
+
]);
|
|
204
|
+
const firstFocusableId = useMemo(() => {
|
|
205
|
+
const first = flat.find((f) => !f.node.disabled);
|
|
206
|
+
return first ? first.node.id : null;
|
|
207
|
+
}, [flat]);
|
|
208
|
+
const ctx = useMemo(() => ({
|
|
209
|
+
selectedId,
|
|
210
|
+
focusedId: focusedId ?? selectedId ?? firstFocusableId,
|
|
211
|
+
expandedIds,
|
|
212
|
+
size: resolvedSize,
|
|
213
|
+
variant: resolvedVariant,
|
|
214
|
+
showGuides,
|
|
215
|
+
flat,
|
|
216
|
+
registerRef,
|
|
217
|
+
toggleExpanded,
|
|
218
|
+
select,
|
|
219
|
+
focusNode,
|
|
220
|
+
handleKeyDown,
|
|
221
|
+
}), [
|
|
222
|
+
selectedId,
|
|
223
|
+
focusedId,
|
|
224
|
+
firstFocusableId,
|
|
225
|
+
expandedIds,
|
|
226
|
+
resolvedSize,
|
|
227
|
+
resolvedVariant,
|
|
228
|
+
showGuides,
|
|
229
|
+
flat,
|
|
230
|
+
registerRef,
|
|
231
|
+
toggleExpanded,
|
|
232
|
+
select,
|
|
233
|
+
focusNode,
|
|
234
|
+
handleKeyDown,
|
|
235
|
+
]);
|
|
236
|
+
return (_jsx(TreeViewContext.Provider, { value: ctx, children: _jsx("ul", { ref: ref, role: "tree", "aria-label": ariaLabel, "aria-labelledby": ariaLabel ? undefined : labelId, className: cn(treeViewVariants({ size: resolvedSize }), className), ...props, children: data.map((node) => (_jsx(TreeViewItem, { node: node, level: 0 }, node.id))) }) }));
|
|
237
|
+
}
|
|
238
|
+
TreeView.displayName = "TreeView";
|
|
239
|
+
function TreeViewItem({ node, level }) {
|
|
240
|
+
const { selectedId, focusedId, expandedIds, size, variant, showGuides, registerRef, toggleExpanded, select, focusNode, handleKeyDown, } = useTreeViewContext();
|
|
241
|
+
const branch = isBranchNode(node);
|
|
242
|
+
const expanded = branch && expandedIds.has(node.id);
|
|
243
|
+
const selected = selectedId === node.id;
|
|
244
|
+
const isTabbable = focusedId === node.id;
|
|
245
|
+
const disabled = node.disabled ?? false;
|
|
246
|
+
const indentStep = size === "sm" ? 14 : size === "lg" ? 22 : 18;
|
|
247
|
+
const paddingLeft = level * indentStep + 8;
|
|
248
|
+
const onRowClick = useCallback((event) => {
|
|
249
|
+
if (disabled)
|
|
250
|
+
return;
|
|
251
|
+
event.stopPropagation();
|
|
252
|
+
focusNode(node.id);
|
|
253
|
+
select(node.id);
|
|
254
|
+
if (branch) {
|
|
255
|
+
toggleExpanded(node.id);
|
|
256
|
+
}
|
|
257
|
+
}, [disabled, branch, node.id, focusNode, select, toggleExpanded]);
|
|
258
|
+
const onChevronClick = useCallback((event) => {
|
|
259
|
+
event.stopPropagation();
|
|
260
|
+
if (disabled)
|
|
261
|
+
return;
|
|
262
|
+
focusNode(node.id);
|
|
263
|
+
toggleExpanded(node.id);
|
|
264
|
+
}, [disabled, node.id, focusNode, toggleExpanded]);
|
|
265
|
+
return (_jsxs("li", { role: "none", children: [_jsxs("div", { ref: (el) => registerRef(node.id, el), role: "treeitem", "aria-selected": selected, "aria-expanded": branch ? expanded : undefined, "aria-disabled": disabled || undefined, "aria-level": level + 1, tabIndex: isTabbable && !disabled ? 0 : -1, "data-state": selected ? "selected" : "idle", onClick: onRowClick, onKeyDown: (event) => handleKeyDown(event, node.id), style: { paddingLeft }, className: cn(treeViewItemVariants({ size, variant })), children: [showGuides && level > 0 ? (_jsx("span", { "aria-hidden": "true", className: "pointer-events-none absolute inset-y-0 left-0 flex", children: Array.from({ length: level }).map((_, i) => (_jsx("span", { className: "border-l border-border/60", style: { width: indentStep, marginLeft: i === 0 ? 8 : 0 } }, i))) })) : null, branch ? (_jsx("button", { type: "button", tabIndex: -1, "aria-hidden": "true", disabled: disabled, onClick: onChevronClick, className: "flex size-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-transform hover:text-foreground", children: _jsx(ChevronRight, { className: cn("size-3.5 transition-transform duration-150", expanded && "rotate-90") }) })) : (_jsx("span", { "aria-hidden": "true", className: "size-4 shrink-0" })), node.icon ? (_jsx("span", { className: "flex size-4 shrink-0 items-center justify-center text-muted-foreground [&_svg]:size-4 group-aria-selected/tree-item:text-current", children: node.icon })) : null, _jsx("span", { className: "truncate", children: node.label })] }), branch && expanded && node.children && node.children.length > 0 ? (_jsx("ul", { role: "group", children: node.children.map((child) => (_jsx(TreeViewItem, { node: child, level: level + 1 }, child.id))) })) : null] }));
|
|
266
|
+
}
|
|
267
|
+
TreeViewItem.displayName = "TreeViewItem";
|
|
268
|
+
export { TreeView, TreeViewItem };
|
|
269
|
+
//# sourceMappingURL=tree-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-view.js","sourceRoot":"","sources":["../../../../src/components/ui/tree-view/tree-view.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,GAOT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,eAAe,EACf,kBAAkB,GAGnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;AAmB/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC,oBAAoB,EAAE;IACxD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,EAAE,EAAE,SAAS;YACb,OAAO,EAAE,SAAS;YAClB,EAAE,EAAE,WAAW;SACuB;KACzC;IACD,eAAe,EAAE;QACf,IAAI,EAAE,SAAS;KAChB;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CACrC,+QAA+Q,EAC/Q;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,EAAE,EAAE,2BAA2B;YAC/B,OAAO,EAAE,+BAA+B;YACxC,EAAE,EAAE,8BAA8B;SACI;QACxC,OAAO,EAAE;YACP,OAAO,EACL,2HAA2H;YAC7H,KAAK,EACH,mJAAmJ;SAC5G;KAC5C;IACD,eAAe,E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