@sincpro/mobile-ui 3.0.0 → 3.1.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 (308) 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 +449 -61
  15. package/dist/Dialog/Dialog.Sheet.d.ts +7 -3
  16. package/dist/Dialog/Dialog.Sheet.js +231 -15
  17. package/dist/Dialog/OverlayHost.d.ts +23 -0
  18. package/dist/Dialog/OverlayHost.js +196 -0
  19. package/dist/Dialog/SheetSurface.d.ts +24 -0
  20. package/dist/Dialog/SheetSurface.js +441 -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 +141 -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 +5 -1
  98. package/dist/Display/icon-map.js +340 -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 +505 -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 +478 -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 +182 -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 +562 -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.js +132 -24
  154. package/dist/Form/Form.Select.js +487 -56
  155. package/dist/Form/Form.Slider.js +133 -10
  156. package/dist/Form/Form.Switch.js +99 -4
  157. package/dist/Form/index.d.ts +11 -6
  158. package/dist/Form/index.js +26 -27
  159. package/dist/Form/input-text.d.ts +7 -0
  160. package/dist/Form/input-text.js +18 -0
  161. package/dist/Navigation/Navigation.AppBar.d.ts +3 -4
  162. package/dist/Navigation/Navigation.AppBar.js +535 -99
  163. package/dist/Navigation/Navigation.BottomNav.js +363 -98
  164. package/dist/Navigation/Navigation.CollapsingHeader.d.ts +28 -13
  165. package/dist/Navigation/Navigation.CollapsingHeader.js +369 -36
  166. package/dist/Navigation/Navigation.FloatingBar.js +71 -11
  167. package/dist/Navigation/Navigation.Menu.js +309 -95
  168. package/dist/Navigation/Navigation.MenuSection.js +80 -11
  169. package/dist/Navigation/Navigation.RowItem.d.ts +4 -2
  170. package/dist/Navigation/Navigation.RowItem.js +93 -8
  171. package/dist/Navigation/Navigation.Search.js +241 -27
  172. package/dist/Navigation/Navigation.SearchBar.d.ts +7 -1
  173. package/dist/Navigation/Navigation.SearchBar.js +218 -29
  174. package/dist/Navigation/Navigation.SearchSuggestions.js +77 -3
  175. package/dist/Navigation/Navigation.SegmentedControl.js +152 -14
  176. package/dist/Navigation/Navigation.Steps.js +105 -11
  177. package/dist/Navigation/Navigation.Tabs.js +449 -41
  178. package/dist/Navigation/index.d.ts +9 -4
  179. package/dist/Navigation/index.js +13 -13
  180. package/dist/Typography/Typography.Heading.js +33 -3
  181. package/dist/Typography/Typography.SelectableText.js +95 -7
  182. package/dist/Typography/Typography.Text.d.ts +4 -2
  183. package/dist/Typography/Typography.Text.js +217 -7
  184. package/dist/Typography/index.js +3 -3
  185. package/dist/branding.js +29 -13
  186. package/dist/icons/AddItemIcon.js +76 -2
  187. package/dist/icons/ArrangeCircle.js +82 -2
  188. package/dist/icons/ArrowDownIcon.js +63 -3
  189. package/dist/icons/ArrowUpIcon.js +63 -3
  190. package/dist/icons/BoxIcon.js +64 -2
  191. package/dist/icons/BoxTimeIcon.js +63 -2
  192. package/dist/icons/CalendarIcon.js +145 -2
  193. package/dist/icons/CardIcon.js +80 -2
  194. package/dist/icons/CashierIcon.js +39 -2
  195. package/dist/icons/CreditIcon.js +76 -3
  196. package/dist/icons/DuoIcon.js +75 -2
  197. package/dist/icons/HomeIcon.js +39 -2
  198. package/dist/icons/HomeIconOutlined.js +53 -2
  199. package/dist/icons/LogoIcon.js +87 -2
  200. package/dist/icons/MoneyReceiveIcon.js +86 -2
  201. package/dist/icons/PinIcon.js +39 -2
  202. package/dist/icons/ProfileIcon.js +47 -2
  203. package/dist/icons/SettingsIcon.js +114 -2
  204. package/dist/icons/SinpeIcon.js +60 -2
  205. package/dist/icons/ToggleOffIcon.js +53 -2
  206. package/dist/icons/WalletMoneyIcon.js +81 -2
  207. package/dist/index.d.ts +1 -0
  208. package/dist/index.js +8 -2
  209. package/dist/layouts/AuthContainer.d.ts +4 -5
  210. package/dist/layouts/AuthContainer.js +231 -7
  211. package/dist/layouts/BottomInset.js +4 -1
  212. package/dist/layouts/Container.d.ts +2 -2
  213. package/dist/layouts/Container.js +45 -3
  214. package/dist/layouts/GradientContainer.js +37 -5
  215. package/dist/layouts/PlainLayout.js +19 -3
  216. package/dist/layouts/ScrollContainer.d.ts +14 -9
  217. package/dist/layouts/ScrollContainer.js +125 -4
  218. package/dist/layouts/edges.d.ts +2 -0
  219. package/dist/layouts/edges.js +1 -0
  220. package/dist/primitives/AspectRatio.js +75 -3
  221. package/dist/primitives/Box.js +45 -3
  222. package/dist/primitives/Pressable.js +95 -5
  223. package/dist/primitives/Row.js +84 -13
  224. package/dist/primitives/Spacer.js +42 -5
  225. package/dist/primitives/Stack.js +66 -7
  226. package/dist/primitives/index.js +1 -1
  227. package/dist/theme/active.js +20 -18
  228. package/dist/theme/build.js +118 -87
  229. package/dist/theme/color.js +87 -87
  230. package/dist/theme/components/ThemedActivityIndicator.d.ts +2 -15
  231. package/dist/theme/components/ThemedActivityIndicator.js +35 -3
  232. package/dist/theme/components/index.js +1 -0
  233. package/dist/theme/contrast.js +32 -33
  234. package/dist/theme/css-vars.js +71 -75
  235. package/dist/theme/dark.js +116 -97
  236. package/dist/theme/default.js +116 -97
  237. package/dist/theme/define.js +16 -12
  238. package/dist/theme/index.d.ts +1 -0
  239. package/dist/theme/index.js +7 -6
  240. package/dist/theme/on-dark-surface.d.ts +12 -0
  241. package/dist/theme/on-dark-surface.js +13 -0
  242. package/dist/theme/theme.js +1 -0
  243. package/dist/theme/tw.js +3 -1
  244. package/dist/theme/types.js +0 -18
  245. package/dist/theme/typography.d.ts +1 -1
  246. package/dist/theme/typography.js +337 -303
  247. package/dist/theme/useTheme.js +12 -3
  248. package/dist/theme/useThemeVars.d.ts +9 -0
  249. package/dist/theme/useThemeVars.js +23 -0
  250. package/dist/theme/validate.js +175 -166
  251. package/dist/tokens/index.js +1 -1
  252. package/dist/tokens/motion.js +30 -13
  253. package/dist/utils/async.d.ts +14 -0
  254. package/dist/utils/async.js +22 -0
  255. package/dist/utils/criteria.js +66 -85
  256. package/dist/utils/date.d.ts +8 -2
  257. package/dist/utils/date.js +63 -50
  258. package/dist/utils/image.js +8 -8
  259. package/dist/utils/intl.d.ts +1 -0
  260. package/dist/utils/intl.js +13 -0
  261. package/dist/utils/keys.js +3 -5
  262. package/dist/utils/monetary.d.ts +1 -0
  263. package/dist/utils/monetary.js +28 -24
  264. package/dist/utils/progress.js +2 -3
  265. package/dist/utils/quantity.js +25 -26
  266. package/dist/utils/reorder.js +11 -20
  267. package/dist/utils/search.d.ts +4 -0
  268. package/dist/utils/search.js +12 -0
  269. package/dist/utils/serializer.js +38 -38
  270. package/dist/utils/useReducedMotion.js +32 -30
  271. package/dist/views/AppSplashView.js +117 -3
  272. package/dist/views/AuthFormView.d.ts +4 -5
  273. package/dist/views/AuthFormView.js +119 -11
  274. package/dist/views/FormViewV2.context.js +75 -23
  275. package/dist/views/FormViewV2.d.ts +4 -5
  276. package/dist/views/FormViewV2.js +658 -92
  277. package/dist/views/ListViewV2.context.js +91 -47
  278. package/dist/views/ListViewV2.d.ts +84 -43
  279. package/dist/views/ListViewV2.js +1350 -200
  280. package/dist/views/Wizard/Wizard.context.js +248 -84
  281. package/dist/views/Wizard/Wizard.js +260 -67
  282. package/dist/views/types/IListView.js +34 -31
  283. package/dist/widgets/CollectionOptions.js +557 -138
  284. package/dist/widgets/FilterBar.js +159 -7
  285. package/dist/widgets/FilterBuilder.js +375 -102
  286. package/dist/widgets/JSONViewer.js +275 -129
  287. package/dist/widgets/PromoBanner.js +336 -42
  288. package/dist/widgets/PromoModal.d.ts +2 -2
  289. package/dist/widgets/PromoModal.js +389 -62
  290. package/dist/widgets/QueryChoice.js +150 -8
  291. package/dist/widgets/QuickActions.js +120 -31
  292. package/dist/widgets/ReorderableList.js +399 -128
  293. package/dist/widgets/TimeZoneSelectorModal.js +458 -51
  294. package/dist/widgets/index.js +3 -3
  295. package/package.json +7 -2
  296. package/tailwind.preset.js +7 -5
  297. package/dist/Form/Form.InputField.d.ts +0 -10
  298. package/dist/Form/Form.InputField.js +0 -38
  299. package/dist/Form/Form.KeyboardToolbar.d.ts +0 -22
  300. package/dist/Form/Form.KeyboardToolbar.js +0 -66
  301. package/dist/Form/Form.PasswordInput.d.ts +0 -9
  302. package/dist/Form/Form.PasswordInput.js +0 -17
  303. package/dist/Form/Form.TextInput.d.ts +0 -8
  304. package/dist/Form/Form.TextInput.js +0 -8
  305. package/dist/primitives/BaseButton.d.ts +0 -150
  306. package/dist/primitives/BaseButton.js +0 -229
  307. package/dist/utils/useSheetTranslation.d.ts +0 -5
  308. package/dist/utils/useSheetTranslation.js +0 -23
