@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 CHANGED
@@ -2,6 +2,69 @@
2
2
 
3
3
  Notable changes to Equality are recorded here, following [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
4
4
 
5
+ ## 5.3.0 - 2026-11-02
6
+
7
+ ### Added
8
+
9
+ - `NavListExpandable`, `NavListExpandableTrigger` and `NavListExpandableContent`: a nav group the
10
+ user opens and closes with its header row. A closed group keeps its links in the page, hidden,
11
+ so they are in server-rendered HTML. Its arrow points down when closed and up when open, and a
12
+ closed group holding the current page lights its header row. A top-level group's header leads
13
+ in primary text, and a link beside it takes the same colour; its rows indent their text. A
14
+ group inside a group reads as a row, and its rows are inset behind a tree line, highlight
15
+ included. The header takes `prefix` and `suffix` like a row, so a status badge sits after its
16
+ label and screen readers read it out. A folder opens itself, and every folder around
17
+ it, when the current page moves inside, such as after a link that changes the page without a
18
+ reload. A reader can still close it; it opens again at their next page inside it. Inside
19
+ `NavDrill`, give a group a `value`, unique within its level, so it stays as the reader left it
20
+ after they drill away and come back. With JavaScript off, every group shows open without its
21
+ arrow, and its header leaves `aria-expanded` out until it loads, so it never reads as collapsed
22
+ over visible links. Browsers from before 2023 keep closed groups closed.
23
+ - `--eq-nav-motion-duration`, `--eq-nav-motion-ease` and `--eq-nav-motion-nudge`: the nav's motion,
24
+ named once. `NavDrill` reads them, and a folder group opens with the same motion: its rows nudge
25
+ 12px down as they fade in, and on the way out are gone within the first third.
26
+ - `--eq-switcher-name-fade`: the fade on `NavSwitcher`'s name, from primary to secondary text, as
27
+ before. It is now a variable, so a site can set its own.
28
+ - `--eq-list-item-muted-color`: the colour of a row's quiet marks, tertiary text. The drill ›, a
29
+ group's arrow, the back row's ‹, `NavSwitcher`'s ↕ and the new-tab ↗ all read it, so a site
30
+ sets them in one place.
31
+ - `NavListItem` marks a link with `target="_blank"`, set on it or on its `asChild` link: a muted ↗
32
+ after the label, "(opens in a new tab)" for screen readers, and `rel="noopener noreferrer"`
33
+ unless you pass your own. Remove any ↗ or "(opens in a new tab)" you put in `suffix`.
34
+
35
+ ### Changed
36
+
37
+ - Nav spacing comes from one gap. Items in `NavPanel`, `NavList` and a `NavDrill` level sit
38
+ `--eq-list-gap` (2px) apart, and a group label carries the group gap above it as its own top
39
+ padding, so it sits 12px below whatever comes before it. A string `header` in `NavPanel` is now
40
+ 32px tall, like the switcher, so its text and the rows below sit 6px lower. Anything else an app
41
+ puts straight into the panel or list, such as a search field, gets the 2px gap.
42
+ - Nav chevrons, the drill › and a group's arrow, are muted, as quiet as a switcher's. Every muted
43
+ mark takes its row's colour on hover and on the current row, the back row's ‹ and the
44
+ switcher's ↕ included. Studio's › gets quieter.
45
+ - A nav row's hover fill shows only with a mouse or trackpad, so a row tapped on a touch screen
46
+ no longer stays lit.
47
+ - `Badge` and `Icon` render spans, not divs, so they are valid inside a button, such as a folder
48
+ header's `prefix` or `suffix`. They look the same. A ref or props typed `HTMLDivElement` on
49
+ either now needs `HTMLSpanElement`.
50
+
51
+ ### Fixed
52
+
53
+ - `MotionCollapsibleContent` no longer grows from nothing when it first renders open, such as an
54
+ `Input` that loads with an error.
55
+ - `MotionCollapsibleContent` clips its content while it opens again after a close. It mounted
56
+ unclipped for a frame and could paint over what follows.
57
+ - Rows under a `NavSwitcher` in `NavPanel`'s header sit 2px below it, as rows sit below each other.
58
+ Without a group label, they touched it.
59
+ - In forced colours, only the current nav row and rail item keep a border. Every row was boxed, and
60
+ the current rail item had no mark at all.
61
+
62
+ ## 5.2.0 - 2026-11-02
63
+
64
+ ### Added
65
+
66
+ - `Button` takes `variant="success"`, a filled green button for actions that approve or confirm, such as approving a review.
67
+
5
68
  ## 5.1.1 - 2026-11-02
6
69
 
7
70
  ### Fixed
@@ -96,6 +96,7 @@
96
96
  }
