@xaui/native 0.2.8 → 0.9.1-alpha.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/dist/chunk-KFCORXWW.cjs +150 -0
- package/dist/chunk-M7P46XKI.cjs +100 -0
- package/dist/chunk-N357EQCZ.js +150 -0
- package/dist/chunk-NHPQQQ7P.cjs +734 -0
- package/dist/chunk-PBVPOX7D.js +734 -0
- package/dist/chunk-RBNCR5KB.js +100 -0
- package/dist/index.cjs +40 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +40 -0
- package/dist/system/index.cjs +7 -0
- package/dist/system/index.d.cts +83 -0
- package/dist/system/index.d.ts +83 -0
- package/dist/system/index.js +7 -0
- package/dist/theme/index.cjs +36 -0
- package/dist/theme/index.d.cts +539 -0
- package/dist/theme/index.d.ts +539 -0
- package/dist/theme/index.js +36 -0
- package/dist/theme.type-B3ODSLbB.d.cts +153 -0
- package/dist/theme.type-B3ODSLbB.d.ts +153 -0
- package/package.json +30 -248
- package/README.md +0 -178
- package/dist/alert/index.cjs +0 -340
- package/dist/alert/index.d.cts +0 -46
- package/dist/alert/index.d.ts +0 -46
- package/dist/alert/index.js +0 -340
- package/dist/app-bar/index.cjs +0 -148
- package/dist/app-bar/index.d.cts +0 -59
- package/dist/app-bar/index.d.ts +0 -59
- package/dist/app-bar/index.js +0 -148
- package/dist/autocomplete/index.cjs +0 -1122
- package/dist/autocomplete/index.d.cts +0 -88
- package/dist/autocomplete/index.d.ts +0 -88
- package/dist/autocomplete/index.js +0 -1122
- package/dist/avatar/index.cjs +0 -281
- package/dist/avatar/index.d.cts +0 -123
- package/dist/avatar/index.d.ts +0 -123
- package/dist/avatar/index.js +0 -281
- package/dist/badge/index.cjs +0 -197
- package/dist/badge/index.d.cts +0 -94
- package/dist/badge/index.d.ts +0 -94
- package/dist/badge/index.js +0 -197
- package/dist/bottom-sheet/index.cjs +0 -9
- package/dist/bottom-sheet/index.d.cts +0 -84
- package/dist/bottom-sheet/index.d.ts +0 -84
- package/dist/bottom-sheet/index.js +0 -9
- package/dist/bottom-tab-bar/index.cjs +0 -497
- package/dist/bottom-tab-bar/index.d.cts +0 -211
- package/dist/bottom-tab-bar/index.d.ts +0 -211
- package/dist/bottom-tab-bar/index.js +0 -497
- package/dist/button/index.cjs +0 -392
- package/dist/button/index.d.cts +0 -174
- package/dist/button/index.d.ts +0 -174
- package/dist/button/index.js +0 -392
- package/dist/button.type-j1ZdkkSl.d.cts +0 -4
- package/dist/button.type-j1ZdkkSl.d.ts +0 -4
- package/dist/card/index.cjs +0 -338
- package/dist/card/index.d.cts +0 -191
- package/dist/card/index.d.ts +0 -191
- package/dist/card/index.js +0 -338
- package/dist/carousel/index.cjs +0 -381
- package/dist/carousel/index.d.cts +0 -147
- package/dist/carousel/index.d.ts +0 -147
- package/dist/carousel/index.js +0 -381
- package/dist/chart/index.cjs +0 -1026
- package/dist/chart/index.d.cts +0 -218
- package/dist/chart/index.d.ts +0 -218
- package/dist/chart/index.js +0 -1026
- package/dist/checkbox/index.cjs +0 -443
- package/dist/checkbox/index.d.cts +0 -73
- package/dist/checkbox/index.d.ts +0 -73
- package/dist/checkbox/index.js +0 -443
- package/dist/chip/index.cjs +0 -503
- package/dist/chip/index.d.cts +0 -195
- package/dist/chip/index.d.ts +0 -195
- package/dist/chip/index.js +0 -503
- package/dist/chunk-4JFWQ5XT.js +0 -368
- package/dist/chunk-56RPWZD2.cjs +0 -9
- package/dist/chunk-7UFBLUMV.cjs +0 -136
- package/dist/chunk-A45TVXU5.js +0 -337
- package/dist/chunk-BYWUAPC4.cjs +0 -368
- package/dist/chunk-DECMUMCI.js +0 -0
- package/dist/chunk-DHSTKO3K.cjs +0 -19
- package/dist/chunk-DJ4Q37UT.cjs +0 -75
- package/dist/chunk-EUQDGTST.cjs +0 -1
- package/dist/chunk-GBHQCAKW.js +0 -19
- package/dist/chunk-RBSA4NH4.js +0 -136
- package/dist/chunk-SHBDANQN.js +0 -9
- package/dist/chunk-UGEINZM7.cjs +0 -290
- package/dist/chunk-UU4HHBDN.js +0 -290
- package/dist/chunk-VSZEXOUN.js +0 -384
- package/dist/chunk-YIEUN3G5.cjs +0 -384
- package/dist/chunk-ZH6ZSV2Q.cjs +0 -337
- package/dist/chunk-ZY7IUTAT.js +0 -75
- package/dist/color-picker/index.cjs +0 -457
- package/dist/color-picker/index.d.cts +0 -124
- package/dist/color-picker/index.d.ts +0 -124
- package/dist/color-picker/index.js +0 -457
- package/dist/core/index.cjs +0 -24
- package/dist/core/index.d.cts +0 -28
- package/dist/core/index.d.ts +0 -28
- package/dist/core/index.js +0 -24
- package/dist/datepicker/index.cjs +0 -1625
- package/dist/datepicker/index.d.cts +0 -45
- package/dist/datepicker/index.d.ts +0 -45
- package/dist/datepicker/index.js +0 -1625
- package/dist/dialog/index.cjs +0 -372
- package/dist/dialog/index.d.cts +0 -151
- package/dist/dialog/index.d.ts +0 -151
- package/dist/dialog/index.js +0 -372
- package/dist/divider/index.cjs +0 -8
- package/dist/divider/index.d.cts +0 -30
- package/dist/divider/index.d.ts +0 -30
- package/dist/divider/index.js +0 -8
- package/dist/drawer/index.cjs +0 -237
- package/dist/drawer/index.d.cts +0 -58
- package/dist/drawer/index.d.ts +0 -58
- package/dist/drawer/index.js +0 -237
- package/dist/expansion-panel/index.cjs +0 -441
- package/dist/expansion-panel/index.d.cts +0 -153
- package/dist/expansion-panel/index.d.ts +0 -153
- package/dist/expansion-panel/index.js +0 -441
- package/dist/fab/index.cjs +0 -9
- package/dist/fab/index.d.cts +0 -10
- package/dist/fab/index.d.ts +0 -10
- package/dist/fab/index.js +0 -9
- package/dist/fab-menu/index.cjs +0 -330
- package/dist/fab-menu/index.d.cts +0 -125
- package/dist/fab-menu/index.d.ts +0 -125
- package/dist/fab-menu/index.js +0 -330
- package/dist/fab.type-CkUHmXU_.d.ts +0 -86
- package/dist/fab.type-DN0vtAh6.d.cts +0 -86
- package/dist/feature-discovery/index.cjs +0 -464
- package/dist/feature-discovery/index.d.cts +0 -82
- package/dist/feature-discovery/index.d.ts +0 -82
- package/dist/feature-discovery/index.js +0 -464
- package/dist/indicator/index.cjs +0 -8
- package/dist/indicator/index.d.cts +0 -47
- package/dist/indicator/index.d.ts +0 -47
- package/dist/indicator/index.js +0 -8
- package/dist/input/index.cjs +0 -1462
- package/dist/input/index.d.cts +0 -522
- package/dist/input/index.d.ts +0 -522
- package/dist/input/index.js +0 -1462
- package/dist/input-trigger/index.cjs +0 -197
- package/dist/input-trigger/index.d.cts +0 -11
- package/dist/input-trigger/index.d.ts +0 -11
- package/dist/input-trigger/index.js +0 -197
- package/dist/input-trigger.type-Ba4bM3Qp.d.cts +0 -180
- package/dist/input-trigger.type-Ba4bM3Qp.d.ts +0 -180
- package/dist/list/index.cjs +0 -395
- package/dist/list/index.d.cts +0 -188
- package/dist/list/index.d.ts +0 -188
- package/dist/list/index.js +0 -395
- package/dist/menu/index.cjs +0 -316
- package/dist/menu/index.d.cts +0 -115
- package/dist/menu/index.d.ts +0 -115
- package/dist/menu/index.js +0 -316
- package/dist/menubox/index.cjs +0 -297
- package/dist/menubox/index.d.cts +0 -98
- package/dist/menubox/index.d.ts +0 -98
- package/dist/menubox/index.js +0 -297
- package/dist/pager/index.cjs +0 -205
- package/dist/pager/index.d.cts +0 -93
- package/dist/pager/index.d.ts +0 -93
- package/dist/pager/index.js +0 -205
- package/dist/picker/index.cjs +0 -244
- package/dist/picker/index.d.cts +0 -121
- package/dist/picker/index.d.ts +0 -121
- package/dist/picker/index.js +0 -244
- package/dist/progress/index.cjs +0 -219
- package/dist/progress/index.d.cts +0 -47
- package/dist/progress/index.d.ts +0 -47
- package/dist/progress/index.js +0 -219
- package/dist/radio/index.cjs +0 -465
- package/dist/radio/index.d.cts +0 -145
- package/dist/radio/index.d.ts +0 -145
- package/dist/radio/index.js +0 -465
- package/dist/refresh-control/index.cjs +0 -45
- package/dist/refresh-control/index.d.cts +0 -55
- package/dist/refresh-control/index.d.ts +0 -55
- package/dist/refresh-control/index.js +0 -45
- package/dist/segment-button/index.cjs +0 -405
- package/dist/segment-button/index.d.cts +0 -141
- package/dist/segment-button/index.d.ts +0 -141
- package/dist/segment-button/index.js +0 -405
- package/dist/select/index.cjs +0 -878
- package/dist/select/index.d.cts +0 -192
- package/dist/select/index.d.ts +0 -192
- package/dist/select/index.js +0 -878
- package/dist/skeleton/index.cjs +0 -89
- package/dist/skeleton/index.d.cts +0 -45
- package/dist/skeleton/index.d.ts +0 -45
- package/dist/skeleton/index.js +0 -89
- package/dist/slider/index.cjs +0 -576
- package/dist/slider/index.d.cts +0 -171
- package/dist/slider/index.d.ts +0 -171
- package/dist/slider/index.js +0 -576
- package/dist/snackbar/index.cjs +0 -436
- package/dist/snackbar/index.d.cts +0 -174
- package/dist/snackbar/index.d.ts +0 -174
- package/dist/snackbar/index.js +0 -436
- package/dist/snippet/index.cjs +0 -314
- package/dist/snippet/index.d.cts +0 -95
- package/dist/snippet/index.d.ts +0 -95
- package/dist/snippet/index.js +0 -314
- package/dist/stepper/index.cjs +0 -550
- package/dist/stepper/index.d.cts +0 -137
- package/dist/stepper/index.d.ts +0 -137
- package/dist/stepper/index.js +0 -550
- package/dist/switch/index.cjs +0 -358
- package/dist/switch/index.d.cts +0 -28
- package/dist/switch/index.d.ts +0 -28
- package/dist/switch/index.js +0 -358
- package/dist/tabs/index.cjs +0 -440
- package/dist/tabs/index.d.cts +0 -180
- package/dist/tabs/index.d.ts +0 -180
- package/dist/tabs/index.js +0 -440
- package/dist/timepicker/index.cjs +0 -823
- package/dist/timepicker/index.d.cts +0 -215
- package/dist/timepicker/index.d.ts +0 -215
- package/dist/timepicker/index.js +0 -823
- package/dist/toolbar/index.cjs +0 -333
- package/dist/toolbar/index.d.cts +0 -100
- package/dist/toolbar/index.d.ts +0 -100
- package/dist/toolbar/index.js +0 -333
- package/dist/typography/index.cjs +0 -238
- package/dist/typography/index.d.cts +0 -113
- package/dist/typography/index.d.ts +0 -113
- package/dist/typography/index.js +0 -238
- package/dist/view/index.cjs +0 -1361
- package/dist/view/index.d.cts +0 -833
- package/dist/view/index.d.ts +0 -833
- package/dist/view/index.js +0 -1361
package/dist/badge/index.js
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import "../chunk-SHBDANQN.js";
|
|
2
|
-
import {
|
|
3
|
-
useXUITheme
|
|
4
|
-
} from "../chunk-RBSA4NH4.js";
|
|
5
|
-
|
|
6
|
-
// src/components/badge/badge.tsx
|
|
7
|
-
import React from "react";
|
|
8
|
-
import { Text, View } from "react-native";
|
|
9
|
-
|
|
10
|
-
// src/components/badge/badge.style.ts
|
|
11
|
-
import { StyleSheet } from "react-native";
|
|
12
|
-
var styles = StyleSheet.create({
|
|
13
|
-
container: {
|
|
14
|
-
position: "relative",
|
|
15
|
-
alignSelf: "flex-start"
|
|
16
|
-
},
|
|
17
|
-
badge: {
|
|
18
|
-
position: "absolute",
|
|
19
|
-
alignItems: "center",
|
|
20
|
-
justifyContent: "center"
|
|
21
|
-
},
|
|
22
|
-
text: {
|
|
23
|
-
textAlign: "center",
|
|
24
|
-
fontWeight: "700",
|
|
25
|
-
includeFontPadding: false,
|
|
26
|
-
textAlignVertical: "center"
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// src/components/badge/badge.hook.ts
|
|
31
|
-
import { useMemo } from "react";
|
|
32
|
-
import { getSafeThemeColor, withOpacity } from "@xaui/core";
|
|
33
|
-
var sizeMap = {
|
|
34
|
-
sm: { height: 16, minWidth: 16, dot: 8 },
|
|
35
|
-
md: { height: 20, minWidth: 20, dot: 10 },
|
|
36
|
-
lg: { height: 24, minWidth: 24, dot: 12 }
|
|
37
|
-
};
|
|
38
|
-
var fontSizeMap = {
|
|
39
|
-
sm: 9,
|
|
40
|
-
md: 10,
|
|
41
|
-
lg: 12
|
|
42
|
-
};
|
|
43
|
-
function useBadgeSizeStyles(size, isDot, isOneChar) {
|
|
44
|
-
const theme = useXUITheme();
|
|
45
|
-
return useMemo(() => {
|
|
46
|
-
const { height, minWidth, dot } = sizeMap[size];
|
|
47
|
-
const fontSize = fontSizeMap[size];
|
|
48
|
-
if (isDot) {
|
|
49
|
-
return {
|
|
50
|
-
height: dot,
|
|
51
|
-
minWidth: dot,
|
|
52
|
-
paddingHorizontal: 0,
|
|
53
|
-
fontSize
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
if (isOneChar) {
|
|
57
|
-
return {
|
|
58
|
-
height,
|
|
59
|
-
minWidth: height,
|
|
60
|
-
paddingHorizontal: 0,
|
|
61
|
-
fontSize
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
const paddingHorizontal = size === "sm" ? theme.spacing.xs : theme.spacing.sm;
|
|
65
|
-
return {
|
|
66
|
-
height,
|
|
67
|
-
minWidth,
|
|
68
|
-
paddingHorizontal,
|
|
69
|
-
fontSize
|
|
70
|
-
};
|
|
71
|
-
}, [isDot, isOneChar, size, theme]);
|
|
72
|
-
}
|
|
73
|
-
function useBadgeVariantStyles(themeColor, variant) {
|
|
74
|
-
const theme = useXUITheme();
|
|
75
|
-
const safeThemeColor = getSafeThemeColor(themeColor);
|
|
76
|
-
const colorScheme = theme.colors[safeThemeColor];
|
|
77
|
-
return useMemo(() => {
|
|
78
|
-
if (variant === "flat") {
|
|
79
|
-
return {
|
|
80
|
-
backgroundColor: colorScheme.container,
|
|
81
|
-
color: colorScheme.onContainer
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
if (variant === "faded") {
|
|
85
|
-
return {
|
|
86
|
-
backgroundColor: withOpacity(colorScheme.container, 0.7),
|
|
87
|
-
color: colorScheme.onContainer
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
if (variant === "shadow") {
|
|
91
|
-
return {
|
|
92
|
-
backgroundColor: colorScheme.main,
|
|
93
|
-
color: colorScheme.onMain,
|
|
94
|
-
shadow: theme.shadows.sm
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
return {
|
|
98
|
-
backgroundColor: colorScheme.main,
|
|
99
|
-
color: colorScheme.onMain
|
|
100
|
-
};
|
|
101
|
-
}, [colorScheme, theme, variant]);
|
|
102
|
-
}
|
|
103
|
-
function useBadgeRadiusStyles(radius, height) {
|
|
104
|
-
const theme = useXUITheme();
|
|
105
|
-
return useMemo(() => {
|
|
106
|
-
if (radius === "full") {
|
|
107
|
-
return { borderRadius: height / 2 };
|
|
108
|
-
}
|
|
109
|
-
return { borderRadius: theme.borderRadius[radius] };
|
|
110
|
-
}, [height, radius, theme.borderRadius]);
|
|
111
|
-
}
|
|
112
|
-
function useBadgePlacementStyles(placement, height) {
|
|
113
|
-
return useMemo(() => {
|
|
114
|
-
const offset = Math.round(height * 0.3);
|
|
115
|
-
switch (placement) {
|
|
116
|
-
case "top-left":
|
|
117
|
-
return { top: -offset, left: -offset };
|
|
118
|
-
case "bottom-right":
|
|
119
|
-
return { bottom: -offset, right: -offset };
|
|
120
|
-
case "bottom-left":
|
|
121
|
-
return { bottom: -offset, left: -offset };
|
|
122
|
-
case "top-right":
|
|
123
|
-
default:
|
|
124
|
-
return { top: -offset, right: -offset };
|
|
125
|
-
}
|
|
126
|
-
}, [height, placement]);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// src/components/badge/badge.tsx
|
|
130
|
-
var Badge = ({
|
|
131
|
-
children,
|
|
132
|
-
content,
|
|
133
|
-
themeColor = "primary",
|
|
134
|
-
variant = "solid",
|
|
135
|
-
size = "md",
|
|
136
|
-
radius = "full",
|
|
137
|
-
placement = "top-right",
|
|
138
|
-
showOutline = true,
|
|
139
|
-
disableOutline = false,
|
|
140
|
-
isInvisible = false,
|
|
141
|
-
isDot = false,
|
|
142
|
-
isOneChar = false,
|
|
143
|
-
disableAnimation = false,
|
|
144
|
-
customAppearance
|
|
145
|
-
}) => {
|
|
146
|
-
const shouldRender = !isInvisible && (isDot || content !== void 0);
|
|
147
|
-
if (!shouldRender && !children) {
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
const forceOneChar = isOneChar;
|
|
151
|
-
const sizeStyles = useBadgeSizeStyles(size, isDot, forceOneChar);
|
|
152
|
-
const variantStyles = useBadgeVariantStyles(themeColor, variant);
|
|
153
|
-
const radiusStyles = useBadgeRadiusStyles(radius, sizeStyles.height);
|
|
154
|
-
const placementStyles = useBadgePlacementStyles(placement, sizeStyles.height);
|
|
155
|
-
const outlineEnabled = disableOutline ? false : showOutline;
|
|
156
|
-
const outlineStyles = outlineEnabled ? { borderWidth: 1, borderColor: "#FFFFFF" } : { borderWidth: 0, borderColor: "transparent" };
|
|
157
|
-
const badgeContent = isDot ? null : content;
|
|
158
|
-
return /* @__PURE__ */ React.createElement(View, { style: [styles.container, customAppearance?.container] }, children, shouldRender && /* @__PURE__ */ React.createElement(
|
|
159
|
-
View,
|
|
160
|
-
{
|
|
161
|
-
style: [
|
|
162
|
-
styles.badge,
|
|
163
|
-
{
|
|
164
|
-
minWidth: sizeStyles.minWidth,
|
|
165
|
-
height: sizeStyles.height,
|
|
166
|
-
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
167
|
-
backgroundColor: variantStyles.backgroundColor,
|
|
168
|
-
opacity: disableAnimation ? 1 : 1
|
|
169
|
-
},
|
|
170
|
-
radiusStyles,
|
|
171
|
-
placementStyles,
|
|
172
|
-
outlineStyles,
|
|
173
|
-
variantStyles.shadow,
|
|
174
|
-
customAppearance?.badge
|
|
175
|
-
],
|
|
176
|
-
accessible: true,
|
|
177
|
-
accessibilityRole: "text"
|
|
178
|
-
},
|
|
179
|
-
badgeContent !== void 0 && badgeContent !== null && /* @__PURE__ */ React.createElement(
|
|
180
|
-
Text,
|
|
181
|
-
{
|
|
182
|
-
style: [
|
|
183
|
-
styles.text,
|
|
184
|
-
{
|
|
185
|
-
fontSize: sizeStyles.fontSize,
|
|
186
|
-
color: variantStyles.color
|
|
187
|
-
},
|
|
188
|
-
customAppearance?.text
|
|
189
|
-
]
|
|
190
|
-
},
|
|
191
|
-
badgeContent
|
|
192
|
-
)
|
|
193
|
-
));
|
|
194
|
-
};
|
|
195
|
-
export {
|
|
196
|
-
Badge
|
|
197
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-EUQDGTST.cjs');
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkBYWUAPC4cjs = require('../chunk-BYWUAPC4.cjs');
|
|
5
|
-
require('../chunk-56RPWZD2.cjs');
|
|
6
|
-
require('../chunk-7UFBLUMV.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.BottomSheet = _chunkBYWUAPC4cjs.BottomSheet;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { ViewStyle } from 'react-native';
|
|
3
|
-
import { ThemeColor, Radius } from '@xaui/core/types';
|
|
4
|
-
|
|
5
|
-
type BottomSheetSnapPoint = number | string;
|
|
6
|
-
type BottomSheetProps = {
|
|
7
|
-
/**
|
|
8
|
-
* Content to render inside the bottom sheet.
|
|
9
|
-
*/
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
* Whether the bottom sheet is visible.
|
|
13
|
-
* @default false
|
|
14
|
-
*/
|
|
15
|
-
isOpen: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Snap points as fractions of screen height (0 to 1).
|
|
18
|
-
* First value is the initial collapsed height, subsequent values are expanded heights.
|
|
19
|
-
* @default [0.4, 0.9]
|
|
20
|
-
*/
|
|
21
|
-
snapPoints?: [number, ...number[]];
|
|
22
|
-
/**
|
|
23
|
-
* Index of the initial snap point when the sheet opens.
|
|
24
|
-
* @default 0
|
|
25
|
-
*/
|
|
26
|
-
initialSnapIndex?: number;
|
|
27
|
-
/**
|
|
28
|
-
* Theme color for the handle bar indicator.
|
|
29
|
-
* @default 'default'
|
|
30
|
-
*/
|
|
31
|
-
themeColor?: ThemeColor;
|
|
32
|
-
/**
|
|
33
|
-
* Border radius of the top corners.
|
|
34
|
-
* @default 'lg'
|
|
35
|
-
*/
|
|
36
|
-
radius?: Radius;
|
|
37
|
-
/**
|
|
38
|
-
* Whether to show the backdrop overlay.
|
|
39
|
-
* @default true
|
|
40
|
-
*/
|
|
41
|
-
showBackdrop?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Whether to close the sheet when tapping the backdrop.
|
|
44
|
-
* @default true
|
|
45
|
-
*/
|
|
46
|
-
closeOnBackdropPress?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Whether the sheet can be dismissed by swiping down.
|
|
49
|
-
* @default true
|
|
50
|
-
*/
|
|
51
|
-
enableSwipeToDismiss?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Whether to show the drag handle indicator.
|
|
54
|
-
* @default true
|
|
55
|
-
*/
|
|
56
|
-
showHandle?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Disable all animations.
|
|
59
|
-
* @default false
|
|
60
|
-
*/
|
|
61
|
-
disableAnimation?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Custom style for the sheet container.
|
|
64
|
-
*/
|
|
65
|
-
style?: ViewStyle;
|
|
66
|
-
/**
|
|
67
|
-
* Custom content to render as the handle.
|
|
68
|
-
*/
|
|
69
|
-
handleContent?: ReactNode;
|
|
70
|
-
} & BottomSheetEvents;
|
|
71
|
-
type BottomSheetEvents = {
|
|
72
|
-
/**
|
|
73
|
-
* Called when the sheet is closed.
|
|
74
|
-
*/
|
|
75
|
-
onClose?: () => void;
|
|
76
|
-
/**
|
|
77
|
-
* Called when the snap point changes.
|
|
78
|
-
*/
|
|
79
|
-
onSnapChange?: (index: number) => void;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
declare const BottomSheet: React.FC<BottomSheetProps>;
|
|
83
|
-
|
|
84
|
-
export { BottomSheet, type BottomSheetEvents, type BottomSheetProps, type BottomSheetSnapPoint };
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { ViewStyle } from 'react-native';
|
|
3
|
-
import { ThemeColor, Radius } from '@xaui/core/types';
|
|
4
|
-
|
|
5
|
-
type BottomSheetSnapPoint = number | string;
|
|
6
|
-
type BottomSheetProps = {
|
|
7
|
-
/**
|
|
8
|
-
* Content to render inside the bottom sheet.
|
|
9
|
-
*/
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
* Whether the bottom sheet is visible.
|
|
13
|
-
* @default false
|
|
14
|
-
*/
|
|
15
|
-
isOpen: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Snap points as fractions of screen height (0 to 1).
|
|
18
|
-
* First value is the initial collapsed height, subsequent values are expanded heights.
|
|
19
|
-
* @default [0.4, 0.9]
|
|
20
|
-
*/
|
|
21
|
-
snapPoints?: [number, ...number[]];
|
|
22
|
-
/**
|
|
23
|
-
* Index of the initial snap point when the sheet opens.
|
|
24
|
-
* @default 0
|
|
25
|
-
*/
|
|
26
|
-
initialSnapIndex?: number;
|
|
27
|
-
/**
|
|
28
|
-
* Theme color for the handle bar indicator.
|
|
29
|
-
* @default 'default'
|
|
30
|
-
*/
|
|
31
|
-
themeColor?: ThemeColor;
|
|
32
|
-
/**
|
|
33
|
-
* Border radius of the top corners.
|
|
34
|
-
* @default 'lg'
|
|
35
|
-
*/
|
|
36
|
-
radius?: Radius;
|
|
37
|
-
/**
|
|
38
|
-
* Whether to show the backdrop overlay.
|
|
39
|
-
* @default true
|
|
40
|
-
*/
|
|
41
|
-
showBackdrop?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Whether to close the sheet when tapping the backdrop.
|
|
44
|
-
* @default true
|
|
45
|
-
*/
|
|
46
|
-
closeOnBackdropPress?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Whether the sheet can be dismissed by swiping down.
|
|
49
|
-
* @default true
|
|
50
|
-
*/
|
|
51
|
-
enableSwipeToDismiss?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Whether to show the drag handle indicator.
|
|
54
|
-
* @default true
|
|
55
|
-
*/
|
|
56
|
-
showHandle?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Disable all animations.
|
|
59
|
-
* @default false
|
|
60
|
-
*/
|
|
61
|
-
disableAnimation?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Custom style for the sheet container.
|
|
64
|
-
*/
|
|
65
|
-
style?: ViewStyle;
|
|
66
|
-
/**
|
|
67
|
-
* Custom content to render as the handle.
|
|
68
|
-
*/
|
|
69
|
-
handleContent?: ReactNode;
|
|
70
|
-
} & BottomSheetEvents;
|
|
71
|
-
type BottomSheetEvents = {
|
|
72
|
-
/**
|
|
73
|
-
* Called when the sheet is closed.
|
|
74
|
-
*/
|
|
75
|
-
onClose?: () => void;
|
|
76
|
-
/**
|
|
77
|
-
* Called when the snap point changes.
|
|
78
|
-
*/
|
|
79
|
-
onSnapChange?: (index: number) => void;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
declare const BottomSheet: React.FC<BottomSheetProps>;
|
|
83
|
-
|
|
84
|
-
export { BottomSheet, type BottomSheetEvents, type BottomSheetProps, type BottomSheetSnapPoint };
|