@umituz/react-native-design-system 2.5.7 → 2.5.8
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 +1 -1
- package/src/atoms/AtomicIcon.tsx +3 -2
- package/src/molecules/animation/presentation/hooks/useFireworks.ts +2 -1
- package/src/molecules/avatar/Avatar.utils.ts +5 -3
- package/src/molecules/calendar/infrastructure/storage/CalendarStore.ts +2 -2
- package/src/molecules/calendar/infrastructure/utils/DateUtilities.ts +6 -2
- package/src/molecules/calendar/presentation/hooks/useCalendar.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.8",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive and safe area utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
package/src/atoms/AtomicIcon.tsx
CHANGED
|
@@ -110,9 +110,10 @@ export const AtomicIcon: React.FC<AtomicIconProps> = React.memo(({
|
|
|
110
110
|
|
|
111
111
|
// Calculate size
|
|
112
112
|
const baseSize = customSize ?? size;
|
|
113
|
-
const
|
|
113
|
+
const iconSizesMap = tokens.iconSizes as Record<string, number>;
|
|
114
|
+
const sizeInPixels: number = typeof baseSize === 'number'
|
|
114
115
|
? baseSize * tokens.spacingMultiplier
|
|
115
|
-
:
|
|
116
|
+
: iconSizesMap[baseSize] ?? iconSizesMap['md'] ?? 24;
|
|
116
117
|
|
|
117
118
|
// Calculate color
|
|
118
119
|
const iconColor = customColor
|
|
@@ -104,7 +104,8 @@ export const useFireworks = (config: FireworksConfig) => {
|
|
|
104
104
|
|
|
105
105
|
const newParticles: ParticleConfig[] = [];
|
|
106
106
|
for (let i = 0; i < particleCount; i++) {
|
|
107
|
-
const
|
|
107
|
+
const colorIndex = Math.floor(Math.random() * colors.length);
|
|
108
|
+
const color = colors[colorIndex] ?? colors[0] ?? '#FFFFFF';
|
|
108
109
|
newParticles.push(createParticle(centerX, centerY, color));
|
|
109
110
|
}
|
|
110
111
|
|
|
@@ -165,9 +165,11 @@ export class AvatarUtils {
|
|
|
165
165
|
|
|
166
166
|
if (words.length >= 2) {
|
|
167
167
|
// Full name: First letter of first + first letter of last
|
|
168
|
-
const
|
|
169
|
-
const
|
|
170
|
-
|
|
168
|
+
const firstWord = words[0] ?? '';
|
|
169
|
+
const lastWord = words[words.length - 1] ?? '';
|
|
170
|
+
const first = firstWord[0] ?? '';
|
|
171
|
+
const last = lastWord[0] ?? '';
|
|
172
|
+
return (first + last).toLocaleUpperCase('tr-TR') || '?';
|
|
171
173
|
} else {
|
|
172
174
|
// Single word: First 2 letters
|
|
173
175
|
return trimmed.slice(0, 2).toLocaleUpperCase('tr-TR');
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* - Timezone-aware via CalendarService
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { create } from 'zustand';
|
|
15
|
-
import { persist, createJSONStorage } from 'zustand/middleware';
|
|
14
|
+
import { create, type StateCreator } from 'zustand';
|
|
15
|
+
import { persist, createJSONStorage, type PersistOptions } from 'zustand/middleware';
|
|
16
16
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
17
17
|
import type { CalendarEvent, CreateCalendarEventRequest, UpdateCalendarEventRequest } from '../../domain/entities/CalendarEvent.entity';
|
|
18
18
|
import { CalendarService } from '../services/CalendarService';
|
|
@@ -14,7 +14,8 @@ export class DateUtilities {
|
|
|
14
14
|
* Format date to string (YYYY-MM-DD)
|
|
15
15
|
*/
|
|
16
16
|
static formatDateToString(date: Date): string {
|
|
17
|
-
|
|
17
|
+
const parts = date.toISOString().split('T');
|
|
18
|
+
return parts[0] ?? '';
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -91,7 +92,10 @@ export class DateUtilities {
|
|
|
91
92
|
* Parse date from string (YYYY-MM-DD)
|
|
92
93
|
*/
|
|
93
94
|
static parseDate(dateString: string): Date {
|
|
94
|
-
const
|
|
95
|
+
const parts = dateString.split('-').map(Number);
|
|
96
|
+
const year = parts[0] ?? 0;
|
|
97
|
+
const month = parts[1] ?? 1;
|
|
98
|
+
const day = parts[2] ?? 1;
|
|
95
99
|
return new Date(year, month - 1, day);
|
|
96
100
|
}
|
|
97
101
|
|
|
@@ -84,7 +84,7 @@ export const useCalendar = (): UseCalendarReturn => {
|
|
|
84
84
|
isLoading,
|
|
85
85
|
error,
|
|
86
86
|
actions,
|
|
87
|
-
} = useCalendarStore((state) => state);
|
|
87
|
+
} = useCalendarStore((state: ReturnType<typeof useCalendarStore.getState>) => state);
|
|
88
88
|
|
|
89
89
|
// Load events on mount
|
|
90
90
|
useEffect(() => {
|
|
@@ -133,7 +133,7 @@ export const useCalendarNavigation = () => {
|
|
|
133
133
|
selectedDate,
|
|
134
134
|
currentMonth,
|
|
135
135
|
actions: { setSelectedDate, navigateMonth, goToToday, setCurrentMonth },
|
|
136
|
-
} = useCalendarStore((state) => state);
|
|
136
|
+
} = useCalendarStore((state: ReturnType<typeof useCalendarStore.getState>) => state);
|
|
137
137
|
|
|
138
138
|
return {
|
|
139
139
|
selectedDate,
|
|
@@ -163,7 +163,7 @@ export const useCalendarEvents = () => {
|
|
|
163
163
|
uncompleteEvent,
|
|
164
164
|
clearError,
|
|
165
165
|
},
|
|
166
|
-
} = useCalendarStore((state) => state);
|
|
166
|
+
} = useCalendarStore((state: ReturnType<typeof useCalendarStore.getState>) => state);
|
|
167
167
|
|
|
168
168
|
return {
|
|
169
169
|
events,
|