@umituz/react-native-design-system 2.11.6 → 2.11.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.7",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone, offline, onboarding, and loading utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -71,7 +71,6 @@
|
|
|
71
71
|
"@tanstack/query-async-storage-persister": ">=5.0.0",
|
|
72
72
|
"@tanstack/react-query": ">=5.0.0",
|
|
73
73
|
"@tanstack/react-query-persist-client": ">=5.0.0",
|
|
74
|
-
"@umituz/react-native-localization": "*",
|
|
75
74
|
"expo-application": ">=5.0.0",
|
|
76
75
|
"expo-clipboard": ">=8.0.0",
|
|
77
76
|
"expo-crypto": ">=13.0.0",
|
|
@@ -118,7 +117,6 @@
|
|
|
118
117
|
"@types/react-native": "^0.73.0",
|
|
119
118
|
"@typescript-eslint/eslint-plugin": "^8.50.1",
|
|
120
119
|
"@typescript-eslint/parser": "^8.50.1",
|
|
121
|
-
"@umituz/react-native-localization": "*",
|
|
122
120
|
"eslint": "^9.39.2",
|
|
123
121
|
"eslint-plugin-react": "^7.37.5",
|
|
124
122
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
@@ -141,9 +139,7 @@
|
|
|
141
139
|
"expo-secure-store": "~15.0.8",
|
|
142
140
|
"expo-sharing": "~14.0.8",
|
|
143
141
|
"expo-video": "~3.0.15",
|
|
144
|
-
"i18next": "^25.0.0",
|
|
145
142
|
"react": "19.1.0",
|
|
146
|
-
"react-i18next": "^16.0.0",
|
|
147
143
|
"react-native": "0.81.5",
|
|
148
144
|
"react-native-gesture-handler": "^2.20.0",
|
|
149
145
|
"react-native-safe-area-context": "^5.6.0",
|
|
@@ -2,7 +2,6 @@ import React from "react";
|
|
|
2
2
|
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
3
3
|
import { AtomicIcon, useIconName } from "../../../atoms";
|
|
4
4
|
import { AtomicText } from "../../../atoms/AtomicText";
|
|
5
|
-
import { useLocalization } from "@umituz/react-native-localization";
|
|
6
5
|
import { useOnboardingProvider } from "../providers/OnboardingProvider";
|
|
7
6
|
|
|
8
7
|
export interface OnboardingHeaderProps {
|
|
@@ -22,14 +21,11 @@ export const OnboardingHeader = ({
|
|
|
22
21
|
showSkipButton = true,
|
|
23
22
|
skipButtonText,
|
|
24
23
|
}: OnboardingHeaderProps) => {
|
|
25
|
-
const { t } = useLocalization();
|
|
26
24
|
const {
|
|
27
25
|
theme: { colors },
|
|
28
26
|
} = useOnboardingProvider();
|
|
29
27
|
const chevronLeftIcon = useIconName('chevronLeft');
|
|
30
28
|
|
|
31
|
-
const skipText = skipButtonText || t("onboarding.skip");
|
|
32
|
-
|
|
33
29
|
return (
|
|
34
30
|
<View style={styles.header}>
|
|
35
31
|
{showBackButton ? (
|
|
@@ -52,13 +48,13 @@ export const OnboardingHeader = ({
|
|
|
52
48
|
) : (
|
|
53
49
|
<View style={styles.headerButton} />
|
|
54
50
|
)}
|
|
55
|
-
{showSkipButton ? (
|
|
51
|
+
{showSkipButton && skipButtonText ? (
|
|
56
52
|
<TouchableOpacity onPress={onSkip} activeOpacity={0.7}>
|
|
57
53
|
<AtomicText
|
|
58
54
|
type="labelLarge"
|
|
59
55
|
style={[styles.skipText, { color: colors.textColor }]}
|
|
60
56
|
>
|
|
61
|
-
{
|
|
57
|
+
{skipButtonText}
|
|
62
58
|
</AtomicText>
|
|
63
59
|
</TouchableOpacity>
|
|
64
60
|
) : <View />}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* QuestionSlide Component
|
|
3
|
-
* Single Responsibility: Render a question-type slide
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
1
|
import React from "react";
|
|
7
2
|
import { View, StyleSheet } from "react-native";
|
|
8
3
|
import { AtomicText } from "../../../atoms/AtomicText";
|
|
@@ -11,24 +6,24 @@ import { QuestionSlideHeader } from "./QuestionSlideHeader";
|
|
|
11
6
|
import { QuestionRenderer } from "./QuestionRenderer";
|
|
12
7
|
import { BaseSlide } from "./BaseSlide";
|
|
13
8
|
import { useOnboardingProvider } from "../providers/OnboardingProvider";
|
|
14
|
-
import { useLocalization } from "@umituz/react-native-localization";
|
|
15
9
|
|
|
16
10
|
export interface QuestionSlideProps {
|
|
17
11
|
slide: OnboardingSlide;
|
|
18
12
|
value: any;
|
|
19
13
|
onChange: (value: any) => void;
|
|
20
14
|
variant?: "default" | "card" | "minimal" | "fullscreen";
|
|
15
|
+
fieldRequiredText?: string;
|
|
21
16
|
}
|
|
22
17
|
|
|
23
18
|
export const QuestionSlide = ({
|
|
24
19
|
slide,
|
|
25
20
|
value,
|
|
26
21
|
onChange,
|
|
22
|
+
fieldRequiredText,
|
|
27
23
|
}: QuestionSlideProps) => {
|
|
28
24
|
const {
|
|
29
25
|
theme: { colors },
|
|
30
26
|
} = useOnboardingProvider();
|
|
31
|
-
const { t } = useLocalization();
|
|
32
27
|
const { question } = slide;
|
|
33
28
|
|
|
34
29
|
if (!question) return null;
|
|
@@ -41,12 +36,12 @@ export const QuestionSlide = ({
|
|
|
41
36
|
<QuestionRenderer question={question} value={value} onChange={onChange} />
|
|
42
37
|
</View>
|
|
43
38
|
|
|
44
|
-
{question.validation?.required && !value && (
|
|
39
|
+
{question.validation?.required && !value && fieldRequiredText && (
|
|
45
40
|
<AtomicText
|
|
46
41
|
type="labelSmall"
|
|
47
42
|
style={[styles.requiredHint, { color: colors.errorColor }]}
|
|
48
43
|
>
|
|
49
|
-
{
|
|
44
|
+
{fieldRequiredText}
|
|
50
45
|
</AtomicText>
|
|
51
46
|
)}
|
|
52
47
|
</BaseSlide>
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* useTimezone Hook
|
|
3
|
-
*
|
|
4
|
-
* React hook for timezone operations with automatic locale integration
|
|
5
|
-
* Integrates with localization package for locale-aware date/time formatting
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
1
|
import { useMemo, useCallback } from 'react';
|
|
9
|
-
import { useLocalization } from '@umituz/react-native-localization';
|
|
10
2
|
import { timezoneService } from '../../infrastructure/services/TimezoneService';
|
|
11
3
|
import type { TimezoneInfo, TimezoneCalendarDay } from '../../domain/entities/Timezone';
|
|
12
4
|
|
|
@@ -51,24 +43,28 @@ export interface UseTimezoneReturn {
|
|
|
51
43
|
fromNow: (date: Date) => string;
|
|
52
44
|
}
|
|
53
45
|
|
|
54
|
-
export
|
|
55
|
-
|
|
46
|
+
export interface UseTimezoneOptions {
|
|
47
|
+
locale?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const useTimezone = (options?: UseTimezoneOptions): UseTimezoneReturn => {
|
|
51
|
+
const locale = options?.locale ?? 'en';
|
|
56
52
|
const timezoneInfo = useMemo(() => timezoneService.getTimezoneInfo(), []);
|
|
57
53
|
|
|
58
54
|
const formatDate = useCallback((date: Date, options?: Intl.DateTimeFormatOptions) =>
|
|
59
|
-
timezoneService.formatDate(date,
|
|
55
|
+
timezoneService.formatDate(date, locale, options), [locale]);
|
|
60
56
|
|
|
61
57
|
const formatTime = useCallback((date: Date, options?: Intl.DateTimeFormatOptions) =>
|
|
62
|
-
timezoneService.formatTime(date,
|
|
58
|
+
timezoneService.formatTime(date, locale, options), [locale]);
|
|
63
59
|
|
|
64
60
|
const formatDateTime = useCallback((date: Date, options?: Intl.DateTimeFormatOptions) =>
|
|
65
|
-
timezoneService.formatDateTime(date,
|
|
61
|
+
timezoneService.formatDateTime(date, locale, options), [locale]);
|
|
66
62
|
|
|
67
63
|
const formatRelativeTime = useCallback((date: Date) =>
|
|
68
|
-
timezoneService.formatRelativeTime(date,
|
|
64
|
+
timezoneService.formatRelativeTime(date, locale), [locale]);
|
|
69
65
|
|
|
70
66
|
const fromNow = useCallback((date: Date) =>
|
|
71
|
-
timezoneService.fromNow(date,
|
|
67
|
+
timezoneService.fromNow(date, locale), [locale]);
|
|
72
68
|
|
|
73
69
|
const getCalendarDays = useCallback((year: number, month: number) =>
|
|
74
70
|
timezoneService.getCalendarDays(year, month), []);
|