@sincpro/mobile-ui 3.0.1 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/dist/Actions/Actions.Button.d.ts +6 -6
  2. package/dist/Actions/Actions.Button.js +650 -180
  3. package/dist/Actions/Actions.Dock.d.ts +1 -1
  4. package/dist/Actions/Actions.Dock.js +297 -18
  5. package/dist/Actions/Actions.FAB.js +100 -12
  6. package/dist/Actions/Actions.FilterButton.d.ts +17 -0
  7. package/dist/Actions/Actions.FilterButton.js +263 -33
  8. package/dist/Actions/Actions.IconButton.d.ts +1 -0
  9. package/dist/Actions/Actions.IconButton.js +196 -33
  10. package/dist/Actions/index.js +13 -13
  11. package/dist/Dialog/Confirmation.context.js +82 -16
  12. package/dist/Dialog/Dialog.ActionSheet.js +200 -41
  13. package/dist/Dialog/Dialog.Confirmation.js +168 -31
  14. package/dist/Dialog/Dialog.EditValue.js +437 -62
  15. package/dist/Dialog/Dialog.Sheet.d.ts +7 -3
  16. package/dist/Dialog/Dialog.Sheet.js +267 -15
  17. package/dist/Dialog/OverlayHost.d.ts +24 -0
  18. package/dist/Dialog/OverlayHost.js +230 -0
  19. package/dist/Dialog/SheetSurface.d.ts +43 -0
  20. package/dist/Dialog/SheetSurface.js +495 -0
  21. package/dist/Dialog/dialog-actions.d.ts +17 -0
  22. package/dist/Dialog/dialog-actions.js +59 -0
  23. package/dist/Dialog/index.d.ts +4 -1
  24. package/dist/Dialog/index.js +8 -7
  25. package/dist/Dialog/overlay.store.d.ts +24 -0
  26. package/dist/Dialog/overlay.store.js +59 -0
  27. package/dist/Dialog/requestConfirmation.js +20 -10
  28. package/dist/Display/Display.Accordion.js +185 -13
  29. package/dist/Display/Display.AmountSummary.js +206 -15
  30. package/dist/Display/Display.Avatar.js +93 -31
  31. package/dist/Display/Display.AvatarGroup.js +132 -17
  32. package/dist/Display/Display.Badge.d.ts +18 -2
  33. package/dist/Display/Display.Badge.js +117 -49
  34. package/dist/Display/Display.Card.js +163 -26
  35. package/dist/Display/Display.Carousel.js +459 -105
  36. package/dist/Display/Display.Chip.d.ts +4 -1
  37. package/dist/Display/Display.Chip.js +165 -31
  38. package/dist/Display/Display.CircleButton.d.ts +1 -0
  39. package/dist/Display/Display.CircleButton.js +86 -27
  40. package/dist/Display/Display.CopyableText.js +289 -66
  41. package/dist/Display/Display.CountRecords.js +60 -3
  42. package/dist/Display/Display.DataTable.js +123 -13
  43. package/dist/Display/Display.Date.js +243 -33
  44. package/dist/Display/Display.Divider.d.ts +10 -10
  45. package/dist/Display/Display.Divider.js +67 -20
  46. package/dist/Display/Display.ExpoImage.js +97 -8
  47. package/dist/Display/Display.GradientSurface.d.ts +9 -4
  48. package/dist/Display/Display.GradientSurface.js +196 -46
  49. package/dist/Display/Display.Icon.js +129 -15
  50. package/dist/Display/Display.IconBadge.js +95 -25
  51. package/dist/Display/Display.Image.d.ts +7 -1
  52. package/dist/Display/Display.Image.js +344 -39
  53. package/dist/Display/Display.KeyValue.js +90 -5
  54. package/dist/Display/Display.ListGroup.js +181 -9
  55. package/dist/Display/Display.ListItem.js +324 -28
  56. package/dist/Display/Display.Logo.js +84 -29
  57. package/dist/Display/Display.MediaCard.js +125 -4
  58. package/dist/Display/Display.MediaEmbed.d.ts +0 -5
  59. package/dist/Display/Display.MediaEmbed.js +170 -26
  60. package/dist/Display/Display.MenuButton.d.ts +2 -2
  61. package/dist/Display/Display.MenuButton.js +380 -94
  62. package/dist/Display/Display.MenuCard.js +122 -18
  63. package/dist/Display/Display.MenuGrid.js +43 -3
  64. package/dist/Display/Display.Monetary.js +90 -5
  65. package/dist/Display/Display.Pattern.js +306 -47
  66. package/dist/Display/Display.PriceTag.js +117 -14
  67. package/dist/Display/Display.ProductCard.js +154 -4
  68. package/dist/Display/Display.Rating.js +92 -11
  69. package/dist/Display/Display.SearchHistory.js +132 -6
  70. package/dist/Display/Display.SectionHeader.d.ts +5 -1
  71. package/dist/Display/Display.SectionHeader.js +125 -12
  72. package/dist/Display/Display.Stat.js +62 -3
  73. package/dist/Display/Display.StatCard.js +131 -7
  74. package/dist/Display/Display.StatusBadge.d.ts +29 -0
  75. package/dist/Display/Display.StatusBadge.js +68 -0
  76. package/dist/Display/Display.StatusDot.js +93 -18
  77. package/dist/Display/Display.Story.js +285 -35
  78. package/dist/Display/Display.StoryTray.js +354 -34
  79. package/dist/Display/Display.StoryViewer.js +571 -72
  80. package/dist/Display/Display.SwipeableRow.js +148 -20
  81. package/dist/Display/Display.Tag.d.ts +4 -1
  82. package/dist/Display/Display.Tag.js +66 -4
  83. package/dist/Display/Display.Timeline.js +102 -13
  84. package/dist/Display/Display.Tooltip.js +122 -26
  85. package/dist/Display/chevron.d.ts +6 -0
  86. package/dist/Display/chevron.js +32 -0
  87. package/dist/Display/count-badge.d.ts +21 -0
  88. package/dist/Display/count-badge.js +124 -0
  89. package/dist/Display/group-title.d.ts +10 -0
  90. package/dist/Display/group-title.js +53 -0
  91. package/dist/Display/icon-font.d.ts +3 -0
  92. package/dist/Display/icon-font.ios.d.ts +3 -0
  93. package/dist/Display/icon-font.ios.js +4 -0
  94. package/dist/Display/icon-font.js +7 -0
  95. package/dist/Display/icon-glyphs.d.ts +2 -0
  96. package/dist/Display/icon-glyphs.js +87 -0
  97. package/dist/Display/icon-map.d.ts +15 -11
  98. package/dist/Display/icon-map.js +344 -84
  99. package/dist/Display/icon-registry.d.ts +21 -0
  100. package/dist/Display/icon-registry.js +21 -0
  101. package/dist/Display/index.d.ts +6 -1
  102. package/dist/Display/index.js +53 -48
  103. package/dist/Display/pill.d.ts +16 -0
  104. package/dist/Display/pill.js +47 -0
  105. package/dist/Feedback/ErrorBoundary.js +35 -23
  106. package/dist/Feedback/Feedback.Banner.js +202 -24
  107. package/dist/Feedback/Feedback.DomainSplashScreen.js +246 -70
  108. package/dist/Feedback/Feedback.Empty.js +54 -3
  109. package/dist/Feedback/Feedback.EmptyState.js +114 -5
  110. package/dist/Feedback/Feedback.Error.d.ts +1 -1
  111. package/dist/Feedback/Feedback.Error.js +130 -5
  112. package/dist/Feedback/Feedback.Loading.d.ts +1 -1
  113. package/dist/Feedback/Feedback.Loading.js +70 -3
  114. package/dist/Feedback/Feedback.PermissionCard.js +161 -5
  115. package/dist/Feedback/Feedback.Progress.js +199 -41
  116. package/dist/Feedback/Feedback.ProgressCircle.js +184 -12
  117. package/dist/Feedback/Feedback.Skeleton.js +149 -36
  118. package/dist/Feedback/Feedback.Spinner.js +407 -79
  119. package/dist/Feedback/Feedback.Splash.js +240 -33
  120. package/dist/Feedback/Feedback.State.d.ts +17 -0
  121. package/dist/Feedback/Feedback.State.js +104 -0
  122. package/dist/Feedback/Toast.context.js +883 -167
  123. package/dist/Feedback/index.d.ts +3 -0
  124. package/dist/Feedback/index.js +15 -13
  125. package/dist/Form/Form.Checkbox.js +212 -22
  126. package/dist/Form/Form.ControlledCheckbox.d.ts +1 -1
  127. package/dist/Form/Form.ControlledCheckbox.js +46 -4
  128. package/dist/Form/Form.ControlledDropdown.d.ts +1 -1
  129. package/dist/Form/Form.ControlledDropdown.js +62 -4
  130. package/dist/Form/Form.ControlledInput.d.ts +4 -3
  131. package/dist/Form/Form.ControlledInput.js +72 -4
  132. package/dist/Form/Form.ControlledMonetaryInput.d.ts +6 -3
  133. package/dist/Form/Form.ControlledMonetaryInput.js +50 -4
  134. package/dist/Form/Form.ControlledRadioButton.d.ts +2 -2
  135. package/dist/Form/Form.ControlledRadioButton.js +45 -4
  136. package/dist/Form/Form.DatePicker.js +507 -107
  137. package/dist/Form/Form.Dropdown.js +303 -52
  138. package/dist/Form/Form.ErrorSummary.js +236 -44
  139. package/dist/Form/Form.Field.d.ts +24 -0
  140. package/dist/Form/Form.Field.js +55 -0
  141. package/dist/Form/Form.FractionalQuantityInput.js +508 -96
  142. package/dist/Form/Form.Input.d.ts +17 -3
  143. package/dist/Form/Form.Input.js +497 -29
  144. package/dist/Form/Form.KeyboardForm.d.ts +22 -8
  145. package/dist/Form/Form.KeyboardForm.js +83 -8
  146. package/dist/Form/Form.KeyboardToolbarHost.d.ts +14 -0
  147. package/dist/Form/Form.KeyboardToolbarHost.js +223 -0
  148. package/dist/Form/Form.MonetaryInput.js +164 -17
  149. package/dist/Form/Form.PickerField.d.ts +31 -0
  150. package/dist/Form/Form.PickerField.js +539 -0
  151. package/dist/Form/Form.PinInput.js +150 -15
  152. package/dist/Form/Form.QuantitySelector.js +229 -25
  153. package/dist/Form/Form.RadioButton.d.ts +1 -0
  154. package/dist/Form/Form.RadioButton.js +26 -29
  155. package/dist/Form/Form.Select.d.ts +2 -1
  156. package/dist/Form/Form.Select.js +388 -60
  157. package/dist/Form/Form.Slider.js +133 -10
  158. package/dist/Form/Form.Switch.js +99 -4
  159. package/dist/Form/choice-row.d.ts +15 -0
  160. package/dist/Form/choice-row.js +236 -0
  161. package/dist/Form/index.d.ts +11 -6
  162. package/dist/Form/index.js +26 -27
  163. package/dist/Form/input-text.d.ts +7 -0
  164. package/dist/Form/input-text.js +18 -0
  165. package/dist/Navigation/Navigation.AppBar.d.ts +3 -4
  166. package/dist/Navigation/Navigation.AppBar.js +535 -99
  167. package/dist/Navigation/Navigation.BottomNav.js +363 -98
  168. package/dist/Navigation/Navigation.CollapsingHeader.d.ts +28 -13
  169. package/dist/Navigation/Navigation.CollapsingHeader.js +369 -36
  170. package/dist/Navigation/Navigation.FloatingBar.js +71 -11
  171. package/dist/Navigation/Navigation.Menu.js +309 -95
  172. package/dist/Navigation/Navigation.MenuSection.js +80 -11
  173. package/dist/Navigation/Navigation.RowItem.d.ts +4 -2
  174. package/dist/Navigation/Navigation.RowItem.js +93 -8
  175. package/dist/Navigation/Navigation.Search.js +241 -27
  176. package/dist/Navigation/Navigation.SearchBar.d.ts +7 -1
  177. package/dist/Navigation/Navigation.SearchBar.js +218 -29
  178. package/dist/Navigation/Navigation.SearchSuggestions.js +77 -3
  179. package/dist/Navigation/Navigation.SegmentedControl.js +152 -14
  180. package/dist/Navigation/Navigation.Steps.js +105 -11
  181. package/dist/Navigation/Navigation.Tabs.js +449 -41
  182. package/dist/Navigation/index.d.ts +9 -4
  183. package/dist/Navigation/index.js +13 -13
  184. package/dist/Typography/Typography.Heading.js +33 -3
  185. package/dist/Typography/Typography.SelectableText.js +95 -7
  186. package/dist/Typography/Typography.Text.d.ts +4 -2
  187. package/dist/Typography/Typography.Text.js +217 -7
  188. package/dist/Typography/index.js +3 -3
  189. package/dist/branding.js +29 -13
  190. package/dist/icons/AddItemIcon.js +76 -2
  191. package/dist/icons/ArrangeCircle.js +82 -2
  192. package/dist/icons/ArrowDownIcon.js +63 -3
  193. package/dist/icons/ArrowUpIcon.js +63 -3
  194. package/dist/icons/BoxIcon.js +64 -2
  195. package/dist/icons/BoxTimeIcon.js +63 -2
  196. package/dist/icons/CalendarIcon.js +145 -2
  197. package/dist/icons/CardIcon.js +80 -2
  198. package/dist/icons/CashierIcon.js +39 -2
  199. package/dist/icons/CreditIcon.js +76 -3
  200. package/dist/icons/DuoIcon.js +75 -2
  201. package/dist/icons/HomeIcon.js +39 -2
  202. package/dist/icons/HomeIconOutlined.js +53 -2
  203. package/dist/icons/LogoIcon.js +87 -2
  204. package/dist/icons/MoneyReceiveIcon.js +86 -2
  205. package/dist/icons/PinIcon.js +39 -2
  206. package/dist/icons/ProfileIcon.js +47 -2
  207. package/dist/icons/SettingsIcon.js +114 -2
  208. package/dist/icons/SinpeIcon.js +60 -2
  209. package/dist/icons/ToggleOffIcon.js +53 -2
  210. package/dist/icons/WalletMoneyIcon.js +81 -2
  211. package/dist/index.d.ts +1 -0
  212. package/dist/index.js +8 -2
  213. package/dist/layouts/AuthContainer.d.ts +4 -5
  214. package/dist/layouts/AuthContainer.js +231 -7
  215. package/dist/layouts/BottomInset.js +4 -1
  216. package/dist/layouts/Container.d.ts +2 -2
  217. package/dist/layouts/Container.js +45 -3
  218. package/dist/layouts/GradientContainer.js +37 -5
  219. package/dist/layouts/PlainLayout.js +19 -3
  220. package/dist/layouts/ScrollContainer.d.ts +14 -9
  221. package/dist/layouts/ScrollContainer.js +125 -4
  222. package/dist/layouts/edges.d.ts +2 -0
  223. package/dist/layouts/edges.js +1 -0
  224. package/dist/primitives/AspectRatio.js +75 -3
  225. package/dist/primitives/Box.js +45 -3
  226. package/dist/primitives/Pressable.js +95 -5
  227. package/dist/primitives/Row.js +84 -13
  228. package/dist/primitives/Spacer.js +42 -5
  229. package/dist/primitives/Stack.js +66 -7
  230. package/dist/primitives/index.js +1 -1
  231. package/dist/theme/active.d.ts +2 -0
  232. package/dist/theme/active.js +33 -18
  233. package/dist/theme/build.js +118 -87
  234. package/dist/theme/color.js +87 -87
  235. package/dist/theme/components/ThemedActivityIndicator.d.ts +2 -15
  236. package/dist/theme/components/ThemedActivityIndicator.js +35 -3
  237. package/dist/theme/components/index.js +1 -0
  238. package/dist/theme/contrast.js +32 -33
  239. package/dist/theme/css-vars.js +71 -75
  240. package/dist/theme/dark.js +116 -97
  241. package/dist/theme/default.js +116 -97
  242. package/dist/theme/define.js +16 -12
  243. package/dist/theme/index.d.ts +1 -0
  244. package/dist/theme/index.js +7 -6
  245. package/dist/theme/on-dark-surface.d.ts +12 -0
  246. package/dist/theme/on-dark-surface.js +13 -0
  247. package/dist/theme/theme.js +1 -0
  248. package/dist/theme/tw.js +3 -1
  249. package/dist/theme/types.js +0 -18
  250. package/dist/theme/typography.d.ts +1 -1
  251. package/dist/theme/typography.js +337 -303
  252. package/dist/theme/useTheme.d.ts +4 -0
  253. package/dist/theme/useTheme.js +7 -3
  254. package/dist/theme/useThemeVars.d.ts +9 -0
  255. package/dist/theme/useThemeVars.js +23 -0
  256. package/dist/theme/validate.js +175 -166
  257. package/dist/tokens/index.js +1 -1
  258. package/dist/tokens/motion.js +30 -13
  259. package/dist/utils/async.d.ts +14 -0
  260. package/dist/utils/async.js +22 -0
  261. package/dist/utils/criteria.js +66 -85
  262. package/dist/utils/date.d.ts +8 -2
  263. package/dist/utils/date.js +63 -50
  264. package/dist/utils/image.js +8 -8
  265. package/dist/utils/intl.d.ts +1 -0
  266. package/dist/utils/intl.js +13 -0
  267. package/dist/utils/keys.js +3 -5
  268. package/dist/utils/monetary.d.ts +1 -0
  269. package/dist/utils/monetary.js +28 -24
  270. package/dist/utils/progress.js +2 -3
  271. package/dist/utils/quantity.js +25 -26
  272. package/dist/utils/reorder.js +11 -20
  273. package/dist/utils/search.d.ts +4 -0
  274. package/dist/utils/search.js +12 -0
  275. package/dist/utils/serializer.js +38 -38
  276. package/dist/utils/useReducedMotion.js +32 -30
  277. package/dist/views/AppSplashView.js +117 -3
  278. package/dist/views/AuthFormView.d.ts +4 -5
  279. package/dist/views/AuthFormView.js +119 -11
  280. package/dist/views/FormViewV2.context.js +75 -23
  281. package/dist/views/FormViewV2.d.ts +4 -5
  282. package/dist/views/FormViewV2.js +658 -92
  283. package/dist/views/ListViewV2.context.js +91 -47
  284. package/dist/views/ListViewV2.d.ts +84 -43
  285. package/dist/views/ListViewV2.js +1350 -200
  286. package/dist/views/Wizard/Wizard.context.js +248 -84
  287. package/dist/views/Wizard/Wizard.js +260 -67
  288. package/dist/views/types/IListView.js +34 -31
  289. package/dist/widgets/CollectionOptions.js +557 -138
  290. package/dist/widgets/FilterBar.js +159 -7
  291. package/dist/widgets/FilterBuilder.js +375 -102
  292. package/dist/widgets/JSONViewer.js +275 -129
  293. package/dist/widgets/PromoBanner.js +336 -42
  294. package/dist/widgets/PromoModal.d.ts +2 -2
  295. package/dist/widgets/PromoModal.js +389 -62
  296. package/dist/widgets/QueryChoice.js +150 -8
  297. package/dist/widgets/QuickActions.js +120 -31
  298. package/dist/widgets/ReorderableList.js +399 -128
  299. package/dist/widgets/TimeZoneSelectorModal.js +458 -51
  300. package/dist/widgets/index.js +3 -3
  301. package/package.json +6 -1
  302. package/tailwind.preset.js +7 -5
  303. package/dist/Form/Form.InputField.d.ts +0 -10
  304. package/dist/Form/Form.InputField.js +0 -38
  305. package/dist/Form/Form.KeyboardToolbar.d.ts +0 -22
  306. package/dist/Form/Form.KeyboardToolbar.js +0 -66
  307. package/dist/Form/Form.PasswordInput.d.ts +0 -9
  308. package/dist/Form/Form.PasswordInput.js +0 -17
  309. package/dist/Form/Form.TextInput.d.ts +0 -8
  310. package/dist/Form/Form.TextInput.js +0 -8
  311. package/dist/primitives/BaseButton.d.ts +0 -150
  312. package/dist/primitives/BaseButton.js +0 -229
  313. package/dist/utils/useSheetTranslation.d.ts +0 -5
  314. package/dist/utils/useSheetTranslation.js +0 -23
