@brand-map/primitives 0.0.0-broken.0 → 0.0.0-broken.2

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 (69) hide show
  1. package/package.json +2 -9
  2. package/src/accordion/accordion.tsx +17 -17
  3. package/src/accordion/accordion.web.tsx +13 -13
  4. package/src/alert-dialog/alert-dialog.tsx +28 -28
  5. package/src/alert-dialog/alert-dialog.web.tsx +18 -18
  6. package/src/alert-dialog/types.ts +3 -3
  7. package/src/aspect-ratio/aspect-ratio.tsx +3 -3
  8. package/src/avatar/avatar.tsx +10 -10
  9. package/src/avatar/types.ts +2 -2
  10. package/src/checkbox/checkbox.tsx +9 -9
  11. package/src/checkbox/checkbox.web.tsx +8 -8
  12. package/src/collapsible/collapsible.tsx +33 -35
  13. package/src/collapsible/collapsible.web.tsx +9 -9
  14. package/src/context-menu/context-menu.tsx +45 -45
  15. package/src/context-menu/context-menu.web.tsx +44 -44
  16. package/src/dialog/dialog.tsx +11 -11
  17. package/src/dialog/dialog.web.tsx +15 -15
  18. package/src/dialog/types.ts +5 -5
  19. package/src/dropdown-menu/dropdown-menu.tsx +43 -43
  20. package/src/dropdown-menu/dropdown-menu.web.tsx +45 -45
  21. package/src/hooks/use-Isomorphic-layout-effect.tsx +1 -2
  22. package/src/hooks/use-relative-position.tsx +2 -2
  23. package/src/hover-card/hover-card.tsx +40 -42
  24. package/src/hover-card/hover-card.web.tsx +9 -9
  25. package/src/label/label.tsx +3 -4
  26. package/src/label/label.web.tsx +5 -5
  27. package/src/menubar/menubar.tsx +45 -45
  28. package/src/menubar/menubar.web.tsx +47 -47
  29. package/src/navigation-menu/navigation-menu.tsx +23 -23
  30. package/src/navigation-menu/navigation-menu.web.tsx +26 -26
  31. package/src/popover/popover.tsx +20 -20
  32. package/src/popover/popover.web.tsx +14 -14
  33. package/src/progress/progress.tsx +4 -4
  34. package/src/progress/progress.web.tsx +5 -5
  35. package/src/radio-group/radio-group.tsx +11 -11
  36. package/src/radio-group/radio-group.web.tsx +9 -9
  37. package/src/render/index.ts +1 -0
  38. package/src/{slot/slot.tsx → render/render.tsx} +26 -27
  39. package/src/select/select.tsx +28 -28
  40. package/src/select/select.web.tsx +22 -22
  41. package/src/separator/separator.tsx +3 -3
  42. package/src/slider/slider.tsx +8 -8
  43. package/src/slider/slider.web.tsx +6 -6
  44. package/src/switch/switch.context.ts +16 -0
  45. package/src/switch/switch.tsx +68 -38
  46. package/src/switch/switch.web.tsx +9 -9
  47. package/src/switch/types.ts +27 -6
  48. package/src/table/table.tsx +9 -9
  49. package/src/tabs/tabs.tsx +13 -13
  50. package/src/tabs/tabs.web.tsx +10 -10
  51. package/src/toast/toast.tsx +14 -14
  52. package/src/toggle/toggle.tsx +5 -5
  53. package/src/toggle/toggle.web.tsx +5 -5
  54. package/src/toggle-group/toggle-group.tsx +11 -11
  55. package/src/toggle-group/toggle-group.web.tsx +10 -10
  56. package/src/toolbar/toolbar.tsx +12 -12
  57. package/src/toolbar/toolbar.web.tsx +12 -12
  58. package/src/tooltip/tooltip.tsx +17 -17
  59. package/src/tooltip/tooltip.web.tsx +11 -11
  60. package/src/types/index.ts +5 -15
  61. package/tsconfig.json +1 -0
  62. package/.changeset/README.md +0 -8
  63. package/.changeset/config.json +0 -11
  64. package/.oxfmtrc.json +0 -35
  65. package/.oxlintrc.json +0 -166
  66. package/README.md +0 -78
  67. package/bun.lock +0 -904
  68. package/mise.toml +0 -3
  69. package/src/slot/index.ts +0 -1
