@particle-network/ui-native 0.0.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 (168) hide show
  1. package/README.md +57 -0
  2. package/dist/components/ProgressWrapper/index.d.ts +35 -0
  3. package/dist/components/ProgressWrapper/index.js +120 -0
  4. package/dist/components/Text/index.d.ts +2 -0
  5. package/dist/components/Text/index.js +2 -0
  6. package/dist/components/Text/text.d.ts +4 -0
  7. package/dist/components/Text/text.js +196 -0
  8. package/dist/components/Text/text.types.d.ts +109 -0
  9. package/dist/components/Text/text.types.js +77 -0
  10. package/dist/components/UXButton/button.d.ts +3 -0
  11. package/dist/components/UXButton/button.js +74 -0
  12. package/dist/components/UXButton/button.styles.d.ts +53 -0
  13. package/dist/components/UXButton/button.styles.js +157 -0
  14. package/dist/components/UXButton/button.types.d.ts +18 -0
  15. package/dist/components/UXButton/button.types.js +0 -0
  16. package/dist/components/UXButton/index.d.ts +2 -0
  17. package/dist/components/UXButton/index.js +1 -0
  18. package/dist/components/UXCheckbox/checkbox-group.d.ts +8 -0
  19. package/dist/components/UXCheckbox/checkbox-group.js +30 -0
  20. package/dist/components/UXCheckbox/checkbox.d.ts +10 -0
  21. package/dist/components/UXCheckbox/checkbox.js +78 -0
  22. package/dist/components/UXCheckbox/context.d.ts +8 -0
  23. package/dist/components/UXCheckbox/context.js +8 -0
  24. package/dist/components/UXCheckbox/index.d.ts +4 -0
  25. package/dist/components/UXCheckbox/index.js +3 -0
  26. package/dist/components/UXCheckbox/types.d.ts +6 -0
  27. package/dist/components/UXCheckbox/types.js +0 -0
  28. package/dist/components/UXChip/chip.d.ts +3 -0
  29. package/dist/components/UXChip/chip.js +48 -0
  30. package/dist/components/UXChip/index.d.ts +2 -0
  31. package/dist/components/UXChip/index.js +1 -0
  32. package/dist/components/UXChip/styles.d.ts +24 -0
  33. package/dist/components/UXChip/styles.js +70 -0
  34. package/dist/components/UXChip/types.d.ts +11 -0
  35. package/dist/components/UXChip/types.js +0 -0
  36. package/dist/components/UXDivider/index.d.ts +8 -0
  37. package/dist/components/UXDivider/index.js +34 -0
  38. package/dist/components/UXHint/index.d.ts +7 -0
  39. package/dist/components/UXHint/index.js +19 -0
  40. package/dist/components/UXModal/index.d.ts +24 -0
  41. package/dist/components/UXModal/index.js +271 -0
  42. package/dist/components/UXPressable/index.d.ts +4 -0
  43. package/dist/components/UXPressable/index.js +36 -0
  44. package/dist/components/UXRadio/context.d.ts +7 -0
  45. package/dist/components/UXRadio/context.js +10 -0
  46. package/dist/components/UXRadio/index.d.ts +2 -0
  47. package/dist/components/UXRadio/index.js +2 -0
  48. package/dist/components/UXRadio/radio-group.d.ts +5 -0
  49. package/dist/components/UXRadio/radio-group.js +21 -0
  50. package/dist/components/UXRadio/radio.d.ts +5 -0
  51. package/dist/components/UXRadio/radio.js +67 -0
  52. package/dist/components/UXRadio/types.d.ts +10 -0
  53. package/dist/components/UXRadio/types.js +0 -0
  54. package/dist/components/UXSwitch/index.d.ts +2 -0
  55. package/dist/components/UXSwitch/index.js +1 -0
  56. package/dist/components/UXSwitch/styles.d.ts +16 -0
  57. package/dist/components/UXSwitch/styles.js +58 -0
  58. package/dist/components/UXSwitch/switch.d.ts +3 -0
  59. package/dist/components/UXSwitch/switch.js +103 -0
  60. package/dist/components/UXSwitch/types.d.ts +11 -0
  61. package/dist/components/UXSwitch/types.js +0 -0
  62. package/dist/components/UXTabs/context.d.ts +5 -0
  63. package/dist/components/UXTabs/context.js +8 -0
  64. package/dist/components/UXTabs/index.d.ts +4 -0
  65. package/dist/components/UXTabs/index.js +3 -0
  66. package/dist/components/UXTabs/styles.d.ts +30 -0
  67. package/dist/components/UXTabs/styles.js +191 -0
  68. package/dist/components/UXTabs/tab.d.ts +3 -0
  69. package/dist/components/UXTabs/tab.js +55 -0
  70. package/dist/components/UXTabs/tabs.d.ts +3 -0
  71. package/dist/components/UXTabs/tabs.js +66 -0
  72. package/dist/components/UXTabs/types.d.ts +23 -0
  73. package/dist/components/UXTabs/types.js +0 -0
  74. package/dist/components/UXTooltip/index.d.ts +6 -0
  75. package/dist/components/UXTooltip/index.js +32 -0
  76. package/dist/components/UXTouchableOpacity/index.d.ts +4 -0
  77. package/dist/components/UXTouchableOpacity/index.js +24 -0
  78. package/dist/components/index.d.ts +22 -0
  79. package/dist/components/index.js +22 -0
  80. package/dist/components/input/index.d.ts +3 -0
  81. package/dist/components/input/index.js +2 -0
  82. package/dist/components/input/input.d.ts +3 -0
  83. package/dist/components/input/input.js +138 -0
  84. package/dist/components/input/number-input.d.ts +3 -0
  85. package/dist/components/input/number-input.js +231 -0
  86. package/dist/components/input/styles.d.ts +31 -0
  87. package/dist/components/input/styles.js +102 -0
  88. package/dist/components/input/types.d.ts +61 -0
  89. package/dist/components/input/types.js +0 -0
  90. package/dist/components/layout/Box/box.d.ts +12 -0
  91. package/dist/components/layout/Box/box.js +89 -0
  92. package/dist/components/layout/Box/index.d.ts +3 -0
  93. package/dist/components/layout/Box/index.js +2 -0
  94. package/dist/components/layout/Box/useBox.style.d.ts +3 -0
  95. package/dist/components/layout/Box/useBox.style.js +141 -0
  96. package/dist/components/layout/Box/useBox.type.d.ts +292 -0
  97. package/dist/components/layout/Box/useBox.type.js +0 -0
  98. package/dist/components/layout/Center.d.ts +5 -0
  99. package/dist/components/layout/Center.js +10 -0
  100. package/dist/components/layout/Circle.d.ts +7 -0
  101. package/dist/components/layout/Circle.js +14 -0
  102. package/dist/components/layout/Flex/flex.d.ts +6 -0
  103. package/dist/components/layout/Flex/flex.js +33 -0
  104. package/dist/components/layout/Flex/index.d.ts +4 -0
  105. package/dist/components/layout/Flex/index.js +3 -0
  106. package/dist/components/layout/Flex/useFlex.style.d.ts +3 -0
  107. package/dist/components/layout/Flex/useFlex.style.js +122 -0
  108. package/dist/components/layout/Flex/useFlex.type.d.ts +65 -0
  109. package/dist/components/layout/Flex/useFlex.type.js +0 -0
  110. package/dist/components/layout/Flex/useFlexBox.style.d.ts +134 -0
  111. package/dist/components/layout/Flex/useFlexBox.style.js +26 -0
  112. package/dist/components/layout/HStack.d.ts +5 -0
  113. package/dist/components/layout/HStack.js +11 -0
  114. package/dist/components/layout/Square.d.ts +9 -0
  115. package/dist/components/layout/Square.js +14 -0
  116. package/dist/components/layout/VStack.d.ts +5 -0
  117. package/dist/components/layout/VStack.js +14 -0
  118. package/dist/hooks/index.d.ts +5 -0
  119. package/dist/hooks/index.js +5 -0
  120. package/dist/hooks/useColors.d.ts +7 -0
  121. package/dist/hooks/useColors.js +18 -0
  122. package/dist/hooks/useKeyboard.d.ts +4 -0
  123. package/dist/hooks/useKeyboard.js +29 -0
  124. package/dist/hooks/useRadius.d.ts +7 -0
  125. package/dist/hooks/useRadius.js +16 -0
  126. package/dist/hooks/useSpacing.d.ts +7 -0
  127. package/dist/hooks/useSpacing.js +16 -0
  128. package/dist/hooks/useTheme.d.ts +5 -0
  129. package/dist/hooks/useTheme.js +6 -0
  130. package/dist/icons/CheckboxOffIcon.d.ts +4 -0
  131. package/dist/icons/CheckboxOffIcon.js +21 -0
  132. package/dist/icons/CheckboxOnIcon.d.ts +4 -0
  133. package/dist/icons/CheckboxOnIcon.js +26 -0
  134. package/dist/icons/DotIcon.d.ts +4 -0
  135. package/dist/icons/DotIcon.js +23 -0
  136. package/dist/icons/QuestionIcon.d.ts +4 -0
  137. package/dist/icons/QuestionIcon.js +30 -0
  138. package/dist/icons/RadioOffIcon.d.ts +4 -0
  139. package/dist/icons/RadioOffIcon.js +22 -0
  140. package/dist/icons/RadioOnIcon.d.ts +4 -0
  141. package/dist/icons/RadioOnIcon.js +42 -0
  142. package/dist/icons/types.d.ts +6 -0
  143. package/dist/icons/types.js +0 -0
  144. package/dist/index.d.ts +5 -0
  145. package/dist/index.js +4 -0
  146. package/dist/provider/ThemeContext.d.ts +3 -0
  147. package/dist/provider/ThemeContext.js +15 -0
  148. package/dist/provider/ThemeProvider.d.ts +10 -0
  149. package/dist/provider/ThemeProvider.js +31 -0
  150. package/dist/provider/index.d.ts +2 -0
  151. package/dist/provider/index.js +2 -0
  152. package/dist/theme/colors.d.ts +6 -0
  153. package/dist/theme/colors.js +17 -0
  154. package/dist/theme/index.d.ts +7 -0
  155. package/dist/theme/index.js +16 -0
  156. package/dist/theme/opacity.d.ts +2 -0
  157. package/dist/theme/opacity.js +3 -0
  158. package/dist/theme/radius.d.ts +3 -0
  159. package/dist/theme/radius.js +10 -0
  160. package/dist/theme/spacing.d.ts +3 -0
  161. package/dist/theme/spacing.js +10 -0
  162. package/dist/types/index.d.ts +1 -0
  163. package/dist/types/index.js +0 -0
  164. package/dist/types/theme.d.ts +17 -0
  165. package/dist/types/theme.js +0 -0
  166. package/dist/utils/triggerHapticFeedback.d.ts +5 -0
  167. package/dist/utils/triggerHapticFeedback.js +16 -0
  168. package/package.json +110 -0
