@react-native-reusables/cli 0.0.18 → 0.1.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 (139) hide show
  1. package/README.md +2 -37
  2. package/__generated/components/ui/accordion.tsx +30 -32
  3. package/__generated/components/ui/alert-dialog.tsx +19 -26
  4. package/__generated/components/ui/aspect-ratio.tsx +1 -1
  5. package/__generated/components/ui/avatar.tsx +31 -34
  6. package/__generated/components/ui/badge.tsx +2 -2
  7. package/__generated/components/ui/button.tsx +2 -5
  8. package/__generated/components/ui/card.tsx +39 -51
  9. package/__generated/components/ui/checkbox.tsx +25 -27
  10. package/__generated/components/ui/collapsible.tsx +1 -1
  11. package/__generated/components/ui/context-menu.tsx +28 -31
  12. package/__generated/components/ui/dialog.tsx +40 -43
  13. package/__generated/components/ui/dropdown-menu.tsx +27 -22
  14. package/__generated/components/ui/hover-card.tsx +3 -3
  15. package/__generated/components/ui/input.tsx +17 -18
  16. package/__generated/components/ui/label.tsx +21 -22
  17. package/__generated/components/ui/menubar.tsx +45 -47
  18. package/__generated/components/ui/navigation-menu.tsx +19 -17
  19. package/__generated/components/ui/popover.tsx +4 -4
  20. package/__generated/components/ui/progress.tsx +15 -11
  21. package/__generated/components/ui/radio-group.tsx +27 -29
  22. package/__generated/components/ui/select.tsx +55 -65
  23. package/__generated/components/ui/separator.tsx +16 -17
  24. package/__generated/components/ui/switch.tsx +59 -61
  25. package/__generated/components/ui/table.tsx +69 -76
  26. package/__generated/components/ui/tabs.tsx +49 -52
  27. package/__generated/components/ui/text.tsx +2 -2
  28. package/__generated/components/ui/textarea.tsx +20 -21
  29. package/__generated/components/ui/toggle-group.tsx +5 -7
  30. package/__generated/components/ui/toggle.tsx +4 -4
  31. package/__generated/components/ui/tooltip.tsx +4 -5
  32. package/__generated/components/ui/typography.tsx +2 -2
  33. package/dist/index.js +3 -3
  34. package/dist/index.js.map +1 -1
  35. package/package.json +2 -34
  36. package/__generated/components/primitives/accordion/accordion.tsx +0 -216
  37. package/__generated/components/primitives/accordion/accordion.web.tsx +0 -295
  38. package/__generated/components/primitives/accordion/index.ts +0 -1
  39. package/__generated/components/primitives/accordion/types.ts +0 -45
  40. package/__generated/components/primitives/alert-dialog/alert-dialog.tsx +0 -237
  41. package/__generated/components/primitives/alert-dialog/alert-dialog.web.tsx +0 -256
  42. package/__generated/components/primitives/alert-dialog/index.ts +0 -1
  43. package/__generated/components/primitives/alert-dialog/types.ts +0 -48
  44. package/__generated/components/primitives/aspect-ratio.tsx +0 -23
  45. package/__generated/components/primitives/avatar/index.tsx +0 -95
  46. package/__generated/components/primitives/avatar/types.ts +0 -10
  47. package/__generated/components/primitives/checkbox/checkbox.tsx +0 -101
  48. package/__generated/components/primitives/checkbox/checkbox.web.tsx +0 -114
  49. package/__generated/components/primitives/checkbox/index.ts +0 -1
  50. package/__generated/components/primitives/checkbox/types.ts +0 -11
  51. package/__generated/components/primitives/collapsible/collapsible.tsx +0 -119
  52. package/__generated/components/primitives/collapsible/collapsible.web.tsx +0 -157
  53. package/__generated/components/primitives/collapsible/index.ts +0 -1
  54. package/__generated/components/primitives/collapsible/types.ts +0 -18
  55. package/__generated/components/primitives/context-menu/context-menu.tsx +0 -648
  56. package/__generated/components/primitives/context-menu/context-menu.web.tsx +0 -533
  57. package/__generated/components/primitives/context-menu/index.ts +0 -1
  58. package/__generated/components/primitives/context-menu/types.ts +0 -90
  59. package/__generated/components/primitives/dialog/dialog.tsx +0 -211
  60. package/__generated/components/primitives/dialog/dialog.web.tsx +0 -197
  61. package/__generated/components/primitives/dialog/index.ts +0 -1
  62. package/__generated/components/primitives/dialog/types.ts +0 -60
  63. package/__generated/components/primitives/dropdown-menu/dropdown-menu.tsx +0 -608
  64. package/__generated/components/primitives/dropdown-menu/dropdown-menu.web.tsx +0 -550
  65. package/__generated/components/primitives/dropdown-menu/index.ts +0 -1
  66. package/__generated/components/primitives/dropdown-menu/types.ts +0 -72
  67. package/__generated/components/primitives/hooks/index.ts +0 -3
  68. package/__generated/components/primitives/hooks/useAugmentedRef.tsx +0 -29
  69. package/__generated/components/primitives/hooks/useControllableState.tsx +0 -75
  70. package/__generated/components/primitives/hooks/useRelativePosition.tsx +0 -227
  71. package/__generated/components/primitives/hover-card/hover-card.tsx +0 -279
  72. package/__generated/components/primitives/hover-card/hover-card.web.tsx +0 -150
  73. package/__generated/components/primitives/hover-card/index.ts +0 -1
  74. package/__generated/components/primitives/hover-card/types.ts +0 -51
  75. package/__generated/components/primitives/label/index.ts +0 -1
  76. package/__generated/components/primitives/label/label.tsx +0 -31
  77. package/__generated/components/primitives/label/label.web.tsx +0 -36
  78. package/__generated/components/primitives/label/types.ts +0 -15
  79. package/__generated/components/primitives/menubar/index.ts +0 -1
  80. package/__generated/components/primitives/menubar/menubar.tsx +0 -622
  81. package/__generated/components/primitives/menubar/menubar.web.tsx +0 -548
  82. package/__generated/components/primitives/menubar/types.ts +0 -77
  83. package/__generated/components/primitives/navigation-menu/index.ts +0 -1
  84. package/__generated/components/primitives/navigation-menu/navigation-menu.tsx +0 -315
  85. package/__generated/components/primitives/navigation-menu/navigation-menu.web.tsx +0 -264
  86. package/__generated/components/primitives/navigation-menu/types.ts +0 -49
  87. package/__generated/components/primitives/popover/index.ts +0 -1
  88. package/__generated/components/primitives/popover/popover.tsx +0 -290
  89. package/__generated/components/primitives/popover/popover.web.tsx +0 -191
  90. package/__generated/components/primitives/popover/types.ts +0 -24
  91. package/__generated/components/primitives/portal.tsx +0 -82
  92. package/__generated/components/primitives/progress/index.ts +0 -1
  93. package/__generated/components/primitives/progress/progress.tsx +0 -59
  94. package/__generated/components/primitives/progress/progress.web.tsx +0 -36
  95. package/__generated/components/primitives/progress/types.ts +0 -7
  96. package/__generated/components/primitives/radio-group/index.ts +0 -1
  97. package/__generated/components/primitives/radio-group/radio-group.tsx +0 -116
  98. package/__generated/components/primitives/radio-group/radio-group.web.tsx +0 -78
  99. package/__generated/components/primitives/radio-group/types.ts +0 -15
  100. package/__generated/components/primitives/select/index.ts +0 -1
  101. package/__generated/components/primitives/select/select.tsx +0 -466
  102. package/__generated/components/primitives/select/select.web.tsx +0 -332
  103. package/__generated/components/primitives/select/types.ts +0 -89
  104. package/__generated/components/primitives/separator/index.tsx +0 -23
  105. package/__generated/components/primitives/separator/types.ts +0 -6
  106. package/__generated/components/primitives/slider/index.ts +0 -1
  107. package/__generated/components/primitives/slider/slider.tsx +0 -89
  108. package/__generated/components/primitives/slider/slider.web.tsx +0 -67
  109. package/__generated/components/primitives/slider/types.ts +0 -24
  110. package/__generated/components/primitives/slot.tsx +0 -187
  111. package/__generated/components/primitives/switch/index.ts +0 -1
  112. package/__generated/components/primitives/switch/switch.tsx +0 -65
  113. package/__generated/components/primitives/switch/switch.web.tsx +0 -67
  114. package/__generated/components/primitives/switch/types.ts +0 -11
  115. package/__generated/components/primitives/table.tsx +0 -55
  116. package/__generated/components/primitives/tabs/index.ts +0 -1
  117. package/__generated/components/primitives/tabs/tabs.tsx +0 -133
  118. package/__generated/components/primitives/tabs/tabs.web.tsx +0 -97
  119. package/__generated/components/primitives/tabs/types.ts +0 -24
  120. package/__generated/components/primitives/toast/index.tsx +0 -128
  121. package/__generated/components/primitives/toast/types.ts +0 -7
  122. package/__generated/components/primitives/toggle/index.ts +0 -1
  123. package/__generated/components/primitives/toggle/toggle.tsx +0 -37
  124. package/__generated/components/primitives/toggle/toggle.web.tsx +0 -26
  125. package/__generated/components/primitives/toggle/types.ts +0 -7
  126. package/__generated/components/primitives/toggle-group/index.ts +0 -1
  127. package/__generated/components/primitives/toggle-group/toggle-group.tsx +0 -125
  128. package/__generated/components/primitives/toggle-group/toggle-group.web.tsx +0 -124
  129. package/__generated/components/primitives/toggle-group/types.ts +0 -37
  130. package/__generated/components/primitives/toolbar/index.ts +0 -1
  131. package/__generated/components/primitives/toolbar/toolbar.tsx +0 -125
  132. package/__generated/components/primitives/toolbar/toolbar.web.tsx +0 -129
  133. package/__generated/components/primitives/toolbar/types.ts +0 -39
  134. package/__generated/components/primitives/tooltip/index.ts +0 -1
  135. package/__generated/components/primitives/tooltip/tooltip.tsx +0 -277
  136. package/__generated/components/primitives/tooltip/tooltip.web.tsx +0 -181
  137. package/__generated/components/primitives/tooltip/types.ts +0 -42
  138. package/__generated/components/primitives/types.ts +0 -105
  139. package/__generated/components/primitives/utils.ts +0 -61
