@sentry/scraps 0.3.0 → 0.5.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 (321) hide show
  1. package/README.md +6 -5
  2. package/dist/alert/alert.js +0 -3
  3. package/dist/badge/badge.js +1 -2
  4. package/dist/badge/tag.js +0 -2
  5. package/dist/button/index.d.ts +0 -1
  6. package/dist/button/index.js +0 -1
  7. package/dist/clipboard/copyToClipboardButton.d.ts +15 -0
  8. package/dist/clipboard/copyToClipboardButton.js +32 -0
  9. package/dist/clipboard/index.d.ts +1 -0
  10. package/dist/clipboard/index.js +1 -0
  11. package/dist/code/index.d.ts +1 -0
  12. package/dist/code/index.js +1 -0
  13. package/dist/codeBlock/codeBlock.d.ts +68 -0
  14. package/dist/codeBlock/codeBlock.js +242 -0
  15. package/dist/codeBlock/index.d.ts +2 -0
  16. package/dist/codeBlock/index.js +2 -0
  17. package/dist/codeBlock/prism.d.ts +11 -0
  18. package/dist/codeBlock/prism.js +101 -0
  19. package/dist/codeBlock/styles.d.ts +2 -0
  20. package/dist/codeBlock/styles.js +133 -0
  21. package/dist/compactSelect/compactSelect.d.ts +21 -0
  22. package/dist/compactSelect/compactSelect.js +150 -0
  23. package/dist/compactSelect/composite.d.ts +54 -0
  24. package/dist/compactSelect/composite.js +101 -0
  25. package/dist/compactSelect/control.d.ts +112 -0
  26. package/dist/compactSelect/control.js +354 -0
  27. package/dist/compactSelect/fzf.d.ts +8 -0
  28. package/dist/compactSelect/fzf.js +151 -0
  29. package/dist/compactSelect/gridList/index.d.ts +46 -0
  30. package/dist/compactSelect/gridList/index.js +102 -0
  31. package/dist/compactSelect/gridList/option.d.ts +15 -0
  32. package/dist/compactSelect/gridList/option.js +111 -0
  33. package/dist/compactSelect/gridList/section.d.ts +15 -0
  34. package/dist/compactSelect/gridList/section.js +58 -0
  35. package/dist/compactSelect/highlightText.d.ts +6 -0
  36. package/dist/compactSelect/highlightText.js +33 -0
  37. package/dist/compactSelect/index.d.ts +9 -0
  38. package/dist/compactSelect/index.js +8 -0
  39. package/dist/compactSelect/list.d.ts +94 -0
  40. package/dist/compactSelect/list.js +167 -0
  41. package/dist/compactSelect/listBox/index.d.ts +84 -0
  42. package/dist/compactSelect/listBox/index.js +175 -0
  43. package/dist/compactSelect/listBox/option.d.ts +19 -0
  44. package/dist/compactSelect/listBox/option.js +101 -0
  45. package/dist/compactSelect/listBox/section.d.ts +21 -0
  46. package/dist/compactSelect/listBox/section.js +58 -0
  47. package/dist/compactSelect/menuComponents.d.ts +89 -0
  48. package/dist/compactSelect/menuComponents.js +117 -0
  49. package/dist/compactSelect/selectFilterContext.d.ts +2 -0
  50. package/dist/compactSelect/selectFilterContext.js +3 -0
  51. package/dist/compactSelect/styles.d.ts +39 -0
  52. package/dist/compactSelect/styles.js +155 -0
  53. package/dist/compactSelect/types.d.ts +1 -0
  54. package/dist/compactSelect/types.js +0 -0
  55. package/dist/compactSelect/useVirtualizedItems.d.ts +52 -0
  56. package/dist/compactSelect/useVirtualizedItems.js +74 -0
  57. package/dist/compactSelect/utils.d.ts +80 -0
  58. package/dist/compactSelect/utils.js +268 -0
  59. package/dist/confirm/index.d.ts +153 -0
  60. package/dist/confirm/index.js +132 -0
  61. package/dist/descriptionList/descriptionList.js +4 -3
  62. package/dist/disclosure/disclosure.js +2 -2
  63. package/dist/dragHandle/dragHandle.d.ts +3 -1
  64. package/dist/dragHandle/dragHandle.js +8 -5
  65. package/dist/drawer/components.d.ts +46 -0
  66. package/dist/drawer/components.js +265 -0
  67. package/dist/drawer/globalDrawer.d.ts +106 -0
  68. package/dist/drawer/globalDrawer.js +173 -0
  69. package/dist/drawer/index.d.ts +3 -0
  70. package/dist/drawer/index.js +2 -0
  71. package/dist/drawer/useDrawerResizing.d.ts +19 -0
  72. package/dist/drawer/useDrawerResizing.js +111 -0
  73. package/dist/drawer/useDrawerWidth.d.ts +1 -0
  74. package/dist/drawer/useDrawerWidth.js +42 -0
  75. package/dist/dropdownMenu/content.d.ts +1 -0
  76. package/dist/dropdownMenu/content.js +1 -0
  77. package/dist/dropdownMenu/context.d.ts +24 -0
  78. package/dist/dropdownMenu/context.js +3 -0
  79. package/dist/dropdownMenu/dropdownMenu.d.ts +70 -0
  80. package/dist/dropdownMenu/dropdownMenu.js +103 -0
  81. package/dist/dropdownMenu/index.d.ts +2 -0
  82. package/dist/dropdownMenu/index.js +1 -0
  83. package/dist/dropdownMenu/item.d.ts +136 -0
  84. package/dist/dropdownMenu/item.js +182 -0
  85. package/dist/dropdownMenu/list.d.ts +59 -0
  86. package/dist/dropdownMenu/list.js +410 -0
  87. package/dist/dropdownMenu/search.d.ts +16 -0
  88. package/dist/dropdownMenu/search.js +16 -0
  89. package/dist/dropdownMenu/section.d.ts +21 -0
  90. package/dist/dropdownMenu/section.js +40 -0
  91. package/dist/dropdownMenu/separator.d.ts +7 -0
  92. package/dist/dropdownMenu/separator.js +15 -0
  93. package/dist/dropdownMenu/useDropdownMenuKeyboard.d.ts +260 -0
  94. package/dist/dropdownMenu/useDropdownMenuKeyboard.js +55 -0
  95. package/dist/dropdownMenu/useDropdownMenuRowLayout.d.ts +29 -0
  96. package/dist/dropdownMenu/useDropdownMenuRowLayout.js +64 -0
  97. package/dist/dropdownMenu/useSafetyTriangle.d.ts +12 -0
  98. package/dist/dropdownMenu/useSafetyTriangle.js +119 -0
  99. package/dist/dropdownMenu/utils.d.ts +21 -0
  100. package/dist/dropdownMenu/utils.js +57 -0
  101. package/dist/form/FormSearch.d.ts +19 -0
  102. package/dist/form/FormSearch.js +4 -0
  103. package/dist/form/autoSaveForm.d.ts +110 -0
  104. package/dist/form/autoSaveForm.js +100 -0
  105. package/dist/{formPresentation → form}/displayField.js +2 -2
  106. package/dist/form/field/baseField.d.ts +23 -0
  107. package/dist/form/field/baseField.js +116 -0
  108. package/dist/form/field/checkboxField.d.ts +11 -0
  109. package/dist/form/field/checkboxField.js +42 -0
  110. package/dist/form/field/checkboxGroupField.d.ts +16 -0
  111. package/dist/form/field/checkboxGroupField.js +80 -0
  112. package/dist/form/field/compactSelectField.d.ts +19 -0
  113. package/dist/form/field/compactSelectField.js +77 -0
  114. package/dist/{formPresentation → form/field}/fieldIds.js +1 -1
  115. package/dist/form/field/inputField.d.ts +19 -0
  116. package/dist/form/field/inputField.js +31 -0
  117. package/dist/{formPresentation → form/field}/meta.js +6 -6
  118. package/dist/form/field/numberField.d.ts +5 -0
  119. package/dist/form/field/numberField.js +11 -0
  120. package/dist/form/field/passwordField.d.ts +3 -0
  121. package/dist/form/field/passwordField.js +27 -0
  122. package/dist/form/field/radioGroupField.d.ts +16 -0
  123. package/dist/form/field/radioGroupField.js +92 -0
  124. package/dist/form/field/rangeField.d.ts +8 -0
  125. package/dist/form/field/rangeField.js +34 -0
  126. package/dist/form/field/selectAsyncField.d.ts +31 -0
  127. package/dist/form/field/selectAsyncField.js +22 -0
  128. package/dist/form/field/selectField.d.ts +9 -0
  129. package/dist/form/field/selectField.js +72 -0
  130. package/dist/form/field/switchField.d.ts +7 -0
  131. package/dist/form/field/switchField.js +37 -0
  132. package/dist/form/field/textAreaField.d.ts +7 -0
  133. package/dist/form/field/textAreaField.js +25 -0
  134. package/dist/{formPresentation → form}/formContext.js +1 -1
  135. package/dist/form/formErrorContext/index.d.ts +9 -0
  136. package/dist/form/formErrorContext/index.js +7 -0
  137. package/dist/form/index.d.ts +9 -0
  138. package/dist/form/index.js +8 -0
  139. package/dist/{formPresentation → form/layout}/base.d.ts +1 -1
  140. package/dist/{formPresentation → form/layout}/base.js +1 -1
  141. package/dist/form/layout/fieldGroup.d.ts +6 -0
  142. package/dist/form/layout/fieldGroup.js +60 -0
  143. package/dist/{formPresentation/fieldLayout.d.ts → form/layout/index.d.ts} +1 -1
  144. package/dist/{formPresentation/fieldLayout.js → form/layout/index.js} +3 -3
  145. package/dist/{formPresentation → form/layout}/useStackedLayout.js +1 -1
  146. package/dist/form/scrapsForm.d.ts +220 -0
  147. package/dist/form/scrapsForm.js +126 -0
  148. package/dist/hotkey/hotkey.d.ts +9 -8
  149. package/dist/hotkey/hotkey.js +13 -6
  150. package/dist/hotkey/index.d.ts +2 -1
  151. package/dist/hotkey/index.js +2 -1
  152. package/dist/hotkey/keyMappings.d.ts +1 -15
  153. package/dist/hotkey/keyMappings.js +29 -174
  154. package/dist/hotkey/useHotkeys.d.ts +3 -47
  155. package/dist/hotkey/useHotkeys.js +8 -42
  156. package/dist/image/image.js +2 -1
  157. package/dist/info/infoTip.d.ts +1 -1
  158. package/dist/info/infoTip.js +4 -3
  159. package/dist/input/index.d.ts +0 -3
  160. package/dist/input/index.js +0 -2
  161. package/dist/input/input.d.ts +2 -0
  162. package/dist/input/input.js +2 -0
  163. package/dist/input/passwordManagerIgnoreProps.d.ts +11 -0
  164. package/dist/input/passwordManagerIgnoreProps.js +8 -0
  165. package/dist/layout/index.d.ts +2 -2
  166. package/dist/layout/index.js +1 -1
  167. package/dist/layout/styles.d.ts +1 -1
  168. package/dist/link/link.js +4 -3
  169. package/dist/link/linkBehaviorContext.d.ts +2 -0
  170. package/dist/link/linkBehaviorContext.js +17 -10
  171. package/dist/menu/controlContext.d.ts +32 -0
  172. package/dist/menu/controlContext.js +7 -0
  173. package/dist/menu/dropdownButton.d.ts +18 -0
  174. package/dist/menu/dropdownButton.js +66 -0
  175. package/dist/menu/index.d.ts +7 -0
  176. package/dist/menu/index.js +3 -0
  177. package/dist/menu/menu.d.ts +167 -0
  178. package/dist/menu/menu.js +568 -0
  179. package/dist/menu/selectTypes.d.ts +96 -0
  180. package/dist/menu/selectTypes.js +0 -0
  181. package/dist/menu/selectValue.d.ts +13 -0
  182. package/dist/menu/selectValue.js +0 -0
  183. package/dist/modal/components.d.ts +19 -0
  184. package/dist/modal/components.js +99 -0
  185. package/dist/modal/errorBoundary.d.ts +2 -0
  186. package/dist/modal/errorBoundary.js +35 -0
  187. package/dist/modal/index.d.ts +33 -0
  188. package/dist/modal/index.js +260 -0
  189. package/dist/modal/portal.d.ts +1 -0
  190. package/dist/modal/portal.js +10 -0
  191. package/dist/modal/state.d.ts +17 -0
  192. package/dist/modal/state.js +41 -0
  193. package/dist/modal/types.d.ts +75 -0
  194. package/dist/modal/types.js +0 -0
  195. package/dist/numberInput/index.d.ts +3 -0
  196. package/dist/numberInput/index.js +2 -0
  197. package/dist/{input → numberInput}/numberDragInput.d.ts +1 -1
  198. package/dist/{input → numberInput}/numberDragInput.js +1 -1
  199. package/dist/{input → numberInput}/numberInput.d.ts +1 -1
  200. package/dist/{input → numberInput}/numberInput.js +1 -1
  201. package/dist/overlayContext.d.ts +29 -0
  202. package/dist/overlayContext.js +7 -0
  203. package/dist/overlayTrigger.d.ts +22 -0
  204. package/dist/overlayTrigger.js +30 -0
  205. package/dist/pagination/index.d.ts +1 -0
  206. package/dist/pagination/index.js +1 -0
  207. package/dist/pagination/pagination.d.ts +24 -0
  208. package/dist/pagination/pagination.js +63 -0
  209. package/dist/pictureInPicture/index.d.ts +2 -0
  210. package/dist/pictureInPicture/index.js +2 -0
  211. package/dist/pictureInPicture/pictureInPicture.d.ts +47 -0
  212. package/dist/pictureInPicture/pictureInPicture.js +100 -0
  213. package/dist/pictureInPicture/pictureInPicturePortal.d.ts +16 -0
  214. package/dist/pictureInPicture/pictureInPicturePortal.js +46 -0
  215. package/dist/pictureInPicture/portalContext.d.ts +2 -0
  216. package/dist/pictureInPicture/portalContext.js +3 -0
  217. package/dist/revealOnHover/revealOnHover.js +1 -1
  218. package/dist/segmentedControl/segmentedControl.js +1 -1
  219. package/dist/select/filter.d.ts +4 -0
  220. package/dist/select/filter.js +12 -0
  221. package/dist/select/index.d.ts +3 -0
  222. package/dist/select/index.js +2 -0
  223. package/dist/select/option.d.ts +16 -0
  224. package/dist/select/option.js +81 -0
  225. package/dist/select/reactSelectWrapper.d.ts +8 -0
  226. package/dist/select/reactSelectWrapper.js +25 -0
  227. package/dist/select/select.d.ts +79 -0
  228. package/dist/select/select.js +454 -0
  229. package/dist/select/styles.d.ts +9 -0
  230. package/dist/select/styles.js +27 -0
  231. package/dist/select/types.d.ts +60 -0
  232. package/dist/select/types.js +0 -0
  233. package/dist/select/virtualizedMenuList.d.ts +24 -0
  234. package/dist/select/virtualizedMenuList.js +123 -0
  235. package/dist/slideOverPanel.d.ts +20 -0
  236. package/dist/slideOverPanel.js +141 -0
  237. package/dist/slot/knownContexts.d.ts +1 -1
  238. package/dist/spinner/index.d.ts +1 -0
  239. package/dist/spinner/index.js +1 -0
  240. package/dist/spinner/spinner.d.ts +14 -0
  241. package/dist/spinner/spinner.js +126 -0
  242. package/dist/splitPanel/index.d.ts +1 -0
  243. package/dist/splitPanel/index.js +1 -0
  244. package/dist/splitPanel/splitPanel.d.ts +38 -0
  245. package/dist/splitPanel/splitPanel.js +145 -0
  246. package/dist/table/table.d.ts +1 -1
  247. package/dist/table/table.js +39 -20
  248. package/dist/table/useColumnResize.d.ts +6 -5
  249. package/dist/table/useColumnResize.js +5 -4
  250. package/dist/tabs/index.d.ts +4 -0
  251. package/dist/tabs/index.js +3 -0
  252. package/dist/tabs/item.d.ts +13 -0
  253. package/dist/tabs/item.js +4 -0
  254. package/dist/tabs/tab.d.ts +22 -0
  255. package/dist/tabs/tab.js +205 -0
  256. package/dist/tabs/tabList.d.ts +18 -0
  257. package/dist/tabs/tabList.js +256 -0
  258. package/dist/tabs/tabPanels.d.ts +14 -0
  259. package/dist/tabs/tabPanels.js +62 -0
  260. package/dist/tabs/tabs.d.ts +38 -0
  261. package/dist/tabs/tabs.js +56 -0
  262. package/dist/tabs/utils.d.ts +3 -0
  263. package/dist/tabs/utils.js +6 -0
  264. package/dist/text/heading.d.ts +1 -1
  265. package/dist/text/heading.js +1 -1
  266. package/dist/text/styles.js +1 -1
  267. package/dist/text/text.d.ts +1 -1
  268. package/dist/text/text.js +1 -1
  269. package/dist/theme/dark.js +9 -9
  270. package/dist/theme/light.js +9 -9
  271. package/dist/toast/index.d.ts +5 -0
  272. package/dist/toast/index.js +4 -0
  273. package/dist/toast/toast.d.ts +10 -0
  274. package/dist/toast/toast.js +182 -0
  275. package/dist/toast/toastApi.d.ts +10 -0
  276. package/dist/toast/toastApi.js +53 -0
  277. package/dist/toast/toaster.d.ts +4 -0
  278. package/dist/toast/toaster.js +42 -0
  279. package/dist/toast/types.d.ts +17 -0
  280. package/dist/toast/types.js +2 -0
  281. package/dist/toggleCard/index.d.ts +1 -0
  282. package/dist/toggleCard/index.js +1 -0
  283. package/dist/toggleCard/toggleCard.d.ts +32 -0
  284. package/dist/toggleCard/toggleCard.js +301 -0
  285. package/dist/tooltip/tooltip.js +2 -5
  286. package/dist/useDimensions.d.ts +12 -0
  287. package/dist/useDimensions.js +31 -0
  288. package/dist/useMedia.d.ts +15 -0
  289. package/dist/useMedia.js +24 -0
  290. package/dist/useOnClickOutside.d.ts +2 -0
  291. package/dist/useOnClickOutside.js +22 -0
  292. package/dist/useOverlay.d.ts +1 -0
  293. package/dist/useOverlay.js +1 -0
  294. package/dist/useResizableDrawer.d.ts +72 -0
  295. package/dist/useResizableDrawer.js +136 -0
  296. package/dist/useVirtualCollection.d.ts +154 -0
  297. package/dist/useVirtualCollection.js +143 -0
  298. package/dist/useVirtualRows.d.ts +26 -0
  299. package/dist/useVirtualRows.js +26 -0
  300. package/dist/virtualCollectionLayout.d.ts +51 -0
  301. package/dist/virtualCollectionLayout.js +49 -0
  302. package/package.json +148 -16
  303. package/dist/formPresentation/index.d.ts +0 -8
  304. package/dist/formPresentation/index.js +0 -8
  305. package/dist/interactionStateLayer/index.d.ts +0 -1
  306. package/dist/interactionStateLayer/index.js +0 -1
  307. package/dist/interactionStateLayer/interactionStateLayer.d.ts +0 -23
  308. package/dist/interactionStateLayer/interactionStateLayer.js +0 -67
  309. package/dist/unreachable.d.ts +0 -1
  310. package/dist/unreachable.js +0 -4
  311. /package/dist/{formPresentation → form}/autoSaveContext.d.ts +0 -0
  312. /package/dist/{formPresentation → form}/autoSaveContext.js +0 -0
  313. /package/dist/{formPresentation → form}/displayField.d.ts +0 -0
  314. /package/dist/{formPresentation → form/field}/fieldIds.d.ts +0 -0
  315. /package/dist/{formPresentation → form/field}/groupContext.d.ts +0 -0
  316. /package/dist/{formPresentation → form/field}/groupContext.js +0 -0
  317. /package/dist/{formPresentation → form/field}/meta.d.ts +0 -0
  318. /package/dist/{formPresentation → form}/formContext.d.ts +0 -0
  319. /package/dist/{formPresentation → form}/icons.d.ts +0 -0
  320. /package/dist/{formPresentation → form}/icons.js +0 -0
  321. /package/dist/{formPresentation → form/layout}/useStackedLayout.d.ts +0 -0