@@ -1,78 +1,301 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import Icon from "./Display.Icon.js";
3
3
  import Pressable from "../primitives/Pressable.js";
4
4
  import { useTheme } from "../theme/index.js";
5
5
  import { Typography } from "../Typography/index.js";
6
+ import { attempt } from "../utils/async.js";
6
7
  import * as Clipboard from "expo-clipboard";
7
8
  import { useEffect, useRef, useState } from "react";
8
9
  import { AccessibilityInfo, ActivityIndicator, View } from "react-native";
9
- function CopyableText({ value, getValue, label, className, accessibilityLabel, testID, disabled = false, onCopied, onCopyError, selectable = false, }) {
10
- const theme = useTheme();
11
- const pending = useRef(false);
12
- const [status, setStatus] = useState("idle");
13
- const [copiedValue, setCopiedValue] = useState();
14
- const hasStaticValue = value !== undefined;
15
- const isCopied = status === "copied" && (!hasStaticValue || copiedValue === value);
16
- const displayText = label || value || "Copiar";
17
- const copyLabel = accessibilityLabel ?? `Copiar ${displayText}`;
18
- useEffect(() => {
19
- if (status !== "copied")
20
- return;
21
- const timer = setTimeout(() => setStatus("idle"), 3000);
22
- return () => clearTimeout(timer);
23
- }, [status]);
24
- const handleCopy = async () => {
25
- if (pending.current || disabled)
26
- return;
27
- pending.current = true;
28
- setStatus("copying");
29
- let textToCopy;
30
- try {
31
- textToCopy = hasStaticValue ? value : getValue();
32
- const copied = await Clipboard.setStringAsync(textToCopy);
33
- if (!copied)
34
- throw new Error("El portapapeles no pudo copiar el texto");
35
- }
36
- catch (cause) {
37
- const error = cause instanceof Error ? cause : new Error(String(cause));
38
- setStatus("error");
39
- AccessibilityInfo.announceForAccessibility("No se pudo copiar. Toca para reintentar.");
40
- pending.current = false;
41
- console.error("CopyableText: no se pudo copiar", error);
42
- onCopyError?.(error);
43
- return;
10
+ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
11
+ function CopyableText(t0) {
12
+ const $ = _c(56);
13
+ const {
14
+ value,
15
+ getValue,
16
+ label,
17
+ className,
18
+ accessibilityLabel,
19
+ testID,
20
+ disabled: t1,
21
+ onCopied,
22
+ onCopyError,
23
+ selectable: t2
24
+ } = t0;
25
+ const disabled = t1 === undefined ? false : t1;
26
+ const selectable = t2 === undefined ? false : t2;
27
+ const theme = useTheme();
28
+ const pending = useRef(false);
29
+ const [status, setStatus] = useState("idle");
30
+ const [copiedValue, setCopiedValue] = useState();
31
+ const hasStaticValue = value !== undefined;
32
+ const isCopied = status === "copied" && (!hasStaticValue || copiedValue === value);
33
+ const displayText = label || value || "Copiar";
34
+ const copyLabel = accessibilityLabel ?? `Copiar ${displayText}`;
35
+ let t3;
36
+ let t4;
37
+ if ($[0] !== status) {
38
+ t3 = () => {
39
+ if (status !== "copied") {
40
+ return;
41
+ }
42
+ const timer = setTimeout(() => setStatus("idle"), 3000);
43
+ return () => clearTimeout(timer);
44
+ };
45
+ t4 = [status];
46
+ $[0] = status;
47
+ $[1] = t3;
48
+ $[2] = t4;
49
+ } else {
50
+ t3 = $[1];
51
+ t4 = $[2];
52
+ }
53
+ useEffect(t3, t4);
54
+ let t5;
55
+ if ($[3] !== disabled || $[4] !== getValue || $[5] !== hasStaticValue || $[6] !== onCopied || $[7] !== onCopyError || $[8] !== value) {
56
+ t5 = async () => {
57
+ if (pending.current || disabled) {
58
+ return;
59
+ }
60
+ pending.current = true;
61
+ setStatus("copying");
62
+ const result = await attempt(async () => {
63
+ const text = hasStaticValue ? value : getValue();
64
+ const copied = await Clipboard.setStringAsync(text);
65
+ if (!copied) {
66
+ throw new Error("El portapapeles no pudo copiar el texto");
44
67
  }
68
+ return text;
69
+ });
70
+ if (!result.ok) {
71
+ const cause = result.error;
72
+ const error = cause instanceof Error ? cause : new Error(String(cause));
73
+ setStatus("error");
74
+ AccessibilityInfo.announceForAccessibility("No se pudo copiar. Toca para reintentar.");
45
75
  pending.current = false;
46
- setCopiedValue(textToCopy);
47
- setStatus("copied");
48
- AccessibilityInfo.announceForAccessibility("Copiado");
49
- onCopied?.(textToCopy);
76
+ console.error("CopyableText: no se pudo copiar", error);
77
+ onCopyError?.(error);
78
+ return;
79
+ }
80
+ const textToCopy = result.value;
81
+ pending.current = false;
82
+ setCopiedValue(textToCopy);
83
+ setStatus("copied");
84
+ AccessibilityInfo.announceForAccessibility("Copiado");
85
+ onCopied?.(textToCopy);
86
+ };
87
+ $[3] = disabled;
88
+ $[4] = getValue;
89
+ $[5] = hasStaticValue;
90
+ $[6] = onCopied;
91
+ $[7] = onCopyError;
92
+ $[8] = value;
93
+ $[9] = t5;
94
+ } else {
95
+ t5 = $[9];
96
+ }
97
+ const handleCopy = t5;
98
+ const t6 = selectable ? "flex-start" : "center";
99
+ let t7;
100
+ if ($[10] !== t6) {
101
+ t7 = {
102
+ flexDirection: "row",
103
+ alignItems: t6,
104
+ gap: 8
105
+ };
106
+ $[10] = t6;
107
+ $[11] = t7;
108
+ } else {
109
+ t7 = $[11];
110
+ }
111
+ let t8;
112
+ if ($[12] !== className || $[13] !== displayText || $[14] !== selectable) {
113
+ t8 = selectable ? _jsx(Typography.SelectableText, {
114
+ className: className,
115
+ style: {
116
+ flex: 1
117
+ },
118
+ value: displayText,
119
+ variant: "body"
120
+ }) : null;
121
+ $[12] = className;
122
+ $[13] = displayText;
123
+ $[14] = selectable;
124
+ $[15] = t8;
125
+ } else {
126
+ t8 = $[15];
127
+ }
128
+ const t9 = selectable ? "Copia el texto completo" : "Toca para copiar";
129
+ const t10 = isCopied ? `${copyLabel}. Copiado` : copyLabel;
130
+ const t11 = disabled || status === "copying";
131
+ const t12 = status === "copying";
132
+ let t13;
133
+ if ($[16] !== t11 || $[17] !== t12) {
134
+ t13 = {
135
+ disabled: t11,
136
+ busy: t12
137
+ };
138
+ $[16] = t11;
139
+ $[17] = t12;
140
+ $[18] = t13;
141
+ } else {
142
+ t13 = $[18];
143
+ }
144
+ const t14 = isCopied ? "Copiado" : status === "copying" ? "Copiando" : status === "error" ? "Error al copiar" : "";
145
+ let t15;
146
+ if ($[19] !== t14) {
147
+ t15 = {
148
+ text: t14
149
+ };
150
+ $[19] = t14;
151
+ $[20] = t15;
152
+ } else {
153
+ t15 = $[20];
154
+ }
155
+ const t16 = disabled || status === "copying";
156
+ let t17;
157
+ if ($[21] !== handleCopy) {
158
+ t17 = () => {
159
+ handleCopy();
160
+ };
161
+ $[21] = handleCopy;
162
+ $[22] = t17;
163
+ } else {
164
+ t17 = $[22];
165
+ }
166
+ const t18 = selectable ? "center" : "flex-start";
167
+ const t19 = selectable ? 0 : 1;
168
+ let t20;
169
+ if ($[23] !== t18 || $[24] !== t19) {
170
+ t20 = {
171
+ minHeight: 48,
172
+ minWidth: 48,
173
+ flexDirection: "row",
174
+ alignItems: "center",
175
+ justifyContent: t18,
176
+ gap: 8,
177
+ flexShrink: t19
178
+ };
179
+ $[23] = t18;
180
+ $[24] = t19;
181
+ $[25] = t20;
182
+ } else {
183
+ t20 = $[25];
184
+ }
185
+ let t21;
186
+ if ($[26] !== className || $[27] !== displayText || $[28] !== selectable) {
187
+ t21 = !selectable ? _jsx(Typography.Text, {
188
+ className: className,
189
+ style: {
190
+ flexShrink: 1
191
+ },
192
+ variant: "body",
193
+ children: displayText
194
+ }) : null;
195
+ $[26] = className;
196
+ $[27] = displayText;
197
+ $[28] = selectable;
198
+ $[29] = t21;
199
+ } else {
200
+ t21 = $[29];
201
+ }
202
+ let t22;
203
+ if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
204
+ t22 = {
205
+ width: 24,
206
+ alignItems: "center"
50
207
  };
51
- return (_jsxs(View, { children: [_jsxs(View, { style: {
52
- flexDirection: "row",
53
- alignItems: selectable ? "flex-start" : "center",
54
- gap: 8,
55
- }, children: [selectable ? (_jsx(Typography.SelectableText, { className: className, style: { flex: 1 }, value: displayText, variant: "body" })) : null, _jsxs(Pressable, { accessibilityHint: selectable ? "Copia el texto completo" : "Toca para copiar", accessibilityLabel: isCopied ? `${copyLabel}. Copiado` : copyLabel, accessibilityState: {
56
- disabled: disabled || status === "copying",
57
- busy: status === "copying",
58
- }, accessibilityValue: {
59
- text: isCopied
60
- ? "Copiado"
61
- : status === "copying"
62
- ? "Copiando"
63
- : status === "error"
64
- ? "Error al copiar"
65
- : "",
66
- }, disabled: disabled || status === "copying", onPress: () => {
67
- void handleCopy();
68
- }, style: {
69
- minHeight: 48,
70
- minWidth: 48,
71
- flexDirection: "row",
72
- alignItems: "center",
73
- justifyContent: selectable ? "center" : "flex-start",
74
- gap: 8,
75
- flexShrink: selectable ? 0 : 1,
76
- }, testID: testID, children: [!selectable ? (_jsx(Typography.Text, { className: className, style: { flexShrink: 1 }, variant: "body", children: displayText })) : null, _jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: { width: 24, alignItems: "center" }, children: status === "copying" ? (_jsx(ActivityIndicator, { color: theme.text.accent, size: "small" })) : (_jsx(Icon, { color: isCopied ? theme.success : theme.text.accent, name: isCopied ? "check" : status === "error" ? "error" : "copy", size: 20 })) })] })] }), status === "error" ? (_jsx(Typography.Text, { accessibilityLiveRegion: "polite", className: "text-danger", variant: "bodySmall", children: "No se pudo copiar. Toca para reintentar." })) : null] }));
208
+ $[30] = t22;
209
+ } else {
210
+ t22 = $[30];
211
+ }
212
+ let t23;
213
+ if ($[31] !== isCopied || $[32] !== status || $[33] !== theme.success || $[34] !== theme.text) {
214
+ t23 = _jsx(View, {
215
+ accessibilityElementsHidden: true,
216
+ importantForAccessibility: "no-hide-descendants",
217
+ style: t22,
218
+ children: status === "copying" ? _jsx(ActivityIndicator, {
219
+ color: theme.text.accent,
220
+ size: "small"
221
+ }) : _jsx(Icon, {
222
+ color: isCopied ? theme.success : theme.text.accent,
223
+ name: isCopied ? "check" : status === "error" ? "error" : "copy",
224
+ size: 20
225
+ })
226
+ });
227
+ $[31] = isCopied;
228
+ $[32] = status;
229
+ $[33] = theme.success;
230
+ $[34] = theme.text;
231
+ $[35] = t23;
232
+ } else {
233
+ t23 = $[35];
234
+ }
235
+ let t24;
236
+ if ($[36] !== t10 || $[37] !== t13 || $[38] !== t15 || $[39] !== t16 || $[40] !== t17 || $[41] !== t20 || $[42] !== t21 || $[43] !== t23 || $[44] !== t9 || $[45] !== testID) {
237
+ t24 = _jsxs(Pressable, {
238
+ accessibilityHint: t9,
239
+ accessibilityLabel: t10,
240
+ accessibilityState: t13,
241
+ accessibilityValue: t15,
242
+ disabled: t16,
243
+ onPress: t17,
244
+ style: t20,
245
+ testID: testID,
246
+ children: [t21, t23]
247
+ });
248
+ $[36] = t10;
249
+ $[37] = t13;
250
+ $[38] = t15;
251
+ $[39] = t16;
252
+ $[40] = t17;
253
+ $[41] = t20;
254
+ $[42] = t21;
255
+ $[43] = t23;
256
+ $[44] = t9;
257
+ $[45] = testID;
258
+ $[46] = t24;
259
+ } else {
260
+ t24 = $[46];
261
+ }
262
+ let t25;
263
+ if ($[47] !== t24 || $[48] !== t7 || $[49] !== t8) {
264
+ t25 = _jsxs(View, {
265
+ style: t7,
266
+ children: [t8, t24]
267
+ });
268
+ $[47] = t24;
269
+ $[48] = t7;
270
+ $[49] = t8;
271
+ $[50] = t25;
272
+ } else {
273
+ t25 = $[50];
274
+ }
275
+ let t26;
276
+ if ($[51] !== status) {
277
+ t26 = status === "error" ? _jsx(Typography.Text, {
278
+ accessibilityLiveRegion: "polite",
279
+ className: "text-danger",
280
+ variant: "bodySmall",
281
+ children: "No se pudo copiar. Toca para reintentar."
282
+ }) : null;
283
+ $[51] = status;
284
+ $[52] = t26;
285
+ } else {
286
+ t26 = $[52];
287
+ }
288
+ let t27;
289
+ if ($[53] !== t25 || $[54] !== t26) {
290
+ t27 = _jsxs(View, {
291
+ children: [t25, t26]
292
+ });
293
+ $[53] = t25;
294
+ $[54] = t26;
295
+ $[55] = t27;
296
+ } else {
297
+ t27 = $[55];
298
+ }
299
+ return t27;
77
300
  }
