@flipova/foundation 2.2.1 → 2.4.0-beta.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.
Files changed (109) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +157 -156
  3. package/components/ui/accordion/ANIMATION_CUSTOMIZATION.md +16 -7
  4. package/components/ui/accordion/AccordionAnimatedHeight.tsx +3 -15
  5. package/components/ui/accordion/AccordionAnimatedIcon.tsx +2 -9
  6. package/components/ui/accordion/AnimatedHeight.tsx +3 -15
  7. package/components/ui/accordion/AnimatedIcon.tsx +2 -9
  8. package/components/ui/accordion/MIGRATION_SUMMARY.md +22 -11
  9. package/components/ui/accordion/USAGE_EXAMPLE.tsx +10 -25
  10. package/components/ui/accordion/index.tsx +71 -139
  11. package/components/ui/actionsheet/index.tsx +63 -105
  12. package/components/ui/alert/index.tsx +20 -50
  13. package/components/ui/alert-dialog/index.tsx +23 -48
  14. package/components/ui/avatar/index.tsx +32 -68
  15. package/components/ui/badge/index.tsx +18 -49
  16. package/components/ui/bottomsheet/index.tsx +20 -52
  17. package/components/ui/box/index.tsx +4 -9
  18. package/components/ui/box/index.web.tsx +3 -9
  19. package/components/ui/button/index.tsx +73 -109
  20. package/components/ui/calendar/creator.tsx +69 -30
  21. package/components/ui/calendar/index.tsx +81 -159
  22. package/components/ui/calendar/styles.tsx +10 -10
  23. package/components/ui/card/index.tsx +8 -9
  24. package/components/ui/card/index.web.tsx +4 -10
  25. package/components/ui/center/index.tsx +6 -11
  26. package/components/ui/center/index.web.tsx +3 -9
  27. package/components/ui/checkbox/index.tsx +46 -107
  28. package/components/ui/date-time-picker/creator.tsx +14 -1
  29. package/components/ui/date-time-picker/index.tsx +107 -156
  30. package/components/ui/date-time-picker/index.web.tsx +11 -33
  31. package/components/ui/date-time-picker/styles.tsx +5 -5
  32. package/components/ui/divider/index.tsx +5 -6
  33. package/components/ui/drawer/index.tsx +108 -128
  34. package/components/ui/fab/index.tsx +25 -68
  35. package/components/ui/flat-list/index.tsx +11 -8
  36. package/components/ui/form-control/index.tsx +49 -90
  37. package/components/ui/gluestack-ui-provider/config.ts +69 -2
  38. package/components/ui/gluestack-ui-provider/index.tsx +32 -12
  39. package/components/ui/gluestack-ui-provider/index.web.tsx +43 -16
  40. package/components/ui/gluestack-ui-provider/script.ts +13 -8
  41. package/components/ui/gluestack-ui-provider/theme-context.ts +36 -1
  42. package/components/ui/gluestack-ui-provider/useGluestackColors.ts +11 -4
  43. package/components/ui/grid/index.tsx +128 -165
  44. package/components/ui/grid/index.web.tsx +17 -19
  45. package/components/ui/grid/styles.tsx +1 -3
  46. package/components/ui/heading/index.tsx +146 -169
  47. package/components/ui/heading/index.web.tsx +7 -28
  48. package/components/ui/heading/styles.tsx +5 -5
  49. package/components/ui/hstack/index.tsx +16 -15
  50. package/components/ui/hstack/index.web.tsx +17 -17
  51. package/components/ui/hstack/styles.tsx +5 -5
  52. package/components/ui/icon/index.tsx +95 -486
  53. package/components/ui/icon/index.web.tsx +79 -439
  54. package/components/ui/image/index.tsx +13 -18
  55. package/components/ui/image-viewer/index.tsx +149 -221
  56. package/components/ui/image-viewer/index.web.tsx +88 -113
  57. package/components/ui/input/index.tsx +20 -33
  58. package/components/ui/link/index.tsx +16 -22
  59. package/components/ui/liquid-glass/index.tsx +19 -25
  60. package/components/ui/menu/index.tsx +44 -66
  61. package/components/ui/modal/index.tsx +70 -91
  62. package/components/ui/popover/index.tsx +102 -121
  63. package/components/ui/portal/index.tsx +5 -6
  64. package/components/ui/pressable/index.tsx +5 -9
  65. package/components/ui/progress/index.tsx +4 -11
  66. package/components/ui/radio/index.tsx +47 -83
  67. package/components/ui/select/index.tsx +38 -59
  68. package/components/ui/select/select-actionsheet.tsx +61 -108
  69. package/components/ui/skeleton/index.tsx +22 -43
  70. package/components/ui/skeleton/index.web.tsx +63 -75
  71. package/components/ui/slider/index.tsx +36 -56
  72. package/components/ui/spinner/index.tsx +1 -10
  73. package/components/ui/switch/index.tsx +6 -13
  74. package/components/ui/table/index.tsx +39 -102
  75. package/components/ui/table/index.web.tsx +41 -79
  76. package/components/ui/tabs/TabsAnimatedIndicator.tsx +10 -38
  77. package/components/ui/tabs/creator.tsx +32 -24
  78. package/components/ui/tabs/index.tsx +253 -309
  79. package/components/ui/text/index.tsx +23 -37
  80. package/components/ui/text/index.web.tsx +33 -35
  81. package/components/ui/text/styles.tsx +5 -5
  82. package/components/ui/textarea/index.tsx +24 -38
  83. package/components/ui/toast/index.tsx +47 -52
  84. package/components/ui/tooltip/index.tsx +12 -28
  85. package/components/ui/vstack/index.tsx +17 -17
  86. package/components/ui/vstack/index.web.tsx +17 -17
  87. package/components/ui/vstack/styles.tsx +5 -5
  88. package/design/canonical.index.txt +15 -1
  89. package/design/manifest.xml +2 -0
  90. package/design/schema.xsd +11 -0
  91. package/design/themes.xml +175 -2
  92. package/design/tools/design.js +15 -12
  93. package/design/tools/npm.js +4 -3
  94. package/design/tools/sources/.generate/config.py +60 -2
  95. package/dist/{chunk-RPLDFHEZ.mjs → chunk-2R66P5X5.mjs} +1907 -3130
  96. package/dist/chunk-2R66P5X5.mjs.map +1 -0
  97. package/dist/{chunk-JVHJUIXV.js → chunk-LCTFQJZM.js} +1909 -3129
  98. package/dist/chunk-LCTFQJZM.js.map +1 -0
  99. package/dist/index.d.mts +1 -1
  100. package/dist/index.d.ts +1 -1
  101. package/dist/index.js +303 -291
  102. package/dist/index.mjs +1 -1
  103. package/dist/ui/index.d.mts +44 -3
  104. package/dist/ui/index.d.ts +44 -3
  105. package/dist/ui/index.js +303 -291
  106. package/dist/ui/index.mjs +1 -1
  107. package/package.json +12 -7
  108. package/dist/chunk-JVHJUIXV.js.map +0 -1
  109. package/dist/chunk-RPLDFHEZ.mjs.map +0 -1
