@sincpro/mobile-ui 0.2.1 → 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.
- package/README.md +75 -20
- package/dist/Dialog/BottomSheet/BottomSheet.Root.d.ts +11 -7
- package/dist/Dialog/BottomSheet/BottomSheet.Root.js +4 -0
- 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.EditValue.d.ts +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.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 +13 -0
- package/dist/Display/Display.ListItem.js +14 -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.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 +66 -0
- package/dist/Display/index.js +54 -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 +1 -1
- 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 +2 -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.Splash.d.ts +1 -1
- package/dist/Feedback/Toast.context.d.ts +35 -0
- package/dist/Feedback/Toast.context.js +119 -0
- package/dist/Feedback/index.d.ts +15 -0
- package/dist/Feedback/index.js +15 -0
- package/dist/Form/Form.Button.d.ts +6 -0
- package/dist/Form/Form.Button.js +12 -1
- package/dist/Form/Form.Checkbox.d.ts +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.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 +41 -0
- package/dist/Navigation/Navigation.AppBar.js +33 -0
- package/dist/Navigation/Navigation.BottomNav.d.ts +29 -0
- package/dist/Navigation/Navigation.BottomNav.js +35 -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 +22 -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 +1 -1
- 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 +2 -1
- 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 +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/layouts/AuthContainer.d.ts +1 -1
- 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 +84 -0
- package/dist/theme/define.d.ts +5 -5
- package/dist/theme/define.js +5 -5
- package/dist/theme/index.d.ts +3 -1
- package/dist/theme/index.js +3 -1
- package/dist/theme/theme.d.ts +1 -1
- package/dist/theme/theme.js +1 -1
- package/dist/theme/types.d.ts +14 -14
- package/dist/theme/types.js +2 -2
- 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/views/AuthFormView.d.ts +1 -1
- package/dist/views/FormViewV2.context.d.ts +1 -1
- package/dist/views/FormViewV2.d.ts +10 -10
- package/dist/views/ListViewV2.context.d.ts +1 -1
- package/dist/views/ListViewV2.d.ts +20 -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 +1 -1
- 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 +6 -6
- 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 +1 -1
- package/dist/widgets/TimeZoneSelectorModal.d.ts +1 -1
- package/package.json +38 -25
- 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/types.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* THEME SYSTEM - SIMPLE & SEMANTIC
|
|
4
4
|
* ============================================================================
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
-
/**
|
|
20
|
+
/** Theme name */
|
|
21
21
|
name: string;
|
|
22
|
-
/**
|
|
22
|
+
/** Primary color - main buttons, links, active states */
|
|
23
23
|
primary: string;
|
|
24
|
-
/**
|
|
24
|
+
/** Secondary color - secondary buttons, low-profile elements (gray) */
|
|
25
25
|
secondary: string;
|
|
26
|
-
/**
|
|
26
|
+
/** Accent color - highlights, important badges, secondary CTAs (orange/indigo) */
|
|
27
27
|
accent: string;
|
|
28
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
61
|
+
/** Borders */
|
|
62
62
|
border: {
|
|
63
63
|
default: string;
|
|
64
64
|
light: string;
|
|
65
65
|
strong: string;
|
|
66
66
|
focus: string;
|
|
67
67
|
};
|
|
68
|
-
/**
|
|
68
|
+
/** Semantic states */
|
|
69
69
|
success: string;
|
|
70
70
|
warning: string;
|
|
71
71
|
danger: string;
|
|
72
72
|
info: string;
|
|
73
|
-
/**
|
|
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
|
-
/**
|
|
81
|
+
/** Gradients (for LinearGradient) */
|
|
82
82
|
gradient: {
|
|
83
83
|
primary: readonly [string, string];
|
|
84
84
|
accent: readonly [string, string];
|
|
85
85
|
};
|
|
86
|
-
/**
|
|
86
|
+
/** Shadows (React Native) */
|
|
87
87
|
shadow: {
|
|
88
88
|
sm: ShadowStyle;
|
|
89
89
|
md: ShadowStyle;
|
package/dist/theme/types.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* THEME SYSTEM - SIMPLE & SEMANTIC
|
|
4
4
|
* ============================================================================
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Simplified theming system without hooks or context.
|
|
7
|
+
* Tokens are read directly from the active theme.
|
|
8
8
|
*/
|
|
9
9
|
export {};
|
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
|
}
|
|
@@ -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 {};
|
|
@@ -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>):
|
|
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
|
-
}):
|
|
24
|
+
}): React.JSX.Element;
|
|
25
25
|
declare function HeaderActions({ children }: {
|
|
26
26
|
children: ReactNode;
|
|
27
|
-
}):
|
|
27
|
+
}): React.JSX.Element;
|
|
28
28
|
declare function HeaderActionsBar({ children }: {
|
|
29
29
|
children: ReactNode;
|
|
30
|
-
}):
|
|
30
|
+
}): React.JSX.Element;
|
|
31
31
|
declare function Content({ withMargin, children, }: {
|
|
32
32
|
withMargin?: boolean;
|
|
33
33
|
children: ReactNode;
|
|
34
|
-
}):
|
|
34
|
+
}): React.JSX.Element;
|
|
35
35
|
declare function Form({ children }: {
|
|
36
36
|
children: ReactNode;
|
|
37
|
-
}):
|
|
37
|
+
}): React.JSX.Element;
|
|
38
38
|
declare function Groups({ children }: {
|
|
39
39
|
children: ReactNode;
|
|
40
|
-
}):
|
|
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
|
-
}):
|
|
45
|
+
}): React.JSX.Element;
|
|
46
46
|
declare function Footer({ children }: {
|
|
47
47
|
children: ReactNode;
|
|
48
|
-
}):
|
|
48
|
+
}): React.JSX.Element | null;
|
|
49
49
|
export declare const FormViewV2: {
|
|
50
50
|
Root: typeof FormViewRoot;
|
|
51
51
|
Header: typeof Header & {
|
|
@@ -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
|
|
34
|
+
}): import("react").JSX.Element;
|
|
35
35
|
export declare function useListView<T>(): ListViewContextValue<T>;
|
|
36
36
|
export {};
|