@sentry/scraps 0.4.0 → 0.6.0

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 (352) hide show
  1. package/README.md +74 -8
  2. package/dist/alert/alert.js +0 -3
  3. package/dist/badge/badge.js +1 -2
  4. package/dist/badge/tag.js +4 -4
  5. package/dist/button/button.js +1 -0
  6. package/dist/button/index.d.ts +0 -1
  7. package/dist/button/index.js +0 -1
  8. package/dist/button/linkButton.js +1 -0
  9. package/dist/button/styles.js +157 -152
  10. package/dist/clipboard/copyToClipboardButton.d.ts +15 -0
  11. package/dist/clipboard/copyToClipboardButton.js +32 -0
  12. package/dist/clipboard/index.d.ts +1 -0
  13. package/dist/clipboard/index.js +1 -0
  14. package/dist/code/index.d.ts +1 -0
  15. package/dist/code/index.js +1 -0
  16. package/dist/codeBlock/codeBlock.d.ts +68 -0
  17. package/dist/codeBlock/codeBlock.js +243 -0
  18. package/dist/codeBlock/index.d.ts +2 -0
  19. package/dist/codeBlock/index.js +2 -0
  20. package/dist/codeBlock/prism.d.ts +11 -0
  21. package/dist/codeBlock/prism.js +101 -0
  22. package/dist/codeBlock/styles.d.ts +2 -0
  23. package/dist/codeBlock/styles.js +133 -0
  24. package/dist/compactSelect/compactSelect.d.ts +21 -0
  25. package/dist/compactSelect/compactSelect.js +150 -0
  26. package/dist/compactSelect/composite.d.ts +54 -0
  27. package/dist/compactSelect/composite.js +101 -0
  28. package/dist/compactSelect/control.d.ts +112 -0
  29. package/dist/compactSelect/control.js +355 -0
  30. package/dist/compactSelect/gridList/index.d.ts +46 -0
  31. package/dist/compactSelect/gridList/index.js +102 -0
  32. package/dist/compactSelect/gridList/option.d.ts +15 -0
  33. package/dist/compactSelect/gridList/option.js +111 -0
  34. package/dist/compactSelect/gridList/section.d.ts +15 -0
  35. package/dist/compactSelect/gridList/section.js +58 -0
  36. package/dist/compactSelect/highlightText.d.ts +6 -0
  37. package/dist/compactSelect/highlightText.js +33 -0
  38. package/dist/compactSelect/index.d.ts +9 -0
  39. package/dist/compactSelect/index.js +8 -0
  40. package/dist/compactSelect/list.d.ts +94 -0
  41. package/dist/compactSelect/list.js +167 -0
  42. package/dist/compactSelect/listBox/index.d.ts +84 -0
  43. package/dist/compactSelect/listBox/index.js +175 -0
  44. package/dist/compactSelect/listBox/option.d.ts +19 -0
  45. package/dist/compactSelect/listBox/option.js +101 -0
  46. package/dist/compactSelect/listBox/section.d.ts +21 -0
  47. package/dist/compactSelect/listBox/section.js +58 -0
  48. package/dist/compactSelect/menuComponents.d.ts +89 -0
  49. package/dist/compactSelect/menuComponents.js +117 -0
  50. package/dist/compactSelect/selectFilterContext.d.ts +2 -0
  51. package/dist/compactSelect/selectFilterContext.js +3 -0
  52. package/dist/compactSelect/styles.d.ts +39 -0
  53. package/dist/compactSelect/styles.js +155 -0
  54. package/dist/compactSelect/types.d.ts +1 -0
  55. package/dist/compactSelect/types.js +0 -0
  56. package/dist/compactSelect/useVirtualizedItems.d.ts +52 -0
  57. package/dist/compactSelect/useVirtualizedItems.js +74 -0
  58. package/dist/compactSelect/utils.d.ts +80 -0
  59. package/dist/compactSelect/utils.js +264 -0
  60. package/dist/confirm/index.d.ts +153 -0
  61. package/dist/confirm/index.js +132 -0
  62. package/dist/dateTime/config.d.ts +23 -0
  63. package/dist/dateTime/config.js +50 -0
  64. package/dist/dateTime/context.d.ts +18 -0
  65. package/dist/dateTime/context.js +46 -0
  66. package/dist/dateTime/dateTime.d.ts +6 -0
  67. package/dist/dateTime/dateTime.js +30 -0
  68. package/dist/dateTime/format.d.ts +24 -0
  69. package/dist/dateTime/format.js +45 -0
  70. package/dist/dateTime/index.d.ts +6 -0
  71. package/dist/dateTime/index.js +6 -0
  72. package/dist/dateTime/intlFormatter.d.ts +9 -0
  73. package/dist/dateTime/intlFormatter.js +16 -0
  74. package/dist/dateTime/parseDate.d.ts +3 -0
  75. package/dist/dateTime/parseDate.js +12 -0
  76. package/dist/descriptionList/descriptionList.js +4 -3
  77. package/dist/disclosure/disclosure.js +2 -2
  78. package/dist/dragHandle/dragHandle.d.ts +3 -1
  79. package/dist/dragHandle/dragHandle.js +8 -5
  80. package/dist/drawer/components.d.ts +46 -0
  81. package/dist/drawer/components.js +265 -0
  82. package/dist/drawer/globalDrawer.d.ts +106 -0
  83. package/dist/drawer/globalDrawer.js +173 -0
  84. package/dist/drawer/index.d.ts +3 -0
  85. package/dist/drawer/index.js +2 -0
  86. package/dist/drawer/useDrawerResizing.d.ts +19 -0
  87. package/dist/drawer/useDrawerResizing.js +111 -0
  88. package/dist/drawer/useDrawerWidth.d.ts +1 -0
  89. package/dist/drawer/useDrawerWidth.js +42 -0
  90. package/dist/dropdownMenu/content.d.ts +1 -0
  91. package/dist/dropdownMenu/content.js +1 -0
  92. package/dist/dropdownMenu/context.d.ts +39 -0
  93. package/dist/dropdownMenu/context.js +3 -0
  94. package/dist/dropdownMenu/dropdownMenu.d.ts +70 -0
  95. package/dist/dropdownMenu/dropdownMenu.js +109 -0
  96. package/dist/dropdownMenu/index.d.ts +2 -0
  97. package/dist/dropdownMenu/index.js +1 -0
  98. package/dist/dropdownMenu/item.d.ts +140 -0
  99. package/dist/dropdownMenu/item.js +142 -0
  100. package/dist/dropdownMenu/list.d.ts +85 -0
  101. package/dist/dropdownMenu/list.js +429 -0
  102. package/dist/dropdownMenu/search.d.ts +16 -0
  103. package/dist/dropdownMenu/search.js +16 -0
  104. package/dist/dropdownMenu/section.d.ts +21 -0
  105. package/dist/dropdownMenu/section.js +40 -0
  106. package/dist/dropdownMenu/separator.d.ts +7 -0
  107. package/dist/dropdownMenu/separator.js +15 -0
  108. package/dist/dropdownMenu/useDropdownMenuKeyboard.d.ts +24 -0
  109. package/dist/dropdownMenu/useDropdownMenuKeyboard.js +31 -0
  110. package/dist/dropdownMenu/useDropdownMenuRowLayout.d.ts +29 -0
  111. package/dist/dropdownMenu/useDropdownMenuRowLayout.js +64 -0
  112. package/dist/dropdownMenu/useDropdownRootMenuState.d.ts +13 -0
  113. package/dist/dropdownMenu/useDropdownRootMenuState.js +30 -0
  114. package/dist/dropdownMenu/useDropdownSubmenuState.d.ts +19 -0
  115. package/dist/dropdownMenu/useDropdownSubmenuState.js +25 -0
  116. package/dist/dropdownMenu/utils.d.ts +21 -0
  117. package/dist/dropdownMenu/utils.js +55 -0
  118. package/dist/duration/formatElapsedDuration.d.ts +4 -0
  119. package/dist/duration/formatElapsedDuration.js +10 -0
  120. package/dist/duration/getDuration.d.ts +68 -0
  121. package/dist/duration/getDuration.js +80 -0
  122. package/dist/duration/index.d.ts +2 -0
  123. package/dist/duration/index.js +2 -0
  124. package/dist/form/FormSearch.d.ts +19 -0
  125. package/dist/form/FormSearch.js +4 -0
  126. package/dist/form/autoSaveForm.d.ts +110 -0
  127. package/dist/form/autoSaveForm.js +100 -0
  128. package/dist/{formPresentation → form}/displayField.js +2 -2
  129. package/dist/form/field/baseField.d.ts +23 -0
  130. package/dist/form/field/baseField.js +116 -0
  131. package/dist/form/field/checkboxField.d.ts +11 -0
  132. package/dist/form/field/checkboxField.js +42 -0
  133. package/dist/form/field/checkboxGroupField.d.ts +16 -0
  134. package/dist/form/field/checkboxGroupField.js +80 -0
  135. package/dist/form/field/compactSelectField.d.ts +19 -0
  136. package/dist/form/field/compactSelectField.js +77 -0
  137. package/dist/{formPresentation → form/field}/fieldIds.js +1 -1
  138. package/dist/form/field/inputField.d.ts +19 -0
  139. package/dist/form/field/inputField.js +31 -0
  140. package/dist/{formPresentation → form/field}/meta.js +6 -6
  141. package/dist/form/field/numberField.d.ts +5 -0
  142. package/dist/form/field/numberField.js +11 -0
  143. package/dist/form/field/passwordField.d.ts +3 -0
  144. package/dist/form/field/passwordField.js +27 -0
  145. package/dist/form/field/radioGroupField.d.ts +16 -0
  146. package/dist/form/field/radioGroupField.js +92 -0
  147. package/dist/form/field/rangeField.d.ts +8 -0
  148. package/dist/form/field/rangeField.js +34 -0
  149. package/dist/form/field/selectAsyncField.d.ts +31 -0
  150. package/dist/form/field/selectAsyncField.js +22 -0
  151. package/dist/form/field/selectField.d.ts +9 -0
  152. package/dist/form/field/selectField.js +72 -0
  153. package/dist/form/field/switchField.d.ts +7 -0
  154. package/dist/form/field/switchField.js +37 -0
  155. package/dist/form/field/textAreaField.d.ts +7 -0
  156. package/dist/form/field/textAreaField.js +25 -0
  157. package/dist/{formPresentation → form}/formContext.js +1 -1
  158. package/dist/form/formErrorContext/index.d.ts +9 -0
  159. package/dist/form/formErrorContext/index.js +7 -0
  160. package/dist/form/index.d.ts +9 -0
  161. package/dist/form/index.js +8 -0
  162. package/dist/{formPresentation → form/layout}/base.d.ts +1 -1
  163. package/dist/{formPresentation → form/layout}/base.js +1 -1
  164. package/dist/form/layout/fieldGroup.d.ts +6 -0
  165. package/dist/form/layout/fieldGroup.js +60 -0
  166. package/dist/{formPresentation/fieldLayout.d.ts → form/layout/index.d.ts} +1 -1
  167. package/dist/{formPresentation/fieldLayout.js → form/layout/index.js} +3 -3
  168. package/dist/{formPresentation → form/layout}/useStackedLayout.js +1 -1
  169. package/dist/form/scrapsForm.d.ts +220 -0
  170. package/dist/form/scrapsForm.js +126 -0
  171. package/dist/fzf.d.ts +9 -0
  172. package/dist/fzf.js +155 -0
  173. package/dist/hotkey/hotkey.d.ts +9 -8
  174. package/dist/hotkey/hotkey.js +13 -6
  175. package/dist/hotkey/index.d.ts +2 -1
  176. package/dist/hotkey/index.js +2 -1
  177. package/dist/hotkey/keyMappings.d.ts +1 -15
  178. package/dist/hotkey/keyMappings.js +29 -174
  179. package/dist/hotkey/useHotkeys.d.ts +3 -47
  180. package/dist/hotkey/useHotkeys.js +8 -42
  181. package/dist/image/image.js +2 -1
  182. package/dist/info/infoTip.d.ts +1 -1
  183. package/dist/info/infoTip.js +4 -3
  184. package/dist/input/index.d.ts +0 -3
  185. package/dist/input/index.js +0 -2
  186. package/dist/input/input.d.ts +2 -0
  187. package/dist/input/input.js +2 -0
  188. package/dist/input/passwordManagerIgnoreProps.d.ts +11 -0
  189. package/dist/input/passwordManagerIgnoreProps.js +8 -0
  190. package/dist/layout/container.d.ts +8 -2
  191. package/dist/layout/container.js +2 -2
  192. package/dist/layout/index.d.ts +2 -2
  193. package/dist/layout/index.js +1 -1
  194. package/dist/layout/styles.d.ts +2 -1
  195. package/dist/layout/styles.js +11 -5
  196. package/dist/legacyDatetime.d.ts +21 -0
  197. package/dist/legacyDatetime.js +13 -0
  198. package/dist/link/index.d.ts +1 -1
  199. package/dist/link/index.js +1 -1
  200. package/dist/link/link.js +4 -3
  201. package/dist/link/linkBehaviorContext.d.ts +11 -0
  202. package/dist/link/linkBehaviorContext.js +48 -11
  203. package/dist/menu/index.d.ts +1 -1
  204. package/dist/menu/index.js +1 -1
  205. package/dist/menu/menu.d.ts +14 -8
  206. package/dist/menu/menu.js +163 -60
  207. package/dist/modal/components.d.ts +19 -0
  208. package/dist/modal/components.js +99 -0
  209. package/dist/modal/errorBoundary.d.ts +2 -0
  210. package/dist/modal/errorBoundary.js +35 -0
  211. package/dist/modal/index.d.ts +33 -0
  212. package/dist/modal/index.js +260 -0
  213. package/dist/modal/portal.d.ts +1 -0
  214. package/dist/modal/portal.js +10 -0
  215. package/dist/modal/state.d.ts +17 -0
  216. package/dist/modal/state.js +41 -0
  217. package/dist/modal/types.d.ts +75 -0
  218. package/dist/modal/types.js +0 -0
  219. package/dist/numberInput/index.d.ts +3 -0
  220. package/dist/numberInput/index.js +2 -0
  221. package/dist/{input → numberInput}/numberDragInput.d.ts +1 -1
  222. package/dist/{input → numberInput}/numberDragInput.js +1 -1
  223. package/dist/{input → numberInput}/numberInput.d.ts +1 -1
  224. package/dist/{input → numberInput}/numberInput.js +1 -1
  225. package/dist/overlayContext.d.ts +29 -0
  226. package/dist/overlayContext.js +7 -0
  227. package/dist/pagination/index.d.ts +1 -0
  228. package/dist/pagination/index.js +1 -0
  229. package/dist/pagination/pagination.d.ts +24 -0
  230. package/dist/pagination/pagination.js +63 -0
  231. package/dist/pictureInPicture/index.d.ts +2 -0
  232. package/dist/pictureInPicture/index.js +2 -0
  233. package/dist/pictureInPicture/pictureInPicture.d.ts +47 -0
  234. package/dist/pictureInPicture/pictureInPicture.js +100 -0
  235. package/dist/pictureInPicture/pictureInPicturePortal.d.ts +16 -0
  236. package/dist/pictureInPicture/pictureInPicturePortal.js +46 -0
  237. package/dist/pictureInPicture/portalContext.d.ts +2 -0
  238. package/dist/pictureInPicture/portalContext.js +3 -0
  239. package/dist/relativeTime/getRelativeDate.d.ts +14 -0
  240. package/dist/relativeTime/getRelativeDate.js +107 -0
  241. package/dist/relativeTime/index.d.ts +3 -0
  242. package/dist/relativeTime/index.js +3 -0
  243. package/dist/relativeTime/relativeTime.d.ts +55 -0
  244. package/dist/relativeTime/relativeTime.js +102 -0
  245. package/dist/relativeTime/useRelativeTimeFormatter.d.ts +2 -0
  246. package/dist/relativeTime/useRelativeTimeFormatter.js +10 -0
  247. package/dist/revealOnHover/revealOnHover.js +1 -1
  248. package/dist/segmentedControl/segmentedControl.js +1 -1
  249. package/dist/select/filter.d.ts +4 -0
  250. package/dist/select/filter.js +12 -0
  251. package/dist/select/index.d.ts +3 -0
  252. package/dist/select/index.js +2 -0
  253. package/dist/select/option.d.ts +16 -0
  254. package/dist/select/option.js +81 -0
  255. package/dist/select/reactSelectWrapper.d.ts +8 -0
  256. package/dist/select/reactSelectWrapper.js +25 -0
  257. package/dist/select/select.d.ts +79 -0
  258. package/dist/select/select.js +454 -0
  259. package/dist/select/styles.d.ts +9 -0
  260. package/dist/select/styles.js +27 -0
  261. package/dist/select/types.d.ts +60 -0
  262. package/dist/select/types.js +0 -0
  263. package/dist/select/virtualizedMenuList.d.ts +24 -0
  264. package/dist/select/virtualizedMenuList.js +123 -0
  265. package/dist/slideOverPanel.d.ts +20 -0
  266. package/dist/slideOverPanel.js +141 -0
  267. package/dist/splitPanel/splitPanel.d.ts +3 -1
  268. package/dist/splitPanel/splitPanel.js +2 -1
  269. package/dist/table/table.d.ts +1 -1
  270. package/dist/table/table.js +39 -20
  271. package/dist/table/useColumnResize.d.ts +6 -5
  272. package/dist/table/useColumnResize.js +5 -4
  273. package/dist/tabs/context.d.ts +9 -0
  274. package/dist/tabs/context.js +9 -0
  275. package/dist/tabs/index.d.ts +2 -0
  276. package/dist/tabs/index.js +1 -0
  277. package/dist/tabs/item.d.ts +24 -0
  278. package/dist/tabs/item.js +4 -0
  279. package/dist/tabs/tab.d.ts +22 -0
  280. package/dist/tabs/tab.js +208 -0
  281. package/dist/tabs/tabList.d.ts +18 -0
  282. package/dist/tabs/tabList.js +258 -0
  283. package/dist/tabs/tabPanels.d.ts +13 -0
  284. package/dist/tabs/tabPanels.js +62 -0
  285. package/dist/tabs/tabs.d.ts +53 -0
  286. package/dist/tabs/tabs.js +59 -0
  287. package/dist/tabs/utils.d.ts +3 -0
  288. package/dist/tabs/utils.js +6 -0
  289. package/dist/text/heading.d.ts +1 -1
  290. package/dist/text/heading.js +1 -1
  291. package/dist/text/prose.d.ts +2 -2
  292. package/dist/text/styles.js +1 -1
  293. package/dist/text/text.d.ts +1 -1
  294. package/dist/text/text.js +1 -1
  295. package/dist/theme/dark.js +9 -9
  296. package/dist/theme/light.js +9 -9
  297. package/dist/theme/theme.d.ts +34 -34
  298. package/dist/theme/theme.js +9 -0
  299. package/dist/theme/types.d.ts +20 -2
  300. package/dist/tooltip/tooltip.js +2 -5
  301. package/dist/translation/index.d.ts +1 -0
  302. package/dist/translation/index.js +1 -0
  303. package/dist/translation/translate.d.ts +9 -0
  304. package/dist/translation/translate.js +5 -0
  305. package/dist/translation/translationContext.d.ts +2 -1
  306. package/dist/translation/translationContext.js +2 -1
  307. package/dist/useMedia.d.ts +15 -0
  308. package/dist/useMedia.js +24 -0
  309. package/dist/useOnClickOutside.d.ts +2 -0
  310. package/dist/useOnClickOutside.js +22 -0
  311. package/dist/useOverlay.d.ts +1 -0
  312. package/dist/useOverlay.js +1 -0
  313. package/dist/useVirtualCollection.d.ts +154 -0
  314. package/dist/useVirtualCollection.js +143 -0
  315. package/dist/useVirtualRows.d.ts +26 -0
  316. package/dist/useVirtualRows.js +26 -0
  317. package/dist/virtualCollectionLayout.d.ts +51 -0
  318. package/dist/virtualCollectionLayout.js +49 -0
  319. package/fonts/OFL.txt +94 -0
  320. package/fonts/roboto-mono-variable-cyrillic-ext.woff2 +0 -0
  321. package/fonts/roboto-mono-variable-cyrillic.woff2 +0 -0
  322. package/fonts/roboto-mono-variable-greek.woff2 +0 -0
  323. package/fonts/roboto-mono-variable-latin-ext.woff2 +0 -0
  324. package/fonts/roboto-mono-variable-vietnamese.woff2 +0 -0
  325. package/fonts/roboto-mono-variable.woff2 +0 -0
  326. package/fonts/rubik-variable-cyrillic-ext.woff2 +0 -0
  327. package/fonts/rubik-variable-cyrillic.woff2 +0 -0
  328. package/fonts/rubik-variable-latin-ext.woff2 +0 -0
  329. package/fonts/rubik-variable.woff2 +0 -0
  330. package/fonts.css +211 -0
  331. package/package.json +140 -23
  332. package/dist/datetime.d.ts +0 -39
  333. package/dist/datetime.js +0 -20
  334. package/dist/formPresentation/index.d.ts +0 -8
  335. package/dist/formPresentation/index.js +0 -8
  336. package/dist/interactionStateLayer/index.d.ts +0 -1
  337. package/dist/interactionStateLayer/index.js +0 -1
  338. package/dist/interactionStateLayer/interactionStateLayer.d.ts +0 -23
  339. package/dist/interactionStateLayer/interactionStateLayer.js +0 -67
  340. package/dist/unreachable.d.ts +0 -1
  341. package/dist/unreachable.js +0 -4
  342. /package/dist/{formPresentation → form}/autoSaveContext.d.ts +0 -0
  343. /package/dist/{formPresentation → form}/autoSaveContext.js +0 -0
  344. /package/dist/{formPresentation → form}/displayField.d.ts +0 -0
  345. /package/dist/{formPresentation → form/field}/fieldIds.d.ts +0 -0
  346. /package/dist/{formPresentation → form/field}/groupContext.d.ts +0 -0
  347. /package/dist/{formPresentation → form/field}/groupContext.js +0 -0
  348. /package/dist/{formPresentation → form/field}/meta.d.ts +0 -0
  349. /package/dist/{formPresentation → form}/formContext.d.ts +0 -0
  350. /package/dist/{formPresentation → form}/icons.d.ts +0 -0
  351. /package/dist/{formPresentation → form}/icons.js +0 -0
  352. /package/dist/{formPresentation → form/layout}/useStackedLayout.d.ts +0 -0
