@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,56 @@
1
+ import type { KeepMountable, PositionedContentProps, PressableRef, RenderPressableProps, RenderViewProps, ViewRef } from "../types";
2
+
3
+ interface SharedRootContext {
4
+ open: boolean;
5
+ onOpenChange: (value: boolean) => void;
6
+ openDelay?: number;
7
+ closeDelay?: number;
8
+ }
9
+
10
+ type RootProps = RenderViewProps & {
11
+ onOpenChange?: (open: boolean) => void;
12
+
13
+ /**
14
+ * @platform: WEB ONLY
15
+ * @default 700
16
+ */
17
+ openDelay?: number;
18
+
19
+ /**
20
+ * @platform: WEB ONLY
21
+ * @default 300
22
+ */
23
+ closeDelay?: number;
24
+ };
25
+
26
+ interface PortalProps extends KeepMountable {
27
+ children: React.ReactNode;
28
+
29
+ /**
30
+ * @platform: NATIVE ONLY
31
+ */
32
+ hostName?: string;
33
+
34
+ /**
35
+ * @platform: WEB ONLY
36
+ */
37
+ container?: HTMLElement | null | undefined;
38
+ }
39
+
40
+ type BackdropProps = KeepMountable &
41
+ RenderPressableProps & {
42
+ closeOnPress?: boolean;
43
+ };
44
+
45
+ type TriggerProps = RenderPressableProps;
46
+ type ContentProps = RenderViewProps & PositionedContentProps;
47
+
48
+ type BackdropRef = PressableRef;
49
+ type RootRef = ViewRef;
50
+ type TriggerRef = PressableRef & {
51
+ open: () => void;
52
+ close: () => void;
53
+ };
54
+ type ContentRef = ViewRef;
55
+
56
+ export type { ContentProps, ContentRef, BackdropProps, BackdropRef, PortalProps, SharedRootContext, RootProps, RootRef, TriggerProps, TriggerRef };
@@ -0,0 +1,2 @@
1
+ export * from "./label";
2
+ export * from "./types";
@@ -0,0 +1,36 @@
1
+ import * as React from "react";
2
+ import { Pressable, Text as ReactNativeText } from "react-native";
3
+
4
+ import * as Slot from "../slot";
5
+
6
+ import type { RootProps, TextProps } from "./types";
7
+
8
+ const Root = ({ render, ...props }: RootProps) => {
9
+ if (render) {
10
+ return (
11
+ <Slot.Pressable
12
+ render={render}
13
+ {...props}
14
+ />
15
+ );
16
+ }
17
+
18
+ return <Pressable {...props} />;
19
+ };
20
+ Root.displayName = "RootNativeLabel";
21
+
22
+ const Text = ({ render, ...props }: TextProps) => {
23
+ if (render) {
24
+ return (
25
+ <Slot.Text
26
+ render={render}
27
+ {...props}
28
+ />
29
+ );
30
+ }
31
+
32
+ return <ReactNativeText {...props} />;
33
+ };
34
+ Text.displayName = "TextNativeLabel";
35
+
36
+ export { Root, Text };
@@ -0,0 +1,38 @@
1
+ // import * as Label from "@radix-ui/react-label";
2
+ // import * as React from "react";
3
+ // import { Pressable, Text as RNText } from "react-native";
4
+
5
+ // import * as Slot from "../slot";
6
+
7
+ // import type { RootProps, RootRef, TextProps, TextRef } from "./types";
8
+
9
+ // const Root = React.forwardRef<RootRef, RootProps>(({ tabIndex = -1, ...props }, ref) => {
10
+ //
11
+ // return (
12
+ // <Component
13
+ // ref={ref}
14
+ // tabIndex={tabIndex}
15
+ // {...props}
16
+ // />
17
+ // );
18
+ // });
19
+ // Root.displayName = "RootWebLabel";
20
+
21
+ // const Text = React.forwardRef<TextRef, TextProps>(({ nativeID, htmlFor, ...props }, ref) => {
22
+ // const Component = render ? Slot.Text : RNText;
23
+ // return (
24
+ // <Label.Root
25
+ // render={!htmlFor}
26
+ // id={nativeID}
27
+ // htmlFor={htmlFor}
28
+ // >
29
+ // <Component
30
+ // ref={ref}
31
+ // {...props}
32
+ // />
33
+ // </Label.Root>
34
+ // );
35
+ // });
36
+ // Text.displayName = "TextWebLabel";
37
+
38
+ // export { Root, Text };
@@ -0,0 +1,24 @@
1
+ import type { ViewStyle } from "react-native";
2
+
3
+ import type { PressableRef, RenderPressableProps, RenderTextProps, TextRef } from "../types";
4
+
5
+ type RootProps = Omit<RenderPressableProps, "children" | "hitSlop" | "style"> & {
6
+ children: React.ReactNode;
7
+ style?: ViewStyle;
8
+ };
9
+
10
+ type TextProps = RenderTextProps & {
11
+ /**
12
+ * Equivalent to `id` so that the same value can be passed as `aria-labelledby` to the input element.
13
+ */
14
+ nativeID?: string;
15
+
16
+ /**
17
+ * WEB ONLY
18
+ */
19
+ htmlFor?: string;
20
+ };
21
+
22
+ type RootRef = PressableRef;
23
+
24
+ export type { RootProps, RootRef, TextProps, TextRef };
@@ -0,0 +1,2 @@
1
+ export * from "./menubar";
2
+ export * from "./types";