@vellira-ui/react-native 2.44.0 → 2.44.2

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.
Files changed (2) hide show
  1. package/dist/index.js +28 -23
  2. 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: "0 -4px 16px rgba(0, 0, 0, 0.24)" },
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: "#000000",
592
+ shadowColor: theme.tokens.shadows.lg.color,
593
593
  shadowOffset: {
594
- width: 0,
595
- height: -4
594
+ width: theme.tokens.shadows.lg.x,
595
+ height: -theme.tokens.shadows.lg.y
596
596
  },
597
- shadowOpacity: .24,
598
- shadowRadius: 16,
599
- elevation: 12
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, color = "primary", icon, danger = false, disabled = false, textWrap = "truncate", itemStyle, textStyle, onSelect }) {
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 colorPalette = theme.components.dropdown[color];
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 ? colorPalette.item.pressed.fg : theme.components.dropdown.item.default.fg;
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 ? colorPalette.item.pressed.bg : theme.components.dropdown.item.default.bg;
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, noOptionsText, size = "md", style, triggerStyle, contentStyle, itemStyle, textStyle, accessibilityLabel, accessibilityHint }) {
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 ?? noOptionsText ?? "No actions found" }
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;
@@ -3912,15 +3915,16 @@ const TabsIndicator = ({ children, style }) => {
3912
3915
  borderRadius: theme.tokens.radius.lg,
3913
3916
  borderWidth: 1,
3914
3917
  ...Platform.select({
3915
- web: { boxShadow: "0 1px 2px rgba(24, 21, 33, 0.06)" },
3918
+ web: { boxShadow: `${theme.tokens.shadows.sm.x}px ${theme.tokens.shadows.sm.y}px ${theme.tokens.shadows.sm.blur}px ${theme.tokens.shadows.sm.color}` },
3916
3919
  default: {
3917
- shadowColor: "#181521",
3920
+ shadowColor: theme.tokens.shadows.sm.color,
3918
3921
  shadowOffset: {
3919
- width: 0,
3920
- height: 1
3922
+ width: theme.tokens.shadows.sm.x,
3923
+ height: theme.tokens.shadows.sm.y
3921
3924
  },
3922
- shadowOpacity: .06,
3923
- shadowRadius: 2
3925
+ shadowOpacity: theme.tokens.shadows.sm.opacity,
3926
+ shadowRadius: theme.tokens.shadows.sm.blur,
3927
+ elevation: theme.tokens.shadows.sm.elevation
3924
3928
  }
3925
3929
  }),
3926
3930
  transform: [{ translateX }, { translateY }]
@@ -3938,6 +3942,7 @@ const TabsIndicator = ({ children, style }) => {
3938
3942
  size,
3939
3943
  style,
3940
3944
  theme.tokens.radius,
3945
+ theme.tokens.shadows.sm,
3941
3946
  translateX,
3942
3947
  translateY,
3943
3948
  variant,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellira-ui/react-native",
3
- "version": "2.44.0",
3
+ "version": "2.44.2",
4
4
  "description": "React Native components for Vellira Design System",
5
5
  "author": "Roman Bakurov",
6
6
  "license": "MIT",