@popsure/dirty-swan 0.66.1 → 0.66.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.
@@ -1,5 +1,5 @@
1
1
  import { RefObject } from 'react';
2
2
  export declare const useDropdownAlignment: (containerRef: RefObject<HTMLElement | null>, dropdownRef: RefObject<HTMLElement | null>, isOpen: boolean) => {
3
- alignRight: boolean;
4
- alignUp: boolean;
3
+ alignX: "left" | "right";
4
+ alignY: "top" | "bottom";
5
5
  };
@@ -4,7 +4,7 @@ import 'react';
4
4
  import '../../index-DLQEsiym.js';
5
5
  import '../input/index.js';
6
6
  import '../icon/icons/ChevronDown.js';
7
- export { S as SearchableDropdown } from '../../index-QeP_xz9v.js';
7
+ export { S as SearchableDropdown } from '../../index-B18M6b67.js';
8
8
  import '../../useOnClickOutside-B5hujnpp.js';
9
9
  import '../../index-CNcEE5dn.js';
10
10
  import '../../_commonjsHelpers-BFTU3MAI.js';
@@ -1,7 +1,7 @@
1
1
  import { b as __assign } from '../../tslib.es6-CVlKGIvp.js';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { useState } from 'react';
4
- import { S as SearchableDropdown } from '../../index-QeP_xz9v.js';
4
+ import { S as SearchableDropdown } from '../../index-B18M6b67.js';
5
5
  import '../../index-DLQEsiym.js';
6
6
  import '../../_commonjsHelpers-BFTU3MAI.js';
7
7
  import '../input/index.js';
@@ -1,7 +1,7 @@
1
1
  import { _ as __awaiter, a as __generator, b as __assign } from '../../tslib.es6-CVlKGIvp.js';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { s as screen, c as customRender } from '../../customRender-DzdqZxUd.js';
4
- import { S as SearchableDropdown } from '../../index-QeP_xz9v.js';
4
+ import { S as SearchableDropdown } from '../../index-B18M6b67.js';
5
5
  import '../../_commonjsHelpers-BFTU3MAI.js';
6
6
  import 'react';
7
7
  import 'react-dom';
@@ -9,8 +9,8 @@ import { g as generateId } from './index-CNcEE5dn.js';
9
9
  import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
10
10
 
