@brand-map/primitives 0.0.0-broken.0

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 (121) hide show
  1. package/.changeset/README.md +8 -0
  2. package/.changeset/config.json +11 -0
  3. package/.oxfmtrc.json +35 -0
  4. package/.oxlintrc.json +166 -0
  5. package/README.md +78 -0
  6. package/bun.lock +904 -0
  7. package/mise.toml +3 -0
  8. package/package.json +61 -0
  9. package/src/accordion/accordion.tsx +189 -0
  10. package/src/accordion/accordion.web.tsx +282 -0
  11. package/src/accordion/index.ts +2 -0
  12. package/src/accordion/types.ts +44 -0
  13. package/src/alert-dialog/alert-dialog.tsx +238 -0
  14. package/src/alert-dialog/alert-dialog.web.tsx +260 -0
  15. package/src/alert-dialog/index.ts +2 -0
  16. package/src/alert-dialog/types.ts +81 -0
  17. package/src/aspect-ratio/aspect-ratio.tsx +27 -0
  18. package/src/aspect-ratio/index.ts +1 -0
  19. package/src/avatar/avatar.tsx +122 -0
  20. package/src/avatar/index.ts +2 -0
  21. package/src/avatar/types.ts +20 -0
  22. package/src/checkbox/checkbox.tsx +95 -0
  23. package/src/checkbox/checkbox.web.tsx +111 -0
  24. package/src/checkbox/index.ts +2 -0
  25. package/src/checkbox/types.ts +14 -0
  26. package/src/collapsible/collapsible.tsx +98 -0
  27. package/src/collapsible/collapsible.web.tsx +149 -0
  28. package/src/collapsible/index.ts +2 -0
  29. package/src/collapsible/types.ts +23 -0
  30. package/src/context-menu/context-menu.tsx +616 -0
  31. package/src/context-menu/context-menu.web.tsx +560 -0
  32. package/src/context-menu/index.ts +2 -0
  33. package/src/context-menu/types.ts +136 -0
  34. package/src/dialog/dialog.tsx +286 -0
  35. package/src/dialog/dialog.web.tsx +215 -0
  36. package/src/dialog/index.ts +2 -0
  37. package/src/dialog/types.ts +92 -0
  38. package/src/dropdown-menu/dropdown-menu.tsx +575 -0
  39. package/src/dropdown-menu/dropdown-menu.web.tsx +565 -0
  40. package/src/dropdown-menu/index.ts +2 -0
  41. package/src/dropdown-menu/types.ts +121 -0
  42. package/src/hooks/index.ts +4 -0
  43. package/src/hooks/use-Isomorphic-layout-effect.tsx +12 -0
  44. package/src/hooks/use-augmented-ref.tsx +25 -0
  45. package/src/hooks/use-controllable-state.tsx +70 -0
  46. package/src/hooks/use-relative-position.tsx +175 -0
  47. package/src/hover-card/hover-card.tsx +255 -0
  48. package/src/hover-card/hover-card.web.tsx +161 -0
  49. package/src/hover-card/index.ts +2 -0
  50. package/src/hover-card/types.ts +56 -0
  51. package/src/label/index.ts +2 -0
  52. package/src/label/label.tsx +36 -0
  53. package/src/label/label.web.tsx +38 -0
  54. package/src/label/types.ts +24 -0
  55. package/src/menubar/index.ts +2 -0
  56. package/src/menubar/menubar.tsx +602 -0
  57. package/src/menubar/menubar.web.tsx +575 -0
  58. package/src/menubar/types.ts +126 -0
  59. package/src/navigation-menu/index.ts +2 -0
  60. package/src/navigation-menu/navigation-menu.tsx +302 -0
  61. package/src/navigation-menu/navigation-menu.web.tsx +259 -0
  62. package/src/navigation-menu/types.ts +85 -0
  63. package/src/popover/index.ts +2 -0
  64. package/src/popover/popover.tsx +279 -0
  65. package/src/popover/popover.web.tsx +217 -0
  66. package/src/popover/types.ts +44 -0
  67. package/src/portal/index.ts +1 -0
  68. package/src/portal/portal.tsx +56 -0
  69. package/src/progress/index.ts +2 -0
  70. package/src/progress/progress.tsx +59 -0
  71. package/src/progress/progress.web.tsx +46 -0
  72. package/src/progress/types.ts +14 -0
  73. package/src/radio-group/index.ts +2 -0
  74. package/src/radio-group/radio-group.tsx +106 -0
  75. package/src/radio-group/radio-group.web.tsx +85 -0
  76. package/src/radio-group/types.ts +24 -0
  77. package/src/select/index.ts +2 -0
  78. package/src/select/select.tsx +447 -0
  79. package/src/select/select.web.tsx +368 -0
  80. package/src/select/types.ts +145 -0
  81. package/src/separator/index.ts +2 -0
  82. package/src/separator/separator.tsx +21 -0
  83. package/src/separator/types.ts +10 -0
  84. package/src/slider/index.ts +2 -0
  85. package/src/slider/slider.tsx +77 -0
  86. package/src/slider/slider.web.tsx +75 -0
  87. package/src/slider/types.ts +39 -0
  88. package/src/slot/index.ts +1 -0
  89. package/src/slot/slot.tsx +224 -0
  90. package/src/switch/index.ts +2 -0
  91. package/src/switch/switch.tsx +49 -0
  92. package/src/switch/switch.web.tsx +60 -0
  93. package/src/switch/types.ts +19 -0
  94. package/src/table/index.ts +1 -0
  95. package/src/table/table.tsx +121 -0
  96. package/src/tabs/index.ts +2 -0
  97. package/src/tabs/tabs.tsx +120 -0
  98. package/src/tabs/tabs.web.tsx +106 -0
  99. package/src/tabs/types.ts +37 -0
  100. package/src/toast/index.ts +2 -0
  101. package/src/toast/toast.tsx +124 -0
  102. package/src/toast/types.ts +20 -0
  103. package/src/toggle/index.ts +2 -0
  104. package/src/toggle/toggle.tsx +35 -0
  105. package/src/toggle/toggle.web.tsx +36 -0
  106. package/src/toggle/types.ts +11 -0
  107. package/src/toggle-group/index.ts +2 -0
  108. package/src/toggle-group/toggle-group.tsx +100 -0
  109. package/src/toggle-group/toggle-group.web.tsx +103 -0
  110. package/src/toggle-group/types.ts +46 -0
  111. package/src/toolbar/index.ts +2 -0
  112. package/src/toolbar/toolbar.tsx +141 -0
  113. package/src/toolbar/toolbar.web.tsx +158 -0
  114. package/src/toolbar/types.ts +64 -0
  115. package/src/tooltip/index.ts +2 -0
  116. package/src/tooltip/tooltip.tsx +261 -0
  117. package/src/tooltip/tooltip.web.tsx +175 -0
  118. package/src/tooltip/types.ts +61 -0
  119. package/src/types/index.ts +141 -0
  120. package/src/utils/index.ts +69 -0
  121. package/tsconfig.json +23 -0
