@surdeddd/bottom-sheet 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/README.md +51 -21
- package/dist/{BottomSheetEngine-CIT9Htti.d.cts → BottomSheetEngine-CAymrH-P.d.cts} +67 -1
- package/dist/{BottomSheetEngine-Df9MwBbm.d.ts → BottomSheetEngine-DcqcuudN.d.ts} +67 -1
- package/dist/element.cjs +699 -116
- package/dist/element.d.cts +7 -2
- package/dist/element.d.ts +7 -2
- package/dist/element.iife.global.js +2 -2
- package/dist/element.js +699 -116
- package/dist/index.cjs +715 -145
- package/dist/index.d.cts +17 -3
- package/dist/index.d.ts +17 -3
- package/dist/index.js +713 -146
- package/dist/integrations/formik.d.cts +1 -1
- package/dist/integrations/formik.d.ts +1 -1
- package/dist/integrations/react-hook-form.d.cts +1 -1
- package/dist/integrations/react-hook-form.d.ts +1 -1
- package/dist/overlay.cjs +168 -35
- package/dist/overlay.d.cts +13 -0
- package/dist/overlay.d.ts +13 -0
- package/dist/overlay.js +168 -35
- package/dist/preact.d.cts +1 -1
- package/dist/preact.d.ts +1 -1
- package/dist/qwik.cjs +619 -119
- package/dist/qwik.d.cts +2 -2
- package/dist/qwik.d.ts +2 -2
- package/dist/qwik.js +620 -120
- package/dist/react.cjs +821 -191
- package/dist/react.d.cts +20 -3
- package/dist/react.d.ts +20 -3
- package/dist/react.js +821 -191
- package/dist/solid.cjs +656 -161
- package/dist/solid.d.cts +263 -4
- package/dist/solid.d.ts +263 -4
- package/dist/solid.js +657 -162
- package/dist/solid.source.jsx +3215 -0
- package/dist/styles.css +10 -10
- package/dist/svelte-core.cjs +3149 -0
- package/dist/svelte-core.js +3147 -0
- package/dist/svelte-src/BottomSheet.svelte +210 -0
- package/dist/svelte-src/index.js +2 -0
- package/dist/svelte.cjs +618 -124
- package/dist/svelte.d.cts +100 -0
- package/dist/svelte.d.ts +7 -3
- package/dist/svelte.js +619 -125
- package/dist/vue.cjs +612 -119
- package/dist/vue.d.cts +78 -0
- package/dist/vue.d.ts +6 -2
- package/dist/vue.js +612 -119
- package/package.json +103 -43
package/dist/react.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { c as EngineOptions, E as EngineState, A as AnchorOptions, S as ScrimStagesOptions, p as ScrimStageDef, q as ScrimUpdate, m as ScrimOverlayOptions, B as BottomSheetEngine, a as SnapPointDef, b as SheetMode } from './BottomSheetEngine-CAymrH-P.cjs';
|
|
2
|
+
export { d as SnapPoint } from './BottomSheetEngine-CAymrH-P.cjs';
|
|
3
3
|
import { OverlayOptions, OverlayState, Overlay as OverlayEngine } from './overlay.cjs';
|
|
4
4
|
export { OverlayEdge } from './overlay.cjs';
|
|
5
5
|
import * as react from 'react';
|
|
@@ -8,6 +8,15 @@ import './transform-jVfAikE9.cjs';
|
|
|
8
8
|
|
|
9
9
|
type EngineOptionsForProps = Omit<EngineOptions, "element" | "handle" | "scrollContainer" | "backdrop" | "scrim">;
|
|
10
10
|
type HeaderProp = ReactNode | ((state: EngineState) => ReactNode);
|
|
11
|
+
type BottomSheetAnchorProp = Omit<AnchorOptions, "element"> & {
|
|
12
|
+
node: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
type BottomSheetScrimStageProp = Omit<ScrimStageDef, "element"> & {
|
|
15
|
+
node: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
type BottomSheetScrimStagesProp = Omit<ScrimStagesOptions, "stages"> & {
|
|
18
|
+
stages: BottomSheetScrimStageProp[];
|
|
19
|
+
};
|
|
11
20
|
type BottomSheetProps = EngineOptionsForProps & {
|
|
12
21
|
backdrop?: boolean;
|
|
13
22
|
closeOnBackdrop?: boolean;
|
|
@@ -18,6 +27,8 @@ type BottomSheetProps = EngineOptionsForProps & {
|
|
|
18
27
|
leftButton?: ReactNode;
|
|
19
28
|
rightButton?: ReactNode;
|
|
20
29
|
screen?: ReactNode;
|
|
30
|
+
anchors?: BottomSheetAnchorProp[];
|
|
31
|
+
scrimStages?: BottomSheetScrimStagesProp;
|
|
21
32
|
onChange?: (state: EngineState) => void;
|
|
22
33
|
ariaLabel?: string;
|
|
23
34
|
ariaLabelledBy?: string;
|
|
@@ -31,6 +42,8 @@ type BottomSheetHandle<TId extends string = string> = {
|
|
|
31
42
|
setSnapPoints: (points: EngineOptions["snapPoints"], allowed?: string[]) => void;
|
|
32
43
|
setScrim: (opts: ScrimUpdate) => void;
|
|
33
44
|
setScrimOverlay: (opts: ScrimOverlayOptions) => () => void;
|
|
45
|
+
addAnchor: (opts: AnchorOptions) => () => void;
|
|
46
|
+
setScrimStages: (opts: ScrimStagesOptions | null) => () => void;
|
|
34
47
|
state: EngineState & {
|
|
35
48
|
activeId: TId;
|
|
36
49
|
};
|
|
@@ -46,6 +59,8 @@ declare const BottomSheet: react.ForwardRefExoticComponent<EngineOptionsForProps
|
|
|
46
59
|
leftButton?: ReactNode;
|
|
47
60
|
rightButton?: ReactNode;
|
|
48
61
|
screen?: ReactNode;
|
|
62
|
+
anchors?: BottomSheetAnchorProp[];
|
|
63
|
+
scrimStages?: BottomSheetScrimStagesProp;
|
|
49
64
|
onChange?: (state: EngineState) => void;
|
|
50
65
|
ariaLabel?: string;
|
|
51
66
|
ariaLabelledBy?: string;
|
|
@@ -67,6 +82,8 @@ type UseBottomSheetReturn<TId extends string = string> = UseBottomSheetRefs & {
|
|
|
67
82
|
open: (id?: TId) => Promise<void>;
|
|
68
83
|
close: () => Promise<void>;
|
|
69
84
|
setAllowed: (ids: TId[], snap?: TId) => void;
|
|
85
|
+
addAnchor: (opts: AnchorOptions) => () => void;
|
|
86
|
+
setScrimStages: (opts: ScrimStagesOptions | null) => () => void;
|
|
70
87
|
engine: BottomSheetEngine | null;
|
|
71
88
|
getEngine: () => BottomSheetEngine | null;
|
|
72
89
|
};
|
|
@@ -94,7 +111,7 @@ type OverlayHandle = {
|
|
|
94
111
|
toggle: () => Promise<void>;
|
|
95
112
|
state: OverlayState;
|
|
96
113
|
};
|
|
97
|
-
declare const Overlay: react.ForwardRefExoticComponent<Omit<OverlayOptions, "
|
|
114
|
+
declare const Overlay: react.ForwardRefExoticComponent<Omit<OverlayOptions, "backdrop" | "element"> & {
|
|
98
115
|
open?: boolean;
|
|
99
116
|
backdrop?: boolean;
|
|
100
117
|
className?: string;
|
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { c as EngineOptions, E as EngineState, A as AnchorOptions, S as ScrimStagesOptions, p as ScrimStageDef, q as ScrimUpdate, m as ScrimOverlayOptions, B as BottomSheetEngine, a as SnapPointDef, b as SheetMode } from './BottomSheetEngine-DcqcuudN.js';
|
|
2
|
+
export { d as SnapPoint } from './BottomSheetEngine-DcqcuudN.js';
|
|
3
3
|
import { OverlayOptions, OverlayState, Overlay as OverlayEngine } from './overlay.js';
|
|
4
4
|
export { OverlayEdge } from './overlay.js';
|
|
5
5
|
import * as react from 'react';
|
|
@@ -8,6 +8,15 @@ import './transform-jVfAikE9.js';
|
|
|
8
8
|
|
|
9
9
|
type EngineOptionsForProps = Omit<EngineOptions, "element" | "handle" | "scrollContainer" | "backdrop" | "scrim">;
|
|
10
10
|
type HeaderProp = ReactNode | ((state: EngineState) => ReactNode);
|
|
11
|
+
type BottomSheetAnchorProp = Omit<AnchorOptions, "element"> & {
|
|
12
|
+
node: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
type BottomSheetScrimStageProp = Omit<ScrimStageDef, "element"> & {
|
|
15
|
+
node: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
type BottomSheetScrimStagesProp = Omit<ScrimStagesOptions, "stages"> & {
|
|
18
|
+
stages: BottomSheetScrimStageProp[];
|
|
19
|
+
};
|
|
11
20
|
type BottomSheetProps = EngineOptionsForProps & {
|
|
12
21
|
backdrop?: boolean;
|
|
13
22
|
closeOnBackdrop?: boolean;
|
|
@@ -18,6 +27,8 @@ type BottomSheetProps = EngineOptionsForProps & {
|
|
|
18
27
|
leftButton?: ReactNode;
|
|
19
28
|
rightButton?: ReactNode;
|
|
20
29
|
screen?: ReactNode;
|
|
30
|
+
anchors?: BottomSheetAnchorProp[];
|
|
31
|
+
scrimStages?: BottomSheetScrimStagesProp;
|
|
21
32
|
onChange?: (state: EngineState) => void;
|
|
22
33
|
ariaLabel?: string;
|
|
23
34
|
ariaLabelledBy?: string;
|
|
@@ -31,6 +42,8 @@ type BottomSheetHandle<TId extends string = string> = {
|
|
|
31
42
|
setSnapPoints: (points: EngineOptions["snapPoints"], allowed?: string[]) => void;
|
|
32
43
|
setScrim: (opts: ScrimUpdate) => void;
|
|
33
44
|
setScrimOverlay: (opts: ScrimOverlayOptions) => () => void;
|
|
45
|
+
addAnchor: (opts: AnchorOptions) => () => void;
|
|
46
|
+
setScrimStages: (opts: ScrimStagesOptions | null) => () => void;
|
|
34
47
|
state: EngineState & {
|
|
35
48
|
activeId: TId;
|
|
36
49
|
};
|
|
@@ -46,6 +59,8 @@ declare const BottomSheet: react.ForwardRefExoticComponent<EngineOptionsForProps
|
|
|
46
59
|
leftButton?: ReactNode;
|
|
47
60
|
rightButton?: ReactNode;
|
|
48
61
|
screen?: ReactNode;
|
|
62
|
+
anchors?: BottomSheetAnchorProp[];
|
|
63
|
+
scrimStages?: BottomSheetScrimStagesProp;
|
|
49
64
|
onChange?: (state: EngineState) => void;
|
|
50
65
|
ariaLabel?: string;
|
|
51
66
|
ariaLabelledBy?: string;
|
|
@@ -67,6 +82,8 @@ type UseBottomSheetReturn<TId extends string = string> = UseBottomSheetRefs & {
|
|
|
67
82
|
open: (id?: TId) => Promise<void>;
|
|
68
83
|
close: () => Promise<void>;
|
|
69
84
|
setAllowed: (ids: TId[], snap?: TId) => void;
|
|
85
|
+
addAnchor: (opts: AnchorOptions) => () => void;
|
|
86
|
+
setScrimStages: (opts: ScrimStagesOptions | null) => () => void;
|
|
70
87
|
engine: BottomSheetEngine | null;
|
|
71
88
|
getEngine: () => BottomSheetEngine | null;
|
|
72
89
|
};
|
|
@@ -94,7 +111,7 @@ type OverlayHandle = {
|
|
|
94
111
|
toggle: () => Promise<void>;
|
|
95
112
|
state: OverlayState;
|
|
96
113
|
};
|
|
97
|
-
declare const Overlay: react.ForwardRefExoticComponent<Omit<OverlayOptions, "
|
|
114
|
+
declare const Overlay: react.ForwardRefExoticComponent<Omit<OverlayOptions, "backdrop" | "element"> & {
|
|
98
115
|
open?: boolean;
|
|
99
116
|
backdrop?: boolean;
|
|
100
117
|
className?: string;
|