@@ -1,9 +1,9 @@
1
- import * as React from "react";
1
+ import { createContext, forwardRef, useId, useState, useContext, useEffect } from "react";
2
2
  import { BackHandler, Pressable, Text, View, type GestureResponderEvent, type LayoutChangeEvent, type LayoutRectangle } from "react-native";
3
3
 
4
4
  import { useAugmentedRef, useControllableState, useRelativePosition, type LayoutPosition } from "../hooks";
5
5
  import { Portal as RNPPortal } from "../portal";
6
- import * as Slot from "../slot";
6
+ import * as Render from "../render";
7
7
 
8
8
  import type {
9
9
  CheckboxItemProps,
@@ -49,13 +49,13 @@ interface RootContextInterface {
49
49
  nativeID: string;
50
50
  }
51
51
 
52
- const RootContext = React.createContext<RootContextInterface | null>(null);
52
+ const RootContext = createContext<RootContextInterface | null>(null);
53
53
 
54
- const Root = React.forwardRef<RootRef, RootProps>(({ onOpenChange: onOpenChangeProp, ...viewProps }, ref) => {
55
- const nativeID = React.useId();
56
- const [triggerPosition, setTriggerPosition] = React.useState<LayoutPosition | null>(null);
57
- const [contentLayout, setContentLayout] = React.useState<LayoutRectangle | null>(null);
58
- const [open, setOpen] = React.useState(false);
54
+ const Root = forwardRef<RootRef, RootProps>(({ onOpenChange: onOpenChangeProp, ...viewProps }, ref) => {
55
+ const nativeID = useId();
56
+ const [triggerPosition, setTriggerPosition] = useState<LayoutPosition | null>(null);
57
+ const [contentLayout, setContentLayout] = useState<LayoutRectangle | null>(null);
58
+ const [open, setOpen] = useState(false);
59
59
 
60
60
  function onOpenChange(open: boolean) {
61
61
  setOpen(open);
@@ -85,14 +85,14 @@ const Root = React.forwardRef<RootRef, RootProps>(({ onOpenChange: onOpenChangeP
85
85
  Root.displayName = "RootNativeDropdownMenu";
86
86
 
87
87
  function useRootContext() {
88
- const context = React.useContext(RootContext);
88
+ const context = useContext(RootContext);
89
89
  if (!context) {
90
90
  throw new Error("DropdownMenu compound components cannot be rendered outside the DropdownMenu component");
91
91
  }
92
92
  return context;
93
93
  }
94
94
 
95
- const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, disabled = false, ...props }, ref) => {
95
+ const Trigger = forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, disabled = false, ...props }, ref) => {
96
96
  const { open, onOpenChange, setTriggerPosition } = useRootContext();
97
97
 
98
98
  const augmentedRef = useAugmentedRef({
@@ -111,14 +111,14 @@ const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressPr
111
111
  },
112
112
  });
113
113
 
114
- function onPress(ev: GestureResponderEvent) {
114
+ function onPress(event: GestureResponderEvent) {
115
115
  if (disabled) return;
116
116
  augmentedRef.current?.measure((_x, _y, width, height, pageX, pageY) => {
117
117
  setTriggerPosition({ width, pageX, pageY: pageY, height });
118
118
  });
119
119
  const newValue = !open;
120
120
  onOpenChange(newValue);
121
- onPressProp?.(ev);
121
+ onPressProp?.(event);
122
122
  }
123
123
 
124
124
  return (
@@ -162,16 +162,16 @@ function Portal({ keepMounted, hostName, children }: PortalProps) {
162
162
  );
163
163
  }
164
164
 
165
- const Backdrop = React.forwardRef<BackdropRef, BackdropProps>(({ keepMounted, onPress: OnPressProp, closeOnPress = true, ...props }, ref) => {
165
+ const Backdrop = forwardRef<BackdropRef, BackdropProps>(({ keepMounted, onPress: onPressProp, closeOnPress = true, ...props }, ref) => {
166
166
  const { open, onOpenChange, setContentLayout, setTriggerPosition } = useRootContext();
167
167
 
168
- function onPress(ev: GestureResponderEvent) {
168
+ function onPress(event: GestureResponderEvent) {
169
169
  if (closeOnPress) {
170
170
  setTriggerPosition(null);
171
171
  setContentLayout(null);
172
172
  onOpenChange(false);
173
173
  }
174
- OnPressProp?.(ev);
174
+ onPressProp?.(event);
175
175
  }
176
176
 
177
177
  if (!keepMounted) {
@@ -194,7 +194,7 @@ Backdrop.displayName = "BackdropNativeDropdownMenu";
194
194
  /**
195
195
  * @info `position`, `top`, `left`, and `maxWidth` style properties are controlled internally. Opt out of this behavior by setting `disablePositioningStyle` to `true`.
196
196
  */
197
- const Content = React.forwardRef<ContentRef, ContentProps>(
197
+ const Content = forwardRef<ContentRef, ContentProps>(
198
198
  (
199
199
  {
200
200
  render = false,
@@ -214,7 +214,7 @@ const Content = React.forwardRef<ContentRef, ContentProps>(
214
214
  ) => {
215
215
  const { open, onOpenChange, nativeID, triggerPosition, setTriggerPosition, contentLayout, setContentLayout } = useRootContext();
216
216
 
217
- React.useEffect(() => {
217
+ useEffect(() => {
218
218
  const backHandler = BackHandler.addEventListener("hardwareBackPress", () => {
219
219
  setTriggerPosition(null);
220
220
  setContentLayout(null);
@@ -267,16 +267,16 @@ const Content = React.forwardRef<ContentRef, ContentProps>(
267
267
 
268
268
  Content.displayName = "ContentNativeDropdownMenu";
269
269
 
270
- const Item = React.forwardRef<ItemRef, ItemProps>(({ textValue, onPress: onPressProp, disabled = false, closeOnPress = true, ...props }, ref) => {
270
+ const Item = forwardRef<ItemRef, ItemProps>(({ textValue, onPress: onPressProp, disabled = false, closeOnPress = true, ...props }, ref) => {
271
271
  const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext();
272
272
 
273
- function onPress(ev: GestureResponderEvent) {
273
+ function onPress(event: GestureResponderEvent) {
274
274
  if (closeOnPress) {
275
275
  setTriggerPosition(null);
276
276
  setContentLayout(null);
277
277
  onOpenChange(false);
278
278
  }
279
- onPressProp?.(ev);
279
+ onPressProp?.(event);
280
280
  }
281
281
 
282
282
  return (
@@ -295,7 +295,7 @@ const Item = React.forwardRef<ItemRef, ItemProps>(({ textValue, onPress: onPress
295
295
 
296
296
  Item.displayName = "ItemNativeDropdownMenu";
297
297
 
298
- const Group = React.forwardRef<GroupRef, GroupProps>(({ ...props }, ref) => {
298
+ const Group = forwardRef<GroupRef, GroupProps>(({ ...props }, ref) => {
299
299
  return (
300
300
  <Component
301
301
  ref={ref}
@@ -307,7 +307,7 @@ const Group = React.forwardRef<GroupRef, GroupProps>(({ ...props }, ref) => {
307
307
 
308
308
  Group.displayName = "GroupNativeDropdownMenu";
309
309
 
310
- const Label = React.forwardRef<LabelRef, LabelProps>(({ ...props }, ref) => {
310
+ const Label = forwardRef<LabelRef, LabelProps>(({ ...props }, ref) => {
311
311
  return (
312
312
  <Component
313
313
  ref={ref}
@@ -325,20 +325,20 @@ type FormItemContext =
325
325
  onValueChange: (value: string) => void;
326
326
  };
327
327
 
328
- const FormItemContext = React.createContext<FormItemContext | null>(null);
328
+ const FormItemContext = createContext<FormItemContext | null>(null);
329
329
 
330
- const CheckboxItem = React.forwardRef<CheckboxItemRef, CheckboxItemProps>(
330
+ const CheckboxItem = forwardRef<CheckboxItemRef, CheckboxItemProps>(
331
331
  ({ render, checked, onCheckedChange, textValue, onPress: onPressProp, closeOnPress = true, disabled = false, ...props }, ref) => {
332
332
  const { onOpenChange, setContentLayout, setTriggerPosition } = useRootContext();
333
333
 
334
- function onPress(ev: GestureResponderEvent) {
334
+ function onPress(event: GestureResponderEvent) {
335
335
  onCheckedChange(!checked);
336
336
  if (closeOnPress) {
337
337
  setTriggerPosition(null);
338
338
  setContentLayout(null);
339
339
  onOpenChange(false);
340
340
  }
341
- onPressProp?.(ev);
341
+ onPressProp?.(event);
342
342
  }
343
343
 
344
344
  return (
@@ -362,14 +362,14 @@ const CheckboxItem = React.forwardRef<CheckboxItemRef, CheckboxItemProps>(
362
362
  CheckboxItem.displayName = "CheckboxItemNativeDropdownMenu";
363
363
 
364
364
  function useFormItemContext() {
365
- const context = React.useContext(FormItemContext);
365
+ const context = useContext(FormItemContext);
366
366
  if (!context) {
367
367
  throw new Error("CheckboxItem or RadioItem compound components cannot be rendered outside of a CheckboxItem or RadioItem component");
368
368
  }
369
369
  return context;
370
370
  }
371
371
 
372
- const RadioGroup = React.forwardRef<RadioGroupRef, RadioGroupProps>(({ value, onValueChange, ...props }, ref) => {
372
+ const RadioGroup = forwardRef<RadioGroupRef, RadioGroupProps>(({ value, onValueChange, ...props }, ref) => {
373
373
  return (
374
374
  <FormItemContext.Provider value={{ value, onValueChange }}>
375
375
  <Component
@@ -387,21 +387,21 @@ type BothFormItemContext = Exclude<FormItemContext, { checked: boolean }> & {
387
387
  checked: boolean;
388
388
  };
389
389
 
390
- const RadioItemContext = React.createContext({} as { itemValue: string });
390
+ const RadioItemContext = createContext({} as { itemValue: string });
391
391
 
392
- const RadioItem = React.forwardRef<RadioItemRef, RadioItemProps>(
392
+ const RadioItem = forwardRef<RadioItemRef, RadioItemProps>(
393
393
  ({ render, value: itemValue, textValue, onPress: onPressProp, disabled = false, closeOnPress = true, ...props }, ref) => {
394
394
  const { onOpenChange, setContentLayout, setTriggerPosition } = useRootContext();
395
395
 
396
396
  const { value, onValueChange } = useFormItemContext() as BothFormItemContext;
397
- function onPress(ev: GestureResponderEvent) {
397
+ function onPress(event: GestureResponderEvent) {
398
398
  onValueChange(itemValue);
399
399
  if (closeOnPress) {
400
400
  setTriggerPosition(null);
401
401
  setContentLayout(null);
402
402
  onOpenChange(false);
403
403
  }
404
- onPressProp?.(ev);
404
+ onPressProp?.(event);
405
405
  }
406
406
 
407
407
  return (
@@ -427,10 +427,10 @@ const RadioItem = React.forwardRef<RadioItemRef, RadioItemProps>(
427
427
  RadioItem.displayName = "RadioItemNativeDropdownMenu";
428
428
 
429
429
  function useItemIndicatorContext() {
430
- return React.useContext(RadioItemContext);
430
+ return useContext(RadioItemContext);
431
431
  }
432
432
 
433
- const ItemIndicator = React.forwardRef<ItemIndicatorRef, ItemIndicatorProps>(({ keepMounted, ...props }, ref) => {
433
+ const ItemIndicator = forwardRef<ItemIndicatorRef, ItemIndicatorProps>(({ keepMounted, ...props }, ref) => {
434
434
  const { itemValue } = useItemIndicatorContext();
435
435
  const { checked, value } = useFormItemContext() as BothFormItemContext;
436
436
 
@@ -454,7 +454,7 @@ const ItemIndicator = React.forwardRef<ItemIndicatorRef, ItemIndicatorProps>(({
454
454
 
455
455
  ItemIndicator.displayName = "ItemIndicatorNativeDropdownMenu";
456
456
 
457
- const Separator = React.forwardRef<SeparatorRef, SeparatorProps>(({ decorative, ...props }, ref) => {
457
+ const Separator = forwardRef<SeparatorRef, SeparatorProps>(({ decorative, ...props }, ref) => {
458
458
  return (
459
459
  <Component
460
460
  role={decorative ? "presentation" : "separator"}
@@ -466,14 +466,14 @@ const Separator = React.forwardRef<SeparatorRef, SeparatorProps>(({ decorative,
466
466
 
467
467
  Separator.displayName = "SeparatorNativeDropdownMenu";
468
468
 
469
- const SubContext = React.createContext<{
469
+ const SubContext = createContext<{
470
470
  nativeID: string;
471
471
  open: boolean;
472
472
  onOpenChange: (value: boolean) => void;
473
473
  } | null>(null);
474
474
 
475
- const Sub = React.forwardRef<SubRef, SubProps>(({ defaultOpen, open: openProp, onOpenChange: onOpenChangeProp, ...props }, ref) => {
476
- const nativeID = React.useId();
475
+ const Sub = forwardRef<SubRef, SubProps>(({ defaultOpen, open: openProp, onOpenChange: onOpenChangeProp, ...props }, ref) => {
476
+ const nativeID = useId();
477
477
  const [open = false, onOpenChange] = useControllableState({
478
478
  prop: openProp,
479
479
  defaultProp: defaultOpen,
@@ -499,19 +499,19 @@ const Sub = React.forwardRef<SubRef, SubProps>(({ defaultOpen, open: openProp, o
499
499
  Sub.displayName = "SubNativeDropdownMenu";
500
500
 
501
501
  function useSubContext() {
502
- const context = React.useContext(SubContext);
502
+ const context = useContext(SubContext);
503
503
  if (!context) {
504
504
  throw new Error("Sub compound components cannot be rendered outside of a Sub component");
505
505
  }
506
506
  return context;
507
507
  }
508
508
 
509
- const SubTrigger = React.forwardRef<SubTriggerRef, SubTriggerProps>(({ textValue, onPress: onPressProp, disabled = false, ...props }, ref) => {
509
+ const SubTrigger = forwardRef<SubTriggerRef, SubTriggerProps>(({ textValue, onPress: onPressProp, disabled = false, ...props }, ref) => {
510
510
  const { nativeID, open, onOpenChange } = useSubContext();
511
511
 
512
- function onPress(ev: GestureResponderEvent) {
512
+ function onPress(event: GestureResponderEvent) {
513
513
  onOpenChange(!open);
514
- onPressProp?.(ev);
514
+ onPressProp?.(event);
515
515
  }
516
516
 
517
517
  return (
@@ -532,7 +532,7 @@ const SubTrigger = React.forwardRef<SubTriggerRef, SubTriggerProps>(({ textValue
532
532
 
533
533
  SubTrigger.displayName = "SubTriggerNativeDropdownMenu";
534
534
 
535
- const SubContent = React.forwardRef<SubContentRef, SubContentProps>(({ render = false, keepMounted, ...props }, ref) => {
535
+ const SubContent = forwardRef<SubContentRef, SubContentProps>(({ render = false, keepMounted, ...props }, ref) => {
536
536
  const { open, nativeID } = useSubContext();
537
537
 
538
538
  if (!keepMounted) {
@@ -1,9 +1,9 @@
1
1
  // import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
2
- // import * as React from "react";
2
+ //
3
3
  // import { GestureResponderEvent, Pressable, Text, View } from "react-native";
4
4
 
5
5
  // import { useAugmentedRef, useControllableState, useIsomorphicLayoutEffect } from "../hooks";
6
- // import * as Slot from "../slot";
6
+ // import * as Render from "../render";
7
7
  // import { EmptyGestureResponderEvent } from "../utils";
8
8
 
9
9
  // import type {
@@ -40,13 +40,13 @@
40
40
  // TriggerRef,
41
41
  // } from "./types";
42
42
 
43
- // const DropdownMenuContext = React.createContext<{
43
+ // const DropdownMenuContext = createContext<{
44
44
  // open: boolean;
45
45
  // onOpenChange: (open: boolean) => void;
46
46
  // } | null>(null);
47
47
 
48
- // const Root = React.forwardRef<RootRef, RootProps>(({ onOpenChange: onOpenChangeProp, ...viewProps }, ref) => {
49
- // const [open, setOpen] = React.useState(false);
48
+ // const Root = forwardRef<RootRef, RootProps>(({ onOpenChange: onOpenChangeProp, ...viewProps }, ref) => {
49
+ // const [open, setOpen] = useState(false);
50
50
 
51
51
  // function onOpenChange(open: boolean) {
52
52
  // setOpen(open);
@@ -72,14 +72,14 @@
72
72
  // Root.displayName = "RootWebDropdownMenu";
73
73
 
74
74
  // function useRootContext() {
75
- // const context = React.useContext(DropdownMenuContext);
75
+ // const context = useContext(DropdownMenuContext);
76
76
  // if (!context) {
77
77
  // throw new Error("DropdownMenu compound components cannot be rendered outside the DropdownMenu component");
78
78
  // }
79
79
  // return context;
80
80
  // }
81
81
 
82
- // const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ disabled = false, ...props }, ref) => {
82
+ // const Trigger = forwardRef<TriggerRef, TriggerProps>(({ disabled = false, ...props }, ref) => {
83
83
  // const { open, onOpenChange } = useRootContext();
84
84
  // const augmentedRef = useAugmentedRef({
85
85
  // ref,
@@ -137,7 +137,7 @@
137
137
  // );
138
138
  // }
139
139
 
140
- // const Backdrop = React.forwardRef<BackdropRef, BackdropProps>(({ ...props }, ref) => {
140
+ // const Backdrop = forwardRef<BackdropRef, BackdropProps>(({ ...props }, ref) => {
141
141
  //
142
142
  // return (
143
143
  // <Component
@@ -149,11 +149,11 @@
149
149
 
150
150
  // Backdrop.displayName = "BackdropWebDropdownMenu";
151
151
 
152
- // const DropdownMenuContentContext = React.createContext<{
152
+ // const DropdownMenuContentContext = createContext<{
153
153
  // close: () => void;
154
154
  // } | null>(null);
155
155
 
156
- // const Content = React.forwardRef<ContentRef, ContentProps>(
156
+ // const Content = forwardRef<ContentRef, ContentProps>(
157
157
  // (
158
158
  // {
159
159
  // render = false,
@@ -224,20 +224,20 @@
224
224
  // Content.displayName = "ContentWebDropdownMenu";
225
225
 
226
226
  // function useDropdownMenuContentContext() {
227
- // const context = React.useContext(DropdownMenuContentContext);
227
+ // const context = useContext(DropdownMenuContentContext);
228
228
  // if (!context) {
229
229
  // throw new Error("DropdownMenu compound components cannot be rendered outside the DropdownMenu component");
230
230
  // }
231
231
  // return context;
232
232
  // }
233
233
 
234
- // const Item = React.forwardRef<ItemRef, ItemProps>(
234
+ // const Item = forwardRef<ItemRef, ItemProps>(
235
235
  // ({ render, textValue, closeOnPress = true, onPress: onPressProp, onKeyDown: onKeyDownProp, ...props }, ref) => {
236
236
  // const { close } = useDropdownMenuContentContext();
237
237
 
238
- // function onKeyDown(ev: React.KeyboardEvent) {
239
- // onKeyDownProp?.(ev);
240
- // if (ev.key === "Enter" || ev.key === " ") {
238
+ // function onKeyDown(event: React.KeyboardEvent) {
239
+ // onKeyDownProp?.(event);
240
+ // if (event.key === "Enter" || event.key === " ") {
241
241
  // onPressProp?.(EmptyGestureResponderEvent);
242
242
  // if (closeOnPress) {
243
243
  // close();
@@ -245,8 +245,8 @@
245
245
  // }
246
246
  // }
247
247
 
248
- // function onPress(ev: GestureResponderEvent) {
249
- // onPressProp?.(ev);
248
+ // function onPress(event: GestureResponderEvent) {
249
+ // onPressProp?.(event);
250
250
  // if (closeOnPress) {
251
251
  // close();
252
252
  // }
@@ -274,7 +274,7 @@
274
274
 
275
275
  // Item.displayName = "ItemWebDropdownMenu";
276
276
 
277
- // const Group = React.forwardRef<GroupRef, GroupProps>(({ ...props }, ref) => {
277
+ // const Group = forwardRef<GroupRef, GroupProps>(({ ...props }, ref) => {
278
278
  //
279
279
  // return (
280
280
  // <DropdownMenu.Group render>
@@ -288,7 +288,7 @@
288
288
 
289
289
  // Group.displayName = "GroupWebDropdownMenu";
290
290
 
291
- // const Label = React.forwardRef<LabelRef, LabelProps>(({ ...props }, ref) => {
291
+ // const Label = forwardRef<LabelRef, LabelProps>(({ ...props }, ref) => {
292
292
  //
293
293
  // return (
294
294
  // <DropdownMenu.Label render>
@@ -302,13 +302,13 @@
302
302
 
303
303
  // Label.displayName = "LabelWebDropdownMenu";
304
304
 
305
- // const CheckboxItem = React.forwardRef<CheckboxItemRef, CheckboxItemProps>(
305
+ // const CheckboxItem = forwardRef<CheckboxItemRef, CheckboxItemProps>(
306
306
  // ({ render, checked, onCheckedChange, textValue, disabled = false, closeOnPress = true, onPress: onPressProp, onKeyDown: onKeyDownProp, ...props }, ref) => {
307
307
  // const { close } = useDropdownMenuContentContext();
308
308
 
309
- // function onKeyDown(ev: React.KeyboardEvent) {
310
- // onKeyDownProp?.(ev);
311
- // if (ev.key === "Enter" || ev.key === " ") {
309
+ // function onKeyDown(event: React.KeyboardEvent) {
310
+ // onKeyDownProp?.(event);
311
+ // if (event.key === "Enter" || event.key === " ") {
312
312
  // onPressProp?.(EmptyGestureResponderEvent);
313
313
  // onCheckedChange?.(!checked);
314
314
  // if (closeOnPress) {
@@ -317,8 +317,8 @@
317
317
  // }
318
318
  // }
319
319
 
320
- // function onPress(ev: GestureResponderEvent) {
321
- // onPressProp?.(ev);
320
+ // function onPress(event: GestureResponderEvent) {
321
+ // onPressProp?.(event);
322
322
  // onCheckedChange?.(!checked);
323
323
  // if (closeOnPress) {
324
324
  // close();
@@ -349,12 +349,12 @@
349
349
 
350
350
  // CheckboxItem.displayName = "CheckboxItemWebDropdownMenu";
351
351
 
352
- // const DropdownMenuRadioGroupContext = React.createContext<{
352
+ // const DropdownMenuRadioGroupContext = createContext<{
353
353
  // value?: string;
354
354
  // onValueChange?: (value: string) => void;
355
355
  // } | null>(null);
356
356
 
357
- // const RadioGroup = React.forwardRef<RadioGroupRef, RadioGroupProps>(({ value, onValueChange, ...props }, ref) => {
357
+ // const RadioGroup = forwardRef<RadioGroupRef, RadioGroupProps>(({ value, onValueChange, ...props }, ref) => {
358
358
  //
359
359
  // return (
360
360
  // <DropdownMenuRadioGroupContext.Provider value={{ value, onValueChange }}>
@@ -375,21 +375,21 @@
375
375
  // RadioGroup.displayName = "RadioGroupWebDropdownMenu";
376
376
 
377
377
  // function useDropdownMenuRadioGroupContext() {
378
- // const context = React.useContext(DropdownMenuRadioGroupContext);
378
+ // const context = useContext(DropdownMenuRadioGroupContext);
379
379
  // if (!context) {
380
380
  // throw new Error("DropdownMenuRadioGroup compound components cannot be rendered outside the DropdownMenuRadioGroup component");
381
381
  // }
382
382
  // return context;
383
383
  // }
384
384
 
385
- // const RadioItem = React.forwardRef<RadioItemRef, RadioItemProps>(
385
+ // const RadioItem = forwardRef<RadioItemRef, RadioItemProps>(
386
386
  // ({ render, value, textValue, closeOnPress = true, onPress: onPressProp, onKeyDown: onKeyDownProp, ...props }, ref) => {
387
387
  // const { onValueChange } = useDropdownMenuRadioGroupContext();
388
388
  // const { close } = useDropdownMenuContentContext();
389
389
 
390
- // function onKeyDown(ev: React.KeyboardEvent) {
391
- // onKeyDownProp?.(ev);
392
- // if (ev.key === "Enter" || ev.key === " ") {
390
+ // function onKeyDown(event: React.KeyboardEvent) {
391
+ // onKeyDownProp?.(event);
392
+ // if (event.key === "Enter" || event.key === " ") {
393
393
  // onValueChange?.(value);
394
394
  // onPressProp?.(EmptyGestureResponderEvent);
395
395
  // if (closeOnPress) {
@@ -398,9 +398,9 @@
398
398
  // }
399
399
  // }
400
400
 
401
- // function onPress(ev: GestureResponderEvent) {
401
+ // function onPress(event: GestureResponderEvent) {
402
402
  // onValueChange?.(value);
403
- // onPressProp?.(ev);
403
+ // onPressProp?.(event);
404
404
  // if (closeOnPress) {
405
405
  // close();
406
406
  // }
@@ -428,7 +428,7 @@
428
428
 
429
429
  // RadioItem.displayName = "RadioItemWebDropdownMenu";
430
430
 
431
- // const ItemIndicator = React.forwardRef<ItemIndicatorRef, ItemIndicatorProps>(({ keepMounted, ...props }, ref) => {
431
+ // const ItemIndicator = forwardRef<ItemIndicatorRef, ItemIndicatorProps>(({ keepMounted, ...props }, ref) => {
432
432
  //
433
433
  // return (
434
434
  // <DropdownMenu.ItemIndicator
@@ -445,7 +445,7 @@
445
445
 
446
446
  // ItemIndicator.displayName = "ItemIndicatorWebDropdownMenu";
447
447
 
448
- // const Separator = React.forwardRef<SeparatorRef, SeparatorProps>(({ decorative, ...props }, ref) => {
448
+ // const Separator = forwardRef<SeparatorRef, SeparatorProps>(({ decorative, ...props }, ref) => {
449
449
  //
450
450
  // return (
451
451
  // <DropdownMenu.Separator render>
@@ -459,12 +459,12 @@
459
459
 
460
460
  // Separator.displayName = "SeparatorWebDropdownMenu";
461
461
 
462
- // const DropdownMenuSubContext = React.createContext<{
462
+ // const DropdownMenuSubContext = createContext<{
463
463
  // open: boolean;
464
464
  // onOpenChange: (open: boolean) => void;
465
465
  // } | null>(null);
466
466
 
467
- // const Sub = React.forwardRef<SubRef, SubProps>(({ defaultOpen, open: openProp, onOpenChange: onOpenChangeProp, ...props }, ref) => {
467
+ // const Sub = forwardRef<SubRef, SubProps>(({ defaultOpen, open: openProp, onOpenChange: onOpenChangeProp, ...props }, ref) => {
468
468
  // const [open = false, onOpenChange] = useControllableState({
469
469
  // prop: openProp,
470
470
  // defaultProp: defaultOpen,
@@ -490,19 +490,19 @@
490
490
  // Sub.displayName = "SubWebDropdownMenu";
491
491
 
492
492
  // function useSubContext() {
493
- // const context = React.useContext(DropdownMenuSubContext);
493
+ // const context = useContext(DropdownMenuSubContext);
494
494
  // if (!context) {
495
495
  // throw new Error("DropdownMenu compound components cannot be rendered outside the DropdownMenu component");
496
496
  // }
497
497
  // return context;
498
498
  // }
499
499
 
500
- // const SubTrigger = React.forwardRef<SubTriggerRef, SubTriggerProps>(({ textValue, disabled = false, onPress: onPressProp, ...props }, ref) => {
500
+ // const SubTrigger = forwardRef<SubTriggerRef, SubTriggerProps>(({ textValue, disabled = false, onPress: onPressProp, ...props }, ref) => {
501
501
  // const { onOpenChange } = useSubContext();
502
502
 
503
- // function onPress(ev: GestureResponderEvent) {
503
+ // function onPress(event: GestureResponderEvent) {
504
504
  // onOpenChange(true);
505
- // onPressProp?.(ev);
505
+ // onPressProp?.(event);
506
506
  // }
507
507
 
508
508
  //
@@ -523,7 +523,7 @@
523
523
 
524
524
  // SubTrigger.displayName = "SubTriggerWebDropdownMenu";
525
525
 
526
- // const SubContent = React.forwardRef<SubContentRef, SubContentProps>(({ render = false, keepMounted, ...props }, ref) => {
526
+ // const SubContent = forwardRef<SubContentRef, SubContentProps>(({ render = false, keepMounted, ...props }, ref) => {
527
527
  //
528
528
  // return (
529
529
  // <DropdownMenu.Portal>
@@ -560,6 +560,6 @@
560
560
  // useSubContext,
561
561
  // };
562
562
 
563
- // function onSelected(ev: Event) {
564
- // ev.preventDefault();
563
+ // function onSelected(event: Event) {
564
+ // event.preventDefault();
565
565
  // }
@@ -1,9 +1,8 @@
1
- import * as React from "react";
2
1
  import { Platform } from "react-native";
3
2
 
4
3
  function useIsomorphicLayoutEffect(effect: React.EffectCallback, dependencies?: React.DependencyList) {
5
4
  if (Platform.OS === "web" && typeof window === "undefined") {
6
- React.useEffect(effect, dependencies);
5
+ useEffect(effect, dependencies);
7
6
  } else {
8
7
  React.useLayoutEffect(effect, dependencies);
9
8
  }
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import { useMemo } from "react";
2
2
  import { Dimensions, type LayoutRectangle, type ScaledSize } from "react-native";
3
3
 
4
4
  import type { Insets } from "../types";
@@ -22,7 +22,7 @@ export function useRelativePosition({
22
22
  }: UseRelativePositionArgs) {
23
23
  const dimensions = Dimensions.get("screen");
24
24
 
25
- return React.useMemo(() => {
25
+ return useMemo(() => {
26
26
  if (disablePositioningStyle) {
27
27
  return {};
28
28
  }