@@ -0,0 +1,11 @@
1
+ import type { UXForegroundColor, UXSize } from '@particle-network/ui-shared';
2
+ import type { FlexProps } from '..';
3
+ export type UXSwitchProps = FlexProps & {
4
+ color?: UXForegroundColor;
5
+ size?: UXSize;
6
+ isSelected?: boolean;
7
+ onValueChange?: (isSelected: boolean) => void;
8
+ isReadOnly?: boolean;
9
+ isDisabled?: boolean;
10
+ defaultSelected?: boolean;
11
+ };
File without changes
@@ -0,0 +1,5 @@
1
+ import type { UXTabsProps } from './types';
2
+ type TabsContextType = Pick<UXTabsProps, 'selectedKey' | 'onSelectionChange' | 'size' | 'color' | 'variant' | 'radius' | 'isDisabled'>;
3
+ export declare const TabsContext: import("react").Context<TabsContextType>;
4
+ export declare const useTabsContext: () => TabsContextType;
5
+ export {};
@@ -0,0 +1,8 @@
1
+ import { createContext, useContext } from "react";
2
+ const TabsContext = createContext({});
3
+ const useTabsContext = ()=>{
4
+ const context = useContext(TabsContext);
5
+ if (!context) throw new Error('useTabsContext must be used within a UXTabs');
6
+ return context;
7
+ };
8
+ export { TabsContext, useTabsContext };
@@ -0,0 +1,4 @@
1
+ export * from './context';
2
+ export * from './tab';
3
+ export * from './tabs';
4
+ export type * from './types';
@@ -0,0 +1,3 @@
1
+ export * from "./context.js";
2
+ export * from "./tab.js";
3
+ export * from "./tabs.js";
@@ -0,0 +1,30 @@
1
+ import type { UXTabsProps } from './types';
2
+ export declare const useStyles: (props: Partial<UXTabsProps> & {
3
+ isSelected?: boolean;
4
+ }) => {
5
+ tabsWrapper: {
6
+ backgroundColor: string | undefined;
7
+ gap: import("@particle-network/ui-shared").SpacingType;
8
+ flex: number;
9
+ justifyContent: "flex-start" | "space-between";
10
+ borderRadius: number | undefined;
11
+ height: number;
12
+ padding: number;
13
+ opacity: number;
14
+ };
15
+ tab: {
16
+ flexGrow: number;
17
+ height: "100%";
18
+ alignItems: "center";
19
+ justifyContent: "center";
20
+ paddingHorizontal: number;
21
+ borderRadius: number | undefined;
22
+ backgroundColor: string | undefined;
23
+ };
24
+ tabText: {
25
+ fontSize: number;
26
+ lineHeight: number;
27
+ fontWeight: "500";
28
+ color: string | undefined;
29
+ };
30
+ };
@@ -0,0 +1,191 @@
1
+ import { useMemo } from "react";
2
+ import { StyleSheet } from "react-native";
3
+ import { ms } from "react-native-size-matters";
4
+ import { useColors, useRadius } from "../../hooks/index.js";
5
+ import { disabledOpacity } from "../../theme/index.js";
6
+ const useStyles = (props)=>{
7
+ const { size = 'md', radius, fullWidth, variant = 'solid', color = 'default', isDisabled, isSelected, w, gap } = props;
8
+ const { getColor } = useColors();
9
+ const { getRadius } = useRadius();
10
+ const height = useMemo(()=>{
11
+ if ('text' === variant) switch(size){
12
+ case 'sm':
13
+ return ms(16);
14
+ case 'lg':
15
+ return ms(20);
16
+ default:
17
+ return ms(18);
18
+ }
19
+ if ('solid' === variant) switch(size){
20
+ case 'sm':
21
+ return ms(24);
22
+ case 'lg':
23
+ return ms(40);
24
+ default:
25
+ return ms(30);
26
+ }
27
+ switch(size){
28
+ case 'sm':
29
+ return ms(24);
30
+ case 'lg':
31
+ return ms(34);
32
+ default:
33
+ return ms(30);
34
+ }
35
+ }, [
36
+ size,
37
+ variant
38
+ ]);
39
+ const fontSize = useMemo(()=>{
40
+ switch(size){
41
+ case 'sm':
42
+ return ms(12);
43
+ case 'lg':
44
+ return ms(16);
45
+ default:
46
+ return ms(14);
47
+ }
48
+ }, [
49
+ size
50
+ ]);
51
+ const paddingHorizontal = useMemo(()=>{
52
+ if ('text' === variant) return 0;
53
+ switch(size){
54
+ case 'sm':
55
+ return ms(8);
56
+ case 'lg':
57
+ return ms(12);
58
+ default:
59
+ return ms(10);
60
+ }
61
+ }, [
62
+ size,
63
+ variant
64
+ ]);
65
+ const gapValue = useMemo(()=>{
66
+ if (gap) return gap;
67
+ if ('text' === variant) switch(size){
68
+ case 'sm':
69
+ return ms(14);
70
+ case 'lg':
71
+ return ms(24);
72
+ default:
73
+ return ms(20);
74
+ }
75
+ if ('light' === variant) return ms(10);
76
+ return 0;
77
+ }, [
78
+ variant,
79
+ size,
80
+ gap
81
+ ]);
82
+ const wrapperBackgroundColor = useMemo(()=>{
83
+ if ('switch' === variant) return getColor('bg-200');
84
+ if ('solid' === variant) return getColor('bg-400');
85
+ return 'transparent';
86
+ }, [
87
+ variant,
88
+ getColor
89
+ ]);
90
+ const wrapperBorderRadius = useMemo(()=>{
91
+ if ('solid' === variant || 'switch' === variant) {
92
+ if (radius) return getRadius(radius);
93
+ if ('lg' === size) return ms(10);
94
+ return ms(6);
95
+ }
96
+ return 0;
97
+ }, [
98
+ variant,
99
+ size,
100
+ radius
101
+ ]);
102
+ const wrapperPadding = useMemo(()=>{
103
+ if ('solid' === variant) {
104
+ if ('lg' === size) return ms(4);
105
+ return ms(2);
106
+ }
107
+ return 0;
108
+ }, [
109
+ variant,
110
+ size
111
+ ]);
112
+ const tabBorderRadius = useMemo(()=>{
113
+ if (radius) return getRadius(radius);
114
+ return ms(6);
115
+ }, [
116
+ variant,
117
+ radius
118
+ ]);
119
+ const tabBg = useMemo(()=>{
120
+ if (!isSelected) return 'transparent';
121
+ if ('text' === variant) return 'transparent';
122
+ if ('default' === color) {
123
+ if ('switch' === variant) return getColor('tertiary');
124
+ return getColor('bg-200');
125
+ }
126
+ return getColor(color);
127
+ }, [
128
+ variant,
129
+ color,
130
+ getColor,
131
+ isSelected
132
+ ]);
133
+ const tabTextColor = useMemo(()=>{
134
+ if (!isSelected) return getColor('secondary');
135
+ if ('text' === variant) {
136
+ if ('default' === color) return getColor('foreground');
137
+ return getColor(color);
138
+ }
139
+ if ('default' === color) return getColor('foreground');
140
+ return 'white';
141
+ }, [
142
+ variant,
143
+ color,
144
+ getColor,
145
+ isSelected
146
+ ]);
147
+ const styles = useMemo(()=>StyleSheet.create({
148
+ tabsWrapper: {
149
+ backgroundColor: wrapperBackgroundColor,
150
+ gap: gapValue,
151
+ flex: fullWidth || w ? 1 : 0,
152
+ justifyContent: fullWidth || w ? 'space-between' : 'flex-start',
153
+ borderRadius: wrapperBorderRadius,
154
+ height,
155
+ padding: wrapperPadding,
156
+ opacity: isDisabled ? disabledOpacity : 1
157
+ },
158
+ tab: {
159
+ flexGrow: 'text' === variant || 'light' === variant ? 0 : 1,
160
+ height: '100%',
161
+ alignItems: 'center',
162
+ justifyContent: 'center',
163
+ paddingHorizontal,
164
+ borderRadius: tabBorderRadius,
165
+ backgroundColor: tabBg
166
+ },
167
+ tabText: {
168
+ fontSize,
169
+ lineHeight: fontSize + ms(4),
170
+ fontWeight: '500',
171
+ color: tabTextColor
172
+ }
173
+ }), [
174
+ variant,
175
+ height,
176
+ paddingHorizontal,
177
+ fontSize,
178
+ gapValue,
179
+ wrapperBackgroundColor,
180
+ wrapperBorderRadius,
181
+ tabBorderRadius,
182
+ wrapperPadding,
183
+ tabBg,
184
+ isDisabled,
185
+ tabTextColor,
186
+ fullWidth,
187
+ w
188
+ ]);
189
+ return styles;
190
+ };
191
+ export { useStyles };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import type { UXTabProps } from './types';
3
+ export declare const UXTab: React.FC<UXTabProps>;
@@ -0,0 +1,55 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { HStack, Text, UXTouchableOpacity } from "../index.js";
4
+ import DotIcon from "../../icons/DotIcon.js";
5
+ import { useTabsContext } from "./context.js";
6
+ import { useStyles } from "./styles.js";
7
+ const UXTab = ({ tabKey = '', title, icon, style, notification })=>{
8
+ const { selectedKey, onSelectionChange, size, color, variant, radius, isDisabled } = useTabsContext();
9
+ const isSelected = selectedKey === tabKey;
10
+ const handlePress = useCallback(()=>{
11
+ if (!isDisabled && tabKey) onSelectionChange?.(tabKey);
12
+ }, [
13
+ isDisabled,
14
+ onSelectionChange,
15
+ tabKey
16
+ ]);
17
+ const styles = useStyles({
18
+ variant,
19
+ color,
20
+ size,
21
+ radius,
22
+ isSelected
23
+ });
24
+ return /*#__PURE__*/ jsx(UXTouchableOpacity, {
25
+ activeOpacity: 0.7,
26
+ disabled: isDisabled,
27
+ style: [
28
+ styles.tab,
29
+ style
30
+ ],
31
+ onPress: handlePress,
32
+ children: /*#__PURE__*/ jsxs(HStack, {
33
+ gap: 4,
34
+ position: "relative",
35
+ children: [
36
+ 'function' == typeof icon ? icon(isSelected) : icon,
37
+ 'function' == typeof title ? title(isSelected) : /*#__PURE__*/ jsx(Text, {
38
+ style: styles.tabText,
39
+ children: title
40
+ }),
41
+ notification ? /*#__PURE__*/ jsx(DotIcon, {
42
+ color: "danger",
43
+ size: 5,
44
+ style: {
45
+ position: 'absolute',
46
+ right: -4,
47
+ top: 0
48
+ }
49
+ }) : null
50
+ ]
51
+ })
52
+ });
53
+ };
54
+ UXTab.displayName = 'UXTab';
55
+ export { UXTab };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import type { UXTabsProps } from './types';
3
+ export declare const UXTabs: React.FC<UXTabsProps>;
@@ -0,0 +1,66 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Children, cloneElement, isValidElement, useState } from "react";
3
+ import useUpdateEffect from "ahooks/es/useUpdateEffect";
4
+ import { HStack, VStack } from "../index.js";
5
+ import { disabledOpacity } from "../../theme/index.js";
6
+ import { TabsContext } from "./context.js";
7
+ import { useStyles } from "./styles.js";
8
+ const UXTabs = (props)=>{
9
+ const { style, tabStyle, color, size, variant, radius, selectedKey: selectedKeyProp, defaultSelectedKey, onSelectionChange, isDisabled, children, ...restProps } = props;
10
+ const firstTabKey = Children.toArray(children).find((child)=>{
11
+ if (/*#__PURE__*/ isValidElement(child) && child.key) return true;
12
+ return false;
13
+ });
14
+ const [selectedKey, setSelectedKey] = useState(selectedKeyProp || defaultSelectedKey || firstTabKey?.key || '');
15
+ useUpdateEffect(()=>{
16
+ if (void 0 !== selectedKeyProp) setSelectedKey(selectedKeyProp);
17
+ }, [
18
+ selectedKeyProp
19
+ ]);
20
+ const styles = useStyles(props);
21
+ const handleSelectionChange = (key)=>{
22
+ if (!isDisabled) {
23
+ setSelectedKey(key);
24
+ onSelectionChange?.(key);
25
+ }
26
+ };
27
+ const tabs = Children.map(children, async (child)=>{
28
+ if (/*#__PURE__*/ isValidElement(child) && child.key) return /*#__PURE__*/ cloneElement(child, {
29
+ tabKey: String(child.key),
30
+ style: tabStyle
31
+ });
32
+ return child;
33
+ });
34
+ const renderSelectedTabContent = ()=>Children.map(children, async (child)=>{
35
+ if (/*#__PURE__*/ isValidElement(child) && child.key === selectedKey) return child.props.children;
36
+ return null;
37
+ });
38
+ return /*#__PURE__*/ jsx(TabsContext.Provider, {
39
+ value: {
40
+ selectedKey,
41
+ onSelectionChange: handleSelectionChange,
42
+ size,
43
+ color,
44
+ variant,
45
+ radius,
46
+ isDisabled
47
+ },
48
+ children: /*#__PURE__*/ jsxs(VStack, {
49
+ gap: "md",
50
+ children: [
51
+ /*#__PURE__*/ jsx(HStack, {
52
+ opacity: isDisabled ? disabledOpacity : 1,
53
+ style: [
54
+ styles.tabsWrapper,
55
+ style
56
+ ],
57
+ ...restProps,
58
+ children: tabs
59
+ }),
60
+ renderSelectedTabContent()
61
+ ]
62
+ })
63
+ });
64
+ };
65
+ UXTabs.displayName = 'UXTabs';
66
+ export { UXTabs };
@@ -0,0 +1,23 @@
1
+ import type React from 'react';
2
+ import type { StyleProp, ViewStyle } from 'react-native';
3
+ import type { UXForegroundColor, UXSize } from '@particle-network/ui-shared';
4
+ import type { HStackProps } from '..';
5
+ export interface UXTabsProps extends HStackProps {
6
+ color?: UXForegroundColor;
7
+ size?: UXSize;
8
+ variant?: 'solid' | 'light' | 'text' | 'switch';
9
+ selectedKey?: string;
10
+ defaultSelectedKey?: string;
11
+ onSelectionChange?: (key: string) => void;
12
+ isDisabled?: boolean;
13
+ containerStyle?: StyleProp<ViewStyle>;
14
+ tabStyle?: StyleProp<ViewStyle>;
15
+ }
16
+ export interface UXTabProps {
17
+ style?: StyleProp<ViewStyle>;
18
+ tabKey?: string;
19
+ title?: string | ((isSelected: boolean) => React.ReactNode);
20
+ icon?: React.ReactNode | ((isSelected: boolean) => React.ReactNode);
21
+ notification?: boolean;
22
+ children?: React.ReactNode;
23
+ }
File without changes
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { type UXModalProps } from '..';
3
+ export type UXTooltipProps = Partial<Omit<UXModalProps, 'isOpen' | 'onClose'>> & {
4
+ content: React.ReactNode;
5
+ };
6
+ export declare const UXTooltip: React.FC<UXTooltipProps>;
@@ -0,0 +1,32 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { Text, UXModal, UXPressable } from "../index.js";
4
+ const UXTooltip = (props)=>{
5
+ const { content, children, ...restProps } = props;
6
+ const [isShow, setIsShow] = useState(false);
7
+ return /*#__PURE__*/ jsxs(Fragment, {
8
+ children: [
9
+ /*#__PURE__*/ jsx(UXPressable, {
10
+ onPress: ()=>{
11
+ setIsShow(true);
12
+ },
13
+ children: children
14
+ }),
15
+ /*#__PURE__*/ jsx(UXModal, {
16
+ wrapPortal: true,
17
+ isOpen: isShow,
18
+ onClose: ()=>{
19
+ setIsShow(false);
20
+ },
21
+ ...restProps,
22
+ children: 'string' == typeof content ? /*#__PURE__*/ jsx(Text, {
23
+ body2: true,
24
+ lineHeight: "1.4",
25
+ children: content
26
+ }) : content
27
+ })
28
+ ]
29
+ });
30
+ };
31
+ UXTooltip.displayName = 'UXTooltip';
32
+ export { UXTooltip };
@@ -0,0 +1,4 @@
1
+ import { type TouchableOpacityProps, type View } from 'react-native';
2
+ import { type UseBoxProps, type UseFlexProps } from '..';
3
+ export type UXTouchableOpacityProps = TouchableOpacityProps & UseBoxProps & UseFlexProps;
4
+ export declare const UXTouchableOpacity: import("react").ForwardRefExoticComponent<TouchableOpacityProps & UseBoxProps & UseFlexProps & import("react").RefAttributes<View>>;
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { TouchableOpacity } from "react-native";
4
+ import useDebounceFn from "ahooks/es/useDebounceFn";
5
+ import { useFlexBoxStyle } from "../index.js";
6
+ const UXTouchableOpacity = /*#__PURE__*/ forwardRef(({ onPress, style, ...props }, ref)=>{
7
+ const { run } = useDebounceFn(onPress || (()=>null), {
8
+ wait: 300,
9
+ leading: true,
10
+ trailing: false
11
+ });
12
+ const boxFlexStyle = useFlexBoxStyle(props);
13
+ return /*#__PURE__*/ jsx(TouchableOpacity, {
14
+ ref: ref,
15
+ style: [
16
+ boxFlexStyle,
17
+ style
18
+ ],
19
+ onPress: run,
20
+ ...props
21
+ });
22
+ });
23
+ UXTouchableOpacity.displayName = 'UXTouchableOpacity';
24
+ export { UXTouchableOpacity };
@@ -0,0 +1,22 @@
1
+ export * from './input';
2
+ export * from './layout/Box';
3
+ export * from './layout/Center';
4
+ export * from './layout/Circle';
5
+ export * from './layout/Flex';
6
+ export * from './layout/HStack';
7
+ export * from './layout/Square';
8
+ export * from './layout/VStack';
9
+ export * from './ProgressWrapper';
10
+ export * from './Text';
11
+ export * from './UXButton';
12
+ export * from './UXCheckbox';
13
+ export * from './UXChip';
14
+ export * from './UXDivider';
15
+ export * from './UXHint';
16
+ export * from './UXModal';
17
+ export * from './UXPressable';
18
+ export * from './UXRadio';
19
+ export * from './UXSwitch';
20
+ export * from './UXTabs';
21
+ export * from './UXTooltip';
22
+ export * from './UXTouchableOpacity';
@@ -0,0 +1,22 @@
1
+ export * from "./input/index.js";
2
+ export * from "./layout/Box/index.js";
3
+ export * from "./layout/Center.js";
4
+ export * from "./layout/Circle.js";
5
+ export * from "./layout/Flex/index.js";
6
+ export * from "./layout/HStack.js";
7
+ export * from "./layout/Square.js";
8
+ export * from "./layout/VStack.js";
9
+ export * from "./ProgressWrapper/index.js";
10
+ export * from "./Text/index.js";
11
+ export * from "./UXButton/index.js";
12
+ export * from "./UXCheckbox/index.js";
13
+ export * from "./UXChip/index.js";
14
+ export * from "./UXDivider/index.js";
15
+ export * from "./UXHint/index.js";
16
+ export * from "./UXModal/index.js";
17
+ export * from "./UXPressable/index.js";
18
+ export * from "./UXRadio/index.js";
19
+ export * from "./UXSwitch/index.js";
20
+ export * from "./UXTabs/index.js";
21
+ export * from "./UXTooltip/index.js";
22
+ export * from "./UXTouchableOpacity/index.js";
@@ -0,0 +1,3 @@
1
+ export * from './input';
2
+ export * from './number-input';
3
+ export type * from './types';
@@ -0,0 +1,2 @@
1
+ export * from "./input.js";
2
+ export * from "./number-input.js";
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import type { UXInputProps, UXInputRef } from './types';
3
+ export declare const UXInput: React.ForwardRefExoticComponent<UXInputProps & React.RefAttributes<UXInputRef>>;