@xaui/native 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/dist/accordion/index.cjs +7 -2
- package/dist/accordion/index.js +7 -2
- package/dist/alert/index.cjs +25 -188
- package/dist/alert/index.js +1 -2
- package/dist/autocomplete/index.cjs +106 -403
- package/dist/autocomplete/index.js +1 -3
- package/dist/button/index.cjs +126 -4
- package/dist/button/index.d.cts +63 -1
- package/dist/button/index.d.ts +63 -1
- package/dist/button/index.js +117 -3
- package/dist/checkbox/index.cjs +5 -1
- package/dist/checkbox/index.js +5 -1
- package/dist/{chunk-OFYJYQ2M.js → chunk-2T6FKPJW.js} +1 -3
- package/dist/{chunk-LM23DOX3.js → chunk-7OFTYKK4.js} +13 -33
- package/dist/{chunk-63LRW4QD.js → chunk-MKHBEJLO.js} +8 -1
- package/dist/{chunk-RL47NQAU.js → chunk-NMZUPH3R.js} +7 -12
- package/dist/datepicker/index.cjs +115 -836
- package/dist/datepicker/index.js +1 -3
- package/dist/index.cjs +362 -1170
- package/dist/index.js +4 -6
- package/dist/indicator/index.cjs +8 -1
- package/dist/indicator/index.js +1 -1
- package/dist/menu/index.cjs +371 -0
- package/dist/menu/index.d.cts +107 -0
- package/dist/menu/index.d.ts +107 -0
- package/dist/menu/index.js +304 -0
- package/dist/select/index.cjs +40 -16
- package/dist/select/index.js +40 -16
- package/dist/view/index.cjs +12 -7
- package/dist/view/index.js +12 -7
- package/package.json +7 -6
- package/dist/chunk-CKGZOJVV.js +0 -815
- package/dist/chunk-SIXET7TJ.js +0 -172
- package/dist/icon/index.cjs +0 -1054
- package/dist/icon/index.d.cts +0 -42
- package/dist/icon/index.d.ts +0 -42
- package/dist/icon/index.js +0 -21
package/dist/chunk-SIXET7TJ.js
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useXUITheme
|
|
3
|
-
} from "./chunk-NBRASCX4.js";
|
|
4
|
-
|
|
5
|
-
// src/components/icon/icons/close.tsx
|
|
6
|
-
import React, { useEffect, useMemo, useRef } from "react";
|
|
7
|
-
import { Animated } from "react-native";
|
|
8
|
-
import Svg, { Path, Rect, Circle } from "react-native-svg";
|
|
9
|
-
|
|
10
|
-
// src/components/icon/icon.utils.ts
|
|
11
|
-
var isThemeColor = (color) => {
|
|
12
|
-
const themeColors = [
|
|
13
|
-
"primary",
|
|
14
|
-
"secondary",
|
|
15
|
-
"tertiary",
|
|
16
|
-
"danger",
|
|
17
|
-
"warning",
|
|
18
|
-
"success",
|
|
19
|
-
"default"
|
|
20
|
-
];
|
|
21
|
-
return themeColors.includes(color);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// src/components/icon/icons/close.tsx
|
|
25
|
-
var AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
26
|
-
var CloseIcon = ({
|
|
27
|
-
variant = "baseline",
|
|
28
|
-
size = 24,
|
|
29
|
-
color = "default",
|
|
30
|
-
isAnimated = false
|
|
31
|
-
}) => {
|
|
32
|
-
const theme = useXUITheme();
|
|
33
|
-
const scaleAnim = useRef(new Animated.Value(isAnimated ? 0 : 1)).current;
|
|
34
|
-
const opacityAnim = useRef(new Animated.Value(isAnimated ? 0 : 1)).current;
|
|
35
|
-
const resolvedColor = useMemo(() => {
|
|
36
|
-
if (typeof color === "string" && isThemeColor(color)) {
|
|
37
|
-
return theme.colors[color].main;
|
|
38
|
-
}
|
|
39
|
-
return color;
|
|
40
|
-
}, [color, theme]);
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
if (isAnimated) {
|
|
43
|
-
Animated.parallel([
|
|
44
|
-
Animated.spring(scaleAnim, {
|
|
45
|
-
toValue: 1,
|
|
46
|
-
useNativeDriver: true,
|
|
47
|
-
tension: 50,
|
|
48
|
-
friction: 7
|
|
49
|
-
}),
|
|
50
|
-
Animated.timing(opacityAnim, {
|
|
51
|
-
toValue: 1,
|
|
52
|
-
duration: 200,
|
|
53
|
-
useNativeDriver: true
|
|
54
|
-
})
|
|
55
|
-
]).start();
|
|
56
|
-
}
|
|
57
|
-
}, [isAnimated, scaleAnim, opacityAnim]);
|
|
58
|
-
const animatedProps = isAnimated ? {
|
|
59
|
-
transform: [{ scale: scaleAnim }],
|
|
60
|
-
opacity: opacityAnim
|
|
61
|
-
} : void 0;
|
|
62
|
-
const renderBaseline = () => /* @__PURE__ */ React.createElement(
|
|
63
|
-
AnimatedPath,
|
|
64
|
-
{
|
|
65
|
-
fill: resolvedColor,
|
|
66
|
-
d: "m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z",
|
|
67
|
-
...animatedProps
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
const renderFilled = () => /* @__PURE__ */ React.createElement(
|
|
71
|
-
AnimatedPath,
|
|
72
|
-
{
|
|
73
|
-
fill: resolvedColor,
|
|
74
|
-
d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm75.31 260.69a16 16 0 1 1-22.62 22.62L256 278.63l-52.69 52.68a16 16 0 0 1-22.62-22.62L233.37 256l-52.68-52.69a16 16 0 0 1 22.62-22.62L256 233.37l52.69-52.68a16 16 0 0 1 22.62 22.62L278.63 256z",
|
|
75
|
-
...animatedProps
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
const renderDuotone = () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
79
|
-
Path,
|
|
80
|
-
{
|
|
81
|
-
fill: resolvedColor,
|
|
82
|
-
opacity: 0.3,
|
|
83
|
-
d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48z"
|
|
84
|
-
}
|
|
85
|
-
), /* @__PURE__ */ React.createElement(
|
|
86
|
-
AnimatedPath,
|
|
87
|
-
{
|
|
88
|
-
fill: resolvedColor,
|
|
89
|
-
d: "m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z",
|
|
90
|
-
...animatedProps
|
|
91
|
-
}
|
|
92
|
-
));
|
|
93
|
-
const renderRoundOutlined = () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
94
|
-
Circle,
|
|
95
|
-
{
|
|
96
|
-
cx: "256",
|
|
97
|
-
cy: "256",
|
|
98
|
-
r: "192",
|
|
99
|
-
fill: "none",
|
|
100
|
-
stroke: resolvedColor,
|
|
101
|
-
strokeWidth: 32
|
|
102
|
-
}
|
|
103
|
-
), /* @__PURE__ */ React.createElement(
|
|
104
|
-
AnimatedPath,
|
|
105
|
-
{
|
|
106
|
-
fill: resolvedColor,
|
|
107
|
-
d: "m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z",
|
|
108
|
-
...animatedProps
|
|
109
|
-
}
|
|
110
|
-
));
|
|
111
|
-
const renderSquareOutlined = () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
112
|
-
Rect,
|
|
113
|
-
{
|
|
114
|
-
x: "64",
|
|
115
|
-
y: "64",
|
|
116
|
-
width: "384",
|
|
117
|
-
height: "384",
|
|
118
|
-
rx: "48",
|
|
119
|
-
fill: "none",
|
|
120
|
-
stroke: resolvedColor,
|
|
121
|
-
strokeWidth: 32
|
|
122
|
-
}
|
|
123
|
-
), /* @__PURE__ */ React.createElement(
|
|
124
|
-
AnimatedPath,
|
|
125
|
-
{
|
|
126
|
-
fill: resolvedColor,
|
|
127
|
-
d: "m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z",
|
|
128
|
-
...animatedProps
|
|
129
|
-
}
|
|
130
|
-
));
|
|
131
|
-
const renderRoundFilled = () => /* @__PURE__ */ React.createElement(
|
|
132
|
-
AnimatedPath,
|
|
133
|
-
{
|
|
134
|
-
fill: resolvedColor,
|
|
135
|
-
d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm75.31 260.69a16 16 0 1 1-22.62 22.62L256 278.63l-52.69 52.68a16 16 0 0 1-22.62-22.62L233.37 256l-52.68-52.69a16 16 0 0 1 22.62-22.62L256 233.37l52.69-52.68a16 16 0 0 1 22.62 22.62L278.63 256z",
|
|
136
|
-
...animatedProps
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
const renderSquareFilled = () => /* @__PURE__ */ React.createElement(
|
|
140
|
-
AnimatedPath,
|
|
141
|
-
{
|
|
142
|
-
fill: resolvedColor,
|
|
143
|
-
d: "M400 64H112a48 48 0 0 0-48 48v288a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V112a48 48 0 0 0-48-48zm-59.31 244.69a16 16 0 1 1-22.62 22.62L256 278.63l-62.07 52.68a16 16 0 0 1-22.62-22.62L223.37 256l-52.06-52.69a16 16 0 0 1 22.62-22.62L256 233.37l62.07-52.68a16 16 0 0 1 22.62 22.62L288.63 256z",
|
|
144
|
-
...animatedProps
|
|
145
|
-
}
|
|
146
|
-
);
|
|
147
|
-
const renderVariant = () => {
|
|
148
|
-
switch (variant) {
|
|
149
|
-
case "filled":
|
|
150
|
-
return renderFilled();
|
|
151
|
-
case "duotone":
|
|
152
|
-
return renderDuotone();
|
|
153
|
-
case "round-outlined":
|
|
154
|
-
return renderRoundOutlined();
|
|
155
|
-
case "square-outlined":
|
|
156
|
-
return renderSquareOutlined();
|
|
157
|
-
case "round-filled":
|
|
158
|
-
return renderRoundFilled();
|
|
159
|
-
case "square-filled":
|
|
160
|
-
return renderSquareFilled();
|
|
161
|
-
case "baseline":
|
|
162
|
-
default:
|
|
163
|
-
return renderBaseline();
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
return /* @__PURE__ */ React.createElement(Svg, { width: size, height: size, viewBox: "0 0 512 512" }, renderVariant());
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
export {
|
|
170
|
-
isThemeColor,
|
|
171
|
-
CloseIcon
|
|
172
|
-
};
|