@sentry/scraps 0.1.0 → 0.3.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 (253) hide show
  1. package/README.md +13 -21
  2. package/dist/alert/alert.d.ts +25 -0
  3. package/dist/alert/alert.js +262 -0
  4. package/dist/alert/alertLink.d.ts +32 -0
  5. package/dist/alert/alertLink.js +94 -0
  6. package/dist/alert/index.d.ts +2 -0
  7. package/dist/alert/index.js +2 -0
  8. package/dist/backdrop/backdrop.d.ts +9 -0
  9. package/dist/backdrop/backdrop.js +28 -0
  10. package/dist/backdrop/index.d.ts +1 -0
  11. package/dist/backdrop/index.js +1 -0
  12. package/dist/badge/badge.d.ts +12 -0
  13. package/dist/badge/badge.js +80 -0
  14. package/dist/badge/featureBadge.d.ts +6 -0
  15. package/dist/badge/featureBadge.js +86 -0
  16. package/dist/badge/index.d.ts +3 -0
  17. package/dist/badge/index.js +3 -0
  18. package/dist/badge/tag.d.ts +15 -0
  19. package/dist/badge/tag.js +119 -0
  20. package/dist/boundaryContext.d.ts +2 -0
  21. package/dist/boundaryContext.js +5 -0
  22. package/dist/button/button.d.ts +3 -0
  23. package/dist/button/button.js +83 -0
  24. package/dist/button/buttonBar.d.ts +10 -0
  25. package/dist/button/buttonBar.js +141 -0
  26. package/dist/button/index.d.ts +5 -0
  27. package/dist/button/index.js +4 -0
  28. package/dist/button/linkButton.d.ts +3 -0
  29. package/dist/button/linkButton.js +110 -0
  30. package/dist/button/styles.d.ts +10 -0
  31. package/dist/button/styles.js +247 -0
  32. package/dist/button/types.d.ts +77 -0
  33. package/dist/button/types.js +0 -0
  34. package/dist/button/useButtonFunctionality.d.ts +5 -0
  35. package/dist/button/useButtonFunctionality.js +9 -0
  36. package/dist/checkbox/checkbox.d.ts +20 -0
  37. package/dist/checkbox/checkbox.js +193 -0
  38. package/dist/checkbox/index.d.ts +1 -0
  39. package/dist/checkbox/index.js +1 -0
  40. package/dist/chip/chip.d.ts +128 -0
  41. package/dist/chip/chip.js +364 -0
  42. package/dist/chip/index.d.ts +1 -0
  43. package/dist/chip/index.js +1 -0
  44. package/dist/code/inlineCode.d.ts +1 -0
  45. package/dist/datetime.d.ts +39 -0
  46. package/dist/datetime.js +20 -0
  47. package/dist/descriptionList/descriptionList.d.ts +69 -0
  48. package/dist/descriptionList/descriptionList.js +76 -0
  49. package/dist/descriptionList/index.d.ts +1 -0
  50. package/dist/descriptionList/index.js +1 -0
  51. package/dist/disclosure/disclosure.d.ts +37 -0
  52. package/dist/disclosure/disclosure.js +155 -0
  53. package/dist/disclosure/index.d.ts +1 -0
  54. package/dist/disclosure/index.js +1 -0
  55. package/dist/dragHandle/dragHandle.d.ts +34 -0
  56. package/dist/dragHandle/dragHandle.js +115 -0
  57. package/dist/dragHandle/index.d.ts +4 -0
  58. package/dist/dragHandle/index.js +4 -0
  59. package/dist/dragHandle/setDocumentDragging.d.ts +9 -0
  60. package/dist/dragHandle/setDocumentDragging.js +6 -0
  61. package/dist/dragHandle/useDragMove.d.ts +244 -0
  62. package/dist/dragHandle/useDragMove.js +66 -0
  63. package/dist/dragHandle/useDragSeparator.d.ts +256 -0
  64. package/dist/dragHandle/useDragSeparator.js +36 -0
  65. package/dist/emptyState/emptyState.d.ts +10 -0
  66. package/dist/emptyState/emptyState.js +81 -0
  67. package/dist/emptyState/index.d.ts +1 -0
  68. package/dist/emptyState/index.js +1 -0
  69. package/dist/formPresentation/autoSaveContext.d.ts +23 -0
  70. package/dist/formPresentation/autoSaveContext.js +13 -0
  71. package/dist/formPresentation/base.d.ts +11 -0
  72. package/dist/formPresentation/base.js +37 -0
  73. package/dist/formPresentation/displayField.d.ts +17 -0
  74. package/dist/formPresentation/displayField.js +69 -0
  75. package/dist/formPresentation/fieldIds.d.ts +3 -0
  76. package/dist/formPresentation/fieldIds.js +14 -0
  77. package/dist/formPresentation/fieldLayout.d.ts +23 -0
  78. package/dist/formPresentation/fieldLayout.js +76 -0
  79. package/dist/formPresentation/formContext.d.ts +4 -0
  80. package/dist/formPresentation/formContext.js +6 -0
  81. package/dist/formPresentation/groupContext.d.ts +24 -0
  82. package/dist/formPresentation/groupContext.js +22 -0
  83. package/dist/formPresentation/icons.d.ts +11 -0
  84. package/dist/formPresentation/icons.js +61 -0
  85. package/dist/formPresentation/index.d.ts +8 -0
  86. package/dist/formPresentation/index.js +8 -0
  87. package/dist/formPresentation/meta.d.ts +18 -0
  88. package/dist/formPresentation/meta.js +88 -0
  89. package/dist/formPresentation/useStackedLayout.d.ts +1 -0
  90. package/dist/formPresentation/useStackedLayout.js +9 -0
  91. package/dist/hotkey/hotkey.d.ts +22 -0
  92. package/dist/hotkey/hotkey.js +41 -0
  93. package/dist/hotkey/index.d.ts +4 -0
  94. package/dist/hotkey/index.js +3 -0
  95. package/dist/hotkey/kbd.d.ts +1 -0
  96. package/dist/hotkey/keyMappings.d.ts +23 -0
  97. package/dist/hotkey/keyMappings.js +223 -0
  98. package/dist/hotkey/useHotkeys.d.ts +47 -0
  99. package/dist/hotkey/useHotkeys.js +44 -0
  100. package/dist/image/image.d.ts +21 -0
  101. package/dist/image/image.js +20 -0
  102. package/dist/image/index.d.ts +1 -0
  103. package/dist/image/index.js +1 -0
  104. package/dist/info/index.d.ts +2 -0
  105. package/dist/info/index.js +2 -0
  106. package/dist/info/infoText.d.ts +15 -0
  107. package/dist/info/infoText.js +43 -0
  108. package/dist/info/infoTip.d.ts +10 -0
  109. package/dist/info/infoTip.js +54 -0
  110. package/dist/input/index.d.ts +8 -0
  111. package/dist/input/index.js +6 -0
  112. package/dist/input/input.d.ts +19 -0
  113. package/dist/input/input.js +14 -0
  114. package/dist/input/inputGroup.d.ts +29 -0
  115. package/dist/input/inputGroup.js +167 -0
  116. package/dist/input/inputStyles.d.ts +13 -0
  117. package/dist/input/inputStyles.js +52 -0
  118. package/dist/input/numberDragInput.d.ts +20 -0
  119. package/dist/input/numberDragInput.js +97 -0
  120. package/dist/input/numberInput.d.ts +10 -0
  121. package/dist/input/numberInput.js +94 -0
  122. package/dist/input/otpInput.d.ts +28 -0
  123. package/dist/input/otpInput.js +81 -0
  124. package/dist/input/useAutosizeInput.d.ts +17 -0
  125. package/dist/input/useAutosizeInput.js +56 -0
  126. package/dist/interactionStateLayer/index.d.ts +1 -0
  127. package/dist/interactionStateLayer/index.js +1 -0
  128. package/dist/interactionStateLayer/interactionStateLayer.d.ts +23 -0
  129. package/dist/interactionStateLayer/interactionStateLayer.js +67 -0
  130. package/dist/layout/flex.d.ts +1 -0
  131. package/dist/layout/grid.d.ts +1 -0
  132. package/dist/layout/index.d.ts +1 -1
  133. package/dist/layout/index.js +1 -1
  134. package/dist/layout/stack.d.ts +1 -0
  135. package/dist/layout/styles.d.ts +1 -1
  136. package/dist/layout/surface.d.ts +1 -0
  137. package/dist/link/index.d.ts +2 -0
  138. package/dist/link/index.js +2 -0
  139. package/dist/link/link.d.ts +43 -0
  140. package/dist/link/link.js +71 -0
  141. package/dist/link/linkBehaviorContext.d.ts +14 -0
  142. package/dist/link/linkBehaviorContext.js +31 -0
  143. package/dist/loader/indeterminateLoader.d.ts +1 -0
  144. package/dist/overlay.d.ts +59 -0
  145. package/dist/overlay.js +113 -0
  146. package/dist/overlayArrow.d.ts +9 -0
  147. package/dist/overlayArrow.js +55 -0
  148. package/dist/overlayPositioning.d.ts +70 -0
  149. package/dist/overlayPositioning.js +139 -0
  150. package/dist/panelProvider.d.ts +8 -0
  151. package/dist/panelProvider.js +20 -0
  152. package/dist/quote/quote.js +1 -1
  153. package/dist/radio/index.d.ts +1 -0
  154. package/dist/radio/index.js +1 -0
  155. package/dist/radio/radio.d.ts +9 -0
  156. package/dist/radio/radio.js +77 -0
  157. package/dist/renderToString.d.ts +2 -0
  158. package/dist/renderToString.js +25 -0
  159. package/dist/revealOnHover/index.d.ts +1 -0
  160. package/dist/revealOnHover/index.js +1 -0
  161. package/dist/revealOnHover/revealOnHover.d.ts +20 -0
  162. package/dist/revealOnHover/revealOnHover.js +62 -0
  163. package/dist/segmentedControl/index.d.ts +1 -0
  164. package/dist/segmentedControl/index.js +1 -0
  165. package/dist/segmentedControl/segmentedControl.d.ts +41 -0
  166. package/dist/segmentedControl/segmentedControl.js +217 -0
  167. package/dist/separator/separator.d.ts +4 -3
  168. package/dist/separator/separator.js +1 -1
  169. package/dist/sizeContext.d.ts +9 -0
  170. package/dist/sizeContext.js +13 -0
  171. package/dist/slider/index.d.ts +1 -0
  172. package/dist/slider/index.js +1 -0
  173. package/dist/slider/slider.d.ts +41 -0
  174. package/dist/slider/slider.js +386 -0
  175. package/dist/slot/index.d.ts +1 -0
  176. package/dist/slot/index.js +1 -0
  177. package/dist/slot/knownContexts.d.ts +1 -0
  178. package/dist/slot/knownContexts.js +7 -0
  179. package/dist/slot/slot.d.ts +26 -0
  180. package/dist/slot/slot.js +274 -0
  181. package/dist/statusIndicator/index.d.ts +1 -0
  182. package/dist/statusIndicator/index.js +1 -0
  183. package/dist/statusIndicator/statusIndicator.d.ts +24 -0
  184. package/dist/statusIndicator/statusIndicator.js +130 -0
  185. package/dist/switch/index.d.ts +1 -0
  186. package/dist/switch/index.js +1 -0
  187. package/dist/switch/switch.d.ts +6 -0
  188. package/dist/switch/switch.js +172 -0
  189. package/dist/table/index.d.ts +3 -0
  190. package/dist/table/index.js +3 -0
  191. package/dist/table/sortableHeaderCell.d.ts +36 -0
  192. package/dist/table/sortableHeaderCell.js +99 -0
  193. package/dist/table/styles.d.ts +46 -0
  194. package/dist/table/styles.js +93 -0
  195. package/dist/table/table.d.ts +64 -0
  196. package/dist/table/table.js +228 -0
  197. package/dist/table/useColumnResize.d.ts +27 -0
  198. package/dist/table/useColumnResize.js +62 -0
  199. package/dist/table/useObservedColumnSize.d.ts +12 -0
  200. package/dist/table/useObservedColumnSize.js +74 -0
  201. package/dist/text/heading.d.ts +2 -1
  202. package/dist/text/index.d.ts +1 -0
  203. package/dist/text/index.js +1 -0
  204. package/dist/text/prose.d.ts +8 -0
  205. package/dist/text/prose.js +45 -0
  206. package/dist/text/text.d.ts +8 -0
  207. package/dist/text/text.js +1 -1
  208. package/dist/textarea/index.d.ts +1 -0
  209. package/dist/textarea/index.js +1 -0
  210. package/dist/textarea/textarea.d.ts +22 -0
  211. package/dist/textarea/textarea.js +77 -0
  212. package/dist/theme/dark.d.ts +129 -10
  213. package/dist/theme/dark.js +41 -13
  214. package/dist/theme/index.d.ts +3 -12
  215. package/dist/theme/index.js +2 -2
  216. package/dist/theme/light.d.ts +129 -10
  217. package/dist/theme/light.js +42 -14
  218. package/dist/theme/swatch.d.ts +27 -0
  219. package/dist/theme/swatch.js +37 -0
  220. package/dist/theme/theme.d.ts +648 -0
  221. package/dist/theme/theme.js +780 -0
  222. package/dist/theme/types.d.ts +1 -0
  223. package/dist/theme/useInvertedTheme.d.ts +1 -0
  224. package/dist/theme/useInvertedTheme.js +7 -0
  225. package/dist/tooltip/index.d.ts +2 -0
  226. package/dist/tooltip/index.js +2 -0
  227. package/dist/tooltip/tooltip.d.ts +166 -0
  228. package/dist/tooltip/tooltip.js +181 -0
  229. package/dist/tooltip/useDisabledTooltip.d.ts +22 -0
  230. package/dist/tooltip/useDisabledTooltip.js +24 -0
  231. package/dist/trackingContext.d.ts +34 -0
  232. package/dist/trackingContext.js +29 -0
  233. package/dist/translation/index.d.ts +4 -0
  234. package/dist/translation/index.js +4 -0
  235. package/dist/translation/translationContext.d.ts +6 -0
  236. package/dist/translation/translationContext.js +6 -0
  237. package/dist/translation/useTranslation.d.ts +1 -0
  238. package/dist/translation/useTranslation.js +6 -0
  239. package/dist/unreachable.d.ts +1 -0
  240. package/dist/unreachable.js +4 -0
  241. package/dist/useHoverOverlay.d.ts +113 -0
  242. package/dist/useHoverOverlay.js +370 -0
  243. package/dist/useIsInsideInteractiveElement.d.ts +6 -0
  244. package/dist/useIsInsideInteractiveElement.js +31 -0
  245. package/dist/useOverlay.d.ts +82 -0
  246. package/dist/useOverlay.js +217 -0
  247. package/dist/useScrollLock.d.ts +5 -0
  248. package/dist/useScrollLock.js +100 -0
  249. package/dist/useStableMergeRef.d.ts +9 -0
  250. package/dist/useStableMergeRef.js +18 -0
  251. package/package.json +219 -11
  252. package/dist/index.d.ts +0 -9
  253. package/dist/index.js +0 -9