@@ -0,0 +1,575 @@
1
+ // import * as Menubar from "@radix-ui/react-menubar";
2
+ // import * as React from "react";
3
+ // import { GestureResponderEvent, Pressable, Text, View } from "react-native";
4
+
5
+ // import { useAugmentedRef, useControllableState, useIsomorphicLayoutEffect } from "../hooks";
6
+ // import * as Slot from "../slot";
7
+ // import { EmptyGestureResponderEvent } from "../utils";
8
+
9
+ // import type {
10
+ // CheckboxItemProps,
11
+ // CheckboxItemRef,
12
+ // ContentProps,
13
+ // ContentRef,
14
+ // GroupProps,
15
+ // GroupRef,
16
+ // ItemIndicatorProps,
17
+ // ItemIndicatorRef,
18
+ // ItemProps,
19
+ // ItemRef,
20
+ // LabelProps,
21
+ // LabelRef,
22
+ // MenuProps,
23
+ // MenuRef,
24
+ // BackdropProps,
25
+ // BackdropRef,
26
+ // PortalProps,
27
+ // RadioGroupProps,
28
+ // RadioGroupRef,
29
+ // RadioItemProps,
30
+ // RadioItemRef,
31
+ // RootProps,
32
+ // RootRef,
33
+ // SeparatorProps,
34
+ // SeparatorRef,
35
+ // SubContentProps,
36
+ // SubContentRef,
37
+ // SubProps,
38
+ // SubRef,
39
+ // SubTriggerProps,
40
+ // SubTriggerRef,
41
+ // TriggerProps,
42
+ // TriggerRef,
43
+ // } from "./types";
44
+
45
+ // const RootContext = React.createContext<RootProps | null>(null);
46
+
47
+ // const Root = React.forwardRef<RootRef, RootProps>(({ value, onValueChange, ...viewProps }, ref) => {
48
+ //
49
+ // return (
50
+ // <RootContext.Provider value={{ value, onValueChange }}>
51
+ // <Menubar.Root
52
+ // value={value}
53
+ // onValueChange={onValueChange}
54
+ // >
55
+ // <Component
56
+ // ref={ref}
57
+ // {...viewProps}
58
+ // />
59
+ // </Menubar.Root>
60
+ // </RootContext.Provider>
61
+ // );
62
+ // });
63
+
64
+ // Root.displayName = "RootWebMenubar";
65
+
66
+ // function useRootContext() {
67
+ // const context = React.useContext(RootContext);
68
+ // if (!context) {
69
+ // throw new Error("Menubar compound components cannot be rendered outside the Menubar component");
70
+ // }
71
+ // return context;
72
+ // }
73
+
74
+ // const MenuContext = React.createContext<MenuProps | null>(null);
75
+
76
+ // const Menu = React.forwardRef<MenuRef, MenuProps>(({ value, ...viewProps }, ref) => {
77
+ //
78
+ // return (
79
+ // <MenuContext.Provider value={{ value }}>
80
+ // <Menubar.Menu value={value}>
81
+ // <Component
82
+ // ref={ref}
83
+ // {...viewProps}
84
+ // />
85
+ // </Menubar.Menu>
86
+ // </MenuContext.Provider>
87
+ // );
88
+ // });
89
+
90
+ // Menu.displayName = "MenuWebMenubar";
91
+
92
+ // function useMenuContext() {
93
+ // const context = React.useContext(MenuContext);
94
+ // if (!context) {
95
+ // throw new Error("Menubar compound components cannot be rendered outside the Menubar component");
96
+ // }
97
+ // return context;
98
+ // }
99
+
100
+ // const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ disabled = false, ...props }, ref) => {
101
+ // const augmentedRef = useAugmentedRef({ ref });
102
+ // const { value: menuValue } = useMenuContext();
103
+ // const { value } = useRootContext();
104
+
105
+ // useIsomorphicLayoutEffect(() => {
106
+ // if (augmentedRef.current) {
107
+ // const augRef = augmentedRef.current as unknown as HTMLDivElement;
108
+ // augRef.dataset.state = value && menuValue === value ? "open" : "closed";
109
+ // }
110
+ // }, [value && menuValue]);
111
+
112
+ // useIsomorphicLayoutEffect(() => {
113
+ // if (augmentedRef.current) {
114
+ // const augRef = augmentedRef.current as unknown as HTMLDivElement;
115
+ // if (disabled) {
116
+ // augRef.dataset.disabled = "true";
117
+ // } else {
118
+ // augRef.dataset.disabled = undefined;
119
+ // }
120
+ // }
121
+ // }, [disabled]);
122
+
123
+ //
124
+ // return (
125
+ // <Menubar.Trigger
126
+ // disabled={disabled ?? undefined}
127
+ // render
128
+ // >
129
+ // <Component
130
+ // ref={augmentedRef}
131
+ // disabled={disabled}
132
+ // {...props}
133
+ // />
134
+ // </Menubar.Trigger>
135
+ // );
136
+ // });
137
+
138
+ // Trigger.displayName = "TriggerWebMenubar";
139
+
140
+ // function Portal({ keepMounted, container, children }: PortalProps) {
141
+ // return (
142
+ // <Menubar.Portal
143
+ // keepMounted={keepMounted}
144
+ // container={container}
145
+ // children={children}
146
+ // />
147
+ // );
148
+ // }
149
+
150
+ // const Backdrop = React.forwardRef<BackdropRef, BackdropProps>(({ ...props }, ref) => {
151
+ //
152
+ // return (
153
+ // <Component
154
+ // ref={ref}
155
+ // {...props}
156
+ // />
157
+ // );
158
+ // });
159
+
160
+ // Backdrop.displayName = "BackdropWebMenubar";
161
+
162
+ // const MenubarContentContext = React.createContext<{
163
+ // close: () => void;
164
+ // } | null>(null);
165
+
166
+ // const Content = React.forwardRef<ContentRef, ContentProps>(
167
+ // (
168
+ // {
169
+ // render = false,
170
+ // keepMounted,
171
+ // align,
172
+ // side,
173
+ // sideOffset,
174
+ // alignOffset = 0,
175
+ // avoidCollisions = true,
176
+ // insets,
177
+ // loop,
178
+ // onCloseAutoFocus,
179
+ // onEscapeKeyDown,
180
+ // onPointerDownOutside,
181
+ // onFocusOutside,
182
+ // onInteractOutside,
183
+ // collisionBoundary,
184
+ // sticky,
185
+ // hideWhenDetached,
186
+ // ...props
187
+ // },
188
+ // ref,
189
+ // ) => {
190
+ // const itemRef = React.useRef<HTMLDivElement>(null);
191
+
192
+ // function close() {
193
+ // itemRef.current?.click();
194
+ // }
195
+
196
+ //
197
+ // return (
198
+ // <MenubarContentContext.Provider value={{ close }}>
199
+ // <Menubar.Content
200
+ // keepMounted={keepMounted}
201
+ // alignOffset={alignOffset}
202
+ // avoidCollisions={avoidCollisions}
203
+ // collisionPadding={insets}
204
+ // loop={loop}
205
+ // onCloseAutoFocus={onCloseAutoFocus}
206
+ // onEscapeKeyDown={onEscapeKeyDown}
207
+ // onPointerDownOutside={onPointerDownOutside}
208
+ // onFocusOutside={onFocusOutside}
209
+ // onInteractOutside={onInteractOutside}
210
+ // collisionBoundary={collisionBoundary}
211
+ // sticky={sticky}
212
+ // hideWhenDetached={hideWhenDetached}
213
+ // align={align}
214
+ // side={side}
215
+ // sideOffset={sideOffset}
216
+ // >
217
+ // <Component
218
+ // ref={ref}
219
+ // {...props}
220
+ // />
221
+ // <Menubar.Item
222
+ // ref={itemRef}
223
+ // aria-hidden
224
+ // style={{ position: "fixed", top: 0, left: 0, zIndex: -999999999 }}
225
+ // aria-disabled
226
+ // tabIndex={-1}
227
+ // hidden
228
+ // />
229
+ // </Menubar.Content>
230
+ // </MenubarContentContext.Provider>
231
+ // );
232
+ // },
233
+ // );
234
+
235
+ // Content.displayName = "ContentWebMenubar";
236
+
237
+ // function useMenubarContentContext() {
238
+ // const context = React.useContext(MenubarContentContext);
239
+ // if (!context) {
240
+ // throw new Error("MenubarContent compound components cannot be rendered outside the MenubarContent component");
241
+ // }
242
+ // return context;
243
+ // }
244
+
245
+ // const Item = React.forwardRef<ItemRef, ItemProps>(
246
+ // ({ render, textValue, closeOnPress = true, onPress: onPressProp, onKeyDown: onKeyDownProp, ...props }, ref) => {
247
+ // const { close } = useMenubarContentContext();
248
+
249
+ // function onKeyDown(ev: React.KeyboardEvent) {
250
+ // onKeyDownProp?.(ev);
251
+ // if (ev.key === "Enter" || ev.key === " ") {
252
+ // onPressProp?.(EmptyGestureResponderEvent);
253
+ // if (closeOnPress) {
254
+ // close();
255
+ // }
256
+ // }
257
+ // }
258
+
259
+ // function onPress(ev: GestureResponderEvent) {
260
+ // onPressProp?.(ev);
261
+ // if (closeOnPress) {
262
+ // close();
263
+ // }
264
+ // }
265
+
266
+ //
267
+ // return (
268
+ // <Menubar.Item
269
+ // textValue={textValue}
270
+ // disabled={props.disabled ?? undefined}
271
+ // onSelect={closeOnPress ? undefined : onSelected}
272
+ // render
273
+ // >
274
+ // <Component
275
+ // ref={ref}
276
+ // // @ts-expect-error web only
277
+ // onKeyDown={onKeyDown}
278
+ // onPress={onPress}
279
+ // {...props}
280
+ // />
281
+ // </Menubar.Item>
282
+ // );
283
+ // },
284
+ // );
285
+
286
+ // Item.displayName = "ItemWebMenubar";
287
+
288
+ // const Group = React.forwardRef<GroupRef, GroupProps>(({ ...props }, ref) => {
289
+ //
290
+ // return (
291
+ // <Menubar.Group render>
292
+ // <Component
293
+ // ref={ref}
294
+ // {...props}
295
+ // />
296
+ // </Menubar.Group>
297
+ // );
298
+ // });
299
+
300
+ // Group.displayName = "GroupWebMenubar";
301
+
302
+ // const Label = React.forwardRef<LabelRef, LabelProps>(({ ...props }, ref) => {
303
+ //
304
+ // return (
305
+ // <Menubar.Label render>
306
+ // <Component
307
+ // ref={ref}
308
+ // {...props}
309
+ // />
310
+ // </Menubar.Label>
311
+ // );
312
+ // });
313
+
314
+ // Label.displayName = "LabelWebMenubar";
315
+
316
+ // const CheckboxItem = React.forwardRef<CheckboxItemRef, CheckboxItemProps>(
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 === " ") {
321
+ // onPressProp?.(EmptyGestureResponderEvent);
322
+ // onCheckedChange?.(!checked);
323
+ // if (closeOnPress) {
324
+ // close();
325
+ // }
326
+ // }
327
+ // }
328
+
329
+ // function onPress(ev: GestureResponderEvent) {
330
+ // onPressProp?.(ev);
331
+ // onCheckedChange?.(!checked);
332
+ // if (closeOnPress) {
333
+ // close();
334
+ // }
335
+ // }
336
+ //
337
+ // return (
338
+ // <Menubar.CheckboxItem
339
+ // textValue={textValue}
340
+ // checked={checked}
341
+ // onCheckedChange={onCheckedChange}
342
+ // onSelect={closeOnPress ? undefined : onSelected}
343
+ // disabled={disabled ?? undefined}
344
+ // render
345
+ // >
346
+ // <Component
347
+ // ref={ref}
348
+ // // @ts-expect-error web only
349
+ // onKeyDown={onKeyDown}
350
+ // onPress={onPress}
351
+ // role="button"
352
+ // {...props}
353
+ // />
354
+ // </Menubar.CheckboxItem>
355
+ // );
356
+ // },
357
+ // );
358
+
359
+ // CheckboxItem.displayName = "CheckboxItemWebMenubar";
360
+
361
+ // const MenubarRadioGroupContext = React.createContext<{
362
+ // value?: string;
363
+ // onValueChange?: (value: string) => void;
364
+ // } | null>(null);
365
+
366
+ // const RadioGroup = React.forwardRef<RadioGroupRef, RadioGroupProps>(({ value, onValueChange, ...props }, ref) => {
367
+ //
368
+ // return (
369
+ // <MenubarRadioGroupContext.Provider value={{ value, onValueChange }}>
370
+ // <Menubar.RadioGroup
371
+ // value={value}
372
+ // onValueChange={onValueChange}
373
+ // render
374
+ // >
375
+ // <Component
376
+ // ref={ref}
377
+ // {...props}
378
+ // />
379
+ // </Menubar.RadioGroup>
380
+ // </MenubarRadioGroupContext.Provider>
381
+ // );
382
+ // });
383
+
384
+ // RadioGroup.displayName = "RadioGroupWebMenubar";
385
+
386
+ // function useMenubarRadioGroupContext() {
387
+ // const context = React.useContext(MenubarRadioGroupContext);
388
+ // if (!context) {
389
+ // throw new Error("MenubarRadioGroup compound components cannot be rendered outside the MenubarRadioGroup component");
390
+ // }
391
+ // return context;
392
+ // }
393
+
394
+ // const RadioItem = React.forwardRef<RadioItemRef, RadioItemProps>(
395
+ // ({ render, value, textValue, closeOnPress = true, onPress: onPressProp, onKeyDown: onKeyDownProp, ...props }, ref) => {
396
+ // const { onValueChange } = useMenubarRadioGroupContext();
397
+ // const { close } = useMenubarContentContext();
398
+
399
+ // function onKeyDown(ev: React.KeyboardEvent) {
400
+ // onKeyDownProp?.(ev);
401
+ // if (ev.key === "Enter" || ev.key === " ") {
402
+ // onValueChange?.(value);
403
+ // onPressProp?.(EmptyGestureResponderEvent);
404
+ // if (closeOnPress) {
405
+ // close();
406
+ // }
407
+ // }
408
+ // }
409
+
410
+ // function onPress(ev: GestureResponderEvent) {
411
+ // onValueChange?.(value);
412
+ // onPressProp?.(ev);
413
+ // if (closeOnPress) {
414
+ // close();
415
+ // }
416
+ // }
417
+ //
418
+ // return (
419
+ // <Menubar.RadioItem
420
+ // value={value}
421
+ // textValue={textValue}
422
+ // disabled={props.disabled ?? undefined}
423
+ // onSelect={closeOnPress ? undefined : onSelected}
424
+ // render
425
+ // >
426
+ // <Component
427
+ // ref={ref}
428
+ // // @ts-expect-error web only
429
+ // onKeyDown={onKeyDown}
430
+ // onPress={onPress}
431
+ // {...props}
432
+ // />
433
+ // </Menubar.RadioItem>
434
+ // );
435
+ // },
436
+ // );
437
+
438
+ // RadioItem.displayName = "RadioItemWebMenubar";
439
+
440
+ // const ItemIndicator = React.forwardRef<ItemIndicatorRef, ItemIndicatorProps>(({ keepMounted, ...props }, ref) => {
441
+ //
442
+ // return (
443
+ // <Menubar.ItemIndicator
444
+ // keepMounted={keepMounted}
445
+ // render
446
+ // >
447
+ // <Component
448
+ // ref={ref}
449
+ // {...props}
450
+ // />
451
+ // </Menubar.ItemIndicator>
452
+ // );
453
+ // });
454
+
455
+ // ItemIndicator.displayName = "ItemIndicatorWebMenubar";
456
+
457
+ // const Separator = React.forwardRef<SeparatorRef, SeparatorProps>(({ decorative, ...props }, ref) => {
458
+ //
459
+ // return (
460
+ // <Menubar.Separator render>
461
+ // <Component
462
+ // ref={ref}
463
+ // {...props}
464
+ // />
465
+ // </Menubar.Separator>
466
+ // );
467
+ // });
468
+
469
+ // Separator.displayName = "SeparatorWebMenubar";
470
+
471
+ // const MenubarSubContext = React.createContext<{
472
+ // open: boolean;
473
+ // onOpenChange: (open: boolean) => void;
474
+ // } | null>(null);
475
+
476
+ // const Sub = React.forwardRef<SubRef, SubProps>(({ defaultOpen, open: openProp, onOpenChange: onOpenChangeProp, ...props }, ref) => {
477
+ // const [open = false, onOpenChange] = useControllableState({
478
+ // prop: openProp,
479
+ // defaultProp: defaultOpen,
480
+ // onChange: onOpenChangeProp,
481
+ // });
482
+ //
483
+ // return (
484
+ // <MenubarSubContext.Provider value={{ open, onOpenChange }}>
485
+ // <Menubar.Sub
486
+ // open={open}
487
+ // onOpenChange={onOpenChange}
488
+ // >
489
+ // <Component
490
+ // ref={ref}
491
+ // {...props}
492
+ // />
493
+ // </Menubar.Sub>
494
+ // </MenubarSubContext.Provider>
495
+ // );
496
+ // });
497
+
498
+ // Sub.displayName = "SubWebMenubar";
499
+
500
+ // function useSubContext() {
501
+ // const context = React.useContext(MenubarSubContext);
502
+ // if (!context) {
503
+ // throw new Error("MenubarSub compound components cannot be rendered outside the MenubarSub component");
504
+ // }
505
+ // return context;
506
+ // }
507
+
508
+ // const SubTrigger = React.forwardRef<SubTriggerRef, SubTriggerProps>(({ textValue, disabled = false, onPress: onPressProp, ...props }, ref) => {
509
+ // const { onOpenChange } = useSubContext();
510
+
511
+ // function onPress(ev: GestureResponderEvent) {
512
+ // onOpenChange(true);
513
+ // onPressProp?.(ev);
514
+ // }
515
+
516
+ //
517
+ // return (
518
+ // <Menubar.SubTrigger
519
+ // disabled={disabled ?? undefined}
520
+ // textValue={textValue}
521
+ // render
522
+ // >
523
+ // <Component
524
+ // ref={ref}
525
+ // onPress={onPress}
526
+ // {...props}
527
+ // />
528
+ // </Menubar.SubTrigger>
529
+ // );
530
+ // });
531
+
532
+ // SubTrigger.displayName = "SubTriggerWebMenubar";
533
+
534
+ // const SubContent = React.forwardRef<SubContentRef, SubContentProps>(({ render = false, keepMounted, ...props }, ref) => {
535
+ //
536
+ // return (
537
+ // <Menubar.Portal>
538
+ // <Menubar.SubContent keepMounted={keepMounted}>
539
+ // <Component
540
+ // ref={ref}
541
+ // {...props}
542
+ // />
543
+ // </Menubar.SubContent>
544
+ // </Menubar.Portal>
545
+ // );
546
+ // });
547
+
548
+ // Content.displayName = "ContentWebMenubar";
549
+
550
+ // export {
551
+ // CheckboxItem,
552
+ // Content,
553
+ // Group,
554
+ // Item,
555
+ // ItemIndicator,
556
+ // Label,
557
+ // Menu,
558
+ // Backdrop,
559
+ // Portal,
560
+ // RadioGroup,
561
+ // RadioItem,
562
+ // Root,
563
+ // Separator,
564
+ // Sub,
565
+ // SubContent,
566
+ // SubTrigger,
567
+ // Trigger,
568
+ // useMenuContext,
569
+ // useRootContext,
570
+ // useSubContext,
571
+ // };
572
+
573
+ // function onSelected(ev: Event) {
574
+ // ev.preventDefault();
575
+ // }
@@ -0,0 +1,126 @@
1
+ import { KeepMountable, PositionedContentProps, PressableRef, RenderPressableProps, RenderTextProps, RenderViewProps, TextRef, ViewRef } from "../types";
2
+
3
+ type RootProps = RenderViewProps & {
4
+ value: string | undefined;
5
+ onValueChange: (value: string | undefined) => void;
6
+ };
7
+
8
+ type MenuProps = RenderViewProps & {
9
+ value: string | undefined;
10
+ };
11
+
12
+ interface PortalProps extends KeepMountable {
13
+ children: React.ReactNode;
14
+
15
+ /**
16
+ * @platform: NATIVE ONLY
17
+ */
18
+ hostName?: string;
19
+
20
+ /**
21
+ * @platform: WEB ONLY
22
+ */
23
+ container?: HTMLElement | null | undefined;
24
+ }
25
+
26
+ type BackdropProps = KeepMountable &
27
+ RenderPressableProps & {
28
+ closeOnPress?: boolean;
29
+ };
30
+
31
+ type ItemProps = RenderPressableProps & {
32
+ textValue?: string;
33
+ closeOnPress?: boolean;
34
+ };
35
+
36
+ type CheckboxItemProps = RenderPressableProps & {
37
+ checked: boolean;
38
+ onCheckedChange: (checked: boolean) => void;
39
+ closeOnPress?: boolean;
40
+ textValue?: string;
41
+ };
42
+
43
+ type RadioGroupProps = RenderViewProps & {
44
+ value: string | undefined;
45
+ onValueChange: (value: string) => void;
46
+ };
47
+
48
+ type RadioItemProps = RenderPressableProps & {
49
+ value: string;
50
+ textValue?: string;
51
+ closeOnPress?: boolean;
52
+ };
53
+
54
+ type SeparatorProps = RenderViewProps & {
55
+ decorative?: boolean;
56
+ };
57
+
58
+ type SubProps = RenderViewProps & {
59
+ defaultOpen?: boolean;
60
+ open?: boolean;
61
+ onOpenChange?: (value: boolean) => void;
62
+ };
63
+
64
+ type SubTriggerProps = RenderPressableProps & {
65
+ textValue?: string;
66
+ };
67
+
68
+ type TriggerProps = RenderPressableProps;
69
+ type ContentProps = RenderViewProps & PositionedContentProps;
70
+ type SubContentProps = RenderViewProps & KeepMountable;
71
+ type ItemIndicatorProps = RenderViewProps & KeepMountable;
72
+ type GroupProps = RenderViewProps;
73
+ type LabelProps = RenderTextProps;
74
+
75
+ type CheckboxItemRef = PressableRef;
76
+ type ContentRef = ViewRef;
77
+ type GroupRef = ViewRef;
78
+ type ItemIndicatorRef = ViewRef;
79
+ type ItemRef = PressableRef;
80
+ type LabelRef = TextRef;
81
+ type MenuRef = ViewRef;
82
+ type BackdropRef = PressableRef;
83
+ type RadioGroupRef = ViewRef;
84
+ type RadioItemRef = PressableRef;
85
+ type RootRef = ViewRef;
86
+ type SeparatorRef = ViewRef;
87
+ type SubContentRef = ViewRef;
88
+ type SubRef = ViewRef;
89
+ type SubTriggerRef = PressableRef;
90
+ type TriggerRef = PressableRef;
91
+
92
+ export type {
93
+ CheckboxItemProps,
94
+ CheckboxItemRef,
95
+ ContentProps,
96
+ ContentRef,
97
+ GroupProps,
98
+ GroupRef,
99
+ ItemIndicatorProps,
100
+ ItemIndicatorRef,
101
+ ItemProps,
102
+ ItemRef,
103
+ LabelProps,
104
+ LabelRef,
105
+ MenuProps,
106
+ MenuRef,
107
+ BackdropProps,
108
+ BackdropRef,
109
+ PortalProps,
110
+ RadioGroupProps,
111
+ RadioGroupRef,
112
+ RadioItemProps,
113
+ RadioItemRef,
114
+ RootProps,
115
+ RootRef,
116
+ SeparatorProps,
117
+ SeparatorRef,
118
+ SubContentProps,
119
+ SubContentRef,
120
+ SubProps,
121
+ SubRef,
122
+ SubTriggerProps,
123
+ SubTriggerRef,
124
+ TriggerProps,
125
+ TriggerRef,
126
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./navigation-menu";
2
+ export * from "./types";