@idealyst/components 1.2.125 → 1.2.127

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.125",
3
+ "version": "1.2.127",
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.125",
59
+ "@idealyst/theme": "^1.2.127",
60
60
  "@mdi/js": ">=7.0.0",
61
61
  "@mdi/react": ">=1.0.0",
62
62
  "@react-native-vector-icons/common": ">=12.0.0",
@@ -111,8 +111,8 @@
111
111
  },
112
112
  "devDependencies": {
113
113
  "@idealyst/blur": "^1.2.40",
114
- "@idealyst/theme": "^1.2.125",
115
- "@idealyst/tooling": "^1.2.125",
114
+ "@idealyst/theme": "^1.2.127",
115
+ "@idealyst/tooling": "^1.2.127",
116
116
  "@mdi/react": "^1.6.1",
117
117
  "@types/react": "^19.1.0",
118
118
  "react": "^19.1.0",
@@ -173,7 +173,6 @@ const TabBar = forwardRef<IdealystElement, TabBarProps>(({
173
173
  // Apply icon variants (size, disabled, iconPosition)
174
174
  tabBarIconStyles.useVariants({
175
175
  size,
176
- active: isActive,
177
176
  disabled: Boolean(item.disabled),
178
177
  iconPosition,
179
178
  });
@@ -181,7 +180,6 @@ const TabBar = forwardRef<IdealystElement, TabBarProps>(({
181
180
  // Compute dynamic styles for this tab - call as functions for theme reactivity
182
181
  const tabStyle = (tabBarTabStyles.tab as any)({ type, size, active: isActive, pillMode, justify });
183
182
  const labelStyle = (tabBarLabelStyles.tabLabel as any)({ type, active: isActive, pillMode });
184
- const iconContainerStyle = (tabBarIconStyles.tabIcon as any)({});
185
183
 
186
184
  const icon = renderIcon(item.icon, isActive, iconSize);
187
185
 
@@ -201,7 +199,7 @@ const TabBar = forwardRef<IdealystElement, TabBarProps>(({
201
199
  accessibilityLabel={item.label}
202
200
  accessibilityState={{ selected: isActive, disabled: item.disabled }}
203
201
  >
204
- {icon && <View style={iconContainerStyle}>{icon}</View>}
202
+ {icon && <View style={tabBarIconStyles.tabIcon as any}>{icon}</View>}
205
203
  <Text style={labelStyle}>{item.label}</Text>
206
204
  </TouchableOpacity>
207
205
  );
@@ -92,15 +92,24 @@ export const tabBarStyles = defineStyle('TabBar', (theme: Theme) => ({
92
92
  },
93
93
 
94
94
  tab: ({ type = 'standard', size = 'md', active = false, pillMode: _pillMode = 'light', disabled = false, iconPosition = 'left', justify = 'start' }: TabBarDynamicProps) => {
95
- // Tab padding for pillsnarrower than standard tabs
96
- const pillsPaddingMap: Record<Size, { paddingVertical: number; paddingHorizontal: number }> = {
97
- xs: { paddingVertical: 2, paddingHorizontal: 8 },
98
- sm: { paddingVertical: 3, paddingHorizontal: 10 },
99
- md: { paddingVertical: 4, paddingHorizontal: 12 },
100
- lg: { paddingVertical: 6, paddingHorizontal: 16 },
101
- xl: { paddingVertical: 8, paddingHorizontal: 20 },
95
+ // Resolve padding at runtimecan't use $iterator with runtime `type` check
96
+ // Use explicit top/bottom/left/right for cross-platform compatibility
97
+ const pillsPaddingMap: Record<Size, { paddingTop: number; paddingBottom: number; paddingLeft: number; paddingRight: number }> = {
98
+ xs: { paddingTop: 2, paddingBottom: 2, paddingLeft: 8, paddingRight: 8 },
99
+ sm: { paddingTop: 3, paddingBottom: 3, paddingLeft: 10, paddingRight: 10 },
100
+ md: { paddingTop: 4, paddingBottom: 4, paddingLeft: 12, paddingRight: 12 },
101
+ lg: { paddingTop: 6, paddingBottom: 6, paddingLeft: 16, paddingRight: 16 },
102
+ xl: { paddingTop: 8, paddingBottom: 8, paddingLeft: 20, paddingRight: 20 },
102
103
  };
103
- const tabPadding = type === 'pills' ? pillsPaddingMap[size] : {};
104
+ const sizeValues = theme.sizes.tabBar[size];
105
+ const tabPadding = type === 'pills'
106
+ ? pillsPaddingMap[size]
107
+ : {
108
+ paddingTop: sizeValues.padding,
109
+ paddingBottom: sizeValues.padding,
110
+ paddingLeft: sizeValues.padding,
111
+ paddingRight: sizeValues.padding,
112
+ };
104
113
 
105
114
  // Color based on type and active state
106
115
  let color = active ? theme.colors.text.primary : theme.colors.text.secondary;
@@ -128,9 +137,6 @@ export const tabBarStyles = defineStyle('TabBar', (theme: Theme) => ({
128
137
  size: {
129
138
  fontSize: theme.sizes.$tabBar.fontSize,
130
139
  lineHeight: theme.sizes.$tabBar.lineHeight,
131
- paddingTop: type === 'pills' ? undefined : theme.sizes.$tabBar.padding,
132
- paddingBottom: type === 'pills' ? undefined : theme.sizes.$tabBar.paddingBottom,
133
- paddingHorizontal: type === 'pills' ? undefined : theme.sizes.$tabBar.padding,
134
140
  },
135
141
  },
136
142
  _web: {
@@ -165,19 +171,25 @@ export const tabBarStyles = defineStyle('TabBar', (theme: Theme) => ({
165
171
  } as const;
166
172
  },
167
173
 
168
- tabIcon: ({ active: _active = false, disabled = false, iconPosition = 'left' }: TabBarDynamicProps) => ({
174
+ tabIcon: {
169
175
  display: 'flex' as const,
170
176
  alignItems: 'center' as const,
171
177
  justifyContent: 'center' as const,
172
- opacity: disabled ? 0.5 : 1,
173
- marginBottom: iconPosition === 'top' ? 2 : 0,
174
178
  variants: {
175
179
  size: {
176
180
  width: theme.sizes.$tabBar.fontSize,
177
181
  height: theme.sizes.$tabBar.fontSize,
178
182
  },
183
+ disabled: {
184
+ true: { opacity: 0.5 },
185
+ false: { opacity: 1 },
186
+ },
187
+ iconPosition: {
188
+ top: { marginBottom: 2 },
189
+ left: { marginBottom: 0 },
190
+ },
179
191
  },
180
- }),
192
+ },
181
193
 
182
194
  indicator: ({ type = 'standard', pillMode = 'light' }: TabBarDynamicProps) => {
183
195
  const backgroundColor = type === 'pills'
@@ -186,8 +198,8 @@ export const tabBarStyles = defineStyle('TabBar', (theme: Theme) => ({
186
198
 
187
199
  const typeStyles = type === 'pills' ? {
188
200
  borderRadius: 9999,
189
- bottom: 3,
190
- top: 3,
201
+ top: 4,
202
+ bottom: 4,
191
203
  left: 0,
192
204
  } : {
193
205
  bottom: -1,
@@ -66,10 +66,19 @@ const Tab: React.FC<TabProps> = ({
66
66
  }) => {
67
67
  const iconSize = ICON_SIZES[size || 'md'] || 18;
68
68
 
69
+ // Apply tab variants (size) for variant expansion (padding, fontSize, lineHeight)
70
+ tabBarTabStyles.useVariants({
71
+ size,
72
+ });
73
+
74
+ // Apply label variants (size) for variant expansion
75
+ tabBarLabelStyles.useVariants({
76
+ size,
77
+ });
78
+
69
79
  // Apply icon variants (size, disabled, iconPosition)
70
80
  tabBarIconStyles.useVariants({
71
81
  size,
72
- active: isActive,
73
82
  disabled: Boolean(item.disabled),
74
83
  iconPosition,
75
84
  });