@campxdev/react-native-blueprint 0.1.3 → 0.1.6
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 +153 -69
- package/lib/module/app/_layout.js +7 -1
- package/lib/module/app/_layout.js.map +1 -1
- package/lib/module/components/ui/Accordion.js.map +1 -1
- package/lib/module/components/ui/Alert-Dialog.js +2 -2
- package/lib/module/components/ui/Alert-Dialog.js.map +1 -1
- package/lib/module/components/ui/Alert.js +2 -2
- package/lib/module/components/ui/Alert.js.map +1 -1
- package/lib/module/components/ui/AppBar.js.map +1 -1
- package/lib/module/components/ui/Avatar.js +3 -3
- package/lib/module/components/ui/Avatar.js.map +1 -1
- package/lib/module/components/ui/Bottom-Sheet.js +9 -2
- package/lib/module/components/ui/Bottom-Sheet.js.map +1 -1
- package/lib/module/components/ui/Context-Menu.js +24 -24
- package/lib/module/components/ui/Context-Menu.js.map +1 -1
- package/lib/module/components/ui/Custom-Card.js +6 -2
- package/lib/module/components/ui/Custom-Card.js.map +1 -1
- package/lib/module/components/ui/Dialog.js +3 -3
- package/lib/module/components/ui/Dialog.js.map +1 -1
- package/lib/module/components/ui/Dropdown-Menu.js +3 -3
- package/lib/module/components/ui/Dropdown-Menu.js.map +1 -1
- package/lib/module/components/ui/Input.js +3 -2
- package/lib/module/components/ui/Input.js.map +1 -1
- package/lib/module/components/ui/Menubar.js +4 -4
- package/lib/module/components/ui/Menubar.js.map +1 -1
- package/lib/module/components/ui/Native-Only-Animated-View.js.map +1 -1
- package/lib/module/components/ui/NavBar.js.map +1 -1
- package/lib/module/components/ui/Progress.js +2 -2
- package/lib/module/components/ui/Progress.js.map +1 -1
- package/lib/module/components/ui/Select.js +3 -3
- package/lib/module/components/ui/Select.js.map +1 -1
- package/lib/module/components/ui/Separator.js +2 -2
- package/lib/module/components/ui/Separator.js.map +1 -1
- package/lib/module/components/ui/Skeleton.js +2 -2
- package/lib/module/components/ui/Skeleton.js.map +1 -1
- package/lib/module/components/ui/Slider.js +7 -2
- package/lib/module/components/ui/Slider.js.map +1 -1
- package/lib/module/components/ui/Table.js +2 -2
- package/lib/module/components/ui/Table.js.map +1 -1
- package/lib/module/components/ui/Text.js.map +1 -1
- package/lib/module/components/ui/Textarea.js +3 -2
- package/lib/module/components/ui/Textarea.js.map +1 -1
- package/lib/module/components/ui/Theme-Toggle.js +3 -3
- package/lib/module/components/ui/Theme-Toggle.js.map +1 -1
- package/lib/module/components/ui/Toast.js +2 -2
- package/lib/module/components/ui/Toast.js.map +1 -1
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/lib/slot-helpers.js +19 -0
- package/lib/module/lib/slot-helpers.js.map +1 -0
- package/lib/module/types/components.d.js +4 -0
- package/lib/module/types/components.d.js.map +1 -0
- package/lib/module/types/global.d.js +5 -0
- package/lib/module/types/global.d.js.map +1 -1
- package/lib/module/types/rn-primitives.d.js +56 -1
- package/lib/module/types/rn-primitives.d.js.map +1 -1
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/app/_layout.d.ts +0 -1
- package/lib/typescript/src/app/_layout.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Accordion.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Alert-Dialog.d.ts +3 -26
- package/lib/typescript/src/components/ui/Alert-Dialog.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Alert.d.ts +3 -2
- package/lib/typescript/src/components/ui/Alert.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/AppBar.d.ts +3 -3
- package/lib/typescript/src/components/ui/AppBar.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Aspect-Ratio.d.ts +2 -8
- package/lib/typescript/src/components/ui/Aspect-Ratio.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Avatar.d.ts +472 -337
- package/lib/typescript/src/components/ui/Avatar.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Badge.d.ts +9 -136
- package/lib/typescript/src/components/ui/Badge.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Bottom-Sheet.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Button.d.ts +12 -165
- package/lib/typescript/src/components/ui/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Card.d.ts +7 -768
- package/lib/typescript/src/components/ui/Card.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Collapsible.d.ts +4 -33
- package/lib/typescript/src/components/ui/Collapsible.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Context-Menu.d.ts +6 -49
- package/lib/typescript/src/components/ui/Context-Menu.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Custom-Card.d.ts +7 -768
- package/lib/typescript/src/components/ui/Custom-Card.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Dialog.d.ts +4 -40
- package/lib/typescript/src/components/ui/Dialog.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Dropdown-Menu.d.ts +7 -49
- package/lib/typescript/src/components/ui/Dropdown-Menu.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Hover-Card.d.ts +2 -21
- package/lib/typescript/src/components/ui/Hover-Card.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Input.d.ts +5 -3
- package/lib/typescript/src/components/ui/Input.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Label.d.ts +2 -73
- package/lib/typescript/src/components/ui/Label.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Menubar.d.ts +6 -39
- package/lib/typescript/src/components/ui/Menubar.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/NavBar.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Popover.d.ts +2 -19
- package/lib/typescript/src/components/ui/Popover.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Progress.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Select.d.ts +5 -26
- package/lib/typescript/src/components/ui/Select.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Separator.d.ts +2 -128
- package/lib/typescript/src/components/ui/Separator.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Skeleton.d.ts +4 -2
- package/lib/typescript/src/components/ui/Skeleton.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Slider.d.ts +2 -1
- package/lib/typescript/src/components/ui/Slider.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Table.d.ts +16 -6
- package/lib/typescript/src/components/ui/Table.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Text.d.ts +3 -74
- package/lib/typescript/src/components/ui/Text.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Textarea.d.ts +7 -3
- package/lib/typescript/src/components/ui/Textarea.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Theme-Toggle.d.ts +1 -128
- package/lib/typescript/src/components/ui/Theme-Toggle.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Toast.d.ts +3 -2
- package/lib/typescript/src/components/ui/Toast.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Toggle.d.ts +4 -4
- package/lib/typescript/src/components/ui/Toggle.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Tooltip.d.ts +2 -22
- package/lib/typescript/src/components/ui/Tooltip.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/lib/slot-helpers.d.ts +32 -0
- package/lib/typescript/src/lib/slot-helpers.d.ts.map +1 -0
- package/nativewind-env.d.ts +7 -0
- package/package.json +24 -7
- package/src/app/_layout.tsx +7 -1
- package/src/components/ui/Accordion.tsx +3 -1
- package/src/components/ui/Alert-Dialog.tsx +5 -3
- package/src/components/ui/Alert.tsx +7 -4
- package/src/components/ui/AppBar.tsx +6 -2
- package/src/components/ui/Avatar.tsx +10 -6
- package/src/components/ui/Bottom-Sheet.tsx +10 -2
- package/src/components/ui/Context-Menu.tsx +15 -4
- package/src/components/ui/Custom-Card.tsx +6 -1
- package/src/components/ui/Dialog.tsx +13 -3
- package/src/components/ui/Dropdown-Menu.tsx +8 -4
- package/src/components/ui/Input.tsx +12 -4
- package/src/components/ui/Menubar.tsx +13 -6
- package/src/components/ui/Native-Only-Animated-View.tsx +1 -1
- package/src/components/ui/NavBar.tsx +9 -3
- package/src/components/ui/Progress.tsx +4 -2
- package/src/components/ui/Select.tsx +18 -6
- package/src/components/ui/Separator.tsx +4 -2
- package/src/components/ui/Skeleton.tsx +5 -3
- package/src/components/ui/Slider.tsx +8 -2
- package/src/components/ui/Table.tsx +9 -7
- package/src/components/ui/Text.tsx +1 -6
- package/src/components/ui/Textarea.tsx +15 -4
- package/src/components/ui/Theme-Toggle.tsx +7 -3
- package/src/components/ui/Toast.tsx +6 -3
- package/src/index.tsx +4 -0
- package/src/lib/slot-helpers.ts +57 -0
- package/src/types/components.d.ts +38 -0
- package/src/types/global.d.ts +178 -4
- package/src/types/rn-primitives.d.ts +1403 -46
|
@@ -14,17 +14,21 @@ import {
|
|
|
14
14
|
Platform,
|
|
15
15
|
type StyleProp,
|
|
16
16
|
StyleSheet,
|
|
17
|
-
Text,
|
|
17
|
+
Text as RNText,
|
|
18
18
|
type TextProps,
|
|
19
|
-
View,
|
|
19
|
+
View as RNView,
|
|
20
20
|
type ViewStyle,
|
|
21
21
|
} from 'react-native';
|
|
22
22
|
import { cssInterop } from 'nativewind';
|
|
23
23
|
import { FadeIn } from 'react-native-reanimated';
|
|
24
24
|
import { FullWindowOverlay as RNFullWindowOverlay } from 'react-native-screens';
|
|
25
25
|
|
|
26
|
-
cssInterop(
|
|
27
|
-
|
|
26
|
+
const View = cssInterop(RNView, {
|
|
27
|
+
className: 'style',
|
|
28
|
+
}) as React.ComponentType<any>;
|
|
29
|
+
const Text = cssInterop(RNText, {
|
|
30
|
+
className: 'style',
|
|
31
|
+
}) as React.ComponentType<any>;
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
34
|
* Root context menu component
|
|
@@ -95,6 +99,7 @@ function ContextMenuSubTrigger({
|
|
|
95
99
|
open && 'text-accent-foreground'
|
|
96
100
|
)}
|
|
97
101
|
>
|
|
102
|
+
supported by NativeWind
|
|
98
103
|
<ContextMenuPrimitive.SubTrigger
|
|
99
104
|
className={cn(
|
|
100
105
|
'active:bg-accent group flex flex-row items-center rounded-sm px-2 py-2 sm:py-1.5',
|
|
@@ -130,6 +135,7 @@ function ContextMenuSubContent({
|
|
|
130
135
|
React.RefAttributes<ContextMenuPrimitive.SubContentRef>) {
|
|
131
136
|
return (
|
|
132
137
|
<NativeOnlyAnimatedView entering={FadeIn}>
|
|
138
|
+
supported by NativeWind
|
|
133
139
|
<ContextMenuPrimitive.SubContent
|
|
134
140
|
className={cn(
|
|
135
141
|
'bg-popover border-border overflow-hidden rounded-md border p-1 shadow-lg shadow-black/5',
|
|
@@ -169,6 +175,7 @@ function ContextMenuContent({
|
|
|
169
175
|
return (
|
|
170
176
|
<ContextMenuPrimitive.Portal hostName={portalHost}>
|
|
171
177
|
<FullWindowOverlay>
|
|
178
|
+
supported by NativeWind
|
|
172
179
|
<ContextMenuPrimitive.Overlay
|
|
173
180
|
style={Platform.select({
|
|
174
181
|
web: overlayStyle ?? undefined,
|
|
@@ -183,6 +190,7 @@ function ContextMenuContent({
|
|
|
183
190
|
>
|
|
184
191
|
<NativeOnlyAnimatedView entering={FadeIn}>
|
|
185
192
|
<TextClassContext.Provider value="text-popover-foreground">
|
|
193
|
+
is supported by NativeWind
|
|
186
194
|
<ContextMenuPrimitive.Content
|
|
187
195
|
className={cn(
|
|
188
196
|
'bg-popover border-border min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg shadow-black/5',
|
|
@@ -228,6 +236,7 @@ function ContextMenuItem({
|
|
|
228
236
|
'text-destructive group-active:text-destructive'
|
|
229
237
|
)}
|
|
230
238
|
>
|
|
239
|
+
supported by NativeWind
|
|
231
240
|
<ContextMenuPrimitive.Item
|
|
232
241
|
className={cn(
|
|
233
242
|
'active:bg-accent group relative flex flex-row items-center gap-2 rounded-sm px-2 py-2 sm:py-1.5',
|
|
@@ -264,6 +273,7 @@ function ContextMenuCheckboxItem({
|
|
|
264
273
|
}) {
|
|
265
274
|
return (
|
|
266
275
|
<TextClassContext.Provider value="text-sm text-popover-foreground select-none group-active:text-accent-foreground">
|
|
276
|
+
supported by NativeWind
|
|
267
277
|
<ContextMenuPrimitive.CheckboxItem
|
|
268
278
|
className={cn(
|
|
269
279
|
'active:bg-accent group relative flex flex-row items-center gap-2 rounded-sm py-2 pl-8 pr-2 sm:py-1.5',
|
|
@@ -306,6 +316,7 @@ function ContextMenuRadioItem({
|
|
|
306
316
|
}) {
|
|
307
317
|
return (
|
|
308
318
|
<TextClassContext.Provider value="text-sm text-popover-foreground select-none group-active:text-accent-foreground">
|
|
319
|
+
supported by NativeWind
|
|
309
320
|
<ContextMenuPrimitive.RadioItem
|
|
310
321
|
className={cn(
|
|
311
322
|
'active:bg-accent group relative flex flex-row items-center gap-2 rounded-sm py-2 pl-8 pr-2 sm:py-1.5',
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import * as Slot from '@rn-primitives/slot';
|
|
2
2
|
import type { SlottableViewProps, ViewRef } from '@rn-primitives/types';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { View, useColorScheme } from 'react-native';
|
|
4
|
+
import { View as RNView, useColorScheme } from 'react-native';
|
|
5
5
|
import { SquircleView } from 'react-native-figma-squircle';
|
|
6
|
+
import { cssInterop } from 'nativewind';
|
|
6
7
|
import { cn } from '../../lib/utils';
|
|
7
8
|
import { TextClassContext } from './Text';
|
|
8
9
|
|
|
10
|
+
const View = cssInterop(RNView, {
|
|
11
|
+
className: 'style',
|
|
12
|
+
}) as React.ComponentType<any>;
|
|
13
|
+
|
|
9
14
|
/**
|
|
10
15
|
* CustomCard container component with squircle shape
|
|
11
16
|
*
|
|
@@ -4,13 +4,22 @@ import { cn } from '../../lib/utils';
|
|
|
4
4
|
import * as DialogPrimitive from '@rn-primitives/dialog';
|
|
5
5
|
import { X } from 'lucide-react-native';
|
|
6
6
|
import * as React from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
Platform,
|
|
9
|
+
Text as RNText,
|
|
10
|
+
View as RNView,
|
|
11
|
+
type ViewProps,
|
|
12
|
+
} from 'react-native';
|
|
8
13
|
import { cssInterop } from 'nativewind';
|
|
9
14
|
import { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
10
15
|
import { FullWindowOverlay as RNFullWindowOverlay } from 'react-native-screens';
|
|
11
16
|
|
|
12
|
-
cssInterop(
|
|
13
|
-
|
|
17
|
+
const View = cssInterop(RNView, {
|
|
18
|
+
className: 'style',
|
|
19
|
+
}) as React.ComponentType<any>;
|
|
20
|
+
const Text = cssInterop(RNText, {
|
|
21
|
+
className: 'style',
|
|
22
|
+
}) as React.ComponentType<any>;
|
|
14
23
|
|
|
15
24
|
/**
|
|
16
25
|
* Root dialog container
|
|
@@ -132,6 +141,7 @@ function DialogContent({
|
|
|
132
141
|
{...props}
|
|
133
142
|
>
|
|
134
143
|
<>{children}</>
|
|
144
|
+
|
|
135
145
|
<DialogPrimitive.Close
|
|
136
146
|
className={cn(
|
|
137
147
|
'absolute right-4 top-4 rounded opacity-70 active:opacity-100',
|
|
@@ -14,17 +14,21 @@ import {
|
|
|
14
14
|
Platform,
|
|
15
15
|
type StyleProp,
|
|
16
16
|
StyleSheet,
|
|
17
|
-
Text,
|
|
17
|
+
Text as RNText,
|
|
18
18
|
type TextProps,
|
|
19
|
-
View,
|
|
19
|
+
View as RNView,
|
|
20
20
|
type ViewStyle,
|
|
21
21
|
} from 'react-native';
|
|
22
22
|
import { cssInterop } from 'nativewind';
|
|
23
23
|
import { FadeIn } from 'react-native-reanimated';
|
|
24
24
|
import { FullWindowOverlay as RNFullWindowOverlay } from 'react-native-screens';
|
|
25
25
|
|
|
26
|
-
cssInterop(
|
|
27
|
-
|
|
26
|
+
const View = cssInterop(RNView, {
|
|
27
|
+
className: 'style',
|
|
28
|
+
}) as React.ComponentType<any>;
|
|
29
|
+
const Text = cssInterop(RNText, {
|
|
30
|
+
className: 'style',
|
|
31
|
+
}) as React.ComponentType<any>;
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
34
|
* Root component for dropdown menu - provides context for all dropdown menu children
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { cn } from '../../lib/utils';
|
|
2
|
-
import
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
Platform,
|
|
5
|
+
TextInput as RNTextInput,
|
|
6
|
+
type TextInputProps,
|
|
7
|
+
} from 'react-native';
|
|
3
8
|
import { cssInterop } from 'nativewind';
|
|
4
9
|
|
|
5
|
-
cssInterop(
|
|
10
|
+
const TextInput = cssInterop(RNTextInput, {
|
|
11
|
+
className: 'style',
|
|
12
|
+
}) as React.ComponentType<any>;
|
|
6
13
|
|
|
7
14
|
/**
|
|
8
15
|
* Props for Input component
|
|
@@ -11,8 +18,9 @@ cssInterop(TextInput, { className: 'style' });
|
|
|
11
18
|
* @property {string} [className] - Additional Tailwind classes for custom styling
|
|
12
19
|
* @property {boolean} [editable=true] - Whether the input is editable (disabled when false)
|
|
13
20
|
*/
|
|
14
|
-
interface InputProps extends TextInputProps {
|
|
21
|
+
interface InputProps extends Omit<TextInputProps, 'editable'> {
|
|
15
22
|
className?: string;
|
|
23
|
+
editable?: boolean;
|
|
16
24
|
}
|
|
17
25
|
|
|
18
26
|
/**
|
|
@@ -56,7 +64,7 @@ function Input({
|
|
|
56
64
|
className,
|
|
57
65
|
editable = true,
|
|
58
66
|
...props
|
|
59
|
-
}: InputProps & React.RefAttributes<
|
|
67
|
+
}: InputProps & React.RefAttributes<RNTextInput>) {
|
|
60
68
|
return (
|
|
61
69
|
<TextInput
|
|
62
70
|
className={cn(
|
|
@@ -13,21 +13,27 @@ import {
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import {
|
|
15
15
|
Platform,
|
|
16
|
-
Pressable,
|
|
16
|
+
Pressable as RNPressable,
|
|
17
17
|
type StyleProp,
|
|
18
18
|
StyleSheet,
|
|
19
|
-
Text,
|
|
19
|
+
Text as RNText,
|
|
20
20
|
type TextProps,
|
|
21
|
-
View,
|
|
21
|
+
View as RNView,
|
|
22
22
|
type ViewStyle,
|
|
23
23
|
} from 'react-native';
|
|
24
24
|
import { cssInterop } from 'nativewind';
|
|
25
25
|
import { FadeIn } from 'react-native-reanimated';
|
|
26
26
|
import { FullWindowOverlay as RNFullWindowOverlay } from 'react-native-screens';
|
|
27
27
|
|
|
28
|
-
cssInterop(
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const View = cssInterop(RNView, {
|
|
29
|
+
className: 'style',
|
|
30
|
+
}) as React.ComponentType<any>;
|
|
31
|
+
const Text = cssInterop(RNText, {
|
|
32
|
+
className: 'style',
|
|
33
|
+
}) as React.ComponentType<any>;
|
|
34
|
+
const Pressable = cssInterop(RNPressable, {
|
|
35
|
+
className: 'style',
|
|
36
|
+
}) as React.ComponentType<any>;
|
|
31
37
|
|
|
32
38
|
/**
|
|
33
39
|
* Individual menu within the menubar
|
|
@@ -124,6 +130,7 @@ function Menubar({
|
|
|
124
130
|
<Pressable onPress={closeMenu} style={StyleSheet.absoluteFill} />
|
|
125
131
|
</Portal>
|
|
126
132
|
) : null}
|
|
133
|
+
|
|
127
134
|
<MenubarPrimitive.Root
|
|
128
135
|
className={cn(
|
|
129
136
|
'bg-background border-border flex h-10 flex-row items-center gap-1 rounded-md border p-1 shadow-sm shadow-black/5 sm:h-9',
|
|
@@ -8,9 +8,15 @@ import { Text, TextClassContext } from './Text';
|
|
|
8
8
|
import type { ViewRef } from '@rn-primitives/types';
|
|
9
9
|
|
|
10
10
|
// Enable NativeWind className support
|
|
11
|
-
const View = cssInterop(RNView, {
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const View = cssInterop(RNView, {
|
|
12
|
+
className: 'style',
|
|
13
|
+
}) as React.ComponentType<any>;
|
|
14
|
+
const Pressable = cssInterop(RNPressable, {
|
|
15
|
+
className: 'style',
|
|
16
|
+
}) as React.ComponentType<any>;
|
|
17
|
+
const SafeAreaView = cssInterop(RNSafeAreaView, {
|
|
18
|
+
className: 'style',
|
|
19
|
+
}) as React.ComponentType<any>;
|
|
14
20
|
|
|
15
21
|
/**
|
|
16
22
|
* Props for individual navigation bar items
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from '../../lib/utils';
|
|
2
2
|
import * as ProgressPrimitive from '@rn-primitives/progress';
|
|
3
|
-
import { Platform, View } from 'react-native';
|
|
3
|
+
import { Platform, View as RNView } from 'react-native';
|
|
4
4
|
import { cssInterop } from 'nativewind';
|
|
5
5
|
import Animated, {
|
|
6
6
|
Extrapolation,
|
|
@@ -10,7 +10,9 @@ import Animated, {
|
|
|
10
10
|
withSpring,
|
|
11
11
|
} from 'react-native-reanimated';
|
|
12
12
|
|
|
13
|
-
cssInterop(
|
|
13
|
+
const View = cssInterop(RNView, {
|
|
14
|
+
className: 'style',
|
|
15
|
+
}) as React.ComponentType<any>;
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* Progress bar component for displaying task completion
|
|
@@ -10,13 +10,22 @@ import {
|
|
|
10
10
|
ChevronUpIcon,
|
|
11
11
|
} from 'lucide-react-native';
|
|
12
12
|
import * as React from 'react';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
Platform,
|
|
15
|
+
ScrollView as RNScrollView,
|
|
16
|
+
StyleSheet,
|
|
17
|
+
View as RNView,
|
|
18
|
+
} from 'react-native';
|
|
14
19
|
import { cssInterop } from 'nativewind';
|
|
15
20
|
import { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
16
21
|
import { FullWindowOverlay as RNFullWindowOverlay } from 'react-native-screens';
|
|
17
22
|
|
|
18
|
-
cssInterop(
|
|
19
|
-
|
|
23
|
+
const View = cssInterop(RNView, {
|
|
24
|
+
className: 'style',
|
|
25
|
+
}) as React.ComponentType<any>;
|
|
26
|
+
const ScrollView = cssInterop(RNScrollView, {
|
|
27
|
+
className: 'style',
|
|
28
|
+
}) as React.ComponentType<any>;
|
|
20
29
|
|
|
21
30
|
/**
|
|
22
31
|
* Option type for select items
|
|
@@ -70,7 +79,7 @@ function SelectValue({
|
|
|
70
79
|
!value && 'text-muted-foreground',
|
|
71
80
|
className
|
|
72
81
|
)}
|
|
73
|
-
{...props}
|
|
82
|
+
{...(props as any)}
|
|
74
83
|
/>
|
|
75
84
|
);
|
|
76
85
|
}
|
|
@@ -102,7 +111,7 @@ function SelectTrigger({
|
|
|
102
111
|
size === 'sm' && 'h-8 py-2 sm:py-1.5',
|
|
103
112
|
className
|
|
104
113
|
)}
|
|
105
|
-
{...props}
|
|
114
|
+
{...(props as any)}
|
|
106
115
|
>
|
|
107
116
|
<>{children}</>
|
|
108
117
|
<Icon
|
|
@@ -168,9 +177,10 @@ function SelectContent({
|
|
|
168
177
|
className
|
|
169
178
|
)}
|
|
170
179
|
position={position}
|
|
171
|
-
{...props}
|
|
180
|
+
{...(props as any)}
|
|
172
181
|
>
|
|
173
182
|
<SelectScrollUpButton />
|
|
183
|
+
|
|
174
184
|
<SelectPrimitive.Viewport
|
|
175
185
|
className={cn(
|
|
176
186
|
'p-1',
|
|
@@ -240,6 +250,7 @@ function SelectItem({
|
|
|
240
250
|
<Icon as={Check} className="text-muted-foreground size-4 shrink-0" />
|
|
241
251
|
</SelectPrimitive.ItemIndicator>
|
|
242
252
|
</View>
|
|
253
|
+
|
|
243
254
|
<SelectPrimitive.ItemText className="text-foreground group-active:text-accent-foreground select-none text-sm" />
|
|
244
255
|
</SelectPrimitive.Item>
|
|
245
256
|
);
|
|
@@ -325,6 +336,7 @@ function NativeSelectScrollView({
|
|
|
325
336
|
if (Platform.OS === 'web') {
|
|
326
337
|
return <>{props.children}</>;
|
|
327
338
|
}
|
|
339
|
+
|
|
328
340
|
return <ScrollView className={cn('max-h-52', className)} {...props} />;
|
|
329
341
|
}
|
|
330
342
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
2
|
+
import { View as RNView } from 'react-native';
|
|
3
3
|
import { cssInterop } from 'nativewind';
|
|
4
4
|
import { cn } from '../../lib/utils';
|
|
5
5
|
import type { ViewRef, SlottableViewProps } from '@rn-primitives/types';
|
|
6
6
|
|
|
7
|
-
cssInterop(
|
|
7
|
+
const View = cssInterop(RNView, {
|
|
8
|
+
className: 'style',
|
|
9
|
+
}) as React.ComponentType<any>;
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Visual divider for separating content sections
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { cn } from '../../lib/utils';
|
|
2
|
-
import { View } from 'react-native';
|
|
2
|
+
import { View as RNView, type ViewProps } from 'react-native';
|
|
3
3
|
import { cssInterop } from 'nativewind';
|
|
4
4
|
|
|
5
|
-
cssInterop(
|
|
5
|
+
const View = cssInterop(RNView, {
|
|
6
|
+
className: 'style',
|
|
7
|
+
}) as React.ComponentType<any>;
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* Skeleton loading placeholder component
|
|
@@ -43,7 +45,7 @@ cssInterop(View, { className: 'style' });
|
|
|
43
45
|
function Skeleton({
|
|
44
46
|
className,
|
|
45
47
|
...props
|
|
46
|
-
}:
|
|
48
|
+
}: ViewProps & { className?: string } & React.RefAttributes<RNView>) {
|
|
47
49
|
return (
|
|
48
50
|
<View
|
|
49
51
|
className={cn('bg-muted animate-pulse rounded-md', className)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Platform, View, ViewProps } from 'react-native';
|
|
2
|
+
import { Platform, View as RNView, type ViewProps } from 'react-native';
|
|
3
3
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
4
4
|
import Animated, {
|
|
5
5
|
runOnJS,
|
|
@@ -7,8 +7,13 @@ import Animated, {
|
|
|
7
7
|
useSharedValue,
|
|
8
8
|
withSpring,
|
|
9
9
|
} from 'react-native-reanimated';
|
|
10
|
+
import { cssInterop } from 'nativewind';
|
|
10
11
|
import { cn } from '../../lib/utils';
|
|
11
12
|
|
|
13
|
+
const View = cssInterop(RNView, {
|
|
14
|
+
className: 'style',
|
|
15
|
+
}) as React.ComponentType<any>;
|
|
16
|
+
|
|
12
17
|
/**
|
|
13
18
|
* Props for the Slider component
|
|
14
19
|
*
|
|
@@ -27,6 +32,7 @@ export interface SliderProps extends Omit<ViewProps, 'children'> {
|
|
|
27
32
|
step?: number;
|
|
28
33
|
disabled?: boolean;
|
|
29
34
|
className?: string;
|
|
35
|
+
style?: any;
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
/**
|
|
@@ -191,7 +197,7 @@ const Slider = React.forwardRef<SliderRef, SliderProps>(
|
|
|
191
197
|
<GestureDetector gesture={composed}>
|
|
192
198
|
<View
|
|
193
199
|
className="relative h-2 w-full overflow-hidden rounded-full bg-primary/20"
|
|
194
|
-
onLayout={(event) => {
|
|
200
|
+
onLayout={(event: any) => {
|
|
195
201
|
const { width, x } = event.nativeEvent.layout;
|
|
196
202
|
sliderWidth.value = width;
|
|
197
203
|
setSliderDimensions({ width, x });
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { cn } from '../../lib/utils';
|
|
2
2
|
import { Text } from './Text';
|
|
3
|
-
import { View } from 'react-native';
|
|
3
|
+
import { View as RNView, type ViewProps } from 'react-native';
|
|
4
4
|
import { cssInterop } from 'nativewind';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
|
|
7
|
-
cssInterop(
|
|
7
|
+
const View = cssInterop(RNView, {
|
|
8
|
+
className: 'style',
|
|
9
|
+
}) as React.ComponentType<any>;
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Root table container component
|
|
@@ -31,7 +33,7 @@ cssInterop(View, { className: 'style' });
|
|
|
31
33
|
function Table({
|
|
32
34
|
className,
|
|
33
35
|
...props
|
|
34
|
-
}:
|
|
36
|
+
}: ViewProps & { className?: string } & React.RefAttributes<RNView>) {
|
|
35
37
|
return <View className={cn('w-full', className)} {...props} />;
|
|
36
38
|
}
|
|
37
39
|
|
|
@@ -43,7 +45,7 @@ function Table({
|
|
|
43
45
|
function TableHeader({
|
|
44
46
|
className,
|
|
45
47
|
...props
|
|
46
|
-
}:
|
|
48
|
+
}: ViewProps & { className?: string } & React.RefAttributes<RNView>) {
|
|
47
49
|
return (
|
|
48
50
|
<View
|
|
49
51
|
className={cn('border-border flex-row border-b', className)}
|
|
@@ -60,7 +62,7 @@ function TableHeader({
|
|
|
60
62
|
function TableBody({
|
|
61
63
|
className,
|
|
62
64
|
...props
|
|
63
|
-
}:
|
|
65
|
+
}: ViewProps & { className?: string } & React.RefAttributes<RNView>) {
|
|
64
66
|
return <View className={cn('flex-col', className)} {...props} />;
|
|
65
67
|
}
|
|
66
68
|
|
|
@@ -72,7 +74,7 @@ function TableBody({
|
|
|
72
74
|
function TableFooter({
|
|
73
75
|
className,
|
|
74
76
|
...props
|
|
75
|
-
}:
|
|
77
|
+
}: ViewProps & { className?: string } & React.RefAttributes<RNView>) {
|
|
76
78
|
return (
|
|
77
79
|
<View
|
|
78
80
|
className={cn(
|
|
@@ -92,7 +94,7 @@ function TableFooter({
|
|
|
92
94
|
function TableRow({
|
|
93
95
|
className,
|
|
94
96
|
...props
|
|
95
|
-
}:
|
|
97
|
+
}: ViewProps & { className?: string } & React.RefAttributes<RNView>) {
|
|
96
98
|
return (
|
|
97
99
|
<View
|
|
98
100
|
className={cn('border-border flex-row border-b', className)}
|
|
@@ -60,12 +60,7 @@ const Text = React.forwardRef<
|
|
|
60
60
|
: cn('text-base text-foreground web:select-text', className);
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
|
-
<Component
|
|
64
|
-
className={finalClassName}
|
|
65
|
-
style={style}
|
|
66
|
-
ref={ref as any}
|
|
67
|
-
{...props}
|
|
68
|
-
/>
|
|
63
|
+
<Component className={finalClassName} style={style} ref={ref} {...props} />
|
|
69
64
|
);
|
|
70
65
|
});
|
|
71
66
|
Text.displayName = 'Text';
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { cn } from '../../lib/utils';
|
|
2
|
-
import
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
Platform,
|
|
5
|
+
TextInput as RNTextInput,
|
|
6
|
+
type TextInputProps,
|
|
7
|
+
} from 'react-native';
|
|
3
8
|
import { cssInterop } from 'nativewind';
|
|
4
9
|
|
|
5
|
-
cssInterop(
|
|
10
|
+
const TextInput = cssInterop(RNTextInput, {
|
|
11
|
+
className: 'style',
|
|
12
|
+
}) as React.ComponentType<any>;
|
|
6
13
|
|
|
7
14
|
/**
|
|
8
15
|
* Props for Textarea component
|
|
@@ -21,9 +28,13 @@ cssInterop(TextInput, { className: 'style' });
|
|
|
21
28
|
* />
|
|
22
29
|
* ```
|
|
23
30
|
*/
|
|
24
|
-
interface TextareaProps
|
|
31
|
+
interface TextareaProps
|
|
32
|
+
extends Omit<TextInputProps, 'multiline' | 'numberOfLines' | 'editable'> {
|
|
25
33
|
className?: string;
|
|
26
34
|
placeholderClassName?: string;
|
|
35
|
+
multiline?: boolean;
|
|
36
|
+
numberOfLines?: number;
|
|
37
|
+
editable?: boolean;
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
/**
|
|
@@ -68,7 +79,7 @@ function Textarea({
|
|
|
68
79
|
placeholderClassName,
|
|
69
80
|
editable = true,
|
|
70
81
|
...props
|
|
71
|
-
}: TextareaProps & React.RefAttributes<
|
|
82
|
+
}: TextareaProps & React.RefAttributes<RNTextInput>) {
|
|
72
83
|
return (
|
|
73
84
|
<TextInput
|
|
74
85
|
className={cn(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { View, Pressable } from 'react-native';
|
|
2
|
+
import { View as RNView, Pressable as RNPressable } from 'react-native';
|
|
3
3
|
import { cssInterop } from 'nativewind';
|
|
4
4
|
import { Moon, Sun, Monitor } from 'lucide-react-native';
|
|
5
5
|
import { cn } from '../../lib/utils';
|
|
@@ -8,8 +8,12 @@ import { Icon } from './Icon';
|
|
|
8
8
|
import { Text } from './Text';
|
|
9
9
|
import type { SlottableViewProps, ViewRef } from '@rn-primitives/types';
|
|
10
10
|
|
|
11
|
-
cssInterop(
|
|
12
|
-
|
|
11
|
+
const View = cssInterop(RNView, {
|
|
12
|
+
className: 'style',
|
|
13
|
+
}) as React.ComponentType<any>;
|
|
14
|
+
const Pressable = cssInterop(RNPressable, {
|
|
15
|
+
className: 'style',
|
|
16
|
+
}) as React.ComponentType<any>;
|
|
13
17
|
|
|
14
18
|
/**
|
|
15
19
|
* Theme toggle button variants
|
|
@@ -3,10 +3,12 @@ import { Text, TextClassContext } from './Text';
|
|
|
3
3
|
import { Icon } from './Icon';
|
|
4
4
|
import type { LucideIcon } from 'lucide-react-native';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { View, type ViewProps } from 'react-native';
|
|
6
|
+
import { View as RNView, type ViewProps } from 'react-native';
|
|
7
7
|
import { cssInterop } from 'nativewind';
|
|
8
8
|
|
|
9
|
-
cssInterop(
|
|
9
|
+
const View = cssInterop(RNView, {
|
|
10
|
+
className: 'style',
|
|
11
|
+
}) as React.ComponentType<any>;
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* Toast notification component
|
|
@@ -48,7 +50,8 @@ function Toast({
|
|
|
48
50
|
iconClassName,
|
|
49
51
|
...props
|
|
50
52
|
}: ViewProps &
|
|
51
|
-
React.RefAttributes<
|
|
53
|
+
React.RefAttributes<RNView> & {
|
|
54
|
+
children?: React.ReactNode;
|
|
52
55
|
icon?: LucideIcon;
|
|
53
56
|
variant?: 'default' | 'destructive';
|
|
54
57
|
iconClassName?: string;
|
package/src/index.tsx
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Properly typed Slot component wrappers
|
|
3
|
+
*
|
|
4
|
+
* The @rn-primitives/slot package has complex type inference that doesn't
|
|
5
|
+
* properly expose className props. These wrappers provide correct typing.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as SlotPrimitive from '@rn-primitives/slot';
|
|
9
|
+
import type {
|
|
10
|
+
PressableProps,
|
|
11
|
+
ViewProps,
|
|
12
|
+
TextProps,
|
|
13
|
+
TextInputProps,
|
|
14
|
+
} from 'react-native';
|
|
15
|
+
|
|
16
|
+
// Create properly typed versions of Slot components
|
|
17
|
+
export const SlotView = SlotPrimitive.View as React.ForwardRefExoticComponent<
|
|
18
|
+
ViewProps & {
|
|
19
|
+
className?: string;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
cssInterop?: boolean;
|
|
22
|
+
}
|
|
23
|
+
>;
|
|
24
|
+
|
|
25
|
+
export const SlotPressable =
|
|
26
|
+
SlotPrimitive.Pressable as React.ForwardRefExoticComponent<
|
|
27
|
+
PressableProps & {
|
|
28
|
+
className?: string;
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
cssInterop?: boolean;
|
|
31
|
+
}
|
|
32
|
+
>;
|
|
33
|
+
|
|
34
|
+
export const SlotText = SlotPrimitive.Text as React.ForwardRefExoticComponent<
|
|
35
|
+
TextProps & {
|
|
36
|
+
className?: string;
|
|
37
|
+
children?: React.ReactNode;
|
|
38
|
+
cssInterop?: boolean;
|
|
39
|
+
}
|
|
40
|
+
>;
|
|
41
|
+
|
|
42
|
+
export const SlotTextInput =
|
|
43
|
+
SlotPrimitive.TextInput as React.ForwardRefExoticComponent<
|
|
44
|
+
TextInputProps & {
|
|
45
|
+
className?: string;
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
cssInterop?: boolean;
|
|
48
|
+
}
|
|
49
|
+
>;
|
|
50
|
+
|
|
51
|
+
// Re-export Slot for cases where it's used directly
|
|
52
|
+
export const Slot = SlotPrimitive.Slot as React.ForwardRefExoticComponent<
|
|
53
|
+
ViewProps & {
|
|
54
|
+
className?: string;
|
|
55
|
+
children?: React.ReactNode;
|
|
56
|
+
}
|
|
57
|
+
>;
|