@sincpro/mobile-ui 0.2.0 → 0.3.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 (234) hide show
  1. package/README.md +76 -19
  2. package/dist/Dialog/BottomSheet/BottomSheet.Root.d.ts +11 -7
  3. package/dist/Dialog/BottomSheet/BottomSheet.Root.js +4 -0
  4. package/dist/Dialog/Confirmation.context.d.ts +1 -1
  5. package/dist/Dialog/Dialog.ActionSheet.d.ts +17 -0
  6. package/dist/Dialog/Dialog.ActionSheet.js +16 -0
  7. package/dist/Dialog/Dialog.EditValue.d.ts +1 -1
  8. package/dist/Dialog/Dialog.Sheet.d.ts +26 -0
  9. package/dist/Dialog/Dialog.Sheet.js +55 -0
  10. package/dist/Dialog/index.d.ts +9 -7
  11. package/dist/Dialog/index.js +2 -0
  12. package/dist/Display/Display.Accordion.d.ts +18 -0
  13. package/dist/Display/Display.Accordion.js +22 -0
  14. package/dist/Display/Display.AvatarGroup.d.ts +12 -0
  15. package/dist/Display/Display.AvatarGroup.js +23 -0
  16. package/dist/Display/Display.Badge.d.ts +1 -1
  17. package/dist/Display/Display.Card.d.ts +46 -0
  18. package/dist/Display/Display.Card.js +36 -0
  19. package/dist/Display/Display.Carousel.d.ts +13 -0
  20. package/dist/Display/Display.Carousel.js +19 -0
  21. package/dist/Display/Display.Chip.d.ts +105 -0
  22. package/dist/Display/Display.Chip.js +45 -0
  23. package/dist/Display/Display.CopyableText.d.ts +1 -1
  24. package/dist/Display/Display.CountRecords.d.ts +1 -1
  25. package/dist/Display/Display.DataTable.d.ts +19 -0
  26. package/dist/Display/Display.DataTable.js +22 -0
  27. package/dist/Display/Display.Date.d.ts +15 -2
  28. package/dist/Display/Display.Date.js +34 -4
  29. package/dist/Display/Display.Divider.d.ts +1 -1
  30. package/dist/Display/Display.IconBadge.d.ts +13 -0
  31. package/dist/Display/Display.IconBadge.js +30 -0
  32. package/dist/Display/Display.Image.d.ts +15 -0
  33. package/dist/Display/Display.Image.js +17 -0
  34. package/dist/Display/Display.KeyValue.d.ts +10 -0
  35. package/dist/Display/Display.KeyValue.js +9 -0
  36. package/dist/Display/Display.ListItem.d.ts +13 -0
  37. package/dist/Display/Display.ListItem.js +14 -0
  38. package/dist/Display/Display.Logo.js +3 -1
  39. package/dist/Display/Display.MediaCard.d.ts +17 -0
  40. package/dist/Display/Display.MediaCard.js +12 -0
  41. package/dist/Display/Display.MediaEmbed.d.ts +19 -0
  42. package/dist/Display/Display.MediaEmbed.js +39 -0
  43. package/dist/Display/Display.MenuButton.d.ts +1 -1
  44. package/dist/Display/Display.Monetary.d.ts +1 -1
  45. package/dist/Display/Display.PriceTag.d.ts +10 -0
  46. package/dist/Display/Display.PriceTag.js +23 -0
  47. package/dist/Display/Display.ProductCard.d.ts +17 -0
  48. package/dist/Display/Display.ProductCard.js +13 -0
  49. package/dist/Display/Display.Rating.d.ts +11 -0
  50. package/dist/Display/Display.Rating.js +16 -0
  51. package/dist/Display/Display.SearchHistory.d.ts +12 -0
  52. package/dist/Display/Display.SearchHistory.js +13 -0
  53. package/dist/Display/Display.SectionHeader.d.ts +13 -0
  54. package/dist/Display/Display.SectionHeader.js +9 -0
  55. package/dist/Display/Display.Stat.d.ts +10 -0
  56. package/dist/Display/Display.Stat.js +9 -0
  57. package/dist/Display/Display.StatCard.d.ts +14 -0
  58. package/dist/Display/Display.StatCard.js +13 -0
  59. package/dist/Display/Display.StatusDot.d.ts +11 -0
  60. package/dist/Display/Display.StatusDot.js +28 -0
  61. package/dist/Display/Display.Story.d.ts +15 -0
  62. package/dist/Display/Display.Story.js +43 -0
  63. package/dist/Display/Display.StoryTray.d.ts +26 -0
  64. package/dist/Display/Display.StoryTray.js +43 -0
  65. package/dist/Display/Display.StoryViewer.d.ts +26 -0
  66. package/dist/Display/Display.StoryViewer.js +79 -0
  67. package/dist/Display/Display.SwipeableRow.d.ts +15 -0
  68. package/dist/Display/Display.SwipeableRow.js +28 -0
  69. package/dist/Display/Display.Tag.d.ts +11 -0
  70. package/dist/Display/Display.Tag.js +9 -0
  71. package/dist/Display/Display.Timeline.d.ts +13 -0
  72. package/dist/Display/Display.Timeline.js +19 -0
  73. package/dist/Display/Display.Tooltip.d.ts +10 -0
  74. package/dist/Display/Display.Tooltip.js +24 -0
  75. package/dist/Display/index.d.ts +66 -0
  76. package/dist/Display/index.js +54 -0
  77. package/dist/Feedback/ErrorBoundary.d.ts +1 -1
  78. package/dist/Feedback/Feedback.Banner.d.ts +82 -0
  79. package/dist/Feedback/Feedback.Banner.js +35 -0
  80. package/dist/Feedback/Feedback.DomainSplashScreen.d.ts +2 -1
  81. package/dist/Feedback/Feedback.DomainSplashScreen.js +1 -1
  82. package/dist/Feedback/Feedback.Empty.d.ts +1 -1
  83. package/dist/Feedback/Feedback.EmptyState.d.ts +15 -0
  84. package/dist/Feedback/Feedback.EmptyState.js +11 -0
  85. package/dist/Feedback/Feedback.Error.d.ts +1 -1
  86. package/dist/Feedback/Feedback.Loading.d.ts +2 -1
  87. package/dist/Feedback/Feedback.PermissionCard.d.ts +15 -0
  88. package/dist/Feedback/Feedback.PermissionCard.js +11 -0
  89. package/dist/Feedback/Feedback.Progress.d.ts +9 -0
  90. package/dist/Feedback/Feedback.Progress.js +35 -0
  91. package/dist/Feedback/Feedback.ProgressCircle.d.ts +12 -0
  92. package/dist/Feedback/Feedback.ProgressCircle.js +15 -0
  93. package/dist/Feedback/Feedback.Skeleton.d.ts +11 -0
  94. package/dist/Feedback/Feedback.Skeleton.js +29 -0
  95. package/dist/Feedback/Feedback.Splash.d.ts +1 -1
  96. package/dist/Feedback/Toast.context.d.ts +35 -0
  97. package/dist/Feedback/Toast.context.js +119 -0
  98. package/dist/Feedback/index.d.ts +15 -0
  99. package/dist/Feedback/index.js +15 -0
  100. package/dist/Form/Form.Button.d.ts +6 -0
  101. package/dist/Form/Form.Button.js +12 -1
  102. package/dist/Form/Form.Checkbox.d.ts +1 -1
  103. package/dist/Form/Form.ControlledCheckbox.d.ts +1 -1
  104. package/dist/Form/Form.ControlledInput.d.ts +1 -1
  105. package/dist/Form/Form.ControlledMonetaryInput.d.ts +1 -1
  106. package/dist/Form/Form.ControlledRadioButton.d.ts +1 -1
  107. package/dist/Form/Form.DatePicker.d.ts +20 -0
  108. package/dist/Form/Form.DatePicker.js +38 -0
  109. package/dist/Form/Form.Dropdown.d.ts +1 -1
  110. package/dist/Form/Form.FAB.d.ts +10 -0
  111. package/dist/Form/Form.FAB.js +17 -0
  112. package/dist/Form/Form.FilterButton.d.ts +1 -1
  113. package/dist/Form/Form.FractionalQuantityInput.d.ts +1 -1
  114. package/dist/Form/Form.IconButton.d.ts +1 -1
  115. package/dist/Form/Form.Input.d.ts +2 -1
  116. package/dist/Form/Form.MonetaryInput.d.ts +1 -1
  117. package/dist/Form/Form.PinInput.d.ts +12 -0
  118. package/dist/Form/Form.PinInput.js +23 -0
  119. package/dist/Form/Form.QuantitySelector.d.ts +2 -1
  120. package/dist/Form/Form.QuantitySelector.js +1 -1
  121. package/dist/Form/Form.RadioButton.d.ts +1 -1
  122. package/dist/Form/Form.SearchBar.d.ts +6 -1
  123. package/dist/Form/Form.SearchBar.js +4 -0
  124. package/dist/Form/Form.Select.d.ts +17 -0
  125. package/dist/Form/Form.Select.js +26 -0
  126. package/dist/Form/Form.Slider.d.ts +20 -0
  127. package/dist/Form/Form.Slider.js +16 -0
  128. package/dist/Form/Form.Switch.d.ts +10 -0
  129. package/dist/Form/Form.Switch.js +9 -0
  130. package/dist/Form/index.d.ts +12 -0
  131. package/dist/Form/index.js +12 -0
  132. package/dist/Navigation/Navigation.AppBar.d.ts +41 -0
  133. package/dist/Navigation/Navigation.AppBar.js +33 -0
  134. package/dist/Navigation/Navigation.BottomNav.d.ts +29 -0
  135. package/dist/Navigation/Navigation.BottomNav.js +35 -0
  136. package/dist/Navigation/Navigation.CollapsingHeader.d.ts +34 -0
  137. package/dist/Navigation/Navigation.CollapsingHeader.js +47 -0
  138. package/dist/Navigation/Navigation.FloatingBar.d.ts +15 -0
  139. package/dist/Navigation/Navigation.FloatingBar.js +21 -0
  140. package/dist/Navigation/Navigation.Header.d.ts +6 -2
  141. package/dist/Navigation/Navigation.Header.js +4 -0
  142. package/dist/Navigation/Navigation.HeaderToolbar.d.ts +1 -1
  143. package/dist/Navigation/Navigation.Menu.d.ts +21 -0
  144. package/dist/Navigation/Navigation.Menu.js +42 -0
  145. package/dist/Navigation/Navigation.RowItem.d.ts +1 -1
  146. package/dist/Navigation/Navigation.SearchBar.d.ts +18 -0
  147. package/dist/Navigation/Navigation.SearchBar.js +22 -0
  148. package/dist/Navigation/Navigation.SegmentedControl.d.ts +14 -0
  149. package/dist/Navigation/Navigation.SegmentedControl.js +13 -0
  150. package/dist/Navigation/Navigation.Steps.d.ts +8 -0
  151. package/dist/Navigation/Navigation.Steps.js +17 -0
  152. package/dist/Navigation/Navigation.TabIcon.d.ts +1 -1
  153. package/dist/Navigation/Navigation.Tabs.d.ts +28 -0
  154. package/dist/Navigation/Navigation.Tabs.js +45 -0
  155. package/dist/Navigation/index.d.ts +32 -1
  156. package/dist/Navigation/index.js +18 -0
  157. package/dist/Typography/Typography.Text.d.ts +2 -1
  158. package/dist/branding.d.ts +6 -0
  159. package/dist/branding.js +7 -0
  160. package/dist/icons/ArrowDownIcon.d.ts +2 -1
  161. package/dist/icons/ArrowUpIcon.d.ts +2 -1
  162. package/dist/icons/CreditIcon.d.ts +1 -1
  163. package/dist/icons/OdooIcon.d.ts +1 -1
  164. package/dist/index.d.ts +1 -0
  165. package/dist/index.js +2 -0
  166. package/dist/layouts/AuthContainer.d.ts +1 -1
  167. package/dist/layouts/Container.d.ts +1 -0
  168. package/dist/layouts/Container.js +2 -3
  169. package/dist/layouts/GradientContainer.d.ts +1 -1
  170. package/dist/layouts/PlainLayout.d.ts +1 -1
  171. package/dist/layouts/ScrollContainer.d.ts +2 -2
  172. package/dist/layouts/ScrollContainer.js +1 -1
  173. package/dist/layouts/TabNavigatorLayout.d.ts +2 -2
  174. package/dist/layouts/TabNavigatorLayout.js +4 -0
  175. package/dist/primitives/AspectRatio.d.ts +10 -0
  176. package/dist/primitives/AspectRatio.js +8 -0
  177. package/dist/primitives/Box.d.ts +1 -1
  178. package/dist/primitives/Pressable.d.ts +10 -0
  179. package/dist/primitives/Pressable.js +9 -0
  180. package/dist/primitives/Row.d.ts +1 -1
  181. package/dist/primitives/Spacer.d.ts +8 -0
  182. package/dist/primitives/Spacer.js +9 -0
  183. package/dist/primitives/Stack.d.ts +1 -1
  184. package/dist/primitives/index.d.ts +3 -0
  185. package/dist/primitives/index.js +3 -0
  186. package/dist/theme/active.d.ts +2 -0
  187. package/dist/theme/active.js +13 -0
  188. package/dist/theme/components/ThemedActivityIndicator.d.ts +1 -1
  189. package/dist/theme/components/index.d.ts +1 -1
  190. package/dist/theme/components/index.js +1 -1
  191. package/dist/theme/dark.d.ts +7 -0
  192. package/dist/theme/dark.js +84 -0
  193. package/dist/theme/define.d.ts +5 -5
  194. package/dist/theme/define.js +5 -5
  195. package/dist/theme/index.d.ts +3 -1
  196. package/dist/theme/index.js +3 -1
  197. package/dist/theme/theme.d.ts +1 -1
  198. package/dist/theme/theme.js +1 -1
  199. package/dist/theme/types.d.ts +14 -14
  200. package/dist/theme/types.js +2 -2
  201. package/dist/theme/useTheme.d.ts +3 -1
  202. package/dist/theme/useTheme.js +6 -1
  203. package/dist/tokens/index.d.ts +2 -0
  204. package/dist/tokens/index.js +2 -0
  205. package/dist/tokens/motion.d.ts +71 -0
  206. package/dist/tokens/motion.js +25 -0
  207. package/dist/utils/date.d.ts +33 -33
  208. package/dist/utils/date.js +39 -39
  209. package/dist/views/AuthFormView.d.ts +1 -1
  210. package/dist/views/FormViewV2.context.d.ts +1 -1
  211. package/dist/views/FormViewV2.d.ts +10 -10
  212. package/dist/views/FormViewV2.js +2 -2
  213. package/dist/views/ListViewV2.context.d.ts +1 -1
  214. package/dist/views/ListViewV2.d.ts +20 -20
  215. package/dist/views/ListViewV2.js +2 -2
  216. package/dist/views/Wizard/Wizard.context.d.ts +1 -1
  217. package/dist/widgets/CircleButton.d.ts +6 -2
  218. package/dist/widgets/CircleButton.js +4 -0
  219. package/dist/widgets/GeoPermissionCard.d.ts +1 -1
  220. package/dist/widgets/HomeHeader.d.ts +4 -0
  221. package/dist/widgets/HomeHeader.js +4 -0
  222. package/dist/widgets/JSONViewer.d.ts +2 -1
  223. package/dist/widgets/JSONViewer.js +6 -6
  224. package/dist/widgets/MenuCard.d.ts +1 -1
  225. package/dist/widgets/ScreenHeader.d.ts +6 -2
  226. package/dist/widgets/ScreenHeader.js +15 -4
  227. package/dist/widgets/TimeZoneSelector.d.ts +1 -1
  228. package/dist/widgets/TimeZoneSelectorModal.d.ts +1 -1
  229. package/package.json +38 -25
  230. package/tailwind.preset.js +14 -0
  231. package/dist/notifications/index.d.ts +0 -1
  232. package/dist/notifications/index.js +0 -1
  233. package/dist/providers/index.d.ts +0 -1
  234. package/dist/providers/index.js +0 -2
