@react-native-reusables/cli 0.4.0 → 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.
Files changed (42) hide show
  1. package/__generated/components/ui/accordion.tsx +53 -44
  2. package/__generated/components/ui/alert-dialog.tsx +96 -84
  3. package/__generated/components/ui/alert.tsx +33 -37
  4. package/__generated/components/ui/avatar.tsx +28 -22
  5. package/__generated/components/ui/badge.tsx +4 -3
  6. package/__generated/components/ui/button.tsx +18 -22
  7. package/__generated/components/ui/card.tsx +70 -43
  8. package/__generated/components/ui/checkbox.tsx +25 -24
  9. package/__generated/components/ui/context-menu.tsx +140 -121
  10. package/__generated/components/ui/dialog.tsx +74 -62
  11. package/__generated/components/ui/dropdown-menu.tsx +147 -126
  12. package/__generated/components/ui/hover-card.tsx +9 -7
  13. package/__generated/components/ui/input.tsx +19 -18
  14. package/__generated/components/ui/label.tsx +13 -6
  15. package/__generated/components/ui/menubar.tsx +164 -141
  16. package/__generated/components/ui/navigation-menu.tsx +68 -58
  17. package/__generated/components/ui/popover.tsx +11 -8
  18. package/__generated/components/ui/progress.tsx +10 -9
  19. package/__generated/components/ui/radio-group.tsx +29 -29
  20. package/__generated/components/ui/select.tsx +58 -40
  21. package/__generated/components/ui/separator.tsx +11 -6
  22. package/__generated/components/ui/switch.tsx +50 -47
  23. package/__generated/components/ui/table.tsx +66 -50
  24. package/__generated/components/ui/tabs.tsx +43 -36
  25. package/__generated/components/ui/text.tsx +17 -15
  26. package/__generated/components/ui/textarea.tsx +24 -21
  27. package/__generated/components/ui/toggle-group.tsx +32 -22
  28. package/__generated/components/ui/toggle.tsx +28 -23
  29. package/__generated/components/ui/tooltip.tsx +31 -26
  30. package/__generated/components/ui/typography.tsx +141 -198
  31. package/__generated/starter-base/app/_layout.tsx +24 -22
  32. package/__generated/starter-base/components/ThemeToggle.tsx +8 -16
  33. package/__generated/starter-base/components/ui/avatar.tsx +30 -28
  34. package/__generated/starter-base/components/ui/button.tsx +18 -25
  35. package/__generated/starter-base/components/ui/card.tsx +61 -36
  36. package/__generated/starter-base/components/ui/progress.tsx +11 -10
  37. package/__generated/starter-base/components/ui/text.tsx +17 -15
  38. package/__generated/starter-base/components/ui/tooltip.tsx +31 -26
  39. package/__generated/starter-base/package.json +1 -3
  40. package/dist/index.js +1 -1
  41. package/dist/index.js.map +1 -1
  42. 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
