@kanso-labs/react-native-kanso-ui 0.3.1 → 0.5.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 (123) hide show
  1. package/dist/autocomplete/index.js +39 -0
  2. package/dist/autocomplete/index.js.map +1 -0
  3. package/dist/button/index.d.ts +2 -1
  4. package/dist/button/index.js +35 -2
  5. package/dist/button/index.js.map +1 -1
  6. package/dist/button/pending.js +1 -1
  7. package/dist/button/slots.d.ts +2 -0
  8. package/dist/button/slots.js.map +1 -1
  9. package/dist/chip/index.js +1 -1
  10. package/dist/components/autocomplete/index.d.ts +49 -0
  11. package/dist/components/autocomplete/index.js +87 -0
  12. package/dist/components/autocomplete/index.js.map +1 -0
  13. package/dist/components/avatar/index.d.ts +1 -1
  14. package/dist/components/button/index.d.ts +2 -2
  15. package/dist/components/button/index.js +196 -150
  16. package/dist/components/button/index.js.map +1 -1
  17. package/dist/components/card/index.d.ts +1 -1
  18. package/dist/components/card/index.js +1 -1
  19. package/dist/components/checkbox/index.d.ts +1 -1
  20. package/dist/components/checkbox/index.js +106 -193
  21. package/dist/components/checkbox/index.js.map +1 -1
  22. package/dist/components/chip/index.d.ts +1 -1
  23. package/dist/components/chip-group/index.d.ts +1 -1
  24. package/dist/components/chip-group/index.js +1 -1
  25. package/dist/components/copy-field/index.d.ts +1 -1
  26. package/dist/components/copy-field/index.js +1 -1
  27. package/dist/components/currency/index.d.ts +1 -1
  28. package/dist/components/currency/index.js +1 -1
  29. package/dist/components/dialog/index.d.ts +3 -2
  30. package/dist/components/dialog/index.js +105 -242
  31. package/dist/components/dialog/index.js.map +1 -1
  32. package/dist/components/icon-button/index.d.ts +2 -2
  33. package/dist/components/icon-button/index.js +205 -159
  34. package/dist/components/icon-button/index.js.map +1 -1
  35. package/dist/components/link/index.d.ts +1 -1
  36. package/dist/components/link/index.js +1 -1
  37. package/dist/components/list/index.d.ts +216 -0
  38. package/dist/components/list/index.js +1118 -0
  39. package/dist/components/list/index.js.map +1 -0
  40. package/dist/components/list-item/index.d.ts +63 -0
  41. package/dist/components/list-item/index.js +275 -0
  42. package/dist/components/list-item/index.js.map +1 -0
  43. package/dist/components/menu/index.d.ts +309 -0
  44. package/dist/components/menu/index.js +1283 -0
  45. package/dist/components/menu/index.js.map +1 -0
  46. package/dist/components/meter/index.d.ts +1 -1
  47. package/dist/components/meter/index.js +1 -1
  48. package/dist/components/number-field/index.d.ts +1 -1
  49. package/dist/components/number-field/index.js +2 -2
  50. package/dist/components/popover/index.d.ts +140 -0
  51. package/dist/components/popover/index.js +704 -0
  52. package/dist/components/popover/index.js.map +1 -0
  53. package/dist/components/product-icon/index.d.ts +1 -1
  54. package/dist/components/progress-indicator/index.d.ts +1 -1
  55. package/dist/components/progress-indicator/index.js +1 -1
  56. package/dist/components/radio-group/index.d.ts +1 -1
  57. package/dist/components/radio-group/index.js +1 -1
  58. package/dist/components/search-field/index.d.ts +12 -4
  59. package/dist/components/search-field/index.js +64 -58
  60. package/dist/components/search-field/index.js.map +1 -1
  61. package/dist/components/segmented-button/index.d.ts +1 -1
  62. package/dist/components/segmented-button/index.js +1 -1
  63. package/dist/components/separator/index.d.ts +1 -1
  64. package/dist/components/separator/index.js +1 -1
  65. package/dist/components/sheet/index.d.ts +137 -0
  66. package/dist/components/sheet/index.js +1091 -0
  67. package/dist/components/sheet/index.js.map +1 -0
  68. package/dist/components/snackbar/index.d.ts +1 -1
  69. package/dist/components/snackbar/index.js +1 -1
  70. package/dist/components/stack/index.d.ts +1 -1
  71. package/dist/components/stack/index.js +1 -1
  72. package/dist/components/switch/index.d.ts +1 -1
  73. package/dist/components/switch/index.js +1 -1
  74. package/dist/components/switch/index.js.map +1 -1
  75. package/dist/components/text/index.d.ts +1 -1
  76. package/dist/components/text/index.js +1 -1
  77. package/dist/components/text-field/index.d.ts +1 -1
  78. package/dist/components/text-field/index.js +1 -1
  79. package/dist/control/checkbox-box.js +137 -0
  80. package/dist/control/checkbox-box.js.map +1 -0
  81. package/dist/control/index.js +1 -1
  82. package/dist/field/index.d.ts +1 -1
  83. package/dist/field/index.js +1 -1
  84. package/dist/form/index.d.ts +1 -1
  85. package/dist/glyphs/index.js +21 -2
  86. package/dist/glyphs/index.js.map +1 -1
  87. package/dist/i18n/index.js +16 -1
  88. package/dist/i18n/index.js.map +1 -1
  89. package/dist/i18n/messages.js +374 -34
  90. package/dist/i18n/messages.js.map +1 -1
  91. package/dist/index.d.ts +7 -1
  92. package/dist/index.js +8 -2
  93. package/dist/indicator/index.d.ts +1 -1
  94. package/dist/indicator/index.js +2 -2
  95. package/dist/mark/index.d.ts +1 -1
  96. package/dist/mark/index.js +1 -1
  97. package/dist/modal/index.d.ts +16 -0
  98. package/dist/modal/index.js +277 -0
  99. package/dist/modal/index.js.map +1 -0
  100. package/dist/overlay/anchored.d.ts +2 -0
  101. package/dist/overlay/anchored.js +182 -0
  102. package/dist/overlay/anchored.js.map +1 -0
  103. package/dist/overlay/host.d.ts +2 -0
  104. package/dist/overlay/host.js +1 -1
  105. package/dist/overlay/index.d.ts +4 -0
  106. package/dist/overlay/panel.js +215 -0
  107. package/dist/overlay/panel.js.map +1 -0
  108. package/dist/overlay/placement.d.ts +8 -0
  109. package/dist/overlay/placement.js +87 -0
  110. package/dist/overlay/placement.js.map +1 -0
  111. package/dist/press/index.js +1 -1
  112. package/dist/ref/index.js +15 -0
  113. package/dist/ref/index.js.map +1 -0
  114. package/dist/router/index.js +1 -1
  115. package/dist/row/index.js +158 -0
  116. package/dist/row/index.js.map +1 -0
  117. package/dist/row/styles.js +51 -0
  118. package/dist/row/styles.js.map +1 -0
  119. package/dist/theme/scope.js +1 -1
  120. package/dist/theme-scope.d.ts +1 -1
  121. package/dist/theme-scope.js +1 -1
  122. package/dist/typography/fonts.js +1 -1
  123. package/package.json +6 -6