@@ -1,22 +1,274 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
2
- import BottomSheet, { BottomSheetView } from "@expo/ui/community/bottom-sheet";
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { OverlayPortal } from "./OverlayHost.js";
3
+ import { SheetSurface, useSheetRestingOffset } from "./SheetSurface.js";
3
4
  import Pressable from "../primitives/Pressable.js";
4
- import { themeToVars, useTheme } from "../theme/index.js";
5
5
  import { Typography } from "../Typography/index.js";
6
- import { vars } from "nativewind";
6
+ import { useState } from "react";
7
7
  import { ScrollView, View } from "react-native";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
9
+ /** Scroll content gets the hidden part of a resting panel as room at its end. */
10
+ function SheetScroll(t0) {
11
+ const $ = _c(6);
12
+ const {
13
+ children
14
+ } = t0;
15
+ const restingOffset = useSheetRestingOffset();
16
+ const t1 = 16 + restingOffset;
17
+ let t2;
18
+ if ($[0] !== t1) {
19
+ t2 = {
20
+ paddingHorizontal: 16,
21
+ paddingBottom: t1
22
+ };
23
+ $[0] = t1;
24
+ $[1] = t2;
25
+ } else {
26
+ t2 = $[1];
27
+ }
28
+ let t3;
29
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
30
+ t3 = {
31
+ flex: 1,
32
+ minHeight: 0
33
+ };
34
+ $[2] = t3;
35
+ } else {
36
+ t3 = $[2];
37
+ }
38
+ let t4;
39
+ if ($[3] !== children || $[4] !== t2) {
40
+ t4 = _jsx(ScrollView, {
41
+ contentContainerStyle: t2,
42
+ keyboardDismissMode: "on-drag",
43
+ keyboardShouldPersistTaps: "handled",
44
+ style: t3,
45
+ children: children
46
+ });
47
+ $[3] = children;
48
+ $[4] = t2;
49
+ $[5] = t4;
50
+ } else {
51
+ t4 = $[5];
52
+ }
53
+ return t4;
54
+ }
8
55
  const SNAP_POINTS = ["60%", "90%"];