@@ -48,15 +48,27 @@ export interface ICalendarProps {
48
48
  const DAY_MS = 86400000;
49
49
  const WEEKDAY_LABELS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
50
50
  const MONTH_LABELS = [
51
- 'January', 'February', 'March', 'April', 'May', 'June',
52
- 'July', 'August', 'September', 'October', 'November', 'December',
51
+ 'January',
52
+ 'February',
53
+ 'March',
54
+ 'April',
55
+ 'May',
56
+ 'June',
57
+ 'July',
58
+ 'August',
59
+ 'September',
60
+ 'October',
61
+ 'November',
62
+ 'December',
53
63
  ];
54
64
 
55
65
  function stripTime(d: Date) {
56
66
  return new Date(d.getFullYear(), d.getMonth(), d.getDate());
57
67
  }
58
68
  function isSameDay(a?: Date, b?: Date) {
59
- return !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
69
+ return (
70
+ !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()
71
+ );
60
72
  }
61
73
  function startOfMonthDate(d: Date) {
62
74
  return new Date(d.getFullYear(), d.getMonth(), 1);
@@ -96,7 +108,10 @@ function getWeekNumber(date: Date) {
96
108
  const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
97
109
  return Math.ceil(((d.getTime() - yearStart.getTime()) / DAY_MS + 1) / 7);
98
110
  }
99
- function isDateDisabled(date: Date, props: Pick<ICalendarProps, 'minimumDate' | 'maximumDate' | 'disabledDates' | 'disabled'>) {
111
+ function isDateDisabled(
112
+ date: Date,
113
+ props: Pick<ICalendarProps, 'minimumDate' | 'maximumDate' | 'disabledDates' | 'disabled'>,
114
+ ) {
100
115
  if (props.disabled) return true;
101
116
  if (props.minimumDate && stripTime(date) < stripTime(props.minimumDate)) return true;
102
117
  if (props.maximumDate && stripTime(date) > stripTime(props.maximumDate)) return true;
@@ -129,8 +144,22 @@ export interface CreateCalendarConfig {
129
144
 
130
145
  export function createCalendar(slots: CreateCalendarConfig) {
131
146
  const {
132
- Root, Header, HeaderPrevButton, HeaderNextButton, HeaderMonthSelect, HeaderYearSelect,
133
- WeekDaysHeader, WeekDay, Body, Grid, Week, Day, DayText, DayIndicator, WeekNumber, Footer,
147
+ Root,
148
+ Header,
149
+ HeaderPrevButton,
150
+ HeaderNextButton,
151
+ HeaderMonthSelect,
152
+ HeaderYearSelect,
153
+ WeekDaysHeader,
154
+ WeekDay,
155
+ Body,
156
+ Grid,
157
+ Week,
158
+ Day,
159
+ DayText,
160
+ DayIndicator,
161
+ WeekNumber,
162
+ Footer,
134
163
  } = slots;
135
164
 
136
165
  const Calendar = React.forwardRef<any, ICalendarProps & { className?: string }>(function Calendar(props, ref) {
@@ -162,7 +191,8 @@ export function createCalendar(slots: CreateCalendarConfig) {
162
191
  if (defaultMonth) return startOfMonthDate(defaultMonth);
163
192
  if (mode === 'single' && currentValue instanceof Date) return startOfMonthDate(currentValue);
164
193
  if (mode === 'range' && currentValue?.from) return startOfMonthDate(currentValue.from);
165
- if (mode === 'multiple' && Array.isArray(currentValue) && currentValue[0]) return startOfMonthDate(currentValue[0]);
194
+ if (mode === 'multiple' && Array.isArray(currentValue) && currentValue[0])
195
+ return startOfMonthDate(currentValue[0]);
166
196
  return startOfMonthDate(new Date());
167
197
  });
168
198
  const displayedMonth = controlledMonth ? startOfMonthDate(controlledMonth) : uncontrolledMonth;
@@ -172,7 +202,7 @@ export function createCalendar(slots: CreateCalendarConfig) {
172
202
  if (!controlledMonth) setUncontrolledMonth(next);
173
203
  onMonthChange?.(next);
174
204
  },
175
- [controlledMonth, onMonthChange]
205
+ [controlledMonth, onMonthChange],
176
206
  );
177
207
 
178
208
  const setValue = React.useCallback(
@@ -180,7 +210,7 @@ export function createCalendar(slots: CreateCalendarConfig) {
180
210
  if (value === undefined) setUncontrolledValue(next);
181
211
  onValueChange?.(next);
182
212
  },
183
- [value, onValueChange]
213
+ [value, onValueChange],
184
214
  );
185
215
 
186
216
  const handleDayPress = React.useCallback(
@@ -204,13 +234,13 @@ export function createCalendar(slots: CreateCalendarConfig) {
204
234
  setValue(date);
205
235
  }
206
236
  },
207
- [mode, currentValue, setValue, minimumDate, maximumDate, disabledDates, disabled]
237
+ [mode, currentValue, setValue, minimumDate, maximumDate, disabledDates, disabled],
208
238
  );
209
239
 
210
240
  const weeks = React.useMemo(() => buildMonthGrid(displayedMonth, weekStartsOn), [displayedMonth, weekStartsOn]);
211
241
  const weekDayLabels = React.useMemo(
212
242
  () => Array.from({ length: 7 }, (_, i) => WEEKDAY_LABELS[(weekStartsOn + i) % 7]),
213
- [weekStartsOn]
243
+ [weekStartsOn],
214
244
  );
215
245
  const today = React.useMemo(() => new Date(), []);
216
246
 
@@ -241,11 +271,19 @@ export function createCalendar(slots: CreateCalendarConfig) {
241
271
  const isRangeStart = !!range?.from && isSameDay(date, range.from);
242
272
  const isRangeEnd = !!range?.to && isSameDay(date, range.to);
243
273
  const isInRange = !!range?.from && !!range?.to && date > stripTime(range.from) && date < stripTime(range.to);
244
- return { isSelected: isRangeStart || isRangeEnd, isToday, isDisabled, isOutsideMonth, isInRange, isRangeStart, isRangeEnd };
274
+ return {
275
+ isSelected: isRangeStart || isRangeEnd,
276
+ isToday,
277
+ isDisabled,
278
+ isOutsideMonth,
279
+ isInRange,
280
+ isRangeStart,
281
+ isRangeEnd,
282
+ };
245
283
  }
246
284
  return { isSelected: isSameDay(currentValue as Date | undefined, date), isToday, isDisabled, isOutsideMonth };
247
285
  },
248
- [mode, currentValue, displayedMonth, today, minimumDate, maximumDate, disabledDates, disabled]
286
+ [mode, currentValue, displayedMonth, today, minimumDate, maximumDate, disabledDates, disabled],
249
287
  );
250
288
 
251
289
  return (
@@ -289,23 +327,24 @@ export function createCalendar(slots: CreateCalendarConfig) {
289
327
  {week.map((date) => {
290
328
  const state = resolveDayState(date);
291
329
  const dayMarkers = markers?.filter((m: CalendarMarker) => isSameDay(m.date, date)) ?? [];
292
- const dataState = state.isRangeStart && state.isRangeEnd
293
- ? 'selected'
294
- : state.isRangeStart
295
- ? 'range-start'
296
- : state.isRangeEnd
297
- ? 'range-end'
298
- : state.isInRange
299
- ? 'range-middle'
300
- : state.isSelected
301
- ? 'selected'
302
- : state.isToday
303
- ? 'today'
304
- : state.isDisabled
305
- ? 'disabled'
306
- : state.isOutsideMonth
307
- ? 'outside-month'
308
- : 'default';
330
+ const dataState =
331
+ state.isRangeStart && state.isRangeEnd
332
+ ? 'selected'
333
+ : state.isRangeStart
334
+ ? 'range-start'
335
+ : state.isRangeEnd
336
+ ? 'range-end'
337
+ : state.isInRange
338
+ ? 'range-middle'
339
+ : state.isSelected
340
+ ? 'selected'
341
+ : state.isToday
342
+ ? 'today'
343
+ : state.isDisabled
344
+ ? 'disabled'
345
+ : state.isOutsideMonth
346
+ ? 'outside-month'
347
+ : 'default';
309
348
 
310
349
  return (
311
350
  <Day
@@ -2,12 +2,7 @@
2
2
 
3
3
  import React from 'react';
4
4
  import { View, Text, Pressable } from 'react-native';
5
- import {
6
- createCalendar,
7
- type ICalendarProps,
8
- type CalendarMode,
9
- type CalendarMarkers,
10
- } from './creator';
5
+ import { createCalendar, type ICalendarProps, type CalendarMode, type CalendarMarkers } from './creator';
11
6
  import { cssInterop } from 'nativewind';
12
7
  import {
13
8
  calendarStyle,
@@ -40,13 +35,7 @@ const CalendarRoot = React.forwardRef<
40
35
  React.ElementRef<typeof View>,
41
36
  ICalendarProps & React.ComponentProps<typeof View> & { className?: string }
42
37
  >(({ className, ...props }, ref) => {
43
- return (
44
- <View
45
- ref={ref}
46
- className={calendarStyle({ class: className })}
47
- {...props}
48
- />
49
- );
38
+ return <View ref={ref} className={calendarStyle({ class: className })} {...props} />;
50
39
  });
51
40
 
52
41
  // Styled Header
@@ -54,13 +43,7 @@ const CalendarHeaderRoot = React.forwardRef<
54
43
  React.ElementRef<typeof View>,
55
44
  React.ComponentProps<typeof View> & { className?: string }
56
45
  >(({ className, ...props }, ref) => {
57
- return (
58
- <View
59
- ref={ref}
60
- className={calendarHeaderStyle({ class: className })}
61
- {...props}
62
- />
63
- );
46
+ return <View ref={ref} className={calendarHeaderStyle({ class: className })} {...props} />;
64
47
  });
65
48
 
66
49
  const CalendarHeaderPrevButtonRoot = React.forwardRef<
@@ -101,18 +84,22 @@ const CalendarHeaderTitleRoot = React.forwardRef<
101
84
  React.ElementRef<typeof Text>,
102
85
  React.ComponentProps<typeof Text> & { className?: string }
103
86
  >(({ className, ...props }, ref) => {
104
- return (
105
- <Text
106
- ref={ref}
107
- className={calendarHeaderTitleStyle({ class: className })}
108
- {...props}
109
- />
110
- );
87
+ return <Text ref={ref} className={calendarHeaderTitleStyle({ class: className })} {...props} />;
111
88
  });
112
89
 
113
90
  const MONTH_NAMES = [
114
- 'January', 'February', 'March', 'April', 'May', 'June',
115
- 'July', 'August', 'September', 'October', 'November', 'December',
91
+ 'January',
92
+ 'February',
93
+ 'March',
94
+ 'April',
95
+ 'May',
96
+ 'June',
97
+ 'July',
98
+ 'August',
99
+ 'September',
100
+ 'October',
101
+ 'November',
102
+ 'December',
116
103
  ];
117
104
 
118
105
  type SelectRootProps = React.ComponentProps<typeof View> & {
@@ -122,86 +109,66 @@ type SelectRootProps = React.ComponentProps<typeof View> & {
122
109
  onValueChange?: (value: number) => void;
123
110
  };
124
111
 
125
- const CalendarHeaderMonthSelectRoot = React.forwardRef<
126
- React.ElementRef<typeof View>,
127
- SelectRootProps
128
- >(({ className, items = [], selectedValue, onValueChange, ...props }, ref) => {
129
- const label = selectedValue !== undefined ? MONTH_NAMES[selectedValue] : 'Month';
130
- return (
131
- <View ref={ref} className={calendarHeaderSelectStyle({ class: className })} {...props}>
132
- <Menu
133
- placement="bottom"
134
- offset={4}
135
- trigger={({ ...triggerProps }) => (
136
- <Pressable {...triggerProps} className="px-2 py-1 rounded-md flex-row items-center">
137
- <Text className="text-sm font-medium text-foreground">{label}</Text>
138
- </Pressable>
139
- )}
140
- >
141
- {items.map((item) => (
142
- <MenuItem
143
- key={item.value}
144
- textValue={item.label}
145
- onPress={() => onValueChange?.(item.value)}
146
- >
147
- <MenuItemLabel
148
- className={item.value === selectedValue ? 'text-primary font-semibold' : ''}
149
- >
150
- {item.label}
151
- </MenuItemLabel>
152
- </MenuItem>
153
- ))}
154
- </Menu>
155
- </View>
156
- );
157
- });
112
+ const CalendarHeaderMonthSelectRoot = React.forwardRef<React.ElementRef<typeof View>, SelectRootProps>(
113
+ ({ className, items = [], selectedValue, onValueChange, ...props }, ref) => {
114
+ const label = selectedValue !== undefined ? MONTH_NAMES[selectedValue] : 'Month';
115
+ return (
116
+ <View ref={ref} className={calendarHeaderSelectStyle({ class: className })} {...props}>
117
+ <Menu
118
+ placement="bottom"
119
+ offset={4}
120
+ trigger={({ ...triggerProps }) => (
121
+ <Pressable {...triggerProps} className="px-2 py-1 rounded-md flex-row items-center">
122
+ <Text className="text-sm font-medium text-foreground">{label}</Text>
123
+ </Pressable>
124
+ )}
125
+ >
126
+ {items.map((item) => (
127
+ <MenuItem key={item.value} textValue={item.label} onPress={() => onValueChange?.(item.value)}>
128
+ <MenuItemLabel className={item.value === selectedValue ? 'text-primary font-semibold' : ''}>
129
+ {item.label}
130
+ </MenuItemLabel>
131
+ </MenuItem>
132
+ ))}
133
+ </Menu>
134
+ </View>
135
+ );
136
+ },
137
+ );
158
138
 
159
- const CalendarHeaderYearSelectRoot = React.forwardRef<
160
- React.ElementRef<typeof View>,
161
- SelectRootProps
162
- >(({ className, items = [], selectedValue, onValueChange, ...props }, ref) => {
163
- const label = selectedValue !== undefined ? String(selectedValue) : 'Year';
164
- return (
165
- <View ref={ref} className={calendarHeaderSelectStyle({ class: className })} {...props}>
166
- <Menu
167
- placement="bottom"
168
- offset={4}
169
- trigger={({ ...triggerProps }) => (
170
- <Pressable {...triggerProps} className="px-2 py-1 rounded-md flex-row items-center">
171
- <Text className="text-sm font-medium text-foreground">{label}</Text>
172
- </Pressable>
173
- )}
174
- >
175
- {items.map((item) => (
176
- <MenuItem
177
- key={item.value}
178
- textValue={item.label}
179
- onPress={() => onValueChange?.(item.value)}
180
- >
181
- <MenuItemLabel
182
- className={item.value === selectedValue ? 'text-primary font-semibold' : ''}
183
- >
184
- {item.label}
185
- </MenuItemLabel>
186
- </MenuItem>
187
- ))}
188
- </Menu>
189
- </View>
190
- );
191
- });
139
+ const CalendarHeaderYearSelectRoot = React.forwardRef<React.ElementRef<typeof View>, SelectRootProps>(
140
+ ({ className, items = [], selectedValue, onValueChange, ...props }, ref) => {
141
+ const label = selectedValue !== undefined ? String(selectedValue) : 'Year';
142
+ return (
143
+ <View ref={ref} className={calendarHeaderSelectStyle({ class: className })} {...props}>
144
+ <Menu
145
+ placement="bottom"
146
+ offset={4}
147
+ trigger={({ ...triggerProps }) => (
148
+ <Pressable {...triggerProps} className="px-2 py-1 rounded-md flex-row items-center">
149
+ <Text className="text-sm font-medium text-foreground">{label}</Text>
150
+ </Pressable>
151
+ )}
152
+ >
153
+ {items.map((item) => (
154
+ <MenuItem key={item.value} textValue={item.label} onPress={() => onValueChange?.(item.value)}>
155
+ <MenuItemLabel className={item.value === selectedValue ? 'text-primary font-semibold' : ''}>
156
+ {item.label}
157
+ </MenuItemLabel>
158
+ </MenuItem>
159
+ ))}
160
+ </Menu>
161
+ </View>
162
+ );
163
+ },
164
+ );
192
165
 
193
166
  // Styled Week Days Header
194
167
  const CalendarWeekDaysHeaderRoot = React.forwardRef<
195
168
  React.ElementRef<typeof View>,
196
169
  React.ComponentProps<typeof View> & { className?: string }
197
170
  >(({ className, ...props }, ref) => {
198
- return (
199
- <View
200
- ref={ref}
201
- className={calendarWeekDaysHeaderStyle({ class: className })}
202
- {...props}
203
- />
204
- );
171
+ return <View ref={ref} className={calendarWeekDaysHeaderStyle({ class: className })} {...props} />;
205
172
  });
206
173
 
207
174
  const CalendarWeekDayRoot = React.forwardRef<
@@ -209,15 +176,9 @@ const CalendarWeekDayRoot = React.forwardRef<
209
176
  React.ComponentProps<typeof View> & { className?: string }
210
177
  >(({ className, children, ...props }, ref) => {
211
178
  return (
212
- <View
213
- ref={ref}
214
- className={calendarWeekDayStyle({ class: className })}
215
- {...props}
216
- >
179
+ <View ref={ref} className={calendarWeekDayStyle({ class: className })} {...props}>
217
180
  {typeof children === 'string' ? (
218
- <Text className={calendarWeekDayTextStyle({ class: '' })}>
219
- {children}
220
- </Text>
181
+ <Text className={calendarWeekDayTextStyle({ class: '' })}>{children}</Text>
221
182
  ) : (
222
183
  children
223
184
  )}
@@ -230,46 +191,28 @@ const CalendarBodyRoot = React.forwardRef<
230
191
  React.ElementRef<typeof View>,
231
192
  React.ComponentProps<typeof View> & { className?: string }
232
193
  >(({ className, ...props }, ref) => {
233
- return (
234
- <View
235
- ref={ref}
236
- className={calendarBodyStyle({ class: className })}
237
- {...props}
238
- />
239
- );
194
+ return <View ref={ref} className={calendarBodyStyle({ class: className })} {...props} />;
240
195
  });
241
196
 
242
197
  const CalendarGridRoot = React.forwardRef<
243
198
  React.ElementRef<typeof View>,
244
199
  React.ComponentProps<typeof View> & { className?: string }
245
200
  >(({ className, ...props }, ref) => {
246
- return (
247
- <View
248
- ref={ref}
249
- className={calendarGridStyle({ class: className })}
250
- {...props}
251
- />
252
- );
201
+ return <View ref={ref} className={calendarGridStyle({ class: className })} {...props} />;
253
202
  });
254
203
 
255
204
  const CalendarWeekRoot = React.forwardRef<
256
205
  React.ElementRef<typeof View>,
257
206
  React.ComponentProps<typeof View> & { className?: string }
258
207
  >(({ className, ...props }, ref) => {
259
- return (
260
- <View
261
- ref={ref}
262
- className={calendarWeekStyle({ class: className })}
263
- {...props}
264
- />
265
- );
208
+ return <View ref={ref} className={calendarWeekStyle({ class: className })} {...props} />;
266
209
  });
267
210
 
268
211
  // Styled Day
269
212
  const CalendarDayRoot = React.forwardRef<
270
213
  React.ElementRef<typeof Pressable>,
271
214
  React.ComponentProps<typeof Pressable> & {
272
- 'className'?: string;
215
+ className?: string;
273
216
  'data-state'?: string;
274
217
  }
275
218
  >(({ className, 'data-state': dataState, ...props }, ref) => {
@@ -319,7 +262,7 @@ const CalendarDayTextRoot = React.forwardRef<
319
262
  const CalendarDayIndicatorRoot = React.forwardRef<
320
263
  React.ElementRef<typeof View>,
321
264
  React.ComponentProps<typeof View> & {
322
- 'className'?: string;
265
+ className?: string;
323
266
  'data-type'?: string;
324
267
  }
325
268
  >(({ className, 'data-type': dataType, ...props }, ref) => {
@@ -341,15 +284,9 @@ const CalendarWeekNumberRoot = React.forwardRef<
341
284
  React.ComponentProps<typeof View> & { className?: string }
342
285
  >(({ className, children, ...props }, ref) => {
343
286
  return (
344
- <View
345
- ref={ref}
346
- className={calendarWeekNumberStyle({ class: className })}
347
- {...props}
348
- >
287
+ <View ref={ref} className={calendarWeekNumberStyle({ class: className })} {...props}>
349
288
  {typeof children === 'string' || typeof children === 'number' ? (
350
- <Text className={calendarWeekNumberTextStyle({ class: '' })}>
351
- {children}
352
- </Text>
289
+ <Text className={calendarWeekNumberTextStyle({ class: '' })}>{children}</Text>
353
290
  ) : (
354
291
  children
355
292
  )}
@@ -362,13 +299,7 @@ const CalendarFooterRoot = React.forwardRef<
362
299
  React.ElementRef<typeof View>,
363
300
  React.ComponentProps<typeof View> & { className?: string }
364
301
  >(({ className, ...props }, ref) => {
365
- return (
366
- <View
367
- ref={ref}
368
- className={calendarFooterStyle({ class: className })}
369
- {...props}
370
- />
371
- );
302
+ return <View ref={ref} className={calendarFooterStyle({ class: className })} {...props} />;
372
303
  });
373
304
 
374
305
  // Create Calendar using the factory
@@ -423,10 +354,7 @@ type CalendarProps = (SingleModeProps | MultipleModeProps | RangeModeProps) &
423
354
  className?: string;
424
355
  };
425
356
 
426
- const CalendarComponent = React.forwardRef<
427
- React.ElementRef<typeof View>,
428
- CalendarProps
429
- >((props, ref) => {
357
+ const CalendarComponent = React.forwardRef<React.ElementRef<typeof View>, CalendarProps>((props, ref) => {
430
358
  return <UICalendar ref={ref} {...(props as any)} />;
431
359
  });
432
360
  CalendarComponent.displayName = 'Calendar';
@@ -451,12 +379,6 @@ export const CalendarWeekNumber = UICalendar.WeekNumber;
451
379
  export const CalendarFooter = UICalendar.Footer;
452
380
 
453
381
  // Re-export types
454
- export type {
455
- ICalendarProps,
456
- CalendarMode,
457
- CalendarMarker,
458
- CalendarMarkers,
459
- DayState,
460
- } from './creator';
382
+ export type { ICalendarProps, CalendarMode, CalendarMarker, CalendarMarkers, DayState } from './creator';
461
383
 
462
384
  export type { CalendarProps };
@@ -70,10 +70,10 @@ export const calendarDayStyle = tva({
70
70
  base: 'flex-1 aspect-square items-center justify-center rounded-md web:max-w-[2.25rem] relative transition-colors',
71
71
  variants: {
72
72
  state: {
73
- 'default': 'hover:bg-accent active:bg-accent/80',
74
- 'selected': 'bg-primary hover:bg-primary/90 active:bg-primary/80',
75
- 'today': 'bg-accent',
76
- 'disabled': 'opacity-40 cursor-not-allowed',
73
+ default: 'hover:bg-accent active:bg-accent/80',
74
+ selected: 'bg-primary hover:bg-primary/90 active:bg-primary/80',
75
+ today: 'bg-accent',
76
+ disabled: 'opacity-40 cursor-not-allowed',
77
77
  'outside-month': 'opacity-30',
78
78
  'range-start': 'bg-primary rounded-r-md',
79
79
  'range-end': 'bg-primary rounded-l-md',
@@ -86,10 +86,10 @@ export const calendarDayTextStyle = tva({
86
86
  base: 'text-foreground text-sm font-normal z-10',
87
87
  variants: {
88
88
  state: {
89
- 'default': 'text-foreground',
90
- 'selected': 'text-primary-foreground ',
91
- 'today': 'text-accent-foreground',
92
- 'disabled': 'text-muted-foreground',
89
+ default: 'text-foreground',
90
+ selected: 'text-primary-foreground ',
91
+ today: 'text-accent-foreground',
92
+ disabled: 'text-muted-foreground',
93
93
  'outside-month': 'text-muted-foreground',
94
94
  'range-start': 'text-primary-foreground font-semibold',
95
95
  'range-end': 'text-primary-foreground font-semibold',
@@ -103,9 +103,9 @@ export const calendarDayIndicatorStyle = tva({
103
103
  base: 'absolute bottom-1 flex-row gap-0.5 z-0',
104
104
  variants: {
105
105
  type: {
106
- 'dot': 'flex-row gap-0.5',
106
+ dot: 'flex-row gap-0.5',
107
107
  'multi-dot': 'flex-row gap-0.5',
108
- 'period': 'absolute inset-0 rounded-md opacity-20',
108
+ period: 'absolute inset-0 rounded-md opacity-20',
109
109
  },
110
110
  },
111
111
  });
@@ -4,19 +4,18 @@ import { View } from 'react-native';
4
4
  import { cardStyle } from './styles';
5
5
  import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
6
6
 
7
- type ICardProps = React.ComponentPropsWithoutRef<typeof View> &
8
- VariantProps<typeof cardStyle> & {
7
+ type ICardProps = React.ComponentPropsWithoutRef<typeof View> &
8
+ VariantProps<typeof cardStyle> & {
9
9
  className?: string;
10
10
  size?: 'default' | 'sm';
11
11
  };
12
12
 
13
- const Card = React.forwardRef<React.ComponentRef<typeof View>, ICardProps>(
14
- function Card({ className, size = 'default', ...props }, ref) {
15
- return (
16
- <View className={cardStyle({ size, class: className })} {...props} ref={ref} />
17
- );
18
- }
19
- );
13
+ const Card = React.forwardRef<React.ComponentRef<typeof View>, ICardProps>(function Card(
14
+ { className, size = 'default', ...props },
15
+ ref,
16
+ ) {
17
+ return <View className={cardStyle({ size, class: className })} {...props} ref={ref} />;
18
+ });
20
19
 
21
20
  Card.displayName = 'Card';
22
21
 
@@ -2,23 +2,17 @@ import React from 'react';
2
2
  import { cardStyle } from './styles';
3
3
  import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
4
4
 
5
- type ICardProps = React.ComponentPropsWithoutRef<'div'> &
6
- VariantProps<typeof cardStyle> & {
5
+ type ICardProps = React.ComponentPropsWithoutRef<'div'> &
6
+ VariantProps<typeof cardStyle> & {
7
7
  className?: string;
8
8
  size?: 'default' | 'sm';
9
9
  };
10
10
 
11
11
  const Card = React.forwardRef<HTMLDivElement, ICardProps>(function Card(
12
12
  { className, size = 'default', ...props },
13
- ref
13
+ ref,
14
14
  ) {
15
- return (
16
- <div
17
- className={cardStyle({ size, class: className })}
18
- {...props}
19
- ref={ref}
20
- />
21
- );
15
+ return <div className={cardStyle({ size, class: className })} {...props} ref={ref} />;
22
16
  });
23
17
 
24
18
  Card.displayName = 'Card';
@@ -5,17 +5,12 @@ import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
5
5
 
6
6
  type ICenterProps = ViewProps & VariantProps<typeof centerStyle>;
7
7
 
8
- const Center = React.forwardRef<React.ComponentRef<typeof View>, ICenterProps>(
9
- function Center({ className, ...props }, ref) {
10
- return (
11
- <View
12
- className={centerStyle({ class: className })}
13
- {...props}
14
- ref={ref}
15
- />
16
- );
17
- }
18
- );
8
+ const Center = React.forwardRef<React.ComponentRef<typeof View>, ICenterProps>(function Center(
9
+ { className, ...props },
10
+ ref,
11
+ ) {
12
+ return <View className={centerStyle({ class: className })} {...props} ref={ref} />;
13
+ });
19
14
 
20
15
  Center.displayName = 'Center';
21
16
 
@@ -3,16 +3,10 @@ import { centerStyle } from './styles';
3
3
 
4
4
  import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
5
5
 
6
- type ICenterProps = React.ComponentPropsWithoutRef<'div'> &
7
- VariantProps<typeof centerStyle>;
6
+ type ICenterProps = React.ComponentPropsWithoutRef<'div'> & VariantProps<typeof centerStyle>;
8
7
 
9
- const Center = React.forwardRef<HTMLDivElement, ICenterProps>(function Center(
10
- { className, ...props },
11
- ref
12
- ) {
13
- return (
14
- <div className={centerStyle({ class: className })} {...props} ref={ref} />
15
- );
8
+ const Center = React.forwardRef<HTMLDivElement, ICenterProps>(function Center({ className, ...props }, ref) {
9
+ return <div className={centerStyle({ class: className })} {...props} ref={ref} />;
16
10
  });
17
11
 
18
12
  Center.displayName = 'Center';