@dloizides/ui-nav 1.13.1 → 1.15.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
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.14.0
4
+
5
+ - **Feature (an expandable nav group now ANIMATES its expand/collapse instead of snapping).**
6
+ `NavExpandableItem` used to conditionally render its children (`{expanded ? … : null}`),
7
+ so a sidebar/drawer group's leaves appeared and vanished INSTANTLY on toggle — a hard,
8
+ jarring cut with no transition. The group's children are now wrapped in the
9
+ `@dloizides/ui-motion` `<Collapse open={expanded}>`, which measures the children's natural
10
+ height and animates a real `Animated.Value` height on WEB and native alike (the height code
11
+ path RN's native-only `LayoutAnimation` never gave the web build), collapsing to instant
12
+ under `prefers-reduced-motion`.
13
+ - **Collapsed leaves stay non-interactive.** Per the `Collapse` contract the children remain
14
+ MOUNTED at all times (their state and a11y focus order are preserved); when collapsed they
15
+ are clipped to zero height under `overflow: hidden`, so a collapsed group's leaves are
16
+ neither visible nor tappable in a real browser even though they are in the tree. This is a
17
+ deliberate change from the prior "absent from the DOM when collapsed" behaviour.
18
+ - **`aria-expanded` and the mobile-drawer contract are intact.** The group header still emits
19
+ `aria-expanded` (the `ariaExpandedProps` spread is unchanged), so `MobileDrawer` still tells
20
+ a group TOGGLE apart from a navigating LEAF and does not dismiss the drawer when a group is
21
+ expanded on mobile. The active-leaf accent bar, docs-style section-header styling, chevron
22
+ slot, testIDs, and all a11y roles/labels/hints are unchanged.
23
+ - **No public API change.** `NavExpandableItemProps` / `NavItem` are untouched — the animation
24
+ is derived from the `expanded` state the component already tracked. `@dloizides/ui-motion`
25
+ (`^1.0.1`) is added as a runtime dependency; all 7 portals gain the animated group on their
26
+ next bump for free. Consumers with no expandable groups are visually unaffected.
27
+
3
28
  ## 1.13.1
4
29
 
5
30
  - **Fix (mobile drawer: a sub-item / leaf tap dismissed the drawer WITHOUT navigating).**
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var reactNative = require('react-native');
4
4
  var uiFeedback = require('@dloizides/ui-feedback');
5
5
  var React2 = require('react');
6
+ var uiMotion = require('@dloizides/ui-motion');
6
7
  var jsxRuntime = require('react/jsx-runtime');
7
8
  var uiLayout = require('@dloizides/ui-layout');
8
9
  var authWeb = require('@dloizides/auth-web');
@@ -413,7 +414,7 @@ var NavExpandableItem = ({
413
414
  ]
414
415
  }
415
416
  ),
416
- expanded ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: expandableStyles.childrenContainer, children: item.children?.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
417
+ /* @__PURE__ */ jsxRuntime.jsx(uiMotion.Collapse, { open: expanded, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: expandableStyles.childrenContainer, children: item.children?.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
417
418
  NavExpandableItem,
418
419
  {
419
420
  collapseHint,
@@ -426,7 +427,7 @@ var NavExpandableItem = ({
426
427
  onNavigate
427
428
  },
428
429
  child.key
429
- )) }) : null
430
+ )) }) })
430
431
  ] });
431
432
  };
432
433
  function isBareText(node) {