@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,256 @@
|
|
|
1
|
+
import type { Orientation } from './dragHandle.js';
|
|
2
|
+
interface UseDragSeparatorOptions {
|
|
3
|
+
isSizedFirst: boolean;
|
|
4
|
+
onMove: (delta: number) => void;
|
|
5
|
+
orientation: Orientation;
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
onMoveEnd?: () => void;
|
|
9
|
+
onMoveStart?: () => void;
|
|
10
|
+
value?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function useDragSeparator({ isSizedFirst, max, min, onMove, onMoveEnd, onMoveStart, orientation, value, }: UseDragSeparatorOptions): {
|
|
13
|
+
cursor: (`${string}(${string})` | "inherit" | "initial" | "revert" | "revert-layer" | "unset") | "auto" | "none" | "-moz-grab" | "-webkit-grab" | "alias" | "all-scroll" | "cell" | "col-resize" | "context-menu" | "copy" | "crosshair" | "default" | "e-resize" | "ew-resize" | "grab" | "grabbing" | "help" | "move" | "n-resize" | "ne-resize" | "nesw-resize" | "no-drop" | "not-allowed" | "ns-resize" | "nw-resize" | "nwse-resize" | "pointer" | "progress" | "row-resize" | "s-resize" | "se-resize" | "sw-resize" | "text" | "vertical-text" | "w-resize" | "wait" | "zoom-in" | "zoom-out";
|
|
14
|
+
separatorProps: {
|
|
15
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
|
|
16
|
+
id?: string | undefined;
|
|
17
|
+
role?: import("react").AriaRole | undefined;
|
|
18
|
+
tabIndex?: number | undefined;
|
|
19
|
+
style?: import("react").CSSProperties | undefined;
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
"aria-activedescendant"?: string | undefined;
|
|
22
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
23
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
24
|
+
"aria-braillelabel"?: string | undefined;
|
|
25
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
26
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
27
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
28
|
+
"aria-colcount"?: number | undefined;
|
|
29
|
+
"aria-colindex"?: number | undefined;
|
|
30
|
+
"aria-colindextext"?: string | undefined;
|
|
31
|
+
"aria-colspan"?: number | undefined;
|
|
32
|
+
"aria-controls"?: string | undefined;
|
|
33
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
34
|
+
"aria-describedby"?: string | undefined;
|
|
35
|
+
"aria-description"?: string | undefined;
|
|
36
|
+
"aria-details"?: string | undefined;
|
|
37
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
38
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
39
|
+
"aria-errormessage"?: string | undefined;
|
|
40
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
41
|
+
"aria-flowto"?: string | undefined;
|
|
42
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
43
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
44
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
45
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
46
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
47
|
+
"aria-label"?: string | undefined;
|
|
48
|
+
"aria-labelledby"?: string | undefined;
|
|
49
|
+
"aria-level"?: number | undefined;
|
|
50
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
51
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
52
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
53
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
54
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
55
|
+
"aria-owns"?: string | undefined;
|
|
56
|
+
"aria-placeholder"?: string | undefined;
|
|
57
|
+
"aria-posinset"?: number | undefined;
|
|
58
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
59
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
60
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
61
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
62
|
+
"aria-roledescription"?: string | undefined;
|
|
63
|
+
"aria-rowcount"?: number | undefined;
|
|
64
|
+
"aria-rowindex"?: number | undefined;
|
|
65
|
+
"aria-rowindextext"?: string | undefined;
|
|
66
|
+
"aria-rowspan"?: number | undefined;
|
|
67
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
68
|
+
"aria-setsize"?: number | undefined;
|
|
69
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
70
|
+
"aria-valuemax"?: number | undefined;
|
|
71
|
+
"aria-valuemin"?: number | undefined;
|
|
72
|
+
"aria-valuenow"?: number | undefined;
|
|
73
|
+
"aria-valuetext"?: string | undefined;
|
|
74
|
+
children?: import("react").ReactNode | undefined;
|
|
75
|
+
dangerouslySetInnerHTML?: {
|
|
76
|
+
__html: string | TrustedHTML;
|
|
77
|
+
} | undefined;
|
|
78
|
+
onCopy?: import("react").ClipboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
79
|
+
onCopyCapture?: import("react").ClipboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
80
|
+
onCut?: import("react").ClipboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
81
|
+
onCutCapture?: import("react").ClipboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
82
|
+
onPaste?: import("react").ClipboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
83
|
+
onPasteCapture?: import("react").ClipboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
84
|
+
onCompositionEnd?: import("react").CompositionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
85
|
+
onCompositionEndCapture?: import("react").CompositionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
86
|
+
onCompositionStart?: import("react").CompositionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
87
|
+
onCompositionStartCapture?: import("react").CompositionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
88
|
+
onCompositionUpdate?: import("react").CompositionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
89
|
+
onCompositionUpdateCapture?: import("react").CompositionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
90
|
+
onFocus?: import("react").FocusEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
91
|
+
onFocusCapture?: import("react").FocusEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
92
|
+
onBlur?: import("react").FocusEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
93
|
+
onBlurCapture?: import("react").FocusEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
94
|
+
onChange?: import("react").ChangeEventHandler<import("@react-types/shared").FocusableElement, Element> | undefined;
|
|
95
|
+
onChangeCapture?: import("react").ChangeEventHandler<import("@react-types/shared").FocusableElement, Element> | undefined;
|
|
96
|
+
onBeforeInput?: import("react").InputEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
97
|
+
onBeforeInputCapture?: import("react").InputEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
98
|
+
onInput?: import("react").InputEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
99
|
+
onInputCapture?: import("react").InputEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
100
|
+
onReset?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
101
|
+
onResetCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
102
|
+
onSubmit?: import("react").SubmitEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
103
|
+
onSubmitCapture?: import("react").SubmitEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
104
|
+
onInvalid?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
105
|
+
onInvalidCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
106
|
+
onLoad?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
107
|
+
onLoadCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
108
|
+
onError?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
109
|
+
onErrorCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
110
|
+
onKeyDownCapture?: import("react").KeyboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
111
|
+
onKeyPress?: import("react").KeyboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
112
|
+
onKeyPressCapture?: import("react").KeyboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
113
|
+
onKeyUp?: import("react").KeyboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
114
|
+
onKeyUpCapture?: import("react").KeyboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
115
|
+
onAbort?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
116
|
+
onAbortCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
117
|
+
onCanPlay?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
118
|
+
onCanPlayCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
119
|
+
onCanPlayThrough?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
120
|
+
onCanPlayThroughCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
121
|
+
onDurationChange?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
122
|
+
onDurationChangeCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
123
|
+
onEmptied?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
124
|
+
onEmptiedCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
125
|
+
onEncrypted?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
126
|
+
onEncryptedCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
127
|
+
onEnded?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
128
|
+
onEndedCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
129
|
+
onLoadedData?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
130
|
+
onLoadedDataCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
131
|
+
onLoadedMetadata?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
132
|
+
onLoadedMetadataCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
133
|
+
onLoadStart?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
134
|
+
onLoadStartCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
135
|
+
onPause?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
136
|
+
onPauseCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
137
|
+
onPlay?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
138
|
+
onPlayCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
139
|
+
onPlaying?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
140
|
+
onPlayingCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
141
|
+
onProgress?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
142
|
+
onProgressCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
143
|
+
onRateChange?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
144
|
+
onRateChangeCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
145
|
+
onSeeked?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
146
|
+
onSeekedCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
147
|
+
onSeeking?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
148
|
+
onSeekingCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
149
|
+
onStalled?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
150
|
+
onStalledCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
151
|
+
onSuspend?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
152
|
+
onSuspendCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
153
|
+
onTimeUpdate?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
154
|
+
onTimeUpdateCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
155
|
+
onVolumeChange?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
156
|
+
onVolumeChangeCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
157
|
+
onWaiting?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
158
|
+
onWaitingCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
159
|
+
onAuxClick?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
160
|
+
onAuxClickCapture?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
161
|
+
onClick?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
162
|
+
onClickCapture?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
163
|
+
onContextMenu?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
164
|
+
onContextMenuCapture?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
165
|
+
onDoubleClick?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
166
|
+
onDoubleClickCapture?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
167
|
+
onDrag?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
168
|
+
onDragCapture?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
169
|
+
onDragEnd?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
170
|
+
onDragEndCapture?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
171
|
+
onDragEnter?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
172
|
+
onDragEnterCapture?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
173
|
+
onDragExit?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
174
|
+
onDragExitCapture?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
175
|
+
onDragLeave?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
176
|
+
onDragLeaveCapture?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
177
|
+
onDragOver?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
178
|
+
onDragOverCapture?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
179
|
+
onDragStart?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
180
|
+
onDragStartCapture?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
181
|
+
onDrop?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
182
|
+
onDropCapture?: import("react").DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
183
|
+
onMouseDown?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
184
|
+
onMouseDownCapture?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
185
|
+
onMouseEnter?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
186
|
+
onMouseLeave?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
187
|
+
onMouseMove?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
188
|
+
onMouseMoveCapture?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
189
|
+
onMouseOut?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
190
|
+
onMouseOutCapture?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
191
|
+
onMouseOver?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
192
|
+
onMouseOverCapture?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
193
|
+
onMouseUp?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
194
|
+
onMouseUpCapture?: import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
195
|
+
onSelect?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
196
|
+
onSelectCapture?: import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
197
|
+
onTouchCancel?: import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
198
|
+
onTouchCancelCapture?: import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
199
|
+
onTouchEnd?: import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
200
|
+
onTouchEndCapture?: import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
201
|
+
onTouchMove?: import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
202
|
+
onTouchMoveCapture?: import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
203
|
+
onTouchStart?: import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
204
|
+
onTouchStartCapture?: import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
205
|
+
onPointerDown?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
206
|
+
onPointerDownCapture?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
207
|
+
onPointerMove?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
208
|
+
onPointerMoveCapture?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
209
|
+
onPointerUp?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
210
|
+
onPointerUpCapture?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
211
|
+
onPointerCancel?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
212
|
+
onPointerCancelCapture?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
213
|
+
onPointerEnter?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
214
|
+
onPointerLeave?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
215
|
+
onPointerOver?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
216
|
+
onPointerOverCapture?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
217
|
+
onPointerOut?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
218
|
+
onPointerOutCapture?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
219
|
+
onGotPointerCapture?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
220
|
+
onGotPointerCaptureCapture?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
221
|
+
onLostPointerCapture?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
222
|
+
onLostPointerCaptureCapture?: import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
223
|
+
onScroll?: import("react").UIEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
224
|
+
onScrollCapture?: import("react").UIEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
225
|
+
onScrollEnd?: import("react").UIEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
226
|
+
onScrollEndCapture?: import("react").UIEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
227
|
+
onWheel?: import("react").WheelEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
228
|
+
onWheelCapture?: import("react").WheelEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
229
|
+
onAnimationStart?: import("react").AnimationEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
230
|
+
onAnimationStartCapture?: import("react").AnimationEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
231
|
+
onAnimationEnd?: import("react").AnimationEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
232
|
+
onAnimationEndCapture?: import("react").AnimationEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
233
|
+
onAnimationIteration?: import("react").AnimationEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
234
|
+
onAnimationIterationCapture?: import("react").AnimationEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
235
|
+
onToggle?: import("react").ToggleEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
236
|
+
onBeforeToggle?: import("react").ToggleEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
237
|
+
onTransitionCancel?: import("react").TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
238
|
+
onTransitionCancelCapture?: import("react").TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
239
|
+
onTransitionEnd?: import("react").TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
240
|
+
onTransitionEndCapture?: import("react").TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
241
|
+
onTransitionRun?: import("react").TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
242
|
+
onTransitionRunCapture?: import("react").TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
243
|
+
onTransitionStart?: import("react").TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
244
|
+
onTransitionStartCapture?: import("react").TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
|
|
245
|
+
} & {
|
|
246
|
+
'aria-orientation': string;
|
|
247
|
+
'aria-valuemax': number | undefined;
|
|
248
|
+
'aria-valuemin': number | undefined;
|
|
249
|
+
'aria-valuenow': number | undefined;
|
|
250
|
+
'data-is-held': boolean;
|
|
251
|
+
'data-orientation': Orientation;
|
|
252
|
+
role: string;
|
|
253
|
+
tabIndex: number;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { mergeProps } from "@react-aria/utils";
|
|
2
|
+
import { useDragMove } from "./useDragMove.js";
|
|
3
|
+
function getDragSeparatorCursor(orientation, atMin, atMax, isSizedFirst) {
|
|
4
|
+
if ('horizontal' === orientation) {
|
|
5
|
+
if (atMin) return isSizedFirst ? 'e-resize' : 'w-resize';
|
|
6
|
+
if (atMax) return isSizedFirst ? 'w-resize' : 'e-resize';
|
|
7
|
+
return 'ew-resize';
|
|
8
|
+
}
|
|
9
|
+
if (atMin) return isSizedFirst ? 's-resize' : 'n-resize';
|
|
10
|
+
if (atMax) return isSizedFirst ? 'n-resize' : 's-resize';
|
|
11
|
+
return 'ns-resize';
|
|
12
|
+
}
|
|
13
|
+
function useDragSeparator({ isSizedFirst, max, min, onMove, onMoveEnd, onMoveStart, orientation, value }) {
|
|
14
|
+
const { isHeld, moveProps } = useDragMove({
|
|
15
|
+
onMove,
|
|
16
|
+
onMoveEnd,
|
|
17
|
+
onMoveStart,
|
|
18
|
+
orientation
|
|
19
|
+
});
|
|
20
|
+
const hasMax = void 0 !== max && Number.isFinite(max);
|
|
21
|
+
const cursor = getDragSeparatorCursor(orientation, void 0 !== min && void 0 !== value && value <= min, hasMax && void 0 !== value && value >= max, isSizedFirst);
|
|
22
|
+
return {
|
|
23
|
+
cursor,
|
|
24
|
+
separatorProps: mergeProps(moveProps, {
|
|
25
|
+
'aria-orientation': 'horizontal' === orientation ? 'vertical' : 'horizontal',
|
|
26
|
+
'aria-valuemax': hasMax ? max : void 0,
|
|
27
|
+
'aria-valuemin': min,
|
|
28
|
+
'aria-valuenow': value,
|
|
29
|
+
'data-is-held': isHeld,
|
|
30
|
+
'data-orientation': orientation,
|
|
31
|
+
role: 'separator',
|
|
32
|
+
tabIndex: 0
|
|
33
|
+
})
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export { useDragSeparator };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Context for auto-save mutation state
|
|
4
|
+
* Consumed by field components to automatically apply mutation state
|
|
5
|
+
*/
|
|
6
|
+
interface AutoSaveContextValue {
|
|
7
|
+
resetOnErrorRef: React.RefObject<boolean>;
|
|
8
|
+
status: 'pending' | 'error' | 'idle' | 'success';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Hook to access auto-save context
|
|
12
|
+
* Returns null if not within AutoSaveForm
|
|
13
|
+
*/
|
|
14
|
+
export declare function useAutoSaveContext(): AutoSaveContextValue | null;
|
|
15
|
+
/**
|
|
16
|
+
* Provider for auto-save context
|
|
17
|
+
* Wraps fields to provide mutation state
|
|
18
|
+
*/
|
|
19
|
+
export declare function AutoSaveContextProvider({ value, children, }: {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
value: AutoSaveContextValue;
|
|
22
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
const AutoSaveContext = /*#__PURE__*/ createContext(null);
|
|
4
|
+
function useAutoSaveContext() {
|
|
5
|
+
return useContext(AutoSaveContext);
|
|
6
|
+
}
|
|
7
|
+
function AutoSaveContextProvider({ value, children }) {
|
|
8
|
+
return /*#__PURE__*/ jsx(AutoSaveContext, {
|
|
9
|
+
value: value,
|
|
10
|
+
children: children
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export { AutoSaveContextProvider, useAutoSaveContext };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { Stack, type FlexProps } from '../layout/index.js';
|
|
3
|
+
interface BaseLayoutProps extends FlexProps<'div' | 'dl'> {
|
|
4
|
+
stacked: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function BaseLayout({ stacked, ...props }: BaseLayoutProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
type LayoutLabelProps = React.ComponentProps<typeof Stack> & {
|
|
8
|
+
stacked: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function LayoutLabel({ stacked, ...props }: LayoutLabelProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { keyframes } from "@emotion/react";
|
|
3
|
+
import styled from "@emotion/styled";
|
|
4
|
+
import { Flex, Stack } from "../layout/index.js";
|
|
5
|
+
function BaseLayout({ stacked, ...props }) {
|
|
6
|
+
return /*#__PURE__*/ jsx(HighlightableFlex, {
|
|
7
|
+
direction: stacked ? 'column' : 'row',
|
|
8
|
+
gap: stacked ? 'md' : 'xl',
|
|
9
|
+
align: stacked ? void 0 : 'center',
|
|
10
|
+
justify: stacked ? void 0 : 'between',
|
|
11
|
+
flexGrow: 1,
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function LayoutLabel({ stacked, ...props }) {
|
|
16
|
+
return /*#__PURE__*/ jsx(Stack, {
|
|
17
|
+
width: stacked ? void 0 : '50%',
|
|
18
|
+
gap: "xs",
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const highlightFade = keyframes`
|
|
23
|
+
0% {
|
|
24
|
+
background-color: var(--highlight-color);
|
|
25
|
+
}
|
|
26
|
+
100% {
|
|
27
|
+
background-color: transparent;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
const HighlightableFlex = styled(Flex)`
|
|
31
|
+
--highlight-color: ${(p)=>p.theme.tokens.background.transparent.accent.muted};
|
|
32
|
+
|
|
33
|
+
&[data-highlight] {
|
|
34
|
+
animation: ${highlightFade} ${(p)=>p.theme.motion.smooth.slow};
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
export { BaseLayout, LayoutLabel };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type ContainerProps } from '../layout/index.js';
|
|
3
|
+
interface DisplayFieldProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
hintText?: React.ReactNode;
|
|
7
|
+
padding?: ContainerProps['padding'];
|
|
8
|
+
variant?: 'compact';
|
|
9
|
+
}
|
|
10
|
+
declare function RowDisplay(props: DisplayFieldProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function StackDisplay(props: DisplayFieldProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
+
/** Display information with the same layout as form fields, without form state. */
|
|
13
|
+
export declare const DisplayField: {
|
|
14
|
+
Row: typeof RowDisplay;
|
|
15
|
+
Stack: typeof StackDisplay;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { DescriptionList } from "../descriptionList/index.js";
|
|
3
|
+
import { InfoText } from "../info/index.js";
|
|
4
|
+
import { Container, Stack } from "../layout/index.js";
|
|
5
|
+
import { Text } from "../text/index.js";
|
|
6
|
+
import { BaseLayout, LayoutLabel } from "./base.js";
|
|
7
|
+
import { useStackedLayout } from "./useStackedLayout.js";
|
|
8
|
+
function RowDisplay(props) {
|
|
9
|
+
const stacked = useStackedLayout();
|
|
10
|
+
return /*#__PURE__*/ jsx(DisplayLayout, {
|
|
11
|
+
...props,
|
|
12
|
+
stacked: stacked
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function StackDisplay(props) {
|
|
16
|
+
return /*#__PURE__*/ jsx(DisplayLayout, {
|
|
17
|
+
...props,
|
|
18
|
+
stacked: true
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function DisplayLayout({ children, label, hintText, padding, variant, stacked }) {
|
|
22
|
+
const compact = 'compact' === variant;
|
|
23
|
+
const hint = hintText && !compact ? /*#__PURE__*/ jsx(Text, {
|
|
24
|
+
size: "sm",
|
|
25
|
+
variant: "muted",
|
|
26
|
+
children: hintText
|
|
27
|
+
}) : null;
|
|
28
|
+
return /*#__PURE__*/ jsxs(BaseLayout, {
|
|
29
|
+
as: "dl",
|
|
30
|
+
stacked: stacked,
|
|
31
|
+
padding: padding,
|
|
32
|
+
margin: "0",
|
|
33
|
+
children: [
|
|
34
|
+
/*#__PURE__*/ jsx(LayoutLabel, {
|
|
35
|
+
stacked: stacked,
|
|
36
|
+
children: (labelProps)=>/*#__PURE__*/ jsxs(DescriptionList.Term, {
|
|
37
|
+
...labelProps,
|
|
38
|
+
children: [
|
|
39
|
+
/*#__PURE__*/ jsx(Text, {
|
|
40
|
+
children: compact && hintText ? /*#__PURE__*/ jsx(InfoText, {
|
|
41
|
+
title: hintText,
|
|
42
|
+
children: label
|
|
43
|
+
}) : label
|
|
44
|
+
}),
|
|
45
|
+
!stacked && hint
|
|
46
|
+
]
|
|
47
|
+
})
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ jsx(Container, {
|
|
50
|
+
flexGrow: 1,
|
|
51
|
+
children: (valueProps)=>/*#__PURE__*/ jsx(DescriptionList.Details, {
|
|
52
|
+
...valueProps,
|
|
53
|
+
children: /*#__PURE__*/ jsxs(Stack, {
|
|
54
|
+
gap: "md",
|
|
55
|
+
children: [
|
|
56
|
+
children,
|
|
57
|
+
stacked && hint
|
|
58
|
+
]
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const DisplayField = {
|
|
66
|
+
Row: RowDisplay,
|
|
67
|
+
Stack: StackDisplay
|
|
68
|
+
};
|
|
69
|
+
export { DisplayField };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useFieldContext } from "./formContext.js";
|
|
2
|
+
const useFieldId = ()=>{
|
|
3
|
+
const field = useFieldContext();
|
|
4
|
+
return field.form.formId + field.name;
|
|
5
|
+
};
|
|
6
|
+
const useHintTextId = ()=>{
|
|
7
|
+
const fieldId = useFieldId();
|
|
8
|
+
return `${fieldId}-hint`;
|
|
9
|
+
};
|
|
10
|
+
const useLabelId = ()=>{
|
|
11
|
+
const fieldId = useFieldId();
|
|
12
|
+
return `${fieldId}-label`;
|
|
13
|
+
};
|
|
14
|
+
export { useFieldId, useHintTextId, useLabelId };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type FlexProps } from '../layout/index.js';
|
|
3
|
+
interface LayoutProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
hintText?: React.ReactNode;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
variant?: 'compact';
|
|
9
|
+
}
|
|
10
|
+
interface RowLayoutProps extends LayoutProps {
|
|
11
|
+
padding?: FlexProps['padding'];
|
|
12
|
+
}
|
|
13
|
+
interface StackLayoutProps extends LayoutProps {
|
|
14
|
+
align?: FlexProps['align'];
|
|
15
|
+
}
|
|
16
|
+
declare function RowLayout(props: RowLayoutProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function StackLayout(props: StackLayoutProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function FieldLayout(): null;
|
|
19
|
+
export declare namespace FieldLayout {
|
|
20
|
+
var Row: typeof RowLayout;
|
|
21
|
+
var Stack: typeof StackLayout;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Container, Flex } from "../layout/index.js";
|
|
3
|
+
import { BaseLayout, LayoutLabel } from "./base.js";
|
|
4
|
+
import { useFieldContext } from "./formContext.js";
|
|
5
|
+
import { FieldMeta } from "./meta.js";
|
|
6
|
+
import { useStackedLayout } from "./useStackedLayout.js";
|
|
7
|
+
function RowLayout(props) {
|
|
8
|
+
const isStackLayout = useStackedLayout();
|
|
9
|
+
return isStackLayout ? /*#__PURE__*/ jsx(StackLayout, {
|
|
10
|
+
...props
|
|
11
|
+
}) : /*#__PURE__*/ jsx(RowLayoutContent, {
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function RowLayoutContent(props) {
|
|
16
|
+
const isCompact = 'compact' === props.variant;
|
|
17
|
+
const field = useFieldContext();
|
|
18
|
+
return /*#__PURE__*/ jsxs(BaseLayout, {
|
|
19
|
+
id: field.name,
|
|
20
|
+
stacked: false,
|
|
21
|
+
padding: props.padding,
|
|
22
|
+
children: [
|
|
23
|
+
/*#__PURE__*/ jsxs(LayoutLabel, {
|
|
24
|
+
stacked: false,
|
|
25
|
+
children: [
|
|
26
|
+
/*#__PURE__*/ jsx(Flex, {
|
|
27
|
+
gap: "xs",
|
|
28
|
+
align: "center",
|
|
29
|
+
children: /*#__PURE__*/ jsx(FieldMeta.Label, {
|
|
30
|
+
required: props.required,
|
|
31
|
+
description: isCompact ? props.hintText : void 0,
|
|
32
|
+
children: props.label
|
|
33
|
+
})
|
|
34
|
+
}),
|
|
35
|
+
props.hintText && !isCompact ? /*#__PURE__*/ jsx(FieldMeta.HintText, {
|
|
36
|
+
children: props.hintText
|
|
37
|
+
}) : null
|
|
38
|
+
]
|
|
39
|
+
}),
|
|
40
|
+
/*#__PURE__*/ jsx(Container, {
|
|
41
|
+
flexGrow: 1,
|
|
42
|
+
children: props.children
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function StackLayout(props) {
|
|
48
|
+
const isCompact = 'compact' === props.variant;
|
|
49
|
+
const field = useFieldContext();
|
|
50
|
+
return /*#__PURE__*/ jsxs(BaseLayout, {
|
|
51
|
+
id: field.name,
|
|
52
|
+
stacked: true,
|
|
53
|
+
align: props.align,
|
|
54
|
+
children: [
|
|
55
|
+
/*#__PURE__*/ jsx(Flex, {
|
|
56
|
+
gap: "xs",
|
|
57
|
+
align: "center",
|
|
58
|
+
children: /*#__PURE__*/ jsx(FieldMeta.Label, {
|
|
59
|
+
required: props.required,
|
|
60
|
+
description: isCompact ? props.hintText : void 0,
|
|
61
|
+
children: props.label
|
|
62
|
+
})
|
|
63
|
+
}),
|
|
64
|
+
props.children,
|
|
65
|
+
props.hintText && !isCompact ? /*#__PURE__*/ jsx(FieldMeta.HintText, {
|
|
66
|
+
children: props.hintText
|
|
67
|
+
}) : null
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function FieldLayout() {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
FieldLayout.Row = RowLayout;
|
|
75
|
+
FieldLayout.Stack = StackLayout;
|
|
76
|
+
export { FieldLayout };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const fieldContext: import("react").Context<import("@tanstack/react-form").AnyFieldApi>, formContext: import("react").Context<import("@tanstack/react-form").AnyFormApi>, useFormContext: () => import("@tanstack/react-form").ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>, useFieldContext: <TData>() => import("@tanstack/react-form").FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
2
|
+
declare const FormElementContext: import("react").Context<boolean>;
|
|
3
|
+
declare const useIsInsideFormElement: () => boolean;
|
|
4
|
+
export { fieldContext, formContext, useFormContext, useFieldContext, FormElementContext, useIsInsideFormElement, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
import { createFormHookContexts } from "@tanstack/react-form";
|
|
3
|
+
const { fieldContext: fieldContext, formContext: formContext, useFormContext: useFormContext, useFieldContext: useFieldContext } = createFormHookContexts();
|
|
4
|
+
const FormElementContext = createContext(false);
|
|
5
|
+
const useIsInsideFormElement = ()=>useContext(FormElementContext);
|
|
6
|
+
export { FormElementContext, fieldContext, formContext, useFieldContext, useFormContext, useIsInsideFormElement };
|