@synerise/ds-dropdown 2.1.0 → 2.1.2

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,28 @@
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.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-dropdown@2.1.1...@synerise/ds-dropdown@2.1.2) (2026-09-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **core:** move test helpers to a ./testing subpath export ([b38cd82](https://github.com/synerise/synerise-design/commit/b38cd82c956111d2331d5c1e0efd1935366f1139))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.1.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-dropdown@2.1.0...@synerise/ds-dropdown@2.1.1) (2026-09-18)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **dropdown:** clear the item-click close timer when the list unmounts ([07f32bb](https://github.com/synerise/synerise-design/commit/07f32bb9308955886b57739cfcb84f99f71914bc))
23
+
24
+
25
+
26
+
27
+
6
28
  # [2.1.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-dropdown@2.0.3...@synerise/ds-dropdown@2.1.0) (2026-09-16)
7
29
 
8
30
  ### Features
@@ -1,11 +1,11 @@
1
1
  import { ComponentType } from 'react';
2
2
  import { default as SearchBar } from '@synerise/ds-search-bar';
3
- import { Wrapper } from './Dropdown.styles';
4
- import { DropdownProps } from './Dropdown.types';
5
3
  import { BackAction } from './components/BackAction/BackAction';
6
4
  import { BottomAction } from './components/BottomAction/BottomAction';
7
5
  import { MenuWrapper } from './components/DropdownMenuList/DropdownMenuList.styles';
8
6
  import { TextTrigger } from './components/TextTrigger/TextTrigger';
7
+ import { Wrapper } from './Dropdown.styles';
8
+ import { DropdownProps } from './Dropdown.types';
9
9
  type SubComponents = {
10
10
  Wrapper: typeof Wrapper;
11
11
  MenuWrapper: typeof MenuWrapper;
package/dist/Dropdown.js CHANGED
@@ -2,13 +2,13 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import { useState, useMemo } from "react";
3
3
  import SearchBar from "@synerise/ds-search-bar";
4
4
  import { getPopupContainer } from "@synerise/ds-utils";
5
- import { Wrapper } from "./Dropdown.styles.js";
6
5
  import { BackAction } from "./components/BackAction/BackAction.js";
7
6
  import { BottomAction } from "./components/BottomAction/BottomAction.js";
8
7
  import { DropdownFooter } from "./components/DropdownFooter/DropdownFooter.js";
9
8
  import { MenuWrapper } from "./components/DropdownMenuList/DropdownMenuList.styles.js";
10
9
  import { DropdownPopover } from "./components/DropdownPopover/DropdownPopover.js";
11
10
  import { TextTrigger } from "./components/TextTrigger/TextTrigger.js";
11
+ import { Wrapper } from "./Dropdown.styles.js";
12
12
  import { useDropdownVisibility } from "./hooks/useDropdownVisibility.js";
13
13
  const Dropdown = ({
14
14
  hideOnItemClick,
@@ -1,5 +1,5 @@
1
- import { CSSProperties, HTMLAttributes, ReactNode } from 'react';
2
1
  import { OpenChangeReason } from '@floating-ui/react';
2
+ import { CSSProperties, HTMLAttributes, ReactNode } from 'react';
3
3
  import { LegacyDropdownPlacement, PopoverOptions, PopoverTriggerType } from '@synerise/ds-popover';
4
4
  import { WithHTMLAttributes } from '@synerise/ds-utils';
5
5
  export type DropdownProps = Omit<WithHTMLAttributes<HTMLDivElement, DropdownSharedProps & {
@@ -1,5 +1,5 @@
1
1
  import { jsx, Fragment } from "react/jsx-runtime";
2
- import { useCallback, useMemo } from "react";
2
+ import { useCallback, useMemo, useRef, useEffect } from "react";
3
3
  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";
@@ -8,6 +8,7 @@ import { useMeasuredRowHeights, useMeasuredRow } 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;
11
+ const CLOSE_DELAY = 10;
11
12
  const DropdownRow = ({
12
13
  index,
13
14
  style,
@@ -51,13 +52,16 @@ const DropdownMenuList = ({
51
52
  keys: rowKeys,
52
53
  estimate: getEstimatedItemSize
53
54
  });
55
+ const closeTimeoutRef = useRef();
54
56
  const handleItemClick = useCallback(() => {
55
57
  if (hideOnItemClick) {
56
- setTimeout(() => {
58
+ clearTimeout(closeTimeoutRef.current);
59
+ closeTimeoutRef.current = setTimeout(() => {
57
60
  closeOverlay();
58
- }, 10);
61
+ }, CLOSE_DELAY);
59
62
  }
60
63
  }, [hideOnItemClick, closeOverlay]);
64
+ useEffect(() => () => clearTimeout(closeTimeoutRef.current), []);
61
65
  const {
62
66
  listHeight,
63
67
  listMaxHeight,
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { useMergeRefs } from "@floating-ui/react";
2
3
  import classnames from "classnames";
3
4
  import { forwardRef, useRef, useState, useEffect } from "react";
4
- import { useMergeRefs } from "@floating-ui/react";
5
5
  import { getDropdownWidth } from "../../utils/getDropdownWidth.js";
6
6
  import { OverlayWrapper } from "./DropdownOverlay.styles.js";
7
7
  const DropdownOverlay = forwardRef(({
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useRef } from "react";
3
2
  import { FloatingList } from "@floating-ui/react";
3
+ import { useRef } from "react";
4
4
  import { DropdownContextProvider } from "@synerise/ds-core";
5
5
  import { getPlacement, Popover, PopoverTrigger, PopoverContent } from "@synerise/ds-popover";
6
6
  import { POPOVER_SHIFT_CONFIG, POPOVER_FLIP_CONFIG, POPOVER_OFFSET_CONFIG, POPOVER_TRANSITION_DURATION } from "../../Dropdown.const.js";
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { default, Dropdown } from './Dropdown';
1
+ export { BackAction } from './components/BackAction/BackAction';
2
+ export { BottomAction } from './components/BottomAction/BottomAction';
2
3
  export { DropdownMenu } from './components/DropdownMenu/DropdownMenu';
4
+ export type { DropdownMenuProps } from './components/DropdownMenu/DropdownMenu.types';
5
+ export type { DropdownMenuListItemProps } from './components/DropdownMenuList/DropdownMenuList.types';
3
6
  export { DropdownOverlay } from './components/DropdownOverlay/DropdownOverlay';
4
7
  export { TextTrigger } from './components/TextTrigger/TextTrigger';
5
- export { BackAction } from './components/BackAction/BackAction';
6
- export { BottomAction } from './components/BottomAction/BottomAction';
8
+ export { Dropdown, default } from './Dropdown';
7
9
  export type { DropdownPlacement, DropdownProps, DropdownSharedProps, DropdownSize, } from './Dropdown.types';
8
- export { type DropdownMenuProps } from './components/DropdownMenu/DropdownMenu.types';
9
- export { type DropdownMenuListItemProps } from './components/DropdownMenuList/DropdownMenuList.types';
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { Dropdown, Dropdown as Dropdown2 } from "./Dropdown.js";
1
+ import { BackAction } from "./components/BackAction/BackAction.js";
2
+ import { BottomAction } from "./components/BottomAction/BottomAction.js";
2
3
  import { DropdownMenu } from "./components/DropdownMenu/DropdownMenu.js";
3
4
  import { DropdownOverlay } from "./components/DropdownOverlay/DropdownOverlay.js";
4
5
  import { TextTrigger } from "./components/TextTrigger/TextTrigger.js";
5
- import { BackAction } from "./components/BackAction/BackAction.js";
6
- import { BottomAction } from "./components/BottomAction/BottomAction.js";
6
+ import { Dropdown, Dropdown as Dropdown2 } from "./Dropdown.js";
7
7
  export {
8
8
  BackAction,
9
9
  BottomAction,
@@ -1,3 +1,3 @@
1
+ export * from './getDropdownWidth';
1
2
  export * from './getTransitionConfig';
2
3
  export * from './isSplitFooter';
3
- export * from './getDropdownWidth';
@@ -1,6 +1,6 @@
1
+ import { getDropdownWidth } from "./getDropdownWidth.js";
1
2
  import { getTransitionConfig } from "./getTransitionConfig.js";
2
3
  import { isSplitFooter } from "./isSplitFooter.js";
3
- import { getDropdownWidth } from "./getDropdownWidth.js";
4
4
  export {
5
5
  getDropdownWidth,
6
6
  getTransitionConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-dropdown",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
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.3",
47
- "@synerise/ds-empty-states": "^2.0.2",
48
- "@synerise/ds-icon": "^2.1.1",
49
- "@synerise/ds-list-item": "^2.1.0",
50
- "@synerise/ds-popover": "^2.0.1",
51
- "@synerise/ds-scrollbar": "^2.0.2",
52
- "@synerise/ds-search-bar": "^2.0.4",
53
- "@synerise/ds-tooltip": "^2.0.3",
54
- "@synerise/ds-typography": "^2.0.3",
55
- "@synerise/ds-utils": "^2.1.0",
46
+ "@synerise/ds-divider": "^2.0.5",
47
+ "@synerise/ds-empty-states": "^2.0.4",
48
+ "@synerise/ds-icon": "^2.1.3",
49
+ "@synerise/ds-list-item": "^2.1.2",
50
+ "@synerise/ds-popover": "^2.0.3",
51
+ "@synerise/ds-scrollbar": "^2.0.4",
52
+ "@synerise/ds-search-bar": "^2.0.6",
53
+ "@synerise/ds-tooltip": "^2.0.5",
54
+ "@synerise/ds-typography": "^2.0.5",
55
+ "@synerise/ds-utils": "^2.2.0",
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": "71f08fdaba8e7b80731e29a03883dc6a33f2b9db"
68
+ "gitHead": "5e795fa4fd23f6b07277edb517a84bb9b5b6d256"
69
69
  }