@@ -3,8 +3,8 @@
3
3
  * THEME SYSTEM - SIMPLE & SEMANTIC
4
4
  * ============================================================================
5
5
  *
6
- * Sistema simplificado de theming sin hooks ni context.
7
- * Importación directa de tokens según dominio activo.
6
+ * Simplified theming system without hooks or context.
7
+ * Tokens are read directly from the active theme.
8
8
  */
9
9
  export interface ShadowStyle {
10
10
  shadowColor: string;
@@ -17,15 +17,15 @@ export interface ShadowStyle {
17
17
  elevation: number;
18
18
  }
19
19
  export interface ThemeTokens {
20
- /** Nombre del theme */
20
+ /** Theme name */
21
21
  name: string;
22
- /** Color primario - botones principales, links, estados activos */
22
+ /** Primary color - main buttons, links, active states */
23
23
  primary: string;
24
- /** Color secundario - botones secundarios, elementos de bajo perfil (gris) */
24
+ /** Secondary color - secondary buttons, low-profile elements (gray) */
25
25
  secondary: string;
26
- /** Color de acento - highlights, badges importantes, CTAs secundarios (naranja/indigo) */
26
+ /** Accent color - highlights, important badges, secondary CTAs (orange/indigo) */
27
27
  accent: string;
28
- /** Fondos */
28
+ /** Backgrounds */
29
29
  bg: {
30
30
  page: string;
31
31
  card: string;
@@ -35,7 +35,7 @@ export interface ThemeTokens {
35
35
  hover: string;
36
36
  disabled: string;
37
37
  };
38
- /** Textos */
38
+ /** Text */
39
39
  text: {
40
40
  primary: string;
41
41
  secondary: string;
@@ -50,7 +50,7 @@ export interface ThemeTokens {
50
50
  onDanger: string;
51
51
  onSuccess: string;
52
52
  };
53
- /** Iconos */
53
+ /** Icons */
54
54
  icon: {
55
55
  primary: string;
56
56
  secondary: string;
@@ -58,19 +58,19 @@ export interface ThemeTokens {
58
58
  inverse: string;
59
59
  disabled: string;
60
60
  };
61
- /** Bordes */
61
+ /** Borders */
62
62
  border: {
63
63
  default: string;
64
64
  light: string;
65
65
  strong: string;
66
66
  focus: string;
67
67
  };
68
- /** Estados semánticos */
68
+ /** Semantic states */
69
69
  success: string;
70
70
  warning: string;
71
71
  danger: string;
72
72
  info: string;
73
- /** Estados semánticos - Versiones claras */
73
+ /** Semantic states - light variants */
74
74
  successLight: string;
75
75
  warningLight: string;
76
76
  dangerLight: string;
@@ -78,12 +78,12 @@ export interface ThemeTokens {
78
78
  /** Focus & Input */
79
79
  ring: string;
80
80
  input: string;
81
- /** Gradientes (para LinearGradient) */
81
+ /** Gradients (for LinearGradient) */
82
82
  gradient: {
83
83
  primary: readonly [string, string];
84
84
  accent: readonly [string, string];
85
85
  };
86
- /** Sombras (React Native) */
86
+ /** Shadows (React Native) */
87
87
  shadow: {
88
88
  sm: ShadowStyle;
89
89
  md: ShadowStyle;
@@ -3,7 +3,7 @@
3
3
  * THEME SYSTEM - SIMPLE & SEMANTIC
4
4
  * ============================================================================
5
5
  *
6
- * Sistema simplificado de theming sin hooks ni context.
7
- * Importación directa de tokens según dominio activo.
6
+ * Simplified theming system without hooks or context.
7
+ * Tokens are read directly from the active theme.
8
8
  */
9
9
  export {};
@@ -1 +1,3 @@
1
- export declare const theme: import("./types").ThemeTokens;
1
+ import type { ThemeTokens } from "../theme/types";
2
+ export declare function useTheme(): ThemeTokens;
3
+ export declare const theme: ThemeTokens;
@@ -1,2 +1,7 @@
1
- import { getActiveTheme } from "../theme/active";
1
+ import { getActiveTheme, getThemeVersion, subscribeTheme, } from "../theme/active";
2
+ import { useSyncExternalStore } from "react";
3
+ export function useTheme() {
4
+ useSyncExternalStore(subscribeTheme, getThemeVersion, getThemeVersion);
5
+ return getActiveTheme();
6
+ }
2
7
  export const theme = getActiveTheme();
@@ -0,0 +1,2 @@
1
+ export { motion } from "../tokens/motion";
2
+ export { duration, type DurationToken, easing, type EasingToken, spring, type SpringToken, } from "../tokens/motion";
@@ -0,0 +1,2 @@
1
+ export { motion } from "../tokens/motion";
2
+ export { duration, easing, spring, } from "../tokens/motion";
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Motion tokens — durations and curves for consistent animations (reanimated, LayoutAnimation).
3
+ * Single source of the DS "rhythm": enter/exit, press, theme transitions, sheets, skeletons.
4
+ */
5
+ export declare const duration: {
6
+ readonly instant: 0;
7
+ readonly fast: 120;
8
+ readonly normal: 200;
9
+ readonly slow: 320;
10
+ readonly slower: 480;
11
+ };
12
+ export type DurationToken = keyof typeof duration;
13
+ /** Bezier curves (x1,y1,x2,y2) for Easing.bezier / CSS-like. */
14
+ export declare const easing: {
15
+ readonly standard: readonly [0.2, 0, 0, 1];
16
+ readonly decelerate: readonly [0, 0, 0, 1];
17
+ readonly accelerate: readonly [0.3, 0, 1, 1];
18
+ readonly emphasized: readonly [0.2, 0, 0, 1];
19
+ };
20
+ export type EasingToken = keyof typeof easing;
21
+ /** Config for reanimated withSpring (spring presets). */
22
+ export declare const spring: {
23
+ readonly default: {
24
+ readonly damping: 20;
25
+ readonly stiffness: 200;
26
+ readonly mass: 1;
27
+ };
28
+ readonly gentle: {
29
+ readonly damping: 24;
30
+ readonly stiffness: 120;
31
+ readonly mass: 1;
32
+ };
33
+ readonly snappy: {
34
+ readonly damping: 18;
35
+ readonly stiffness: 300;
36
+ readonly mass: 1;
37
+ };
38
+ };
39
+ export type SpringToken = keyof typeof spring;
40
+ export declare const motion: {
41
+ readonly duration: {
42
+ readonly instant: 0;
43
+ readonly fast: 120;
44
+ readonly normal: 200;
45
+ readonly slow: 320;
46
+ readonly slower: 480;
47
+ };
48
+ readonly easing: {
49
+ readonly standard: readonly [0.2, 0, 0, 1];
50
+ readonly decelerate: readonly [0, 0, 0, 1];
51
+ readonly accelerate: readonly [0.3, 0, 1, 1];
52
+ readonly emphasized: readonly [0.2, 0, 0, 1];
53
+ };
54
+ readonly spring: {
55
+ readonly default: {
56
+ readonly damping: 20;
57
+ readonly stiffness: 200;
58
+ readonly mass: 1;
59
+ };
60
+ readonly gentle: {
61
+ readonly damping: 24;
62
+ readonly stiffness: 120;
63
+ readonly mass: 1;
64
+ };
65
+ readonly snappy: {
66
+ readonly damping: 18;
67
+ readonly stiffness: 300;
68
+ readonly mass: 1;
69
+ };
70
+ };
71
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Motion tokens — durations and curves for consistent animations (reanimated, LayoutAnimation).
3
+ * Single source of the DS "rhythm": enter/exit, press, theme transitions, sheets, skeletons.
4
+ */
5
+ export const duration = {
6
+ instant: 0,
7
+ fast: 120,
8
+ normal: 200,
9
+ slow: 320,
10
+ slower: 480,
11
+ };
12
+ /** Bezier curves (x1,y1,x2,y2) for Easing.bezier / CSS-like. */
13
+ export const easing = {
14
+ standard: [0.2, 0, 0, 1],
15
+ decelerate: [0, 0, 0, 1],
16
+ accelerate: [0.3, 0, 1, 1],
17
+ emphasized: [0.2, 0, 0, 1],
18
+ };
19
+ /** Config for reanimated withSpring (spring presets). */
20
+ export const spring = {
21
+ default: { damping: 20, stiffness: 200, mass: 1 },
22
+ gentle: { damping: 24, stiffness: 120, mass: 1 },
23
+ snappy: { damping: 18, stiffness: 300, mass: 1 },
24
+ };
25
+ export const motion = { duration, easing, spring };
@@ -3,25 +3,25 @@ interface FormatDateOptions {
3
3
  showTime?: boolean;
4
4
  }
5
5
  /**
6
- * Formatea una fecha en la zona horaria indicada respetando la granularidad de la entrada.
6
+ * Formats a date in the given timezone, respecting the granularity of the input.
7
7
  *
8
- * Reglas de detección:
9
- * 1. Si `input` es un string 'YYYY-MM-DD' (solo fecha) => se interpreta como medianoche (00:00:00)
10
- * en la zona horaria destino y se devuelve SOLO la parte de fecha (sin hora).
11
- * 2. Si `input` incluye componente de tiempo (ISO completo o Date) => se convierte a la zona destino
12
- * y se muestra fecha + hora (HH:MM) salvo que se fuerce lo contrario mediante `options.showTime`.
13
- * 3. Cuando `options.showTime` es `true` o `false` se sobre‑escribe la auto‑detección.
14
- * 4. Si `timezone` es null/undefined o inválido se retorna la cadena "Error de formateo".
8
+ * Detection rules:
9
+ * 1. If `input` is a 'YYYY-MM-DD' string (date only) => interpreted as midnight (00:00:00)
10
+ * in the target timezone and ONLY the date part is returned (no time).
11
+ * 2. If `input` includes a time component (full ISO or Date) => converted to the target timezone
12
+ * and shown as date + time (HH:MM) unless overridden via `options.showTime`.
13
+ * 3. When `options.showTime` is `true` or `false` it overrides the auto-detection.
14
+ * 4. If `timezone` is null/undefined or invalid, the string "Error de formateo" is returned.
15
15
  *
16
- * Localización:
17
- * - Usa el primer locale del dispositivo (`expo-localization`) como predeterminado.
18
- * - Puedes forzar uno diferente con `options.locale` (ej: 'es-CR', 'en-US').
16
+ * Localization:
17
+ * - Uses the device's first locale (`expo-localization`) by default.
18
+ * - You can force a different one with `options.locale` (e.g. 'es-CR', 'en-US').
19
19
  *
20
- * Seguridad de zona horaria:
21
- * - El parse de una fecha sin hora NO se hace en la zona local del dispositivo para luego convertir,
22
- * sino directamente en la zona destino para evitar corrimientos de día.
20
+ * Timezone safety:
21
+ * - A date without time is NOT parsed in the device's local zone and then converted,
22
+ * but directly in the target zone to avoid day shifts.
23
23
  *
24
- * Ejemplos:
24
+ * Examples:
25
25
  * ```ts
26
26
  * formatDate('2025-09-02', 'America/Costa_Rica');
27
27
  * // => "2 de septiembre de 2025"
@@ -30,41 +30,41 @@ interface FormatDateOptions {
30
30
  * // => "2 de septiembre de 2025, 12:30 p. m." (dependiendo del locale real)
31
31
  *
32
32
  * formatDate(new Date('2025-09-02T23:15:00Z'), 'Europe/Madrid');
33
- * // => "3 de septiembre de 2025, 01:15" (cambio de día por zona +02)
33
+ * // => "3 de septiembre de 2025, 01:15" (day shifts due to +02 zone)
34
34
  *
35
35
  * formatDate('2025-09-02', 'America/Costa_Rica', { showTime: true });
36
36
  * // => "2 de septiembre de 2025, 12:00 a. m." (fuerza hora)
37
37
  * ```
38
38
  *
39
- * @param input Fecha (string ISO, 'YYYY-MM-DD' o instancia Date)
40
- * @param timezone Zona horaria IANA (ej: 'America/Costa_Rica', 'Asia/Tokyo'). Si es null/undefined usa Costa Rica
41
- * @param options Opcional: locale forzado y/o bandera para mostrar hora
42
- * @returns Cadena localizada o "Error de formateo" si no se puede procesar
39
+ * @param input Date (ISO string, 'YYYY-MM-DD', or Date instance)
40
+ * @param timezone IANA timezone (e.g. 'America/Costa_Rica', 'Asia/Tokyo'). Falls back to Costa Rica if null/undefined
41
+ * @param options Optional: forced locale and/or flag to show the time
42
+ * @returns Localized string, or "Error de formateo" if it can't be processed
43
43
  */
44
44
  export declare function formatDate(input: string | Date, timezone: string | null | undefined, options?: FormatDateOptions): string;
45
45
  /**
46
- * Formatea una fecha usando automáticamente el timezone por defecto (Costa Rica).
47
- * Útil para casos donde no se tiene acceso al timezone del usuario.
46
+ * Formats a date using the default timezone automatically (Costa Rica).
47
+ * Useful when the user's timezone isn't available.
48
48
  *
49
- * @param input Fecha (string ISO, 'YYYY-MM-DD' o instancia Date)
50
- * @param options Opcional: locale forzado y/o bandera para mostrar hora
51
- * @returns Cadena localizada en timezone de Costa Rica
49
+ * @param input Date (ISO string, 'YYYY-MM-DD', or Date instance)
50
+ * @param options Optional: forced locale and/or flag to show the time
51
+ * @returns Localized string in the Costa Rica timezone
52
52
  */
53
53
  export declare function formatDateWithDefaultTimezone(input: string | Date, options?: FormatDateOptions): string;
54
54
  /**
55
- * Obtiene la fecha actual en formato YYYY-MM-DD en el timezone especificado.
56
- * Útil para crear fechas de programación que respeten el timezone del usuario.
55
+ * Returns the current date as YYYY-MM-DD in the given timezone.
56
+ * Useful to build scheduling dates that respect the user's timezone.
57
57
  *
58
- * @param timezone Zona horaria IANA. Si es null/undefined usa Costa Rica
59
- * @returns Fecha actual en formato YYYY-MM-DD en el timezone especificado
58
+ * @param timezone IANA timezone. Falls back to Costa Rica if null/undefined
59
+ * @returns Current date as YYYY-MM-DD in the given timezone
60
60
  */
61
61
  export declare function getCurrentDateInTimezone(timezone?: string | null): string;
62
62
  /**
63
- * Obtiene la fecha y hora actual en formato ISO en el timezone especificado.
64
- * Útil para timestamps que necesiten reflejar el timezone del usuario.
63
+ * Returns the current date-time as an ISO string in the given timezone.
64
+ * Useful for timestamps that need to reflect the user's timezone.
65
65
  *
66
- * @param timezone Zona horaria IANA. Si es null/undefined usa Costa Rica
67
- * @returns Fecha actual en formato ISO en el timezone especificado
66
+ * @param timezone IANA timezone. Falls back to Costa Rica if null/undefined
67
+ * @returns Current date-time as an ISO string in the given timezone
68
68
  */
69
69
  export declare function getCurrentDateTimeInTimezone(timezone?: string | null): string;
70
70
  export {};
@@ -7,25 +7,25 @@ const DEFAULT_LOCALE = "es-CR";
7
7
  dayjs.extend(utc);
8
8
  dayjs.extend(timezone);
9
9
  /**
10
- * Formatea una fecha en la zona horaria indicada respetando la granularidad de la entrada.
10
+ * Formats a date in the given timezone, respecting the granularity of the input.
11
11
  *
12
- * Reglas de detección:
13
- * 1. Si `input` es un string 'YYYY-MM-DD' (solo fecha) => se interpreta como medianoche (00:00:00)
14
- * en la zona horaria destino y se devuelve SOLO la parte de fecha (sin hora).
15
- * 2. Si `input` incluye componente de tiempo (ISO completo o Date) => se convierte a la zona destino
16
- * y se muestra fecha + hora (HH:MM) salvo que se fuerce lo contrario mediante `options.showTime`.
17
- * 3. Cuando `options.showTime` es `true` o `false` se sobre‑escribe la auto‑detección.
18
- * 4. Si `timezone` es null/undefined o inválido se retorna la cadena "Error de formateo".
12
+ * Detection rules:
13
+ * 1. If `input` is a 'YYYY-MM-DD' string (date only) => interpreted as midnight (00:00:00)
14
+ * in the target timezone and ONLY the date part is returned (no time).
15
+ * 2. If `input` includes a time component (full ISO or Date) => converted to the target timezone
16
+ * and shown as date + time (HH:MM) unless overridden via `options.showTime`.
17
+ * 3. When `options.showTime` is `true` or `false` it overrides the auto-detection.
18
+ * 4. If `timezone` is null/undefined or invalid, the string "Error de formateo" is returned.
19
19
  *
20
- * Localización:
21
- * - Usa el primer locale del dispositivo (`expo-localization`) como predeterminado.
22
- * - Puedes forzar uno diferente con `options.locale` (ej: 'es-CR', 'en-US').
20
+ * Localization:
21
+ * - Uses the device's first locale (`expo-localization`) by default.
22
+ * - You can force a different one with `options.locale` (e.g. 'es-CR', 'en-US').
23
23
  *
24
- * Seguridad de zona horaria:
25
- * - El parse de una fecha sin hora NO se hace en la zona local del dispositivo para luego convertir,
26
- * sino directamente en la zona destino para evitar corrimientos de día.
24
+ * Timezone safety:
25
+ * - A date without time is NOT parsed in the device's local zone and then converted,
26
+ * but directly in the target zone to avoid day shifts.
27
27
  *
28
- * Ejemplos:
28
+ * Examples:
29
29
  * ```ts
30
30
  * formatDate('2025-09-02', 'America/Costa_Rica');
31
31
  * // => "2 de septiembre de 2025"
@@ -34,19 +34,19 @@ dayjs.extend(timezone);
34
34
  * // => "2 de septiembre de 2025, 12:30 p. m." (dependiendo del locale real)
35
35
  *
36
36
  * formatDate(new Date('2025-09-02T23:15:00Z'), 'Europe/Madrid');
37
- * // => "3 de septiembre de 2025, 01:15" (cambio de día por zona +02)
37
+ * // => "3 de septiembre de 2025, 01:15" (day shifts due to +02 zone)
38
38
  *
39
39
  * formatDate('2025-09-02', 'America/Costa_Rica', { showTime: true });
40
40
  * // => "2 de septiembre de 2025, 12:00 a. m." (fuerza hora)
41
41
  * ```
42
42
  *
43
- * @param input Fecha (string ISO, 'YYYY-MM-DD' o instancia Date)
44
- * @param timezone Zona horaria IANA (ej: 'America/Costa_Rica', 'Asia/Tokyo'). Si es null/undefined usa Costa Rica
45
- * @param options Opcional: locale forzado y/o bandera para mostrar hora
46
- * @returns Cadena localizada o "Error de formateo" si no se puede procesar
43
+ * @param input Date (ISO string, 'YYYY-MM-DD', or Date instance)
44
+ * @param timezone IANA timezone (e.g. 'America/Costa_Rica', 'Asia/Tokyo'). Falls back to Costa Rica if null/undefined
45
+ * @param options Optional: forced locale and/or flag to show the time
46
+ * @returns Localized string, or "Error de formateo" if it can't be processed
47
47
  */
48
48
  export function formatDate(input, timezone, options) {
49
- // Usar timezone por defecto si no se proporciona
49
+ // Use the default timezone when none is provided
50
50
  const effectiveTimezone = timezone || DEFAULT_TIMEZONE;
51
51
  const fallbackLocale = DEFAULT_LOCALE.split("-")[0]; // "es" from "es-CR"
52
52
  const deviceLocale = getLocales()?.[0]?.languageTag ?? fallbackLocale;
@@ -54,10 +54,10 @@ export function formatDate(input, timezone, options) {
54
54
  try {
55
55
  const rawStr = typeof input === "string" ? input : input.toISOString();
56
56
  const isDateOnly = /^\d{4}-\d{2}-\d{2}$/.test(rawStr);
57
- // Auto-detect showTime si no se pasa explicitamente
57
+ // Auto-detect showTime when not passed explicitly
58
58
  const effectiveShowTime = options?.showTime !== undefined
59
59
  ? options.showTime
60
- : !isDateOnly && /T\d{2}:\d{2}/.test(rawStr); // tiene componente hora
60
+ : !isDateOnly && /T\d{2}:\d{2}/.test(rawStr); // has a time component
61
61
  const dateInstance = isDateOnly
62
62
  ? dayjs.tz(`${rawStr}T00:00:00`, effectiveTimezone)
63
63
  : dayjs.utc(rawStr).tz(effectiveTimezone);
@@ -75,27 +75,27 @@ export function formatDate(input, timezone, options) {
75
75
  return new Intl.DateTimeFormat(usedLocale, formatOptions).format(dateInZone);
76
76
  }
77
77
  catch (error) {
78
- console.warn("Error formateando fecha:", error);
78
+ console.warn("Error formatting date:", error);
79
79
  return "Error de formateo";
80
80
  }
81
81
  }
82
82
  /**
83
- * Formatea una fecha usando automáticamente el timezone por defecto (Costa Rica).
84
- * Útil para casos donde no se tiene acceso al timezone del usuario.
83
+ * Formats a date using the default timezone automatically (Costa Rica).
84
+ * Useful when the user's timezone isn't available.
85
85
  *
86
- * @param input Fecha (string ISO, 'YYYY-MM-DD' o instancia Date)
87
- * @param options Opcional: locale forzado y/o bandera para mostrar hora
88
- * @returns Cadena localizada en timezone de Costa Rica
86
+ * @param input Date (ISO string, 'YYYY-MM-DD', or Date instance)
87
+ * @param options Optional: forced locale and/or flag to show the time
88
+ * @returns Localized string in the Costa Rica timezone
89
89
  */
90
90
  export function formatDateWithDefaultTimezone(input, options) {
91
91
  return formatDate(input, DEFAULT_TIMEZONE, options);
92
92
  }
93
93
  /**
94
- * Obtiene la fecha actual en formato YYYY-MM-DD en el timezone especificado.
95
- * Útil para crear fechas de programación que respeten el timezone del usuario.
94
+ * Returns the current date as YYYY-MM-DD in the given timezone.
95
+ * Useful to build scheduling dates that respect the user's timezone.
96
96
  *
97
- * @param timezone Zona horaria IANA. Si es null/undefined usa Costa Rica
98
- * @returns Fecha actual en formato YYYY-MM-DD en el timezone especificado
97
+ * @param timezone IANA timezone. Falls back to Costa Rica if null/undefined
98
+ * @returns Current date as YYYY-MM-DD in the given timezone
99
99
  */
100
100
  export function getCurrentDateInTimezone(timezone) {
101
101
  const effectiveTimezone = timezone || DEFAULT_TIMEZONE;
@@ -103,16 +103,16 @@ export function getCurrentDateInTimezone(timezone) {
103
103
  return dayjs().tz(effectiveTimezone).format("YYYY-MM-DD");
104
104
  }
105
105
  catch (error) {
106
- console.warn("Error obteniendo fecha actual en timezone:", error);
106
+ console.warn("Error getting current date in timezone:", error);
107
107
  return dayjs().format("YYYY-MM-DD"); // Fallback to local
108
108
  }
109
109
  }
110
110
  /**
111
- * Obtiene la fecha y hora actual en formato ISO en el timezone especificado.
112
- * Útil para timestamps que necesiten reflejar el timezone del usuario.
111
+ * Returns the current date-time as an ISO string in the given timezone.
112
+ * Useful for timestamps that need to reflect the user's timezone.
113
113
  *
114
- * @param timezone Zona horaria IANA. Si es null/undefined usa Costa Rica
115
- * @returns Fecha actual en formato ISO en el timezone especificado
114
+ * @param timezone IANA timezone. Falls back to Costa Rica if null/undefined
115
+ * @returns Current date-time as an ISO string in the given timezone
116
116
  */
117
117
  export function getCurrentDateTimeInTimezone(timezone) {
118
118
  const effectiveTimezone = timezone || DEFAULT_TIMEZONE;
@@ -120,7 +120,7 @@ export function getCurrentDateTimeInTimezone(timezone) {
120
120
  return dayjs().tz(effectiveTimezone).toISOString();
121
121
  }
122
122
  catch (error) {
123
- console.warn("Error obteniendo fecha/hora actual en timezone:", error);
123
+ console.warn("Error getting current date-time in timezone:", error);
124
124
  return dayjs().toISOString(); // Fallback to local
125
125
  }
126
126
  }
@@ -7,5 +7,5 @@ interface AuthFormProps {
7
7
  onBack?: () => void;
8
8
  FormNode: ReactNode;
9
9
  }
10
- declare function AuthFormView({ title, description, logoSource, onBack, FormNode }: AuthFormProps): import("react/jsx-runtime").JSX.Element;
10
+ declare function AuthFormView({ title, description, logoSource, onBack, FormNode }: AuthFormProps): import("react").JSX.Element;
11
11
  export default AuthFormView;
@@ -27,6 +27,6 @@ export declare function FormViewProvider<T>({ name, description, item, isLoading
27
27
  onRetry?: () => void;
28
28
  onBack?: () => void;
29
29
  children: ReactNode;
30
- }): import("react/jsx-runtime").JSX.Element;
30
+ }): import("react").JSX.Element;
31
31
  export declare function useFormView<T>(): FormViewContextValue<T>;
32
32
  export {};
@@ -1,5 +1,5 @@
1
1
  import { EVariantScreenHeader } from "../widgets/ScreenHeader";
2
- import { ReactNode } from "react";
2
+ import React, { ReactNode } from "react";
3
3
  import { type ImageSourcePropType } from "react-native";
4
4
  interface FormViewProps<T> {
5
5
  name: string;
@@ -16,36 +16,36 @@ interface FormViewProps<T> {
16
16
  withContainer?: boolean;
17
17
  children: ReactNode;
18
18
  }
19
- declare function FormViewRoot<T>({ name, description, item, isLoading, isEmpty, hasError, errorMessage, readonly, onRefresh, onRetry, onBack, withContainer, children, }: FormViewProps<T>): import("react/jsx-runtime").JSX.Element;
19
+ declare function FormViewRoot<T>({ name, description, item, isLoading, isEmpty, hasError, errorMessage, readonly, onRefresh, onRetry, onBack, withContainer, children, }: FormViewProps<T>): React.JSX.Element;
20
20
  declare function Header({ variant, logoSource, children, }: {
21
21
  variant?: EVariantScreenHeader;
22
22
  logoSource?: ImageSourcePropType;
23
23
  children?: ReactNode;
24
- }): import("react/jsx-runtime").JSX.Element;
24
+ }): React.JSX.Element;
25
25
  declare function HeaderActions({ children }: {
26
26
  children: ReactNode;
27
- }): import("react/jsx-runtime").JSX.Element;
27
+ }): React.JSX.Element;
28
28
  declare function HeaderActionsBar({ children }: {
29
29
  children: ReactNode;
30
- }): import("react/jsx-runtime").JSX.Element;
30
+ }): React.JSX.Element;
31
31
  declare function Content({ withMargin, children, }: {
32
32
  withMargin?: boolean;
33
33
  children: ReactNode;
34
- }): import("react/jsx-runtime").JSX.Element;
34
+ }): React.JSX.Element;
35
35
  declare function Form({ children }: {
36
36
  children: ReactNode;
37
- }): import("react/jsx-runtime").JSX.Element;
37
+ }): React.JSX.Element;
38
38
  declare function Groups({ children }: {
39
39
  children: ReactNode;
40
- }): import("react/jsx-runtime").JSX.Element | null;
40
+ }): React.JSX.Element | null;
41
41
  declare function Group({ children, withMargin, elevation, }: {
42
42
  children: ReactNode;
43
43
  withMargin?: boolean;
44
44
  elevation?: "sm" | "md" | "lg";
45
- }): import("react/jsx-runtime").JSX.Element;
45
+ }): React.JSX.Element;
46
46
  declare function Footer({ children }: {
47
47
  children: ReactNode;
48
- }): import("react/jsx-runtime").JSX.Element | null;
48
+ }): React.JSX.Element | null;
49
49
  export declare const FormViewV2: {
50
50
  Root: typeof FormViewRoot;
51
51
  Header: typeof Header & {
@@ -3,7 +3,7 @@ import { ErrorBoundary, Feedback } from "../Feedback";
3
3
  import Container from "../layouts/Container";
4
4
  import { theme } from "../theme";
5
5
  import { FormViewProvider, useFormView } from "../views/FormViewV2.context";
6
- import ScreenHeader from "../widgets/ScreenHeader";
6
+ import ScreenHeader, { EVariantScreenHeader } from "../widgets/ScreenHeader";
7
7
  import React from "react";
8
8
  import { RefreshControl, View } from "react-native";
9
9
  import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
@@ -12,7 +12,7 @@ function FormViewRoot({ name, description, item, isLoading = false, isEmpty = fa
12
12
  const wrapperProps = withContainer ? {} : { style: { flex: 1 } };
13
13
  return (_jsx(FormViewProvider, { description: description, errorMessage: errorMessage, hasError: hasError, isEmpty: isEmpty, isLoading: isLoading, item: item, name: name, onBack: onBack, onRefresh: onRefresh, onRetry: onRetry, readonly: readonly, children: _jsx(ErrorBoundary, { children: _jsx(Wrapper, { ...wrapperProps, children: children }) }) }));
14
14
  }
15
- function Header({ variant = "FLAT_HEADER" /* EVariantScreenHeader.FLAT_HEADER */, logoSource, children, }) {
15
+ function Header({ variant = EVariantScreenHeader.FLAT_HEADER, logoSource, children, }) {
16
16
  const { name, description, onBack } = useFormView();
17
17
  return (_jsx(_Fragment, { children: _jsx(ScreenHeader, { logoSource: logoSource, onBack: onBack, subtitle: description ? description : `Seleccionar ${name}`, title: name, variant: variant, children: children }) }));
18
18
  }
@@ -31,6 +31,6 @@ export declare function ListViewProvider<T>({ name, description, items, isLoadin
31
31
  onSearch?: (query: string) => void;
32
32
  onBack?: () => void;
33
33
  children: ReactNode;
34
- }): import("react/jsx-runtime").JSX.Element;
34
+ }): import("react").JSX.Element;
35
35
  export declare function useListView<T>(): ListViewContextValue<T>;
36
36
  export {};