@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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +377 -0
  3. package/dist/BottomSheetEngine-CvSVbo6c.d.cts +704 -0
  4. package/dist/BottomSheetEngine-DbO8rW_3.d.ts +704 -0
  5. package/dist/element.cjs +3442 -0
  6. package/dist/element.d.cts +88 -0
  7. package/dist/element.d.ts +88 -0
  8. package/dist/element.iife.global.js +3 -0
  9. package/dist/element.js +3442 -0
  10. package/dist/index.cjs +3693 -0
  11. package/dist/index.d.cts +184 -0
  12. package/dist/index.d.ts +184 -0
  13. package/dist/index.js +3669 -0
  14. package/dist/integrations/formik.cjs +27 -0
  15. package/dist/integrations/formik.d.cts +27 -0
  16. package/dist/integrations/formik.d.ts +27 -0
  17. package/dist/integrations/formik.js +25 -0
  18. package/dist/integrations/react-hook-form.cjs +28 -0
  19. package/dist/integrations/react-hook-form.d.cts +30 -0
  20. package/dist/integrations/react-hook-form.d.ts +30 -0
  21. package/dist/integrations/react-hook-form.js +26 -0
  22. package/dist/overlay.cjs +1058 -0
  23. package/dist/overlay.d.cts +282 -0
  24. package/dist/overlay.d.ts +282 -0
  25. package/dist/overlay.js +1053 -0
  26. package/dist/preact.cjs +2 -0
  27. package/dist/preact.d.cts +5 -0
  28. package/dist/preact.d.ts +5 -0
  29. package/dist/preact.js +2 -0
  30. package/dist/qwik.cjs +3046 -0
  31. package/dist/qwik.d.cts +55 -0
  32. package/dist/qwik.d.ts +55 -0
  33. package/dist/qwik.js +3044 -0
  34. package/dist/react.cjs +4162 -0
  35. package/dist/react.d.cts +301 -0
  36. package/dist/react.d.ts +301 -0
  37. package/dist/react.js +4156 -0
  38. package/dist/solid.cjs +3063 -0
  39. package/dist/solid.d.cts +66 -0
  40. package/dist/solid.d.ts +66 -0
  41. package/dist/solid.js +3061 -0
  42. package/dist/styles.css +508 -0
  43. package/dist/svelte.cjs +3200 -0
  44. package/dist/svelte.d.ts +89 -0
  45. package/dist/svelte.js +3177 -0
  46. package/dist/themes/ios.css +24 -0
  47. package/dist/themes/material.css +24 -0
  48. package/dist/themes/vercel.css +24 -0
  49. package/dist/transform-Brkf-wzo.d.cts +4 -0
  50. package/dist/transform-Brkf-wzo.d.ts +4 -0
  51. package/dist/vue.cjs +3361 -0
  52. package/dist/vue.d.ts +68 -0
  53. package/dist/vue.js +3358 -0
  54. package/package.json +288 -0
@@ -0,0 +1,55 @@
1
+ import * as _builder_io_qwik from '@builder.io/qwik';
2
+ import { QRL } from '@builder.io/qwik';
3
+ import { S as SnapPointDef, a as SheetMode, E as EngineState } from './BottomSheetEngine-CvSVbo6c.cjs';
4
+ export { b as EngineOptions, c as SnapPoint } from './BottomSheetEngine-CvSVbo6c.cjs';
5
+ import './transform-Brkf-wzo.cjs';
6
+
7
+ /**
8
+ * Props for the Qwik `BottomSheet` component. Optionally narrows to a
9
+ * literal-id union `TId` when the consumer pins `snapPoints` with `as const`
10
+ * and explicitly types the call site:
11
+ *
12
+ * ```tsx
13
+ * const points = [
14
+ * { id: "min", size: 96 },
15
+ * { id: "full", size: "85%" },
16
+ * ] as const;
17
+ * <BottomSheet<"min" | "full"> snapPoints={points} onSnap$={$((id) => ...)} />
18
+ * ```
19
+ *
20
+ * Without an explicit type argument `TId` defaults to `string` so existing
21
+ * call sites compile unchanged. The underlying engine stays `string`-typed;
22
+ * the literal narrowing is a TS-only convenience layered on top of the
23
+ * runtime. Note: Qwik wraps event handlers in `QRL<...>` because component
24
+ * boundaries are serialised — that wrapper preserves the inner `TId`.
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";
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$?: QRL<(id: TId) => void>;
48
+ /** Fires on every state-affecting engine event (snap/dragstart/dragend). */
49
+ onChange$?: QRL<(state: EngineState & {
50
+ activeId: TId;
51
+ }) => void>;
52
+ };
53
+ declare const BottomSheet: _builder_io_qwik.Component<BottomSheetProps<string>>;
54
+
55
+ export { BottomSheet, type BottomSheetProps, EngineState, SheetMode, SnapPointDef };
package/dist/qwik.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ import * as _builder_io_qwik from '@builder.io/qwik';
2
+ import { QRL } from '@builder.io/qwik';
3
+ import { S as SnapPointDef, a as SheetMode, E as EngineState } from './BottomSheetEngine-DbO8rW_3.js';
4
+ export { b as EngineOptions, c as SnapPoint } from './BottomSheetEngine-DbO8rW_3.js';
5
+ import './transform-Brkf-wzo.js';
6
+
7
+ /**
8
+ * Props for the Qwik `BottomSheet` component. Optionally narrows to a
9
+ * literal-id union `TId` when the consumer pins `snapPoints` with `as const`
10
+ * and explicitly types the call site:
11
+ *
12
+ * ```tsx
13
+ * const points = [
14
+ * { id: "min", size: 96 },
15
+ * { id: "full", size: "85%" },
16
+ * ] as const;
17
+ * <BottomSheet<"min" | "full"> snapPoints={points} onSnap$={$((id) => ...)} />
18
+ * ```
19
+ *
20
+ * Without an explicit type argument `TId` defaults to `string` so existing
21
+ * call sites compile unchanged. The underlying engine stays `string`-typed;
22
+ * the literal narrowing is a TS-only convenience layered on top of the
23
+ * runtime. Note: Qwik wraps event handlers in `QRL<...>` because component
24
+ * boundaries are serialised — that wrapper preserves the inner `TId`.
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";
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$?: QRL<(id: TId) => void>;
48
+ /** Fires on every state-affecting engine event (snap/dragstart/dragend). */
49
+ onChange$?: QRL<(state: EngineState & {
50
+ activeId: TId;
51
+ }) => void>;
52
+ };
53
+ declare const BottomSheet: _builder_io_qwik.Component<BottomSheetProps<string>>;
54
+
55
+ export { BottomSheet, type BottomSheetProps, EngineState, SheetMode, SnapPointDef };