- const Text = React.forwardRef<TextRef, SlottableTextProps>(
10
- ({ className, asChild = false, ...props }, ref) => {
11
- const textClass = React.useContext(TextClassContext);
12
- const Component = asChild ? Slot.Text : RNText;
13
- return (
14
- <Component
15
- className={cn('text-base text-foreground web:select-text', textClass, className)}
16
- ref={ref}
17
- {...props}
18
- />
19
- );
20
- }
21
- );
22
- Text.displayName = 'Text';
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
- const Textarea = React.forwardRef<React.ElementRef<typeof TextInput>, TextInputProps>(
6
- ({ className, multiline = true, numberOfLines = 4, placeholderClassName, ...props }, ref) => {
7
- return (
8
- <TextInput
9
- ref={ref}
10
- className={cn(
11
- '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',
12
- props.editable === false && 'opacity-50 web:cursor-not-allowed',
13
- className
14
- )}
15
- placeholderClassName={cn('text-muted-foreground', placeholderClassName)}
16
- multiline={multiline}
17
- numberOfLines={numberOfLines}
18
- textAlignVertical='top'
19
- {...props}
20
- />
21
- );
22
- }
23
- );
24
-
25
- Textarea.displayName = 'Textarea';
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
- const ToggleGroup = React.forwardRef<
12
- ToggleGroupPrimitive.RootRef,
13
- ToggleGroupPrimitive.RootProps & VariantProps<typeof toggleVariants>
14
- >(({ className, variant, size, children, ...props }, ref) => (
15
- <ToggleGroupPrimitive.Root
16
- ref={ref}
17
- className={cn('flex flex-row items-center justify-center gap-1', className)}
18
- {...props}
19
- >
20
- <ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>
21
- </ToggleGroupPrimitive.Root>
22
- ));
23
-
24
- ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
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
- const ToggleGroupItem = React.forwardRef<
37
- ToggleGroupPrimitive.ItemRef,
38
- ToggleGroupPrimitive.ItemProps & VariantProps<typeof toggleVariants>
39
- >(({ className, children, variant, size, ...props }, ref) => {
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
- const Toggle = React.forwardRef<
49
- TogglePrimitive.RootRef,
50
- TogglePrimitive.RootProps & VariantProps<typeof toggleVariants>
51
- >(({ className, variant, size, ...props }, ref) => (
52
- <TextClassContext.Provider
53
- value={cn(
54
- toggleTextVariants({ variant, size }),
55
- props.pressed ? 'text-accent-foreground' : 'web:group-hover:text-muted-foreground',
56
- className
57
- )}
58
- >
59
- <TogglePrimitive.Root
60
- ref={ref}
61
- className={cn(
62
- toggleVariants({ variant, size }),
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
- {...props}
68
- />
69
- </TextClassContext.Provider>
70
- ));
71
-
72
- Toggle.displayName = TogglePrimitive.Root.displayName;
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
- const TooltipContent = React.forwardRef<
12
- TooltipPrimitive.ContentRef,
13
- TooltipPrimitive.ContentProps & { portalHost?: string }
14
- >(({ className, sideOffset = 4, portalHost, ...props }, ref) => (
15
- <TooltipPrimitive.Portal hostName={portalHost}>
16
- <TooltipPrimitive.Overlay style={Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined}>
17
- <Animated.View
18
- entering={Platform.select({ web: undefined, default: FadeIn })}
19
- exiting={Platform.select({ web: undefined, default: FadeOut })}
20
- >
21
- <TextClassContext.Provider value='text-sm native:text-base text-popover-foreground'>
22
- <TooltipPrimitive.Content
23
- ref={ref}
24
- sideOffset={sideOffset}
25
- className={cn(
26
- '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',
27
- className
28
- )}
29
- {...props}
30
- />
31
- </TextClassContext.Provider>
32
- </Animated.View>
33
- </TooltipPrimitive.Overlay>
34
- </TooltipPrimitive.Portal>
35
- ));
36
- TooltipContent.displayName = TooltipPrimitive.Content.displayName;
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
- const H1 = React.forwardRef<TextRef, SlottableTextProps>(
8
- ({ className, asChild = false, ...props }, ref) => {
9
- const Component = asChild ? Slot.Text : RNText;
10
- return (
11
- <Component
12
- role='heading'
13
- aria-level='1'
14
- className={cn(
15
- 'web:scroll-m-20 text-4xl text-foreground font-extrabold tracking-tight lg:text-5xl web:select-text',
16
- className
17
- )}
18
- ref={ref}
19
- {...props}
20
- />
21
- );
22
- }
23
- );
24
-
25
- H1.displayName = 'H1';
26
-
27
- const H2 = React.forwardRef<TextRef, SlottableTextProps>(
28
- ({ className, asChild = false, ...props }, ref) => {
29
- const Component = asChild ? Slot.Text : RNText;
30
- return (
31
- <Component
32
- role='heading'
33
- aria-level='2'
34
- className={cn(
35
- 'web:scroll-m-20 border-b border-border pb-2 text-3xl text-foreground font-semibold tracking-tight first:mt-0 web:select-text',
36
- className
37
- )}
38
- ref={ref}
39
- {...props}
40
- />
41
- );
42
- }
43
- );
44
-
45
- H2.displayName = 'H2';
46
-
47
- const H3 = React.forwardRef<TextRef, SlottableTextProps>(
48
- ({ className, asChild = false, ...props }, ref) => {
49
- const Component = asChild ? Slot.Text : RNText;
50
- return (
51
- <Component
52
- role='heading'
53
- aria-level='3'
54
- className={cn(
55
- 'web:scroll-m-20 text-2xl text-foreground font-semibold tracking-tight web:select-text',
56
- className
57
- )}
58
- ref={ref}
59
- {...props}
60
- />
61
- );
62
- }
63
- );
64
-
65
- H3.displayName = 'H3';
66
-
67
- const H4 = React.forwardRef<TextRef, SlottableTextProps>(
68
- ({ className, asChild = false, ...props }, ref) => {
69
- const Component = asChild ? Slot.Text : RNText;
70
- return (
71
- <Component
72
- role='heading'
73
- aria-level='4'
74
- className={cn(
75
- 'web:scroll-m-20 text-xl text-foreground font-semibold tracking-tight web:select-text',
76
- className
77
- )}
78
- ref={ref}
79
- {...props}
80
- />
81
- );
82
- }
83
- );
84
-
85
- H4.displayName = 'H4';
86
-
87
- const P = React.forwardRef<TextRef, SlottableTextProps>(
88
- ({ className, asChild = false, ...props }, ref) => {
89
- const Component = asChild ? Slot.Text : RNText;
90
- return (
91
- <Component
92
- className={cn('text-base text-foreground web:select-text', className)}
93
- ref={ref}
94
- {...props}
95
- />
96
- );
97
- }
98
- );
99
-
100
- P.displayName = 'P';
101
-
102
- const BlockQuote = React.forwardRef<TextRef, SlottableTextProps>(
103
- ({ className, asChild = false, ...props }, ref) => {
104
- const Component = asChild ? Slot.Text : RNText;
105
- return (
106
- <Component
107
- // @ts-ignore - role of blockquote renders blockquote element on the web
108
- role={Platform.OS === 'web' ? 'blockquote' : undefined}
109
- className={cn(
110
- 'mt-6 native:mt-4 border-l-2 border-border pl-6 native:pl-3 text-base text-foreground italic web:select-text',
111
- className
112
- )}
113
- ref={ref}
114
- {...props}
115
- />
116
- );
117
- }
118
- );
119
-
120
- BlockQuote.displayName = 'BlockQuote';
121
-
122
- const Code = React.forwardRef<TextRef, SlottableTextProps>(
123
- ({ className, asChild = false, ...props }, ref) => {
124
- const Component = asChild ? Slot.Text : RNText;
125
- return (
126
- <Component
127
- // @ts-ignore - role of code renders code element on the web
128
- role={Platform.OS === 'web' ? 'code' : undefined}
129
- className={cn(
130
- 'relative rounded-md bg-muted px-[0.3rem] py-[0.2rem] text-sm text-foreground font-semibold web:select-text',
131
- className
132
- )}
133
- ref={ref}
134
- {...props}
135
- />
136
- );
137
- }
138
- );
139
-
140
- Code.displayName = 'Code';
141
-
142
- const Lead = React.forwardRef<TextRef, SlottableTextProps>(
143
- ({ className, asChild = false, ...props }, ref) => {
144
- const Component = asChild ? Slot.Text : RNText;
145
- return (
146
- <Component
147
- className={cn('text-xl text-muted-foreground web:select-text', className)}
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 };