97
97
  .button--primary,
98
98
  .button--danger,
99
+ .button--success,
99
100
  .button--warning {
100
101
  --button-hover-fill: var(--mix-color);
101
102
  @supports (color: color-mix(in lab, red, red)) {
@@ -116,6 +117,10 @@
116
117
  --mix-color: var(--color-button-danger-fill);
117
118
  color: var(--color-button-danger-text, color(display-p3 1 1 1));
118
119
  }
120
+ .button--success {
121
+ --mix-color: var(--color-button-success-fill);
122
+ color: var(--color-button-success-text, color(display-p3 1 1 1));
123
+ }
119
124
  .button--warning {
120
125
  --mix-color: var(--color-button-warning-fill);
121
126
  color: var(--color-button-warning-text, color(display-p3 1 1 1));
package/dist/index.cjs CHANGED
@@ -55,6 +55,7 @@ var styles33 = require('./loading-overlay.module.module.css.module.css');
55
55
  var styles32 = require('./spinner.module.module.css.module.css');
56
56
  var styles34 = require('./metric-card.module.module.css.module.css');
57
57
  var styles36 = require('./nav-list.module.module.css.module.css');
58
+ var CollapsiblePrimitive = require('@radix-ui/react-collapsible');
58
59
  var styles41 = require('./nav.module.module.css.module.css');
59
60
  var SelectPrimitive = require('@radix-ui/react-select');
60
61
  var styles39 = require('./select.module.module.css.module.css');
@@ -157,6 +158,7 @@ var styles33__default = /*#__PURE__*/_interopDefault(styles33);
157
158
  var styles32__default = /*#__PURE__*/_interopDefault(styles32);
158
159
  var styles34__default = /*#__PURE__*/_interopDefault(styles34);
159
160
  var styles36__default = /*#__PURE__*/_interopDefault(styles36);
161
+ var CollapsiblePrimitive__namespace = /*#__PURE__*/_interopNamespace(CollapsiblePrimitive);
160
162
  var styles41__default = /*#__PURE__*/_interopDefault(styles41);
161
163
  var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
162
164
  var styles39__default = /*#__PURE__*/_interopDefault(styles39);
@@ -213,6 +215,7 @@ var buttonVariants = classVarianceAuthority.cva(styles__default.default["button"
213
215
  variant: {
214
216
  primary: [styles__default.default["button--filled"], styles__default.default["button--primary"]],
215
217
  danger: [styles__default.default["button--filled"], styles__default.default["button--danger"]],
218
+ success: [styles__default.default["button--filled"], styles__default.default["button--success"]],
216
219
  warning: [styles__default.default["button--filled"], styles__default.default["button--warning"]],
217
220
  secondary: [styles__default.default["button--filled"], styles__default.default["button--secondary"]],
218
221
  tertiary: styles__default.default["button--tertiary"],
@@ -416,7 +419,7 @@ var Icon = React16.forwardRef(
416
419
  throw new Error("Icon must be either a string (Lucide icon name) or a React element");
417
420
  }
418
421
  return /* @__PURE__ */ jsxRuntime.jsx(
419
- "div",
422
+ "span",
420
423
  {
421
424
  ref,
422
425
  className: cn(
@@ -620,7 +623,7 @@ function Badge({
620
623
  const shouldShowChildren = effectiveDisplay !== "icon-only";
621
624
  const isIconOnly = effectiveDisplay === "icon-only" && effectiveIcon;
622
625
  return /* @__PURE__ */ jsxRuntime.jsxs(
623
- "div",
626
+ "span",
624
627
  {
625
628
  className: cn(
626
629
  variant !== null && badgeVariants({ variant, size }),
@@ -2724,36 +2727,22 @@ var MotionCollapsibleContent = ({
2724
2727
  children,
2725
2728
  className
2726
2729
  }) => {
2727
- const [contentHeight, setContentHeight] = React16.useState(0);
2728
- const [isSettled, setIsSettled] = React16.useState(false);
2729
- const contentRef = React16.useRef(null);
2730
- React16.useEffect(() => {
2731
- if (contentRef.current) {
2732
- const resizeObserver = new ResizeObserver(() => {
2733
- if (contentRef.current) {
2734
- setContentHeight(contentRef.current.scrollHeight);
2735
- }
2736
- });
2737
- resizeObserver.observe(contentRef.current);
2738
- setContentHeight(contentRef.current.scrollHeight);
2739
- return () => resizeObserver.disconnect();
2740
- }
2741
- }, [children]);
2730
+ const [isSettled, setIsSettled] = React16.useState(isOpen);
2742
2731
  return /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, mode: "wait", children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(
2743
2732
  react.motion.div,
2744
2733
  {
2745
2734
  initial: { height: 0, opacity: 0 },
2746
- animate: { height: contentHeight, opacity: 1 },
2735
+ animate: { height: "auto", opacity: 1 },
2747
2736
  exit: { height: 0, opacity: 0 },
2748
2737
  transition: { duration: 0.3, ease: "easeInOut" },
2749
2738
  onAnimationStart: () => setIsSettled(false),
2750
- onAnimationComplete: () => setIsSettled(isOpen),
2739
+ onAnimationComplete: (definition) => setIsSettled(definition.height === "auto"),
2751
2740
  className: cn(
2752
2741
  styles30__default.default["motion-collapsible"],
2753
2742
  isSettled && styles30__default.default["motion-collapsible--settled"],
2754
2743
  className
2755
2744
  ),
2756
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: contentRef, children })
2745
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { children })
2757
2746
  },
2758
2747
  "motion-content"
2759
2748
  ) });
@@ -2886,35 +2875,50 @@ var MetricCard = ({
2886
2875
  ] });
2887
2876
  };
2888
2877
  var NavDrillContext = React16__namespace.createContext(null);
2878
+ var FolderMemoryContext = React16__namespace.createContext(null);
2889
2879
  var useIsomorphicLayoutEffect = typeof window === "undefined" ? React16.useEffect : React16.useLayoutEffect;
2890
- var MOTION = {
2891
- drill: {
2892
- current: [
2893
- { transform: "translateX(12px)", opacity: 0 },
2894
- { transform: "translateX(0)", opacity: 1 }
2895
- ],
2896
- previous: [
2897
- { transform: "translateX(0)", opacity: 1 },
2898
- { opacity: 0, offset: 0.35 },
2899
- { transform: "translateX(-12px)", opacity: 0 }
2900
- ]
2901
- },
2902
- back: {
2880
+ var motion2 = (direction, nudge) => {
2881
+ const sign = direction === "drill" ? 1 : -1;
2882
+ return {
2903
2883
  current: [
2904
- { transform: "translateX(-12px)", opacity: 0 },
2884
+ { transform: `translateX(${sign * nudge}px)`, opacity: 0 },
2905
2885
  { transform: "translateX(0)", opacity: 1 }
2906
2886
  ],
2907
2887
  previous: [
2908
2888
  { transform: "translateX(0)", opacity: 1 },
2909
2889
  { opacity: 0, offset: 0.35 },
2910
- { transform: "translateX(12px)", opacity: 0 }
2890
+ { transform: `translateX(${-sign * nudge}px)`, opacity: 0 }
2911
2891
  ]
2912
- }
2892
+ };
2913
2893
  };
2914
- var TIMING = { duration: 300, easing: "cubic-bezier(.2, .8, .2, 1)" };
2894
+ function navMotion(element) {
2895
+ const style = getComputedStyle(element);
2896
+ const read = (name) => style.getPropertyValue(name).trim();
2897
+ const duration = read("--eq-nav-motion-duration");
2898
+ const ms = duration.endsWith("ms") ? parseFloat(duration) : parseFloat(duration) * 1e3;
2899
+ const raw = read("--eq-nav-motion-nudge");
2900
+ const nudge = /^-?[\d.]+px$/.test(raw) ? parseFloat(raw) : resolveNudge(element);
2901
+ return {
2902
+ nudge: Number.isFinite(nudge) ? nudge : 12,
2903
+ timing: {
2904
+ duration: Number.isFinite(ms) ? ms : 300,
2905
+ easing: read("--eq-nav-motion-ease") || "cubic-bezier(.2, .8, .2, 1)"
2906
+ }
2907
+ };
2908
+ }
2909
+ function resolveNudge(element) {
2910
+ const previous = element.style.outlineOffset;
2911
+ element.style.outlineOffset = "var(--eq-nav-motion-nudge, 12px)";
2912
+ const nudge = parseFloat(getComputedStyle(element).outlineOffset);
2913
+ element.style.outlineOffset = previous;
2914
+ return nudge;
2915
+ }
2915
2916
  var LEVEL = '[data-slot="nav-drill-level"]';
2916
2917
  var NavDrillBackContext = React16__namespace.createContext(() => {
2917
2918
  });
2919
+ var LevelFoldersContext = React16__namespace.createContext(
2920
+ null
2921
+ );
2918
2922
  var LEAVING_DRILL_CONTEXT = { requestDrill: () => {
2919
2923
  }, leaving: true };
2920
2924
  var NO_BACK = () => {
@@ -2940,6 +2944,7 @@ var NavDrill = React16__namespace.forwardRef(
2940
2944
  const focusRequest = React16__namespace.useRef(null);
2941
2945
  const observer = React16__namespace.useRef(null);
2942
2946
  const previousView = React16__namespace.useRef(view);
2947
+ const [levelFolders] = React16__namespace.useState(() => /* @__PURE__ */ new Map());
2943
2948
  const level = React16__namespace.Children.toArray(children).find(
2944
2949
  (child) => React16__namespace.isValidElement(child) && child.props.value === view
2945
2950
  ) ?? null;
@@ -3026,9 +3031,11 @@ var NavDrill = React16__namespace.forwardRef(
3026
3031
  const ghostLevel = ghost?.querySelector(LEVEL);
3027
3032
  if (!leaving || !live || !ghost || !ghostLevel) return;
3028
3033
  ghostLevel.style.marginTop = `${leaving.top - live.getBoundingClientRect().top}px`;
3034
+ const { nudge, timing } = navMotion(live);
3035
+ const frames = motion2(leaving.direction, nudge);
3029
3036
  const animations = [
3030
- live.animate(MOTION[leaving.direction].current, TIMING),
3031
- ghost.animate(MOTION[leaving.direction].previous, TIMING)
3037
+ live.animate(frames.current, timing),
3038
+ ghost.animate(frames.previous, timing)
3032
3039
  ];
3033
3040
  running.current = animations;
3034
3041
  Promise.all(animations.map((animation) => animation.finished)).then(
@@ -3071,7 +3078,7 @@ var NavDrill = React16__namespace.forwardRef(
3071
3078
  ghostRef.current = node;
3072
3079
  if (node) node.inert = true;
3073
3080
  }, []);
3074
- return /* @__PURE__ */ jsxRuntime.jsxs(
3081
+ return /* @__PURE__ */ jsxRuntime.jsx(
3075
3082
  "div",
3076
3083
  {
3077
3084
  ref: setRootRef,
@@ -3079,7 +3086,7 @@ var NavDrill = React16__namespace.forwardRef(
3079
3086
  "data-motion": leaving?.direction,
3080
3087
  className: cn(styles36__default.default["nav-drill"], className),
3081
3088
  ...props,
3082
- children: [
3089
+ children: /* @__PURE__ */ jsxRuntime.jsxs(LevelFoldersContext.Provider, { value: levelFolders, children: [
3083
3090
  /* @__PURE__ */ jsxRuntime.jsx(NavDrillContext.Provider, { value: drillContext, children: /* @__PURE__ */ jsxRuntime.jsx(NavDrillBackContext.Provider, { value: requestBack, children: level && /* @__PURE__ */ jsxRuntime.jsx(React16__namespace.Fragment, { children: level }, view) }) }),
3084
3091
  leaving && /* @__PURE__ */ jsxRuntime.jsx(
3085
3092
  "div",
@@ -3093,7 +3100,7 @@ var NavDrill = React16__namespace.forwardRef(
3093
3100
  },
3094
3101
  leaving.id
3095
3102
  )
3096
- ]
3103
+ ] })
3097
3104
  }
3098
3105
  );
3099
3106
  }
@@ -3102,6 +3109,12 @@ NavDrill.displayName = "NavDrill";
3102
3109
  var NavDrillLevel = React16__namespace.forwardRef(
3103
3110
  ({ value, parent, label, backLabel, className, children, ...props }, ref) => {
3104
3111
  const requestBack = React16__namespace.useContext(NavDrillBackContext);
3112
+ const levelFolders = React16__namespace.useContext(LevelFoldersContext);
3113
+ let folders = levelFolders?.get(value) ?? null;
3114
+ if (levelFolders && !folders) {
3115
+ folders = /* @__PURE__ */ new Map();
3116
+ levelFolders.set(value, folders);
3117
+ }
3105
3118
  React16__namespace.useEffect(() => {
3106
3119
  if (typeof process !== "undefined" && process.env.NODE_ENV !== "production" && parent !== void 0 && backLabel && label && !backLabel.startsWith(label)) {
3107
3120
  console.warn(
@@ -3128,14 +3141,21 @@ var NavDrillLevel = React16__namespace.forwardRef(
3128
3141
  className: cn(styles36__default.default["nav-list-item"], styles36__default.default["nav-list-item--back"]),
3129
3142
  onClick: () => requestBack(parent),
3130
3143
  children: [
3131
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-prefix"], "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronLeft, {}) }),
3144
+ /* @__PURE__ */ jsxRuntime.jsx(
3145
+ "span",
3146
+ {
3147
+ className: cn(styles36__default.default["nav-list-item-prefix"], styles36__default.default["nav-list-item-muted"]),
3148
+ "aria-hidden": "true",
3149
+ children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronLeft, {})
3150
+ }
3151
+ ),
3132
3152
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-label"], title: label, children: label })
3133
3153
  ]
3134
3154
  }
3135
3155
  ),
3136
3156
  /* @__PURE__ */ jsxRuntime.jsx("hr", { className: styles36__default.default["nav-drill-rule"] })
3137
3157
  ] }),
3138
- children
3158
+ /* @__PURE__ */ jsxRuntime.jsx(FolderMemoryContext.Provider, { value: folders, children })
3139
3159
  ]
3140
3160
  }
3141
3161
  );
@@ -3143,7 +3163,8 @@ var NavDrillLevel = React16__namespace.forwardRef(
3143
3163
  );
3144
3164
  NavDrillLevel.displayName = "NavDrillLevel";
3145
3165
  var ListDepthContext = React16__namespace.createContext(0);
3146
- var NavList = React16__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn(styles36__default.default["nav-list"], className), ...props }));
3166
+ var RevealFolderContext = React16__namespace.createContext(null);
3167
+ var NavList = React16__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-slot": "nav-list", className: cn(styles36__default.default["nav-list"], className), ...props }));
3147
3168
  NavList.displayName = "NavList";
3148
3169
  var NavListGroup = React16__namespace.forwardRef(
3149
3170
  ({ label, className, children, ...props }, ref) => {
@@ -3153,11 +3174,8 @@ var NavListGroup = React16__namespace.forwardRef(
3153
3174
  "div",
3154
3175
  {
3155
3176
  ref,
3156
- className: cn(
3157
- styles36__default.default["nav-list-group"],
3158
- !label && styles36__default.default["nav-list-group--unlabelled"],
3159
- className
3160
- ),
3177
+ "data-slot": "nav-list-group",
3178
+ className: cn(styles36__default.default["nav-list-group"], className),
3161
3179
  ...props,
3162
3180
  children: [
3163
3181
  label && /* @__PURE__ */ jsxRuntime.jsx("div", { id: labelId, className: styles36__default.default["nav-list-group-label"], children: label }),
@@ -3191,8 +3209,12 @@ var NavListItem = React16__namespace.forwardRef(
3191
3209
  ...props
3192
3210
  }, ref) => {
3193
3211
  const drillContext = React16__namespace.useContext(NavDrillContext);
3212
+ const revealFolder = React16__namespace.useContext(RevealFolderContext);
3213
+ const wasCurrent = React16__namespace.useRef(current);
3194
3214
  const Comp = asChild ? reactSlot.Slot : props.href ? "a" : "button";
3195
3215
  const leaving = drillContext?.leaving ?? false;
3216
+ const childTarget = asChild && React16__namespace.isValidElement(children) ? children.props.target : void 0;
3217
+ const newTab = (props.target ?? childTarget) === "_blank";
3196
3218
  const handleClick = (event) => {
3197
3219
  onClick?.(event);
3198
3220
  if (!drill || !drillContext) return;
@@ -3200,6 +3222,10 @@ var NavListItem = React16__namespace.forwardRef(
3200
3222
  return;
3201
3223
  drillContext.requestDrill(drill);
3202
3224
  };
3225
+ useIsomorphicLayoutEffect(() => {
3226
+ if (current) revealFolder?.(wasCurrent.current ? "mount" : "change");
3227
+ wasCurrent.current = current;
3228
+ }, [current, revealFolder]);
3203
3229
  return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
3204
3230
  Comp,
3205
3231
  {
@@ -3211,13 +3237,32 @@ var NavListItem = React16__namespace.forwardRef(
3211
3237
  "data-current": current && leaving ? "page" : void 0,
3212
3238
  className: cn(styles36__default.default["nav-list-item"], className),
3213
3239
  onClick: handleClick,
3240
+ rel: newTab ? "noopener noreferrer" : void 0,
3214
3241
  ...props,
3215
3242
  children: [
3216
3243
  prefix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-prefix"], "aria-hidden": "true", children: prefix }),
3217
3244
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-label"], title: label, children: label }),
3218
3245
  /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slottable, { children }),
3219
3246
  suffix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-suffix"], children: suffix }),
3220
- drill && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-caret"], "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronRight, {}) })
3247
+ newTab && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3248
+ /* @__PURE__ */ jsxRuntime.jsx(
3249
+ "span",
3250
+ {
3251
+ className: cn(styles36__default.default["nav-list-item-caret"], styles36__default.default["nav-list-item-muted"]),
3252
+ "aria-hidden": "true",
3253
+ children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ArrowUpRight, {})
3254
+ }
3255
+ ),
3256
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-new-tab"], children: " (opens in a new tab)" })
3257
+ ] }),
3258
+ drill && /* @__PURE__ */ jsxRuntime.jsx(
3259
+ "span",
3260
+ {
3261
+ className: cn(styles36__default.default["nav-list-item-caret"], styles36__default.default["nav-list-item-muted"]),
3262
+ "aria-hidden": "true",
3263
+ children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronRight, {})
3264
+ }
3265
+ )
3221
3266
  ]
3222
3267
  }
3223
3268
  ) });
