@campxdev/react-native-blueprint 0.1.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.
Files changed (178) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +358 -0
  3. package/lib/module/app/_layout.js +23 -0
  4. package/lib/module/app/_layout.js.map +1 -0
  5. package/lib/module/assets/icons/weather_icons/drizzle.png +0 -0
  6. package/lib/module/assets/icons/weather_icons/foggy.png +0 -0
  7. package/lib/module/assets/icons/weather_icons/freezing_rain.png +0 -0
  8. package/lib/module/assets/icons/weather_icons/partly_cloudy.png +0 -0
  9. package/lib/module/assets/icons/weather_icons/rainy.png +0 -0
  10. package/lib/module/assets/icons/weather_icons/showers.png +0 -0
  11. package/lib/module/assets/icons/weather_icons/sunny_weather.png +0 -0
  12. package/lib/module/assets/icons/weather_icons/thunderstorm.png +0 -0
  13. package/lib/module/assets/icons/weather_icons/thunderstorm_hail.png +0 -0
  14. package/lib/module/components/theme-config.js +265 -0
  15. package/lib/module/components/theme-config.js.map +1 -0
  16. package/lib/module/components/ui/Accordion.js +228 -0
  17. package/lib/module/components/ui/Accordion.js.map +1 -0
  18. package/lib/module/components/ui/Alert-Dialog.js +266 -0
  19. package/lib/module/components/ui/Alert-Dialog.js.map +1 -0
  20. package/lib/module/components/ui/Alert.js +107 -0
  21. package/lib/module/components/ui/Alert.js.map +1 -0
  22. package/lib/module/components/ui/AppBar.js +403 -0
  23. package/lib/module/components/ui/AppBar.js.map +1 -0
  24. package/lib/module/components/ui/Aspect-Ratio.js +27 -0
  25. package/lib/module/components/ui/Aspect-Ratio.js.map +1 -0
  26. package/lib/module/components/ui/Avatar.js +97 -0
  27. package/lib/module/components/ui/Avatar.js.map +1 -0
  28. package/lib/module/components/ui/Badge.js +127 -0
  29. package/lib/module/components/ui/Badge.js.map +1 -0
  30. package/lib/module/components/ui/Bottom-Sheet.js +144 -0
  31. package/lib/module/components/ui/Bottom-Sheet.js.map +1 -0
  32. package/lib/module/components/ui/Button.js +88 -0
  33. package/lib/module/components/ui/Button.js.map +1 -0
  34. package/lib/module/components/ui/Card.js +176 -0
  35. package/lib/module/components/ui/Card.js.map +1 -0
  36. package/lib/module/components/ui/Checkbox.js +65 -0
  37. package/lib/module/components/ui/Checkbox.js.map +1 -0
  38. package/lib/module/components/ui/Collapsible.js +42 -0
  39. package/lib/module/components/ui/Collapsible.js.map +1 -0
  40. package/lib/module/components/ui/Context-Menu.js +287 -0
  41. package/lib/module/components/ui/Context-Menu.js.map +1 -0
  42. package/lib/module/components/ui/Custom-Card.js +202 -0
  43. package/lib/module/components/ui/Custom-Card.js.map +1 -0
  44. package/lib/module/components/ui/Dialog.js +202 -0
  45. package/lib/module/components/ui/Dialog.js.map +1 -0
  46. package/lib/module/components/ui/Dropdown-Menu.js +421 -0
  47. package/lib/module/components/ui/Dropdown-Menu.js.map +1 -0
  48. package/lib/module/components/ui/Floating-Action.js +50 -0
  49. package/lib/module/components/ui/Floating-Action.js.map +1 -0
  50. package/lib/module/components/ui/Greeting-Card.js +392 -0
  51. package/lib/module/components/ui/Greeting-Card.js.map +1 -0
  52. package/lib/module/components/ui/Hover-Card.js +96 -0
  53. package/lib/module/components/ui/Hover-Card.js.map +1 -0
  54. package/lib/module/components/ui/Icon.js +73 -0
  55. package/lib/module/components/ui/Icon.js.map +1 -0
  56. package/lib/module/components/ui/Input.js +74 -0
  57. package/lib/module/components/ui/Input.js.map +1 -0
  58. package/lib/module/components/ui/Label.js +44 -0
  59. package/lib/module/components/ui/Label.js.map +1 -0
  60. package/lib/module/components/ui/Menubar.js +375 -0
  61. package/lib/module/components/ui/Menubar.js.map +1 -0
  62. package/lib/module/components/ui/Native-Only-Animated-View.js +41 -0
  63. package/lib/module/components/ui/Native-Only-Animated-View.js.map +1 -0
  64. package/lib/module/components/ui/NavBar.js +352 -0
  65. package/lib/module/components/ui/NavBar.js.map +1 -0
  66. package/lib/module/components/ui/Popover.js +101 -0
  67. package/lib/module/components/ui/Popover.js.map +1 -0
  68. package/lib/module/components/ui/Progress.js +124 -0
  69. package/lib/module/components/ui/Progress.js.map +1 -0
  70. package/lib/module/components/ui/Radio-Group.js +75 -0
  71. package/lib/module/components/ui/Radio-Group.js.map +1 -0
  72. package/lib/module/components/ui/Select.js +269 -0
  73. package/lib/module/components/ui/Select.js.map +1 -0
  74. package/lib/module/components/ui/Separator.js +58 -0
  75. package/lib/module/components/ui/Separator.js.map +1 -0
  76. package/lib/module/components/ui/SizedBox.js +101 -0
  77. package/lib/module/components/ui/SizedBox.js.map +1 -0
  78. package/lib/module/components/ui/Skeleton.js +57 -0
  79. package/lib/module/components/ui/Skeleton.js.map +1 -0
  80. package/lib/module/components/ui/Slider.js +169 -0
  81. package/lib/module/components/ui/Slider.js.map +1 -0
  82. package/lib/module/components/ui/Switch.js +55 -0
  83. package/lib/module/components/ui/Switch.js.map +1 -0
  84. package/lib/module/components/ui/Table.js +150 -0
  85. package/lib/module/components/ui/Table.js.map +1 -0
  86. package/lib/module/components/ui/Tabs.js +106 -0
  87. package/lib/module/components/ui/Tabs.js.map +1 -0
  88. package/lib/module/components/ui/Text.js +69 -0
  89. package/lib/module/components/ui/Text.js.map +1 -0
  90. package/lib/module/components/ui/Textarea.js +88 -0
  91. package/lib/module/components/ui/Textarea.js.map +1 -0
  92. package/lib/module/components/ui/Theme-Toggle.js +156 -0
  93. package/lib/module/components/ui/Theme-Toggle.js.map +1 -0
  94. package/lib/module/components/ui/Toast.js +101 -0
  95. package/lib/module/components/ui/Toast.js.map +1 -0
  96. package/lib/module/components/ui/Toggle-Group.js +129 -0
  97. package/lib/module/components/ui/Toggle-Group.js.map +1 -0
  98. package/lib/module/components/ui/Toggle.js +106 -0
  99. package/lib/module/components/ui/Toggle.js.map +1 -0
  100. package/lib/module/components/ui/Tooltip.js +106 -0
  101. package/lib/module/components/ui/Tooltip.js.map +1 -0
  102. package/lib/module/components/ui/index.js +45 -0
  103. package/lib/module/components/ui/index.js.map +1 -0
  104. package/lib/module/index.js +19 -0
  105. package/lib/module/index.js.map +1 -0
  106. package/lib/module/lib/ThemeProvider.js +173 -0
  107. package/lib/module/lib/ThemeProvider.js.map +1 -0
  108. package/lib/module/lib/cornerRadius.js +164 -0
  109. package/lib/module/lib/cornerRadius.js.map +1 -0
  110. package/lib/module/lib/fonts.js +25 -0
  111. package/lib/module/lib/fonts.js.map +1 -0
  112. package/lib/module/lib/theme.js +212 -0
  113. package/lib/module/lib/theme.js.map +1 -0
  114. package/lib/module/lib/utils.js +137 -0
  115. package/lib/module/lib/utils.js.map +1 -0
  116. package/lib/module/package.json +1 -0
  117. package/package.json +208 -0
  118. package/src/app/_layout.tsx +25 -0
  119. package/src/assets/icons/weather_icons/drizzle.png +0 -0
  120. package/src/assets/icons/weather_icons/foggy.png +0 -0
  121. package/src/assets/icons/weather_icons/freezing_rain.png +0 -0
  122. package/src/assets/icons/weather_icons/partly_cloudy.png +0 -0
  123. package/src/assets/icons/weather_icons/rainy.png +0 -0
  124. package/src/assets/icons/weather_icons/showers.png +0 -0
  125. package/src/assets/icons/weather_icons/sunny_weather.png +0 -0
  126. package/src/assets/icons/weather_icons/thunderstorm.png +0 -0
  127. package/src/assets/icons/weather_icons/thunderstorm_hail.png +0 -0
  128. package/src/components/theme-config.ts +331 -0
  129. package/src/components/ui/Accordion.tsx +253 -0
  130. package/src/components/ui/Alert-Dialog.tsx +295 -0
  131. package/src/components/ui/Alert.tsx +137 -0
  132. package/src/components/ui/AppBar.tsx +551 -0
  133. package/src/components/ui/Aspect-Ratio.tsx +25 -0
  134. package/src/components/ui/Avatar.tsx +103 -0
  135. package/src/components/ui/Badge.tsx +121 -0
  136. package/src/components/ui/Bottom-Sheet.tsx +224 -0
  137. package/src/components/ui/Button.tsx +100 -0
  138. package/src/components/ui/Card.tsx +185 -0
  139. package/src/components/ui/Checkbox.tsx +81 -0
  140. package/src/components/ui/Collapsible.tsx +40 -0
  141. package/src/components/ui/Context-Menu.tsx +407 -0
  142. package/src/components/ui/Custom-Card.tsx +226 -0
  143. package/src/components/ui/Dialog.tsx +240 -0
  144. package/src/components/ui/Dropdown-Menu.tsx +544 -0
  145. package/src/components/ui/Floating-Action.tsx +54 -0
  146. package/src/components/ui/Greeting-Card.tsx +471 -0
  147. package/src/components/ui/Hover-Card.tsx +101 -0
  148. package/src/components/ui/Icon.tsx +75 -0
  149. package/src/components/ui/Input.tsx +90 -0
  150. package/src/components/ui/Label.tsx +48 -0
  151. package/src/components/ui/Menubar.tsx +509 -0
  152. package/src/components/ui/Native-Only-Animated-View.tsx +37 -0
  153. package/src/components/ui/NavBar.tsx +397 -0
  154. package/src/components/ui/Popover.tsx +110 -0
  155. package/src/components/ui/Progress.tsx +138 -0
  156. package/src/components/ui/Radio-Group.tsx +79 -0
  157. package/src/components/ui/Select.tsx +344 -0
  158. package/src/components/ui/Separator.tsx +68 -0
  159. package/src/components/ui/SizedBox.tsx +116 -0
  160. package/src/components/ui/Skeleton.tsx +55 -0
  161. package/src/components/ui/Slider.tsx +222 -0
  162. package/src/components/ui/Switch.tsx +67 -0
  163. package/src/components/ui/Table.tsx +170 -0
  164. package/src/components/ui/Tabs.tsx +119 -0
  165. package/src/components/ui/Text.tsx +73 -0
  166. package/src/components/ui/Textarea.tsx +93 -0
  167. package/src/components/ui/Theme-Toggle.tsx +204 -0
  168. package/src/components/ui/Toast.tsx +127 -0
  169. package/src/components/ui/Toggle-Group.tsx +160 -0
  170. package/src/components/ui/Toggle.tsx +122 -0
  171. package/src/components/ui/Tooltip.tsx +117 -0
  172. package/src/components/ui/index.ts +42 -0
  173. package/src/index.tsx +24 -0
  174. package/src/lib/ThemeProvider.tsx +204 -0
  175. package/src/lib/cornerRadius.ts +160 -0
  176. package/src/lib/fonts.ts +28 -0
  177. package/src/lib/theme.ts +151 -0
  178. package/src/lib/utils.ts +146 -0
