@sprawlify/primitives 0.0.109 → 0.0.111

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 (231) hide show
  1. package/dist/{aria-hidden-BX4SWNE_.mjs → aria-hidden-C72KtklN.mjs} +1 -1
  2. package/dist/{aria-hidden-BAGrxNHt.cjs → aria-hidden-CIBHXlCy.cjs} +1 -1
  3. package/dist/aria-hidden.cjs +2 -2
  4. package/dist/aria-hidden.mjs +2 -2
  5. package/dist/{auto-resize-B1BDDnp1.cjs → auto-resize-BTTNXiml.cjs} +1 -1
  6. package/dist/{auto-resize-CN2vAzdj.mjs → auto-resize-CbNgN0OO.mjs} +1 -1
  7. package/dist/auto-resize.cjs +2 -2
  8. package/dist/auto-resize.mjs +2 -2
  9. package/dist/collection.d.cts +2 -2
  10. package/dist/collection.d.mts +2 -2
  11. package/dist/{core-BmIEKqtP.mjs → core-Ci9Yu6QI.mjs} +1 -1
  12. package/dist/{core-nBg9RC_y.cjs → core-DwdPztGA.cjs} +1 -1
  13. package/dist/core.cjs +2 -2
  14. package/dist/core.mjs +2 -2
  15. package/dist/{dismissable-DWfZGIA7.mjs → dismissable-B9k5K6f9.mjs} +2 -2
  16. package/dist/{dismissable-ChwcJMHk.cjs → dismissable-DxjbwsOf.cjs} +2 -2
  17. package/dist/dismissable.cjs +3 -3
  18. package/dist/dismissable.mjs +3 -3
  19. package/dist/{dom-query-s2ESLR2U.mjs → dom-query-BFuRs3l4.mjs} +1 -1
  20. package/dist/{dom-query-Bd63cRVF.cjs → dom-query-BUO7rGsg.cjs} +1 -1
  21. package/dist/dom-query.cjs +1 -1
  22. package/dist/dom-query.mjs +1 -1
  23. package/dist/{focus-trap-fucc6OU_.cjs → focus-trap-BewqTQFt.cjs} +1 -1
  24. package/dist/{focus-trap-DzBvBlTH.mjs → focus-trap-Do8IUXYh.mjs} +1 -1
  25. package/dist/focus-trap.cjs +2 -2
  26. package/dist/focus-trap.mjs +2 -2
  27. package/dist/{focus-visible-D5qBaAOn.mjs → focus-visible-GXKbbuiq.mjs} +1 -1
  28. package/dist/{focus-visible-75XTctXf.cjs → focus-visible-JdJXqMic.cjs} +1 -1
  29. package/dist/focus-visible.cjs +2 -2
  30. package/dist/focus-visible.mjs +2 -2
  31. package/dist/{i18n-utils-DB-lUfrr.cjs → i18n-utils-BRLqoCq8.cjs} +1 -1
  32. package/dist/{i18n-utils-oWZyUib_.mjs → i18n-utils-DZs1CPj8.mjs} +1 -1
  33. package/dist/i18n-utils.cjs +2 -2
  34. package/dist/i18n-utils.mjs +2 -2
  35. package/dist/{interact-outside-2qkUnl4N.mjs → interact-outside-Ba50N1a5.mjs} +1 -1
  36. package/dist/{interact-outside-Cx4J0EBf.cjs → interact-outside-Bg-QSXqp.cjs} +1 -1
  37. package/dist/interact-outside.cjs +2 -2
  38. package/dist/interact-outside.mjs +2 -2
  39. package/dist/{list-collection-B_8BN0XB.d.cts → list-collection-Cjgbx_9l.d.cts} +1 -1
  40. package/dist/{list-collection-DkRA5LOq.d.mts → list-collection-IF510iNl.d.mts} +1 -1
  41. package/dist/machines/accordion/index.cjs +2 -2
  42. package/dist/machines/accordion/index.mjs +2 -2
  43. package/dist/machines/angle-slider/index.cjs +2 -2
  44. package/dist/machines/angle-slider/index.d.cts +1 -1
  45. package/dist/machines/angle-slider/index.d.mts +1 -1
  46. package/dist/machines/angle-slider/index.mjs +2 -2
  47. package/dist/machines/aspect-ratio/index.cjs +2 -2
  48. package/dist/machines/aspect-ratio/index.mjs +2 -2
  49. package/dist/machines/async-list/index.cjs +2 -2
  50. package/dist/machines/async-list/index.mjs +2 -2
  51. package/dist/machines/avatar/index.cjs +2 -2
  52. package/dist/machines/avatar/index.mjs +2 -2
  53. package/dist/machines/carousel/index.cjs +3 -3
  54. package/dist/machines/carousel/index.d.cts +1 -1
  55. package/dist/machines/carousel/index.d.mts +1 -1
  56. package/dist/machines/carousel/index.mjs +3 -3
  57. package/dist/machines/cascade-select/index.cjs +5 -5
  58. package/dist/machines/cascade-select/index.d.cts +2 -2
  59. package/dist/machines/cascade-select/index.d.mts +2 -2
  60. package/dist/machines/cascade-select/index.mjs +5 -5
  61. package/dist/machines/checkbox/index.cjs +3 -3
  62. package/dist/machines/checkbox/index.d.cts +1 -1
  63. package/dist/machines/checkbox/index.d.mts +1 -1
  64. package/dist/machines/checkbox/index.mjs +3 -3
  65. package/dist/machines/clipboard/index.cjs +2 -2
  66. package/dist/machines/clipboard/index.d.cts +1 -1
  67. package/dist/machines/clipboard/index.d.mts +1 -1
  68. package/dist/machines/clipboard/index.mjs +2 -2
  69. package/dist/machines/collapsible/index.cjs +2 -2
  70. package/dist/machines/collapsible/index.d.cts +1 -1
  71. package/dist/machines/collapsible/index.d.mts +1 -1
  72. package/dist/machines/collapsible/index.mjs +2 -2
  73. package/dist/machines/color-picker/index.cjs +5 -5
  74. package/dist/machines/color-picker/index.d.cts +1 -1
  75. package/dist/machines/color-picker/index.d.mts +1 -1
  76. package/dist/machines/color-picker/index.mjs +5 -5
  77. package/dist/machines/combobox/index.cjs +5 -5
  78. package/dist/machines/combobox/index.d.cts +2 -2
  79. package/dist/machines/combobox/index.d.mts +2 -2
  80. package/dist/machines/combobox/index.mjs +5 -5
  81. package/dist/machines/date-picker/index.cjs +5 -5
  82. package/dist/machines/date-picker/index.d.cts +1 -1
  83. package/dist/machines/date-picker/index.d.mts +1 -1
  84. package/dist/machines/date-picker/index.mjs +5 -5
  85. package/dist/machines/dialog/index.cjs +7 -7
  86. package/dist/machines/dialog/index.d.cts +1 -1
  87. package/dist/machines/dialog/index.d.mts +1 -1
  88. package/dist/machines/dialog/index.mjs +7 -7
  89. package/dist/machines/drawer/index.cjs +1934 -0
  90. package/dist/machines/drawer/index.d.cts +310 -0
  91. package/dist/machines/drawer/index.d.mts +310 -0
  92. package/dist/machines/drawer/index.mjs +1927 -0
  93. package/dist/machines/dropdown-menu/index.cjs +5 -5
  94. package/dist/machines/dropdown-menu/index.d.cts +1 -1
  95. package/dist/machines/dropdown-menu/index.d.mts +1 -1
  96. package/dist/machines/dropdown-menu/index.mjs +5 -5
  97. package/dist/machines/editable/index.cjs +3 -3
  98. package/dist/machines/editable/index.d.cts +1 -1
  99. package/dist/machines/editable/index.d.mts +1 -1
  100. package/dist/machines/editable/index.mjs +3 -3
  101. package/dist/machines/file-upload/index.cjs +3 -3
  102. package/dist/machines/file-upload/index.d.cts +1 -1
  103. package/dist/machines/file-upload/index.d.mts +1 -1
  104. package/dist/machines/file-upload/index.mjs +3 -3
  105. package/dist/machines/floating-panel/index.cjs +2 -2
  106. package/dist/machines/floating-panel/index.d.cts +1 -1
  107. package/dist/machines/floating-panel/index.d.mts +1 -1
  108. package/dist/machines/floating-panel/index.mjs +2 -2
  109. package/dist/machines/hover-card/index.cjs +5 -5
  110. package/dist/machines/hover-card/index.d.cts +1 -1
  111. package/dist/machines/hover-card/index.d.mts +1 -1
  112. package/dist/machines/hover-card/index.mjs +5 -5
  113. package/dist/machines/image-cropper/index.cjs +2 -2
  114. package/dist/machines/image-cropper/index.mjs +2 -2
  115. package/dist/machines/listbox/index.cjs +3 -3
  116. package/dist/machines/listbox/index.d.cts +3 -3
  117. package/dist/machines/listbox/index.d.mts +3 -3
  118. package/dist/machines/listbox/index.mjs +3 -3
  119. package/dist/machines/marquee/index.cjs +2 -2
  120. package/dist/machines/marquee/index.d.cts +3 -3
  121. package/dist/machines/marquee/index.d.mts +3 -3
  122. package/dist/machines/marquee/index.mjs +2 -2
  123. package/dist/machines/navigation-menu/index.cjs +4 -4
  124. package/dist/machines/navigation-menu/index.d.cts +1 -1
  125. package/dist/machines/navigation-menu/index.d.mts +1 -1
  126. package/dist/machines/navigation-menu/index.mjs +4 -4
  127. package/dist/machines/number-input/index.cjs +2 -2
  128. package/dist/machines/number-input/index.d.cts +1 -1
  129. package/dist/machines/number-input/index.d.mts +1 -1
  130. package/dist/machines/number-input/index.mjs +2 -2
  131. package/dist/machines/pagination/index.cjs +2 -2
  132. package/dist/machines/pagination/index.mjs +2 -2
  133. package/dist/machines/password-input/index.cjs +2 -2
  134. package/dist/machines/password-input/index.d.cts +1 -1
  135. package/dist/machines/password-input/index.d.mts +1 -1
  136. package/dist/machines/password-input/index.mjs +2 -2
  137. package/dist/machines/pin-input/index.cjs +2 -2
  138. package/dist/machines/pin-input/index.d.cts +1 -1
  139. package/dist/machines/pin-input/index.d.mts +1 -1
  140. package/dist/machines/pin-input/index.mjs +2 -2
  141. package/dist/machines/popover/index.cjs +8 -8
  142. package/dist/machines/popover/index.d.cts +1 -1
  143. package/dist/machines/popover/index.d.mts +1 -1
  144. package/dist/machines/popover/index.mjs +8 -8
  145. package/dist/machines/presence/index.cjs +2 -2
  146. package/dist/machines/presence/index.mjs +2 -2
  147. package/dist/machines/progress/index.cjs +2 -2
  148. package/dist/machines/progress/index.d.cts +1 -1
  149. package/dist/machines/progress/index.d.mts +1 -1
  150. package/dist/machines/progress/index.mjs +2 -2
  151. package/dist/machines/qr-code/index.cjs +2 -2
  152. package/dist/machines/qr-code/index.mjs +2 -2
  153. package/dist/machines/radio-group/index.cjs +3 -3
  154. package/dist/machines/radio-group/index.d.cts +1 -1
  155. package/dist/machines/radio-group/index.d.mts +1 -1
  156. package/dist/machines/radio-group/index.mjs +3 -3
  157. package/dist/machines/rating-group/index.cjs +2 -2
  158. package/dist/machines/rating-group/index.mjs +2 -2
  159. package/dist/machines/scroll-area/index.cjs +2 -2
  160. package/dist/machines/scroll-area/index.d.cts +1 -1
  161. package/dist/machines/scroll-area/index.d.mts +1 -1
  162. package/dist/machines/scroll-area/index.mjs +2 -2
  163. package/dist/machines/select/index.cjs +6 -6
  164. package/dist/machines/select/index.d.cts +2 -2
  165. package/dist/machines/select/index.d.mts +2 -2
  166. package/dist/machines/select/index.mjs +6 -6
  167. package/dist/machines/separator/index.cjs +2 -2
  168. package/dist/machines/separator/index.mjs +2 -2
  169. package/dist/machines/signature-pad/index.cjs +2 -2
  170. package/dist/machines/signature-pad/index.mjs +2 -2
  171. package/dist/machines/slider/index.cjs +2 -2
  172. package/dist/machines/slider/index.d.cts +1 -1
  173. package/dist/machines/slider/index.d.mts +1 -1
  174. package/dist/machines/slider/index.mjs +2 -2
  175. package/dist/machines/splitter/index.cjs +2 -2
  176. package/dist/machines/splitter/index.mjs +2 -2
  177. package/dist/machines/steps/index.cjs +2 -2
  178. package/dist/machines/steps/index.d.cts +1 -1
  179. package/dist/machines/steps/index.d.mts +1 -1
  180. package/dist/machines/steps/index.mjs +2 -2
  181. package/dist/machines/switch/index.cjs +3 -3
  182. package/dist/machines/switch/index.mjs +3 -3
  183. package/dist/machines/tabs/index.cjs +2 -2
  184. package/dist/machines/tabs/index.d.cts +1 -1
  185. package/dist/machines/tabs/index.d.mts +1 -1
  186. package/dist/machines/tabs/index.mjs +2 -2
  187. package/dist/machines/tags-input/index.cjs +4 -4
  188. package/dist/machines/tags-input/index.d.cts +1 -1
  189. package/dist/machines/tags-input/index.d.mts +1 -1
  190. package/dist/machines/tags-input/index.mjs +4 -4
  191. package/dist/machines/timer/index.cjs +2 -2
  192. package/dist/machines/timer/index.d.cts +1 -1
  193. package/dist/machines/timer/index.d.mts +1 -1
  194. package/dist/machines/timer/index.mjs +2 -2
  195. package/dist/machines/toast/index.cjs +4 -4
  196. package/dist/machines/toast/index.d.cts +1 -1
  197. package/dist/machines/toast/index.d.mts +1 -1
  198. package/dist/machines/toast/index.mjs +4 -4
  199. package/dist/machines/toggle/index.cjs +2 -2
  200. package/dist/machines/toggle/index.mjs +2 -2
  201. package/dist/machines/toggle-group/index.cjs +2 -2
  202. package/dist/machines/toggle-group/index.mjs +2 -2
  203. package/dist/machines/tooltip/index.cjs +4 -4
  204. package/dist/machines/tooltip/index.d.cts +1 -1
  205. package/dist/machines/tooltip/index.d.mts +1 -1
  206. package/dist/machines/tooltip/index.mjs +4 -4
  207. package/dist/machines/tour/index.cjs +6 -6
  208. package/dist/machines/tour/index.d.cts +1 -1
  209. package/dist/machines/tour/index.d.mts +1 -1
  210. package/dist/machines/tour/index.mjs +6 -6
  211. package/dist/machines/tree-view/index.cjs +2 -2
  212. package/dist/machines/tree-view/index.d.cts +1 -1
  213. package/dist/machines/tree-view/index.d.mts +1 -1
  214. package/dist/machines/tree-view/index.mjs +2 -2
  215. package/dist/{popper-BDy37WA0.mjs → popper-BlgbmdAn.mjs} +1 -1
  216. package/dist/{popper-Cx3KHzeT.cjs → popper-viCrafLC.cjs} +1 -1
  217. package/dist/popper.cjs +2 -2
  218. package/dist/popper.mjs +2 -2
  219. package/dist/{remove-scroll-D9FAOapi.cjs → remove-scroll-D4CMJmU2.cjs} +1 -1
  220. package/dist/{remove-scroll-HcSiTbd5.mjs → remove-scroll-D55GZoBb.mjs} +1 -1
  221. package/dist/{scroll-snap-DfSwN3As.mjs → scroll-snap-CdneVP31.mjs} +1 -1
  222. package/dist/{scroll-snap-Dp_2adEa.cjs → scroll-snap-vZ2q6dcN.cjs} +1 -1
  223. package/dist/scroll-snap.cjs +2 -2
  224. package/dist/scroll-snap.mjs +2 -2
  225. package/dist/{selection-DdNvrKbj.d.mts → selection-6urf-c8j.d.mts} +1 -1
  226. package/dist/{selection-Bb_ZSVxe.d.cts → selection-BmS2RDMq.d.cts} +1 -1
  227. package/package.json +11 -11
  228. package/dist/machines/bottom-sheet/index.cjs +0 -667
  229. package/dist/machines/bottom-sheet/index.d.cts +0 -239
  230. package/dist/machines/bottom-sheet/index.d.mts +0 -239
  231. package/dist/machines/bottom-sheet/index.mjs +0 -662