11
11
  var useDropdownAlignment = function (containerRef, dropdownRef, isOpen) {
12
- var _a = useState(false), alignRight = _a[0], setAlignRight = _a[1];
13
- var _b = useState(false), alignUp = _b[0], setAlignUp = _b[1];
12
+ var _a = useState('left'), alignX = _a[0], setAlignX = _a[1];
13
+ var _b = useState('bottom'), alignY = _b[0], setAlignY = _b[1];
14
14
  var updateAlignment = useCallback(function () {
15
15
  if (containerRef.current && dropdownRef.current) {
16
16
  var containerRect = containerRef.current.getBoundingClientRect();
@@ -18,8 +18,8 @@ var useDropdownAlignment = function (containerRef, dropdownRef, isOpen) {
18
18
  var dropdownHeight = dropdownRef.current.offsetHeight;
19
19
  var spaceOnRight = window.innerWidth - containerRect.left;
20
20
  var spaceBelow = window.innerHeight - containerRect.bottom;
21
- setAlignRight(spaceOnRight < dropdownWidth);
22
- setAlignUp(spaceBelow < dropdownHeight && containerRect.top > spaceBelow);
21
+ setAlignX(spaceOnRight < dropdownWidth ? 'right' : 'left');
22
+ setAlignY(spaceBelow < dropdownHeight && containerRect.top > spaceBelow ? 'top' : 'bottom');
23
23
  }
24
24
  }, [containerRef, dropdownRef]);
25
25
  useEffect(function () {
@@ -30,7 +30,7 @@ var useDropdownAlignment = function (containerRef, dropdownRef, isOpen) {
30
30
  observer.observe(document.documentElement);
31
31
  return function () { return observer.disconnect(); };
32
32
  }, [isOpen, updateAlignment]);
33
- return { alignRight: alignRight, alignUp: alignUp };
33
+ return { alignX: alignX, alignY: alignY };
34
34
  };
35
35
 
36
36
  var useEscapeKey = function (callback) {
@@ -45,8 +45,8 @@ var useEscapeKey = function (callback) {
45
45
  }, [handleOnEscape]);
46
46
  };
47
47
 
48
- var css_248z = ".style-module_bs-xs__2KEsk {\n box-shadow: 0 2px 12px rgba(38, 38, 46, 0.03);\n}\n\n.style-module_bs-sm__3u9QM {\n box-shadow: 0 2px 20px 0 rgba(38, 38, 46, 0.04);\n}\n\n.style-module_bs-md__2LfxW {\n box-shadow: 0 2px 28px rgba(38, 38, 46, 0.08);\n}\n\n.style-module_bs-lg__2Qx0R {\n box-shadow: 0 2px 32px rgba(38, 38, 46, 0.1);\n}\n\n.style-module_bs-xl__kaOuM {\n box-shadow: 0 2px 50px rgba(38, 38, 46, 0.18);\n}\n\n.style-module_container__2064q {\n position: relative;\n}\n\n.style-module_selectTrigger__1GiSB {\n padding: 10px 12px;\n border: 1px solid #e7e7ed;\n}\n.style-module_selectTrigger__1GiSB:hover {\n border-color: #b8b8c0;\n}\n.style-module_selectTrigger__1GiSB:focus-visible {\n outline: 1px solid #26262e;\n outline-offset: 1px;\n}\n.style-module_selectTriggerOpen__29Kor {\n border-color: #26262e;\n box-shadow: 0 2px 12px rgba(38, 38, 46, 0.03);\n}\n\n.style-module_disabled__2BlO- {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.style-module_chevronOpen__Ot3RV {\n transform: rotate(180deg);\n}\n\n.style-module_condensed__GDq0d {\n width: auto;\n padding: 8px 10px;\n gap: 8px;\n}\n\n.style-module_bordered__tRh9H {\n border: 1px solid #e7e7ed;\n}\n.style-module_bordered__tRh9H:hover {\n border-color: #b8b8c0;\n}\n\n.style-module_dropdown__1A-wl {\n position: absolute;\n top: calc(100% + 4px);\n left: 0;\n min-width: 280px;\n border: 1px solid #e7e7ed;\n box-shadow: 0 2px 28px rgba(38, 38, 46, 0.08);\n z-index: 10;\n}\n\n.style-module_dropdownRight__lLMiT {\n left: auto;\n right: 0;\n}\n\n.style-module_dropdownUp__2PCvx {\n top: auto;\n bottom: calc(100% + 4px);\n}\n.style-module_dropdownUp__2PCvx .style-module_searchContainer__4O1qv {\n order: 2;\n padding-bottom: 0;\n padding-top: 8px;\n}\n.style-module_dropdownUp__2PCvx .style-module_optionList__-2I8l {\n order: 1;\n}\n\n.style-module_searchContainer__4O1qv {\n position: sticky;\n top: 0;\n}\n\n.style-module_optionList__-2I8l {\n max-height: 308px;\n overflow-y: auto;\n scrollbar-width: none;\n}\n.style-module_optionList__-2I8l::-webkit-scrollbar {\n display: none;\n}\n\n.style-module_optionWrapper__3GVCB {\n position: relative;\n}\n\n.style-module_optionRadio__3GBog {\n position: absolute;\n opacity: 0;\n width: 0;\n height: 0;\n}\n.style-module_optionRadio__3GBog:focus-visible + label {\n outline: 2px solid #26262e;\n outline-offset: -2px;\n border-radius: 8px;\n}\n\n.style-module_option__1HkKR {\n padding: 10px 12px;\n border: none;\n background-color: transparent;\n}\n.style-module_option__1HkKR:hover {\n background-color: #f7f7fd;\n}\n.style-module_optionSelected__2pPt9 {\n background-color: #F6F6FE;\n}\n.style-module_optionSelected__2pPt9:hover {\n background-color: #F6F6FE;\n}\n\n.style-module_optionIcon__2hBSY {\n flex-shrink: 0;\n}\n\n.style-module_noResults__18exv {\n padding: 10px 12px;\n}";
49
- var styles = {"container":"style-module_container__2064q","selectTrigger":"style-module_selectTrigger__1GiSB","selectTriggerOpen":"style-module_selectTriggerOpen__29Kor","disabled":"style-module_disabled__2BlO-","chevronOpen":"style-module_chevronOpen__Ot3RV","condensed":"style-module_condensed__GDq0d","bordered":"style-module_bordered__tRh9H","dropdown":"style-module_dropdown__1A-wl","dropdownRight":"style-module_dropdownRight__lLMiT","dropdownUp":"style-module_dropdownUp__2PCvx","searchContainer":"style-module_searchContainer__4O1qv","optionList":"style-module_optionList__-2I8l","optionWrapper":"style-module_optionWrapper__3GVCB","optionRadio":"style-module_optionRadio__3GBog","option":"style-module_option__1HkKR","optionSelected":"style-module_optionSelected__2pPt9","optionIcon":"style-module_optionIcon__2hBSY","noResults":"style-module_noResults__18exv"};
48
+ var css_248z = ".style-module_bs-xs__2KEsk {\n box-shadow: 0 2px 12px rgba(38, 38, 46, 0.03);\n}\n\n.style-module_bs-sm__3u9QM {\n box-shadow: 0 2px 20px 0 rgba(38, 38, 46, 0.04);\n}\n\n.style-module_bs-md__2LfxW {\n box-shadow: 0 2px 28px rgba(38, 38, 46, 0.08);\n}\n\n.style-module_bs-lg__2Qx0R {\n box-shadow: 0 2px 32px rgba(38, 38, 46, 0.1);\n}\n\n.style-module_bs-xl__kaOuM {\n box-shadow: 0 2px 50px rgba(38, 38, 46, 0.18);\n}\n\n.style-module_container__2064q {\n position: relative;\n}\n\n.style-module_selectTrigger__1GiSB {\n padding: 10px 12px;\n border: 1px solid #e7e7ed;\n}\n.style-module_selectTrigger__1GiSB:hover {\n border-color: #b8b8c0;\n}\n.style-module_selectTrigger__1GiSB:focus-visible {\n outline: 1px solid #26262e;\n outline-offset: 1px;\n}\n.style-module_selectTriggerOpen__29Kor {\n border-color: #26262e;\n box-shadow: 0 2px 12px rgba(38, 38, 46, 0.03);\n}\n\n.style-module_disabled__2BlO- {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.style-module_chevronOpen__Ot3RV {\n transform: rotate(180deg);\n}\n\n.style-module_condensed__GDq0d {\n width: auto;\n padding: 8px 10px;\n gap: 8px;\n}\n\n.style-module_bordered__tRh9H {\n border: 1px solid #e7e7ed;\n}\n.style-module_bordered__tRh9H:hover {\n border-color: #b8b8c0;\n}\n\n.style-module_dropdown__1A-wl {\n position: absolute;\n top: calc(100% + 4px);\n left: 0;\n min-width: 280px;\n border: 1px solid #e7e7ed;\n box-shadow: 0 2px 28px rgba(38, 38, 46, 0.08);\n z-index: 10;\n}\n\n.style-module_dropdownXRight__2LIci {\n left: auto;\n right: 0;\n}\n\n.style-module_dropdownYTop__Amnit {\n top: auto;\n bottom: calc(100% + 4px);\n}\n.style-module_dropdownYTop__Amnit .style-module_searchContainer__4O1qv {\n order: 2;\n padding-bottom: 0;\n padding-top: 8px;\n}\n.style-module_dropdownYTop__Amnit .style-module_optionList__-2I8l {\n order: 1;\n}\n\n.style-module_optionList__-2I8l {\n max-height: 308px;\n overflow-y: auto;\n scrollbar-width: none;\n}\n.style-module_optionList__-2I8l::-webkit-scrollbar {\n display: none;\n}\n\n.style-module_optionWrapper__3GVCB {\n position: relative;\n}\n\n.style-module_optionRadio__3GBog {\n position: absolute;\n opacity: 0;\n width: 0;\n height: 0;\n}\n.style-module_optionRadio__3GBog:focus-visible + label {\n outline: 2px solid #26262e;\n outline-offset: -2px;\n border-radius: 8px;\n}\n\n.style-module_option__1HkKR {\n padding: 10px 12px;\n border: none;\n background-color: transparent;\n}\n.style-module_option__1HkKR:hover {\n background-color: #f7f7fd;\n}\n.style-module_optionSelected__2pPt9 {\n background-color: #F6F6FE;\n}\n.style-module_optionSelected__2pPt9:hover {\n background-color: #F6F6FE;\n}\n\n.style-module_optionIcon__2hBSY {\n flex-shrink: 0;\n}\n\n.style-module_noResults__18exv {\n padding: 10px 12px;\n}";
49
+ var styles = {"container":"style-module_container__2064q","selectTrigger":"style-module_selectTrigger__1GiSB","selectTriggerOpen":"style-module_selectTriggerOpen__29Kor","disabled":"style-module_disabled__2BlO-","chevronOpen":"style-module_chevronOpen__Ot3RV","condensed":"style-module_condensed__GDq0d","bordered":"style-module_bordered__tRh9H","dropdown":"style-module_dropdown__1A-wl","dropdownXRight":"style-module_dropdownXRight__2LIci","dropdownYTop":"style-module_dropdownYTop__Amnit","optionList":"style-module_optionList__-2I8l","optionWrapper":"style-module_optionWrapper__3GVCB","optionRadio":"style-module_optionRadio__3GBog","option":"style-module_option__1HkKR","optionSelected":"style-module_optionSelected__2pPt9","optionIcon":"style-module_optionIcon__2hBSY","noResults":"style-module_noResults__18exv"};
50
50
  styleInject(css_248z);
51
51
 
52
52
  var SearchableDropdown = function (_a) {
@@ -73,7 +73,7 @@ var SearchableDropdown = function (_a) {
73
73
  if (isOpen)
74
74
  closeAndRestoreFocus();
75
75
  }, [isOpen, closeAndRestoreFocus]));
