@vellira-ui/react-native 2.44.0 → 2.44.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/index.js +20 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -587,16 +587,16 @@ const createStyles$21 = (theme) => StyleSheet.create({
|
|
|
587
587
|
borderTopRightRadius: theme.tokens.radius.lg,
|
|
588
588
|
borderWidth: 1,
|
|
589
589
|
...Platform.select({
|
|
590
|
-
web: { boxShadow:
|
|
590
|
+
web: { boxShadow: `${theme.tokens.shadows.lg.x}px ${-theme.tokens.shadows.lg.y}px ${theme.tokens.shadows.lg.blur}px ${theme.tokens.shadows.lg.color}` },
|
|
591
591
|
default: {
|
|
592
|
-
shadowColor:
|
|
592
|
+
shadowColor: theme.tokens.shadows.lg.color,
|
|
593
593
|
shadowOffset: {
|
|
594
|
-
width:
|
|
595
|
-
height: -
|
|
594
|
+
width: theme.tokens.shadows.lg.x,
|
|
595
|
+
height: -theme.tokens.shadows.lg.y
|
|
596
596
|
},
|
|
597
|
-
shadowOpacity: .
|
|
598
|
-
shadowRadius:
|
|
599
|
-
elevation:
|
|
597
|
+
shadowOpacity: theme.tokens.shadows.lg.opacity,
|
|
598
|
+
shadowRadius: theme.tokens.shadows.lg.blur,
|
|
599
|
+
elevation: theme.tokens.shadows.lg.elevation
|
|
600
600
|
}
|
|
601
601
|
})
|
|
602
602
|
},
|
|
@@ -905,23 +905,26 @@ const createStyles$19 = (theme) => StyleSheet.create({
|
|
|
905
905
|
});
|
|
906
906
|
//#endregion
|
|
907
907
|
//#region src/components/Dropdown/Item/DropdownItem.tsx
|
|
908
|
-
function DropdownItem({ label, value,
|
|
908
|
+
function DropdownItem({ label, value, rootColor = "primary", color = "default", icon, disabled = false, textWrap = "truncate", itemStyle, textStyle, onSelect }) {
|
|
909
909
|
const { theme } = useTheme();
|
|
910
910
|
const styles = useThemeStyles(createStyles$19);
|
|
911
|
-
const
|
|
911
|
+
const rootColorPalette = theme.components.dropdown[rootColor];
|
|
912
|
+
const itemColorPalette = color === "default" ? void 0 : theme.components.dropdown[color];
|
|
912
913
|
const renderColoredNode = (node, color) => {
|
|
913
914
|
if (!isValidElement(node)) return node;
|
|
914
915
|
return cloneElement(node, { color });
|
|
915
916
|
};
|
|
916
917
|
const getContentColor = (pressed) => {
|
|
917
918
|
if (disabled) return theme.components.dropdown.item.disabled.fg;
|
|
918
|
-
if (danger) return pressed ? theme.components.dropdown.item.danger.active.fg : theme.components.dropdown.item.danger.default.fg;
|
|
919
|
-
return pressed ?
|
|
919
|
+
if (color === "danger") return pressed ? theme.components.dropdown.item.danger.active.fg : theme.components.dropdown.item.danger.default.fg;
|
|
920
|
+
if (itemColorPalette) return pressed ? itemColorPalette.item.pressed.fg : itemColorPalette.item.fg;
|
|
921
|
+
return pressed ? rootColorPalette.item.pressed.fg : theme.components.dropdown.item.default.fg;
|
|
920
922
|
};
|
|
921
923
|
const getBackgroundColor = (pressed) => {
|
|
922
924
|
if (disabled) return theme.components.dropdown.item.disabled.bg;
|
|
923
|
-
if (danger) return pressed ? theme.components.dropdown.item.danger.active.bg : theme.components.dropdown.item.danger.default.bg;
|
|
924
|
-
return pressed ?
|
|
925
|
+
if (color === "danger") return pressed ? theme.components.dropdown.item.danger.active.bg : theme.components.dropdown.item.danger.default.bg;
|
|
926
|
+
if (itemColorPalette) return pressed ? itemColorPalette.item.pressed.bg : theme.components.dropdown.item.default.bg;
|
|
927
|
+
return pressed ? rootColorPalette.item.pressed.bg : theme.components.dropdown.item.default.bg;
|
|
925
928
|
};
|
|
926
929
|
const accessibilityLabel = typeof label === "string" ? label : value;
|
|
927
930
|
const numberOfLines = textWrap === "wrap" ? void 0 : 1;
|
|
@@ -1193,7 +1196,7 @@ const createStyles$16 = (theme) => StyleSheet.create({
|
|
|
1193
1196
|
});
|
|
1194
1197
|
//#endregion
|
|
1195
1198
|
//#region src/components/Dropdown/Dropdown.tsx
|
|
1196
|
-
function DropdownRoot({ children, label = "Menu", trigger, icon, arrowIcon, showArrow = true, open, defaultOpen = false, onOpenChange, presentation = "auto", closeOnSelect = true, color = "primary", disabled = false, loading = false, loadingText = "Loading actions...", searchable = false, command = false, searchValue, defaultSearchValue = "", searchPlaceholder, onSearch, empty,
|
|
1199
|
+
function DropdownRoot({ children, label = "Menu", trigger, icon, arrowIcon, showArrow = true, open, defaultOpen = false, onOpenChange, presentation = "auto", closeOnSelect = true, color = "primary", disabled = false, loading = false, loadingText = "Loading actions...", searchable = false, command = false, searchValue, defaultSearchValue = "", searchPlaceholder, onSearch, empty, size = "md", style, triggerStyle, contentStyle, itemStyle, textStyle, accessibilityLabel, accessibilityHint }) {
|
|
1197
1200
|
const styles = useThemeStyles(createStyles$16);
|
|
1198
1201
|
const overlayId = useId();
|
|
1199
1202
|
const [uncontrolledSearchValue, setUncontrolledSearchValue] = useState(defaultSearchValue);
|
|
@@ -1285,9 +1288,9 @@ function DropdownRoot({ children, label = "Menu", trigger, icon, arrowIcon, show
|
|
|
1285
1288
|
return /* @__PURE__ */ jsx(DropdownItem, {
|
|
1286
1289
|
label: item.props.children,
|
|
1287
1290
|
value: item.props.value ?? item.id,
|
|
1288
|
-
color,
|
|
1291
|
+
rootColor: color,
|
|
1292
|
+
color: item.props.color,
|
|
1289
1293
|
icon: item.props.icon,
|
|
1290
|
-
danger: item.props.danger,
|
|
1291
1294
|
disabled: item.props.disabled,
|
|
1292
1295
|
textWrap: item.props.textWrap,
|
|
1293
1296
|
itemStyle,
|
|
@@ -1308,7 +1311,7 @@ function DropdownRoot({ children, label = "Menu", trigger, icon, arrowIcon, show
|
|
|
1308
1311
|
}] : isSearchable && filteredParsed.items.length === 0 ? [{
|
|
1309
1312
|
type: "empty",
|
|
1310
1313
|
id: "empty",
|
|
1311
|
-
props: { children: empty ??
|
|
1314
|
+
props: { children: empty ?? "No actions found" }
|
|
1312
1315
|
}] : filteredParsed.entries;
|
|
1313
1316
|
const contentStyleFromSlot = parsed.contentProps?.style;
|
|
1314
1317
|
const presentationFromSlot = parsed.contentProps?.presentation === "auto" ? void 0 : parsed.contentProps?.presentation;
|