@surdeddd/bottom-sheet 0.1.0 → 0.2.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.
Files changed (50) hide show
  1. package/README.md +6 -0
  2. package/dist/BottomSheetEngine-CIT9Htti.d.cts +219 -0
  3. package/dist/BottomSheetEngine-Df9MwBbm.d.ts +219 -0
  4. package/dist/element.cjs +95 -440
  5. package/dist/element.d.cts +3 -56
  6. package/dist/element.d.ts +3 -56
  7. package/dist/element.iife.global.js +2 -2
  8. package/dist/element.js +95 -440
  9. package/dist/index.cjs +84 -494
  10. package/dist/index.d.cts +3 -84
  11. package/dist/index.d.ts +3 -84
  12. package/dist/index.js +84 -494
  13. package/dist/integrations/formik.d.cts +2 -8
  14. package/dist/integrations/formik.d.ts +2 -8
  15. package/dist/integrations/react-hook-form.d.cts +2 -11
  16. package/dist/integrations/react-hook-form.d.ts +2 -11
  17. package/dist/overlay.cjs +0 -87
  18. package/dist/overlay.d.cts +1 -137
  19. package/dist/overlay.d.ts +1 -137
  20. package/dist/overlay.js +0 -87
  21. package/dist/preact.d.cts +2 -2
  22. package/dist/preact.d.ts +2 -2
  23. package/dist/preact.js +0 -1
  24. package/dist/qwik.cjs +87 -439
  25. package/dist/qwik.d.cts +3 -24
  26. package/dist/qwik.d.ts +3 -24
  27. package/dist/qwik.js +87 -439
  28. package/dist/react.cjs +91 -496
  29. package/dist/react.d.cts +16 -158
  30. package/dist/react.d.ts +16 -158
  31. package/dist/react.js +91 -496
  32. package/dist/solid.cjs +87 -439
  33. package/dist/solid.d.cts +4 -31
  34. package/dist/solid.d.ts +4 -31
  35. package/dist/solid.js +87 -439
  36. package/dist/styles.css +27 -102
  37. package/dist/svelte.cjs +139 -462
  38. package/dist/svelte.d.ts +9 -2
  39. package/dist/svelte.js +139 -462
  40. package/dist/themes/ios.css +0 -3
  41. package/dist/themes/material.css +0 -3
  42. package/dist/themes/vercel.css +0 -3
  43. package/dist/{transform-Brkf-wzo.d.cts → transform-jVfAikE9.d.cts} +0 -1
  44. package/dist/{transform-Brkf-wzo.d.ts → transform-jVfAikE9.d.ts} +0 -1
  45. package/dist/vue.cjs +104 -446
  46. package/dist/vue.d.ts +7 -1
  47. package/dist/vue.js +105 -447
  48. package/package.json +3 -3
  49. package/dist/BottomSheetEngine-CvSVbo6c.d.cts +0 -704
  50. package/dist/BottomSheetEngine-DbO8rW_3.d.ts +0 -704
package/dist/solid.d.cts CHANGED
@@ -1,28 +1,10 @@
1
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';
2
+ import { S as SnapPointDef, a as SheetMode, E as EngineState, B as BottomSheetEngine } from './BottomSheetEngine-CIT9Htti.cjs';
3
+ export { b as EngineOptions, c as SnapPoint } from './BottomSheetEngine-CIT9Htti.cjs';
4
+ import './transform-jVfAikE9.cjs';
5
5
 
6
6
  /** @jsxImportSource solid-js */
7
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
8
  type BottomSheetProps<TId extends string = string> = {
27
9
  snapPoints: SnapPointDef<TId>[] | ReadonlyArray<SnapPointDef<TId>>;
28
10
  allowed?: TId[] | ReadonlyArray<TId>;
@@ -43,22 +25,13 @@ type BottomSheetProps<TId extends string = string> = {
43
25
  backdrop?: boolean;
44
26
  closeOnBackdrop?: boolean;
45
27
  ariaLabel?: string;
46
- /** Fires when the active snap settles. */
47
28
  onSnap?: (id: TId) => void;
48
- /** Fires on every state-affecting engine event (snap/dragstart/dragend). */
49
29
  onChange?: (state: EngineState & {
50
30
  activeId: TId;
51
31
  }) => 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
32
  engineRef?: (engine: BottomSheetEngine | null) => void;
60
- /** Header content rendered inside the drag handle. */
61
33
  header?: JSX.Element;
34
+ screen?: JSX.Element;
62
35
  children?: JSX.Element;
63
36
  };
64
37
  declare const BottomSheet: <TId extends string = string>(props: BottomSheetProps<TId>) => JSX.Element;
package/dist/solid.d.ts CHANGED
@@ -1,28 +1,10 @@
1
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';
2
+ import { S as SnapPointDef, a as SheetMode, E as EngineState, B as BottomSheetEngine } from './BottomSheetEngine-Df9MwBbm.js';
3
+ export { b as EngineOptions, c as SnapPoint } from './BottomSheetEngine-Df9MwBbm.js';
4
+ import './transform-jVfAikE9.js';
5
5
 
6
6
  /** @jsxImportSource solid-js */
7
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
8
  type BottomSheetProps<TId extends string = string> = {
27
9
  snapPoints: SnapPointDef<TId>[] | ReadonlyArray<SnapPointDef<TId>>;
28
10
  allowed?: TId[] | ReadonlyArray<TId>;
@@ -43,22 +25,13 @@ type BottomSheetProps<TId extends string = string> = {
43
25
  backdrop?: boolean;
44
26
  closeOnBackdrop?: boolean;
45
27
  ariaLabel?: string;
46
- /** Fires when the active snap settles. */
47
28
  onSnap?: (id: TId) => void;
48
- /** Fires on every state-affecting engine event (snap/dragstart/dragend). */
49
29
  onChange?: (state: EngineState & {
50
30
  activeId: TId;
51
31
  }) => 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
32
  engineRef?: (engine: BottomSheetEngine | null) => void;
60
- /** Header content rendered inside the drag handle. */
61
33
  header?: JSX.Element;
34
+ screen?: JSX.Element;
62
35
  children?: JSX.Element;
63
36
  };
64
37
  declare const BottomSheet: <TId extends string = string>(props: BottomSheetProps<TId>) => JSX.Element;