@dbcdk/react-components 0.0.169 → 0.0.171

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 (576) hide show
  1. package/dist/assets/logo.cjs +87 -0
  2. package/dist/assets/logo.d.ts +2 -0
  3. package/dist/assets/logo.js +85 -0
  4. package/dist/client.cjs +629 -0
  5. package/dist/client.d.ts +89 -0
  6. package/dist/client.js +90 -0
  7. package/dist/components/accordion/Accordion.cjs +127 -0
  8. package/dist/components/accordion/Accordion.d.ts +36 -0
  9. package/dist/components/accordion/Accordion.js +121 -0
  10. package/dist/components/accordion/Accordion.module.css +41 -0
  11. package/dist/components/accordion/components/AccordionRow.cjs +129 -0
  12. package/dist/components/accordion/components/AccordionRow.d.ts +14 -0
  13. package/dist/components/accordion/components/AccordionRow.js +123 -0
  14. package/dist/components/accordion/components/AccordionRow.module.css +129 -0
  15. package/dist/components/alert/Alert.cjs +52 -0
  16. package/dist/components/alert/Alert.d.ts +14 -0
  17. package/dist/components/alert/Alert.js +46 -0
  18. package/dist/components/alert/Alert.module.css +102 -0
  19. package/dist/components/app-header/AppHeader.cjs +14 -0
  20. package/dist/components/app-header/AppHeader.d.ts +8 -0
  21. package/dist/components/app-header/AppHeader.js +8 -0
  22. package/dist/components/app-header/AppHeader.module.css +74 -0
  23. package/dist/components/attribute-chip/AttributeChip.cjs +36 -0
  24. package/dist/components/attribute-chip/AttributeChip.d.ts +11 -0
  25. package/dist/components/attribute-chip/AttributeChip.js +30 -0
  26. package/dist/components/attribute-chip/AttributeChip.module.css +64 -0
  27. package/dist/components/avatar/Avatar.cjs +111 -0
  28. package/dist/components/avatar/Avatar.d.ts +17 -0
  29. package/dist/components/avatar/Avatar.js +86 -0
  30. package/dist/components/avatar/Avatar.module.css +91 -0
  31. package/dist/components/breadcrumbs/Breadcrumbs.cjs +24 -0
  32. package/dist/components/breadcrumbs/Breadcrumbs.d.ts +12 -0
  33. package/dist/components/breadcrumbs/Breadcrumbs.js +18 -0
  34. package/dist/components/breadcrumbs/Breadcrumbs.module.css +77 -0
  35. package/dist/components/button/Button.cjs +150 -0
  36. package/dist/components/button/Button.d.ts +18 -0
  37. package/dist/components/button/Button.js +125 -0
  38. package/dist/components/button/Button.module.css +266 -0
  39. package/dist/components/button-select/ButtonSelect.cjs +35 -0
  40. package/dist/components/button-select/ButtonSelect.d.ts +16 -0
  41. package/dist/components/button-select/ButtonSelect.js +29 -0
  42. package/dist/components/button-select/ButtonSelect.module.css +40 -0
  43. package/dist/components/card/Card.cjs +109 -0
  44. package/dist/components/card/Card.d.ts +37 -0
  45. package/dist/components/card/Card.js +103 -0
  46. package/dist/components/card/Card.module.css +191 -0
  47. package/dist/components/card/components/CardMeta.cjs +62 -0
  48. package/dist/components/card/components/CardMeta.d.ts +16 -0
  49. package/dist/components/card/components/CardMeta.js +55 -0
  50. package/dist/components/card/components/CardMeta.module.css +55 -0
  51. package/dist/components/card-container/CardContainer.cjs +34 -0
  52. package/dist/components/card-container/CardContainer.d.ts +12 -0
  53. package/dist/components/card-container/CardContainer.js +28 -0
  54. package/dist/components/card-container/CardContainer.module.css +63 -0
  55. package/dist/components/chip/Chip.cjs +65 -0
  56. package/dist/components/chip/Chip.d.ts +16 -0
  57. package/dist/components/chip/Chip.js +59 -0
  58. package/dist/components/chip/Chip.module.css +247 -0
  59. package/dist/components/circle/Circle.cjs +39 -0
  60. package/dist/components/circle/Circle.d.ts +14 -0
  61. package/dist/components/circle/Circle.js +33 -0
  62. package/dist/components/circle/Circle.module.css +138 -0
  63. package/dist/components/clear-button/ClearButton.cjs +33 -0
  64. package/dist/components/clear-button/ClearButton.d.ts +8 -0
  65. package/dist/components/clear-button/ClearButton.js +27 -0
  66. package/dist/components/clear-button/ClearButton.module.css +26 -0
  67. package/dist/components/code-block/CodeBlock.cjs +107 -0
  68. package/dist/components/code-block/CodeBlock.d.ts +11 -0
  69. package/dist/components/code-block/CodeBlock.js +101 -0
  70. package/dist/components/code-block/CodeBlock.module.css +135 -0
  71. package/dist/components/copy-button/CopyButton.cjs +139 -0
  72. package/dist/components/copy-button/CopyButton.d.ts +13 -0
  73. package/dist/components/copy-button/CopyButton.js +133 -0
  74. package/dist/components/copy-button/CopyButton.module.css +22 -0
  75. package/dist/components/datetime-picker/DateTimePicker.cjs +563 -0
  76. package/dist/components/datetime-picker/DateTimePicker.d.ts +66 -0
  77. package/dist/components/datetime-picker/DateTimePicker.js +557 -0
  78. package/dist/components/datetime-picker/DateTimePicker.module.css +155 -0
  79. package/dist/components/datetime-picker/dateTimeHelpers.cjs +185 -0
  80. package/dist/components/datetime-picker/dateTimeHelpers.d.ts +37 -0
  81. package/dist/components/datetime-picker/dateTimeHelpers.js +166 -0
  82. package/dist/components/divider/Divider.cjs +22 -0
  83. package/dist/components/divider/Divider.d.ts +5 -0
  84. package/dist/components/divider/Divider.js +20 -0
  85. package/dist/components/environment-banner/EnvironmentBanner.cjs +20 -0
  86. package/dist/components/environment-banner/EnvironmentBanner.d.ts +13 -0
  87. package/dist/components/environment-banner/EnvironmentBanner.js +14 -0
  88. package/dist/components/environment-banner/EnvironmentBanner.module.css +54 -0
  89. package/dist/components/filter-field/FilterField.cjs +324 -0
  90. package/dist/components/filter-field/FilterField.d.ts +39 -0
  91. package/dist/components/filter-field/FilterField.js +317 -0
  92. package/dist/components/filter-field/FilterField.module.css +304 -0
  93. package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.cjs +115 -0
  94. package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.d.ts +35 -0
  95. package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.js +108 -0
  96. package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.module.css +59 -0
  97. package/dist/components/forms/checkbox/Checkbox.cjs +99 -0
  98. package/dist/components/forms/checkbox/Checkbox.d.ts +39 -0
  99. package/dist/components/forms/checkbox/Checkbox.js +93 -0
  100. package/dist/components/forms/checkbox/Checkbox.module.css +110 -0
  101. package/dist/components/forms/checkbox-group/CheckboxGroup.cjs +121 -0
  102. package/dist/components/forms/checkbox-group/CheckboxGroup.d.ts +47 -0
  103. package/dist/components/forms/checkbox-group/CheckboxGroup.js +115 -0
  104. package/dist/components/forms/checkbox-group/CheckboxGroup.module.css +115 -0
  105. package/dist/components/forms/file-upload/FileUpload.cjs +127 -0
  106. package/dist/components/forms/file-upload/FileUpload.d.ts +18 -0
  107. package/dist/components/forms/file-upload/FileUpload.js +121 -0
  108. package/dist/components/forms/file-upload/FileUpload.module.css +75 -0
  109. package/dist/components/forms/form-select/FormSelect.cjs +191 -0
  110. package/dist/components/forms/form-select/FormSelect.d.ts +35 -0
  111. package/dist/components/forms/form-select/FormSelect.js +166 -0
  112. package/dist/components/forms/form-select/FormSelect.module.css +236 -0
  113. package/dist/components/forms/input/Input.cjs +190 -0
  114. package/dist/components/forms/input/Input.d.ts +37 -0
  115. package/dist/components/forms/input/Input.js +184 -0
  116. package/dist/components/forms/input/Input.module.css +478 -0
  117. package/dist/components/forms/input-container/InputContainer.cjs +72 -0
  118. package/dist/components/forms/input-container/InputContainer.d.ts +18 -0
  119. package/dist/components/forms/input-container/InputContainer.js +66 -0
  120. package/dist/components/forms/input-container/InputContainer.module.css +59 -0
  121. package/dist/components/forms/multi-select/MultiSelect.cjs +229 -0
  122. package/dist/components/forms/multi-select/MultiSelect.d.ts +26 -0
  123. package/dist/components/forms/multi-select/MultiSelect.js +227 -0
  124. package/dist/components/forms/radio-buttons/RadioButton.cjs +94 -0
  125. package/dist/components/forms/radio-buttons/RadioButton.d.ts +46 -0
  126. package/dist/components/forms/radio-buttons/RadioButton.js +88 -0
  127. package/dist/components/forms/radio-buttons/RadioButtonGroup.cjs +74 -0
  128. package/dist/components/forms/radio-buttons/RadioButtonGroup.d.ts +25 -0
  129. package/dist/components/forms/radio-buttons/RadioButtonGroup.js +72 -0
  130. package/dist/components/forms/radio-buttons/RadioButtons.module.css +131 -0
  131. package/dist/components/forms/select/Select.cjs +287 -0
  132. package/dist/components/forms/select/Select.d.ts +24 -0
  133. package/dist/components/forms/select/Select.js +281 -0
  134. package/dist/components/forms/select/Select.module.css +41 -0
  135. package/dist/components/forms/switch/Switch.cjs +93 -0
  136. package/dist/components/forms/switch/Switch.d.ts +37 -0
  137. package/dist/components/forms/switch/Switch.js +87 -0
  138. package/dist/components/forms/switch/Switch.module.css +89 -0
  139. package/dist/components/forms/text-area/Textarea.cjs +118 -0
  140. package/dist/components/forms/text-area/Textarea.d.ts +17 -0
  141. package/dist/components/forms/text-area/Textarea.js +112 -0
  142. package/dist/components/forms/text-area/Textarea.module.css +70 -0
  143. package/dist/components/forms/typeahead/Typeahead.cjs +824 -0
  144. package/dist/components/forms/typeahead/Typeahead.d.ts +46 -0
  145. package/dist/components/forms/typeahead/Typeahead.js +800 -0
  146. package/dist/components/forms/typeahead/Typeahead.module.css +38 -0
  147. package/dist/components/grid/Grid.cjs +58 -0
  148. package/dist/components/grid/Grid.d.ts +29 -0
  149. package/dist/components/grid/Grid.js +51 -0
  150. package/dist/components/grid/Grid.module.css +44 -0
  151. package/dist/components/headline/CollapsibleHeadline.cjs +84 -0
  152. package/dist/components/headline/CollapsibleHeadline.d.ts +25 -0
  153. package/dist/components/headline/CollapsibleHeadline.js +78 -0
  154. package/dist/components/headline/Headline.cjs +59 -0
  155. package/dist/components/headline/Headline.d.ts +20 -0
  156. package/dist/components/headline/Headline.js +53 -0
  157. package/dist/components/headline/Headline.module.css +167 -0
  158. package/dist/components/highlighted-text/HighlightedText.cjs +21 -0
  159. package/dist/components/highlighted-text/HighlightedText.d.ts +7 -0
  160. package/dist/components/highlighted-text/HighlightedText.js +19 -0
  161. package/dist/components/hyperlink/Hyperlink.cjs +113 -0
  162. package/dist/components/hyperlink/Hyperlink.d.ts +24 -0
  163. package/dist/components/hyperlink/Hyperlink.js +88 -0
  164. package/dist/components/hyperlink/Hyperlink.module.css +121 -0
  165. package/dist/components/icon/Icon.cjs +39 -0
  166. package/dist/components/icon/Icon.d.ts +14 -0
  167. package/dist/components/icon/Icon.js +32 -0
  168. package/dist/components/icon/Icon.module.css +50 -0
  169. package/dist/components/inline-status/InlineStatus.cjs +39 -0
  170. package/dist/components/inline-status/InlineStatus.d.ts +11 -0
  171. package/dist/components/inline-status/InlineStatus.js +33 -0
  172. package/dist/components/inline-status/InlineStatus.module.css +98 -0
  173. package/dist/components/interval-select/IntervalSelect.cjs +203 -0
  174. package/dist/components/interval-select/IntervalSelect.d.ts +37 -0
  175. package/dist/components/interval-select/IntervalSelect.js +201 -0
  176. package/dist/components/json-viewer/JsonNode.cjs +124 -0
  177. package/dist/components/json-viewer/JsonNode.d.ts +3 -0
  178. package/dist/components/json-viewer/JsonNode.js +118 -0
  179. package/dist/components/json-viewer/JsonViewer.cjs +164 -0
  180. package/dist/components/json-viewer/JsonViewer.d.ts +4 -0
  181. package/dist/components/json-viewer/JsonViewer.js +158 -0
  182. package/dist/components/json-viewer/JsonViewer.module.css +346 -0
  183. package/dist/components/json-viewer/types.cjs +2 -0
  184. package/dist/components/json-viewer/types.d.ts +33 -0
  185. package/dist/components/json-viewer/types.js +1 -0
  186. package/dist/components/json-viewer/useClipboardStatus.cjs +15 -0
  187. package/dist/components/json-viewer/useClipboardStatus.d.ts +4 -0
  188. package/dist/components/json-viewer/useClipboardStatus.js +13 -0
  189. package/dist/components/json-viewer/utils.cjs +126 -0
  190. package/dist/components/json-viewer/utils.d.ts +17 -0
  191. package/dist/components/json-viewer/utils.js +111 -0
  192. package/dist/components/lightbox/Lightbox.cjs +291 -0
  193. package/dist/components/lightbox/Lightbox.d.ts +36 -0
  194. package/dist/components/lightbox/Lightbox.js +285 -0
  195. package/dist/components/lightbox/Lightbox.module.css +214 -0
  196. package/dist/components/media-card/MediaCard.cjs +87 -0
  197. package/dist/components/media-card/MediaCard.d.ts +21 -0
  198. package/dist/components/media-card/MediaCard.js +80 -0
  199. package/dist/components/media-card/MediaCard.module.css +91 -0
  200. package/dist/components/menu/Menu.cjs +455 -0
  201. package/dist/components/menu/Menu.d.ts +102 -0
  202. package/dist/components/menu/Menu.js +430 -0
  203. package/dist/components/menu/Menu.module.css +286 -0
  204. package/dist/components/meta-bar/MetaBar.cjs +28 -0
  205. package/dist/components/meta-bar/MetaBar.d.ts +12 -0
  206. package/dist/components/meta-bar/MetaBar.js +22 -0
  207. package/dist/components/meta-bar/MetaBar.module.css +27 -0
  208. package/dist/components/metric-tile/MetricTile.cjs +33 -0
  209. package/dist/components/metric-tile/MetricTile.d.ts +15 -0
  210. package/dist/components/metric-tile/MetricTile.js +27 -0
  211. package/dist/components/metric-tile/MetricTile.module.css +103 -0
  212. package/dist/components/nav-bar/NavBar.cjs +107 -0
  213. package/dist/components/nav-bar/NavBar.d.ts +44 -0
  214. package/dist/components/nav-bar/NavBar.js +101 -0
  215. package/dist/components/nav-bar/NavBar.module.css +243 -0
  216. package/dist/components/overlay/fade-overlay/FadeOverlay.cjs +30 -0
  217. package/dist/components/overlay/fade-overlay/FadeOverlay.d.ts +13 -0
  218. package/dist/components/overlay/fade-overlay/FadeOverlay.js +24 -0
  219. package/dist/components/overlay/fade-overlay/FadeOverlay.module.css +54 -0
  220. package/dist/components/overlay/modal/Modal.cjs +200 -0
  221. package/dist/components/overlay/modal/Modal.d.ts +30 -0
  222. package/dist/components/overlay/modal/Modal.js +194 -0
  223. package/dist/components/overlay/modal/Modal.module.css +112 -0
  224. package/dist/components/overlay/modal/provider/ModalProvider.cjs +98 -0
  225. package/dist/components/overlay/modal/provider/ModalProvider.d.ts +23 -0
  226. package/dist/components/overlay/modal/provider/ModalProvider.js +95 -0
  227. package/dist/components/overlay/side-panel/SidePanel.cjs +173 -0
  228. package/dist/components/overlay/side-panel/SidePanel.d.ts +25 -0
  229. package/dist/components/overlay/side-panel/SidePanel.js +167 -0
  230. package/dist/components/overlay/side-panel/SidePanel.module.css +177 -0
  231. package/dist/components/overlay/side-panel/useSidePanel.cjs +16 -0
  232. package/dist/components/overlay/side-panel/useSidePanel.d.ts +5 -0
  233. package/dist/components/overlay/side-panel/useSidePanel.js +14 -0
  234. package/dist/components/overlay/tooltip/Tooltip.cjs +56 -0
  235. package/dist/components/overlay/tooltip/Tooltip.d.ts +12 -0
  236. package/dist/components/overlay/tooltip/Tooltip.js +54 -0
  237. package/dist/components/overlay/tooltip/Tooltip.module.css +104 -0
  238. package/dist/components/overlay/tooltip/TooltipProvider.cjs +238 -0
  239. package/dist/components/overlay/tooltip/TooltipProvider.d.ts +20 -0
  240. package/dist/components/overlay/tooltip/TooltipProvider.js +231 -0
  241. package/dist/components/overlay/tooltip/useTooltipTrigger.cjs +117 -0
  242. package/dist/components/overlay/tooltip/useTooltipTrigger.d.ts +28 -0
  243. package/dist/components/overlay/tooltip/useTooltipTrigger.js +115 -0
  244. package/dist/components/page/Page.cjs +64 -0
  245. package/dist/components/page/Page.d.ts +21 -0
  246. package/dist/components/page/Page.js +58 -0
  247. package/dist/components/page/Page.module.css +95 -0
  248. package/dist/components/page-layout/PageLayout.cjs +126 -0
  249. package/dist/components/page-layout/PageLayout.d.ts +47 -0
  250. package/dist/components/page-layout/PageLayout.js +120 -0
  251. package/dist/components/page-layout/PageLayout.module.css +333 -0
  252. package/dist/components/page-layout/components/footer/Footer.cjs +53 -0
  253. package/dist/components/page-layout/components/footer/Footer.d.ts +14 -0
  254. package/dist/components/page-layout/components/footer/Footer.js +47 -0
  255. package/dist/components/page-layout/components/footer/Footer.module.css +86 -0
  256. package/dist/components/pagination/Pagination.cjs +161 -0
  257. package/dist/components/pagination/Pagination.d.ts +21 -0
  258. package/dist/components/pagination/Pagination.js +155 -0
  259. package/dist/components/pagination/Pagination.module.css +25 -0
  260. package/dist/components/panel/Panel.cjs +38 -0
  261. package/dist/components/panel/Panel.d.ts +13 -0
  262. package/dist/components/panel/Panel.js +32 -0
  263. package/dist/components/panel/Panel.module.css +30 -0
  264. package/dist/components/popover/Popover.cjs +331 -0
  265. package/dist/components/popover/Popover.d.ts +27 -0
  266. package/dist/components/popover/Popover.js +307 -0
  267. package/dist/components/popover/Popover.module.css +52 -0
  268. package/dist/components/search-box/SearchBox.cjs +297 -0
  269. package/dist/components/search-box/SearchBox.d.ts +30 -0
  270. package/dist/components/search-box/SearchBox.js +291 -0
  271. package/dist/components/search-box/SearchBox.module.css +27 -0
  272. package/dist/components/section-label/SectionLabel.cjs +18 -0
  273. package/dist/components/section-label/SectionLabel.d.ts +5 -0
  274. package/dist/components/section-label/SectionLabel.js +12 -0
  275. package/dist/components/section-label/SectionLabel.module.css +12 -0
  276. package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +130 -0
  277. package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +27 -0
  278. package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +124 -0
  279. package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +187 -0
  280. package/dist/components/sidebar/Sidebar.cjs +41 -0
  281. package/dist/components/sidebar/Sidebar.d.ts +23 -0
  282. package/dist/components/sidebar/Sidebar.js +39 -0
  283. package/dist/components/sidebar/components/SidebarItem.cjs +29 -0
  284. package/dist/components/sidebar/components/SidebarItem.d.ts +11 -0
  285. package/dist/components/sidebar/components/SidebarItem.js +27 -0
  286. package/dist/components/sidebar/components/SidebarItem.module.css +0 -0
  287. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +153 -0
  288. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts +13 -0
  289. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +147 -0
  290. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +47 -0
  291. package/dist/components/sidebar/components/sidebar-container/SidebarContainer.cjs +220 -0
  292. package/dist/components/sidebar/components/sidebar-container/SidebarContainer.d.ts +18 -0
  293. package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +213 -0
  294. package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +293 -0
  295. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +54 -0
  296. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.d.ts +13 -0
  297. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +47 -0
  298. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +117 -0
  299. package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +61 -0
  300. package/dist/components/sidebar/components/sidebar-items/SidebarItems.d.ts +4 -0
  301. package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +55 -0
  302. package/dist/components/sidebar/components/sidebar-items/SidebarItems.module.css +20 -0
  303. package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.cjs +96 -0
  304. package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.d.ts +7 -0
  305. package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +90 -0
  306. package/dist/components/sidebar/providers/SidebarProvider.cjs +223 -0
  307. package/dist/components/sidebar/providers/SidebarProvider.d.ts +34 -0
  308. package/dist/components/sidebar/providers/SidebarProvider.js +220 -0
  309. package/dist/components/skeleton-loader/SkeletonLoader.cjs +442 -0
  310. package/dist/components/skeleton-loader/SkeletonLoader.d.ts +9 -0
  311. package/dist/components/skeleton-loader/SkeletonLoader.js +440 -0
  312. package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.cjs +42 -0
  313. package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.d.ts +11 -0
  314. package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +36 -0
  315. package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +55 -0
  316. package/dist/components/split-button/SplitButton.cjs +46 -0
  317. package/dist/components/split-button/SplitButton.d.ts +16 -0
  318. package/dist/components/split-button/SplitButton.js +40 -0
  319. package/dist/components/split-button/SplitButton.module.css +32 -0
  320. package/dist/components/split-pane/SplitPane.cjs +191 -0
  321. package/dist/components/split-pane/SplitPane.d.ts +21 -0
  322. package/dist/components/split-pane/SplitPane.js +182 -0
  323. package/dist/components/split-pane/SplitPane.module.css +118 -0
  324. package/dist/components/split-pane/provider/SplitPaneContext.cjs +129 -0
  325. package/dist/components/split-pane/provider/SplitPaneContext.d.ts +24 -0
  326. package/dist/components/split-pane/provider/SplitPaneContext.js +121 -0
  327. package/dist/components/stack/Stack.cjs +56 -0
  328. package/dist/components/stack/Stack.d.ts +26 -0
  329. package/dist/components/stack/Stack.js +50 -0
  330. package/dist/components/stack/Stack.module.css +77 -0
  331. package/dist/components/state-page/StatePage.cjs +48 -0
  332. package/dist/components/state-page/StatePage.d.ts +10 -0
  333. package/dist/components/state-page/StatePage.js +42 -0
  334. package/dist/components/state-page/StatePage.module.css +9 -0
  335. package/dist/components/state-page/empty.cjs +664 -0
  336. package/dist/components/state-page/empty.d.ts +2 -0
  337. package/dist/components/state-page/empty.js +662 -0
  338. package/dist/components/state-page/error.cjs +310 -0
  339. package/dist/components/state-page/error.d.ts +2 -0
  340. package/dist/components/state-page/error.js +308 -0
  341. package/dist/components/state-page/notFound.cjs +243 -0
  342. package/dist/components/state-page/notFound.d.ts +2 -0
  343. package/dist/components/state-page/notFound.js +241 -0
  344. package/dist/components/sticky-footer-layout/StickyFooterLayout.cjs +98 -0
  345. package/dist/components/sticky-footer-layout/StickyFooterLayout.d.ts +14 -0
  346. package/dist/components/sticky-footer-layout/StickyFooterLayout.js +96 -0
  347. package/dist/components/table/Table.cjs +240 -0
  348. package/dist/components/table/Table.d.ts +4 -0
  349. package/dist/components/table/Table.js +234 -0
  350. package/dist/components/table/Table.module.css +704 -0
  351. package/dist/components/table/Table.types.cjs +2 -0
  352. package/dist/components/table/Table.types.d.ts +91 -0
  353. package/dist/components/table/Table.types.js +1 -0
  354. package/dist/components/table/TanstackTable.cjs +191 -0
  355. package/dist/components/table/TanstackTable.d.ts +15 -0
  356. package/dist/components/table/TanstackTable.js +166 -0
  357. package/dist/components/table/components/TableBody.cjs +58 -0
  358. package/dist/components/table/components/TableBody.d.ts +28 -0
  359. package/dist/components/table/components/TableBody.js +52 -0
  360. package/dist/components/table/components/TableHeader.cjs +56 -0
  361. package/dist/components/table/components/TableHeader.d.ts +16 -0
  362. package/dist/components/table/components/TableHeader.js +50 -0
  363. package/dist/components/table/components/TableHeaderCell.cjs +68 -0
  364. package/dist/components/table/components/TableHeaderCell.d.ts +12 -0
  365. package/dist/components/table/components/TableHeaderCell.js +62 -0
  366. package/dist/components/table/components/TablePagination.cjs +2 -0
  367. package/dist/components/table/components/TablePagination.d.ts +0 -0
  368. package/dist/components/table/components/TablePagination.js +1 -0
  369. package/dist/components/table/components/TableRow.cjs +287 -0
  370. package/dist/components/table/components/TableRow.d.ts +28 -0
  371. package/dist/components/table/components/TableRow.js +281 -0
  372. package/dist/components/table/components/TableSelectionCell.cjs +41 -0
  373. package/dist/components/table/components/TableSelectionCell.d.ts +9 -0
  374. package/dist/components/table/components/TableSelectionCell.js +35 -0
  375. package/dist/components/table/components/column-resizer/ColumnResizer.cjs +25 -0
  376. package/dist/components/table/components/column-resizer/ColumnResizer.d.ts +7 -0
  377. package/dist/components/table/components/column-resizer/ColumnResizer.js +19 -0
  378. package/dist/components/table/components/column-resizer/ColumnResizer.module.css +24 -0
  379. package/dist/components/table/components/empty-state/EmptyState.cjs +33 -0
  380. package/dist/components/table/components/empty-state/EmptyState.d.ts +21 -0
  381. package/dist/components/table/components/empty-state/EmptyState.js +31 -0
  382. package/dist/components/table/components/empty-state/EmptyState.module.css +4 -0
  383. package/dist/components/table/components/table-settings/TableSettings.cjs +139 -0
  384. package/dist/components/table/components/table-settings/TableSettings.d.ts +18 -0
  385. package/dist/components/table/components/table-settings/TableSettings.js +137 -0
  386. package/dist/components/table/hooks/useTableRowInteractions.cjs +47 -0
  387. package/dist/components/table/hooks/useTableRowInteractions.d.ts +15 -0
  388. package/dist/components/table/hooks/useTableRowInteractions.js +45 -0
  389. package/dist/components/table/table.classes.cjs +49 -0
  390. package/dist/components/table/table.classes.d.ts +10 -0
  391. package/dist/components/table/table.classes.js +40 -0
  392. package/dist/components/table/table.utils.cjs +59 -0
  393. package/dist/components/table/table.utils.d.ts +18 -0
  394. package/dist/components/table/table.utils.js +46 -0
  395. package/dist/components/table/tanstackTable.utils.cjs +181 -0
  396. package/dist/components/table/tanstackTable.utils.d.ts +29 -0
  397. package/dist/components/table/tanstackTable.utils.js +174 -0
  398. package/dist/components/tabs/Tabs.cjs +187 -0
  399. package/dist/components/tabs/Tabs.d.ts +52 -0
  400. package/dist/components/tabs/Tabs.js +181 -0
  401. package/dist/components/tabs/Tabs.module.css +263 -0
  402. package/dist/components/theme-button/ThemeButton.cjs +75 -0
  403. package/dist/components/theme-button/ThemeButton.d.ts +8 -0
  404. package/dist/components/theme-button/ThemeButton.js +72 -0
  405. package/dist/components/toast/Toast.cjs +68 -0
  406. package/dist/components/toast/Toast.d.ts +15 -0
  407. package/dist/components/toast/Toast.js +62 -0
  408. package/dist/components/toast/Toast.module.css +165 -0
  409. package/dist/components/toast/provider/ToastProvider.cjs +105 -0
  410. package/dist/components/toast/provider/ToastProvider.d.ts +24 -0
  411. package/dist/components/toast/provider/ToastProvider.js +97 -0
  412. package/dist/components/user-display/UserDisplay.cjs +22 -0
  413. package/dist/components/user-display/UserDisplay.d.ts +10 -0
  414. package/dist/components/user-display/UserDisplay.js +16 -0
  415. package/dist/components/user-display/UserDisplay.module.css +25 -0
  416. package/dist/constants/chart-colors.cjs +10 -0
  417. package/dist/constants/chart-colors.d.ts +2 -0
  418. package/dist/constants/chart-colors.js +8 -0
  419. package/dist/constants/chart-colors.types.cjs +2 -0
  420. package/dist/constants/chart-colors.types.d.ts +3 -0
  421. package/dist/constants/chart-colors.types.js +1 -0
  422. package/dist/constants/severity.cjs +33 -0
  423. package/dist/constants/severity.d.ts +4 -0
  424. package/dist/constants/severity.js +29 -0
  425. package/dist/constants/severity.types.cjs +2 -0
  426. package/dist/constants/severity.types.d.ts +1 -0
  427. package/dist/constants/severity.types.js +1 -0
  428. package/dist/constants/sizes.cjs +11 -0
  429. package/dist/constants/sizes.d.ts +2 -0
  430. package/dist/constants/sizes.js +9 -0
  431. package/dist/hooks/useDeviceSize.cjs +33 -0
  432. package/dist/hooks/useDeviceSize.d.ts +2 -0
  433. package/dist/hooks/useDeviceSize.js +31 -0
  434. package/dist/hooks/useListNavigation.cjs +237 -0
  435. package/dist/hooks/useListNavigation.d.ts +24 -0
  436. package/dist/hooks/useListNavigation.js +235 -0
  437. package/dist/hooks/usePagination.cjs +144 -0
  438. package/dist/hooks/usePagination.d.ts +38 -0
  439. package/dist/hooks/usePagination.js +142 -0
  440. package/dist/hooks/usePersistentState.cjs +60 -0
  441. package/dist/hooks/usePersistentState.d.ts +33 -0
  442. package/dist/hooks/usePersistentState.js +58 -0
  443. package/dist/hooks/useSorting.cjs +120 -0
  444. package/dist/hooks/useSorting.d.ts +50 -0
  445. package/dist/hooks/useSorting.js +117 -0
  446. package/dist/hooks/useTableData.cjs +75 -0
  447. package/dist/hooks/useTableData.d.ts +42 -0
  448. package/dist/hooks/useTableData.js +73 -0
  449. package/dist/hooks/useTableSelection.cjs +172 -0
  450. package/dist/hooks/useTableSelection.d.ts +27 -0
  451. package/dist/hooks/useTableSelection.js +170 -0
  452. package/dist/hooks/useTableSettings.cjs +90 -0
  453. package/dist/hooks/useTableSettings.d.ts +26 -0
  454. package/dist/hooks/useTableSettings.js +87 -0
  455. package/dist/hooks/useTheme.cjs +64 -0
  456. package/dist/hooks/useTheme.d.ts +7 -0
  457. package/dist/hooks/useTheme.js +62 -0
  458. package/dist/hooks/useTimeDuration.cjs +75 -0
  459. package/dist/hooks/useTimeDuration.d.ts +26 -0
  460. package/dist/hooks/useTimeDuration.js +73 -0
  461. package/dist/hooks/useViewportFill.cjs +82 -0
  462. package/dist/hooks/useViewportFill.d.ts +13 -0
  463. package/dist/hooks/useViewportFill.js +80 -0
  464. package/dist/index.cjs +292 -0
  465. package/dist/index.css +75 -0
  466. package/dist/index.d.ts +42 -0
  467. package/dist/index.js +41 -0
  468. package/dist/styles/animation.cjs +9 -0
  469. package/dist/styles/animation.d.ts +5 -0
  470. package/dist/styles/animation.js +7 -0
  471. package/dist/styles/css-helper-classes/flex.css +113 -0
  472. package/dist/styles/css-helper-classes/spacing.css +312 -0
  473. package/dist/styles/css-helper-classes/typography.css +11 -0
  474. package/dist/styles/fonts/Roboto/OFL.txt +93 -0
  475. package/dist/styles/fonts/Roboto/README.txt +118 -0
  476. package/dist/styles/fonts/Roboto/Roboto-Black.ttf +0 -0
  477. package/dist/styles/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  478. package/dist/styles/fonts/Roboto/Roboto-Bold.ttf +0 -0
  479. package/dist/styles/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  480. package/dist/styles/fonts/Roboto/Roboto-ExtraBold.ttf +0 -0
  481. package/dist/styles/fonts/Roboto/Roboto-ExtraBoldItalic.ttf +0 -0
  482. package/dist/styles/fonts/Roboto/Roboto-ExtraLight.ttf +0 -0
  483. package/dist/styles/fonts/Roboto/Roboto-ExtraLightItalic.ttf +0 -0
  484. package/dist/styles/fonts/Roboto/Roboto-Italic.ttf +0 -0
  485. package/dist/styles/fonts/Roboto/Roboto-Light.ttf +0 -0
  486. package/dist/styles/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  487. package/dist/styles/fonts/Roboto/Roboto-Medium.ttf +0 -0
  488. package/dist/styles/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  489. package/dist/styles/fonts/Roboto/Roboto-Regular.ttf +0 -0
  490. package/dist/styles/fonts/Roboto/Roboto-SemiBold.ttf +0 -0
  491. package/dist/styles/fonts/Roboto/Roboto-SemiBoldItalic.ttf +0 -0
  492. package/dist/styles/fonts/Roboto/Roboto-Thin.ttf +0 -0
  493. package/dist/styles/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  494. package/dist/styles/fonts/Roboto/Roboto_Condensed-Black.ttf +0 -0
  495. package/dist/styles/fonts/Roboto/Roboto_Condensed-BlackItalic.ttf +0 -0
  496. package/dist/styles/fonts/Roboto/Roboto_Condensed-Bold.ttf +0 -0
  497. package/dist/styles/fonts/Roboto/Roboto_Condensed-BoldItalic.ttf +0 -0
  498. package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraBold.ttf +0 -0
  499. package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraBoldItalic.ttf +0 -0
  500. package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraLight.ttf +0 -0
  501. package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraLightItalic.ttf +0 -0
  502. package/dist/styles/fonts/Roboto/Roboto_Condensed-Italic.ttf +0 -0
  503. package/dist/styles/fonts/Roboto/Roboto_Condensed-Light.ttf +0 -0
  504. package/dist/styles/fonts/Roboto/Roboto_Condensed-LightItalic.ttf +0 -0
  505. package/dist/styles/fonts/Roboto/Roboto_Condensed-Medium.ttf +0 -0
  506. package/dist/styles/fonts/Roboto/Roboto_Condensed-MediumItalic.ttf +0 -0
  507. package/dist/styles/fonts/Roboto/Roboto_Condensed-Regular.ttf +0 -0
  508. package/dist/styles/fonts/Roboto/Roboto_Condensed-SemiBold.ttf +0 -0
  509. package/dist/styles/fonts/Roboto/Roboto_Condensed-SemiBoldItalic.ttf +0 -0
  510. package/dist/styles/fonts/Roboto/Roboto_Condensed-Thin.ttf +0 -0
  511. package/dist/styles/fonts/Roboto/Roboto_Condensed-ThinItalic.ttf +0 -0
  512. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Black.ttf +0 -0
  513. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-BlackItalic.ttf +0 -0
  514. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Bold.ttf +0 -0
  515. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-BoldItalic.ttf +0 -0
  516. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraBold.ttf +0 -0
  517. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraBoldItalic.ttf +0 -0
  518. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraLight.ttf +0 -0
  519. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraLightItalic.ttf +0 -0
  520. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Italic.ttf +0 -0
  521. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Light.ttf +0 -0
  522. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-LightItalic.ttf +0 -0
  523. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Medium.ttf +0 -0
  524. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-MediumItalic.ttf +0 -0
  525. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Regular.ttf +0 -0
  526. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-SemiBold.ttf +0 -0
  527. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-SemiBoldItalic.ttf +0 -0
  528. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Thin.ttf +0 -0
  529. package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ThinItalic.ttf +0 -0
  530. package/dist/styles/fonts/Tajawal/OFL.txt +93 -0
  531. package/dist/styles/fonts/Tajawal/Tajawal-Black.ttf +0 -0
  532. package/dist/styles/fonts/Tajawal/Tajawal-Bold.ttf +0 -0
  533. package/dist/styles/fonts/Tajawal/Tajawal-ExtraBold.ttf +0 -0
  534. package/dist/styles/fonts/Tajawal/Tajawal-ExtraLight.ttf +0 -0
  535. package/dist/styles/fonts/Tajawal/Tajawal-Light.ttf +0 -0
  536. package/dist/styles/fonts/Tajawal/Tajawal-Medium.ttf +0 -0
  537. package/dist/styles/fonts/Tajawal/Tajawal-Regular.ttf +0 -0
  538. package/dist/styles/styles.css +377 -0
  539. package/dist/styles/themes/dbc/base.css +141 -0
  540. package/dist/styles/themes/dbc/colors.css +320 -0
  541. package/dist/styles/themes/filmstriben-budget/theme.css +22 -0
  542. package/dist/styles/themes/types.cjs +2 -0
  543. package/dist/styles/themes/types.d.ts +16 -0
  544. package/dist/styles/themes/types.js +1 -0
  545. package/dist/styles.css +377 -0
  546. package/dist/tanstack.cjs +26 -0
  547. package/dist/tanstack.d.ts +3 -0
  548. package/dist/tanstack.js +3 -0
  549. package/dist/themes/dbc.css +3 -0
  550. package/dist/themes/filmstriben-budget.css +3 -0
  551. package/dist/types/a11y-props.types.cjs +2 -0
  552. package/dist/types/a11y-props.types.d.ts +8 -0
  553. package/dist/types/a11y-props.types.js +1 -0
  554. package/dist/types/assets.d.cjs +2 -0
  555. package/dist/types/assets.d.js +1 -0
  556. package/dist/types/css.d.cjs +2 -0
  557. package/dist/types/css.d.js +1 -0
  558. package/dist/types/sizes.types.cjs +2 -0
  559. package/dist/types/sizes.types.d.ts +2 -0
  560. package/dist/types/sizes.types.js +1 -0
  561. package/dist/utils/arrays/nested-filtering.cjs +40 -0
  562. package/dist/utils/arrays/nested-filtering.d.ts +9 -0
  563. package/dist/utils/arrays/nested-filtering.js +38 -0
  564. package/dist/utils/cookie.utils.cjs +44 -0
  565. package/dist/utils/cookie.utils.d.ts +19 -0
  566. package/dist/utils/cookie.utils.js +40 -0
  567. package/dist/utils/date/formatDate.cjs +49 -0
  568. package/dist/utils/date/formatDate.d.ts +28 -0
  569. package/dist/utils/date/formatDate.js +47 -0
  570. package/dist/utils/localStorage.utils.cjs +53 -0
  571. package/dist/utils/localStorage.utils.d.ts +19 -0
  572. package/dist/utils/localStorage.utils.js +49 -0
  573. package/dist/utils/text/get-highlighted-segments.cjs +49 -0
  574. package/dist/utils/text/get-highlighted-segments.d.ts +5 -0
  575. package/dist/utils/text/get-highlighted-segments.js +47 -0
  576. package/package.json +2 -1