@@ -0,0 +1,274 @@
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { createContext, use, useCallback, useContext, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
3
+ import { createPortal } from "react-dom";
4
+ import { KNOWN_BRIDGED_CONTEXTS } from "./knownContexts.js";
5
+ import * as __rspack_external__sentry_react_f0cda475 from "@sentry/react";
6
+ const NOOP_REF_CALLBACK = ()=>{};
7
+ const EMPTY_STATE = {};
8
+ const NOOP_DISPATCH = ()=>{};
9
+ const reportedSlotWarnings = new Set();
10
+ function reportSlotWarning(type, component, slotName, message) {
11
+ const key = `${type}:${component}:${slotName}`;
12
+ if (reportedSlotWarnings.has(key)) return;
13
+ reportedSlotWarnings.add(key);
14
+ if ('production' !== process.env.NODE_ENV) return void console.warn(message);
15
+ __rspack_external__sentry_react_f0cda475.withScope((scope)=>{
16
+ scope.setLevel('warning');
17
+ scope.setTag('slot.component', component);
18
+ scope.setTag('slot.name', slotName);
19
+ scope.setFingerprint([
20
+ `slot-${type}`,
21
+ component,
22
+ slotName
23
+ ]);
24
+ __rspack_external__sentry_react_f0cda475.captureException(new Error(message));
25
+ });
26
+ }
27
+ function makeSlotReducer() {
28
+ return function(state, action) {
29
+ switch(action.type){
30
+ case 'increment counter':
31
+ {
32
+ const currentSlot = state[action.name];
33
+ return {
34
+ ...state,
35
+ [action.name]: {
36
+ contextBridges: currentSlot?.contextBridges ?? [],
37
+ element: currentSlot?.element ?? null,
38
+ counter: (currentSlot?.counter ?? 0) + 1
39
+ }
40
+ };
41
+ }
42
+ case 'decrement counter':
43
+ {
44
+ const currentSlot = state[action.name];
45
+ if (!currentSlot) return state;
46
+ return {
47
+ ...state,
48
+ [action.name]: {
49
+ ...currentSlot,
50
+ counter: currentSlot.counter - 1
51
+ }
52
+ };
53
+ }
54
+ case 'register':
55
+ return {
56
+ ...state,
57
+ [action.name]: {
58
+ contextBridges: state[action.name]?.contextBridges ?? [],
59
+ counter: state[action.name]?.counter ?? 0,
60
+ element: action.element
61
+ }
62
+ };
63
+ case 'unregister':
64
+ {
65
+ const currentSlot = state[action.name];
66
+ if (!currentSlot) return state;
67
+ return {
68
+ ...state,
69
+ [action.name]: {
70
+ contextBridges: currentSlot?.contextBridges ?? [],
71
+ counter: currentSlot?.counter ?? 0,
72
+ element: null
73
+ }
74
+ };
75
+ }
76
+ case 'set context bridges':
77
+ {
78
+ const currentSlot = state[action.name];
79
+ return {
80
+ ...state,
81
+ [action.name]: {
82
+ contextBridges: action.contextBridges,
83
+ counter: currentSlot?.counter ?? 0,
84
+ element: currentSlot?.element ?? null
85
+ }
86
+ };
87
+ }
88
+ case 'remove context bridges':
89
+ {
90
+ const currentSlot = state[action.name];
91
+ return {
92
+ ...state,
93
+ [action.name]: {
94
+ contextBridges: [],
95
+ counter: currentSlot?.counter ?? 0,
96
+ element: currentSlot?.element ?? null
97
+ }
98
+ };
99
+ }
100
+ default:
101
+ return state;
102
+ }
103
+ };
104
+ }
105
+ function useContextBridges() {
106
+ const values = KNOWN_BRIDGED_CONTEXTS.map((ctx)=>use(ctx));
107
+ const [prev, setPrev] = useState([]);
108
+ const changed = prev.length !== KNOWN_BRIDGED_CONTEXTS.length || prev.some((bridge, i)=>bridge.value !== values[i]);
109
+ if (changed) {
110
+ const next = KNOWN_BRIDGED_CONTEXTS.map((ctx, i)=>({
111
+ context: ctx,
112
+ value: values[i]
113
+ }));
114
+ setPrev(next);
115
+ return next;
116
+ }
117
+ return prev;
118
+ }
119
+ function makeSlotConsumer(options) {
120
+ const { context, outletNameContext } = options;
121
+ function SlotConsumer(props) {
122
+ const ctx = useContext(context);
123
+ const [state, dispatch] = ctx ?? [
124
+ EMPTY_STATE,
125
+ NOOP_DISPATCH
126
+ ];
127
+ const { name } = props;
128
+ const element = state[name]?.element;
129
+ useLayoutEffect(()=>{
130
+ if (dispatch === NOOP_DISPATCH) return;
131
+ dispatch({
132
+ type: 'increment counter',
133
+ name
134
+ });
135
+ return ()=>dispatch({
136
+ type: 'decrement counter',
137
+ name
138
+ });
139
+ }, [
140
+ dispatch,
141
+ name
142
+ ]);
143
+ if (!ctx) {
144
+ reportSlotWarning('missing-provider', 'Consumer', name, `<Slot.Consumer> for slot "${name}" rendered without a <Slot.Provider>`);
145
+ return null;
146
+ }
147
+ if (!element) return null;
148
+ let content = /*#__PURE__*/ jsx(outletNameContext.Provider, {
149
+ value: name,
150
+ children: props.children
151
+ });
152
+ const bridges = state[name]?.contextBridges;
153
+ if (bridges) content = bridges.toReversed().reduce((children, bridge)=>/*#__PURE__*/ jsx(bridge.context, {
154
+ value: bridge.value,
155
+ children: children
156
+ }), content);
157
+ return /*#__PURE__*/ createPortal(content, element);
158
+ }
159
+ SlotConsumer.displayName = 'Slot.Consumer';
160
+ return SlotConsumer;
161
+ }
162
+ function makeSlotOutlet(context, outletNameContext) {
163
+ function SlotOutlet(props) {
164
+ const ctx = useContext(context);
165
+ const [, dispatch] = ctx ?? [
166
+ EMPTY_STATE,
167
+ NOOP_DISPATCH
168
+ ];
169
+ const { name } = props;
170
+ const contextBridges = useContextBridges();
171
+ useLayoutEffect(()=>{
172
+ dispatch({
173
+ type: 'set context bridges',
174
+ name,
175
+ contextBridges
176
+ });
177
+ return ()=>dispatch({
178
+ type: 'remove context bridges',
179
+ name
180
+ });
181
+ }, [
182
+ dispatch,
183
+ name,
184
+ contextBridges
185
+ ]);
186
+ const ref = useCallback((element)=>{
187
+ if (dispatch === NOOP_DISPATCH) return;
188
+ if (!element) return void dispatch({
189
+ type: 'unregister',
190
+ name
191
+ });
192
+ dispatch({
193
+ type: 'register',
194
+ name,
195
+ element
196
+ });
197
+ }, [
198
+ dispatch,
199
+ name
200
+ ]);
201
+ if (!ctx) {
202
+ reportSlotWarning('missing-provider', 'Outlet', name, `<Slot.Outlet> for slot "${name}" rendered without a <Slot.Provider>`);
203
+ return props.children({
204
+ ref: NOOP_REF_CALLBACK
205
+ }, false);
206
+ }
207
+ return /*#__PURE__*/ jsx(outletNameContext.Provider, {
208
+ value: name,
209
+ children: props.children({
210
+ ref
211
+ }, (ctx[0][name]?.counter ?? 0) > 0)
212
+ });
213
+ }
214
+ SlotOutlet.displayName = 'Slot.Outlet';
215
+ return SlotOutlet;
216
+ }
217
+ function makeSlotFallback(context, outletNameContext) {
218
+ function SlotFallback({ children }) {
219
+ const ctx = useContext(context);
220
+ const name = useContext(outletNameContext);
221
+ if (!ctx) {
222
+ reportSlotWarning('missing-provider', 'Fallback', name ?? 'unknown', `<Slot.Fallback> for slot "${name ?? 'unknown'}" rendered without a <Slot.Provider>`);
223
+ return null;
224
+ }
225
+ if (null === name) throw new Error('Slot.Fallback must be rendered inside Slot.Outlet');
226
+ const [state] = ctx;
227
+ if ((state[name]?.counter ?? 0) > 0 || !state[name]?.element) return null;
228
+ return /*#__PURE__*/ createPortal(children, state[name].element);
229
+ }
230
+ SlotFallback.displayName = 'Slot.Fallback';
231
+ return SlotFallback;
232
+ }
233
+ function makeSlotProvider(context) {
234
+ const reducer = makeSlotReducer();
235
+ function SlotProvider({ children }) {
236
+ const [value, dispatch] = useReducer(reducer, {});
237
+ const contextValue = useMemo(()=>[
238
+ value,
239
+ dispatch
240
+ ], [
241
+ value,
242
+ dispatch
243
+ ]);
244
+ return /*#__PURE__*/ jsx(context.Provider, {
245
+ value: contextValue,
246
+ children: children
247
+ });
248
+ }
249
+ SlotProvider.displayName = 'Slot.Provider';
250
+ return SlotProvider;
251
+ }
252
+ function makeUseSlotOutletRef(context, outletNameContext) {
253
+ return function() {
254
+ const ctx = useContext(context);
255
+ const name = useContext(outletNameContext);
256
+ const ref = useRef(null);
257
+ ref.current = ctx && name ? ctx[0][name]?.element ?? null : null;
258
+ return ref;
259
+ };
260
+ }
261
+ function slot(names) {
262
+ const SlotContext = /*#__PURE__*/ createContext(null);
263
+ const OutletNameContext = /*#__PURE__*/ createContext(null);
264
+ const Slot = makeSlotConsumer({
265
+ context: SlotContext,
266
+ outletNameContext: OutletNameContext
267
+ });
268
+ Slot.Provider = makeSlotProvider(SlotContext);
269
+ Slot.Outlet = makeSlotOutlet(SlotContext, OutletNameContext);
270
+ Slot.Fallback = makeSlotFallback(SlotContext, OutletNameContext);
271
+ Slot.useSlotOutletRef = makeUseSlotOutletRef(SlotContext, OutletNameContext);
272
+ return Slot;
273
+ }
274
+ export { slot };
@@ -0,0 +1 @@
1
+ export { StatusIndicator } from './statusIndicator.js';
@@ -0,0 +1 @@
1
+ export { StatusIndicator } from "./statusIndicator.js";
@@ -0,0 +1,24 @@
1
+ import type * as React from 'react';
2
+ type StatusIndicatorVariant = 'accent' | 'danger' | 'warning' | 'success' | 'promotion' | 'muted';
3
+ type StatusIndicatorAnimationIterationCount = number | 'infinite';
4
+ interface StatusIndicatorProps extends React.HTMLAttributes<HTMLSpanElement> {
5
+ variant: StatusIndicatorVariant;
6
+ animationIterationCount?: StatusIndicatorAnimationIterationCount;
7
+ }
8
+ /**
9
+ * A small dot indicator that communicates status or state via color.
10
+ *
11
+ * Accessibility:
12
+ * - Provide `aria-label` when the dot conveys meaningful information not
13
+ * available elsewhere in the UI. An implicit `role="img"` is added when
14
+ * `aria-label` is present and no explicit `role` is given.
15
+ * - Omit `aria-label` (and `role`) for purely decorative dots that accompany
16
+ * visible text; the component will be hidden from the accessibility tree
17
+ * via `aria-hidden="true"`.
18
+ * - Pass an explicit `role` (e.g. `role="status"`) together with `aria-label`
19
+ * when a live-region semantic is needed.
20
+ *
21
+ * Placement is the caller's responsibility — no positioning props are provided.
22
+ */
23
+ export declare function StatusIndicator(props: StatusIndicatorProps): import("@emotion/react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -0,0 +1,130 @@
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import is_prop_valid from "@emotion/is-prop-valid";
3
+ import { keyframes } from "@emotion/react";
4
+ import styled from "@emotion/styled";
5
+ import { Container } from "../layout/index.js";
6
+ function StatusIndicator(props) {
7
+ const { animationIterationCount = 'infinite', variant, ...spanProps } = props;
8
+ return /*#__PURE__*/ jsx(Container, {
9
+ flexShrink: 0,
10
+ children: (p)=>/*#__PURE__*/ jsx(Dot, {
11
+ ...p,
12
+ ...spanProps,
13
+ animationIterationCount: animationIterationCount,
14
+ variant: variant,
15
+ role: spanProps.role ?? (spanProps['aria-label'] ? 'img' : void 0),
16
+ "aria-hidden": spanProps['aria-label'] || spanProps.role ? void 0 : true
17
+ })
18
+ });
19
+ }
20
+ function getDotTokens(variant, theme) {
21
+ switch(variant){
22
+ case 'accent':
23
+ return {
24
+ dot: theme.tokens.background.accent.vibrant,
25
+ pulse: theme.tokens.background.transparent.accent.muted
26
+ };
27
+ case 'danger':
28
+ return {
29
+ dot: theme.tokens.background.danger.vibrant,
30
+ pulse: theme.tokens.background.transparent.danger.muted
31
+ };
32
+ case 'warning':
33
+ return {
34
+ dot: theme.tokens.background.warning.vibrant,
35
+ pulse: theme.tokens.background.transparent.warning.muted
36
+ };
37
+ case 'success':
38
+ return {
39
+ dot: theme.tokens.background.success.vibrant,
40
+ pulse: theme.tokens.background.transparent.success.muted
41
+ };
42
+ case 'promotion':
43
+ return {
44
+ dot: theme.tokens.background.promotion.vibrant,
45
+ pulse: theme.tokens.background.transparent.promotion.muted
46
+ };
47
+ case 'muted':
48
+ return {
49
+ dot: theme.tokens.graphics.neutral.moderate,
50
+ pulse: theme.tokens.background.transparent.neutral.muted
51
+ };
52
+ default:
53
+ throw new TypeError(`Unsupported StatusIndicator variant: ${variant}`);
54
+ }
55
+ }
56
+ const gentlePulse = keyframes`
57
+ 0%, 100% {
58
+ transform: scale(1);
59
+ }
60
+ 33% {
61
+ transform: scale(0.95);
62
+ }
63
+ 67% {
64
+ transform: scale(1.05);
65
+ }
66
+ `;
67
+ const gentleSpin = keyframes`
68
+ 0% {
69
+ opacity: 0;
70
+ transform: scale(0.9) rotate(0);
71
+ }
72
+ 75% {
73
+ opacity: 1;
74
+ transform: scale(1) rotate(1turn);
75
+ }
76
+ 100% {
77
+ opacity: 0;
78
+ transform: scale(1.25) rotate(1turn);
79
+ }
80
+ `;
81
+ const Dot = styled('span', {
82
+ shouldForwardProp: (prop)=>is_prop_valid(prop) && 'animationIterationCount' !== prop
83
+ })`
84
+ position: relative;
85
+ width: 8px;
86
+ height: 8px;
87
+ &::before {
88
+ content: '';
89
+ position: absolute;
90
+ top: -2px;
91
+ left: -2px;
92
+ width: 12px;
93
+ height: 12px;
94
+ border-radius: ${(p)=>p.theme.radius['2xs']};
95
+ background-color: ${(p)=>getDotTokens(p.variant, p.theme).pulse};
96
+ animation: ${gentleSpin} 2.2s cubic-bezier(0.785, 0.135, 0.15, 0.86)
97
+ ${(p)=>p.animationIterationCount}
98
+ ${(p)=>'infinite' === p.animationIterationCount ? 'none' : 'forwards'};
99
+ }
100
+ &::after {
101
+ content: '';
102
+ position: absolute;
103
+ top: 0;
104
+ left: 0;
105
+ width: 8px;
106
+ height: 8px;
107
+ border-radius: ${(p)=>p.theme.radius.xs};
108
+ background-color: ${(p)=>getDotTokens(p.variant, p.theme).dot};
109
+ animation: ${gentlePulse} 2.2s cubic-bezier(0.445, 0.05, 0.55, 0.95)
110
+ ${(p)=>p.animationIterationCount}
111
+ ${(p)=>'infinite' === p.animationIterationCount ? 'none' : 'forwards'};
112
+ }
113
+
114
+ @media (prefers-reduced-motion: reduce) {
115
+ &::before,
116
+ &::after {
117
+ animation: none;
118
+ }
119
+
120
+ &::before {
121
+ opacity: 0;
122
+ transform: scale(1.25) rotate(1turn);
123
+ }
124
+
125
+ &::after {
126
+ transform: scale(1);
127
+ }
128
+ }
129
+ `;
130
+ export { StatusIndicator };
@@ -0,0 +1 @@
1
+ export { Switch, type SwitchProps } from './switch.js';
@@ -0,0 +1 @@
1
+ export { Switch } from "./switch.js";
@@ -0,0 +1,6 @@
1
+ import type * as React from 'react';
2
+ export interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'onClick'> {
3
+ ref?: React.Ref<HTMLInputElement>;
4
+ size?: 'sm' | 'lg';
5
+ }
6
+ export declare function Switch({ ref, size, ...props }: SwitchProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,172 @@
1
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
2
+ import styled from "@emotion/styled";
3
+ import { IconCheckmark } from "@sentry/icons/checkmark";
4
+ import { IconClose } from "@sentry/icons/close";
5
+ import { Container, Flex } from "../layout/index.js";
6
+ const toggleWrapperSize = {
7
+ sm: {
8
+ width: 36,
9
+ height: 20
10
+ },
11
+ lg: {
12
+ width: 40,
13
+ height: 24
14
+ }
15
+ };
16
+ const toggleButtonSize = {
17
+ sm: {
18
+ width: 20,
19
+ height: 20
20
+ },
21
+ lg: {
22
+ width: 24,
23
+ height: 24
24
+ }
25
+ };
26
+ const NativeHiddenCheckbox = styled('input')`
27
+ position: absolute;
28
+ opacity: 0;
29
+ top: 0;
30
+ left: 0;
31
+ width: 100%;
32
+ height: 100%;
33
+ cursor: pointer;
34
+
35
+ &:focus-visible + div {
36
+ ${(p)=>p.theme.focusRing()};
37
+ }
38
+
39
+ + div {
40
+ background: ${(p)=>p.theme.tokens.interactive.chonky.debossed.neutral.background};
41
+ border-top: 2px solid ${(p)=>p.theme.tokens.interactive.chonky.embossed.neutral.chonk};
42
+ border-right: 1px solid
43
+ ${(p)=>p.theme.tokens.interactive.chonky.embossed.neutral.chonk};
44
+ border-bottom: 1px solid
45
+ ${(p)=>p.theme.tokens.interactive.chonky.embossed.neutral.chonk};
46
+ border-left: 1px solid
47
+ ${(p)=>p.theme.tokens.interactive.chonky.embossed.neutral.chonk};
48
+
49
+ transition: all ${(p)=>p.theme.motion.spring.moderate};
50
+
51
+ [data-icon='checkmark'],
52
+ [data-icon='close'] {
53
+ top: 50%;
54
+ left: 50%;
55
+ position: absolute;
56
+ transform: scale(0.94) translate(-50%, -50%);
57
+ transform-origin: center center;
58
+ transition: all ${(p)=>p.theme.motion.spring.fast};
59
+ }
60
+
61
+ > div {
62
+ background: ${(p)=>p.theme.tokens.interactive.chonky.embossed.neutral.background};
63
+ border: 1px solid ${(p)=>p.theme.tokens.interactive.chonky.embossed.neutral.chonk};
64
+ transition: transform ${(p)=>p.theme.motion.spring.moderate};
65
+ transform: translateY(-1px);
66
+ }
67
+ }
68
+
69
+ & + div {
70
+ [data-icon='close'] {
71
+ opacity: 1;
72
+ transform: scale(1) translate(-50%, -50%);
73
+ }
74
+
75
+ [data-icon='checkmark'] {
76
+ opacity: 0;
77
+ transform: scale(0.94) translate(-50%, -50%);
78
+ }
79
+ }
80
+
81
+ &:checked + div {
82
+ [data-icon='close'] {
83
+ opacity: 0;
84
+ transform: scale(0.94) translate(-50%, -50%);
85
+ }
86
+
87
+ [data-icon='checkmark'] {
88
+ opacity: 1;
89
+ transform: scale(1) translate(-50%, -50%);
90
+ }
91
+
92
+ background: ${(p)=>p.theme.tokens.interactive.chonky.embossed.accent.background};
93
+
94
+ border-top: 2px solid ${(p)=>p.theme.tokens.interactive.chonky.embossed.accent.chonk};
95
+ border-right: 1px solid
96
+ ${(p)=>p.theme.tokens.interactive.chonky.embossed.accent.chonk};
97
+ border-bottom: 1px solid
98
+ ${(p)=>p.theme.tokens.interactive.chonky.embossed.accent.chonk};
99
+ border-left: 1px solid ${(p)=>p.theme.tokens.interactive.chonky.embossed.accent.chonk};
100
+
101
+ > div {
102
+ background: ${(p)=>p.theme.tokens.interactive.chonky.embossed.neutral.background};
103
+ border: 1px solid ${(p)=>p.theme.tokens.interactive.chonky.embossed.accent.chonk};
104
+ transform: translateY(-1px) translateX(-1px)
105
+ translateX(
106
+ ${(p)=>toggleWrapperSize[p.nativeSize].width - toggleButtonSize[p.nativeSize].width + 1}px
107
+ );
108
+ }
109
+ }
110
+
111
+ &:disabled {
112
+ cursor: not-allowed;
113
+ + div {
114
+ opacity: ${(p)=>p.theme.tokens.interactive.disabled};
115
+
116
+ > div {
117
+ transform: translateY(0px) translateX(-1px);
118
+ }
119
+ }
120
+ }
121
+
122
+ &:checked:disabled + div > div {
123
+ transform: translateY(0px)
124
+ translateX(
125
+ ${(p)=>toggleWrapperSize[p.nativeSize].width - toggleButtonSize[p.nativeSize].width + 1}px
126
+ );
127
+ }
128
+ `;
129
+ function Switch({ ref, size = 'sm', ...props }) {
130
+ return /*#__PURE__*/ jsxs(Flex, {
131
+ display: "inline-flex",
132
+ justify: "start",
133
+ position: "relative",
134
+ children: [
135
+ /*#__PURE__*/ jsx(NativeHiddenCheckbox, {
136
+ ref: ref,
137
+ type: "checkbox",
138
+ nativeSize: size,
139
+ ...props
140
+ }),
141
+ /*#__PURE__*/ jsx(Container, {
142
+ width: `${toggleWrapperSize[size].width}px`,
143
+ height: `${toggleWrapperSize[size].height}px`,
144
+ pointerEvents: "none",
145
+ radius: "sm",
146
+ children: /*#__PURE__*/ jsxs(Container, {
147
+ width: `${toggleButtonSize[size].width}px`,
148
+ height: `${toggleButtonSize[size].height}px`,
149
+ position: "absolute",
150
+ top: "0",
151
+ left: "0",
152
+ right: "0",
153
+ bottom: "0",
154
+ radius: "sm",
155
+ children: [
156
+ /*#__PURE__*/ jsx(IconClose, {
157
+ "data-icon": "close",
158
+ variant: "muted",
159
+ size: 'sm' === size ? 'xs' : 'sm'
160
+ }),
161
+ /*#__PURE__*/ jsx(IconCheckmark, {
162
+ "data-icon": "checkmark",
163
+ variant: "accent",
164
+ size: 'sm' === size ? 'xs' : 'sm'
165
+ })
166
+ ]
167
+ })
168
+ })
169
+ ]
170
+ });
171
+ }
172
+ export { Switch };
@@ -0,0 +1,3 @@
1
+ export { COL_WIDTH_MINIMUM, COL_WIDTH_UNDEFINED, Table, type TableColumnConfig, type TableProps, useTableElement, } from './table.js';
2
+ export { COLUMN_ALIGN_JUSTIFY, getAriaSort, HeaderCellContent, SortableHeaderCell, type ColumnAlign, type SortDirection, } from './sortableHeaderCell.js';
3
+ export { emptyCellStyle, fullWidthCellStyle, statusCellStyle, TableStatusCell, } from './styles.js';
@@ -0,0 +1,3 @@
1
+ export { COL_WIDTH_MINIMUM, COL_WIDTH_UNDEFINED, Table, useTableElement } from "./table.js";
2
+ export { COLUMN_ALIGN_JUSTIFY, HeaderCellContent, SortableHeaderCell, getAriaSort } from "./sortableHeaderCell.js";
3
+ export { TableStatusCell, emptyCellStyle, fullWidthCellStyle, statusCellStyle } from "./styles.js";
@@ -0,0 +1,36 @@
1
+ import type { HTMLAttributes, MouseEvent, ReactNode } from 'react';
2
+ import { type LinkProps } from '../link/index.js';
3
+ export type SortDirection = 'asc' | 'desc';
4
+ export declare function getAriaSort(direction: SortDirection | undefined): 'ascending' | 'descending' | undefined;
5
+ export type ColumnAlign = 'left' | 'center' | 'right';
6
+ export declare const COLUMN_ALIGN_JUSTIFY: {
7
+ readonly center: "center";
8
+ readonly left: "start";
9
+ readonly right: "end";
10
+ };
11
+ interface SortableHeaderCellProps extends HTMLAttributes<HTMLDivElement> {
12
+ align?: ColumnAlign;
13
+ children?: ReactNode;
14
+ direction?: SortDirection;
15
+ onSort?: (event: MouseEvent) => void;
16
+ overlays?: ReactNode;
17
+ /**
18
+ * Whether `to` should replace the history entry rather than pushing a new one.
19
+ */
20
+ replace?: boolean;
21
+ /**
22
+ * Sort destination to navigate to on sort.
23
+ */
24
+ to?: LinkProps['to'];
25
+ }
26
+ export declare function SortableHeaderCell({ align, children, direction, onSort, overlays, replace, to, ...props }: SortableHeaderCellProps): import("@emotion/react/jsx-runtime").JSX.Element;
27
+ export declare const HeaderCellContent: import("@emotion/styled").StyledComponent<{
28
+ theme?: import("@emotion/react").Theme;
29
+ as?: React.ElementType;
30
+ } & {
31
+ align?: ColumnAlign;
32
+ replace?: boolean;
33
+ to?: LinkProps["to"];
34
+ type?: "button";
35
+ }, import("react").DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
36
+ export {};