@xaui/native 0.0.16 → 0.0.18
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/dist/accordion/index.cjs +1 -1
- package/dist/accordion/index.js +5 -4
- package/dist/alert/index.js +352 -3
- package/dist/autocomplete/index.cjs +5 -11
- package/dist/autocomplete/index.js +1122 -5
- package/dist/avatar/index.js +276 -4
- package/dist/badge/index.js +193 -3
- package/dist/bottom-sheet/index.cjs +9 -20
- package/dist/bottom-sheet/index.js +364 -3
- package/dist/button/index.js +3 -2
- package/dist/card/index.cjs +429 -0
- package/dist/card/index.d.cts +186 -0
- package/dist/card/index.d.ts +186 -0
- package/dist/card/index.js +336 -0
- package/dist/carousel/index.cjs +458 -0
- package/dist/carousel/index.d.cts +147 -0
- package/dist/carousel/index.d.ts +147 -0
- package/dist/carousel/index.js +381 -0
- package/dist/checkbox/index.js +2 -1
- package/dist/chip/index.cjs +2 -8
- package/dist/chip/index.js +497 -5
- package/dist/chunk-DXXNBF5P.js +7 -0
- package/dist/{chunk-MKHBEJLO.js → chunk-F7WH4DMG.js} +1 -1
- package/dist/{chunk-II4QINLG.js → chunk-JEGEPGVU.js} +2 -2
- package/dist/{chunk-NBRASCX4.js → chunk-LTKYHG5V.js} +6 -13
- package/dist/{chunk-GNJIET26.js → chunk-LUBWRVI2.js} +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.js +5 -3
- package/dist/datepicker/index.js +1623 -3
- package/dist/divider/index.js +3 -2
- package/dist/fab/index.js +4 -3
- package/dist/fab-menu/index.cjs +4 -13
- package/dist/fab-menu/index.js +325 -6
- package/dist/index.cjs +0 -5709
- package/dist/index.d.cts +2 -17
- package/dist/index.d.ts +2 -17
- package/dist/index.js +0 -62
- package/dist/indicator/index.js +3 -2
- package/dist/menu/index.cjs +8 -7
- package/dist/menu/index.js +15 -9
- package/dist/progress/index.js +2 -1
- package/dist/segment-button/index.cjs +492 -0
- package/dist/segment-button/index.d.cts +141 -0
- package/dist/segment-button/index.d.ts +141 -0
- package/dist/segment-button/index.js +405 -0
- package/dist/select/index.js +2 -1
- package/dist/switch/index.js +2 -1
- package/dist/typography/index.js +146 -3
- package/dist/view/index.cjs +153 -78
- package/dist/view/index.d.cts +77 -1
- package/dist/view/index.d.ts +77 -1
- package/dist/view/index.js +125 -52
- package/package.json +16 -1
- package/dist/chunk-2T6FKPJW.js +0 -356
- package/dist/chunk-4LFRYVSR.js +0 -281
- package/dist/chunk-7OFTYKK4.js +0 -1627
- package/dist/chunk-EI5OMBFE.js +0 -338
- package/dist/chunk-GAOI4KIV.js +0 -379
- package/dist/chunk-NMZUPH3R.js +0 -1133
- package/dist/chunk-QLEQYKG5.js +0 -509
- package/dist/chunk-XJKA22BK.js +0 -197
- package/dist/chunk-ZYTBRHLJ.js +0 -150
|
@@ -0,0 +1,429 @@
|
|
|
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/card/index.ts
|
|
31
|
+
var card_exports = {};
|
|
32
|
+
__export(card_exports, {
|
|
33
|
+
Card: () => Card,
|
|
34
|
+
CardBody: () => CardBody,
|
|
35
|
+
CardDescription: () => CardDescription,
|
|
36
|
+
CardFooter: () => CardFooter,
|
|
37
|
+
CardHeader: () => CardHeader,
|
|
38
|
+
CardTitle: () => CardTitle
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(card_exports);
|
|
41
|
+
|
|
42
|
+
// src/components/card/card.tsx
|
|
43
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
44
|
+
var import_react_native5 = require("react-native");
|
|
45
|
+
|
|
46
|
+
// src/core/theme-hooks.ts
|
|
47
|
+
var import_react5 = require("react");
|
|
48
|
+
var import_react_native3 = require("react-native");
|
|
49
|
+
|
|
50
|
+
// src/core/theme-context.tsx
|
|
51
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
52
|
+
var import_react_native2 = require("react-native");
|
|
53
|
+
var import_theme = require("@xaui/core/theme");
|
|
54
|
+
var import_palette = require("@xaui/core/palette");
|
|
55
|
+
|
|
56
|
+
// src/core/portal/portal.tsx
|
|
57
|
+
var import_react2 = require("react");
|
|
58
|
+
|
|
59
|
+
// src/core/portal/portal-context.ts
|
|
60
|
+
var import_react = require("react");
|
|
61
|
+
var PortalContext = (0, import_react.createContext)(null);
|
|
62
|
+
|
|
63
|
+
// src/core/portal/portal-host.tsx
|
|
64
|
+
var import_react3 = __toESM(require("react"), 1);
|
|
65
|
+
var import_react_native = require("react-native");
|
|
66
|
+
var hostStyles = import_react_native.StyleSheet.create({
|
|
67
|
+
container: {
|
|
68
|
+
flex: 1
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// src/core/theme-context.tsx
|
|
73
|
+
var XUIThemeContext = (0, import_react4.createContext)(null);
|
|
74
|
+
|
|
75
|
+
// src/core/theme-hooks.ts
|
|
76
|
+
function useXUITheme() {
|
|
77
|
+
const theme = (0, import_react5.useContext)(XUIThemeContext);
|
|
78
|
+
if (!theme) {
|
|
79
|
+
throw new Error("useXUITheme must be used within XUIProvider");
|
|
80
|
+
}
|
|
81
|
+
return theme;
|
|
82
|
+
}
|
|
83
|
+
function useBorderRadiusStyles(radius) {
|
|
84
|
+
const theme = useXUITheme();
|
|
85
|
+
const borderRadius = (0, import_react5.useMemo)(() => {
|
|
86
|
+
const radiusMap = {
|
|
87
|
+
none: theme.borderRadius.none,
|
|
88
|
+
sm: theme.borderRadius.sm,
|
|
89
|
+
md: theme.borderRadius.md,
|
|
90
|
+
lg: theme.borderRadius.lg,
|
|
91
|
+
full: theme.borderRadius.full
|
|
92
|
+
};
|
|
93
|
+
return { borderRadius: radiusMap[radius] };
|
|
94
|
+
}, [radius, theme]);
|
|
95
|
+
return borderRadius;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// src/components/card/card.style.ts
|
|
99
|
+
var import_react_native4 = require("react-native");
|
|
100
|
+
var styles = import_react_native4.StyleSheet.create({
|
|
101
|
+
card: {
|
|
102
|
+
overflow: "hidden",
|
|
103
|
+
borderWidth: 1
|
|
104
|
+
},
|
|
105
|
+
fullWidth: {
|
|
106
|
+
flexShrink: 1,
|
|
107
|
+
flexBasis: "auto",
|
|
108
|
+
width: "100%"
|
|
109
|
+
},
|
|
110
|
+
disabled: {
|
|
111
|
+
opacity: 0.55
|
|
112
|
+
},
|
|
113
|
+
header: {
|
|
114
|
+
flexDirection: "row",
|
|
115
|
+
alignItems: "center",
|
|
116
|
+
gap: 12,
|
|
117
|
+
paddingHorizontal: 16,
|
|
118
|
+
paddingTop: 14,
|
|
119
|
+
paddingBottom: 10
|
|
120
|
+
},
|
|
121
|
+
body: {
|
|
122
|
+
paddingHorizontal: 16,
|
|
123
|
+
paddingVertical: 12
|
|
124
|
+
},
|
|
125
|
+
footer: {
|
|
126
|
+
flexDirection: "row",
|
|
127
|
+
alignItems: "center",
|
|
128
|
+
gap: 12,
|
|
129
|
+
paddingHorizontal: 16,
|
|
130
|
+
paddingTop: 10,
|
|
131
|
+
paddingBottom: 14
|
|
132
|
+
},
|
|
133
|
+
title: {
|
|
134
|
+
fontSize: 16,
|
|
135
|
+
fontWeight: "600",
|
|
136
|
+
includeFontPadding: false
|
|
137
|
+
},
|
|
138
|
+
description: {
|
|
139
|
+
fontSize: 14,
|
|
140
|
+
lineHeight: 20,
|
|
141
|
+
includeFontPadding: false
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// src/components/card/card.hook.ts
|
|
146
|
+
var import_react6 = require("react");
|
|
147
|
+
var import_core = require("@xaui/core");
|
|
148
|
+
|
|
149
|
+
// src/core/index.ts
|
|
150
|
+
var import_theme2 = require("@xaui/core/theme");
|
|
151
|
+
|
|
152
|
+
// src/components/card/card.hook.ts
|
|
153
|
+
var useCardContainerStyles = (themeColor, isBlurred) => {
|
|
154
|
+
const theme = useXUITheme();
|
|
155
|
+
return (0, import_react6.useMemo)(() => {
|
|
156
|
+
const safeThemeColor = (0, import_core.getSafeThemeColor)(themeColor);
|
|
157
|
+
const colorScheme = theme.colors[safeThemeColor];
|
|
158
|
+
const isDefaultThemeColor = safeThemeColor === "default";
|
|
159
|
+
const defaultBackgroundColor = theme.mode === "dark" ? theme.colors.default.background : "#FFFFFF";
|
|
160
|
+
return {
|
|
161
|
+
backgroundColor: isBlurred ? theme.mode === "dark" ? "rgba(24, 24, 27, 0.82)" : "rgba(255, 255, 255, 0.82)" : isDefaultThemeColor ? defaultBackgroundColor : colorScheme.background,
|
|
162
|
+
borderColor: (0, import_core.withOpacity)(colorScheme.main, 0.05)
|
|
163
|
+
};
|
|
164
|
+
}, [isBlurred, theme, themeColor]);
|
|
165
|
+
};
|
|
166
|
+
var useCardElevationStyles = (elevation = 0) => {
|
|
167
|
+
const theme = useXUITheme();
|
|
168
|
+
return (0, import_react6.useMemo)(() => {
|
|
169
|
+
const shadowStyles = elevation === 0 ? {} : elevation === 1 ? theme.shadows.sm : elevation === 2 ? theme.shadows.md : elevation === 3 ? theme.shadows.lg : theme.shadows.xl;
|
|
170
|
+
return {
|
|
171
|
+
...shadowStyles,
|
|
172
|
+
...elevation > 0 ? { elevation } : {}
|
|
173
|
+
};
|
|
174
|
+
}, [elevation, theme]);
|
|
175
|
+
};
|
|
176
|
+
var useCardTextStyles = (themeColor) => {
|
|
177
|
+
const theme = useXUITheme();
|
|
178
|
+
return (0, import_react6.useMemo)(() => {
|
|
179
|
+
const safeThemeColor = (0, import_core.getSafeThemeColor)(themeColor);
|
|
180
|
+
const colorScheme = theme.colors[safeThemeColor];
|
|
181
|
+
return {
|
|
182
|
+
titleColor: colorScheme.main,
|
|
183
|
+
descriptionColor: theme.mode === "dark" ? (0, import_core.withOpacity)(theme.colors.foreground, 0.8) : (0, import_core.withOpacity)(theme.colors.foreground, 0.72)
|
|
184
|
+
};
|
|
185
|
+
}, [theme, themeColor]);
|
|
186
|
+
};
|
|
187
|
+
var useCardFooterStyles = (themeColor, isFooterBlurred) => {
|
|
188
|
+
const theme = useXUITheme();
|
|
189
|
+
return (0, import_react6.useMemo)(() => {
|
|
190
|
+
const safeThemeColor = (0, import_core.getSafeThemeColor)(themeColor);
|
|
191
|
+
const colorScheme = theme.colors[safeThemeColor];
|
|
192
|
+
if (!isFooterBlurred) {
|
|
193
|
+
return {};
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
backgroundColor: theme.mode === "dark" ? "rgba(24, 24, 27, 0.68)" : "rgba(255, 255, 255, 0.72)",
|
|
197
|
+
borderTopWidth: theme.borderWidth.sm,
|
|
198
|
+
borderTopColor: theme.mode === "dark" ? (0, import_core.withOpacity)(colorScheme.main, 0.4) : (0, import_core.withOpacity)(colorScheme.main, 0.18)
|
|
199
|
+
};
|
|
200
|
+
}, [isFooterBlurred, theme, themeColor]);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
// src/components/card/card.tsx
|
|
204
|
+
var CardContext = import_react7.default.createContext({
|
|
205
|
+
themeColor: "default",
|
|
206
|
+
isFooterBlurred: false
|
|
207
|
+
});
|
|
208
|
+
var Card = ({
|
|
209
|
+
children,
|
|
210
|
+
themeColor = "default",
|
|
211
|
+
radius = "lg",
|
|
212
|
+
elevation = 0,
|
|
213
|
+
fullWidth = false,
|
|
214
|
+
isHoverable = false,
|
|
215
|
+
isPressable = false,
|
|
216
|
+
isBlurred = false,
|
|
217
|
+
isFooterBlurred = false,
|
|
218
|
+
isDisabled = false,
|
|
219
|
+
disableAnimation = false,
|
|
220
|
+
disableRipple: _disableRipple = false,
|
|
221
|
+
allowTextSelectionOnPress: _allowTextSelectionOnPress = false,
|
|
222
|
+
customAppearance,
|
|
223
|
+
onPress,
|
|
224
|
+
onLongPress,
|
|
225
|
+
onPressIn,
|
|
226
|
+
onPressOut
|
|
227
|
+
}) => {
|
|
228
|
+
const animatedScale = import_react7.default.useRef(new import_react_native5.Animated.Value(1)).current;
|
|
229
|
+
const animatedOpacity = import_react7.default.useRef(new import_react_native5.Animated.Value(1)).current;
|
|
230
|
+
const radiusStyles = useBorderRadiusStyles(radius);
|
|
231
|
+
const containerStyles = useCardContainerStyles(themeColor, isBlurred);
|
|
232
|
+
const elevationStyles = useCardElevationStyles(elevation);
|
|
233
|
+
const contextValue = import_react7.default.useMemo(
|
|
234
|
+
() => ({
|
|
235
|
+
themeColor,
|
|
236
|
+
isFooterBlurred,
|
|
237
|
+
customAppearance
|
|
238
|
+
}),
|
|
239
|
+
[customAppearance, isFooterBlurred, themeColor]
|
|
240
|
+
);
|
|
241
|
+
const animateTo = import_react7.default.useCallback(
|
|
242
|
+
(scale, opacity, duration) => {
|
|
243
|
+
if (disableAnimation) {
|
|
244
|
+
animatedScale.setValue(scale);
|
|
245
|
+
animatedOpacity.setValue(opacity);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
import_react_native5.Animated.parallel([
|
|
249
|
+
import_react_native5.Animated.timing(animatedScale, {
|
|
250
|
+
toValue: scale,
|
|
251
|
+
duration,
|
|
252
|
+
useNativeDriver: true
|
|
253
|
+
}),
|
|
254
|
+
import_react_native5.Animated.timing(animatedOpacity, {
|
|
255
|
+
toValue: opacity,
|
|
256
|
+
duration,
|
|
257
|
+
useNativeDriver: true
|
|
258
|
+
})
|
|
259
|
+
]).start();
|
|
260
|
+
},
|
|
261
|
+
[animatedOpacity, animatedScale, disableAnimation]
|
|
262
|
+
);
|
|
263
|
+
const handlePressIn = import_react7.default.useCallback(
|
|
264
|
+
(event) => {
|
|
265
|
+
if (!isDisabled && isPressable) {
|
|
266
|
+
animateTo(0.985, 0.95, 110);
|
|
267
|
+
}
|
|
268
|
+
onPressIn?.(event);
|
|
269
|
+
},
|
|
270
|
+
[animateTo, isDisabled, isPressable, onPressIn]
|
|
271
|
+
);
|
|
272
|
+
const handlePressOut = import_react7.default.useCallback(
|
|
273
|
+
(event) => {
|
|
274
|
+
if (!isDisabled && isPressable) {
|
|
275
|
+
animateTo(1, 1, 140);
|
|
276
|
+
}
|
|
277
|
+
onPressOut?.(event);
|
|
278
|
+
},
|
|
279
|
+
[animateTo, isDisabled, isPressable, onPressOut]
|
|
280
|
+
);
|
|
281
|
+
const handleHoverIn = import_react7.default.useCallback(() => {
|
|
282
|
+
if (!isDisabled && isHoverable && !isPressable) {
|
|
283
|
+
animateTo(1.01, 1, 130);
|
|
284
|
+
}
|
|
285
|
+
}, [animateTo, isDisabled, isHoverable, isPressable]);
|
|
286
|
+
const handleHoverOut = import_react7.default.useCallback(() => {
|
|
287
|
+
if (!isDisabled && isHoverable && !isPressable) {
|
|
288
|
+
animateTo(1, 1, 130);
|
|
289
|
+
}
|
|
290
|
+
}, [animateTo, isDisabled, isHoverable, isPressable]);
|
|
291
|
+
const cardContent = /* @__PURE__ */ import_react7.default.createElement(
|
|
292
|
+
import_react_native5.Animated.View,
|
|
293
|
+
{
|
|
294
|
+
style: [
|
|
295
|
+
styles.card,
|
|
296
|
+
radiusStyles,
|
|
297
|
+
containerStyles,
|
|
298
|
+
elevationStyles,
|
|
299
|
+
fullWidth && styles.fullWidth,
|
|
300
|
+
isDisabled && styles.disabled,
|
|
301
|
+
{
|
|
302
|
+
transform: [{ scale: animatedScale }],
|
|
303
|
+
opacity: animatedOpacity
|
|
304
|
+
},
|
|
305
|
+
customAppearance?.container
|
|
306
|
+
]
|
|
307
|
+
},
|
|
308
|
+
/* @__PURE__ */ import_react7.default.createElement(CardContext.Provider, { value: contextValue }, children)
|
|
309
|
+
);
|
|
310
|
+
if (!isPressable) {
|
|
311
|
+
return cardContent;
|
|
312
|
+
}
|
|
313
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
314
|
+
import_react_native5.Pressable,
|
|
315
|
+
{
|
|
316
|
+
onPress: isDisabled ? void 0 : onPress,
|
|
317
|
+
onLongPress: isDisabled ? void 0 : onLongPress,
|
|
318
|
+
onPressIn: handlePressIn,
|
|
319
|
+
onPressOut: handlePressOut,
|
|
320
|
+
onHoverIn: isHoverable ? handleHoverIn : void 0,
|
|
321
|
+
onHoverOut: isHoverable ? handleHoverOut : void 0,
|
|
322
|
+
disabled: isDisabled
|
|
323
|
+
},
|
|
324
|
+
cardContent
|
|
325
|
+
);
|
|
326
|
+
};
|
|
327
|
+
var CardHeader = ({
|
|
328
|
+
children,
|
|
329
|
+
customAppearance
|
|
330
|
+
}) => {
|
|
331
|
+
const cardContext = import_react7.default.useContext(CardContext);
|
|
332
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
333
|
+
import_react_native5.View,
|
|
334
|
+
{
|
|
335
|
+
style: [
|
|
336
|
+
styles.header,
|
|
337
|
+
cardContext.customAppearance?.header,
|
|
338
|
+
customAppearance?.container
|
|
339
|
+
]
|
|
340
|
+
},
|
|
341
|
+
children
|
|
342
|
+
);
|
|
343
|
+
};
|
|
344
|
+
var CardBody = ({
|
|
345
|
+
children,
|
|
346
|
+
customAppearance
|
|
347
|
+
}) => {
|
|
348
|
+
const cardContext = import_react7.default.useContext(CardContext);
|
|
349
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
350
|
+
import_react_native5.View,
|
|
351
|
+
{
|
|
352
|
+
style: [
|
|
353
|
+
styles.body,
|
|
354
|
+
cardContext.customAppearance?.body,
|
|
355
|
+
customAppearance?.container
|
|
356
|
+
]
|
|
357
|
+
},
|
|
358
|
+
children
|
|
359
|
+
);
|
|
360
|
+
};
|
|
361
|
+
var CardFooter = ({
|
|
362
|
+
children,
|
|
363
|
+
customAppearance
|
|
364
|
+
}) => {
|
|
365
|
+
const cardContext = import_react7.default.useContext(CardContext);
|
|
366
|
+
const footerStyles = useCardFooterStyles(
|
|
367
|
+
cardContext.themeColor,
|
|
368
|
+
cardContext.isFooterBlurred
|
|
369
|
+
);
|
|
370
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
371
|
+
import_react_native5.View,
|
|
372
|
+
{
|
|
373
|
+
style: [
|
|
374
|
+
styles.footer,
|
|
375
|
+
footerStyles,
|
|
376
|
+
cardContext.customAppearance?.footer,
|
|
377
|
+
customAppearance?.container
|
|
378
|
+
]
|
|
379
|
+
},
|
|
380
|
+
children
|
|
381
|
+
);
|
|
382
|
+
};
|
|
383
|
+
var CardTitle = ({
|
|
384
|
+
children,
|
|
385
|
+
customAppearance
|
|
386
|
+
}) => {
|
|
387
|
+
const cardContext = import_react7.default.useContext(CardContext);
|
|
388
|
+
const { titleColor } = useCardTextStyles(cardContext.themeColor);
|
|
389
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
390
|
+
import_react_native5.Text,
|
|
391
|
+
{
|
|
392
|
+
style: [
|
|
393
|
+
styles.title,
|
|
394
|
+
{ color: titleColor },
|
|
395
|
+
cardContext.customAppearance?.title,
|
|
396
|
+
customAppearance?.text
|
|
397
|
+
]
|
|
398
|
+
},
|
|
399
|
+
children
|
|
400
|
+
);
|
|
401
|
+
};
|
|
402
|
+
var CardDescription = ({
|
|
403
|
+
children,
|
|
404
|
+
customAppearance
|
|
405
|
+
}) => {
|
|
406
|
+
const cardContext = import_react7.default.useContext(CardContext);
|
|
407
|
+
const { descriptionColor } = useCardTextStyles(cardContext.themeColor);
|
|
408
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
409
|
+
import_react_native5.Text,
|
|
410
|
+
{
|
|
411
|
+
style: [
|
|
412
|
+
styles.description,
|
|
413
|
+
{ color: descriptionColor },
|
|
414
|
+
cardContext.customAppearance?.description,
|
|
415
|
+
customAppearance?.text
|
|
416
|
+
]
|
|
417
|
+
},
|
|
418
|
+
children
|
|
419
|
+
);
|
|
420
|
+
};
|
|
421
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
422
|
+
0 && (module.exports = {
|
|
423
|
+
Card,
|
|
424
|
+
CardBody,
|
|
425
|
+
CardDescription,
|
|
426
|
+
CardFooter,
|
|
427
|
+
CardHeader,
|
|
428
|
+
CardTitle
|
|
429
|
+
});
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ViewStyle, TextStyle, GestureResponderEvent } from 'react-native';
|
|
3
|
+
import { T as ThemeColor, R as Radius } from '../index-BOw6tbkc.cjs';
|
|
4
|
+
import { E as ElevationLevel } from '../button.type-ikaWzhIg.cjs';
|
|
5
|
+
|
|
6
|
+
type CardCustomAppearance = {
|
|
7
|
+
/**
|
|
8
|
+
* Custom styles for the card container
|
|
9
|
+
*/
|
|
10
|
+
container?: ViewStyle;
|
|
11
|
+
/**
|
|
12
|
+
* Custom styles for the card header section
|
|
13
|
+
*/
|
|
14
|
+
header?: ViewStyle;
|
|
15
|
+
/**
|
|
16
|
+
* Custom styles for the card body section
|
|
17
|
+
*/
|
|
18
|
+
body?: ViewStyle;
|
|
19
|
+
/**
|
|
20
|
+
* Custom styles for the card footer section
|
|
21
|
+
*/
|
|
22
|
+
footer?: ViewStyle;
|
|
23
|
+
/**
|
|
24
|
+
* Custom styles for title text
|
|
25
|
+
*/
|
|
26
|
+
title?: TextStyle;
|
|
27
|
+
/**
|
|
28
|
+
* Custom styles for description text
|
|
29
|
+
*/
|
|
30
|
+
description?: TextStyle;
|
|
31
|
+
};
|
|
32
|
+
type CardProps = {
|
|
33
|
+
/**
|
|
34
|
+
* Content to render inside the card.
|
|
35
|
+
*/
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* The theme color of the card.
|
|
39
|
+
* @default 'default'
|
|
40
|
+
*/
|
|
41
|
+
themeColor?: ThemeColor;
|
|
42
|
+
/**
|
|
43
|
+
* Card corner radius.
|
|
44
|
+
* @default 'lg'
|
|
45
|
+
*/
|
|
46
|
+
radius?: Radius;
|
|
47
|
+
/**
|
|
48
|
+
* Android elevation level from 0 to 4.
|
|
49
|
+
* @default 0
|
|
50
|
+
*/
|
|
51
|
+
elevation?: ElevationLevel;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the card should take full width of its container.
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
fullWidth?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether hover interactions are enabled.
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
isHoverable?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Whether press interactions are enabled.
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
isPressable?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the whole card should be blurred.
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
isBlurred?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Whether the footer section should be blurred.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
isFooterBlurred?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Whether the card is disabled.
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
isDisabled?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Disable all card animations.
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
disableAnimation?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Disable press ripple animation.
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
91
|
+
disableRipple?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Allow text selection while pressing a pressable card.
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
96
|
+
allowTextSelectionOnPress?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Custom appearance styles for card parts.
|
|
99
|
+
*/
|
|
100
|
+
customAppearance?: CardCustomAppearance;
|
|
101
|
+
/**
|
|
102
|
+
* Callback fired when card is pressed.
|
|
103
|
+
*/
|
|
104
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
105
|
+
/**
|
|
106
|
+
* Callback fired when card is long pressed.
|
|
107
|
+
*/
|
|
108
|
+
onLongPress?: (event: GestureResponderEvent) => void;
|
|
109
|
+
/**
|
|
110
|
+
* Callback fired when card press starts.
|
|
111
|
+
*/
|
|
112
|
+
onPressIn?: (event: GestureResponderEvent) => void;
|
|
113
|
+
/**
|
|
114
|
+
* Callback fired when card press ends.
|
|
115
|
+
*/
|
|
116
|
+
onPressOut?: (event: GestureResponderEvent) => void;
|
|
117
|
+
};
|
|
118
|
+
type CardHeaderProps = {
|
|
119
|
+
/**
|
|
120
|
+
* Header content.
|
|
121
|
+
*/
|
|
122
|
+
children: ReactNode;
|
|
123
|
+
/**
|
|
124
|
+
* Custom styles for the header container.
|
|
125
|
+
*/
|
|
126
|
+
customAppearance?: {
|
|
127
|
+
container?: ViewStyle;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
type CardBodyProps = {
|
|
131
|
+
/**
|
|
132
|
+
* Body content.
|
|
133
|
+
*/
|
|
134
|
+
children: ReactNode;
|
|
135
|
+
/**
|
|
136
|
+
* Custom styles for the body container.
|
|
137
|
+
*/
|
|
138
|
+
customAppearance?: {
|
|
139
|
+
container?: ViewStyle;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
type CardFooterProps = {
|
|
143
|
+
/**
|
|
144
|
+
* Footer content.
|
|
145
|
+
*/
|
|
146
|
+
children: ReactNode;
|
|
147
|
+
/**
|
|
148
|
+
* Custom styles for the footer container.
|
|
149
|
+
*/
|
|
150
|
+
customAppearance?: {
|
|
151
|
+
container?: ViewStyle;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
type CardTitleProps = {
|
|
155
|
+
/**
|
|
156
|
+
* Title content.
|
|
157
|
+
*/
|
|
158
|
+
children: ReactNode;
|
|
159
|
+
/**
|
|
160
|
+
* Custom styles for the title text.
|
|
161
|
+
*/
|
|
162
|
+
customAppearance?: {
|
|
163
|
+
text?: TextStyle;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
type CardDescriptionProps = {
|
|
167
|
+
/**
|
|
168
|
+
* Description content.
|
|
169
|
+
*/
|
|
170
|
+
children: ReactNode;
|
|
171
|
+
/**
|
|
172
|
+
* Custom styles for the description text.
|
|
173
|
+
*/
|
|
174
|
+
customAppearance?: {
|
|
175
|
+
text?: TextStyle;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
declare const Card: React.FC<CardProps>;
|
|
180
|
+
declare const CardHeader: React.FC<CardHeaderProps>;
|
|
181
|
+
declare const CardBody: React.FC<CardBodyProps>;
|
|
182
|
+
declare const CardFooter: React.FC<CardFooterProps>;
|
|
183
|
+
declare const CardTitle: React.FC<CardTitleProps>;
|
|
184
|
+
declare const CardDescription: React.FC<CardDescriptionProps>;
|
|
185
|
+
|
|
186
|
+
export { Card, CardBody, type CardBodyProps, type CardCustomAppearance, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps };
|