@react-native-reusables/cli 0.0.18 → 0.1.1
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.
- package/README.md +2 -37
- package/__generated/components/ui/accordion.tsx +30 -32
- package/__generated/components/ui/alert-dialog.tsx +19 -26
- package/__generated/components/ui/aspect-ratio.tsx +1 -1
- package/__generated/components/ui/avatar.tsx +31 -34
- package/__generated/components/ui/badge.tsx +2 -2
- package/__generated/components/ui/button.tsx +2 -5
- package/__generated/components/ui/card.tsx +39 -51
- package/__generated/components/ui/checkbox.tsx +25 -27
- package/__generated/components/ui/collapsible.tsx +1 -1
- package/__generated/components/ui/context-menu.tsx +28 -31
- package/__generated/components/ui/dialog.tsx +40 -43
- package/__generated/components/ui/dropdown-menu.tsx +27 -22
- package/__generated/components/ui/hover-card.tsx +3 -3
- package/__generated/components/ui/input.tsx +17 -18
- package/__generated/components/ui/label.tsx +21 -22
- package/__generated/components/ui/menubar.tsx +45 -47
- package/__generated/components/ui/navigation-menu.tsx +19 -17
- package/__generated/components/ui/popover.tsx +4 -4
- package/__generated/components/ui/progress.tsx +15 -11
- package/__generated/components/ui/radio-group.tsx +27 -29
- package/__generated/components/ui/select.tsx +55 -65
- package/__generated/components/ui/separator.tsx +16 -17
- package/__generated/components/ui/switch.tsx +59 -61
- package/__generated/components/ui/table.tsx +69 -76
- package/__generated/components/ui/tabs.tsx +49 -52
- package/__generated/components/ui/text.tsx +2 -2
- package/__generated/components/ui/textarea.tsx +20 -21
- package/__generated/components/ui/toggle-group.tsx +5 -7
- package/__generated/components/ui/toggle.tsx +4 -4
- package/__generated/components/ui/tooltip.tsx +4 -5
- package/__generated/components/ui/typography.tsx +2 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -34
- package/__generated/components/primitives/accordion/accordion.tsx +0 -216
- package/__generated/components/primitives/accordion/accordion.web.tsx +0 -295
- package/__generated/components/primitives/accordion/index.ts +0 -1
- package/__generated/components/primitives/accordion/types.ts +0 -45
- package/__generated/components/primitives/alert-dialog/alert-dialog.tsx +0 -237
- package/__generated/components/primitives/alert-dialog/alert-dialog.web.tsx +0 -256
- package/__generated/components/primitives/alert-dialog/index.ts +0 -1
- package/__generated/components/primitives/alert-dialog/types.ts +0 -48
- package/__generated/components/primitives/aspect-ratio.tsx +0 -23
- package/__generated/components/primitives/avatar/index.tsx +0 -95
- package/__generated/components/primitives/avatar/types.ts +0 -10
- package/__generated/components/primitives/checkbox/checkbox.tsx +0 -101
- package/__generated/components/primitives/checkbox/checkbox.web.tsx +0 -114
- package/__generated/components/primitives/checkbox/index.ts +0 -1
- package/__generated/components/primitives/checkbox/types.ts +0 -11
- package/__generated/components/primitives/collapsible/collapsible.tsx +0 -119
- package/__generated/components/primitives/collapsible/collapsible.web.tsx +0 -157
- package/__generated/components/primitives/collapsible/index.ts +0 -1
- package/__generated/components/primitives/collapsible/types.ts +0 -18
- package/__generated/components/primitives/context-menu/context-menu.tsx +0 -648
- package/__generated/components/primitives/context-menu/context-menu.web.tsx +0 -533
- package/__generated/components/primitives/context-menu/index.ts +0 -1
- package/__generated/components/primitives/context-menu/types.ts +0 -90
- package/__generated/components/primitives/dialog/dialog.tsx +0 -211
- package/__generated/components/primitives/dialog/dialog.web.tsx +0 -197
- package/__generated/components/primitives/dialog/index.ts +0 -1
- package/__generated/components/primitives/dialog/types.ts +0 -60
- package/__generated/components/primitives/dropdown-menu/dropdown-menu.tsx +0 -608
- package/__generated/components/primitives/dropdown-menu/dropdown-menu.web.tsx +0 -550
- package/__generated/components/primitives/dropdown-menu/index.ts +0 -1
- package/__generated/components/primitives/dropdown-menu/types.ts +0 -72
- package/__generated/components/primitives/hooks/index.ts +0 -3
- package/__generated/components/primitives/hooks/useAugmentedRef.tsx +0 -29
- package/__generated/components/primitives/hooks/useControllableState.tsx +0 -75
- package/__generated/components/primitives/hooks/useRelativePosition.tsx +0 -227
- package/__generated/components/primitives/hover-card/hover-card.tsx +0 -279
- package/__generated/components/primitives/hover-card/hover-card.web.tsx +0 -150
- package/__generated/components/primitives/hover-card/index.ts +0 -1
- package/__generated/components/primitives/hover-card/types.ts +0 -51
- package/__generated/components/primitives/label/index.ts +0 -1
- package/__generated/components/primitives/label/label.tsx +0 -31
- package/__generated/components/primitives/label/label.web.tsx +0 -36
- package/__generated/components/primitives/label/types.ts +0 -15
- package/__generated/components/primitives/menubar/index.ts +0 -1
- package/__generated/components/primitives/menubar/menubar.tsx +0 -622
- package/__generated/components/primitives/menubar/menubar.web.tsx +0 -548
- package/__generated/components/primitives/menubar/types.ts +0 -77
- package/__generated/components/primitives/navigation-menu/index.ts +0 -1
- package/__generated/components/primitives/navigation-menu/navigation-menu.tsx +0 -315
- package/__generated/components/primitives/navigation-menu/navigation-menu.web.tsx +0 -264
- package/__generated/components/primitives/navigation-menu/types.ts +0 -49
- package/__generated/components/primitives/popover/index.ts +0 -1
- package/__generated/components/primitives/popover/popover.tsx +0 -290
- package/__generated/components/primitives/popover/popover.web.tsx +0 -191
- package/__generated/components/primitives/popover/types.ts +0 -24
- package/__generated/components/primitives/portal.tsx +0 -82
- package/__generated/components/primitives/progress/index.ts +0 -1
- package/__generated/components/primitives/progress/progress.tsx +0 -59
- package/__generated/components/primitives/progress/progress.web.tsx +0 -36
- package/__generated/components/primitives/progress/types.ts +0 -7
- package/__generated/components/primitives/radio-group/index.ts +0 -1
- package/__generated/components/primitives/radio-group/radio-group.tsx +0 -116
- package/__generated/components/primitives/radio-group/radio-group.web.tsx +0 -78
- package/__generated/components/primitives/radio-group/types.ts +0 -15
- package/__generated/components/primitives/select/index.ts +0 -1
- package/__generated/components/primitives/select/select.tsx +0 -466
- package/__generated/components/primitives/select/select.web.tsx +0 -332
- package/__generated/components/primitives/select/types.ts +0 -89
- package/__generated/components/primitives/separator/index.tsx +0 -23
- package/__generated/components/primitives/separator/types.ts +0 -6
- package/__generated/components/primitives/slider/index.ts +0 -1
- package/__generated/components/primitives/slider/slider.tsx +0 -89
- package/__generated/components/primitives/slider/slider.web.tsx +0 -67
- package/__generated/components/primitives/slider/types.ts +0 -24
- package/__generated/components/primitives/slot.tsx +0 -187
- package/__generated/components/primitives/switch/index.ts +0 -1
- package/__generated/components/primitives/switch/switch.tsx +0 -65
- package/__generated/components/primitives/switch/switch.web.tsx +0 -67
- package/__generated/components/primitives/switch/types.ts +0 -11
- package/__generated/components/primitives/table.tsx +0 -55
- package/__generated/components/primitives/tabs/index.ts +0 -1
- package/__generated/components/primitives/tabs/tabs.tsx +0 -133
- package/__generated/components/primitives/tabs/tabs.web.tsx +0 -97
- package/__generated/components/primitives/tabs/types.ts +0 -24
- package/__generated/components/primitives/toast/index.tsx +0 -128
- package/__generated/components/primitives/toast/types.ts +0 -7
- package/__generated/components/primitives/toggle/index.ts +0 -1
- package/__generated/components/primitives/toggle/toggle.tsx +0 -37
- package/__generated/components/primitives/toggle/toggle.web.tsx +0 -26
- package/__generated/components/primitives/toggle/types.ts +0 -7
- package/__generated/components/primitives/toggle-group/index.ts +0 -1
- package/__generated/components/primitives/toggle-group/toggle-group.tsx +0 -125
- package/__generated/components/primitives/toggle-group/toggle-group.web.tsx +0 -124
- package/__generated/components/primitives/toggle-group/types.ts +0 -37
- package/__generated/components/primitives/toolbar/index.ts +0 -1
- package/__generated/components/primitives/toolbar/toolbar.tsx +0 -125
- package/__generated/components/primitives/toolbar/toolbar.web.tsx +0 -129
- package/__generated/components/primitives/toolbar/types.ts +0 -39
- package/__generated/components/primitives/tooltip/index.ts +0 -1
- package/__generated/components/primitives/tooltip/tooltip.tsx +0 -277
- package/__generated/components/primitives/tooltip/tooltip.web.tsx +0 -181
- package/__generated/components/primitives/tooltip/types.ts +0 -42
- package/__generated/components/primitives/types.ts +0 -105
- package/__generated/components/primitives/utils.ts +0 -61
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import type { Pressable, Text, View, ViewStyle } from 'react-native';
|
|
2
|
-
|
|
3
|
-
type ComponentPropsWithAsChild<T extends React.ElementType<any>> =
|
|
4
|
-
React.ComponentPropsWithoutRef<T> & { asChild?: boolean };
|
|
5
|
-
|
|
6
|
-
type ViewRef = React.ElementRef<typeof View>;
|
|
7
|
-
type PressableRef = React.ElementRef<typeof Pressable>;
|
|
8
|
-
type TextRef = React.ElementRef<typeof Text>;
|
|
9
|
-
|
|
10
|
-
type SlottableViewProps = ComponentPropsWithAsChild<typeof View>;
|
|
11
|
-
type SlottablePressableProps = ComponentPropsWithAsChild<typeof Pressable> & {
|
|
12
|
-
/**
|
|
13
|
-
* Platform: WEB ONLY
|
|
14
|
-
*/
|
|
15
|
-
onKeyDown?: (ev: React.KeyboardEvent) => void;
|
|
16
|
-
/**
|
|
17
|
-
* Platform: WEB ONLY
|
|
18
|
-
*/
|
|
19
|
-
onKeyUp?: (ev: React.KeyboardEvent) => void;
|
|
20
|
-
};
|
|
21
|
-
type SlottableTextProps = ComponentPropsWithAsChild<typeof Text>;
|
|
22
|
-
|
|
23
|
-
interface Insets {
|
|
24
|
-
top?: number;
|
|
25
|
-
bottom?: number;
|
|
26
|
-
left?: number;
|
|
27
|
-
right?: number;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
type PointerDownOutsideEvent = CustomEvent<{ originalEvent: PointerEvent }>;
|
|
31
|
-
type FocusOutsideEvent = CustomEvent<{ originalEvent: FocusEvent }>;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Certain props are only available on the native version of the component.
|
|
35
|
-
* @docs For the web version, see the Radix documentation https://www.radix-ui.com/primitives
|
|
36
|
-
*/
|
|
37
|
-
interface PositionedContentProps {
|
|
38
|
-
forceMount?: true | undefined;
|
|
39
|
-
style?: ViewStyle;
|
|
40
|
-
alignOffset?: number;
|
|
41
|
-
insets?: Insets;
|
|
42
|
-
avoidCollisions?: boolean;
|
|
43
|
-
align?: 'start' | 'center' | 'end';
|
|
44
|
-
side?: 'top' | 'bottom';
|
|
45
|
-
sideOffset?: number;
|
|
46
|
-
/**
|
|
47
|
-
* Platform: NATIVE ONLY
|
|
48
|
-
*/
|
|
49
|
-
disablePositioningStyle?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Platform: WEB ONLY
|
|
52
|
-
*/
|
|
53
|
-
loop?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Platform: WEB ONLY
|
|
56
|
-
*/
|
|
57
|
-
onCloseAutoFocus?: (event: Event) => void;
|
|
58
|
-
/**
|
|
59
|
-
* Platform: WEB ONLY
|
|
60
|
-
*/
|
|
61
|
-
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
62
|
-
/**
|
|
63
|
-
* Platform: WEB ONLY
|
|
64
|
-
*/
|
|
65
|
-
onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;
|
|
66
|
-
/**
|
|
67
|
-
* Platform: WEB ONLY
|
|
68
|
-
*/
|
|
69
|
-
onFocusOutside?: (event: FocusOutsideEvent) => void;
|
|
70
|
-
/**
|
|
71
|
-
* Platform: WEB ONLY
|
|
72
|
-
*/
|
|
73
|
-
onInteractOutside?: (
|
|
74
|
-
event: PointerDownOutsideEvent | FocusOutsideEvent
|
|
75
|
-
) => void;
|
|
76
|
-
/**
|
|
77
|
-
* Platform: WEB ONLY
|
|
78
|
-
*/
|
|
79
|
-
collisionBoundary?: Element | null | Array<Element | null>;
|
|
80
|
-
/**
|
|
81
|
-
* Platform: WEB ONLY
|
|
82
|
-
*/
|
|
83
|
-
sticky?: 'partial' | 'always';
|
|
84
|
-
/**
|
|
85
|
-
* Platform: WEB ONLY
|
|
86
|
-
*/
|
|
87
|
-
hideWhenDetached?: boolean;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
interface ForceMountable {
|
|
91
|
-
forceMount?: true | undefined;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export type {
|
|
95
|
-
ComponentPropsWithAsChild,
|
|
96
|
-
ForceMountable,
|
|
97
|
-
Insets,
|
|
98
|
-
PositionedContentProps,
|
|
99
|
-
PressableRef,
|
|
100
|
-
SlottablePressableProps,
|
|
101
|
-
SlottableTextProps,
|
|
102
|
-
SlottableViewProps,
|
|
103
|
-
TextRef,
|
|
104
|
-
ViewRef,
|
|
105
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { GestureResponderEvent } from 'react-native';
|
|
2
|
-
|
|
3
|
-
const ToggleGroupUtils = {
|
|
4
|
-
getIsSelected(value: string | string[] | undefined, itemValue: string) {
|
|
5
|
-
if (value === undefined) {
|
|
6
|
-
return false;
|
|
7
|
-
}
|
|
8
|
-
if (typeof value === 'string') {
|
|
9
|
-
return value === itemValue;
|
|
10
|
-
}
|
|
11
|
-
return value.includes(itemValue);
|
|
12
|
-
},
|
|
13
|
-
getNewSingleValue(originalValue: string | string[] | undefined, itemValue: string) {
|
|
14
|
-
if (originalValue === itemValue) {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
return itemValue;
|
|
18
|
-
},
|
|
19
|
-
getNewMultipleValue(originalValue: string | string[] | undefined, itemValue: string) {
|
|
20
|
-
if (originalValue === undefined) {
|
|
21
|
-
return [itemValue];
|
|
22
|
-
}
|
|
23
|
-
if (typeof originalValue === 'string') {
|
|
24
|
-
return originalValue === itemValue ? [] : [originalValue, itemValue];
|
|
25
|
-
}
|
|
26
|
-
if (originalValue.includes(itemValue)) {
|
|
27
|
-
return originalValue.filter((v) => v !== itemValue);
|
|
28
|
-
}
|
|
29
|
-
return [...originalValue, itemValue];
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const EmptyGestureResponderEvent: GestureResponderEvent = {
|
|
34
|
-
nativeEvent: {
|
|
35
|
-
changedTouches: [],
|
|
36
|
-
identifier: '0',
|
|
37
|
-
locationX: 0,
|
|
38
|
-
locationY: 0,
|
|
39
|
-
pageX: 0,
|
|
40
|
-
pageY: 0,
|
|
41
|
-
target: '0',
|
|
42
|
-
timestamp: 0,
|
|
43
|
-
touches: [],
|
|
44
|
-
},
|
|
45
|
-
bubbles: false,
|
|
46
|
-
cancelable: false,
|
|
47
|
-
currentTarget: {} as any,
|
|
48
|
-
defaultPrevented: false,
|
|
49
|
-
eventPhase: 0,
|
|
50
|
-
persist: () => {},
|
|
51
|
-
isDefaultPrevented: () => false,
|
|
52
|
-
isPropagationStopped: () => false,
|
|
53
|
-
isTrusted: false,
|
|
54
|
-
preventDefault: () => {},
|
|
55
|
-
stopPropagation: () => {},
|
|
56
|
-
target: {} as any,
|
|
57
|
-
timeStamp: 0,
|
|
58
|
-
type: '',
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export { ToggleGroupUtils, EmptyGestureResponderEvent };
|