9
- function Sheet({ visible, onClose, title, children, footer, snapPoints = SNAP_POINTS, scrollable = true, dismissible = true, testID, }) {
10
- const theme = useTheme();
11
- const close = () => {
12
- if (visible && dismissible)
13
- onClose();
56
+ function Sheet(t0) {
57
+ const $ = _c(41);
58
+ const {
59
+ visible,
60
+ onClose,
61
+ onClosed,
62
+ title,
63
+ children,
64
+ footer,
65
+ snapPoints: t1,
66
+ scrollable: t2,
67
+ dismissible: t3,
68
+ testID
69
+ } = t0;
70
+ const snapPoints = t1 === undefined ? SNAP_POINTS : t1;
71
+ const scrollable = t2 === undefined ? true : t2;
72
+ const dismissible = t3 === undefined ? true : t3;
73
+ const [present, setPresent] = useState(visible);
74
+ if (visible && !present) {
75
+ setPresent(true);
76
+ }
77
+ if (!present) {
78
+ return null;
79
+ }
80
+ let t4;
81
+ if ($[0] !== dismissible || $[1] !== onClose || $[2] !== visible) {
82
+ t4 = () => {
83
+ if (visible && dismissible) {
84
+ onClose();
85
+ }
86
+ };
87
+ $[0] = dismissible;
88
+ $[1] = onClose;
89
+ $[2] = visible;
90
+ $[3] = t4;
91
+ } else {
92
+ t4 = $[3];
93
+ }
94
+ const close = t4;
95
+ let t5;
96
+ if ($[4] !== onClosed) {
97
+ t5 = () => {
98
+ setPresent(false);
99
+ onClosed?.();
100
+ };
101
+ $[4] = onClosed;
102
+ $[5] = t5;
103
+ } else {
104
+ t5 = $[5];
105
+ }
106
+ const exited = t5;
107
+ let t6;
108
+ if ($[6] !== close) {
109
+ t6 = () => {
110
+ close();
111
+ return true;
112
+ };
113
+ $[6] = close;
114
+ $[7] = t6;
115
+ } else {
116
+ t6 = $[7];
117
+ }
118
+ const back = t6;
119
+ let t7;
120
+ if ($[8] !== title) {
121
+ t7 = title ? _jsx(Typography.Text, {
122
+ accessibilityRole: "header",
123
+ className: "flex-1 text-text-primary",
124
+ semibold: true,
125
+ variant: "subtitle",
126
+ children: title
127
+ }) : _jsx(View, {
128
+ className: "flex-1"
129
+ });
130
+ $[8] = title;
131
+ $[9] = t7;
132
+ } else {
133
+ t7 = $[9];
134
+ }
135
+ const t8 = !dismissible;
136
+ let t9;
137
+ if ($[10] !== t8) {
138
+ t9 = {
139
+ disabled: t8
140
+ };
141
+ $[10] = t8;
142
+ $[11] = t9;
143
+ } else {
144
+ t9 = $[11];
145
+ }
146
+ const t10 = !dismissible;
147
+ let t11;
148
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
149
+ t11 = {
150
+ minHeight: 48,
151
+ minWidth: 48,
152
+ alignItems: "center",
153
+ justifyContent: "center"
14
154
  };
15
- return (_jsx(BottomSheet, { backgroundStyle: { backgroundColor: theme.bg.card }, enablePanDownToClose: dismissible, index: visible ? 0 : -1, onClose: close, snapPoints: snapPoints, children: _jsx(BottomSheetView, { style: { flex: 1 }, children: _jsxs(View, { accessibilityViewIsModal: true, importantForAccessibility: "yes", onAccessibilityEscape: close, style: [vars(themeToVars(theme)), { flex: 1, minHeight: 0 }], testID: testID, children: [_jsxs(View, { className: "flex-row items-center gap-3 px-4 pb-2", children: [title ? (_jsx(Typography.Text, { accessibilityRole: "header", className: "flex-1 text-text-primary", semibold: true, variant: "subtitle", children: title })) : (_jsx(View, { className: "flex-1" })), _jsx(Pressable, { accessibilityLabel: "Cerrar", accessibilityRole: "button", accessibilityState: { disabled: !dismissible }, disabled: !dismissible, onPress: close, style: {
16
- minHeight: 48,
17
- minWidth: 48,
18
- alignItems: "center",
19
- justifyContent: "center",
20
- }, children: _jsx(Typography.Text, { className: dismissible ? "text-text-accent" : "text-text-disabled", variant: "bodySmall", children: "Cerrar" }) })] }), scrollable ? (_jsx(ScrollView, { contentContainerStyle: { paddingHorizontal: 16, paddingBottom: 16 }, keyboardDismissMode: "on-drag", keyboardShouldPersistTaps: "handled", style: { flex: 1, minHeight: 0 }, children: children })) : (_jsx(View, { style: { flex: 1, minHeight: 0, paddingHorizontal: 16 }, children: children })), footer ? (_jsx(View, { className: "border-t border-border-light px-4 py-3", children: footer })) : null] }) }) }));
155
+ $[12] = t11;
156
+ } else {
157
+ t11 = $[12];
158
+ }
159
+ const t12 = dismissible ? "text-text-accent" : "text-text-disabled";
160
+ let t13;
161
+ if ($[13] !== t12) {
162
+ t13 = _jsx(Typography.Text, {
163
+ className: t12,
164
+ variant: "bodySmall",
165
+ children: "Cerrar"
166
+ });
167
+ $[13] = t12;
168
+ $[14] = t13;
169
+ } else {
170
+ t13 = $[14];
171
+ }
172
+ let t14;
173
+ if ($[15] !== close || $[16] !== t10 || $[17] !== t13 || $[18] !== t9) {
174
+ t14 = _jsx(Pressable, {
175
+ accessibilityLabel: "Cerrar",
176
+ accessibilityRole: "button",
177
+ accessibilityState: t9,
178
+ disabled: t10,
179
+ onPress: close,
180
+ style: t11,
181
+ children: t13
182
+ });
183
+ $[15] = close;
184
+ $[16] = t10;
185
+ $[17] = t13;
186
+ $[18] = t9;
187
+ $[19] = t14;
188
+ } else {
189
+ t14 = $[19];
190
+ }
191
+ let t15;
192
+ if ($[20] !== t14 || $[21] !== t7) {
193
+ t15 = _jsxs(View, {
194
+ className: "flex-row items-center gap-3 px-4 pb-2",
195
+ children: [t7, t14]
196
+ });
197
+ $[20] = t14;
198
+ $[21] = t7;
199
+ $[22] = t15;
200
+ } else {
201
+ t15 = $[22];
202
+ }
203
+ const header = t15;
204
+ const t16 = visible ? back : undefined;
205
+ let t17;
206
+ if ($[23] !== footer) {
207
+ t17 = footer ? _jsx(View, {
208
+ className: "border-t border-border-light px-4 py-3",
209
+ children: footer
210
+ }) : undefined;
211
+ $[23] = footer;
212
+ $[24] = t17;
213
+ } else {
214
+ t17 = $[24];
215
+ }
216
+ let t18;
217
+ if ($[25] !== children || $[26] !== scrollable) {
218
+ t18 = scrollable ? _jsx(SheetScroll, {
219
+ children: children
220
+ }) : _jsx(View, {
221
+ style: {
222
+ flex: 1,
223
+ minHeight: 0,
224
+ paddingHorizontal: 16
225
+ },
226
+ children: children
227
+ });
228
+ $[25] = children;
229
+ $[26] = scrollable;
230
+ $[27] = t18;
231
+ } else {
232
+ t18 = $[27];
233
+ }
234
+ let t19;
235
+ if ($[28] !== close || $[29] !== dismissible || $[30] !== exited || $[31] !== header || $[32] !== snapPoints || $[33] !== t17 || $[34] !== t18 || $[35] !== testID || $[36] !== visible) {
236
+ t19 = _jsx(SheetSurface, {
237
+ dismissible: dismissible,
238
+ footer: t17,
239
+ header: header,
240
+ onExited: exited,
241
+ onRequestClose: close,
242
+ snapPoints: snapPoints,
243
+ testID: testID,
244
+ visible: visible,
245
+ children: t18
246
+ });
247
+ $[28] = close;
248
+ $[29] = dismissible;
249
+ $[30] = exited;
250
+ $[31] = header;
251
+ $[32] = snapPoints;
252
+ $[33] = t17;
253
+ $[34] = t18;
254
+ $[35] = testID;
255
+ $[36] = visible;
256
+ $[37] = t19;
257
+ } else {
258
+ t19 = $[37];
259
+ }
260
+ let t20;
261
+ if ($[38] !== t16 || $[39] !== t19) {
262
+ t20 = _jsx(OverlayPortal, {
263
+ onBack: t16,
264
+ children: t19
265
+ });
266
+ $[38] = t16;
267
+ $[39] = t19;
268
+ $[40] = t20;
269
+ } else {
270
+ t20 = $[40];
271
+ }
272
+ return t20;
21
273
  }
22
274
  export default Sheet;
@@ -0,0 +1,24 @@
1
+ import { type OverlayLayer } from "./overlay.store.js";
2
+ import { type ReactNode } from "react";
3
+ /**
4
+ * Mount once at the app root, inside the theme and gesture roots.
5
+ * Every Dialog.Sheet, Confirmation, ActionSheet, picker and toast renders
6
+ * here, in the same native window as the screen.
7
+ */
8
+ export declare function OverlayHost({ children }: {
9
+ children: ReactNode;
10
+ }): import("react").JSX.Element;
11
+ export interface OverlayPortalProps {
12
+ children: ReactNode;
13
+ layer?: OverlayLayer;
14
+ onBack?: () => boolean;
15
+ }
16
+ /**
17
+ * Sends its children to the OverlayHost. Without a host (tests, isolated
18
+ * stories) it renders in place so the content stays reachable, and warns once in
19
+ * development, because an app without the host draws every overlay clipped.
20
+ *
21
+ * Content rendered in the host sees the providers above the host, not the
22
+ * screen-level providers around the portal. Pass what it needs as props.
23
+ */
24
+ export declare function OverlayPortal({ children, layer, onBack }: OverlayPortalProps): ReactNode;
@@ -0,0 +1,230 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { overlayStore } from "./overlay.store.js";
3
+ import { useEffect, useEffectEvent, useId, useLayoutEffect, useSyncExternalStore } from "react";
4
+ import { BackHandler, StyleSheet, View } from "react-native";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
6
+ const styles = StyleSheet.create({
7
+ root: {
8
+ flex: 1
9
+ }
10
+ });
11
+
12
+ /**
13
+ * Mount once at the app root, inside the theme and gesture roots.
14
+ * Every Dialog.Sheet, Confirmation, ActionSheet, picker and toast renders
15
+ * here, in the same native window as the screen.
16
+ */
17
+ export function OverlayHost(t0) {
18
+ const $ = _c(17);
19
+ const {
20
+ children
21
+ } = t0;
22
+ const entries = useSyncExternalStore(overlayStore.subscribe, overlayStore.entries, overlayStore.entries);
23
+ let t1;
24
+ if ($[0] !== entries) {
25
+ t1 = entries.some(_temp);
26
+ $[0] = entries;
27
+ $[1] = t1;
28
+ } else {
29
+ t1 = $[1];
30
+ }
31
+ const blocking = t1;
32
+ let t2;
33
+ if ($[2] !== entries) {
34
+ t2 = entries.some(_temp2);
35
+ $[2] = entries;
36
+ $[3] = t2;
37
+ } else {
38
+ t2 = $[3];
39
+ }
40
+ const handlesBack = t2;
41
+ let t3;
42
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
43
+ t3 = [];
44
+ $[4] = t3;
45
+ } else {
46
+ t3 = $[4];
47
+ }
48
+ useLayoutEffect(_temp3, t3);
49
+ let t4;
50
+ let t5;
51
+ if ($[5] !== handlesBack) {
52
+ t4 = () => {
53
+ if (!handlesBack) {
54
+ return;
55
+ }
56
+ const subscription = BackHandler.addEventListener("hardwareBackPress", _temp4);
57
+ return () => subscription.remove();
58
+ };
59
+ t5 = [handlesBack];
60
+ $[5] = handlesBack;
61
+ $[6] = t4;
62
+ $[7] = t5;
63
+ } else {
64
+ t4 = $[6];
65
+ t5 = $[7];
66
+ }
67
+ useEffect(t4, t5);
68
+ const t6 = blocking ? "no-hide-descendants" : "auto";
69
+ let t7;
70
+ if ($[8] !== blocking || $[9] !== children || $[10] !== t6) {
71
+ t7 = _jsx(View, {
72
+ accessibilityElementsHidden: blocking,
73
+ importantForAccessibility: t6,
74
+ style: styles.root,
75
+ children: children
76
+ });
77
+ $[8] = blocking;
78
+ $[9] = children;
79
+ $[10] = t6;
80
+ $[11] = t7;
81
+ } else {
82
+ t7 = $[11];
83
+ }
84
+ let t8;
85
+ if ($[12] !== entries) {
86
+ t8 = entries.map(_temp5);
87
+ $[12] = entries;
88
+ $[13] = t8;
89
+ } else {
90
+ t8 = $[13];
91
+ }
92
+ let t9;
93
+ if ($[14] !== t7 || $[15] !== t8) {
94
+ t9 = _jsxs(View, {
95
+ style: styles.root,
96
+ children: [t7, t8]
97
+ });
98
+ $[14] = t7;
99
+ $[15] = t8;
100
+ $[16] = t9;
101
+ } else {
102
+ t9 = $[16];
103
+ }
104
+ return t9;
105
+ }
106
+ function _temp5(entry_1) {
107
+ return _jsx(View, {
108
+ pointerEvents: "box-none",
109
+ style: StyleSheet.absoluteFill,
110
+ children: entry_1.element
111
+ }, entry_1.key);
112
+ }
113
+ function _temp4() {
114
+ return overlayStore.handleBack();
115
+ }
116
+ function _temp3() {
117
+ return overlayStore.attachHost();
118
+ }
119
+ function _temp2(entry_0) {
120
+ return entry_0.onBack;
121
+ }
122
+ function _temp(entry) {
123
+ return entry.layer === "sheet";
124
+ }
125
+ let warnedMissingHost = false;
126
+
127
+ /** Overlays without a host render in place, clipped by their container: say so once. */
128
+ function warnMissingHost() {
129
+ if (warnedMissingHost || !__DEV__ || process.env.NODE_ENV === "test") return;
130
+ warnedMissingHost = true;
131
+ console.warn("[mobile-ui] A Sheet or dialog opened without <OverlayHost>: it renders in place, " + "clipped by its container. Mount <OverlayHost> once at the app root " + "(the @sincpro/mobile AppShell does it).");
132
+ }
133
+
134
+ /**
135
+ * Sends its children to the OverlayHost. Without a host (tests, isolated
136
+ * stories) it renders in place so the content stays reachable, and warns once in
137
+ * development, because an app without the host draws every overlay clipped.
138
+ *
139
+ * Content rendered in the host sees the providers above the host, not the
140
+ * screen-level providers around the portal. Pass what it needs as props.
141
+ */
142
+ export function OverlayPortal(t0) {
143
+ const $ = _c(16);
144
+ const {
145
+ children,
146
+ layer: t1,
147
+ onBack
148
+ } = t0;
149
+ const layer = t1 === undefined ? "sheet" : t1;
150
+ const key = useId();
151
+ const hosted = useSyncExternalStore(overlayStore.subscribe, overlayStore.hasHost, overlayStore.hasHost);
152
+ let t2;
153
+ if ($[0] !== onBack) {
154
+ t2 = () => onBack?.() ?? false;
155
+ $[0] = onBack;
156
+ $[1] = t2;
157
+ } else {
158
+ t2 = $[1];
159
+ }
160
+ const back = useEffectEvent(t2);
161
+ const listensToBack = onBack !== undefined;
162
+ let t3;
163
+ if ($[2] !== back || $[3] !== children || $[4] !== hosted || $[5] !== key || $[6] !== layer || $[7] !== listensToBack) {
164
+ t3 = () => {
165
+ if (!hosted) {
166
+ return;
167
+ }
168
+ overlayStore.upsert({
169
+ key,
170
+ layer,
171
+ element: children,
172
+ onBack: listensToBack ? () => back() : undefined
173
+ });
174
+ };
175
+ $[2] = back;
176
+ $[3] = children;
177
+ $[4] = hosted;
178
+ $[5] = key;
179
+ $[6] = layer;
180
+ $[7] = listensToBack;
181
+ $[8] = t3;
182
+ } else {
183
+ t3 = $[8];
184
+ }
185
+ useLayoutEffect(t3);
186
+ let t4;
187
+ let t5;
188
+ if ($[9] !== hosted || $[10] !== key) {
189
+ t4 = () => {
190
+ if (!hosted) {
191
+ return;
192
+ }
193
+ return () => overlayStore.remove(key);
194
+ };
195
+ t5 = [hosted, key];
196
+ $[9] = hosted;
197
+ $[10] = key;
198
+ $[11] = t4;
199
+ $[12] = t5;
200
+ } else {
201
+ t4 = $[11];
202
+ t5 = $[12];
203
+ }
204
+ useLayoutEffect(t4, t5);
205
+ let t6;
206
+ let t7;
207
+ if ($[13] !== hosted) {
208
+ t6 = () => {
209
+ if (hosted) {
210
+ return;
211
+ }
212
+ const timer = setTimeout(_temp6, 0);
213
+ return () => clearTimeout(timer);
214
+ };
215
+ t7 = [hosted];
216
+ $[13] = hosted;
217
+ $[14] = t6;
218
+ $[15] = t7;
219
+ } else {
220
+ t6 = $[14];
221
+ t7 = $[15];
222
+ }
223
+ useEffect(t6, t7);
224
+ return hosted ? null : children;
225
+ }
226
+ function _temp6() {
227
+ if (!overlayStore.hasHost()) {
228
+ warnMissingHost();
229
+ }
230
+ }
@@ -0,0 +1,43 @@
1
+ import { type ReactNode } from "react";
2
+ export type SnapPoint = string | number;
3
+ /** The part of the sheet panel below the screen at rest (0 outside a sheet). */
4
+ export declare function useSheetRestingOffset(): number;
5
+ export declare function resolveSnapPoint(point: SnapPoint, windowHeight: number): number;
6
+ /**
7
+ * Panel geometry for a host of `height` whose top `topInset` points are covered (status
8
+ * bar, notch). The panel is as tall as the highest snap point and never reaches into the
9
+ * inset; it rests pushed down `restOffset` so only the lowest snap point shows.
10
+ */
11
+ export declare function sheetGeometry(snapPoints: SnapPoint[], height: number, topInset: number): {
12
+ ceiling: number;
13
+ panelHeight: number;
14
+ offsets: number[];
15
+ restOffset: number;
16
+ };
17
+ /**
18
+ * How much of the panel sits below the screen while it rests at its lowest snap point.
19
+ * Scroll content needs this much extra room at its end, or its last rows stay off screen
20
+ * until the sheet is dragged up.
21
+ */
22
+ export declare function restingOffset(snapPoints: SnapPoint[], height: number, topInset: number): number;
23
+ export interface SheetSurfaceProps {
24
+ /** `false` starts the exit animation. */
25
+ visible: boolean;
26
+ snapPoints: SnapPoint[];
27
+ dismissible: boolean;
28
+ /** The user asked to close: backdrop, drag or accessibility escape. */
29
+ onRequestClose: () => void;
30
+ /** The exit animation finished and the surface can unmount. */
31
+ onExited: () => void;
32
+ /** Drag area at the top of the panel. */
33
+ header: ReactNode;
34
+ /** Actions pinned to the visible bottom of the sheet at every snap point. */
35
+ footer?: ReactNode;
36
+ children: ReactNode;
37
+ testID?: string;
38
+ }
39
+ /**
40
+ * Bottom sheet drawn in the app window. While it exits it ignores touches,
41
+ * so a tap during the close animation never lands on a view that unmounts.
42
+ */
43
+ export declare function SheetSurface({ visible, snapPoints, dismissible, onRequestClose, onExited, header, footer, children, testID, }: SheetSurfaceProps): import("react").JSX.Element;