se-design 1.0.87-dev.2 → 1.0.87

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.
Files changed (295) hide show
  1. package/dist/components/Icon/index.d.ts +0 -5
  2. package/dist/components/InputWithTags/index.d.ts +2 -3
  3. package/dist/components/Tooltip/index.d.ts +1 -5
  4. package/dist/index112.js +1 -1
  5. package/dist/index112.js.map +1 -1
  6. package/dist/index113.js +2 -2
  7. package/dist/index113.js.map +1 -1
  8. package/dist/index114.js +1 -1
  9. package/dist/index114.js.map +1 -1
  10. package/dist/index115.js +2 -2
  11. package/dist/index115.js.map +1 -1
  12. package/dist/index116.js +1 -1
  13. package/dist/index116.js.map +1 -1
  14. package/dist/index117.js +1 -1
  15. package/dist/index117.js.map +1 -1
  16. package/dist/index118.js +2 -2
  17. package/dist/index118.js.map +1 -1
  18. package/dist/index119.js +1 -1
  19. package/dist/index119.js.map +1 -1
  20. package/dist/index120.js +2 -2
  21. package/dist/index120.js.map +1 -1
  22. package/dist/index121.js +1 -1
  23. package/dist/index121.js.map +1 -1
  24. package/dist/index122.js +1 -1
  25. package/dist/index122.js.map +1 -1
  26. package/dist/index123.js +1 -1
  27. package/dist/index123.js.map +1 -1
  28. package/dist/index124.js +1 -1
  29. package/dist/index124.js.map +1 -1
  30. package/dist/index125.js +2 -2
  31. package/dist/index125.js.map +1 -1
  32. package/dist/index126.js +1 -1
  33. package/dist/index126.js.map +1 -1
  34. package/dist/index127.js +2 -2
  35. package/dist/index127.js.map +1 -1
  36. package/dist/index128.js +2 -2
  37. package/dist/index128.js.map +1 -1
  38. package/dist/index129.js +1 -1
  39. package/dist/index129.js.map +1 -1
  40. package/dist/index130.js +2 -2
  41. package/dist/index130.js.map +1 -1
  42. package/dist/index131.js +2 -2
  43. package/dist/index131.js.map +1 -1
  44. package/dist/index132.js +1 -1
  45. package/dist/index132.js.map +1 -1
  46. package/dist/index133.js +1 -1
  47. package/dist/index133.js.map +1 -1
  48. package/dist/index134.js +1 -1
  49. package/dist/index134.js.map +1 -1
  50. package/dist/index135.js +2 -2
  51. package/dist/index135.js.map +1 -1
  52. package/dist/index136.js +2 -2
  53. package/dist/index136.js.map +1 -1
  54. package/dist/index137.js +2 -2
  55. package/dist/index137.js.map +1 -1
  56. package/dist/index138.js +1 -1
  57. package/dist/index138.js.map +1 -1
  58. package/dist/index139.js +1 -1
  59. package/dist/index139.js.map +1 -1
  60. package/dist/index140.js +1 -1
  61. package/dist/index140.js.map +1 -1
  62. package/dist/index141.js +1 -1
  63. package/dist/index141.js.map +1 -1
  64. package/dist/index142.js +1 -1
  65. package/dist/index142.js.map +1 -1
  66. package/dist/index143.js +1 -1
  67. package/dist/index143.js.map +1 -1
  68. package/dist/index144.js +1 -1
  69. package/dist/index144.js.map +1 -1
  70. package/dist/index145.js +1 -1
  71. package/dist/index145.js.map +1 -1
  72. package/dist/index146.js +2 -2
  73. package/dist/index146.js.map +1 -1
  74. package/dist/index147.js +2 -2
  75. package/dist/index147.js.map +1 -1
  76. package/dist/index148.js +1 -1
  77. package/dist/index148.js.map +1 -1
  78. package/dist/index149.js +1 -1
  79. package/dist/index149.js.map +1 -1
  80. package/dist/index150.js +1 -1
  81. package/dist/index150.js.map +1 -1
  82. package/dist/index151.js +1 -1
  83. package/dist/index151.js.map +1 -1
  84. package/dist/index152.js +1 -1
  85. package/dist/index152.js.map +1 -1
  86. package/dist/index153.js +1 -1
  87. package/dist/index153.js.map +1 -1
  88. package/dist/index154.js +1 -1
  89. package/dist/index154.js.map +1 -1
  90. package/dist/index155.js +2 -2
  91. package/dist/index155.js.map +1 -1
  92. package/dist/index156.js +1 -1
  93. package/dist/index156.js.map +1 -1
  94. package/dist/index157.js +2 -2
  95. package/dist/index157.js.map +1 -1
  96. package/dist/index158.js +2 -2
  97. package/dist/index158.js.map +1 -1
  98. package/dist/index159.js +2 -2
  99. package/dist/index159.js.map +1 -1
  100. package/dist/index16.js +107 -111
  101. package/dist/index16.js.map +1 -1
  102. package/dist/index160.js +2 -2
  103. package/dist/index160.js.map +1 -1
  104. package/dist/index161.js +1 -1
  105. package/dist/index161.js.map +1 -1
  106. package/dist/index162.js +1 -1
  107. package/dist/index162.js.map +1 -1
  108. package/dist/index163.js +1 -1
  109. package/dist/index163.js.map +1 -1
  110. package/dist/index164.js +1 -1
  111. package/dist/index164.js.map +1 -1
  112. package/dist/index165.js +1 -1
  113. package/dist/index165.js.map +1 -1
  114. package/dist/index166.js +1 -1
  115. package/dist/index166.js.map +1 -1
  116. package/dist/index167.js +1 -1
  117. package/dist/index167.js.map +1 -1
  118. package/dist/index168.js +1 -1
  119. package/dist/index168.js.map +1 -1
  120. package/dist/index169.js +1 -1
  121. package/dist/index169.js.map +1 -1
  122. package/dist/index170.js +1 -1
  123. package/dist/index170.js.map +1 -1
  124. package/dist/index171.js +1 -1
  125. package/dist/index171.js.map +1 -1
  126. package/dist/index172.js +1 -1
  127. package/dist/index172.js.map +1 -1
  128. package/dist/index173.js +1 -1
  129. package/dist/index173.js.map +1 -1
  130. package/dist/index174.js +1 -1
  131. package/dist/index174.js.map +1 -1
  132. package/dist/index175.js +1 -1
  133. package/dist/index175.js.map +1 -1
  134. package/dist/index176.js +1 -1
  135. package/dist/index176.js.map +1 -1
  136. package/dist/index177.js +1 -1
  137. package/dist/index177.js.map +1 -1
  138. package/dist/index178.js +1 -1
  139. package/dist/index178.js.map +1 -1
  140. package/dist/index179.js +1 -1
  141. package/dist/index179.js.map +1 -1
  142. package/dist/index180.js +1 -1
  143. package/dist/index180.js.map +1 -1
  144. package/dist/index181.js +1 -1
  145. package/dist/index181.js.map +1 -1
  146. package/dist/index182.js +1 -1
  147. package/dist/index182.js.map +1 -1
  148. package/dist/index183.js +1 -1
  149. package/dist/index183.js.map +1 -1
  150. package/dist/index184.js +1 -1
  151. package/dist/index184.js.map +1 -1
  152. package/dist/index185.js +2 -2
  153. package/dist/index185.js.map +1 -1
  154. package/dist/index186.js +2 -2
  155. package/dist/index186.js.map +1 -1
  156. package/dist/index187.js +1 -1
  157. package/dist/index187.js.map +1 -1
  158. package/dist/index188.js +1 -1
  159. package/dist/index188.js.map +1 -1
  160. package/dist/index189.js +2 -2
  161. package/dist/index189.js.map +1 -1
  162. package/dist/index190.js +2 -2
  163. package/dist/index190.js.map +1 -1
  164. package/dist/index191.js +1 -1
  165. package/dist/index191.js.map +1 -1
  166. package/dist/index192.js +1 -1
  167. package/dist/index192.js.map +1 -1
  168. package/dist/index193.js +1 -1
  169. package/dist/index193.js.map +1 -1
  170. package/dist/index194.js +1 -1
  171. package/dist/index194.js.map +1 -1
  172. package/dist/index195.js +1 -1
  173. package/dist/index195.js.map +1 -1
  174. package/dist/index196.js +1 -1
  175. package/dist/index196.js.map +1 -1
  176. package/dist/index197.js +1 -1
  177. package/dist/index197.js.map +1 -1
  178. package/dist/index198.js +1 -1
  179. package/dist/index198.js.map +1 -1
  180. package/dist/index199.js +1 -1
  181. package/dist/index199.js.map +1 -1
  182. package/dist/index200.js +2 -2
  183. package/dist/index200.js.map +1 -1
  184. package/dist/index201.js +2 -2
  185. package/dist/index201.js.map +1 -1
  186. package/dist/index202.js +2 -2
  187. package/dist/index202.js.map +1 -1
  188. package/dist/index203.js +149 -2
  189. package/dist/index203.js.map +1 -1
  190. package/dist/index204.js +9 -149
  191. package/dist/index204.js.map +1 -1
  192. package/dist/index205.js +5 -8
  193. package/dist/index205.js.map +1 -1
  194. package/dist/index206.js +4 -5
  195. package/dist/index206.js.map +1 -1
  196. package/dist/index207.js +1 -1
  197. package/dist/{index225.js → index224.js} +1 -1
  198. package/dist/{index225.js.map → index224.js.map} +1 -1
  199. package/dist/index23.js +16 -16
  200. package/dist/index23.js.map +1 -1
  201. package/dist/{index233.js → index232.js} +1 -1
  202. package/dist/{index233.js.map → index232.js.map} +1 -1
  203. package/dist/{index236.js → index235.js} +1 -1
  204. package/dist/{index236.js.map → index235.js.map} +1 -1
  205. package/dist/index244.js +173 -0
  206. package/dist/index244.js.map +1 -0
  207. package/dist/index245.js +3 -169
  208. package/dist/index245.js.map +1 -1
  209. package/dist/index247.js +22 -0
  210. package/dist/index247.js.map +1 -0
  211. package/dist/index248.js +9 -18
  212. package/dist/index248.js.map +1 -1
  213. package/dist/index249.js +9 -9
  214. package/dist/index249.js.map +1 -1
  215. package/dist/index25.js +1 -2
  216. package/dist/index25.js.map +1 -1
  217. package/dist/index250.js +4 -9
  218. package/dist/index250.js.map +1 -1
  219. package/dist/index251.js +170 -5
  220. package/dist/index251.js.map +1 -1
  221. package/dist/index252.js +11 -170
  222. package/dist/index252.js.map +1 -1
  223. package/dist/index253.js +6 -11
  224. package/dist/index253.js.map +1 -1
  225. package/dist/index254.js +5 -5
  226. package/dist/index254.js.map +1 -1
  227. package/dist/index255.js +37 -5
  228. package/dist/index255.js.map +1 -1
  229. package/dist/index256.js +2 -38
  230. package/dist/index256.js.map +1 -1
  231. package/dist/index257.js +8 -2
  232. package/dist/index257.js.map +1 -1
  233. package/dist/index258.js +326 -7
  234. package/dist/index258.js.map +1 -1
  235. package/dist/index259.js +47 -324
  236. package/dist/index259.js.map +1 -1
  237. package/dist/index260.js +2 -50
  238. package/dist/index260.js.map +1 -1
  239. package/dist/index261.js +76 -2
  240. package/dist/index261.js.map +1 -1
  241. package/dist/index262.js +82 -65
  242. package/dist/index262.js.map +1 -1
  243. package/dist/index263.js +48 -89
  244. package/dist/index263.js.map +1 -1
  245. package/dist/index264.js +7 -51
  246. package/dist/index264.js.map +1 -1
  247. package/dist/index265.js +4 -7
  248. package/dist/index265.js.map +1 -1
  249. package/dist/index266.js +51 -4
  250. package/dist/index266.js.map +1 -1
  251. package/dist/index267.js +2 -52
  252. package/dist/index267.js.map +1 -1
  253. package/dist/index268.js +2 -2
  254. package/dist/index29.js +1 -1
  255. package/dist/index30.js +1 -1
  256. package/dist/index33.js +1 -1
  257. package/dist/index35.js +1 -1
  258. package/dist/index36.js +1 -1
  259. package/dist/index37.js +40 -54
  260. package/dist/index37.js.map +1 -1
  261. package/dist/index38.js +162 -163
  262. package/dist/index38.js.map +1 -1
  263. package/dist/index39.js +51 -55
  264. package/dist/index39.js.map +1 -1
  265. package/dist/index4.js +61 -66
  266. package/dist/index4.js.map +1 -1
  267. package/dist/index40.js +1 -1
  268. package/dist/index45.js +38 -39
  269. package/dist/index45.js.map +1 -1
  270. package/dist/index46.js +51 -52
  271. package/dist/index46.js.map +1 -1
  272. package/dist/index49.js +1 -1
  273. package/dist/index51.js +1 -1
  274. package/dist/index52.js +1 -1
  275. package/dist/index53.js +1 -1
  276. package/dist/index57.js +1 -1
  277. package/dist/index6.js +299 -305
  278. package/dist/index6.js.map +1 -1
  279. package/dist/index61.js +1 -1
  280. package/dist/index63.js +1 -1
  281. package/dist/index65.js +1 -1
  282. package/dist/index7.js +1 -1
  283. package/dist/index79.js +1 -1
  284. package/dist/index81.js +7 -9
  285. package/dist/index81.js.map +1 -1
  286. package/dist/index9.js +20 -20
  287. package/dist/index9.js.map +1 -1
  288. package/package.json +1 -1
  289. package/dist/assets/icons/cloud-check.svg +0 -4
  290. package/dist/index223.js +0 -8
  291. package/dist/index223.js.map +0 -1
  292. package/dist/index246.js +0 -7
  293. package/dist/index246.js.map +0 -1
  294. package/dist/index269.js +0 -5
  295. package/dist/index269.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index25.js","sources":["../src/components/Dropdown/index.tsx"],"sourcesContent":["import React, { FC, useState, useRef, useEffect, useLayoutEffect } from 'react';\n\nimport { Popover, PopoverHandle } from 'src/components/Popover';\nimport { Icon } from 'components/Icon';\nimport { Checkbox } from '../Checkbox';\nimport { Button } from '../Button';\nimport { InputWithIcon } from '../InputWithIcon';\nimport { useStableId } from '../../utils/useStableId';\nimport { useCombobox } from '../../utils/a11y/useCombobox';\nimport { getFocusableElements } from '../../utils/a11y';\nimport { announce } from '../../utils/a11y/liveAnnouncer/LiveAnnouncer';\n\ntype DropdownValue = {\n [key: string]: any;\n};\n\ntype DropdownProps = {\n label?: string;\n firstOptionAsHeading?: boolean;\n ariaLabel?: string;\n ariaLabelledBy?: string;\n type: 'select' | 'multi-select';\n dropDownOptions?: DropdownValue[];\n defaultText?: string;\n selectBy?: string;\n optionsUniqueBy?: string;\n displaySelected?: boolean;\n defaultSelectedValue?: DropdownValue | DropdownValue[];\n customSelectedValue?: string;\n onOptionClick?: (selectedValue: DropdownValue) => void;\n style?: React.CSSProperties;\n renderOptionChip?: (option: DropdownValue, srcOption: boolean) => React.ReactNode;\n className?: string;\n iconColor?: string;\n disabled?: boolean;\n dropdownClassName?: string;\n hasError?: boolean;\n errorMessage?: string;\n onApply?: (selectedValue: DropdownValue[]) => void;\n onClear?: () => void;\n customDropdownContent?: () => React.ReactNode;\n isBorderless?: boolean;\n dropDownSrcAutomationId?: string;\n dropDownSelectAutomationId?: string;\n dropDownContentAutomationId?: string;\n shouldShowSearch?: boolean;\n showSearchIcon?: boolean;\n searchPlaceholder?: string;\n searchResultEmptyMessage?: string;\n /** Controlled selection — when provided, Dropdown won't manage internal selected state */\n selectedValue?: DropdownValue | DropdownValue[];\n /** Controlled open state — when provided, Dropdown won't manage internal open/close */\n isOpen?: boolean;\n /** Callback when open state changes (fires in both controlled and uncontrolled modes) */\n onOpenChange?: (isOpen: boolean) => void;\n /** Custom trigger element — replaces the default bordered div + chevron */\n renderSrcElement?: (props: { isOpen: boolean; selectedValue: DropdownValue[] }) => React.ReactNode;\n /** Render the dropdown panel in a portal (document.body) to escape overflow:hidden containers */\n isWithPortal?: boolean;\n /** Optional ref that will be populated with the Popover wrapper element on mount.\n * Use with setFocusAnchor() to return focus to the dropdown trigger after a modal closes. */\n popoverElementRef?: React.RefObject<HTMLElement | null>;\n /** Inline styles forwarded to the Popover content (portal or inline). Useful for min-width overrides. */\n popoverContentStyleProperty?: React.CSSProperties;\n};\n\nexport const Dropdown: FC<DropdownProps> = (props) => {\n const isControlledSelection = props.selectedValue !== undefined;\n const isControlledOpen = props.isOpen !== undefined;\n\n const [internalIsOpen, setInternalIsOpen] = useState(false);\n const [searchQuery, setSearchQuery] = useState('');\n const [internalSelectedValues, setInternalSelectedValues] = useState<DropdownValue[]>(() =>\n props?.defaultSelectedValue\n ? Array.isArray(props?.defaultSelectedValue)\n ? props?.defaultSelectedValue\n : [props.defaultSelectedValue]\n : []\n );\n const popoverRef = useRef<HTMLDivElement & PopoverHandle>(null);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const labelId = useStableId(undefined, 'dropdown-label');\n const valueId = useStableId(undefined, 'dropdown-value');\n const listboxId = useStableId(undefined, 'dropdown-listbox');\n\n // Derived state: controlled props take precedence over internal state\n const isDropDownOpen = isControlledOpen ? props.isOpen! : internalIsOpen;\n const selectedDropDownValues = isControlledSelection\n ? (Array.isArray(props.selectedValue) ? props.selectedValue : props.selectedValue ? [props.selectedValue] : [])\n : internalSelectedValues;\n\n const setIsDropDownOpen = (value: boolean) => {\n if (!isControlledOpen) {\n setInternalIsOpen(value);\n }\n props.onOpenChange?.(value);\n };\n\n const setSelectedDropDownValues = (values: DropdownValue[]) => {\n if (!isControlledSelection) {\n setInternalSelectedValues(values);\n }\n };\n\n const {\n selectBy = '',\n optionsUniqueBy = '',\n displaySelected = false,\n dropDownOptions,\n defaultText = 'Select',\n iconColor = 'var(--color-gray-700)',\n disabled = false,\n dropdownClassName = '',\n hasError = false,\n errorMessage = '',\n customDropdownContent = null,\n isBorderless = false,\n shouldShowSearch = false,\n showSearchIcon = true,\n searchPlaceholder = 'Search...',\n searchResultEmptyMessage = 'No results found',\n ariaLabel = '',\n customSelectedValue = '',\n isWithPortal = false,\n firstOptionAsHeading = false\n } = props;\n\n useEffect(() => {\n if (!isControlledSelection) {\n const newValues = props?.defaultSelectedValue\n ? Array.isArray(props?.defaultSelectedValue)\n ? props?.defaultSelectedValue\n : [props.defaultSelectedValue]\n : [];\n setInternalSelectedValues(newValues);\n }\n }, [props?.defaultSelectedValue, isControlledSelection]);\n\n useEffect(() => {\n if (!isDropDownOpen) {\n setSearchQuery('');\n }\n }, [isDropDownOpen]);\n\n // Focus search input when dropdown opens with search enabled\n useEffect(() => {\n if (isDropDownOpen && shouldShowSearch && searchInputRef.current) {\n requestAnimationFrame(() => searchInputRef.current?.focus());\n }\n }, [isDropDownOpen, shouldShowSearch]);\n\n // Populate caller's popoverElementRef with the Popover wrapper element.\n // Runs after mount so popoverRef.current is set.\n useLayoutEffect(() => {\n if (props.popoverElementRef) {\n props.popoverElementRef.current = popoverRef.current?.element ?? null;\n }\n });\n\n const isMultiSelect = props?.type === 'multi-select';\n\n // Sentinel item for empty state — enables keyboard navigation to \"No results found\"\n const NO_RESULTS_SENTINEL: DropdownValue = { __noResults: true, id: '__no_results__', value: '__no_results__' };\n const isNoResultsSentinel = (item: DropdownValue) => !!item?.__noResults;\n\n const getFilteredOptions = () => {\n if (!searchQuery.trim()) {\n return dropDownOptions || [];\n }\n return (dropDownOptions || []).filter((option) => {\n const optionValue = option?.[selectBy]?.toString().toLowerCase() || '';\n return optionValue.includes(searchQuery.toLowerCase());\n });\n };\n\n const handleDropDownOptionClick = (dropDownOption: any) => {\n setSelectedDropDownValues([dropDownOption]);\n setIsDropDownOpen(false);\n props?.onOptionClick?.(dropDownOption);\n // Restore focus to the trigger after portal unmounts.\n // Double rAF ensures this runs after React re-renders AND the focus trap safety net,\n // getting the final say on focus.\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n popoverRef.current?.focusTrigger();\n });\n });\n };\n\n // Use useCombobox hook for keyboard navigation (only for single-select)\n const filteredOptions = getFilteredOptions();\n const showEmptyState = filteredOptions.length === 0 && (searchQuery.trim() || dropDownOptions?.length === 0);\n // Inject sentinel so arrow keys can reach \"No results found\"\n const singleSelectItems = !isMultiSelect\n ? (filteredOptions.length > 0 ? filteredOptions : (showEmptyState ? [NO_RESULTS_SENTINEL] : []))\n : [];\n const multiSelectItems = isMultiSelect\n ? (filteredOptions.length > 0 ? filteredOptions : (showEmptyState ? [NO_RESULTS_SENTINEL] : []))\n : [];\n\n const {\n listboxProps,\n getOptionProps,\n highlightedIndex,\n setHighlightedIndex,\n containerProps: comboboxContainerProps,\n inputProps: comboboxInputProps,\n isKeyboardFocused: isSingleSelectKeyboardFocused\n } = useCombobox({\n items: singleSelectItems,\n isOpen: isDropDownOpen && !isMultiSelect,\n onOpenChange: setIsDropDownOpen,\n onSelect: (item: DropdownValue) => {\n handleDropDownOptionClick(item);\n },\n listboxId,\n disabled: isMultiSelect || disabled,\n hasItems: singleSelectItems.length > 0,\n isItemDisabled: isNoResultsSentinel\n });\n\n // Second useCombobox for multi-select: provides ARIA props, keyboard navigation, and auto-scroll.\n // Enter/Space are intercepted in multiSelectOnKeyDown to avoid the hook's highlight reset after select.\n const {\n inputProps: multiSelectComboboxInputProps,\n listboxProps: multiSelectListboxProps,\n containerProps: multiSelectContainerProps,\n highlightedIndex: highlightedMultiSelectIndex,\n setHighlightedIndex: setHighlightedMultiSelectIndex,\n isKeyboardFocused: isMultiSelectKeyboardFocused\n } = useCombobox({\n items: multiSelectItems,\n isOpen: isDropDownOpen && isMultiSelect,\n onOpenChange: setIsDropDownOpen,\n onSelect: () => {},\n listboxId,\n disabled: !isMultiSelect,\n loop: false,\n hasItems: multiSelectItems.length > 0,\n closeOnTab: false,\n isItemDisabled: isNoResultsSentinel\n });\n\n // Announce empty state for screen readers — only when arrow keys haven't reached it yet.\n // Once highlighted (aria-activedescendant), the screen reader reads it directly.\n const activeHighlight = isMultiSelect ? highlightedMultiSelectIndex : highlightedIndex;\n useEffect(() => {\n if (isDropDownOpen && filteredOptions.length === 0 && (searchQuery.trim() || dropDownOptions?.length === 0) && activeHighlight === -1) {\n announce(searchResultEmptyMessage, { assertiveness: 'polite', batchId: 'dropdown-empty-state', delay: 300 });\n }\n }, [filteredOptions.length, isDropDownOpen, searchQuery, dropDownOptions?.length, activeHighlight]);\n\n const getSelectedDropDownValue = (option: DropdownValue, isSrcOption: boolean = false) => {\n if (isMultiSelect) {\n return defaultText;\n }\n\n // if custom selected value is provided, use it instead of the option value\n if (isSrcOption && customSelectedValue) {\n return customSelectedValue;\n }\n\n return option?.[selectBy] || defaultText;\n };\n\n const clearSelectedDropDownValues = () => {\n setSelectedDropDownValues([]);\n props?.onClear?.();\n };\n\n const optionChip = (option: DropdownValue, srcOption: boolean = false) => {\n if (props?.renderOptionChip) {\n return props?.renderOptionChip(option, srcOption);\n }\n\n if (isMultiSelect && selectedDropDownValues?.length > 0) {\n const firstSelectedLabel = selectedDropDownValues[0]?.[selectBy] || '';\n const remainingCount = selectedDropDownValues.length - 1;\n\n // For multiple selections: text takes remaining space, count takes minimum space needed\n return (\n <div className={`option-chip flex items-center w-full`}>\n <div\n className={`${remainingCount > 0 ? 'w-full' : 'flex-1'} truncate`}\n >{`${defaultText}: ${firstSelectedLabel}`}</div>\n {remainingCount > 0 && <div className=\"flex-shrink-0\">+{remainingCount}</div>}\n </div>\n );\n }\n\n const selectedLabel = getSelectedDropDownValue(option, srcOption);\n const hasVisibleLabel = !!props?.label || !!props?.ariaLabelledBy;\n const showPrefix = srcOption && defaultText && option?.[selectBy] && !customSelectedValue && !hasVisibleLabel;\n\n return (\n <p className={`option-chip flex flex-1 items-center justify-between`}>\n {showPrefix ? `${defaultText}: ${selectedLabel}` : selectedLabel}\n </p>\n );\n };\n\n const renderSearchInput = (extraInputProps: Record<string, any>) => (\n <div className=\" w-full relative flex items-center border-b border-[var(--color-gray-300)]\">\n <InputWithIcon\n leftIcon={showSearchIcon ? { name: 'search', position: 'left', style: { color: 'var(--color-gray-500)' } } : undefined}\n value={searchQuery}\n onChange={(value) => setSearchQuery(value)}\n placeholder={searchPlaceholder}\n style={{ margin: 0, gap: 0 }}\n inputStyle={{ width: '100%', border: 'none', outline: 'none' }}\n automationId=\"se-design-dropdown-search\"\n ariaLabel={searchPlaceholder}\n inputRef={searchInputRef}\n inputProps={extraInputProps}\n />\n </div>\n );\n\n const renderSearchBar = () => {\n if (isMultiSelect) {\n return renderSearchInput({\n ...multiSelectComboboxInputProps,\n onKeyDown: (e: React.KeyboardEvent) => multiSelectOnKeyDown(e, true)\n });\n }\n\n // Single-select: wrap onKeyDown to add Escape → focusTrigger (portal-safe)\n return renderSearchInput({\n ...comboboxInputProps,\n onKeyDown: (e: React.KeyboardEvent) => {\n comboboxInputProps.onKeyDown(e);\n if (e.key === 'Escape') {\n requestAnimationFrame(() => popoverRef.current?.focusTrigger());\n }\n }\n });\n };\n\n const dropDownOptionJsx = (dropDownOption: DropdownValue, index: number) => {\n const optionTxt = dropDownOption[selectBy];\n const dropDownSelectedValue = selectedDropDownValues[0]?.[selectBy] || defaultText;\n const selectByUniqueId = optionsUniqueBy?.length\n ? dropDownOption[optionsUniqueBy] == selectedDropDownValues[0]?.[optionsUniqueBy]\n : true;\n const isOptionSelected = displaySelected && optionTxt === dropDownSelectedValue && selectByUniqueId;\n const isHighlighted = highlightedIndex === index;\n const optionProps = !isMultiSelect ? getOptionProps(index, isOptionSelected) : {};\n\n return (\n <div\n key={dropDownOption.id || dropDownOption.value}\n className={`option break-words px-3 py-2 hover:bg-[var(--color-gray-100)] cursor-pointer select-none flex items-center justify-between ${\n isOptionSelected ? 'selected' : ''\n } ${isHighlighted ? `bg-[var(--color-gray-100)]${isSingleSelectKeyboardFocused ? ' outline outline-[length:var(--focus-width)] -outline-offset-2 outline-[var(--focus-color)]' : ''}` : ''}`}\n onClick={() => handleDropDownOptionClick(dropDownOption)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleDropDownOptionClick(dropDownOption);\n } else if (e.key === 'Escape') {\n requestAnimationFrame(() => popoverRef.current?.focusTrigger());\n }\n }}\n tabIndex={-1}\n data-automation-id={`dropdown-option-${dropDownOption?.automationId || index}`}\n {...optionProps}\n aria-selected={isOptionSelected ? 'true' : 'false'}\n >\n {optionChip({ ...dropDownOption, isOptionSelected }, false)}\n {isOptionSelected && <Icon name=\"checkmark\" stroke={iconColor} />}\n </div>\n );\n };\n\n const emptyStateOption = (currentHighlightedIndex: number, keyboardFocused: boolean, isMulti: boolean) => (\n <div\n {...(!isMulti ? getOptionProps(0, false) : { id: `${listboxId}-option-0`, role: 'option', 'aria-disabled': true })}\n className={`px-3 py-4 text-center text-[var(--color-gray-700)] text-sm${currentHighlightedIndex === 0 ? ` bg-[var(--color-gray-100)]${keyboardFocused ? ' outline outline-[length:var(--focus-width)] -outline-offset-2 outline-[var(--focus-color)]' : ''}` : ''}`}\n >\n {searchResultEmptyMessage}\n </div>\n );\n\n const renderDropdownContents = () => {\n return (\n <>\n {props?.label && firstOptionAsHeading && (\n <div\n aria-hidden=\"true\"\n className=\"px-3 pt-2 pb-1 text-[var(--color-gray-650)] text-xs cursor-default select-none\"\n >\n {props.label}\n </div>\n )}\n {shouldShowSearch && renderSearchBar()}\n <div\n className={`dropdown-content dropdown-options${shouldShowSearch ? '' : ' flex flex-col max-h-80 overflow-y-auto'}`}\n {...(shouldShowSearch ? {} : {\n ...listboxProps,\n 'aria-label': `${defaultText} options`,\n style: { outline: 'none' },\n tabIndex: -1,\n 'aria-activedescendant': comboboxInputProps['aria-activedescendant'],\n onKeyDown: (e: React.KeyboardEvent) => {\n comboboxContainerProps.onKeyDownCapture?.(e as React.KeyboardEvent<HTMLElement>);\n if (e.key === ' ') {\n e.preventDefault();\n if (highlightedIndex >= 0 && filteredOptions[highlightedIndex]) {\n handleDropDownOptionClick(filteredOptions[highlightedIndex]);\n }\n return;\n }\n comboboxInputProps.onKeyDown(e);\n },\n onFocus: () => {\n if (highlightedIndex === -1 && singleSelectItems.length > 0) {\n setHighlightedIndex(0);\n }\n }\n })}\n >\n {shouldShowSearch ? (\n <div\n className=\"flex flex-col max-h-80 overflow-y-auto\"\n aria-label={`${defaultText} options`}\n {...listboxProps}\n >\n {filteredOptions.length > 0 ? (\n filteredOptions.map((dropDownOption, index) => dropDownOptionJsx(dropDownOption, index))\n ) : (\n emptyStateOption(highlightedIndex, isSingleSelectKeyboardFocused, false)\n )}\n </div>\n ) : (\n filteredOptions.length > 0 ? (\n filteredOptions.map((dropDownOption, index) => dropDownOptionJsx(dropDownOption, index))\n ) : (\n emptyStateOption(highlightedIndex, isSingleSelectKeyboardFocused, false)\n )\n )}\n </div>\n </>\n );\n };\n\n const handleMultiSelectDropdownOptionClick = (isSelected: boolean, dropDownOption: DropdownValue) => {\n let newSelectedDropDownValues: DropdownValue[] = [];\n if (isSelected) {\n newSelectedDropDownValues = [...selectedDropDownValues, dropDownOption];\n } else {\n newSelectedDropDownValues = selectedDropDownValues?.filter(\n (option) => option[optionsUniqueBy] !== dropDownOption[optionsUniqueBy]\n );\n }\n setSelectedDropDownValues(newSelectedDropDownValues);\n };\n\n const handleApplySelectedDropDownValues = () => {\n popoverRef.current?.togglePopover();\n popoverRef.current?.focusTrigger();\n props?.onApply?.(selectedDropDownValues);\n };\n\n // Wraps the multi-select useCombobox's onKeyDown.\n // - Intercepts Enter/Space to toggle selection without resetting the highlight\n // (the hook resets highlightedIndex to -1 after onSelect, which is wrong for multi-select).\n // - When isSearchInput is true, Space is left for typing.\n // - Adds focusTrigger on Escape (Popover's handler is unreliable for portals).\n const multiSelectOnKeyDown = (e: React.KeyboardEvent, isSearchInput: boolean = false) => {\n if (isSearchInput && e.key === ' ') return;\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n if (highlightedMultiSelectIndex >= 0 && highlightedMultiSelectIndex < filteredOptions.length) {\n const option = filteredOptions[highlightedMultiSelectIndex];\n const isSelected = selectedDropDownValues.some(\n (v) => v[optionsUniqueBy] === option[optionsUniqueBy]\n );\n handleMultiSelectDropdownOptionClick(!isSelected, option);\n }\n return;\n }\n\n multiSelectComboboxInputProps.onKeyDown(e);\n\n if (e.key === 'Escape') {\n e.stopPropagation();\n requestAnimationFrame(() => popoverRef.current?.focusTrigger());\n }\n };\n\n const multiSelectDropdownOptionJSX = (dropDownOption: DropdownValue, index: number) => {\n const isOptionSelected = selectedDropDownValues.some(\n (option) => option[optionsUniqueBy] === dropDownOption[optionsUniqueBy]\n );\n const optionId = `${listboxId}-option-${index}`;\n const isHighlighted = highlightedMultiSelectIndex === index;\n\n return (\n <div\n key={dropDownOption.id || dropDownOption.value}\n id={optionId}\n role=\"option\"\n aria-selected={isOptionSelected}\n className={`option px-3 py-2 hover:bg-[var(--color-gray-100)] cursor-pointer select-none flex items-center gap-2 ${\n isHighlighted ? `bg-[var(--color-gray-100)]${isMultiSelectKeyboardFocused ? ' outline outline-[length:var(--focus-width)] -outline-offset-2 outline-[var(--focus-color)]' : ''}` : ''\n }`}\n tabIndex={-1}\n onClick={() => handleMultiSelectDropdownOptionClick(!isOptionSelected, dropDownOption)}\n data-automation-id={`dropdown-option-${dropDownOption?.automationId || index}`}\n >\n <Checkbox\n tabIndex={-1}\n ariaHidden\n checked={isOptionSelected}\n onChange={() => {}}\n className=\"pointer-events-none\"\n />\n <span className=\"checkbox-label\">{dropDownOption?.label}</span>\n </div>\n );\n };\n\n const renderMultiSelectDropdownContents = () => {\n return (\n <div\n onKeyDown={(e) => {\n // Stop all Tab events from reaching Popover's handlePopoverContentKeyDown (which closes on Tab).\n // Tab flow is managed by the footer onKeyDown: forward Tab from Apply closes and advances\n // focus past trigger; Shift+Tab returns to search/listbox.\n if (e.key === 'Tab') {\n e.stopPropagation();\n }\n }}\n >\n {shouldShowSearch && renderSearchBar()}\n <div\n className={`dropdown-content dropdown-options${shouldShowSearch ? '' : ' flex flex-col max-h-80 overflow-y-auto'}`}\n {...(shouldShowSearch ? {} : {\n ...multiSelectListboxProps,\n 'aria-label': `${defaultText} options`,\n 'aria-multiselectable': 'true',\n style: { outline: 'none' },\n tabIndex: -1,\n 'aria-activedescendant': multiSelectComboboxInputProps['aria-activedescendant'],\n onKeyDown: (e: React.KeyboardEvent) => multiSelectOnKeyDown(e, false),\n onFocus: () => {\n if (highlightedMultiSelectIndex === -1 && multiSelectItems.length > 0) {\n setHighlightedMultiSelectIndex(0);\n }\n }\n })}\n >\n {shouldShowSearch ? (\n <div\n className=\"flex flex-col max-h-80 overflow-y-auto\"\n {...multiSelectListboxProps}\n aria-label={`${defaultText} options`}\n aria-multiselectable=\"true\"\n >\n {filteredOptions.length > 0 ? (\n filteredOptions.map((dropDownOption, index) => multiSelectDropdownOptionJSX(dropDownOption, index))\n ) : (\n emptyStateOption(highlightedMultiSelectIndex, isMultiSelectKeyboardFocused, true)\n )}\n </div>\n ) : (\n filteredOptions.length > 0 ? (\n filteredOptions.map((dropDownOption, index) => multiSelectDropdownOptionJSX(dropDownOption, index))\n ) : (\n emptyStateOption(highlightedMultiSelectIndex, isMultiSelectKeyboardFocused, true)\n )\n )}\n </div>\n <div\n className=\"flex items-center justify-end gap-4 p-3 border-t border-[var(--color-gray-200)]\"\n onKeyDown={(e) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Home' || e.key === 'End') {\n // Stop arrow keys from reaching Popover's handleArrowKeyNavigation\n // which would move focus out of the CTA buttons back into options\n e.stopPropagation();\n return;\n }\n if (e.key === 'Tab' && !e.shiftKey) {\n // Forward Tab from Apply — close dropdown and advance focus past trigger.\n // The wrapper stopPropagation blocks Popover's Tab handler, so we replicate\n // its portal-safe focus advance here (Popover lines 559-569).\n const applyEl = e.currentTarget.querySelector('[data-automation-id=\"se-design-dropdown-apply-button\"]');\n if (document.activeElement === applyEl) {\n e.stopPropagation();\n popoverRef.current?.togglePopover();\n if (isWithPortal) {\n // Portal: manually advance focus past trigger (portal Tab order is wrong)\n e.preventDefault();\n const srcEl = popoverRef.current?.element;\n const focusables = getFocusableElements({ container: document.body, filterHidden: true });\n const idx = srcEl ? focusables.indexOf(srcEl) : -1;\n const next = focusables[idx + 1];\n if (next) (next as HTMLElement).focus();\n else (srcEl as HTMLElement)?.focus();\n }\n // Non-portal: togglePopover closes, browser Tab naturally advances focus\n }\n } else if (e.key === 'Tab' && e.shiftKey) {\n e.preventDefault();\n e.stopPropagation();\n if (shouldShowSearch) {\n searchInputRef.current?.focus();\n } else {\n multiSelectListboxProps.ref.current?.focus();\n }\n }\n }}\n >\n <Button label=\"Clear\" type=\"link\" size=\"sm\" onClick={clearSelectedDropDownValues} automationId=\"se-design-dropdown-clear-button\" />\n <Button label=\"Apply\" type=\"primary\" size=\"sm\" onClick={handleApplySelectedDropDownValues} automationId=\"se-design-dropdown-apply-button\" />\n </div>\n </div>\n );\n };\n\n const renderDropdownSelect = () => {\n const borderColor = isDropDownOpen\n ? 'border-[var(--color-blue-500)]'\n : disabled\n ? 'border-[var(--color-gray-300)]'\n : 'border-[var(--color-gray-600)]';\n const errorBorderColor = hasError ? 'border-[var(--color-red-500)]' : '';\n const dropDownSelectClass = `dropdown-src-element bg-[var(--color-white)] flex px-3 py-2 ${\n isBorderless ? 'border-0' : `border rounded-md ${errorBorderColor ? errorBorderColor : borderColor}`\n } flex items-center ${dropdownClassName}`;\n\n return (\n <div className={dropDownSelectClass}>\n <div\n id={valueId}\n className=\"flex-1 min-w-0\"\n data-automation-id={props?.dropDownSelectAutomationId || 'selected-dropdown-value'}\n >\n {optionChip(selectedDropDownValues[0], true)}\n </div>\n <div className=\"flex-shrink-0 ml-2\" aria-hidden=\"true\">\n <Icon\n name={'chevron'}\n rotation={isDropDownOpen ? '180' : '0'}\n className={`transition-transform`}\n stroke={iconColor}\n />\n </div>\n </div>\n );\n };\n\n const getDropdownAriaLabel = () => {\n const selectedLabel = selectedDropDownValues[0]?.[selectBy];\n if (ariaLabel && selectedLabel) {\n return `${ariaLabel}, ${selectedLabel}`;\n }\n return ariaLabel || defaultText || 'Select option';\n };\n\n // Trigger is always a button that reveals a listbox popup (Select/Listbox pattern).\n // For search-enabled dropdowns, the combobox role lives on the search input inside the popup.\n // This matches React Aria (useSelect), Radix (Select), and Headless UI (Listbox) — all use\n // role=\"button\" with real focus on options, separate from their Combobox components.\n const triggerSourceRole = 'button';\n\n // Trigger is always role=\"button\" — combobox ARIA (aria-activedescendant etc.)\n // lives on the search input inside the popup, not on the trigger.\n // Trigger only needs aria-haspopup + aria-expanded (Popover handles) + aria-controls.\n\n return (\n <div\n className={`se-design-dropdown-container${props?.className ? ` ${props?.className}` : ''}`}\n style={props?.style}\n >\n {props?.label ? (\n <div id={labelId} className={`se-design-dropdown-label ${firstOptionAsHeading ? 'sr-only' : 'mb-[3px] text-[var(--color-gray-700)] text-sm'}`}>\n {props?.label}\n </div>\n ) : !props?.ariaLabelledBy && ariaLabel ? (\n <span id={labelId} className=\"sr-only\">{ariaLabel}</span>\n ) : null}\n <div\n style={props?.style}\n className={`${disabled ? 'bg-[var(--color-gray-50)] rounded-md cursor-not-allowed' : ''}`}\n {...(!isMultiSelect ? {\n ...comboboxContainerProps,\n onKeyDownCapture: (e: React.KeyboardEvent<HTMLElement>) => {\n // Handle Escape/Tab BEFORE dismiss — React unmounts the popup after\n // dismiss's setState, so bubble-phase handlers never fire.\n if ((e.key === 'Escape' || e.key === 'Tab') && isDropDownOpen) {\n e.stopPropagation(); // prevent Popover wrapper + parent sidebar from seeing Escape\n popoverRef.current?.focusTrigger();\n }\n comboboxContainerProps.onKeyDownCapture?.(e);\n },\n // Portal content lives in document.body — focus moving into it looks like \"focus out\" to\n // the container's blur handler, causing immediate close. Suppress it; the Popover's own\n // onBlur handler checks both source and portal content and handles dismissal correctly.\n ...(isWithPortal ? { onBlurCapture: undefined } : {})\n } : {\n // Multi-select: only spread focus-tracking handlers for isKeyboardFocused.\n // Dismiss is handled by Popover — don't spread onBlurCapture.\n onPointerMove: multiSelectContainerProps.onPointerMove,\n onPointerDown: multiSelectContainerProps.onPointerDown,\n onPointerUp: multiSelectContainerProps.onPointerUp,\n onFocusCapture: multiSelectContainerProps.onFocusCapture,\n onKeyDownCapture: (e: React.KeyboardEvent<HTMLElement>) => {\n if (e.key === 'Escape' && isDropDownOpen) {\n e.stopPropagation();\n popoverRef.current?.focusTrigger();\n }\n // When arrow keys are pressed while focus is still on the wrapper (before\n // focus-on-open completes), redirect focus into the content so the arrow\n // key handler on the listbox/search can process it.\n if ((e.key === 'ArrowDown' || e.key === 'ArrowUp') && isDropDownOpen) {\n const target = shouldShowSearch\n ? searchInputRef.current\n : multiSelectListboxProps.ref.current;\n if (target && document.activeElement !== target && !target.contains(document.activeElement as Node)) {\n target.focus();\n }\n }\n multiSelectContainerProps.onKeyDownCapture?.(e);\n }\n })}\n >\n <Popover\n ref={popoverRef}\n isPopoverOpen={isDropDownOpen}\n isWithPortal={isWithPortal}\n renderPopoverContents={\n customDropdownContent\n ? customDropdownContent\n : isMultiSelect\n ? renderMultiSelectDropdownContents\n : renderDropdownContents\n }\n contentWidth={'full'}\n popoverContentStyleProperty={props.popoverContentStyleProperty}\n renderPopoverSrcElement={\n props.renderSrcElement\n ? () => props.renderSrcElement!({ isOpen: isDropDownOpen, selectedValue: selectedDropDownValues })\n : renderDropdownSelect\n }\n onPopoverToggle={(value) => {\n setIsDropDownOpen(value);\n if (value && !isMultiSelect && selectedDropDownValues.length > 0) {\n // Highlight the currently selected option when the dropdown opens (APG Select pattern)\n const selectedIndex = filteredOptions.findIndex(\n (option) => optionsUniqueBy\n ? option[optionsUniqueBy] === selectedDropDownValues[0]?.[optionsUniqueBy]\n : option[selectBy] === selectedDropDownValues[0]?.[selectBy]\n );\n if (selectedIndex >= 0) {\n setHighlightedIndex(selectedIndex);\n }\n }\n if (value && !shouldShowSearch) {\n // Focus listbox after portal mounts and browser paints.\n // Double rAF ensures the portal DOM is ready. Also acts as fallback\n // if the arrow-key redirect in onKeyDownCapture fires first.\n const ref = isMultiSelect ? multiSelectListboxProps.ref : listboxProps.ref;\n requestAnimationFrame(() => requestAnimationFrame(() => ref.current?.focus()));\n }\n // When search is enabled, the useEffect at line 145 focuses the search input via rAF.\n }}\n disabled={disabled}\n automationId={props?.dropDownSrcAutomationId}\n popoverContentAutomationId={props?.dropDownContentAutomationId}\n ariaLabelledBy={\n props?.label || props?.ariaLabelledBy || ariaLabel\n ? [props?.label || (!props?.ariaLabelledBy && ariaLabel) ? labelId : props?.ariaLabelledBy, valueId].filter(Boolean).join(' ')\n : undefined\n }\n ariaLabel={!props?.label && !ariaLabel && !props?.ariaLabelledBy ? getDropdownAriaLabel() : undefined}\n sourceRole={triggerSourceRole}\n {...{ 'aria-haspopup': 'listbox' }}\n {...(isDropDownOpen ? { 'aria-controls': listboxId } : {})}\n />\n </div>\n {hasError && <div className=\"text-[var(--color-red-500)] text-sm\">{errorMessage}</div>}\n </div>\n );\n};\n"],"names":["Dropdown","props","isControlledSelection","selectedValue","undefined","isControlledOpen","isOpen","internalIsOpen","setInternalIsOpen","useState","searchQuery","setSearchQuery","internalSelectedValues","setInternalSelectedValues","defaultSelectedValue","Array","isArray","popoverRef","useRef","searchInputRef","labelId","useStableId","valueId","listboxId","isDropDownOpen","selectedDropDownValues","setIsDropDownOpen","value","onOpenChange","setSelectedDropDownValues","values","selectBy","optionsUniqueBy","displaySelected","dropDownOptions","defaultText","iconColor","disabled","dropdownClassName","hasError","errorMessage","customDropdownContent","isBorderless","shouldShowSearch","showSearchIcon","searchPlaceholder","searchResultEmptyMessage","ariaLabel","customSelectedValue","isWithPortal","firstOptionAsHeading","useEffect","newValues","current","requestAnimationFrame","focus","useLayoutEffect","popoverElementRef","element","isMultiSelect","type","NO_RESULTS_SENTINEL","__noResults","id","isNoResultsSentinel","item","getFilteredOptions","trim","filter","option","toString","toLowerCase","includes","handleDropDownOptionClick","dropDownOption","onOptionClick","focusTrigger","filteredOptions","showEmptyState","length","singleSelectItems","multiSelectItems","listboxProps","getOptionProps","highlightedIndex","setHighlightedIndex","containerProps","comboboxContainerProps","inputProps","comboboxInputProps","isKeyboardFocused","isSingleSelectKeyboardFocused","useCombobox","items","onSelect","hasItems","isItemDisabled","multiSelectComboboxInputProps","multiSelectListboxProps","multiSelectContainerProps","highlightedMultiSelectIndex","setHighlightedMultiSelectIndex","isMultiSelectKeyboardFocused","loop","closeOnTab","activeHighlight","announce","assertiveness","batchId","delay","getSelectedDropDownValue","isSrcOption","clearSelectedDropDownValues","onClear","optionChip","srcOption","renderOptionChip","firstSelectedLabel","remainingCount","React","createElement","className","selectedLabel","hasVisibleLabel","label","ariaLabelledBy","showPrefix","renderSearchInput","extraInputProps","InputWithIcon","leftIcon","name","position","style","color","onChange","placeholder","margin","gap","inputStyle","width","border","outline","automationId","inputRef","renderSearchBar","onKeyDown","e","multiSelectOnKeyDown","key","dropDownOptionJsx","index","optionTxt","dropDownSelectedValue","selectByUniqueId","isOptionSelected","isHighlighted","optionProps","_extends","onClick","preventDefault","tabIndex","Icon","stroke","emptyStateOption","currentHighlightedIndex","keyboardFocused","isMulti","role","renderDropdownContents","Fragment","onKeyDownCapture","onFocus","map","handleMultiSelectDropdownOptionClick","isSelected","newSelectedDropDownValues","handleApplySelectedDropDownValues","togglePopover","onApply","isSearchInput","some","v","stopPropagation","multiSelectDropdownOptionJSX","optionId","Checkbox","ariaHidden","checked","renderMultiSelectDropdownContents","shiftKey","applyEl","currentTarget","querySelector","document","activeElement","srcEl","focusables","getFocusableElements","container","body","filterHidden","idx","indexOf","next","ref","Button","size","renderDropdownSelect","borderColor","errorBorderColor","dropDownSelectClass","dropDownSelectAutomationId","rotation","getDropdownAriaLabel","onPointerMove","onPointerDown","onPointerUp","onFocusCapture","target","contains","onBlurCapture","Popover","isPopoverOpen","renderPopoverContents","contentWidth","popoverContentStyleProperty","renderPopoverSrcElement","renderSrcElement","onPopoverToggle","selectedIndex","findIndex","dropDownSrcAutomationId","popoverContentAutomationId","dropDownContentAutomationId","Boolean","join","sourceRole"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkEO,MAAMA,KAA+BC,CAAAA,MAAU;AACpD,QAAMC,IAAwBD,EAAME,kBAAkBC,QAChDC,IAAmBJ,EAAMK,WAAWF,QAEpC,CAACG,GAAgBC,EAAiB,IAAIC,EAAS,EAAK,GACpD,CAACC,GAAaC,CAAc,IAAIF,EAAS,EAAE,GAC3C,CAACG,IAAwBC,CAAyB,IAAIJ,EAA0B,MACpFR,GAAOa,uBACHC,MAAMC,QAAQf,GAAOa,oBAAoB,IACvCb,GAAOa,uBACP,CAACb,EAAMa,oBAAoB,IAC7B,EACN,GACMG,IAAaC,GAAuC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C,EAAuBsD,SAAS,GAAG;AAEhE,cAAMuJ,IAAgBzJ,EAAgB0J,UACnClK,CAAAA,MAAWrC,IACRqC,EAAOrC,CAAe,MAAMP,EAAuB,CAAC,IAAIO,CAAe,IACvEqC,EAAOtC,CAAQ,MAAMN,EAAuB,CAAC,IAAIM,CAAQ,CAC/D;AACA,QAAIuM,KAAiB,KACnBjJ,GAAoBiJ,CAAa;AAAA,MAErC;AACA,UAAI3M,KAAS,CAACgB,GAAkB;AAI9B,cAAMkK,IAAMlJ,IAAgBuC,EAAwB2G,MAAM3H,EAAa2H;AACvEvJ,8BAAsB,MAAMA,sBAAsB,MAAMuJ,EAAIxJ,SAASE,MAAAA,CAAO,CAAC;AAAA,MAC/E;AAAA,IAEF;AAAA,IACAlB,UAAAA;AAAAA,IACA0G,cAAc9I,GAAOuO;AAAAA,IACrBC,4BAA4BxO,GAAOyO;AAAAA,IACnC7G,gBACE5H,GAAO2H,SAAS3H,GAAO4H,kBAAkB9E,IACrC,CAAC9C,GAAO2H,SAAU,CAAC3H,GAAO4H,kBAAkB9E,IAAa3B,IAAUnB,GAAO4H,gBAAgBvG,CAAO,EAAE8C,OAAOuK,OAAO,EAAEC,KAAK,GAAG,IAC3HxO;AAAAA,IAEN2C,WAAW,CAAC9C,GAAO2H,SAAS,CAAC7E,KAAa,CAAC9C,GAAO4H,iBAAiByF,GAAAA,IAAyBlN;AAAAA,IAC5FyO,YAhHkB;AAAA,IAiHZ,iBAAiB;AAAA,EAAA,GAClBrN,IAAiB;AAAA,IAAE,iBAAiBD;AAAAA,EAAAA,IAAc,CAAA,CAAE,CAC1D,CACE,GACJgB,MAAYgF,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,WAAU;AAAA,EAAA,GAAuCjF,EAAkB,CAClF;AAET;"}
1
+ {"version":3,"file":"index25.js","sources":["../src/components/Dropdown/index.tsx"],"sourcesContent":["import React, { FC, useState, useRef, useEffect, useLayoutEffect } from 'react';\n\nimport { Popover, PopoverHandle } from 'src/components/Popover';\nimport { Icon } from 'components/Icon';\nimport { Checkbox } from '../Checkbox';\nimport { Button } from '../Button';\nimport { InputWithIcon } from '../InputWithIcon';\nimport { useStableId } from '../../utils/useStableId';\nimport { useCombobox } from '../../utils/a11y/useCombobox';\nimport { getFocusableElements } from '../../utils/a11y';\nimport { announce } from '../../utils/a11y/liveAnnouncer/LiveAnnouncer';\n\ntype DropdownValue = {\n [key: string]: any;\n};\n\ntype DropdownProps = {\n label?: string;\n firstOptionAsHeading?: boolean;\n ariaLabel?: string;\n ariaLabelledBy?: string;\n type: 'select' | 'multi-select';\n dropDownOptions?: DropdownValue[];\n defaultText?: string;\n selectBy?: string;\n optionsUniqueBy?: string;\n displaySelected?: boolean;\n defaultSelectedValue?: DropdownValue | DropdownValue[];\n customSelectedValue?: string;\n onOptionClick?: (selectedValue: DropdownValue) => void;\n style?: React.CSSProperties;\n renderOptionChip?: (option: DropdownValue, srcOption: boolean) => React.ReactNode;\n className?: string;\n iconColor?: string;\n disabled?: boolean;\n dropdownClassName?: string;\n hasError?: boolean;\n errorMessage?: string;\n onApply?: (selectedValue: DropdownValue[]) => void;\n onClear?: () => void;\n customDropdownContent?: () => React.ReactNode;\n isBorderless?: boolean;\n dropDownSrcAutomationId?: string;\n dropDownSelectAutomationId?: string;\n dropDownContentAutomationId?: string;\n shouldShowSearch?: boolean;\n showSearchIcon?: boolean;\n searchPlaceholder?: string;\n searchResultEmptyMessage?: string;\n /** Controlled selection — when provided, Dropdown won't manage internal selected state */\n selectedValue?: DropdownValue | DropdownValue[];\n /** Controlled open state — when provided, Dropdown won't manage internal open/close */\n isOpen?: boolean;\n /** Callback when open state changes (fires in both controlled and uncontrolled modes) */\n onOpenChange?: (isOpen: boolean) => void;\n /** Custom trigger element — replaces the default bordered div + chevron */\n renderSrcElement?: (props: { isOpen: boolean; selectedValue: DropdownValue[] }) => React.ReactNode;\n /** Render the dropdown panel in a portal (document.body) to escape overflow:hidden containers */\n isWithPortal?: boolean;\n /** Optional ref that will be populated with the Popover wrapper element on mount.\n * Use with setFocusAnchor() to return focus to the dropdown trigger after a modal closes. */\n popoverElementRef?: React.RefObject<HTMLElement | null>;\n /** Inline styles forwarded to the Popover content (portal or inline). Useful for min-width overrides. */\n popoverContentStyleProperty?: React.CSSProperties;\n};\n\nexport const Dropdown: FC<DropdownProps> = (props) => {\n const isControlledSelection = props.selectedValue !== undefined;\n const isControlledOpen = props.isOpen !== undefined;\n\n const [internalIsOpen, setInternalIsOpen] = useState(false);\n const [searchQuery, setSearchQuery] = useState('');\n const [internalSelectedValues, setInternalSelectedValues] = useState<DropdownValue[]>(() =>\n props?.defaultSelectedValue\n ? Array.isArray(props?.defaultSelectedValue)\n ? props?.defaultSelectedValue\n : [props.defaultSelectedValue]\n : []\n );\n const popoverRef = useRef<HTMLDivElement & PopoverHandle>(null);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const labelId = useStableId(undefined, 'dropdown-label');\n const valueId = useStableId(undefined, 'dropdown-value');\n const listboxId = useStableId(undefined, 'dropdown-listbox');\n\n // Derived state: controlled props take precedence over internal state\n const isDropDownOpen = isControlledOpen ? props.isOpen! : internalIsOpen;\n const selectedDropDownValues = isControlledSelection\n ? (Array.isArray(props.selectedValue) ? props.selectedValue : props.selectedValue ? [props.selectedValue] : [])\n : internalSelectedValues;\n\n const setIsDropDownOpen = (value: boolean) => {\n if (!isControlledOpen) {\n setInternalIsOpen(value);\n }\n props.onOpenChange?.(value);\n };\n\n const setSelectedDropDownValues = (values: DropdownValue[]) => {\n if (!isControlledSelection) {\n setInternalSelectedValues(values);\n }\n };\n\n const {\n selectBy = '',\n optionsUniqueBy = '',\n displaySelected = false,\n dropDownOptions,\n defaultText = 'Select',\n iconColor = 'var(--color-gray-700)',\n disabled = false,\n dropdownClassName = '',\n hasError = false,\n errorMessage = '',\n customDropdownContent = null,\n isBorderless = false,\n shouldShowSearch = false,\n showSearchIcon = true,\n searchPlaceholder = 'Search...',\n searchResultEmptyMessage = 'No results found',\n ariaLabel = '',\n customSelectedValue = '',\n isWithPortal = false,\n firstOptionAsHeading = false\n } = props;\n\n useEffect(() => {\n if (!isControlledSelection) {\n const newValues = props?.defaultSelectedValue\n ? Array.isArray(props?.defaultSelectedValue)\n ? props?.defaultSelectedValue\n : [props.defaultSelectedValue]\n : [];\n setInternalSelectedValues(newValues);\n }\n }, [props?.defaultSelectedValue, isControlledSelection]);\n\n useEffect(() => {\n if (!isDropDownOpen) {\n setSearchQuery('');\n }\n }, [isDropDownOpen]);\n\n // Focus search input when dropdown opens with search enabled\n useEffect(() => {\n if (isDropDownOpen && shouldShowSearch && searchInputRef.current) {\n requestAnimationFrame(() => searchInputRef.current?.focus());\n }\n }, [isDropDownOpen, shouldShowSearch]);\n\n // Populate caller's popoverElementRef with the Popover wrapper element.\n // Runs after mount so popoverRef.current is set.\n useLayoutEffect(() => {\n if (props.popoverElementRef) {\n props.popoverElementRef.current = popoverRef.current?.element ?? null;\n }\n });\n\n const isMultiSelect = props?.type === 'multi-select';\n\n // Sentinel item for empty state — enables keyboard navigation to \"No results found\"\n const NO_RESULTS_SENTINEL: DropdownValue = { __noResults: true, id: '__no_results__', value: '__no_results__' };\n const isNoResultsSentinel = (item: DropdownValue) => !!item?.__noResults;\n\n const getFilteredOptions = () => {\n if (!searchQuery.trim()) {\n return dropDownOptions || [];\n }\n return (dropDownOptions || []).filter((option) => {\n const optionValue = option?.[selectBy]?.toString().toLowerCase() || '';\n return optionValue.includes(searchQuery.toLowerCase());\n });\n };\n\n const handleDropDownOptionClick = (dropDownOption: any) => {\n setSelectedDropDownValues([dropDownOption]);\n setIsDropDownOpen(false);\n props?.onOptionClick?.(dropDownOption);\n // Restore focus to the trigger after portal unmounts.\n // Double rAF ensures this runs after React re-renders AND the focus trap safety net,\n // getting the final say on focus.\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n popoverRef.current?.focusTrigger();\n });\n });\n };\n\n // Use useCombobox hook for keyboard navigation (only for single-select)\n const filteredOptions = getFilteredOptions();\n const showEmptyState = filteredOptions.length === 0 && (searchQuery.trim() || dropDownOptions?.length === 0);\n // Inject sentinel so arrow keys can reach \"No results found\"\n const singleSelectItems = !isMultiSelect\n ? (filteredOptions.length > 0 ? filteredOptions : (showEmptyState ? [NO_RESULTS_SENTINEL] : []))\n : [];\n const multiSelectItems = isMultiSelect\n ? (filteredOptions.length > 0 ? filteredOptions : (showEmptyState ? [NO_RESULTS_SENTINEL] : []))\n : [];\n\n const {\n listboxProps,\n getOptionProps,\n highlightedIndex,\n setHighlightedIndex,\n containerProps: comboboxContainerProps,\n inputProps: comboboxInputProps,\n isKeyboardFocused: isSingleSelectKeyboardFocused\n } = useCombobox({\n items: singleSelectItems,\n isOpen: isDropDownOpen && !isMultiSelect,\n onOpenChange: setIsDropDownOpen,\n onSelect: (item: DropdownValue) => {\n handleDropDownOptionClick(item);\n },\n listboxId,\n disabled: isMultiSelect || disabled,\n hasItems: singleSelectItems.length > 0,\n isItemDisabled: isNoResultsSentinel\n });\n\n // Second useCombobox for multi-select: provides ARIA props, keyboard navigation, and auto-scroll.\n // Enter/Space are intercepted in multiSelectOnKeyDown to avoid the hook's highlight reset after select.\n const {\n inputProps: multiSelectComboboxInputProps,\n listboxProps: multiSelectListboxProps,\n containerProps: multiSelectContainerProps,\n highlightedIndex: highlightedMultiSelectIndex,\n setHighlightedIndex: setHighlightedMultiSelectIndex,\n isKeyboardFocused: isMultiSelectKeyboardFocused\n } = useCombobox({\n items: multiSelectItems,\n isOpen: isDropDownOpen && isMultiSelect,\n onOpenChange: setIsDropDownOpen,\n onSelect: () => {},\n listboxId,\n disabled: !isMultiSelect,\n loop: false,\n hasItems: multiSelectItems.length > 0,\n closeOnTab: false,\n isItemDisabled: isNoResultsSentinel\n });\n\n // Announce empty state for screen readers — only when arrow keys haven't reached it yet.\n // Once highlighted (aria-activedescendant), the screen reader reads it directly.\n const activeHighlight = isMultiSelect ? highlightedMultiSelectIndex : highlightedIndex;\n useEffect(() => {\n if (isDropDownOpen && filteredOptions.length === 0 && (searchQuery.trim() || dropDownOptions?.length === 0) && activeHighlight === -1) {\n announce(searchResultEmptyMessage, { assertiveness: 'polite', batchId: 'dropdown-empty-state', delay: 300 });\n }\n }, [filteredOptions.length, isDropDownOpen, searchQuery, dropDownOptions?.length, activeHighlight]);\n\n const getSelectedDropDownValue = (option: DropdownValue, isSrcOption: boolean = false) => {\n if (isMultiSelect) {\n return defaultText;\n }\n\n // if custom selected value is provided, use it instead of the option value\n if (isSrcOption && customSelectedValue) {\n return customSelectedValue;\n }\n\n return option?.[selectBy] || defaultText;\n };\n\n const clearSelectedDropDownValues = () => {\n setSelectedDropDownValues([]);\n props?.onClear?.();\n };\n\n const optionChip = (option: DropdownValue, srcOption: boolean = false) => {\n if (props?.renderOptionChip) {\n return props?.renderOptionChip(option, srcOption);\n }\n\n if (isMultiSelect && selectedDropDownValues?.length > 0) {\n const firstSelectedLabel = selectedDropDownValues[0]?.[selectBy] || '';\n const remainingCount = selectedDropDownValues.length - 1;\n\n // For multiple selections: text takes remaining space, count takes minimum space needed\n return (\n <div className={`option-chip flex items-center w-full`}>\n <div\n className={`${remainingCount > 0 ? 'w-full' : 'flex-1'} truncate`}\n >{`${defaultText}: ${firstSelectedLabel}`}</div>\n {remainingCount > 0 && <div className=\"flex-shrink-0\">+{remainingCount}</div>}\n </div>\n );\n }\n\n const selectedLabel = getSelectedDropDownValue(option, srcOption);\n const hasVisibleLabel = !!props?.label || !!props?.ariaLabelledBy;\n const showPrefix = srcOption && defaultText && option?.[selectBy] && !customSelectedValue && !hasVisibleLabel;\n\n return (\n <p className={`option-chip flex flex-1 items-center justify-between`}>\n {showPrefix ? `${defaultText}: ${selectedLabel}` : selectedLabel}\n </p>\n );\n };\n\n const renderSearchInput = (extraInputProps: Record<string, any>) => (\n <div className=\" w-full relative flex items-center border-b border-[var(--color-gray-300)]\">\n <InputWithIcon\n leftIcon={showSearchIcon ? { name: 'search', position: 'left', style: { color: 'var(--color-gray-500)' } } : undefined}\n value={searchQuery}\n onChange={(value) => setSearchQuery(value)}\n placeholder={searchPlaceholder}\n style={{ margin: 0, gap: 0 }}\n inputStyle={{ width: '100%', border: 'none', outline: 'none' }}\n automationId=\"se-design-dropdown-search\"\n ariaLabel={searchPlaceholder}\n inputRef={searchInputRef}\n inputProps={extraInputProps}\n />\n </div>\n );\n\n const renderSearchBar = () => {\n if (isMultiSelect) {\n return renderSearchInput({\n ...multiSelectComboboxInputProps,\n onKeyDown: (e: React.KeyboardEvent) => multiSelectOnKeyDown(e, true)\n });\n }\n\n // Single-select: wrap onKeyDown to add Escape → focusTrigger (portal-safe)\n return renderSearchInput({\n ...comboboxInputProps,\n onKeyDown: (e: React.KeyboardEvent) => {\n comboboxInputProps.onKeyDown(e);\n if (e.key === 'Escape') {\n requestAnimationFrame(() => popoverRef.current?.focusTrigger());\n }\n }\n });\n };\n\n const dropDownOptionJsx = (dropDownOption: DropdownValue, index: number) => {\n const optionTxt = dropDownOption[selectBy];\n const dropDownSelectedValue = selectedDropDownValues[0]?.[selectBy] || defaultText;\n const selectByUniqueId = optionsUniqueBy?.length\n ? dropDownOption[optionsUniqueBy] == selectedDropDownValues[0]?.[optionsUniqueBy]\n : true;\n const isOptionSelected = displaySelected && optionTxt === dropDownSelectedValue && selectByUniqueId;\n const isHighlighted = highlightedIndex === index;\n const optionProps = !isMultiSelect ? getOptionProps(index, isOptionSelected) : {};\n\n return (\n <div\n key={dropDownOption.id || dropDownOption.value}\n className={`option break-words px-3 py-2 hover:bg-[var(--color-gray-100)] cursor-pointer select-none flex items-center justify-between ${\n isOptionSelected ? 'selected' : ''\n } ${isHighlighted ? `bg-[var(--color-gray-100)]${isSingleSelectKeyboardFocused ? ' outline outline-[length:var(--focus-width)] -outline-offset-2 outline-[var(--focus-color)]' : ''}` : ''}`}\n onClick={() => handleDropDownOptionClick(dropDownOption)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleDropDownOptionClick(dropDownOption);\n } else if (e.key === 'Escape') {\n requestAnimationFrame(() => popoverRef.current?.focusTrigger());\n }\n }}\n tabIndex={-1}\n data-automation-id={`dropdown-option-${dropDownOption?.automationId || index}`}\n {...optionProps}\n aria-selected={isOptionSelected ? 'true' : 'false'}\n >\n {optionChip({ ...dropDownOption, isOptionSelected }, false)}\n {isOptionSelected && <Icon name=\"checkmark\" stroke={iconColor} />}\n </div>\n );\n };\n\n const emptyStateOption = (currentHighlightedIndex: number, keyboardFocused: boolean, isMulti: boolean) => (\n <div\n {...(!isMulti ? getOptionProps(0, false) : { id: `${listboxId}-option-0`, role: 'option', 'aria-disabled': true })}\n className={`px-3 py-4 text-center text-[var(--color-gray-700)] text-sm${currentHighlightedIndex === 0 ? ` bg-[var(--color-gray-100)]${keyboardFocused ? ' outline outline-[length:var(--focus-width)] -outline-offset-2 outline-[var(--focus-color)]' : ''}` : ''}`}\n >\n {searchResultEmptyMessage}\n </div>\n );\n\n const renderDropdownContents = () => {\n return (\n <>\n {props?.label && firstOptionAsHeading && (\n <div\n aria-hidden=\"true\"\n className=\"px-3 pt-2 pb-1 text-[var(--color-gray-650)] text-xs cursor-default select-none\"\n >\n {props.label}\n </div>\n )}\n {shouldShowSearch && renderSearchBar()}\n <div\n className={`dropdown-content dropdown-options${shouldShowSearch ? '' : ' flex flex-col max-h-80 overflow-y-auto'}`}\n {...(shouldShowSearch ? {} : {\n ...listboxProps,\n 'aria-label': `${defaultText} options`,\n style: { outline: 'none' },\n tabIndex: -1,\n 'aria-activedescendant': comboboxInputProps['aria-activedescendant'],\n onKeyDown: (e: React.KeyboardEvent) => {\n comboboxContainerProps.onKeyDownCapture?.(e as React.KeyboardEvent<HTMLElement>);\n if (e.key === ' ') {\n e.preventDefault();\n if (highlightedIndex >= 0 && filteredOptions[highlightedIndex]) {\n handleDropDownOptionClick(filteredOptions[highlightedIndex]);\n }\n return;\n }\n comboboxInputProps.onKeyDown(e);\n },\n onFocus: () => {\n if (highlightedIndex === -1 && singleSelectItems.length > 0) {\n setHighlightedIndex(0);\n }\n }\n })}\n >\n {shouldShowSearch ? (\n <div\n className=\"flex flex-col max-h-80 overflow-y-auto\"\n aria-label={`${defaultText} options`}\n {...listboxProps}\n >\n {filteredOptions.length > 0 ? (\n filteredOptions.map((dropDownOption, index) => dropDownOptionJsx(dropDownOption, index))\n ) : (\n emptyStateOption(highlightedIndex, isSingleSelectKeyboardFocused, false)\n )}\n </div>\n ) : (\n filteredOptions.length > 0 ? (\n filteredOptions.map((dropDownOption, index) => dropDownOptionJsx(dropDownOption, index))\n ) : (\n emptyStateOption(highlightedIndex, isSingleSelectKeyboardFocused, false)\n )\n )}\n </div>\n </>\n );\n };\n\n const handleMultiSelectDropdownOptionClick = (isSelected: boolean, dropDownOption: DropdownValue) => {\n let newSelectedDropDownValues: DropdownValue[] = [];\n if (isSelected) {\n newSelectedDropDownValues = [...selectedDropDownValues, dropDownOption];\n } else {\n newSelectedDropDownValues = selectedDropDownValues?.filter(\n (option) => option[optionsUniqueBy] !== dropDownOption[optionsUniqueBy]\n );\n }\n setSelectedDropDownValues(newSelectedDropDownValues);\n };\n\n const handleApplySelectedDropDownValues = () => {\n popoverRef.current?.togglePopover();\n popoverRef.current?.focusTrigger();\n props?.onApply?.(selectedDropDownValues);\n };\n\n // Wraps the multi-select useCombobox's onKeyDown.\n // - Intercepts Enter/Space to toggle selection without resetting the highlight\n // (the hook resets highlightedIndex to -1 after onSelect, which is wrong for multi-select).\n // - When isSearchInput is true, Space is left for typing.\n // - Adds focusTrigger on Escape (Popover's handler is unreliable for portals).\n const multiSelectOnKeyDown = (e: React.KeyboardEvent, isSearchInput: boolean = false) => {\n if (isSearchInput && e.key === ' ') return;\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n if (highlightedMultiSelectIndex >= 0 && highlightedMultiSelectIndex < filteredOptions.length) {\n const option = filteredOptions[highlightedMultiSelectIndex];\n const isSelected = selectedDropDownValues.some(\n (v) => v[optionsUniqueBy] === option[optionsUniqueBy]\n );\n handleMultiSelectDropdownOptionClick(!isSelected, option);\n }\n return;\n }\n\n multiSelectComboboxInputProps.onKeyDown(e);\n\n if (e.key === 'Escape') {\n e.stopPropagation();\n requestAnimationFrame(() => popoverRef.current?.focusTrigger());\n }\n };\n\n const multiSelectDropdownOptionJSX = (dropDownOption: DropdownValue, index: number) => {\n const isOptionSelected = selectedDropDownValues.some(\n (option) => option[optionsUniqueBy] === dropDownOption[optionsUniqueBy]\n );\n const optionId = `${listboxId}-option-${index}`;\n const isHighlighted = highlightedMultiSelectIndex === index;\n\n return (\n <div\n key={dropDownOption.id || dropDownOption.value}\n id={optionId}\n role=\"option\"\n aria-selected={isOptionSelected}\n className={`option px-3 py-2 hover:bg-[var(--color-gray-100)] cursor-pointer select-none flex items-center gap-2 ${\n isHighlighted ? `bg-[var(--color-gray-100)]${isMultiSelectKeyboardFocused ? ' outline outline-[length:var(--focus-width)] -outline-offset-2 outline-[var(--focus-color)]' : ''}` : ''\n }`}\n onClick={() => handleMultiSelectDropdownOptionClick(!isOptionSelected, dropDownOption)}\n data-automation-id={`dropdown-option-${dropDownOption?.automationId || index}`}\n >\n <Checkbox\n tabIndex={-1}\n ariaHidden\n checked={isOptionSelected}\n onChange={() => {}}\n className=\"pointer-events-none\"\n />\n <span className=\"checkbox-label\">{dropDownOption?.label}</span>\n </div>\n );\n };\n\n const renderMultiSelectDropdownContents = () => {\n return (\n <div\n onKeyDown={(e) => {\n // Stop all Tab events from reaching Popover's handlePopoverContentKeyDown (which closes on Tab).\n // Tab flow is managed by the footer onKeyDown: forward Tab from Apply closes and advances\n // focus past trigger; Shift+Tab returns to search/listbox.\n if (e.key === 'Tab') {\n e.stopPropagation();\n }\n }}\n >\n {shouldShowSearch && renderSearchBar()}\n <div\n className={`dropdown-content dropdown-options${shouldShowSearch ? '' : ' flex flex-col max-h-80 overflow-y-auto'}`}\n {...(shouldShowSearch ? {} : {\n ...multiSelectListboxProps,\n 'aria-label': `${defaultText} options`,\n 'aria-multiselectable': 'true',\n style: { outline: 'none' },\n tabIndex: -1,\n 'aria-activedescendant': multiSelectComboboxInputProps['aria-activedescendant'],\n onKeyDown: (e: React.KeyboardEvent) => multiSelectOnKeyDown(e, false),\n onFocus: () => {\n if (highlightedMultiSelectIndex === -1 && multiSelectItems.length > 0) {\n setHighlightedMultiSelectIndex(0);\n }\n }\n })}\n >\n {shouldShowSearch ? (\n <div\n className=\"flex flex-col max-h-80 overflow-y-auto\"\n {...multiSelectListboxProps}\n aria-label={`${defaultText} options`}\n aria-multiselectable=\"true\"\n >\n {filteredOptions.length > 0 ? (\n filteredOptions.map((dropDownOption, index) => multiSelectDropdownOptionJSX(dropDownOption, index))\n ) : (\n emptyStateOption(highlightedMultiSelectIndex, isMultiSelectKeyboardFocused, true)\n )}\n </div>\n ) : (\n filteredOptions.length > 0 ? (\n filteredOptions.map((dropDownOption, index) => multiSelectDropdownOptionJSX(dropDownOption, index))\n ) : (\n emptyStateOption(highlightedMultiSelectIndex, isMultiSelectKeyboardFocused, true)\n )\n )}\n </div>\n <div\n className=\"flex items-center justify-end gap-4 p-3 border-t border-[var(--color-gray-200)]\"\n onKeyDown={(e) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Home' || e.key === 'End') {\n // Stop arrow keys from reaching Popover's handleArrowKeyNavigation\n // which would move focus out of the CTA buttons back into options\n e.stopPropagation();\n return;\n }\n if (e.key === 'Tab' && !e.shiftKey) {\n // Forward Tab from Apply — close dropdown and advance focus past trigger.\n // The wrapper stopPropagation blocks Popover's Tab handler, so we replicate\n // its portal-safe focus advance here (Popover lines 559-569).\n const applyEl = e.currentTarget.querySelector('[data-automation-id=\"se-design-dropdown-apply-button\"]');\n if (document.activeElement === applyEl) {\n e.stopPropagation();\n popoverRef.current?.togglePopover();\n if (isWithPortal) {\n // Portal: manually advance focus past trigger (portal Tab order is wrong)\n e.preventDefault();\n const srcEl = popoverRef.current?.element;\n const focusables = getFocusableElements({ container: document.body, filterHidden: true });\n const idx = srcEl ? focusables.indexOf(srcEl) : -1;\n const next = focusables[idx + 1];\n if (next) (next as HTMLElement).focus();\n else (srcEl as HTMLElement)?.focus();\n }\n // Non-portal: togglePopover closes, browser Tab naturally advances focus\n }\n } else if (e.key === 'Tab' && e.shiftKey) {\n e.preventDefault();\n e.stopPropagation();\n if (shouldShowSearch) {\n searchInputRef.current?.focus();\n } else {\n multiSelectListboxProps.ref.current?.focus();\n }\n }\n }}\n >\n <Button label=\"Clear\" type=\"link\" size=\"sm\" onClick={clearSelectedDropDownValues} automationId=\"se-design-dropdown-clear-button\" />\n <Button label=\"Apply\" type=\"primary\" size=\"sm\" onClick={handleApplySelectedDropDownValues} automationId=\"se-design-dropdown-apply-button\" />\n </div>\n </div>\n );\n };\n\n const renderDropdownSelect = () => {\n const borderColor = isDropDownOpen\n ? 'border-[var(--color-blue-500)]'\n : disabled\n ? 'border-[var(--color-gray-300)]'\n : 'border-[var(--color-gray-600)]';\n const errorBorderColor = hasError ? 'border-[var(--color-red-500)]' : '';\n const dropDownSelectClass = `dropdown-src-element bg-[var(--color-white)] flex px-3 py-2 ${\n isBorderless ? 'border-0' : `border rounded-md ${errorBorderColor ? errorBorderColor : borderColor}`\n } flex items-center ${dropdownClassName}`;\n\n return (\n <div className={dropDownSelectClass}>\n <div\n id={valueId}\n className=\"flex-1 min-w-0\"\n data-automation-id={props?.dropDownSelectAutomationId || 'selected-dropdown-value'}\n >\n {optionChip(selectedDropDownValues[0], true)}\n </div>\n <div className=\"flex-shrink-0 ml-2\" aria-hidden=\"true\">\n <Icon\n name={'chevron'}\n rotation={isDropDownOpen ? '180' : '0'}\n className={`transition-transform`}\n stroke={iconColor}\n />\n </div>\n </div>\n );\n };\n\n const getDropdownAriaLabel = () => {\n const selectedLabel = selectedDropDownValues[0]?.[selectBy];\n if (ariaLabel && selectedLabel) {\n return `${ariaLabel}, ${selectedLabel}`;\n }\n return ariaLabel || defaultText || 'Select option';\n };\n\n // Trigger is always a button that reveals a listbox popup (Select/Listbox pattern).\n // For search-enabled dropdowns, the combobox role lives on the search input inside the popup.\n // This matches React Aria (useSelect), Radix (Select), and Headless UI (Listbox) — all use\n // role=\"button\" with real focus on options, separate from their Combobox components.\n const triggerSourceRole = 'button';\n\n // Trigger is always role=\"button\" — combobox ARIA (aria-activedescendant etc.)\n // lives on the search input inside the popup, not on the trigger.\n // Trigger only needs aria-haspopup + aria-expanded (Popover handles) + aria-controls.\n\n return (\n <div\n className={`se-design-dropdown-container${props?.className ? ` ${props?.className}` : ''}`}\n style={props?.style}\n >\n {props?.label ? (\n <div id={labelId} className={`se-design-dropdown-label ${firstOptionAsHeading ? 'sr-only' : 'mb-[3px] text-[var(--color-gray-700)] text-sm'}`}>\n {props?.label}\n </div>\n ) : !props?.ariaLabelledBy && ariaLabel ? (\n <span id={labelId} className=\"sr-only\">{ariaLabel}</span>\n ) : null}\n <div\n style={props?.style}\n className={`${disabled ? 'bg-[var(--color-gray-50)] rounded-md cursor-not-allowed' : ''}`}\n {...(!isMultiSelect ? {\n ...comboboxContainerProps,\n onKeyDownCapture: (e: React.KeyboardEvent<HTMLElement>) => {\n // Handle Escape/Tab BEFORE dismiss — React unmounts the popup after\n // dismiss's setState, so bubble-phase handlers never fire.\n if ((e.key === 'Escape' || e.key === 'Tab') && isDropDownOpen) {\n e.stopPropagation(); // prevent Popover wrapper + parent sidebar from seeing Escape\n popoverRef.current?.focusTrigger();\n }\n comboboxContainerProps.onKeyDownCapture?.(e);\n },\n // Portal content lives in document.body — focus moving into it looks like \"focus out\" to\n // the container's blur handler, causing immediate close. Suppress it; the Popover's own\n // onBlur handler checks both source and portal content and handles dismissal correctly.\n ...(isWithPortal ? { onBlurCapture: undefined } : {})\n } : {\n // Multi-select: only spread focus-tracking handlers for isKeyboardFocused.\n // Dismiss is handled by Popover — don't spread onBlurCapture.\n onPointerMove: multiSelectContainerProps.onPointerMove,\n onPointerDown: multiSelectContainerProps.onPointerDown,\n onPointerUp: multiSelectContainerProps.onPointerUp,\n onFocusCapture: multiSelectContainerProps.onFocusCapture,\n onKeyDownCapture: (e: React.KeyboardEvent<HTMLElement>) => {\n if (e.key === 'Escape' && isDropDownOpen) {\n e.stopPropagation();\n popoverRef.current?.focusTrigger();\n }\n // When arrow keys are pressed while focus is still on the wrapper (before\n // focus-on-open completes), redirect focus into the content so the arrow\n // key handler on the listbox/search can process it.\n if ((e.key === 'ArrowDown' || e.key === 'ArrowUp') && isDropDownOpen) {\n const target = shouldShowSearch\n ? searchInputRef.current\n : multiSelectListboxProps.ref.current;\n if (target && document.activeElement !== target && !target.contains(document.activeElement as Node)) {\n target.focus();\n }\n }\n multiSelectContainerProps.onKeyDownCapture?.(e);\n }\n })}\n >\n <Popover\n ref={popoverRef}\n isPopoverOpen={isDropDownOpen}\n isWithPortal={isWithPortal}\n renderPopoverContents={\n customDropdownContent\n ? customDropdownContent\n : isMultiSelect\n ? renderMultiSelectDropdownContents\n : renderDropdownContents\n }\n contentWidth={'full'}\n popoverContentStyleProperty={props.popoverContentStyleProperty}\n renderPopoverSrcElement={\n props.renderSrcElement\n ? () => props.renderSrcElement!({ isOpen: isDropDownOpen, selectedValue: selectedDropDownValues })\n : renderDropdownSelect\n }\n onPopoverToggle={(value) => {\n setIsDropDownOpen(value);\n if (value && !isMultiSelect && selectedDropDownValues.length > 0) {\n // Highlight the currently selected option when the dropdown opens (APG Select pattern)\n const selectedIndex = filteredOptions.findIndex(\n (option) => optionsUniqueBy\n ? option[optionsUniqueBy] === selectedDropDownValues[0]?.[optionsUniqueBy]\n : option[selectBy] === selectedDropDownValues[0]?.[selectBy]\n );\n if (selectedIndex >= 0) {\n setHighlightedIndex(selectedIndex);\n }\n }\n if (value && !shouldShowSearch) {\n // Focus listbox after portal mounts and browser paints.\n // Double rAF ensures the portal DOM is ready. Also acts as fallback\n // if the arrow-key redirect in onKeyDownCapture fires first.\n const ref = isMultiSelect ? multiSelectListboxProps.ref : listboxProps.ref;\n requestAnimationFrame(() => requestAnimationFrame(() => ref.current?.focus()));\n }\n // When search is enabled, the useEffect at line 145 focuses the search input via rAF.\n }}\n disabled={disabled}\n automationId={props?.dropDownSrcAutomationId}\n popoverContentAutomationId={props?.dropDownContentAutomationId}\n ariaLabelledBy={\n props?.label || props?.ariaLabelledBy || ariaLabel\n ? [props?.label || (!props?.ariaLabelledBy && ariaLabel) ? labelId : props?.ariaLabelledBy, valueId].filter(Boolean).join(' ')\n : undefined\n }\n ariaLabel={!props?.label && !ariaLabel && !props?.ariaLabelledBy ? getDropdownAriaLabel() : undefined}\n sourceRole={triggerSourceRole}\n {...{ 'aria-haspopup': 'listbox' }}\n {...(isDropDownOpen ? { 'aria-controls': listboxId } : {})}\n />\n </div>\n {hasError && <div className=\"text-[var(--color-red-500)] text-sm\">{errorMessage}</div>}\n </div>\n );\n};\n"],"names":["Dropdown","props","isControlledSelection","selectedValue","undefined","isControlledOpen","isOpen","internalIsOpen","setInternalIsOpen","useState","searchQuery","setSearchQuery","internalSelectedValues","setInternalSelectedValues","defaultSelectedValue","Array","isArray","popoverRef","useRef","searchInputRef","labelId","useStableId","valueId","listboxId","isDropDownOpen","selectedDropDownValues","setIsDropDownOpen","value","onOpenChange","setSelectedDropDownValues","values","selectBy","optionsUniqueBy","displaySelected","dropDownOptions","defaultText","iconColor","disabled","dropdownClassName","hasError","errorMessage","customDropdownContent","isBorderless","shouldShowSearch","showSearchIcon","searchPlaceholder","searchResultEmptyMessage","ariaLabel","customSelectedValue","isWithPortal","firstOptionAsHeading","useEffect","newValues","current","requestAnimationFrame","focus","useLayoutEffect","popoverElementRef","element","isMultiSelect","type","NO_RESULTS_SENTINEL","__noResults","id","isNoResultsSentinel","item","getFilteredOptions","trim","filter","option","toString","toLowerCase","includes","handleDropDownOptionClick","dropDownOption","onOptionClick","focusTrigger","filteredOptions","showEmptyState","length","singleSelectItems","multiSelectItems","listboxProps","getOptionProps","highlightedIndex","setHighlightedIndex","containerProps","comboboxContainerProps","inputProps","comboboxInputProps","isKeyboardFocused","isSingleSelectKeyboardFocused","useCombobox","items","onSelect","hasItems","isItemDisabled","multiSelectComboboxInputProps","multiSelectListboxProps","multiSelectContainerProps","highlightedMultiSelectIndex","setHighlightedMultiSelectIndex","isMultiSelectKeyboardFocused","loop","closeOnTab","activeHighlight","announce","assertiveness","batchId","delay","getSelectedDropDownValue","isSrcOption","clearSelectedDropDownValues","onClear","optionChip","srcOption","renderOptionChip","firstSelectedLabel","remainingCount","React","createElement","className","selectedLabel","hasVisibleLabel","label","ariaLabelledBy","showPrefix","renderSearchInput","extraInputProps","InputWithIcon","leftIcon","name","position","style","color","onChange","placeholder","margin","gap","inputStyle","width","border","outline","automationId","inputRef","renderSearchBar","onKeyDown","e","multiSelectOnKeyDown","key","dropDownOptionJsx","index","optionTxt","dropDownSelectedValue","selectByUniqueId","isOptionSelected","isHighlighted","optionProps","_extends","onClick","preventDefault","tabIndex","Icon","stroke","emptyStateOption","currentHighlightedIndex","keyboardFocused","isMulti","role","renderDropdownContents","Fragment","onKeyDownCapture","onFocus","map","handleMultiSelectDropdownOptionClick","isSelected","newSelectedDropDownValues","handleApplySelectedDropDownValues","togglePopover","onApply","isSearchInput","some","v","stopPropagation","multiSelectDropdownOptionJSX","optionId","Checkbox","ariaHidden","checked","renderMultiSelectDropdownContents","shiftKey","applyEl","currentTarget","querySelector","document","activeElement","srcEl","focusables","getFocusableElements","container","body","filterHidden","idx","indexOf","next","ref","Button","size","renderDropdownSelect","borderColor","errorBorderColor","dropDownSelectClass","dropDownSelectAutomationId","rotation","getDropdownAriaLabel","onPointerMove","onPointerDown","onPointerUp","onFocusCapture","target","contains","onBlurCapture","Popover","isPopoverOpen","renderPopoverContents","contentWidth","popoverContentStyleProperty","renderPopoverSrcElement","renderSrcElement","onPopoverToggle","selectedIndex","findIndex","dropDownSrcAutomationId","popoverContentAutomationId","dropDownContentAutomationId","Boolean","join","sourceRole"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkEO,MAAMA,KAA+BC,CAAAA,MAAU;AACpD,QAAMC,IAAwBD,EAAME,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E,iBAAiBD;AAAAA,EAAAA,IAAc,CAAA,CAAE,CAC1D,CACE,GACJgB,MAAYgF,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,WAAU;AAAA,EAAA,GAAuCjF,EAAkB,CAClF;AAET;"}
package/dist/index250.js CHANGED
@@ -1,13 +1,8 @@
1
- function e() {
2
- return e = Object.assign ? Object.assign.bind() : function(t) {
3
- for (var n = 1; n < arguments.length; n++) {
4
- var a = arguments[n];
5
- for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
6
- }
7
- return t;
8
- }, e.apply(null, arguments);
1
+ import e from "./index253.js";
2
+ function p(o, t) {
3
+ o.prototype = Object.create(t.prototype), o.prototype.constructor = o, e(o, t);
9
4
  }
10
5
  export {
11
- e as default
6
+ p as default
12
7
  };
13
8
  //# sourceMappingURL=index250.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index250.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js"],"sourcesContent":["function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };"],"names":["_extends","n","e","t"],"mappings":"AAAA,SAASA,IAAW;AAClB,SAAOA,IAAW,OAAO,SAAS,OAAO,OAAO,KAAI,IAAK,SAAUC,GAAG;AACpE,aAASC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AACzC,UAAIC,IAAI,UAAUD,CAAC;AACnB,eAAS,KAAKC,EAAG,EAAC,CAAA,GAAI,eAAe,KAAKA,GAAG,CAAC,MAAMF,EAAE,CAAC,IAAIE,EAAE,CAAC;AAAA,IAChE;AACA,WAAOF;AAAA,EACT,GAAGD,EAAS,MAAM,MAAM,SAAS;AACnC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index250.js","sources":["../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"],"sourcesContent":["import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };"],"names":["_setPrototypeOf","_inheritsLoose","t","o","setPrototypeOf"],"mappings":"AACA,OAAAA,OAAA;AAAA,SAASC,EAAeC,GAAGC,GAAG;AAC5B,EAAAD,EAAE,YAAY,OAAO,OAAOC,EAAE,SAAS,GAAGD,EAAE,UAAU,cAAcA,GAAGE,EAAeF,GAAGC,CAAC;AAC5F;","x_google_ignoreList":[0]}
package/dist/index251.js CHANGED
@@ -1,8 +1,173 @@
1
- import e from "./index254.js";
2
- function p(o, t) {
3
- o.prototype = Object.create(t.prototype), o.prototype.constructor = o, e(o, t);
4
- }
1
+ import { __spreadArray as D } from "./index254.js";
2
+ import { parse as ut } from "./index255.js";
3
+ var g = /* @__PURE__ */ new Map(), Y = function(t) {
4
+ return t.cloneNode(!0);
5
+ }, z = function() {
6
+ return window.location.protocol === "file:";
7
+ }, Z = function(t, o, n) {
8
+ var e = new XMLHttpRequest();
9
+ e.onreadystatechange = function() {
10
+ try {
11
+ if (!/\.svg/i.test(t) && e.readyState === 2) {
12
+ var s = e.getResponseHeader("Content-Type");
13
+ if (!s)
14
+ throw new Error("Content type not found");
15
+ var i = ut(s).type;
16
+ if (!(i === "image/svg+xml" || i === "text/plain"))
17
+ throw new Error("Invalid content type: ".concat(i));
18
+ }
19
+ if (e.readyState === 4) {
20
+ if (e.status === 404 || e.responseXML === null)
21
+ throw new Error(z() ? "Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver." : "Unable to load SVG file: " + t);
22
+ if (e.status === 200 || z() && e.status === 0)
23
+ n(null, e);
24
+ else
25
+ throw new Error("There was a problem injecting the SVG: " + e.status + " " + e.statusText);
26
+ }
27
+ } catch (a) {
28
+ if (e.abort(), a instanceof Error)
29
+ n(a, e);
30
+ else
31
+ throw a;
32
+ }
33
+ }, e.open("GET", t), e.withCredentials = o, e.overrideMimeType && e.overrideMimeType("text/xml"), e.send();
34
+ }, v = {}, B = function(t, o) {
35
+ v[t] = v[t] || [], v[t].push(o);
36
+ }, ft = function(t) {
37
+ for (var o = function(i, a) {
38
+ setTimeout(function() {
39
+ if (Array.isArray(v[t])) {
40
+ var u = g.get(t), p = v[t][i];
41
+ u instanceof SVGSVGElement && p(null, Y(u)), u instanceof Error && p(u), i === v[t].length - 1 && delete v[t];
42
+ }
43
+ }, 0);
44
+ }, n = 0, e = v[t].length; n < e; n++)
45
+ o(n);
46
+ }, lt = function(t, o, n) {
47
+ if (g.has(t)) {
48
+ var e = g.get(t);
49
+ if (e === void 0) {
50
+ B(t, n);
51
+ return;
52
+ }
53
+ if (e instanceof SVGSVGElement) {
54
+ n(null, Y(e));
55
+ return;
56
+ }
57
+ }
58
+ g.set(t, void 0), B(t, n), Z(t, o, function(s, i) {
59
+ var a;
60
+ s ? g.set(t, s) : ((a = i.responseXML) === null || a === void 0 ? void 0 : a.documentElement) instanceof SVGSVGElement && g.set(t, i.responseXML.documentElement), ft(t);
61
+ });
62
+ }, ct = function(t, o, n) {
63
+ Z(t, o, function(e, s) {
64
+ var i;
65
+ e ? n(e) : ((i = s.responseXML) === null || i === void 0 ? void 0 : i.documentElement) instanceof SVGSVGElement && n(null, s.responseXML.documentElement);
66
+ });
67
+ }, dt = 0, vt = function() {
68
+ return ++dt;
69
+ }, l = [], J = {}, pt = "http://www.w3.org/2000/svg", F = "http://www.w3.org/1999/xlink", K = function(t, o, n, e, s, i, a) {
70
+ var u = t.getAttribute("data-src") || t.getAttribute("src");
71
+ if (!u) {
72
+ a(new Error("Invalid data-src or src attribute"));
73
+ return;
74
+ }
75
+ if (l.indexOf(t) !== -1) {
76
+ l.splice(l.indexOf(t), 1), t = null;
77
+ return;
78
+ }
79
+ l.push(t), t.setAttribute("src", "");
80
+ var p = e ? lt : ct;
81
+ p(u, s, function(j, r) {
82
+ if (!r) {
83
+ l.splice(l.indexOf(t), 1), t = null, a(j);
84
+ return;
85
+ }
86
+ var w = t.getAttribute("id");
87
+ w && r.setAttribute("id", w);
88
+ var S = t.getAttribute("title");
89
+ S && r.setAttribute("title", S);
90
+ var E = t.getAttribute("width");
91
+ E && r.setAttribute("width", E);
92
+ var y = t.getAttribute("height");
93
+ y && r.setAttribute("height", y);
94
+ var G = Array.from(new Set(D(D(D([], (r.getAttribute("class") || "").split(" "), !0), ["injected-svg"], !1), (t.getAttribute("class") || "").split(" "), !0))).join(" ").trim();
95
+ r.setAttribute("class", G);
96
+ var b = t.getAttribute("style");
97
+ b && r.setAttribute("style", b), r.setAttribute("data-src", u);
98
+ var R = [].filter.call(t.attributes, function(f) {
99
+ return /^data-\w[\w-]*$/.test(f.name);
100
+ });
101
+ if (Array.prototype.forEach.call(R, function(f) {
102
+ f.name && f.value && r.setAttribute(f.name, f.value);
103
+ }), n) {
104
+ var h = {
105
+ clipPath: ["clip-path"],
106
+ "color-profile": ["color-profile"],
107
+ cursor: ["cursor"],
108
+ filter: ["filter"],
109
+ linearGradient: ["fill", "stroke"],
110
+ marker: ["marker", "marker-start", "marker-mid", "marker-end"],
111
+ mask: ["mask"],
112
+ path: [],
113
+ pattern: ["fill", "stroke"],
114
+ radialGradient: ["fill", "stroke"]
115
+ }, C, d, m, T, k;
116
+ Object.keys(h).forEach(function(f) {
117
+ C = f, m = h[f], d = r.querySelectorAll(C + "[id]");
118
+ for (var nt = function(I, mt) {
119
+ T = d[I].id, k = T + "-" + vt();
120
+ var M;
121
+ Array.prototype.forEach.call(m, function(W) {
122
+ M = r.querySelectorAll("[" + W + '*="' + T + '"]');
123
+ for (var O = 0, st = M.length; O < st; O++) {
124
+ var $ = M[O].getAttribute(W);
125
+ $ && !$.match(new RegExp('url\\("?#' + T + '"?\\)')) || M[O].setAttribute(W, "url(#" + k + ")");
126
+ }
127
+ });
128
+ for (var U = r.querySelectorAll("[*|href]"), H = [], N = 0, at = U.length; N < at; N++) {
129
+ var P = U[N].getAttributeNS(F, "href");
130
+ P && P.toString() === "#" + d[I].id && H.push(U[N]);
131
+ }
132
+ for (var Q = 0, ot = H.length; Q < ot; Q++)
133
+ H[Q].setAttributeNS(F, "href", "#" + k);
134
+ d[I].id = k;
135
+ }, _ = 0, it = d.length; _ < it; _++)
136
+ nt(_);
137
+ });
138
+ }
139
+ r.removeAttribute("xmlns:a");
140
+ for (var x = r.querySelectorAll("script"), L = [], V, q, A = 0, tt = x.length; A < tt; A++)
141
+ q = x[A].getAttribute("type"), (!q || q === "application/ecmascript" || q === "application/javascript" || q === "text/javascript") && (V = x[A].innerText || x[A].textContent, V && L.push(V), r.removeChild(x[A]));
142
+ if (L.length > 0 && (o === "always" || o === "once" && !J[u])) {
143
+ for (var X = 0, et = L.length; X < et; X++)
144
+ new Function(L[X])(window);
145
+ J[u] = !0;
146
+ }
147
+ var rt = r.querySelectorAll("style");
148
+ if (Array.prototype.forEach.call(rt, function(f) {
149
+ f.textContent += "";
150
+ }), r.setAttribute("xmlns", pt), r.setAttribute("xmlns:xlink", F), i(r), !t.parentNode) {
151
+ l.splice(l.indexOf(t), 1), t = null, a(new Error("Parent node is null"));
152
+ return;
153
+ }
154
+ t.parentNode.replaceChild(r, t), l.splice(l.indexOf(t), 1), t = null, a(null, r);
155
+ });
156
+ }, wt = function(t, o) {
157
+ var n = o === void 0 ? {} : o, e = n.afterAll, s = e === void 0 ? function() {
158
+ } : e, i = n.afterEach, a = i === void 0 ? function() {
159
+ } : i, u = n.beforeEach, p = u === void 0 ? function() {
160
+ } : u, j = n.cacheRequests, r = j === void 0 ? !0 : j, w = n.evalScripts, S = w === void 0 ? "never" : w, E = n.httpRequestWithCredentials, y = E === void 0 ? !1 : E, G = n.renumerateIRIElements, b = G === void 0 ? !0 : G;
161
+ if (t && "length" in t)
162
+ for (var R = 0, h = 0, C = t.length; h < C; h++)
163
+ K(t[h], S, b, r, y, p, function(d, m) {
164
+ a(d, m), t && "length" in t && t.length === ++R && s(R);
165
+ });
166
+ else t ? K(t, S, b, r, y, p, function(d, m) {
167
+ a(d, m), s(1), t = null;
168
+ }) : s(0);
169
+ };
5
170
  export {
6
- p as default
171
+ wt as SVGInjector
7
172
  };
8
173
  //# sourceMappingURL=index251.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index251.js","sources":["../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"],"sourcesContent":["import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };"],"names":["_setPrototypeOf","_inheritsLoose","t","o","setPrototypeOf"],"mappings":"AACA,OAAAA,OAAA;AAAA,SAASC,EAAeC,GAAGC,GAAG;AAC5B,EAAAD,EAAE,YAAY,OAAO,OAAOC,EAAE,SAAS,GAAGD,EAAE,UAAU,cAAcA,GAAGE,EAAeF,GAAGC,CAAC;AAC5F;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index251.js","sources":["../node_modules/@tanem/svg-injector/dist/svg-injector.esm.js"],"sourcesContent":["import { __spreadArray } from 'tslib';\nimport { parse } from 'content-type';\n\nvar cache = new Map();\n\nvar cloneSvg = function cloneSvg(sourceSvg) {\n return sourceSvg.cloneNode(true);\n};\n\nvar isLocal = function isLocal() {\n return window.location.protocol === 'file:';\n};\n\nvar makeAjaxRequest = function makeAjaxRequest(url, httpRequestWithCredentials, callback) {\n var httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = function () {\n try {\n if (!/\\.svg/i.test(url) && httpRequest.readyState === 2) {\n var contentType = httpRequest.getResponseHeader('Content-Type');\n if (!contentType) {\n throw new Error('Content type not found');\n }\n var type = parse(contentType).type;\n if (!(type === 'image/svg+xml' || type === 'text/plain')) {\n throw new Error(\"Invalid content type: \".concat(type));\n }\n }\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 404 || httpRequest.responseXML === null) {\n throw new Error(isLocal() ? 'Note: SVG injection ajax calls do not work locally without ' + 'adjusting security settings in your browser. Or consider ' + 'using a local webserver.' : 'Unable to load SVG file: ' + url);\n }\n if (httpRequest.status === 200 || isLocal() && httpRequest.status === 0) {\n callback(null, httpRequest);\n } else {\n throw new Error('There was a problem injecting the SVG: ' + httpRequest.status + ' ' + httpRequest.statusText);\n }\n }\n } catch (error) {\n httpRequest.abort();\n if (error instanceof Error) {\n callback(error, httpRequest);\n } else {\n throw error;\n }\n }\n };\n httpRequest.open('GET', url);\n httpRequest.withCredentials = httpRequestWithCredentials;\n if (httpRequest.overrideMimeType) {\n httpRequest.overrideMimeType('text/xml');\n }\n httpRequest.send();\n};\n\nvar requestQueue = {};\nvar queueRequest = function queueRequest(url, callback) {\n requestQueue[url] = requestQueue[url] || [];\n requestQueue[url].push(callback);\n};\nvar processRequestQueue = function processRequestQueue(url) {\n var _loop_1 = function _loop_1(i, len) {\n setTimeout(function () {\n if (Array.isArray(requestQueue[url])) {\n var cacheValue = cache.get(url);\n var callback = requestQueue[url][i];\n if (cacheValue instanceof SVGSVGElement) {\n callback(null, cloneSvg(cacheValue));\n }\n if (cacheValue instanceof Error) {\n callback(cacheValue);\n }\n if (i === requestQueue[url].length - 1) {\n delete requestQueue[url];\n }\n }\n }, 0);\n };\n for (var i = 0, len = requestQueue[url].length; i < len; i++) {\n _loop_1(i);\n }\n};\n\nvar loadSvgCached = function loadSvgCached(url, httpRequestWithCredentials, callback) {\n if (cache.has(url)) {\n var cacheValue = cache.get(url);\n if (cacheValue === undefined) {\n queueRequest(url, callback);\n return;\n }\n if (cacheValue instanceof SVGSVGElement) {\n callback(null, cloneSvg(cacheValue));\n return;\n }\n }\n cache.set(url, undefined);\n queueRequest(url, callback);\n makeAjaxRequest(url, httpRequestWithCredentials, function (error, httpRequest) {\n var _a;\n if (error) {\n cache.set(url, error);\n } else if (((_a = httpRequest.responseXML) === null || _a === void 0 ? void 0 : _a.documentElement) instanceof SVGSVGElement) {\n cache.set(url, httpRequest.responseXML.documentElement);\n }\n processRequestQueue(url);\n });\n};\n\nvar loadSvgUncached = function loadSvgUncached(url, httpRequestWithCredentials, callback) {\n makeAjaxRequest(url, httpRequestWithCredentials, function (error, httpRequest) {\n var _a;\n if (error) {\n callback(error);\n } else if (((_a = httpRequest.responseXML) === null || _a === void 0 ? void 0 : _a.documentElement) instanceof SVGSVGElement) {\n callback(null, httpRequest.responseXML.documentElement);\n }\n });\n};\n\nvar idCounter = 0;\nvar uniqueId = function uniqueId() {\n return ++idCounter;\n};\n\nvar injectedElements = [];\nvar ranScripts = {};\nvar svgNamespace = 'http://www.w3.org/2000/svg';\nvar xlinkNamespace = 'http://www.w3.org/1999/xlink';\nvar injectElement = function injectElement(el, evalScripts, renumerateIRIElements, cacheRequests, httpRequestWithCredentials, beforeEach, callback) {\n var elUrl = el.getAttribute('data-src') || el.getAttribute('src');\n if (!elUrl) {\n callback(new Error('Invalid data-src or src attribute'));\n return;\n }\n if (injectedElements.indexOf(el) !== -1) {\n injectedElements.splice(injectedElements.indexOf(el), 1);\n el = null;\n return;\n }\n injectedElements.push(el);\n el.setAttribute('src', '');\n var loadSvg = cacheRequests ? loadSvgCached : loadSvgUncached;\n loadSvg(elUrl, httpRequestWithCredentials, function (error, svg) {\n if (!svg) {\n injectedElements.splice(injectedElements.indexOf(el), 1);\n el = null;\n callback(error);\n return;\n }\n var elId = el.getAttribute('id');\n if (elId) {\n svg.setAttribute('id', elId);\n }\n var elTitle = el.getAttribute('title');\n if (elTitle) {\n svg.setAttribute('title', elTitle);\n }\n var elWidth = el.getAttribute('width');\n if (elWidth) {\n svg.setAttribute('width', elWidth);\n }\n var elHeight = el.getAttribute('height');\n if (elHeight) {\n svg.setAttribute('height', elHeight);\n }\n var mergedClasses = Array.from(new Set(__spreadArray(__spreadArray(__spreadArray([], (svg.getAttribute('class') || '').split(' '), true), ['injected-svg'], false), (el.getAttribute('class') || '').split(' '), true))).join(' ').trim();\n svg.setAttribute('class', mergedClasses);\n var elStyle = el.getAttribute('style');\n if (elStyle) {\n svg.setAttribute('style', elStyle);\n }\n svg.setAttribute('data-src', elUrl);\n var elData = [].filter.call(el.attributes, function (at) {\n return /^data-\\w[\\w-]*$/.test(at.name);\n });\n Array.prototype.forEach.call(elData, function (dataAttr) {\n if (dataAttr.name && dataAttr.value) {\n svg.setAttribute(dataAttr.name, dataAttr.value);\n }\n });\n if (renumerateIRIElements) {\n var iriElementsAndProperties_1 = {\n clipPath: ['clip-path'],\n 'color-profile': ['color-profile'],\n cursor: ['cursor'],\n filter: ['filter'],\n linearGradient: ['fill', 'stroke'],\n marker: ['marker', 'marker-start', 'marker-mid', 'marker-end'],\n mask: ['mask'],\n path: [],\n pattern: ['fill', 'stroke'],\n radialGradient: ['fill', 'stroke']\n };\n var element_1;\n var elements_1;\n var properties_1;\n var currentId_1;\n var newId_1;\n Object.keys(iriElementsAndProperties_1).forEach(function (key) {\n element_1 = key;\n properties_1 = iriElementsAndProperties_1[key];\n elements_1 = svg.querySelectorAll(element_1 + '[id]');\n var _loop_1 = function _loop_1(a, elementsLen) {\n currentId_1 = elements_1[a].id;\n newId_1 = currentId_1 + '-' + uniqueId();\n var referencingElements;\n Array.prototype.forEach.call(properties_1, function (property) {\n referencingElements = svg.querySelectorAll('[' + property + '*=\"' + currentId_1 + '\"]');\n for (var b = 0, referencingElementLen = referencingElements.length; b < referencingElementLen; b++) {\n var attrValue = referencingElements[b].getAttribute(property);\n if (attrValue && !attrValue.match(new RegExp('url\\\\(\"?#' + currentId_1 + '\"?\\\\)'))) {\n continue;\n }\n referencingElements[b].setAttribute(property, 'url(#' + newId_1 + ')');\n }\n });\n var allLinks = svg.querySelectorAll('[*|href]');\n var links = [];\n for (var c = 0, allLinksLen = allLinks.length; c < allLinksLen; c++) {\n var href = allLinks[c].getAttributeNS(xlinkNamespace, 'href');\n if (href && href.toString() === '#' + elements_1[a].id) {\n links.push(allLinks[c]);\n }\n }\n for (var d = 0, linksLen = links.length; d < linksLen; d++) {\n links[d].setAttributeNS(xlinkNamespace, 'href', '#' + newId_1);\n }\n elements_1[a].id = newId_1;\n };\n for (var a = 0, elementsLen = elements_1.length; a < elementsLen; a++) {\n _loop_1(a);\n }\n });\n }\n svg.removeAttribute('xmlns:a');\n var scripts = svg.querySelectorAll('script');\n var scriptsToEval = [];\n var script;\n var scriptType;\n for (var i = 0, scriptsLen = scripts.length; i < scriptsLen; i++) {\n scriptType = scripts[i].getAttribute('type');\n if (!scriptType || scriptType === 'application/ecmascript' || scriptType === 'application/javascript' || scriptType === 'text/javascript') {\n script = scripts[i].innerText || scripts[i].textContent;\n if (script) {\n scriptsToEval.push(script);\n }\n svg.removeChild(scripts[i]);\n }\n }\n if (scriptsToEval.length > 0 && (evalScripts === 'always' || evalScripts === 'once' && !ranScripts[elUrl])) {\n for (var l = 0, scriptsToEvalLen = scriptsToEval.length; l < scriptsToEvalLen; l++) {\n new Function(scriptsToEval[l])(window);\n }\n ranScripts[elUrl] = true;\n }\n var styleTags = svg.querySelectorAll('style');\n Array.prototype.forEach.call(styleTags, function (styleTag) {\n styleTag.textContent += '';\n });\n svg.setAttribute('xmlns', svgNamespace);\n svg.setAttribute('xmlns:xlink', xlinkNamespace);\n beforeEach(svg);\n if (!el.parentNode) {\n injectedElements.splice(injectedElements.indexOf(el), 1);\n el = null;\n callback(new Error('Parent node is null'));\n return;\n }\n el.parentNode.replaceChild(svg, el);\n injectedElements.splice(injectedElements.indexOf(el), 1);\n el = null;\n callback(null, svg);\n });\n};\n\nvar SVGInjector = function SVGInjector(elements, _a) {\n var _b = _a === void 0 ? {} : _a,\n _c = _b.afterAll,\n afterAll = _c === void 0 ? function () {\n return undefined;\n } : _c,\n _d = _b.afterEach,\n afterEach = _d === void 0 ? function () {\n return undefined;\n } : _d,\n _e = _b.beforeEach,\n beforeEach = _e === void 0 ? function () {\n return undefined;\n } : _e,\n _f = _b.cacheRequests,\n cacheRequests = _f === void 0 ? true : _f,\n _g = _b.evalScripts,\n evalScripts = _g === void 0 ? 'never' : _g,\n _h = _b.httpRequestWithCredentials,\n httpRequestWithCredentials = _h === void 0 ? false : _h,\n _j = _b.renumerateIRIElements,\n renumerateIRIElements = _j === void 0 ? true : _j;\n if (elements && 'length' in elements) {\n var elementsLoaded_1 = 0;\n for (var i = 0, j = elements.length; i < j; i++) {\n injectElement(elements[i], evalScripts, renumerateIRIElements, cacheRequests, httpRequestWithCredentials, beforeEach, function (error, svg) {\n afterEach(error, svg);\n if (elements && 'length' in elements && elements.length === ++elementsLoaded_1) {\n afterAll(elementsLoaded_1);\n }\n });\n }\n } else if (elements) {\n injectElement(elements, evalScripts, renumerateIRIElements, cacheRequests, httpRequestWithCredentials, beforeEach, function (error, svg) {\n afterEach(error, svg);\n afterAll(1);\n elements = null;\n });\n } else {\n afterAll(0);\n }\n};\n\nexport { SVGInjector };\n//# sourceMappingURL=svg-injector.esm.js.map\n"],"names":["__spreadArray","parse_1","cache","cloneSvg","sourceSvg","isLocal","makeAjaxRequest","url","httpRequestWithCredentials","callback","httpRequest","contentType","type","parse","error","requestQueue","queueRequest","processRequestQueue","_loop_1","len","cacheValue","i","loadSvgCached","_a","loadSvgUncached","idCounter","uniqueId","injectedElements","ranScripts","svgNamespace","xlinkNamespace","injectElement","el","evalScripts","renumerateIRIElements","cacheRequests","beforeEach","elUrl","loadSvg","svg","elId","elTitle","elWidth","elHeight","mergedClasses","elStyle","elData","at","dataAttr","iriElementsAndProperties_1","element_1","elements_1","properties_1","currentId_1","newId_1","key","a","elementsLen","referencingElements","property","b","referencingElementLen","attrValue","allLinks","links","c","allLinksLen","href","d","linksLen","scripts","scriptsToEval","script","scriptType","scriptsLen","l","scriptsToEvalLen","styleTags","styleTag","SVGInjector","elements","_b","_c","afterAll","_d","afterEach","_e","_f","_g","_h","_j","elementsLoaded_1","j"],"mappings":"AAGA,SAAA,iBAAAA,SAAA;AAAA,SAAA,SAAAC,UAAA;AAAA,IAAIC,IAAQ,oBAAI,IAAG,GAEfC,IAAW,SAAkBC,GAAW;AAC1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