@synerise/ds-list-item 1.6.3 → 1.6.5

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
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.6.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list-item@1.6.4...@synerise/ds-list-item@1.6.5) (2026-08-18)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-list-item
9
+
10
+ ## [1.6.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list-item@1.6.3...@synerise/ds-list-item@1.6.4) (2026-08-14)
11
+
12
+ ### Bug Fixes
13
+
14
+ - **list-item:** stop clipping long sub-menus at a fixed height ([7e4510e](https://github.com/Synerise/synerise-design/commit/7e4510e8915536ae38b4dc199fbd81c24cf15330))
15
+
6
16
  ## [1.6.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list-item@1.6.2...@synerise/ds-list-item@1.6.3) (2026-08-11)
7
17
 
8
18
  **Note:** Version bump only for package @synerise/ds-list-item
package/CLAUDE.md CHANGED
@@ -182,6 +182,7 @@ import ListItem, { ListWrapper, ListContextProvider, useListContext } from '@syn
182
182
  - **`indentLevel`** — each sub-menu level adds 20px indent (`INDENT_WIDTH`). The `SubMenu` component automatically increments `indentLevel` by 1.
183
183
  - **`selectableParent`** — by default a `subMenu` parent owns its whole row for expand/collapse and swallows `onClick`. Setting `selectableParent` flips this: `Text.tsx` routes the row click/Enter to `onClick` (the `if (subMenu && !selectableParent)` guard), and `ItemLabel` renders the suffix arrow as a focusable `S.SubMenuToggle` (`role="button"`, Enter/Space) whose handler calls `stopPropagation()` so toggling never selects.
184
184
  - **Sub-menu open state** — uncontrolled by default (internal `useState`, starts closed). Seed the initial state with `defaultSubMenuOpen`, or fully control it with `subMenuOpen` + `onSubMenuToggle` (mirrors `Dropdown`'s `open`/`onOpenChange`). When `subMenuOpen` is provided, `Text.tsx` derives the open state from the prop and `onSubMenuToggle` fires the next state on each toggle without mutating internal state. Omitting all three preserves the legacy behaviour.
185
- - **Sub-menu nesting** — `subMenu` is fully recursive (each `SubMenu` renders items via `ItemComponent`, so a nested item with its own `subMenu` nests again); there is **no hard depth limit**. The practical cap is layout-driven: each open `SubMenuContainer` is `max-height: 999px; overflow: hidden` (`SubMenu.styles.ts`), so any single level whose expanded content exceeds 999px is clipped, and indent grows 20px per level without bound.
185
+ - **Sub-menu nesting** — `subMenu` is fully recursive (each `SubMenu` renders items via `ItemComponent`, so a nested item with its own `subMenu` nests again); there is **no hard depth limit** and no height cap either. Indent grows 20px per level without bound.
186
+ - **Sub-menu expand/collapse animation** — items stay mounted at all times (`SubMenu.tsx` renders `dataSource` unconditionally), so the transition is pure CSS. `SubMenuContainer` is a grid whose single track goes `0fr → 1fr` (`SubMenu.styles.ts`), which animates to the sub-menu's *own* height — CSS cannot transition `height: 0 → auto`. Two invariants keep it working: `overflow: hidden` on the **container** (clips the collapsing track so nothing peeks at `0fr`), and `min-height: 0` on `SubMenuList`, the **grid item** (without it the item's automatic minimum size holds the track open at content height and the sub-menu never fully collapses). `SubMenuList` must stay the container's only child and carry no padding/border of its own. This replaced a `max-height: 999px` cap that clipped any level past ~31 default-size rows, and — since a nested container counts toward its ancestor's height — clipped much shallower trees than that. Mirrors the same pattern in `@synerise/ds-sidebar`'s `Collapse.styles.ts`.
186
187
  - **`popoverDelay` is not forwarded** through `ListWrapper` — `ListWrapper` only forwards `onClick`; callers needing custom delay must use `ListContextProvider` directly.
187
188
  - **Uses Vitest** — `jest.config.js` present; only 2 smoke tests exist, well below 80% coverage requirement.
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, createElement } from "react";
3
3
  import { ListContextProvider } from "../ListContext/ListContextProvider.js";
4
- import { SubMenuContainer } from "./SubMenu.styles.js";
4
+ import { SubMenuContainer, SubMenuList } from "./SubMenu.styles.js";
5
5
  const SubMenu = forwardRef(({
6
6
  onClick,
7
7
  isOpen,
@@ -9,7 +9,7 @@ const SubMenu = forwardRef(({
9
9
  indentLevel,
10
10
  ItemComponent
11
11
  }, forwardedRef) => {
12
- return /* @__PURE__ */ jsx(ListContextProvider, { onClick, children: /* @__PURE__ */ jsx(SubMenuContainer, { ref: forwardedRef, isOpen, children: dataSource?.map((item) => /* @__PURE__ */ createElement(ItemComponent, { ...item, key: item.itemKey, indentLevel })) }) });
12
+ return /* @__PURE__ */ jsx(ListContextProvider, { onClick, children: /* @__PURE__ */ jsx(SubMenuContainer, { ref: forwardedRef, isOpen, children: /* @__PURE__ */ jsx(SubMenuList, { children: dataSource?.map((item) => /* @__PURE__ */ createElement(ItemComponent, { ...item, key: item.itemKey, indentLevel })) }) }) });
13
13
  });
14
14
  export {
15
15
  SubMenu
@@ -2,11 +2,11 @@ import styled from "styled-components";
2
2
  const SubMenuContainer = /* @__PURE__ */ styled.div.withConfig({
3
3
  displayName: "SubMenustyles__SubMenuContainer",
4
4
  componentId: "sc-12pkrfi-0"
5
- })(["max-height:", "px;overflow:hidden;transition:max-height 0.3s ease;"], (props) => props.isOpen ? "999" : "0");
5
+ })(["display:grid;grid-template-rows:", ";transition:grid-template-rows 0.3s ease;overflow:hidden;"], (props) => props.isOpen ? "1fr" : "0fr");
6
6
  const SubMenuList = /* @__PURE__ */ styled.div.withConfig({
7
7
  displayName: "SubMenustyles__SubMenuList",
8
8
  componentId: "sc-12pkrfi-1"
9
- })([""]);
9
+ })(["min-height:0;min-width:0;"]);
10
10
  export {
11
11
  SubMenuContainer,
12
12
  SubMenuList
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-list-item",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "description": "ListItem UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -43,11 +43,11 @@
43
43
  "types": "dist/index.d.ts",
44
44
  "dependencies": {
45
45
  "@floating-ui/react": "^0.27.16",
46
- "@synerise/ds-button": "^1.5.36",
47
- "@synerise/ds-divider": "^1.3.17",
46
+ "@synerise/ds-button": "^1.5.37",
47
+ "@synerise/ds-divider": "^1.3.18",
48
48
  "@synerise/ds-icon": "^1.18.5",
49
- "@synerise/ds-popover": "^1.6.3",
50
- "@synerise/ds-tooltip": "^1.5.5",
49
+ "@synerise/ds-popover": "^1.7.0",
50
+ "@synerise/ds-tooltip": "^1.6.0",
51
51
  "@synerise/ds-utils": "^1.10.2",
52
52
  "classnames": "^2.5.1"
53
53
  },
@@ -61,5 +61,5 @@
61
61
  "@testing-library/react": "^14.0.0",
62
62
  "vitest": "^4.0.0"
63
63
  },
64
- "gitHead": "6df24ed12cd5f276d8eccde730591807982e3385"
64
+ "gitHead": "e1fece64a41fd18a78583ecb6c21ee00fe8c0759"
65
65
  }