@surdeddd/bottom-sheet 0.23.4 → 0.24.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 (80) hide show
  1. package/README.md +513 -527
  2. package/README.ru.md +533 -545
  3. package/dist/{BottomSheetCore-C5tJYVMY.d.cts → BottomSheetCore-B_r4KCQL.d.cts} +48 -13
  4. package/dist/{BottomSheetCore-DxSrC4QC.d.ts → BottomSheetCore-B_r4KCQL.d.ts} +48 -13
  5. package/dist/{BottomSheetEngine-B3F9qukX.d.cts → BottomSheetEngine-0F7mjyvF.d.cts} +1 -1
  6. package/dist/{BottomSheetEngine-BchzgqGG.d.ts → BottomSheetEngine-CJV_DDrM.d.ts} +1 -1
  7. package/dist/core.cjs +810 -436
  8. package/dist/core.d.cts +2 -3
  9. package/dist/core.d.ts +2 -3
  10. package/dist/core.js +810 -436
  11. package/dist/debug.d.cts +0 -1
  12. package/dist/debug.d.ts +0 -1
  13. package/dist/{default-features-DwVTzDwP.d.ts → default-features-4Xwv6aVt.d.ts} +4 -2
  14. package/dist/{default-features-BGiCSmV1.d.cts → default-features-DX2NOxP6.d.cts} +4 -2
  15. package/dist/element.cjs +1421 -697
  16. package/dist/element.d.cts +11 -3
  17. package/dist/element.d.ts +11 -3
  18. package/dist/element.iife.global.js +2 -2
  19. package/dist/element.js +1421 -697
  20. package/dist/features.cjs +334 -190
  21. package/dist/features.d.cts +3 -4
  22. package/dist/features.d.ts +3 -4
  23. package/dist/features.js +334 -191
  24. package/dist/{index-C7TSQkVK.d.cts → index-2shlxhcG.d.cts} +1 -1
  25. package/dist/{index-CdM1tke5.d.ts → index-CNCRQnpc.d.ts} +1 -1
  26. package/dist/index.cjs +1129 -631
  27. package/dist/index.d.cts +11 -6
  28. package/dist/index.d.ts +11 -6
  29. package/dist/index.js +1129 -632
  30. package/dist/integrations/formik.cjs +21 -10
  31. package/dist/integrations/formik.d.cts +0 -1
  32. package/dist/integrations/formik.d.ts +0 -1
  33. package/dist/integrations/formik.js +22 -11
  34. package/dist/integrations/react-hook-form.cjs +21 -12
  35. package/dist/integrations/react-hook-form.d.cts +0 -1
  36. package/dist/integrations/react-hook-form.d.ts +0 -1
  37. package/dist/integrations/react-hook-form.js +21 -12
  38. package/dist/option-keys-DItuAjUw.d.cts +6 -0
  39. package/dist/option-keys-a5DYNwwO.d.ts +6 -0
  40. package/dist/overlay.cjs +386 -189
  41. package/dist/overlay.d.cts +1 -3
  42. package/dist/overlay.d.ts +1 -3
  43. package/dist/overlay.js +386 -189
  44. package/dist/preact.d.cts +3 -4
  45. package/dist/preact.d.ts +3 -4
  46. package/dist/qwik-lib/index.qwik.cjs +1306 -671
  47. package/dist/qwik-lib/index.qwik.mjs +1306 -671
  48. package/dist/qwik.cjs +1326 -701
  49. package/dist/qwik.d.cts +12 -30
  50. package/dist/qwik.d.ts +12 -30
  51. package/dist/qwik.js +1326 -701
  52. package/dist/react.cjs +1373 -750
  53. package/dist/react.d.cts +26 -12
  54. package/dist/react.d.ts +26 -12
  55. package/dist/react.js +1375 -752
  56. package/dist/solid.cjs +1332 -727
  57. package/dist/solid.d.cts +13 -438
  58. package/dist/solid.d.ts +13 -438
  59. package/dist/solid.js +1334 -729
  60. package/dist/solid.source.jsx +1374 -751
  61. package/dist/styles.css +20 -6
  62. package/dist/svelte-core.cjs +1209 -676
  63. package/dist/svelte-core.js +1207 -677
  64. package/dist/svelte-src/BottomSheet.svelte +101 -58
  65. package/dist/svelte.cjs +1323 -705
  66. package/dist/svelte.d.cts +45 -25
  67. package/dist/svelte.d.ts +45 -25
  68. package/dist/svelte.js +1323 -705
  69. package/dist/vue.cjs +1354 -773
  70. package/dist/vue.d.cts +20 -3
  71. package/dist/vue.d.ts +20 -3
  72. package/dist/vue.js +1354 -773
  73. package/dist/webgl.cjs +38 -7
  74. package/dist/webgl.d.cts +0 -1
  75. package/dist/webgl.d.ts +0 -1
  76. package/dist/webgl.js +38 -7
  77. package/llms.txt +330 -0
  78. package/package.json +41 -19
  79. package/dist/transform-jVfAikE9.d.cts +0 -3
  80. package/dist/transform-jVfAikE9.d.ts +0 -3
