@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,107 +1,321 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { MenuView } from "@expo/ui/community/menu";
3
3
  import Icon from "../Display/Display.Icon.js";
4
4
  import { ICON_MAP } from "../Display/icon-map.js";
5
5
  import { relativeLuminance, useTheme } from "../theme/index.js";
6
6
  import { unstable_getMaterialSymbolSourceAsync } from "expo-symbols";
7
7
  import { useEffect, useMemo, useRef, useState } from "react";
8
- import { ActivityIndicator, Alert, Platform, View, } from "react-native";
9
- function Menu({ items, trigger, title, disabled = false, accessibilityLabel = "Más opciones", style, testID, }) {
10
- const theme = useTheme();
11
- const running = useRef(false);
12
- const [pending, setPending] = useState(false);
13
- const blocked = disabled || pending || !items.some((entry) => !("separator" in entry));
14
- const [sources, setSources] = useState(() => new Map());
15
- const requests = useMemo(() => items.flatMap((entry) => "separator" in entry || !entry.icon
16
- ? []
17
- : [
18
- {
19
- icon: entry.icon,
20
- color: entry.destructive ? theme.danger : theme.icon.secondary,
21
- },
22
- ]), [items, theme.danger, theme.icon.secondary]);
23
- useEffect(() => {
24
- if (Platform.OS !== "android" || !requests.length)
25
- return;
26
- let active = true;
27
- void Promise.all(requests.map(async ({ icon, color }) => ({
28
- key: `${icon}:${color}`,
29
- source: await unstable_getMaterialSymbolSourceAsync(ICON_MAP[icon].md, 24, color),
30
- }))).then((results) => {
31
- if (!active)
32
- return;
33
- const next = new Map();
34
- for (const { key, source } of results) {
35
- if (source)
36
- next.set(key, source);
37
- }
38
- setSources(next);
39
- }, (cause) => {
40
- console.error("[Navigation.Menu] Could not render native icons", cause);
41
- });
42
- return () => {
43
- active = false;
44
- };
45
- }, [requests]);
8
+ import { ActivityIndicator, Alert, Platform, View } from "react-native";
9
+ import { jsx as _jsx } from "nativewind/jsx-runtime";
10
+ const iconSources = new Map();
11
+
12
+ /** One native rasterization per icon and color for the whole app. */
13
+ function menuIconSource(icon, color) {
14
+ const key = `${icon}:${color}`;
15
+ let source = iconSources.get(key);
16
+ if (!source) {
17
+ source = unstable_getMaterialSymbolSourceAsync(ICON_MAP[icon].md, 24, color).catch(cause => {
18
+ iconSources.delete(key);
19
+ throw cause;
20
+ });
21
+ iconSources.set(key, source);
22
+ }
23
+ return source;
24
+ }
25
+ function Menu(t0) {
26
+ const $ = _c(52);
27
+ const {
28
+ items,
29
+ trigger,
30
+ title,
31
+ disabled: t1,
32
+ accessibilityLabel: t2,
33
+ style,
34
+ testID
35
+ } = t0;
36
+ const disabled = t1 === undefined ? false : t1;
37
+ const accessibilityLabel = t2 === undefined ? "M\xE1s opciones" : t2;
38
+ const theme = useTheme();
39
+ const running = useRef(false);
40
+ const [pending, setPending] = useState(false);
41
+ let t3;
42
+ if ($[0] !== disabled || $[1] !== items || $[2] !== pending) {
43
+ t3 = disabled || pending || !items.some(_temp);
44
+ $[0] = disabled;
45
+ $[1] = items;
46
+ $[2] = pending;
47
+ $[3] = t3;
48
+ } else {
49
+ t3 = $[3];
50
+ }
51
+ const blocked = t3;
52
+ const [sources, setSources] = useState(_temp2);
53
+ let t4;
54
+ if ($[4] !== items || $[5] !== theme.danger || $[6] !== theme.icon.secondary) {
55
+ let t5;
56
+ if ($[8] !== theme.danger || $[9] !== theme.icon.secondary) {
57
+ t5 = entry_0 => "separator" in entry_0 || !entry_0.icon ? [] : [{
58
+ icon: entry_0.icon,
59
+ color: entry_0.destructive ? theme.danger : theme.icon.secondary
60
+ }];
61
+ $[8] = theme.danger;
62
+ $[9] = theme.icon.secondary;
63
+ $[10] = t5;
64
+ } else {
65
+ t5 = $[10];
66
+ }
67
+ t4 = items.flatMap(t5);
68
+ $[4] = items;
69
+ $[5] = theme.danger;
70
+ $[6] = theme.icon.secondary;
71
+ $[7] = t4;
72
+ } else {
73
+ t4 = $[7];
74
+ }
75
+ const requests = t4;
76
+ let t5;
77
+ let t6;
78
+ if ($[11] !== requests) {
79
+ t5 = () => {
80
+ if (Platform.OS !== "android" || !requests.length) {
81
+ return;
82
+ }
83
+ let active = true;
84
+ Promise.all(requests.map(_temp3)).then(results => {
85
+ if (!active) {
86
+ return;
87
+ }
88
+ const next = new Map();
89
+ for (const {
90
+ key,
91
+ source
92
+ } of results) {
93
+ if (source) {
94
+ next.set(key, source);
95
+ }
96
+ }
97
+ setSources(next);
98
+ }, _temp4);
99
+ return () => {
100
+ active = false;
101
+ };
102
+ };
103
+ t6 = [requests];
104
+ $[11] = requests;
105
+ $[12] = t5;
106
+ $[13] = t6;
107
+ } else {
108
+ t5 = $[12];
109
+ t6 = $[13];
110
+ }
111
+ useEffect(t5, t6);
112
+ let t7;
113
+ if ($[14] !== blocked || $[15] !== items || $[16] !== sources || $[17] !== theme.danger || $[18] !== theme.icon.secondary || $[19] !== theme.text) {
46
114
  const groups = [[]];
47
- items.forEach((entry, index) => {
48
- if ("separator" in entry) {
49
- if (groups[groups.length - 1].length)
50
- groups.push([]);
51
- return;
115
+ items.forEach((entry_1, index) => {
116
+ if ("separator" in entry_1) {
117
+ if (groups[groups.length - 1].length) {
118
+ groups.push([]);
119
+ }
120
+ return;
121
+ }
122
+ const color_0 = entry_1.disabled ? theme.text.disabled : entry_1.destructive ? theme.danger : theme.text.primary;
123
+ const imageColor = entry_1.destructive ? theme.danger : theme.icon.secondary;
124
+ groups[groups.length - 1].push({
125
+ id: String(index),
126
+ title: entry_1.label,
127
+ titleColor: color_0,
128
+ image: entry_1.icon ? Platform.OS === "ios" ? ICON_MAP[entry_1.icon].sf : sources.get(`${entry_1.icon}:${imageColor}`) : undefined,
129
+ imageColor,
130
+ attributes: {
131
+ disabled: blocked || entry_1.disabled,
132
+ destructive: entry_1.destructive
52
133
  }
53
- const color = entry.disabled
54
- ? theme.text.disabled
55
- : entry.destructive
56
- ? theme.danger
57
- : theme.text.primary;
58
- const imageColor = entry.destructive ? theme.danger : theme.icon.secondary;
59
- groups[groups.length - 1].push({
60
- id: String(index),
61
- title: entry.label,
62
- titleColor: color,
63
- image: entry.icon
64
- ? Platform.OS === "ios"
65
- ? ICON_MAP[entry.icon].sf
66
- : sources.get(`${entry.icon}:${imageColor}`)
67
- : undefined,
68
- imageColor,
69
- attributes: { disabled: blocked || entry.disabled, destructive: entry.destructive },
70
- });
134
+ });
135
+ });
136
+ const sections = groups.filter(_temp5);
137
+ t7 = sections.length > 1 ? sections.map(_temp6) : sections[0] ?? [];
138
+ $[14] = blocked;
139
+ $[15] = items;
140
+ $[16] = sources;
141
+ $[17] = theme.danger;
142
+ $[18] = theme.icon.secondary;
143
+ $[19] = theme.text;
144
+ $[20] = t7;
145
+ } else {
146
+ t7 = $[20];
147
+ }
148
+ const actions = t7;
149
+ const t8 = blocked ? "none" : "auto";
150
+ const t9 = relativeLuminance(theme.bg.card) < 0.179 ? "dark" : "light";
151
+ let t10;
152
+ if ($[21] !== blocked || $[22] !== items) {
153
+ t10 = t11 => {
154
+ const {
155
+ nativeEvent
156
+ } = t11;
157
+ const entry_2 = items.find((_, index_1) => String(index_1) === nativeEvent.event);
158
+ if (!entry_2 || "separator" in entry_2 || blocked || entry_2.disabled || running.current) {
159
+ return;
160
+ }
161
+ running.current = true;
162
+ setPending(true);
163
+ Promise.resolve().then(() => entry_2.onPress()).catch(_temp7).finally(() => {
164
+ running.current = false;
165
+ setPending(false);
166
+ });
167
+ };
168
+ $[21] = blocked;
169
+ $[22] = items;
170
+ $[23] = t10;
171
+ } else {
172
+ t10 = $[23];
173
+ }
174
+ let t11;
175
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
176
+ t11 = {
177
+ minWidth: 48,
178
+ minHeight: 48
179
+ };
180
+ $[24] = t11;
181
+ } else {
182
+ t11 = $[24];
183
+ }
184
+ const t12 = testID ? `${testID}-native-menu` : undefined;
185
+ let t13;
186
+ if ($[25] !== blocked || $[26] !== pending) {
187
+ t13 = {
188
+ disabled: blocked,
189
+ busy: pending
190
+ };
191
+ $[25] = blocked;
192
+ $[26] = pending;
193
+ $[27] = t13;
194
+ } else {
195
+ t13 = $[27];
196
+ }
197
+ const t14 = blocked ? 0.5 : 1;
198
+ let t15;
199
+ if ($[28] !== t14) {
200
+ t15 = {
201
+ minWidth: 48,
202
+ minHeight: 48,
203
+ alignItems: "center",
204
+ justifyContent: "center",
205
+ opacity: t14
206
+ };
207
+ $[28] = t14;
208
+ $[29] = t15;
209
+ } else {
210
+ t15 = $[29];
211
+ }
212
+ let t16;
213
+ if ($[30] !== pending || $[31] !== theme.icon.secondary || $[32] !== theme.primary || $[33] !== trigger) {
214
+ t16 = pending ? _jsx(ActivityIndicator, {
215
+ color: theme.primary
216
+ }) : trigger ?? _jsx(Icon, {
217
+ color: theme.icon.secondary,
218
+ name: "more-vertical",
219
+ size: 22
220
+ });
221
+ $[30] = pending;
222
+ $[31] = theme.icon.secondary;
223
+ $[32] = theme.primary;
224
+ $[33] = trigger;
225
+ $[34] = t16;
226
+ } else {
227
+ t16 = $[34];
228
+ }
229
+ let t17;
230
+ if ($[35] !== accessibilityLabel || $[36] !== t13 || $[37] !== t15 || $[38] !== t16) {
231
+ t17 = _jsx(View, {
232
+ accessibilityLabel: accessibilityLabel,
233
+ accessibilityRole: "button",
234
+ accessibilityState: t13,
235
+ accessible: true,
236
+ pointerEvents: "none",
237
+ style: t15,
238
+ children: t16
71
239
  });
72
- const sections = groups.filter((group) => group.length > 0);
73
- const actions = sections.length > 1
74
- ? sections.map((subactions, index) => ({
75
- id: `section-${index}`,
76
- title: "",
77
- displayInline: true,
78
- subactions,
79
- }))
80
- : (sections[0] ?? []);
81
- return (_jsx(View, { pointerEvents: blocked ? "none" : "auto", style: style, testID: testID, children: _jsx(MenuView, { actions: actions, colorScheme: relativeLuminance(theme.bg.card) < 0.179 ? "dark" : "light", onPressAction: ({ nativeEvent }) => {
82
- const entry = items.find((_, index) => String(index) === nativeEvent.event);
83
- if (!entry || "separator" in entry || blocked || entry.disabled || running.current)
84
- return;
85
- running.current = true;
86
- setPending(true);
87
- void Promise.resolve()
88
- .then(() => entry.onPress())
89
- .catch((cause) => {
90
- Alert.alert("No se pudo completar la acción", cause instanceof Error && cause.message.trim()
91
- ? cause.message
92
- : "Vuelve a intentarlo.");
93
- })
94
- .finally(() => {
95
- running.current = false;
96
- setPending(false);
97
- });
98
- }, style: { minWidth: 48, minHeight: 48 }, testID: testID ? `${testID}-native-menu` : undefined, title: title, children: _jsx(View, { accessibilityLabel: accessibilityLabel, accessibilityRole: "button", accessibilityState: { disabled: blocked, busy: pending }, accessible: true, pointerEvents: "none", style: {
99
- minWidth: 48,
100
- minHeight: 48,
101
- alignItems: "center",
102
- justifyContent: "center",
103
- opacity: blocked ? 0.5 : 1,
104
- }, children: pending ? (_jsx(ActivityIndicator, { color: theme.primary })) : ((trigger ?? _jsx(Icon, { color: theme.icon.secondary, name: "more-vertical", size: 22 }))) }) }) }));
240
+ $[35] = accessibilityLabel;
241
+ $[36] = t13;
242
+ $[37] = t15;
243
+ $[38] = t16;
244
+ $[39] = t17;
245
+ } else {
246
+ t17 = $[39];
247
+ }
248
+ let t18;
249
+ if ($[40] !== actions || $[41] !== t10 || $[42] !== t12 || $[43] !== t17 || $[44] !== t9 || $[45] !== title) {
250
+ t18 = _jsx(MenuView, {
251
+ actions: actions,
252
+ colorScheme: t9,
253
+ onPressAction: t10,
254
+ style: t11,
255
+ testID: t12,
256
+ title: title,
257
+ children: t17
258
+ });
259
+ $[40] = actions;
260
+ $[41] = t10;
261
+ $[42] = t12;
262
+ $[43] = t17;
263
+ $[44] = t9;
264
+ $[45] = title;
265
+ $[46] = t18;
266
+ } else {
267
+ t18 = $[46];
268
+ }
269
+ let t19;
270
+ if ($[47] !== style || $[48] !== t18 || $[49] !== t8 || $[50] !== testID) {
271
+ t19 = _jsx(View, {
272
+ pointerEvents: t8,
273
+ style: style,
274
+ testID: testID,
275
+ children: t18
276
+ });
277
+ $[47] = style;
278
+ $[48] = t18;
279
+ $[49] = t8;
280
+ $[50] = testID;
281
+ $[51] = t19;
282
+ } else {
283
+ t19 = $[51];
284
+ }
285
+ return t19;
286
+ }
287
+ function _temp7(cause_0) {
288
+ Alert.alert("No se pudo completar la acci\xF3n", cause_0 instanceof Error && cause_0.message.trim() ? cause_0.message : "Vuelve a intentarlo.");
289
+ }
290
+ function _temp6(subactions, index_0) {
291
+ return {
292
+ id: `section-${index_0}`,
293
+ title: "",
294
+ displayInline: true,
295
+ subactions
296
+ };
297
+ }
298
+ function _temp5(group) {
299
+ return group.length > 0;
300
+ }
301
+ function _temp4(cause) {
302
+ console.error("[Navigation.Menu] Could not render native icons", cause);
303
+ }
304
+ async function _temp3(t0) {
305
+ const {
306
+ icon,
307
+ color
308
+ } = t0;
309
+ return {
310
+ key: `${icon}:${color}`,
311
+ source: await menuIconSource(icon, color)
312
+ };
313
+ }
314
+ function _temp2() {
315
+ return new Map();
316
+ }
317
+ function _temp(entry) {
318
+ return !("separator" in entry);
105
319
  }
106
320
  export default Menu;
107
321
  export { Menu };
@@ -1,7 +1,10 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import Card from "../Display/Display.Card.js";
3
+ import { GroupTitle } from "../Display/group-title.js";
2
4
  import { useTheme } from "../theme/index.js";
3
5
  import { Typography } from "../Typography/index.js";
4
6
  import { View } from "react-native";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
5
8
  /**
6
9
  * Titled card that groups `Display.MenuButton` rows into a visual section.
7
10
  * Mirrors iOS grouped-table-view style: title above, card surface, optional footer note.
@@ -12,14 +15,80 @@ import { View } from "react-native";
12
15
  * <Display.MenuButton label="Ajustes" icon={SettingsIcon} onPress={...} showDivider={false} />
13
16
  * </MenuSection>
14
17
  */
15
- export function MenuSection({ title, footer, children }) {
16
- const theme = useTheme();
17
- return (_jsxs(View, { style: { marginHorizontal: 16, marginBottom: 20 }, children: [title ? (_jsx(Typography.Text, { semibold: true, style: { color: theme.text.secondary, marginBottom: 6, paddingHorizontal: 4 }, variant: "caption", children: title.toUpperCase() })) : null, _jsx(View, { style: {
18
- backgroundColor: theme.bg.card,
19
- borderRadius: 14,
20
- borderWidth: 1,
21
- borderColor: theme.border.default,
22
- overflow: "hidden",
23
- ...theme.shadow.sm,
24
- }, children: children }), footer ? (_jsx(Typography.Text, { style: { color: theme.text.tertiary, marginTop: 6, paddingHorizontal: 4 }, variant: "caption", children: footer })) : null] }));
18
+ export function MenuSection(t0) {
19
+ const $ = _c(12);
20
+ const {
21
+ title,
22
+ footer,
23
+ children
24
+ } = t0;
25
+ const theme = useTheme();
26
+ let t1;
27
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28
+ t1 = {
29
+ marginHorizontal: 16,
30
+ marginBottom: 20
31
+ };
32
+ $[0] = t1;
33
+ } else {
34
+ t1 = $[0];
35
+ }
36
+ let t2;
37
+ if ($[1] !== title) {
38
+ t2 = title ? _jsx(GroupTitle, {
39
+ style: {
40
+ marginBottom: 6,
41
+ paddingHorizontal: 4
42
+ },
43
+ children: title
44
+ }) : null;
45
+ $[1] = title;
46
+ $[2] = t2;
47
+ } else {
48
+ t2 = $[2];
49
+ }
50
+ let t3;
51
+ if ($[3] !== children) {
52
+ t3 = _jsx(Card, {
53
+ className: "overflow-hidden",
54
+ elevation: "sm",
55
+ padding: "none",
56
+ children: children
57
+ });
58
+ $[3] = children;
59
+ $[4] = t3;
60
+ } else {
61
+ t3 = $[4];
62
+ }
63
+ let t4;
64
+ if ($[5] !== footer || $[6] !== theme) {
65
+ t4 = footer ? _jsx(Typography.Text, {
66
+ style: {
67
+ color: theme.text.tertiary,
68
+ marginTop: 6,
69
+ paddingHorizontal: 4
70
+ },
71
+ variant: "caption",
72
+ children: footer
73
+ }) : null;
74
+ $[5] = footer;
75
+ $[6] = theme;
76
+ $[7] = t4;
77
+ } else {
78
+ t4 = $[7];
79
+ }
80
+ let t5;
81
+ if ($[8] !== t2 || $[9] !== t3 || $[10] !== t4) {
82
+ t5 = _jsxs(View, {
83
+ style: t1,
84
+ children: [t2, t3, t4]
85
+ });
86
+ $[8] = t2;
87
+ $[9] = t3;
88
+ $[10] = t4;
89
+ $[11] = t5;
90
+ } else {
91
+ t5 = $[11];
92
+ }
93
+ return t5;
25
94
  }
@@ -1,5 +1,7 @@
1
1
  import { IRowItemProps } from "../views/types/IListView.js";
2
- declare function RowItem({ item, className, onPress, readonly, }: IRowItemProps<any> & {
2
+ /** The default row of `ListViewV2.Content`: the same row as `ListViewV2.Content.Row`. */
3
+ declare function RowItem({ item, className, onPress: onPressProp, readonly: readonlyProp, }: IRowItemProps<any> & {
3
4
  className?: string;
4
5
  }): import("react").JSX.Element;
5
- export default RowItem;
6
+ declare const _default: import("react").MemoExoticComponent<typeof RowItem>;
7
+ export default _default;
@@ -1,11 +1,96 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import Pressable from "../primitives/Pressable.js";
2
3
  import { cn } from "../theme/tw.js";
3
4
  import { Typography } from "../Typography/index.js";
4
- import { TouchableOpacity, View } from "react-native";
5
- function RowItem({ item, className, onPress = item.onPress, readonly = item.readonly, }) {
6
- function rowContent() {
7
- return (_jsxs(View, { className: "flex-1", children: [_jsx(Typography.Text, { className: "flex-1", variant: "title", children: item.rowTitle }), _jsx(Typography.Text, { className: "mt-0.5 text-text-secondary", variant: "bodySmall", children: item.rowSubtitle })] }));
8
- }
9
- return readonly ? (_jsx(View, { className: cn("flex-row items-center py-2.5", className), children: rowContent() })) : (_jsx(TouchableOpacity, { className: cn("flex-row items-center py-2.5", className), onPress: onPress, children: rowContent() }));
5
+ import { memo } from "react";
6
+ import { View } from "react-native";
7
+
8
+ /** The default row of `ListViewV2.Content`: the same row as `ListViewV2.Content.Row`. */
9
+ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
10
+ function RowItem(t0) {
11
+ const $ = _c(15);
12
+ const {
13
+ item,
14
+ className,
15
+ onPress: onPressProp,
16
+ readonly: readonlyProp
17
+ } = t0;
18
+ const onPress = onPressProp === undefined ? item.onPress : onPressProp;
19
+ const readonly = readonlyProp === undefined ? item.readonly : readonlyProp;
20
+ let t1;
21
+ if ($[0] !== className) {
22
+ t1 = cn("flex-row items-center py-3 px-4 bg-bg-card border-b border-border-default", className);
23
+ $[0] = className;
24
+ $[1] = t1;
25
+ } else {
26
+ t1 = $[1];
27
+ }
28
+ let t2;
29
+ if ($[2] !== item.rowTitle) {
30
+ t2 = _jsx(Typography.Text, {
31
+ numberOfLines: 1,
32
+ semibold: true,
33
+ variant: "body",
34
+ children: item.rowTitle
35
+ });
36
+ $[2] = item.rowTitle;
37
+ $[3] = t2;
38
+ } else {
39
+ t2 = $[3];
40
+ }
41
+ let t3;
42
+ if ($[4] !== item.rowSubtitle) {
43
+ t3 = item.rowSubtitle ? _jsx(Typography.Text, {
44
+ className: "text-text-secondary",
45
+ variant: "bodySmall",
46
+ children: item.rowSubtitle
47
+ }) : null;
48
+ $[4] = item.rowSubtitle;
49
+ $[5] = t3;
50
+ } else {
51
+ t3 = $[5];
52
+ }
53
+ let t4;
54
+ if ($[6] !== t2 || $[7] !== t3) {
55
+ t4 = _jsxs(View, {
56
+ className: "flex-1 gap-0.5",
57
+ children: [t2, t3]
58
+ });
59
+ $[6] = t2;
60
+ $[7] = t3;
61
+ $[8] = t4;
62
+ } else {
63
+ t4 = $[8];
64
+ }
65
+ let t5;
66
+ if ($[9] !== t1 || $[10] !== t4) {
67
+ t5 = _jsx(View, {
68
+ className: t1,
69
+ children: t4
70
+ });
71
+ $[9] = t1;
72
+ $[10] = t4;
73
+ $[11] = t5;
74
+ } else {
75
+ t5 = $[11];
76
+ }
77
+ const content = t5;
78
+ if (readonly) {
79
+ return content;
80
+ }
81
+ let t6;
82
+ if ($[12] !== content || $[13] !== onPress) {
83
+ t6 = _jsx(Pressable, {
84
+ hitSlop: 0,
85
+ onPress: onPress,
86
+ children: content
87
+ });
88
+ $[12] = content;
89
+ $[13] = onPress;
90
+ $[14] = t6;
91
+ } else {
92
+ t6 = $[14];
93
+ }
94
+ return t6;
10
95
  }
11
- export default RowItem;
96
+ export default memo(RowItem);