@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
|
@@ -35,8 +35,8 @@ __export(datepicker_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(datepicker_exports);
|
|
36
36
|
|
|
37
37
|
// src/components/datepicker/datepicker.tsx
|
|
38
|
-
var
|
|
39
|
-
var
|
|
38
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
39
|
+
var import_react_native13 = require("react-native");
|
|
40
40
|
|
|
41
41
|
// src/components/datepicker/datepicker.hook.ts
|
|
42
42
|
var import_react6 = require("react");
|
|
@@ -310,9 +310,7 @@ var getWeekdayNames = (locale, firstDayOfWeek) => {
|
|
|
310
310
|
const days = [];
|
|
311
311
|
for (let i = 0; i < 7; i++) {
|
|
312
312
|
const date = new Date(2024, 0, 1 + offset + i);
|
|
313
|
-
days.push(
|
|
314
|
-
date.toLocaleDateString(locale, { weekday: "short" }).slice(0, 2)
|
|
315
|
-
);
|
|
313
|
+
days.push(date.toLocaleDateString(locale, { weekday: "short" }).slice(0, 2));
|
|
316
314
|
}
|
|
317
315
|
return days;
|
|
318
316
|
};
|
|
@@ -523,8 +521,8 @@ var styles = import_react_native4.StyleSheet.create({
|
|
|
523
521
|
});
|
|
524
522
|
|
|
525
523
|
// src/components/dialogs/datepicker-dialog/datepicker-dialog.tsx
|
|
526
|
-
var
|
|
527
|
-
var
|
|
524
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
525
|
+
var import_react_native11 = require("react-native");
|
|
528
526
|
var import_react_native_gesture_handler2 = require("react-native-gesture-handler");
|
|
529
527
|
|
|
530
528
|
// src/components/dialogs/datepicker-dialog/datepicker-dialog.animation.ts
|
|
@@ -1013,718 +1011,12 @@ var DatePickerDialogCalendar = ({
|
|
|
1013
1011
|
};
|
|
1014
1012
|
|
|
1015
1013
|
// src/components/dialogs/datepicker-dialog/datepicker-dialog-header.tsx
|
|
1016
|
-
var import_react17 = __toESM(require("react"), 1);
|
|
1017
|
-
var import_react_native15 = require("react-native");
|
|
1018
|
-
|
|
1019
|
-
// src/components/icon/icons/arrow-back.tsx
|
|
1020
1014
|
var import_react10 = __toESM(require("react"), 1);
|
|
1021
1015
|
var import_react_native8 = require("react-native");
|
|
1022
|
-
var
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
var
|
|
1026
|
-
const themeColors = [
|
|
1027
|
-
"primary",
|
|
1028
|
-
"secondary",
|
|
1029
|
-
"tertiary",
|
|
1030
|
-
"danger",
|
|
1031
|
-
"warning",
|
|
1032
|
-
"success",
|
|
1033
|
-
"default"
|
|
1034
|
-
];
|
|
1035
|
-
return themeColors.includes(color);
|
|
1036
|
-
};
|
|
1037
|
-
|
|
1038
|
-
// src/components/icon/icons/arrow-back.tsx
|
|
1039
|
-
var AnimatedPath = import_react_native8.Animated.createAnimatedComponent(import_react_native_svg.Path);
|
|
1040
|
-
|
|
1041
|
-
// src/components/icon/icons/calendar.tsx
|
|
1042
|
-
var import_react11 = __toESM(require("react"), 1);
|
|
1043
|
-
var import_react_native9 = require("react-native");
|
|
1044
|
-
var import_react_native_svg2 = __toESM(require("react-native-svg"), 1);
|
|
1045
|
-
var AnimatedPath2 = import_react_native9.Animated.createAnimatedComponent(import_react_native_svg2.Path);
|
|
1046
|
-
var CalendarIcon = ({
|
|
1047
|
-
variant = "baseline",
|
|
1048
|
-
size = 24,
|
|
1049
|
-
color = "default",
|
|
1050
|
-
isAnimated = false
|
|
1051
|
-
}) => {
|
|
1052
|
-
const theme = useXUITheme();
|
|
1053
|
-
const scaleAnim = (0, import_react11.useRef)(new import_react_native9.Animated.Value(isAnimated ? 0 : 1)).current;
|
|
1054
|
-
const opacityAnim = (0, import_react11.useRef)(new import_react_native9.Animated.Value(isAnimated ? 0 : 1)).current;
|
|
1055
|
-
const resolvedColor = (0, import_react11.useMemo)(() => {
|
|
1056
|
-
if (typeof color === "string" && isThemeColor(color)) {
|
|
1057
|
-
return theme.colors[color].main;
|
|
1058
|
-
}
|
|
1059
|
-
return color;
|
|
1060
|
-
}, [color, theme]);
|
|
1061
|
-
(0, import_react11.useEffect)(() => {
|
|
1062
|
-
if (isAnimated) {
|
|
1063
|
-
import_react_native9.Animated.parallel([
|
|
1064
|
-
import_react_native9.Animated.spring(scaleAnim, {
|
|
1065
|
-
toValue: 1,
|
|
1066
|
-
useNativeDriver: true,
|
|
1067
|
-
tension: 50,
|
|
1068
|
-
friction: 7
|
|
1069
|
-
}),
|
|
1070
|
-
import_react_native9.Animated.timing(opacityAnim, {
|
|
1071
|
-
toValue: 1,
|
|
1072
|
-
duration: 200,
|
|
1073
|
-
useNativeDriver: true
|
|
1074
|
-
})
|
|
1075
|
-
]).start();
|
|
1076
|
-
}
|
|
1077
|
-
}, [isAnimated, scaleAnim, opacityAnim]);
|
|
1078
|
-
const animatedProps = isAnimated ? {
|
|
1079
|
-
transform: [{ scale: scaleAnim }],
|
|
1080
|
-
opacity: opacityAnim
|
|
1081
|
-
} : void 0;
|
|
1082
|
-
const renderBaseline = () => /* @__PURE__ */ import_react11.default.createElement(
|
|
1083
|
-
AnimatedPath2,
|
|
1084
|
-
{
|
|
1085
|
-
fill: "none",
|
|
1086
|
-
stroke: resolvedColor,
|
|
1087
|
-
strokeLinecap: "round",
|
|
1088
|
-
strokeLinejoin: "round",
|
|
1089
|
-
strokeWidth: 32,
|
|
1090
|
-
d: "M48 112a48 48 0 0148-48h320a48 48 0 0148 48v320a48 48 0 01-48 48H96a48 48 0 01-48-48zm0 80h416M176 64v48M336 64v48",
|
|
1091
|
-
...animatedProps
|
|
1092
|
-
}
|
|
1093
|
-
);
|
|
1094
|
-
const renderFilled = () => /* @__PURE__ */ import_react11.default.createElement(
|
|
1095
|
-
AnimatedPath2,
|
|
1096
|
-
{
|
|
1097
|
-
fill: resolvedColor,
|
|
1098
|
-
d: "M416 64h-56V40a24 24 0 00-48 0v24H200V40a24 24 0 00-48 0v24H96a48 48 0 00-48 48v320a48 48 0 0048 48h320a48 48 0 0048-48V112a48 48 0 00-48-48zm0 368H96V208h320z",
|
|
1099
|
-
...animatedProps
|
|
1100
|
-
}
|
|
1101
|
-
);
|
|
1102
|
-
const renderDuotone = () => /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(
|
|
1103
|
-
import_react_native_svg2.Path,
|
|
1104
|
-
{
|
|
1105
|
-
fill: resolvedColor,
|
|
1106
|
-
opacity: 0.3,
|
|
1107
|
-
d: "M48 192h416v240a48 48 0 01-48 48H96a48 48 0 01-48-48z"
|
|
1108
|
-
}
|
|
1109
|
-
), renderBaseline());
|
|
1110
|
-
const renderRoundOutlined = () => /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(
|
|
1111
|
-
import_react_native_svg2.Circle,
|
|
1112
|
-
{
|
|
1113
|
-
cx: "256",
|
|
1114
|
-
cy: "256",
|
|
1115
|
-
r: "192",
|
|
1116
|
-
fill: "none",
|
|
1117
|
-
stroke: resolvedColor,
|
|
1118
|
-
strokeWidth: 32
|
|
1119
|
-
}
|
|
1120
|
-
), /* @__PURE__ */ import_react11.default.createElement(
|
|
1121
|
-
AnimatedPath2,
|
|
1122
|
-
{
|
|
1123
|
-
fill: "none",
|
|
1124
|
-
stroke: resolvedColor,
|
|
1125
|
-
strokeLinecap: "round",
|
|
1126
|
-
strokeLinejoin: "round",
|
|
1127
|
-
strokeWidth: 28,
|
|
1128
|
-
d: "M152 176a24 24 0 0124-24h160a24 24 0 0124 24v176a24 24 0 01-24 24H176a24 24 0 01-24-24zm0 48h208M208 152v32M304 152v32",
|
|
1129
|
-
...animatedProps
|
|
1130
|
-
}
|
|
1131
|
-
));
|
|
1132
|
-
const renderSquareOutlined = () => /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(
|
|
1133
|
-
import_react_native_svg2.Rect,
|
|
1134
|
-
{
|
|
1135
|
-
x: "64",
|
|
1136
|
-
y: "64",
|
|
1137
|
-
width: "384",
|
|
1138
|
-
height: "384",
|
|
1139
|
-
rx: "48",
|
|
1140
|
-
fill: "none",
|
|
1141
|
-
stroke: resolvedColor,
|
|
1142
|
-
strokeWidth: 32
|
|
1143
|
-
}
|
|
1144
|
-
), /* @__PURE__ */ import_react11.default.createElement(
|
|
1145
|
-
AnimatedPath2,
|
|
1146
|
-
{
|
|
1147
|
-
fill: "none",
|
|
1148
|
-
stroke: resolvedColor,
|
|
1149
|
-
strokeLinecap: "round",
|
|
1150
|
-
strokeLinejoin: "round",
|
|
1151
|
-
strokeWidth: 28,
|
|
1152
|
-
d: "M152 176a24 24 0 0124-24h160a24 24 0 0124 24v176a24 24 0 01-24 24H176a24 24 0 01-24-24zm0 48h208M208 152v32M304 152v32",
|
|
1153
|
-
...animatedProps
|
|
1154
|
-
}
|
|
1155
|
-
));
|
|
1156
|
-
const renderVariant = () => {
|
|
1157
|
-
switch (variant) {
|
|
1158
|
-
case "filled":
|
|
1159
|
-
return renderFilled();
|
|
1160
|
-
case "duotone":
|
|
1161
|
-
return renderDuotone();
|
|
1162
|
-
case "round-outlined":
|
|
1163
|
-
return renderRoundOutlined();
|
|
1164
|
-
case "square-outlined":
|
|
1165
|
-
return renderSquareOutlined();
|
|
1166
|
-
case "round-filled":
|
|
1167
|
-
case "square-filled":
|
|
1168
|
-
return renderFilled();
|
|
1169
|
-
case "baseline":
|
|
1170
|
-
default:
|
|
1171
|
-
return renderBaseline();
|
|
1172
|
-
}
|
|
1173
|
-
};
|
|
1174
|
-
return /* @__PURE__ */ import_react11.default.createElement(import_react_native_svg2.default, { width: size, height: size, viewBox: "0 0 512 512" }, renderVariant());
|
|
1175
|
-
};
|
|
1176
|
-
|
|
1177
|
-
// src/components/icon/icons/checkmark.tsx
|
|
1178
|
-
var import_react12 = __toESM(require("react"), 1);
|
|
1179
|
-
var import_react_native10 = require("react-native");
|
|
1180
|
-
var import_react_native_svg3 = __toESM(require("react-native-svg"), 1);
|
|
1181
|
-
var AnimatedPath3 = import_react_native10.Animated.createAnimatedComponent(import_react_native_svg3.Path);
|
|
1182
|
-
|
|
1183
|
-
// src/components/icon/icons/chevron-down.tsx
|
|
1184
|
-
var import_react13 = __toESM(require("react"), 1);
|
|
1185
|
-
var import_react_native11 = require("react-native");
|
|
1186
|
-
var import_react_native_svg4 = __toESM(require("react-native-svg"), 1);
|
|
1187
|
-
var AnimatedPath4 = import_react_native11.Animated.createAnimatedComponent(import_react_native_svg4.Path);
|
|
1188
|
-
var ChevronDownIcon = ({
|
|
1189
|
-
variant = "baseline",
|
|
1190
|
-
size = 24,
|
|
1191
|
-
color = "default",
|
|
1192
|
-
isAnimated = false
|
|
1193
|
-
}) => {
|
|
1194
|
-
const theme = useXUITheme();
|
|
1195
|
-
const scaleAnim = (0, import_react13.useRef)(new import_react_native11.Animated.Value(isAnimated ? 0 : 1)).current;
|
|
1196
|
-
const opacityAnim = (0, import_react13.useRef)(new import_react_native11.Animated.Value(isAnimated ? 0 : 1)).current;
|
|
1197
|
-
const resolvedColor = (0, import_react13.useMemo)(() => {
|
|
1198
|
-
if (typeof color === "string" && isThemeColor(color)) {
|
|
1199
|
-
return theme.colors[color].main;
|
|
1200
|
-
}
|
|
1201
|
-
return color;
|
|
1202
|
-
}, [color, theme]);
|
|
1203
|
-
(0, import_react13.useEffect)(() => {
|
|
1204
|
-
if (isAnimated) {
|
|
1205
|
-
import_react_native11.Animated.parallel([
|
|
1206
|
-
import_react_native11.Animated.spring(scaleAnim, {
|
|
1207
|
-
toValue: 1,
|
|
1208
|
-
useNativeDriver: true,
|
|
1209
|
-
tension: 50,
|
|
1210
|
-
friction: 7
|
|
1211
|
-
}),
|
|
1212
|
-
import_react_native11.Animated.timing(opacityAnim, {
|
|
1213
|
-
toValue: 1,
|
|
1214
|
-
duration: 200,
|
|
1215
|
-
useNativeDriver: true
|
|
1216
|
-
})
|
|
1217
|
-
]).start();
|
|
1218
|
-
}
|
|
1219
|
-
}, [isAnimated, scaleAnim, opacityAnim]);
|
|
1220
|
-
const animatedProps = isAnimated ? {
|
|
1221
|
-
transform: [{ scale: scaleAnim }],
|
|
1222
|
-
opacity: opacityAnim
|
|
1223
|
-
} : void 0;
|
|
1224
|
-
const renderBaseline = () => /* @__PURE__ */ import_react13.default.createElement(
|
|
1225
|
-
AnimatedPath4,
|
|
1226
|
-
{
|
|
1227
|
-
fill: "none",
|
|
1228
|
-
stroke: resolvedColor,
|
|
1229
|
-
strokeLinecap: "round",
|
|
1230
|
-
strokeLinejoin: "round",
|
|
1231
|
-
strokeWidth: 48,
|
|
1232
|
-
d: "M112 184l144 144 144-144",
|
|
1233
|
-
...animatedProps
|
|
1234
|
-
}
|
|
1235
|
-
);
|
|
1236
|
-
const renderFilled = () => /* @__PURE__ */ import_react13.default.createElement(
|
|
1237
|
-
AnimatedPath4,
|
|
1238
|
-
{
|
|
1239
|
-
fill: resolvedColor,
|
|
1240
|
-
d: "M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z",
|
|
1241
|
-
...animatedProps
|
|
1242
|
-
}
|
|
1243
|
-
);
|
|
1244
|
-
const renderDuotone = () => /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
1245
|
-
import_react_native_svg4.Path,
|
|
1246
|
-
{
|
|
1247
|
-
fill: resolvedColor,
|
|
1248
|
-
opacity: 0.3,
|
|
1249
|
-
d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48z"
|
|
1250
|
-
}
|
|
1251
|
-
), /* @__PURE__ */ import_react13.default.createElement(
|
|
1252
|
-
AnimatedPath4,
|
|
1253
|
-
{
|
|
1254
|
-
fill: "none",
|
|
1255
|
-
stroke: resolvedColor,
|
|
1256
|
-
strokeLinecap: "round",
|
|
1257
|
-
strokeLinejoin: "round",
|
|
1258
|
-
strokeWidth: 48,
|
|
1259
|
-
d: "M112 184l144 144 144-144",
|
|
1260
|
-
...animatedProps
|
|
1261
|
-
}
|
|
1262
|
-
));
|
|
1263
|
-
const renderRoundOutlined = () => /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
1264
|
-
import_react_native_svg4.Circle,
|
|
1265
|
-
{
|
|
1266
|
-
cx: "256",
|
|
1267
|
-
cy: "256",
|
|
1268
|
-
r: "192",
|
|
1269
|
-
fill: "none",
|
|
1270
|
-
stroke: resolvedColor,
|
|
1271
|
-
strokeWidth: 32
|
|
1272
|
-
}
|
|
1273
|
-
), /* @__PURE__ */ import_react13.default.createElement(
|
|
1274
|
-
AnimatedPath4,
|
|
1275
|
-
{
|
|
1276
|
-
fill: "none",
|
|
1277
|
-
stroke: resolvedColor,
|
|
1278
|
-
strokeLinecap: "round",
|
|
1279
|
-
strokeLinejoin: "round",
|
|
1280
|
-
strokeWidth: 48,
|
|
1281
|
-
d: "M112 184l144 144 144-144",
|
|
1282
|
-
...animatedProps
|
|
1283
|
-
}
|
|
1284
|
-
));
|
|
1285
|
-
const renderSquareOutlined = () => /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
1286
|
-
import_react_native_svg4.Rect,
|
|
1287
|
-
{
|
|
1288
|
-
x: "64",
|
|
1289
|
-
y: "64",
|
|
1290
|
-
width: "384",
|
|
1291
|
-
height: "384",
|
|
1292
|
-
rx: "48",
|
|
1293
|
-
fill: "none",
|
|
1294
|
-
stroke: resolvedColor,
|
|
1295
|
-
strokeWidth: 32
|
|
1296
|
-
}
|
|
1297
|
-
), /* @__PURE__ */ import_react13.default.createElement(
|
|
1298
|
-
AnimatedPath4,
|
|
1299
|
-
{
|
|
1300
|
-
fill: "none",
|
|
1301
|
-
stroke: resolvedColor,
|
|
1302
|
-
strokeLinecap: "round",
|
|
1303
|
-
strokeLinejoin: "round",
|
|
1304
|
-
strokeWidth: 48,
|
|
1305
|
-
d: "M112 184l144 144 144-144",
|
|
1306
|
-
...animatedProps
|
|
1307
|
-
}
|
|
1308
|
-
));
|
|
1309
|
-
const renderRoundFilled = () => /* @__PURE__ */ import_react13.default.createElement(
|
|
1310
|
-
AnimatedPath4,
|
|
1311
|
-
{
|
|
1312
|
-
fill: resolvedColor,
|
|
1313
|
-
d: "M464 256c0-114.87-93.13-208-208-208S48 141.13 48 256s93.13 208 208 208 208-93.13 208-208zm-100.69-28.69l-96 96a16 16 0 0 1-22.62 0l-96-96a16 16 0 0 1 22.62-22.62L256 289.37l84.69-84.68a16 16 0 0 1 22.62 22.62z",
|
|
1314
|
-
...animatedProps
|
|
1315
|
-
}
|
|
1316
|
-
);
|
|
1317
|
-
const renderSquareFilled = () => /* @__PURE__ */ import_react13.default.createElement(
|
|
1318
|
-
AnimatedPath4,
|
|
1319
|
-
{
|
|
1320
|
-
fill: resolvedColor,
|
|
1321
|
-
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-36.69 163.31l-96 96a16 16 0 0 1-22.62 0l-96-96a16 16 0 0 1 22.62-22.62L256 289.37l84.69-84.68a16 16 0 0 1 22.62 22.62z",
|
|
1322
|
-
...animatedProps
|
|
1323
|
-
}
|
|
1324
|
-
);
|
|
1325
|
-
const renderVariant = () => {
|
|
1326
|
-
switch (variant) {
|
|
1327
|
-
case "filled":
|
|
1328
|
-
return renderFilled();
|
|
1329
|
-
case "duotone":
|
|
1330
|
-
return renderDuotone();
|
|
1331
|
-
case "round-outlined":
|
|
1332
|
-
return renderRoundOutlined();
|
|
1333
|
-
case "square-outlined":
|
|
1334
|
-
return renderSquareOutlined();
|
|
1335
|
-
case "round-filled":
|
|
1336
|
-
return renderRoundFilled();
|
|
1337
|
-
case "square-filled":
|
|
1338
|
-
return renderSquareFilled();
|
|
1339
|
-
case "baseline":
|
|
1340
|
-
default:
|
|
1341
|
-
return renderBaseline();
|
|
1342
|
-
}
|
|
1343
|
-
};
|
|
1344
|
-
return /* @__PURE__ */ import_react13.default.createElement(import_react_native_svg4.default, { width: size, height: size, viewBox: "0 0 512 512" }, renderVariant());
|
|
1345
|
-
};
|
|
1346
|
-
|
|
1347
|
-
// src/components/icon/icons/chevron-left.tsx
|
|
1348
|
-
var import_react14 = __toESM(require("react"), 1);
|
|
1349
|
-
var import_react_native12 = require("react-native");
|
|
1350
|
-
var import_react_native_svg5 = __toESM(require("react-native-svg"), 1);
|
|
1351
|
-
var AnimatedPath5 = import_react_native12.Animated.createAnimatedComponent(import_react_native_svg5.Path);
|
|
1352
|
-
var ChevronLeftIcon = ({
|
|
1353
|
-
variant = "baseline",
|
|
1354
|
-
size = 24,
|
|
1355
|
-
color = "default",
|
|
1356
|
-
isAnimated = false
|
|
1357
|
-
}) => {
|
|
1358
|
-
const theme = useXUITheme();
|
|
1359
|
-
const scaleAnim = (0, import_react14.useRef)(new import_react_native12.Animated.Value(isAnimated ? 0 : 1)).current;
|
|
1360
|
-
const opacityAnim = (0, import_react14.useRef)(new import_react_native12.Animated.Value(isAnimated ? 0 : 1)).current;
|
|
1361
|
-
const resolvedColor = (0, import_react14.useMemo)(() => {
|
|
1362
|
-
if (typeof color === "string" && isThemeColor(color)) {
|
|
1363
|
-
return theme.colors[color].main;
|
|
1364
|
-
}
|
|
1365
|
-
return color;
|
|
1366
|
-
}, [color, theme]);
|
|
1367
|
-
(0, import_react14.useEffect)(() => {
|
|
1368
|
-
if (isAnimated) {
|
|
1369
|
-
import_react_native12.Animated.parallel([
|
|
1370
|
-
import_react_native12.Animated.spring(scaleAnim, {
|
|
1371
|
-
toValue: 1,
|
|
1372
|
-
useNativeDriver: true,
|
|
1373
|
-
tension: 50,
|
|
1374
|
-
friction: 7
|
|
1375
|
-
}),
|
|
1376
|
-
import_react_native12.Animated.timing(opacityAnim, {
|
|
1377
|
-
toValue: 1,
|
|
1378
|
-
duration: 200,
|
|
1379
|
-
useNativeDriver: true
|
|
1380
|
-
})
|
|
1381
|
-
]).start();
|
|
1382
|
-
}
|
|
1383
|
-
}, [isAnimated, scaleAnim, opacityAnim]);
|
|
1384
|
-
const animatedProps = isAnimated ? {
|
|
1385
|
-
transform: [{ scale: scaleAnim }],
|
|
1386
|
-
opacity: opacityAnim
|
|
1387
|
-
} : void 0;
|
|
1388
|
-
const renderBaseline = () => /* @__PURE__ */ import_react14.default.createElement(
|
|
1389
|
-
AnimatedPath5,
|
|
1390
|
-
{
|
|
1391
|
-
fill: "none",
|
|
1392
|
-
stroke: resolvedColor,
|
|
1393
|
-
strokeLinecap: "round",
|
|
1394
|
-
strokeLinejoin: "round",
|
|
1395
|
-
strokeWidth: 48,
|
|
1396
|
-
d: "M328 112L184 256l144 144",
|
|
1397
|
-
...animatedProps
|
|
1398
|
-
}
|
|
1399
|
-
);
|
|
1400
|
-
const renderFilled = () => /* @__PURE__ */ import_react14.default.createElement(
|
|
1401
|
-
AnimatedPath5,
|
|
1402
|
-
{
|
|
1403
|
-
fill: resolvedColor,
|
|
1404
|
-
d: "M256 217.9L383 345c9.4 9.4 24.6 9.4 33.9 0s9.3-24.6 0-34L273 167c-9.1-9.1-23.7-9.3-33.1-.7L95 310.9c-4.7 4.7-7 10.9-7 17s2.3 12.3 7 17c9.4 9.4 24.6 9.4 33.9 0l127.1-127z",
|
|
1405
|
-
rotation: 90,
|
|
1406
|
-
origin: "256, 256",
|
|
1407
|
-
...animatedProps
|
|
1408
|
-
}
|
|
1409
|
-
);
|
|
1410
|
-
const renderDuotone = () => /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, null, /* @__PURE__ */ import_react14.default.createElement(
|
|
1411
|
-
import_react_native_svg5.Path,
|
|
1412
|
-
{
|
|
1413
|
-
fill: resolvedColor,
|
|
1414
|
-
opacity: 0.3,
|
|
1415
|
-
d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48z"
|
|
1416
|
-
}
|
|
1417
|
-
), renderBaseline());
|
|
1418
|
-
const renderRoundOutlined = () => /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, null, /* @__PURE__ */ import_react14.default.createElement(
|
|
1419
|
-
import_react_native_svg5.Circle,
|
|
1420
|
-
{
|
|
1421
|
-
cx: "256",
|
|
1422
|
-
cy: "256",
|
|
1423
|
-
r: "192",
|
|
1424
|
-
fill: "none",
|
|
1425
|
-
stroke: resolvedColor,
|
|
1426
|
-
strokeWidth: 32
|
|
1427
|
-
}
|
|
1428
|
-
), renderBaseline());
|
|
1429
|
-
const renderSquareOutlined = () => /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, null, /* @__PURE__ */ import_react14.default.createElement(
|
|
1430
|
-
import_react_native_svg5.Rect,
|
|
1431
|
-
{
|
|
1432
|
-
x: "64",
|
|
1433
|
-
y: "64",
|
|
1434
|
-
width: "384",
|
|
1435
|
-
height: "384",
|
|
1436
|
-
rx: "48",
|
|
1437
|
-
fill: "none",
|
|
1438
|
-
stroke: resolvedColor,
|
|
1439
|
-
strokeWidth: 32
|
|
1440
|
-
}
|
|
1441
|
-
), renderBaseline());
|
|
1442
|
-
const renderVariant = () => {
|
|
1443
|
-
switch (variant) {
|
|
1444
|
-
case "filled":
|
|
1445
|
-
return renderFilled();
|
|
1446
|
-
case "duotone":
|
|
1447
|
-
return renderDuotone();
|
|
1448
|
-
case "round-outlined":
|
|
1449
|
-
return renderRoundOutlined();
|
|
1450
|
-
case "square-outlined":
|
|
1451
|
-
return renderSquareOutlined();
|
|
1452
|
-
case "round-filled":
|
|
1453
|
-
case "square-filled":
|
|
1454
|
-
return renderFilled();
|
|
1455
|
-
case "baseline":
|
|
1456
|
-
default:
|
|
1457
|
-
return renderBaseline();
|
|
1458
|
-
}
|
|
1459
|
-
};
|
|
1460
|
-
return /* @__PURE__ */ import_react14.default.createElement(import_react_native_svg5.default, { width: size, height: size, viewBox: "0 0 512 512" }, renderVariant());
|
|
1461
|
-
};
|
|
1462
|
-
|
|
1463
|
-
// src/components/icon/icons/chevron-right.tsx
|
|
1464
|
-
var import_react15 = __toESM(require("react"), 1);
|
|
1465
|
-
var import_react_native13 = require("react-native");
|
|
1466
|
-
var import_react_native_svg6 = __toESM(require("react-native-svg"), 1);
|
|
1467
|
-
var AnimatedPath6 = import_react_native13.Animated.createAnimatedComponent(import_react_native_svg6.Path);
|
|
1468
|
-
var ChevronRightIcon = ({
|
|
1469
|
-
variant = "baseline",
|
|
1470
|
-
size = 24,
|
|
1471
|
-
color = "default",
|
|
1472
|
-
isAnimated = false
|
|
1473
|
-
}) => {
|
|
1474
|
-
const theme = useXUITheme();
|
|
1475
|
-
const scaleAnim = (0, import_react15.useRef)(new import_react_native13.Animated.Value(isAnimated ? 0 : 1)).current;
|
|
1476
|
-
const opacityAnim = (0, import_react15.useRef)(new import_react_native13.Animated.Value(isAnimated ? 0 : 1)).current;
|
|
1477
|
-
const resolvedColor = (0, import_react15.useMemo)(() => {
|
|
1478
|
-
if (typeof color === "string" && isThemeColor(color)) {
|
|
1479
|
-
return theme.colors[color].main;
|
|
1480
|
-
}
|
|
1481
|
-
return color;
|
|
1482
|
-
}, [color, theme]);
|
|
1483
|
-
(0, import_react15.useEffect)(() => {
|
|
1484
|
-
if (isAnimated) {
|
|
1485
|
-
import_react_native13.Animated.parallel([
|
|
1486
|
-
import_react_native13.Animated.spring(scaleAnim, {
|
|
1487
|
-
toValue: 1,
|
|
1488
|
-
useNativeDriver: true,
|
|
1489
|
-
tension: 50,
|
|
1490
|
-
friction: 7
|
|
1491
|
-
}),
|
|
1492
|
-
import_react_native13.Animated.timing(opacityAnim, {
|
|
1493
|
-
toValue: 1,
|
|
1494
|
-
duration: 200,
|
|
1495
|
-
useNativeDriver: true
|
|
1496
|
-
})
|
|
1497
|
-
]).start();
|
|
1498
|
-
}
|
|
1499
|
-
}, [isAnimated, scaleAnim, opacityAnim]);
|
|
1500
|
-
const animatedProps = isAnimated ? {
|
|
1501
|
-
transform: [{ scale: scaleAnim }],
|
|
1502
|
-
opacity: opacityAnim
|
|
1503
|
-
} : void 0;
|
|
1504
|
-
const renderBaseline = () => /* @__PURE__ */ import_react15.default.createElement(
|
|
1505
|
-
AnimatedPath6,
|
|
1506
|
-
{
|
|
1507
|
-
fill: "none",
|
|
1508
|
-
stroke: resolvedColor,
|
|
1509
|
-
strokeLinecap: "round",
|
|
1510
|
-
strokeLinejoin: "round",
|
|
1511
|
-
strokeWidth: 48,
|
|
1512
|
-
d: "M184 112l144 144-144 144",
|
|
1513
|
-
...animatedProps
|
|
1514
|
-
}
|
|
1515
|
-
);
|
|
1516
|
-
const renderFilled = () => /* @__PURE__ */ import_react15.default.createElement(
|
|
1517
|
-
AnimatedPath6,
|
|
1518
|
-
{
|
|
1519
|
-
fill: resolvedColor,
|
|
1520
|
-
d: "M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z",
|
|
1521
|
-
rotation: -90,
|
|
1522
|
-
origin: "256, 256",
|
|
1523
|
-
...animatedProps
|
|
1524
|
-
}
|
|
1525
|
-
);
|
|
1526
|
-
const renderDuotone = () => /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement(
|
|
1527
|
-
import_react_native_svg6.Path,
|
|
1528
|
-
{
|
|
1529
|
-
fill: resolvedColor,
|
|
1530
|
-
opacity: 0.3,
|
|
1531
|
-
d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48z"
|
|
1532
|
-
}
|
|
1533
|
-
), renderBaseline());
|
|
1534
|
-
const renderRoundOutlined = () => /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement(
|
|
1535
|
-
import_react_native_svg6.Circle,
|
|
1536
|
-
{
|
|
1537
|
-
cx: "256",
|
|
1538
|
-
cy: "256",
|
|
1539
|
-
r: "192",
|
|
1540
|
-
fill: "none",
|
|
1541
|
-
stroke: resolvedColor,
|
|
1542
|
-
strokeWidth: 32
|
|
1543
|
-
}
|
|
1544
|
-
), renderBaseline());
|
|
1545
|
-
const renderSquareOutlined = () => /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement(
|
|
1546
|
-
import_react_native_svg6.Rect,
|
|
1547
|
-
{
|
|
1548
|
-
x: "64",
|
|
1549
|
-
y: "64",
|
|
1550
|
-
width: "384",
|
|
1551
|
-
height: "384",
|
|
1552
|
-
rx: "48",
|
|
1553
|
-
fill: "none",
|
|
1554
|
-
stroke: resolvedColor,
|
|
1555
|
-
strokeWidth: 32
|
|
1556
|
-
}
|
|
1557
|
-
), renderBaseline());
|
|
1558
|
-
const renderVariant = () => {
|
|
1559
|
-
switch (variant) {
|
|
1560
|
-
case "filled":
|
|
1561
|
-
return renderFilled();
|
|
1562
|
-
case "duotone":
|
|
1563
|
-
return renderDuotone();
|
|
1564
|
-
case "round-outlined":
|
|
1565
|
-
return renderRoundOutlined();
|
|
1566
|
-
case "square-outlined":
|
|
1567
|
-
return renderSquareOutlined();
|
|
1568
|
-
case "round-filled":
|
|
1569
|
-
case "square-filled":
|
|
1570
|
-
return renderFilled();
|
|
1571
|
-
case "baseline":
|
|
1572
|
-
default:
|
|
1573
|
-
return renderBaseline();
|
|
1574
|
-
}
|
|
1575
|
-
};
|
|
1576
|
-
return /* @__PURE__ */ import_react15.default.createElement(import_react_native_svg6.default, { width: size, height: size, viewBox: "0 0 512 512" }, renderVariant());
|
|
1577
|
-
};
|
|
1578
|
-
|
|
1579
|
-
// src/components/icon/icons/close.tsx
|
|
1580
|
-
var import_react16 = __toESM(require("react"), 1);
|
|
1581
|
-
var import_react_native14 = require("react-native");
|
|
1582
|
-
var import_react_native_svg7 = __toESM(require("react-native-svg"), 1);
|
|
1583
|
-
var AnimatedPath7 = import_react_native14.Animated.createAnimatedComponent(import_react_native_svg7.Path);
|
|
1584
|
-
var CloseIcon = ({
|
|
1585
|
-
variant = "baseline",
|
|
1586
|
-
size = 24,
|
|
1587
|
-
color = "default",
|
|
1588
|
-
isAnimated = false
|
|
1589
|
-
}) => {
|
|
1590
|
-
const theme = useXUITheme();
|
|
1591
|
-
const scaleAnim = (0, import_react16.useRef)(new import_react_native14.Animated.Value(isAnimated ? 0 : 1)).current;
|
|
1592
|
-
const opacityAnim = (0, import_react16.useRef)(new import_react_native14.Animated.Value(isAnimated ? 0 : 1)).current;
|
|
1593
|
-
const resolvedColor = (0, import_react16.useMemo)(() => {
|
|
1594
|
-
if (typeof color === "string" && isThemeColor(color)) {
|
|
1595
|
-
return theme.colors[color].main;
|
|
1596
|
-
}
|
|
1597
|
-
return color;
|
|
1598
|
-
}, [color, theme]);
|
|
1599
|
-
(0, import_react16.useEffect)(() => {
|
|
1600
|
-
if (isAnimated) {
|
|
1601
|
-
import_react_native14.Animated.parallel([
|
|
1602
|
-
import_react_native14.Animated.spring(scaleAnim, {
|
|
1603
|
-
toValue: 1,
|
|
1604
|
-
useNativeDriver: true,
|
|
1605
|
-
tension: 50,
|
|
1606
|
-
friction: 7
|
|
1607
|
-
}),
|
|
1608
|
-
import_react_native14.Animated.timing(opacityAnim, {
|
|
1609
|
-
toValue: 1,
|
|
1610
|
-
duration: 200,
|
|
1611
|
-
useNativeDriver: true
|
|
1612
|
-
})
|
|
1613
|
-
]).start();
|
|
1614
|
-
}
|
|
1615
|
-
}, [isAnimated, scaleAnim, opacityAnim]);
|
|
1616
|
-
const animatedProps = isAnimated ? {
|
|
1617
|
-
transform: [{ scale: scaleAnim }],
|
|
1618
|
-
opacity: opacityAnim
|
|
1619
|
-
} : void 0;
|
|
1620
|
-
const renderBaseline = () => /* @__PURE__ */ import_react16.default.createElement(
|
|
1621
|
-
AnimatedPath7,
|
|
1622
|
-
{
|
|
1623
|
-
fill: resolvedColor,
|
|
1624
|
-
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",
|
|
1625
|
-
...animatedProps
|
|
1626
|
-
}
|
|
1627
|
-
);
|
|
1628
|
-
const renderFilled = () => /* @__PURE__ */ import_react16.default.createElement(
|
|
1629
|
-
AnimatedPath7,
|
|
1630
|
-
{
|
|
1631
|
-
fill: resolvedColor,
|
|
1632
|
-
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",
|
|
1633
|
-
...animatedProps
|
|
1634
|
-
}
|
|
1635
|
-
);
|
|
1636
|
-
const renderDuotone = () => /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(
|
|
1637
|
-
import_react_native_svg7.Path,
|
|
1638
|
-
{
|
|
1639
|
-
fill: resolvedColor,
|
|
1640
|
-
opacity: 0.3,
|
|
1641
|
-
d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48z"
|
|
1642
|
-
}
|
|
1643
|
-
), /* @__PURE__ */ import_react16.default.createElement(
|
|
1644
|
-
AnimatedPath7,
|
|
1645
|
-
{
|
|
1646
|
-
fill: resolvedColor,
|
|
1647
|
-
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",
|
|
1648
|
-
...animatedProps
|
|
1649
|
-
}
|
|
1650
|
-
));
|
|
1651
|
-
const renderRoundOutlined = () => /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(
|
|
1652
|
-
import_react_native_svg7.Circle,
|
|
1653
|
-
{
|
|
1654
|
-
cx: "256",
|
|
1655
|
-
cy: "256",
|
|
1656
|
-
r: "192",
|
|
1657
|
-
fill: "none",
|
|
1658
|
-
stroke: resolvedColor,
|
|
1659
|
-
strokeWidth: 32
|
|
1660
|
-
}
|
|
1661
|
-
), /* @__PURE__ */ import_react16.default.createElement(
|
|
1662
|
-
AnimatedPath7,
|
|
1663
|
-
{
|
|
1664
|
-
fill: resolvedColor,
|
|
1665
|
-
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",
|
|
1666
|
-
...animatedProps
|
|
1667
|
-
}
|
|
1668
|
-
));
|
|
1669
|
-
const renderSquareOutlined = () => /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(
|
|
1670
|
-
import_react_native_svg7.Rect,
|
|
1671
|
-
{
|
|
1672
|
-
x: "64",
|
|
1673
|
-
y: "64",
|
|
1674
|
-
width: "384",
|
|
1675
|
-
height: "384",
|
|
1676
|
-
rx: "48",
|
|
1677
|
-
fill: "none",
|
|
1678
|
-
stroke: resolvedColor,
|
|
1679
|
-
strokeWidth: 32
|
|
1680
|
-
}
|
|
1681
|
-
), /* @__PURE__ */ import_react16.default.createElement(
|
|
1682
|
-
AnimatedPath7,
|
|
1683
|
-
{
|
|
1684
|
-
fill: resolvedColor,
|
|
1685
|
-
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",
|
|
1686
|
-
...animatedProps
|
|
1687
|
-
}
|
|
1688
|
-
));
|
|
1689
|
-
const renderRoundFilled = () => /* @__PURE__ */ import_react16.default.createElement(
|
|
1690
|
-
AnimatedPath7,
|
|
1691
|
-
{
|
|
1692
|
-
fill: resolvedColor,
|
|
1693
|
-
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",
|
|
1694
|
-
...animatedProps
|
|
1695
|
-
}
|
|
1696
|
-
);
|
|
1697
|
-
const renderSquareFilled = () => /* @__PURE__ */ import_react16.default.createElement(
|
|
1698
|
-
AnimatedPath7,
|
|
1699
|
-
{
|
|
1700
|
-
fill: resolvedColor,
|
|
1701
|
-
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",
|
|
1702
|
-
...animatedProps
|
|
1703
|
-
}
|
|
1704
|
-
);
|
|
1705
|
-
const renderVariant = () => {
|
|
1706
|
-
switch (variant) {
|
|
1707
|
-
case "filled":
|
|
1708
|
-
return renderFilled();
|
|
1709
|
-
case "duotone":
|
|
1710
|
-
return renderDuotone();
|
|
1711
|
-
case "round-outlined":
|
|
1712
|
-
return renderRoundOutlined();
|
|
1713
|
-
case "square-outlined":
|
|
1714
|
-
return renderSquareOutlined();
|
|
1715
|
-
case "round-filled":
|
|
1716
|
-
return renderRoundFilled();
|
|
1717
|
-
case "square-filled":
|
|
1718
|
-
return renderSquareFilled();
|
|
1719
|
-
case "baseline":
|
|
1720
|
-
default:
|
|
1721
|
-
return renderBaseline();
|
|
1722
|
-
}
|
|
1723
|
-
};
|
|
1724
|
-
return /* @__PURE__ */ import_react16.default.createElement(import_react_native_svg7.default, { width: size, height: size, viewBox: "0 0 512 512" }, renderVariant());
|
|
1725
|
-
};
|
|
1726
|
-
|
|
1727
|
-
// src/components/dialogs/datepicker-dialog/datepicker-dialog-header.tsx
|
|
1016
|
+
var import_chevron_down = require("@xaui/icons/chevron-down");
|
|
1017
|
+
var import_chevron_left = require("@xaui/icons/chevron-left");
|
|
1018
|
+
var import_chevron_right = require("@xaui/icons/chevron-right");
|
|
1019
|
+
var import_close = require("@xaui/icons/close");
|
|
1728
1020
|
var DatePickerDialogHeader = ({
|
|
1729
1021
|
viewDate,
|
|
1730
1022
|
selectedDate,
|
|
@@ -1738,89 +1030,77 @@ var DatePickerDialogHeader = ({
|
|
|
1738
1030
|
}) => {
|
|
1739
1031
|
const theme = useXUITheme();
|
|
1740
1032
|
const colorScheme = theme.colors[themeColor] ?? theme.colors.primary;
|
|
1741
|
-
const dateText = (0,
|
|
1033
|
+
const dateText = (0, import_react10.useMemo)(() => {
|
|
1742
1034
|
if (!selectedDate) return "---";
|
|
1743
1035
|
return formatDate(selectedDate, locale);
|
|
1744
1036
|
}, [selectedDate, locale]);
|
|
1745
|
-
const monthYearLabel = (0,
|
|
1037
|
+
const monthYearLabel = (0, import_react10.useMemo)(() => {
|
|
1746
1038
|
const month = getMonthName(viewDate.getMonth(), locale);
|
|
1747
1039
|
return `${month} ${viewDate.getFullYear()}`;
|
|
1748
1040
|
}, [viewDate, locale]);
|
|
1749
|
-
return /* @__PURE__ */
|
|
1750
|
-
|
|
1041
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, /* @__PURE__ */ import_react10.default.createElement(import_react_native8.View, { style: [styles2.header, { backgroundColor: colorScheme.main }] }, /* @__PURE__ */ import_react10.default.createElement(import_react_native8.Text, { style: [styles2.headerLabel, { color: colorScheme.foreground }] }, selectDateLabel), /* @__PURE__ */ import_react10.default.createElement(import_react_native8.View, { style: styles2.headerDateRow }, /* @__PURE__ */ import_react10.default.createElement(import_react_native8.Text, { style: [styles2.headerDate, { color: colorScheme.foreground }] }, dateText), selectedDate ? /* @__PURE__ */ import_react10.default.createElement(
|
|
1042
|
+
import_react_native8.Pressable,
|
|
1751
1043
|
{
|
|
1752
1044
|
onPress: onClearValue,
|
|
1753
1045
|
hitSlop: { top: 8, right: 8, bottom: 8, left: 8 },
|
|
1754
1046
|
accessibilityLabel: "Clear date",
|
|
1755
1047
|
accessibilityRole: "button"
|
|
1756
1048
|
},
|
|
1757
|
-
/* @__PURE__ */
|
|
1758
|
-
))), /* @__PURE__ */
|
|
1759
|
-
|
|
1049
|
+
/* @__PURE__ */ import_react10.default.createElement(import_close.CloseIcon, { size: 20, color: colorScheme.foreground })
|
|
1050
|
+
) : null)), /* @__PURE__ */ import_react10.default.createElement(import_react_native8.View, { style: styles2.navigationRow }, /* @__PURE__ */ import_react10.default.createElement(
|
|
1051
|
+
import_react_native8.Pressable,
|
|
1760
1052
|
{
|
|
1761
1053
|
style: styles2.monthYearButton,
|
|
1762
1054
|
onPress: onToggleYearPicker,
|
|
1763
1055
|
accessibilityLabel: `${monthYearLabel}, tap to change`,
|
|
1764
1056
|
accessibilityRole: "button"
|
|
1765
1057
|
},
|
|
1766
|
-
/* @__PURE__ */
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
},
|
|
1771
|
-
monthYearLabel
|
|
1772
|
-
),
|
|
1773
|
-
/* @__PURE__ */ import_react17.default.createElement(
|
|
1774
|
-
ChevronDownIcon,
|
|
1775
|
-
{
|
|
1776
|
-
size: 18,
|
|
1777
|
-
color: theme.colors.foreground
|
|
1778
|
-
}
|
|
1779
|
-
)
|
|
1780
|
-
), /* @__PURE__ */ import_react17.default.createElement(import_react_native15.View, { style: styles2.navButtons }, /* @__PURE__ */ import_react17.default.createElement(
|
|
1781
|
-
import_react_native15.Pressable,
|
|
1058
|
+
/* @__PURE__ */ import_react10.default.createElement(import_react_native8.Text, { style: [styles2.monthYearText, { color: theme.colors.foreground }] }, monthYearLabel),
|
|
1059
|
+
/* @__PURE__ */ import_react10.default.createElement(import_chevron_down.ChevronDownIcon, { size: 18, color: theme.colors.foreground })
|
|
1060
|
+
), /* @__PURE__ */ import_react10.default.createElement(import_react_native8.View, { style: styles2.navButtons }, /* @__PURE__ */ import_react10.default.createElement(
|
|
1061
|
+
import_react_native8.Pressable,
|
|
1782
1062
|
{
|
|
1783
1063
|
style: styles2.navButton,
|
|
1784
1064
|
onPress: onPreviousMonth,
|
|
1785
1065
|
accessibilityLabel: "Previous month",
|
|
1786
1066
|
accessibilityRole: "button"
|
|
1787
1067
|
},
|
|
1788
|
-
/* @__PURE__ */
|
|
1789
|
-
), /* @__PURE__ */
|
|
1790
|
-
|
|
1068
|
+
/* @__PURE__ */ import_react10.default.createElement(import_chevron_left.ChevronLeftIcon, { size: 20, color: theme.colors.foreground })
|
|
1069
|
+
), /* @__PURE__ */ import_react10.default.createElement(
|
|
1070
|
+
import_react_native8.Pressable,
|
|
1791
1071
|
{
|
|
1792
1072
|
style: styles2.navButton,
|
|
1793
1073
|
onPress: onNextMonth,
|
|
1794
1074
|
accessibilityLabel: "Next month",
|
|
1795
1075
|
accessibilityRole: "button"
|
|
1796
1076
|
},
|
|
1797
|
-
/* @__PURE__ */
|
|
1077
|
+
/* @__PURE__ */ import_react10.default.createElement(import_chevron_right.ChevronRightIcon, { size: 20, color: theme.colors.foreground })
|
|
1798
1078
|
))));
|
|
1799
1079
|
};
|
|
1800
1080
|
|
|
1801
1081
|
// src/components/dialogs/datepicker-dialog/datepicker-dialog-month-picker.tsx
|
|
1802
|
-
var
|
|
1803
|
-
var
|
|
1082
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
1083
|
+
var import_react_native9 = require("react-native");
|
|
1804
1084
|
var DatePickerDialogMonthPicker = ({ viewDate, locale, themeColor, onSelectMonth }) => {
|
|
1805
1085
|
const theme = useXUITheme();
|
|
1806
1086
|
const colorScheme = theme.colors[themeColor] ?? theme.colors.primary;
|
|
1807
1087
|
const isDefault = themeColor === "default";
|
|
1808
1088
|
const accentColor = isDefault ? theme.colors.foreground : colorScheme.main;
|
|
1809
1089
|
const accentFg = isDefault ? theme.colors.background : colorScheme.foreground;
|
|
1810
|
-
const months = (0,
|
|
1090
|
+
const months = (0, import_react11.useMemo)(() => getMonthNames(locale), [locale]);
|
|
1811
1091
|
const currentMonth = viewDate.getMonth();
|
|
1812
|
-
const groupAnim = (0,
|
|
1813
|
-
(0,
|
|
1092
|
+
const groupAnim = (0, import_react11.useRef)(new import_react_native9.Animated.Value(0)).current;
|
|
1093
|
+
(0, import_react11.useEffect)(() => {
|
|
1814
1094
|
groupAnim.setValue(0);
|
|
1815
|
-
|
|
1095
|
+
import_react_native9.Animated.timing(groupAnim, {
|
|
1816
1096
|
toValue: 1,
|
|
1817
1097
|
duration: 220,
|
|
1818
|
-
easing:
|
|
1098
|
+
easing: import_react_native9.Easing.out(import_react_native9.Easing.cubic),
|
|
1819
1099
|
useNativeDriver: true
|
|
1820
1100
|
}).start();
|
|
1821
1101
|
}, [groupAnim]);
|
|
1822
|
-
return /* @__PURE__ */
|
|
1823
|
-
|
|
1102
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react_native9.View, { style: styles2.monthPickerContainer }, /* @__PURE__ */ import_react11.default.createElement(
|
|
1103
|
+
import_react_native9.Animated.View,
|
|
1824
1104
|
{
|
|
1825
1105
|
style: {
|
|
1826
1106
|
opacity: groupAnim,
|
|
@@ -1834,10 +1114,10 @@ var DatePickerDialogMonthPicker = ({ viewDate, locale, themeColor, onSelectMonth
|
|
|
1834
1114
|
]
|
|
1835
1115
|
}
|
|
1836
1116
|
},
|
|
1837
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ import_react11.default.createElement(import_react_native9.View, { style: styles2.monthGrid }, months.map((name, index) => {
|
|
1838
1118
|
const isCurrentMonth = index === currentMonth;
|
|
1839
|
-
return /* @__PURE__ */
|
|
1840
|
-
|
|
1119
|
+
return /* @__PURE__ */ import_react11.default.createElement(
|
|
1120
|
+
import_react_native9.Pressable,
|
|
1841
1121
|
{
|
|
1842
1122
|
key: index,
|
|
1843
1123
|
style: [
|
|
@@ -1849,8 +1129,8 @@ var DatePickerDialogMonthPicker = ({ viewDate, locale, themeColor, onSelectMonth
|
|
|
1849
1129
|
accessibilityRole: "button",
|
|
1850
1130
|
accessibilityState: { selected: isCurrentMonth }
|
|
1851
1131
|
},
|
|
1852
|
-
/* @__PURE__ */
|
|
1853
|
-
|
|
1132
|
+
/* @__PURE__ */ import_react11.default.createElement(
|
|
1133
|
+
import_react_native9.Text,
|
|
1854
1134
|
{
|
|
1855
1135
|
style: [
|
|
1856
1136
|
styles2.monthText,
|
|
@@ -1869,38 +1149,35 @@ var DatePickerDialogMonthPicker = ({ viewDate, locale, themeColor, onSelectMonth
|
|
|
1869
1149
|
};
|
|
1870
1150
|
|
|
1871
1151
|
// src/components/dialogs/datepicker-dialog/datepicker-dialog-year-picker.tsx
|
|
1872
|
-
var
|
|
1873
|
-
var
|
|
1152
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
1153
|
+
var import_react_native10 = require("react-native");
|
|
1874
1154
|
var ITEM_HEIGHT = 48;
|
|
1875
1155
|
var NUM_COLUMNS = 4;
|
|
1876
1156
|
var DatePickerDialogYearPicker = ({ viewDate, themeColor, minDate, maxDate, onSelectYear }) => {
|
|
1877
|
-
const listRef = (0,
|
|
1878
|
-
const groupAnim = (0,
|
|
1157
|
+
const listRef = (0, import_react12.useRef)(null);
|
|
1158
|
+
const groupAnim = (0, import_react12.useRef)(new import_react_native10.Animated.Value(0)).current;
|
|
1879
1159
|
const theme = useXUITheme();
|
|
1880
1160
|
const colorScheme = theme.colors[themeColor] ?? theme.colors.primary;
|
|
1881
1161
|
const isDefault = themeColor === "default";
|
|
1882
1162
|
const accentColor = isDefault ? theme.colors.foreground : colorScheme.main;
|
|
1883
1163
|
const accentFg = isDefault ? theme.colors.background : colorScheme.foreground;
|
|
1884
|
-
const years = (0,
|
|
1885
|
-
() => getYearRange(minDate, maxDate),
|
|
1886
|
-
[minDate, maxDate]
|
|
1887
|
-
);
|
|
1164
|
+
const years = (0, import_react12.useMemo)(() => getYearRange(minDate, maxDate), [minDate, maxDate]);
|
|
1888
1165
|
const currentYear = viewDate.getFullYear();
|
|
1889
|
-
const initialIndex = (0,
|
|
1166
|
+
const initialIndex = (0, import_react12.useMemo)(() => {
|
|
1890
1167
|
const index = years.indexOf(currentYear);
|
|
1891
1168
|
const rowIndex = Math.floor(index / NUM_COLUMNS);
|
|
1892
1169
|
return Math.max(0, rowIndex);
|
|
1893
1170
|
}, [years, currentYear]);
|
|
1894
|
-
(0,
|
|
1171
|
+
(0, import_react12.useEffect)(() => {
|
|
1895
1172
|
groupAnim.setValue(0);
|
|
1896
|
-
|
|
1173
|
+
import_react_native10.Animated.timing(groupAnim, {
|
|
1897
1174
|
toValue: 1,
|
|
1898
1175
|
duration: 220,
|
|
1899
|
-
easing:
|
|
1176
|
+
easing: import_react_native10.Easing.out(import_react_native10.Easing.cubic),
|
|
1900
1177
|
useNativeDriver: true
|
|
1901
1178
|
}).start();
|
|
1902
1179
|
}, [groupAnim]);
|
|
1903
|
-
const getItemLayout = (0,
|
|
1180
|
+
const getItemLayout = (0, import_react12.useCallback)(
|
|
1904
1181
|
(_, index) => ({
|
|
1905
1182
|
length: ITEM_HEIGHT,
|
|
1906
1183
|
offset: ITEM_HEIGHT * index,
|
|
@@ -1908,11 +1185,11 @@ var DatePickerDialogYearPicker = ({ viewDate, themeColor, minDate, maxDate, onSe
|
|
|
1908
1185
|
}),
|
|
1909
1186
|
[]
|
|
1910
1187
|
);
|
|
1911
|
-
const renderYear = (0,
|
|
1188
|
+
const renderYear = (0, import_react12.useCallback)(
|
|
1912
1189
|
({ item }) => {
|
|
1913
1190
|
const isCurrentYear = item === currentYear;
|
|
1914
|
-
return /* @__PURE__ */
|
|
1915
|
-
|
|
1191
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
1192
|
+
import_react_native10.Pressable,
|
|
1916
1193
|
{
|
|
1917
1194
|
style: [
|
|
1918
1195
|
styles2.yearCell,
|
|
@@ -1923,8 +1200,8 @@ var DatePickerDialogYearPicker = ({ viewDate, themeColor, minDate, maxDate, onSe
|
|
|
1923
1200
|
accessibilityRole: "button",
|
|
1924
1201
|
accessibilityState: { selected: isCurrentYear }
|
|
1925
1202
|
},
|
|
1926
|
-
/* @__PURE__ */
|
|
1927
|
-
|
|
1203
|
+
/* @__PURE__ */ import_react12.default.createElement(
|
|
1204
|
+
import_react_native10.Text,
|
|
1928
1205
|
{
|
|
1929
1206
|
style: [
|
|
1930
1207
|
styles2.yearText,
|
|
@@ -1941,8 +1218,8 @@ var DatePickerDialogYearPicker = ({ viewDate, themeColor, minDate, maxDate, onSe
|
|
|
1941
1218
|
},
|
|
1942
1219
|
[currentYear, onSelectYear, accentColor, accentFg, theme.colors.foreground]
|
|
1943
1220
|
);
|
|
1944
|
-
return /* @__PURE__ */
|
|
1945
|
-
|
|
1221
|
+
return /* @__PURE__ */ import_react12.default.createElement(import_react_native10.View, { style: styles2.yearPickerContainer }, /* @__PURE__ */ import_react12.default.createElement(
|
|
1222
|
+
import_react_native10.Animated.View,
|
|
1946
1223
|
{
|
|
1947
1224
|
style: {
|
|
1948
1225
|
opacity: groupAnim,
|
|
@@ -1956,8 +1233,8 @@ var DatePickerDialogYearPicker = ({ viewDate, themeColor, minDate, maxDate, onSe
|
|
|
1956
1233
|
]
|
|
1957
1234
|
}
|
|
1958
1235
|
},
|
|
1959
|
-
/* @__PURE__ */
|
|
1960
|
-
|
|
1236
|
+
/* @__PURE__ */ import_react12.default.createElement(
|
|
1237
|
+
import_react_native10.FlatList,
|
|
1961
1238
|
{
|
|
1962
1239
|
ref: listRef,
|
|
1963
1240
|
data: years,
|
|
@@ -1990,13 +1267,13 @@ var DatePickerDialog = ({
|
|
|
1990
1267
|
onClose
|
|
1991
1268
|
}) => {
|
|
1992
1269
|
const theme = useXUITheme();
|
|
1993
|
-
const { width: screenWidth, height: screenHeight } = (0,
|
|
1994
|
-
const fadeAnim = (0,
|
|
1995
|
-
const slideAnim = (0,
|
|
1996
|
-
const scaleAnim = (0,
|
|
1997
|
-
const viewFadeAnim = (0,
|
|
1998
|
-
const monthSlideXAnim = (0,
|
|
1999
|
-
const monthFadeAnim = (0,
|
|
1270
|
+
const { width: screenWidth, height: screenHeight } = (0, import_react_native11.useWindowDimensions)();
|
|
1271
|
+
const fadeAnim = (0, import_react13.useRef)(new import_react_native11.Animated.Value(0)).current;
|
|
1272
|
+
const slideAnim = (0, import_react13.useRef)(new import_react_native11.Animated.Value(0)).current;
|
|
1273
|
+
const scaleAnim = (0, import_react13.useRef)(new import_react_native11.Animated.Value(0)).current;
|
|
1274
|
+
const viewFadeAnim = (0, import_react13.useRef)(new import_react_native11.Animated.Value(1)).current;
|
|
1275
|
+
const monthSlideXAnim = (0, import_react13.useRef)(new import_react_native11.Animated.Value(0)).current;
|
|
1276
|
+
const monthFadeAnim = (0, import_react13.useRef)(new import_react_native11.Animated.Value(1)).current;
|
|
2000
1277
|
const colorScheme = theme.colors[themeColor] ?? theme.colors.primary;
|
|
2001
1278
|
const isDefault = themeColor === "default";
|
|
2002
1279
|
const accentColor = isDefault ? theme.colors.foreground : colorScheme.main;
|
|
@@ -2014,7 +1291,7 @@ var DatePickerDialog = ({
|
|
|
2014
1291
|
toggleYearPicker,
|
|
2015
1292
|
syncViewToDate
|
|
2016
1293
|
} = useDatePickerViewState(selectedDate);
|
|
2017
|
-
const onCloseComplete = (0,
|
|
1294
|
+
const onCloseComplete = (0, import_react13.useCallback)(() => {
|
|
2018
1295
|
fadeAnim.setValue(0);
|
|
2019
1296
|
slideAnim.setValue(0);
|
|
2020
1297
|
scaleAnim.setValue(0);
|
|
@@ -2036,41 +1313,41 @@ var DatePickerDialog = ({
|
|
|
2036
1313
|
slideAnim: monthSlideXAnim,
|
|
2037
1314
|
fadeAnim: monthFadeAnim
|
|
2038
1315
|
});
|
|
2039
|
-
const prevViewModeRef = (0,
|
|
2040
|
-
(0,
|
|
1316
|
+
const prevViewModeRef = (0, import_react13.useRef)(viewMode);
|
|
1317
|
+
(0, import_react13.useEffect)(() => {
|
|
2041
1318
|
if (prevViewModeRef.current !== viewMode) {
|
|
2042
1319
|
prevViewModeRef.current = viewMode;
|
|
2043
1320
|
animateViewTransition();
|
|
2044
1321
|
}
|
|
2045
1322
|
}, [viewMode, animateViewTransition]);
|
|
2046
|
-
(0,
|
|
1323
|
+
(0, import_react13.useEffect)(() => {
|
|
2047
1324
|
if (visible && selectedDate) {
|
|
2048
1325
|
syncViewToDate(selectedDate);
|
|
2049
1326
|
}
|
|
2050
1327
|
}, [visible, selectedDate, syncViewToDate]);
|
|
2051
|
-
(0,
|
|
1328
|
+
(0, import_react13.useEffect)(() => {
|
|
2052
1329
|
if (!visible) return;
|
|
2053
|
-
const sub =
|
|
1330
|
+
const sub = import_react_native11.BackHandler.addEventListener("hardwareBackPress", () => {
|
|
2054
1331
|
onClose();
|
|
2055
1332
|
return true;
|
|
2056
1333
|
});
|
|
2057
1334
|
return () => sub.remove();
|
|
2058
1335
|
}, [visible, onClose]);
|
|
2059
|
-
const handlePreviousMonth = (0,
|
|
1336
|
+
const handlePreviousMonth = (0, import_react13.useCallback)(() => {
|
|
2060
1337
|
goToPreviousMonth();
|
|
2061
1338
|
animateMonthSlide("left");
|
|
2062
1339
|
}, [goToPreviousMonth, animateMonthSlide]);
|
|
2063
|
-
const handleNextMonth = (0,
|
|
1340
|
+
const handleNextMonth = (0, import_react13.useCallback)(() => {
|
|
2064
1341
|
goToNextMonth();
|
|
2065
1342
|
animateMonthSlide("right");
|
|
2066
1343
|
}, [goToNextMonth, animateMonthSlide]);
|
|
2067
|
-
const handleDaySelect = (0,
|
|
1344
|
+
const handleDaySelect = (0, import_react13.useCallback)(
|
|
2068
1345
|
(date) => {
|
|
2069
1346
|
onDateSelect(date);
|
|
2070
1347
|
},
|
|
2071
1348
|
[onDateSelect]
|
|
2072
1349
|
);
|
|
2073
|
-
const handleTodayPress = (0,
|
|
1350
|
+
const handleTodayPress = (0, import_react13.useCallback)(() => {
|
|
2074
1351
|
const today = /* @__PURE__ */ new Date();
|
|
2075
1352
|
if (!isDateInRange(today, minDate, maxDate)) return;
|
|
2076
1353
|
goToToday();
|
|
@@ -2119,7 +1396,7 @@ var DatePickerDialog = ({
|
|
|
2119
1396
|
const renderContent = () => {
|
|
2120
1397
|
switch (viewMode) {
|
|
2121
1398
|
case "year":
|
|
2122
|
-
return /* @__PURE__ */
|
|
1399
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
2123
1400
|
DatePickerDialogYearPicker,
|
|
2124
1401
|
{
|
|
2125
1402
|
viewDate,
|
|
@@ -2130,7 +1407,7 @@ var DatePickerDialog = ({
|
|
|
2130
1407
|
}
|
|
2131
1408
|
);
|
|
2132
1409
|
case "month":
|
|
2133
|
-
return /* @__PURE__ */
|
|
1410
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
2134
1411
|
DatePickerDialogMonthPicker,
|
|
2135
1412
|
{
|
|
2136
1413
|
viewDate,
|
|
@@ -2141,7 +1418,7 @@ var DatePickerDialog = ({
|
|
|
2141
1418
|
);
|
|
2142
1419
|
case "calendar":
|
|
2143
1420
|
default:
|
|
2144
|
-
return /* @__PURE__ */
|
|
1421
|
+
return /* @__PURE__ */ import_react13.default.createElement(import_react_native11.Animated.View, { style: [viewTransitionStyle, monthSlideStyle] }, /* @__PURE__ */ import_react13.default.createElement(
|
|
2145
1422
|
DatePickerDialogCalendar,
|
|
2146
1423
|
{
|
|
2147
1424
|
viewDate,
|
|
@@ -2158,23 +1435,23 @@ var DatePickerDialog = ({
|
|
|
2158
1435
|
));
|
|
2159
1436
|
}
|
|
2160
1437
|
};
|
|
2161
|
-
return /* @__PURE__ */
|
|
2162
|
-
|
|
1438
|
+
return /* @__PURE__ */ import_react13.default.createElement(Portal, null, /* @__PURE__ */ import_react13.default.createElement(import_react_native_gesture_handler2.GestureHandlerRootView, { style: [overlayStyle, style] }, /* @__PURE__ */ import_react13.default.createElement(import_react_native11.View, { style: overlayStyle }, /* @__PURE__ */ import_react13.default.createElement(import_react_native11.Animated.View, { style: [styles2.backdrop, { opacity: fadeAnim }] }, /* @__PURE__ */ import_react13.default.createElement(
|
|
1439
|
+
import_react_native11.Pressable,
|
|
2163
1440
|
{
|
|
2164
1441
|
style: { flex: 1 },
|
|
2165
1442
|
onPress: onClose,
|
|
2166
1443
|
accessibilityLabel: "Close calendar",
|
|
2167
1444
|
accessibilityRole: "button"
|
|
2168
1445
|
}
|
|
2169
|
-
)), /* @__PURE__ */
|
|
2170
|
-
|
|
1446
|
+
)), /* @__PURE__ */ import_react13.default.createElement(import_react_native11.Animated.View, { style: [styles2.dialogContainer, containerAnimatedStyle] }, /* @__PURE__ */ import_react13.default.createElement(
|
|
1447
|
+
import_react_native11.View,
|
|
2171
1448
|
{
|
|
2172
1449
|
style: [
|
|
2173
1450
|
styles2.container,
|
|
2174
1451
|
{ backgroundColor: theme.colors.background }
|
|
2175
1452
|
]
|
|
2176
1453
|
},
|
|
2177
|
-
/* @__PURE__ */
|
|
1454
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
2178
1455
|
DatePickerDialogHeader,
|
|
2179
1456
|
{
|
|
2180
1457
|
viewDate,
|
|
@@ -2189,31 +1466,33 @@ var DatePickerDialog = ({
|
|
|
2189
1466
|
}
|
|
2190
1467
|
),
|
|
2191
1468
|
renderContent(),
|
|
2192
|
-
/* @__PURE__ */
|
|
2193
|
-
|
|
1469
|
+
/* @__PURE__ */ import_react13.default.createElement(import_react_native11.View, { style: styles2.footer }, /* @__PURE__ */ import_react13.default.createElement(
|
|
1470
|
+
import_react_native11.Pressable,
|
|
2194
1471
|
{
|
|
2195
1472
|
style: styles2.footerButton,
|
|
2196
1473
|
onPress: handleTodayPress,
|
|
2197
1474
|
accessibilityLabel: resolvedTodayLabel,
|
|
2198
1475
|
accessibilityRole: "button"
|
|
2199
1476
|
},
|
|
2200
|
-
/* @__PURE__ */
|
|
2201
|
-
), /* @__PURE__ */
|
|
2202
|
-
|
|
1477
|
+
/* @__PURE__ */ import_react13.default.createElement(import_react_native11.Text, { style: [styles2.footerButtonText, { color: accentColor }] }, resolvedTodayLabel)
|
|
1478
|
+
), /* @__PURE__ */ import_react13.default.createElement(
|
|
1479
|
+
import_react_native11.Pressable,
|
|
2203
1480
|
{
|
|
2204
1481
|
style: styles2.footerButton,
|
|
2205
1482
|
onPress: onClose,
|
|
2206
1483
|
accessibilityLabel: resolvedConfirmLabel,
|
|
2207
1484
|
accessibilityRole: "button"
|
|
2208
1485
|
},
|
|
2209
|
-
/* @__PURE__ */
|
|
1486
|
+
/* @__PURE__ */ import_react13.default.createElement(import_react_native11.Text, { style: [styles2.footerButtonText, { color: accentColor }] }, resolvedConfirmLabel)
|
|
2210
1487
|
))
|
|
2211
1488
|
)))));
|
|
2212
1489
|
};
|
|
2213
1490
|
|
|
2214
1491
|
// src/components/datepicker/datepicker-trigger.tsx
|
|
2215
|
-
var
|
|
2216
|
-
var
|
|
1492
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
1493
|
+
var import_react_native12 = require("react-native");
|
|
1494
|
+
var import_calendar = require("@xaui/icons/calendar");
|
|
1495
|
+
var import_close2 = require("@xaui/icons/close");
|
|
2217
1496
|
var DatePickerTrigger = ({
|
|
2218
1497
|
triggerRef,
|
|
2219
1498
|
isDisabled,
|
|
@@ -2235,8 +1514,8 @@ var DatePickerTrigger = ({
|
|
|
2235
1514
|
onLayout: handleTriggerLayout
|
|
2236
1515
|
}) => {
|
|
2237
1516
|
const renderLabel = isLabelInside && label;
|
|
2238
|
-
return /* @__PURE__ */
|
|
2239
|
-
|
|
1517
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
1518
|
+
import_react_native12.Pressable,
|
|
2240
1519
|
{
|
|
2241
1520
|
ref: triggerRef,
|
|
2242
1521
|
onPress: handleTriggerPress,
|
|
@@ -2258,8 +1537,8 @@ var DatePickerTrigger = ({
|
|
|
2258
1537
|
accessibilityRole: "button",
|
|
2259
1538
|
accessibilityState: { disabled: isDisabled }
|
|
2260
1539
|
},
|
|
2261
|
-
/* @__PURE__ */
|
|
2262
|
-
|
|
1540
|
+
/* @__PURE__ */ import_react14.default.createElement(import_react_native12.View, { style: styles.triggerContent }, isLabelInside && renderLabel, /* @__PURE__ */ import_react14.default.createElement(
|
|
1541
|
+
import_react_native12.Text,
|
|
2263
1542
|
{
|
|
2264
1543
|
style: [
|
|
2265
1544
|
styles.triggerText,
|
|
@@ -2272,15 +1551,15 @@ var DatePickerTrigger = ({
|
|
|
2272
1551
|
},
|
|
2273
1552
|
displayValue
|
|
2274
1553
|
)),
|
|
2275
|
-
isClearable && hasValue ? /* @__PURE__ */
|
|
2276
|
-
|
|
1554
|
+
isClearable && hasValue ? /* @__PURE__ */ import_react14.default.createElement(
|
|
1555
|
+
import_react_native12.TouchableOpacity,
|
|
2277
1556
|
{
|
|
2278
1557
|
onPress: handleClear,
|
|
2279
1558
|
style: styles.clearButton,
|
|
2280
1559
|
hitSlop: { top: 8, right: 8, bottom: 8, left: 8 }
|
|
2281
1560
|
},
|
|
2282
|
-
/* @__PURE__ */
|
|
2283
|
-
) : calendarIcon ?? /* @__PURE__ */
|
|
1561
|
+
/* @__PURE__ */ import_react14.default.createElement(import_close2.CloseIcon, { color: theme.colors.foreground, size: 20 })
|
|
1562
|
+
) : calendarIcon ?? /* @__PURE__ */ import_react14.default.createElement(import_calendar.CalendarIcon, { color: theme.colors.foreground, size: 20 })
|
|
2284
1563
|
);
|
|
2285
1564
|
};
|
|
2286
1565
|
|
|
@@ -2325,10 +1604,10 @@ var DatePicker = ({
|
|
|
2325
1604
|
onOpen,
|
|
2326
1605
|
onClose
|
|
2327
1606
|
});
|
|
2328
|
-
const triggerRef = (0,
|
|
2329
|
-
const handleTriggerLayout = (0,
|
|
1607
|
+
const triggerRef = (0, import_react15.useRef)(null);
|
|
1608
|
+
const handleTriggerLayout = (0, import_react15.useCallback)(() => {
|
|
2330
1609
|
}, []);
|
|
2331
|
-
const firstDayOfWeek = (0,
|
|
1610
|
+
const firstDayOfWeek = (0, import_react15.useMemo)(
|
|
2332
1611
|
() => firstDayOfWeekProp ?? getFirstDayOfWeek(locale),
|
|
2333
1612
|
[firstDayOfWeekProp, locale]
|
|
2334
1613
|
);
|
|
@@ -2341,35 +1620,35 @@ var DatePicker = ({
|
|
|
2341
1620
|
sizeStyles.labelSize
|
|
2342
1621
|
);
|
|
2343
1622
|
const helperColor = useDatePickerHelperColor(isInvalid);
|
|
2344
|
-
const displayValue = (0,
|
|
1623
|
+
const displayValue = (0, import_react15.useMemo)(() => {
|
|
2345
1624
|
if (!selectedDate) return placeholder;
|
|
2346
1625
|
return formatDate(selectedDate, locale);
|
|
2347
1626
|
}, [selectedDate, locale, placeholder]);
|
|
2348
|
-
const handleTriggerPress = (0,
|
|
1627
|
+
const handleTriggerPress = (0, import_react15.useCallback)(() => {
|
|
2349
1628
|
if (!isDisabled && !isReadOnly) {
|
|
2350
1629
|
setOpen(true);
|
|
2351
1630
|
}
|
|
2352
1631
|
}, [isDisabled, isReadOnly, setOpen]);
|
|
2353
|
-
const handleClear = (0,
|
|
1632
|
+
const handleClear = (0, import_react15.useCallback)(() => {
|
|
2354
1633
|
if (isDisabled || isReadOnly) return;
|
|
2355
1634
|
updateDate(null);
|
|
2356
1635
|
}, [isDisabled, isReadOnly, updateDate]);
|
|
2357
|
-
const handleDateSelect = (0,
|
|
1636
|
+
const handleDateSelect = (0, import_react15.useCallback)(
|
|
2358
1637
|
(date) => {
|
|
2359
1638
|
updateDate(date);
|
|
2360
1639
|
},
|
|
2361
1640
|
[updateDate]
|
|
2362
1641
|
);
|
|
2363
|
-
const handleClose = (0,
|
|
1642
|
+
const handleClose = (0, import_react15.useCallback)(() => {
|
|
2364
1643
|
setOpen(false);
|
|
2365
1644
|
}, [setOpen]);
|
|
2366
1645
|
const isLabelInside = labelPlacement === "inside";
|
|
2367
1646
|
const isLabelOutsideLeft = labelPlacement === "outside-left";
|
|
2368
1647
|
const isLabelOutside = labelPlacement === "outside" || labelPlacement === "outside-top";
|
|
2369
|
-
const renderLabel = label ? typeof label === "string" || typeof label === "number" ? /* @__PURE__ */
|
|
1648
|
+
const renderLabel = label ? typeof label === "string" || typeof label === "number" ? /* @__PURE__ */ import_react15.default.createElement(import_react_native13.Text, { style: [styles.label, labelStyle] }, label) : /* @__PURE__ */ import_react15.default.createElement(import_react_native13.View, null, label) : null;
|
|
2370
1649
|
const shouldShowHelper = Boolean(description || errorMessage);
|
|
2371
1650
|
const helperContent = isInvalid && errorMessage ? errorMessage : description;
|
|
2372
|
-
const triggerContent = /* @__PURE__ */
|
|
1651
|
+
const triggerContent = /* @__PURE__ */ import_react15.default.createElement(
|
|
2373
1652
|
DatePickerTrigger,
|
|
2374
1653
|
{
|
|
2375
1654
|
triggerRef,
|
|
@@ -2393,8 +1672,8 @@ var DatePicker = ({
|
|
|
2393
1672
|
}
|
|
2394
1673
|
);
|
|
2395
1674
|
const labelBlock = isLabelOutside || isLabelInside ? renderLabel : null;
|
|
2396
|
-
return /* @__PURE__ */
|
|
2397
|
-
|
|
1675
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
1676
|
+
import_react_native13.View,
|
|
2398
1677
|
{
|
|
2399
1678
|
style: [
|
|
2400
1679
|
styles.container,
|
|
@@ -2403,9 +1682,9 @@ var DatePicker = ({
|
|
|
2403
1682
|
]
|
|
2404
1683
|
},
|
|
2405
1684
|
isLabelOutside && labelBlock,
|
|
2406
|
-
isLabelOutsideLeft ? /* @__PURE__ */
|
|
2407
|
-
shouldShowHelper && helperContent ? typeof helperContent === "string" || typeof helperContent === "number" ? /* @__PURE__ */
|
|
2408
|
-
/* @__PURE__ */
|
|
1685
|
+
isLabelOutsideLeft ? /* @__PURE__ */ import_react15.default.createElement(import_react_native13.View, { style: styles.outsideLeftRow }, renderLabel, triggerContent) : triggerContent,
|
|
1686
|
+
shouldShowHelper && helperContent ? typeof helperContent === "string" || typeof helperContent === "number" ? /* @__PURE__ */ import_react15.default.createElement(import_react_native13.Text, { style: [styles.helperText, { color: helperColor }] }, helperContent) : /* @__PURE__ */ import_react15.default.createElement(import_react_native13.View, null, helperContent) : null,
|
|
1687
|
+
/* @__PURE__ */ import_react15.default.createElement(
|
|
2409
1688
|
DatePickerDialog,
|
|
2410
1689
|
{
|
|
2411
1690
|
visible: isOpen,
|