@sincpro/mobile-ui 0.2.1 → 0.3.1
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.
- package/README.md +75 -20
- package/dist/Dialog/BottomSheet/BottomSheet.Root.d.ts +13 -9
- package/dist/Dialog/BottomSheet/BottomSheet.Root.js +6 -2
- package/dist/Dialog/Confirmation.context.d.ts +1 -1
- package/dist/Dialog/Dialog.ActionSheet.d.ts +17 -0
- package/dist/Dialog/Dialog.ActionSheet.js +16 -0
- package/dist/Dialog/Dialog.Confirmation.js +5 -1
- package/dist/Dialog/Dialog.EditValue.d.ts +1 -1
- package/dist/Dialog/Dialog.EditValue.js +1 -1
- package/dist/Dialog/Dialog.Sheet.d.ts +26 -0
- package/dist/Dialog/Dialog.Sheet.js +55 -0
- package/dist/Dialog/index.d.ts +9 -7
- package/dist/Dialog/index.js +2 -0
- package/dist/Display/Display.Accordion.d.ts +18 -0
- package/dist/Display/Display.Accordion.js +22 -0
- package/dist/Display/Display.AvatarGroup.d.ts +12 -0
- package/dist/Display/Display.AvatarGroup.js +23 -0
- package/dist/Display/Display.Badge.d.ts +1 -1
- package/dist/Display/Display.Card.d.ts +46 -0
- package/dist/Display/Display.Card.js +36 -0
- package/dist/Display/Display.Carousel.d.ts +13 -0
- package/dist/Display/Display.Carousel.js +19 -0
- package/dist/Display/Display.Chip.d.ts +105 -0
- package/dist/Display/Display.Chip.js +45 -0
- package/dist/Display/Display.CopyableText.d.ts +1 -1
- package/dist/Display/Display.CountRecords.d.ts +1 -1
- package/dist/Display/Display.DataTable.d.ts +19 -0
- package/dist/Display/Display.DataTable.js +22 -0
- package/dist/Display/Display.Date.d.ts +15 -2
- package/dist/Display/Display.Date.js +34 -4
- package/dist/Display/Display.Divider.d.ts +1 -1
- package/dist/Display/Display.GradientSurface.d.ts +116 -0
- package/dist/Display/Display.GradientSurface.js +62 -0
- package/dist/Display/Display.IconBadge.d.ts +13 -0
- package/dist/Display/Display.IconBadge.js +30 -0
- package/dist/Display/Display.Image.d.ts +15 -0
- package/dist/Display/Display.Image.js +17 -0
- package/dist/Display/Display.KeyValue.d.ts +10 -0
- package/dist/Display/Display.KeyValue.js +9 -0
- package/dist/Display/Display.ListItem.d.ts +17 -0
- package/dist/Display/Display.ListItem.js +18 -0
- package/dist/Display/Display.Logo.js +3 -1
- package/dist/Display/Display.MediaCard.d.ts +17 -0
- package/dist/Display/Display.MediaCard.js +12 -0
- package/dist/Display/Display.MediaEmbed.d.ts +19 -0
- package/dist/Display/Display.MediaEmbed.js +39 -0
- package/dist/Display/Display.MenuButton.d.ts +1 -1
- package/dist/Display/Display.Monetary.d.ts +1 -1
- package/dist/Display/Display.Monetary.js +1 -1
- package/dist/Display/Display.Pattern.d.ts +26 -0
- package/dist/Display/Display.Pattern.js +27 -0
- package/dist/Display/Display.PriceTag.d.ts +10 -0
- package/dist/Display/Display.PriceTag.js +23 -0
- package/dist/Display/Display.ProductCard.d.ts +17 -0
- package/dist/Display/Display.ProductCard.js +13 -0
- package/dist/Display/Display.Rating.d.ts +11 -0
- package/dist/Display/Display.Rating.js +16 -0
- package/dist/Display/Display.SearchHistory.d.ts +12 -0
- package/dist/Display/Display.SearchHistory.js +13 -0
- package/dist/Display/Display.SectionHeader.d.ts +13 -0
- package/dist/Display/Display.SectionHeader.js +9 -0
- package/dist/Display/Display.Stat.d.ts +10 -0
- package/dist/Display/Display.Stat.js +9 -0
- package/dist/Display/Display.StatCard.d.ts +14 -0
- package/dist/Display/Display.StatCard.js +13 -0
- package/dist/Display/Display.StatusDot.d.ts +11 -0
- package/dist/Display/Display.StatusDot.js +28 -0
- package/dist/Display/Display.Story.d.ts +15 -0
- package/dist/Display/Display.Story.js +43 -0
- package/dist/Display/Display.StoryTray.d.ts +26 -0
- package/dist/Display/Display.StoryTray.js +43 -0
- package/dist/Display/Display.StoryViewer.d.ts +26 -0
- package/dist/Display/Display.StoryViewer.js +79 -0
- package/dist/Display/Display.SwipeableRow.d.ts +15 -0
- package/dist/Display/Display.SwipeableRow.js +28 -0
- package/dist/Display/Display.Tag.d.ts +11 -0
- package/dist/Display/Display.Tag.js +9 -0
- package/dist/Display/Display.Timeline.d.ts +13 -0
- package/dist/Display/Display.Timeline.js +19 -0
- package/dist/Display/Display.Tooltip.d.ts +10 -0
- package/dist/Display/Display.Tooltip.js +24 -0
- package/dist/Display/index.d.ts +70 -0
- package/dist/Display/index.js +58 -0
- package/dist/Feedback/ErrorBoundary.d.ts +1 -1
- package/dist/Feedback/Feedback.Banner.d.ts +82 -0
- package/dist/Feedback/Feedback.Banner.js +35 -0
- package/dist/Feedback/Feedback.DomainSplashScreen.d.ts +2 -1
- package/dist/Feedback/Feedback.DomainSplashScreen.js +3 -2
- package/dist/Feedback/Feedback.Empty.d.ts +1 -1
- package/dist/Feedback/Feedback.EmptyState.d.ts +15 -0
- package/dist/Feedback/Feedback.EmptyState.js +11 -0
- package/dist/Feedback/Feedback.Error.d.ts +1 -1
- package/dist/Feedback/Feedback.Loading.d.ts +8 -1
- package/dist/Feedback/Feedback.Loading.js +7 -1
- package/dist/Feedback/Feedback.PermissionCard.d.ts +15 -0
- package/dist/Feedback/Feedback.PermissionCard.js +11 -0
- package/dist/Feedback/Feedback.Progress.d.ts +9 -0
- package/dist/Feedback/Feedback.Progress.js +35 -0
- package/dist/Feedback/Feedback.ProgressCircle.d.ts +12 -0
- package/dist/Feedback/Feedback.ProgressCircle.js +15 -0
- package/dist/Feedback/Feedback.Skeleton.d.ts +11 -0
- package/dist/Feedback/Feedback.Skeleton.js +29 -0
- package/dist/Feedback/Feedback.Spinner.js +2 -1
- package/dist/Feedback/Feedback.Splash.d.ts +7 -1
- package/dist/Feedback/Feedback.Splash.js +11 -2
- package/dist/Feedback/Toast.context.d.ts +42 -0
- package/dist/Feedback/Toast.context.js +121 -0
- package/dist/Feedback/index.d.ts +15 -0
- package/dist/Feedback/index.js +15 -0
- package/dist/Form/Form.Button.d.ts +10 -4
- package/dist/Form/Form.Button.js +27 -16
- package/dist/Form/Form.Checkbox.d.ts +1 -1
- package/dist/Form/Form.Checkbox.js +1 -1
- package/dist/Form/Form.ControlledCheckbox.d.ts +1 -1
- package/dist/Form/Form.ControlledInput.d.ts +1 -1
- package/dist/Form/Form.ControlledMonetaryInput.d.ts +1 -1
- package/dist/Form/Form.ControlledRadioButton.d.ts +1 -1
- package/dist/Form/Form.DatePicker.d.ts +20 -0
- package/dist/Form/Form.DatePicker.js +38 -0
- package/dist/Form/Form.Dropdown.d.ts +1 -1
- package/dist/Form/Form.FAB.d.ts +10 -0
- package/dist/Form/Form.FAB.js +17 -0
- package/dist/Form/Form.FilterButton.d.ts +1 -1
- package/dist/Form/Form.FractionalQuantityInput.d.ts +1 -1
- package/dist/Form/Form.IconButton.d.ts +1 -1
- package/dist/Form/Form.Input.d.ts +2 -1
- package/dist/Form/Form.Input.js +1 -1
- package/dist/Form/Form.InputField.js +1 -1
- package/dist/Form/Form.MonetaryInput.d.ts +1 -1
- package/dist/Form/Form.PinInput.d.ts +12 -0
- package/dist/Form/Form.PinInput.js +23 -0
- package/dist/Form/Form.QuantitySelector.d.ts +2 -1
- package/dist/Form/Form.QuantitySelector.js +1 -1
- package/dist/Form/Form.RadioButton.d.ts +1 -1
- package/dist/Form/Form.SearchBar.d.ts +6 -1
- package/dist/Form/Form.SearchBar.js +4 -0
- package/dist/Form/Form.Select.d.ts +17 -0
- package/dist/Form/Form.Select.js +26 -0
- package/dist/Form/Form.Slider.d.ts +20 -0
- package/dist/Form/Form.Slider.js +16 -0
- package/dist/Form/Form.Switch.d.ts +10 -0
- package/dist/Form/Form.Switch.js +9 -0
- package/dist/Form/index.d.ts +12 -0
- package/dist/Form/index.js +12 -0
- package/dist/Navigation/Navigation.AppBar.d.ts +57 -0
- package/dist/Navigation/Navigation.AppBar.js +72 -0
- package/dist/Navigation/Navigation.BottomNav.d.ts +57 -0
- package/dist/Navigation/Navigation.BottomNav.js +108 -0
- package/dist/Navigation/Navigation.CollapsingHeader.d.ts +34 -0
- package/dist/Navigation/Navigation.CollapsingHeader.js +47 -0
- package/dist/Navigation/Navigation.FloatingBar.d.ts +15 -0
- package/dist/Navigation/Navigation.FloatingBar.js +21 -0
- package/dist/Navigation/Navigation.Header.d.ts +6 -2
- package/dist/Navigation/Navigation.Header.js +4 -0
- package/dist/Navigation/Navigation.HeaderToolbar.d.ts +1 -1
- package/dist/Navigation/Navigation.Menu.d.ts +21 -0
- package/dist/Navigation/Navigation.Menu.js +42 -0
- package/dist/Navigation/Navigation.RowItem.d.ts +1 -1
- package/dist/Navigation/Navigation.SearchBar.d.ts +18 -0
- package/dist/Navigation/Navigation.SearchBar.js +28 -0
- package/dist/Navigation/Navigation.SegmentedControl.d.ts +14 -0
- package/dist/Navigation/Navigation.SegmentedControl.js +13 -0
- package/dist/Navigation/Navigation.Steps.d.ts +8 -0
- package/dist/Navigation/Navigation.Steps.js +17 -0
- package/dist/Navigation/Navigation.TabIcon.d.ts +5 -1
- package/dist/Navigation/Navigation.TabIcon.js +4 -0
- package/dist/Navigation/Navigation.TabItem.d.ts +5 -0
- package/dist/Navigation/Navigation.TabItem.js +5 -0
- package/dist/Navigation/Navigation.Tabs.d.ts +28 -0
- package/dist/Navigation/Navigation.Tabs.js +45 -0
- package/dist/Navigation/index.d.ts +32 -1
- package/dist/Navigation/index.js +18 -0
- package/dist/Typography/Typography.Text.d.ts +3 -2
- package/dist/Typography/Typography.Text.js +16 -6
- package/dist/branding.d.ts +6 -0
- package/dist/branding.js +7 -0
- package/dist/icons/ArrowDownIcon.d.ts +2 -1
- package/dist/icons/ArrowUpIcon.d.ts +2 -1
- package/dist/icons/CreditIcon.d.ts +1 -1
- package/dist/icons/OdooIcon.d.ts +6 -1
- package/dist/icons/OdooIcon.js +5 -0
- package/dist/icons/PrinterIcon.d.ts +5 -0
- package/dist/icons/PrinterIcon.js +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/layouts/AuthContainer.d.ts +1 -1
- package/dist/layouts/AuthContainer.js +2 -2
- package/dist/layouts/Container.d.ts +1 -0
- package/dist/layouts/Container.js +2 -3
- package/dist/layouts/GradientContainer.d.ts +1 -1
- package/dist/layouts/PlainLayout.d.ts +1 -1
- package/dist/layouts/ScrollContainer.d.ts +2 -2
- package/dist/layouts/ScrollContainer.js +1 -1
- package/dist/layouts/TabNavigatorLayout.d.ts +2 -2
- package/dist/layouts/TabNavigatorLayout.js +4 -0
- package/dist/primitives/AspectRatio.d.ts +10 -0
- package/dist/primitives/AspectRatio.js +8 -0
- package/dist/primitives/Box.d.ts +1 -1
- package/dist/primitives/Pressable.d.ts +10 -0
- package/dist/primitives/Pressable.js +9 -0
- package/dist/primitives/Row.d.ts +1 -1
- package/dist/primitives/Spacer.d.ts +8 -0
- package/dist/primitives/Spacer.js +9 -0
- package/dist/primitives/Stack.d.ts +1 -1
- package/dist/primitives/index.d.ts +3 -0
- package/dist/primitives/index.js +3 -0
- package/dist/theme/active.d.ts +2 -0
- package/dist/theme/active.js +13 -0
- package/dist/theme/components/ThemedActivityIndicator.d.ts +1 -1
- package/dist/theme/components/index.d.ts +1 -1
- package/dist/theme/components/index.js +1 -1
- package/dist/theme/dark.d.ts +7 -0
- package/dist/theme/dark.js +85 -0
- package/dist/theme/default.js +1 -0
- package/dist/theme/define.d.ts +5 -5
- package/dist/theme/define.js +5 -5
- package/dist/theme/index.d.ts +4 -1
- package/dist/theme/index.js +4 -1
- package/dist/theme/theme.d.ts +1 -1
- package/dist/theme/theme.js +1 -1
- package/dist/theme/types.d.ts +15 -14
- package/dist/theme/types.js +2 -2
- package/dist/theme/typography.d.ts +117 -60
- package/dist/theme/typography.js +115 -29
- package/dist/theme/useTheme.d.ts +3 -1
- package/dist/theme/useTheme.js +6 -1
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/index.js +2 -0
- package/dist/tokens/motion.d.ts +71 -0
- package/dist/tokens/motion.js +25 -0
- package/dist/utils/date.d.ts +33 -33
- package/dist/utils/date.js +39 -39
- package/dist/utils/timezone.d.ts +5 -0
- package/dist/views/AuthFormView.d.ts +1 -1
- package/dist/views/FormViewV2.context.d.ts +1 -1
- package/dist/views/FormViewV2.d.ts +12 -11
- package/dist/views/FormViewV2.js +8 -4
- package/dist/views/ListViewV2.context.d.ts +6 -2
- package/dist/views/ListViewV2.context.js +3 -1
- package/dist/views/ListViewV2.d.ts +26 -21
- package/dist/views/ListViewV2.js +18 -20
- package/dist/views/Wizard/Wizard.context.d.ts +1 -1
- package/dist/widgets/CircleButton.d.ts +6 -2
- package/dist/widgets/CircleButton.js +4 -0
- package/dist/widgets/GeoPermissionCard.d.ts +6 -1
- package/dist/widgets/GeoPermissionCard.js +8 -3
- package/dist/widgets/HomeHeader.d.ts +4 -0
- package/dist/widgets/HomeHeader.js +4 -0
- package/dist/widgets/JSONViewer.d.ts +2 -1
- package/dist/widgets/JSONViewer.js +9 -12
- package/dist/widgets/MenuCard.d.ts +1 -1
- package/dist/widgets/ScreenHeader.d.ts +5 -1
- package/dist/widgets/ScreenHeader.js +4 -0
- package/dist/widgets/TimeZoneSelector.d.ts +6 -1
- package/dist/widgets/TimeZoneSelector.js +6 -1
- package/dist/widgets/TimeZoneSelectorModal.d.ts +6 -1
- package/dist/widgets/TimeZoneSelectorModal.js +8 -3
- package/package.json +41 -23
- package/tailwind.preset.js +14 -0
- package/dist/notifications/index.d.ts +0 -1
- package/dist/notifications/index.js +0 -1
- package/dist/providers/index.d.ts +0 -1
- package/dist/providers/index.js +0 -2
package/dist/theme/typography.js
CHANGED
|
@@ -1,18 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
light: "
|
|
5
|
-
regular: "
|
|
6
|
-
medium: "
|
|
7
|
-
semiBold: "
|
|
8
|
-
extraBold: "
|
|
1
|
+
import { FiraCode_400Regular, FiraCode_500Medium } from "@expo-google-fonts/fira-code";
|
|
2
|
+
import { Inter_300Light, Inter_400Regular, Inter_500Medium, Inter_600SemiBold, Inter_800ExtraBold, useFonts, } from "@expo-google-fonts/inter";
|
|
3
|
+
const DEFAULT_FONT_FAMILIES = {
|
|
4
|
+
light: "Inter_300Light",
|
|
5
|
+
regular: "Inter_400Regular",
|
|
6
|
+
medium: "Inter_500Medium",
|
|
7
|
+
semiBold: "Inter_600SemiBold",
|
|
8
|
+
extraBold: "Inter_800ExtraBold",
|
|
9
|
+
mono: "FiraCode_400Regular",
|
|
10
|
+
monoMedium: "FiraCode_500Medium",
|
|
11
|
+
// Título: default Inter (seguro). Storybook/app lo apunta a Satoshi vía configureFonts.
|
|
12
|
+
titleRegular: "Inter_400Regular",
|
|
13
|
+
titleMedium: "Inter_500Medium",
|
|
14
|
+
title: "Inter_600SemiBold",
|
|
15
|
+
titleBlack: "Inter_800ExtraBold",
|
|
9
16
|
};
|
|
17
|
+
export const fontFamilies = { ...DEFAULT_FONT_FAMILIES };
|
|
18
|
+
/**
|
|
19
|
+
* Configura las familias de fuente del DS (rol → nombre de familia ya cargada por la app).
|
|
20
|
+
* Mutación in-place del singleton, así los componentes la leen en vivo. Ejemplo:
|
|
21
|
+
* `configureFonts({ title: "Satoshi-Bold", titleBlack: "Satoshi-Black" })`.
|
|
22
|
+
*/
|
|
23
|
+
export function configureFonts(overrides) {
|
|
24
|
+
Object.assign(fontFamilies, overrides);
|
|
25
|
+
}
|
|
26
|
+
/** Restablece las familias a los defaults (Inter + Fira Code). Útil en tests/stories. */
|
|
27
|
+
export function resetFonts() {
|
|
28
|
+
Object.assign(fontFamilies, DEFAULT_FONT_FAMILIES);
|
|
29
|
+
}
|
|
10
30
|
export const fontWeights = {
|
|
11
31
|
light: "300",
|
|
12
32
|
regular: "400",
|
|
13
33
|
medium: "500",
|
|
14
34
|
semiBold: "600",
|
|
15
35
|
extraBold: "800",
|
|
36
|
+
mono: "400",
|
|
37
|
+
monoMedium: "500",
|
|
38
|
+
titleRegular: "400",
|
|
39
|
+
titleMedium: "500",
|
|
40
|
+
title: "700",
|
|
41
|
+
titleBlack: "900",
|
|
16
42
|
};
|
|
17
43
|
/* -------------------- Font Sizes -------------------- */
|
|
18
44
|
export const fontSizes = {
|
|
@@ -49,33 +75,33 @@ export const letterSpacing = {
|
|
|
49
75
|
};
|
|
50
76
|
/* -------------------- Typography Variants -------------------- */
|
|
51
77
|
export const typographyVariants = {
|
|
52
|
-
// Display
|
|
78
|
+
// Display (Satoshi Black — carácter de marca)
|
|
53
79
|
display: {
|
|
54
80
|
fontSize: fontSizes["7xl"],
|
|
55
|
-
fontFamily: fontFamilies.
|
|
56
|
-
fontWeight: fontWeights.
|
|
81
|
+
fontFamily: fontFamilies.titleBlack,
|
|
82
|
+
fontWeight: fontWeights.titleBlack,
|
|
57
83
|
lineHeight: fontSizes["7xl"] * lineHeights.tight,
|
|
58
84
|
letterSpacing: letterSpacing.tight,
|
|
59
85
|
},
|
|
60
|
-
// Headings
|
|
86
|
+
// Headings (Satoshi Bold)
|
|
61
87
|
h1: {
|
|
62
88
|
fontSize: fontSizes["5xl"],
|
|
63
|
-
fontFamily: fontFamilies.
|
|
64
|
-
fontWeight: fontWeights.
|
|
89
|
+
fontFamily: fontFamilies.title,
|
|
90
|
+
fontWeight: fontWeights.title,
|
|
65
91
|
lineHeight: fontSizes["5xl"] * lineHeights.tight,
|
|
66
92
|
letterSpacing: letterSpacing.tight,
|
|
67
93
|
},
|
|
68
94
|
h2: {
|
|
69
95
|
fontSize: fontSizes["4xl"],
|
|
70
|
-
fontFamily: fontFamilies.
|
|
71
|
-
fontWeight: fontWeights.
|
|
96
|
+
fontFamily: fontFamilies.title,
|
|
97
|
+
fontWeight: fontWeights.title,
|
|
72
98
|
lineHeight: fontSizes["4xl"] * lineHeights.snug,
|
|
73
99
|
letterSpacing: letterSpacing.normal,
|
|
74
100
|
},
|
|
75
101
|
h3: {
|
|
76
102
|
fontSize: fontSizes["3xl"],
|
|
77
|
-
fontFamily: fontFamilies.
|
|
78
|
-
fontWeight: fontWeights.
|
|
103
|
+
fontFamily: fontFamilies.title,
|
|
104
|
+
fontWeight: fontWeights.title,
|
|
79
105
|
lineHeight: fontSizes["3xl"] * lineHeights.snug,
|
|
80
106
|
letterSpacing: letterSpacing.normal,
|
|
81
107
|
},
|
|
@@ -137,18 +163,42 @@ export const typographyVariants = {
|
|
|
137
163
|
lineHeight: fontSizes.sm * lineHeights.normal,
|
|
138
164
|
letterSpacing: letterSpacing.wide,
|
|
139
165
|
},
|
|
140
|
-
//
|
|
166
|
+
// Data — cifras, montos, SKU, % (mono Fira Code, peso medio). DS spec rol "data".
|
|
167
|
+
data: {
|
|
168
|
+
fontSize: fontSizes.lg,
|
|
169
|
+
fontFamily: fontFamilies.monoMedium,
|
|
170
|
+
fontWeight: fontWeights.monoMedium,
|
|
171
|
+
lineHeight: fontSizes.lg * lineHeights.tight,
|
|
172
|
+
letterSpacing: letterSpacing.normal,
|
|
173
|
+
},
|
|
174
|
+
dataLarge: {
|
|
175
|
+
fontSize: fontSizes["4xl"],
|
|
176
|
+
fontFamily: fontFamilies.monoMedium,
|
|
177
|
+
fontWeight: fontWeights.monoMedium,
|
|
178
|
+
lineHeight: fontSizes["4xl"] * lineHeights.none,
|
|
179
|
+
letterSpacing: letterSpacing.tight,
|
|
180
|
+
},
|
|
181
|
+
// Overline — labels/metadata en mono MAYÚSCULAS con tracking. DS spec rol "caption".
|
|
182
|
+
overline: {
|
|
183
|
+
fontSize: 11,
|
|
184
|
+
fontFamily: fontFamilies.mono,
|
|
185
|
+
fontWeight: fontWeights.mono,
|
|
186
|
+
lineHeight: 11 * lineHeights.snug,
|
|
187
|
+
letterSpacing: 0.6,
|
|
188
|
+
textTransform: "uppercase",
|
|
189
|
+
},
|
|
190
|
+
// Caption — Fira Code mono (secundario, metadata, labels de datos)
|
|
141
191
|
caption: {
|
|
142
192
|
fontSize: fontSizes.sm,
|
|
143
|
-
fontFamily: fontFamilies.
|
|
144
|
-
fontWeight: fontWeights.
|
|
193
|
+
fontFamily: fontFamilies.mono,
|
|
194
|
+
fontWeight: fontWeights.mono,
|
|
145
195
|
lineHeight: fontSizes.sm * lineHeights.normal,
|
|
146
196
|
letterSpacing: letterSpacing.normal,
|
|
147
197
|
},
|
|
148
198
|
captionSmall: {
|
|
149
199
|
fontSize: fontSizes.xs,
|
|
150
|
-
fontFamily: fontFamilies.
|
|
151
|
-
fontWeight: fontWeights.
|
|
200
|
+
fontFamily: fontFamilies.mono,
|
|
201
|
+
fontWeight: fontWeights.mono,
|
|
152
202
|
lineHeight: fontSizes.xs * lineHeights.normal,
|
|
153
203
|
letterSpacing: letterSpacing.normal,
|
|
154
204
|
},
|
|
@@ -190,6 +240,34 @@ export const typographyVariants = {
|
|
|
190
240
|
letterSpacing: letterSpacing.normal,
|
|
191
241
|
},
|
|
192
242
|
};
|
|
243
|
+
/* -------------------- Variant → Font Role --------------------
|
|
244
|
+
* Cada variante apunta a un ROL de fuente (no a una familia fija), para que
|
|
245
|
+
* `configureFonts` la cambie en vivo. `Typography.Text` resuelve `fontFamilies[rol]`
|
|
246
|
+
* en render. La familia "baked" de cada variante arriba queda solo como fallback. */
|
|
247
|
+
export const variantFontRole = {
|
|
248
|
+
display: "titleBlack",
|
|
249
|
+
h1: "titleBlack",
|
|
250
|
+
h2: "title",
|
|
251
|
+
h3: "title",
|
|
252
|
+
h4: "medium",
|
|
253
|
+
h5: "medium",
|
|
254
|
+
h6: "medium",
|
|
255
|
+
bodyLarge: "regular",
|
|
256
|
+
body: "regular",
|
|
257
|
+
bodySmall: "regular",
|
|
258
|
+
label: "medium",
|
|
259
|
+
labelSmall: "medium",
|
|
260
|
+
data: "monoMedium",
|
|
261
|
+
dataLarge: "monoMedium",
|
|
262
|
+
overline: "mono",
|
|
263
|
+
caption: "mono",
|
|
264
|
+
captionSmall: "mono",
|
|
265
|
+
button: "semiBold",
|
|
266
|
+
buttonSmall: "semiBold",
|
|
267
|
+
buttonLarge: "semiBold",
|
|
268
|
+
title: "semiBold",
|
|
269
|
+
subtitle: "medium",
|
|
270
|
+
};
|
|
193
271
|
/* -------------------- Utility Functions -------------------- */
|
|
194
272
|
export const createTextStyle = (variant, overrides) => ({
|
|
195
273
|
...typographyVariants[variant],
|
|
@@ -208,14 +286,19 @@ export const createCustomTextStyle = (fontSize, fontFamily, options) => {
|
|
|
208
286
|
...(options?.color && { color: options.color }),
|
|
209
287
|
};
|
|
210
288
|
};
|
|
211
|
-
/* -------------------- Font Loader --------------------
|
|
289
|
+
/* -------------------- Font Loader (opcional, conveniencia) --------------------
|
|
290
|
+
* Carga las fuentes recomendadas (Inter + Fira Code), que la app instala como peer deps.
|
|
291
|
+
* El rol "title" (Satoshi u otra) lo carga y enchufa la app/Storybook por su cuenta vía
|
|
292
|
+
* `configureFonts` — la librería NO bundlea archivos de fuente. */
|
|
212
293
|
export const useAppFonts = () => {
|
|
213
294
|
const [loaded] = useFonts({
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
295
|
+
FiraCode_400Regular,
|
|
296
|
+
FiraCode_500Medium,
|
|
297
|
+
Inter_300Light,
|
|
298
|
+
Inter_400Regular,
|
|
299
|
+
Inter_500Medium,
|
|
300
|
+
Inter_600SemiBold,
|
|
301
|
+
Inter_800ExtraBold,
|
|
219
302
|
});
|
|
220
303
|
return loaded;
|
|
221
304
|
};
|
|
@@ -227,8 +310,11 @@ export const Typography = {
|
|
|
227
310
|
lineHeights,
|
|
228
311
|
letterSpacing,
|
|
229
312
|
variants: typographyVariants,
|
|
313
|
+
variantFontRole,
|
|
230
314
|
createTextStyle,
|
|
231
315
|
createCustomTextStyle,
|
|
316
|
+
configureFonts,
|
|
317
|
+
resetFonts,
|
|
232
318
|
useAppFonts,
|
|
233
319
|
};
|
|
234
320
|
export default Typography;
|
package/dist/theme/useTheme.d.ts
CHANGED
package/dist/theme/useTheme.js
CHANGED
|
@@ -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,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 };
|
package/dist/utils/date.d.ts
CHANGED
|
@@ -3,25 +3,25 @@ interface FormatDateOptions {
|
|
|
3
3
|
showTime?: boolean;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Formats a date in the given timezone, respecting the granularity of the input.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* 1.
|
|
10
|
-
*
|
|
11
|
-
* 2.
|
|
12
|
-
*
|
|
13
|
-
* 3.
|
|
14
|
-
* 4.
|
|
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
|
-
*
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
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
|
-
*
|
|
21
|
-
* -
|
|
22
|
-
*
|
|
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
|
-
*
|
|
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" (
|
|
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
|
|
40
|
-
* @param timezone
|
|
41
|
-
* @param options
|
|
42
|
-
* @returns
|
|
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
|
-
*
|
|
47
|
-
*
|
|
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
|
|
50
|
-
* @param options
|
|
51
|
-
* @returns
|
|
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
|
-
*
|
|
56
|
-
*
|
|
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
|
|
59
|
-
* @returns
|
|
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
|
-
*
|
|
64
|
-
*
|
|
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
|
|
67
|
-
* @returns
|
|
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 {};
|
package/dist/utils/date.js
CHANGED
|
@@ -7,25 +7,25 @@ const DEFAULT_LOCALE = "es-CR";
|
|
|
7
7
|
dayjs.extend(utc);
|
|
8
8
|
dayjs.extend(timezone);
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Formats a date in the given timezone, respecting the granularity of the input.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* 1.
|
|
14
|
-
*
|
|
15
|
-
* 2.
|
|
16
|
-
*
|
|
17
|
-
* 3.
|
|
18
|
-
* 4.
|
|
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
|
-
*
|
|
21
|
-
* -
|
|
22
|
-
* -
|
|
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
|
-
*
|
|
25
|
-
* -
|
|
26
|
-
*
|
|
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
|
-
*
|
|
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" (
|
|
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
|
|
44
|
-
* @param timezone
|
|
45
|
-
* @param options
|
|
46
|
-
* @returns
|
|
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
|
-
//
|
|
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
|
|
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); //
|
|
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
|
|
78
|
+
console.warn("Error formatting date:", error);
|
|
79
79
|
return "Error de formateo";
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
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
|
|
87
|
-
* @param options
|
|
88
|
-
* @returns
|
|
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
|
-
*
|
|
95
|
-
*
|
|
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
|
|
98
|
-
* @returns
|
|
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
|
|
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
|
-
*
|
|
112
|
-
*
|
|
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
|
|
115
|
-
* @returns
|
|
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
|
|
123
|
+
console.warn("Error getting current date-time in timezone:", error);
|
|
124
124
|
return dayjs().toISOString(); // Fallback to local
|
|
125
125
|
}
|
|
126
126
|
}
|
package/dist/utils/timezone.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Region-coupled (LatAm locale data); relocated to the core alongside the
|
|
3
|
+
* TimeZone widgets. Import from `@sincpro/mobile/ui/components/molecules` instead. Kept
|
|
4
|
+
* here for backwards compatibility and removed in the next major.
|
|
5
|
+
*/
|
|
1
6
|
export interface TimezoneLocale {
|
|
2
7
|
timezone: string;
|
|
3
8
|
locale: string;
|
|
@@ -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
|
|
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
|
|
30
|
+
}): import("react").JSX.Element;
|
|
31
31
|
export declare function useFormView<T>(): FormViewContextValue<T>;
|
|
32
32
|
export {};
|