@@ -0,0 +1,310 @@
1
+ import { n as AnatomyInstance } from "../../create-anatomy-9eFQs7lO.cjs";
2
+ import { p as Machine, u as EventObject, y as Service } from "../../types-B24gMTKq.cjs";
3
+ import { C as JSX, b as NormalizeProps, g as RequiredBy, p as Point, r as DirectionProperty, s as MaybeElement, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
4
+ import { c as PointerDownOutsideEvent, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-DzWGFhcS.cjs";
5
+ import { t as DismissableElementHandlers } from "../../dismissable-layer-ZgyqN8AD.cjs";
6
+
7
+ //#region src/machines/drawer/drawer.anatomy.d.ts
8
+ declare const anatomy: AnatomyInstance<"trigger" | "title" | "content" | "description" | "positioner" | "backdrop" | "closeTrigger" | "grabber" | "grabberIndicator" | "swipeArea">;
9
+ //#endregion
10
+ //#region src/machines/drawer/utils/session.d.ts
11
+ type GestureAxis = "x" | "y";
12
+ type PhysicalSwipeDirection = "up" | "down" | "left" | "right";
13
+ type SwipePointerType = "mouse" | "pen" | "touch";
14
+ interface SwipeMoveDetails {
15
+ point: Point;
16
+ target: Element | null;
17
+ event: PointerEvent | TouchEvent;
18
+ pointerType: SwipePointerType;
19
+ axis: GestureAxis;
20
+ swipeDirection: PhysicalSwipeDirection;
21
+ }
22
+ interface SwipeEndDetails {
23
+ point: Point;
24
+ swipeDirection: PhysicalSwipeDirection;
25
+ }
26
+ interface SwipeStartDetails {
27
+ point: Point;
28
+ target: Element | null;
29
+ event: PointerEvent | TouchEvent;
30
+ pointerType: SwipePointerType;
31
+ axis: GestureAxis;
32
+ swipeDirection: PhysicalSwipeDirection;
33
+ }
34
+ interface SwipeInterruptDetails {
35
+ reason: "visibility-hidden" | "lost-pointer-capture";
36
+ event: Event | Document;
37
+ target: Element | null;
38
+ pointerType: SwipePointerType | null;
39
+ }
40
+ interface SwipeTrackingOptions {
41
+ getDoc: () => Document;
42
+ getSelectionTarget?: () => HTMLElement | null;
43
+ swipeDirection: PhysicalSwipeDirection;
44
+ onStart?: (details: SwipeStartDetails) => void;
45
+ onMove: (details: SwipeMoveDetails) => void;
46
+ onEnd: (details: SwipeEndDetails) => void;
47
+ onCancel: () => void;
48
+ preventDefault?: (details: SwipeMoveDetails) => boolean;
49
+ cancelOnInterrupt?: (details: SwipeInterruptDetails) => boolean;
50
+ }
51
+ interface PendingSwipeOptions {
52
+ getWin: () => Window;
53
+ pointerId: number;
54
+ startPoint: Point;
55
+ swipeDirection: PhysicalSwipeDirection;
56
+ onCommit: (point: Point) => void;
57
+ canCommit?: () => boolean;
58
+ onCancel?: () => void;
59
+ }
60
+ declare class SwipeSession {
61
+ private startPoint;
62
+ private velocity;
63
+ private samples;
64
+ private sampleStartIndex;
65
+ private gestureStartAxis;
66
+ private gestureStartTime;
67
+ private gestureSign;
68
+ private pendingSwipe;
69
+ setStartPoint(point: Point): void;
70
+ clearStartPoint(): void;
71
+ getStartPoint(): Point | null;
72
+ getGestureAxis(direction: PhysicalSwipeDirection): GestureAxis;
73
+ getGestureSign(direction: PhysicalSwipeDirection): number;
74
+ private getAxisValue;
75
+ getMainAxisDisplacement(point: Point, axis: GestureAxis, sign: number): number;
76
+ getCrossAxisDisplacement(point: Point, axis: GestureAxis): number;
77
+ track(point: Point, axis: GestureAxis, sign: number): void;
78
+ getReleaseVelocity(): number;
79
+ clearVelocityTracking(): void;
80
+ clear(): void;
81
+ startDeferredSwipe(options: PendingSwipeOptions): void;
82
+ cancelDeferredSwipe(): void;
83
+ bind(options: SwipeTrackingOptions): () => void;
84
+ }
85
+ //#endregion
86
+ //#region src/machines/drawer/utils/drawer-session.d.ts
87
+ interface ContentPointerDownOptions {
88
+ event: JSX.PointerEvent<HTMLElement>;
89
+ getDoc: () => Document;
90
+ getContentEl: () => HTMLElement | null;
91
+ getWin: () => Window;
92
+ swipeDirection: PhysicalSwipeDirection;
93
+ canCommit: () => boolean;
94
+ onCommit: (point: Point) => void;
95
+ }
96
+ interface GrabberPointerDownOptions {
97
+ event: JSX.PointerEvent<HTMLElement>;
98
+ point: Point;
99
+ canCommit: () => boolean;
100
+ onCommit: (point: Point) => void;
101
+ }
102
+ declare class DrawerSwipeSession {
103
+ readonly session: SwipeSession;
104
+ private dragOffset;
105
+ private readonly preventDragOnScroll;
106
+ constructor(options: DrawerSwipeSessionOptions);
107
+ contentPointerDown(options: ContentPointerDownOptions): void;
108
+ grabberPointerDown(options: GrabberPointerDownOptions): void;
109
+ private adjustReleaseVelocityAgainstDisplacement;
110
+ private adjustReleaseVelocityForOpenSwipe;
111
+ beginSwipe(point: Point): void;
112
+ clearSwipeStart(): void;
113
+ getSwipeStart(): Point | null;
114
+ getDragOffset(): number | null;
115
+ resetDragOffset(): void;
116
+ resetVelocity(): void;
117
+ reset(): void;
118
+ setDragOffset(point: Point, resolvedActiveSnapPointOffset: number, direction: PhysicalSwipeDirection): void;
119
+ setSwipeOpenOffset(point: Point, contentSize: number, direction: PhysicalSwipeDirection): void;
120
+ canStartDrag(point: Point, target: EventTarget | null, container: HTMLElement | null, preventDragOnScroll: boolean, direction: PhysicalSwipeDirection): boolean;
121
+ resolveSnapPointOnRelease(snapPoints: ResolvedSnapPoint[], snapPoint: ResolvedSnapPoint | null, snapToSequentialPoints: boolean, contentSize: number): number | string | null;
122
+ shouldOpenOnRelease(contentSize: number | null, swipeVelocityThreshold: number, openThreshold: number): boolean;
123
+ shouldDismissOnRelease(contentSize: number | null, snapPoints: ResolvedSnapPoint[], resolvedSnapOffset: number): boolean;
124
+ getSwipeStrength(targetOffset: number, resolvedSnapOffset?: number | null): number;
125
+ bindDragTracking(options: DragTrackingOptions): () => void;
126
+ bindSwipeOpenTracking(options: SwipeOpenTrackingOptions): () => void;
127
+ }
128
+ interface DrawerSwipeSessionOptions {
129
+ preventDragOnScroll: () => boolean;
130
+ }
131
+ interface DragTrackingOptions {
132
+ getDoc: () => Document;
133
+ getContentEl: () => HTMLElement | null;
134
+ getSwipeAreaEl: () => HTMLElement | null;
135
+ swipeDirection: PhysicalSwipeDirection;
136
+ onMove: (details: {
137
+ point: Point;
138
+ target: Element | null;
139
+ swipeDirection: PhysicalSwipeDirection;
140
+ }) => void;
141
+ onEnd: (details: {
142
+ point: Point;
143
+ swipeDirection: PhysicalSwipeDirection;
144
+ }) => void;
145
+ onCancel: () => void;
146
+ }
147
+ interface SwipeOpenTrackingOptions {
148
+ getDoc: () => Document;
149
+ getContentEl: () => HTMLElement | null;
150
+ getSwipeAreaEl: () => HTMLElement | null;
151
+ swipeDirection: PhysicalSwipeDirection;
152
+ onMove: (details: {
153
+ point: Point;
154
+ }) => void;
155
+ onEnd: (details: {
156
+ point: Point;
157
+ swipeDirection: PhysicalSwipeDirection;
158
+ }) => void;
159
+ onCancel: () => void;
160
+ }
161
+ //#endregion
162
+ //#region src/machines/drawer/drawer.types.d.ts
163
+ type SwipeDirection = "up" | "down" | "start" | "end";
164
+ type SnapPoint = number | string;
165
+ interface OpenChangeDetails {
166
+ open: boolean;
167
+ }
168
+ interface ResolvedSnapPoint {
169
+ value: SnapPoint;
170
+ height: number;
171
+ offset: number;
172
+ }
173
+ interface SnapPointChangeDetails {
174
+ snapPoint: SnapPoint | null;
175
+ }
176
+ interface DrawerStackSnapshot {
177
+ active: boolean;
178
+ openCount: number;
179
+ swipeProgress: number;
180
+ frontmostHeight: number;
181
+ }
182
+ interface DrawerStack {
183
+ getSnapshot(): DrawerStackSnapshot;
184
+ subscribe(listener: () => void): () => void;
185
+ register(id: string): void;
186
+ unregister(id: string): void;
187
+ setOpen(id: string, open: boolean): void;
188
+ setHeight(id: string, height: number): void;
189
+ setSwipe(id: string, swiping: boolean, progress: number): void;
190
+ }
191
+ interface DrawerStackApi<T extends PropTypes = PropTypes> {
192
+ getIndentProps(): T["element"];
193
+ getIndentBackgroundProps(): T["element"];
194
+ }
195
+ type ElementIds = Partial<{
196
+ backdrop: string;
197
+ positioner: string;
198
+ content: string;
199
+ title: string;
200
+ description: string;
201
+ header: string;
202
+ trigger: string;
203
+ grabber: string;
204
+ grabberIndicator: string;
205
+ closeTrigger: string;
206
+ swipeArea: string;
207
+ }>;
208
+ interface DrawerProps extends DirectionProperty, CommonProperties, DismissableElementHandlers {
209
+ ids?: ElementIds;
210
+ trapFocus?: boolean | undefined;
211
+ preventScroll?: boolean | undefined;
212
+ modal?: boolean | undefined;
213
+ initialFocusEl?: (() => MaybeElement) | undefined;
214
+ finalFocusEl?: (() => MaybeElement) | undefined;
215
+ restoreFocus?: boolean | undefined;
216
+ role?: "dialog" | "alertdialog" | undefined;
217
+ open?: boolean | undefined;
218
+ defaultOpen?: boolean | undefined;
219
+ onOpenChange?: ((details: OpenChangeDetails) => void) | undefined;
220
+ closeOnInteractOutside?: boolean | undefined;
221
+ closeOnEscape?: boolean | undefined;
222
+ snapPoints?: SnapPoint[] | undefined;
223
+ swipeDirection?: SwipeDirection | undefined;
224
+ snapToSequentialPoints?: boolean | undefined;
225
+ swipeVelocityThreshold?: number;
226
+ closeThreshold?: number;
227
+ preventDragOnScroll?: boolean;
228
+ snapPoint?: SnapPoint | null | undefined;
229
+ defaultSnapPoint?: SnapPoint | null | undefined;
230
+ onSnapPointChange?: ((details: SnapPointChangeDetails) => void) | undefined;
231
+ stack?: DrawerStack | undefined;
232
+ }
233
+ type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "trapFocus" | "restoreFocus" | "preventScroll" | "initialFocusEl" | "snapPoints" | "swipeDirection" | "snapToSequentialPoints" | "swipeVelocityThreshold" | "closeThreshold" | "preventDragOnScroll" | "defaultSnapPoint";
234
+ interface DrawerSchema {
235
+ props: RequiredBy<DrawerProps, PropsWithDefault>;
236
+ state: "open" | "closed" | "closing" | "swipe-area-dragging" | "swiping-open";
237
+ tag: "open" | "closed";
238
+ context: {
239
+ dragOffset: number | null;
240
+ snapPoint: SnapPoint | null;
241
+ resolvedActiveSnapPoint: ResolvedSnapPoint | null;
242
+ contentSize: number | null;
243
+ viewportSize: number;
244
+ rootFontSize: number;
245
+ swipeStrength: number;
246
+ rendered: {
247
+ title: boolean;
248
+ description: boolean;
249
+ };
250
+ };
251
+ refs: {
252
+ swipeSession: DrawerSwipeSession;
253
+ };
254
+ computed: {
255
+ drawerId: string;
256
+ physicalSwipeDirection: PhysicalSwipeDirection;
257
+ resolvedSnapPoints: ResolvedSnapPoint[];
258
+ };
259
+ event: EventObject;
260
+ action: string;
261
+ guard: string;
262
+ effect: string;
263
+ }
264
+ type DrawerService = Service<DrawerSchema>;
265
+ type DrawerMachine = Machine<DrawerSchema>;
266
+ interface ContentProps {
267
+ draggable?: boolean | undefined;
268
+ }
269
+ interface SwipeAreaProps {
270
+ disabled?: boolean | undefined;
271
+ swipeDirection?: SwipeDirection | undefined;
272
+ }
273
+ interface DrawerApi<T extends PropTypes = PropTypes> {
274
+ open: boolean;
275
+ dragging: boolean;
276
+ setOpen: (open: boolean) => void;
277
+ snapPoints: SnapPoint[];
278
+ swipeDirection: SwipeDirection;
279
+ snapPoint: SnapPoint | null;
280
+ setSnapPoint: (snapPoint: SnapPoint | null) => void;
281
+ getOpenPercentage: () => number;
282
+ getSnapPointIndex: () => number;
283
+ getContentSize: () => number | null;
284
+ getPositionerProps: () => T["element"];
285
+ getContentProps: (props?: ContentProps) => T["element"];
286
+ getTitleProps: () => T["element"];
287
+ getDescriptionProps: () => T["element"];
288
+ getTriggerProps: () => T["element"];
289
+ getBackdropProps: () => T["element"];
290
+ getGrabberProps: () => T["element"];
291
+ getGrabberIndicatorProps: () => T["element"];
292
+ getCloseTriggerProps: () => T["element"];
293
+ getSwipeAreaProps: (props?: SwipeAreaProps) => T["element"];
294
+ }
295
+ //#endregion
296
+ //#region src/machines/drawer/drawer.connect.d.ts
297
+ declare function connect<T extends PropTypes>(service: DrawerService, normalize: NormalizeProps<T>): DrawerApi<T>;
298
+ //#endregion
299
+ //#region src/machines/drawer/drawer.machine.d.ts
300
+ declare const machine: Machine<DrawerSchema>;
301
+ //#endregion
302
+ //#region src/machines/drawer/drawer.props.d.ts
303
+ declare const props: (keyof DrawerProps)[];
304
+ declare const splitProps: <Props extends Partial<DrawerProps>>(props: Props) => [Partial<DrawerProps>, Omit<Props, keyof DrawerProps>];
305
+ //#endregion
306
+ //#region src/machines/drawer/drawer.stack.d.ts
307
+ declare function createStack(): DrawerStack;
308
+ declare function connectStack<T extends PropTypes>(snapshot: DrawerStackSnapshot, normalize: NormalizeProps<T>): DrawerStackApi<T>;
309
+ //#endregion
310
+ export { type DrawerApi as Api, type ContentProps, type DrawerStack, type DrawerStackApi, type DrawerStackSnapshot, type ElementIds, type FocusOutsideEvent, type InteractOutsideEvent, type DrawerMachine as Machine, type OpenChangeDetails, type PointerDownOutsideEvent, type DrawerProps as Props, type ResolvedSnapPoint, type DrawerService as Service, type SnapPoint, type SnapPointChangeDetails, type SwipeDirection, anatomy, connect, connectStack, createStack, machine, props, splitProps };
@@ -0,0 +1,310 @@
1
+ import { n as AnatomyInstance } from "../../create-anatomy-BedZVdg0.mjs";
2
+ import { p as Machine, u as EventObject, y as Service } from "../../types-DUM9rzfD.mjs";
3
+ import { C as JSX, b as NormalizeProps, g as RequiredBy, p as Point, r as DirectionProperty, s as MaybeElement, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
4
+ import { c as PointerDownOutsideEvent, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-CGNNiDyE.mjs";
5
+ import { t as DismissableElementHandlers } from "../../dismissable-layer-h14gHVbJ.mjs";
6
+
7
+ //#region src/machines/drawer/drawer.anatomy.d.ts
8
+ declare const anatomy: AnatomyInstance<"trigger" | "title" | "content" | "description" | "positioner" | "backdrop" | "closeTrigger" | "grabber" | "grabberIndicator" | "swipeArea">;
9
+ //#endregion
10
+ //#region src/machines/drawer/utils/session.d.ts
11
+ type GestureAxis = "x" | "y";
12
+ type PhysicalSwipeDirection = "up" | "down" | "left" | "right";
13
+ type SwipePointerType = "mouse" | "pen" | "touch";
14
+ interface SwipeMoveDetails {
15
+ point: Point;
16
+ target: Element | null;
17
+ event: PointerEvent | TouchEvent;
18
+ pointerType: SwipePointerType;
19
+ axis: GestureAxis;
20
+ swipeDirection: PhysicalSwipeDirection;
21
+ }
22
+ interface SwipeEndDetails {
23
+ point: Point;
24
+ swipeDirection: PhysicalSwipeDirection;
25
+ }
26
+ interface SwipeStartDetails {
27
+ point: Point;
28
+ target: Element | null;
29
+ event: PointerEvent | TouchEvent;
30
+ pointerType: SwipePointerType;
31
+ axis: GestureAxis;
32
+ swipeDirection: PhysicalSwipeDirection;
33
+ }
34
+ interface SwipeInterruptDetails {
35
+ reason: "visibility-hidden" | "lost-pointer-capture";
36
+ event: Event | Document;
37
+ target: Element | null;
38
+ pointerType: SwipePointerType | null;
39
+ }
40
+ interface SwipeTrackingOptions {
41
+ getDoc: () => Document;
42
+ getSelectionTarget?: () => HTMLElement | null;
43
+ swipeDirection: PhysicalSwipeDirection;
44
+ onStart?: (details: SwipeStartDetails) => void;
45
+ onMove: (details: SwipeMoveDetails) => void;
46
+ onEnd: (details: SwipeEndDetails) => void;
47
+ onCancel: () => void;
48
+ preventDefault?: (details: SwipeMoveDetails) => boolean;
49
+ cancelOnInterrupt?: (details: SwipeInterruptDetails) => boolean;
50
+ }
51
+ interface PendingSwipeOptions {
52
+ getWin: () => Window;
53
+ pointerId: number;
54
+ startPoint: Point;
55
+ swipeDirection: PhysicalSwipeDirection;
56
+ onCommit: (point: Point) => void;
57
+ canCommit?: () => boolean;
58
+ onCancel?: () => void;
59
+ }
60
+ declare class SwipeSession {
61
+ private startPoint;
62
+ private velocity;
63
+ private samples;
64
+ private sampleStartIndex;
65
+ private gestureStartAxis;
66
+ private gestureStartTime;
67
+ private gestureSign;
68
+ private pendingSwipe;
69
+ setStartPoint(point: Point): void;
70
+ clearStartPoint(): void;
71
+ getStartPoint(): Point | null;
72
+ getGestureAxis(direction: PhysicalSwipeDirection): GestureAxis;
73
+ getGestureSign(direction: PhysicalSwipeDirection): number;
74
+ private getAxisValue;
75
+ getMainAxisDisplacement(point: Point, axis: GestureAxis, sign: number): number;
76
+ getCrossAxisDisplacement(point: Point, axis: GestureAxis): number;
77
+ track(point: Point, axis: GestureAxis, sign: number): void;
78
+ getReleaseVelocity(): number;
79
+ clearVelocityTracking(): void;
80
+ clear(): void;
81
+ startDeferredSwipe(options: PendingSwipeOptions): void;
82
+ cancelDeferredSwipe(): void;
83
+ bind(options: SwipeTrackingOptions): () => void;
84
+ }
85
+ //#endregion
86
+ //#region src/machines/drawer/utils/drawer-session.d.ts
87
+ interface ContentPointerDownOptions {
88
+ event: JSX.PointerEvent<HTMLElement>;
89
+ getDoc: () => Document;
90
+ getContentEl: () => HTMLElement | null;
91
+ getWin: () => Window;
92
+ swipeDirection: PhysicalSwipeDirection;
93
+ canCommit: () => boolean;
94
+ onCommit: (point: Point) => void;
95
+ }
96
+ interface GrabberPointerDownOptions {
97
+ event: JSX.PointerEvent<HTMLElement>;
98
+ point: Point;
99
+ canCommit: () => boolean;
100
+ onCommit: (point: Point) => void;
101
+ }
102
+ declare class DrawerSwipeSession {
103
+ readonly session: SwipeSession;
104
+ private dragOffset;
105
+ private readonly preventDragOnScroll;
106
+ constructor(options: DrawerSwipeSessionOptions);
107
+ contentPointerDown(options: ContentPointerDownOptions): void;
108
+ grabberPointerDown(options: GrabberPointerDownOptions): void;
109
+ private adjustReleaseVelocityAgainstDisplacement;
110
+ private adjustReleaseVelocityForOpenSwipe;
111
+ beginSwipe(point: Point): void;
112
+ clearSwipeStart(): void;
113
+ getSwipeStart(): Point | null;
114
+ getDragOffset(): number | null;
115
+ resetDragOffset(): void;
116
+ resetVelocity(): void;
117
+ reset(): void;
118
+ setDragOffset(point: Point, resolvedActiveSnapPointOffset: number, direction: PhysicalSwipeDirection): void;
119
+ setSwipeOpenOffset(point: Point, contentSize: number, direction: PhysicalSwipeDirection): void;
120
+ canStartDrag(point: Point, target: EventTarget | null, container: HTMLElement | null, preventDragOnScroll: boolean, direction: PhysicalSwipeDirection): boolean;
121
+ resolveSnapPointOnRelease(snapPoints: ResolvedSnapPoint[], snapPoint: ResolvedSnapPoint | null, snapToSequentialPoints: boolean, contentSize: number): number | string | null;
122
+ shouldOpenOnRelease(contentSize: number | null, swipeVelocityThreshold: number, openThreshold: number): boolean;
123
+ shouldDismissOnRelease(contentSize: number | null, snapPoints: ResolvedSnapPoint[], resolvedSnapOffset: number): boolean;
124
+ getSwipeStrength(targetOffset: number, resolvedSnapOffset?: number | null): number;
125
+ bindDragTracking(options: DragTrackingOptions): () => void;
126
+ bindSwipeOpenTracking(options: SwipeOpenTrackingOptions): () => void;
127
+ }
128
+ interface DrawerSwipeSessionOptions {
129
+ preventDragOnScroll: () => boolean;
130
+ }
131
+ interface DragTrackingOptions {
132
+ getDoc: () => Document;
133
+ getContentEl: () => HTMLElement | null;
134
+ getSwipeAreaEl: () => HTMLElement | null;
135
+ swipeDirection: PhysicalSwipeDirection;
136
+ onMove: (details: {
137
+ point: Point;
138
+ target: Element | null;
139
+ swipeDirection: PhysicalSwipeDirection;
140
+ }) => void;
141
+ onEnd: (details: {
142
+ point: Point;
143
+ swipeDirection: PhysicalSwipeDirection;
144
+ }) => void;
145
+ onCancel: () => void;
146
+ }
147
+ interface SwipeOpenTrackingOptions {
148
+ getDoc: () => Document;
149
+ getContentEl: () => HTMLElement | null;
150
+ getSwipeAreaEl: () => HTMLElement | null;
151
+ swipeDirection: PhysicalSwipeDirection;
152
+ onMove: (details: {
153
+ point: Point;
154
+ }) => void;
155
+ onEnd: (details: {
156
+ point: Point;
157
+ swipeDirection: PhysicalSwipeDirection;
158
+ }) => void;
159
+ onCancel: () => void;
160
+ }
161
+ //#endregion
162
+ //#region src/machines/drawer/drawer.types.d.ts
163
+ type SwipeDirection = "up" | "down" | "start" | "end";
164
+ type SnapPoint = number | string;
165
+ interface OpenChangeDetails {
166
+ open: boolean;
167
+ }
168
+ interface ResolvedSnapPoint {
169
+ value: SnapPoint;
170
+ height: number;
171
+ offset: number;
172
+ }
173
+ interface SnapPointChangeDetails {
174
+ snapPoint: SnapPoint | null;
175
+ }
176
+ interface DrawerStackSnapshot {
177
+ active: boolean;
178
+ openCount: number;
179
+ swipeProgress: number;
180
+ frontmostHeight: number;
181
+ }
182
+ interface DrawerStack {
183
+ getSnapshot(): DrawerStackSnapshot;
184
+ subscribe(listener: () => void): () => void;
185
+ register(id: string): void;
186
+ unregister(id: string): void;
187
+ setOpen(id: string, open: boolean): void;
188
+ setHeight(id: string, height: number): void;
189
+ setSwipe(id: string, swiping: boolean, progress: number): void;
190
+ }
191
+ interface DrawerStackApi<T extends PropTypes = PropTypes> {
192
+ getIndentProps(): T["element"];
193
+ getIndentBackgroundProps(): T["element"];
194
+ }
195
+ type ElementIds = Partial<{
196
+ backdrop: string;
197
+ positioner: string;
198
+ content: string;
199
+ title: string;
200
+ description: string;
201
+ header: string;
202
+ trigger: string;
203
+ grabber: string;
204
+ grabberIndicator: string;
205
+ closeTrigger: string;
206
+ swipeArea: string;
207
+ }>;
208
+ interface DrawerProps extends DirectionProperty, CommonProperties, DismissableElementHandlers {
209
+ ids?: ElementIds;
210
+ trapFocus?: boolean | undefined;
211
+ preventScroll?: boolean | undefined;
212
+ modal?: boolean | undefined;
213
+ initialFocusEl?: (() => MaybeElement) | undefined;
214
+ finalFocusEl?: (() => MaybeElement) | undefined;
215
+ restoreFocus?: boolean | undefined;
216
+ role?: "dialog" | "alertdialog" | undefined;
217
+ open?: boolean | undefined;
218
+ defaultOpen?: boolean | undefined;
219
+ onOpenChange?: ((details: OpenChangeDetails) => void) | undefined;
220
+ closeOnInteractOutside?: boolean | undefined;
221
+ closeOnEscape?: boolean | undefined;
222
+ snapPoints?: SnapPoint[] | undefined;
223
+ swipeDirection?: SwipeDirection | undefined;
224
+ snapToSequentialPoints?: boolean | undefined;
225
+ swipeVelocityThreshold?: number;
226
+ closeThreshold?: number;
227
+ preventDragOnScroll?: boolean;
228
+ snapPoint?: SnapPoint | null | undefined;
229
+ defaultSnapPoint?: SnapPoint | null | undefined;
230
+ onSnapPointChange?: ((details: SnapPointChangeDetails) => void) | undefined;
231
+ stack?: DrawerStack | undefined;
232
+ }
233
+ type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "trapFocus" | "restoreFocus" | "preventScroll" | "initialFocusEl" | "snapPoints" | "swipeDirection" | "snapToSequentialPoints" | "swipeVelocityThreshold" | "closeThreshold" | "preventDragOnScroll" | "defaultSnapPoint";
234
+ interface DrawerSchema {
235
+ props: RequiredBy<DrawerProps, PropsWithDefault>;
236
+ state: "open" | "closed" | "closing" | "swipe-area-dragging" | "swiping-open";
237
+ tag: "open" | "closed";
238
+ context: {
239
+ dragOffset: number | null;
240
+ snapPoint: SnapPoint | null;
241
+ resolvedActiveSnapPoint: ResolvedSnapPoint | null;
242
+ contentSize: number | null;
243
+ viewportSize: number;
244
+ rootFontSize: number;
245
+ swipeStrength: number;
246
+ rendered: {
247
+ title: boolean;
248
+ description: boolean;
249
+ };
250
+ };
251
+ refs: {
252
+ swipeSession: DrawerSwipeSession;
253
+ };
254
+ computed: {
255
+ drawerId: string;
256
+ physicalSwipeDirection: PhysicalSwipeDirection;
257
+ resolvedSnapPoints: ResolvedSnapPoint[];
258
+ };
259
+ event: EventObject;
260
+ action: string;
261
+ guard: string;
262
+ effect: string;
263
+ }
264
+ type DrawerService = Service<DrawerSchema>;
265
+ type DrawerMachine = Machine<DrawerSchema>;
266
+ interface ContentProps {
267
+ draggable?: boolean | undefined;
268
+ }
269
+ interface SwipeAreaProps {
270
+ disabled?: boolean | undefined;
271
+ swipeDirection?: SwipeDirection | undefined;
272
+ }
273
+ interface DrawerApi<T extends PropTypes = PropTypes> {
274
+ open: boolean;
275
+ dragging: boolean;
276
+ setOpen: (open: boolean) => void;
277
+ snapPoints: SnapPoint[];
278
+ swipeDirection: SwipeDirection;
279
+ snapPoint: SnapPoint | null;
280
+ setSnapPoint: (snapPoint: SnapPoint | null) => void;
281
+ getOpenPercentage: () => number;
282
+ getSnapPointIndex: () => number;
283
+ getContentSize: () => number | null;
284
+ getPositionerProps: () => T["element"];
285
+ getContentProps: (props?: ContentProps) => T["element"];
286
+ getTitleProps: () => T["element"];
287
+ getDescriptionProps: () => T["element"];
288
+ getTriggerProps: () => T["element"];
289
+ getBackdropProps: () => T["element"];
290
+ getGrabberProps: () => T["element"];
291
+ getGrabberIndicatorProps: () => T["element"];
292
+ getCloseTriggerProps: () => T["element"];
293
+ getSwipeAreaProps: (props?: SwipeAreaProps) => T["element"];
294
+ }
295
+ //#endregion
296
+ //#region src/machines/drawer/drawer.connect.d.ts
297
+ declare function connect<T extends PropTypes>(service: DrawerService, normalize: NormalizeProps<T>): DrawerApi<T>;
298
+ //#endregion
299
+ //#region src/machines/drawer/drawer.machine.d.ts
300
+ declare const machine: Machine<DrawerSchema>;
301
+ //#endregion
302
+ //#region src/machines/drawer/drawer.props.d.ts
303
+ declare const props: (keyof DrawerProps)[];
304
+ declare const splitProps: <Props extends Partial<DrawerProps>>(props: Props) => [Partial<DrawerProps>, Omit<Props, keyof DrawerProps>];
305
+ //#endregion
306
+ //#region src/machines/drawer/drawer.stack.d.ts
307
+ declare function createStack(): DrawerStack;
308
+ declare function connectStack<T extends PropTypes>(snapshot: DrawerStackSnapshot, normalize: NormalizeProps<T>): DrawerStackApi<T>;
309
+ //#endregion
310
+ export { type DrawerApi as Api, type ContentProps, type DrawerStack, type DrawerStackApi, type DrawerStackSnapshot, type ElementIds, type FocusOutsideEvent, type InteractOutsideEvent, type DrawerMachine as Machine, type OpenChangeDetails, type PointerDownOutsideEvent, type DrawerProps as Props, type ResolvedSnapPoint, type DrawerService as Service, type SnapPoint, type SnapPointChangeDetails, type SwipeDirection, anatomy, connect, connectStack, createStack, machine, props, splitProps };