@eqtylab/equality 5.1.1 → 5.3.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/CHANGELOG.md +63 -0
- package/dist/button.module.module.css.module.css +5 -0
- package/dist/index.cjs +198 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -19
- package/dist/index.d.ts +60 -19
- package/dist/index.js +197 -54
- package/dist/index.js.map +1 -1
- package/dist/nav-list.module.module.css.module.css +210 -16
- package/dist/nav.module.module.css.module.css +18 -12
- package/dist/theme-decisions-scoped.css +13 -0
- package/dist/theme-decisions.css +13 -0
- package/dist/theme.module.module.css.module.css +10 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React16 from 'react';
|
|
2
|
-
import { forwardRef, useState,
|
|
2
|
+
import { forwardRef, useState, useEffect, useLayoutEffect, useRef, useMemo, useCallback, createElement, useSyncExternalStore } from 'react';
|
|
3
3
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
4
4
|
import styles2 from './alert-dialog.module.module.css.module.css';
|
|
5
5
|
import { Slot, Slottable } from '@radix-ui/react-slot';
|
|
@@ -10,7 +10,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
10
10
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
import styles4 from './alert.module.module.css.module.css';
|
|
12
12
|
import * as LucideIcons from 'lucide-react';
|
|
13
|
-
import { Check, ChevronRight, Search, Circle, TriangleAlert, ChevronLeft, ChevronDown, ChevronsUpDown, X, SearchIcon, CalendarDays, AlertOctagon, Home, ChevronsLeft, ChevronsRight, ArrowUp, ArrowDown, ArrowUpDown } from 'lucide-react';
|
|
13
|
+
import { Check, ChevronRight, Search, Circle, TriangleAlert, ChevronLeft, ArrowUpRight, ChevronDown, ChevronsUpDown, X, SearchIcon, CalendarDays, AlertOctagon, Home, ChevronsLeft, ChevronsRight, ArrowUp, ArrowDown, ArrowUpDown } from 'lucide-react';
|
|
14
14
|
import styles3 from './icon.module.module.css.module.css';
|
|
15
15
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
16
16
|
import styles5 from './avatar.module.module.css.module.css';
|
|
@@ -55,6 +55,7 @@ import styles33 from './loading-overlay.module.module.css.module.css';
|
|
|
55
55
|
import styles32 from './spinner.module.module.css.module.css';
|
|
56
56
|
import styles34 from './metric-card.module.module.css.module.css';
|
|
57
57
|
import styles36 from './nav-list.module.module.css.module.css';
|
|
58
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
58
59
|
import styles41 from './nav.module.module.css.module.css';
|
|
59
60
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
60
61
|
import styles39 from './select.module.module.css.module.css';
|
|
@@ -111,6 +112,7 @@ var buttonVariants = cva(styles["button"], {
|
|
|
111
112
|
variant: {
|
|
112
113
|
primary: [styles["button--filled"], styles["button--primary"]],
|
|
113
114
|
danger: [styles["button--filled"], styles["button--danger"]],
|
|
115
|
+
success: [styles["button--filled"], styles["button--success"]],
|
|
114
116
|
warning: [styles["button--filled"], styles["button--warning"]],
|
|
115
117
|
secondary: [styles["button--filled"], styles["button--secondary"]],
|
|
116
118
|
tertiary: styles["button--tertiary"],
|
|
@@ -314,7 +316,7 @@ var Icon = forwardRef(
|
|
|
314
316
|
throw new Error("Icon must be either a string (Lucide icon name) or a React element");
|
|
315
317
|
}
|
|
316
318
|
return /* @__PURE__ */ jsx(
|
|
317
|
-
"
|
|
319
|
+
"span",
|
|
318
320
|
{
|
|
319
321
|
ref,
|
|
320
322
|
className: cn(
|
|
@@ -518,7 +520,7 @@ function Badge({
|
|
|
518
520
|
const shouldShowChildren = effectiveDisplay !== "icon-only";
|
|
519
521
|
const isIconOnly = effectiveDisplay === "icon-only" && effectiveIcon;
|
|
520
522
|
return /* @__PURE__ */ jsxs(
|
|
521
|
-
"
|
|
523
|
+
"span",
|
|
522
524
|
{
|
|
523
525
|
className: cn(
|
|
524
526
|
variant !== null && badgeVariants({ variant, size }),
|
|
@@ -2622,36 +2624,22 @@ var MotionCollapsibleContent = ({
|
|
|
2622
2624
|
children,
|
|
2623
2625
|
className
|
|
2624
2626
|
}) => {
|
|
2625
|
-
const [
|
|
2626
|
-
const [isSettled, setIsSettled] = useState(false);
|
|
2627
|
-
const contentRef = useRef(null);
|
|
2628
|
-
useEffect(() => {
|
|
2629
|
-
if (contentRef.current) {
|
|
2630
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
2631
|
-
if (contentRef.current) {
|
|
2632
|
-
setContentHeight(contentRef.current.scrollHeight);
|
|
2633
|
-
}
|
|
2634
|
-
});
|
|
2635
|
-
resizeObserver.observe(contentRef.current);
|
|
2636
|
-
setContentHeight(contentRef.current.scrollHeight);
|
|
2637
|
-
return () => resizeObserver.disconnect();
|
|
2638
|
-
}
|
|
2639
|
-
}, [children]);
|
|
2627
|
+
const [isSettled, setIsSettled] = useState(isOpen);
|
|
2640
2628
|
return /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "wait", children: isOpen && /* @__PURE__ */ jsx(
|
|
2641
2629
|
motion.div,
|
|
2642
2630
|
{
|
|
2643
2631
|
initial: { height: 0, opacity: 0 },
|
|
2644
|
-
animate: { height:
|
|
2632
|
+
animate: { height: "auto", opacity: 1 },
|
|
2645
2633
|
exit: { height: 0, opacity: 0 },
|
|
2646
2634
|
transition: { duration: 0.3, ease: "easeInOut" },
|
|
2647
2635
|
onAnimationStart: () => setIsSettled(false),
|
|
2648
|
-
onAnimationComplete: () => setIsSettled(
|
|
2636
|
+
onAnimationComplete: (definition) => setIsSettled(definition.height === "auto"),
|
|
2649
2637
|
className: cn(
|
|
2650
2638
|
styles30["motion-collapsible"],
|
|
2651
2639
|
isSettled && styles30["motion-collapsible--settled"],
|
|
2652
2640
|
className
|
|
2653
2641
|
),
|
|
2654
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
2642
|
+
children: /* @__PURE__ */ jsx("div", { children })
|
|
2655
2643
|
},
|
|
2656
2644
|
"motion-content"
|
|
2657
2645
|
) });
|
|
@@ -2784,35 +2772,50 @@ var MetricCard = ({
|
|
|
2784
2772
|
] });
|
|
2785
2773
|
};
|
|
2786
2774
|
var NavDrillContext = React16.createContext(null);
|
|
2775
|
+
var FolderMemoryContext = React16.createContext(null);
|
|
2787
2776
|
var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
2788
|
-
var
|
|
2789
|
-
drill:
|
|
2790
|
-
|
|
2791
|
-
{ transform: "translateX(12px)", opacity: 0 },
|
|
2792
|
-
{ transform: "translateX(0)", opacity: 1 }
|
|
2793
|
-
],
|
|
2794
|
-
previous: [
|
|
2795
|
-
{ transform: "translateX(0)", opacity: 1 },
|
|
2796
|
-
{ opacity: 0, offset: 0.35 },
|
|
2797
|
-
{ transform: "translateX(-12px)", opacity: 0 }
|
|
2798
|
-
]
|
|
2799
|
-
},
|
|
2800
|
-
back: {
|
|
2777
|
+
var motion2 = (direction, nudge) => {
|
|
2778
|
+
const sign = direction === "drill" ? 1 : -1;
|
|
2779
|
+
return {
|
|
2801
2780
|
current: [
|
|
2802
|
-
{ transform:
|
|
2781
|
+
{ transform: `translateX(${sign * nudge}px)`, opacity: 0 },
|
|
2803
2782
|
{ transform: "translateX(0)", opacity: 1 }
|
|
2804
2783
|
],
|
|
2805
2784
|
previous: [
|
|
2806
2785
|
{ transform: "translateX(0)", opacity: 1 },
|
|
2807
2786
|
{ opacity: 0, offset: 0.35 },
|
|
2808
|
-
{ transform:
|
|
2787
|
+
{ transform: `translateX(${-sign * nudge}px)`, opacity: 0 }
|
|
2809
2788
|
]
|
|
2810
|
-
}
|
|
2789
|
+
};
|
|
2811
2790
|
};
|
|
2812
|
-
|
|
2791
|
+
function navMotion(element) {
|
|
2792
|
+
const style = getComputedStyle(element);
|
|
2793
|
+
const read = (name) => style.getPropertyValue(name).trim();
|
|
2794
|
+
const duration = read("--eq-nav-motion-duration");
|
|
2795
|
+
const ms = duration.endsWith("ms") ? parseFloat(duration) : parseFloat(duration) * 1e3;
|
|
2796
|
+
const raw = read("--eq-nav-motion-nudge");
|
|
2797
|
+
const nudge = /^-?[\d.]+px$/.test(raw) ? parseFloat(raw) : resolveNudge(element);
|
|
2798
|
+
return {
|
|
2799
|
+
nudge: Number.isFinite(nudge) ? nudge : 12,
|
|
2800
|
+
timing: {
|
|
2801
|
+
duration: Number.isFinite(ms) ? ms : 300,
|
|
2802
|
+
easing: read("--eq-nav-motion-ease") || "cubic-bezier(.2, .8, .2, 1)"
|
|
2803
|
+
}
|
|
2804
|
+
};
|
|
2805
|
+
}
|
|
2806
|
+
function resolveNudge(element) {
|
|
2807
|
+
const previous = element.style.outlineOffset;
|
|
2808
|
+
element.style.outlineOffset = "var(--eq-nav-motion-nudge, 12px)";
|
|
2809
|
+
const nudge = parseFloat(getComputedStyle(element).outlineOffset);
|
|
2810
|
+
element.style.outlineOffset = previous;
|
|
2811
|
+
return nudge;
|
|
2812
|
+
}
|
|
2813
2813
|
var LEVEL = '[data-slot="nav-drill-level"]';
|
|
2814
2814
|
var NavDrillBackContext = React16.createContext(() => {
|
|
2815
2815
|
});
|
|
2816
|
+
var LevelFoldersContext = React16.createContext(
|
|
2817
|
+
null
|
|
2818
|
+
);
|
|
2816
2819
|
var LEAVING_DRILL_CONTEXT = { requestDrill: () => {
|
|
2817
2820
|
}, leaving: true };
|
|
2818
2821
|
var NO_BACK = () => {
|
|
@@ -2838,6 +2841,7 @@ var NavDrill = React16.forwardRef(
|
|
|
2838
2841
|
const focusRequest = React16.useRef(null);
|
|
2839
2842
|
const observer = React16.useRef(null);
|
|
2840
2843
|
const previousView = React16.useRef(view);
|
|
2844
|
+
const [levelFolders] = React16.useState(() => /* @__PURE__ */ new Map());
|
|
2841
2845
|
const level = React16.Children.toArray(children).find(
|
|
2842
2846
|
(child) => React16.isValidElement(child) && child.props.value === view
|
|
2843
2847
|
) ?? null;
|
|
@@ -2924,9 +2928,11 @@ var NavDrill = React16.forwardRef(
|
|
|
2924
2928
|
const ghostLevel = ghost?.querySelector(LEVEL);
|
|
2925
2929
|
if (!leaving || !live || !ghost || !ghostLevel) return;
|
|
2926
2930
|
ghostLevel.style.marginTop = `${leaving.top - live.getBoundingClientRect().top}px`;
|
|
2931
|
+
const { nudge, timing } = navMotion(live);
|
|
2932
|
+
const frames = motion2(leaving.direction, nudge);
|
|
2927
2933
|
const animations = [
|
|
2928
|
-
live.animate(
|
|
2929
|
-
ghost.animate(
|
|
2934
|
+
live.animate(frames.current, timing),
|
|
2935
|
+
ghost.animate(frames.previous, timing)
|
|
2930
2936
|
];
|
|
2931
2937
|
running.current = animations;
|
|
2932
2938
|
Promise.all(animations.map((animation) => animation.finished)).then(
|
|
@@ -2969,7 +2975,7 @@ var NavDrill = React16.forwardRef(
|
|
|
2969
2975
|
ghostRef.current = node;
|
|
2970
2976
|
if (node) node.inert = true;
|
|
2971
2977
|
}, []);
|
|
2972
|
-
return /* @__PURE__ */
|
|
2978
|
+
return /* @__PURE__ */ jsx(
|
|
2973
2979
|
"div",
|
|
2974
2980
|
{
|
|
2975
2981
|
ref: setRootRef,
|
|
@@ -2977,7 +2983,7 @@ var NavDrill = React16.forwardRef(
|
|
|
2977
2983
|
"data-motion": leaving?.direction,
|
|
2978
2984
|
className: cn(styles36["nav-drill"], className),
|
|
2979
2985
|
...props,
|
|
2980
|
-
children: [
|
|
2986
|
+
children: /* @__PURE__ */ jsxs(LevelFoldersContext.Provider, { value: levelFolders, children: [
|
|
2981
2987
|
/* @__PURE__ */ jsx(NavDrillContext.Provider, { value: drillContext, children: /* @__PURE__ */ jsx(NavDrillBackContext.Provider, { value: requestBack, children: level && /* @__PURE__ */ jsx(React16.Fragment, { children: level }, view) }) }),
|
|
2982
2988
|
leaving && /* @__PURE__ */ jsx(
|
|
2983
2989
|
"div",
|
|
@@ -2991,7 +2997,7 @@ var NavDrill = React16.forwardRef(
|
|
|
2991
2997
|
},
|
|
2992
2998
|
leaving.id
|
|
2993
2999
|
)
|
|
2994
|
-
]
|
|
3000
|
+
] })
|
|
2995
3001
|
}
|
|
2996
3002
|
);
|
|
2997
3003
|
}
|
|
@@ -3000,6 +3006,12 @@ NavDrill.displayName = "NavDrill";
|
|
|
3000
3006
|
var NavDrillLevel = React16.forwardRef(
|
|
3001
3007
|
({ value, parent, label, backLabel, className, children, ...props }, ref) => {
|
|
3002
3008
|
const requestBack = React16.useContext(NavDrillBackContext);
|
|
3009
|
+
const levelFolders = React16.useContext(LevelFoldersContext);
|
|
3010
|
+
let folders = levelFolders?.get(value) ?? null;
|
|
3011
|
+
if (levelFolders && !folders) {
|
|
3012
|
+
folders = /* @__PURE__ */ new Map();
|
|
3013
|
+
levelFolders.set(value, folders);
|
|
3014
|
+
}
|
|
3003
3015
|
React16.useEffect(() => {
|
|
3004
3016
|
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production" && parent !== void 0 && backLabel && label && !backLabel.startsWith(label)) {
|
|
3005
3017
|
console.warn(
|
|
@@ -3026,14 +3038,21 @@ var NavDrillLevel = React16.forwardRef(
|
|
|
3026
3038
|
className: cn(styles36["nav-list-item"], styles36["nav-list-item--back"]),
|
|
3027
3039
|
onClick: () => requestBack(parent),
|
|
3028
3040
|
children: [
|
|
3029
|
-
/* @__PURE__ */ jsx(
|
|
3041
|
+
/* @__PURE__ */ jsx(
|
|
3042
|
+
"span",
|
|
3043
|
+
{
|
|
3044
|
+
className: cn(styles36["nav-list-item-prefix"], styles36["nav-list-item-muted"]),
|
|
3045
|
+
"aria-hidden": "true",
|
|
3046
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, {})
|
|
3047
|
+
}
|
|
3048
|
+
),
|
|
3030
3049
|
/* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-label"], title: label, children: label })
|
|
3031
3050
|
]
|
|
3032
3051
|
}
|
|
3033
3052
|
),
|
|
3034
3053
|
/* @__PURE__ */ jsx("hr", { className: styles36["nav-drill-rule"] })
|
|
3035
3054
|
] }),
|
|
3036
|
-
children
|
|
3055
|
+
/* @__PURE__ */ jsx(FolderMemoryContext.Provider, { value: folders, children })
|
|
3037
3056
|
]
|
|
3038
3057
|
}
|
|
3039
3058
|
);
|
|
@@ -3041,7 +3060,8 @@ var NavDrillLevel = React16.forwardRef(
|
|
|
3041
3060
|
);
|
|
3042
3061
|
NavDrillLevel.displayName = "NavDrillLevel";
|
|
3043
3062
|
var ListDepthContext = React16.createContext(0);
|
|
3044
|
-
var
|
|
3063
|
+
var RevealFolderContext = React16.createContext(null);
|
|
3064
|
+
var NavList = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, "data-slot": "nav-list", className: cn(styles36["nav-list"], className), ...props }));
|
|
3045
3065
|
NavList.displayName = "NavList";
|
|
3046
3066
|
var NavListGroup = React16.forwardRef(
|
|
3047
3067
|
({ label, className, children, ...props }, ref) => {
|
|
@@ -3051,11 +3071,8 @@ var NavListGroup = React16.forwardRef(
|
|
|
3051
3071
|
"div",
|
|
3052
3072
|
{
|
|
3053
3073
|
ref,
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
!label && styles36["nav-list-group--unlabelled"],
|
|
3057
|
-
className
|
|
3058
|
-
),
|
|
3074
|
+
"data-slot": "nav-list-group",
|
|
3075
|
+
className: cn(styles36["nav-list-group"], className),
|
|
3059
3076
|
...props,
|
|
3060
3077
|
children: [
|
|
3061
3078
|
label && /* @__PURE__ */ jsx("div", { id: labelId, className: styles36["nav-list-group-label"], children: label }),
|
|
@@ -3089,8 +3106,12 @@ var NavListItem = React16.forwardRef(
|
|
|
3089
3106
|
...props
|
|
3090
3107
|
}, ref) => {
|
|
3091
3108
|
const drillContext = React16.useContext(NavDrillContext);
|
|
3109
|
+
const revealFolder = React16.useContext(RevealFolderContext);
|
|
3110
|
+
const wasCurrent = React16.useRef(current);
|
|
3092
3111
|
const Comp = asChild ? Slot : props.href ? "a" : "button";
|
|
3093
3112
|
const leaving = drillContext?.leaving ?? false;
|
|
3113
|
+
const childTarget = asChild && React16.isValidElement(children) ? children.props.target : void 0;
|
|
3114
|
+
const newTab = (props.target ?? childTarget) === "_blank";
|
|
3094
3115
|
const handleClick = (event) => {
|
|
3095
3116
|
onClick?.(event);
|
|
3096
3117
|
if (!drill || !drillContext) return;
|
|
@@ -3098,6 +3119,10 @@ var NavListItem = React16.forwardRef(
|
|
|
3098
3119
|
return;
|
|
3099
3120
|
drillContext.requestDrill(drill);
|
|
3100
3121
|
};
|
|
3122
|
+
useIsomorphicLayoutEffect(() => {
|
|
3123
|
+
if (current) revealFolder?.(wasCurrent.current ? "mount" : "change");
|
|
3124
|
+
wasCurrent.current = current;
|
|
3125
|
+
}, [current, revealFolder]);
|
|
3101
3126
|
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
3102
3127
|
Comp,
|
|
3103
3128
|
{
|
|
@@ -3109,13 +3134,32 @@ var NavListItem = React16.forwardRef(
|
|
|
3109
3134
|
"data-current": current && leaving ? "page" : void 0,
|
|
3110
3135
|
className: cn(styles36["nav-list-item"], className),
|
|
3111
3136
|
onClick: handleClick,
|
|
3137
|
+
rel: newTab ? "noopener noreferrer" : void 0,
|
|
3112
3138
|
...props,
|
|
3113
3139
|
children: [
|
|
3114
3140
|
prefix && /* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-prefix"], "aria-hidden": "true", children: prefix }),
|
|
3115
3141
|
/* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-label"], title: label, children: label }),
|
|
3116
3142
|
/* @__PURE__ */ jsx(Slottable, { children }),
|
|
3117
3143
|
suffix && /* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-suffix"], children: suffix }),
|
|
3118
|
-
|
|
3144
|
+
newTab && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3145
|
+
/* @__PURE__ */ jsx(
|
|
3146
|
+
"span",
|
|
3147
|
+
{
|
|
3148
|
+
className: cn(styles36["nav-list-item-caret"], styles36["nav-list-item-muted"]),
|
|
3149
|
+
"aria-hidden": "true",
|
|
3150
|
+
children: /* @__PURE__ */ jsx(ArrowUpRight, {})
|
|
3151
|
+
}
|
|
3152
|
+
),
|
|
3153
|
+
/* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-new-tab"], children: " (opens in a new tab)" })
|
|
3154
|
+
] }),
|
|
3155
|
+
drill && /* @__PURE__ */ jsx(
|
|
3156
|
+
"span",
|
|
3157
|
+
{
|
|
3158
|
+
className: cn(styles36["nav-list-item-caret"], styles36["nav-list-item-muted"]),
|
|
3159
|
+
"aria-hidden": "true",
|
|
3160
|
+
children: /* @__PURE__ */ jsx(ChevronRight, {})
|
|
3161
|
+
}
|
|
3162
|
+
)
|
|
3119
3163
|
]
|
|
3120
3164
|
}
|
|
3121
3165
|
) });
|
|
@@ -3138,6 +3182,105 @@ var NavListSeparator = React16.forwardRef(
|
|
|
3138
3182
|
}
|
|
3139
3183
|
);
|
|
3140
3184
|
NavListSeparator.displayName = "NavListSeparator";
|
|
3185
|
+
var NavListExpandable = React16.forwardRef(
|
|
3186
|
+
({ open, defaultOpen = false, onOpenChange, value, className, ...props }, ref) => {
|
|
3187
|
+
const revealParent = React16.useContext(RevealFolderContext);
|
|
3188
|
+
const folders = React16.useContext(FolderMemoryContext);
|
|
3189
|
+
const memory = value === void 0 ? void 0 : folders?.get(value);
|
|
3190
|
+
const [ownOpen, setOwnOpen] = React16.useState(memory?.open ?? defaultOpen);
|
|
3191
|
+
const [instant, setInstant] = React16.useState(false);
|
|
3192
|
+
const isOpen = open ?? ownOpen;
|
|
3193
|
+
const mounting = React16.useRef(true);
|
|
3194
|
+
const closedByReader = React16.useRef(memory?.closedByReader ?? false);
|
|
3195
|
+
const askedToOpen = React16.useRef(false);
|
|
3196
|
+
const handleOpenChange = (next) => {
|
|
3197
|
+
closedByReader.current = !next;
|
|
3198
|
+
if (open === void 0) setOwnOpen(next);
|
|
3199
|
+
onOpenChange?.(next);
|
|
3200
|
+
};
|
|
3201
|
+
const latest = React16.useRef({ isOpen, handleOpenChange, revealParent });
|
|
3202
|
+
useIsomorphicLayoutEffect(() => {
|
|
3203
|
+
latest.current = { isOpen, handleOpenChange, revealParent };
|
|
3204
|
+
if (isOpen) askedToOpen.current = false;
|
|
3205
|
+
if (value !== void 0)
|
|
3206
|
+
folders?.set(value, { open: isOpen, closedByReader: closedByReader.current });
|
|
3207
|
+
});
|
|
3208
|
+
React16.useEffect(() => {
|
|
3209
|
+
const frame = requestAnimationFrame(() => {
|
|
3210
|
+
mounting.current = false;
|
|
3211
|
+
});
|
|
3212
|
+
return () => cancelAnimationFrame(frame);
|
|
3213
|
+
}, []);
|
|
3214
|
+
React16.useEffect(() => {
|
|
3215
|
+
if (!instant) return;
|
|
3216
|
+
const frame = requestAnimationFrame(() => setInstant(false));
|
|
3217
|
+
return () => cancelAnimationFrame(frame);
|
|
3218
|
+
}, [instant]);
|
|
3219
|
+
const reveal = React16.useCallback((reason) => {
|
|
3220
|
+
const folder = latest.current;
|
|
3221
|
+
folder.revealParent?.(reason);
|
|
3222
|
+
if (folder.isOpen) return;
|
|
3223
|
+
if (reason === "mount" && (closedByReader.current || askedToOpen.current)) return;
|
|
3224
|
+
askedToOpen.current = true;
|
|
3225
|
+
if (mounting.current) setInstant(true);
|
|
3226
|
+
folder.handleOpenChange(true);
|
|
3227
|
+
}, []);
|
|
3228
|
+
return /* @__PURE__ */ jsx(RevealFolderContext.Provider, { value: reveal, children: /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { asChild: true, open: isOpen, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsx(
|
|
3229
|
+
"li",
|
|
3230
|
+
{
|
|
3231
|
+
ref,
|
|
3232
|
+
"data-instant": instant ? "" : void 0,
|
|
3233
|
+
className: cn(styles36["nav-list-expandable"], className),
|
|
3234
|
+
...props
|
|
3235
|
+
}
|
|
3236
|
+
) }) });
|
|
3237
|
+
}
|
|
3238
|
+
);
|
|
3239
|
+
NavListExpandable.displayName = "NavListExpandable";
|
|
3240
|
+
var NavListExpandableTrigger = React16.forwardRef(
|
|
3241
|
+
({ label, prefix, suffix, className, ...props }, ref) => {
|
|
3242
|
+
const [mounted, setMounted] = React16.useState(false);
|
|
3243
|
+
React16.useEffect(() => setMounted(true), []);
|
|
3244
|
+
return /* @__PURE__ */ jsxs(
|
|
3245
|
+
CollapsiblePrimitive.Trigger,
|
|
3246
|
+
{
|
|
3247
|
+
ref,
|
|
3248
|
+
"data-slot": "nav-list-expandable-trigger",
|
|
3249
|
+
className: cn(styles36["nav-list-item"], styles36["nav-list-expandable-trigger"], className),
|
|
3250
|
+
...mounted ? {} : { "aria-expanded": void 0 },
|
|
3251
|
+
...props,
|
|
3252
|
+
children: [
|
|
3253
|
+
prefix && /* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-prefix"], "aria-hidden": "true", children: prefix }),
|
|
3254
|
+
/* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-label"], title: label, children: label }),
|
|
3255
|
+
suffix && /* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-suffix"], children: suffix }),
|
|
3256
|
+
/* @__PURE__ */ jsx(
|
|
3257
|
+
"span",
|
|
3258
|
+
{
|
|
3259
|
+
className: cn(styles36["nav-list-expandable-chevron"], styles36["nav-list-item-muted"]),
|
|
3260
|
+
"aria-hidden": "true",
|
|
3261
|
+
children: /* @__PURE__ */ jsx(ChevronDown, {})
|
|
3262
|
+
}
|
|
3263
|
+
)
|
|
3264
|
+
]
|
|
3265
|
+
}
|
|
3266
|
+
);
|
|
3267
|
+
}
|
|
3268
|
+
);
|
|
3269
|
+
NavListExpandableTrigger.displayName = "NavListExpandableTrigger";
|
|
3270
|
+
var NavListExpandableContent = React16.forwardRef(({ className, children, ...props }, ref) => {
|
|
3271
|
+
const depth = React16.useContext(ListDepthContext);
|
|
3272
|
+
return /* @__PURE__ */ jsx("div", { className: styles36["nav-list-expandable-panel"], children: /* @__PURE__ */ jsx(CollapsiblePrimitive.Content, { forceMount: true, className: styles36["nav-list-expandable-content"], children: /* @__PURE__ */ jsx(
|
|
3273
|
+
"ul",
|
|
3274
|
+
{
|
|
3275
|
+
ref,
|
|
3276
|
+
"data-depth": depth,
|
|
3277
|
+
className: cn(styles36["nav-list-items"], styles36["nav-list-expandable-items"], className),
|
|
3278
|
+
...props,
|
|
3279
|
+
children: /* @__PURE__ */ jsx(ListDepthContext.Provider, { value: depth + 1, children })
|
|
3280
|
+
}
|
|
3281
|
+
) }) });
|
|
3282
|
+
});
|
|
3283
|
+
NavListExpandableContent.displayName = "NavListExpandableContent";
|
|
3141
3284
|
var NavPanel = React16.forwardRef(
|
|
3142
3285
|
({ header, className, children, ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, className: cn(styles41["nav-panel"], className), ...props, children: /* @__PURE__ */ jsxs("div", { className: styles41["nav-scroller"], "data-nav-scroller": "", children: [
|
|
3143
3286
|
header && /* @__PURE__ */ jsx("div", { className: styles41["nav-panel-header"], children: header }),
|
|
@@ -5252,6 +5395,6 @@ var useTheme = () => {
|
|
|
5252
5395
|
return [theme, setTheme];
|
|
5253
5396
|
};
|
|
5254
5397
|
|
|
5255
|
-
export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Banner, BarGraph, BarGraphSegment, BgGradient, Button, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, CopyButton, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, Heading, Icon, IconButton, InfoCard, Input, Label2 as Label, LoadingOverlay, MetricCard, MotionCollapsibleContent, NavDrill, NavDrillLevel, NavList, NavListGroup, NavListItem, NavListSeparator, NavPanel, NavRail, NavRailItem, NavSwitcher, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, ProgressIndicatorStep, RadialGraph, RadioDropdown, RadioGroup2 as RadioGroup, RadioGroupItem, ResourceBadge, SearchBar, SectionHeading, SegmentedControls, Select, SelectContent, SelectEmpty, SelectGroup, SelectItem, SelectLabel, SelectSearch, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toast, ToastAction, ToastClose, ToastContainer, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, badgeVariants, blockClosedTypeahead, buttonVariants, reducer, scheduleHighlight, toast, useDropdownMenuSearchQuery, useFormField, usePortalContainer, useSelectSearchQuery, useTheme, useToast };
|
|
5398
|
+
export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Banner, BarGraph, BarGraphSegment, BgGradient, Button, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, CopyButton, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, Heading, Icon, IconButton, InfoCard, Input, Label2 as Label, LoadingOverlay, MetricCard, MotionCollapsibleContent, NavDrill, NavDrillLevel, NavList, NavListExpandable, NavListExpandableContent, NavListExpandableTrigger, NavListGroup, NavListItem, NavListSeparator, NavPanel, NavRail, NavRailItem, NavSwitcher, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, ProgressIndicatorStep, RadialGraph, RadioDropdown, RadioGroup2 as RadioGroup, RadioGroupItem, ResourceBadge, SearchBar, SectionHeading, SegmentedControls, Select, SelectContent, SelectEmpty, SelectGroup, SelectItem, SelectLabel, SelectSearch, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toast, ToastAction, ToastClose, ToastContainer, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, badgeVariants, blockClosedTypeahead, buttonVariants, reducer, scheduleHighlight, toast, useDropdownMenuSearchQuery, useFormField, usePortalContainer, useSelectSearchQuery, useTheme, useToast };
|
|
5256
5399
|
//# sourceMappingURL=index.js.map
|
|
5257
5400
|
//# sourceMappingURL=index.js.map
|