@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, useContext, useEffect, useId, useState } from "react";
2
2
  import { BackHandler, Pressable, View, type GestureResponderEvent, type LayoutChangeEvent, type LayoutRectangle } from "react-native";
3
3
 
4
4
  import { useAugmentedRef, 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,
@@ -28,52 +28,50 @@ interface RootContextInterface extends SharedRootContext {
28
28
  nativeID: string;
29
29
  }
30
30
 
31
- const RootContext = React.createContext<RootContextInterface | null>(null);
31
+ const RootContext = createContext<RootContextInterface | null>(null);
32
32
 
33
- const Root = React.forwardRef<RootRef, RootProps>(
34
- ({ render, openDelay: _openDelay, closeDelay: _closeDelay, onOpenChange: onOpenChangeProp, ...viewProps }, ref) => {
35
- const nativeID = React.useId();
36
- const [triggerPosition, setTriggerPosition] = React.useState<LayoutPosition | null>(null);
37
- const [contentLayout, setContentLayout] = React.useState<LayoutRectangle | null>(null);
38
- const [open, setOpen] = React.useState(false);
33
+ const Root = forwardRef<RootRef, RootProps>(({ render, openDelay: _openDelay, closeDelay: _closeDelay, onOpenChange: onOpenChangeProp, ...viewProps }, ref) => {
34
+ const nativeID = useId();
35
+ const [triggerPosition, setTriggerPosition] = useState<LayoutPosition | null>(null);
36
+ const [contentLayout, setContentLayout] = useState<LayoutRectangle | null>(null);
37
+ const [open, setOpen] = useState(false);
39
38
 
40
- function onOpenChange(value: boolean) {
41
- setOpen(value);
42
- onOpenChangeProp?.(value);
43
- }
39
+ function onOpenChange(value: boolean) {
40
+ setOpen(value);
41
+ onOpenChangeProp?.(value);
42
+ }
44
43
 
45
- return (
46
- <RootContext.Provider
47
- value={{
48
- open,
49
- onOpenChange,
50
- contentLayout,
51
- nativeID,
52
- setContentLayout,
53
- setTriggerPosition,
54
- triggerPosition,
55
- }}
56
- >
57
- <Component
58
- ref={ref}
59
- {...viewProps}
60
- />
61
- </RootContext.Provider>
62
- );
63
- },
64
- );
44
+ return (
45
+ <RootContext.Provider
46
+ value={{
47
+ open,
48
+ onOpenChange,
49
+ contentLayout,
50
+ nativeID,
51
+ setContentLayout,
52
+ setTriggerPosition,
53
+ triggerPosition,
54
+ }}
55
+ >
56
+ <Component
57
+ ref={ref}
58
+ {...viewProps}
59
+ />
60
+ </RootContext.Provider>
61
+ );
62
+ });
65
63
 
66
64
  Root.displayName = "RootNativeHoverCard";
67
65
 
68
66
  function useRootContext() {
69
- const context = React.useContext(RootContext);
67
+ const context = useContext(RootContext);
70
68
  if (!context) {
71
69
  throw new Error("HoverCard compound components cannot be rendered outside the HoverCard component");
72
70
  }
73
71
  return context;
74
72
  }
75
73
 
76
- const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, disabled = false, ...props }, ref) => {
74
+ const Trigger = forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, disabled = false, ...props }, ref) => {
77
75
  const { open, onOpenChange, setTriggerPosition } = useRootContext();
78
76
 
79
77
  const augmentedRef = useAugmentedRef({
@@ -92,14 +90,14 @@ const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressPr
92
90
  },
93
91
  });
94
92
 
