@xaui/native 0.0.26 → 0.0.28
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/LICENSE +21 -0
- package/README.md +105 -228
- package/dist/alert/index.cjs +92 -166
- package/dist/alert/index.js +2 -1
- package/dist/app-bar/index.cjs +24 -98
- package/dist/app-bar/index.js +2 -1
- package/dist/autocomplete/index.cjs +192 -281
- package/dist/autocomplete/index.js +36 -48
- package/dist/avatar/index.cjs +59 -133
- package/dist/avatar/index.js +2 -1
- package/dist/badge/index.cjs +26 -99
- package/dist/badge/index.js +2 -1
- package/dist/bottom-sheet/index.cjs +5 -456
- package/dist/bottom-sheet/index.js +4 -363
- package/dist/bottom-tab-bar/index.cjs +93 -167
- package/dist/bottom-tab-bar/index.js +2 -2
- package/dist/button/index.cjs +73 -525
- package/dist/button/index.js +3 -2
- package/dist/card/index.cjs +76 -169
- package/dist/card/index.js +2 -2
- package/dist/carousel/index.cjs +68 -145
- package/dist/carousel/index.js +1 -1
- package/dist/chart/index.cjs +132 -173
- package/dist/checkbox/index.cjs +70 -143
- package/dist/checkbox/index.js +2 -1
- package/dist/chip/index.cjs +89 -164
- package/dist/chip/index.js +2 -1
- package/dist/chunk-BD72HIPR.cjs +75 -0
- package/dist/chunk-DHSTKO3K.cjs +19 -0
- package/dist/{chunk-CZFDZPAS.js → chunk-DXXNBF5P.js} +5 -0
- package/dist/{chunk-UI5L26KD.js → chunk-F7WH4DMG.js} +1 -1
- package/dist/chunk-GBHQCAKW.js +19 -0
- package/dist/chunk-HC2SSHNU.js +368 -0
- package/dist/chunk-HSPTLUFA.cjs +7 -0
- package/dist/chunk-JEGEPGVU.js +287 -0
- package/dist/chunk-KTLGDLCB.cjs +287 -0
- package/dist/{chunk-GHCVNQET.js → chunk-LTKYHG5V.js} +5 -12
- package/dist/{chunk-ULJSCNPE.js → chunk-LUBWRVI2.js} +1 -1
- package/dist/chunk-OQ2BLOOG.cjs +138 -0
- package/dist/chunk-QMYWIWSX.cjs +384 -0
- package/dist/chunk-XFPPR2VB.cjs +368 -0
- package/dist/core/index.cjs +22 -168
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +5 -3
- package/dist/datepicker/index.cjs +239 -320
- package/dist/datepicker/index.js +2 -1
- package/dist/divider/index.cjs +5 -145
- package/dist/divider/index.js +3 -2
- package/dist/drawer/index.cjs +39 -112
- package/dist/drawer/index.js +2 -1
- package/dist/expansion-panel/index.cjs +91 -230
- package/dist/expansion-panel/index.js +3 -2
- package/dist/fab/index.cjs +6 -722
- package/dist/fab/index.js +4 -3
- package/dist/fab-menu/index.cjs +81 -814
- package/dist/fab-menu/index.js +4 -3
- package/dist/feature-discovery/index.cjs +72 -139
- package/dist/feature-discovery/index.js +2 -2
- package/dist/index.cjs +1 -18
- package/dist/indicator/index.cjs +5 -445
- package/dist/indicator/index.js +3 -2
- package/dist/input/index.cjs +214 -282
- package/dist/input/index.js +2 -2
- package/dist/list/index.cjs +71 -146
- package/dist/list/index.js +2 -1
- package/dist/menu/index.cjs +59 -127
- package/dist/menu/index.js +2 -2
- package/dist/menubox/index.cjs +60 -132
- package/dist/menubox/index.js +2 -1
- package/dist/pager/index.cjs +42 -80
- package/dist/progress/index.cjs +43 -114
- package/dist/progress/index.js +2 -1
- package/dist/radio/index.cjs +82 -154
- package/dist/radio/index.js +2 -1
- package/dist/segment-button/index.cjs +60 -147
- package/dist/segment-button/index.js +2 -2
- package/dist/select/index.cjs +149 -224
- package/dist/select/index.js +10 -22
- package/dist/skeleton/index.cjs +23 -94
- package/dist/skeleton/index.js +2 -2
- package/dist/slider/index.cjs +77 -156
- package/dist/slider/index.js +2 -1
- package/dist/snackbar/index.cjs +420 -0
- package/dist/snackbar/index.d.cts +175 -0
- package/dist/snackbar/index.d.ts +175 -0
- package/dist/snackbar/index.js +420 -0
- package/dist/stepper/index.cjs +121 -195
- package/dist/stepper/index.js +2 -1
- package/dist/switch/index.cjs +48 -121
- package/dist/switch/index.js +2 -1
- package/dist/tabs/index.cjs +67 -151
- package/dist/tabs/index.js +2 -1
- package/dist/timepicker/index.cjs +135 -593
- package/dist/timepicker/index.js +24 -383
- package/dist/toolbar/index.cjs +59 -128
- package/dist/toolbar/index.js +2 -1
- package/dist/typography/index.cjs +37 -92
- package/dist/typography/index.d.cts +1 -1
- package/dist/typography/index.d.ts +1 -1
- package/dist/typography/index.js +20 -1
- package/dist/view/index.cjs +178 -223
- package/package.json +7 -1
- package/dist/chunk-3XSXTM3G.js +0 -661
- package/dist/chunk-4KSZLONZ.js +0 -79
- package/dist/chunk-I4V5Y5GD.js +0 -76
- package/dist/chunk-URBEEDFX.js +0 -79
package/dist/button/index.cjs
CHANGED
|
@@ -1,470 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/components/button/index.ts
|
|
31
|
-
var button_exports = {};
|
|
32
|
-
__export(button_exports, {
|
|
33
|
-
Button: () => Button,
|
|
34
|
-
IconButton: () => IconButton
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(button_exports);
|
|
37
|
-
|
|
38
|
-
// src/components/button/button.tsx
|
|
39
|
-
var import_react11 = __toESM(require("react"), 1);
|
|
40
|
-
var import_react_native10 = require("react-native");
|
|
41
|
-
|
|
42
|
-
// src/components/indicator/indicator.tsx
|
|
43
|
-
var import_react9 = __toESM(require("react"), 1);
|
|
44
|
-
var import_react_native7 = require("react-native");
|
|
45
|
-
|
|
46
|
-
// src/core/theme-context.tsx
|
|
47
|
-
var import_react4 = __toESM(require("react"), 1);
|
|
48
|
-
var import_react_native2 = require("react-native");
|
|
49
|
-
var import_theme = require("@xaui/core/theme");
|
|
50
|
-
var import_palette = require("@xaui/core/palette");
|
|
51
|
-
|
|
52
|
-
// src/core/portal/portal.tsx
|
|
53
|
-
var import_react2 = require("react");
|
|
54
|
-
|
|
55
|
-
// src/core/portal/portal-context.ts
|
|
56
|
-
var import_react = require("react");
|
|
57
|
-
var PortalContext = (0, import_react.createContext)(null);
|
|
58
|
-
|
|
59
|
-
// src/core/portal/portal-host.tsx
|
|
60
|
-
var import_react3 = __toESM(require("react"), 1);
|
|
61
|
-
var import_react_native = require("react-native");
|
|
62
|
-
var hostStyles = import_react_native.StyleSheet.create({
|
|
63
|
-
container: {
|
|
64
|
-
flex: 1
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// src/core/theme-context.tsx
|
|
69
|
-
var XUIThemeContext = (0, import_react4.createContext)(null);
|
|
70
|
-
|
|
71
|
-
// src/core/theme-hooks.ts
|
|
72
|
-
var import_react5 = require("react");
|
|
73
|
-
var import_react_native3 = require("react-native");
|
|
74
|
-
function useXUITheme() {
|
|
75
|
-
const theme = (0, import_react5.useContext)(XUIThemeContext);
|
|
76
|
-
if (!theme) {
|
|
77
|
-
throw new Error("useXUITheme must be used within XUIProvider");
|
|
78
|
-
}
|
|
79
|
-
return theme;
|
|
80
|
-
}
|
|
81
|
-
function useBorderRadiusStyles(radius) {
|
|
82
|
-
const theme = useXUITheme();
|
|
83
|
-
const borderRadius = (0, import_react5.useMemo)(() => {
|
|
84
|
-
const radiusMap = {
|
|
85
|
-
none: theme.borderRadius.none,
|
|
86
|
-
sm: theme.borderRadius.sm,
|
|
87
|
-
md: theme.borderRadius.md,
|
|
88
|
-
lg: theme.borderRadius.lg,
|
|
89
|
-
full: theme.borderRadius.full
|
|
90
|
-
};
|
|
91
|
-
return { borderRadius: radiusMap[radius] };
|
|
92
|
-
}, [radius, theme]);
|
|
93
|
-
return borderRadius;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// src/core/index.ts
|
|
97
|
-
var import_theme2 = require("@xaui/core/theme");
|
|
98
|
-
|
|
99
|
-
// src/components/indicator/circular-activity-indicator.tsx
|
|
100
|
-
var import_react6 = __toESM(require("react"), 1);
|
|
101
|
-
var import_react_native5 = require("react-native");
|
|
102
|
-
|
|
103
|
-
// src/components/indicator/indicator.style.ts
|
|
104
|
-
var import_react_native4 = require("react-native");
|
|
105
|
-
var styles = import_react_native4.StyleSheet.create({
|
|
106
|
-
container: {
|
|
107
|
-
flexShrink: 1,
|
|
108
|
-
flexBasis: "auto",
|
|
109
|
-
width: "100%",
|
|
110
|
-
justifyContent: "center"
|
|
111
|
-
},
|
|
112
|
-
layer: {
|
|
113
|
-
...import_react_native4.StyleSheet.absoluteFillObject,
|
|
114
|
-
justifyContent: "center",
|
|
115
|
-
alignItems: "center"
|
|
116
|
-
},
|
|
117
|
-
track: {
|
|
118
|
-
width: "100%",
|
|
119
|
-
overflow: "hidden"
|
|
120
|
-
},
|
|
121
|
-
progress: {
|
|
122
|
-
height: "100%"
|
|
123
|
-
}
|
|
124
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
125
2
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
var DURATION = 1800;
|
|
129
|
-
var CircularActivityIndicator = ({
|
|
130
|
-
size = 40,
|
|
131
|
-
themeColor = "primary",
|
|
132
|
-
color,
|
|
133
|
-
backgroundColor,
|
|
134
|
-
disableAnimation = false,
|
|
135
|
-
showTrack = true
|
|
136
|
-
}) => {
|
|
137
|
-
const theme = useXUITheme();
|
|
138
|
-
const { current: timer } = (0, import_react6.useRef)(new import_react_native5.Animated.Value(0));
|
|
139
|
-
const rotation = (0, import_react6.useRef)(void 0);
|
|
140
|
-
const startRotation = import_react6.default.useCallback(() => {
|
|
141
|
-
if (rotation.current) {
|
|
142
|
-
timer.setValue(0);
|
|
143
|
-
import_react_native5.Animated.loop(rotation.current).start();
|
|
144
|
-
}
|
|
145
|
-
}, [timer]);
|
|
146
|
-
const stopRotation = () => {
|
|
147
|
-
if (rotation.current) rotation.current.stop();
|
|
148
|
-
};
|
|
149
|
-
(0, import_react6.useEffect)(() => {
|
|
150
|
-
if (rotation.current === void 0) {
|
|
151
|
-
rotation.current = import_react_native5.Animated.timing(timer, {
|
|
152
|
-
duration: DURATION,
|
|
153
|
-
easing: import_react_native5.Easing.linear,
|
|
154
|
-
useNativeDriver: import_react_native5.Platform.OS !== "web",
|
|
155
|
-
toValue: 1
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
if (!disableAnimation) startRotation();
|
|
159
|
-
else stopRotation();
|
|
160
|
-
}, [disableAnimation, startRotation, timer]);
|
|
161
|
-
const safeThemeColor = (0, import_core2.getSafeThemeColor)(themeColor);
|
|
162
|
-
const colorScheme = theme.colors[safeThemeColor];
|
|
163
|
-
const mainColor = color || colorScheme.main;
|
|
164
|
-
const trackColor = showTrack ? backgroundColor ?? colorScheme.background : "transparent";
|
|
165
|
-
const strokeWidth = size * 0.1;
|
|
166
|
-
const frames = 60 * DURATION / 1e3;
|
|
167
|
-
const easing = import_react_native5.Easing.bezier(0.4, 0, 0.7, 1);
|
|
168
|
-
const containerStyle = {
|
|
169
|
-
width: size,
|
|
170
|
-
height: size / 2,
|
|
171
|
-
overflow: "hidden"
|
|
172
|
-
};
|
|
173
|
-
return /* @__PURE__ */ import_react6.default.createElement(import_react_native5.View, { style: [styles.container, { width: size, height: size }] }, /* @__PURE__ */ import_react6.default.createElement(
|
|
174
|
-
import_react_native5.View,
|
|
175
|
-
{
|
|
176
|
-
style: {
|
|
177
|
-
width: size,
|
|
178
|
-
height: size,
|
|
179
|
-
borderRadius: size / 2,
|
|
180
|
-
borderWidth: strokeWidth,
|
|
181
|
-
borderColor: trackColor
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
), /* @__PURE__ */ import_react6.default.createElement(
|
|
185
|
-
import_react_native5.View,
|
|
186
|
-
{
|
|
187
|
-
style: {
|
|
188
|
-
width: size,
|
|
189
|
-
height: size,
|
|
190
|
-
position: "absolute"
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
[0, 1].map((index) => {
|
|
194
|
-
const inputRange = Array.from(
|
|
195
|
-
new Array(frames),
|
|
196
|
-
(_, frameIndex) => frameIndex / (frames - 1)
|
|
197
|
-
);
|
|
198
|
-
const outputRange = Array.from(new Array(frames), (_, frameIndex) => {
|
|
199
|
-
let progress = 2 * frameIndex / (frames - 1);
|
|
200
|
-
const rotationValue = index ? +(360 - 15) : -(180 - 15);
|
|
201
|
-
if (progress > 1) {
|
|
202
|
-
progress = 2 - progress;
|
|
203
|
-
}
|
|
204
|
-
const direction = index ? -1 : 1;
|
|
205
|
-
return `${direction * (180 - 30) * easing(progress) + rotationValue}deg`;
|
|
206
|
-
});
|
|
207
|
-
const layerStyle = {
|
|
208
|
-
width: size,
|
|
209
|
-
height: size,
|
|
210
|
-
transform: [
|
|
211
|
-
{
|
|
212
|
-
rotate: timer.interpolate({
|
|
213
|
-
inputRange: [0, 1],
|
|
214
|
-
outputRange: [`${0 + 30 + 15}deg`, `${2 * 360 + 30 + 15}deg`]
|
|
215
|
-
})
|
|
216
|
-
}
|
|
217
|
-
]
|
|
218
|
-
};
|
|
219
|
-
const viewportStyle = {
|
|
220
|
-
width: size,
|
|
221
|
-
height: size,
|
|
222
|
-
transform: [
|
|
223
|
-
{ translateY: index ? -size / 2 : 0 },
|
|
224
|
-
{
|
|
225
|
-
rotate: timer.interpolate({ inputRange, outputRange })
|
|
226
|
-
}
|
|
227
|
-
]
|
|
228
|
-
};
|
|
229
|
-
const offsetStyle = index ? { top: size / 2 } : null;
|
|
230
|
-
const lineStyle = {
|
|
231
|
-
width: size,
|
|
232
|
-
height: size,
|
|
233
|
-
borderColor: mainColor,
|
|
234
|
-
borderWidth: strokeWidth,
|
|
235
|
-
borderRadius: size / 2
|
|
236
|
-
};
|
|
237
|
-
return /* @__PURE__ */ import_react6.default.createElement(import_react_native5.Animated.View, { key: index, style: [styles.layer] }, /* @__PURE__ */ import_react6.default.createElement(import_react_native5.Animated.View, { style: layerStyle }, /* @__PURE__ */ import_react6.default.createElement(
|
|
238
|
-
import_react_native5.Animated.View,
|
|
239
|
-
{
|
|
240
|
-
style: [containerStyle, offsetStyle],
|
|
241
|
-
collapsable: false
|
|
242
|
-
},
|
|
243
|
-
/* @__PURE__ */ import_react6.default.createElement(import_react_native5.Animated.View, { style: viewportStyle }, /* @__PURE__ */ import_react6.default.createElement(import_react_native5.Animated.View, { style: containerStyle, collapsable: false }, /* @__PURE__ */ import_react6.default.createElement(import_react_native5.Animated.View, { style: lineStyle })))
|
|
244
|
-
)));
|
|
245
|
-
})
|
|
246
|
-
));
|
|
247
|
-
};
|
|
3
|
+
var _chunkQMYWIWSXcjs = require('../chunk-QMYWIWSX.cjs');
|
|
4
|
+
require('../chunk-HSPTLUFA.cjs');
|
|
248
5
|
|
|
249
|
-
// src/components/indicator/linear-activity-indicator.tsx
|
|
250
|
-
var import_react8 = __toESM(require("react"), 1);
|
|
251
|
-
var import_react_native6 = require("react-native");
|
|
252
|
-
var import_react_native_reanimated2 = __toESM(require("react-native-reanimated"), 1);
|
|
253
6
|
|
|
254
|
-
// src/components/indicator/indicator.hook.ts
|
|
255
|
-
var import_react7 = require("react");
|
|
256
|
-
var import_react_native_reanimated = require("react-native-reanimated");
|
|
257
|
-
var useLinearActivityIndicatorAnimation = (disableAnimation) => {
|
|
258
|
-
const primaryTranslateX = (0, import_react_native_reanimated.useSharedValue)(0);
|
|
259
|
-
const primaryScaleX = (0, import_react_native_reanimated.useSharedValue)(0.08);
|
|
260
|
-
const secondaryTranslateX = (0, import_react_native_reanimated.useSharedValue)(0);
|
|
261
|
-
const secondaryScaleX = (0, import_react_native_reanimated.useSharedValue)(0.08);
|
|
262
|
-
(0, import_react7.useEffect)(() => {
|
|
263
|
-
if (disableAnimation) {
|
|
264
|
-
(0, import_react_native_reanimated.cancelAnimation)(primaryTranslateX);
|
|
265
|
-
(0, import_react_native_reanimated.cancelAnimation)(primaryScaleX);
|
|
266
|
-
(0, import_react_native_reanimated.cancelAnimation)(secondaryTranslateX);
|
|
267
|
-
(0, import_react_native_reanimated.cancelAnimation)(secondaryScaleX);
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
primaryTranslateX.value = (0, import_react_native_reanimated.withRepeat)(
|
|
271
|
-
(0, import_react_native_reanimated.withSequence)(
|
|
272
|
-
(0, import_react_native_reanimated.withTiming)(0, { duration: 0 }),
|
|
273
|
-
(0, import_react_native_reanimated.withTiming)(0, { duration: 400, easing: import_react_native_reanimated.Easing.linear }),
|
|
274
|
-
(0, import_react_native_reanimated.withTiming)(0.836714, {
|
|
275
|
-
duration: 783,
|
|
276
|
-
easing: import_react_native_reanimated.Easing.bezier(0.5, 0, 0.701732, 0.495819)
|
|
277
|
-
}),
|
|
278
|
-
(0, import_react_native_reanimated.withTiming)(2.00611, {
|
|
279
|
-
duration: 817,
|
|
280
|
-
easing: import_react_native_reanimated.Easing.bezier(0.302435, 0.381352, 0.55, 0.956352)
|
|
281
|
-
})
|
|
282
|
-
),
|
|
283
|
-
-1,
|
|
284
|
-
false
|
|
285
|
-
);
|
|
286
|
-
primaryScaleX.value = (0, import_react_native_reanimated.withRepeat)(
|
|
287
|
-
(0, import_react_native_reanimated.withSequence)(
|
|
288
|
-
(0, import_react_native_reanimated.withTiming)(0.08, { duration: 0 }),
|
|
289
|
-
(0, import_react_native_reanimated.withTiming)(0.08, { duration: 733, easing: import_react_native_reanimated.Easing.linear }),
|
|
290
|
-
(0, import_react_native_reanimated.withTiming)(0.661479, {
|
|
291
|
-
duration: 650,
|
|
292
|
-
easing: import_react_native_reanimated.Easing.bezier(0.334731, 0.12482, 0.785844, 1)
|
|
293
|
-
}),
|
|
294
|
-
(0, import_react_native_reanimated.withTiming)(0.08, {
|
|
295
|
-
duration: 617,
|
|
296
|
-
easing: import_react_native_reanimated.Easing.bezier(0.06, 0.11, 0.6, 1)
|
|
297
|
-
})
|
|
298
|
-
),
|
|
299
|
-
-1,
|
|
300
|
-
false
|
|
301
|
-
);
|
|
302
|
-
secondaryTranslateX.value = (0, import_react_native_reanimated.withRepeat)(
|
|
303
|
-
(0, import_react_native_reanimated.withSequence)(
|
|
304
|
-
(0, import_react_native_reanimated.withTiming)(0, { duration: 0 }),
|
|
305
|
-
(0, import_react_native_reanimated.withTiming)(0.376519, {
|
|
306
|
-
duration: 500,
|
|
307
|
-
easing: import_react_native_reanimated.Easing.bezier(0.15, 0, 0.515058, 0.409685)
|
|
308
|
-
}),
|
|
309
|
-
(0, import_react_native_reanimated.withTiming)(0.843862, {
|
|
310
|
-
duration: 467,
|
|
311
|
-
easing: import_react_native_reanimated.Easing.bezier(0.31033, 0.284058, 0.8, 0.733712)
|
|
312
|
-
}),
|
|
313
|
-
(0, import_react_native_reanimated.withTiming)(1.60278, {
|
|
314
|
-
duration: 1033,
|
|
315
|
-
easing: import_react_native_reanimated.Easing.bezier(0.4, 0.627035, 0.6, 0.902026)
|
|
316
|
-
})
|
|
317
|
-
),
|
|
318
|
-
-1,
|
|
319
|
-
false
|
|
320
|
-
);
|
|
321
|
-
secondaryScaleX.value = (0, import_react_native_reanimated.withRepeat)(
|
|
322
|
-
(0, import_react_native_reanimated.withSequence)(
|
|
323
|
-
(0, import_react_native_reanimated.withTiming)(0.08, { duration: 0 }),
|
|
324
|
-
(0, import_react_native_reanimated.withTiming)(0.457104, {
|
|
325
|
-
duration: 383,
|
|
326
|
-
easing: import_react_native_reanimated.Easing.bezier(0.205028, 0.057051, 0.57661, 0.453971)
|
|
327
|
-
}),
|
|
328
|
-
(0, import_react_native_reanimated.withTiming)(0.72796, {
|
|
329
|
-
duration: 500,
|
|
330
|
-
easing: import_react_native_reanimated.Easing.bezier(0.152313, 0.196432, 0.648374, 1.00432)
|
|
331
|
-
}),
|
|
332
|
-
(0, import_react_native_reanimated.withTiming)(0.08, {
|
|
333
|
-
duration: 1117,
|
|
334
|
-
easing: import_react_native_reanimated.Easing.bezier(0.257759, -3163e-6, 0.211762, 1.38179)
|
|
335
|
-
})
|
|
336
|
-
),
|
|
337
|
-
-1,
|
|
338
|
-
false
|
|
339
|
-
);
|
|
340
|
-
return () => {
|
|
341
|
-
(0, import_react_native_reanimated.cancelAnimation)(primaryTranslateX);
|
|
342
|
-
(0, import_react_native_reanimated.cancelAnimation)(primaryScaleX);
|
|
343
|
-
(0, import_react_native_reanimated.cancelAnimation)(secondaryTranslateX);
|
|
344
|
-
(0, import_react_native_reanimated.cancelAnimation)(secondaryScaleX);
|
|
345
|
-
};
|
|
346
|
-
}, [disableAnimation]);
|
|
347
|
-
return {
|
|
348
|
-
primaryTranslateX,
|
|
349
|
-
primaryScaleX,
|
|
350
|
-
secondaryTranslateX,
|
|
351
|
-
secondaryScaleX
|
|
352
|
-
};
|
|
353
|
-
};
|
|
354
7
|
|
|
355
|
-
|
|
356
|
-
var LinearActivityIndicator = ({
|
|
357
|
-
size = 4,
|
|
358
|
-
themeColor = "primary",
|
|
359
|
-
color,
|
|
360
|
-
backgroundColor,
|
|
361
|
-
disableAnimation = false,
|
|
362
|
-
borderRadius = 0,
|
|
363
|
-
showTrack = true
|
|
364
|
-
}) => {
|
|
365
|
-
const theme = useXUITheme();
|
|
366
|
-
const { primaryTranslateX, primaryScaleX, secondaryTranslateX, secondaryScaleX } = useLinearActivityIndicatorAnimation(disableAnimation);
|
|
367
|
-
const colorScheme = theme.colors[themeColor];
|
|
368
|
-
const mainColor = color || colorScheme.main;
|
|
369
|
-
const trackColor = showTrack ? backgroundColor ?? colorScheme.background : "transparent";
|
|
370
|
-
const barStyle = {
|
|
371
|
-
...import_react_native6.StyleSheet.absoluteFillObject,
|
|
372
|
-
backgroundColor: mainColor,
|
|
373
|
-
borderRadius
|
|
374
|
-
};
|
|
375
|
-
const primaryStyle = (0, import_react_native_reanimated2.useAnimatedStyle)(() => ({
|
|
376
|
-
transform: [
|
|
377
|
-
{ translateX: `${(primaryTranslateX.value - 1.45167) * 100}%` },
|
|
378
|
-
{ scaleX: primaryScaleX.value }
|
|
379
|
-
]
|
|
380
|
-
}));
|
|
381
|
-
const secondaryStyle = (0, import_react_native_reanimated2.useAnimatedStyle)(() => ({
|
|
382
|
-
transform: [
|
|
383
|
-
{ translateX: `${(secondaryTranslateX.value - 0.548889) * 100}%` },
|
|
384
|
-
{ scaleX: secondaryScaleX.value }
|
|
385
|
-
]
|
|
386
|
-
}));
|
|
387
|
-
return /* @__PURE__ */ import_react8.default.createElement(
|
|
388
|
-
import_react_native6.View,
|
|
389
|
-
{
|
|
390
|
-
style: {
|
|
391
|
-
height: size,
|
|
392
|
-
width: "100%",
|
|
393
|
-
borderRadius,
|
|
394
|
-
backgroundColor: trackColor,
|
|
395
|
-
overflow: "hidden"
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
/* @__PURE__ */ import_react8.default.createElement(import_react_native_reanimated2.default.View, { style: [barStyle, primaryStyle] }),
|
|
399
|
-
/* @__PURE__ */ import_react8.default.createElement(import_react_native_reanimated2.default.View, { style: [barStyle, secondaryStyle] })
|
|
400
|
-
);
|
|
401
|
-
};
|
|
8
|
+
var _chunkOQ2BLOOGcjs = require('../chunk-OQ2BLOOG.cjs');
|
|
402
9
|
|
|
403
|
-
// src/components/
|
|
404
|
-
var
|
|
405
|
-
|
|
406
|
-
variant = "circular",
|
|
407
|
-
themeColor = "primary",
|
|
408
|
-
color,
|
|
409
|
-
backgroundColor,
|
|
410
|
-
size,
|
|
411
|
-
disableAnimation = false,
|
|
412
|
-
borderRadius,
|
|
413
|
-
showTrack
|
|
414
|
-
} = props;
|
|
415
|
-
const theme = useXUITheme();
|
|
416
|
-
const colorScheme = theme.colors[themeColor];
|
|
417
|
-
const mainColor = color ?? colorScheme.main;
|
|
418
|
-
const trackColor = backgroundColor ?? (showTrack ? colorScheme.background : "transparent");
|
|
419
|
-
if (variant === "circular") {
|
|
420
|
-
const circleSize = size ?? 40;
|
|
421
|
-
return /* @__PURE__ */ import_react9.default.createElement(
|
|
422
|
-
import_react_native7.View,
|
|
423
|
-
{
|
|
424
|
-
style: [styles.container, { width: circleSize, height: circleSize }],
|
|
425
|
-
accessible: true,
|
|
426
|
-
accessibilityRole: "progressbar",
|
|
427
|
-
accessibilityLabel: "Loading"
|
|
428
|
-
},
|
|
429
|
-
/* @__PURE__ */ import_react9.default.createElement(
|
|
430
|
-
CircularActivityIndicator,
|
|
431
|
-
{
|
|
432
|
-
size: circleSize,
|
|
433
|
-
themeColor,
|
|
434
|
-
color: mainColor,
|
|
435
|
-
backgroundColor: trackColor,
|
|
436
|
-
disableAnimation
|
|
437
|
-
}
|
|
438
|
-
)
|
|
439
|
-
);
|
|
440
|
-
}
|
|
441
|
-
const linearSize = size ?? 4;
|
|
442
|
-
return /* @__PURE__ */ import_react9.default.createElement(
|
|
443
|
-
import_react_native7.View,
|
|
444
|
-
{
|
|
445
|
-
style: styles.container,
|
|
446
|
-
accessible: true,
|
|
447
|
-
accessibilityRole: "progressbar",
|
|
448
|
-
accessibilityLabel: "Loading"
|
|
449
|
-
},
|
|
450
|
-
/* @__PURE__ */ import_react9.default.createElement(
|
|
451
|
-
LinearActivityIndicator,
|
|
452
|
-
{
|
|
453
|
-
size: linearSize,
|
|
454
|
-
themeColor,
|
|
455
|
-
color: mainColor,
|
|
456
|
-
backgroundColor: trackColor,
|
|
457
|
-
disableAnimation,
|
|
458
|
-
borderRadius,
|
|
459
|
-
showTrack
|
|
460
|
-
}
|
|
461
|
-
)
|
|
462
|
-
);
|
|
463
|
-
};
|
|
10
|
+
// src/components/button/button.tsx
|
|
11
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
12
|
+
var _reactnative = require('react-native');
|
|
464
13
|
|
|
465
14
|
// src/components/button/button.style.ts
|
|
466
|
-
|
|
467
|
-
var
|
|
15
|
+
|
|
16
|
+
var styles = _reactnative.StyleSheet.create({
|
|
468
17
|
button: {
|
|
469
18
|
flexDirection: "row",
|
|
470
19
|
alignItems: "center",
|
|
@@ -504,13 +53,13 @@ var styles2 = import_react_native8.StyleSheet.create({
|
|
|
504
53
|
});
|
|
505
54
|
|
|
506
55
|
// src/components/button/button.hook.ts
|
|
507
|
-
|
|
508
|
-
var
|
|
56
|
+
|
|
57
|
+
var _core = require('@xaui/core');
|
|
509
58
|
var useTextStyles = (themeColor, variant) => {
|
|
510
|
-
const theme = useXUITheme();
|
|
511
|
-
const safeThemeColor = (0,
|
|
59
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
60
|
+
const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
|
|
512
61
|
const colorScheme = theme.colors[safeThemeColor];
|
|
513
|
-
const textColor = (0,
|
|
62
|
+
const textColor = _react.useMemo.call(void 0, () => {
|
|
514
63
|
if (variant === "solid") {
|
|
515
64
|
return colorScheme.foreground;
|
|
516
65
|
}
|
|
@@ -521,8 +70,8 @@ var useTextStyles = (themeColor, variant) => {
|
|
|
521
70
|
};
|
|
522
71
|
};
|
|
523
72
|
function useSizesStyles(size) {
|
|
524
|
-
const theme = useXUITheme();
|
|
525
|
-
const sizeStyles = (0,
|
|
73
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
74
|
+
const sizeStyles = _react.useMemo.call(void 0, () => {
|
|
526
75
|
const sizes = {
|
|
527
76
|
xs: {
|
|
528
77
|
paddingHorizontal: theme.spacing.sm,
|
|
@@ -551,7 +100,7 @@ function useSizesStyles(size) {
|
|
|
551
100
|
};
|
|
552
101
|
return sizes[size];
|
|
553
102
|
}, [size, theme]);
|
|
554
|
-
const spinnerSize = (0,
|
|
103
|
+
const spinnerSize = _react.useMemo.call(void 0, () => {
|
|
555
104
|
const sizes = {
|
|
556
105
|
xs: 14,
|
|
557
106
|
sm: 16,
|
|
@@ -563,11 +112,11 @@ function useSizesStyles(size) {
|
|
|
563
112
|
return { sizeStyles, spinnerSize };
|
|
564
113
|
}
|
|
565
114
|
function useVariantSizesStyles(themeColor, variant, elevation = 0) {
|
|
566
|
-
const theme = useXUITheme();
|
|
567
|
-
const safeThemeColor = (0,
|
|
115
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
116
|
+
const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
|
|
568
117
|
const colorScheme = theme.colors[safeThemeColor];
|
|
569
|
-
const variantStyles = (0,
|
|
570
|
-
const
|
|
118
|
+
const variantStyles = _react.useMemo.call(void 0, () => {
|
|
119
|
+
const styles2 = {
|
|
571
120
|
solid: {
|
|
572
121
|
backgroundColor: colorScheme.main,
|
|
573
122
|
borderWidth: 0
|
|
@@ -591,7 +140,7 @@ function useVariantSizesStyles(themeColor, variant, elevation = 0) {
|
|
|
591
140
|
borderColor: `${colorScheme.main}90`
|
|
592
141
|
}
|
|
593
142
|
};
|
|
594
|
-
const baseStyle =
|
|
143
|
+
const baseStyle = styles2[variant];
|
|
595
144
|
const shouldApplyElevation = variant !== "outlined" && variant !== "light";
|
|
596
145
|
const shadowStyles = elevation === 0 ? {} : elevation === 1 ? theme.shadows.sm : elevation === 2 ? theme.shadows.md : elevation === 3 ? theme.shadows.lg : theme.shadows.xl;
|
|
597
146
|
return {
|
|
@@ -604,16 +153,16 @@ function useVariantSizesStyles(themeColor, variant, elevation = 0) {
|
|
|
604
153
|
}
|
|
605
154
|
|
|
606
155
|
// src/components/button/button.animation.ts
|
|
607
|
-
|
|
156
|
+
|
|
608
157
|
var runPressInAnimation = (animatedScale, animatedOpacity) => {
|
|
609
|
-
|
|
610
|
-
|
|
158
|
+
_reactnative.Animated.parallel([
|
|
159
|
+
_reactnative.Animated.spring(animatedScale, {
|
|
611
160
|
toValue: 0.975,
|
|
612
161
|
useNativeDriver: true,
|
|
613
162
|
speed: 50,
|
|
614
163
|
bounciness: 0
|
|
615
164
|
}),
|
|
616
|
-
|
|
165
|
+
_reactnative.Animated.timing(animatedOpacity, {
|
|
617
166
|
toValue: 0.9,
|
|
618
167
|
duration: 100,
|
|
619
168
|
useNativeDriver: true
|
|
@@ -621,14 +170,14 @@ var runPressInAnimation = (animatedScale, animatedOpacity) => {
|
|
|
621
170
|
]).start();
|
|
622
171
|
};
|
|
623
172
|
var runPressOutAnimation = (animatedScale, animatedOpacity) => {
|
|
624
|
-
|
|
625
|
-
|
|
173
|
+
_reactnative.Animated.parallel([
|
|
174
|
+
_reactnative.Animated.spring(animatedScale, {
|
|
626
175
|
toValue: 1,
|
|
627
176
|
useNativeDriver: true,
|
|
628
177
|
speed: 50,
|
|
629
178
|
bounciness: 0
|
|
630
179
|
}),
|
|
631
|
-
|
|
180
|
+
_reactnative.Animated.timing(animatedOpacity, {
|
|
632
181
|
toValue: 1,
|
|
633
182
|
duration: 100,
|
|
634
183
|
useNativeDriver: true
|
|
@@ -656,26 +205,26 @@ var Button = ({
|
|
|
656
205
|
onPressIn,
|
|
657
206
|
onPressOut
|
|
658
207
|
}) => {
|
|
659
|
-
const animatedScale =
|
|
660
|
-
const animatedOpacity =
|
|
208
|
+
const animatedScale = _react2.default.useRef(new _reactnative.Animated.Value(1)).current;
|
|
209
|
+
const animatedOpacity = _react2.default.useRef(new _reactnative.Animated.Value(1)).current;
|
|
661
210
|
const { sizeStyles, spinnerSize } = useSizesStyles(size);
|
|
662
|
-
const radiusStyles = useBorderRadiusStyles(radius);
|
|
211
|
+
const radiusStyles = _chunkOQ2BLOOGcjs.useBorderRadiusStyles.call(void 0, radius);
|
|
663
212
|
const variantStyles = useVariantSizesStyles(themeColor, variant, elevation);
|
|
664
213
|
const { textColor } = useTextStyles(themeColor, variant);
|
|
665
214
|
const handlePressIn = (event) => {
|
|
666
215
|
if (!isDisabled && !isLoading) {
|
|
667
216
|
runPressInAnimation(animatedScale, animatedOpacity);
|
|
668
217
|
}
|
|
669
|
-
onPressIn
|
|
218
|
+
_optionalChain([onPressIn, 'optionalCall', _ => _(event)]);
|
|
670
219
|
};
|
|
671
220
|
const handlePressOut = (event) => {
|
|
672
221
|
if (!isDisabled && !isLoading) {
|
|
673
222
|
runPressOutAnimation(animatedScale, animatedOpacity);
|
|
674
223
|
}
|
|
675
|
-
onPressOut
|
|
224
|
+
_optionalChain([onPressOut, 'optionalCall', _2 => _2(event)]);
|
|
676
225
|
};
|
|
677
|
-
const spinner = /* @__PURE__ */
|
|
678
|
-
ActivityIndicator,
|
|
226
|
+
const spinner = /* @__PURE__ */ _react2.default.createElement(
|
|
227
|
+
_chunkQMYWIWSXcjs.ActivityIndicator,
|
|
679
228
|
{
|
|
680
229
|
variant: "circular",
|
|
681
230
|
themeColor: variant === "solid" ? void 0 : themeColor,
|
|
@@ -683,8 +232,8 @@ var Button = ({
|
|
|
683
232
|
size: spinnerSize
|
|
684
233
|
}
|
|
685
234
|
);
|
|
686
|
-
return /* @__PURE__ */
|
|
687
|
-
|
|
235
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [fullWidth && styles.fullWidth, _optionalChain([customAppearance, 'optionalAccess', _3 => _3.container])] }, /* @__PURE__ */ _react2.default.createElement(
|
|
236
|
+
_reactnative.Pressable,
|
|
688
237
|
{
|
|
689
238
|
onPress: isDisabled || isLoading ? void 0 : onPress,
|
|
690
239
|
onLongPress: isDisabled || isLoading ? void 0 : onLongPress,
|
|
@@ -692,46 +241,46 @@ var Button = ({
|
|
|
692
241
|
onPressOut: handlePressOut,
|
|
693
242
|
disabled: isDisabled || isLoading
|
|
694
243
|
},
|
|
695
|
-
/* @__PURE__ */
|
|
696
|
-
|
|
244
|
+
/* @__PURE__ */ _react2.default.createElement(
|
|
245
|
+
_reactnative.Animated.View,
|
|
697
246
|
{
|
|
698
247
|
style: [
|
|
699
|
-
|
|
248
|
+
styles.button,
|
|
700
249
|
sizeStyles,
|
|
701
250
|
radiusStyles,
|
|
702
251
|
variantStyles,
|
|
703
|
-
fullWidth &&
|
|
704
|
-
isDisabled &&
|
|
252
|
+
fullWidth && styles.fullWidth,
|
|
253
|
+
isDisabled && styles.disabled,
|
|
705
254
|
{
|
|
706
255
|
transform: [{ scale: animatedScale }],
|
|
707
256
|
opacity: animatedOpacity
|
|
708
257
|
},
|
|
709
|
-
customAppearance
|
|
258
|
+
_optionalChain([customAppearance, 'optionalAccess', _4 => _4.button])
|
|
710
259
|
]
|
|
711
260
|
},
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
|
|
261
|
+
/* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.contentContainer }, startContent && !isLoading && spinnerPlacement !== "start" && /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.startContent }, startContent), isLoading && spinnerPlacement === "start" && /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.spinner }, spinner), /* @__PURE__ */ _react2.default.createElement(
|
|
262
|
+
_reactnative.Text,
|
|
714
263
|
{
|
|
715
264
|
style: [
|
|
716
|
-
|
|
265
|
+
styles.text,
|
|
717
266
|
{ fontSize: sizeStyles.fontSize, color: textColor },
|
|
718
|
-
isDisabled &&
|
|
719
|
-
customAppearance
|
|
267
|
+
isDisabled && styles.disabledText,
|
|
268
|
+
_optionalChain([customAppearance, 'optionalAccess', _5 => _5.text])
|
|
720
269
|
]
|
|
721
270
|
},
|
|
722
271
|
children
|
|
723
|
-
), isLoading && spinnerPlacement === "end" && /* @__PURE__ */
|
|
272
|
+
), isLoading && spinnerPlacement === "end" && /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.spinner }, spinner), endContent && !isLoading && spinnerPlacement !== "end" && /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.endContent }, endContent))
|
|
724
273
|
)
|
|
725
274
|
));
|
|
726
275
|
};
|
|
727
276
|
|
|
728
277
|
// src/components/button/icon-button.tsx
|
|
729
|
-
|
|
730
|
-
|
|
278
|
+
|
|
279
|
+
|
|
731
280
|
|
|
732
281
|
// src/components/button/icon-button.style.ts
|
|
733
|
-
|
|
734
|
-
var iconButtonStyles =
|
|
282
|
+
|
|
283
|
+
var iconButtonStyles = _reactnative.StyleSheet.create({
|
|
735
284
|
container: {
|
|
736
285
|
alignItems: "center",
|
|
737
286
|
justifyContent: "center"
|
|
@@ -747,10 +296,10 @@ var iconButtonStyles = import_react_native11.StyleSheet.create({
|
|
|
747
296
|
});
|
|
748
297
|
|
|
749
298
|
// src/components/button/icon-button.hook.ts
|
|
750
|
-
|
|
299
|
+
|
|
751
300
|
var useIconButtonSizeStyles = (size) => {
|
|
752
|
-
const theme = useXUITheme();
|
|
753
|
-
return (0,
|
|
301
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
302
|
+
return _react.useMemo.call(void 0, () => {
|
|
754
303
|
const sizeMap = {
|
|
755
304
|
xs: { width: 34, height: 34 },
|
|
756
305
|
sm: { width: 38, height: 38 },
|
|
@@ -777,23 +326,23 @@ var IconButton = ({
|
|
|
777
326
|
onPressIn,
|
|
778
327
|
onPressOut
|
|
779
328
|
}) => {
|
|
780
|
-
const animatedScale =
|
|
781
|
-
const animatedOpacity =
|
|
329
|
+
const animatedScale = _react2.default.useRef(new _reactnative.Animated.Value(1)).current;
|
|
330
|
+
const animatedOpacity = _react2.default.useRef(new _reactnative.Animated.Value(1)).current;
|
|
782
331
|
const sizeStyles = useIconButtonSizeStyles(size);
|
|
783
|
-
const radiusStyles = useBorderRadiusStyles(radius);
|
|
332
|
+
const radiusStyles = _chunkOQ2BLOOGcjs.useBorderRadiusStyles.call(void 0, radius);
|
|
784
333
|
const variantStyles = useVariantSizesStyles(themeColor, variant, elevation);
|
|
785
334
|
const { textColor } = useTextStyles(themeColor, variant);
|
|
786
335
|
const handlePressIn = (event) => {
|
|
787
336
|
if (!isDisabled && !isLoading) {
|
|
788
337
|
runPressInAnimation(animatedScale, animatedOpacity);
|
|
789
338
|
}
|
|
790
|
-
onPressIn
|
|
339
|
+
_optionalChain([onPressIn, 'optionalCall', _6 => _6(event)]);
|
|
791
340
|
};
|
|
792
341
|
const handlePressOut = (event) => {
|
|
793
342
|
if (!isDisabled && !isLoading) {
|
|
794
343
|
runPressOutAnimation(animatedScale, animatedOpacity);
|
|
795
344
|
}
|
|
796
|
-
onPressOut
|
|
345
|
+
_optionalChain([onPressOut, 'optionalCall', _7 => _7(event)]);
|
|
797
346
|
};
|
|
798
347
|
const spinnerSize = {
|
|
799
348
|
xs: 14,
|
|
@@ -801,8 +350,8 @@ var IconButton = ({
|
|
|
801
350
|
md: 18,
|
|
802
351
|
lg: 20
|
|
803
352
|
}[size];
|
|
804
|
-
return /* @__PURE__ */
|
|
805
|
-
|
|
353
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [iconButtonStyles.container, _optionalChain([customAppearance, 'optionalAccess', _8 => _8.container])] }, /* @__PURE__ */ _react2.default.createElement(
|
|
354
|
+
_reactnative.Pressable,
|
|
806
355
|
{
|
|
807
356
|
onPress: isDisabled || isLoading ? void 0 : onPress,
|
|
808
357
|
onLongPress: isDisabled || isLoading ? void 0 : onLongPress,
|
|
@@ -810,8 +359,8 @@ var IconButton = ({
|
|
|
810
359
|
onPressOut: handlePressOut,
|
|
811
360
|
disabled: isDisabled || isLoading
|
|
812
361
|
},
|
|
813
|
-
/* @__PURE__ */
|
|
814
|
-
|
|
362
|
+
/* @__PURE__ */ _react2.default.createElement(
|
|
363
|
+
_reactnative.Animated.View,
|
|
815
364
|
{
|
|
816
365
|
style: [
|
|
817
366
|
iconButtonStyles.button,
|
|
@@ -823,11 +372,11 @@ var IconButton = ({
|
|
|
823
372
|
transform: [{ scale: animatedScale }],
|
|
824
373
|
opacity: animatedOpacity
|
|
825
374
|
},
|
|
826
|
-
customAppearance
|
|
375
|
+
_optionalChain([customAppearance, 'optionalAccess', _9 => _9.button])
|
|
827
376
|
]
|
|
828
377
|
},
|
|
829
|
-
isLoading ? /* @__PURE__ */
|
|
830
|
-
ActivityIndicator,
|
|
378
|
+
isLoading ? /* @__PURE__ */ _react2.default.createElement(
|
|
379
|
+
_chunkQMYWIWSXcjs.ActivityIndicator,
|
|
831
380
|
{
|
|
832
381
|
variant: "circular",
|
|
833
382
|
themeColor: variant === "solid" ? void 0 : themeColor,
|
|
@@ -838,8 +387,7 @@ var IconButton = ({
|
|
|
838
387
|
)
|
|
839
388
|
));
|
|
840
389
|
};
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
});
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
exports.Button = Button; exports.IconButton = IconButton;
|