@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
1
  // import * as Menubar from "@radix-ui/react-menubar";
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 {
@@ -42,9 +42,9 @@
42
42
  // TriggerRef,
43
43
  // } from "./types";
44
44
 
45
- // const RootContext = React.createContext<RootProps | null>(null);
45
+ // const RootContext = createContext<RootProps | null>(null);
46
46
 
47
- // const Root = React.forwardRef<RootRef, RootProps>(({ value, onValueChange, ...viewProps }, ref) => {
47
+ // const Root = forwardRef<RootRef, RootProps>(({ value, onValueChange, ...viewProps }, ref) => {
48
48
  //
49
49
  // return (
50
50
  // <RootContext.Provider value={{ value, onValueChange }}>
@@ -64,16 +64,16 @@
64
64
  // Root.displayName = "RootWebMenubar";
65
65
 
66
66
  // function useRootContext() {
67
- // const context = React.useContext(RootContext);
67
+ // const context = useContext(RootContext);
68
68
  // if (!context) {
69
69
  // throw new Error("Menubar compound components cannot be rendered outside the Menubar component");
70
70
  // }
71
71
  // return context;
72
72
  // }
73
73
 
74
- // const MenuContext = React.createContext<MenuProps | null>(null);
74
+ // const MenuContext = createContext<MenuProps | null>(null);
75
75
 
76
- // const Menu = React.forwardRef<MenuRef, MenuProps>(({ value, ...viewProps }, ref) => {
76
+ // const Menu = forwardRef<MenuRef, MenuProps>(({ value, ...viewProps }, ref) => {
77
77
  //
78
78
  // return (
79
79
  // <MenuContext.Provider value={{ value }}>
@@ -90,14 +90,14 @@
90
90
  // Menu.displayName = "MenuWebMenubar";
91
91
 
92
92
  // function useMenuContext() {
93
- // const context = React.useContext(MenuContext);
93
+ // const context = useContext(MenuContext);
94
94
  // if (!context) {
95
95
  // throw new Error("Menubar compound components cannot be rendered outside the Menubar component");
96
96
  // }
97
97
  // return context;
98
98
  // }
99
99
 
100
- // const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ disabled = false, ...props }, ref) => {
100
+ // const Trigger = forwardRef<TriggerRef, TriggerProps>(({ disabled = false, ...props }, ref) => {
101
101
  // const augmentedRef = useAugmentedRef({ ref });
102
102
  // const { value: menuValue } = useMenuContext();
103
103
  // const { value } = useRootContext();
@@ -147,7 +147,7 @@
147
147
  // );
148
148
  // }
149
149
 
150
- // const Backdrop = React.forwardRef<BackdropRef, BackdropProps>(({ ...props }, ref) => {
150
+ // const Backdrop = forwardRef<BackdropRef, BackdropProps>(({ ...props }, ref) => {
151
151
  //
152
152
  // return (
153
153
  // <Component
@@ -159,11 +159,11 @@
159
159
 
160
160
  // Backdrop.displayName = "BackdropWebMenubar";
161
161
 
162
- // const MenubarContentContext = React.createContext<{
162
+ // const MenubarContentContext = createContext<{
163
163
  // close: () => void;
164
164
  // } | null>(null);
165
165
 
166
- // const Content = React.forwardRef<ContentRef, ContentProps>(
166
+ // const Content = forwardRef<ContentRef, ContentProps>(
167
167
  // (
168
168
  // {
169
169
  // render = false,
@@ -235,20 +235,20 @@
235
235
  // Content.displayName = "ContentWebMenubar";
236
236
 
237
237
  // function useMenubarContentContext() {
238
- // const context = React.useContext(MenubarContentContext);
238
+ // const context = useContext(MenubarContentContext);
239
239
  // if (!context) {
240
240
  // throw new Error("MenubarContent compound components cannot be rendered outside the MenubarContent component");
241
241
  // }
242
242
  // return context;
243
243
  // }
244
244
 
245
- // const Item = React.forwardRef<ItemRef, ItemProps>(
245
+ // const Item = forwardRef<ItemRef, ItemProps>(
246
246
  // ({ render, textValue, closeOnPress = true, onPress: onPressProp, onKeyDown: onKeyDownProp, ...props }, ref) => {
247
247
  // const { close } = useMenubarContentContext();
248
248
 
249
- // function onKeyDown(ev: React.KeyboardEvent) {
250
- // onKeyDownProp?.(ev);
251
- // if (ev.key === "Enter" || ev.key === " ") {
249
+ // function onKeyDown(event: React.KeyboardEvent) {
250
+ // onKeyDownProp?.(event);
251
+ // if (event.key === "Enter" || event.key === " ") {
252
252
  // onPressProp?.(EmptyGestureResponderEvent);
253
253
  // if (closeOnPress) {
254
254
  // close();
@@ -256,8 +256,8 @@
256
256
  // }
257
257
  // }
258
258
 
259
- // function onPress(ev: GestureResponderEvent) {
260
- // onPressProp?.(ev);
259
+ // function onPress(event: GestureResponderEvent) {
260
+ // onPressProp?.(event);
261
261
  // if (closeOnPress) {
262
262
  // close();
263
263
  // }
@@ -285,7 +285,7 @@
285
285
 
286
286
  // Item.displayName = "ItemWebMenubar";
287
287
 
288
- // const Group = React.forwardRef<GroupRef, GroupProps>(({ ...props }, ref) => {
288
+ // const Group = forwardRef<GroupRef, GroupProps>(({ ...props }, ref) => {
289
289
  //
290
290
  // return (
291
291
  // <Menubar.Group render>
@@ -299,7 +299,7 @@
299
299
 
300
300
  // Group.displayName = "GroupWebMenubar";
301
301
 
302
- // const Label = React.forwardRef<LabelRef, LabelProps>(({ ...props }, ref) => {
302
+ // const Label = forwardRef<LabelRef, LabelProps>(({ ...props }, ref) => {
303
303
  //
304
304
  // return (
305
305
  // <Menubar.Label render>
@@ -313,11 +313,11 @@
313
313
 
314
314
  // Label.displayName = "LabelWebMenubar";
315
315
 
316
- // const CheckboxItem = React.forwardRef<CheckboxItemRef, CheckboxItemProps>(
316
+ // const CheckboxItem = forwardRef<CheckboxItemRef, CheckboxItemProps>(
317
317
  // ({ render, checked, onCheckedChange, textValue, disabled = false, closeOnPress = true, onPress: onPressProp, onKeyDown: onKeyDownProp, ...props }, ref) => {
318
- // function onKeyDown(ev: React.KeyboardEvent) {
319
- // onKeyDownProp?.(ev);
320
- // if (ev.key === "Enter" || ev.key === " ") {
318
+ // function onKeyDown(event: React.KeyboardEvent) {
319
+ // onKeyDownProp?.(event);
320
+ // if (event.key === "Enter" || event.key === " ") {
321
321
  // onPressProp?.(EmptyGestureResponderEvent);
322
322
  // onCheckedChange?.(!checked);
323
323
  // if (closeOnPress) {
@@ -326,8 +326,8 @@
326
326
  // }
327
327
  // }
328
328
 
329
- // function onPress(ev: GestureResponderEvent) {
330
- // onPressProp?.(ev);
329
+ // function onPress(event: GestureResponderEvent) {
330
+ // onPressProp?.(event);
331
331
  // onCheckedChange?.(!checked);
332
332
  // if (closeOnPress) {
333
333
  // close();
@@ -358,12 +358,12 @@
358
358
 
359
359
  // CheckboxItem.displayName = "CheckboxItemWebMenubar";
360
360
 
361
- // const MenubarRadioGroupContext = React.createContext<{
361
+ // const MenubarRadioGroupContext = createContext<{
362
362
  // value?: string;
363
363
  // onValueChange?: (value: string) => void;
364
364
  // } | null>(null);
365
365
 
366
- // const RadioGroup = React.forwardRef<RadioGroupRef, RadioGroupProps>(({ value, onValueChange, ...props }, ref) => {
366
+ // const RadioGroup = forwardRef<RadioGroupRef, RadioGroupProps>(({ value, onValueChange, ...props }, ref) => {
367
367
  //
368
368
  // return (
369
369
  // <MenubarRadioGroupContext.Provider value={{ value, onValueChange }}>
@@ -384,21 +384,21 @@
384
384
  // RadioGroup.displayName = "RadioGroupWebMenubar";
385
385
 
386
386
  // function useMenubarRadioGroupContext() {
387
- // const context = React.useContext(MenubarRadioGroupContext);
387
+ // const context = useContext(MenubarRadioGroupContext);
388
388
  // if (!context) {
389
389
  // throw new Error("MenubarRadioGroup compound components cannot be rendered outside the MenubarRadioGroup component");
390
390
  // }
391
391
  // return context;
392
392
  // }
393
393
 
394
- // const RadioItem = React.forwardRef<RadioItemRef, RadioItemProps>(
394
+ // const RadioItem = forwardRef<RadioItemRef, RadioItemProps>(
395
395
  // ({ render, value, textValue, closeOnPress = true, onPress: onPressProp, onKeyDown: onKeyDownProp, ...props }, ref) => {
396
396
  // const { onValueChange } = useMenubarRadioGroupContext();
397
397
  // const { close } = useMenubarContentContext();
398
398
 
399
- // function onKeyDown(ev: React.KeyboardEvent) {
400
- // onKeyDownProp?.(ev);
401
- // if (ev.key === "Enter" || ev.key === " ") {
399
+ // function onKeyDown(event: React.KeyboardEvent) {
400
+ // onKeyDownProp?.(event);
401
+ // if (event.key === "Enter" || event.key === " ") {
402
402
  // onValueChange?.(value);
403
403
  // onPressProp?.(EmptyGestureResponderEvent);
404
404
  // if (closeOnPress) {
@@ -407,9 +407,9 @@
407
407
  // }
408
408
  // }
409
409
 
410
- // function onPress(ev: GestureResponderEvent) {
410
+ // function onPress(event: GestureResponderEvent) {
411
411
  // onValueChange?.(value);
412
- // onPressProp?.(ev);
412
+ // onPressProp?.(event);
413
413
  // if (closeOnPress) {
414
414
  // close();
415
415
  // }
@@ -437,7 +437,7 @@
437
437
 
438
438
  // RadioItem.displayName = "RadioItemWebMenubar";
439
439
 
440
- // const ItemIndicator = React.forwardRef<ItemIndicatorRef, ItemIndicatorProps>(({ keepMounted, ...props }, ref) => {
440
+ // const ItemIndicator = forwardRef<ItemIndicatorRef, ItemIndicatorProps>(({ keepMounted, ...props }, ref) => {
441
441
  //
442
442
  // return (
443
443
  // <Menubar.ItemIndicator
@@ -454,7 +454,7 @@
454
454
 
455
455
  // ItemIndicator.displayName = "ItemIndicatorWebMenubar";
456
456
 
457
- // const Separator = React.forwardRef<SeparatorRef, SeparatorProps>(({ decorative, ...props }, ref) => {
457
+ // const Separator = forwardRef<SeparatorRef, SeparatorProps>(({ decorative, ...props }, ref) => {
458
458
  //
459
459
  // return (
460
460
  // <Menubar.Separator render>
@@ -468,12 +468,12 @@
468
468
 
469
469
  // Separator.displayName = "SeparatorWebMenubar";
470
470
 
471
- // const MenubarSubContext = React.createContext<{
471
+ // const MenubarSubContext = createContext<{
472
472
  // open: boolean;
473
473
  // onOpenChange: (open: boolean) => void;
474
474
  // } | null>(null);
475
475
 
476
- // const Sub = React.forwardRef<SubRef, SubProps>(({ defaultOpen, open: openProp, onOpenChange: onOpenChangeProp, ...props }, ref) => {
476
+ // const Sub = forwardRef<SubRef, SubProps>(({ defaultOpen, open: openProp, onOpenChange: onOpenChangeProp, ...props }, ref) => {
477
477
  // const [open = false, onOpenChange] = useControllableState({
478
478
  // prop: openProp,
479
479
  // defaultProp: defaultOpen,
@@ -498,19 +498,19 @@
498
498
  // Sub.displayName = "SubWebMenubar";
499
499
 
500
500
  // function useSubContext() {
501
- // const context = React.useContext(MenubarSubContext);
501
+ // const context = useContext(MenubarSubContext);
502
502
  // if (!context) {
503
503
  // throw new Error("MenubarSub compound components cannot be rendered outside the MenubarSub component");
504
504
  // }
505
505
  // return context;
506
506
  // }
507
507
 
508
- // const SubTrigger = React.forwardRef<SubTriggerRef, SubTriggerProps>(({ textValue, disabled = false, onPress: onPressProp, ...props }, ref) => {
508
+ // const SubTrigger = forwardRef<SubTriggerRef, SubTriggerProps>(({ textValue, disabled = false, onPress: onPressProp, ...props }, ref) => {
509
509
  // const { onOpenChange } = useSubContext();
510
510
 
511
- // function onPress(ev: GestureResponderEvent) {
511
+ // function onPress(event: GestureResponderEvent) {
512
512
  // onOpenChange(true);
513
- // onPressProp?.(ev);
513
+ // onPressProp?.(event);
514
514
  // }
515
515
 
516
516
  //
@@ -531,7 +531,7 @@
531
531
 
532
532
  // SubTrigger.displayName = "SubTriggerWebMenubar";
533
533
 
534
- // const SubContent = React.forwardRef<SubContentRef, SubContentProps>(({ render = false, keepMounted, ...props }, ref) => {
534
+ // const SubContent = forwardRef<SubContentRef, SubContentProps>(({ render = false, keepMounted, ...props }, ref) => {
535
535
  //
536
536
  // return (
537
537
  // <Menubar.Portal>
@@ -570,6 +570,6 @@
570
570
  // useSubContext,
571
571
  // };
572
572
 
573
- // function onSelected(ev: Event) {
574
- // ev.preventDefault();
573
+ // function onSelected(event: Event) {
574
+ // event.preventDefault();
575
575
  // }
@@ -1,9 +1,9 @@
1
- import * as React from "react";
1
+ import { createContext, forwardRef, useId, useState, useContext, useRef, useImperativeHandle, useEffect } from "react";
2
2
  import { BackHandler, Pressable, View, type GestureResponderEvent, type LayoutChangeEvent, type LayoutRectangle } from "react-native";
3
3
 
4
4
  import { 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
  ContentProps,
@@ -33,12 +33,12 @@ interface INavigationMenuRootContext extends RootProps {
33
33
  nativeID: string;
34
34
  }
35
35
 
36
- const RootContext = React.createContext<INavigationMenuRootContext | null>(null);
36
+ const RootContext = createContext<INavigationMenuRootContext | null>(null);
37
37
 
38
- const Root = React.forwardRef<RootRef, RootProps>(({ value, onValueChange, ...viewProps }, ref) => {
39
- const nativeID = React.useId();
40
- const [triggerPosition, setTriggerPosition] = React.useState<LayoutPosition | null>(null);
41
- const [contentLayout, setContentLayout] = React.useState<LayoutRectangle | null>(null);
38
+ const Root = forwardRef<RootRef, RootProps>(({ value, onValueChange, ...viewProps }, ref) => {
39
+ const nativeID = useId();
40
+ const [triggerPosition, setTriggerPosition] = useState<LayoutPosition | null>(null);
41
+ const [contentLayout, setContentLayout] = useState<LayoutRectangle | null>(null);
42
42
 
43
43
  return (
44
44
  <RootContext.Provider
@@ -64,14 +64,14 @@ const Root = React.forwardRef<RootRef, RootProps>(({ value, onValueChange, ...vi
64
64
  Root.displayName = "RootNativeNavigationMenu";
65
65
 
66
66
  function useRootContext() {
67
- const context = React.useContext(RootContext);
67
+ const context = useContext(RootContext);
68
68
  if (!context) {
69
69
  throw new Error("NavigationMenu compound components cannot be rendered outside the NavigationMenu component");
70
70
  }
71
71
  return context;
72
72
  }
73
73
 
74
- const List = React.forwardRef<ListRef, ListProps>(({ ...viewProps }, ref) => {
74
+ const List = forwardRef<ListRef, ListProps>(({ ...viewProps }, ref) => {
75
75
  return (
76
76
  <Component
77
77
  ref={ref}
@@ -83,10 +83,10 @@ const List = React.forwardRef<ListRef, ListProps>(({ ...viewProps }, ref) => {
83
83
 
84
84
  List.displayName = "ListNativeNavigationMenu";
85
85
 
86
- const ItemContext = React.createContext<(ItemProps & { nativeID: string }) | null>(null);
86
+ const ItemContext = createContext<(ItemProps & { nativeID: string }) | null>(null);
87
87
 
88
- const Item = React.forwardRef<ItemRef, ItemProps>(({ value, ...viewProps }, ref) => {
89
- const nativeID = React.useId();
88
+ const Item = forwardRef<ItemRef, ItemProps>(({ value, ...viewProps }, ref) => {
89
+ const nativeID = useId();
90
90
 
91
91
  return (
92
92
  <ItemContext.Provider
@@ -107,33 +107,33 @@ const Item = React.forwardRef<ItemRef, ItemProps>(({ value, ...viewProps }, ref)
107
107
  Item.displayName = "ItemNativeNavigationMenu";
108
108
 
109
109
  function useItemContext() {
110
- const context = React.useContext(ItemContext);
110
+ const context = useContext(ItemContext);
111
111
  if (!context) {
112
112
  throw new Error("NavigationMenu compound components cannot be rendered outside the NavigationMenu component");
113
113
  }
114
114
  return context;
115
115
  }
116
116
 
117
- const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, disabled = false, ...props }, ref) => {
118
- const triggerRef = React.useRef<View>(null);
117
+ const Trigger = forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, disabled = false, ...props }, ref) => {
118
+ const triggerRef = useRef<View>(null);
119
119
  const { value, onValueChange, setTriggerPosition } = useRootContext();
120
120
  const { value: menuValue } = useItemContext();
121
121
 
122
- React.useImperativeHandle(ref, () => {
122
+ useImperativeHandle(ref, () => {
123
123
  if (!triggerRef.current) {
124
124
  return new View({});
125
125
  }
126
126
  return triggerRef.current;
127
127
  }, [triggerRef.current]);
128
128
 
129
- function onPress(ev: GestureResponderEvent) {
129
+ function onPress(event: GestureResponderEvent) {
130
130
  if (disabled) return;
131
131
  triggerRef.current?.measure((_x, _y, width, height, pageX, pageY) => {
132
132
  setTriggerPosition({ width, pageX, pageY: pageY, height });
133
133
  });
134
134
 
135
135
  onValueChange(menuValue === value ? "" : menuValue);
136
- onPressProp?.(ev);
136
+ onPressProp?.(event);
137
137
  }
138
138
 
139
139
  return (
@@ -186,7 +186,7 @@ function Portal({ keepMounted, hostName, children }: PortalProps) {
186
186
  /**
187
187
  * @info `position`, `top`, `left`, and `maxWidth` style properties are controlled internally. Opt out of this behavior by setting `disablePositioningStyle` to `true`.
188
188
  */
189
- const Content = React.forwardRef<ContentRef, ContentProps>(
189
+ const Content = forwardRef<ContentRef, ContentProps>(
190
190
  (
191
191
  {
192
192
  render = false,
@@ -207,7 +207,7 @@ const Content = React.forwardRef<ContentRef, ContentProps>(
207
207
  const { value, onValueChange, triggerPosition, setTriggerPosition, contentLayout, setContentLayout } = useRootContext();
208
208
  const { value: menuValue, nativeID } = useItemContext();
209
209
 
210
- React.useEffect(() => {
210
+ useEffect(() => {
211
211
  const backHandler = BackHandler.addEventListener("hardwareBackPress", () => {
212
212
  setTriggerPosition(null);
213
213
  setContentLayout(null);
@@ -261,7 +261,7 @@ const Content = React.forwardRef<ContentRef, ContentProps>(
261
261
 
262
262
  Content.displayName = "ContentNativeNavigationMenu";
263
263
 
264
- const Link = React.forwardRef<LinkRef, LinkProps>(({ ...props }, ref) => {
264
+ const Link = forwardRef<LinkRef, LinkProps>(({ ...props }, ref) => {
265
265
  return (
266
266
  <Component
267
267
  ref={ref}
@@ -273,7 +273,7 @@ const Link = React.forwardRef<LinkRef, LinkProps>(({ ...props }, ref) => {
273
273
 
274
274
  Link.displayName = "LinkNativeNavigationMenu";
275
275
 
276
- const Viewport = React.forwardRef<ViewportRef, ViewportProps>((props, ref) => {
276
+ const Viewport = forwardRef<ViewportRef, ViewportProps>((props, ref) => {
277
277
  return (
278
278
  <View
279
279
  ref={ref}
@@ -284,7 +284,7 @@ const Viewport = React.forwardRef<ViewportRef, ViewportProps>((props, ref) => {
284
284
 
285
285
  Viewport.displayName = "ViewportNativeNavigationMenu";
286
286
 
287
- const Indicator = React.forwardRef<IndicatorRef, IndicatorProps>(({ ...props }, ref) => {
287
+ const Indicator = forwardRef<IndicatorRef, IndicatorProps>(({ ...props }, ref) => {
288
288
  return (
289
289
  <Component
290
290
  ref={ref}
@@ -1,9 +1,9 @@
1
1
  // import * as NavigationMenu from "@radix-ui/react-navigation-menu";
2
- // import * as React from "react";
2
+ //
3
3
  // import { GestureResponderEvent, Pressable, View } from "react-native";
4
4
 
5
5
  // import { useAugmentedRef, 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 {
@@ -26,9 +26,9 @@
26
26
  // ViewportRef,
27
27
  // } from "./types";
28
28
 
29
- // const NavigationMenuContext = React.createContext<RootProps | null>(null);
29
+ // const NavigationMenuContext = createContext<RootProps | null>(null);
30
30
 
31
- // const Root = React.forwardRef<RootRef, RootProps>(
31
+ // const Root = forwardRef<RootRef, RootProps>(
32
32
  // ({ render, value, onValueChange, delayDuration, skipDelayDuration, dir, orientation, ...viewProps }, ref) => {
33
33
  //
34
34
  // return (
@@ -54,14 +54,14 @@
54
54
  // Root.displayName = "RootWebNavigationMenu";
55
55
 
56
56
  // function useRootContext() {
57
- // const context = React.useContext(NavigationMenuContext);
57
+ // const context = useContext(NavigationMenuContext);
58
58
  // if (!context) {
59
59
  // throw new Error("NavigationMenu compound components cannot be rendered outside the NavigationMenu component");
60
60
  // }
61
61
  // return context;
62
62
  // }
63
63
 
64
- // const List = React.forwardRef<ListRef, ListProps>(({ ...viewProps }, ref) => {
64
+ // const List = forwardRef<ListRef, ListProps>(({ ...viewProps }, ref) => {
65
65
  // const augmentedRef = useAugmentedRef({ ref });
66
66
  // const { orientation } = useRootContext();
67
67
 
@@ -85,9 +85,9 @@
85
85
 
86
86
  // List.displayName = "ListWebNavigationMenu";
87
87
 
88
- // const ItemContext = React.createContext<ItemProps | null>(null);
88
+ // const ItemContext = createContext<ItemProps | null>(null);
89
89
 
90
- // const Item = React.forwardRef<ItemRef, ItemProps>(({ value, ...props }, ref) => {
90
+ // const Item = forwardRef<ItemRef, ItemProps>(({ value, ...props }, ref) => {
91
91
  //
92
92
  // return (
93
93
  // <ItemContext.Provider value={{ value }}>
@@ -107,26 +107,26 @@
107
107
  // Item.displayName = "ItemWebNavigationMenu";
108
108
 
109
109
  // function useItemContext() {
110
- // const context = React.useContext(ItemContext);
110
+ // const context = useContext(ItemContext);
111
111
  // if (!context) {
112
112
  // throw new Error("NavigationMenu compound components cannot be rendered outside the NavigationMenu component");
113
113
  // }
114
114
  // return context;
115
115
  // }
116
116
 
117
- // const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, disabled = false, onKeyDown: onKeyDownProp, ...props }, ref) => {
117
+ // const Trigger = forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, disabled = false, onKeyDown: onKeyDownProp, ...props }, ref) => {
118
118
  // const { value: rootValue, onValueChange } = useRootContext();
119
119
  // const { value } = useItemContext();
120
- // function onKeyDown(ev: React.KeyboardEvent) {
121
- // onKeyDownProp?.(ev);
122
- // if (ev.key === " ") {
120
+ // function onKeyDown(event: React.KeyboardEvent) {
121
+ // onKeyDownProp?.(event);
122
+ // if (event.key === " ") {
123
123
  // onPressProp?.(EmptyGestureResponderEvent);
124
124
  // onValueChange(value === rootValue ? "" : value);
125
125
  // }
126
126
  // }
127
127
 
128
- // function onPress(ev: GestureResponderEvent) {
129
- // onPressProp?.(ev);
128
+ // function onPress(event: GestureResponderEvent) {
129
+ // onPressProp?.(event);
130
130
  // onValueChange(value === rootValue ? "" : value);
131
131
  // }
132
132
 
@@ -153,7 +153,7 @@
153
153
  // return <>{children}</>;
154
154
  // }
155
155
 
156
- // const Content = React.forwardRef<ContentRef, ContentProps>(
156
+ // const Content = forwardRef<ContentRef, ContentProps>(
157
157
  // (
158
158
  // {
159
159
  // render = false,
@@ -194,18 +194,18 @@
194
194
 
195
195
  // Content.displayName = "ContentWebNavigationMenu";
196
196
 
197
- // const Link = React.forwardRef<LinkRef, LinkProps>(({ active, onPress: onPressProp, onKeyDown: onKeyDownProp, ...props }, ref) => {
197
+ // const Link = forwardRef<LinkRef, LinkProps>(({ active, onPress: onPressProp, onKeyDown: onKeyDownProp, ...props }, ref) => {
198
198
  // const { onValueChange } = useRootContext();
199
- // function onKeyDown(ev: React.KeyboardEvent) {
200
- // onKeyDownProp?.(ev);
201
- // if (ev.key === "Enter" || ev.key === " ") {
199
+ // function onKeyDown(event: React.KeyboardEvent) {
200
+ // onKeyDownProp?.(event);
201
+ // if (event.key === "Enter" || event.key === " ") {
202
202
  // onPressProp?.(EmptyGestureResponderEvent);
203
203
  // onValueChange("");
204
204
  // }
205
205
  // }
206
206
 
207
- // function onPress(ev: GestureResponderEvent) {
208
- // onPressProp?.(ev);
207
+ // function onPress(event: GestureResponderEvent) {
208
+ // onPressProp?.(event);
209
209
  // onValueChange("");
210
210
  // }
211
211
 
@@ -229,20 +229,20 @@
229
229
 
230
230
  // Link.displayName = "LinkWebNavigationMenu";
231
231
 
232
- // const Viewport = React.forwardRef<ViewportRef, ViewportProps>((props, ref) => {
232
+ // const Viewport = forwardRef<ViewportRef, ViewportProps>((props, ref) => {
233
233
  // return (
234
- // <Slot.View
234
+ // <Render.View
235
235
  // ref={ref}
236
236
  // {...props}
237
237
  // >
238
238
  // <NavigationMenu.Viewport />
239
- // </Slot.View>
239
+ // </Render.View>
240
240
  // );
241
241
  // });
242
242
 
243
243
  // Viewport.displayName = "ViewportWebNavigationMenu";
244
244
 
245
- // const Indicator = React.forwardRef<IndicatorRef, IndicatorProps>(({ ...props }, ref) => {
245
+ // const Indicator = forwardRef<IndicatorRef, IndicatorProps>(({ ...props }, ref) => {
246
246
  //
247
247
  // return (
248
248
  // <NavigationMenu.Indicator render>