@@ -0,0 +1,1091 @@
1
+ import { useTheme } from "../../theme/scope.js";
2
+ import { composeStyles, themedStyles } from "../../theme/styles.js";
3
+ import { useTypeRole } from "../../typography/roles.js";
4
+ import { refsOf } from "../../ref/index.js";
5
+ import { ButtonSlotContext } from "../../button/slots.js";
6
+ import { messagesFor } from "../../i18n/index.js";
7
+ import { usePressFeedback } from "../../press/index.js";
8
+ import { useWindowSizeClass } from "../../hooks/useWindowSizeClass.js";
9
+ import { ModalWindow, NO_INSETS, insetsOf, panelRoleOf, useModalState, useModalTrigger } from "../../modal/index.js";
10
+ import { c } from "react/compiler-runtime";
11
+ import { createContext, use, useEffect, useId, useState } from "react";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+ import { I18nManager, Pressable, ScrollView, StyleSheet, Text, View, useWindowDimensions } from "react-native";
14
+ import Animated, { Easing, useAnimatedStyle, useReducedMotion, useSharedValue, withTiming } from "react-native-reanimated";
15
+ import { SafeAreaInsetsContext } from "react-native-safe-area-context";
16
+ import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
17
+ //#region src/components/sheet/index.tsx
18
+ const SIDE_WIDTH = 400;
19
+ const TOP_MARGIN = 72;
20
+ const PARTIAL = .5;
21
+ const DRAG_SLOP = 8;
22
+ const FLING = 500;
23
+ const BAR_WIDTH = 32;
24
+ const BAR_HEIGHT = 4;
25
+ const BAR_SPACE = 22;
26
+ const BAR_SIDE = 8;
27
+ const stylesOf = themedStyles(({ colors, radii, shadows, spacing }) => StyleSheet.create({
28
+ bar: {
29
+ backgroundColor: colors.onSurfaceVariant,
30
+ borderRadius: radii.pill,
31
+ height: BAR_HEIGHT,
32
+ width: BAR_WIDTH
33
+ },
34
+ body: {
35
+ gap: spacing.lg,
36
+ paddingHorizontal: spacing.xl,
37
+ paddingVertical: spacing.lg
38
+ },
39
+ bodyText: { color: colors.onSurfaceVariant },
40
+ container: {
41
+ backgroundColor: colors.surfaceContainerLow,
42
+ boxShadow: shadows.elevation1,
43
+ overflow: "hidden"
44
+ },
45
+ containerBottom: {
46
+ borderTopLeftRadius: radii.xl,
47
+ borderTopRightRadius: radii.xl,
48
+ width: "100%"
49
+ },
50
+ containerSide: {
51
+ borderBottomStartRadius: radii.lg,
52
+ borderTopStartRadius: radii.lg,
53
+ flex: 1
54
+ },
55
+ footer: {
56
+ alignItems: "center",
57
+ borderTopColor: colors.outlineVariant,
58
+ borderTopWidth: 1,
59
+ flexDirection: "row",
60
+ flexShrink: 0,
61
+ flexWrap: "wrap",
62
+ gap: spacing.sm,
63
+ justifyContent: "flex-start",
64
+ minHeight: 72,
65
+ paddingBottom: spacing.xl,
66
+ paddingHorizontal: spacing.xl,
67
+ paddingTop: spacing.lg
68
+ },
69
+ handle: {
70
+ alignItems: "center",
71
+ alignSelf: "center",
72
+ borderRadius: radii.pill,
73
+ flexShrink: 0,
74
+ paddingHorizontal: BAR_SIDE,
75
+ paddingVertical: BAR_SPACE
76
+ },
77
+ header: {
78
+ alignItems: "center",
79
+ borderBottomColor: colors.outlineVariant,
80
+ borderBottomWidth: 1,
81
+ flexDirection: "row",
82
+ flexShrink: 0,
83
+ gap: spacing.md,
84
+ justifyContent: "space-between",
85
+ paddingHorizontal: spacing.xl,
86
+ paddingVertical: spacing.sm
87
+ },
88
+ rootBottom: {
89
+ bottom: 0,
90
+ left: 0,
91
+ position: "absolute",
92
+ right: 0
93
+ },
94
+ rootSide: {
95
+ bottom: 0,
96
+ end: 0,
97
+ maxWidth: "100%",
98
+ position: "absolute",
99
+ top: 0,
100
+ width: SIDE_WIDTH
101
+ },
102
+ title: {
103
+ color: colors.onSurfaceVariant,
104
+ flexShrink: 1,
105
+ minWidth: 0
106
+ }
107
+ }));
108
+ const SheetLayoutContext = createContext(null);
109
+ const SheetTriggerContext = createContext(null);
110
+ function bottomBoundsOf(insets, height) {
111
+ return {
112
+ ...insetsOf(insets),
113
+ maxHeight: height - Math.max(TOP_MARGIN, insets.top),
114
+ paddingTop: 0
115
+ };
116
+ }
117
+ /**
118
+ * Where a bottom sheet let go comes to rest: one height on in the direction of
119
+ * a fling, and the nearest height otherwise. Heights are how far the panel is
120
+ * moved down, highest first, and the highest is always the whole sheet, 0.
121
+ */
122
+ function settleOf(at, velocity, settles) {
123
+ if (velocity > FLING) return settles.find((stop) => stop > at) ?? settles.at(-1) ?? 0;
124
+ if (velocity < -500) return settles.findLast((stop) => stop < at) ?? 0;
125
+ return settles.reduce((nearest, stop) => Math.abs(stop - at) < Math.abs(nearest - at) ? stop : nearest, 0);
126
+ }
127
+ /**
128
+ * A modal sheet along an edge of the screen, the bottom sheets and side sheets
129
+ * spec pages' modal sheets, paired by window size as kanso-ui's are: a bottom
130
+ * sheet in a compact window, dragged between heights and swiped down to go,
131
+ * and a side sheet along the end edge from the medium window up. Pass
132
+ * `isOpen` with `onOpenChange` to hold the open state, or `defaultOpen` to let
133
+ * it keep its own.
134
+ *
135
+ * ```tsx
136
+ * <Sheet>
137
+ * <Button>Open</Button>
138
+ * <Sheet.Content>
139
+ * <Sheet.Handle />
140
+ * <Sheet.Header>
141
+ * <Sheet.Title>Headline</Sheet.Title>
142
+ * </Sheet.Header>
143
+ * <Sheet.Body>Supporting text</Sheet.Body>
144
+ * <Sheet.Footer>
145
+ * <Button slot="close">Done</Button>
146
+ * </Sheet.Footer>
147
+ * </Sheet.Content>
148
+ * </Sheet>
149
+ * ```
150
+ *
151
+ * Composed rather than configured by props, as web's is. A `Button` or
152
+ * `IconButton` inside `Sheet` and outside its content opens it, and one given
153
+ * `slot="close"` anywhere inside the content closes it. A sheet nothing on the
154
+ * screen opens leaves `Sheet` out and passes `isOpen` and `onOpenChange` to
155
+ * `Sheet.Content` instead.
156
+ */
157
+ function Sheet(t0) {
158
+ const $ = c(10);
159
+ const { children, defaultOpen, isOpen, onOpenChange } = t0;
160
+ let t1;
161
+ if ($[0] !== defaultOpen || $[1] !== isOpen || $[2] !== onOpenChange) {
162
+ t1 = {
163
+ defaultOpen,
164
+ isOpen,
165
+ onOpenChange
166
+ };
167
+ $[0] = defaultOpen;
168
+ $[1] = isOpen;
169
+ $[2] = onOpenChange;
170
+ $[3] = t1;
171
+ } else t1 = $[3];
172
+ const { context, slots } = useModalTrigger(t1);
173
+ let t2;
174
+ if ($[4] !== children || $[5] !== slots) {
175
+ t2 = /* @__PURE__ */ jsx(ButtonSlotContext, {
176
+ value: slots,
177
+ children
178
+ });
179
+ $[4] = children;
180
+ $[5] = slots;
181
+ $[6] = t2;
182
+ } else t2 = $[6];
183
+ let t3;
184
+ if ($[7] !== context || $[8] !== t2) {
185
+ t3 = /* @__PURE__ */ jsx(SheetTriggerContext, {
186
+ value: context,
187
+ children: t2
188
+ });
189
+ $[7] = context;
190
+ $[8] = t2;
191
+ $[9] = t3;
192
+ } else t3 = $[9];
193
+ return t3;
194
+ }
195
+ /**
196
+ * What the sheet shows, as a body that scrolls when its content runs past the
197
+ * room it has. A string is drawn in body medium on on-surface variant;
198
+ * anything else draws itself. `style`, `ref` and `testID` land on the
199
+ * `ScrollView`.
200
+ *
201
+ * A body its content runs past takes focus, as web's is a tab stop, so a
202
+ * keyboard can scroll it when nothing inside it takes focus; a call site's
203
+ * own `focusable` still wins. A bottom sheet's body scrolls only once the
204
+ * sheet is at its whole height, and holds the sheet's drag off while it does.
205
+ */
206
+ function SheetBody(t0) {
207
+ const $ = c(28);
208
+ let children;
209
+ let contentContainerStyle;
210
+ let onContentSizeChange;
211
+ let onLayout;
212
+ let props;
213
+ let t1;
214
+ if ($[0] !== t0) {
215
+ ({children, contentContainerStyle, onContentSizeChange, onLayout, scrollEnabled: t1, ...props} = t0);
216
+ $[0] = t0;
217
+ $[1] = children;
218
+ $[2] = contentContainerStyle;
219
+ $[3] = onContentSizeChange;
220
+ $[4] = onLayout;
221
+ $[5] = props;
222
+ $[6] = t1;
223
+ } else {
224
+ children = $[1];
225
+ contentContainerStyle = $[2];
226
+ onContentSizeChange = $[3];
227
+ onLayout = $[4];
228
+ props = $[5];
229
+ t1 = $[6];
230
+ }
231
+ const scrollEnabled = t1 === void 0 ? true : t1;
232
+ const layout = useLayout("Sheet.Body");
233
+ const styles = stylesOf(useTheme());
234
+ const text = useTypeRole("bodyMedium");
235
+ const [content, setContent] = useState(0);
236
+ const [room, setRoom] = useState(0);
237
+ let t2;
238
+ if ($[7] !== onContentSizeChange) {
239
+ t2 = (width, height) => {
240
+ setContent(height);
241
+ onContentSizeChange?.(width, height);
242
+ };
243
+ $[7] = onContentSizeChange;
244
+ $[8] = t2;
245
+ } else t2 = $[8];
246
+ const measureContent = t2;
247
+ let t3;
248
+ if ($[9] !== onLayout) {
249
+ t3 = (event) => {
250
+ setRoom(event.nativeEvent.layout.height);
251
+ onLayout?.(event);
252
+ };
253
+ $[9] = onLayout;
254
+ $[10] = t3;
255
+ } else t3 = $[10];
256
+ const measureRoom = t3;
257
+ const scrolls = scrollEnabled && layout.expanded;
258
+ const overflows = content > room;
259
+ let t4;
260
+ if ($[11] !== layout.pan || $[12] !== overflows || $[13] !== scrolls) {
261
+ t4 = Gesture.Native().enabled(scrolls && overflows).blocksExternalGesture(layout.pan);
262
+ $[11] = layout.pan;
263
+ $[12] = overflows;
264
+ $[13] = scrolls;
265
+ $[14] = t4;
266
+ } else t4 = $[14];
267
+ const native = t4;
268
+ const T0 = GestureDetector;
269
+ const T1 = ScrollView;
270
+ const t5 = scrolls && overflows;
271
+ const t6 = composeStyles(styles.body, contentContainerStyle);
272
+ const t7 = typeof children === "string" ? /* @__PURE__ */ jsx(Text, {
273
+ style: composeStyles(text, styles.bodyText),
274
+ children
275
+ }) : children;
276
+ let t8;
277
+ if ($[15] !== T1 || $[16] !== measureContent || $[17] !== measureRoom || $[18] !== props || $[19] !== scrolls || $[20] !== t5 || $[21] !== t6 || $[22] !== t7) {
278
+ t8 = /* @__PURE__ */ jsx(T1, {
279
+ focusable: t5,
280
+ onContentSizeChange: measureContent,
281
+ onLayout: measureRoom,
282
+ ...props,
283
+ contentContainerStyle: t6,
284
+ scrollEnabled: scrolls,
285
+ children: t7
286
+ });
287
+ $[15] = T1;
288
+ $[16] = measureContent;
289
+ $[17] = measureRoom;
290
+ $[18] = props;
291
+ $[19] = scrolls;
292
+ $[20] = t5;
293
+ $[21] = t6;
294
+ $[22] = t7;
295
+ $[23] = t8;
296
+ } else t8 = $[23];
297
+ let t9;
298
+ if ($[24] !== T0 || $[25] !== native || $[26] !== t8) {
299
+ t9 = /* @__PURE__ */ jsx(T0, {
300
+ gesture: native,
301
+ children: t8
302
+ });
303
+ $[24] = T0;
304
+ $[25] = native;
305
+ $[26] = t8;
306
+ $[27] = t9;
307
+ } else t9 = $[27];
308
+ return t9;
309
+ }
310
+ /**
311
+ * The sheet itself, and the scrim behind it. Everything the sheet shows goes
312
+ * in here; the button that opens it stays outside it.
313
+ *
314
+ * Inside `Sheet`, the open state is the trigger's. On its own it is this
315
+ * part's: `isOpen` with `onOpenChange` holds it, and a `slot="close"` button,
316
+ * the scrim, the swipe and the back gesture all report through
317
+ * `onOpenChange`. `style`, `ref` and `testID` land on the container, and
318
+ * `testID` names the drag `<testID>-drag` for Gesture Handler's test helpers.
319
+ */
320
+ function SheetContent(t0) {
321
+ const $ = c(19);
322
+ let defaultOpen;
323
+ let isOpen;
324
+ let onOpenChange;
325
+ let props;
326
+ let t1;
327
+ let t2;
328
+ if ($[0] !== t0) {
329
+ ({defaultOpen, isDismissable: t1, isKeyboardDismissDisabled: t2, isOpen, onOpenChange, ...props} = t0);
330
+ $[0] = t0;
331
+ $[1] = defaultOpen;
332
+ $[2] = isOpen;
333
+ $[3] = onOpenChange;
334
+ $[4] = props;
335
+ $[5] = t1;
336
+ $[6] = t2;
337
+ } else {
338
+ defaultOpen = $[1];
339
+ isOpen = $[2];
340
+ onOpenChange = $[3];
341
+ props = $[4];
342
+ t1 = $[5];
343
+ t2 = $[6];
344
+ }
345
+ const isDismissable = t1 === void 0 ? true : t1;
346
+ const isKeyboardDismissDisabled = t2 === void 0 ? false : t2;
347
+ const outer = use(SheetTriggerContext);
348
+ let t3;
349
+ if ($[7] !== defaultOpen || $[8] !== isOpen || $[9] !== onOpenChange) {
350
+ t3 = {
351
+ defaultOpen,
352
+ isOpen,
353
+ onOpenChange
354
+ };
355
+ $[7] = defaultOpen;
356
+ $[8] = isOpen;
357
+ $[9] = onOpenChange;
358
+ $[10] = t3;
359
+ } else t3 = $[10];
360
+ const { close, present, setPresent, slots, state } = useModalState(outer, t3);
361
+ if (!present) return null;
362
+ let t4;
363
+ if ($[11] !== close || $[12] !== isDismissable || $[13] !== isKeyboardDismissDisabled || $[14] !== props || $[15] !== setPresent || $[16] !== slots || $[17] !== state.isOpen) {
364
+ t4 = /* @__PURE__ */ jsx(SheetWindow, {
365
+ ...props,
366
+ close,
367
+ isDismissable,
368
+ isKeyboardDismissDisabled,
369
+ isOpen: state.isOpen,
370
+ setPresent,
371
+ slots
372
+ });
373
+ $[11] = close;
374
+ $[12] = isDismissable;
375
+ $[13] = isKeyboardDismissDisabled;
376
+ $[14] = props;
377
+ $[15] = setPresent;
378
+ $[16] = slots;
379
+ $[17] = state.isOpen;
380
+ $[18] = t4;
381
+ } else t4 = $[18];
382
+ return t4;
383
+ }
384
+ /**
385
+ * The sheet's actions, leading and wrapping onto another row when they do not
386
+ * fit on one, over a divider. On a bottom sheet at half height they are below
387
+ * the fold until the sheet is raised. `style`, `ref` and `testID` land on its
388
+ * view.
389
+ */
390
+ function SheetFooter(t0) {
391
+ const $ = c(7);
392
+ let props;
393
+ let style;
394
+ if ($[0] !== t0) {
395
+ ({style, ...props} = t0);
396
+ $[0] = t0;
397
+ $[1] = props;
398
+ $[2] = style;
399
+ } else {
400
+ props = $[1];
401
+ style = $[2];
402
+ }
403
+ useLayout("Sheet.Footer");
404
+ const styles = stylesOf(useTheme());
405
+ const T0 = View;
406
+ const t1 = composeStyles(styles.footer, style);
407
+ let t2;
408
+ if ($[3] !== T0 || $[4] !== props || $[5] !== t1) {
409
+ t2 = /* @__PURE__ */ jsx(T0, {
410
+ ...props,
411
+ style: t1
412
+ });
413
+ $[3] = T0;
414
+ $[4] = props;
415
+ $[5] = t1;
416
+ $[6] = t2;
417
+ } else t2 = $[6];
418
+ return t2;
419
+ }
420
+ /**
421
+ * The bottom sheet's drag handle, a 32 by 4dp bar centred along its top edge.
422
+ * Where the sheet has two heights it is a button moving it to the other one,
423
+ * named "Drag handle" in the device's locale unless `aria-label` says
424
+ * otherwise; elsewhere it is a mark a screen reader skips. A side sheet draws
425
+ * none. `style`, `ref` and `testID` land on its view.
426
+ */
427
+ function SheetHandle(t0) {
428
+ const $ = c(23);
429
+ let label;
430
+ let props;
431
+ let style;
432
+ if ($[0] !== t0) {
433
+ ({"aria-label": label, style, ...props} = t0);
434
+ $[0] = t0;
435
+ $[1] = label;
436
+ $[2] = props;
437
+ $[3] = style;
438
+ } else {
439
+ label = $[1];
440
+ props = $[2];
441
+ style = $[3];
442
+ }
443
+ const layout = useLayout("Sheet.Handle");
444
+ const theme = useTheme();
445
+ const styles = stylesOf(theme);
446
+ const { colors, radii } = theme;
447
+ let t1;
448
+ if ($[4] !== radii.pill) {
449
+ t1 = { borderRadius: radii.pill };
450
+ $[4] = radii.pill;
451
+ $[5] = t1;
452
+ } else t1 = $[5];
453
+ let t2;
454
+ if ($[6] !== colors.onSurfaceVariant || $[7] !== t1) {
455
+ t2 = {
456
+ color: colors.onSurfaceVariant,
457
+ corners: t1
458
+ };
459
+ $[6] = colors.onSurfaceVariant;
460
+ $[7] = t1;
461
+ $[8] = t2;
462
+ } else t2 = $[8];
463
+ const feedback = usePressFeedback(t2);
464
+ const { toggle } = layout;
465
+ if (!layout.bottom) return null;
466
+ if (toggle === void 0) return /* @__PURE__ */ jsx(View, {
467
+ "aria-hidden": true,
468
+ ...props,
469
+ style: composeStyles(styles.handle, style),
470
+ children: /* @__PURE__ */ jsx(View, { style: styles.bar })
471
+ });
472
+ const T0 = Pressable;
473
+ const t3 = layout.expanded;
474
+ let t4;
475
+ if ($[9] !== label) {
476
+ t4 = label ?? messagesFor().dragHandle;
477
+ $[9] = label;
478
+ $[10] = t4;
479
+ } else t4 = $[10];
480
+ const t5 = "button";
481
+ const t6 = feedback.handlers;
482
+ const t7 = composeStyles(styles.handle, feedback.ring, style);
483
+ let t8;
484
+ if ($[11] !== styles.bar) {
485
+ t8 = /* @__PURE__ */ jsx(View, { style: styles.bar });
486
+ $[11] = styles.bar;
487
+ $[12] = t8;
488
+ } else t8 = $[12];
489
+ let t9;
490
+ if ($[13] !== T0 || $[14] !== feedback.handlers || $[15] !== feedback.layer || $[16] !== layout.expanded || $[17] !== props || $[18] !== t4 || $[19] !== t7 || $[20] !== t8 || $[21] !== toggle) {
491
+ t9 = /* @__PURE__ */ jsxs(T0, {
492
+ "aria-expanded": t3,
493
+ "aria-label": t4,
494
+ role: t5,
495
+ ...props,
496
+ ...t6,
497
+ onPress: toggle,
498
+ style: t7,
499
+ children: [feedback.layer, t8]
500
+ });
501
+ $[13] = T0;
502
+ $[14] = feedback.handlers;
503
+ $[15] = feedback.layer;
504
+ $[16] = layout.expanded;
505
+ $[17] = props;
506
+ $[18] = t4;
507
+ $[19] = t7;
508
+ $[20] = t8;
509
+ $[21] = toggle;
510
+ $[22] = t9;
511
+ } else t9 = $[22];
512
+ return t9;
513
+ }
514
+ /**
515
+ * The sheet's header: its `Sheet.Title`, and anything beside it, such as a
516
+ * close button, over a divider. `style`, `ref` and `testID` land on its view.
517
+ */
518
+ function SheetHeader(t0) {
519
+ const $ = c(7);
520
+ let props;
521
+ let style;
522
+ if ($[0] !== t0) {
523
+ ({style, ...props} = t0);
524
+ $[0] = t0;
525
+ $[1] = props;
526
+ $[2] = style;
527
+ } else {
528
+ props = $[1];
529
+ style = $[2];
530
+ }
531
+ useLayout("Sheet.Header");
532
+ const styles = stylesOf(useTheme());
533
+ const T0 = View;
534
+ const t1 = composeStyles(styles.header, style);
535
+ let t2;
536
+ if ($[3] !== T0 || $[4] !== props || $[5] !== t1) {
537
+ t2 = /* @__PURE__ */ jsx(T0, {
538
+ ...props,
539
+ style: t1
540
+ });
541
+ $[3] = T0;
542
+ $[4] = props;
543
+ $[5] = t1;
544
+ $[6] = t2;
545
+ } else t2 = $[6];
546
+ return t2;
547
+ }
548
+ /**
549
+ * Names the sheet: the container is labelled by it, and a screen reader is
550
+ * sent to it once the sheet shows. In title large on on-surface variant.
551
+ * `style`, `ref` and `testID` land on React Native's own Text.
552
+ */
553
+ function SheetTitle(t0) {
554
+ const $ = c(13);
555
+ let props;
556
+ let ref;
557
+ let style;
558
+ if ($[0] !== t0) {
559
+ ({ref, style, ...props} = t0);
560
+ $[0] = t0;
561
+ $[1] = props;
562
+ $[2] = ref;
563
+ $[3] = style;
564
+ } else {
565
+ props = $[1];
566
+ ref = $[2];
567
+ style = $[3];
568
+ }
569
+ const layout = useLayout("Sheet.Title");
570
+ const styles = stylesOf(useTheme());
571
+ const role = useTypeRole("titleLarge");
572
+ const T0 = Text;
573
+ const t1 = layout.titleId;
574
+ let t2;
575
+ if ($[4] !== layout.setTitle || $[5] !== ref) {
576
+ t2 = refsOf(layout.setTitle, ref);
577
+ $[4] = layout.setTitle;
578
+ $[5] = ref;
579
+ $[6] = t2;
580
+ } else t2 = $[6];
581
+ const t3 = "heading";
582
+ const t4 = composeStyles(role, styles.title, style);
583
+ let t5;
584
+ if ($[7] !== T0 || $[8] !== layout.titleId || $[9] !== props || $[10] !== t2 || $[11] !== t4) {
585
+ t5 = /* @__PURE__ */ jsx(T0, {
586
+ ...props,
587
+ nativeID: t1,
588
+ ref: t2,
589
+ role: t3,
590
+ style: t4
591
+ });
592
+ $[7] = T0;
593
+ $[8] = layout.titleId;
594
+ $[9] = props;
595
+ $[10] = t2;
596
+ $[11] = t4;
597
+ $[12] = t5;
598
+ } else t5 = $[12];
599
+ return t5;
600
+ }
601
+ /**
602
+ * The open sheet, mounted from the moment it opens until its exit has run, so
603
+ * each opening starts from its edge and at its first height.
604
+ */
605
+ function SheetWindow(t0) {
606
+ const $ = c(76);
607
+ let children;
608
+ let close;
609
+ let isDismissable;
610
+ let isKeyboardDismissDisabled;
611
+ let isOpen;
612
+ let onLayout;
613
+ let props;
614
+ let setPresent;
615
+ let slots;
616
+ let style;
617
+ let testID;
618
+ if ($[0] !== t0) {
619
+ ({children, close, isDismissable, isKeyboardDismissDisabled, isOpen, onLayout, setPresent, slots, style, testID, ...props} = t0);
620
+ $[0] = t0;
621
+ $[1] = children;
622
+ $[2] = close;
623
+ $[3] = isDismissable;
624
+ $[4] = isKeyboardDismissDisabled;
625
+ $[5] = isOpen;
626
+ $[6] = onLayout;
627
+ $[7] = props;
628
+ $[8] = setPresent;
629
+ $[9] = slots;
630
+ $[10] = style;
631
+ $[11] = testID;
632
+ } else {
633
+ children = $[1];
634
+ close = $[2];
635
+ isDismissable = $[3];
636
+ isKeyboardDismissDisabled = $[4];
637
+ isOpen = $[5];
638
+ onLayout = $[6];
639
+ props = $[7];
640
+ setPresent = $[8];
641
+ slots = $[9];
642
+ style = $[10];
643
+ testID = $[11];
644
+ }
645
+ const styles = stylesOf(useTheme());
646
+ const insets = use(SafeAreaInsetsContext) ?? NO_INSETS;
647
+ const { height } = useWindowDimensions();
648
+ const bottom = useWindowSizeClass() === "compact";
649
+ const titleId = useId();
650
+ const [title, setTitle] = useState(null);
651
+ const [full, setFull] = useState(null);
652
+ const [expanded, setExpanded] = useState(false);
653
+ let t1;
654
+ if ($[12] !== bottom || $[13] !== full || $[14] !== height || $[15] !== isDismissable) {
655
+ t1 = stopsOf(bottom, full, height, isDismissable);
656
+ $[12] = bottom;
657
+ $[13] = full;
658
+ $[14] = height;
659
+ $[15] = isDismissable;
660
+ $[16] = t1;
661
+ } else t1 = $[16];
662
+ const stops = t1;
663
+ const twoHeights = stops.partial !== null;
664
+ const rest = stops.partial !== null && !expanded ? stops.partial : 0;
665
+ let t2;
666
+ if ($[17] !== bottom || $[18] !== full || $[19] !== isOpen || $[20] !== rest || $[21] !== setPresent) {
667
+ t2 = {
668
+ bottom,
669
+ full,
670
+ isOpen,
671
+ rest,
672
+ setPresent
673
+ };
674
+ $[17] = bottom;
675
+ $[18] = full;
676
+ $[19] = isOpen;
677
+ $[20] = rest;
678
+ $[21] = setPresent;
679
+ $[22] = t2;
680
+ } else t2 = $[22];
681
+ const motion = useSheetMotion(t2);
682
+ const t3 = bottom && isOpen && stops.settles.length > 1;
683
+ let t4;
684
+ if ($[23] !== close || $[24] !== expanded || $[25] !== full || $[26] !== isDismissable || $[27] !== motion.offset || $[28] !== rest || $[29] !== stops || $[30] !== t3 || $[31] !== testID) {
685
+ t4 = {
686
+ close,
687
+ enabled: t3,
688
+ expanded,
689
+ full,
690
+ isDismissable,
691
+ offset: motion.offset,
692
+ rest,
693
+ setExpanded,
694
+ stops,
695
+ testID
696
+ };
697
+ $[23] = close;
698
+ $[24] = expanded;
699
+ $[25] = full;
700
+ $[26] = isDismissable;
701
+ $[27] = motion.offset;
702
+ $[28] = rest;
703
+ $[29] = stops;
704
+ $[30] = t3;
705
+ $[31] = testID;
706
+ $[32] = t4;
707
+ } else t4 = $[32];
708
+ const pan = useSheetDrag(t4);
709
+ let t5;
710
+ if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
711
+ t5 = () => {
712
+ setExpanded(_temp);
713
+ };
714
+ $[33] = t5;
715
+ } else t5 = $[33];
716
+ const toggle = t5;
717
+ const t6 = !twoHeights || expanded;
718
+ const t7 = twoHeights ? toggle : void 0;
719
+ let t8;
720
+ if ($[34] !== bottom || $[35] !== pan || $[36] !== t6 || $[37] !== t7 || $[38] !== titleId) {
721
+ t8 = {
722
+ bottom,
723
+ expanded: t6,
724
+ pan,
725
+ setTitle,
726
+ titleId,
727
+ toggle: t7
728
+ };
729
+ $[34] = bottom;
730
+ $[35] = pan;
731
+ $[36] = t6;
732
+ $[37] = t7;
733
+ $[38] = titleId;
734
+ $[39] = t8;
735
+ } else t8 = $[39];
736
+ const layout = t8;
737
+ let t9;
738
+ if ($[40] !== onLayout) {
739
+ t9 = (event) => {
740
+ setFull(event.nativeEvent.layout.height);
741
+ onLayout?.(event);
742
+ };
743
+ $[40] = onLayout;
744
+ $[41] = t9;
745
+ } else t9 = $[41];
746
+ const measure = t9;
747
+ const labelledBy = title === null ? void 0 : titleId;
748
+ const T0 = ModalWindow;
749
+ const t10 = isDismissable && isOpen ? close : void 0;
750
+ const t11 = motion.scrim;
751
+ const T1 = GestureHandlerRootView;
752
+ const t12 = bottom ? styles.rootBottom : styles.rootSide;
753
+ const T2 = GestureDetector;
754
+ const t13 = Animated;
755
+ let t14;
756
+ if ($[42] !== labelledBy) {
757
+ t14 = panelRoleOf("dialog", labelledBy);
758
+ $[42] = labelledBy;
759
+ $[43] = t14;
760
+ } else t14 = $[43];
761
+ const t15 = isKeyboardDismissDisabled ? void 0 : close;
762
+ const t16 = composeStyles(styles.container, bottom ? styles.containerBottom : styles.containerSide, bottom ? bottomBoundsOf(insets, height) : sideInsetsOf(insets), motion.panel, style);
763
+ let t17;
764
+ if ($[44] !== children || $[45] !== slots) {
765
+ t17 = /* @__PURE__ */ jsx(ButtonSlotContext, {
766
+ value: slots,
767
+ children
768
+ });
769
+ $[44] = children;
770
+ $[45] = slots;
771
+ $[46] = t17;
772
+ } else t17 = $[46];
773
+ let t18;
774
+ if ($[47] !== layout || $[48] !== t17) {
775
+ t18 = /* @__PURE__ */ jsx(SheetLayoutContext, {
776
+ value: layout,
777
+ children: t17
778
+ });
779
+ $[47] = layout;
780
+ $[48] = t17;
781
+ $[49] = t18;
782
+ } else t18 = $[49];
783
+ let t19;
784
+ if ($[50] !== measure || $[51] !== props || $[52] !== t13.View || $[53] !== t14 || $[54] !== t15 || $[55] !== t16 || $[56] !== t18 || $[57] !== testID) {
785
+ t19 = /* @__PURE__ */ jsx(t13.View, {
786
+ ...t14,
787
+ onAccessibilityEscape: t15,
788
+ ...props,
789
+ onLayout: measure,
790
+ style: t16,
791
+ testID,
792
+ children: t18
793
+ });
794
+ $[50] = measure;
795
+ $[51] = props;
796
+ $[52] = t13.View;
797
+ $[53] = t14;
798
+ $[54] = t15;
799
+ $[55] = t16;
800
+ $[56] = t18;
801
+ $[57] = testID;
802
+ $[58] = t19;
803
+ } else t19 = $[58];
804
+ let t20;
805
+ if ($[59] !== T2 || $[60] !== pan || $[61] !== t19) {
806
+ t20 = /* @__PURE__ */ jsx(T2, {
807
+ gesture: pan,
808
+ children: t19
809
+ });
810
+ $[59] = T2;
811
+ $[60] = pan;
812
+ $[61] = t19;
813
+ $[62] = t20;
814
+ } else t20 = $[62];
815
+ let t21;
816
+ if ($[63] !== T1 || $[64] !== t12 || $[65] !== t20) {
817
+ t21 = /* @__PURE__ */ jsx(T1, {
818
+ style: t12,
819
+ children: t20
820
+ });
821
+ $[63] = T1;
822
+ $[64] = t12;
823
+ $[65] = t20;
824
+ $[66] = t21;
825
+ } else t21 = $[66];
826
+ let t22;
827
+ if ($[67] !== T0 || $[68] !== close || $[69] !== isKeyboardDismissDisabled || $[70] !== labelledBy || $[71] !== motion.scrim || $[72] !== t10 || $[73] !== t21 || $[74] !== title) {
828
+ t22 = /* @__PURE__ */ jsx(T0, {
829
+ isKeyboardDismissDisabled,
830
+ labelledBy,
831
+ onClose: close,
832
+ onScrimPress: t10,
833
+ scrim: t11,
834
+ title,
835
+ children: t21
836
+ });
837
+ $[67] = T0;
838
+ $[68] = close;
839
+ $[69] = isKeyboardDismissDisabled;
840
+ $[70] = labelledBy;
841
+ $[71] = motion.scrim;
842
+ $[72] = t10;
843
+ $[73] = t21;
844
+ $[74] = title;
845
+ $[75] = t22;
846
+ } else t22 = $[75];
847
+ return t22;
848
+ }
849
+ function _temp(was) {
850
+ return !was;
851
+ }
852
+ function sideInsetsOf(insets) {
853
+ return {
854
+ ...insetsOf(insets),
855
+ paddingStart: 0
856
+ };
857
+ }
858
+ function stopsOf(bottom, full, height, isDismissable) {
859
+ if (!bottom || full === null) return {
860
+ partial: null,
861
+ settles: [0]
862
+ };
863
+ const lower = full - height * PARTIAL;
864
+ const partial = lower > 0 ? lower : null;
865
+ return {
866
+ partial,
867
+ settles: [
868
+ 0,
869
+ ...partial === null ? [] : [partial],
870
+ ...isDismissable ? [full] : []
871
+ ]
872
+ };
873
+ }
874
+ function useLayout(part) {
875
+ const layout = use(SheetLayoutContext);
876
+ if (layout === null) throw new Error(`${part} is drawn inside Sheet.Content.`);
877
+ return layout;
878
+ }
879
+ /**
880
+ * The bottom sheet's drag. The panel follows the finger, no higher than its
881
+ * whole height and no lower than gone, or than its lowest height when it may
882
+ * not be dismissed, and once let go it settles where `settleOf` says: below
883
+ * the lowest height it closes, and at another height it moves the sheet there.
884
+ */
885
+ function useSheetDrag(t0) {
886
+ const $ = c(17);
887
+ const { close, enabled, expanded, full, isDismissable, offset, rest, setExpanded, stops, testID } = t0;
888
+ const { motion } = useTheme();
889
+ const reduceMotion = useReducedMotion();
890
+ const origin = useSharedValue(0);
891
+ let t1;
892
+ if ($[0] !== stops.settles) {
893
+ t1 = stops.settles.at(-1) ?? 0;
894
+ $[0] = stops.settles;
895
+ $[1] = t1;
896
+ } else t1 = $[1];
897
+ const lowest = t1;
898
+ const follow = function follow(translation) {
899
+ offset.set(Math.min(lowest, Math.max(0, origin.get() + translation)));
900
+ };
901
+ let t2;
902
+ if ($[2] !== close || $[3] !== expanded || $[4] !== full || $[5] !== isDismissable || $[6] !== motion || $[7] !== offset || $[8] !== reduceMotion || $[9] !== setExpanded || $[10] !== stops.partial) {
903
+ t2 = function settle(target) {
904
+ if (isDismissable && target === full) {
905
+ close();
906
+ return;
907
+ }
908
+ const higher = target === 0;
909
+ if (stops.partial !== null && higher !== expanded) {
910
+ setExpanded(higher);
911
+ return;
912
+ }
913
+ offset.set(reduceMotion ? target : withTiming(target, {
914
+ duration: motion.durationMedium1,
915
+ easing: Easing.bezier(...motion.easingEmphasizedDecelerate)
916
+ }));
917
+ };
918
+ $[2] = close;
919
+ $[3] = expanded;
920
+ $[4] = full;
921
+ $[5] = isDismissable;
922
+ $[6] = motion;
923
+ $[7] = offset;
924
+ $[8] = reduceMotion;
925
+ $[9] = setExpanded;
926
+ $[10] = stops.partial;
927
+ $[11] = t2;
928
+ } else t2 = $[11];
929
+ const settle = t2;
930
+ let t5;
931
+ if ($[12] !== offset || $[13] !== rest || $[14] !== settle || $[15] !== stops.settles) {
932
+ t5 = (t6, success) => {
933
+ const { velocityY } = t6;
934
+ settle(success ? settleOf(offset.get(), velocityY, stops.settles) : rest);
935
+ };
936
+ $[12] = offset;
937
+ $[13] = rest;
938
+ $[14] = settle;
939
+ $[15] = stops.settles;
940
+ $[16] = t5;
941
+ } else t5 = $[16];
942
+ const pan = Gesture.Pan().activeOffsetY([-8, DRAG_SLOP]).enabled(enabled).runOnJS(true).onStart((t3) => {
943
+ const { translationY } = t3;
944
+ origin.set(offset.get());
945
+ follow(translationY);
946
+ }).onUpdate((t4) => {
947
+ const { translationY: translationY_0 } = t4;
948
+ follow(translationY_0);
949
+ }).onEnd(t5);
950
+ return testID === void 0 ? pan : pan.withTestId(`${testID}-drag`);
951
+ }
952
+ /**
953
+ * The scrim's and the panel's motion, and the timer that unmounts the sheet
954
+ * once its exit has run. The bottom sheet's position is how far its panel is
955
+ * moved down, which the drag sets too; it starts below the window and rises
956
+ * to its height once that is measured. The side sheet's is how far it has
957
+ * come in from its edge, which is the end edge, and so the left one under
958
+ * right-to-left.
959
+ */
960
+ function useSheetMotion(t0) {
961
+ const $ = c(33);
962
+ const { bottom, full, isOpen, rest, setPresent } = t0;
963
+ const { motion } = useTheme();
964
+ const reduceMotion = useReducedMotion();
965
+ const { height } = useWindowDimensions();
966
+ const offset = useSharedValue(height);
967
+ const shown = useSharedValue(0);
968
+ const scrim = useSharedValue(0);
969
+ const direction = I18nManager.isRTL ? -1 : 1;
970
+ let t1;
971
+ if ($[0] !== bottom || $[1] !== full || $[2] !== height || $[3] !== isOpen || $[4] !== motion.durationMedium1 || $[5] !== motion.durationShort2 || $[6] !== motion.durationShort3 || $[7] !== motion.easingEmphasizedAccelerate || $[8] !== motion.easingEmphasizedDecelerate || $[9] !== motion.easingStandard || $[10] !== offset || $[11] !== reduceMotion || $[12] !== rest || $[13] !== scrim || $[14] !== setPresent || $[15] !== shown) {
972
+ t1 = () => {
973
+ const fade = {
974
+ duration: motion.durationShort2,
975
+ easing: Easing.bezier(...motion.easingStandard)
976
+ };
977
+ const enter = {
978
+ duration: motion.durationMedium1,
979
+ easing: Easing.bezier(...motion.easingEmphasizedDecelerate)
980
+ };
981
+ const exit = {
982
+ duration: motion.durationShort3,
983
+ easing: Easing.bezier(...motion.easingEmphasizedAccelerate)
984
+ };
985
+ if (isOpen) {
986
+ scrim.set(withTiming(1, fade));
987
+ if (!bottom) {
988
+ shown.set(reduceMotion ? 1 : withTiming(1, enter));
989
+ return;
990
+ }
991
+ if (full === null) return;
992
+ if (offset.get() > full) offset.set(full);
993
+ offset.set(reduceMotion ? rest : withTiming(rest, enter));
994
+ return;
995
+ }
996
+ scrim.set(withTiming(0, fade));
997
+ if (bottom) {
998
+ const gone = full ?? height;
999
+ offset.set(reduceMotion ? gone : withTiming(gone, exit));
1000
+ } else shown.set(reduceMotion ? 0 : withTiming(0, exit));
1001
+ const timer = setTimeout(() => {
1002
+ setPresent(false);
1003
+ }, reduceMotion ? motion.durationShort2 : Math.max(motion.durationShort2, motion.durationShort3));
1004
+ return () => {
1005
+ clearTimeout(timer);
1006
+ };
1007
+ };
1008
+ $[0] = bottom;
1009
+ $[1] = full;
1010
+ $[2] = height;
1011
+ $[3] = isOpen;
1012
+ $[4] = motion.durationMedium1;
1013
+ $[5] = motion.durationShort2;
1014
+ $[6] = motion.durationShort3;
1015
+ $[7] = motion.easingEmphasizedAccelerate;
1016
+ $[8] = motion.easingEmphasizedDecelerate;
1017
+ $[9] = motion.easingStandard;
1018
+ $[10] = offset;
1019
+ $[11] = reduceMotion;
1020
+ $[12] = rest;
1021
+ $[13] = scrim;
1022
+ $[14] = setPresent;
1023
+ $[15] = shown;
1024
+ $[16] = t1;
1025
+ } else t1 = $[16];
1026
+ let t2;
1027
+ if ($[17] !== bottom || $[18] !== full || $[19] !== height || $[20] !== isOpen || $[21] !== motion || $[22] !== offset || $[23] !== reduceMotion || $[24] !== rest || $[25] !== scrim || $[26] !== setPresent || $[27] !== shown) {
1028
+ t2 = [
1029
+ bottom,
1030
+ full,
1031
+ height,
1032
+ isOpen,
1033
+ motion,
1034
+ offset,
1035
+ reduceMotion,
1036
+ rest,
1037
+ scrim,
1038
+ setPresent,
1039
+ shown
1040
+ ];
1041
+ $[17] = bottom;
1042
+ $[18] = full;
1043
+ $[19] = height;
1044
+ $[20] = isOpen;
1045
+ $[21] = motion;
1046
+ $[22] = offset;
1047
+ $[23] = reduceMotion;
1048
+ $[24] = rest;
1049
+ $[25] = scrim;
1050
+ $[26] = setPresent;
1051
+ $[27] = shown;
1052
+ $[28] = t2;
1053
+ } else t2 = $[28];
1054
+ useEffect(t1, t2);
1055
+ const t3 = useAnimatedStyle(() => {
1056
+ "worklet";
1057
+ if (bottom) return { transform: [{ translateY: offset.get() }] };
1058
+ const progress = shown.get();
1059
+ return {
1060
+ opacity: progress,
1061
+ transform: [{ translateX: (1 - progress) * SIDE_WIDTH * direction }]
1062
+ };
1063
+ });
1064
+ const t4 = useAnimatedStyle(() => {
1065
+ "worklet";
1066
+ return { opacity: scrim.get() };
1067
+ });
1068
+ let t5;
1069
+ if ($[29] !== offset || $[30] !== t3 || $[31] !== t4) {
1070
+ t5 = {
1071
+ offset,
1072
+ panel: t3,
1073
+ scrim: t4
1074
+ };
1075
+ $[29] = offset;
1076
+ $[30] = t3;
1077
+ $[31] = t4;
1078
+ $[32] = t5;
1079
+ } else t5 = $[32];
1080
+ return t5;
1081
+ }
1082
+ Sheet.Body = SheetBody;
1083
+ Sheet.Content = SheetContent;
1084
+ Sheet.Footer = SheetFooter;
1085
+ Sheet.Handle = SheetHandle;
1086
+ Sheet.Header = SheetHeader;
1087
+ Sheet.Title = SheetTitle;
1088
+ //#endregion
1089
+ export { Sheet, SheetBody, SheetContent, SheetFooter, SheetHandle, SheetHeader, SheetTitle };
1090
+
1091
+ //# sourceMappingURL=index.js.map