78
301
  export default CopyableText;
@@ -1,8 +1,65 @@
1
- import { jsxs as _jsxs } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { cn } from "../theme/tw.js";
3
3
  import { Typography } from "../Typography/index.js";
4
4
  import { View } from "react-native";
5
- function CountRecords({ name, count, withPadding = true, className }) {
6
- return (_jsxs(View, { className: cn("flex-row py-2", withPadding && "px-4", className), children: [_jsxs(Typography.Text, { semibold: true, variant: "bodySmall", children: ["Total ", " ", `${name || "Registros"} `] }), _jsxs(Typography.Text, { className: "text-text-secondary", variant: "bodySmall", children: ["( ", count, " )"] })] }));
5
+ import { jsxs as _jsxs } from "nativewind/jsx-runtime";
6
+ function CountRecords(t0) {
7
+ const $ = _c(11);
8
+ const {
9
+ name,
10
+ count,
11
+ withPadding: t1,
12
+ className
13
+ } = t0;
14
+ const withPadding = t1 === undefined ? true : t1;
15
+ const t2 = withPadding && "px-4";
16
+ let t3;
17
+ if ($[0] !== className || $[1] !== t2) {
18
+ t3 = cn("flex-row py-2", t2, className);
19
+ $[0] = className;
20
+ $[1] = t2;
21
+ $[2] = t3;
22
+ } else {
23
+ t3 = $[2];
24
+ }
25
+ const t4 = `${name || "Registros"} `;
26
+ let t5;
27
+ if ($[3] !== t4) {
28
+ t5 = _jsxs(Typography.Text, {
29
+ semibold: true,
30
+ variant: "bodySmall",
31
+ children: ["Total ", " ", t4]
32
+ });
33
+ $[3] = t4;
34
+ $[4] = t5;
35
+ } else {
36
+ t5 = $[4];
37
+ }
38
+ let t6;
39
+ if ($[5] !== count) {
40
+ t6 = _jsxs(Typography.Text, {
41
+ className: "text-text-secondary",
42
+ variant: "bodySmall",
43
+ children: ["( ", count, " )"]
44
+ });
45
+ $[5] = count;
46
+ $[6] = t6;
47
+ } else {
48
+ t6 = $[6];
49
+ }
50
+ let t7;
51
+ if ($[7] !== t3 || $[8] !== t5 || $[9] !== t6) {
52
+ t7 = _jsxs(View, {
53
+ className: t3,
54
+ children: [t5, t6]
55
+ });
56
+ $[7] = t3;
57
+ $[8] = t5;
58
+ $[9] = t6;
59
+ $[10] = t7;
60
+ } else {
61
+ t7 = $[10];
62
+ }
63
+ return t7;
7
64
  }
8
65
  export default CountRecords;
@@ -1,22 +1,132 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { cn } from "../theme/tw.js";
3
3
  import { Typography } from "../Typography/index.js";
4
4
  import { ScrollView, View } from "react-native";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
5
6
  const alignClass = {
6
- left: "text-left",
7
- right: "text-right",
8
- center: "text-center",
7
+ left: "text-left",
8
+ right: "text-right",
9
+ center: "text-center"
9
10
  };
10
11
  function cellValue(col, row) {
11
- if (col.render)
12
- return col.render(row);
13
- const raw = row[col.key];
14
- return raw == null ? "" : String(raw);
12
+ if (col.render) return col.render(row);
13
+ const raw = row[col.key];
14
+ return raw == null ? "" : String(raw);
15
+ }
16
+ function DataTable(t0) {
17
+ const $ = _c(19);
18
+ const {
19
+ columns,
20
+ data,
21
+ keyExtractor,
22
+ footer,
23
+ emptyText: t1,
24
+ className,
25
+ testID
26
+ } = t0;
27
+ const emptyText = t1 === undefined ? "Sin datos" : t1;
28
+ let t2;
29
+ if ($[0] !== className) {
30
+ t2 = cn("bg-bg-card rounded-lg border border-border-light overflow-hidden", className);
31
+ $[0] = className;
32
+ $[1] = t2;
33
+ } else {
34
+ t2 = $[1];
35
+ }
36
+ let t3;
37
+ if ($[2] !== columns) {
38
+ t3 = columns.map(_temp);
39
+ $[2] = columns;
40
+ $[3] = t3;
41
+ } else {
42
+ t3 = $[3];
43
+ }
44
+ let t4;
45
+ if ($[4] !== t3) {
46
+ t4 = _jsx(View, {
47
+ className: "flex-row bg-bg-muted px-3 py-2.5",
48
+ children: t3
49
+ });
50
+ $[4] = t3;
51
+ $[5] = t4;
52
+ } else {
53
+ t4 = $[5];
54
+ }
55
+ let t5;
56
+ if ($[6] !== columns || $[7] !== data || $[8] !== emptyText || $[9] !== keyExtractor) {
57
+ t5 = data.length === 0 ? _jsx(View, {
58
+ className: "px-3 py-6 items-center",
59
+ children: _jsx(Typography.Text, {
60
+ className: "text-text-tertiary",
61
+ variant: "bodySmall",
62
+ children: emptyText
63
+ })
64
+ }) : _jsx(ScrollView, {
65
+ children: data.map((row, index) => _jsx(View, {
66
+ className: "flex-row px-3 py-3 border-t border-border-light",
67
+ children: columns.map(col_0 => {
68
+ const content = cellValue(col_0, row);
69
+ return _jsx(View, {
70
+ style: {
71
+ flex: col_0.flex ?? 1
72
+ },
73
+ children: typeof content === "string" || typeof content === "number" ? _jsx(Typography.Text, {
74
+ className: cn("text-text-primary", alignClass[col_0.align ?? "left"]),
75
+ variant: "bodySmall",
76
+ children: content
77
+ }) : content
78
+ }, col_0.key);
79
+ })
80
+ }, keyExtractor(row, index)))
81
+ });
82
+ $[6] = columns;
83
+ $[7] = data;
84
+ $[8] = emptyText;
85
+ $[9] = keyExtractor;
86
+ $[10] = t5;
87
+ } else {
88
+ t5 = $[10];
89
+ }
90
+ let t6;
91
+ if ($[11] !== footer) {
92
+ t6 = footer ? _jsx(View, {
93
+ className: "flex-row px-3 py-3 border-t border-border-default bg-bg-muted",
94
+ children: footer
95
+ }) : null;
96
+ $[11] = footer;
97
+ $[12] = t6;
98
+ } else {
99
+ t6 = $[12];
100
+ }
101
+ let t7;
102
+ if ($[13] !== t2 || $[14] !== t4 || $[15] !== t5 || $[16] !== t6 || $[17] !== testID) {
103
+ t7 = _jsxs(View, {
104
+ className: t2,
105
+ testID: testID,
106
+ children: [t4, t5, t6]
107
+ });
108
+ $[13] = t2;
109
+ $[14] = t4;
110
+ $[15] = t5;
111
+ $[16] = t6;
112
+ $[17] = testID;
113
+ $[18] = t7;
114
+ } else {
115
+ t7 = $[18];
116
+ }
117
+ return t7;
15
118
  }
16
- function DataTable({ columns, data, keyExtractor, footer, emptyText = "Sin datos", className, testID, }) {
17
- return (_jsxs(View, { className: cn("bg-bg-card rounded-lg border border-border-light overflow-hidden", className), testID: testID, children: [_jsx(View, { className: "flex-row bg-bg-muted px-3 py-2.5", children: columns.map((col) => (_jsx(View, { style: { flex: col.flex ?? 1 }, children: _jsx(Typography.Text, { className: cn("text-text-secondary font-semibold", alignClass[col.align ?? "left"]), numberOfLines: 1, variant: "caption", children: col.header }) }, col.key))) }), data.length === 0 ? (_jsx(View, { className: "px-3 py-6 items-center", children: _jsx(Typography.Text, { className: "text-text-tertiary", variant: "bodySmall", children: emptyText }) })) : (_jsx(ScrollView, { children: data.map((row, index) => (_jsx(View, { className: "flex-row px-3 py-3 border-t border-border-light", children: columns.map((col) => {
18
- const content = cellValue(col, row);
19
- return (_jsx(View, { style: { flex: col.flex ?? 1 }, children: typeof content === "string" || typeof content === "number" ? (_jsx(Typography.Text, { className: cn("text-text-primary", alignClass[col.align ?? "left"]), variant: "bodySmall", children: content })) : (content) }, col.key));
20
- }) }, keyExtractor(row, index)))) })), footer ? (_jsx(View, { className: "flex-row px-3 py-3 border-t border-border-default bg-bg-muted", children: footer })) : null] }));
119
+ function _temp(col) {
120
+ return _jsx(View, {
121
+ style: {
122
+ flex: col.flex ?? 1
123
+ },
124
+ children: _jsx(Typography.Text, {
125
+ className: cn("text-text-secondary", alignClass[col.align ?? "left"]),
126
+ numberOfLines: 1,
127
+ variant: "caption",
128
+ children: col.header
129
+ })
130
+ }, col.key);
21
131
  }
22
132
  export default DataTable;