@@ -1,6 +1,14 @@
1
- import * as ContextMenuPrimitive from '@rnr/context-menu';
1
+ import * as ContextMenuPrimitive from '@rn-primitives/context-menu';
2
2
  import * as React from 'react';
3
- import { Platform, StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native';
3
+ import {
4
+ Platform,
5
+ type StyleProp,
6
+ StyleSheet,
7
+ Text,
8
+ type TextProps,
9
+ View,
10
+ type ViewStyle,
11
+ } from 'react-native';
4
12
  import { Check } from '../../lib/icons/Check';
5
13
  import { ChevronDown } from '../../lib/icons/ChevronDown';
6
14
  import { ChevronRight } from '../../lib/icons/ChevronRight';
@@ -9,20 +17,14 @@ import { cn } from '../../lib/utils';
9
17
  import { TextClassContext } from './text';
10
18
 
11
19
  const ContextMenu = ContextMenuPrimitive.Root;
12
-
13
20
  const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
14
-
15
21
  const ContextMenuGroup = ContextMenuPrimitive.Group;
16
-
17
- const ContextMenuPortal = ContextMenuPrimitive.Portal;
18
-
19
22
  const ContextMenuSub = ContextMenuPrimitive.Sub;
20
-
21
23
  const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
22
24
 
23
25
  const ContextMenuSubTrigger = React.forwardRef<
24
- React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
25
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {
26
+ ContextMenuPrimitive.SubTriggerRef,
27
+ ContextMenuPrimitive.SubTriggerProps & {
26
28
  inset?: boolean;
27
29
  }
28
30
  >(({ className, inset, children, ...props }, ref) => {
@@ -54,8 +56,8 @@ const ContextMenuSubTrigger = React.forwardRef<
54
56
  ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
55
57
 
56
58
  const ContextMenuSubContent = React.forwardRef<
57
- React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
58
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>
59
+ ContextMenuPrimitive.SubContentRef,
60
+ ContextMenuPrimitive.SubContentProps
59
61
  >(({ className, ...props }, ref) => {
60
62
  const { open } = ContextMenuPrimitive.useSubContext();
61
63
  return (
@@ -75,8 +77,8 @@ const ContextMenuSubContent = React.forwardRef<
75
77
  ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
76
78
 
77
79
  const ContextMenuContent = React.forwardRef<
78
- React.ElementRef<typeof ContextMenuPrimitive.Content>,
79
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content> & {
80
+ ContextMenuPrimitive.ContentRef,
81
+ ContextMenuPrimitive.ContentProps & {
80
82
  overlayStyle?: StyleProp<ViewStyle>;
81
83
  overlayClassName?: string;
82
84
  portalHost?: string;
@@ -116,8 +118,8 @@ const ContextMenuContent = React.forwardRef<
116
118
  ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
117
119
 
118
120
  const ContextMenuItem = React.forwardRef<
119
- React.ElementRef<typeof ContextMenuPrimitive.Item>,
120
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
121
+ ContextMenuPrimitive.ItemRef,
122
+ ContextMenuPrimitive.ItemProps & {
121
123
  inset?: boolean;
122
124
  }
123
125
  >(({ className, inset, ...props }, ref) => (
@@ -137,9 +139,9 @@ const ContextMenuItem = React.forwardRef<
137
139
  ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
138
140
 
139
141
  const ContextMenuCheckboxItem = React.forwardRef<
140
- React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
141
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>
142
- >(({ className, children, checked, ...props }, ref) => (
142
+ ContextMenuPrimitive.CheckboxItemRef,
143
+ ContextMenuPrimitive.CheckboxItemProps
144
+ >(({ className, children, ...props }, ref) => (
143
145
  <ContextMenuPrimitive.CheckboxItem
144
146
  ref={ref}
145
147
  className={cn(
@@ -147,7 +149,6 @@ const ContextMenuCheckboxItem = React.forwardRef<
147
149
  props.disabled && 'web:pointer-events-none opacity-50',
148
150
  className
149
151
  )}
150
- checked={checked}
151
152
  {...props}
152
153
  >
153
154
  <View className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
@@ -161,8 +162,8 @@ const ContextMenuCheckboxItem = React.forwardRef<
161
162
  ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
162
163
 
163
164
  const ContextMenuRadioItem = React.forwardRef<
164
- React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
165
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>
165
+ ContextMenuPrimitive.RadioItemRef,
166
+ ContextMenuPrimitive.RadioItemProps
166
167
  >(({ className, children, ...props }, ref) => (
167
168
  <ContextMenuPrimitive.RadioItem
168
169
  ref={ref}
@@ -184,8 +185,8 @@ const ContextMenuRadioItem = React.forwardRef<
184
185
  ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
185
186
 
186
187
  const ContextMenuLabel = React.forwardRef<
187
- React.ElementRef<typeof ContextMenuPrimitive.Label>,
188
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {
188
+ ContextMenuPrimitive.LabelRef,
189
+ ContextMenuPrimitive.LabelProps & {
189
190
  inset?: boolean;
190
191
  }
191
192
  >(({ className, inset, ...props }, ref) => (
@@ -202,8 +203,8 @@ const ContextMenuLabel = React.forwardRef<
202
203
  ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
203
204
 
204
205
  const ContextMenuSeparator = React.forwardRef<
205
- React.ElementRef<typeof ContextMenuPrimitive.Separator>,
206
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>
206
+ ContextMenuPrimitive.SeparatorRef,
207
+ ContextMenuPrimitive.SeparatorProps
207
208
  >(({ className, ...props }, ref) => (
208
209
  <ContextMenuPrimitive.Separator
209
210
  ref={ref}
@@ -213,10 +214,7 @@ const ContextMenuSeparator = React.forwardRef<
213
214
  ));
214
215
  ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
215
216
 
216
- const ContextMenuShortcut = ({
217
- className,
218
- ...props
219
- }: React.ComponentPropsWithoutRef<typeof Text>) => {
217
+ const ContextMenuShortcut = ({ className, ...props }: TextProps) => {
220
218
  return (
221
219
  <Text
222
220
  className={cn(
@@ -236,7 +234,6 @@ export {
236
234
  ContextMenuGroup,
237
235
  ContextMenuItem,
238
236
  ContextMenuLabel,
239
- ContextMenuPortal,
240
237
  ContextMenuRadioGroup,
241
238
  ContextMenuRadioItem,
242
239
  ContextMenuSeparator,
@@ -1,6 +1,6 @@
1
- import * as DialogPrimitive from '@rnr/dialog';
1
+ import * as DialogPrimitive from '@rn-primitives/dialog';
2
2
  import * as React from 'react';
3
- import { Platform, StyleSheet, View } from 'react-native';
3
+ import { Platform, StyleSheet, View, type ViewProps } from 'react-native';
4
4
  import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
5
5
  import { X } from '../../lib/icons/X';
6
6
  import { cn } from '../../lib/utils';
@@ -13,35 +13,33 @@ const DialogPortal = DialogPrimitive.Portal;
13
13
 
14
14
  const DialogClose = DialogPrimitive.Close;
15
15
 
16
- const DialogOverlayWeb = React.forwardRef<
17
- React.ElementRef<typeof DialogPrimitive.Overlay>,
18
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
19
- >(({ className, ...props }, ref) => {
20
- const { open } = DialogPrimitive.useRootContext();
21
- return (
22
- <DialogPrimitive.Overlay
23
- style={StyleSheet.absoluteFill}
24
- className={cn(
25
- 'z-50 bg-black/80 flex justify-center items-center p-2',
26
- open ? 'web:animate-in web:fade-in-0' : 'web:animate-out web:fade-out-0',
27
- className
28
- )}
29
- {...props}
30
- ref={ref}
31
- />
32
- );
33
- });
16
+ const DialogOverlayWeb = React.forwardRef<DialogPrimitive.OverlayRef, DialogPrimitive.OverlayProps>(
17
+ ({ className, ...props }, ref) => {
18
+ const { open } = DialogPrimitive.useRootContext();
19
+ return (
20
+ <DialogPrimitive.Overlay
21
+ className={cn(
22
+ 'bg-black/80 flex justify-center items-center p-2 absolute top-0 right-0 bottom-0 left-0',
23
+ open ? 'web:animate-in web:fade-in-0' : 'web:animate-out web:fade-out-0',
24
+ className
25
+ )}
26
+ {...props}
27
+ ref={ref}
28
+ />
29
+ );
30
+ }
31
+ );
34
32
 
35
33
  DialogOverlayWeb.displayName = 'DialogOverlayWeb';
36
34
 
37
35
  const DialogOverlayNative = React.forwardRef<
38
- React.ElementRef<typeof DialogPrimitive.Overlay>,
39
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
36
+ DialogPrimitive.OverlayRef,
37
+ DialogPrimitive.OverlayProps
40
38
  >(({ className, children, ...props }, ref) => {
41
39
  return (
42
40
  <DialogPrimitive.Overlay
43
41
  style={StyleSheet.absoluteFill}
44
- className={cn('z-50 flex bg-black/80 justify-center items-center p-2', className)}
42
+ className={cn('flex bg-black/80 justify-center items-center p-2', className)}
45
43
  {...props}
46
44
  ref={ref}
47
45
  >
@@ -60,8 +58,8 @@ const DialogOverlay = Platform.select({
60
58
  });
61
59
 
62
60
  const DialogContent = React.forwardRef<
63
- React.ElementRef<typeof DialogPrimitive.Content>,
64
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & { portalHost?: string }
61
+ DialogPrimitive.ContentRef,
62
+ DialogPrimitive.ContentProps & { portalHost?: string }
65
63
  >(({ className, children, portalHost, ...props }, ref) => {
66
64
  const { open } = DialogPrimitive.useRootContext();
67
65
  return (
@@ -70,7 +68,7 @@ const DialogContent = React.forwardRef<
70
68
  <DialogPrimitive.Content
71
69
  ref={ref}
72
70
  className={cn(
73
- 'z-50 max-w-lg gap-4 border border-border web:cursor-default bg-background p-6 shadow-lg web:duration-200 rounded-lg',
71
+ 'max-w-lg gap-4 border border-border web:cursor-default bg-background p-6 shadow-lg web:duration-200 rounded-lg',
74
72
  open
75
73
  ? 'web:animate-in web:fade-in-0 web:zoom-in-95'
76
74
  : 'web:animate-out web:fade-out-0 web:zoom-out-95',
@@ -96,12 +94,12 @@ const DialogContent = React.forwardRef<
96
94
  });
97
95
  DialogContent.displayName = DialogPrimitive.Content.displayName;
98
96
 
99
- const DialogHeader = ({ className, ...props }: React.ComponentPropsWithoutRef<typeof View>) => (
97
+ const DialogHeader = ({ className, ...props }: ViewProps) => (
100
98
  <View className={cn('flex flex-col gap-1.5 text-center sm:text-left', className)} {...props} />
101
99
  );
102
100
  DialogHeader.displayName = 'DialogHeader';
103
101
 
104
- const DialogFooter = ({ className, ...props }: React.ComponentPropsWithoutRef<typeof View>) => (
102
+ const DialogFooter = ({ className, ...props }: ViewProps) => (
105
103
  <View
106
104
  className={cn('flex flex-col-reverse sm:flex-row sm:justify-end gap-2', className)}
107
105
  {...props}
@@ -109,24 +107,23 @@ const DialogFooter = ({ className, ...props }: React.ComponentPropsWithoutRef<ty
109
107
  );
110
108
  DialogFooter.displayName = 'DialogFooter';
111
109
 
112
- const DialogTitle = React.forwardRef<
113
- React.ElementRef<typeof DialogPrimitive.Title>,
114
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
115
- >(({ className, ...props }, ref) => (
116
- <DialogPrimitive.Title
117
- ref={ref}
118
- className={cn(
119
- 'text-lg native:text-xl text-foreground font-semibold leading-none tracking-tight',
120
- className
121
- )}
122
- {...props}
123
- />
124
- ));
110
+ const DialogTitle = React.forwardRef<DialogPrimitive.TitleRef, DialogPrimitive.TitleProps>(
111
+ ({ className, ...props }, ref) => (
112
+ <DialogPrimitive.Title
113
+ ref={ref}
114
+ className={cn(
115
+ 'text-lg native:text-xl text-foreground font-semibold leading-none tracking-tight',
116
+ className
117
+ )}
118
+ {...props}
119
+ />
120
+ )
121
+ );
125
122
  DialogTitle.displayName = DialogPrimitive.Title.displayName;
126
123
 
127
124
  const DialogDescription = React.forwardRef<
128
- React.ElementRef<typeof DialogPrimitive.Description>,
129
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
125
+ DialogPrimitive.DescriptionRef,
126
+ DialogPrimitive.DescriptionProps
130
127
  >(({ className, ...props }, ref) => (
131
128
  <DialogPrimitive.Description
132
129
  ref={ref}
@@ -1,6 +1,14 @@
1
- import * as DropdownMenuPrimitive from '@rnr/dropdown-menu';
1
+ import * as DropdownMenuPrimitive from '@rn-primitives/dropdown-menu';
2
2
  import * as React from 'react';
3
- import { Platform, StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native';
3
+ import {
4
+ Platform,
5
+ type StyleProp,
6
+ StyleSheet,
7
+ Text,
8
+ type TextProps,
9
+ View,
10
+ type ViewStyle,
11
+ } from 'react-native';
4
12
  import { Check } from '../../lib/icons/Check';
5
13
  import { ChevronDown } from '../../lib/icons/ChevronDown';
6
14
  import { ChevronRight } from '../../lib/icons/ChevronRight';
@@ -21,8 +29,8 @@ const DropdownMenuSub = DropdownMenuPrimitive.Sub;
21
29
  const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
22
30
 
23
31
  const DropdownMenuSubTrigger = React.forwardRef<
24
- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
25
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
32
+ DropdownMenuPrimitive.SubTriggerRef,
33
+ DropdownMenuPrimitive.SubTriggerProps & {
26
34
  inset?: boolean;
27
35
  }
28
36
  >(({ className, inset, children, ...props }, ref) => {
@@ -54,8 +62,8 @@ const DropdownMenuSubTrigger = React.forwardRef<
54
62
  DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
55
63
 
56
64
  const DropdownMenuSubContent = React.forwardRef<
57
- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
58
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
65
+ DropdownMenuPrimitive.SubContentRef,
66
+ DropdownMenuPrimitive.SubContentProps
59
67
  >(({ className, ...props }, ref) => {
60
68
  const { open } = DropdownMenuPrimitive.useSubContext();
61
69
  return (
@@ -75,8 +83,8 @@ const DropdownMenuSubContent = React.forwardRef<
75
83
  DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
76
84
 
77
85
  const DropdownMenuContent = React.forwardRef<
78
- React.ElementRef<typeof DropdownMenuPrimitive.Content>,
79
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> & {
86
+ DropdownMenuPrimitive.ContentRef,
87
+ DropdownMenuPrimitive.ContentProps & {
80
88
  overlayStyle?: StyleProp<ViewStyle>;
81
89
  overlayClassName?: string;
82
90
  portalHost?: string;
@@ -116,8 +124,8 @@ const DropdownMenuContent = React.forwardRef<
116
124
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
117
125
 
118
126
  const DropdownMenuItem = React.forwardRef<
119
- React.ElementRef<typeof DropdownMenuPrimitive.Item>,
120
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
127
+ DropdownMenuPrimitive.ItemRef,
128
+ DropdownMenuPrimitive.ItemProps & {
121
129
  inset?: boolean;
122
130
  }
123
131
  >(({ className, inset, ...props }, ref) => (
@@ -137,8 +145,8 @@ const DropdownMenuItem = React.forwardRef<
137
145
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
138
146
 
139
147
  const DropdownMenuCheckboxItem = React.forwardRef<
140
- React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
141
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
148
+ DropdownMenuPrimitive.CheckboxItemRef,
149
+ DropdownMenuPrimitive.CheckboxItemProps
142
150
  >(({ className, children, checked, ...props }, ref) => (
143
151
  <DropdownMenuPrimitive.CheckboxItem
144
152
  ref={ref}
@@ -161,8 +169,8 @@ const DropdownMenuCheckboxItem = React.forwardRef<
161
169
  DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
162
170
 
163
171
  const DropdownMenuRadioItem = React.forwardRef<
164
- React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
165
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
172
+ DropdownMenuPrimitive.RadioItemRef,
173
+ DropdownMenuPrimitive.RadioItemProps
166
174
  >(({ className, children, ...props }, ref) => (
167
175
  <DropdownMenuPrimitive.RadioItem
168
176
  ref={ref}
@@ -184,8 +192,8 @@ const DropdownMenuRadioItem = React.forwardRef<
184
192
  DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
185
193
 
186
194
  const DropdownMenuLabel = React.forwardRef<
187
- React.ElementRef<typeof DropdownMenuPrimitive.Label>,
188
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
195
+ DropdownMenuPrimitive.LabelRef,
196
+ DropdownMenuPrimitive.LabelProps & {
189
197
  inset?: boolean;
190
198
  }
191
199
  >(({ className, inset, ...props }, ref) => (
@@ -202,8 +210,8 @@ const DropdownMenuLabel = React.forwardRef<
202
210
  DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
203
211
 
204
212
  const DropdownMenuSeparator = React.forwardRef<
205
- React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
206
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
213
+ DropdownMenuPrimitive.SeparatorRef,
214
+ DropdownMenuPrimitive.SeparatorProps
207
215
  >(({ className, ...props }, ref) => (
208
216
  <DropdownMenuPrimitive.Separator
209
217
  ref={ref}
@@ -213,10 +221,7 @@ const DropdownMenuSeparator = React.forwardRef<
213
221
  ));
214
222
  DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
215
223
 
216
- const DropdownMenuShortcut = ({
217
- className,
218
- ...props
219
- }: React.ComponentPropsWithoutRef<typeof Text>) => {
224
+ const DropdownMenuShortcut = ({ className, ...props }: TextProps) => {
220
225
  return (
221
226
  <Text
222
227
  className={cn(
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { Platform, StyleSheet } from 'react-native';
3
3
  import Animated, { FadeIn } from 'react-native-reanimated';
4
4
  import { TextClassContext } from './text';
5
- import * as HoverCardPrimitive from '@rnr/hover-card';
5
+ import * as HoverCardPrimitive from '@rn-primitives/hover-card';
6
6
  import { cn } from '../../lib/utils';
7
7
 
8
8
  const HoverCard = HoverCardPrimitive.Root;
@@ -10,8 +10,8 @@ const HoverCard = HoverCardPrimitive.Root;
10
10
  const HoverCardTrigger = HoverCardPrimitive.Trigger;
11
11
 
12
12
  const HoverCardContent = React.forwardRef<
13
- React.ElementRef<typeof HoverCardPrimitive.Content>,
14
- React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>
13
+ HoverCardPrimitive.ContentRef,
14
+ HoverCardPrimitive.ContentProps
15
15
  >(({ className, align = 'center', sideOffset = 4, ...props }, ref) => {
16
16
  const { open } = HoverCardPrimitive.useRootContext();
17
17
  return (
@@ -1,24 +1,23 @@
1
1
  import * as React from 'react';
2
- import { TextInput } from 'react-native';
2
+ import { TextInput, type TextInputProps } from 'react-native';
3
3
  import { cn } from '../../lib/utils';
4
4
 
5
- const Input = React.forwardRef<
6
- React.ElementRef<typeof TextInput>,
7
- React.ComponentPropsWithoutRef<typeof TextInput>
8
- >(({ className, placeholderClassName, ...props }, ref) => {
9
- return (
10
- <TextInput
11
- ref={ref}
12
- className={cn(
13
- 'web:flex h-10 native:h-12 web:w-full rounded-md border border-input bg-background px-3 web:py-2 text-base lg:text-sm native:text-lg native:leading-[1.25] text-foreground placeholder:text-muted-foreground web:ring-offset-background file:border-0 file:bg-transparent file:font-medium web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2',
14
- props.editable === false && 'opacity-50 web:cursor-not-allowed',
15
- className
16
- )}
17
- placeholderClassName={cn('text-muted-foreground', placeholderClassName)}
18
- {...props}
19
- />
20
- );
21
- });
5
+ const Input = React.forwardRef<React.ElementRef<typeof TextInput>, TextInputProps>(
6
+ ({ className, placeholderClassName, ...props }, ref) => {
7
+ return (
8
+ <TextInput
9
+ ref={ref}
10
+ className={cn(
11
+ 'web:flex h-10 native:h-12 web:w-full rounded-md border border-input bg-background px-3 web:py-2 text-base lg:text-sm native:text-lg native:leading-[1.25] text-foreground placeholder:text-muted-foreground web:ring-offset-background file:border-0 file:bg-transparent file:font-medium 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
+ {...props}
17
+ />
18
+ );
19
+ }
20
+ );
22
21
 
23
22
  Input.displayName = 'Input';
24
23
 
@@ -1,28 +1,27 @@
1
- import * as LabelPrimitive from '@rnr/label';
1
+ import * as LabelPrimitive from '@rn-primitives/label';
2
2
  import * as React from 'react';
3
3
  import { cn } from '../../lib/utils';
4
4
 
5
- const Label = React.forwardRef<
6
- React.ElementRef<typeof LabelPrimitive.Text>,
7
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Text>
8
- >(({ className, onPress, onLongPress, onPressIn, onPressOut, ...props }, ref) => (
9
- <LabelPrimitive.Root
10
- className='web:cursor-default'
11
- onPress={onPress}
12
- onLongPress={onLongPress}
13
- onPressIn={onPressIn}
14
- onPressOut={onPressOut}
15
- >
16
- <LabelPrimitive.Text
17
- ref={ref}
18
- className={cn(
19
- 'text-sm text-foreground native:text-base font-medium leading-none web:peer-disabled:cursor-not-allowed web:peer-disabled:opacity-70',
20
- className
21
- )}
22
- {...props}
23
- />
24
- </LabelPrimitive.Root>
25
- ));
5
+ const Label = React.forwardRef<LabelPrimitive.TextRef, LabelPrimitive.TextProps>(
6
+ ({ className, onPress, onLongPress, onPressIn, onPressOut, ...props }, ref) => (
7
+ <LabelPrimitive.Root
8
+ className='web:cursor-default'
9
+ onPress={onPress}
10
+ onLongPress={onLongPress}
11
+ onPressIn={onPressIn}
12
+ onPressOut={onPressOut}
13
+ >
14
+ <LabelPrimitive.Text
15
+ ref={ref}
16
+ className={cn(
17
+ 'text-sm text-foreground native:text-base font-medium leading-none web:peer-disabled:cursor-not-allowed web:peer-disabled:opacity-70',
18
+ className
19
+ )}
20
+ {...props}
21
+ />
22
+ </LabelPrimitive.Root>
23
+ )
24
+ );
26
25
  Label.displayName = LabelPrimitive.Root.displayName;
27
26
 
28
27
  export { Label };