@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 CHANGED
@@ -2,6 +2,73 @@
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.1 - 2026-11-02
6
+
7
+ ### Fixed
8
+
9
+ - A `DropdownMenuRadioItem` marks the chosen option with a tick level with its first line, where
10
+ every row drew a radio ring. This changes `RadioDropdown`, `SortSelector` and the docs site's
11
+ version and site menus.
12
+ - A `DropdownMenuCheckboxItem`'s box sits level with the first line of a two-line item, where it
13
+ was centred on the whole item.
14
+
15
+ ## 5.3.0 - 2026-11-02
16
+
17
+ ### Added
18
+
19
+ - `NavListExpandable`, `NavListExpandableTrigger` and `NavListExpandableContent`: a nav group the
20
+ user opens and closes with its header row. A closed group keeps its links in the page, hidden,
21
+ so they are in server-rendered HTML. Its arrow points down when closed and up when open, and a
22
+ closed group holding the current page lights its header row. A top-level group's header leads
23
+ in primary text, and a link beside it takes the same colour; its rows indent their text. A
24
+ group inside a group reads as a row, and its rows are inset behind a tree line, highlight
25
+ included. The header takes `prefix` and `suffix` like a row, so a status badge sits after its
26
+ label and screen readers read it out. A folder opens itself, and every folder around
27
+ it, when the current page moves inside, such as after a link that changes the page without a
28
+ reload. A reader can still close it; it opens again at their next page inside it. Inside
29
+ `NavDrill`, give a group a `value`, unique within its level, so it stays as the reader left it
30
+ after they drill away and come back. With JavaScript off, every group shows open without its
31
+ arrow, and its header leaves `aria-expanded` out until it loads, so it never reads as collapsed
32
+ over visible links. Browsers from before 2023 keep closed groups closed.
33
+ - `--eq-nav-motion-duration`, `--eq-nav-motion-ease` and `--eq-nav-motion-nudge`: the nav's motion,
34
+ named once. `NavDrill` reads them, and a folder group opens with the same motion: its rows nudge
35
+ 12px down as they fade in, and on the way out are gone within the first third.
36
+ - `--eq-switcher-name-fade`: the fade on `NavSwitcher`'s name, from primary to secondary text, as
37
+ before. It is now a variable, so a site can set its own.
38
+ - `--eq-list-item-muted-color`: the colour of a row's quiet marks, tertiary text. The drill ›, a
39
+ group's arrow, the back row's ‹, `NavSwitcher`'s ↕ and the new-tab ↗ all read it, so a site
40
+ sets them in one place.
41
+ - `NavListItem` marks a link with `target="_blank"`, set on it or on its `asChild` link: a muted ↗
42
+ after the label, "(opens in a new tab)" for screen readers, and `rel="noopener noreferrer"`
43
+ unless you pass your own. Remove any ↗ or "(opens in a new tab)" you put in `suffix`.
44
+
45
+ ### Changed
46
+
47
+ - Nav spacing comes from one gap. Items in `NavPanel`, `NavList` and a `NavDrill` level sit
48
+ `--eq-list-gap` (2px) apart, and a group label carries the group gap above it as its own top
49
+ padding, so it sits 12px below whatever comes before it. A string `header` in `NavPanel` is now
50
+ 32px tall, like the switcher, so its text and the rows below sit 6px lower. Anything else an app
51
+ puts straight into the panel or list, such as a search field, gets the 2px gap.
52
+ - Nav chevrons, the drill › and a group's arrow, are muted, as quiet as a switcher's. Every muted
53
+ mark takes its row's colour on hover and on the current row, the back row's ‹ and the
54
+ switcher's ↕ included. Studio's › gets quieter.
55
+ - A nav row's hover fill shows only with a mouse or trackpad, so a row tapped on a touch screen
56
+ no longer stays lit.
57
+ - `Badge` and `Icon` render spans, not divs, so they are valid inside a button, such as a folder
58
+ header's `prefix` or `suffix`. They look the same. A ref or props typed `HTMLDivElement` on
59
+ either now needs `HTMLSpanElement`.
60
+
61
+ ### Fixed
62
+
63
+ - `MotionCollapsibleContent` no longer grows from nothing when it first renders open, such as an
64
+ `Input` that loads with an error.
65
+ - `MotionCollapsibleContent` clips its content while it opens again after a close. It mounted
66
+ unclipped for a frame and could paint over what follows.
67
+ - Rows under a `NavSwitcher` in `NavPanel`'s header sit 2px below it, as rows sit below each other.
68
+ Without a group label, they touched it.
69
+ - In forced colours, only the current nav row and rail item keep a border. Every row was boxed, and
70
+ the current rail item had no mark at all.
71
+
5
72
  ## 5.2.0 - 2026-11-02
