@octanejs/vaul 0.0.29 → 0.0.31
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/package.json +5 -6
- package/src/index.tsrx +170 -164
- package/src/style.css.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/vaul",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"description": "Octane binding for Vaul drawers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"status.json"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@octanejs/radix": "0.1.
|
|
37
|
+
"@octanejs/radix": "0.1.64",
|
|
38
38
|
"@types/react": "^19.2.17"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"octane": "^0.
|
|
41
|
+
"octane": "^0.11.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/react-dom": "^19.2.3",
|
|
45
|
-
"octane": "0.
|
|
45
|
+
"octane": "0.11.0",
|
|
46
46
|
"playwright": "^1.61.1",
|
|
47
47
|
"react": "19.2.7",
|
|
48
48
|
"react-dom": "19.2.7",
|
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
"scripts": {
|
|
60
60
|
"test": "pnpm upstream:check && vitest run --root ../.. --project vaul --project vaul-differential --project vaul-ssr --project vaul-browser --project vaul-browser-conformance",
|
|
61
61
|
"parity:inventory": "node ../../scripts/react-parity/vaul-runtime-inventory.mjs",
|
|
62
|
-
"upstream:check": "node ../../scripts/react-parity/verify-provenance.mjs"
|
|
63
|
-
"typecheck": "tsrx-tsc --noEmit -p tsconfig.json"
|
|
62
|
+
"upstream:check": "node ../../scripts/react-parity/verify-provenance.mjs"
|
|
64
63
|
}
|
|
65
64
|
}
|
package/src/index.tsrx
CHANGED
|
@@ -27,116 +27,115 @@ import { isIOS, isMobileFirefox } from './browser';
|
|
|
27
27
|
|
|
28
28
|
export interface WithFadeFromProps {
|
|
29
29
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
* Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up.
|
|
31
|
+
* Should go from least visible. Example `[0.2, 0.5, 0.8]`.
|
|
32
|
+
* You can also use px values, which doesn't take screen height into account.
|
|
33
|
+
*/
|
|
34
34
|
snapPoints: (number | string)[];
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
* Index of a `snapPoint` from which the overlay fade should be applied. Defaults to the last snap point.
|
|
37
|
+
*/
|
|
38
38
|
fadeFromIndex: number;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export interface WithoutFadeFromProps {
|
|
42
42
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
* Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up.
|
|
44
|
+
* Should go from least visible. Example `[0.2, 0.5, 0.8]`.
|
|
45
|
+
* You can also use px values, which doesn't take screen height into account.
|
|
46
|
+
*/
|
|
47
47
|
snapPoints?: (number | string)[];
|
|
48
48
|
fadeFromIndex?: never;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export type DialogProps =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
} & (WithFadeFromProps | WithoutFadeFromProps);
|
|
51
|
+
export type DialogProps = {
|
|
52
|
+
activeSnapPoint?: number | string | null;
|
|
53
|
+
setActiveSnapPoint?: (snapPoint: number | string | null) => void;
|
|
54
|
+
children?: React.ReactNode;
|
|
55
|
+
open?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Number between 0 and 1 that determines when the drawer should be closed.
|
|
58
|
+
* Example: threshold of 0.5 would close the drawer if the user swiped for 50% of the height of the drawer or more.
|
|
59
|
+
* @default 0.25
|
|
60
|
+
*/
|
|
61
|
+
closeThreshold?: number;
|
|
62
|
+
/**
|
|
63
|
+
* When `true` the `body` doesn't get any styles assigned from Vaul
|
|
64
|
+
*/
|
|
65
|
+
noBodyStyles?: boolean;
|
|
66
|
+
onOpenChange?: (open: boolean) => void;
|
|
67
|
+
shouldScaleBackground?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* When `false` we don't change body's background color when the drawer is open.
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
72
|
+
setBackgroundColorOnScale?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Duration for which the drawer is not draggable after scrolling content inside of the drawer.
|
|
75
|
+
* @default 500ms
|
|
76
|
+
*/
|
|
77
|
+
scrollLockTimeout?: number;
|
|
78
|
+
/**
|
|
79
|
+
* When `true`, don't move the drawer upwards if there's space, but rather only change it's height so it's fully scrollable when the keyboard is open
|
|
80
|
+
*/
|
|
81
|
+
fixed?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* When `true` only allows the drawer to be dragged by the `<Drawer.Handle />` component.
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
handleOnly?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* When `false` dragging, clicking outside, pressing esc, etc. will not close the drawer.
|
|
89
|
+
* Use this in comination with the `open` prop, otherwise you won't be able to open/close the drawer.
|
|
90
|
+
* @default true
|
|
91
|
+
*/
|
|
92
|
+
dismissible?: boolean;
|
|
93
|
+
onDrag?: (event: React.PointerEvent<HTMLDivElement>, percentageDragged: number) => void;
|
|
94
|
+
onRelease?: (event: React.PointerEvent<HTMLDivElement>, open: boolean) => void;
|
|
95
|
+
/**
|
|
96
|
+
* When `false` it allows to interact with elements outside of the drawer without closing it.
|
|
97
|
+
* @default true
|
|
98
|
+
*/
|
|
99
|
+
modal?: boolean;
|
|
100
|
+
nested?: boolean;
|
|
101
|
+
onClose?: () => void;
|
|
102
|
+
/**
|
|
103
|
+
* Direction of the drawer. Can be `top` or `bottom`, `left`, `right`.
|
|
104
|
+
* @default 'bottom'
|
|
105
|
+
*/
|
|
106
|
+
direction?: 'top' | 'bottom' | 'left' | 'right';
|
|
107
|
+
/**
|
|
108
|
+
* Opened by default, skips initial enter animation. Still reacts to `open` state changes
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
defaultOpen?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* When set to `true` prevents scrolling on the document body on mount, and restores it on unmount.
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
116
|
+
disablePreventScroll?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* When `true` Vaul will reposition inputs rather than scroll then into view if the keyboard is in the way.
|
|
119
|
+
* Setting it to `false` will fall back to the default browser behavior.
|
|
120
|
+
* @default true when {@link snapPoints} is defined
|
|
121
|
+
*/
|
|
122
|
+
repositionInputs?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Disabled velocity based swiping for snap points.
|
|
125
|
+
* This means that a snap point won't be skipped even if the velocity is high enough.
|
|
126
|
+
* Useful if each snap point in a drawer is equally important.
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
129
|
+
snapToSequentialPoint?: boolean;
|
|
130
|
+
container?: HTMLElement | null;
|
|
131
|
+
/**
|
|
132
|
+
* Gets triggered after the open or close animation ends, it receives an `open` argument with the `open` state of the drawer by the time the function was triggered.
|
|
133
|
+
* Useful to revert any state changes for example.
|
|
134
|
+
*/
|
|
135
|
+
onAnimationEnd?: (open: boolean) => void;
|
|
136
|
+
preventScrollRestoration?: boolean;
|
|
137
|
+
autoFocus?: boolean;
|
|
138
|
+
} & (WithFadeFromProps | WithoutFadeFromProps);
|
|
140
139
|
|
|
141
140
|
export function Root({
|
|
142
141
|
open: openProp,
|
|
@@ -218,8 +217,8 @@ export function Root({
|
|
|
218
217
|
|
|
219
218
|
const onSnapPointChange = useCallback((activeSnapPointIndex: number) => {
|
|
220
219
|
// Change openTime ref when we reach the last snap point to prevent dragging for 500ms incase it's scrollable.
|
|
221
|
-
if (snapPoints && activeSnapPointIndex === snapPointsOffset.length - 1)
|
|
222
|
-
new Date();
|
|
220
|
+
if (snapPoints && activeSnapPointIndex === snapPointsOffset.length - 1)
|
|
221
|
+
openTime.current = new Date();
|
|
223
222
|
}, []);
|
|
224
223
|
|
|
225
224
|
const {
|
|
@@ -245,7 +244,12 @@ export function Root({
|
|
|
245
244
|
});
|
|
246
245
|
|
|
247
246
|
usePreventScroll({
|
|
248
|
-
isDisabled:
|
|
247
|
+
isDisabled:
|
|
248
|
+
!isOpen ||
|
|
249
|
+
isDragging ||
|
|
250
|
+
!modal ||
|
|
251
|
+
justReleased ||
|
|
252
|
+
!hasBeenOpened ||
|
|
249
253
|
!repositionInputs ||
|
|
250
254
|
!disablePreventScroll,
|
|
251
255
|
});
|
|
@@ -285,8 +289,7 @@ export function Root({
|
|
|
285
289
|
function shouldDrag(el: EventTarget, isDraggingInDirection: boolean) {
|
|
286
290
|
let element = el as HTMLElement;
|
|
287
291
|
const highlightedText = window.getSelection()?.toString();
|
|
288
|
-
const swipeAmount =
|
|
289
|
-
drawerRef.current ? getTranslate(drawerRef.current, direction) : null;
|
|
292
|
+
const swipeAmount = drawerRef.current ? getTranslate(drawerRef.current, direction) : null;
|
|
290
293
|
const date = new Date();
|
|
291
294
|
|
|
292
295
|
// Fixes https://github.com/emilkowalski/vaul/issues/483
|
|
@@ -321,8 +324,8 @@ export function Root({
|
|
|
321
324
|
// Disallow dragging if drawer was scrolled within `scrollLockTimeout`
|
|
322
325
|
if (
|
|
323
326
|
lastTimeDragPrevented.current &&
|
|
324
|
-
|
|
325
|
-
|
|
327
|
+
date.getTime() - lastTimeDragPrevented.current.getTime() < scrollLockTimeout &&
|
|
328
|
+
swipeAmount === 0
|
|
326
329
|
) {
|
|
327
330
|
lastTimeDragPrevented.current = date;
|
|
328
331
|
return false;
|
|
@@ -366,8 +369,7 @@ export function Root({
|
|
|
366
369
|
|
|
367
370
|
// We need to know how much of the drawer has been dragged in percentages so that we can transform background accordingly
|
|
368
371
|
if (isDragging) {
|
|
369
|
-
const directionMultiplier =
|
|
370
|
-
direction === 'bottom' || direction === 'right' ? 1 : -1;
|
|
372
|
+
const directionMultiplier = direction === 'bottom' || direction === 'right' ? 1 : -1;
|
|
371
373
|
const draggedDistance =
|
|
372
374
|
(pointerStart.current - (isVertical(direction) ? event.pageY : event.pageX)) *
|
|
373
375
|
directionMultiplier;
|
|
@@ -434,7 +436,7 @@ export function Root({
|
|
|
434
436
|
|
|
435
437
|
const opacityValue = 1 - percentageDragged;
|
|
436
438
|
|
|
437
|
-
if (shouldFade || fadeFromIndex && activeSnapPointIndex === fadeFromIndex - 1) {
|
|
439
|
+
if (shouldFade || (fadeFromIndex && activeSnapPointIndex === fadeFromIndex - 1)) {
|
|
438
440
|
onDragProp?.(event, percentageDragged);
|
|
439
441
|
|
|
440
442
|
set(
|
|
@@ -520,8 +522,8 @@ export function Root({
|
|
|
520
522
|
let newDrawerHeight = height;
|
|
521
523
|
|
|
522
524
|
if (height > visualViewportHeight) {
|
|
523
|
-
newDrawerHeight =
|
|
524
|
-
|
|
525
|
+
newDrawerHeight =
|
|
526
|
+
visualViewportHeight - (isTallEnough ? offsetFromTop : WINDOW_TOP_OFFSET);
|
|
525
527
|
}
|
|
526
528
|
// When fixed, don't move the drawer upwards if there's space, but rather only change it's height so it's fully scrollable when the keyboard is open
|
|
527
529
|
if (fixed) {
|
|
@@ -622,9 +624,8 @@ export function Root({
|
|
|
622
624
|
dragEndTime.current = new Date();
|
|
623
625
|
const swipeAmount = getTranslate(drawerRef.current, direction);
|
|
624
626
|
|
|
625
|
-
if (
|
|
626
|
-
|
|
627
|
-
) return;
|
|
627
|
+
if (!event || !shouldDrag(event.target, false) || !swipeAmount || Number.isNaN(swipeAmount))
|
|
628
|
+
return;
|
|
628
629
|
|
|
629
630
|
if (dragStartTime.current === null) return;
|
|
630
631
|
|
|
@@ -642,8 +643,7 @@ export function Root({
|
|
|
642
643
|
}
|
|
643
644
|
|
|
644
645
|
if (snapPoints) {
|
|
645
|
-
const directionMultiplier =
|
|
646
|
-
direction === 'bottom' || direction === 'right' ? 1 : -1;
|
|
646
|
+
const directionMultiplier = direction === 'bottom' || direction === 'right' ? 1 : -1;
|
|
647
647
|
onReleaseSnapPoints({
|
|
648
648
|
draggedDistance: distMoved * directionMultiplier,
|
|
649
649
|
closeDrawer,
|
|
@@ -679,7 +679,7 @@ export function Root({
|
|
|
679
679
|
const isHorizontalSwipe = direction === 'left' || direction === 'right';
|
|
680
680
|
if (
|
|
681
681
|
Math.abs(swipeAmount) >=
|
|
682
|
-
|
|
682
|
+
(isHorizontalSwipe ? visibleDrawerWidth : visibleDrawerHeight) * closeThreshold
|
|
683
683
|
) {
|
|
684
684
|
closeDrawer();
|
|
685
685
|
onReleaseProp?.(event, false);
|
|
@@ -831,15 +831,16 @@ export function Root({
|
|
|
831
831
|
container,
|
|
832
832
|
autoFocus,
|
|
833
833
|
}}
|
|
834
|
-
>
|
|
834
|
+
>
|
|
835
|
+
{children}
|
|
836
|
+
</DrawerContext>
|
|
835
837
|
</DialogPrimitive.Root>
|
|
836
838
|
}
|
|
837
839
|
|
|
838
|
-
export type OverlayProps =
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
};
|
|
840
|
+
export type OverlayProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
841
|
+
forceMount?: true;
|
|
842
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
843
|
+
};
|
|
843
844
|
|
|
844
845
|
export function Overlay({ ref, ...rest }: OverlayProps) @{
|
|
845
846
|
const { overlayRef, snapPoints, onRelease, shouldFade, isOpen, modal, shouldAnimate } =
|
|
@@ -852,9 +853,10 @@ export function Overlay({ ref, ...rest }: OverlayProps) @{
|
|
|
852
853
|
return null;
|
|
853
854
|
}
|
|
854
855
|
|
|
855
|
-
const onMouseUp = useCallback(
|
|
856
|
-
onRelease,
|
|
857
|
-
|
|
856
|
+
const onMouseUp = useCallback(
|
|
857
|
+
(event: React.PointerEvent<HTMLDivElement>) => onRelease(event),
|
|
858
|
+
[onRelease],
|
|
859
|
+
);
|
|
858
860
|
|
|
859
861
|
<DialogPrimitive.Overlay
|
|
860
862
|
onMouseUp={onMouseUp}
|
|
@@ -869,16 +871,15 @@ export function Overlay({ ref, ...rest }: OverlayProps) @{
|
|
|
869
871
|
|
|
870
872
|
type PreventableEvent = Event & { defaultPrevented: boolean; preventDefault(): void };
|
|
871
873
|
|
|
872
|
-
export type ContentProps =
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
};
|
|
874
|
+
export type ContentProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
875
|
+
forceMount?: true;
|
|
876
|
+
onOpenAutoFocus?: (event: PreventableEvent) => void;
|
|
877
|
+
onCloseAutoFocus?: (event: PreventableEvent) => void;
|
|
878
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
879
|
+
onPointerDownOutside?: (event: PreventableEvent) => void;
|
|
880
|
+
onFocusOutside?: (event: PreventableEvent) => void;
|
|
881
|
+
onInteractOutside?: (event: PreventableEvent) => void;
|
|
882
|
+
};
|
|
882
883
|
|
|
883
884
|
export function Content({
|
|
884
885
|
ref,
|
|
@@ -964,12 +965,14 @@ export function Content({
|
|
|
964
965
|
data-vaul-animate={shouldAnimate?.current ? 'true' : 'false'}
|
|
965
966
|
{...rest}
|
|
966
967
|
ref={composedRef}
|
|
967
|
-
style={
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
968
|
+
style={
|
|
969
|
+
snapPointsOffset && snapPointsOffset.length > 0
|
|
970
|
+
? ({
|
|
971
|
+
'--snap-point-height': `${snapPointsOffset[activeSnapPointIndex ?? 0]!}px`,
|
|
972
|
+
...style,
|
|
973
|
+
} as React.CSSProperties)
|
|
974
|
+
: style
|
|
975
|
+
}
|
|
973
976
|
onPointerDown={(event: any) => {
|
|
974
977
|
if (handleOnly) return;
|
|
975
978
|
rest.onPointerDown?.(event);
|
|
@@ -1009,14 +1012,14 @@ export function Content({
|
|
|
1009
1012
|
const yPosition = event.pageY - pointerStartRef.current.y;
|
|
1010
1013
|
const xPosition = event.pageX - pointerStartRef.current.x;
|
|
1011
1014
|
|
|
1012
|
-
const swipeStartThreshold =
|
|
1013
|
-
event.pointerType === 'touch' ? 10 : 2;
|
|
1015
|
+
const swipeStartThreshold = event.pointerType === 'touch' ? 10 : 2;
|
|
1014
1016
|
const delta = { x: xPosition, y: yPosition };
|
|
1015
1017
|
|
|
1016
1018
|
const isAllowedToSwipe = isDeltaInDirection(delta, direction, swipeStartThreshold);
|
|
1017
1019
|
if (isAllowedToSwipe) onDrag(event);
|
|
1018
1020
|
else if (
|
|
1019
|
-
Math.abs(xPosition) > swipeStartThreshold ||
|
|
1021
|
+
Math.abs(xPosition) > swipeStartThreshold ||
|
|
1022
|
+
Math.abs(yPosition) > swipeStartThreshold
|
|
1020
1023
|
) {
|
|
1021
1024
|
pointerStartRef.current = null;
|
|
1022
1025
|
}
|
|
@@ -1040,15 +1043,19 @@ export function Content({
|
|
|
1040
1043
|
/>
|
|
1041
1044
|
}
|
|
1042
1045
|
|
|
1043
|
-
export type HandleProps =
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
};
|
|
1046
|
+
export type HandleProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
1047
|
+
preventCycle?: boolean;
|
|
1048
|
+
};
|
|
1047
1049
|
|
|
1048
1050
|
const LONG_HANDLE_PRESS_TIMEOUT = 250;
|
|
1049
1051
|
const DOUBLE_TAP_TIMEOUT = 120;
|
|
1050
1052
|
|
|
1051
|
-
export function Handle({
|
|
1053
|
+
export function Handle({
|
|
1054
|
+
ref,
|
|
1055
|
+
preventCycle = false,
|
|
1056
|
+
children,
|
|
1057
|
+
...rest
|
|
1058
|
+
}: HandleProps & {
|
|
1052
1059
|
ref?: React.Ref<HTMLDivElement>;
|
|
1053
1060
|
}) @{
|
|
1054
1061
|
const {
|
|
@@ -1149,10 +1156,12 @@ export function Handle({ ref, preventCycle = false, children, ...rest }: HandleP
|
|
|
1149
1156
|
data-vaul-drawer-visible={isOpen ? 'true' : 'false'}
|
|
1150
1157
|
data-vaul-handle=""
|
|
1151
1158
|
aria-hidden="true"
|
|
1152
|
-
{...rest as any}
|
|
1159
|
+
{...(rest as any)}
|
|
1153
1160
|
>
|
|
1154
1161
|
{/* Expand handle's hit area beyond what's visible to ensure a 44x44 tap target for touch devices */}
|
|
1155
|
-
<span data-vaul-handle-hitarea="" aria-hidden="true">
|
|
1162
|
+
<span data-vaul-handle-hitarea="" aria-hidden="true">
|
|
1163
|
+
{children}
|
|
1164
|
+
</span>
|
|
1156
1165
|
</div>
|
|
1157
1166
|
}
|
|
1158
1167
|
|
|
@@ -1198,18 +1207,15 @@ export function Portal(props: PortalProps) {
|
|
|
1198
1207
|
return target ? createPortal(children, target) : null;
|
|
1199
1208
|
}
|
|
1200
1209
|
|
|
1201
|
-
type ButtonPrimitiveProps =
|
|
1202
|
-
React.
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
React.ComponentPropsWithoutRef<'p'> & {
|
|
1211
|
-
ref?: React.Ref<HTMLParagraphElement>;
|
|
1212
|
-
};
|
|
1210
|
+
type ButtonPrimitiveProps = React.ComponentPropsWithoutRef<'button'> & {
|
|
1211
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
1212
|
+
};
|
|
1213
|
+
type TitlePrimitiveProps = React.ComponentPropsWithoutRef<'h2'> & {
|
|
1214
|
+
ref?: React.Ref<HTMLHeadingElement>;
|
|
1215
|
+
};
|
|
1216
|
+
type DescriptionPrimitiveProps = React.ComponentPropsWithoutRef<'p'> & {
|
|
1217
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
1218
|
+
};
|
|
1213
1219
|
|
|
1214
1220
|
export const Drawer = {
|
|
1215
1221
|
Root,
|