95
- function onPress(ev: GestureResponderEvent) {
93
+ function onPress(event: GestureResponderEvent) {
96
94
  if (disabled) return;
97
95
  augmentedRef.current?.measure((_x, _y, width, height, pageX, pageY) => {
98
96
  setTriggerPosition({ width, pageX, pageY: pageY, height });
99
97
  });
100
98
 
101
99
  onOpenChange(!open);
102
- onPressProp?.(ev);
100
+ onPressProp?.(event);
103
101
  }
104
102
 
105
103
  return (
@@ -142,16 +140,16 @@ function Portal({ keepMounted, hostName, children }: PortalProps) {
142
140
  );
143
141
  }
144
142
 
145
- const Backdrop = React.forwardRef<BackdropRef, BackdropProps>(({ keepMounted, onPress: OnPressProp, closeOnPress = true, ...props }, ref) => {
143
+ const Backdrop = forwardRef<BackdropRef, BackdropProps>(({ keepMounted, onPress: onPressProp, closeOnPress = true, ...props }, ref) => {
146
144
  const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext();
147
145
 
148
- function onPress(ev: GestureResponderEvent) {
146
+ function onPress(event: GestureResponderEvent) {
149
147
  if (closeOnPress) {
150
148
  setTriggerPosition(null);
151
149
  setContentLayout(null);
152
150
  onOpenChange(false);
153
151
  }
154
- OnPressProp?.(ev);
152
+ onPressProp?.(event);
155
153
  }
156
154
 
157
155
  if (!keepMounted) {
@@ -174,7 +172,7 @@ Backdrop.displayName = "BackdropNativeHoverCard";
174
172
  /**
175
173
  * @info `position`, `top`, `left`, and `maxWidth` style properties are controlled internally. Opt out of this behavior by setting `disablePositioningStyle` to `true`.
176
174
  */
177
- const Content = React.forwardRef<ContentRef, ContentProps>(
175
+ const Content = forwardRef<ContentRef, ContentProps>(
178
176
  (
179
177
  {
180
178
  render = false,
@@ -194,7 +192,7 @@ const Content = React.forwardRef<ContentRef, ContentProps>(
194
192
  ) => {
195
193
  const { open, onOpenChange, contentLayout, nativeID, setContentLayout, setTriggerPosition, triggerPosition } = useRootContext();
196
194
 
197
- React.useEffect(() => {
195
+ useEffect(() => {
198
196
  const backHandler = BackHandler.addEventListener("hardwareBackPress", () => {
199
197
  setTriggerPosition(null);
200
198
  setContentLayout(null);
@@ -1,9 +1,9 @@
1
1
  // import * as HoverCard from "@radix-ui/react-hover-card";
2
- // import * as React from "react";
2
+ //
3
3
  // import { Pressable, View } from "react-native";
4
4
 
5
5
  // import { useAugmentedRef } from "../hooks";
6
- // import * as Slot from "../slot";
6
+ // import * as Render from "../render";
7
7
 
8
8
  // import type {
9
9
  // ContentProps,
@@ -18,10 +18,10 @@
18
18
  // TriggerRef,
19
19
  // } from "./types";
20
20
 
21
- // const HoverCardContext = React.createContext<SharedRootContext | null>(null);
21
+ // const HoverCardContext = createContext<SharedRootContext | null>(null);
22
22
 
23
- // const Root = React.forwardRef<RootRef, RootProps>(({ openDelay, closeDelay, onOpenChange: onOpenChangeProp, ...viewProps }, ref) => {
24
- // const [open, setOpen] = React.useState(false);
23
+ // const Root = forwardRef<RootRef, RootProps>(({ openDelay, closeDelay, onOpenChange: onOpenChangeProp, ...viewProps }, ref) => {
24
+ // const [open, setOpen] = useState(false);
25
25
 
26
26
  // function onOpenChange(value: boolean) {
27
27
  // setOpen(value);
@@ -49,14 +49,14 @@
49
49
  // Root.displayName = "RootWebHoverCard";
50
50
 
51
51
  // function useRootContext() {
52
- // const context = React.useContext(HoverCardContext);
52
+ // const context = useContext(HoverCardContext);
53
53
  // if (!context) {
54
54
  // throw new Error("HoverCard compound components cannot be rendered outside the HoverCard component");
55
55
  // }
56
56
  // return context;
57
57
  // }
58
58
 
59
- // const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ ...props }, ref) => {
59
+ // const Trigger = forwardRef<TriggerRef, TriggerProps>(({ ...props }, ref) => {
60
60
  // const { onOpenChange } = useRootContext();
61
61
  // const augmentedRef = useAugmentedRef({
62
62
  // ref,
@@ -93,7 +93,7 @@
93
93
  // );
94
94
  // }
95
95
 
96
- // const Backdrop = React.forwardRef<BackdropRef, BackdropProps>(({ ...props }, ref) => {
96
+ // const Backdrop = forwardRef<BackdropRef, BackdropProps>(({ ...props }, ref) => {
97
97
  //
98
98
  // return (
99
99
  // <Component
@@ -105,7 +105,7 @@
105
105
 
106
106
  // Backdrop.displayName = "BackdropWebHoverCard";
107
107
 
108
- // const Content = React.forwardRef<ContentRef, ContentProps>(
108
+ // const Content = forwardRef<ContentRef, ContentProps>(
109
109
  // (
110
110
  // {
111
111
  // render = false,
@@ -1,14 +1,13 @@
1
- import * as React from "react";
2
1
  import { Pressable, Text as ReactNativeText } from "react-native";
3
2
 
4
- import * as Slot from "../slot";
3
+ import * as Render from "../render";
5
4
 
6
5
  import type { RootProps, TextProps } from "./types";
7
6
 
8
7
  const Root = ({ render, ...props }: RootProps) => {
9
8
  if (render) {
10
9
  return (
11
- <Slot.Pressable
10
+ <Render.Pressable
12
11
  render={render}
13
12
  {...props}
14
13
  />
@@ -22,7 +21,7 @@ Root.displayName = "RootNativeLabel";
22
21
  const Text = ({ render, ...props }: TextProps) => {
23
22
  if (render) {
24
23
  return (
25
- <Slot.Text
24
+ <Render.Text
26
25
  render={render}
27
26
  {...props}
28
27
  />
@@ -1,12 +1,12 @@
1
1
  // import * as Label from "@radix-ui/react-label";
2
- // import * as React from "react";
2
+ //
3
3
  // import { Pressable, Text as RNText } from "react-native";
4
4
 
5
- // import * as Slot from "../slot";
5
+ // import * as Render from "../render";
6
6
 
7
7
  // import type { RootProps, RootRef, TextProps, TextRef } from "./types";
8
8
 
9
- // const Root = React.forwardRef<RootRef, RootProps>(({ tabIndex = -1, ...props }, ref) => {
9
+ // const Root = forwardRef<RootRef, RootProps>(({ tabIndex = -1, ...props }, ref) => {
10
10
  //
11
11
  // return (
12
12
  // <Component
@@ -18,8 +18,8 @@
18
18
  // });
19
19
  // Root.displayName = "RootWebLabel";
20
20
 
21
- // const Text = React.forwardRef<TextRef, TextProps>(({ nativeID, htmlFor, ...props }, ref) => {
22
- // const Component = render ? Slot.Text : RNText;
21
+ // const Text = forwardRef<TextRef, TextProps>(({ nativeID, htmlFor, ...props }, ref) => {
22
+ // const Component = render ? Render.Text : RNText;
23
23
  // return (
24
24
  // <Label.Root
25
25
  // render={!htmlFor}
@@ -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,12 +49,12 @@ interface IMenuContext extends RootProps {
49
49
  nativeID: string;
50
50
  }
51
51
 
52
- const RootContext = React.createContext<IMenuContext | null>(null);
52
+ const RootContext = createContext<IMenuContext | null>(null);
53
53
 
54
- const Root = React.forwardRef<RootRef, RootProps>(({ value, onValueChange, ...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);
54
+ const Root = forwardRef<RootRef, RootProps>(({ value, onValueChange, ...viewProps }, ref) => {
55
+ const nativeID = useId();
56
+ const [triggerPosition, setTriggerPosition] = useState<LayoutPosition | null>(null);
57
+ const [contentLayout, setContentLayout] = useState<LayoutRectangle | null>(null);
58
58
 
59
59
  return (
60
60
  <RootContext.Provider
@@ -79,16 +79,16 @@ const Root = React.forwardRef<RootRef, RootProps>(({ value, onValueChange, ...vi
79
79
  Root.displayName = "RootMenubar";
80
80
 
81
81
  function useRootContext() {
82
- const context = React.useContext(RootContext);
82
+ const context = useContext(RootContext);
83
83
  if (!context) {
84
84
  throw new Error("Menubar compound components cannot be rendered outside the Menubar component");
85
85
  }
86
86
  return context;
87
87
  }
88
88
 
89
- const MenuContext = React.createContext<MenuProps | null>(null);
89
+ const MenuContext = createContext<MenuProps | null>(null);
90
90
 
91
- const Menu = React.forwardRef<MenuRef, MenuProps>(({ value, ...viewProps }, ref) => {
91
+ const Menu = forwardRef<MenuRef, MenuProps>(({ value, ...viewProps }, ref) => {
92
92
  return (
93
93
  <MenuContext.Provider
94
94
  value={{
@@ -107,26 +107,26 @@ const Menu = React.forwardRef<MenuRef, MenuProps>(({ value, ...viewProps }, ref)
107
107
  Menu.displayName = "MenuMenubar";
108
108
 
109
109
  function useMenuContext() {
110
- const context = React.useContext(MenuContext);
110
+ const context = useContext(MenuContext);
111
111
  if (!context) {
112
112
  throw new Error("Menubar compound components cannot be rendered outside the Menubar component");
113
113
  }
114
114
  return context;
115
115
  }
116
116
 
117
- const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, disabled = false, ...props }, ref) => {
117
+ const Trigger = forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, disabled = false, ...props }, ref) => {
118
118
  const triggerRef = useAugmentedRef({ ref });
119
119
  const { value, onValueChange, setTriggerPosition } = useRootContext();
120
120
  const { value: menuValue } = useMenuContext();
121
121
 
122
- function onPress(ev: GestureResponderEvent) {
122
+ function onPress(event: GestureResponderEvent) {
123
123
  if (disabled) return;
124
124
  triggerRef.current?.measure((_x, _y, width, height, pageX, pageY) => {
125
125
  setTriggerPosition({ width, pageX, pageY, height });
126
126
  });
127
127
 
128
128
  onValueChange(menuValue === value ? undefined : menuValue);
129
- onPressProp?.(ev);
129
+ onPressProp?.(event);
130
130
  }
131
131
 
132
132
  return (
@@ -181,16 +181,16 @@ function Portal({ keepMounted, hostName, children }: PortalProps) {
181
181
  );
182
182
  }
183
183
 
184
- const Backdrop = React.forwardRef<BackdropRef, BackdropProps>(({ keepMounted, onPress: OnPressProp, closeOnPress = true, ...props }, ref) => {
184
+ const Backdrop = forwardRef<BackdropRef, BackdropProps>(({ keepMounted, onPress: onPressProp, closeOnPress = true, ...props }, ref) => {
185
185
  const { value, onValueChange, setContentLayout, setTriggerPosition } = useRootContext();
186
186
 
187
- function onPress(ev: GestureResponderEvent) {
187
+ function onPress(event: GestureResponderEvent) {
188
188
  if (closeOnPress) {
189
189
  setTriggerPosition(null);
190
190
  setContentLayout(null);
191
191
  onValueChange(undefined);
192
192
  }
193
- OnPressProp?.(ev);
193
+ onPressProp?.(event);
194
194
  }
195
195
 
196
196
  if (!keepMounted) {
@@ -213,7 +213,7 @@ Backdrop.displayName = "BackdropMenubar";
213
213
  /**
214
214
  * @info `position`, `top`, `left`, and `maxWidth` style properties are controlled internally. Opt out of this behavior by setting `disablePositioningStyle` to `true`.
215
215
  */
216
- const Content = React.forwardRef<ContentRef, ContentProps>(
216
+ const Content = forwardRef<ContentRef, ContentProps>(
217
217
  (
218
218
  {
219
219
  render = false,
@@ -234,7 +234,7 @@ const Content = React.forwardRef<ContentRef, ContentProps>(
234
234
  const { value, onValueChange, triggerPosition, contentLayout, setContentLayout, nativeID, setTriggerPosition } = useRootContext();
235
235
  const { value: menuValue } = useMenuContext();
236
236
 
237
- React.useEffect(() => {
237
+ useEffect(() => {
238
238
  const backHandler = BackHandler.addEventListener("hardwareBackPress", () => {
239
239
  setTriggerPosition(null);
240
240
  setContentLayout(null);
@@ -288,16 +288,16 @@ const Content = React.forwardRef<ContentRef, ContentProps>(
288
288
 
289
289
  Content.displayName = "ContentMenubar";
290
290
 
291
- const Item = React.forwardRef<ItemRef, ItemProps>(({ textValue, onPress: onPressProp, disabled = false, closeOnPress = true, ...props }, ref) => {
291
+ const Item = forwardRef<ItemRef, ItemProps>(({ textValue, onPress: onPressProp, disabled = false, closeOnPress = true, ...props }, ref) => {
292
292
  const { onValueChange, setContentLayout, setTriggerPosition } = useRootContext();
293
293
 
294
- function onPress(ev: GestureResponderEvent) {
294
+ function onPress(event: GestureResponderEvent) {
295
295
  if (closeOnPress) {
296
296
  setTriggerPosition(null);
297
297
  setContentLayout(null);
298
298
  onValueChange(undefined);
299
299
  }
300
- onPressProp?.(ev);
300
+ onPressProp?.(event);
301
301
  }
302
302
 
303
303
  return (
@@ -316,7 +316,7 @@ const Item = React.forwardRef<ItemRef, ItemProps>(({ textValue, onPress: onPress
316
316
 
317
317
  Item.displayName = "ItemMenubar";
318
318
 
319
- const Group = React.forwardRef<GroupRef, GroupProps>(({ ...props }, ref) => {
319
+ const Group = forwardRef<GroupRef, GroupProps>(({ ...props }, ref) => {
320
320
  return (
321
321
  <Component
322
322
  ref={ref}
@@ -328,7 +328,7 @@ const Group = React.forwardRef<GroupRef, GroupProps>(({ ...props }, ref) => {
328
328
 
329
329
  Group.displayName = "GroupMenubar";
330
330
 
331
- const Label = React.forwardRef<LabelRef, LabelProps>(({ ...props }, ref) => {
331
+ const Label = forwardRef<LabelRef, LabelProps>(({ ...props }, ref) => {
332
332
  return (
333
333
  <Component
334
334
  ref={ref}
@@ -346,20 +346,20 @@ type FormItemContext =
346
346
  onValueChange: (value: string) => void;
347
347
  };
348
348
 
349
- const FormItemContext = React.createContext<FormItemContext | null>(null);
349
+ const FormItemContext = createContext<FormItemContext | null>(null);
350
350
 
351
- const CheckboxItem = React.forwardRef<CheckboxItemRef, CheckboxItemProps>(
351
+ const CheckboxItem = forwardRef<CheckboxItemRef, CheckboxItemProps>(
352
352
  ({ render, checked, onCheckedChange, textValue, onPress: onPressProp, closeOnPress = true, disabled = false, ...props }, ref) => {
353
353
  const { onValueChange, setTriggerPosition, setContentLayout } = useRootContext();
354
354
 
355
- function onPress(ev: GestureResponderEvent) {
355
+ function onPress(event: GestureResponderEvent) {
356
356
  onCheckedChange(!checked);
357
357
  if (closeOnPress) {
358
358
  setTriggerPosition(null);
359
359
  setContentLayout(null);
360
360
  onValueChange(undefined);
361
361
  }
362
- onPressProp?.(ev);
362
+ onPressProp?.(event);
363
363
  }
364
364
 
365
365
  return (
@@ -383,14 +383,14 @@ const CheckboxItem = React.forwardRef<CheckboxItemRef, CheckboxItemProps>(
383
383
  CheckboxItem.displayName = "CheckboxItemMenubar";
384
384
 
385
385
  function useFormItemContext() {
386
- const context = React.useContext(FormItemContext);
386
+ const context = useContext(FormItemContext);
387
387
  if (!context) {
388
388
  throw new Error("CheckboxItem or RadioItem compound components cannot be rendered outside of a CheckboxItem or RadioItem component");
389
389
  }
390
390
  return context;
391
391
  }
392
392
 
393
- const RadioGroup = React.forwardRef<RadioGroupRef, RadioGroupProps>(({ value, onValueChange, ...props }, ref) => {
393
+ const RadioGroup = forwardRef<RadioGroupRef, RadioGroupProps>(({ value, onValueChange, ...props }, ref) => {
394
394
  return (
395
395
  <FormItemContext.Provider value={{ value, onValueChange }}>
396
396
  <Component
@@ -408,21 +408,21 @@ type BothFormItemContext = Exclude<FormItemContext, { checked: boolean }> & {
408
408
  checked: boolean;
409
409
  };
410
410
 
411
- const RadioItemContext = React.createContext({} as { itemValue: string });
411
+ const RadioItemContext = createContext({} as { itemValue: string });
412
412
 
413
- const RadioItem = React.forwardRef<RadioItemRef, RadioItemProps>(
413
+ const RadioItem = forwardRef<RadioItemRef, RadioItemProps>(
414
414
  ({ render, value: itemValue, textValue, onPress: onPressProp, disabled = false, closeOnPress = true, ...props }, ref) => {
415
415
  const { onValueChange: onRootValueChange, setTriggerPosition, setContentLayout } = useRootContext();
416
416
 
417
417
  const { value, onValueChange } = useFormItemContext() as BothFormItemContext;
418
- function onPress(ev: GestureResponderEvent) {
418
+ function onPress(event: GestureResponderEvent) {
419
419
  onValueChange(itemValue);
420
420
  if (closeOnPress) {
421
421
  setTriggerPosition(null);
422
422
  setContentLayout(null);
423
423
  onRootValueChange(undefined);
424
424
  }
425
- onPressProp?.(ev);
425
+ onPressProp?.(event);
426
426
  }
427
427
 
428
428
  return (
@@ -448,10 +448,10 @@ const RadioItem = React.forwardRef<RadioItemRef, RadioItemProps>(
448
448
  RadioItem.displayName = "RadioItemMenubar";
449
449
 
450
450
  function useItemIndicatorContext() {
451
- return React.useContext(RadioItemContext);
451
+ return useContext(RadioItemContext);
452
452
  }
453
453
 
454
- const ItemIndicator = React.forwardRef<ItemIndicatorRef, ItemIndicatorProps>(({ keepMounted, ...props }, ref) => {
454
+ const ItemIndicator = forwardRef<ItemIndicatorRef, ItemIndicatorProps>(({ keepMounted, ...props }, ref) => {
455
455
  const { itemValue } = useItemIndicatorContext();
456
456
  const { checked, value } = useFormItemContext() as BothFormItemContext;
457
457
 
@@ -475,7 +475,7 @@ const ItemIndicator = React.forwardRef<ItemIndicatorRef, ItemIndicatorProps>(({
475
475
 
476
476
  ItemIndicator.displayName = "ItemIndicatorMenubar";
477
477
 
478
- const Separator = React.forwardRef<SeparatorRef, SeparatorProps>(({ decorative, ...props }, ref) => {
478
+ const Separator = forwardRef<SeparatorRef, SeparatorProps>(({ decorative, ...props }, ref) => {
479
479
  return (
480
480
  <Component
481
481
  role={decorative ? "presentation" : "separator"}
@@ -487,14 +487,14 @@ const Separator = React.forwardRef<SeparatorRef, SeparatorProps>(({ decorative,
487
487
 
488
488
  Separator.displayName = "SeparatorMenubar";
489
489
 
490
- const SubContext = React.createContext<{
490
+ const SubContext = createContext<{
491
491
  nativeID: string;
492
492
  open: boolean;
493
493
  onOpenChange: (value: boolean) => void;
494
494
  } | null>(null);
495
495
 
496
- const Sub = React.forwardRef<SubRef, SubProps>(({ defaultOpen, open: openProp, onOpenChange: onOpenChangeProp, ...props }, ref) => {
497
- const nativeID = React.useId();
496
+ const Sub = forwardRef<SubRef, SubProps>(({ defaultOpen, open: openProp, onOpenChange: onOpenChangeProp, ...props }, ref) => {
497
+ const nativeID = useId();
498
498
  const [open = false, onOpenChange] = useControllableState({
499
499
  prop: openProp,
500
500
  defaultProp: defaultOpen,
@@ -520,19 +520,19 @@ const Sub = React.forwardRef<SubRef, SubProps>(({ defaultOpen, open: openProp, o
520
520
  Sub.displayName = "SubMenubar";
521
521
 
522
522
  function useSubContext() {
523
- const context = React.useContext(SubContext);
523
+ const context = useContext(SubContext);
524
524
  if (!context) {
525
525
  throw new Error("Sub compound components cannot be rendered outside of a Sub component");
526
526
  }
527
527
  return context;
528
528
  }
529
529
 
530
- const SubTrigger = React.forwardRef<SubTriggerRef, SubTriggerProps>(({ textValue, onPress: onPressProp, disabled = false, ...props }, ref) => {
530
+ const SubTrigger = forwardRef<SubTriggerRef, SubTriggerProps>(({ textValue, onPress: onPressProp, disabled = false, ...props }, ref) => {
531
531
  const { nativeID, open, onOpenChange } = useSubContext();
532
532
 
533
- function onPress(ev: GestureResponderEvent) {
533
+ function onPress(event: GestureResponderEvent) {
534
534
  onOpenChange(!open);
535
- onPressProp?.(ev);
535
+ onPressProp?.(event);
536
536
  }
537
537
 
538
538
  return (
@@ -553,7 +553,7 @@ const SubTrigger = React.forwardRef<SubTriggerRef, SubTriggerProps>(({ textValue
553
553
 
554
554
  SubTrigger.displayName = "SubTriggerMenubar";
555
555
 
556
- const SubContent = React.forwardRef<SubContentRef, SubContentProps>(({ render = false, keepMounted, ...props }, ref) => {
556
+ const SubContent = forwardRef<SubContentRef, SubContentProps>(({ render = false, keepMounted, ...props }, ref) => {
557
557
  const { open, nativeID } = useSubContext();
558
558
 
559
559
  if (!keepMounted) {