@@ -1,223 +1,78 @@
1
1
  import { jsx } from "@emotion/react/jsx-runtime";
2
- import { isMac } from "@react-aria/utils";
3
2
  import { IconArrow } from "@sentry/icons/arrow";
4
3
  import { IconCommand } from "@sentry/icons/command";
5
4
  import { IconControl } from "@sentry/icons/control";
6
5
  import { IconOption } from "@sentry/icons/option";
7
6
  import { IconReturn } from "@sentry/icons/return";
8
7
  import { IconShift } from "@sentry/icons/shift";
9
- import * as __rspack_external__sentry_react_f0cda475 from "@sentry/react";
10
- const aliases = {
11
- cmd: 'command',
12
- meta: 'command',
13
- '\u2318': 'command',
14
- ctrl: 'control',
15
- '\u2303': 'control',
16
- option: 'alt',
17
- '\u2325': 'alt',
18
- '\u21E7': 'shift',
19
- return: 'enter',
20
- esc: 'escape',
21
- del: 'delete',
22
- ins: 'insert',
23
- '\u21EA': 'capslock'
24
- };
25
- function canonicalize(keyName) {
26
- const lower = keyName.toLowerCase();
27
- if ('mod' === lower) return isMac() ? 'command' : 'control';
28
- return aliases[lower] ?? lower;
29
- }
30
- const namedKeyMap = {
31
- backspace: 'Backspace',
32
- tab: 'Tab',
33
- clear: 'Clear',
34
- enter: 'Enter',
35
- escape: 'Escape',
36
- space: ' ',
37
- left: 'ArrowLeft',
38
- up: 'ArrowUp',
39
- right: 'ArrowRight',
40
- down: 'ArrowDown',
41
- delete: 'Delete',
42
- insert: 'Insert',
43
- home: 'Home',
44
- end: 'End',
45
- pageup: 'PageUp',
46
- pagedown: 'PageDown',
47
- capslock: 'CapsLock'
48
- };
49
- const punctuationCodeMap = {
50
- ',': 'Comma',
51
- '.': 'Period',
52
- '/': 'Slash',
53
- '`': 'Backquote',
54
- '-': 'Minus',
55
- '=': 'Equal',
56
- ';': 'Semicolon',
57
- "'": 'Quote',
58
- '[': 'BracketLeft',
59
- ']': 'BracketRight',
60
- '\\': 'Backslash'
61
- };
62
- const modifierPredicates = {
63
- command: (e)=>e.metaKey,
64
- shift: (e)=>e.shiftKey,
65
- control: (e)=>e.ctrlKey,
66
- alt: (e)=>e.altKey
67
- };
68
- const MODIFIER_KEYS = [
69
- 'command',
70
- 'shift',
71
- 'control',
72
- 'alt'
73
- ];
74
- function codeForChar(ch) {
75
- if (ch >= 'a' && ch <= 'z') return `Key${ch.toUpperCase()}`;
76
- if (ch >= '0' && ch <= '9') return `Digit${ch}`;
77
- return punctuationCodeMap[ch];
78
- }
79
- function matchesKey(name, event) {
80
- const key = canonicalize(name);
81
- const modifier = modifierPredicates[key];
82
- if (modifier) return modifier(event);
83
- const namedKey = namedKeyMap[key];
84
- if (namedKey) return event.key === namedKey;
85
- if (1 === key.length) {
86
- if (event.key?.toLowerCase() === key) return true;
87
- const code = codeForChar(key);
88
- if (code && event.code === code) {
89
- const eventKey = event.key;
90
- if (eventKey?.length !== 1 || eventKey.charCodeAt(0) > 0x7f) return true;
91
- if (event.shiftKey) return true;
92
- }
93
- }
94
- return false;
95
- }
96
8
  const sharedProps = {
97
9
  size: 'xs'
98
10
  };