6
73
 
7
74
  ### Added
@@ -305,23 +305,25 @@
305
305
  .dropdown-menu-item-indicator-radio {
306
306
  position: absolute;
307
307
  left: calc(0.25rem * 2);
308
- width: calc(0.25rem * 3.5);
309
- height: calc(0.25rem * 3.5);
310
308
  display: flex;
311
309
  align-items: center;
312
310
  justify-content: center;
313
- border-style: var(--tw-border-style);
314
- border-width: 1px;
315
- border-color: var(--color-text-secondary, color(display-p3 0.1792 0.1792 0.1792));
316
311
  }
317
312
  .dropdown-menu-item-indicator-checkbox {
313
+ top: calc(0.25rem * 2.25);
314
+ width: calc(0.25rem * 3.5);
315
+ height: calc(0.25rem * 3.5);
318
316
  border-radius: 0.25rem;
317
+ border-style: var(--tw-border-style);
318
+ border-width: 1px;
319
+ border-color: var(--color-text-secondary, color(display-p3 0.1792 0.1792 0.1792));
319
320
  }
320
321
  .dropdown-menu-item-indicator-radio {
321
- border-radius: calc(infinity * 1px);
322
+ top: calc(0.25rem * 1.5);
323
+ height: calc(0.25rem * 5);
324
+ width: calc(0.25rem * 4);
322
325
  }
