@react-native-reusables/cli 0.3.8 → 0.4.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.
- package/__generated/components/ui/accordion.tsx +53 -44
- package/__generated/components/ui/alert-dialog.tsx +96 -84
- package/__generated/components/ui/alert.tsx +33 -37
- package/__generated/components/ui/avatar.tsx +28 -22
- package/__generated/components/ui/badge.tsx +4 -3
- package/__generated/components/ui/button.tsx +18 -22
- package/__generated/components/ui/card.tsx +70 -43
- package/__generated/components/ui/checkbox.tsx +25 -24
- package/__generated/components/ui/context-menu.tsx +140 -121
- package/__generated/components/ui/dialog.tsx +74 -62
- package/__generated/components/ui/dropdown-menu.tsx +147 -126
- package/__generated/components/ui/hover-card.tsx +9 -7
- package/__generated/components/ui/input.tsx +19 -18
- package/__generated/components/ui/label.tsx +13 -6
- package/__generated/components/ui/menubar.tsx +164 -141
- package/__generated/components/ui/navigation-menu.tsx +68 -58
- package/__generated/components/ui/popover.tsx +11 -8
- package/__generated/components/ui/progress.tsx +10 -9
- package/__generated/components/ui/radio-group.tsx +29 -29
- package/__generated/components/ui/select.tsx +58 -40
- package/__generated/components/ui/separator.tsx +11 -6
- package/__generated/components/ui/switch.tsx +50 -47
- package/__generated/components/ui/table.tsx +66 -50
- package/__generated/components/ui/tabs.tsx +43 -36
- package/__generated/components/ui/text.tsx +17 -15
- package/__generated/components/ui/textarea.tsx +24 -21
- package/__generated/components/ui/toggle-group.tsx +32 -22
- package/__generated/components/ui/toggle.tsx +28 -23
- package/__generated/components/ui/tooltip.tsx +31 -26
- package/__generated/components/ui/typography.tsx +141 -198
- package/__generated/starter-base/app/_layout.tsx +24 -22
- package/__generated/starter-base/components/ThemeToggle.tsx +8 -16
- package/__generated/starter-base/components/ui/avatar.tsx +30 -28
- package/__generated/starter-base/components/ui/button.tsx +18 -25
- package/__generated/starter-base/components/ui/card.tsx +61 -36
- package/__generated/starter-base/components/ui/progress.tsx +11 -10
- package/__generated/starter-base/components/ui/text.tsx +17 -15
- package/__generated/starter-base/components/ui/tooltip.tsx +31 -26
- package/__generated/starter-base/package.json +10 -12
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import * as Slot from '@rn-primitives/slot';
|
|
2
|
-
import type { SlottableTextProps, TextRef } from '@rn-primitives/types';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { Text as RNText } from 'react-native';
|
|
5
4
|
import { cn } from '../../lib/utils';
|
|
6
5
|
|
|
7
6
|
const TextClassContext = React.createContext<string | undefined>(undefined);
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
)
|
|
22
|
-
|
|
8
|
+
function Text({
|
|
9
|
+
className,
|
|
10
|
+
asChild = false,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof RNText> & {
|
|
13
|
+
ref?: React.RefObject<RNText>;
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
}) {
|
|
16
|
+
const textClass = React.useContext(TextClassContext);
|
|
17
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
18
|
+
return (
|
|
19
|
+
<Component
|
|
20
|
+
className={cn('text-base text-foreground web:select-text', textClass, className)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
23
25
|
|
|
24
26
|
export { Text, TextClassContext };
|
|
@@ -2,26 +2,29 @@ import * as React from 'react';
|
|
|
2
2
|
import { TextInput, type TextInputProps } from 'react-native';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
function Textarea({
|
|
6
|
+
className,
|
|
7
|
+
multiline = true,
|
|
8
|
+
numberOfLines = 4,
|
|
9
|
+
placeholderClassName,
|
|
10
|
+
...props
|
|
11
|
+
}: TextInputProps & {
|
|
12
|
+
ref?: React.RefObject<TextInput>;
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<TextInput
|
|
16
|
+
className={cn(
|
|
17
|
+
'web:flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base lg:text-sm native:text-lg native:leading-[1.25] text-foreground web:ring-offset-background placeholder:text-muted-foreground web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2',
|
|
18
|
+
props.editable === false && 'opacity-50 web:cursor-not-allowed',
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
placeholderClassName={cn('text-muted-foreground', placeholderClassName)}
|
|
22
|
+
multiline={multiline}
|
|
23
|
+
numberOfLines={numberOfLines}
|
|
24
|
+
textAlignVertical='top'
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
26
29
|
|
|
27
30
|
export { Textarea };
|
|
@@ -8,20 +8,27 @@ import { cn } from '../../lib/utils';
|
|
|
8
8
|
|
|
9
9
|
const ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants> | null>(null);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
function ToggleGroup({
|
|
12
|
+
className,
|
|
13
|
+
variant,
|
|
14
|
+
size,
|
|
15
|
+
children,
|
|
16
|
+
...props
|
|
17
|
+
}: ToggleGroupPrimitive.RootProps &
|
|
18
|
+
VariantProps<typeof toggleVariants> & {
|
|
19
|
+
ref?: React.RefObject<ToggleGroupPrimitive.RootRef>;
|
|
20
|
+
}) {
|
|
21
|
+
return (
|
|
22
|
+
<ToggleGroupPrimitive.Root
|
|
23
|
+
className={cn('flex flex-row items-center justify-center gap-1', className)}
|
|
24
|
+
{...props}
|
|
25
|
+
>
|
|
26
|
+
<ToggleGroupContext.Provider value={{ variant, size }}>
|
|
27
|
+
{children}
|
|
28
|
+
</ToggleGroupContext.Provider>
|
|
29
|
+
</ToggleGroupPrimitive.Root>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
25
32
|
|
|
26
33
|
function useToggleGroupContext() {
|
|
27
34
|
const context = React.useContext(ToggleGroupContext);
|
|
@@ -33,10 +40,16 @@ function useToggleGroupContext() {
|
|
|
33
40
|
return context;
|
|
34
41
|
}
|
|
35
42
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
function ToggleGroupItem({
|
|
44
|
+
className,
|
|
45
|
+
children,
|
|
46
|
+
variant,
|
|
47
|
+
size,
|
|
48
|
+
...props
|
|
49
|
+
}: ToggleGroupPrimitive.ItemProps &
|
|
50
|
+
VariantProps<typeof toggleVariants> & {
|
|
51
|
+
ref?: React.RefObject<ToggleGroupPrimitive.ItemRef>;
|
|
52
|
+
}) {
|
|
40
53
|
const context = useToggleGroupContext();
|
|
41
54
|
const { value } = ToggleGroupPrimitive.useRootContext();
|
|
42
55
|
|
|
@@ -50,7 +63,6 @@ const ToggleGroupItem = React.forwardRef<
|
|
|
50
63
|
)}
|
|
51
64
|
>
|
|
52
65
|
<ToggleGroupPrimitive.Item
|
|
53
|
-
ref={ref}
|
|
54
66
|
className={cn(
|
|
55
67
|
toggleVariants({
|
|
56
68
|
variant: context.variant || variant,
|
|
@@ -66,9 +78,7 @@ const ToggleGroupItem = React.forwardRef<
|
|
|
66
78
|
</ToggleGroupPrimitive.Item>
|
|
67
79
|
</TextClassContext.Provider>
|
|
68
80
|
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
81
|
+
}
|
|
72
82
|
|
|
73
83
|
function ToggleGroupIcon({
|
|
74
84
|
className,
|
|
@@ -45,31 +45,36 @@ const toggleTextVariants = cva('text-sm native:text-base text-foreground font-me
|
|
|
45
45
|
},
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
props.disabled && 'web:pointer-events-none opacity-50',
|
|
64
|
-
props.pressed && 'bg-accent',
|
|
48
|
+
function Toggle({
|
|
49
|
+
className,
|
|
50
|
+
variant,
|
|
51
|
+
size,
|
|
52
|
+
...props
|
|
53
|
+
}: TogglePrimitive.RootProps &
|
|
54
|
+
VariantProps<typeof toggleVariants> &
|
|
55
|
+
VariantProps<typeof toggleVariants> & {
|
|
56
|
+
ref?: React.RefObject<TogglePrimitive.RootRef>;
|
|
57
|
+
}) {
|
|
58
|
+
return (
|
|
59
|
+
<TextClassContext.Provider
|
|
60
|
+
value={cn(
|
|
61
|
+
toggleTextVariants({ variant, size }),
|
|
62
|
+
props.pressed ? 'text-accent-foreground' : 'web:group-hover:text-muted-foreground',
|
|
65
63
|
className
|
|
66
64
|
)}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
>
|
|
66
|
+
<TogglePrimitive.Root
|
|
67
|
+
className={cn(
|
|
68
|
+
toggleVariants({ variant, size }),
|
|
69
|
+
props.disabled && 'web:pointer-events-none opacity-50',
|
|
70
|
+
props.pressed && 'bg-accent',
|
|
71
|
+
className
|
|
72
|
+
)}
|
|
73
|
+
{...props}
|
|
74
|
+
/>
|
|
75
|
+
</TextClassContext.Provider>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
73
78
|
|
|
74
79
|
function ToggleIcon({
|
|
75
80
|
className,
|
|
@@ -8,31 +8,36 @@ import { TextClassContext } from './text';
|
|
|
8
8
|
const Tooltip = TooltipPrimitive.Root;
|
|
9
9
|
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
function TooltipContent({
|
|
12
|
+
className,
|
|
13
|
+
sideOffset = 4,
|
|
14
|
+
portalHost,
|
|
15
|
+
...props
|
|
16
|
+
}: TooltipPrimitive.ContentProps & {
|
|
17
|
+
ref?: React.RefObject<TooltipPrimitive.ContentRef>;
|
|
18
|
+
portalHost?: string;
|
|
19
|
+
}) {
|
|
20
|
+
return (
|
|
21
|
+
<TooltipPrimitive.Portal hostName={portalHost}>
|
|
22
|
+
<TooltipPrimitive.Overlay style={Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined}>
|
|
23
|
+
<Animated.View
|
|
24
|
+
entering={Platform.select({ web: undefined, default: FadeIn })}
|
|
25
|
+
exiting={Platform.select({ web: undefined, default: FadeOut })}
|
|
26
|
+
>
|
|
27
|
+
<TextClassContext.Provider value='text-sm native:text-base text-popover-foreground'>
|
|
28
|
+
<TooltipPrimitive.Content
|
|
29
|
+
sideOffset={sideOffset}
|
|
30
|
+
className={cn(
|
|
31
|
+
'z-50 overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 shadow-md shadow-foreground/5 web:animate-in web:fade-in-0 web:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
</TextClassContext.Provider>
|
|
37
|
+
</Animated.View>
|
|
38
|
+
</TooltipPrimitive.Overlay>
|
|
39
|
+
</TooltipPrimitive.Portal>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
37
42
|
|
|
38
43
|
export { Tooltip, TooltipContent, TooltipTrigger };
|
|
@@ -1,205 +1,148 @@
|
|
|
1
1
|
import * as Slot from '@rn-primitives/slot';
|
|
2
|
-
import type { SlottableTextProps, TextRef } from '@rn-primitives/types';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { Platform, Text as RNText } from 'react-native';
|
|
5
4
|
import { cn } from '../../lib/utils';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
ref={ref}
|
|
149
|
-
{...props}
|
|
150
|
-
/>
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
Lead.displayName = 'Lead';
|
|
156
|
-
|
|
157
|
-
const Large = React.forwardRef<TextRef, SlottableTextProps>(
|
|
158
|
-
({ className, asChild = false, ...props }, ref) => {
|
|
159
|
-
const Component = asChild ? Slot.Text : RNText;
|
|
160
|
-
return (
|
|
161
|
-
<Component
|
|
162
|
-
className={cn('text-xl text-foreground font-semibold web:select-text', className)}
|
|
163
|
-
ref={ref}
|
|
164
|
-
{...props}
|
|
165
|
-
/>
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
|
|
170
|
-
Large.displayName = 'Large';
|
|
171
|
-
|
|
172
|
-
const Small = React.forwardRef<TextRef, SlottableTextProps>(
|
|
173
|
-
({ className, asChild = false, ...props }, ref) => {
|
|
174
|
-
const Component = asChild ? Slot.Text : RNText;
|
|
175
|
-
return (
|
|
176
|
-
<Component
|
|
177
|
-
className={cn(
|
|
178
|
-
'text-sm text-foreground font-medium leading-none web:select-text',
|
|
179
|
-
className
|
|
180
|
-
)}
|
|
181
|
-
ref={ref}
|
|
182
|
-
{...props}
|
|
183
|
-
/>
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
);
|
|
187
|
-
|
|
188
|
-
Small.displayName = 'Small';
|
|
189
|
-
|
|
190
|
-
const Muted = React.forwardRef<TextRef, SlottableTextProps>(
|
|
191
|
-
({ className, asChild = false, ...props }, ref) => {
|
|
192
|
-
const Component = asChild ? Slot.Text : RNText;
|
|
193
|
-
return (
|
|
194
|
-
<Component
|
|
195
|
-
className={cn('text-sm text-muted-foreground web:select-text', className)}
|
|
196
|
-
ref={ref}
|
|
197
|
-
{...props}
|
|
198
|
-
/>
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
);
|
|
202
|
-
|
|
203
|
-
Muted.displayName = 'Muted';
|
|
6
|
+
type TypographyProps = React.ComponentProps<typeof RNText> & {
|
|
7
|
+
ref?: React.RefObject<RNText>;
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
function H1({ className, asChild = false, ...props }: TypographyProps) {
|
|
12
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
13
|
+
return (
|
|
14
|
+
<Component
|
|
15
|
+
role='heading'
|
|
16
|
+
aria-level='1'
|
|
17
|
+
className={cn(
|
|
18
|
+
'web:scroll-m-20 text-4xl text-foreground font-extrabold tracking-tight lg:text-5xl web:select-text',
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function H2({ className, asChild = false, ...props }: TypographyProps) {
|
|
27
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
28
|
+
return (
|
|
29
|
+
<Component
|
|
30
|
+
role='heading'
|
|
31
|
+
aria-level='2'
|
|
32
|
+
className={cn(
|
|
33
|
+
'web:scroll-m-20 border-b border-border pb-2 text-3xl text-foreground font-semibold tracking-tight first:mt-0 web:select-text',
|
|
34
|
+
className
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function H3({ className, asChild = false, ...props }: TypographyProps) {
|
|
42
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
43
|
+
return (
|
|
44
|
+
<Component
|
|
45
|
+
role='heading'
|
|
46
|
+
aria-level='3'
|
|
47
|
+
className={cn(
|
|
48
|
+
'web:scroll-m-20 text-2xl text-foreground font-semibold tracking-tight web:select-text',
|
|
49
|
+
className
|
|
50
|
+
)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function H4({ className, asChild = false, ...props }: TypographyProps) {
|
|
57
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
58
|
+
return (
|
|
59
|
+
<Component
|
|
60
|
+
role='heading'
|
|
61
|
+
aria-level='4'
|
|
62
|
+
className={cn(
|
|
63
|
+
'web:scroll-m-20 text-xl text-foreground font-semibold tracking-tight web:select-text',
|
|
64
|
+
className
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function P({ className, asChild = false, ...props }: TypographyProps) {
|
|
72
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
73
|
+
return (
|
|
74
|
+
<Component className={cn('text-base text-foreground web:select-text', className)} {...props} />
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function BlockQuote({ className, asChild = false, ...props }: TypographyProps) {
|
|
79
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
80
|
+
return (
|
|
81
|
+
<Component
|
|
82
|
+
// @ts-ignore - role of blockquote renders blockquote element on the web
|
|
83
|
+
role={Platform.OS === 'web' ? 'blockquote' : undefined}
|
|
84
|
+
className={cn(
|
|
85
|
+
'mt-6 native:mt-4 border-l-2 border-border pl-6 native:pl-3 text-base text-foreground italic web:select-text',
|
|
86
|
+
className
|
|
87
|
+
)}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function Code({ className, asChild = false, ...props }: TypographyProps) {
|
|
94
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
95
|
+
return (
|
|
96
|
+
<Component
|
|
97
|
+
// @ts-ignore - role of code renders code element on the web
|
|
98
|
+
role={Platform.OS === 'web' ? 'code' : undefined}
|
|
99
|
+
className={cn(
|
|
100
|
+
'relative rounded-md bg-muted px-[0.3rem] py-[0.2rem] text-sm text-foreground font-semibold web:select-text',
|
|
101
|
+
className
|
|
102
|
+
)}
|
|
103
|
+
{...props}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function Lead({ className, asChild = false, ...props }: TypographyProps) {
|
|
109
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
110
|
+
return (
|
|
111
|
+
<Component
|
|
112
|
+
className={cn('text-xl text-muted-foreground web:select-text', className)}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function Large({ className, asChild = false, ...props }: TypographyProps) {
|
|
119
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
120
|
+
return (
|
|
121
|
+
<Component
|
|
122
|
+
className={cn('text-xl text-foreground font-semibold web:select-text', className)}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function Small({ className, asChild = false, ...props }: TypographyProps) {
|
|
129
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
130
|
+
return (
|
|
131
|
+
<Component
|
|
132
|
+
className={cn('text-sm text-foreground font-medium leading-none web:select-text', className)}
|
|
133
|
+
{...props}
|
|
134
|
+
/>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function Muted({ className, asChild = false, ...props }: TypographyProps) {
|
|
139
|
+
const Component = asChild ? Slot.Text : RNText;
|
|
140
|
+
return (
|
|
141
|
+
<Component
|
|
142
|
+
className={cn('text-sm text-muted-foreground web:select-text', className)}
|
|
143
|
+
{...props}
|
|
144
|
+
/>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
204
147
|
|
|
205
148
|
export { BlockQuote, Code, H1, H2, H3, H4, Large, Lead, Muted, P, Small };
|