@brand-map/primitives 0.0.0-broken.1 → 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 (68) 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/.changeset/README.md +0 -8
  62. package/.changeset/config.json +0 -11
  63. package/.oxfmtrc.json +0 -35
  64. package/.oxlintrc.json +0 -166
  65. package/README.md +0 -78
  66. package/bun.lock +0 -904
  67. package/mise.toml +0 -3
  68. package/src/slot/index.ts +0 -1
@@ -1,9 +1,9 @@
1
- import * as React from "react";
1
+ import { createContext, forwardRef, useId, useState, useContext, useEffect } from "react";
2
2
  import { BackHandler, Pressable, 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
  CloseProps,
@@ -29,13 +29,13 @@ interface RootContextInterface {
29
29
  nativeID: string;
30
30
  }
31
31
 
32
- const RootContext = React.createContext<RootContextInterface | null>(null);
32
+ const RootContext = createContext<RootContextInterface | null>(null);
33
33
 
34
- const Root = React.forwardRef<RootRef, RootProps>(({ 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);
34
+ const Root = forwardRef<RootRef, RootProps>(({ onOpenChange: onOpenChangeProp, ...viewProps }, ref) => {
35
+ const nativeID = useId();
36
+ const [triggerPosition, setTriggerPosition] = useState<LayoutPosition | null>(null);
37
+ const [contentLayout, setContentLayout] = useState<LayoutRectangle | null>(null);
38
+ const [open, setOpen] = useState(false);
39
39
 
40
40
  function onOpenChange(value: boolean) {
41
41
  setOpen(value);
@@ -65,14 +65,14 @@ const Root = React.forwardRef<RootRef, RootProps>(({ onOpenChange: onOpenChangeP
65
65
  Root.displayName = "RootNativePopover";
66
66
 
67
67
  function useRootContext() {
68
- const context = React.useContext(RootContext);
68
+ const context = useContext(RootContext);
69
69
  if (!context) {
70
70
  throw new Error("Popover compound components cannot be rendered outside the Popover component");
71
71
  }
72
72
  return context;
73
73
  }
74
74
 
75
- const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, disabled = false, ...props }, ref) => {
75
+ const Trigger = forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, disabled = false, ...props }, ref) => {
76
76
  const { onOpenChange, open, setTriggerPosition } = useRootContext();
77
77
 
78
78
  const augmentedRef = useAugmentedRef({
@@ -91,13 +91,13 @@ const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressPr
91
91
  },
92
92
  });
93
93
 
94
- function onPress(ev: GestureResponderEvent) {
94
+ function onPress(event: GestureResponderEvent) {
95
95
  if (disabled) return;
96
96
  augmentedRef.current?.measure((_x, _y, width, height, pageX, pageY) => {
97
97
  setTriggerPosition({ width, pageX, pageY: pageY, height });
98
98
  });
99
99
  onOpenChange(!open);
100
- onPressProp?.(ev);
100
+ onPressProp?.(event);
101
101
  }
102
102
 
103
103
  return (
@@ -140,16 +140,16 @@ function Portal({ keepMounted, hostName, children }: PortalProps) {
140
140
  );
141
141
  }
142
142
 
143
- 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) => {
144
144
  const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext();
145
145
 
146
- function onPress(ev: GestureResponderEvent) {
146
+ function onPress(event: GestureResponderEvent) {
147
147
  if (closeOnPress) {
148
148
  setTriggerPosition(null);
149
149
  setContentLayout(null);
150
150
  onOpenChange(false);
151
151
  }
152
- OnPressProp?.(ev);
152
+ onPressProp?.(event);
153
153
  }
154
154
 
155
155
  if (!keepMounted) {
@@ -172,7 +172,7 @@ Backdrop.displayName = "BackdropNativePopover";
172
172
  /**
173
173
  * @info `position`, `top`, `left`, and `maxWidth` style properties are controlled internally. Opt out of this behavior by setting `disablePositioningStyle` to `true`.
174
174
  */
175
- const Content = React.forwardRef<ContentRef, ContentProps>(
175
+ const Content = forwardRef<ContentRef, ContentProps>(
176
176
  (
177
177
  {
178
178
  render = false,
@@ -193,7 +193,7 @@ const Content = React.forwardRef<ContentRef, ContentProps>(
193
193
  ) => {
194
194
  const { open, onOpenChange, contentLayout, nativeID, setContentLayout, setTriggerPosition, triggerPosition } = useRootContext();
195
195
 
196
- React.useEffect(() => {
196
+ useEffect(() => {
197
197
  const backHandler = BackHandler.addEventListener("hardwareBackPress", () => {
198
198
  setTriggerPosition(null);
199
199
  setContentLayout(null);
@@ -247,15 +247,15 @@ const Content = React.forwardRef<ContentRef, ContentProps>(
247
247
 
248
248
  Content.displayName = "ContentNativePopover";
249
249
 
250
- const Close = React.forwardRef<CloseRef, CloseProps>(({ onPress: onPressProp, disabled = false, ...props }, ref) => {
250
+ const Close = forwardRef<CloseRef, CloseProps>(({ onPress: onPressProp, disabled = false, ...props }, ref) => {
251
251
  const { onOpenChange, setContentLayout, setTriggerPosition } = useRootContext();
252
252
 
253
- function onPress(ev: GestureResponderEvent) {
253
+ function onPress(event: GestureResponderEvent) {
254
254
  if (disabled) return;
255
255
  setTriggerPosition(null);
256
256
  setContentLayout(null);
257
257
  onOpenChange(false);
258
- onPressProp?.(ev);
258
+ onPressProp?.(event);
259
259
  }
260
260
 
261
261
  return (
@@ -1,9 +1,9 @@
1
1
  // import * as Popover from "@radix-ui/react-popover";
2
- // import * as React from "react";
2
+ //
3
3
  // import { Pressable, View, type GestureResponderEvent } 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
 
8
8
  // import type {
9
9
  // CloseProps,
@@ -19,14 +19,14 @@
19
19
  // TriggerRef,
20
20
  // } from "./types";
21
21
 
22
- // const RootContext = React.createContext<{
22
+ // const RootContext = createContext<{
23
23
  // open: boolean;
24
24
  // onOpenChange: (open: boolean) => void;
25
25
  // } | null>(null);
26
26
 
27
- // const Root = React.forwardRef<RootRef, RootProps & { onOpenChange?: (open: boolean) => void }>(
27
+ // const Root = forwardRef<RootRef, RootProps & { onOpenChange?: (open: boolean) => void }>(
28
28
  // ({ render, onOpenChange: onOpenChangeProp, ...viewProps }, ref) => {
29
- // const [open, setOpen] = React.useState(false);
29
+ // const [open, setOpen] = useState(false);
30
30
 
31
31
  // function onOpenChange(value: boolean) {
32
32
  // setOpen(value);
@@ -52,14 +52,14 @@
52
52
  // Root.displayName = "RootWebPopover";
53
53
 
54
54
  // function useRootContext() {
55
- // const context = React.useContext(RootContext);
55
+ // const context = useContext(RootContext);
56
56
  // if (!context) {
57
57
  // throw new Error("Popover compound components cannot be rendered outside the Popover component");
58
58
  // }
59
59
  // return context;
60
60
  // }
61
61
 
62
- // const Trigger = React.forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, role: _role, disabled, ...props }, ref) => {
62
+ // const Trigger = forwardRef<TriggerRef, TriggerProps>(({ onPress: onPressProp, role: _role, disabled, ...props }, ref) => {
63
63
  // const { onOpenChange, open } = useRootContext();
64
64
  // const augmentedRef = useAugmentedRef({
65
65
  // ref,
@@ -72,9 +72,9 @@
72
72
  // },
73
73
  // },
74
74
  // });
75
- // function onPress(ev: GestureResponderEvent) {
75
+ // function onPress(event: GestureResponderEvent) {
76
76
  // if (onPressProp) {
77
- // onPressProp(ev);
77
+ // onPressProp(event);
78
78
  // }
79
79
  // onOpenChange(!open);
80
80
  // }
@@ -116,7 +116,7 @@
116
116
  // );
117
117
  // }
118
118
 
119
- // const Backdrop = React.forwardRef<BackdropRef, BackdropProps>(({ keepMounted, ...props }, ref) => {
119
+ // const Backdrop = forwardRef<BackdropRef, BackdropProps>(({ keepMounted, ...props }, ref) => {
120
120
  //
121
121
  // return (
122
122
  // <Component
@@ -128,7 +128,7 @@
128
128
 
129
129
  // Backdrop.displayName = "BackdropWebPopover";
130
130
 
131
- // const Content = React.forwardRef<ContentRef, ContentProps>(
131
+ // const Content = forwardRef<ContentRef, ContentProps>(
132
132
  // (
133
133
  // {
134
134
  // render = false,
@@ -175,13 +175,13 @@
175
175
 
176
176
  // Content.displayName = "ContentWebPopover";
177
177
 
178
- // const Close = React.forwardRef<CloseRef, CloseProps>(({ onPress: onPressProp, disabled, ...props }, ref) => {
178
+ // const Close = forwardRef<CloseRef, CloseProps>(({ onPress: onPressProp, disabled, ...props }, ref) => {
179
179
  // const augmentedRef = useAugmentedRef({ ref });
180
180
  // const { onOpenChange, open } = useRootContext();
181
181
 
182
- // function onPress(ev: GestureResponderEvent) {
182
+ // function onPress(event: GestureResponderEvent) {
183
183
  // if (onPressProp) {
184
- // onPressProp(ev);
184
+ // onPressProp(event);
185
185
  // }
186
186
  // onOpenChange(!open);
187
187
  // }
@@ -1,7 +1,7 @@
1
- import * as React from "react";
1
+ import { forwardRef, Component } from "react";
2
2
  import { View } from "react-native";
3
3
 
4
- import * as Slot from "../slot";
4
+ import * as Render from "../render";
5
5
 
6
6
  import type { IndicatorProps, IndicatorRef, RootProps, RootRef } from "./types";
7
7
 
@@ -11,7 +11,7 @@ import type { IndicatorProps, IndicatorRef, RootProps, RootRef } from "./types";
11
11
 
12
12
  const DEFAULT_MAX = 100;
13
13
 
14
- const Root = React.forwardRef<RootRef, RootProps>(({ value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, ...props }, ref) => {
14
+ const Root = forwardRef<RootRef, RootProps>(({ value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, ...props }, ref) => {
15
15
  const max = maxProp ?? DEFAULT_MAX;
16
16
  const value = isValidValueNumber(valueProp, max) ? valueProp : 0;
17
17
 
@@ -36,7 +36,7 @@ const Root = React.forwardRef<RootRef, RootProps>(({ value: valueProp, max: maxP
36
36
 
37
37
  Root.displayName = "RootProgress";
38
38
 
39
- const Indicator = React.forwardRef<IndicatorRef, IndicatorProps>(({ ...props }, ref) => {
39
+ const Indicator = forwardRef<IndicatorRef, IndicatorProps>(({ ...props }, ref) => {
40
40
  return (
41
41
  <Component
42
42
  ref={ref}
@@ -1,14 +1,14 @@
1
1
  // import * as Progress from "@radix-ui/react-progress";
2
- // import * as React from "react";
2
+ //
3
3
  // import { View } from "react-native";
4
4
 
5
- // import * as Slot from "../slot";
5
+ // import * as Render from "../render";
6
6
 
7
7
  // import type { IndicatorProps, IndicatorRef, RootProps, RootRef } from "./types";
8
8
 
9
- // const ProgressContext = React.createContext<RootProps | null>(null);
9
+ // const ProgressContext = createContext<RootProps | null>(null);
10
10
 
11
- // const Root = React.forwardRef<RootRef, RootProps>(({ value, max, getValueLabel, ...props }, ref) => {
11
+ // const Root = forwardRef<RootRef, RootProps>(({ value, max, getValueLabel, ...props }, ref) => {
12
12
  //
13
13
  // return (
14
14
  // <ProgressContext.Provider value={{ value, max }}>
@@ -29,7 +29,7 @@
29
29
 
30
30
  // Root.displayName = "RootProgress";
31
31
 
32
- // const Indicator = React.forwardRef<IndicatorRef, IndicatorProps>(({ ...props }, ref) => {
32
+ // const Indicator = forwardRef<IndicatorRef, IndicatorProps>(({ ...props }, ref) => {
33
33
  //
34
34
  // return (
35
35
  // <Progress.Indicator render>
@@ -1,13 +1,13 @@
1
- import * as React from "react";
1
+ import { createContext, forwardRef, useContext } from "react";
2
2
  import { Pressable, View, type GestureResponderEvent } from "react-native";
3
3
 
4
- import * as Slot from "../slot";
4
+ import * as Render from "../render";
5
5
 
6
6
  import type { IndicatorProps, IndicatorRef, ItemProps, ItemRef, RootProps, RootRef } from "./types";
7
7
 
8
- const RadioGroupContext = React.createContext<RootProps | null>(null);
8
+ const RadioGroupContext = createContext<RootProps | null>(null);
9
9
 
10
- const Root = React.forwardRef<RootRef, RootProps>(({ value, onValueChange, disabled = false, ...viewProps }, ref) => {
10
+ const Root = forwardRef<RootRef, RootProps>(({ value, onValueChange, disabled = false, ...viewProps }, ref) => {
11
11
  return (
12
12
  <RadioGroupContext.Provider
13
13
  value={{
@@ -28,7 +28,7 @@ const Root = React.forwardRef<RootRef, RootProps>(({ value, onValueChange, disab
28
28
  Root.displayName = "RootRadioGroup";
29
29
 
30
30
  function useRadioGroupContext() {
31
- const context = React.useContext(RadioGroupContext);
31
+ const context = useContext(RadioGroupContext);
32
32
  if (!context) {
33
33
  throw new Error("RadioGroup compound components cannot be rendered outside the RadioGroup component");
34
34
  }
@@ -39,15 +39,15 @@ interface RadioItemContext {
39
39
  itemValue: string | undefined;
40
40
  }
41
41
 
42
- const RadioItemContext = React.createContext<RadioItemContext | null>(null);
42
+ const RadioItemContext = createContext<RadioItemContext | null>(null);
43
43
 
44
- const Item = React.forwardRef<ItemRef, ItemProps>(({ value: itemValue, disabled: disabledProp = false, onPress: onPressProp, ...props }, ref) => {
44
+ const Item = forwardRef<ItemRef, ItemProps>(({ value: itemValue, disabled: disabledProp = false, onPress: onPressProp, ...props }, ref) => {
45
45
  const { disabled, value, onValueChange } = useRadioGroupContext();
46
46
 
47
- function onPress(ev: GestureResponderEvent) {
47
+ function onPress(event: GestureResponderEvent) {
48
48
  if (disabled || disabledProp) return;
49
49
  onValueChange(itemValue);
50
- onPressProp?.(ev);
50
+ onPressProp?.(event);
51
51
  }
52
52
 
53
53
  return (
@@ -75,14 +75,14 @@ const Item = React.forwardRef<ItemRef, ItemProps>(({ value: itemValue, disabled:
75
75
  Item.displayName = "ItemRadioGroup";
76
76
 
77
77
  function useRadioItemContext() {
78
- const context = React.useContext(RadioItemContext);
78
+ const context = useContext(RadioItemContext);
79
79
  if (!context) {
80
80
  throw new Error("RadioItem compound components cannot be rendered outside the RadioItem component");
81
81
  }
82
82
  return context;
83
83
  }
84
84
 
85
- const Indicator = React.forwardRef<IndicatorRef, IndicatorProps>(({ keepMounted, ...props }, ref) => {
85
+ const Indicator = forwardRef<IndicatorRef, IndicatorProps>(({ keepMounted, ...props }, ref) => {
86
86
  const { value } = useRadioGroupContext();
87
87
  const { itemValue } = useRadioItemContext();
88
88
 
@@ -1,14 +1,14 @@
1
1
  // import * as RadioGroup from "@radix-ui/react-radio-group";
2
- // import * as React from "react";
2
+ //
3
3
  // import { GestureResponderEvent, Pressable, View } from "react-native";
4
4
 
5
- // import * as Slot from "../slot";
5
+ // import * as Render from "../render";
6
6
 
7
7
  // import type { IndicatorProps, IndicatorRef, ItemProps, ItemRef, RootProps, RootRef } from "./types";
8
8
 
9
- // const RadioGroupContext = React.createContext<RootProps | null>(null);
9
+ // const RadioGroupContext = createContext<RootProps | null>(null);
10
10
 
11
- // const Root = React.forwardRef<RootRef, RootProps>(({ value, onValueChange, disabled = false, ...viewProps }, ref) => {
11
+ // const Root = forwardRef<RootRef, RootProps>(({ value, onValueChange, disabled = false, ...viewProps }, ref) => {
12
12
  //
13
13
  // return (
14
14
  // <RadioGroupContext.Provider
@@ -35,18 +35,18 @@
35
35
 
36
36
  // Root.displayName = "RootRadioGroup";
37
37
  // function useRadioGroupContext() {
38
- // const context = React.useContext(RadioGroupContext);
38
+ // const context = useContext(RadioGroupContext);
39
39
  // if (!context) {
40
40
  // throw new Error("RadioGroup compound components cannot be rendered outside the RadioGroup component");
41
41
  // }
42
42
  // return context;
43
43
  // }
44
- // const Item = React.forwardRef<ItemRef, ItemProps>(({ value, onPress: onPressProps, ...props }, ref) => {
44
+ // const Item = forwardRef<ItemRef, ItemProps>(({ value, onPress: onPressProps, ...props }, ref) => {
45
45
  // const { onValueChange } = useRadioGroupContext();
46
46
 
47
- // function onPress(ev: GestureResponderEvent) {
47
+ // function onPress(event: GestureResponderEvent) {
48
48
  // if (onPressProps) {
49
- // onPressProps(ev);
49
+ // onPressProps(event);
50
50
  // }
51
51
  // onValueChange(value);
52
52
  // }
@@ -68,7 +68,7 @@
68
68
 
69
69
  // Item.displayName = "ItemRadioGroup";
70
70
 
71
- // const Indicator = React.forwardRef<IndicatorRef, IndicatorProps>(({ keepMounted, ...props }, ref) => {
71
+ // const Indicator = forwardRef<IndicatorRef, IndicatorProps>(({ keepMounted, ...props }, ref) => {
72
72
  //
73
73
  // return (
74
74
  // <RadioGroup.Indicator render>
@@ -0,0 +1 @@
1
+ export * from "./render";
@@ -1,4 +1,3 @@
1
- import * as React from "react";
2
1
  import { cloneElement, isValidElement } from "react";
3
2
  import {
4
3
  Image as ReactNativeImage,
@@ -24,7 +23,7 @@ const Pressable = (props: BrandMapUIComponentProps<typeof ReactNativePressable>)
24
23
  }
25
24
 
26
25
  if (!isValidElement(render)) {
27
- console.log("Slot.Pressable - Invalid render prop", render);
26
+ console.log("Render.Pressable - Invalid render prop", render);
28
27
  return <></>;
29
28
  }
30
29
 
@@ -41,7 +40,7 @@ const Pressable = (props: BrandMapUIComponentProps<typeof ReactNativePressable>)
41
40
  },
42
41
  );
43
42
  };
44
- // Pressable.displayName = "SlotPressable";
43
+ // Pressable.displayName = "RenderPressable";
45
44
 
46
45
  const View = (props: BrandMapUIComponentProps<typeof ReactNativeView>): React.JSX.Element => {
47
46
  const { children, render, ...rest } = props;
@@ -51,7 +50,7 @@ const View = (props: BrandMapUIComponentProps<typeof ReactNativeView>): React.JS
51
50
  }
52
51
 
53
52
  if (!isValidElement(render)) {
54
- console.log("Slot.View - Invalid render prop", render);
53
+ console.log("Render.View - Invalid render prop", render);
55
54
  return <></>;
56
55
  }
57
56
 
@@ -68,7 +67,7 @@ const View = (props: BrandMapUIComponentProps<typeof ReactNativeView>): React.JS
68
67
  },
69
68
  );
70
69
  };
71
- // View.displayName = "SlotView";
70
+ // View.displayName = "RenderView";
72
71
 
73
72
  const Text = (props: BrandMapUIComponentProps<typeof ReactNativeText>): React.JSX.Element => {
74
73
  const { children, render, ...rest } = props;
@@ -78,7 +77,7 @@ const Text = (props: BrandMapUIComponentProps<typeof ReactNativeText>): React.JS
78
77
  }
79
78
 
80
79
  if (!isValidElement(render)) {
81
- console.log("Slot.Text - Invalid render prop", render);
80
+ console.log("Render.Text - Invalid render prop", render);
82
81
  return <></>;
83
82
  }
84
83
 
@@ -95,7 +94,7 @@ const Text = (props: BrandMapUIComponentProps<typeof ReactNativeText>): React.JS
95
94
  },
96
95
  );
97
96
  };
98
- // Text.displayName = "SlotText";
97
+ // Text.displayName = "RenderText";
99
98
 
100
99
  const Image = (props: BrandMapUIComponentProps<typeof ReactNativeImage> /** & { children?: React.ReactNode } */): React.JSX.Element => {
101
100
  const { render, ...rest } = props;
@@ -105,7 +104,7 @@ const Image = (props: BrandMapUIComponentProps<typeof ReactNativeImage> /** & {
105
104
  }
106
105
 
107
106
  if (!isValidElement(render)) {
108
- console.log("Slot.Image - Invalid render prop", render);
107
+ console.log("Render.Image - Invalid render prop", render);
109
108
  return <></>;
110
109
  }
111
110
 
@@ -118,7 +117,7 @@ const Image = (props: BrandMapUIComponentProps<typeof ReactNativeImage> /** & {
118
117
  // children,
119
118
  });
120
119
  };
121
- // Image.displayName = "SlotImage";
120
+ // Image.displayName = "RenderImage";
122
121
 
123
122
  export { Image, Pressable, Text, View };
124
123
 
@@ -150,30 +149,30 @@ function composeRefs<T>(...refs: (React.Ref<T> | undefined)[]) {
150
149
 
151
150
  type AnyProps = Record<string, any>;
152
151
 
153
- function mergeProps(slotProps: AnyProps, childProps: AnyProps) {
152
+ function mergeProps(renderProps: AnyProps, childProps: AnyProps) {
154
153
  // all child props should override
155
154
  const overrideProps = { ...childProps };
156
155
 
157
156
  for (const propName in childProps) {
158
- const slotPropValue = slotProps[propName];
157
+ const renderPropValue = renderProps[propName];
159
158
  const childPropValue = childProps[propName];
160
159
 
161
160
  if (propName.startsWith("on")) {
162
- if (!childPropValue && !slotPropValue) {
161
+ if (!childPropValue && !renderPropValue) {
163
162
  continue;
164
163
  }
165
164
 
166
165
  // if the handler exists on both, we compose them
167
- if (slotPropValue && childPropValue) {
166
+ if (renderPropValue && childPropValue) {
168
167
  overrideProps[propName] = (...args: any[]) => {
169
168
  childPropValue(...args);
170
- slotPropValue(...args);
169
+ renderPropValue(...args);
171
170
  };
172
171
  }
173
172
 
174
- // but if it exists only on the slot, we use only this one
175
- if (slotPropValue) {
176
- overrideProps[propName] = slotPropValue;
173
+ // but if it exists only on the render, we use only this one
174
+ if (renderPropValue) {
175
+ overrideProps[propName] = renderPropValue;
177
176
  }
178
177
 
179
178
  continue;
@@ -181,42 +180,42 @@ function mergeProps(slotProps: AnyProps, childProps: AnyProps) {
181
180
 
182
181
  // if it's `style`, we merge them
183
182
  if (propName === "style") {
184
- overrideProps[propName] = combineStyles(slotPropValue, childPropValue);
183
+ overrideProps[propName] = combineStyles(renderPropValue, childPropValue);
185
184
  }
186
185
 
187
186
  // if it's `className`, we merge them
188
187
  if (propName === "className") {
189
- overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
188
+ overrideProps[propName] = [renderPropValue, childPropValue].filter(Boolean).join(" ");
190
189
  }
191
190
  }
192
191
 
193
- return { ...slotProps, ...overrideProps };
192
+ return { ...renderProps, ...overrideProps };
194
193
  }
195
194
 
196
195
  type PressableStyle = ReactNativePressableProps["style"];
197
196
  type ImageStyle = StyleProp<ReactNativeImageStyle>;
198
197
  type Style = PressableStyle | ImageStyle;
199
198
 
200
- function combineStyles(slotStyle?: Style, childValue?: Style) {
201
- if (typeof slotStyle === "function" && typeof childValue === "function") {
199
+ function combineStyles(renderStyle?: Style, childValue?: Style) {
200
+ if (typeof renderStyle === "function" && typeof childValue === "function") {
202
201
  return (state: PressableStateCallbackType) => {
203
- return StyleSheet.flatten([slotStyle(state), childValue(state)]);
202
+ return StyleSheet.flatten([renderStyle(state), childValue(state)]);
204
203
  };
205
204
  }
206
205
 
207
- if (typeof slotStyle === "function") {
206
+ if (typeof renderStyle === "function") {
208
207
  return (state: PressableStateCallbackType) => {
209
- return childValue ? StyleSheet.flatten([slotStyle(state), childValue]) : slotStyle(state);
208
+ return childValue ? StyleSheet.flatten([renderStyle(state), childValue]) : renderStyle(state);
210
209
  };
211
210
  }
212
211
 
213
212
  if (typeof childValue === "function") {
214
213
  return (state: PressableStateCallbackType) => {
215
- return slotStyle ? StyleSheet.flatten([slotStyle, childValue(state)]) : childValue(state);
214
+ return renderStyle ? StyleSheet.flatten([renderStyle, childValue(state)]) : childValue(state);
216
215
  };
217
216
  }
218
217
 
219
- return StyleSheet.flatten([slotStyle, childValue].filter(Boolean));
218
+ return StyleSheet.flatten([renderStyle, childValue].filter(Boolean));
220
219
  }
221
220
 
222
221
  export function isTextChildren(children: React.ReactNode | ((state: PressableStateCallbackType) => React.ReactNode)): children is string | string[] {