323
- .dropdown-menu-checkbox-item[data-state='checked'] .dropdown-menu-item-indicator-checkbox,
324
- .dropdown-menu-radio-item[data-state='checked'] .dropdown-menu-item-indicator-radio {
326
+ .dropdown-menu-checkbox-item[data-state='checked'] .dropdown-menu-item-indicator-checkbox {
325
327
  border-color: var(--color-button-primary-border, color(display-p3 0.5242 0.2903 0.7705));
326
328
  background-color: var(--color-button-primary-fill, color(display-p3 0.5242 0.2903 0.7705));
327
329
  color: var(--color-button-primary-text, color(display-p3 1 1 1));
@@ -331,9 +333,8 @@
331
333
  height: calc(0.25rem * 3);
332
334
  }
333
335
  .radio-icon {
334
- width: calc(0.25rem * 2);
335
- height: calc(0.25rem * 2);
336
- fill: currentcolor;
336
+ width: calc(0.25rem * 4);
337
+ height: calc(0.25rem * 4);
337
338
  }
338
339
  .dropdown-menu-label {
339
340
  display: flex;
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);
@@ -417,7 +419,7 @@ var Icon = React16.forwardRef(
417
419
  throw new Error("Icon must be either a string (Lucide icon name) or a React element");
418
420
  }
419
421
  return /* @__PURE__ */ jsxRuntime.jsx(
420
- "div",
422
+ "span",
421
423
  {
422
424
  ref,
423
425
  className: cn(
@@ -621,7 +623,7 @@ function Badge({
621
623
  const shouldShowChildren = effectiveDisplay !== "icon-only";
622
624
  const isIconOnly = effectiveDisplay === "icon-only" && effectiveIcon;
623
625
  return /* @__PURE__ */ jsxRuntime.jsxs(
624
- "div",
626
+ "span",
625
627
  {
626
628
  className: cn(
627
629
  variant !== null && badgeVariants({ variant, size }),
@@ -1984,7 +1986,6 @@ function assignRefs(node, ...refs) {
1984
1986
  }
1985
1987
  var CheckIcon2 = LucideIcons.Check;
1986
1988
  var ChevronRightIcon2 = LucideIcons.ChevronRight;
1987
- var CircleIcon = LucideIcons.Circle;
1988
1989
  var SearchIcon2 = LucideIcons.Search;
1989
1990
  var DropdownMenuSearchContext = React16__namespace.createContext(null);
1990
1991
  var useDropdownMenuSearch = () => React16__namespace.useContext(DropdownMenuSearchContext);
@@ -2303,7 +2304,7 @@ var DropdownMenuRadioItem = React16__namespace.forwardRef(({ className, children
2303
2304
  ...props,
2304
2305
  "data-persistent": persistent ? "" : void 0,
2305
2306
  children: [
2306
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles22__default.default["dropdown-menu-item-indicator-radio"], children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(CircleIcon, { className: styles22__default.default["radio-icon"] }) }) }),
2307
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles22__default.default["dropdown-menu-item-indicator-radio"], children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon2, { className: styles22__default.default["radio-icon"] }) }) }),
2307
2308
  /* @__PURE__ */ jsxRuntime.jsx(ItemBreadcrumb, {}),
2308
2309
  children
2309
2310
  ]
@@ -2725,36 +2726,22 @@ var MotionCollapsibleContent = ({
2725
2726
  children,
2726
2727
  className
2727
2728
  }) => {
2728
- const [contentHeight, setContentHeight] = React16.useState(0);
2729
- const [isSettled, setIsSettled] = React16.useState(false);
2730
- const contentRef = React16.useRef(null);
2731
- React16.useEffect(() => {
2732
- if (contentRef.current) {
2733
- const resizeObserver = new ResizeObserver(() => {
2734
- if (contentRef.current) {
2735
- setContentHeight(contentRef.current.scrollHeight);
2736
- }
2737
- });
2738
- resizeObserver.observe(contentRef.current);
2739
- setContentHeight(contentRef.current.scrollHeight);
2740
- return () => resizeObserver.disconnect();
2741
- }
2742
- }, [children]);
2729
+ const [isSettled, setIsSettled] = React16.useState(isOpen);
2743
2730
  return /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, mode: "wait", children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(
2744
2731
  react.motion.div,
2745
2732
  {
2746
2733
  initial: { height: 0, opacity: 0 },
2747
- animate: { height: contentHeight, opacity: 1 },
2734
+ animate: { height: "auto", opacity: 1 },
2748
2735
  exit: { height: 0, opacity: 0 },
2749
2736
  transition: { duration: 0.3, ease: "easeInOut" },
2750
2737
  onAnimationStart: () => setIsSettled(false),
2751
- onAnimationComplete: () => setIsSettled(isOpen),
2738
+ onAnimationComplete: (definition) => setIsSettled(definition.height === "auto"),
2752
2739
  className: cn(
2753
2740
  styles30__default.default["motion-collapsible"],
2754
2741
  isSettled && styles30__default.default["motion-collapsible--settled"],
2755
2742
  className
2756
2743
  ),
2757
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: contentRef, children })
2744
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { children })
2758
2745
  },
2759
2746
  "motion-content"
2760
2747
  ) });
@@ -2887,35 +2874,50 @@ var MetricCard = ({
2887
2874
  ] });
2888
2875
  };
2889
2876
  var NavDrillContext = React16__namespace.createContext(null);
2877
+ var FolderMemoryContext = React16__namespace.createContext(null);
2890
2878
  var useIsomorphicLayoutEffect = typeof window === "undefined" ? React16.useEffect : React16.useLayoutEffect;
