@synerise/ds-dropdown 2.1.3 → 2.1.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,25 @@
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
+ ## [2.1.5](https://github.com/synerise/synerise-design/compare/@synerise/ds-dropdown@2.1.4...@synerise/ds-dropdown@2.1.5) (2026-10-20)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **utils:** let measured list rows shrink back to their content ([f04903d](https://github.com/synerise/synerise-design/commit/f04903dc40ddbec33850946045c02f914569aeb7))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.1.4](https://github.com/synerise/synerise-design/compare/@synerise/ds-dropdown@2.1.3...@synerise/ds-dropdown@2.1.4) (2026-10-09)
18
+
19
+ **Note:** Version bump only for package @synerise/ds-dropdown
20
+
21
+
22
+
23
+
24
+
6
25
  ## [2.1.3](https://github.com/synerise/synerise-design/compare/@synerise/ds-dropdown@2.1.2...@synerise/ds-dropdown@2.1.3) (2026-09-24)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-dropdown
@@ -4,7 +4,7 @@ import { VariableSizeList } from "react-window";
4
4
  import { SearchNoResultsL } from "@synerise/ds-icon";
5
5
  import { LIST_ITEM_SIZE_MAPPING, itemTypes, itemSizes } from "@synerise/ds-list-item";
6
6
  import Scrollbar from "@synerise/ds-scrollbar";
7
- import { useMeasuredRowHeights, useMeasuredRow } from "@synerise/ds-utils";
7
+ import { useMeasuredRowHeights, useMeasuredRow, getMeasuredRowStyle } from "@synerise/ds-utils";
8
8
  import { MAX_VISIBLE_ITEMS, SCROLLBAR_OFFSET } from "../../Dropdown.const.js";
9
9
  import { ScrollableMenuWrapper, DropdownMenuList as DropdownMenuList$1, DropdownMenuListItem, EmptyStates } from "./DropdownMenuList.styles.js";
10
10
  const DIVIDER_HEIGHT = 17;
@@ -17,15 +17,12 @@ const DropdownRow = ({
17
17
  const {
18
18
  dataSource,
19
19
  onItemClick,
20
+ getEstimatedItemSize,
20
21
  measureRow
21
22
  } = data;
22
23
  const item = dataSource[index];
23
24
  const rowRef = useMeasuredRow(index, measureRow);
24
- return /* @__PURE__ */ jsx("div", { ref: rowRef, style: {
25
- ...style,
26
- height: "auto",
27
- minHeight: style.height
28
- }, children: item.type === itemTypes.DIVIDER ? /* @__PURE__ */ jsx(DropdownMenuListItem, { ...item }) : /* @__PURE__ */ jsx(DropdownMenuListItem, { ...item, itemKey: item.key, onClick: (itemData) => {
25
+ return /* @__PURE__ */ jsx("div", { ref: rowRef, style: getMeasuredRowStyle(style, getEstimatedItemSize(index)), children: item.type === itemTypes.DIVIDER ? /* @__PURE__ */ jsx(DropdownMenuListItem, { ...item }) : /* @__PURE__ */ jsx(DropdownMenuListItem, { ...item, itemKey: item.key, onClick: (itemData) => {
29
26
  item.onClick?.(itemData);
30
27
  onItemClick();
31
28
  } }) });
@@ -93,8 +90,9 @@ const DropdownMenuList = ({
93
90
  const itemData = useMemo(() => ({
94
91
  dataSource,
95
92
  onItemClick: handleItemClick,
93
+ getEstimatedItemSize,
96
94
  measureRow
97
- }), [dataSource, handleItemClick, measureRow]);
95
+ }), [dataSource, handleItemClick, getEstimatedItemSize, measureRow]);
98
96
  return /* @__PURE__ */ jsx(ScrollableMenuWrapper, { children: dataSource.length ? /* @__PURE__ */ jsx(Scrollbar, { absolute: true, maxHeight: !virtualised && hasAutoItem ? void 0 : listMaxHeight + SCROLLBAR_OFFSET, children: /* @__PURE__ */ jsx(DropdownMenuList$1, { children: virtualised ? /* @__PURE__ */ jsx(VariableSizeList, { ref: listRef, height: listHeight, itemData, itemCount: dataSource.length, itemSize: getItemSize, itemKey: (index) => rowKeys[index], estimatedItemSize: getEstimatedItemSize(0), width: "100%", style: {
99
97
  paddingRight: "8px"
100
98
  }, children: DropdownRow }) : /* @__PURE__ */ jsx(Fragment, { children: dataSource.map((item) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-dropdown",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "Dropdown UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -43,16 +43,16 @@
43
43
  "types": "dist/index.d.ts",
44
44
  "dependencies": {
45
45
  "@floating-ui/react": "^0.27.16",
46
- "@synerise/ds-divider": "^2.0.6",
47
- "@synerise/ds-empty-states": "^2.0.5",
48
- "@synerise/ds-icon": "^2.2.0",
49
- "@synerise/ds-list-item": "^2.1.3",
46
+ "@synerise/ds-divider": "^2.0.8",
47
+ "@synerise/ds-empty-states": "^2.0.7",
48
+ "@synerise/ds-icon": "^2.2.2",
49
+ "@synerise/ds-list-item": "^2.2.1",
50
50
  "@synerise/ds-popover": "^2.0.3",
51
- "@synerise/ds-scrollbar": "^2.0.5",
52
- "@synerise/ds-search-bar": "^2.0.7",
53
- "@synerise/ds-tooltip": "^2.0.6",
54
- "@synerise/ds-typography": "^2.0.6",
55
- "@synerise/ds-utils": "^2.2.0",
51
+ "@synerise/ds-scrollbar": "^2.0.7",
52
+ "@synerise/ds-search-bar": "^2.0.9",
53
+ "@synerise/ds-tooltip": "^2.0.8",
54
+ "@synerise/ds-typography": "^2.0.8",
55
+ "@synerise/ds-utils": "^2.2.1",
56
56
  "classnames": "^2.5.1",
57
57
  "react-window": "^1.8.11"
58
58
  },
@@ -65,5 +65,5 @@
65
65
  "react-intl": "^6.8.7",
66
66
  "styled-components": "^5.3.3"
67
67
  },
68
- "gitHead": "6b725db2b0de1a2dfc6e9a3744f6c2fb2a04cc04"
68
+ "gitHead": "ac1a96b3cd66d2836b0639b3d9920fc0ebd7f8f3"
69
69
  }