@@ -0,0 +1,454 @@
1
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
2
+ import { useCallback, useImperativeHandle, useMemo, useRef } from "react";
3
+ import { useTheme } from "@emotion/react";
4
+ import styled from "@emotion/styled";
5
+ import { useObjectRef } from "@react-aria/utils";
6
+ import { IconChevron } from "@sentry/icons/chevron";
7
+ import { IconClose } from "@sentry/icons/close";
8
+ import { Button } from "../button/index.js";
9
+ import { PanelProvider } from "../panelProvider.js";
10
+ import { Spinner } from "../spinner/index.js";
11
+ import { useTranslation } from "../translation/index.js";
12
+ import { createFilter } from "./filter.js";
13
+ import { SelectOption } from "./option.js";
14
+ import { Creatable, ReactSelect, components as external_reactSelectWrapper_js_components, mergeStyles } from "./reactSelectWrapper.js";
15
+ import { VirtualizedMenuList } from "./virtualizedMenuList.js";
16
+ const selectSpacing = {
17
+ md: '8px',
18
+ sm: '6px',
19
+ xs: '4px'
20
+ };
21
+ const multiValueSizeMapping = {
22
+ md: {
23
+ height: '20px',
24
+ spacing: '4px'
25
+ },
26
+ sm: {
27
+ height: '18px',
28
+ spacing: '2px'
29
+ },
30
+ xs: {
31
+ height: '16px',
32
+ spacing: '2px'
33
+ }
34
+ };
35
+ const getStylesConfig = ({ theme, size = 'md', maxMenuWidth, isInsideModal, isSearchable, isDisabled })=>{
36
+ const indicatorStyles = (provided, state)=>({
37
+ ...provided,
38
+ padding: '0 4px 0 4px',
39
+ alignItems: 'center',
40
+ cursor: state.isDisabled ? 'not-allowed' : 'pointer',
41
+ color: state.isDisabled ? theme.tokens.content.disabled : theme.tokens.content.primary,
42
+ ':hover': {
43
+ color: 'currentcolor'
44
+ }
45
+ });
46
+ const boxShadow = `0px 1px 0px 0px ${theme.tokens.interactive.chonky.debossed.neutral.chonk} inset`;
47
+ return {
48
+ control: (_, state)=>({
49
+ display: 'flex',
50
+ color: state.isDisabled ? theme.tokens.content.disabled : theme.tokens.content.primary,
51
+ backgroundColor: theme.tokens.interactive.chonky.debossed.neutral.background,
52
+ border: `1px solid ${theme.tokens.border.primary}`,
53
+ boxShadow,
54
+ borderRadius: theme.form[size].borderRadius,
55
+ transition: `border ${theme.motion.smooth.fast}, box-shadow ${theme.motion.smooth.fast}`,
56
+ alignItems: 'center',
57
+ ...state.isFocused && theme.focusRing(boxShadow),
58
+ ...state.isDisabled && {
59
+ background: theme.tokens.background.primary,
60
+ color: theme.tokens.content.disabled,
61
+ cursor: 'not-allowed',
62
+ opacity: '60%'
63
+ },
64
+ minHeight: theme.form[size].minHeight,
65
+ fontSize: theme.form[size].fontSize,
66
+ lineHeight: theme.form[size].lineHeight,
67
+ ...state.isMulti && {
68
+ maxHeight: '12em',
69
+ overflow: 'hidden'
70
+ }
71
+ }),
72
+ menu: (provided)=>({
73
+ ...provided,
74
+ zIndex: theme.zIndex.dropdown,
75
+ background: theme.tokens.background.primary,
76
+ borderRadius: theme.radius.md,
77
+ border: `1px solid ${theme.tokens.border.primary}`,
78
+ boxShadow: 'none',
79
+ width: 'auto',
80
+ minWidth: '100%',
81
+ maxWidth: maxMenuWidth ?? 'auto'
82
+ }),
83
+ noOptionsMessage: (provided)=>({
84
+ ...provided,
85
+ color: theme.tokens.content.disabled
86
+ }),
87
+ menuPortal: (provided)=>({
88
+ ...provided,
89
+ maxWidth: maxMenuWidth ?? '24rem',
90
+ zIndex: isInsideModal ? theme.zIndex.modal + 1 : theme.zIndex.dropdown
91
+ }),
92
+ option: (provided)=>({
93
+ ...provided,
94
+ color: theme.tokens.content.primary,
95
+ background: 'transparent',
96
+ padding: 0,
97
+ ':active': {
98
+ background: 'transparent'
99
+ }
100
+ }),
101
+ container: (provided, state)=>({
102
+ ...provided,
103
+ ...state.isDisabled && {
104
+ pointerEvents: 'unset'
105
+ }
106
+ }),
107
+ valueContainer: (provided, state)=>({
108
+ ...provided,
109
+ cursor: isDisabled ? 'not-allowed' : isSearchable ? 'default' : 'pointer',
110
+ alignItems: 'center',
111
+ paddingTop: 0,
112
+ paddingBottom: 0,
113
+ paddingLeft: theme.form[size].paddingLeft,
114
+ paddingRight: selectSpacing[size],
115
+ ...state.isMulti && {
116
+ maxHeight: 'inherit',
117
+ overflowY: 'auto',
118
+ scrollbarColor: `${theme.tokens.graphics.accent.moderate} ${theme.tokens.background.primary}`
119
+ }
120
+ }),
121
+ input: (provided)=>({
122
+ ...provided,
123
+ color: theme.tokens.content.primary,
124
+ margin: 0
125
+ }),
126
+ singleValue: (provided, state)=>({
127
+ ...provided,
128
+ color: state.isDisabled ? theme.tokens.content.disabled : theme.tokens.content.primary,
129
+ display: 'flex',
130
+ alignItems: 'center',
131
+ marginLeft: 0,
132
+ marginRight: 0,
133
+ width: `calc(100% - ${theme.form[size].paddingLeft}px - ${theme.space.xs})`
134
+ }),
135
+ placeholder: (provided, state)=>({
136
+ ...provided,
137
+ color: state.isDisabled ? theme.tokens.content.disabled : theme.tokens.content.secondary
138
+ }),
139
+ multiValue: (provided)=>({
140
+ ...provided,
141
+ backgroundColor: theme.tokens.background.primary,
142
+ color: isDisabled ? theme.tokens.content.disabled : theme.tokens.content.primary,
143
+ borderRadius: '4px',
144
+ border: `1px solid ${theme.tokens.border.primary}`,
145
+ boxShadow: `0px 1px 0px 0px ${theme.tokens.border.primary}`,
146
+ display: 'flex',
147
+ margin: 0,
148
+ marginTop: multiValueSizeMapping[size].spacing,
149
+ marginBottom: multiValueSizeMapping[size].spacing,
150
+ marginRight: multiValueSizeMapping[size].spacing
151
+ }),
152
+ multiValueLabel: (provided)=>({
153
+ ...provided,
154
+ color: isDisabled ? theme.tokens.content.disabled : theme.tokens.content.primary,
155
+ padding: multiValueSizeMapping[size].spacing,
156
+ paddingLeft: multiValueSizeMapping[size].spacing,
157
+ height: multiValueSizeMapping[size].height,
158
+ display: 'flex',
159
+ alignItems: 'center'
160
+ }),
161
+ multiValueRemove: ()=>({
162
+ alignItems: 'center',
163
+ display: 'flex',
164
+ margin: '4px 4px',
165
+ ...isDisabled ? {
166
+ pointerEvents: 'none'
167
+ } : {
168
+ '&:hover': {
169
+ cursor: 'pointer',
170
+ background: theme.tokens.interactive.transparent.neutral.background.hover
171
+ }
172
+ }
173
+ }),
174
+ indicatorsContainer: ()=>({
175
+ display: 'grid',
176
+ gridAutoFlow: 'column',
177
+ marginRight: selectSpacing[size]
178
+ }),
179
+ clearIndicator: indicatorStyles,
180
+ dropdownIndicator: indicatorStyles,
181
+ loadingIndicator: indicatorStyles,
182
+ groupHeading: (provided)=>({
183
+ ...provided,
184
+ lineHeight: '1.5',
185
+ fontWeight: 600,
186
+ color: theme.tokens.content.secondary,
187
+ marginBottom: 0,
188
+ padding: `${theme.space.xs} ${theme.space.lg}`,
189
+ ':empty': {
190
+ display: 'none'
191
+ }
192
+ }),
193
+ group: (provided)=>({
194
+ ...provided,
195
+ paddingTop: 0,
196
+ ':last-of-type': {
197
+ paddingBottom: 0
198
+ },
199
+ ':not(:last-of-type)': {
200
+ position: 'relative',
201
+ marginBottom: theme.space.md
202
+ },
203
+ ':not(:last-of-type)::after': {
204
+ content: '""',
205
+ position: 'absolute',
206
+ left: theme.space.lg,
207
+ right: theme.space.lg,
208
+ bottom: 0,
209
+ borderBottom: `solid 1px ${theme.tokens.border.secondary}`
210
+ }
211
+ })
212
+ };
213
+ };
214
+ function SelectInput({ selectProps, ...props }) {
215
+ const { inputRef } = selectProps;
216
+ const nativeInputRef = useObjectRef(inputRef);
217
+ const ref = useCallback((instance)=>{
218
+ nativeInputRef.current = instance?.input ?? null;
219
+ }, [
220
+ nativeInputRef
221
+ ]);
222
+ return /*#__PURE__*/ jsx(external_reactSelectWrapper_js_components.Input, {
223
+ ...props,
224
+ ref,
225
+ "aria-invalid": selectProps['aria-invalid'],
226
+ "aria-describedby": selectProps['aria-describedby']
227
+ });
228
+ }
229
+ function SelectControl({ children, ...props }) {
230
+ return /*#__PURE__*/ jsxs(external_reactSelectWrapper_js_components.Control, {
231
+ ...props,
232
+ children: [
233
+ props.selectProps.controlLeadingItems,
234
+ children
235
+ ]
236
+ });
237
+ }
238
+ function IndicatorsContainer({ children, ...props }) {
239
+ const Indicators = props.selectProps.contentComponents?.Indicators;
240
+ if (null === Indicators) return null;
241
+ return Indicators ? /*#__PURE__*/ jsx(Indicators, {
242
+ children: children
243
+ }) : /*#__PURE__*/ jsx(external_reactSelectWrapper_js_components.IndicatorsContainer, {
244
+ ...props,
245
+ children: children
246
+ });
247
+ }
248
+ function MultiValueLabel({ children, ...props }) {
249
+ const Label = props.selectProps.contentComponents?.MultiValueLabel;
250
+ return /*#__PURE__*/ jsx(external_reactSelectWrapper_js_components.MultiValueLabel, {
251
+ ...props,
252
+ children: Label ? /*#__PURE__*/ jsx(Label, {
253
+ option: props.data,
254
+ children: children
255
+ }) : children
256
+ });
257
+ }
258
+ function ClearIndicator(props) {
259
+ const { t } = useTranslation();
260
+ return /*#__PURE__*/ jsx(external_reactSelectWrapper_js_components.ClearIndicator, {
261
+ ...props,
262
+ children: /*#__PURE__*/ jsx(Button, {
263
+ variant: "transparent",
264
+ icon: /*#__PURE__*/ jsx(IconClose, {
265
+ legacySize: "10px"
266
+ }),
267
+ size: "zero",
268
+ "aria-label": t('Clear choices'),
269
+ onClick: props.clearValue
270
+ })
271
+ });
272
+ }
273
+ function DropdownIndicator(props) {
274
+ return /*#__PURE__*/ jsx(external_reactSelectWrapper_js_components.DropdownIndicator, {
275
+ ...props,
276
+ children: props.selectProps.dropdownIndicator ?? /*#__PURE__*/ jsx(IconChevron, {
277
+ direction: "down",
278
+ size: "xs"
279
+ })
280
+ });
281
+ }
282
+ function MultiValueRemove(props) {
283
+ const { t } = useTranslation();
284
+ return /*#__PURE__*/ jsx(external_reactSelectWrapper_js_components.MultiValueRemove, {
285
+ ...props,
286
+ children: /*#__PURE__*/ jsx(IconClose, {
287
+ "aria-label": t('Remove item'),
288
+ legacySize: "8px"
289
+ })
290
+ });
291
+ }
292
+ function SelectSpinner() {
293
+ return /*#__PURE__*/ jsx(Spinner, {
294
+ mini: true,
295
+ size: 14,
296
+ style: {
297
+ height: 14,
298
+ width: 14
299
+ }
300
+ });
301
+ }
302
+ function SingleValue(props) {
303
+ const { leadingItems, label } = props.data;
304
+ const ValueComponent = props.selectProps.contentComponents?.Value;
305
+ const renderedLeadingItems = 'function' == typeof leadingItems ? leadingItems({
306
+ disabled: props.isDisabled,
307
+ isFocused: false,
308
+ isSelected: true
309
+ }) : leadingItems;
310
+ return /*#__PURE__*/ jsx(external_reactSelectWrapper_js_components.SingleValue, {
311
+ ...props,
312
+ children: ValueComponent ? /*#__PURE__*/ jsx(ValueComponent, {
313
+ option: props.data
314
+ }) : /*#__PURE__*/ jsxs(SingleValueWrap, {
315
+ children: [
316
+ renderedLeadingItems,
317
+ /*#__PURE__*/ jsx(SingleValueLabel, {
318
+ children: label
319
+ })
320
+ ]
321
+ })
322
+ });
323
+ }
324
+ const SingleValueWrap = styled('div')`
325
+ display: grid;
326
+ grid-auto-flow: column;
327
+ gap: ${(p)=>p.theme.space.md};
328
+ align-items: center;
329
+ `;
330
+ const SingleValueLabel = styled('div')`
331
+ display: block;
332
+ width: 100%;
333
+ white-space: nowrap;
334
+ overflow: hidden;
335
+ text-overflow: ellipsis;
336
+ `;
337
+ function Menu(props) {
338
+ const { children, ...otherProps } = props;
339
+ return /*#__PURE__*/ jsx(external_reactSelectWrapper_js_components.Menu, {
340
+ ...otherProps,
341
+ children: /*#__PURE__*/ jsxs(PanelProvider, {
342
+ children: [
343
+ children,
344
+ props.selectProps.menuFooter
345
+ ]
346
+ })
347
+ });
348
+ }
349
+ function Select(props) {
350
+ const theme = useTheme();
351
+ const { size, maxMenuWidth, isInsideModal } = props;
352
+ const isSearchable = props.searchable;
353
+ const isDisabled = props.disabled;
354
+ const defaultStyles = useMemo(()=>getStylesConfig({
355
+ theme,
356
+ size,
357
+ maxMenuWidth,
358
+ isInsideModal,
359
+ isSearchable,
360
+ isDisabled
361
+ }), [
362
+ theme,
363
+ size,
364
+ maxMenuWidth,
365
+ isInsideModal,
366
+ isSearchable,
367
+ isDisabled
368
+ ]);
369
+ const { creatable, options, clearable, styles, onInputChange, filterOption, ref, inputRef, id, isOpen, onOpenChange, components, controlLeadingItems, dropdownIndicator, menuFooter, loadingMessage, virtualized, ...rest } = props;
370
+ const flatOptions = options.flatMap((option)=>'options' in option ? option.options : [
371
+ option
372
+ ]);
373
+ const compare = (a, b)=>{
374
+ if (props.isValueEqual && null != a && null != b) return props.isValueEqual(a, b);
375
+ return a === b;
376
+ };
377
+ const toOption = (val)=>flatOptions.find((option)=>compare(option.value, val)) ?? (creatable && null != val ? {
378
+ value: val,
379
+ label: String(val)
380
+ } : void 0);
381
+ const mappedValue = props.multiple ? props.value.map(toOption).filter((option)=>null != option) : toOption(props.value) ?? null;
382
+ const mappedStyles = styles ? mergeStyles(defaultStyles, styles) : defaultStyles;
383
+ const selectRef = useRef(null);
384
+ useImperativeHandle(ref, ()=>({
385
+ focus: ()=>selectRef.current?.focus(),
386
+ blur: ()=>selectRef.current?.blur()
387
+ }), []);
388
+ const replacedComponents = {
389
+ SingleValue: SingleValue,
390
+ ClearIndicator,
391
+ DropdownIndicator,
392
+ MultiValueRemove,
393
+ LoadingIndicator: SelectSpinner,
394
+ IndicatorSeparator: null,
395
+ Menu,
396
+ Input: SelectInput,
397
+ Control: SelectControl,
398
+ IndicatorsContainer: IndicatorsContainer,
399
+ MultiValueLabel: MultiValueLabel,
400
+ Option: SelectOption,
401
+ ...null === dropdownIndicator && {
402
+ DropdownIndicator: null
403
+ },
404
+ ...virtualized && {
405
+ MenuList: VirtualizedMenuList
406
+ },
407
+ ...loadingMessage && {
408
+ LoadingMessage: ()=>loadingMessage()
409
+ }
410
+ };
411
+ const filterOptions = createFilter();
412
+ return /*#__PURE__*/ jsx(SelectPicker, {
413
+ filterOption: null === filterOption ? null : (candidate, input)=>(filterOption ?? filterOptions)(candidate.data, input),
414
+ styles: mappedStyles,
415
+ components: replacedComponents,
416
+ creatable: creatable,
417
+ isClearable: clearable,
418
+ backspaceRemovesValue: clearable,
419
+ isMulti: props.multiple,
420
+ isDisabled: isDisabled,
421
+ isSearchable: isSearchable ?? true,
422
+ isOptionDisabled: (option)=>!!option.disabled,
423
+ showDividers: props.showDividers,
424
+ options: options,
425
+ blurInputOnSelect: !props.multiple,
426
+ closeMenuOnSelect: !props.multiple,
427
+ hideSelectedOptions: false,
428
+ tabSelectsValue: false,
429
+ ...rest,
430
+ value: mappedValue,
431
+ ref: selectRef,
432
+ inputRef: inputRef,
433
+ inputId: id,
434
+ onInputChange: (input, { action })=>{
435
+ onInputChange?.(input, 'input-change' === action ? 'input' : 'reset');
436
+ },
437
+ menuIsOpen: isOpen,
438
+ onMenuOpen: ()=>onOpenChange?.(true),
439
+ onMenuClose: ()=>onOpenChange?.(false),
440
+ contentComponents: components,
441
+ controlLeadingItems: controlLeadingItems,
442
+ dropdownIndicator: dropdownIndicator,
443
+ menuFooter: menuFooter
444
+ });
445
+ }
446
+ function SelectPicker({ creatable, ref, ...props }) {
447
+ const Component = creatable ? Creatable : ReactSelect;
448
+ return /*#__PURE__*/ jsx(Component, {
449
+ ref: ref,
450
+ ...props,
451
+ menuPlacement: "auto"
452
+ });
453
+ }
454
+ export { Select };
@@ -0,0 +1,9 @@
1
+ import type { FormSize } from '../theme/index.js';
2
+ export declare const CheckWrap: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme;
4
+ as?: React.ElementType;
5
+ } & {
6
+ isMultiple: boolean;
7
+ isSelected: boolean;
8
+ size: FormSize;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,27 @@
1
+ import { css } from "@emotion/react";
2
+ import styled from "@emotion/styled";
3
+ const CheckWrap = styled('div')`
4
+ display: flex;
5
+ justify-content: center;
6
+ align-items: center;
7
+ width: 1em;
8
+ height: 1.4em;
9
+
10
+ ${(p)=>p.isMultiple ? css`
11
+ padding: 1px;
12
+ border: solid 1px ${p.theme.tokens.border.primary};
13
+ background: ${p.theme.tokens.background.primary};
14
+ border-radius: 2px;
15
+ height: 1em;
16
+ margin-top: 2px;
17
+ ${p.isSelected && css`
18
+ background: ${p.theme.tokens.background.accent.vibrant};
19
+ border-color: ${p.theme.tokens.border.accent};
20
+ `}
21
+ ` : css`
22
+ ${p.isSelected && css`
23
+ color: ${p.theme.tokens.content.accent};
24
+ `}
25
+ `}
26
+ `;
27
+ export { CheckWrap };
@@ -0,0 +1,60 @@
1
+ import type * as React from 'react';
2
+ import type { CSSObject } from '@emotion/react';
3
+ import type { SelectValue } from '../menu/index.js';
4
+ export type { SelectValue } from '../menu/index.js';
5
+ /** Content components receive public option data, without implementation props. */
6
+ export interface SelectComponents<Option extends SelectValue<any> = SelectValue<any>> {
7
+ Indicators?: React.ComponentType<{
8
+ children: React.ReactNode;
9
+ }> | null;
10
+ MultiValueLabel?: React.ComponentType<{
11
+ children: React.ReactNode;
12
+ option: Option;
13
+ }>;
14
+ OptionLabel?: React.ComponentType<{
15
+ option: Option;
16
+ }>;
17
+ Value?: React.ComponentType<{
18
+ option: Option;
19
+ }>;
20
+ }
21
+ type NonArray<T> = T extends readonly unknown[] ? never : T;
22
+ interface SingleUnclearableSelectProps<TValue, TSelection> {
23
+ onChange: (value: NonArray<TSelection>) => void;
24
+ value: NonArray<TValue> | null;
25
+ clearable?: false;
26
+ multiple?: false;
27
+ }
28
+ interface SingleClearableSelectProps<TValue, TSelection> {
29
+ clearable: true;
30
+ onChange: (value: NonArray<TSelection> | null) => void;
31
+ value: NonArray<TValue> | null;
32
+ multiple?: false;
33
+ }
34
+ interface MultipleSelectProps<TValue, TSelection> {
35
+ multiple: true;
36
+ onChange: (value: TSelection[]) => void;
37
+ value: TValue[];
38
+ clearable?: boolean;
39
+ }
40
+ /**
41
+ * Shared selection rules for selects and form fields. Core Select returns option
42
+ * objects; form fields return raw values, so the callback payload is configurable.
43
+ */
44
+ export type SelectSelectionProps<TValue, TSelection = TValue> = SingleUnclearableSelectProps<TValue, TSelection> | SingleClearableSelectProps<TValue, TSelection> | MultipleSelectProps<TValue, TSelection>;
45
+ /** The supported imperative operations on a select. */
46
+ export interface SelectHandle {
47
+ blur: () => void;
48
+ focus: () => void;
49
+ }
50
+ interface SelectStyleState {
51
+ isDisabled?: boolean;
52
+ isSelected?: boolean;
53
+ }
54
+ type SelectStyleSlot = 'container' | 'control' | 'groupHeading' | 'input' | 'menu' | 'menuList' | 'menuPortal' | 'multiValue' | 'multiValueLabel' | 'multiValueRemove' | 'option' | 'placeholder' | 'singleValue';
55
+ /** Style overrides receive CSS and selection state, without implementation components. */
56
+ export type StylesConfig<TValue = unknown, TOption extends SelectValue<TValue> = SelectValue<TValue>> = {
57
+ [Slot in SelectStyleSlot]?: (base: CSSObject, state: Slot extends 'option' | 'singleValue' | 'multiValue' | 'multiValueLabel' | 'multiValueRemove' ? SelectStyleState & {
58
+ data: TOption;
59
+ } : Slot extends 'control' | 'container' ? Pick<SelectStyleState, 'isDisabled'> : unknown) => CSSObject;
60
+ };
File without changes
@@ -0,0 +1,24 @@
1
+ import type * as React from 'react';
2
+ /**
3
+ * Virtualized MenuList for the Select (react-select) component.
4
+ * react-select re-renders every Option on hover/focus changes, which
5
+ * causes ~1s lag with 130+ platform options containing PlatformIcon SVGs.
6
+ * Virtualizing limits mounted components to the visible set.
7
+ *
8
+ * Supports grouped options: react-select renders each group as a single
9
+ * <Group> element wrapping its Option children, which would virtualize as one
10
+ * giant row. Groups are flattened here into heading + option rows instead,
11
+ * with per-row measurement since headings and options differ in height.
12
+ *
13
+ * Implementation detail of the shared Select virtualized prop.
14
+ */
15
+ import { type Ref } from 'react';
16
+ interface VirtualizedMenuListProps {
17
+ children: React.ReactNode;
18
+ focusedOption?: unknown;
19
+ innerProps?: React.HTMLAttributes<HTMLDivElement>;
20
+ innerRef?: Ref<HTMLDivElement>;
21
+ maxHeight?: number;
22
+ }
23
+ export declare function VirtualizedMenuList({ children, focusedOption, maxHeight, innerRef, innerProps, }: VirtualizedMenuListProps): import("@emotion/react/jsx-runtime").JSX.Element;
24
+ export {};