2891
- var MOTION = {
2892
- drill: {
2893
- current: [
2894
- { transform: "translateX(12px)", opacity: 0 },
2895
- { transform: "translateX(0)", opacity: 1 }
2896
- ],
2897
- previous: [
2898
- { transform: "translateX(0)", opacity: 1 },
2899
- { opacity: 0, offset: 0.35 },
2900
- { transform: "translateX(-12px)", opacity: 0 }
2901
- ]
2902
- },
2903
- back: {
2879
+ var motion2 = (direction, nudge) => {
2880
+ const sign = direction === "drill" ? 1 : -1;
2881
+ return {
2904
2882
  current: [
2905
- { transform: "translateX(-12px)", opacity: 0 },
2883
+ { transform: `translateX(${sign * nudge}px)`, opacity: 0 },
2906
2884
  { transform: "translateX(0)", opacity: 1 }
2907
2885
  ],
2908
2886
  previous: [
2909
2887
  { transform: "translateX(0)", opacity: 1 },
2910
2888
  { opacity: 0, offset: 0.35 },
2911
- { transform: "translateX(12px)", opacity: 0 }
2889
+ { transform: `translateX(${-sign * nudge}px)`, opacity: 0 }
2912
2890
  ]
2913
- }
2891
+ };
2914
2892
  };
2915
- var TIMING = { duration: 300, easing: "cubic-bezier(.2, .8, .2, 1)" };
2893
+ function navMotion(element) {
2894
+ const style = getComputedStyle(element);
2895
+ const read = (name) => style.getPropertyValue(name).trim();
2896
+ const duration = read("--eq-nav-motion-duration");
2897
+ const ms = duration.endsWith("ms") ? parseFloat(duration) : parseFloat(duration) * 1e3;
2898
+ const raw = read("--eq-nav-motion-nudge");
2899
+ const nudge = /^-?[\d.]+px$/.test(raw) ? parseFloat(raw) : resolveNudge(element);
2900
+ return {
2901
+ nudge: Number.isFinite(nudge) ? nudge : 12,
2902
+ timing: {
2903
+ duration: Number.isFinite(ms) ? ms : 300,
2904
+ easing: read("--eq-nav-motion-ease") || "cubic-bezier(.2, .8, .2, 1)"
2905
+ }
2906
+ };
2907
+ }
2908
+ function resolveNudge(element) {
2909
+ const previous = element.style.outlineOffset;
2910
+ element.style.outlineOffset = "var(--eq-nav-motion-nudge, 12px)";
2911
+ const nudge = parseFloat(getComputedStyle(element).outlineOffset);
2912
+ element.style.outlineOffset = previous;
2913
+ return nudge;
2914
+ }
2916
2915
  var LEVEL = '[data-slot="nav-drill-level"]';
2917
2916
  var NavDrillBackContext = React16__namespace.createContext(() => {
2918
2917
  });
2918
+ var LevelFoldersContext = React16__namespace.createContext(
2919
+ null
2920
+ );
2919
2921
  var LEAVING_DRILL_CONTEXT = { requestDrill: () => {
2920
2922
  }, leaving: true };
2921
2923
  var NO_BACK = () => {
@@ -2941,6 +2943,7 @@ var NavDrill = React16__namespace.forwardRef(
2941
2943
  const focusRequest = React16__namespace.useRef(null);
2942
2944
  const observer = React16__namespace.useRef(null);
2943
2945
  const previousView = React16__namespace.useRef(view);
2946
+ const [levelFolders] = React16__namespace.useState(() => /* @__PURE__ */ new Map());
2944
2947
  const level = React16__namespace.Children.toArray(children).find(
2945
2948
  (child) => React16__namespace.isValidElement(child) && child.props.value === view
2946
2949
  ) ?? null;
@@ -3027,9 +3030,11 @@ var NavDrill = React16__namespace.forwardRef(
3027
3030
  const ghostLevel = ghost?.querySelector(LEVEL);
3028
3031
  if (!leaving || !live || !ghost || !ghostLevel) return;
3029
3032
  ghostLevel.style.marginTop = `${leaving.top - live.getBoundingClientRect().top}px`;
3033
+ const { nudge, timing } = navMotion(live);
3034
+ const frames = motion2(leaving.direction, nudge);
3030
3035
  const animations = [
3031
- live.animate(MOTION[leaving.direction].current, TIMING),
3032
- ghost.animate(MOTION[leaving.direction].previous, TIMING)
3036
+ live.animate(frames.current, timing),
3037
+ ghost.animate(frames.previous, timing)
3033
3038
  ];
3034
3039
  running.current = animations;
3035
3040
  Promise.all(animations.map((animation) => animation.finished)).then(
@@ -3072,7 +3077,7 @@ var NavDrill = React16__namespace.forwardRef(
3072
3077
  ghostRef.current = node;
3073
3078
  if (node) node.inert = true;
3074
3079
  }, []);
3075
- return /* @__PURE__ */ jsxRuntime.jsxs(
3080
+ return /* @__PURE__ */ jsxRuntime.jsx(
3076
3081
  "div",
3077
3082
  {
3078
3083
  ref: setRootRef,
@@ -3080,7 +3085,7 @@ var NavDrill = React16__namespace.forwardRef(
3080
3085
  "data-motion": leaving?.direction,
3081
3086
  className: cn(styles36__default.default["nav-drill"], className),
3082
3087
  ...props,
3083
- children: [
3088
+ children: /* @__PURE__ */ jsxRuntime.jsxs(LevelFoldersContext.Provider, { value: levelFolders, children: [
3084
3089
  /* @__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) }) }),
3085
3090
  leaving && /* @__PURE__ */ jsxRuntime.jsx(
3086
3091
  "div",
@@ -3094,7 +3099,7 @@ var NavDrill = React16__namespace.forwardRef(
3094
3099
  },
3095
3100
  leaving.id
3096
3101
  )
3097
- ]
3102
+ ] })
3098
3103
  }
3099
3104
  );
3100
3105
  }
@@ -3103,6 +3108,12 @@ NavDrill.displayName = "NavDrill";
3103
3108
  var NavDrillLevel = React16__namespace.forwardRef(
3104
3109
  ({ value, parent, label, backLabel, className, children, ...props }, ref) => {
3105
3110
  const requestBack = React16__namespace.useContext(NavDrillBackContext);
3111
+ const levelFolders = React16__namespace.useContext(LevelFoldersContext);
3112
+ let folders = levelFolders?.get(value) ?? null;
3113
+ if (levelFolders && !folders) {
3114
+ folders = /* @__PURE__ */ new Map();
3115
+ levelFolders.set(value, folders);
3116
+ }
3106
3117
  React16__namespace.useEffect(() => {
3107
3118
  if (typeof process !== "undefined" && process.env.NODE_ENV !== "production" && parent !== void 0 && backLabel && label && !backLabel.startsWith(label)) {
3108
3119
  console.warn(
@@ -3129,14 +3140,21 @@ var NavDrillLevel = React16__namespace.forwardRef(
3129
3140
  className: cn(styles36__default.default["nav-list-item"], styles36__default.default["nav-list-item--back"]),
3130
3141
  onClick: () => requestBack(parent),
3131
3142
  children: [
3132
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-prefix"], "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronLeft, {}) }),
3143
+ /* @__PURE__ */ jsxRuntime.jsx(
3144
+ "span",
3145
+ {
3146
+ className: cn(styles36__default.default["nav-list-item-prefix"], styles36__default.default["nav-list-item-muted"]),
3147
+ "aria-hidden": "true",
3148
+ children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronLeft, {})
3149
+ }
3150
+ ),
3133
3151
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-label"], title: label, children: label })
3134
3152
  ]
3135
3153
  }
3136
3154
  ),
3137
3155
  /* @__PURE__ */ jsxRuntime.jsx("hr", { className: styles36__default.default["nav-drill-rule"] })
3138
3156
  ] }),
3139
- children
3157
+ /* @__PURE__ */ jsxRuntime.jsx(FolderMemoryContext.Provider, { value: folders, children })
3140
3158
  ]
3141
3159
  }
3142
3160
  );
