@eqtylab/equality 5.2.0 → 5.3.1
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 +67 -0
- package/dist/dropdown-menu.module.module.css.module.css +12 -11
- package/dist/index.cjs +200 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -8
- package/dist/index.d.ts +49 -8
- package/dist/index.js +199 -58
- 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,
|
|
13
|
+
import { Check, ChevronRight, Search, TriangleAlert, ChevronLeft, ArrowUpRight, ChevronDown, ChevronsUpDown, Circle, 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';
|
|
@@ -315,7 +316,7 @@ var Icon = forwardRef(
|
|
|
315
316
|
throw new Error("Icon must be either a string (Lucide icon name) or a React element");
|
|
316
317
|
}
|
|
317
318
|
return /* @__PURE__ */ jsx(
|
|
318
|
-
"
|
|
319
|
+
"span",
|
|
319
320
|
{
|
|
320
321
|
ref,
|
|
321
322
|
className: cn(
|
|
@@ -519,7 +520,7 @@ function Badge({
|
|
|
519
520
|
const shouldShowChildren = effectiveDisplay !== "icon-only";
|
|
520
521
|
const isIconOnly = effectiveDisplay === "icon-only" && effectiveIcon;
|
|
521
522
|
return /* @__PURE__ */ jsxs(
|
|
522
|
-
"
|
|
523
|
+
"span",
|
|
523
524
|
{
|
|
524
525
|
className: cn(
|
|
525
526
|
variant !== null && badgeVariants({ variant, size }),
|
|
@@ -1882,7 +1883,6 @@ function assignRefs(node, ...refs) {
|
|
|
1882
1883
|
}
|
|
1883
1884
|
var CheckIcon2 = Check;
|
|
1884
1885
|
var ChevronRightIcon2 = ChevronRight;
|
|
1885
|
-
var CircleIcon = Circle;
|
|
1886
1886
|
var SearchIcon2 = Search;
|
|
1887
1887
|
var DropdownMenuSearchContext = React16.createContext(null);
|
|
1888
1888
|
var useDropdownMenuSearch = () => React16.useContext(DropdownMenuSearchContext);
|
|
@@ -2201,7 +2201,7 @@ var DropdownMenuRadioItem = React16.forwardRef(({ className, children, textValue
|
|
|
2201
2201
|
...props,
|
|
2202
2202
|
"data-persistent": persistent ? "" : void 0,
|
|
2203
2203
|
children: [
|
|
2204
|
-
/* @__PURE__ */ jsx("span", { className: styles22["dropdown-menu-item-indicator-radio"], children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(
|
|
2204
|
+
/* @__PURE__ */ jsx("span", { className: styles22["dropdown-menu-item-indicator-radio"], children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon2, { className: styles22["radio-icon"] }) }) }),
|
|
2205
2205
|
/* @__PURE__ */ jsx(ItemBreadcrumb, {}),
|
|
2206
2206
|
children
|
|
2207
2207
|
]
|
|
@@ -2623,36 +2623,22 @@ var MotionCollapsibleContent = ({
|
|
|
2623
2623
|
children,
|
|
2624
2624
|
className
|
|
2625
2625
|
}) => {
|
|
2626
|
-
const [
|
|
2627
|
-
const [isSettled, setIsSettled] = useState(false);
|
|
2628
|
-
const contentRef = useRef(null);
|
|
2629
|
-
useEffect(() => {
|
|
2630
|
-
if (contentRef.current) {
|
|
2631
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
2632
|
-
if (contentRef.current) {
|
|
2633
|
-
setContentHeight(contentRef.current.scrollHeight);
|
|
2634
|
-
}
|
|
2635
|
-
});
|
|
2636
|
-
resizeObserver.observe(contentRef.current);
|
|
2637
|
-
setContentHeight(contentRef.current.scrollHeight);
|
|
2638
|
-
return () => resizeObserver.disconnect();
|
|
2639
|
-
}
|
|
2640
|
-
}, [children]);
|
|
2626
|
+
const [isSettled, setIsSettled] = useState(isOpen);
|
|
2641
2627
|
return /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "wait", children: isOpen && /* @__PURE__ */ jsx(
|
|
2642
2628
|
motion.div,
|
|
2643
2629
|
{
|
|
2644
2630
|
initial: { height: 0, opacity: 0 },
|
|
2645
|
-
animate: { height:
|
|
2631
|
+
animate: { height: "auto", opacity: 1 },
|
|
2646
2632
|
exit: { height: 0, opacity: 0 },
|
|
2647
2633
|
transition: { duration: 0.3, ease: "easeInOut" },
|
|
2648
2634
|
onAnimationStart: () => setIsSettled(false),
|
|
2649
|
-
onAnimationComplete: () => setIsSettled(
|
|
2635
|
+
onAnimationComplete: (definition) => setIsSettled(definition.height === "auto"),
|
|
2650
2636
|
className: cn(
|
|
2651
2637
|
styles30["motion-collapsible"],
|
|
2652
2638
|
isSettled && styles30["motion-collapsible--settled"],
|
|
2653
2639
|
className
|
|
2654
2640
|
),
|
|
2655
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
2641
|
+
children: /* @__PURE__ */ jsx("div", { children })
|
|
2656
2642
|
},
|
|
2657
2643
|
"motion-content"
|
|
2658
2644
|
) });
|
|
@@ -2785,35 +2771,50 @@ var MetricCard = ({
|
|
|
2785
2771
|
] });
|
|
2786
2772
|
};
|
|
2787
2773
|
var NavDrillContext = React16.createContext(null);
|
|
2774
|
+
var FolderMemoryContext = React16.createContext(null);
|
|
2788
2775
|
var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
2789
|
-
var
|
|
2790
|
-
drill:
|
|
2791
|
-
|
|
2792
|
-
{ transform: "translateX(12px)", opacity: 0 },
|
|
2793
|
-
{ transform: "translateX(0)", opacity: 1 }
|
|
2794
|
-
],
|
|
2795
|
-
previous: [
|
|
2796
|
-
{ transform: "translateX(0)", opacity: 1 },
|
|
2797
|
-
{ opacity: 0, offset: 0.35 },
|
|
2798
|
-
{ transform: "translateX(-12px)", opacity: 0 }
|
|
2799
|
-
]
|
|
2800
|
-
},
|
|
2801
|
-
back: {
|
|
2776
|
+
var motion2 = (direction, nudge) => {
|
|
2777
|
+
const sign = direction === "drill" ? 1 : -1;
|
|
2778
|
+
return {
|
|
2802
2779
|
current: [
|
|
2803
|
-
{ transform:
|
|
2780
|
+
{ transform: `translateX(${sign * nudge}px)`, opacity: 0 },
|
|
2804
2781
|
{ transform: "translateX(0)", opacity: 1 }
|
|
2805
2782
|
],
|
|
2806
2783
|
previous: [
|
|
2807
2784
|
{ transform: "translateX(0)", opacity: 1 },
|
|
2808
2785
|
{ opacity: 0, offset: 0.35 },
|
|
2809
|
-
{ transform:
|
|
2786
|
+
{ transform: `translateX(${-sign * nudge}px)`, opacity: 0 }
|
|
2810
2787
|
]
|
|
2811
|
-
}
|
|
2788
|
+
};
|
|
2812
2789
|
};
|
|
2813
|
-
|
|
2790
|
+
function navMotion(element) {
|
|
2791
|
+
const style = getComputedStyle(element);
|
|
2792
|
+
const read = (name) => style.getPropertyValue(name).trim();
|
|
2793
|
+
const duration = read("--eq-nav-motion-duration");
|
|
2794
|
+
const ms = duration.endsWith("ms") ? parseFloat(duration) : parseFloat(duration) * 1e3;
|
|
2795
|
+
const raw = read("--eq-nav-motion-nudge");
|
|
2796
|
+
const nudge = /^-?[\d.]+px$/.test(raw) ? parseFloat(raw) : resolveNudge(element);
|
|
2797
|
+
return {
|
|
2798
|
+
nudge: Number.isFinite(nudge) ? nudge : 12,
|
|
2799
|
+
timing: {
|
|
2800
|
+
duration: Number.isFinite(ms) ? ms : 300,
|
|
2801
|
+
easing: read("--eq-nav-motion-ease") || "cubic-bezier(.2, .8, .2, 1)"
|
|
2802
|
+
}
|
|
2803
|
+
};
|
|
2804
|
+
}
|
|
2805
|
+
function resolveNudge(element) {
|
|
2806
|
+
const previous = element.style.outlineOffset;
|
|
2807
|
+
element.style.outlineOffset = "var(--eq-nav-motion-nudge, 12px)";
|
|
2808
|
+
const nudge = parseFloat(getComputedStyle(element).outlineOffset);
|
|
2809
|
+
element.style.outlineOffset = previous;
|
|
2810
|
+
return nudge;
|
|
2811
|
+
}
|
|
2814
2812
|
var LEVEL = '[data-slot="nav-drill-level"]';
|
|
2815
2813
|
var NavDrillBackContext = React16.createContext(() => {
|
|
2816
2814
|
});
|
|
2815
|
+
var LevelFoldersContext = React16.createContext(
|
|
2816
|
+
null
|
|
2817
|
+
);
|
|
2817
2818
|
var LEAVING_DRILL_CONTEXT = { requestDrill: () => {
|
|
2818
2819
|
}, leaving: true };
|
|
2819
2820
|
var NO_BACK = () => {
|
|
@@ -2839,6 +2840,7 @@ var NavDrill = React16.forwardRef(
|
|
|
2839
2840
|
const focusRequest = React16.useRef(null);
|
|
2840
2841
|
const observer = React16.useRef(null);
|
|
2841
2842
|
const previousView = React16.useRef(view);
|
|
2843
|
+
const [levelFolders] = React16.useState(() => /* @__PURE__ */ new Map());
|
|
2842
2844
|
const level = React16.Children.toArray(children).find(
|
|
2843
2845
|
(child) => React16.isValidElement(child) && child.props.value === view
|
|
2844
2846
|
) ?? null;
|
|
@@ -2925,9 +2927,11 @@ var NavDrill = React16.forwardRef(
|
|
|
2925
2927
|
const ghostLevel = ghost?.querySelector(LEVEL);
|
|
2926
2928
|
if (!leaving || !live || !ghost || !ghostLevel) return;
|
|
2927
2929
|
ghostLevel.style.marginTop = `${leaving.top - live.getBoundingClientRect().top}px`;
|
|
2930
|
+
const { nudge, timing } = navMotion(live);
|
|
2931
|
+
const frames = motion2(leaving.direction, nudge);
|
|
2928
2932
|
const animations = [
|
|
2929
|
-
live.animate(
|
|
2930
|
-
ghost.animate(
|
|
2933
|
+
live.animate(frames.current, timing),
|
|
2934
|
+
ghost.animate(frames.previous, timing)
|
|
2931
2935
|
];
|
|
2932
2936
|
running.current = animations;
|
|
2933
2937
|
Promise.all(animations.map((animation) => animation.finished)).then(
|
|
@@ -2970,7 +2974,7 @@ var NavDrill = React16.forwardRef(
|
|
|
2970
2974
|
ghostRef.current = node;
|
|
2971
2975
|
if (node) node.inert = true;
|
|
2972
2976
|
}, []);
|
|
2973
|
-
return /* @__PURE__ */
|
|
2977
|
+
return /* @__PURE__ */ jsx(
|
|
2974
2978
|
"div",
|
|
2975
2979
|
{
|
|
2976
2980
|
ref: setRootRef,
|
|
@@ -2978,7 +2982,7 @@ var NavDrill = React16.forwardRef(
|
|
|
2978
2982
|
"data-motion": leaving?.direction,
|
|
2979
2983
|
className: cn(styles36["nav-drill"], className),
|
|
2980
2984
|
...props,
|
|
2981
|
-
children: [
|
|
2985
|
+
children: /* @__PURE__ */ jsxs(LevelFoldersContext.Provider, { value: levelFolders, children: [
|
|
2982
2986
|
/* @__PURE__ */ jsx(NavDrillContext.Provider, { value: drillContext, children: /* @__PURE__ */ jsx(NavDrillBackContext.Provider, { value: requestBack, children: level && /* @__PURE__ */ jsx(React16.Fragment, { children: level }, view) }) }),
|
|
2983
2987
|
leaving && /* @__PURE__ */ jsx(
|
|
2984
2988
|
"div",
|
|
@@ -2992,7 +2996,7 @@ var NavDrill = React16.forwardRef(
|
|
|
2992
2996
|
},
|
|
2993
2997
|
leaving.id
|
|
2994
2998
|
)
|
|
2995
|
-
]
|
|
2999
|
+
] })
|
|
2996
3000
|
}
|
|
2997
3001
|
);
|
|
2998
3002
|
}
|
|
@@ -3001,6 +3005,12 @@ NavDrill.displayName = "NavDrill";
|
|
|
3001
3005
|
var NavDrillLevel = React16.forwardRef(
|
|
3002
3006
|
({ value, parent, label, backLabel, className, children, ...props }, ref) => {
|
|
3003
3007
|
const requestBack = React16.useContext(NavDrillBackContext);
|
|
3008
|
+
const levelFolders = React16.useContext(LevelFoldersContext);
|
|
3009
|
+
let folders = levelFolders?.get(value) ?? null;
|
|
3010
|
+
if (levelFolders && !folders) {
|
|
3011
|
+
folders = /* @__PURE__ */ new Map();
|
|
3012
|
+
levelFolders.set(value, folders);
|
|
3013
|
+
}
|
|
3004
3014
|
React16.useEffect(() => {
|
|
3005
3015
|
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production" && parent !== void 0 && backLabel && label && !backLabel.startsWith(label)) {
|
|
3006
3016
|
console.warn(
|
|
@@ -3027,14 +3037,21 @@ var NavDrillLevel = React16.forwardRef(
|
|
|
3027
3037
|
className: cn(styles36["nav-list-item"], styles36["nav-list-item--back"]),
|
|
3028
3038
|
onClick: () => requestBack(parent),
|
|
3029
3039
|
children: [
|
|
3030
|
-
/* @__PURE__ */ jsx(
|
|
3040
|
+
/* @__PURE__ */ jsx(
|
|
3041
|
+
"span",
|
|
3042
|
+
{
|
|
3043
|
+
className: cn(styles36["nav-list-item-prefix"], styles36["nav-list-item-muted"]),
|
|
3044
|
+
"aria-hidden": "true",
|
|
3045
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, {})
|
|
3046
|
+
}
|
|
3047
|
+
),
|
|
3031
3048
|
/* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-label"], title: label, children: label })
|
|
3032
3049
|
]
|
|
3033
3050
|
}
|
|
3034
3051
|
),
|
|
3035
3052
|
/* @__PURE__ */ jsx("hr", { className: styles36["nav-drill-rule"] })
|
|
3036
3053
|
] }),
|
|
3037
|
-
children
|
|
3054
|
+
/* @__PURE__ */ jsx(FolderMemoryContext.Provider, { value: folders, children })
|
|
3038
3055
|
]
|
|
3039
3056
|
}
|
|
3040
3057
|
);
|
|
@@ -3042,7 +3059,8 @@ var NavDrillLevel = React16.forwardRef(
|
|
|
3042
3059
|
);
|
|
3043
3060
|
NavDrillLevel.displayName = "NavDrillLevel";
|
|
3044
3061
|
var ListDepthContext = React16.createContext(0);
|
|
3045
|
-
var
|
|
3062
|
+
var RevealFolderContext = React16.createContext(null);
|
|
3063
|
+
var NavList = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, "data-slot": "nav-list", className: cn(styles36["nav-list"], className), ...props }));
|
|
3046
3064
|
NavList.displayName = "NavList";
|
|
3047
3065
|
var NavListGroup = React16.forwardRef(
|
|
3048
3066
|
({ label, className, children, ...props }, ref) => {
|
|
@@ -3052,11 +3070,8 @@ var NavListGroup = React16.forwardRef(
|
|
|
3052
3070
|
"div",
|
|
3053
3071
|
{
|
|
3054
3072
|
ref,
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
!label && styles36["nav-list-group--unlabelled"],
|
|
3058
|
-
className
|
|
3059
|
-
),
|
|
3073
|
+
"data-slot": "nav-list-group",
|
|
3074
|
+
className: cn(styles36["nav-list-group"], className),
|
|
3060
3075
|
...props,
|
|
3061
3076
|
children: [
|
|
3062
3077
|
label && /* @__PURE__ */ jsx("div", { id: labelId, className: styles36["nav-list-group-label"], children: label }),
|
|
@@ -3090,8 +3105,12 @@ var NavListItem = React16.forwardRef(
|
|
|
3090
3105
|
...props
|
|
3091
3106
|
}, ref) => {
|
|
3092
3107
|
const drillContext = React16.useContext(NavDrillContext);
|
|
3108
|
+
const revealFolder = React16.useContext(RevealFolderContext);
|
|
3109
|
+
const wasCurrent = React16.useRef(current);
|
|
3093
3110
|
const Comp = asChild ? Slot : props.href ? "a" : "button";
|
|
3094
3111
|
const leaving = drillContext?.leaving ?? false;
|
|
3112
|
+
const childTarget = asChild && React16.isValidElement(children) ? children.props.target : void 0;
|
|
3113
|
+
const newTab = (props.target ?? childTarget) === "_blank";
|
|
3095
3114
|
const handleClick = (event) => {
|
|
3096
3115
|
onClick?.(event);
|
|
3097
3116
|
if (!drill || !drillContext) return;
|
|
@@ -3099,6 +3118,10 @@ var NavListItem = React16.forwardRef(
|
|
|
3099
3118
|
return;
|
|
3100
3119
|
drillContext.requestDrill(drill);
|
|
3101
3120
|
};
|
|
3121
|
+
useIsomorphicLayoutEffect(() => {
|
|
3122
|
+
if (current) revealFolder?.(wasCurrent.current ? "mount" : "change");
|
|
3123
|
+
wasCurrent.current = current;
|
|
3124
|
+
}, [current, revealFolder]);
|
|
3102
3125
|
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
3103
3126
|
Comp,
|
|
3104
3127
|
{
|
|
@@ -3110,13 +3133,32 @@ var NavListItem = React16.forwardRef(
|
|
|
3110
3133
|
"data-current": current && leaving ? "page" : void 0,
|
|
3111
3134
|
className: cn(styles36["nav-list-item"], className),
|
|
3112
3135
|
onClick: handleClick,
|
|
3136
|
+
rel: newTab ? "noopener noreferrer" : void 0,
|
|
3113
3137
|
...props,
|
|
3114
3138
|
children: [
|
|
3115
3139
|
prefix && /* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-prefix"], "aria-hidden": "true", children: prefix }),
|
|
3116
3140
|
/* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-label"], title: label, children: label }),
|
|
3117
3141
|
/* @__PURE__ */ jsx(Slottable, { children }),
|
|
3118
3142
|
suffix && /* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-suffix"], children: suffix }),
|
|
3119
|
-
|
|
3143
|
+
newTab && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3144
|
+
/* @__PURE__ */ jsx(
|
|
3145
|
+
"span",
|
|
3146
|
+
{
|
|
3147
|
+
className: cn(styles36["nav-list-item-caret"], styles36["nav-list-item-muted"]),
|
|
3148
|
+
"aria-hidden": "true",
|
|
3149
|
+
children: /* @__PURE__ */ jsx(ArrowUpRight, {})
|
|
3150
|
+
}
|
|
3151
|
+
),
|
|
3152
|
+
/* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-new-tab"], children: " (opens in a new tab)" })
|
|
3153
|
+
] }),
|
|
3154
|
+
drill && /* @__PURE__ */ jsx(
|
|
3155
|
+
"span",
|
|
3156
|
+
{
|
|
3157
|
+
className: cn(styles36["nav-list-item-caret"], styles36["nav-list-item-muted"]),
|
|
3158
|
+
"aria-hidden": "true",
|
|
3159
|
+
children: /* @__PURE__ */ jsx(ChevronRight, {})
|
|
3160
|
+
}
|
|
3161
|
+
)
|
|
3120
3162
|
]
|
|
3121
3163
|
}
|
|
3122
3164
|
) });
|
|
@@ -3139,6 +3181,105 @@ var NavListSeparator = React16.forwardRef(
|
|
|
3139
3181
|
}
|
|
3140
3182
|
);
|
|
3141
3183
|
NavListSeparator.displayName = "NavListSeparator";
|
|
3184
|
+
var NavListExpandable = React16.forwardRef(
|
|
3185
|
+
({ open, defaultOpen = false, onOpenChange, value, className, ...props }, ref) => {
|
|
3186
|
+
const revealParent = React16.useContext(RevealFolderContext);
|
|
3187
|
+
const folders = React16.useContext(FolderMemoryContext);
|
|
3188
|
+
const memory = value === void 0 ? void 0 : folders?.get(value);
|
|
3189
|
+
const [ownOpen, setOwnOpen] = React16.useState(memory?.open ?? defaultOpen);
|
|
3190
|
+
const [instant, setInstant] = React16.useState(false);
|
|
3191
|
+
const isOpen = open ?? ownOpen;
|
|
3192
|
+
const mounting = React16.useRef(true);
|
|
3193
|
+
const closedByReader = React16.useRef(memory?.closedByReader ?? false);
|
|
3194
|
+
const askedToOpen = React16.useRef(false);
|
|
3195
|
+
const handleOpenChange = (next) => {
|
|
3196
|
+
closedByReader.current = !next;
|
|
3197
|
+
if (open === void 0) setOwnOpen(next);
|
|
3198
|
+
onOpenChange?.(next);
|
|
3199
|
+
};
|
|
3200
|
+
const latest = React16.useRef({ isOpen, handleOpenChange, revealParent });
|
|
3201
|
+
useIsomorphicLayoutEffect(() => {
|
|
3202
|
+
latest.current = { isOpen, handleOpenChange, revealParent };
|
|
3203
|
+
if (isOpen) askedToOpen.current = false;
|
|
3204
|
+
if (value !== void 0)
|
|
3205
|
+
folders?.set(value, { open: isOpen, closedByReader: closedByReader.current });
|
|
3206
|
+
});
|
|
3207
|
+
React16.useEffect(() => {
|
|
3208
|
+
const frame = requestAnimationFrame(() => {
|
|
3209
|
+
mounting.current = false;
|
|
3210
|
+
});
|
|
3211
|
+
return () => cancelAnimationFrame(frame);
|
|
3212
|
+
}, []);
|
|
3213
|
+
React16.useEffect(() => {
|
|
3214
|
+
if (!instant) return;
|
|
3215
|
+
const frame = requestAnimationFrame(() => setInstant(false));
|
|
3216
|
+
return () => cancelAnimationFrame(frame);
|
|
3217
|
+
}, [instant]);
|
|
3218
|
+
const reveal = React16.useCallback((reason) => {
|
|
3219
|
+
const folder = latest.current;
|
|
3220
|
+
folder.revealParent?.(reason);
|
|
3221
|
+
if (folder.isOpen) return;
|
|
3222
|
+
if (reason === "mount" && (closedByReader.current || askedToOpen.current)) return;
|
|
3223
|
+
askedToOpen.current = true;
|
|
3224
|
+
if (mounting.current) setInstant(true);
|
|
3225
|
+
folder.handleOpenChange(true);
|
|
3226
|
+
}, []);
|
|
3227
|
+
return /* @__PURE__ */ jsx(RevealFolderContext.Provider, { value: reveal, children: /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { asChild: true, open: isOpen, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsx(
|
|
3228
|
+
"li",
|
|
3229
|
+
{
|
|
3230
|
+
ref,
|
|
3231
|
+
"data-instant": instant ? "" : void 0,
|
|
3232
|
+
className: cn(styles36["nav-list-expandable"], className),
|
|
3233
|
+
...props
|
|
3234
|
+
}
|
|
3235
|
+
) }) });
|
|
3236
|
+
}
|
|
3237
|
+
);
|
|
3238
|
+
NavListExpandable.displayName = "NavListExpandable";
|
|
3239
|
+
var NavListExpandableTrigger = React16.forwardRef(
|
|
3240
|
+
({ label, prefix, suffix, className, ...props }, ref) => {
|
|
3241
|
+
const [mounted, setMounted] = React16.useState(false);
|
|
3242
|
+
React16.useEffect(() => setMounted(true), []);
|
|
3243
|
+
return /* @__PURE__ */ jsxs(
|
|
3244
|
+
CollapsiblePrimitive.Trigger,
|
|
3245
|
+
{
|
|
3246
|
+
ref,
|
|
3247
|
+
"data-slot": "nav-list-expandable-trigger",
|
|
3248
|
+
className: cn(styles36["nav-list-item"], styles36["nav-list-expandable-trigger"], className),
|
|
3249
|
+
...mounted ? {} : { "aria-expanded": void 0 },
|
|
3250
|
+
...props,
|
|
3251
|
+
children: [
|
|
3252
|
+
prefix && /* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-prefix"], "aria-hidden": "true", children: prefix }),
|
|
3253
|
+
/* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-label"], title: label, children: label }),
|
|
3254
|
+
suffix && /* @__PURE__ */ jsx("span", { className: styles36["nav-list-item-suffix"], children: suffix }),
|
|
3255
|
+
/* @__PURE__ */ jsx(
|
|
3256
|
+
"span",
|
|
3257
|
+
{
|
|
3258
|
+
className: cn(styles36["nav-list-expandable-chevron"], styles36["nav-list-item-muted"]),
|
|
3259
|
+
"aria-hidden": "true",
|
|
3260
|
+
children: /* @__PURE__ */ jsx(ChevronDown, {})
|
|
3261
|
+
}
|
|
3262
|
+
)
|
|
3263
|
+
]
|
|
3264
|
+
}
|
|
3265
|
+
);
|
|
3266
|
+
}
|
|
3267
|
+
);
|
|
3268
|
+
NavListExpandableTrigger.displayName = "NavListExpandableTrigger";
|
|
3269
|
+
var NavListExpandableContent = React16.forwardRef(({ className, children, ...props }, ref) => {
|
|
3270
|
+
const depth = React16.useContext(ListDepthContext);
|
|
3271
|
+
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(
|
|
3272
|
+
"ul",
|
|
3273
|
+
{
|
|
3274
|
+
ref,
|
|
3275
|
+
"data-depth": depth,
|
|
3276
|
+
className: cn(styles36["nav-list-items"], styles36["nav-list-expandable-items"], className),
|
|
3277
|
+
...props,
|
|
3278
|
+
children: /* @__PURE__ */ jsx(ListDepthContext.Provider, { value: depth + 1, children })
|
|
3279
|
+
}
|
|
3280
|
+
) }) });
|
|
3281
|
+
});
|
|
3282
|
+
NavListExpandableContent.displayName = "NavListExpandableContent";
|
|
3142
3283
|
var NavPanel = React16.forwardRef(
|
|
3143
3284
|
({ 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: [
|
|
3144
3285
|
header && /* @__PURE__ */ jsx("div", { className: styles41["nav-panel-header"], children: header }),
|
|
@@ -4111,7 +4252,7 @@ var RadioDropdown = ({
|
|
|
4111
4252
|
] })
|
|
4112
4253
|
] });
|
|
4113
4254
|
};
|
|
4114
|
-
var
|
|
4255
|
+
var CircleIcon = Circle;
|
|
4115
4256
|
var RadioGroup2 = React16.forwardRef(({ className, ...props }, ref) => {
|
|
4116
4257
|
return /* @__PURE__ */ jsx(
|
|
4117
4258
|
RadioGroupPrimitive.Root,
|
|
@@ -4130,7 +4271,7 @@ var RadioGroupItem = React16.forwardRef(({ className, ...props }, ref) => {
|
|
|
4130
4271
|
ref,
|
|
4131
4272
|
className: cn(styles49["radio-group-item"], className),
|
|
4132
4273
|
...props,
|
|
4133
|
-
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: styles49["radio-group-item-indicator"], children: /* @__PURE__ */ jsx(
|
|
4274
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: styles49["radio-group-item-indicator"], children: /* @__PURE__ */ jsx(CircleIcon, { className: styles49["indicator-icon"] }) })
|
|
4134
4275
|
}
|
|
4135
4276
|
);
|
|
4136
4277
|
});
|
|
@@ -5253,6 +5394,6 @@ var useTheme = () => {
|
|
|
5253
5394
|
return [theme, setTheme];
|
|
5254
5395
|
};
|
|
5255
5396
|
|
|
5256
|
-
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 };
|
|
5397
|
+
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 };
|
|
5257
5398
|
//# sourceMappingURL=index.js.map
|
|
5258
5399
|
//# sourceMappingURL=index.js.map
|