@sentry/scraps 0.2.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.
- package/dist/button/buttonBar.js +7 -1
- package/dist/dragHandle/dragHandle.d.ts +34 -0
- package/dist/dragHandle/dragHandle.js +115 -0
- package/dist/dragHandle/index.d.ts +4 -0
- package/dist/dragHandle/index.js +4 -0
- package/dist/dragHandle/setDocumentDragging.d.ts +9 -0
- package/dist/dragHandle/setDocumentDragging.js +6 -0
- package/dist/dragHandle/useDragMove.d.ts +244 -0
- package/dist/dragHandle/useDragMove.js +66 -0
- package/dist/dragHandle/useDragSeparator.d.ts +256 -0
- package/dist/dragHandle/useDragSeparator.js +36 -0
- package/dist/formPresentation/autoSaveContext.d.ts +23 -0
- package/dist/formPresentation/autoSaveContext.js +13 -0
- package/dist/formPresentation/base.d.ts +11 -0
- package/dist/formPresentation/base.js +37 -0
- package/dist/formPresentation/displayField.d.ts +17 -0
- package/dist/formPresentation/displayField.js +69 -0
- package/dist/formPresentation/fieldIds.d.ts +3 -0
- package/dist/formPresentation/fieldIds.js +14 -0
- package/dist/formPresentation/fieldLayout.d.ts +23 -0
- package/dist/formPresentation/fieldLayout.js +76 -0
- package/dist/formPresentation/formContext.d.ts +4 -0
- package/dist/formPresentation/formContext.js +6 -0
- package/dist/formPresentation/groupContext.d.ts +24 -0
- package/dist/formPresentation/groupContext.js +22 -0
- package/dist/formPresentation/icons.d.ts +11 -0
- package/dist/formPresentation/icons.js +61 -0
- package/dist/formPresentation/index.d.ts +8 -0
- package/dist/formPresentation/index.js +8 -0
- package/dist/formPresentation/meta.d.ts +18 -0
- package/dist/formPresentation/meta.js +88 -0
- package/dist/formPresentation/useStackedLayout.d.ts +1 -0
- package/dist/formPresentation/useStackedLayout.js +9 -0
- package/dist/input/index.d.ts +8 -0
- package/dist/input/index.js +6 -0
- package/dist/input/input.d.ts +19 -0
- package/dist/input/input.js +14 -0
- package/dist/input/inputGroup.d.ts +29 -0
- package/dist/input/inputGroup.js +167 -0
- package/dist/input/inputStyles.d.ts +13 -0
- package/dist/input/inputStyles.js +52 -0
- package/dist/input/numberDragInput.d.ts +20 -0
- package/dist/input/numberDragInput.js +97 -0
- package/dist/input/numberInput.d.ts +10 -0
- package/dist/input/numberInput.js +94 -0
- package/dist/input/otpInput.d.ts +28 -0
- package/dist/input/otpInput.js +81 -0
- package/dist/input/useAutosizeInput.d.ts +17 -0
- package/dist/input/useAutosizeInput.js +56 -0
- package/dist/overlayPositioning.d.ts +10 -1
- package/dist/overlayPositioning.js +15 -2
- package/dist/table/index.d.ts +3 -0
- package/dist/table/index.js +3 -0
- package/dist/table/sortableHeaderCell.d.ts +36 -0
- package/dist/table/sortableHeaderCell.js +99 -0
- package/dist/table/styles.d.ts +46 -0
- package/dist/table/styles.js +93 -0
- package/dist/table/table.d.ts +64 -0
- package/dist/table/table.js +228 -0
- package/dist/table/useColumnResize.d.ts +27 -0
- package/dist/table/useColumnResize.js +62 -0
- package/dist/table/useObservedColumnSize.d.ts +12 -0
- package/dist/table/useObservedColumnSize.js +74 -0
- package/dist/text/heading.d.ts +1 -1
- package/dist/text/text.d.ts +7 -0
- package/dist/text/text.js +1 -1
- package/dist/textarea/index.d.ts +1 -0
- package/dist/textarea/index.js +1 -0
- package/dist/textarea/textarea.d.ts +22 -0
- package/dist/textarea/textarea.js +77 -0
- package/dist/useOverlay.js +2 -1
- package/package.json +27 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo, useState } from "react";
|
|
3
|
+
import react_textarea_autosize from "react-textarea-autosize";
|
|
4
|
+
import is_prop_valid from "@emotion/is-prop-valid";
|
|
5
|
+
import { css } from "@emotion/react";
|
|
6
|
+
import styled from "@emotion/styled";
|
|
7
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
8
|
+
import { inputStyles } from "../input/inputStyles.js";
|
|
9
|
+
function TextAreaControl({ ref, autosize, rows = 3, maxRows, size: _size, ...p }) {
|
|
10
|
+
return autosize ? /*#__PURE__*/ jsx(AutosizeTextArea, {
|
|
11
|
+
...p,
|
|
12
|
+
ref: ref,
|
|
13
|
+
rows: rows,
|
|
14
|
+
maxRows: maxRows
|
|
15
|
+
}) : /*#__PURE__*/ jsx("textarea", {
|
|
16
|
+
ref: ref,
|
|
17
|
+
...p,
|
|
18
|
+
rows: rows
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
TextAreaControl.displayName = 'TextAreaControl';
|
|
22
|
+
function AutosizeTextArea({ ref, rows, maxRows, ...p }) {
|
|
23
|
+
'use no memo';
|
|
24
|
+
const [, setWidth] = useState();
|
|
25
|
+
const observerRef = useCallback((node)=>{
|
|
26
|
+
if (!node) return;
|
|
27
|
+
const observer = new ResizeObserver((entries)=>{
|
|
28
|
+
const entry = entries[0];
|
|
29
|
+
const width = entry?.borderBoxSize?.[0]?.inlineSize ?? entry?.contentRect.width;
|
|
30
|
+
setWidth(width);
|
|
31
|
+
});
|
|
32
|
+
observer.observe(node, {
|
|
33
|
+
box: 'border-box'
|
|
34
|
+
});
|
|
35
|
+
return ()=>observer.disconnect();
|
|
36
|
+
}, []);
|
|
37
|
+
const mergedRef = useMemo(()=>mergeRefs(ref, observerRef), [
|
|
38
|
+
ref,
|
|
39
|
+
observerRef
|
|
40
|
+
]);
|
|
41
|
+
return /*#__PURE__*/ jsx(react_textarea_autosize, {
|
|
42
|
+
...p,
|
|
43
|
+
ref: mergedRef,
|
|
44
|
+
minRows: rows,
|
|
45
|
+
maxRows: maxRows
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const StyledTextArea = styled(TextAreaControl, {
|
|
49
|
+
shouldForwardProp: (p)=>[
|
|
50
|
+
'autosize',
|
|
51
|
+
'maxRows'
|
|
52
|
+
].includes(p) || is_prop_valid(p)
|
|
53
|
+
})`
|
|
54
|
+
${inputStyles};
|
|
55
|
+
line-height: ${(p)=>p.theme.font.lineHeight.comfortable};
|
|
56
|
+
/** Allow react-textarea-autosize to freely control height based on props. */
|
|
57
|
+
${(p)=>p.autosize && css`
|
|
58
|
+
height: unset;
|
|
59
|
+
min-height: unset;
|
|
60
|
+
`}
|
|
61
|
+
`;
|
|
62
|
+
const TextArea = styled(StyledTextArea)`
|
|
63
|
+
/* re-set height to let it be determined by the rows prop */
|
|
64
|
+
height: unset;
|
|
65
|
+
/* this calculation reduces padding to account for the line-height, which ensures text is still correctly centered. */
|
|
66
|
+
${({ theme, size = 'md' })=>`padding-top: calc(
|
|
67
|
+
(${theme.form[size].height} -
|
|
68
|
+
(${theme.form[size].fontSize} * ${theme.font.lineHeight.comfortable})
|
|
69
|
+
) / 2
|
|
70
|
+
)`};
|
|
71
|
+
${({ theme, size = 'md' })=>`padding-bottom: calc(
|
|
72
|
+
(${theme.form[size].height} -
|
|
73
|
+
(${theme.form[size].fontSize} * ${theme.font.lineHeight.comfortable})
|
|
74
|
+
) / 2
|
|
75
|
+
)`};
|
|
76
|
+
`;
|
|
77
|
+
export { TextArea };
|
package/dist/useOverlay.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useButton } from "@react-aria/button";
|
|
|
4
4
|
import { useOverlay, useOverlayTrigger } from "@react-aria/overlays";
|
|
5
5
|
import { mergeProps } from "@react-aria/utils";
|
|
6
6
|
import { useOverlayTriggerState } from "@react-stately/overlays";
|
|
7
|
-
import { anchorOverlay, anchoredStyles, arrowOverlay, placementMiddleware, shiftOverlay } from "./overlayPositioning.js";
|
|
7
|
+
import { anchorOverlay, anchoredStyles, arrowOverlay, overlayPlatform, placementMiddleware, shiftOverlay } from "./overlayPositioning.js";
|
|
8
8
|
function maxSize(options) {
|
|
9
9
|
return {
|
|
10
10
|
name: 'maxSize',
|
|
@@ -116,6 +116,7 @@ function useOverlay_useOverlay({ isOpen, onClose, defaultOpen, onOpenChange, typ
|
|
|
116
116
|
},
|
|
117
117
|
middleware,
|
|
118
118
|
placement: initialPlacement,
|
|
119
|
+
platform: overlayPlatform,
|
|
119
120
|
strategy,
|
|
120
121
|
transform: false,
|
|
121
122
|
whileElementsMounted: openState.isOpen ? autoUpdate : void 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/scraps",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/getsentry/sentry.git",
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
"types": "./dist/theme/index.d.ts",
|
|
24
24
|
"import": "./dist/theme/index.js"
|
|
25
25
|
},
|
|
26
|
+
"./formPresentation": {
|
|
27
|
+
"types": "./dist/formPresentation/index.d.ts",
|
|
28
|
+
"import": "./dist/formPresentation/index.js"
|
|
29
|
+
},
|
|
26
30
|
"./tokens": {
|
|
27
31
|
"types": "./dist/tokens/index.d.ts",
|
|
28
32
|
"import": "./dist/tokens/index.js"
|
|
@@ -63,6 +67,14 @@
|
|
|
63
67
|
"types": "./dist/slider/index.d.ts",
|
|
64
68
|
"import": "./dist/slider/index.js"
|
|
65
69
|
},
|
|
70
|
+
"./input": {
|
|
71
|
+
"types": "./dist/input/index.d.ts",
|
|
72
|
+
"import": "./dist/input/index.js"
|
|
73
|
+
},
|
|
74
|
+
"./textarea": {
|
|
75
|
+
"types": "./dist/textarea/index.d.ts",
|
|
76
|
+
"import": "./dist/textarea/index.js"
|
|
77
|
+
},
|
|
66
78
|
"./slot": {
|
|
67
79
|
"types": "./dist/slot/index.d.ts",
|
|
68
80
|
"import": "./dist/slot/index.js"
|
|
@@ -194,6 +206,14 @@
|
|
|
194
206
|
"./useIsInsideInteractiveElement": {
|
|
195
207
|
"types": "./dist/useIsInsideInteractiveElement.d.ts",
|
|
196
208
|
"import": "./dist/useIsInsideInteractiveElement.js"
|
|
209
|
+
},
|
|
210
|
+
"./table": {
|
|
211
|
+
"types": "./dist/table/index.d.ts",
|
|
212
|
+
"import": "./dist/table/index.js"
|
|
213
|
+
},
|
|
214
|
+
"./dragHandle": {
|
|
215
|
+
"types": "./dist/dragHandle/index.d.ts",
|
|
216
|
+
"import": "./dist/dragHandle/index.js"
|
|
197
217
|
}
|
|
198
218
|
},
|
|
199
219
|
"publishConfig": {
|
|
@@ -207,6 +227,7 @@
|
|
|
207
227
|
"@react-aria/disclosure": "3.2.1",
|
|
208
228
|
"@react-aria/i18n": "3.13.1",
|
|
209
229
|
"@react-aria/interactions": "3.28.1",
|
|
230
|
+
"@react-aria/numberfield": "3.13.1",
|
|
210
231
|
"@react-aria/overlays": "3.32.1",
|
|
211
232
|
"@react-aria/radio": "3.13.1",
|
|
212
233
|
"@react-aria/slider": "3.9.1",
|
|
@@ -215,6 +236,7 @@
|
|
|
215
236
|
"@react-stately/collections": "3.13.1",
|
|
216
237
|
"@react-stately/disclosure": "3.1.1",
|
|
217
238
|
"@react-stately/list": "3.14.1",
|
|
239
|
+
"@react-stately/numberfield": "3.12.1",
|
|
218
240
|
"@react-stately/overlays": "3.7.1",
|
|
219
241
|
"@react-stately/radio": "3.12.1",
|
|
220
242
|
"@react-stately/slider": "3.8.1",
|
|
@@ -224,7 +246,9 @@
|
|
|
224
246
|
"@types/react": "19.3.0",
|
|
225
247
|
"classnames": "2.3.1",
|
|
226
248
|
"framer-motion": "12.38.0",
|
|
249
|
+
"input-otp": "^1.5.0",
|
|
227
250
|
"query-string": "7.0.1",
|
|
251
|
+
"react-textarea-autosize": "8.5.7",
|
|
228
252
|
"type-fest": "^5.10.0"
|
|
229
253
|
},
|
|
230
254
|
"devDependencies": {
|
|
@@ -234,6 +258,7 @@
|
|
|
234
258
|
"@rslib/core": "1.0.3",
|
|
235
259
|
"@swc/core": "1.16.13",
|
|
236
260
|
"@swc/jest": "0.2.39",
|
|
261
|
+
"@tanstack/react-form": "1.28.6",
|
|
237
262
|
"@testing-library/dom": "10.4.1",
|
|
238
263
|
"@testing-library/jest-dom": "7.0.1",
|
|
239
264
|
"@testing-library/react": "16.3.2",
|
|
@@ -251,6 +276,7 @@
|
|
|
251
276
|
},
|
|
252
277
|
"peerDependencies": {
|
|
253
278
|
"@emotion/react": "^11.14.0",
|
|
279
|
+
"@tanstack/react-form": "^1.28.6",
|
|
254
280
|
"react": "^19.0.0",
|
|
255
281
|
"react-dom": "^19.0.0"
|
|
256
282
|
},
|