@@ -3144,7 +3162,8 @@ var NavDrillLevel = React16__namespace.forwardRef(
3144
3162
  );
3145
3163
  NavDrillLevel.displayName = "NavDrillLevel";
3146
3164
  var ListDepthContext = React16__namespace.createContext(0);
3147
- var NavList = React16__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn(styles36__default.default["nav-list"], className), ...props }));
3165
+ var RevealFolderContext = React16__namespace.createContext(null);
3166
+ 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 }));
3148
3167
  NavList.displayName = "NavList";
3149
3168
  var NavListGroup = React16__namespace.forwardRef(
3150
3169
  ({ label, className, children, ...props }, ref) => {
@@ -3154,11 +3173,8 @@ var NavListGroup = React16__namespace.forwardRef(
3154
3173
  "div",
3155
3174
  {
3156
3175
  ref,
3157
- className: cn(
3158
- styles36__default.default["nav-list-group"],
3159
- !label && styles36__default.default["nav-list-group--unlabelled"],
3160
- className
3161
- ),
3176
+ "data-slot": "nav-list-group",
3177
+ className: cn(styles36__default.default["nav-list-group"], className),
3162
3178
  ...props,
3163
3179
  children: [
3164
3180
  label && /* @__PURE__ */ jsxRuntime.jsx("div", { id: labelId, className: styles36__default.default["nav-list-group-label"], children: label }),
@@ -3192,8 +3208,12 @@ var NavListItem = React16__namespace.forwardRef(
3192
3208
  ...props
3193
3209
  }, ref) => {
3194
3210
  const drillContext = React16__namespace.useContext(NavDrillContext);
3211
+ const revealFolder = React16__namespace.useContext(RevealFolderContext);
3212
+ const wasCurrent = React16__namespace.useRef(current);
3195
3213
  const Comp = asChild ? reactSlot.Slot : props.href ? "a" : "button";
3196
3214
  const leaving = drillContext?.leaving ?? false;
3215
+ const childTarget = asChild && React16__namespace.isValidElement(children) ? children.props.target : void 0;
3216
+ const newTab = (props.target ?? childTarget) === "_blank";
3197
3217
  const handleClick = (event) => {
3198
3218
  onClick?.(event);
3199
3219
  if (!drill || !drillContext) return;
@@ -3201,6 +3221,10 @@ var NavListItem = React16__namespace.forwardRef(
3201
3221
  return;
3202
3222
  drillContext.requestDrill(drill);
3203
3223
  };
3224
+ useIsomorphicLayoutEffect(() => {
3225
+ if (current) revealFolder?.(wasCurrent.current ? "mount" : "change");
3226
+ wasCurrent.current = current;
3227
+ }, [current, revealFolder]);
3204
3228
  return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
3205
3229
  Comp,
3206
3230
  {
@@ -3212,13 +3236,32 @@ var NavListItem = React16__namespace.forwardRef(
3212
3236
  "data-current": current && leaving ? "page" : void 0,
3213
3237
  className: cn(styles36__default.default["nav-list-item"], className),
3214
3238
  onClick: handleClick,
3239
+ rel: newTab ? "noopener noreferrer" : void 0,
3215
3240
  ...props,
3216
3241
  children: [
3217
3242
  prefix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-prefix"], "aria-hidden": "true", children: prefix }),
3218
3243
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-label"], title: label, children: label }),
3219
3244
  /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slottable, { children }),
3220
3245
  suffix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-suffix"], children: suffix }),
3221
- drill && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-caret"], "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronRight, {}) })
3246
+ newTab && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3247
+ /* @__PURE__ */ jsxRuntime.jsx(
3248
+ "span",
3249
+ {
3250
+ className: cn(styles36__default.default["nav-list-item-caret"], styles36__default.default["nav-list-item-muted"]),
3251
+ "aria-hidden": "true",
3252
+ children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ArrowUpRight, {})
3253
+ }
3254
+ ),
3255
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-new-tab"], children: " (opens in a new tab)" })
3256
+ ] }),
3257
+ drill && /* @__PURE__ */ jsxRuntime.jsx(
3258
+ "span",
3259
+ {
3260
+ className: cn(styles36__default.default["nav-list-item-caret"], styles36__default.default["nav-list-item-muted"]),
3261
+ "aria-hidden": "true",
3262
+ children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronRight, {})
3263
+ }
3264
+ )
3222
3265
  ]
