@idealyst/components 1.2.8 → 1.2.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/components",
3
- "version": "1.2.8",
3
+ "version": "1.2.11",
4
4
  "description": "Shared component library for React and React Native",
5
5
  "documentation": "https://github.com/IdealystIO/idealyst-framework/tree/main/packages/components#readme",
6
6
  "readme": "README.md",
@@ -56,7 +56,7 @@
56
56
  "publish:npm": "npm publish"
57
57
  },
58
58
  "peerDependencies": {
59
- "@idealyst/theme": "^1.2.8",
59
+ "@idealyst/theme": "^1.2.11",
60
60
  "@mdi/js": ">=7.0.0",
61
61
  "@mdi/react": ">=1.0.0",
62
62
  "@react-native-vector-icons/common": ">=12.0.0",
@@ -106,7 +106,7 @@
106
106
  }
107
107
  },
108
108
  "devDependencies": {
109
- "@idealyst/theme": "^1.2.8",
109
+ "@idealyst/theme": "^1.2.11",
110
110
  "@idealyst/tooling": "^1.2.4",
111
111
  "@mdi/react": "^1.6.1",
112
112
  "@types/react": "^19.1.0",
@@ -1,7 +1,7 @@
1
1
  import React, { useState, forwardRef, useEffect, useMemo } from 'react';
2
2
  import { View, TouchableOpacity, LayoutChangeEvent } from 'react-native';
3
3
  import Animated, { useSharedValue, useAnimatedStyle, withTiming, Easing } from 'react-native-reanimated';
4
- import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
4
+ import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
5
5
  import { accordionStyles } from './Accordion.styles';
6
6
  import Text from '../Text';
7
7
  import type { AccordionProps, AccordionItem as AccordionItemType } from './types';
@@ -96,7 +96,7 @@ const AccordionItem: React.FC<AccordionItemProps> = ({
96
96
  </Text>
97
97
  </View>
98
98
  <Animated.View style={[iconStyle, animatedIconStyle]}>
99
- <MaterialCommunityIcons
99
+ <MaterialDesignIcons
100
100
  name="chevron-down"
101
101
  size={20}
102
102
  style={iconStyle}
@@ -1,6 +1,6 @@
1
1
  import React, { isValidElement, forwardRef, ComponentRef } from 'react';
2
2
  import { View, Text, TouchableOpacity } from 'react-native';
3
- import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
3
+ import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
4
4
  import { alertStyles } from './Alert.styles';
5
5
  import { isIconName } from '../Icon/icon-resolver';
6
6
  import type { AlertProps } from './types';
@@ -49,7 +49,7 @@ const Alert = forwardRef<ComponentRef<typeof View>, AlertProps>(({
49
49
 
50
50
  if (typeof displayIcon === 'string' && isIconName(displayIcon)) {
51
51
  return (
52
- <MaterialCommunityIcons
52
+ <MaterialDesignIcons
53
53
  name={displayIcon}
54
54
  size={20}
55
55
  style={iconContainerStyle}
@@ -110,7 +110,7 @@ const Alert = forwardRef<ComponentRef<typeof View>, AlertProps>(({
110
110
  accessibilityLabel="Dismiss alert"
111
111
  accessibilityRole="button"
112
112
  >
113
- <MaterialCommunityIcons
113
+ <MaterialDesignIcons
114
114
  name="close"
115
115
  size={16}
116
116
  style={closeIconStyle}
@@ -1,6 +1,6 @@
1
1
  import React, { isValidElement, forwardRef } from 'react';
2
2
  import { View, Text } from 'react-native';
3
- import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
3
+ import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
4
4
  import { BadgeProps } from './types';
5
5
  import { badgeStyles } from './Badge.styles';
6
6
  import { isIconName } from '../Icon/icon-resolver';
@@ -33,7 +33,7 @@ const Badge = forwardRef<View, BadgeProps>(({
33
33
 
34
34
  if (typeof icon === 'string' && isIconName(icon)) {
35
35
  return (
36
- <MaterialCommunityIcons
36
+ <MaterialDesignIcons
37
37
  name={icon}
38
38
  size={iconSize}
39
39
  color={textStyle.color}
@@ -1,6 +1,6 @@
1
1
  import React, { ComponentRef, forwardRef, isValidElement, useMemo } from 'react';
2
2
  import { ActivityIndicator, StyleSheet as RNStyleSheet, Text, TouchableOpacity, View } from 'react-native';
3
- import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
3
+ import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
4
4
  import Svg, { Defs, LinearGradient, Stop, Rect } from 'react-native-svg';
5
5
  import { buttonStyles } from './Button.styles';
6
6
  import { ButtonProps } from './types';
@@ -208,7 +208,7 @@ const Button = forwardRef<ComponentRef<typeof TouchableOpacity>, ButtonProps>((p
208
208
  {hasIcons ? (
209
209
  <View style={[iconContainerStyle, { opacity: contentOpacity }]}>
210
210
  {leftIcon && (
211
- <MaterialCommunityIcons
211
+ <MaterialDesignIcons
212
212
  name={leftIcon}
213
213
  size={iconSize}
214
214
  style={iconStyle}
@@ -218,7 +218,7 @@ const Button = forwardRef<ComponentRef<typeof TouchableOpacity>, ButtonProps>((p
218
218
  {buttonContent}
219
219
  </Text>
220
220
  {rightIcon && (
221
- <MaterialCommunityIcons
221
+ <MaterialDesignIcons
222
222
  name={rightIcon}
223
223
  size={iconSize}
224
224
  style={iconStyle}
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect, forwardRef, useMemo } from 'react';
2
2
  import { View, Text, Pressable } from 'react-native';
3
- import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
3
+ import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
4
4
  import { CheckboxProps } from './types';
5
5
  import { checkboxStyles } from './Checkbox.styles';
6
6
  import { getNativeSelectionAccessibilityProps } from '../utils/accessibility';
@@ -118,7 +118,7 @@ const Checkbox = forwardRef<View, CheckboxProps>(({
118
118
  >
119
119
  <View style={checkboxStyle}>
120
120
  {(internalChecked || indeterminate) && (
121
- <MaterialCommunityIcons
121
+ <MaterialDesignIcons
122
122
  name={indeterminate ? 'minus' : 'check'}
123
123
  size={14}
124
124
  color="#ffffff"
@@ -1,6 +1,6 @@
1
1
  import React, { isValidElement, forwardRef, ComponentRef } from 'react';
2
2
  import { Pressable, Text, View } from 'react-native';
3
- import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
3
+ import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
4
4
  import { chipStyles } from './Chip.styles';
5
5
  import { isIconName } from '../Icon/icon-resolver';
6
6
  import type { ChipProps } from './types';
@@ -59,7 +59,7 @@ const Chip = forwardRef<ComponentRef<typeof Pressable>, ChipProps>(({
59
59
  if (typeof icon === 'string' && isIconName(icon)) {
60
60
  return (
61
61
  <View style={iconStyle}>
62
- <MaterialCommunityIcons
62
+ <MaterialDesignIcons
63
63
  name={icon}
64
64
  size={iconSize}
65
65
  style={iconStyle}
@@ -89,7 +89,7 @@ const Chip = forwardRef<ComponentRef<typeof Pressable>, ChipProps>(({
89
89
  accessibilityLabel="Delete"
90
90
  accessibilityRole="button"
91
91
  >
92
- <MaterialCommunityIcons
92
+ <MaterialDesignIcons
93
93
  name="close"
94
94
  size={deleteIconSize}
95
95
  style={deleteIconStyle}
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, useMemo } from 'react';
2
- import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
2
+ import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
3
3
  import { IconProps } from './types';
4
4
  import { iconStyles } from './Icon.styles';
5
5
  import { useUnistyles } from 'react-native-unistyles';
@@ -28,7 +28,7 @@ const Icon = forwardRef<any, IconProps>(({
28
28
  const iconColor = iconStyle.color;
29
29
 
30
30
  return (
31
- <MaterialCommunityIcons
31
+ <MaterialDesignIcons
32
32
  ref={ref}
33
33
  nativeID={id}
34
34
  size={iconSize}
@@ -45,8 +45,8 @@ export const iconStyles = defineStyle('Icon', (theme: Theme) => ({
45
45
  }
46
46
  }
47
47
 
48
- // Get color - priority: intent > color > textColor > default
49
- // color takes precedence over textColor (as per design)
48
+ // Get color - priority: intent > color > textColor > default (textColor="primary")
49
+ // When no color prop is specified, defaults to theme's primary text color
50
50
  const iconColor = intent
51
51
  ? theme.intents[intent]?.primary
52
52
  : color
package/src/Icon/types.ts CHANGED
@@ -65,6 +65,9 @@ interface IconWithTextColor extends IconBaseProps {
65
65
  }
66
66
 
67
67
  /**
68
- * Icon component props - accepts either `color` (palette) or `textColor` (text colors), but not both
68
+ * Icon component props - accepts either `color` (palette) or `textColor` (text colors), but not both.
69
+ *
70
+ * Color priority: intent > color > textColor > default (textColor="primary")
71
+ * When no color prop is specified, the icon defaults to the theme's primary text color.
69
72
  */
70
73
  export type IconProps = IconWithColor | IconWithTextColor;
@@ -1,6 +1,6 @@
1
1
  import React, { useState, isValidElement, useMemo, useEffect, useRef, useCallback } from 'react';
2
2
  import { View, TextInput, TouchableOpacity, Platform, TextInputProps } from 'react-native';
3
- import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
3
+ import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
4
4
  import { useUnistyles } from 'react-native-unistyles';
5
5
  import { InputProps } from './types';
6
6
  import { inputStyles } from './Input.styles';
@@ -220,7 +220,7 @@ const Input = React.forwardRef<TextInput, InputProps>(({
220
220
 
221
221
  if (typeof leftIcon === 'string') {
222
222
  return (
223
- <MaterialCommunityIcons
223
+ <MaterialDesignIcons
224
224
  name={leftIcon}
225
225
  size={iconSize}
226
226
  color={iconColor}
@@ -239,7 +239,7 @@ const Input = React.forwardRef<TextInput, InputProps>(({
239
239
 
240
240
  if (typeof rightIcon === 'string') {
241
241
  return (
242
- <MaterialCommunityIcons
242
+ <MaterialDesignIcons
243
243
  name={rightIcon}
244
244
  size={iconSize}
245
245
  color={iconColor}
@@ -279,7 +279,7 @@ const Input = React.forwardRef<TextInput, InputProps>(({
279
279
  disabled={disabled}
280
280
  accessibilityLabel={isPasswordVisible ? 'Hide password' : 'Show password'}
281
281
  >
282
- <MaterialCommunityIcons
282
+ <MaterialDesignIcons
283
283
  name={isPasswordVisible ? 'eye-off' : 'eye'}
284
284
  size={iconSize}
285
285
  color={iconColor}
@@ -168,6 +168,8 @@ export const inputStyles = defineStyle('Input', (theme: Theme) => ({
168
168
  variants: {
169
169
  size: {
170
170
  marginLeft: theme.sizes.$input.iconMargin,
171
+ width: theme.sizes.$input.iconSize,
172
+ height: theme.sizes.$input.iconSize,
171
173
  },
172
174
  },
173
175
  _web: {
@@ -1,7 +1,7 @@
1
1
  import React, { isValidElement, forwardRef, ComponentRef, useMemo } from 'react';
2
2
  import { View, Pressable, Text } from 'react-native';
3
3
  import { useUnistyles } from 'react-native-unistyles';
4
- import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
4
+ import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
5
5
  import { getColorFromString, Intent, Theme, Color } from '@idealyst/theme';
6
6
  import { listStyles } from './List.styles';
7
7
  import type { ListItemProps } from './types';
@@ -87,7 +87,7 @@ const ListItem = forwardRef<ComponentRef<typeof View> | ComponentRef<typeof Pres
87
87
  if (typeof element === 'string') {
88
88
  const iconSize = styleKey === 'leading' ? leadingStyle.width : trailingIconStyle.width;
89
89
  return (
90
- <MaterialCommunityIcons
90
+ <MaterialDesignIcons
91
91
  name={element}
92
92
  size={iconSize}
93
93
  color={resolvedIconColor}
@@ -75,7 +75,6 @@ export const screenStyles = defineStyle('Screen', (theme: Theme) => ({
75
75
  _web: {
76
76
  display: 'flex',
77
77
  flexDirection: 'column',
78
- minHeight: '100%',
79
78
  boxSizing: 'border-box',
80
79
  },
81
80
  }),
@@ -10,7 +10,7 @@ import {
10
10
  Platform,
11
11
  Animated,
12
12
  } from 'react-native';
13
- import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
13
+ import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
14
14
  import { SelectProps, SelectOption } from './types';
15
15
  import { selectStyles } from './Select.styles';
16
16
  import { BoundedModalContent } from '../internal/BoundedModalContent.native';
@@ -180,7 +180,7 @@ const Select = forwardRef<View, SelectProps>(({
180
180
  const renderChevron = () => {
181
181
  return (
182
182
  <View style={chevronStyle}>
183
- <MaterialCommunityIcons
183
+ <MaterialDesignIcons
184
184
  name="chevron-down"
185
185
  style={chevronStyle}
186
186
  />
@@ -195,7 +195,7 @@ const Select = forwardRef<View, SelectProps>(({
195
195
  if (typeof icon === 'string') {
196
196
  return (
197
197
  <View style={iconStyle}>
198
- <MaterialCommunityIcons
198
+ <MaterialDesignIcons
199
199
  style={iconStyle}
200
200
  name={icon}
201
201
  />
@@ -214,7 +214,7 @@ const Select = forwardRef<View, SelectProps>(({
214
214
  if (typeof icon === 'string') {
215
215
  return (
216
216
  <View style={optionIconStyle}>
217
- <MaterialCommunityIcons
217
+ <MaterialDesignIcons
218
218
  style={optionIconStyle}
219
219
  name={icon}
220
220
  />
@@ -2,7 +2,7 @@ import React, { useState, useCallback, forwardRef, useMemo } from 'react';
2
2
  import { View } from 'react-native';
3
3
  import { GestureDetector, Gesture } from 'react-native-gesture-handler';
4
4
  import Animated, { useSharedValue, useAnimatedStyle, runOnJS, withSpring } from 'react-native-reanimated';
5
- import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
5
+ import MaterialDesignIcons from '@react-native-vector-icons/material-design-icons';
6
6
  import { sliderStyles } from './Slider.styles';
7
7
  import Text from '../Text';
8
8
  import type { SliderProps } from './types';
@@ -195,7 +195,7 @@ const Slider = forwardRef<View, SliderProps>(({
195
195
  if (typeof icon === 'string' && isIconName(icon)) {
196
196
  const iconStyle = (sliderStyles.thumbIcon as any)({ intent });
197
197
  return (
198
- <MaterialCommunityIcons
198
+ <MaterialDesignIcons
199
199
  name={icon}
200
200
  size={iconStyle.width || 16}
201
201
  color={iconStyle.color}