@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/solid.d.cts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { S as SnapPointDef, a as SheetMode, E as EngineState, B as BottomSheetEngine } from './BottomSheetEngine-CvSVbo6c.cjs';
|
|
3
|
+
export { b as EngineOptions, c as SnapPoint } from './BottomSheetEngine-CvSVbo6c.cjs';
|
|
4
|
+
import './transform-Brkf-wzo.cjs';
|
|
5
|
+
|
|
6
|
+
/** @jsxImportSource solid-js */
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Props for the Solid `BottomSheet` component. Optionally narrows to a
|
|
10
|
+
* literal-id union `TId` when the consumer pins `snapPoints` with `as const`
|
|
11
|
+
* and explicitly types the call site:
|
|
12
|
+
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const points = [
|
|
15
|
+
* { id: "min", size: 96 },
|
|
16
|
+
* { id: "full", size: "85%" },
|
|
17
|
+
* ] as const;
|
|
18
|
+
* <BottomSheet<"min" | "full"> snapPoints={points} onSnap={id => ...} />
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* Without an explicit type argument `TId` defaults to `string` so existing
|
|
22
|
+
* call sites compile unchanged. The underlying engine stays `string`-typed;
|
|
23
|
+
* the literal narrowing is a TS-only convenience layered on top of the
|
|
24
|
+
* runtime.
|
|
25
|
+
*/
|
|
26
|
+
type BottomSheetProps<TId extends string = string> = {
|
|
27
|
+
snapPoints: SnapPointDef<TId>[] | ReadonlyArray<SnapPointDef<TId>>;
|
|
28
|
+
allowed?: TId[] | ReadonlyArray<TId>;
|
|
29
|
+
initial?: TId;
|
|
30
|
+
mode?: SheetMode;
|
|
31
|
+
animation?: "spring" | "tween" | "ios-spring" | "material-bounce" | "linear" | "snappy";
|
|
32
|
+
spring?: {
|
|
33
|
+
stiffness?: number;
|
|
34
|
+
damping?: number;
|
|
35
|
+
mass?: number;
|
|
36
|
+
};
|
|
37
|
+
focusTrap?: boolean;
|
|
38
|
+
closeOnEscape?: boolean;
|
|
39
|
+
closeOnBack?: boolean;
|
|
40
|
+
lockBodyScroll?: boolean;
|
|
41
|
+
rubberBand?: boolean;
|
|
42
|
+
backdropRange?: [number, number];
|
|
43
|
+
backdrop?: boolean;
|
|
44
|
+
closeOnBackdrop?: boolean;
|
|
45
|
+
ariaLabel?: string;
|
|
46
|
+
/** Fires when the active snap settles. */
|
|
47
|
+
onSnap?: (id: TId) => void;
|
|
48
|
+
/** Fires on every state-affecting engine event (snap/dragstart/dragend). */
|
|
49
|
+
onChange?: (state: EngineState & {
|
|
50
|
+
activeId: TId;
|
|
51
|
+
}) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Imperative escape hatch. Invoked once after the engine is constructed
|
|
54
|
+
* inside `onMount` (and once with `null` on cleanup). Use this to subscribe
|
|
55
|
+
* to per-frame events the adapter intentionally skips, e.g.
|
|
56
|
+
* `engineRef={(e) => e?.on("progress", ...)}`. Mirrors React's
|
|
57
|
+
* `useBottomSheet` engine handle.
|
|
58
|
+
*/
|
|
59
|
+
engineRef?: (engine: BottomSheetEngine | null) => void;
|
|
60
|
+
/** Header content rendered inside the drag handle. */
|
|
61
|
+
header?: JSX.Element;
|
|
62
|
+
children?: JSX.Element;
|
|
63
|
+
};
|
|
64
|
+
declare const BottomSheet: <TId extends string = string>(props: BottomSheetProps<TId>) => JSX.Element;
|
|
65
|
+
|
|
66
|
+
export { BottomSheet, type BottomSheetProps, EngineState, SheetMode, SnapPointDef };
|
package/dist/solid.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { S as SnapPointDef, a as SheetMode, E as EngineState, B as BottomSheetEngine } from './BottomSheetEngine-DbO8rW_3.js';
|
|
3
|
+
export { b as EngineOptions, c as SnapPoint } from './BottomSheetEngine-DbO8rW_3.js';
|
|
4
|
+
import './transform-Brkf-wzo.js';
|
|
5
|
+
|
|
6
|
+
/** @jsxImportSource solid-js */
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Props for the Solid `BottomSheet` component. Optionally narrows to a
|
|
10
|
+
* literal-id union `TId` when the consumer pins `snapPoints` with `as const`
|
|
11
|
+
* and explicitly types the call site:
|
|
12
|
+
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const points = [
|
|
15
|
+
* { id: "min", size: 96 },
|
|
16
|
+
* { id: "full", size: "85%" },
|
|
17
|
+
* ] as const;
|
|
18
|
+
* <BottomSheet<"min" | "full"> snapPoints={points} onSnap={id => ...} />
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* Without an explicit type argument `TId` defaults to `string` so existing
|
|
22
|
+
* call sites compile unchanged. The underlying engine stays `string`-typed;
|
|
23
|
+
* the literal narrowing is a TS-only convenience layered on top of the
|
|
24
|
+
* runtime.
|
|
25
|
+
*/
|
|
26
|
+
type BottomSheetProps<TId extends string = string> = {
|
|
27
|
+
snapPoints: SnapPointDef<TId>[] | ReadonlyArray<SnapPointDef<TId>>;
|
|
28
|
+
allowed?: TId[] | ReadonlyArray<TId>;
|
|
29
|
+
initial?: TId;
|
|
30
|
+
mode?: SheetMode;
|
|
31
|
+
animation?: "spring" | "tween" | "ios-spring" | "material-bounce" | "linear" | "snappy";
|
|
32
|
+
spring?: {
|
|
33
|
+
stiffness?: number;
|
|
34
|
+
damping?: number;
|
|
35
|
+
mass?: number;
|
|
36
|
+
};
|
|
37
|
+
focusTrap?: boolean;
|
|
38
|
+
closeOnEscape?: boolean;
|
|
39
|
+
closeOnBack?: boolean;
|
|
40
|
+
lockBodyScroll?: boolean;
|
|
41
|
+
rubberBand?: boolean;
|
|
42
|
+
backdropRange?: [number, number];
|
|
43
|
+
backdrop?: boolean;
|
|
44
|
+
closeOnBackdrop?: boolean;
|
|
45
|
+
ariaLabel?: string;
|
|
46
|
+
/** Fires when the active snap settles. */
|
|
47
|
+
onSnap?: (id: TId) => void;
|
|
48
|
+
/** Fires on every state-affecting engine event (snap/dragstart/dragend). */
|
|
49
|
+
onChange?: (state: EngineState & {
|
|
50
|
+
activeId: TId;
|
|
51
|
+
}) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Imperative escape hatch. Invoked once after the engine is constructed
|
|
54
|
+
* inside `onMount` (and once with `null` on cleanup). Use this to subscribe
|
|
55
|
+
* to per-frame events the adapter intentionally skips, e.g.
|
|
56
|
+
* `engineRef={(e) => e?.on("progress", ...)}`. Mirrors React's
|
|
57
|
+
* `useBottomSheet` engine handle.
|
|
58
|
+
*/
|
|
59
|
+
engineRef?: (engine: BottomSheetEngine | null) => void;
|
|
60
|
+
/** Header content rendered inside the drag handle. */
|
|
61
|
+
header?: JSX.Element;
|
|
62
|
+
children?: JSX.Element;
|
|
63
|
+
};
|
|
64
|
+
declare const BottomSheet: <TId extends string = string>(props: BottomSheetProps<TId>) => JSX.Element;
|
|
65
|
+
|
|
66
|
+
export { BottomSheet, type BottomSheetProps, EngineState, SheetMode, SnapPointDef };
|