@surdeddd/bottom-sheet 0.1.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/LICENSE +21 -0
- package/README.md +377 -0
- package/dist/BottomSheetEngine-CvSVbo6c.d.cts +704 -0
- package/dist/BottomSheetEngine-DbO8rW_3.d.ts +704 -0
- package/dist/element.cjs +3442 -0
- package/dist/element.d.cts +88 -0
- package/dist/element.d.ts +88 -0
- package/dist/element.iife.global.js +3 -0
- package/dist/element.js +3442 -0
- package/dist/index.cjs +3693 -0
- package/dist/index.d.cts +184 -0
- package/dist/index.d.ts +184 -0
- package/dist/index.js +3669 -0
- package/dist/integrations/formik.cjs +27 -0
- package/dist/integrations/formik.d.cts +27 -0
- package/dist/integrations/formik.d.ts +27 -0
- package/dist/integrations/formik.js +25 -0
- package/dist/integrations/react-hook-form.cjs +28 -0
- package/dist/integrations/react-hook-form.d.cts +30 -0
- package/dist/integrations/react-hook-form.d.ts +30 -0
- package/dist/integrations/react-hook-form.js +26 -0
- package/dist/overlay.cjs +1058 -0
- package/dist/overlay.d.cts +282 -0
- package/dist/overlay.d.ts +282 -0
- package/dist/overlay.js +1053 -0
- package/dist/preact.cjs +2 -0
- package/dist/preact.d.cts +5 -0
- package/dist/preact.d.ts +5 -0
- package/dist/preact.js +2 -0
- package/dist/qwik.cjs +3046 -0
- package/dist/qwik.d.cts +55 -0
- package/dist/qwik.d.ts +55 -0
- package/dist/qwik.js +3044 -0
- package/dist/react.cjs +4162 -0
- package/dist/react.d.cts +301 -0
- package/dist/react.d.ts +301 -0
- package/dist/react.js +4156 -0
- package/dist/solid.cjs +3063 -0
- package/dist/solid.d.cts +66 -0
- package/dist/solid.d.ts +66 -0
- package/dist/solid.js +3061 -0
- package/dist/styles.css +508 -0
- package/dist/svelte.cjs +3200 -0
- package/dist/svelte.d.ts +89 -0
- package/dist/svelte.js +3177 -0
- package/dist/themes/ios.css +24 -0
- package/dist/themes/material.css +24 -0
- package/dist/themes/vercel.css +24 -0
- package/dist/transform-Brkf-wzo.d.cts +4 -0
- package/dist/transform-Brkf-wzo.d.ts +4 -0
- package/dist/vue.cjs +3361 -0
- package/dist/vue.d.ts +68 -0
- package/dist/vue.js +3358 -0
- package/package.json +288 -0
package/dist/vue.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { DefineComponent } from "vue";
|
|
2
|
+
import type {
|
|
3
|
+
EngineOptions,
|
|
4
|
+
EngineState,
|
|
5
|
+
SheetEventMap,
|
|
6
|
+
SheetMode,
|
|
7
|
+
SnapPoint,
|
|
8
|
+
SnapPointDef,
|
|
9
|
+
} from "../core/types";
|
|
10
|
+
|
|
11
|
+
export type UseBottomSheetVueOptions<TId extends string = string> = Omit<
|
|
12
|
+
EngineOptions,
|
|
13
|
+
| "element"
|
|
14
|
+
| "handle"
|
|
15
|
+
| "scrollContainer"
|
|
16
|
+
| "backdrop"
|
|
17
|
+
| "screenComponent"
|
|
18
|
+
| "snapPoints"
|
|
19
|
+
| "allowed"
|
|
20
|
+
| "initial"
|
|
21
|
+
> & {
|
|
22
|
+
snapPoints: SnapPointDef<TId>[] | ReadonlyArray<SnapPointDef<TId>>;
|
|
23
|
+
allowed?: TId[] | ReadonlyArray<TId>;
|
|
24
|
+
initial?: TId;
|
|
25
|
+
onSnap?: (id: TId) => void;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type UseBottomSheetVueReturn<TId extends string = string> = {
|
|
29
|
+
sheetRef: { value: HTMLElement | null };
|
|
30
|
+
handleRef: { value: HTMLElement | null };
|
|
31
|
+
contentRef: { value: HTMLElement | null };
|
|
32
|
+
backdropRef: { value: HTMLElement | null };
|
|
33
|
+
screenRef: { value: HTMLElement | null };
|
|
34
|
+
state: EngineState & { activeId: TId };
|
|
35
|
+
snapTo: (id: TId) => Promise<void>;
|
|
36
|
+
open: (id?: TId) => Promise<void>;
|
|
37
|
+
close: () => Promise<void>;
|
|
38
|
+
setAllowed: (ids: TId[], snap?: TId) => void;
|
|
39
|
+
setSnapPoints: (
|
|
40
|
+
points: EngineOptions["snapPoints"],
|
|
41
|
+
allowed?: string[],
|
|
42
|
+
) => void;
|
|
43
|
+
on: <K extends keyof SheetEventMap>(
|
|
44
|
+
event: K,
|
|
45
|
+
fn: (payload: SheetEventMap[K]) => void,
|
|
46
|
+
) => () => void;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export function useBottomSheet<TId extends string = string>(
|
|
50
|
+
opts: UseBottomSheetVueOptions<TId>,
|
|
51
|
+
): UseBottomSheetVueReturn<TId>;
|
|
52
|
+
|
|
53
|
+
export type BottomSheetProps<TId extends string = string> =
|
|
54
|
+
UseBottomSheetVueOptions<TId> & {
|
|
55
|
+
backdrop?: boolean;
|
|
56
|
+
closeOnBackdrop?: boolean;
|
|
57
|
+
ariaLabel?: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const BottomSheet: DefineComponent<BottomSheetProps>;
|
|
61
|
+
|
|
62
|
+
export type {
|
|
63
|
+
SnapPoint,
|
|
64
|
+
SnapPointDef,
|
|
65
|
+
SheetMode,
|
|
66
|
+
EngineState,
|
|
67
|
+
EngineOptions,
|
|
68
|
+
};
|