@@ -3240,6 +3285,105 @@ var NavListSeparator = React16__namespace.forwardRef(
3240
3285
  }
3241
3286
  );
3242
3287
  NavListSeparator.displayName = "NavListSeparator";
3288
+ var NavListExpandable = React16__namespace.forwardRef(
3289
+ ({ open, defaultOpen = false, onOpenChange, value, className, ...props }, ref) => {
3290
+ const revealParent = React16__namespace.useContext(RevealFolderContext);
3291
+ const folders = React16__namespace.useContext(FolderMemoryContext);
3292
+ const memory = value === void 0 ? void 0 : folders?.get(value);
3293
+ const [ownOpen, setOwnOpen] = React16__namespace.useState(memory?.open ?? defaultOpen);
3294
+ const [instant, setInstant] = React16__namespace.useState(false);
3295
+ const isOpen = open ?? ownOpen;
3296
+ const mounting = React16__namespace.useRef(true);
3297
+ const closedByReader = React16__namespace.useRef(memory?.closedByReader ?? false);
3298
+ const askedToOpen = React16__namespace.useRef(false);
3299
+ const handleOpenChange = (next) => {
3300
+ closedByReader.current = !next;
3301
+ if (open === void 0) setOwnOpen(next);
3302
+ onOpenChange?.(next);
3303
+ };
3304
+ const latest = React16__namespace.useRef({ isOpen, handleOpenChange, revealParent });
3305
+ useIsomorphicLayoutEffect(() => {
3306
+ latest.current = { isOpen, handleOpenChange, revealParent };
3307
+ if (isOpen) askedToOpen.current = false;
3308
+ if (value !== void 0)
3309
+ folders?.set(value, { open: isOpen, closedByReader: closedByReader.current });
3310
+ });
3311
+ React16__namespace.useEffect(() => {
3312
+ const frame = requestAnimationFrame(() => {
3313
+ mounting.current = false;
3314
+ });
3315
+ return () => cancelAnimationFrame(frame);
3316
+ }, []);
3317
+ React16__namespace.useEffect(() => {
3318
+ if (!instant) return;
3319
+ const frame = requestAnimationFrame(() => setInstant(false));
3320
+ return () => cancelAnimationFrame(frame);
3321
+ }, [instant]);
3322
+ const reveal = React16__namespace.useCallback((reason) => {
3323
+ const folder = latest.current;
3324
+ folder.revealParent?.(reason);
3325
+ if (folder.isOpen) return;
3326
+ if (reason === "mount" && (closedByReader.current || askedToOpen.current)) return;
3327
+ askedToOpen.current = true;
3328
+ if (mounting.current) setInstant(true);
3329
+ folder.handleOpenChange(true);
3330
+ }, []);
3331
+ return /* @__PURE__ */ jsxRuntime.jsx(RevealFolderContext.Provider, { value: reveal, children: /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.Root, { asChild: true, open: isOpen, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxRuntime.jsx(
3332
+ "li",
3333
+ {
3334
+ ref,
3335
+ "data-instant": instant ? "" : void 0,
3336
+ className: cn(styles36__default.default["nav-list-expandable"], className),
3337
+ ...props
3338
+ }
3339
+ ) }) });
3340
+ }
3341
+ );
3342
+ NavListExpandable.displayName = "NavListExpandable";
3343
+ var NavListExpandableTrigger = React16__namespace.forwardRef(
3344
+ ({ label, prefix, suffix, className, ...props }, ref) => {
3345
+ const [mounted, setMounted] = React16__namespace.useState(false);
3346
+ React16__namespace.useEffect(() => setMounted(true), []);
3347
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3348
+ CollapsiblePrimitive__namespace.Trigger,
3349
+ {
3350
+ ref,
3351
+ "data-slot": "nav-list-expandable-trigger",
3352
+ className: cn(styles36__default.default["nav-list-item"], styles36__default.default["nav-list-expandable-trigger"], className),
3353
+ ...mounted ? {} : { "aria-expanded": void 0 },
3354
+ ...props,
3355
+ children: [
3356
+ prefix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-prefix"], "aria-hidden": "true", children: prefix }),
3357
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-label"], title: label, children: label }),
3358
+ suffix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-suffix"], children: suffix }),
3359
+ /* @__PURE__ */ jsxRuntime.jsx(
3360
+ "span",
3361
+ {
3362
+ className: cn(styles36__default.default["nav-list-expandable-chevron"], styles36__default.default["nav-list-item-muted"]),
3363
+ "aria-hidden": "true",
3364
+ children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronDown, {})
3365
+ }
3366
+ )
3367
+ ]
3368
+ }
3369
+ );
3370
+ }
3371
+ );
3372
+ NavListExpandableTrigger.displayName = "NavListExpandableTrigger";
3373
+ var NavListExpandableContent = React16__namespace.forwardRef(({ className, children, ...props }, ref) => {
3374
+ const depth = React16__namespace.useContext(ListDepthContext);
3375
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles36__default.default["nav-list-expandable-panel"], children: /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.Content, { forceMount: true, className: styles36__default.default["nav-list-expandable-content"], children: /* @__PURE__ */ jsxRuntime.jsx(
3376
+ "ul",
3377
+ {
3378
+ ref,
3379
+ "data-depth": depth,
3380
+ className: cn(styles36__default.default["nav-list-items"], styles36__default.default["nav-list-expandable-items"], className),
3381
+ ...props,
3382
+ children: /* @__PURE__ */ jsxRuntime.jsx(ListDepthContext.Provider, { value: depth + 1, children })
3383
+ }
3384
+ ) }) });
3385
+ });
3386
+ NavListExpandableContent.displayName = "NavListExpandableContent";
3243
3387
  var NavPanel = React16__namespace.forwardRef(
3244
3388
  ({ header, className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, className: cn(styles41__default.default["nav-panel"], className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles41__default.default["nav-scroller"], "data-nav-scroller": "", children: [
3245
3389
  header && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles41__default.default["nav-panel-header"], children: header }),
@@ -5450,6 +5594,9 @@ exports.MotionCollapsibleContent = MotionCollapsibleContent;
5450
5594
  exports.NavDrill = NavDrill;
5451
5595
  exports.NavDrillLevel = NavDrillLevel;
5452
5596
  exports.NavList = NavList;
5597
+ exports.NavListExpandable = NavListExpandable;
5598
+ exports.NavListExpandableContent = NavListExpandableContent;
5599
+ exports.NavListExpandableTrigger = NavListExpandableTrigger;
5453
5600
  exports.NavListGroup = NavListGroup;
5454
5601
  exports.NavListItem = NavListItem;
5455
5602
  exports.NavListSeparator = NavListSeparator;