package/dist/react.d.cts CHANGED
@@ -1,14 +1,13 @@
1
- import { d as EngineState, e as SnapPointDef, f as SheetMode } from './BottomSheetCore-C5tJYVMY.cjs';
1
+ import { d as EngineState, e as SnapPointDef, g as SheetMode } from './BottomSheetCore-B_r4KCQL.cjs';
2
2
  import { EngineOptions, SheetEventMap, CloseReason } from './core.cjs';
3
3
  import { AnchorOptions, ScrimStagesOptions, ScrimStageDef, ScrimUpdate, ScrimOverlayOptions } from './index.cjs';
4
- export { h as SnapPoint } from './BottomSheetCore-C5tJYVMY.cjs';
4
+ export { h as SnapPoint } from './BottomSheetCore-B_r4KCQL.cjs';
5
5
  import { OverlayOptions, OverlayState, Overlay as OverlayEngine } from './overlay.cjs';
6
6
  export { OverlayEdge } from './overlay.cjs';
7
7
  import * as react from 'react';
8
8
  import { CSSProperties, ReactNode } from 'react';
9
9
  import { BottomSheetEngine } from './index.cjs';
10
- import { T as TeleportTarget } from './teleport-7uYNiEAT.cjs';
11
- import './transform-jVfAikE9.cjs';
10
+ import { TeleportTarget } from './index.cjs';
12
11
 
13
12
  type EngineOptionsForProps = Omit<EngineOptions, "element" | "handle" | "scrollContainer" | "backdrop" | "scrim">;
14
13
  type HeaderProp = ReactNode | ((state: EngineState) => ReactNode);
@@ -51,6 +50,10 @@ type BottomSheetProps = EngineOptionsForProps & {
51
50
  onProgress?: (payload: SheetEventMap["progress"]) => void;
52
51
  ariaLabel?: string;
53
52
  ariaLabelledBy?: string;
53
+ handleLabel?: string;
54
+ contentLabel?: string;
55
+ open?: boolean;
56
+ onOpenChange?: (open: boolean) => void;
54
57
  noSSR?: boolean;
55
58
  };