99
- const macGlyphs = {
100
- command: {
11
+ const shiftGlyph = {
12
+ icon: /*#__PURE__*/ jsx(IconShift, {
13
+ ...sharedProps
14
+ }),
15
+ label: '⇧'
16
+ };
17
+ const glyphs = {
18
+ '⌘': {
101
19
  icon: /*#__PURE__*/ jsx(IconCommand, {
102
20
  ...sharedProps
103
21
  }),
104
- label: '\u2318'
22
+ label: '⌘'
105
23
  },
106
- control: {
24
+ '⌃': {
107
25
  icon: /*#__PURE__*/ jsx(IconControl, {
108
26
  ...sharedProps
109
27
  }),
110
- label: '\u2303'
28
+ label: '⌃'
111
29
  },
112
- alt: {
30
+ '⌥': {
113
31
  icon: /*#__PURE__*/ jsx(IconOption, {
114
32
  ...sharedProps
115
33
  }),
116
- label: '\u2325'
117
- }
118
- };
119
- const otherGlyphs = {
120
- command: {
121
- label: 'Ctrl'
122
- },
123
- control: {
124
- label: 'Ctrl'
125
- },
126
- alt: {
127
- label: 'Alt'
128
- }
129
- };
130
- const universalGlyphs = {
131
- shift: {
132
- icon: /*#__PURE__*/ jsx(IconShift, {
133
- ...sharedProps
134
- }),
135
- label: '\u21E7'
34
+ label: '⌥'
136
35
  },
137
- enter: {
36
+ '⇧': shiftGlyph,
37
+ Shift: shiftGlyph,
38
+ '↵': {
138
39
  icon: /*#__PURE__*/ jsx(IconReturn, {
139
40
  ...sharedProps
140
41
  }),
141
- label: '\u21B5'
42
+ label: '↵'
142
43
  },
143
- left: {
44
+ '←': {
144
45
  icon: /*#__PURE__*/ jsx(IconArrow, {
145
46
  ...sharedProps,
146
47
  direction: "left"
147
48
  }),
148
- label: '\u2190'
49
+ label: '←'
149
50
  },
150
- right: {
51
+ '→': {
151
52
  icon: /*#__PURE__*/ jsx(IconArrow, {
152
53
  ...sharedProps,
153
54
  direction: "right"
154
55
  }),
155
- label: '\u2192'
56
+ label: '→'
156
57
  },
157
- up: {
58
+ '↑': {
158
59
  icon: /*#__PURE__*/ jsx(IconArrow, {
159
60
  ...sharedProps,
160
61
  direction: "up"
161
62
  }),
162
- label: '\u2191'
63
+ label: '↑'
163
64
  },
164
- down: {
65
+ '↓': {
165
66
  icon: /*#__PURE__*/ jsx(IconArrow, {
166
67
  ...sharedProps,
167
68
  direction: "down"
168
69
  }),
169
- label: '\u2193'
170
- },
171
- backspace: {
172
- label: '\u232B'
173
- },
174
- delete: {
175
- label: 'Del'
176
- },
177
- tab: {
178
- label: 'Tab'
179
- },
180
- escape: {
181
- label: 'Esc'
182
- },
183
- space: {
184
- label: 'Space'
185
- },
186
- home: {
187
- label: 'Home'
188
- },
189
- end: {
190
- label: 'End'
191
- },
192
- pageup: {
193
- label: 'PageUp'
194
- },
195
- pagedown: {
196
- label: 'PageDown'
197
- },
198
- insert: {
199
- label: 'Insert'
200
- },
201
- clear: {
202
- label: 'Clear'
203
- },
204
- capslock: {
205
- label: 'CapsLock'
70
+ label: '↓'
206
71
  }
207
72
  };
208
- function resolveKeyGlyph(keyName) {
209
- const key = canonicalize(keyName);
210
- const platformGlyphs = isMac() ? macGlyphs : otherGlyphs;
211
- const glyph = platformGlyphs[key] ?? universalGlyphs[key];
212
- if (glyph) return glyph;
213
- if (key.length > 1) {
214
- if ('production' !== process.env.NODE_ENV) throw new Error(`Missing key glyph mapping for "${keyName}"`);
215
- __rspack_external__sentry_react_f0cda475.logger.warn('Missing key glyph mapping', {
216
- keyName
217
- });
218
- }
219
- return {
220
- label: keyName.replace(/\w\S*/g, (word)=>word.charAt(0).toUpperCase() + word.substring(1))
73
+ function resolveKeyGlyph(label) {
74
+ return glyphs[label] ?? {
75
+ label
221
76
  };
222
77
  }
223
- export { MODIFIER_KEYS, canonicalize, matchesKey, resolveKeyGlyph };
78
+ export { resolveKeyGlyph };
@@ -1,47 +1,3 @@
1
- type Hotkey = {
2
- /**
3
- * The callback triggered when the matching key is pressed
4
- */
5
- callback: (e: KeyboardEvent) => void;
6
- /**
7
- * Defines the matching shortcuts.
8
- *
9
- * Multiple shortcuts may be passed as a list.
10
- *
11
- * The format for shorcuts is `<modifiers>+<key>` For example `shift+t` or
12
- * `command+shift+t`.
13
- */
14
- match: string[] | string;
15
- /**
16
- * When `false`, the hotkey is skipped: the callback never fires and
17
- * `preventDefault` is never called. Useful for gating a hotkey on state
18
- * (e.g. only intercept `Escape` while a panel is open) without rebuilding
19
- * the hotkey array. Defaults to `true`.
20
- */
21
- enabled?: boolean;
22
- /**
23
- * Allow shortcuts to be triggered while a text input is foccused
24
- */
25
- includeInputs?: boolean;
26
- /**
27
- * Do not call preventDefault on the keydown event
28
- */
29
- skipPreventDefault?: boolean;
30
- };
31
- /**
32
- * Returns whether an event should trigger one of the supplied hotkey matches.
33
- * Uses the same platform-aware modifier and keyboard-layout behavior as
34
- * useHotkeys, and never matches while an IME is composing text.
35
- */
36
- export declare function matchesHotkey(match: string[] | string, event: KeyboardEvent): boolean;
37
- /**
38
- * Pass in the hotkey combinations under match and the corresponding callback
39
- * function to be called. Separate key names with +. For example,
40
- * 'command+alt+shift+x'
41
- *
42
- * Alternate matchings as an array: ['command+alt+backspace', 'ctrl+alt+delete']
43
- *
44
- * Note: you can only use one non-modifier (keys other than shift, ctrl, alt, command) key at a time.
45
- */
46
- export declare function useHotkeys(hotkeys: Hotkey[]): void;
47
- export {};
1
+ import { type UseHotkeyCommonOptions, type UseHotkeyDefinition } from '@tanstack/react-hotkeys';
2
+ /** Register native TanStack hotkeys with Sentry's input and propagation defaults. */
3
+ export declare function useHotkeys(hotkeys: readonly UseHotkeyDefinition[], options?: UseHotkeyCommonOptions): void;
@@ -1,44 +1,10 @@
1
- import { useEffect, useRef } from "react";
2
- import { MODIFIER_KEYS, canonicalize, matchesKey } from "./keyMappings.js";
3
- function shouldIgnoreHotkeyEvent(event) {
4
- return event.isComposing;
5
- }
6
- function matchesHotkey(match, event) {
7
- if (shouldIgnoreHotkeyEvent(event)) return false;
8
- return (Array.isArray(match) ? match : [
9
- match
10
- ]).some((keyset)=>{
11
- const keys = keyset.toLowerCase().split('+').map((key)=>canonicalize(key));
12
- const unusedModifiers = MODIFIER_KEYS.filter((modifier)=>!keys.includes(modifier));
13
- return keys.every((key)=>matchesKey(key, event)) && unusedModifiers.every((modifier)=>!matchesKey(modifier, event));
14
- });
15
- }
16
- function useHotkeys(hotkeys) {
17
- const hotkeysRef = useRef(hotkeys);
18
- useEffect(()=>{
19
- hotkeysRef.current = hotkeys;
1
+ import { useHotkeys } from "@tanstack/react-hotkeys";
2
+ function useHotkeys_useHotkeys(hotkeys, options) {
3
+ useHotkeys(hotkeys, {
4
+ ignoreInputs: true,
5
+ stopPropagation: false,
6
+ conflictBehavior: 'allow',
7
+ ...options
20
8
  });
21
- useEffect(()=>{
22
- const onKeyDown = (evt)=>{
23
- if (shouldIgnoreHotkeyEvent(evt)) return;
24
- for (const hotkey of hotkeysRef.current){
25
- if (false === hotkey.enabled) continue;
26
- const preventDefault = !hotkey.skipPreventDefault;
27
- const inputHasFocus = !hotkey.includeInputs && evt.target instanceof HTMLElement ? evt.target.isContentEditable || [
28
- 'textarea',
29
- 'input'
30
- ].includes(evt.target.tagName.toLowerCase()) : false;
31
- if (matchesHotkey(hotkey.match, evt) && !inputHasFocus) {
32
- if (preventDefault) evt.preventDefault();
33
- hotkey.callback(evt);
34
- return;
35
- }
36
- }
37
- };
38
- document.addEventListener('keydown', onKeyDown);
39
- return ()=>{
40
- document.removeEventListener('keydown', onKeyDown);
41
- };
42
- }, []);
43
9
  }
44
- export { matchesHotkey, useHotkeys };
10
+ export { useHotkeys_useHotkeys as useHotkeys };
@@ -1,6 +1,7 @@
1
1
  import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import styled from "@emotion/styled";
3
- import { getRadius, rc } from "../layout/index.js";
3
+ import { getRadius } from "../layout/index.js";
4
+ import { rc } from "../layout/styles.js";
4
5
  function Image({ loading, width, height, ...props }) {
5
6
  return /*#__PURE__*/ jsx(Img, {
6
7
  loading: loading ?? 'lazy',
@@ -5,6 +5,6 @@ interface InfoTooltipProps extends SVGIconProps {
5
5
  title: React.ReactNode;
6
6
  position?: TooltipProps['position'];
7
7
  }
8
- export declare function InfoTip(props: InfoTooltipProps): import("@emotion/react/jsx-runtime").JSX.Element;
8
+ export declare function InfoTip({ variant, ...props }: InfoTooltipProps): import("@emotion/react/jsx-runtime").JSX.Element;
9
9
  export declare function DisabledTip(props: InfoTooltipProps): import("@emotion/react/jsx-runtime").JSX.Element;
10
10
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import styled from "@emotion/styled";
3
+ import { IconInfo } from "@sentry/icons/info";
3
4
  import { IconLock } from "@sentry/icons/lock";
4
- import { IconQuestion } from "@sentry/icons/question";
5
5
  import { Tooltip } from "../tooltip/index.js";
6
6
  import { useTranslation } from "../translation/useTranslation.js";
7
7
  function IconWithTooltip({ title, position, icon: Icon, 'aria-label': ariaLabel, ...props }) {
@@ -29,11 +29,12 @@ const StyledIconWrapper = styled('span')`
29
29
  ${(p)=>p.theme.focusRing()}
30
30
  }
31
31
  `;
32
- function InfoTip(props) {
32
+ function InfoTip({ variant = 'primary', ...props }) {
33
33
  const { t } = useTranslation();
34
34
  return /*#__PURE__*/ jsx(IconWithTooltip, {
35
35
  ...props,
36
- icon: IconQuestion,
36
+ variant: variant,
37
+ icon: IconInfo,
37
38
  "aria-label": t('More information')
38
39
  });
39
40
  }
@@ -1,8 +1,5 @@
1
1
  export { Input, type InputProps, type InputStylesProps } from './input.js';
2
2
  export { InputGroup } from './inputGroup.js';
3
3
  /** @public */
4
- export { NumberDragInput } from './numberDragInput.js';
5
- export { NumberInput } from './numberInput.js';
6
- /** @public */
7
4
  export { OTPInput, type OTPInputProps } from './otpInput.js';
8
5
  export { useAutosizeInput } from './useAutosizeInput.js';
@@ -1,6 +1,4 @@
1
1
  export { Input } from "./input.js";
2
2
  export { InputGroup } from "./inputGroup.js";
3
- export { NumberDragInput } from "./numberDragInput.js";
4
- export { NumberInput } from "./numberInput.js";
5
3
  export { OTPInput } from "./otpInput.js";
6
4
  export { useAutosizeInput } from "./useAutosizeInput.js";
@@ -13,6 +13,8 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
13
13
  *
14
14
  * To add leading/trailing items (e.g. a search icon on the left side), use
15
15
  * InputControl (components/inputControl) instead.
16
+ *
17
+ * `type="search"` inputs opt out of password manager autofill.
16
18
  */
17
19
  export declare const Input: import("@emotion/styled").StyledComponent<InputProps & {
18
20
  theme?: import("@emotion/react").Theme;
@@ -2,7 +2,9 @@ import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import is_prop_valid from "@emotion/is-prop-valid";
3
3
  import styled from "@emotion/styled";
4
4
  import { inputStyles } from "./inputStyles.js";
5
+ import { passwordManagerIgnoreProps } from "./passwordManagerIgnoreProps.js";
5
6
  const Input = styled(({ ref, size: _size, nativeSize, ...props })=>/*#__PURE__*/ jsx("input", {
7
+ ...'search' === props.type ? passwordManagerIgnoreProps : void 0,
6
8
  ...props,
7
9
  ref: ref,
8
10
  size: nativeSize
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Stops password manager extensions from offering to fill an input. There is
3
+ * no standard attribute, so each manager needs its own.
4
+ */
5
+ export declare const passwordManagerIgnoreProps: {
6
+ readonly 'data-1p-ignore': true;
7
+ readonly 'data-bwignore': true;
8
+ readonly 'data-form-type': "other";
9
+ readonly 'data-lpignore': "true";
10
+ readonly 'data-protonpass-ignore': "true";
11
+ };
@@ -0,0 +1,8 @@
1
+ const passwordManagerIgnoreProps = {
2
+ 'data-1p-ignore': true,
3
+ 'data-bwignore': true,
4
+ 'data-form-type': 'other',
5
+ 'data-lpignore': 'true',
6
+ 'data-protonpass-ignore': 'true'
7
+ };
8
+ export { passwordManagerIgnoreProps };
@@ -6,8 +6,8 @@ export { Stack, type StackProps } from './stack.js';
6
6
  /**
7
7
  * @TODO: these should probably be private to scraps
8
8
  */
9
- export { ContainerQueryContext, ContainerQueryProvider, rc, type Responsive, type ResponsiveKey,
9
+ export { ContainerQueryContext, ContainerQueryProvider, type Responsive, type ResponsiveKey,
10
10
  /** @public */
11
- useContainerBreakpoint, useHasContainerQuery, useResponsivePropResolver, useResponsivePropValue, } from './styles.js';
11
+ useContainerBreakpoint, useHasContainerQuery, useResponsivePropValue, } from './styles.js';
12
12
  export { getBorder, getMargin, getRadius, getSpacing } from './styles.js';
13
13
  export { FLEX_JUSTIFY_CONTENT, type FlexJustify } from './styles.js';
@@ -3,4 +3,4 @@ export { Surface } from "./surface.js";
3
3
  export { Flex } from "./flex.js";
4
4
  export { Grid } from "./grid.js";
5
5
  export { Stack } from "./stack.js";
6
- export { ContainerQueryContext, ContainerQueryProvider, FLEX_JUSTIFY_CONTENT, getBorder, getMargin, getRadius, getSpacing, rc, useContainerBreakpoint, useHasContainerQuery, useResponsivePropResolver, useResponsivePropValue } from "./styles.js";
6
+ export { ContainerQueryContext, ContainerQueryProvider, FLEX_JUSTIFY_CONTENT, getBorder, getMargin, getRadius, getSpacing, useContainerBreakpoint, useHasContainerQuery, useResponsivePropValue } from "./styles.js";
@@ -77,7 +77,7 @@ export declare function useActiveBreakpoint(): BreakpointSize;
77
77
  * CSS-only responsive props don't need this — they resolve natively via
78
78
  * `@container` queries. This context exists purely for the JS resolution path.
79
79
  */
80
- export declare const ContainerQueryContext: import("react").Context<"xs" | "sm" | "md" | "2xs" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "zero" | "3xs" | "5xl" | null>;
80
+ export declare const ContainerQueryContext: import("react").Context<"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "zero" | "3xs" | "5xl" | null>;
81
81
  /**
82
82
  * The JS equivalent of a CSS container query: returns the active breakpoint of
83
83
  * the nearest ancestor query container (read from `ContainerQueryContext`),
package/dist/link/link.js CHANGED
@@ -8,10 +8,11 @@ import { useLinkBehavior } from "./linkBehaviorContext.js";
8
8
  const getLinkStyles = ({ disabled, theme })=>css`
9
9
  border-radius: 2px;
10
10
  pointer-events: ${disabled ? 'none' : void 0};
11
- color: ${disabled ? theme.tokens.content.disabled : void 0};
11
+ color: ${disabled ? theme.tokens.content.disabled : theme.tokens.interactive.link.accent.rest};
12
12
 
13
- &:hover {
14
- color: ${disabled ? theme.tokens.content.disabled : void 0};
13
+ &:hover,
14
+ &:focus-visible {
15
+ color: ${disabled ? theme.tokens.content.disabled : theme.tokens.interactive.link.accent.hover};
15
16
  }
16
17
 
17
18
  &:focus-visible {
@@ -11,4 +11,6 @@ export declare const useLinkBehavior: <T extends LinkProps>(props: T) => {
11
11
  Component: typeof AnchorLink | React.FunctionComponent<T>;
12
12
  behavior: () => T;
13
13
  };
14
+ /** Resolve collection hrefs through the same application behavior as Link. */
15
+ export declare function useResolveLinkHref(): (to: LinkProps["to"]) => string;
14
16
  export {};
@@ -1,18 +1,11 @@
1
1
  import { jsx } from "@emotion/react/jsx-runtime";
2
- import { createContext, useContext } from "react";
2
+ import { createContext, useCallback, useContext } from "react";
3
3
  import * as __rspack_external_query_string_78b5d812 from "query-string";
4
4
  const LinkBehaviorContext = /*#__PURE__*/ createContext(null);
5
5
  function AnchorLink({ to, replace: _replace, preventScrollReset: _preventScrollReset, reloadDocument: _reloadDocument, state: _state, ...props }) {
6
- if ('string' == typeof to) return /*#__PURE__*/ jsx("a", {
7
- ...props,
8
- href: to
9
- });
10
- const { pathname = '', hash = '', search = '', query } = to;
11
- const querySearch = query ? __rspack_external_query_string_78b5d812.stringify(query) : search;
12
- const href = `${pathname}${querySearch && !querySearch.startsWith('?') ? '?' : ''}${querySearch}${hash && !hash.startsWith('#') ? '#' : ''}${hash}`;
13
6
  return /*#__PURE__*/ jsx("a", {
14
7
  ...props,
15
- href: href
8
+ href: destinationToHref(to)
16
9
  });
17
10
  }
18
11
  const defaultLinkBehavior = ()=>({
@@ -28,4 +21,18 @@ const useLinkBehavior = (props)=>{
28
21
  behavior: ()=>behavior(props)
29
22
  };
30
23
  };
31
- export { LinkBehaviorContextProvider, useLinkBehavior };
24
+ function destinationToHref(to) {
25
+ if ('string' == typeof to) return to;
26
+ const { pathname = '', hash = '', search = '', query } = to;
27
+ const querySearch = query ? __rspack_external_query_string_78b5d812.stringify(query) : search;
28
+ return `${pathname}${querySearch && !querySearch.startsWith('?') ? '?' : ''}${querySearch}${hash && !hash.startsWith('#') ? '#' : ''}${hash}`;
29
+ }
30
+ function useResolveLinkHref() {
31
+ const linkBehavior = useContext(LinkBehaviorContext);
32
+ return useCallback((to)=>destinationToHref(linkBehavior ? linkBehavior.behavior({
33
+ to
34
+ }).to : to), [
35
+ linkBehavior
36
+ ]);
37
+ }
38
+ export { LinkBehaviorContextProvider, useLinkBehavior, useResolveLinkHref };
@@ -0,0 +1,32 @@
1
+ import type { OverlayTriggerState } from '@react-stately/overlays';
2
+ import type { FormSize } from '../theme/index.js';
3
+ import type { SearchMatchResult, SelectKey, SelectOptionWithKey } from './selectTypes.js';
4
+ interface ControlContextValue {
5
+ overlayIsOpen: boolean;
6
+ /**
7
+ * Search string to determine whether an option should be rendered in the select list.
8
+ */
9
+ search: string;
10
+ /**
11
+ * Whether the select has a search input field.
12
+ */
13
+ searchable: boolean;
14
+ disabled?: boolean;
15
+ /**
16
+ * Whether the matched substring of each option's label should be highlighted
17
+ * as the user types.
18
+ */
19
+ highlightSearch?: boolean;
20
+ /**
21
+ * The control's overlay state. Useful for opening/closing the menu from inside the
22
+ * selector.
23
+ */
24
+ overlayState?: OverlayTriggerState;
25
+ /**
26
+ * Custom function to determine whether an option matches the search query.
27
+ */
28
+ searchMatcher?: (option: SelectOptionWithKey<SelectKey>, search: string) => SearchMatchResult;
29
+ size?: FormSize;
30
+ }
31
+ export declare const ControlContext: import("react").Context<ControlContextValue>;
32
+ export {};
@@ -0,0 +1,7 @@
1
+ import { createContext } from "react";
2
+ const ControlContext = /*#__PURE__*/ createContext({
3
+ overlayIsOpen: false,
4
+ search: '',
5
+ searchable: false
6
+ });
7
+ export { ControlContext };
@@ -0,0 +1,18 @@
1
+ import type * as React from 'react';
2
+ import type { DistributedOmit } from 'type-fest';
3
+ import type { ButtonProps } from '../button/index.js';
4
+ export type DropdownButtonProps = DistributedOmit<ButtonProps, 'type' | 'prefix'> & {
5
+ /**
6
+ * Whether or not the button should render as open
7
+ */
8
+ isOpen?: boolean;
9
+ /**
10
+ * The fixed prefix text to show in the button eg: 'Sort By'
11
+ */
12
+ prefix?: React.ReactNode;
13
+ /**
14
+ * Should a chevron icon be shown?
15
+ */
16
+ showChevron?: boolean;
17
+ };
18
+ export declare function DropdownButton({ children, prefix, size: explicitSize, isOpen, showChevron, disabled, ref, onClick, ...props }: DropdownButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;