@@ -0,0 +1,352 @@
1
+ "use strict";
2
+
3
+ import * as React from 'react';
4
+ import { View as RNView, Pressable as RNPressable, Image } from 'react-native';
5
+ import { SafeAreaView as RNSafeAreaView } from 'react-native-safe-area-context';
6
+ import { cssInterop } from 'nativewind';
7
+ import { cn } from "../../lib/utils.js";
8
+ import { Text, TextClassContext } from "./Text.js";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ // Enable NativeWind className support
11
+ const View = cssInterop(RNView, {
12
+ className: 'style'
13
+ });
14
+ const Pressable = cssInterop(RNPressable, {
15
+ className: 'style'
16
+ });
17
+ const SafeAreaView = cssInterop(RNSafeAreaView, {
18
+ className: 'style'
19
+ });
20
+
21
+ /**
22
+ * Props for individual navigation bar items
23
+ *
24
+ * Defines the structure for each item displayed in the NavBar component.
25
+ * Each item can have both active and inactive states with different icons.
26
+ *
27
+ * @interface NavBarItem
28
+ *
29
+ * @property {ImageSourcePropType | React.ReactElement} icon - Icon displayed when item is inactive
30
+ * - Can be an image source from require() or { uri: 'url' }
31
+ * - Can be a React element like lucide-react-native icons
32
+ * @property {ImageSourcePropType | React.ReactElement} activeIcon - Icon displayed when item is active
33
+ * - Same types as icon property
34
+ * - Typically a different color or style variant
35
+ * @property {string} label - Text label displayed below the icon
36
+ * @property {() => void} onPress - Callback function invoked when item is pressed
37
+ * @property {boolean} [disabled] - Optional flag to disable the item interaction
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * // Using image sources
42
+ * const homeItem: NavBarItem = {
43
+ * icon: require('./assets/home-inactive.png'),
44
+ * activeIcon: require('./assets/home-active.png'),
45
+ * label: 'Home',
46
+ * onPress: () => console.log('Home pressed'),
47
+ * };
48
+ *
49
+ * // Using React elements (lucide icons)
50
+ * import { Home } from 'lucide-react-native';
51
+ * const homeItem: NavBarItem = {
52
+ * icon: <Icon as={Home} color="#666" />,
53
+ * activeIcon: <Icon as={Home} color="#000" />,
54
+ * label: 'Home',
55
+ * onPress: () => navigation.navigate('Home'),
56
+ * };
57
+ * ```
58
+ */
59
+
60
+ /**
61
+ * Props for NavBar component
62
+ *
63
+ * Configuration options for customizing the NavBar appearance and behavior.
64
+ * Provides fine-grained control over styling for different states and elements.
65
+ *
66
+ * @interface NavBarProps
67
+ *
68
+ * @property {NavBarItem[]} items - Array of navigation items to display in the bar
69
+ * @property {number} activeIndex - Zero-based index of the currently active item
70
+ *
71
+ * @property {string} [className] - Additional Tailwind classes for the main container
72
+ * @property {string} [itemClassName] - Additional Tailwind classes applied to all items
73
+ * @property {string} [activeItemClassName] - Additional Tailwind classes for the active item only
74
+ * @property {string} [labelClassName] - Additional Tailwind classes for all labels
75
+ * @property {string} [activeLabelClassName] - Additional Tailwind classes for the active label only
76
+ * @property {string} [backgroundColor] - Custom background color classes (overrides default)
77
+ * @property {number} [iconSize] - Size of icons in pixels (default: 24)
78
+ *
79
+ * @example
80
+ * ```tsx
81
+ * const navBarProps: NavBarProps = {
82
+ * items: navigationItems,
83
+ * activeIndex: 0,
84
+ * iconSize: 28,
85
+ * className: 'px-4',
86
+ * activeItemClassName: 'scale-110',
87
+ * backgroundColor: 'bg-white dark:bg-gray-900',
88
+ * };
89
+ * ```
90
+ */
91
+
92
+ /**
93
+ * NavBar - Bottom navigation bar component
94
+ *
95
+ * A navigation component designed for mobile applications that displays at the bottom
96
+ * of the screen with proper safe area handling. Similar to Flutter's BottomNavigationBar,
97
+ * it provides an intuitive way to switch between different sections of your app.
98
+ *
99
+ * Features:
100
+ * - Automatic safe area handling for devices with notches/home indicators
101
+ * - Support for both image and React element icons
102
+ * - Active/inactive state management with visual feedback
103
+ * - Customizable styling through Tailwind classes
104
+ * - Full dark mode support
105
+ * - Accessibility features built-in
106
+ * - Disabled state support for items
107
+ *
108
+ * @component
109
+ *
110
+ * @example
111
+ * // Basic usage with state management
112
+ * ```tsx
113
+ * import { useState } from 'react';
114
+ * import { NavBar, NavBarItem } from 'react-native-blueprint';
115
+ *
116
+ * function App() {
117
+ * const [activeIndex, setActiveIndex] = useState(0);
118
+ *
119
+ * const navItems: NavBarItem[] = [
120
+ * {
121
+ * icon: require('./assets/home-inactive.png'),
122
+ * activeIcon: require('./assets/home-active.png'),
123
+ * label: 'Home',
124
+ * onPress: () => setActiveIndex(0),
125
+ * },
126
+ * {
127
+ * icon: require('./assets/browse-inactive.png'),
128
+ * activeIcon: require('./assets/browse-active.png'),
129
+ * label: 'Browse',
130
+ * onPress: () => setActiveIndex(1),
131
+ * },
132
+ * {
133
+ * icon: require('./assets/feed-inactive.png'),
134
+ * activeIcon: require('./assets/feed-active.png'),
135
+ * label: 'Feed',
136
+ * onPress: () => setActiveIndex(2),
137
+ * },
138
+ * {
139
+ * icon: require('./assets/chat-inactive.png'),
140
+ * activeIcon: require('./assets/chat-active.png'),
141
+ * label: 'Chat',
142
+ * onPress: () => setActiveIndex(3),
143
+ * },
144
+ * ];
145
+ *
146
+ * return (
147
+ * <View style={{ flex: 1 }}>
148
+ * <View style={{ flex: 1 }}>
149
+ * {renderScreen(activeIndex)}
150
+ * </View>
151
+ * <NavBar items={navItems} activeIndex={activeIndex} />
152
+ * </View>
153
+ * );
154
+ * }
155
+ * ```
156
+ *
157
+ * @example
158
+ * // With React Navigation
159
+ * ```tsx
160
+ * import { useNavigation, useRoute } from '@react-navigation/native';
161
+ * import { Home, Search, Bell, MessageCircle } from 'lucide-react-native';
162
+ * import { Icon } from 'react-native-blueprint';
163
+ *
164
+ * function BottomTabBar() {
165
+ * const navigation = useNavigation();
166
+ * const route = useRoute();
167
+ * const [activeIndex, setActiveIndex] = useState(0);
168
+ *
169
+ * const navItems: NavBarItem[] = [
170
+ * {
171
+ * icon: <Icon as={Home} size={24} color="#666" />,
172
+ * activeIcon: <Icon as={Home} size={24} color="#000" />,
173
+ * label: 'Home',
174
+ * onPress: () => {
175
+ * setActiveIndex(0);
176
+ * navigation.navigate('Home');
177
+ * },
178
+ * },
179
+ * {
180
+ * icon: <Icon as={Search} size={24} color="#666" />,
181
+ * activeIcon: <Icon as={Search} size={24} color="#000" />,
182
+ * label: 'Browse',
183
+ * onPress: () => {
184
+ * setActiveIndex(1);
185
+ * navigation.navigate('Browse');
186
+ * },
187
+ * },
188
+ * {
189
+ * icon: <Icon as={Bell} size={24} color="#666" />,
190
+ * activeIcon: <Icon as={Bell} size={24} color="#000" />,
191
+ * label: 'Feed',
192
+ * onPress: () => {
193
+ * setActiveIndex(2);
194
+ * navigation.navigate('Feed');
195
+ * },
196
+ * },
197
+ * {
198
+ * icon: <Icon as={MessageCircle} size={24} color="#666" />,
199
+ * activeIcon: <Icon as={MessageCircle} size={24} color="#000" />,
200
+ * label: 'Chat',
201
+ * onPress: () => {
202
+ * setActiveIndex(3);
203
+ * navigation.navigate('Chat');
204
+ * },
205
+ * },
206
+ * ];
207
+ *
208
+ * return <NavBar items={navItems} activeIndex={activeIndex} />;
209
+ * }
210
+ * ```
211
+ *
212
+ * @example
213
+ * // With custom styling and theming
214
+ * ```tsx
215
+ * import { useTheme } from 'react-native-blueprint';
216
+ *
217
+ * function ThemedNavBar() {
218
+ * const { isDark } = useTheme();
219
+ * const [activeIndex, setActiveIndex] = useState(0);
220
+ *
221
+ * return (
222
+ * <NavBar
223
+ * items={navItems}
224
+ * activeIndex={activeIndex}
225
+ * backgroundColor="bg-gray-100 dark:bg-gray-900"
226
+ * iconSize={28}
227
+ * className="py-2 px-4"
228
+ * activeItemClassName="scale-110 transition-transform"
229
+ * activeLabelClassName="text-blue-600 dark:text-blue-400 font-bold"
230
+ * labelClassName="text-gray-500 dark:text-gray-400"
231
+ * />
232
+ * );
233
+ * }
234
+ * ```
235
+ *
236
+ * @example
237
+ * // With disabled items
238
+ * ```tsx
239
+ * const navItems: NavBarItem[] = [
240
+ * {
241
+ * icon: require('./assets/home-inactive.png'),
242
+ * activeIcon: require('./assets/home-active.png'),
243
+ * label: 'Home',
244
+ * onPress: () => setActiveIndex(0),
245
+ * },
246
+ * {
247
+ * icon: require('./assets/premium-inactive.png'),
248
+ * activeIcon: require('./assets/premium-active.png'),
249
+ * label: 'Premium',
250
+ * onPress: () => showUpgradeModal(),
251
+ * disabled: !user.isPremium, // Disable if user is not premium
252
+ * },
253
+ * ];
254
+ * ```
255
+ *
256
+ * @param {NavBarProps} props - Component props
257
+ * @param {React.Ref<ViewRef>} ref - Forwarded ref to the container View
258
+ *
259
+ * @returns {React.ReactElement} The rendered NavBar component
260
+ *
261
+ * @accessibility
262
+ * - Sets role="navigation" on the container for proper semantic structure
263
+ * - Each item has role="button" with appropriate labels
264
+ * - Uses aria-label for screen reader support
265
+ * - Indicates selected state with aria-selected
266
+ * - Respects and communicates disabled state
267
+ * - Provides accessibilityRole and accessibilityLabel for React Native
268
+ * - Includes accessibilityState for selected and disabled states
269
+ *
270
+ * @see {@link NavBarItem} for item configuration
271
+ * @see {@link NavBarProps} for all available props
272
+ */
273
+ const NavBar = /*#__PURE__*/React.forwardRef(({
274
+ items,
275
+ activeIndex,
276
+ className,
277
+ itemClassName,
278
+ activeItemClassName,
279
+ labelClassName,
280
+ activeLabelClassName,
281
+ backgroundColor,
282
+ iconSize = 24
283
+ }, ref) => {
284
+ /**
285
+ * Renders an icon based on its type (image source or React element)
286
+ *
287
+ * @param {NavBarItem} item - The navigation item containing the icon
288
+ * @param {boolean} isActive - Whether this item is currently active
289
+ * @returns {React.ReactElement} The rendered icon
290
+ */
291
+ const renderIcon = (item, isActive) => {
292
+ const iconSource = isActive ? item.activeIcon : item.icon;
293
+
294
+ // Check if it's a React element (like lucide icon)
295
+ if (/*#__PURE__*/React.isValidElement(iconSource)) {
296
+ return iconSource;
297
+ }
298
+
299
+ // It's an image source
300
+ return /*#__PURE__*/_jsx(Image, {
301
+ source: iconSource,
302
+ style: {
303
+ width: iconSize,
304
+ height: iconSize
305
+ },
306
+ resizeMode: "contain",
307
+ accessibilityIgnoresInvertColors: true
308
+ });
309
+ };
310
+
311
+ // Default background color with dark mode support
312
+ const defaultBgColor = 'bg-background';
313
+ return /*#__PURE__*/_jsx(SafeAreaView, {
314
+ edges: ['bottom'],
315
+ className: cn('border-t border-border', backgroundColor || defaultBgColor),
316
+ ref: ref,
317
+ children: /*#__PURE__*/_jsx(View, {
318
+ className: cn('flex-row items-center justify-around px-2 py-1', className),
319
+ role: "navigation",
320
+ children: items.map((item, index) => {
321
+ const isActive = index === activeIndex;
322
+ const isDisabled = item.disabled;
323
+ return /*#__PURE__*/_jsxs(Pressable, {
324
+ onPress: item.onPress,
325
+ disabled: isDisabled,
326
+ className: cn('flex-1 items-center justify-center py-2 px-1 active:opacity-70', isDisabled && 'opacity-40', itemClassName, isActive && activeItemClassName),
327
+ role: "button",
328
+ "aria-label": item.label,
329
+ "aria-selected": isActive,
330
+ accessibilityRole: "button",
331
+ accessibilityLabel: item.label,
332
+ accessibilityState: {
333
+ selected: isActive,
334
+ disabled: isDisabled
335
+ },
336
+ children: [/*#__PURE__*/_jsx(View, {
337
+ className: "mb-1.5 mt-2.5",
338
+ children: renderIcon(item, isActive)
339
+ }), /*#__PURE__*/_jsx(TextClassContext.Provider, {
340
+ value: cn('text-xs font-medium text-center', isActive ? activeLabelClassName || 'text-foreground' : labelClassName || 'text-muted-foreground'),
341
+ children: /*#__PURE__*/_jsx(Text, {
342
+ children: item.label
343
+ })
344
+ })]
345
+ }, `nav-item-${index}-${item.label}`);
346
+ })
347
+ })
348
+ });
349
+ });
350
+ NavBar.displayName = 'NavBar';
351
+ export { NavBar };
352
+ //# sourceMappingURL=NavBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","RNView","Pressable","RNPressable","Image","SafeAreaView","RNSafeAreaView","cssInterop","cn","Text","TextClassContext","jsx","_jsx","jsxs","_jsxs","className","NavBar","forwardRef","items","activeIndex","itemClassName","activeItemClassName","labelClassName","activeLabelClassName","backgroundColor","iconSize","ref","renderIcon","item","isActive","iconSource","activeIcon","icon","isValidElement","source","style","width","height","resizeMode","accessibilityIgnoresInvertColors","defaultBgColor","edges","children","role","map","index","isDisabled","disabled","onPress","label","accessibilityRole","accessibilityLabel","accessibilityState","selected","Provider","value","displayName"],"sourceRoot":"../../../../src","sources":["components/ui/NavBar.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,IAAIC,MAAM,EAAEC,SAAS,IAAIC,WAAW,EAAEC,KAAK,QAAQ,cAAc;AAE9E,SAASC,YAAY,IAAIC,cAAc,QAAQ,gCAAgC;AAC/E,SAASC,UAAU,QAAQ,YAAY;AACvC,SAASC,EAAE,QAAQ,oBAAiB;AACpC,SAASC,IAAI,EAAEC,gBAAgB,QAAQ,WAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGhD;AACA,MAAMd,IAAI,GAAGO,UAAU,CAACN,MAAM,EAAE;EAAEc,SAAS,EAAE;AAAQ,CAAC,CAAC;AACvD,MAAMb,SAAS,GAAGK,UAAU,CAACJ,WAAW,EAAE;EAAEY,SAAS,EAAE;AAAQ,CAAC,CAAC;AACjE,MAAMV,YAAY,GAAGE,UAAU,CAACD,cAAc,EAAE;EAAES,SAAS,EAAE;AAAQ,CAAC,CAAC;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,MAAM,gBAAGjB,KAAK,CAACkB,UAAU,CAC7B,CACE;EACEC,KAAK;EACLC,WAAW;EACXJ,SAAS;EACTK,aAAa;EACbC,mBAAmB;EACnBC,cAAc;EACdC,oBAAoB;EACpBC,eAAe;EACfC,QAAQ,GAAG;AACb,CAAC,EACDC,GAAG,KACA;EACH;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,MAAMC,UAAU,GAAGA,CACjBC,IAAgB,EAChBC,QAAiB,KACM;IACvB,MAAMC,UAAU,GAAGD,QAAQ,GAAGD,IAAI,CAACG,UAAU,GAAGH,IAAI,CAACI,IAAI;;IAEzD;IACA,iBAAIjC,KAAK,CAACkC,cAAc,CAACH,UAAU,CAAC,EAAE;MACpC,OAAOA,UAAU;IACnB;;IAEA;IACA,oBACElB,IAAA,CAACR,KAAK;MACJ8B,MAAM,EAAEJ,UAAkC;MAC1CK,KAAK,EAAE;QAAEC,KAAK,EAAEX,QAAQ;QAAEY,MAAM,EAAEZ;MAAS,CAAE;MAC7Ca,UAAU,EAAC,SAAS;MACpBC,gCAAgC;IAAA,CACjC,CAAC;EAEN,CAAC;;EAED;EACA,MAAMC,cAAc,GAAG,eAAe;EAEtC,oBACE5B,IAAA,CAACP,YAAY;IACXoC,KAAK,EAAE,CAAC,QAAQ,CAAE;IAClB1B,SAAS,EAAEP,EAAE,CACX,wBAAwB,EACxBgB,eAAe,IAAIgB,cACrB,CAAE;IACFd,GAAG,EAAEA,GAAW;IAAAgB,QAAA,eAEhB9B,IAAA,CAACZ,IAAI;MACHe,SAAS,EAAEP,EAAE,CACX,gDAAgD,EAChDO,SACF,CAAE;MACF4B,IAAI,EAAC,YAAY;MAAAD,QAAA,EAEhBxB,KAAK,CAAC0B,GAAG,CAAC,CAAChB,IAAI,EAAEiB,KAAK,KAAK;QAC1B,MAAMhB,QAAQ,GAAGgB,KAAK,KAAK1B,WAAW;QACtC,MAAM2B,UAAU,GAAGlB,IAAI,CAACmB,QAAQ;QAEhC,oBACEjC,KAAA,CAACZ,SAAS;UAER8C,OAAO,EAAEpB,IAAI,CAACoB,OAAQ;UACtBD,QAAQ,EAAED,UAAW;UACrB/B,SAAS,EAAEP,EAAE,CACX,gEAAgE,EAChEsC,UAAU,IAAI,YAAY,EAC1B1B,aAAa,EACbS,QAAQ,IAAIR,mBACd,CAAE;UACFsB,IAAI,EAAC,QAAQ;UACb,cAAYf,IAAI,CAACqB,KAAM;UACvB,iBAAepB,QAAS;UACxBqB,iBAAiB,EAAC,QAAQ;UAC1BC,kBAAkB,EAAEvB,IAAI,CAACqB,KAAM;UAC/BG,kBAAkB,EAAE;YAClBC,QAAQ,EAAExB,QAAQ;YAClBkB,QAAQ,EAAED;UACZ,CAAE;UAAAJ,QAAA,gBAEF9B,IAAA,CAACZ,IAAI;YAACe,SAAS,EAAC,eAAe;YAAA2B,QAAA,EAC5Bf,UAAU,CAACC,IAAI,EAAEC,QAAQ;UAAC,CACvB,CAAC,eACPjB,IAAA,CAACF,gBAAgB,CAAC4C,QAAQ;YACxBC,KAAK,EAAE/C,EAAE,CACP,iCAAiC,EACjCqB,QAAQ,GACJN,oBAAoB,IAAI,iBAAiB,GACzCD,cAAc,IAAI,uBACxB,CAAE;YAAAoB,QAAA,eAEF9B,IAAA,CAACH,IAAI;cAAAiC,QAAA,EAAEd,IAAI,CAACqB;YAAK,CAAO;UAAC,CACA,CAAC;QAAA,GA/BvB,YAAYJ,KAAK,IAAIjB,IAAI,CAACqB,KAAK,EAgC3B,CAAC;MAEhB,CAAC;IAAC,CACE;EAAC,CACK,CAAC;AAEnB,CACF,CAAC;AAEDjC,MAAM,CAACwC,WAAW,GAAG,QAAQ;AAE7B,SAASxC,MAAM","ignoreList":[]}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ import { NativeOnlyAnimatedView } from "./Native-Only-Animated-View.js";
4
+ import { TextClassContext } from "./Text.js";
5
+ import { cn } from "../../lib/utils.js";
6
+ import * as PopoverPrimitive from '@rn-primitives/popover';
7
+ import * as React from 'react';
8
+ import { Platform, StyleSheet } from 'react-native';
9
+ import { FadeIn, FadeOut } from 'react-native-reanimated';
10
+ import { FullWindowOverlay as RNFullWindowOverlay } from 'react-native-screens';
11
+
12
+ /**
13
+ * Root component for popover - provides context for trigger and content
14
+ *
15
+ * @component
16
+ * @example
17
+ * ```tsx
18
+ * <Popover>
19
+ * <PopoverTrigger>
20
+ * <Button variant="outline">
21
+ * <Text>Open Popover</Text>
22
+ * </Button>
23
+ * </PopoverTrigger>
24
+ * <PopoverContent>
25
+ * <Text>Popover content goes here</Text>
26
+ * </PopoverContent>
27
+ * </Popover>
28
+ * ```
29
+ */
30
+ import { jsx as _jsx } from "react/jsx-runtime";
31
+ const Popover = PopoverPrimitive.Root;
32
+
33
+ /**
34
+ * Trigger component that opens the popover when pressed
35
+ *
36
+ * @component
37
+ */
38
+ const PopoverTrigger = PopoverPrimitive.Trigger;
39
+
40
+ /**
41
+ * Full window overlay wrapper for iOS, Fragment for other platforms
42
+ */
43
+ const FullWindowOverlay = Platform.OS === 'ios' ? RNFullWindowOverlay : React.Fragment;
44
+
45
+ /**
46
+ * Content container for popover
47
+ *
48
+ * Displays content in a floating panel anchored to the trigger.
49
+ * Includes smooth animations and proper positioning.
50
+ *
51
+ * @component
52
+ * @example
53
+ * ```tsx
54
+ * <PopoverContent align="start" sideOffset={8}>
55
+ * <View className="gap-2">
56
+ * <Text className="font-semibold">Dimensions</Text>
57
+ * <Text className="text-sm">Set the dimensions for the layer</Text>
58
+ * </View>
59
+ * </PopoverContent>
60
+ * ```
61
+ *
62
+ * @accessibility
63
+ * - Content is announced by screen readers
64
+ * - Dismissible with escape key on web
65
+ * - Proper focus management
66
+ */
67
+ function PopoverContent({
68
+ className,
69
+ align = 'center',
70
+ sideOffset = 4,
71
+ portalHost,
72
+ ...props
73
+ }) {
74
+ return /*#__PURE__*/_jsx(PopoverPrimitive.Portal, {
75
+ hostName: portalHost,
76
+ children: /*#__PURE__*/_jsx(FullWindowOverlay, {
77
+ children: /*#__PURE__*/_jsx(PopoverPrimitive.Overlay, {
78
+ style: Platform.select({
79
+ native: StyleSheet.absoluteFill
80
+ }),
81
+ children: /*#__PURE__*/_jsx(NativeOnlyAnimatedView, {
82
+ entering: FadeIn.duration(200),
83
+ exiting: FadeOut,
84
+ children: /*#__PURE__*/_jsx(TextClassContext.Provider, {
85
+ value: "text-popover-foreground",
86
+ children: /*#__PURE__*/_jsx(PopoverPrimitive.Content, {
87
+ align: align,
88
+ sideOffset: sideOffset,
89
+ className: cn('bg-popover border-border outline-hidden z-50 w-72 rounded-md border p-4 shadow-md shadow-black/5', Platform.select({
90
+ web: cn('animate-in fade-in-0 zoom-in-95 origin-(--radix-popover-content-transform-origin) cursor-auto', props.side === 'bottom' && 'slide-in-from-top-2', props.side === 'top' && 'slide-in-from-bottom-2')
91
+ }), className),
92
+ ...props
93
+ })
94
+ })
95
+ })
96
+ })
97
+ })
98
+ });
99
+ }
100
+ export { Popover, PopoverContent, PopoverTrigger };
101
+ //# sourceMappingURL=Popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeOnlyAnimatedView","TextClassContext","cn","PopoverPrimitive","React","Platform","StyleSheet","FadeIn","FadeOut","FullWindowOverlay","RNFullWindowOverlay","jsx","_jsx","Popover","Root","PopoverTrigger","Trigger","OS","Fragment","PopoverContent","className","align","sideOffset","portalHost","props","Portal","hostName","children","Overlay","style","select","native","absoluteFill","entering","duration","exiting","Provider","value","Content","web","side"],"sourceRoot":"../../../../src","sources":["components/ui/Popover.tsx"],"mappings":";;AAAA,SAASA,sBAAsB,QAAQ,gCAA6B;AACpE,SAASC,gBAAgB,QAAQ,WAAQ;AACzC,SAASC,EAAE,QAAQ,oBAAiB;AACpC,OAAO,KAAKC,gBAAgB,MAAM,wBAAwB;AAC1D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,SAASC,MAAM,EAAEC,OAAO,QAAQ,yBAAyB;AACzD,SAASC,iBAAiB,IAAIC,mBAAmB,QAAQ,sBAAsB;;AAE/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAjBA,SAAAC,GAAA,IAAAC,IAAA;AAkBA,MAAMC,OAAO,GAAGV,gBAAgB,CAACW,IAAI;;AAErC;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAGZ,gBAAgB,CAACa,OAAO;;AAE/C;AACA;AACA;AACA,MAAMP,iBAAiB,GACrBJ,QAAQ,CAACY,EAAE,KAAK,KAAK,GAAGP,mBAAmB,GAAGN,KAAK,CAACc,QAAQ;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,cAAcA,CAAC;EACtBC,SAAS;EACTC,KAAK,GAAG,QAAQ;EAChBC,UAAU,GAAG,CAAC;EACdC,UAAU;EACV,GAAGC;AAIH,CAAC,EAAE;EACH,oBACEZ,IAAA,CAACT,gBAAgB,CAACsB,MAAM;IAACC,QAAQ,EAAEH,UAAW;IAAAI,QAAA,eAC5Cf,IAAA,CAACH,iBAAiB;MAAAkB,QAAA,eAChBf,IAAA,CAACT,gBAAgB,CAACyB,OAAO;QACvBC,KAAK,EAAExB,QAAQ,CAACyB,MAAM,CAAC;UAAEC,MAAM,EAAEzB,UAAU,CAAC0B;QAAa,CAAC,CAAE;QAAAL,QAAA,eAE5Df,IAAA,CAACZ,sBAAsB;UACrBiC,QAAQ,EAAE1B,MAAM,CAAC2B,QAAQ,CAAC,GAAG,CAAE;UAC/BC,OAAO,EAAE3B,OAAQ;UAAAmB,QAAA,eAEjBf,IAAA,CAACX,gBAAgB,CAACmC,QAAQ;YAACC,KAAK,EAAC,yBAAyB;YAAAV,QAAA,eACxDf,IAAA,CAACT,gBAAgB,CAACmC,OAAO;cACvBjB,KAAK,EAAEA,KAAM;cACbC,UAAU,EAAEA,UAAW;cACvBF,SAAS,EAAElB,EAAE,CACX,kGAAkG,EAClGG,QAAQ,CAACyB,MAAM,CAAC;gBACdS,GAAG,EAAErC,EAAE,CACL,+FAA+F,EAC/FsB,KAAK,CAACgB,IAAI,KAAK,QAAQ,IAAI,qBAAqB,EAChDhB,KAAK,CAACgB,IAAI,KAAK,KAAK,IAAI,wBAC1B;cACF,CAAC,CAAC,EACFpB,SACF,CAAE;cAAA,GACEI;YAAK,CACV;UAAC,CACuB;QAAC,CACN;MAAC,CACD;IAAC,CACV;EAAC,CACG,CAAC;AAE9B;AAEA,SAASX,OAAO,EAAEM,cAAc,EAAEJ,cAAc","ignoreList":[]}
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+
3
+ import { cn } from "../../lib/utils.js";
4
+ import * as ProgressPrimitive from '@rn-primitives/progress';
5
+ import { Platform, View } from 'react-native';
6
+ import { cssInterop } from 'nativewind';
7
+ import Animated, { Extrapolation, interpolate, useAnimatedStyle, useDerivedValue, withSpring } from 'react-native-reanimated';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ cssInterop(View, {
10
+ className: 'style'
11
+ });
12
+
13
+ /**
14
+ * Progress bar component for displaying task completion
15
+ *
16
+ * Displays an animated progress indicator with customizable styles.
17
+ * Uses spring animations on native platforms for smooth transitions.
18
+ *
19
+ * @component
20
+ * @example
21
+ * ```tsx
22
+ * <Progress value={60} className="w-full" />
23
+ *
24
+ * <Progress
25
+ * value={progress}
26
+ * indicatorClassName="bg-green-500"
27
+ * />
28
+ * ```
29
+ *
30
+ * @accessibility
31
+ * - Uses proper ARIA attributes for progress indication
32
+ * - Value changes are announced by screen readers
33
+ */
34
+ function Progress({
35
+ className,
36
+ value,
37
+ indicatorClassName,
38
+ ...props
39
+ }) {
40
+ return /*#__PURE__*/_jsx(ProgressPrimitive.Root, {
41
+ className: cn('bg-primary/20 relative h-2 w-full overflow-hidden rounded-full', className),
42
+ ...props,
43
+ children: /*#__PURE__*/_jsx(Indicator, {
44
+ value: value,
45
+ className: indicatorClassName
46
+ })
47
+ });
48
+ }
49
+ export { Progress };
50
+
51
+ /**
52
+ * Platform-specific indicator component selector
53
+ */
54
+ const Indicator = Platform.select({
55
+ web: WebIndicator,
56
+ native: NativeIndicator,
57
+ default: NullIndicator
58
+ });
59
+
60
+ /**
61
+ * Props for progress indicator components
62
+ */
63
+
64
+ /**
65
+ * Web-specific progress indicator using CSS transforms
66
+ *
67
+ * @platform web
68
+ */
69
+ function WebIndicator({
70
+ value,
71
+ className
72
+ }) {
73
+ if (Platform.OS !== 'web') {
74
+ return null;
75
+ }
76
+ return /*#__PURE__*/_jsx(View, {
77
+ className: cn('bg-primary h-full w-full flex-1 transition-all', className),
78
+ style: {
79
+ transform: `translateX(-${100 - (value ?? 0)}%)`
80
+ },
81
+ children: /*#__PURE__*/_jsx(ProgressPrimitive.Indicator, {
82
+ className: cn('h-full w-full', className)
83
+ })
84
+ });
85
+ }
86
+
87
+ /**
88
+ * Native-specific progress indicator using Reanimated
89
+ *
90
+ * Provides smooth spring animations for progress changes.
91
+ *
92
+ * @platform native
93
+ */
94
+ function NativeIndicator({
95
+ value,
96
+ className
97
+ }) {
98
+ const progress = useDerivedValue(() => value ?? 0);
99
+ const indicator = useAnimatedStyle(() => {
100
+ return {
101
+ width: withSpring(`${interpolate(progress.value, [0, 100], [1, 100], Extrapolation.CLAMP)}%`, {
102
+ overshootClamping: true
103
+ })
104
+ };
105
+ }, [value]);
106
+ if (Platform.OS === 'web') {
107
+ return null;
108
+ }
109
+ return /*#__PURE__*/_jsx(ProgressPrimitive.Indicator, {
110
+ asChild: true,
111
+ children: /*#__PURE__*/_jsx(Animated.View, {
112
+ style: indicator,
113
+ className: cn('bg-foreground h-full', className)
114
+ })
115
+ });
116
+ }
117
+
118
+ /**
119
+ * Null indicator fallback for unsupported platforms
120
+ */
121
+ function NullIndicator(_props) {
122
+ return null;
123
+ }
124
+ //# sourceMappingURL=Progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["cn","ProgressPrimitive","Platform","View","cssInterop","Animated","Extrapolation","interpolate","useAnimatedStyle","useDerivedValue","withSpring","jsx","_jsx","className","Progress","value","indicatorClassName","props","Root","children","Indicator","select","web","WebIndicator","native","NativeIndicator","default","NullIndicator","OS","style","transform","progress","indicator","width","CLAMP","overshootClamping","asChild","_props"],"sourceRoot":"../../../../src","sources":["components/ui/Progress.tsx"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ import { cn } from "../../lib/utils.js";
4
+ import * as RadioGroupPrimitive from '@rn-primitives/radio-group';
5
+ import { Platform } from 'react-native';
6
+
7
+ /**
8
+ * Radio group component for single-choice selection
9
+ *
10
+ * Groups radio buttons together to ensure only one can be selected at a time.
11
+ *
12
+ * @component
13
+ * @example
14
+ * ```tsx
15
+ * <RadioGroup value={selectedValue} onValueChange={setSelectedValue}>
16
+ * <View className="flex-row items-center gap-2">
17
+ * <RadioGroupItem value="option1" />
18
+ * <Label>Option 1</Label>
19
+ * </View>
20
+ * <View className="flex-row items-center gap-2">
21
+ * <RadioGroupItem value="option2" />
22
+ * <Label>Option 2</Label>
23
+ * </View>
24
+ * </RadioGroup>
25
+ * ```
26
+ *
27
+ * @accessibility
28
+ * - Uses proper ARIA role for radio group
29
+ * - Keyboard navigation support (arrow keys)
30
+ * - Screen reader friendly with proper labeling
31
+ */
32
+ import { jsx as _jsx } from "react/jsx-runtime";
33
+ function RadioGroup({
34
+ className,
35
+ ...props
36
+ }) {
37
+ return /*#__PURE__*/_jsx(RadioGroupPrimitive.Root, {
38
+ className: cn('gap-3', className),
39
+ ...props
40
+ });
41
+ }
42
+
43
+ /**
44
+ * Individual radio button item
45
+ *
46
+ * Displays as a circular button with an inner indicator when selected.
47
+ *
48
+ * @component
49
+ * @example
50
+ * ```tsx
51
+ * <RadioGroupItem value="dark" />
52
+ * <RadioGroupItem value="light" disabled />
53
+ * ```
54
+ *
55
+ * @accessibility
56
+ * - Disabled state prevents interaction
57
+ * - Focus visible states on web
58
+ * - Invalid state styling for form validation
59
+ */
60
+ function RadioGroupItem({
61
+ className,
62
+ ...props
63
+ }) {
64
+ return /*#__PURE__*/_jsx(RadioGroupPrimitive.Item, {
65
+ className: cn('border-input dark:bg-input/30 aspect-square size-4 shrink-0 items-center justify-center rounded-full border shadow-sm shadow-black/5', Platform.select({
66
+ web: 'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive outline-none transition-all focus-visible:ring-[3px] disabled:cursor-not-allowed'
67
+ }), props.disabled && 'opacity-50', className),
68
+ ...props,
69
+ children: /*#__PURE__*/_jsx(RadioGroupPrimitive.Indicator, {
70
+ className: "bg-primary size-2 rounded-full"
71
+ })
72
+ });
73
+ }
74
+ export { RadioGroup, RadioGroupItem };
75
+ //# sourceMappingURL=Radio-Group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["cn","RadioGroupPrimitive","Platform","jsx","_jsx","RadioGroup","className","props","Root","RadioGroupItem","Item","select","web","disabled","children","Indicator"],"sourceRoot":"../../../../src","sources":["components/ui/Radio-Group.tsx"],"mappings":";;AAAA,SAASA,EAAE,QAAQ,oBAAiB;AACpC,OAAO,KAAKC,mBAAmB,MAAM,4BAA4B;AACjE,SAASC,QAAQ,QAAQ,cAAc;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxBA,SAAAC,GAAA,IAAAC,IAAA;AAyBA,SAASC,UAAUA,CAAC;EAClBC,SAAS;EACT,GAAGC;AAE4C,CAAC,EAAE;EAClD,oBACEH,IAAA,CAACH,mBAAmB,CAACO,IAAI;IAACF,SAAS,EAAEN,EAAE,CAAC,OAAO,EAAEM,SAAS,CAAE;IAAA,GAAKC;EAAK,CAAG,CAAC;AAE9E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,cAAcA,CAAC;EACtBH,SAAS;EACT,GAAGC;AAE4C,CAAC,EAAE;EAClD,oBACEH,IAAA,CAACH,mBAAmB,CAACS,IAAI;IACvBJ,SAAS,EAAEN,EAAE,CACX,sIAAsI,EACtIE,QAAQ,CAACS,MAAM,CAAC;MACdC,GAAG,EAAE;IACP,CAAC,CAAC,EACFL,KAAK,CAACM,QAAQ,IAAI,YAAY,EAC9BP,SACF,CAAE;IAAA,GACEC,KAAK;IAAAO,QAAA,eAETV,IAAA,CAACH,mBAAmB,CAACc,SAAS;MAACT,SAAS,EAAC;IAAgC,CAAE;EAAC,CACpD,CAAC;AAE/B;AAEA,SAASD,UAAU,EAAEI,cAAc","ignoreList":[]}