3223
3266
  }
3224
3267
  ) });
@@ -3241,6 +3284,105 @@ var NavListSeparator = React16__namespace.forwardRef(
3241
3284
  }
3242
3285
  );
3243
3286
  NavListSeparator.displayName = "NavListSeparator";
3287
+ var NavListExpandable = React16__namespace.forwardRef(
3288
+ ({ open, defaultOpen = false, onOpenChange, value, className, ...props }, ref) => {
3289
+ const revealParent = React16__namespace.useContext(RevealFolderContext);
3290
+ const folders = React16__namespace.useContext(FolderMemoryContext);
3291
+ const memory = value === void 0 ? void 0 : folders?.get(value);
3292
+ const [ownOpen, setOwnOpen] = React16__namespace.useState(memory?.open ?? defaultOpen);
3293
+ const [instant, setInstant] = React16__namespace.useState(false);
3294
+ const isOpen = open ?? ownOpen;
3295
+ const mounting = React16__namespace.useRef(true);
3296
+ const closedByReader = React16__namespace.useRef(memory?.closedByReader ?? false);
3297
+ const askedToOpen = React16__namespace.useRef(false);
3298
+ const handleOpenChange = (next) => {
3299
+ closedByReader.current = !next;
3300
+ if (open === void 0) setOwnOpen(next);
3301
+ onOpenChange?.(next);
3302
+ };
3303
+ const latest = React16__namespace.useRef({ isOpen, handleOpenChange, revealParent });
3304
+ useIsomorphicLayoutEffect(() => {
3305
+ latest.current = { isOpen, handleOpenChange, revealParent };
3306
+ if (isOpen) askedToOpen.current = false;
3307
+ if (value !== void 0)
3308
+ folders?.set(value, { open: isOpen, closedByReader: closedByReader.current });
3309
+ });
3310
+ React16__namespace.useEffect(() => {
3311
+ const frame = requestAnimationFrame(() => {
3312
+ mounting.current = false;
3313
+ });
3314
+ return () => cancelAnimationFrame(frame);
3315
+ }, []);
3316
+ React16__namespace.useEffect(() => {
3317
+ if (!instant) return;
3318
+ const frame = requestAnimationFrame(() => setInstant(false));
3319
+ return () => cancelAnimationFrame(frame);
3320
+ }, [instant]);
3321
+ const reveal = React16__namespace.useCallback((reason) => {
3322
+ const folder = latest.current;
3323
+ folder.revealParent?.(reason);
3324
+ if (folder.isOpen) return;
3325
+ if (reason === "mount" && (closedByReader.current || askedToOpen.current)) return;
3326
+ askedToOpen.current = true;
3327
+ if (mounting.current) setInstant(true);
3328
+ folder.handleOpenChange(true);
3329
+ }, []);
3330
+ 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(
3331
+ "li",
3332
+ {
3333
+ ref,
3334
+ "data-instant": instant ? "" : void 0,
3335
+ className: cn(styles36__default.default["nav-list-expandable"], className),
3336
+ ...props
3337
+ }
3338
+ ) }) });
3339
+ }
3340
+ );
3341
+ NavListExpandable.displayName = "NavListExpandable";
3342
+ var NavListExpandableTrigger = React16__namespace.forwardRef(
3343
+ ({ label, prefix, suffix, className, ...props }, ref) => {
3344
+ const [mounted, setMounted] = React16__namespace.useState(false);
3345
+ React16__namespace.useEffect(() => setMounted(true), []);
3346
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3347
+ CollapsiblePrimitive__namespace.Trigger,
3348
+ {
3349
+ ref,
3350
+ "data-slot": "nav-list-expandable-trigger",
3351
+ className: cn(styles36__default.default["nav-list-item"], styles36__default.default["nav-list-expandable-trigger"], className),
3352
+ ...mounted ? {} : { "aria-expanded": void 0 },
3353
+ ...props,
3354
+ children: [
3355
+ prefix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-prefix"], "aria-hidden": "true", children: prefix }),
3356
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-label"], title: label, children: label }),
3357
+ suffix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles36__default.default["nav-list-item-suffix"], children: suffix }),
3358
+ /* @__PURE__ */ jsxRuntime.jsx(
3359
+ "span",
3360
+ {
3361
+ className: cn(styles36__default.default["nav-list-expandable-chevron"], styles36__default.default["nav-list-item-muted"]),
3362
+ "aria-hidden": "true",
3363
+ children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronDown, {})
3364
+ }
3365
+ )
3366
+ ]
3367
+ }
3368
+ );
3369
+ }
3370
+ );
3371
+ NavListExpandableTrigger.displayName = "NavListExpandableTrigger";
3372
+ var NavListExpandableContent = React16__namespace.forwardRef(({ className, children, ...props }, ref) => {
3373
+ const depth = React16__namespace.useContext(ListDepthContext);
3374
+ 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(
3375
+ "ul",
3376
+ {
3377
+ ref,
3378
+ "data-depth": depth,
3379
+ className: cn(styles36__default.default["nav-list-items"], styles36__default.default["nav-list-expandable-items"], className),
3380
+ ...props,
3381
+ children: /* @__PURE__ */ jsxRuntime.jsx(ListDepthContext.Provider, { value: depth + 1, children })
3382
+ }
3383
+ ) }) });
3384
+ });
3385
+ NavListExpandableContent.displayName = "NavListExpandableContent";
3244
3386
  var NavPanel = React16__namespace.forwardRef(
3245
3387
  ({ 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: [
3246
3388
  header && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles41__default.default["nav-panel-header"], children: header }),
@@ -4213,7 +4355,7 @@ var RadioDropdown = ({
4213
4355
  ] })
4214
4356
  ] });