56
59
  type BottomSheetHandle<TId extends string = string> = {
@@ -68,6 +71,7 @@ type BottomSheetHandle<TId extends string = string> = {
68
71
  addAnchor: (opts: AnchorOptions) => () => void;
69
72
  setScrimStages: (opts: ScrimStagesOptions | null) => () => void;
70
73
  recompute: () => void;
74
+ on: <K extends keyof SheetEventMap>(event: K, fn: (payload: SheetEventMap[K]) => void) => () => void;
71
75
  state: EngineState & {
72
76
  activeId: TId;
73
77
  };
@@ -103,15 +107,24 @@ declare const BottomSheet: react.ForwardRefExoticComponent<EngineOptionsForProps
103
107
  onProgress?: (payload: SheetEventMap["progress"]) => void;
104
108
  ariaLabel?: string;
105
109
  ariaLabelledBy?: string;
110
+ handleLabel?: string;
111
+ contentLabel?: string;
112
+ open?: boolean;
113
+ onOpenChange?: (open: boolean) => void;
106
114
  noSSR?: boolean;
107
115
  } & react.RefAttributes<BottomSheetHandle<string>>>;
108
116
 
117
+ type ElementRef = {
118
+ (node: HTMLElement | null): void;
119
+ readonly current: HTMLElement | null;
120
+ };
121
+
109
122
  type UseBottomSheetRefs = {
110
- sheetRef: React.RefObject<HTMLElement | null>;
111
- handleRef: React.RefObject<HTMLElement | null>;
112
- contentRef: React.RefObject<HTMLElement | null>;
113
- backdropRef: React.RefObject<HTMLElement | null>;
114
- screenRef: React.RefObject<HTMLElement | null>;
123
+ sheetRef: ElementRef;
124
+ handleRef: ElementRef;
125
+ contentRef: ElementRef;
126
+ backdropRef: ElementRef;
127
+ screenRef: ElementRef;
115
128
  };
116
129
  type UseBottomSheetReturn<TId extends string = string> = UseBottomSheetRefs & {
117
130
  state: EngineState & {
@@ -128,6 +141,7 @@ type UseBottomSheetReturn<TId extends string = string> = UseBottomSheetRefs & {
128
141
  addAnchor: (opts: AnchorOptions) => () => void;
129
142
  setScrimStages: (opts: ScrimStagesOptions | null) => () => void;
130
143
  recompute: () => void;
144
+ on: <K extends keyof SheetEventMap>(event: K, fn: (payload: SheetEventMap[K]) => void) => () => void;
131
145
  getEngine: () => BottomSheetEngine | null;
132
146
  };
133
147
  type HookOpts<TId extends string> = Omit<EngineOptions, "element" | "handle" | "scrollContainer" | "backdrop" | "scrim" | "snapPoints" | "allowed" | "initial"> & {
@@ -179,8 +193,8 @@ declare const Overlay: react.ForwardRefExoticComponent<Omit<OverlayOptions, "ele
179
193
  } & react.RefAttributes<OverlayHandle>>;
180
194
 
181
195
  type UseOverlayReturn = {
182
- panelRef: React.RefObject<HTMLElement | null>;
183
- backdropRef: React.RefObject<HTMLElement | null>;
196
+ panelRef: ElementRef;
197
+ backdropRef: ElementRef;
184
198
  state: OverlayState;
185
199
  open: () => Promise<void>;
186
200
  close: () => Promise<void>;
@@ -231,4 +245,4 @@ type BottomSheetFromConfigProps = {
231
245
  declare const BottomSheetFromConfig: react.ForwardRefExoticComponent<BottomSheetFromConfigProps & react.RefAttributes<BottomSheetHandle>>;
232
246
 
233
247
  export { BottomSheet, BottomSheetFromConfig, EngineState, Overlay, OverlayOptions, OverlayState, SheetMode, SnapPointDef, useBottomSheet, useOverlay };
234
- export type { BottomSheetFromConfigProps, BottomSheetHandle, BottomSheetProps, HeaderProp, OverlayHandle, OverlayProps, SheetConfig, UseBottomSheetRefs, UseBottomSheetReturn, UseOverlayReturn };
248
+ export type { BottomSheetFromConfigProps, BottomSheetHandle, BottomSheetProps, ElementRef, HeaderProp, OverlayHandle, OverlayProps, SheetConfig, UseBottomSheetRefs, UseBottomSheetReturn, UseOverlayReturn };
package/dist/react.d.ts CHANGED
@@ -1,14 +1,13 @@
1
- import { d as EngineState, e as SnapPointDef, f as SheetMode } from './BottomSheetCore-DxSrC4QC.js';
1
+ import { d as EngineState, e as SnapPointDef, g as SheetMode } from './BottomSheetCore-B_r4KCQL.js';
2
2
  import { EngineOptions, SheetEventMap, CloseReason } from './core.js';
3
3
  import { AnchorOptions, ScrimStagesOptions, ScrimStageDef, ScrimUpdate, ScrimOverlayOptions } from './index.js';
4
- export { h as SnapPoint } from './BottomSheetCore-DxSrC4QC.js';
4
+ export { h as SnapPoint } from './BottomSheetCore-B_r4KCQL.js';
5
5
  import { OverlayOptions, OverlayState, Overlay as OverlayEngine } from './overlay.js';
6
6
  export { OverlayEdge } from './overlay.js';
7
7
  import * as react from 'react';
8
8
  import { CSSProperties, ReactNode } from 'react';
9
9
  import { BottomSheetEngine } from './index.js';
10
- import { T as TeleportTarget } from './teleport-7uYNiEAT.js';
11
- import './transform-jVfAikE9.js';
10
+ import { TeleportTarget } from './index.js';
12
11
 
13
12
  type EngineOptionsForProps = Omit<EngineOptions, "element" | "handle" | "scrollContainer" | "backdrop" | "scrim">;
14
13
  type HeaderProp = ReactNode | ((state: EngineState) => ReactNode);
@@ -51,6 +50,10 @@ type BottomSheetProps = EngineOptionsForProps & {
51
50
  onProgress?: (payload: SheetEventMap["progress"]) => void;
52
51
  ariaLabel?: string;
53
52
  ariaLabelledBy?: string;
53
+ handleLabel?: string;
54
+ contentLabel?: string;
55
+ open?: boolean;
56
+ onOpenChange?: (open: boolean) => void;
54
57
  noSSR?: boolean;
55
58
  };
56
59
  type BottomSheetHandle<TId extends string = string> = {
@@ -68,6 +71,7 @@ type BottomSheetHandle<TId extends string = string> = {
68
71
  addAnchor: (opts: AnchorOptions) => () => void;
69
72
  setScrimStages: (opts: ScrimStagesOptions | null) => () => void;
70
73
  recompute: () => void;
74
+ on: <K extends keyof SheetEventMap>(event: K, fn: (payload: SheetEventMap[K]) => void) => () => void;
71
75
  state: EngineState & {
72
76
  activeId: TId;
73
77
  };
@@ -103,15 +107,24 @@ declare const BottomSheet: react.ForwardRefExoticComponent<EngineOptionsForProps
103
107
  onProgress?: (payload: SheetEventMap["progress"]) => void;
104
108
  ariaLabel?: string;
105
109
  ariaLabelledBy?: string;
110
+ handleLabel?: string;
111
+ contentLabel?: string;
112
+ open?: boolean;
113
+ onOpenChange?: (open: boolean) => void;
106
114
  noSSR?: boolean;
107
115
  } & react.RefAttributes<BottomSheetHandle<string>>>;
108
116
 
117
+ type ElementRef = {
118
+ (node: HTMLElement | null): void;
119
+ readonly current: HTMLElement | null;
120
+ };
121
+
109
122
  type UseBottomSheetRefs = {
110
- sheetRef: React.RefObject<HTMLElement | null>;
111
- handleRef: React.RefObject<HTMLElement | null>;
112
- contentRef: React.RefObject<HTMLElement | null>;
113
- backdropRef: React.RefObject<HTMLElement | null>;
114
- screenRef: React.RefObject<HTMLElement | null>;
123
+ sheetRef: ElementRef;
124
+ handleRef: ElementRef;
125
+ contentRef: ElementRef;
126
+ backdropRef: ElementRef;
127
+ screenRef: ElementRef;
115
128
  };
116
129
  type UseBottomSheetReturn<TId extends string = string> = UseBottomSheetRefs & {
117
130
  state: EngineState & {
@@ -128,6 +141,7 @@ type UseBottomSheetReturn<TId extends string = string> = UseBottomSheetRefs & {
128
141
  addAnchor: (opts: AnchorOptions) => () => void;
129
142
  setScrimStages: (opts: ScrimStagesOptions | null) => () => void;
130
143
  recompute: () => void;
144
+ on: <K extends keyof SheetEventMap>(event: K, fn: (payload: SheetEventMap[K]) => void) => () => void;
131
145
  getEngine: () => BottomSheetEngine | null;
132
146
  };
133
147
  type HookOpts<TId extends string> = Omit<EngineOptions, "element" | "handle" | "scrollContainer" | "backdrop" | "scrim" | "snapPoints" | "allowed" | "initial"> & {
@@ -179,8 +193,8 @@ declare const Overlay: react.ForwardRefExoticComponent<Omit<OverlayOptions, "ele
179
193
  } & react.RefAttributes<OverlayHandle>>;
180
194
 
181
195
  type UseOverlayReturn = {
182
- panelRef: React.RefObject<HTMLElement | null>;
183
- backdropRef: React.RefObject<HTMLElement | null>;
196
+ panelRef: ElementRef;
197
+ backdropRef: ElementRef;
184
198
  state: OverlayState;
185
199
  open: () => Promise<void>;
186
200
  close: () => Promise<void>;
@@ -231,4 +245,4 @@ type BottomSheetFromConfigProps = {
231
245
  declare const BottomSheetFromConfig: react.ForwardRefExoticComponent<BottomSheetFromConfigProps & react.RefAttributes<BottomSheetHandle>>;
232
246
 
233
247
  export { BottomSheet, BottomSheetFromConfig, EngineState, Overlay, OverlayOptions, OverlayState, SheetMode, SnapPointDef, useBottomSheet, useOverlay };
234
- export type { BottomSheetFromConfigProps, BottomSheetHandle, BottomSheetProps, HeaderProp, OverlayHandle, OverlayProps, SheetConfig, UseBottomSheetRefs, UseBottomSheetReturn, UseOverlayReturn };
248
+ export type { BottomSheetFromConfigProps, BottomSheetHandle, BottomSheetProps, ElementRef, HeaderProp, OverlayHandle, OverlayProps, SheetConfig, UseBottomSheetRefs, UseBottomSheetReturn, UseOverlayReturn };