@hoddy-ui/next 2.0.59 → 2.0.60
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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +68 -45
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +68 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -389,6 +389,7 @@ var UIThemeContext = createContext({
|
|
|
389
389
|
themeState: { mode: "default", value: "light" }
|
|
390
390
|
});
|
|
391
391
|
function themeReducer(state, { type, payload }) {
|
|
392
|
+
AsyncStorage.setItem("theme", type);
|
|
392
393
|
switch (type) {
|
|
393
394
|
case "dark":
|
|
394
395
|
return { mode: "dark", value: "dark" };
|
|
@@ -407,12 +408,20 @@ var ConfigureSystemUI = () => {
|
|
|
407
408
|
const config2 = getConfig();
|
|
408
409
|
if (colors2) {
|
|
409
410
|
SystemUI.setBackgroundColorAsync(colors2.white[1]);
|
|
410
|
-
if (Platform.OS === "android"
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
411
|
+
if (Platform.OS === "android") {
|
|
412
|
+
if (config2.EDGE_TO_EDGE) {
|
|
413
|
+
if (theme === "dark") {
|
|
414
|
+
NavigationBar.setStyle("light");
|
|
415
|
+
} else {
|
|
416
|
+
NavigationBar.setStyle("dark");
|
|
417
|
+
}
|
|
414
418
|
} else {
|
|
415
|
-
NavigationBar.
|
|
419
|
+
NavigationBar.setBackgroundColorAsync(colors2.white[1]);
|
|
420
|
+
if (theme === "dark") {
|
|
421
|
+
NavigationBar.setButtonStyleAsync("light");
|
|
422
|
+
} else {
|
|
423
|
+
NavigationBar.setButtonStyleAsync("dark");
|
|
424
|
+
}
|
|
416
425
|
}
|
|
417
426
|
}
|
|
418
427
|
}
|
|
@@ -460,7 +469,6 @@ var UIThemeProvider = ({ children }) => {
|
|
|
460
469
|
};
|
|
461
470
|
|
|
462
471
|
// ../src/hooks.ts
|
|
463
|
-
import AsyncStorage2 from "@react-native-async-storage/async-storage";
|
|
464
472
|
var useColors = () => {
|
|
465
473
|
const { themeState } = useContext(UIThemeContext);
|
|
466
474
|
return colors(themeState.value);
|
|
@@ -475,10 +483,8 @@ var useThemeContext = () => {
|
|
|
475
483
|
const setTheme = (theme2) => {
|
|
476
484
|
if (theme2 === "default") {
|
|
477
485
|
themeDispatch?.({ type: "default", payload: colorScheme });
|
|
478
|
-
AsyncStorage2.setItem("theme", "default");
|
|
479
486
|
} else {
|
|
480
487
|
themeDispatch?.({ type: theme2 });
|
|
481
|
-
AsyncStorage2.setItem("theme", theme2);
|
|
482
488
|
}
|
|
483
489
|
};
|
|
484
490
|
return { theme, setTheme };
|
|
@@ -932,7 +938,8 @@ var Popup = ({
|
|
|
932
938
|
},
|
|
933
939
|
style,
|
|
934
940
|
onModalShow,
|
|
935
|
-
onModalHide
|
|
941
|
+
onModalHide,
|
|
942
|
+
disableAutoKeyboardManagement = false
|
|
936
943
|
}) => {
|
|
937
944
|
const theme = useTheme();
|
|
938
945
|
const colors2 = useColors();
|
|
@@ -1060,27 +1067,34 @@ var Popup = ({
|
|
|
1060
1067
|
behavior: Platform5.OS === "ios" ? "padding" : "height",
|
|
1061
1068
|
keyboardVerticalOffset: keyboardVerticalOffset || keyboardVerticalOffsetValue
|
|
1062
1069
|
},
|
|
1063
|
-
/* @__PURE__ */ React11.createElement(
|
|
1064
|
-
|
|
1070
|
+
/* @__PURE__ */ React11.createElement(
|
|
1071
|
+
TouchableWithoutFeedback2,
|
|
1065
1072
|
{
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
}
|
|
1069
|
-
), /* @__PURE__ */ React11.createElement(
|
|
1070
|
-
Animated2.View,
|
|
1071
|
-
{
|
|
1072
|
-
style: [styles.avoidingView, contentAnimatedStyle],
|
|
1073
|
-
layout: modalVisible ? LinearTransition.springify().stiffness(200).mass(0.5).damping(100) : void 0
|
|
1073
|
+
onPress: Keyboard2.dismiss,
|
|
1074
|
+
disabled: disableAutoKeyboardManagement
|
|
1074
1075
|
},
|
|
1075
|
-
/* @__PURE__ */ React11.createElement(View5, { style: styles.
|
|
1076
|
-
|
|
1076
|
+
/* @__PURE__ */ React11.createElement(View5, { style: styles.root }, modalOpen && /* @__PURE__ */ React11.createElement(
|
|
1077
|
+
Pressable,
|
|
1077
1078
|
{
|
|
1078
|
-
|
|
1079
|
-
icon: "close",
|
|
1079
|
+
style: [StyleSheet2.absoluteFill, { zIndex: 1 }],
|
|
1080
1080
|
onPress: closeAction
|
|
1081
1081
|
}
|
|
1082
|
-
)
|
|
1083
|
-
|
|
1082
|
+
), /* @__PURE__ */ React11.createElement(
|
|
1083
|
+
Animated2.View,
|
|
1084
|
+
{
|
|
1085
|
+
style: [styles.avoidingView, contentAnimatedStyle],
|
|
1086
|
+
layout: modalVisible ? LinearTransition.springify().stiffness(200).mass(0.5).damping(100) : void 0
|
|
1087
|
+
},
|
|
1088
|
+
/* @__PURE__ */ React11.createElement(View5, { style: styles.container }, !bare && /* @__PURE__ */ React11.createElement(View5, { style: styles.title }, /* @__PURE__ */ React11.createElement(View5, { style: styles.titleIcon }, /* @__PURE__ */ React11.createElement(
|
|
1089
|
+
IconButton,
|
|
1090
|
+
{
|
|
1091
|
+
size: 20,
|
|
1092
|
+
icon: "close",
|
|
1093
|
+
onPress: closeAction
|
|
1094
|
+
}
|
|
1095
|
+
)), /* @__PURE__ */ React11.createElement(Typography_default, { align: "center", fontWeight: 500 }, title)), /* @__PURE__ */ React11.createElement(View5, { style: styles.content }, children))
|
|
1096
|
+
))
|
|
1097
|
+
)
|
|
1084
1098
|
))
|
|
1085
1099
|
);
|
|
1086
1100
|
};
|
|
@@ -1395,27 +1409,36 @@ var SelectMenu = ({
|
|
|
1395
1409
|
),
|
|
1396
1410
|
[value, colors2]
|
|
1397
1411
|
);
|
|
1398
|
-
return /* @__PURE__ */ React14.createElement(
|
|
1399
|
-
|
|
1400
|
-
{
|
|
1401
|
-
label: searchPlaceholder,
|
|
1402
|
-
value: search,
|
|
1403
|
-
type: "search",
|
|
1404
|
-
onChangeText: setSearch,
|
|
1405
|
-
variant: "outlined"
|
|
1406
|
-
}
|
|
1407
|
-
)), /* @__PURE__ */ React14.createElement(
|
|
1408
|
-
FlatList,
|
|
1412
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1413
|
+
Popup,
|
|
1409
1414
|
{
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1415
|
+
open,
|
|
1416
|
+
onClose,
|
|
1417
|
+
title: label,
|
|
1418
|
+
disableAutoKeyboardManagement: true
|
|
1419
|
+
},
|
|
1420
|
+
/* @__PURE__ */ React14.createElement(View9, { style: styles.content }, /* @__PURE__ */ React14.createElement(View9, { style: styles.header }, helperText && /* @__PURE__ */ React14.createElement(Typography_default, { variant: "body2", color: "textSecondary", gutterBottom: 5 }, helperText), searchEnabled && /* @__PURE__ */ React14.createElement(
|
|
1421
|
+
TextField_default,
|
|
1422
|
+
{
|
|
1423
|
+
label: searchPlaceholder,
|
|
1424
|
+
value: search,
|
|
1425
|
+
type: "search",
|
|
1426
|
+
onChangeText: setSearch,
|
|
1427
|
+
variant: "outlined"
|
|
1428
|
+
}
|
|
1429
|
+
)), /* @__PURE__ */ React14.createElement(
|
|
1430
|
+
FlatList,
|
|
1431
|
+
{
|
|
1432
|
+
removeClippedSubviews: true,
|
|
1433
|
+
keyExtractor: (item) => item.value,
|
|
1434
|
+
bounces: false,
|
|
1435
|
+
renderItem,
|
|
1436
|
+
data: options.filter(
|
|
1437
|
+
(item) => search.length > 1 ? item.label.toLowerCase().indexOf(search.toLowerCase()) > -1 : item
|
|
1438
|
+
).sort((a, b) => a.label.localeCompare(b.label))
|
|
1439
|
+
}
|
|
1440
|
+
))
|
|
1441
|
+
);
|
|
1419
1442
|
};
|
|
1420
1443
|
var SelectMenu_default = SelectMenu;
|
|
1421
1444
|
|