4215
4357
  };
4216
- var CircleIcon2 = LucideIcons.Circle;
4358
+ var CircleIcon = LucideIcons.Circle;
4217
4359
  var RadioGroup2 = React16__namespace.forwardRef(({ className, ...props }, ref) => {
4218
4360
  return /* @__PURE__ */ jsxRuntime.jsx(
4219
4361
  RadioGroupPrimitive__namespace.Root,
@@ -4232,7 +4374,7 @@ var RadioGroupItem = React16__namespace.forwardRef(({ className, ...props }, ref
4232
4374
  ref,
4233
4375
  className: cn(styles49__default.default["radio-group-item"], className),
4234
4376
  ...props,
4235
- children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: styles49__default.default["radio-group-item-indicator"], children: /* @__PURE__ */ jsxRuntime.jsx(CircleIcon2, { className: styles49__default.default["indicator-icon"] }) })
4377
+ children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: styles49__default.default["radio-group-item-indicator"], children: /* @__PURE__ */ jsxRuntime.jsx(CircleIcon, { className: styles49__default.default["indicator-icon"] }) })
4236
4378
  }
4237
4379
  );
4238
4380
  });
@@ -5451,6 +5593,9 @@ exports.MotionCollapsibleContent = MotionCollapsibleContent;
5451
5593
  exports.NavDrill = NavDrill;
5452
5594
  exports.NavDrillLevel = NavDrillLevel;
5453
5595
  exports.NavList = NavList;
5596
+ exports.NavListExpandable = NavListExpandable;
5597
+ exports.NavListExpandableContent = NavListExpandableContent;
5598
+ exports.NavListExpandableTrigger = NavListExpandableTrigger;
5454
5599
  exports.NavListGroup = NavListGroup;
5455
5600
  exports.NavListItem = NavListItem;
5456
5601
  exports.NavListSeparator = NavListSeparator;