@@ -0,0 +1,800 @@
1
+ 'use client';
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import { useRef, useId, useMemo, useState, useLayoutEffect, useEffect } from 'react';
5
+ import { Chip } from '../../../components/chip/Chip';
6
+ import { Input } from '../../../components/forms/input/Input';
7
+ import { Menu } from '../../../components/menu/Menu';
8
+ import { Popover } from '../../../components/popover/Popover';
9
+ import styles from './Typeahead.module.css';
10
+
11
+ function parseLengthToPx(value, referenceFontSize = 16) {
12
+ if (!value) return 0;
13
+ const trimmed = value.trim();
14
+ if (!trimmed) return 0;
15
+ if (trimmed.endsWith("px")) {
16
+ const n2 = Number.parseFloat(trimmed);
17
+ return Number.isFinite(n2) ? n2 : 0;
18
+ }
19
+ if (trimmed.endsWith("rem")) {
20
+ const n2 = Number.parseFloat(trimmed);
21
+ if (!Number.isFinite(n2)) return 0;
22
+ const rootFont = Number.parseFloat(getComputedStyle(document.documentElement).fontSize || "16");
23
+ return n2 * (Number.isFinite(rootFont) ? rootFont : 16);
24
+ }
25
+ if (trimmed.endsWith("em")) {
26
+ const n2 = Number.parseFloat(trimmed);
27
+ return Number.isFinite(n2) ? n2 * referenceFontSize : 0;
28
+ }
29
+ const n = Number.parseFloat(trimmed);
30
+ return Number.isFinite(n) ? n : 0;
31
+ }
32
+ function getOuterWidthWithMargins(element) {
33
+ if (!(element instanceof HTMLElement)) return 0;
34
+ const rect = element.getBoundingClientRect();
35
+ const styles2 = window.getComputedStyle(element);
36
+ const marginLeft = Number.parseFloat(styles2.marginLeft || "0");
37
+ const marginRight = Number.parseFloat(styles2.marginRight || "0");
38
+ return Math.ceil(rect.width + marginLeft + marginRight);
39
+ }
40
+ function getInputFontShorthand(inputStyles) {
41
+ return inputStyles.font || [
42
+ inputStyles.fontStyle,
43
+ inputStyles.fontVariant,
44
+ inputStyles.fontWeight,
45
+ inputStyles.fontStretch,
46
+ inputStyles.fontSize,
47
+ inputStyles.lineHeight !== "normal" ? `/${inputStyles.lineHeight}` : "",
48
+ inputStyles.fontFamily
49
+ ].filter(Boolean).join(" ");
50
+ }
51
+ function measureFitContentWidth(input, text, minWidth) {
52
+ const field = input.closest('[data-forminput="field"]');
53
+ if (!field) return null;
54
+ const inputStyles = window.getComputedStyle(input);
55
+ const fieldStyles = window.getComputedStyle(field);
56
+ const canvas = document.createElement("canvas");
57
+ const ctx = canvas.getContext("2d");
58
+ if (!ctx) return null;
59
+ ctx.font = getInputFontShorthand(inputStyles);
60
+ const textWidth = Math.ceil(ctx.measureText(text).width);
61
+ const inputFontSize = Number.parseFloat(inputStyles.fontSize || "16");
62
+ const inputPaddingLeft = Number.parseFloat(inputStyles.paddingLeft || "0");
63
+ const inputPaddingRight = Number.parseFloat(inputStyles.paddingRight || "0");
64
+ const borderLeft = Number.parseFloat(fieldStyles.borderLeftWidth || "0");
65
+ const borderRight = Number.parseFloat(fieldStyles.borderRightWidth || "0");
66
+ const startAdornmentWidth = getOuterWidthWithMargins(
67
+ field.querySelector('[data-input-role="start-adornment"]')
68
+ );
69
+ const endAdornmentWidth = getOuterWidthWithMargins(
70
+ field.querySelector('[data-input-role="end-adornment"]')
71
+ );
72
+ const iconWidth = getOuterWidthWithMargins(field.querySelector('[data-input-role="icon"]'));
73
+ const breathingRoom = 6;
74
+ const nextWidth = Math.ceil(
75
+ borderLeft + borderRight + iconWidth + startAdornmentWidth + inputPaddingLeft + textWidth + breathingRoom + inputPaddingRight + endAdornmentWidth
76
+ );
77
+ return Math.max(parseLengthToPx(minWidth, inputFontSize) || 120, nextWidth);
78
+ }
79
+ function Typeahead({
80
+ options,
81
+ mode = "single",
82
+ multiValueDisplayMode = "chips",
83
+ multiSelectedValuesDisplayMode = "hidden",
84
+ multiSelectedValueChipContent = "label",
85
+ selectedValue = null,
86
+ onChange,
87
+ placeholder,
88
+ variant = "outlined",
89
+ disabled = false,
90
+ fullWidth = false,
91
+ onClear,
92
+ emptyMessage = "Ingen resultater",
93
+ filterOptions,
94
+ maxVisibleOptions,
95
+ allowCustomValue = false,
96
+ inputProps,
97
+ inputSize,
98
+ width,
99
+ minWidth,
100
+ popoverWidth,
101
+ autoComplete,
102
+ autoCorrect,
103
+ autoCapitalize,
104
+ spellCheck,
105
+ popoverAnchorRef,
106
+ fitContent = false,
107
+ enableHotkey = false
108
+ }) {
109
+ var _a;
110
+ const rootRef = useRef(null);
111
+ const triggerWrapperRef = useRef(null);
112
+ const inputRef = useRef(null);
113
+ const popoverContentRef = useRef(null);
114
+ const interactingWithOptionsRef = useRef(false);
115
+ const justClearedRef = useRef(false);
116
+ const locallyClearedRef = useRef(false);
117
+ const listboxId = useId();
118
+ const {
119
+ onFocus: inputPropsOnFocus,
120
+ onBlur: inputPropsOnBlur,
121
+ onKeyDown: inputPropsOnKeyDown,
122
+ onMouseDown: inputPropsOnMouseDown,
123
+ onClear: inputPropsOnClear,
124
+ startAdornment: inputPropsStartAdornment,
125
+ endAdornment: inputPropsEndAdornment,
126
+ ...passthroughInputProps
127
+ } = inputProps != null ? inputProps : {};
128
+ const selectedOption = useMemo(() => {
129
+ var _a2;
130
+ if (mode === "multi") return null;
131
+ return (_a2 = options.find((option) => option.value === selectedValue)) != null ? _a2 : null;
132
+ }, [options, selectedValue, mode]);
133
+ const selectedOptions = useMemo(() => {
134
+ if (mode !== "multi" || !Array.isArray(selectedValue)) return [];
135
+ return options.filter((option) => selectedValue.includes(option.value));
136
+ }, [options, selectedValue, mode]);
137
+ const selectedSingleText = useMemo(() => {
138
+ if (mode !== "single") return "";
139
+ if (selectedOption) return selectedOption.label;
140
+ if (allowCustomValue && selectedValue != null) return String(selectedValue);
141
+ return "";
142
+ }, [mode, selectedOption, allowCustomValue, selectedValue]);
143
+ const [open, setOpen] = useState(false);
144
+ const [inputValue, setInputValue] = useState(mode === "multi" ? "" : selectedSingleText);
145
+ const [query, setQuery] = useState("");
146
+ const [activeIndex, setActiveIndex] = useState(-1);
147
+ const [hideSelectedHighlight, setHideSelectedHighlight] = useState(false);
148
+ const clearJustClearedAfterEventCycle = React.useCallback(() => {
149
+ requestAnimationFrame(() => {
150
+ justClearedRef.current = false;
151
+ });
152
+ }, []);
153
+ const getSelectedValueChipLabel = React.useCallback(
154
+ (option) => {
155
+ switch (multiSelectedValueChipContent) {
156
+ case "value":
157
+ return String(option.value);
158
+ case "value-label":
159
+ return `${String(option.value)} - ${option.label}`;
160
+ case "label":
161
+ default:
162
+ return option.label;
163
+ }
164
+ },
165
+ [multiSelectedValueChipContent]
166
+ );
167
+ let filteredOptions;
168
+ if (filterOptions) {
169
+ filteredOptions = filterOptions(options, query);
170
+ } else {
171
+ const normalizedQuery = query.trim().toLocaleLowerCase();
172
+ if (!normalizedQuery) {
173
+ filteredOptions = options;
174
+ } else {
175
+ filteredOptions = options.filter(
176
+ (option) => option.label.toLocaleLowerCase().includes(normalizedQuery)
177
+ );
178
+ }
179
+ }
180
+ if (typeof maxVisibleOptions === "number" && Number.isFinite(maxVisibleOptions)) {
181
+ filteredOptions = filteredOptions.slice(0, Math.max(0, maxVisibleOptions));
182
+ }
183
+ const commitSelection = React.useCallback(
184
+ (option) => {
185
+ var _a2, _b;
186
+ locallyClearedRef.current = false;
187
+ setHideSelectedHighlight(false);
188
+ if (mode === "multi") {
189
+ if (!option) return;
190
+ const nextValues = Array.isArray(selectedValue) ? [...selectedValue] : [];
191
+ const idx = nextValues.indexOf(option.value);
192
+ if (idx > -1) {
193
+ nextValues.splice(idx, 1);
194
+ } else {
195
+ nextValues.push(option.value);
196
+ }
197
+ onChange(nextValues);
198
+ if (filteredOptions.length > 1) {
199
+ return;
200
+ }
201
+ setInputValue("");
202
+ setQuery("");
203
+ return;
204
+ }
205
+ onChange((_a2 = option == null ? void 0 : option.value) != null ? _a2 : null);
206
+ setInputValue((_b = option == null ? void 0 : option.label) != null ? _b : "");
207
+ setQuery("");
208
+ setOpen(false);
209
+ setActiveIndex(-1);
210
+ },
211
+ [mode, selectedValue, onChange, filteredOptions.length]
212
+ );
213
+ const multiSelectionAdornment = mode === "multi" && selectedOptions.length > 0 ? multiValueDisplayMode === "count" ? /* @__PURE__ */ jsxs("span", { className: `dbc-muted-text dbc-sm-text ${styles.countAdornment}`, children: [
214
+ "(",
215
+ selectedOptions.length,
216
+ ")"
217
+ ] }) : (() => {
218
+ const MAX_CHIPS = 2;
219
+ const chipsToShow = selectedOptions.slice(0, MAX_CHIPS);
220
+ const extraCount = selectedOptions.length - MAX_CHIPS;
221
+ return /* @__PURE__ */ jsxs("div", { className: styles.chipRow, children: [
222
+ chipsToShow.map((option) => /* @__PURE__ */ jsx(
223
+ Chip,
224
+ {
225
+ size: "sm",
226
+ type: "rounded",
227
+ onClose: () => commitSelection(option),
228
+ children: option.label
229
+ },
230
+ option.value
231
+ )),
232
+ extraCount > 0 && /* @__PURE__ */ jsxs("span", { className: "dbc-muted-text dbc-sm-text dbc-px-xxs", children: [
233
+ "+",
234
+ extraCount
235
+ ] })
236
+ ] });
237
+ })() : void 0;
238
+ const usesCountAdornment = mode === "multi" && multiValueDisplayMode === "count" && selectedOptions.length > 0;
239
+ const resolvedInputSize = (_a = inputSize != null ? inputSize : inputProps == null ? void 0 : inputProps.inputSize) != null ? _a : "md";
240
+ const shouldFitContent = fitContent && mode === "single";
241
+ const [fittedWidthPx, setFittedWidthPx] = useState(null);
242
+ const visibleSingleValueText = useMemo(() => {
243
+ if (!shouldFitContent) return "";
244
+ return inputValue || selectedSingleText || placeholder || "";
245
+ }, [shouldFitContent, inputValue, selectedSingleText, placeholder]);
246
+ useLayoutEffect(() => {
247
+ if (!shouldFitContent) return;
248
+ const input = inputRef.current;
249
+ if (!input) return;
250
+ let cancelled = false;
251
+ const frameId = requestAnimationFrame(() => {
252
+ const nextWidth = measureFitContentWidth(input, visibleSingleValueText, minWidth);
253
+ if (!cancelled && nextWidth != null) {
254
+ setFittedWidthPx((current) => current !== nextWidth ? nextWidth : current);
255
+ }
256
+ });
257
+ const fonts = document.fonts;
258
+ if (fonts == null ? void 0 : fonts.ready) {
259
+ void fonts.ready.then(() => {
260
+ if (cancelled) return;
261
+ const liveInput = inputRef.current;
262
+ if (!liveInput) return;
263
+ const nextWidth = measureFitContentWidth(liveInput, visibleSingleValueText, minWidth);
264
+ if (nextWidth != null) {
265
+ setFittedWidthPx((current) => current !== nextWidth ? nextWidth : current);
266
+ }
267
+ });
268
+ }
269
+ return () => {
270
+ cancelled = true;
271
+ cancelAnimationFrame(frameId);
272
+ };
273
+ }, [
274
+ shouldFitContent,
275
+ visibleSingleValueText,
276
+ minWidth,
277
+ inputPropsStartAdornment,
278
+ inputPropsEndAdornment
279
+ ]);
280
+ const measuredRootWidth = useMemo(() => {
281
+ if (!shouldFitContent) return void 0;
282
+ if (fittedWidthPx == null) return minWidth != null ? minWidth : "120px";
283
+ return `${fittedWidthPx}px`;
284
+ }, [shouldFitContent, fittedWidthPx, minWidth]);
285
+ const shouldStretchInput = !width && (fullWidth || shouldFitContent);
286
+ useEffect(() => {
287
+ if (!enableHotkey) return;
288
+ function handleKeyDown2(event) {
289
+ var _a2;
290
+ if (event.key === "k" && (event.metaKey || event.ctrlKey)) {
291
+ event.preventDefault();
292
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
293
+ }
294
+ }
295
+ window.addEventListener("keydown", handleKeyDown2);
296
+ return () => window.removeEventListener("keydown", handleKeyDown2);
297
+ }, [enableHotkey]);
298
+ useEffect(() => {
299
+ if (selectedOption) {
300
+ locallyClearedRef.current = false;
301
+ setHideSelectedHighlight(false);
302
+ }
303
+ if (justClearedRef.current || locallyClearedRef.current) return;
304
+ if (mode === "multi") {
305
+ setInputValue("");
306
+ setQuery("");
307
+ } else {
308
+ setInputValue(selectedSingleText);
309
+ }
310
+ }, [selectedOption, selectedSingleText, mode]);
311
+ const getSelectedIndex = React.useCallback(
312
+ (items) => {
313
+ if (items.length === 0) return -1;
314
+ if (locallyClearedRef.current) return 0;
315
+ if (mode === "multi") {
316
+ if (!Array.isArray(selectedValue) || selectedValue.length === 0) return 0;
317
+ const firstSelectedIndex = items.findIndex((option) => selectedValue.includes(option.value));
318
+ return firstSelectedIndex >= 0 ? firstSelectedIndex : 0;
319
+ }
320
+ const singleSelectedIndex = items.findIndex((option) => option.value === selectedValue);
321
+ return singleSelectedIndex >= 0 ? singleSelectedIndex : 0;
322
+ },
323
+ [mode, selectedValue]
324
+ );
325
+ useEffect(() => {
326
+ setActiveIndex((current) => {
327
+ if (filteredOptions.length === 0) return -1;
328
+ if (locallyClearedRef.current) return 0;
329
+ if (current < 0) return getSelectedIndex(filteredOptions);
330
+ return Math.min(current, filteredOptions.length - 1);
331
+ });
332
+ }, [filteredOptions, getSelectedIndex]);
333
+ useEffect(() => {
334
+ var _a2, _b;
335
+ if (!open || activeIndex < 0) return;
336
+ const activeEl = (_a2 = document.getElementById(listboxId)) == null ? void 0 : _a2.querySelector(`#${CSS.escape(`${listboxId}-option-${activeIndex}`)}`);
337
+ (_b = activeEl == null ? void 0 : activeEl.scrollIntoView) == null ? void 0 : _b.call(activeEl, { block: "nearest" });
338
+ }, [open, activeIndex, filteredOptions, listboxId]);
339
+ const getFocusableElements = React.useCallback(() => {
340
+ const selector = [
341
+ "a[href]",
342
+ "button:not([disabled])",
343
+ "input:not([disabled])",
344
+ "select:not([disabled])",
345
+ "textarea:not([disabled])",
346
+ '[tabindex]:not([tabindex="-1"])'
347
+ ].join(",");
348
+ const seen = /* @__PURE__ */ new Set();
349
+ const focusables = [];
350
+ for (const container of [rootRef.current, popoverContentRef.current]) {
351
+ if (!container) continue;
352
+ const elements = container.matches(selector) ? [container] : Array.from(container.querySelectorAll(selector));
353
+ for (const element of elements) {
354
+ if (seen.has(element) || element.getAttribute("aria-hidden") === "true" || element.tabIndex < 0) {
355
+ continue;
356
+ }
357
+ seen.add(element);
358
+ focusables.push(element);
359
+ }
360
+ }
361
+ return focusables;
362
+ }, []);
363
+ const isFocusWithinTypeahead = React.useCallback((target) => {
364
+ var _a2, _b;
365
+ if (!(target instanceof Node)) return false;
366
+ return Boolean(((_a2 = rootRef.current) == null ? void 0 : _a2.contains(target)) || ((_b = popoverContentRef.current) == null ? void 0 : _b.contains(target)));
367
+ }, []);
368
+ const handleTabKeyDown = React.useCallback(
369
+ (event) => {
370
+ var _a2, _b, _c;
371
+ if (event.key !== "Tab" || !open) return;
372
+ const focusables = getFocusableElements();
373
+ if (focusables.length === 0) return;
374
+ const eventTarget = event.target instanceof HTMLElement ? event.target : document.activeElement;
375
+ const activeElement = eventTarget && focusables.includes(eventTarget) ? eventTarget : (_a2 = document.activeElement) != null ? _a2 : null;
376
+ const activeIndexInScope = activeElement ? focusables.indexOf(activeElement) : -1;
377
+ if (mode === "multi") {
378
+ if (activeIndexInScope === -1) {
379
+ event.preventDefault();
380
+ (_b = focusables[0]) == null ? void 0 : _b.focus();
381
+ return;
382
+ }
383
+ event.preventDefault();
384
+ const nextIndex = event.shiftKey ? (activeIndexInScope - 1 + focusables.length) % focusables.length : (activeIndexInScope + 1) % focusables.length;
385
+ (_c = focusables[nextIndex]) == null ? void 0 : _c.focus();
386
+ return;
387
+ }
388
+ setOpen(false);
389
+ setActiveIndex(-1);
390
+ },
391
+ [open, getFocusableElements, mode]
392
+ );
393
+ const handleInputChange = (nextValue) => {
394
+ if (justClearedRef.current) return;
395
+ locallyClearedRef.current = false;
396
+ setHideSelectedHighlight(false);
397
+ setInputValue(nextValue);
398
+ setQuery(nextValue);
399
+ if (!open) setOpen(true);
400
+ if (mode === "multi") return;
401
+ if (allowCustomValue) return;
402
+ const exactMatch = options.find((option) => option.label === nextValue);
403
+ if (!exactMatch && selectedValue !== null) {
404
+ onChange(null);
405
+ }
406
+ };
407
+ const handleBlur = (nextFocusedTarget) => {
408
+ if (justClearedRef.current || locallyClearedRef.current) {
409
+ setInputValue("");
410
+ setQuery("");
411
+ setOpen(false);
412
+ setActiveIndex(-1);
413
+ return;
414
+ }
415
+ if (isFocusWithinTypeahead(nextFocusedTarget)) return;
416
+ if (mode === "multi") {
417
+ if (interactingWithOptionsRef.current) {
418
+ interactingWithOptionsRef.current = false;
419
+ setInputValue("");
420
+ setQuery("");
421
+ return;
422
+ }
423
+ setInputValue("");
424
+ setQuery("");
425
+ setOpen(false);
426
+ setActiveIndex(-1);
427
+ return;
428
+ }
429
+ const exactLabelMatch = options.find((option) => option.label === inputValue);
430
+ if (exactLabelMatch) {
431
+ commitSelection(exactLabelMatch);
432
+ return;
433
+ }
434
+ if (allowCustomValue) {
435
+ const customValue = inputValue.trim();
436
+ if (customValue) {
437
+ onChange(customValue);
438
+ setInputValue(customValue);
439
+ } else {
440
+ if (selectedValue !== null) {
441
+ onChange(null);
442
+ }
443
+ setInputValue("");
444
+ }
445
+ setQuery("");
446
+ setOpen(false);
447
+ setActiveIndex(-1);
448
+ return;
449
+ }
450
+ if (selectedOption) {
451
+ setInputValue(selectedOption.label);
452
+ } else {
453
+ setInputValue("");
454
+ }
455
+ setQuery("");
456
+ setOpen(false);
457
+ setActiveIndex(-1);
458
+ };
459
+ const openWithAllOptions = React.useCallback(() => {
460
+ if (justClearedRef.current) return;
461
+ setQuery("");
462
+ setOpen(true);
463
+ setActiveIndex(getSelectedIndex(options));
464
+ }, [getSelectedIndex, options]);
465
+ const openWithCurrentFilter = React.useCallback(() => {
466
+ if (justClearedRef.current) return;
467
+ setOpen(true);
468
+ setActiveIndex(getSelectedIndex(filteredOptions));
469
+ }, [getSelectedIndex, filteredOptions]);
470
+ const prepareSingleSearchInput = React.useCallback(() => {
471
+ if (mode !== "single" || !selectedOption || justClearedRef.current) return;
472
+ setInputValue("");
473
+ setQuery("");
474
+ }, [mode, selectedOption]);
475
+ const handleOpen = React.useCallback(() => {
476
+ if (justClearedRef.current) return;
477
+ if (mode === "single" && selectedOption && !locallyClearedRef.current) {
478
+ prepareSingleSearchInput();
479
+ openWithAllOptions();
480
+ return;
481
+ }
482
+ openWithCurrentFilter();
483
+ }, [mode, selectedOption, prepareSingleSearchInput, openWithAllOptions, openWithCurrentFilter]);
484
+ const handleTriggerMouseDown = React.useCallback(
485
+ (e) => {
486
+ inputPropsOnMouseDown == null ? void 0 : inputPropsOnMouseDown(e);
487
+ if (e.defaultPrevented) return;
488
+ if (justClearedRef.current) {
489
+ e.preventDefault();
490
+ e.stopPropagation();
491
+ return;
492
+ }
493
+ const isAlreadyFocused = document.activeElement === inputRef.current;
494
+ if (isAlreadyFocused && open) {
495
+ e.preventDefault();
496
+ setOpen(false);
497
+ setActiveIndex(-1);
498
+ setQuery("");
499
+ setInputValue(mode === "single" && !locallyClearedRef.current ? selectedSingleText : "");
500
+ return;
501
+ }
502
+ if (isAlreadyFocused && mode === "single" && selectedOption && !locallyClearedRef.current) {
503
+ prepareSingleSearchInput();
504
+ setOpen(true);
505
+ setActiveIndex(getSelectedIndex(options));
506
+ } else if (isAlreadyFocused && !open) {
507
+ setOpen(true);
508
+ setActiveIndex(getSelectedIndex(filteredOptions));
509
+ }
510
+ },
511
+ [
512
+ inputPropsOnMouseDown,
513
+ open,
514
+ mode,
515
+ selectedOption,
516
+ selectedSingleText,
517
+ prepareSingleSearchInput,
518
+ getSelectedIndex,
519
+ options,
520
+ filteredOptions
521
+ ]
522
+ );
523
+ const handleChevronMouseDown = React.useCallback(
524
+ (e) => {
525
+ var _a2;
526
+ e.preventDefault();
527
+ e.stopPropagation();
528
+ if (justClearedRef.current) return;
529
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
530
+ if (open) {
531
+ setOpen(false);
532
+ setActiveIndex(-1);
533
+ setQuery("");
534
+ setInputValue(mode === "single" && !locallyClearedRef.current ? selectedSingleText : "");
535
+ return;
536
+ }
537
+ handleOpen();
538
+ },
539
+ [open, mode, selectedSingleText, handleOpen]
540
+ );
541
+ const handleKeyDown = (e) => {
542
+ switch (e.key) {
543
+ case "ArrowDown":
544
+ e.preventDefault();
545
+ if (!open) {
546
+ handleOpen();
547
+ return;
548
+ }
549
+ setActiveIndex((index) => {
550
+ if (filteredOptions.length === 0) return -1;
551
+ if (index < 0) return getSelectedIndex(filteredOptions);
552
+ return Math.min(index + 1, filteredOptions.length - 1);
553
+ });
554
+ return;
555
+ case "ArrowUp":
556
+ e.preventDefault();
557
+ if (!open) {
558
+ handleOpen();
559
+ return;
560
+ }
561
+ setActiveIndex((index) => {
562
+ if (filteredOptions.length === 0) return -1;
563
+ if (index < 0) return filteredOptions.length - 1;
564
+ return Math.max(index - 1, 0);
565
+ });
566
+ return;
567
+ case "Home":
568
+ if (!open || filteredOptions.length === 0) return;
569
+ e.preventDefault();
570
+ setActiveIndex(0);
571
+ return;
572
+ case "End":
573
+ if (!open || filteredOptions.length === 0) return;
574
+ e.preventDefault();
575
+ setActiveIndex(filteredOptions.length - 1);
576
+ return;
577
+ case "Enter":
578
+ if (!open) return;
579
+ e.preventDefault();
580
+ if (activeIndex >= 0 && filteredOptions[activeIndex]) {
581
+ commitSelection(filteredOptions[activeIndex]);
582
+ }
583
+ return;
584
+ case "Escape":
585
+ e.preventDefault();
586
+ e.stopPropagation();
587
+ setOpen(false);
588
+ setActiveIndex(-1);
589
+ setQuery("");
590
+ setInputValue(mode === "single" && !locallyClearedRef.current ? selectedSingleText : "");
591
+ return;
592
+ }
593
+ };
594
+ return /* @__PURE__ */ jsxs(
595
+ "div",
596
+ {
597
+ ref: rootRef,
598
+ style: {
599
+ display: "flex",
600
+ flexDirection: "column",
601
+ justifyContent: mode === "multi" && multiSelectedValuesDisplayMode === "below-input" && selectedOptions.length > 0 ? "flex-start" : "center",
602
+ gap: mode === "multi" && multiSelectedValuesDisplayMode === "below-input" && selectedOptions.length > 0 ? 8 : 0,
603
+ height: "100%",
604
+ width: width != null ? width : fullWidth ? "100%" : shouldFitContent ? measuredRootWidth : void 0,
605
+ flex: width ? "0 0 auto" : fullWidth || shouldFitContent ? "1 1 auto" : void 0,
606
+ minWidth: width ? void 0 : shouldFitContent ? measuredRootWidth : 0,
607
+ maxWidth: width ? void 0 : shouldFitContent ? "100%" : void 0
608
+ },
609
+ children: [
610
+ /* @__PURE__ */ jsx(
611
+ Popover,
612
+ {
613
+ open,
614
+ minWidth: popoverWidth != null ? popoverWidth : minWidth,
615
+ matchTriggerWidth: true,
616
+ fillTrigger: true,
617
+ anchorRef: popoverAnchorRef != null ? popoverAnchorRef : triggerWrapperRef,
618
+ onOpenChange: (nextOpen) => {
619
+ if (justClearedRef.current) {
620
+ setOpen(false);
621
+ setActiveIndex(-1);
622
+ return;
623
+ }
624
+ setOpen(nextOpen);
625
+ if (nextOpen) {
626
+ if (mode === "single" && selectedOption && !locallyClearedRef.current) {
627
+ setQuery("");
628
+ setActiveIndex(getSelectedIndex(options));
629
+ } else {
630
+ setActiveIndex(getSelectedIndex(filteredOptions));
631
+ }
632
+ } else {
633
+ setActiveIndex(-1);
634
+ }
635
+ },
636
+ fullWidth,
637
+ autoFocusContent: false,
638
+ returnFocus: false,
639
+ overlayRef: popoverContentRef,
640
+ trigger: (openPopover, icon) => {
641
+ var _a2, _b, _c, _d;
642
+ return /* @__PURE__ */ jsx(
643
+ "div",
644
+ {
645
+ ref: triggerWrapperRef,
646
+ style: {
647
+ display: "flex",
648
+ alignItems: "stretch",
649
+ minWidth: 0,
650
+ width: "100%",
651
+ height: "100%"
652
+ },
653
+ onMouseDown: (e) => {
654
+ const target = e.target;
655
+ if (justClearedRef.current) {
656
+ e.preventDefault();
657
+ e.stopPropagation();
658
+ return;
659
+ }
660
+ if (target.closest('input, button, [data-input-role="clear"]')) return;
661
+ handleChevronMouseDown(e);
662
+ },
663
+ children: /* @__PURE__ */ jsx(
664
+ Input,
665
+ {
666
+ ...passthroughInputProps,
667
+ ref: inputRef,
668
+ value: inputValue,
669
+ startAdornment: multiSelectionAdornment || inputPropsStartAdornment ? /* @__PURE__ */ jsxs(Fragment, { children: [
670
+ multiSelectionAdornment,
671
+ inputPropsStartAdornment
672
+ ] }) : void 0,
673
+ endAdornment: inputPropsEndAdornment || icon ? /* @__PURE__ */ jsxs(Fragment, { children: [
674
+ inputPropsEndAdornment,
675
+ icon ? /* @__PURE__ */ jsx("span", { className: styles.chevronButton, onMouseDown: handleChevronMouseDown, children: icon }) : null
676
+ ] }) : void 0,
677
+ onFocus: (e) => {
678
+ inputPropsOnFocus == null ? void 0 : inputPropsOnFocus(e);
679
+ if (e.defaultPrevented) return;
680
+ if (justClearedRef.current) return;
681
+ handleOpen();
682
+ openPopover(e);
683
+ },
684
+ onMouseDown: handleTriggerMouseDown,
685
+ onChange: (e) => handleInputChange(e.currentTarget.value),
686
+ onBlur: (e) => {
687
+ inputPropsOnBlur == null ? void 0 : inputPropsOnBlur(e);
688
+ if (e.defaultPrevented) return;
689
+ handleBlur(e.relatedTarget);
690
+ },
691
+ onKeyDown: (e) => {
692
+ inputPropsOnKeyDown == null ? void 0 : inputPropsOnKeyDown(e);
693
+ if (e.defaultPrevented) return;
694
+ handleTabKeyDown(e);
695
+ if (e.defaultPrevented) return;
696
+ handleKeyDown(e);
697
+ },
698
+ placeholder,
699
+ variant,
700
+ inputSize: resolvedInputSize,
701
+ width: width != null ? width : shouldFitContent ? void 0 : inputProps == null ? void 0 : inputProps.width,
702
+ autoComplete: (_a2 = autoComplete != null ? autoComplete : inputProps == null ? void 0 : inputProps.autoComplete) != null ? _a2 : "off",
703
+ autoCorrect: (_b = autoCorrect != null ? autoCorrect : inputProps == null ? void 0 : inputProps.autoCorrect) != null ? _b : "off",
704
+ autoCapitalize: (_c = autoCapitalize != null ? autoCapitalize : inputProps == null ? void 0 : inputProps.autoCapitalize) != null ? _c : "none",
705
+ spellCheck: (_d = spellCheck != null ? spellCheck : inputProps == null ? void 0 : inputProps.spellCheck) != null ? _d : false,
706
+ disabled,
707
+ fullWidth: shouldStretchInput,
708
+ inputClassName: [
709
+ inputProps == null ? void 0 : inputProps.inputClassName,
710
+ styles.typeaheadInput,
711
+ usesCountAdornment ? styles.inputWithoutStartPadding : ""
712
+ ].filter(Boolean).join(" "),
713
+ onClear: (event) => {
714
+ var _a3, _b2;
715
+ (_a3 = event == null ? void 0 : event.preventDefault) == null ? void 0 : _a3.call(event);
716
+ (_b2 = event == null ? void 0 : event.stopPropagation) == null ? void 0 : _b2.call(event);
717
+ justClearedRef.current = true;
718
+ locallyClearedRef.current = true;
719
+ setHideSelectedHighlight(true);
720
+ setOpen(false);
721
+ setInputValue("");
722
+ setQuery("");
723
+ setActiveIndex(-1);
724
+ inputPropsOnClear == null ? void 0 : inputPropsOnClear();
725
+ if (onClear) {
726
+ onClear();
727
+ } else {
728
+ onChange(mode === "multi" ? [] : null);
729
+ }
730
+ clearJustClearedAfterEventCycle();
731
+ },
732
+ role: "combobox",
733
+ "aria-expanded": open,
734
+ "aria-controls": listboxId,
735
+ "aria-autocomplete": "list",
736
+ "aria-activedescendant": open && activeIndex >= 0 ? `${listboxId}-option-${activeIndex}` : void 0
737
+ }
738
+ )
739
+ }
740
+ );
741
+ },
742
+ children: /* @__PURE__ */ jsx(Menu, { role: "listbox", id: listboxId, children: filteredOptions.length > 0 ? filteredOptions.map((option, index) => {
743
+ const isActive = index === activeIndex;
744
+ const isSelected = mode === "multi" ? Array.isArray(selectedValue) && selectedValue.includes(option.value) : option.value === selectedValue && !hideSelectedHighlight;
745
+ const optionId = `${listboxId}-option-${index}`;
746
+ return mode === "multi" ? /* @__PURE__ */ jsx(
747
+ Menu.CheckItem,
748
+ {
749
+ checked: isSelected,
750
+ active: isActive,
751
+ interactiveProps: {
752
+ id: optionId,
753
+ role: "option",
754
+ onMouseEnter: () => setActiveIndex(index),
755
+ onMouseDown: (e) => {
756
+ interactingWithOptionsRef.current = true;
757
+ e.preventDefault();
758
+ },
759
+ onKeyDown: (e) => handleTabKeyDown(e)
760
+ },
761
+ label: /* @__PURE__ */ jsx("span", { children: option.label }),
762
+ onCheckedChange: () => commitSelection(option)
763
+ },
764
+ option.value
765
+ ) : /* @__PURE__ */ jsx(Menu.Item, { active: isActive, selected: isSelected, children: /* @__PURE__ */ jsx(
766
+ "button",
767
+ {
768
+ id: optionId,
769
+ type: "button",
770
+ role: "option",
771
+ "aria-selected": isSelected,
772
+ onMouseEnter: () => setActiveIndex(index),
773
+ onMouseDown: (e) => {
774
+ e.preventDefault();
775
+ },
776
+ onKeyDown: (e) => handleTabKeyDown(e),
777
+ onClick: () => commitSelection(option),
778
+ children: /* @__PURE__ */ jsx("span", { children: option.label })
779
+ }
780
+ ) }, option.value);
781
+ }) : /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: emptyMessage }) })
782
+ }
783
+ ),
784
+ mode === "multi" && multiSelectedValuesDisplayMode === "below-input" && selectedOptions.length > 0 && /* @__PURE__ */ jsx("div", { className: styles.selectedValues, children: selectedOptions.map((option) => /* @__PURE__ */ jsx(
785
+ Chip,
786
+ {
787
+ size: "sm",
788
+ type: "default",
789
+ severity: "neutral",
790
+ onClose: () => commitSelection(option),
791
+ children: getSelectedValueChipLabel(option)
792
+ },
793
+ option.value
794
+ )) })
795
+ ]
796
+ }
797
+ );
798
+ }
799
+
800
+ export { Typeahead };