76
- var _s = useDropdownAlignment(containerRef, dropdownRef, isOpen), alignRight = _s.alignRight, alignUp = _s.alignUp;
76
+ var _s = useDropdownAlignment(containerRef, dropdownRef, isOpen), alignX = _s.alignX, alignY = _s.alignY;
77
77
  useEffect(function () {
78
78
  if (isOpen && searchable && searchInputRef.current) {
79
79
  searchInputRef.current.focus();
@@ -163,7 +163,7 @@ var SearchableDropdown = function (_a) {
163
163
  _b[styles.condensed] = condensed,
164
164
  _b[styles.bordered] = bordered,
165
165
  _b[styles.disabled] = disabled,
166
- _b)), onClick: handleTriggerClick, disabled: disabled, "aria-expanded": isOpen, "aria-haspopup": "listbox", "aria-controls": isOpen ? dropdownId : undefined, children: [jsxs("span", { className: 'd-flex ai-center gap8', children: [(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.icon) && (jsx("span", { className: styles.optionIcon, children: selectedOption.icon })), !condensed && (jsx("span", { className: "p-p", children: (_e = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _e !== void 0 ? _e : triggerPlaceholder }))] }), showChevron && (jsx(ChevronDownIcon, { className: classNames('ml8', (_c = {}, _c[styles.chevronOpen] = isOpen, _c)), size: 20, noMargin: true, color: "neutral-600" }))] }), isOpen && (jsxs("div", { id: dropdownId, ref: dropdownRef, className: classNames(styles.dropdown, 'bg-white br8 p8 d-flex fd-column', (_d = {}, _d[styles.dropdownUp] = dropUp || alignUp, _d[styles.dropdownRight] = alignRight, _d)), children: [searchable && (jsx("div", { className: classNames('pb8 bg-white', styles.searchContainer), children: jsx(Input, { ref: searchInputRef, type: "text", placeholder: placeholder, value: searchTerm, onChange: function (e) { return setSearchTerm(e.target.value); }, label: placeholder, hideLabel: true, onKeyDown: handleSearchKeyDown }) })), jsxs("div", { className: styles.optionList, role: "radiogroup", "aria-label": groupName, children: [filteredOptions.map(function (option) {
166
+ _b)), onClick: handleTriggerClick, disabled: disabled, "aria-expanded": isOpen, "aria-haspopup": "listbox", "aria-controls": isOpen ? dropdownId : undefined, children: [jsxs("span", { className: 'd-flex ai-center gap8', children: [(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.icon) && (jsx("span", { className: styles.optionIcon, children: selectedOption.icon })), !condensed && (jsx("span", { className: "p-p", children: (_e = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _e !== void 0 ? _e : triggerPlaceholder }))] }), showChevron && (jsx(ChevronDownIcon, { className: classNames('ml8', (_c = {}, _c[styles.chevronOpen] = isOpen, _c)), size: 20, noMargin: true, color: "neutral-600" }))] }), isOpen && (jsxs("div", { id: dropdownId, ref: dropdownRef, className: classNames(styles.dropdown, 'bg-white br8 p8 d-flex fd-column', (_d = {}, _d[styles.dropdownYTop] = dropUp || alignY === 'top', _d[styles.dropdownXRight] = alignX === 'right', _d)), children: [searchable && (jsx("div", { className: "pb8 bg-white", children: jsx(Input, { ref: searchInputRef, type: "text", placeholder: placeholder, value: searchTerm, onChange: function (e) { return setSearchTerm(e.target.value); }, label: placeholder, hideLabel: true, onKeyDown: handleSearchKeyDown }) })), jsxs("div", { className: styles.optionList, role: "radiogroup", "aria-label": groupName, children: [filteredOptions.map(function (option) {
167
167
  var _a;
168
168
  return (jsxs("div", { className: styles.optionWrapper, children: [jsx("input", { type: "radio", id: "".concat(groupName, "-").concat(option.id), name: groupName, value: option.id, checked: option.id === localValue, onChange: function () { return setLocalValue(option.id); }, onClick: function () { return handleOptionClick(option.id); }, tabIndex: option.id === localValue ? 0 : -1, className: styles.optionRadio, ref: function (el) { return handleOptionRef(option.id, el); }, onKeyDown: function (e) { return handleOptionKeyDown(e, option.id); } }), jsxs("label", { htmlFor: "".concat(groupName, "-").concat(option.id), className: classNames('d-flex ai-center gap8 w100 br8 c-pointer ta-left tc-neutral-900', styles.option, (_a = {},
169
169
  _a[styles.optionSelected] = option.id === localValue,
@@ -172,4 +172,4 @@ var SearchableDropdown = function (_a) {
172
172
  };
173
173
 
174
174
  export { SearchableDropdown as S, useEscapeKey as u };
175
- //# sourceMappingURL=index-QeP_xz9v.js.map
175
+ //# sourceMappingURL=index-B18M6b67.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-B18M6b67.js","sources":["../../../src/lib/hooks/useDropdownAlignment.ts","../../../src/lib/hooks/useEscapeKey.ts","../../../src/lib/components/searchableDropdown/index.tsx"],"sourcesContent":["import { RefObject, useCallback, useEffect, useState } from 'react';\n\nexport const useDropdownAlignment = (\n containerRef: RefObject<HTMLElement | null>,\n dropdownRef: RefObject<HTMLElement | null>,\n isOpen: boolean\n) => {\n const [alignX, setAlignX] = useState<'left' | 'right'>('left');\n const [alignY, setAlignY] = useState<'top' | 'bottom'>('bottom');\n\n const updateAlignment = useCallback(() => {\n if (containerRef.current && dropdownRef.current) {\n const containerRect = containerRef.current.getBoundingClientRect();\n const dropdownWidth = dropdownRef.current.offsetWidth;\n const dropdownHeight = dropdownRef.current.offsetHeight;\n const spaceOnRight = window.innerWidth - containerRect.left;\n const spaceBelow = window.innerHeight - containerRect.bottom;\n setAlignX(spaceOnRight < dropdownWidth ? 'right' : 'left');\n setAlignY(spaceBelow < dropdownHeight && containerRect.top > spaceBelow ? 'top' : 'bottom');\n }\n }, [containerRef, dropdownRef]);\n\n useEffect(() => {\n if (!isOpen) return;\n\n updateAlignment();\n\n const observer = new ResizeObserver(updateAlignment);\n observer.observe(document.documentElement);\n return () => observer.disconnect();\n }, [isOpen, updateAlignment]);\n\n return { alignX, alignY };\n};\n","import { useCallback, useEffect } from 'react';\n\nexport const useEscapeKey = (callback: () => void) => {\n const handleOnEscape = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n callback();\n }\n },\n [callback]\n );\n\n useEffect(() => {\n window.addEventListener('keydown', handleOnEscape);\n\n return () => window.removeEventListener('keydown', handleOnEscape);\n }, [handleOnEscape]);\n};\n","import { ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport classnames from 'classnames';\n\nimport { Input } from '../input';\nimport { ChevronDownIcon } from '../icon';\nimport { useDropdownAlignment } from '../../hooks/useDropdownAlignment';\nimport { useEscapeKey } from '../../hooks/useEscapeKey';\nimport { useOnClickOutside } from '../../hooks/useOnClickOutside';\nimport generateId from '../../util/generateId';\n\nimport styles from './style.module.scss';\n\nexport interface SearchableDropdownOption {\n id: string;\n label: string;\n icon?: ReactNode;\n}\n\nexport interface SearchableDropdownProps {\n options: SearchableDropdownOption[];\n value: string | null;\n onChange: (value: string) => void;\n searchable?: boolean;\n placeholder?: string;\n triggerPlaceholder?: string;\n noResultsText?: string;\n groupName?: string;\n dropUp?: boolean;\n condensed?: boolean;\n bordered?: boolean;\n showChevron?: boolean;\n disabled?: boolean;\n}\n\nexport const SearchableDropdown = ({\n options,\n value,\n onChange,\n searchable = false,\n placeholder = 'Search',\n triggerPlaceholder,\n noResultsText = 'No results found',\n groupName: groupNameProp,\n dropUp = false,\n condensed = false,\n bordered = false,\n showChevron = false,\n disabled = false,\n}: SearchableDropdownProps) => {\n const [isOpen, setIsOpen] = useState(false);\n const [searchTerm, setSearchTerm] = useState('');\n const [localValue, setLocalValue] = useState(value);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const optionRefs = useRef<Map<string, HTMLInputElement>>(new Map());\n const [groupName] = useState(() => groupNameProp ?? `sd-${generateId()}`);\n const dropdownId = `${groupName}-dropdown`;\n\n const closeAndRestoreFocus = useCallback(() => {\n setIsOpen(false);\n triggerRef.current?.focus();\n }, []);\n\n useOnClickOutside(containerRef, () => isOpen && closeAndRestoreFocus());\n useEscapeKey(\n useCallback(() => {\n if (isOpen) closeAndRestoreFocus();\n }, [isOpen, closeAndRestoreFocus])\n );\n\n const { alignX, alignY } = useDropdownAlignment(containerRef, dropdownRef, isOpen);\n\n useEffect(() => {\n if (isOpen && searchable && searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, [isOpen, searchable]);\n\n useEffect(() => {\n if (!isOpen) {\n setSearchTerm('');\n setLocalValue(value);\n }\n }, [isOpen, value]);\n\n const filteredOptions = useMemo(() => {\n if (!searchTerm) return options;\n return [...options]\n .filter((option) =>\n option.label.toLowerCase().includes(searchTerm.toLowerCase())\n )\n .sort((a, b) => {\n const term = searchTerm.toLowerCase();\n const aStartsWith = a.label.toLowerCase().startsWith(term);\n const bStartsWith = b.label.toLowerCase().startsWith(term);\n if (aStartsWith && !bStartsWith) return -1;\n if (!aStartsWith && bStartsWith) return 1;\n return 0;\n });\n }, [options, searchTerm]);\n\n const selectedOption = options.find((option) => option.id === value);\n\n const handleTriggerClick = () => {\n if (!disabled) setIsOpen(!isOpen);\n };\n\n const handleSearchKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n const target =\n e.key === 'ArrowDown'\n ? filteredOptions[0]\n : filteredOptions[filteredOptions.length - 1];\n if (target) {\n setLocalValue(target.id);\n optionRefs.current.get(target.id)?.focus();\n }\n } else if (e.key === 'Enter') {\n e.preventDefault();\n const target = filteredOptions[0];\n if (target) {\n onChange(target.id);\n closeAndRestoreFocus();\n }\n }\n };\n\n const handleOptionClick = (optionId: string) => {\n onChange(optionId);\n closeAndRestoreFocus();\n };\n\n const handleOptionRef = (optionId: string, el: HTMLInputElement | null) => {\n if (el) optionRefs.current.set(optionId, el);\n else optionRefs.current.delete(optionId);\n };\n\n const handleOptionKeyDown = (e: React.KeyboardEvent, optionId: string) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n const currentIndex = filteredOptions.findIndex(\n (o) => o.id === optionId\n );\n const nextIndex =\n e.key === 'ArrowDown'\n ? Math.min(currentIndex + 1, filteredOptions.length - 1)\n : Math.max(currentIndex - 1, 0);\n const next = filteredOptions[nextIndex];\n if (next) {\n setLocalValue(next.id);\n optionRefs.current.get(next.id)?.focus();\n }\n } else if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onChange(optionId);\n closeAndRestoreFocus();\n }\n };\n\n return (\n <div className={classnames(styles.container, { 'd-inline-block': condensed })} ref={containerRef}>\n <button\n ref={triggerRef}\n type=\"button\"\n className={classnames(\n 'd-flex ai-center jc-between w100 br8 bg-white c-pointer ta-left tc-neutral-900',\n styles.selectTrigger, {\n [styles.selectTriggerOpen]: isOpen,\n [styles.condensed]: condensed,\n [styles.bordered]: bordered,\n [styles.disabled]: disabled,\n }\n )}\n onClick={handleTriggerClick}\n disabled={disabled}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-controls={isOpen ? dropdownId : undefined}\n >\n <span className={'d-flex ai-center gap8'}>\n {selectedOption?.icon && (\n <span className={styles.optionIcon}>{selectedOption.icon}</span>\n )}\n {!condensed && (\n <span className=\"p-p\">\n {selectedOption?.label ?? triggerPlaceholder}\n </span>\n )}\n </span>\n {showChevron && (\n <ChevronDownIcon\n className={classnames('ml8', { [styles.chevronOpen]: isOpen })}\n size={20}\n noMargin\n color=\"neutral-600\"\n />\n )}\n </button>\n {isOpen && (\n <div\n id={dropdownId}\n ref={dropdownRef}\n className={classnames(\n styles.dropdown,\n 'bg-white br8 p8 d-flex fd-column',\n { [styles.dropdownYTop]: dropUp || alignY === 'top', [styles.dropdownXRight]: alignX === 'right' }\n )}\n >\n {searchable && (\n <div className=\"pb8 bg-white\">\n <Input\n ref={searchInputRef}\n type=\"text\"\n placeholder={placeholder}\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n label={placeholder}\n hideLabel\n onKeyDown={handleSearchKeyDown}\n />\n </div>\n )}\n <div className={styles.optionList} role=\"radiogroup\" aria-label={groupName}>\n {filteredOptions.map((option) => (\n <div key={option.id} className={styles.optionWrapper}>\n <input\n type=\"radio\"\n id={`${groupName}-${option.id}`}\n name={groupName}\n value={option.id}\n checked={option.id === localValue}\n onChange={() => setLocalValue(option.id)}\n onClick={() => handleOptionClick(option.id)}\n tabIndex={option.id === localValue ? 0 : -1}\n className={styles.optionRadio}\n ref={(el) => handleOptionRef(option.id, el)}\n onKeyDown={(e) => handleOptionKeyDown(e, option.id)}\n />\n <label\n htmlFor={`${groupName}-${option.id}`}\n className={classnames(\n 'd-flex ai-center gap8 w100 br8 c-pointer ta-left tc-neutral-900',\n styles.option, {\n [styles.optionSelected]: option.id === localValue,\n })}\n >\n {option.icon && (\n <span className={styles.optionIcon}>{option.icon}</span>\n )}\n <span className=\"p-p\">{option.label}</span>\n </label>\n </div>\n ))}\n {filteredOptions.length === 0 && (\n <p className={`p-p tc-neutral-500 ${styles.noResults}`}>\n {noResultsText}\n </p>\n )}\n </div>\n </div>\n )}\n </div>\n );\n};\n"],"names":["_jsxs","classnames","_jsx"],"mappings":";;;;;;;;;;AAEO,IAAM,oBAAoB,GAAG,UAClC,YAA2C,EAC3C,WAA0C,EAC1C,MAAe,EAAA;IAET,IAAA,EAAA,GAAsB,QAAQ,CAAmB,MAAM,CAAC,EAAvD,MAAM,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,SAAS,GAAA,EAAA,CAAA,CAAA,CAAsC;IACxD,IAAA,EAAA,GAAsB,QAAQ,CAAmB,QAAQ,CAAC,EAAzD,MAAM,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,SAAS,GAAA,EAAA,CAAA,CAAA,CAAwC;IAEhE,IAAM,eAAe,GAAG,WAAW,CAAC,YAAA;QAClC,IAAI,YAAY,CAAC,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE;YAC/C,IAAM,aAAa,GAAG,YAAY,CAAC,OAAO,CAAC,qBAAqB,EAAE;AAClE,YAAA,IAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC,WAAW;AACrD,YAAA,IAAM,cAAc,GAAG,WAAW,CAAC,OAAO,CAAC,YAAY;YACvD,IAAM,YAAY,GAAG,MAAM,CAAC,UAAU,GAAG,aAAa,CAAC,IAAI;YAC3D,IAAM,UAAU,GAAG,MAAM,CAAC,WAAW,GAAG,aAAa,CAAC,MAAM;AAC5D,YAAA,SAAS,CAAC,YAAY,GAAG,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAC1D,YAAA,SAAS,CAAC,UAAU,GAAG,cAAc,IAAI,aAAa,CAAC,GAAG,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,CAAC;QAC7F;AACF,IAAA,CAAC,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M,SAAS,EAAE,MAAM,CAAC,UAAU,EAAA,QAAA,EAAG,MAAM,CAAC,IAAI,EAAA,CAAQ,CACzD,EACDA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,KAAK,YAAE,MAAM,CAAC,KAAK,EAAA,CAAQ,IACrC,CAAA,EAAA,EA1BA,MAAM,CAAC,EAAE,CA2Bb;4BA5ByB,CA6BhC,CAAC,EACD,eAAe,CAAC,MAAM,KAAK,CAAC,KAC3BA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,qBAAA,CAAA,MAAA,CAAsB,MAAM,CAAC,SAAS,CAAE,EAAA,QAAA,EACnD,aAAa,EAAA,CACZ,CACL,CAAA,EAAA,CACG,CAAA,EAAA,CACF,CACP,CAAA,EAAA,CACG;AAEV;;;;"}
package/dist/esm/index.js CHANGED
@@ -23,7 +23,7 @@ export { default as Chip } from './components/chip/index.js';
23
23
  export { AutoSuggestInput } from './components/input/autoSuggestInput/index.js';
24
24
  export { ComparisonTable } from './components/comparisonTable/index.js';
25
25
  export { SegmentedControl } from './components/segmentedControl/index.js';
26
- export { S as SearchableDropdown, u as useEscapeKey } from './index-QeP_xz9v.js';
26
+ export { S as SearchableDropdown, u as useEscapeKey } from './index-B18M6b67.js';
27
27
  export { Link } from './components/link/index.js';
28
28
  export { a as illustrations, i as images } from './index-C4hs4X-e.js';
29
29
  export { Spinner } from './components/spinner/index.js';
@@ -1,5 +1,5 @@
1
1
  import { RefObject } from 'react';
2
2
  export declare const useDropdownAlignment: (containerRef: RefObject<HTMLElement | null>, dropdownRef: RefObject<HTMLElement | null>, isOpen: boolean) => {
3
- alignRight: boolean;
4
- alignUp: boolean;
3
+ alignX: "left" | "right";
4
+ alignY: "top" | "bottom";
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popsure/dirty-swan",
3
- "version": "0.66.1",
3
+ "version": "0.66.2",
4
4
  "author": "Vincent Audoire <vincent@getpopsure.com>",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -70,7 +70,7 @@ export const SearchableDropdown = ({
70
70
  }, [isOpen, closeAndRestoreFocus])
71
71
  );
72
72
 
73
- const { alignRight, alignUp } = useDropdownAlignment(containerRef, dropdownRef, isOpen);
73
+ const { alignX, alignY } = useDropdownAlignment(containerRef, dropdownRef, isOpen);
74
74
 
75
75
  useEffect(() => {
76
76
  if (isOpen && searchable && searchInputRef.current) {
@@ -206,11 +206,11 @@ export const SearchableDropdown = ({
206
206
  className={classnames(
207
207
  styles.dropdown,
208
208
  'bg-white br8 p8 d-flex fd-column',
209
- { [styles.dropdownUp]: dropUp || alignUp, [styles.dropdownRight]: alignRight }
209
+ { [styles.dropdownYTop]: dropUp || alignY === 'top', [styles.dropdownXRight]: alignX === 'right' }
210
210
  )}
211
211
  >
212
212
  {searchable && (
213
- <div className={classnames('pb8 bg-white', styles.searchContainer)}>
213
+ <div className="pb8 bg-white">
214
214
  <Input
215
215
  ref={searchInputRef}
216
216
  type="text"
@@ -58,12 +58,12 @@
58
58
  z-index: 10;
59
59
  }
60
60
 
61
- .dropdownRight {
61
+ .dropdownXRight {
62
62
  left: auto;
63
63
  right: 0;
64
64
  }
65
65
 
66
- .dropdownUp {
66
+ .dropdownYTop {
67
67
  top: auto;
68
68
  bottom: calc(100% + 4px);
69
69
 
@@ -78,11 +78,6 @@
78
78
  }
79
79
  }
80
80
 
81
- .searchContainer {
82
- position: sticky;
83
- top: 0;
84
- }
85
-
86
81
  .optionList {
87
82
  max-height: 308px;
88
83
  overflow-y: auto;
@@ -49,13 +49,13 @@ describe('useDropdownAlignment', () => {
49
49
  });
50
50
  });
51
51
 
52
- it('should return alignRight and alignUp as false by default', () => {
52
+ it('should return alignX as left and alignY as bottom by default', () => {
53
53
  const { result } = renderHook(() =>
54
54
  useDropdownAlignment(containerRef, dropdownRef, false)
55
55
  );
56
56
 
57
- expect(result.current.alignRight).toBe(false);
58
- expect(result.current.alignUp).toBe(false);
57
+ expect(result.current.alignX).toBe('left');
58
+ expect(result.current.alignY).toBe('bottom');
59
59
  });
60
60
 
61
61
  it('should not compute alignment when isOpen is false', () => {
@@ -76,12 +76,12 @@ describe('useDropdownAlignment', () => {
76
76
  useDropdownAlignment(nullContainerRef, nullDropdownRef, true)
77
77
  );
78
78
 
79
- expect(result.current.alignRight).toBe(false);
80
- expect(result.current.alignUp).toBe(false);
79
+ expect(result.current.alignX).toBe('left');
80
+ expect(result.current.alignY).toBe('bottom');
81
81
  });
82
82
 
83
83
  describe('horizontal alignment', () => {
84
- it('should set alignRight to false when there is enough space on the right', () => {
84
+ it('should set alignX to left when there is enough space on the right', () => {
85
85
  jest.spyOn(containerEl, 'getBoundingClientRect').mockReturnValue(
86
86
  mockContainerRect({ left: 100, bottom: 100, top: 100 })
87
87
  );
@@ -91,10 +91,10 @@ describe('useDropdownAlignment', () => {
91
91
  );
92
92
 
93
93
  // spaceOnRight = 1024 - 100 = 924, dropdownWidth = 200 → enough space
94
- expect(result.current.alignRight).toBe(false);
94
+ expect(result.current.alignX).toBe('left');
95
95
  });
96
96
 
97
- it('should set alignRight to true when there is not enough space on the right', () => {
97
+ it('should set alignX to right when there is not enough space on the right', () => {
98
98
  jest.spyOn(containerEl, 'getBoundingClientRect').mockReturnValue(
99
99
  mockContainerRect({ left: 900, bottom: 100, top: 100 })
100
100
  );
@@ -104,12 +104,12 @@ describe('useDropdownAlignment', () => {
104
104
  );
105
105
 
106
106
  // spaceOnRight = 1024 - 900 = 124, dropdownWidth = 200 → not enough space
107
- expect(result.current.alignRight).toBe(true);
107
+ expect(result.current.alignX).toBe('right');
108
108
  });
109
109
  });
110
110
 
111
111
  describe('vertical alignment', () => {
112
- it('should set alignUp to false when there is enough space below', () => {
112
+ it('should set alignY to bottom when there is enough space below', () => {
113
113
  jest.spyOn(containerEl, 'getBoundingClientRect').mockReturnValue(
114
114
  mockContainerRect({ left: 100, bottom: 100, top: 100 })
115
115
  );
@@ -119,10 +119,10 @@ describe('useDropdownAlignment', () => {
119
119
  );
120
120
 
121
121
  // spaceBelow = 768 - 100 = 668, dropdownHeight = 300 → enough space
122
- expect(result.current.alignUp).toBe(false);
122
+ expect(result.current.alignY).toBe('bottom');
123
123
  });
124
124
 
125
- it('should set alignUp to true when not enough space below and more space above', () => {
125
+ it('should set alignY to top when not enough space below and more space above', () => {
126
126
  jest.spyOn(containerEl, 'getBoundingClientRect').mockReturnValue(
127
127
  mockContainerRect({ left: 100, bottom: 600, top: 600 })
128
128
  );
@@ -133,10 +133,10 @@ describe('useDropdownAlignment', () => {
133
133
 
134
134
  // spaceBelow = 768 - 600 = 168, dropdownHeight = 300 → not enough below
135
135
  // containerRect.top = 600 > spaceBelow = 168 → more space above
136
- expect(result.current.alignUp).toBe(true);
136
+ expect(result.current.alignY).toBe('top');
137
137
  });
138
138
 
139
- it('should set alignUp to false when not enough space below but more space below than above', () => {
139
+ it('should set alignY to bottom when not enough space below but more space below than above', () => {
140
140
  jest.spyOn(containerEl, 'getBoundingClientRect').mockReturnValue(
141
141
  mockContainerRect({ left: 100, bottom: 500, top: 100 })
142
142
  );
@@ -147,7 +147,7 @@ describe('useDropdownAlignment', () => {
147
147
 
148
148
  // spaceBelow = 768 - 500 = 268, dropdownHeight = 300 → not enough below
149
149
  // containerRect.top = 100 < spaceBelow = 268 → more space below
150
- expect(result.current.alignUp).toBe(false);
150
+ expect(result.current.alignY).toBe('bottom');
151
151
  });
152
152
  });
153
153
 
@@ -191,7 +191,7 @@ describe('useDropdownAlignment', () => {
191
191
  useDropdownAlignment(containerRef, dropdownRef, true)
192
192
  );
193
193
 
194
- expect(result.current.alignRight).toBe(false);
194
+ expect(result.current.alignX).toBe('left');
195
195
 
196
196
  // Simulate viewport change: now not enough space on the right
197
197
  jest
@@ -204,7 +204,7 @@ describe('useDropdownAlignment', () => {
204
204
  observerCallback();
205
205
  });
206
206
 
207
- expect(result.current.alignRight).toBe(true);
207
+ expect(result.current.alignX).toBe('right');
208
208
  });
209
209
  });
210
210
  });
@@ -5,8 +5,8 @@ export const useDropdownAlignment = (
5
5
  dropdownRef: RefObject<HTMLElement | null>,
6
6
  isOpen: boolean
7
7
  ) => {
8
- const [alignRight, setAlignRight] = useState(false);
9
- const [alignUp, setAlignUp] = useState(false);
8
+ const [alignX, setAlignX] = useState<'left' | 'right'>('left');
9
+ const [alignY, setAlignY] = useState<'top' | 'bottom'>('bottom');
10
10
 
11
11
  const updateAlignment = useCallback(() => {
12
12
  if (containerRef.current && dropdownRef.current) {
@@ -15,8 +15,8 @@ export const useDropdownAlignment = (
15
15
  const dropdownHeight = dropdownRef.current.offsetHeight;
16
16
  const spaceOnRight = window.innerWidth - containerRect.left;
17
17
  const spaceBelow = window.innerHeight - containerRect.bottom;
18
- setAlignRight(spaceOnRight < dropdownWidth);
19
- setAlignUp(spaceBelow < dropdownHeight && containerRect.top > spaceBelow);
18
+ setAlignX(spaceOnRight < dropdownWidth ? 'right' : 'left');
19
+ setAlignY(spaceBelow < dropdownHeight && containerRect.top > spaceBelow ? 'top' : 'bottom');
20
20
  }
21
21
  }, [containerRef, dropdownRef]);
22
22
 
@@ -30,5 +30,5 @@ export const useDropdownAlignment = (
30
30
  return () => observer.disconnect();
31
31
  }, [isOpen, updateAlignment]);
32
32
 
33
- return { alignRight, alignUp };
33
+ return { alignX, alignY };
34
34
  };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-QeP_xz9v.js","sources":["../../../src/lib/hooks/useDropdownAlignment.ts","../../../src/lib/hooks/useEscapeKey.ts","../../../src/lib/components/searchableDropdown/index.tsx"],"sourcesContent":["import { RefObject, useCallback, useEffect, useState } from 'react';\n\nexport const useDropdownAlignment = (\n containerRef: RefObject<HTMLElement | null>,\n dropdownRef: RefObject<HTMLElement | null>,\n isOpen: boolean\n) => {\n const [alignRight, setAlignRight] = useState(false);\n const [alignUp, setAlignUp] = useState(false);\n\n const updateAlignment = useCallback(() => {\n if (containerRef.current && dropdownRef.current) {\n const containerRect = containerRef.current.getBoundingClientRect();\n const dropdownWidth = dropdownRef.current.offsetWidth;\n const dropdownHeight = dropdownRef.current.offsetHeight;\n const spaceOnRight = window.innerWidth - containerRect.left;\n const spaceBelow = window.innerHeight - containerRect.bottom;\n setAlignRight(spaceOnRight < dropdownWidth);\n setAlignUp(spaceBelow < dropdownHeight && containerRect.top > spaceBelow);\n }\n }, [containerRef, dropdownRef]);\n\n useEffect(() => {\n if (!isOpen) return;\n\n updateAlignment();\n\n const observer = new ResizeObserver(updateAlignment);\n observer.observe(document.documentElement);\n return () => observer.disconnect();\n }, [isOpen, updateAlignment]);\n\n return { alignRight, alignUp };\n};\n","import { useCallback, useEffect } from 'react';\n\nexport const useEscapeKey = (callback: () => void) => {\n const handleOnEscape = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n callback();\n }\n },\n [callback]\n );\n\n useEffect(() => {\n window.addEventListener('keydown', handleOnEscape);\n\n return () => window.removeEventListener('keydown', handleOnEscape);\n }, [handleOnEscape]);\n};\n","import { ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport classnames from 'classnames';\n\nimport { Input } from '../input';\nimport { ChevronDownIcon } from '../icon';\nimport { useDropdownAlignment } from '../../hooks/useDropdownAlignment';\nimport { useEscapeKey } from '../../hooks/useEscapeKey';\nimport { useOnClickOutside } from '../../hooks/useOnClickOutside';\nimport generateId from '../../util/generateId';\n\nimport styles from './style.module.scss';\n\nexport interface SearchableDropdownOption {\n id: string;\n label: string;\n icon?: ReactNode;\n}\n\nexport interface SearchableDropdownProps {\n options: SearchableDropdownOption[];\n value: string | null;\n onChange: (value: string) => void;\n searchable?: boolean;\n placeholder?: string;\n triggerPlaceholder?: string;\n noResultsText?: string;\n groupName?: string;\n dropUp?: boolean;\n condensed?: boolean;\n bordered?: boolean;\n showChevron?: boolean;\n disabled?: boolean;\n}\n\nexport const SearchableDropdown = ({\n options,\n value,\n onChange,\n searchable = false,\n placeholder = 'Search',\n triggerPlaceholder,\n noResultsText = 'No results found',\n groupName: groupNameProp,\n dropUp = false,\n condensed = false,\n bordered = false,\n showChevron = false,\n disabled = false,\n}: SearchableDropdownProps) => {\n const [isOpen, setIsOpen] = useState(false);\n const [searchTerm, setSearchTerm] = useState('');\n const [localValue, setLocalValue] = useState(value);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const optionRefs = useRef<Map<string, HTMLInputElement>>(new Map());\n const [groupName] = useState(() => groupNameProp ?? `sd-${generateId()}`);\n const dropdownId = `${groupName}-dropdown`;\n\n const closeAndRestoreFocus = useCallback(() => {\n setIsOpen(false);\n triggerRef.current?.focus();\n }, []);\n\n useOnClickOutside(containerRef, () => isOpen && closeAndRestoreFocus());\n useEscapeKey(\n useCallback(() => {\n if (isOpen) closeAndRestoreFocus();\n }, [isOpen, closeAndRestoreFocus])\n );\n\n const { alignRight, alignUp } = useDropdownAlignment(containerRef, dropdownRef, isOpen);\n\n useEffect(() => {\n if (isOpen && searchable && searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, [isOpen, searchable]);\n\n useEffect(() => {\n if (!isOpen) {\n setSearchTerm('');\n setLocalValue(value);\n }\n }, [isOpen, value]);\n\n const filteredOptions = useMemo(() => {\n if (!searchTerm) return options;\n return [...options]\n .filter((option) =>\n option.label.toLowerCase().includes(searchTerm.toLowerCase())\n )\n .sort((a, b) => {\n const term = searchTerm.toLowerCase();\n const aStartsWith = a.label.toLowerCase().startsWith(term);\n const bStartsWith = b.label.toLowerCase().startsWith(term);\n if (aStartsWith && !bStartsWith) return -1;\n if (!aStartsWith && bStartsWith) return 1;\n return 0;\n });\n }, [options, searchTerm]);\n\n const selectedOption = options.find((option) => option.id === value);\n\n const handleTriggerClick = () => {\n if (!disabled) setIsOpen(!isOpen);\n };\n\n const handleSearchKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n const target =\n e.key === 'ArrowDown'\n ? filteredOptions[0]\n : filteredOptions[filteredOptions.length - 1];\n if (target) {\n setLocalValue(target.id);\n optionRefs.current.get(target.id)?.focus();\n }\n } else if (e.key === 'Enter') {\n e.preventDefault();\n const target = filteredOptions[0];\n if (target) {\n onChange(target.id);\n closeAndRestoreFocus();\n }\n }\n };\n\n const handleOptionClick = (optionId: string) => {\n onChange(optionId);\n closeAndRestoreFocus();\n };\n\n const handleOptionRef = (optionId: string, el: HTMLInputElement | null) => {\n if (el) optionRefs.current.set(optionId, el);\n else optionRefs.current.delete(optionId);\n };\n\n const handleOptionKeyDown = (e: React.KeyboardEvent, optionId: string) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n const currentIndex = filteredOptions.findIndex(\n (o) => o.id === optionId\n );\n const nextIndex =\n e.key === 'ArrowDown'\n ? Math.min(currentIndex + 1, filteredOptions.length - 1)\n : Math.max(currentIndex - 1, 0);\n const next = filteredOptions[nextIndex];\n if (next) {\n setLocalValue(next.id);\n optionRefs.current.get(next.id)?.focus();\n }\n } else if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onChange(optionId);\n closeAndRestoreFocus();\n }\n };\n\n return (\n <div className={classnames(styles.container, { 'd-inline-block': condensed })} ref={containerRef}>\n <button\n ref={triggerRef}\n type=\"button\"\n className={classnames(\n 'd-flex ai-center jc-between w100 br8 bg-white c-pointer ta-left tc-neutral-900',\n styles.selectTrigger, {\n [styles.selectTriggerOpen]: isOpen,\n [styles.condensed]: condensed,\n [styles.bordered]: bordered,\n [styles.disabled]: disabled,\n }\n )}\n onClick={handleTriggerClick}\n disabled={disabled}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-controls={isOpen ? dropdownId : undefined}\n >\n <span className={'d-flex ai-center gap8'}>\n {selectedOption?.icon && (\n <span className={styles.optionIcon}>{selectedOption.icon}</span>\n )}\n {!condensed && (\n <span className=\"p-p\">\n {selectedOption?.label ?? triggerPlaceholder}\n </span>\n )}\n </span>\n {showChevron && (\n <ChevronDownIcon\n className={classnames('ml8', { [styles.chevronOpen]: isOpen })}\n size={20}\n noMargin\n color=\"neutral-600\"\n />\n )}\n </button>\n {isOpen && (\n <div\n id={dropdownId}\n ref={dropdownRef}\n className={classnames(\n styles.dropdown,\n 'bg-white br8 p8 d-flex fd-column',\n { [styles.dropdownUp]: dropUp || alignUp, [styles.dropdownRight]: alignRight }\n )}\n >\n {searchable && (\n <div className={classnames('pb8 bg-white', styles.searchContainer)}>\n <Input\n ref={searchInputRef}\n type=\"text\"\n placeholder={placeholder}\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n label={placeholder}\n hideLabel\n onKeyDown={handleSearchKeyDown}\n />\n </div>\n )}\n <div className={styles.optionList} role=\"radiogroup\" aria-label={groupName}>\n {filteredOptions.map((option) => (\n <div key={option.id} className={styles.optionWrapper}>\n <input\n type=\"radio\"\n id={`${groupName}-${option.id}`}\n name={groupName}\n value={option.id}\n checked={option.id === localValue}\n onChange={() => setLocalValue(option.id)}\n onClick={() => handleOptionClick(option.id)}\n tabIndex={option.id === localValue ? 0 : -1}\n className={styles.optionRadio}\n ref={(el) => handleOptionRef(option.id, el)}\n onKeyDown={(e) => handleOptionKeyDown(e, option.id)}\n />\n <label\n htmlFor={`${groupName}-${option.id}`}\n className={classnames(\n 'd-flex ai-center gap8 w100 br8 c-pointer ta-left tc-neutral-900',\n styles.option, {\n [styles.optionSelected]: option.id === localValue,\n })}\n >\n {option.icon && (\n <span className={styles.optionIcon}>{option.icon}</span>\n )}\n <span className=\"p-p\">{option.label}</span>\n </label>\n </div>\n ))}\n {filteredOptions.length === 0 && (\n <p className={`p-p tc-neutral-500 ${styles.noResults}`}>\n {noResultsText}\n </p>\n )}\n </div>\n </div>\n )}\n </div>\n );\n};\n"],"names":["_jsxs","classnames","_jsx"],"mappings":";;;;;;;;;;AAEO,IAAM,oBAAoB,GAAG,UAClC,YAA2C,EAC3C,WAA0C,EAC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