@idealyst/components 1.1.6 → 1.1.8

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 (144) hide show
  1. package/package.json +8 -3
  2. package/src/Accordion/Accordion.native.tsx +22 -14
  3. package/src/Accordion/Accordion.styles.old.tsx +298 -0
  4. package/src/Accordion/Accordion.styles.tsx +139 -248
  5. package/src/Accordion/Accordion.web.tsx +12 -7
  6. package/src/ActivityIndicator/ActivityIndicator.native.tsx +3 -2
  7. package/src/ActivityIndicator/ActivityIndicator.styles.old.tsx +94 -0
  8. package/src/ActivityIndicator/ActivityIndicator.styles.tsx +43 -62
  9. package/src/ActivityIndicator/ActivityIndicator.web.tsx +2 -2
  10. package/src/Alert/Alert.native.tsx +26 -15
  11. package/src/Alert/Alert.styles.old.tsx +209 -0
  12. package/src/Alert/Alert.styles.tsx +108 -281
  13. package/src/Alert/Alert.web.tsx +6 -10
  14. package/src/Avatar/Avatar.native.tsx +5 -2
  15. package/src/Avatar/Avatar.styles.old.tsx +99 -0
  16. package/src/Avatar/Avatar.styles.tsx +47 -62
  17. package/src/Avatar/Avatar.web.tsx +2 -2
  18. package/src/Badge/Badge.native.tsx +2 -2
  19. package/src/Badge/Badge.styles.old.tsx +157 -0
  20. package/src/Badge/Badge.styles.tsx +69 -108
  21. package/src/Badge/Badge.web.tsx +6 -6
  22. package/src/Breadcrumb/Breadcrumb.native.tsx +12 -5
  23. package/src/Breadcrumb/Breadcrumb.styles.old.tsx +231 -0
  24. package/src/Breadcrumb/Breadcrumb.styles.tsx +93 -209
  25. package/src/Breadcrumb/Breadcrumb.web.tsx +39 -27
  26. package/src/Button/Button.native.tsx +39 -14
  27. package/src/Button/Button.styles.tsx +99 -253
  28. package/src/Button/Button.web.tsx +10 -8
  29. package/src/Card/Card.native.tsx +8 -4
  30. package/src/Card/Card.styles.old.tsx +160 -0
  31. package/src/Card/Card.styles.tsx +107 -142
  32. package/src/Card/Card.web.tsx +6 -4
  33. package/src/Checkbox/Checkbox.native.tsx +14 -6
  34. package/src/Checkbox/Checkbox.styles.old.tsx +271 -0
  35. package/src/Checkbox/Checkbox.styles.tsx +109 -197
  36. package/src/Checkbox/Checkbox.web.tsx +7 -7
  37. package/src/Chip/Chip.native.tsx +5 -5
  38. package/src/Chip/Chip.styles.old.tsx +184 -0
  39. package/src/Chip/Chip.styles.tsx +34 -22
  40. package/src/Chip/Chip.web.tsx +5 -5
  41. package/src/Dialog/Dialog.native.tsx +16 -7
  42. package/src/Dialog/Dialog.styles.old.tsx +202 -0
  43. package/src/Dialog/Dialog.styles.tsx +108 -132
  44. package/src/Dialog/Dialog.web.tsx +4 -4
  45. package/src/Divider/Divider.native.tsx +29 -42
  46. package/src/Divider/Divider.styles.old.tsx +172 -0
  47. package/src/Divider/Divider.styles.tsx +116 -242
  48. package/src/Divider/Divider.web.tsx +17 -14
  49. package/src/Icon/Icon.native.tsx +12 -4
  50. package/src/Icon/Icon.styles.old.tsx +81 -0
  51. package/src/Icon/Icon.styles.tsx +52 -60
  52. package/src/Icon/Icon.web.tsx +43 -7
  53. package/src/Icon/IconSvg/IconSvg.web.tsx +2 -0
  54. package/src/Image/Image.styles.old.tsx +69 -0
  55. package/src/Image/Image.styles.tsx +45 -43
  56. package/src/Input/Input.native.tsx +140 -56
  57. package/src/Input/Input.styles.old.tsx +289 -0
  58. package/src/Input/Input.styles.tsx +177 -228
  59. package/src/Input/Input.web.tsx +5 -8
  60. package/src/Link/Link.native.tsx +4 -1
  61. package/src/List/List.native.tsx +5 -2
  62. package/src/List/List.styles.old.tsx +242 -0
  63. package/src/List/List.styles.tsx +178 -240
  64. package/src/List/ListItem.native.tsx +16 -8
  65. package/src/List/ListItem.web.tsx +26 -15
  66. package/src/Menu/Menu.native.tsx +1 -1
  67. package/src/Menu/Menu.styles.old.tsx +197 -0
  68. package/src/Menu/Menu.styles.tsx +90 -156
  69. package/src/Menu/Menu.web.tsx +2 -2
  70. package/src/Menu/MenuItem.native.tsx +9 -5
  71. package/src/Menu/MenuItem.styles.old.tsx +114 -0
  72. package/src/Menu/MenuItem.styles.tsx +71 -104
  73. package/src/Menu/MenuItem.web.tsx +23 -5
  74. package/src/Popover/Popover.native.tsx +10 -4
  75. package/src/Popover/Popover.styles.old.tsx +135 -0
  76. package/src/Popover/Popover.styles.tsx +46 -96
  77. package/src/Popover/Popover.web.tsx +1 -1
  78. package/src/Pressable/Pressable.native.tsx +3 -1
  79. package/src/Pressable/Pressable.styles.old.tsx +27 -0
  80. package/src/Pressable/Pressable.styles.tsx +35 -20
  81. package/src/Pressable/Pressable.web.tsx +1 -1
  82. package/src/Progress/Progress.native.tsx +15 -6
  83. package/src/Progress/Progress.styles.old.tsx +200 -0
  84. package/src/Progress/Progress.styles.tsx +69 -118
  85. package/src/Progress/Progress.web.tsx +10 -9
  86. package/src/RadioButton/RadioButton.native.tsx +10 -4
  87. package/src/RadioButton/RadioButton.styles.old.tsx +175 -0
  88. package/src/RadioButton/RadioButton.styles.tsx +81 -145
  89. package/src/RadioButton/RadioButton.web.tsx +4 -4
  90. package/src/SVGImage/SVGImage.styles.old.tsx +86 -0
  91. package/src/SVGImage/SVGImage.styles.tsx +35 -66
  92. package/src/Screen/Screen.native.tsx +30 -27
  93. package/src/Screen/Screen.styles.old.tsx +87 -0
  94. package/src/Screen/Screen.styles.tsx +120 -71
  95. package/src/Screen/Screen.web.tsx +2 -2
  96. package/src/Select/Select.native.tsx +44 -29
  97. package/src/Select/Select.styles.old.tsx +353 -0
  98. package/src/Select/Select.styles.tsx +244 -293
  99. package/src/Select/Select.web.tsx +5 -5
  100. package/src/Skeleton/Skeleton.styles.old.tsx +67 -0
  101. package/src/Skeleton/Skeleton.styles.tsx +31 -43
  102. package/src/Slider/Slider.native.tsx +9 -5
  103. package/src/Slider/Slider.styles.old.tsx +259 -0
  104. package/src/Slider/Slider.styles.tsx +157 -227
  105. package/src/Slider/Slider.web.tsx +5 -5
  106. package/src/Switch/Switch.native.tsx +11 -5
  107. package/src/Switch/Switch.styles.old.tsx +203 -0
  108. package/src/Switch/Switch.styles.tsx +103 -149
  109. package/src/Switch/Switch.web.tsx +8 -8
  110. package/src/TabBar/TabBar.native.tsx +24 -31
  111. package/src/TabBar/TabBar.styles.old.tsx +343 -0
  112. package/src/TabBar/TabBar.styles.tsx +204 -494
  113. package/src/TabBar/TabBar.web.tsx +21 -33
  114. package/src/Table/Table.native.tsx +18 -9
  115. package/src/Table/Table.styles.old.tsx +311 -0
  116. package/src/Table/Table.styles.tsx +151 -278
  117. package/src/Table/Table.web.tsx +1 -1
  118. package/src/Text/Text.native.tsx +1 -4
  119. package/src/Text/Text.style.demo.tsx +16 -0
  120. package/src/Text/Text.styles.old.tsx +219 -0
  121. package/src/Text/Text.styles.tsx +94 -78
  122. package/src/Text/Text.web.tsx +2 -2
  123. package/src/Text/index.ts +1 -0
  124. package/src/TextArea/TextArea.styles.old.tsx +213 -0
  125. package/src/TextArea/TextArea.styles.tsx +101 -157
  126. package/src/Tooltip/Tooltip.native.tsx +2 -2
  127. package/src/Tooltip/Tooltip.styles.old.tsx +82 -0
  128. package/src/Tooltip/Tooltip.styles.tsx +38 -53
  129. package/src/Tooltip/Tooltip.web.tsx +2 -2
  130. package/src/Video/Video.styles.old.tsx +51 -0
  131. package/src/Video/Video.styles.tsx +32 -28
  132. package/src/View/View.native.tsx +12 -12
  133. package/src/View/View.styles.old.tsx +125 -0
  134. package/src/View/View.styles.tsx +84 -103
  135. package/src/View/View.web.tsx +14 -2
  136. package/src/examples/CardExamples.tsx +0 -6
  137. package/src/extensions/applyExtension.ts +210 -0
  138. package/src/extensions/extendComponent.ts +438 -0
  139. package/src/extensions/index.ts +102 -0
  140. package/src/extensions/types.ts +497 -0
  141. package/src/globals.ts +16 -0
  142. package/src/index.native.ts +4 -0
  143. package/src/index.ts +28 -0
  144. package/src/utils/deepMerge.ts +54 -2
@@ -1,274 +1,212 @@
1
+ /**
2
+ * List styles using defineStyle with dynamic props.
3
+ */
1
4
  import { StyleSheet } from 'react-native-unistyles';
2
- import { Theme, CompoundVariants } from '@idealyst/theme';
3
- import { buildSizeVariants } from '../utils/buildSizeVariants';
4
- import {
5
- buildGapVariants,
6
- buildPaddingVariants,
7
- buildPaddingVerticalVariants,
8
- buildPaddingHorizontalVariants,
9
- buildMarginVariants,
10
- buildMarginVerticalVariants,
11
- buildMarginHorizontalVariants,
12
- } from '../utils/buildViewStyleVariants';
13
- import { ListSizeVariant, ListType } from './types';
5
+ import { defineStyle, ThemeStyleWrapper } from '@idealyst/theme';
6
+ import type { Theme as BaseTheme, Size } from '@idealyst/theme';
7
+ import { ViewStyleSize } from '../utils/viewStyleProps';
8
+
9
+ // Required: Unistyles must see StyleSheet usage in original source to process this file
10
+ void StyleSheet;
11
+
12
+ // Wrap theme for $iterator support
13
+ type Theme = ThemeStyleWrapper<BaseTheme>;
14
14
 
15
- type ListVariants = {
16
- type: ListType;
17
- size: ListSizeVariant;
18
- scrollable: boolean;
19
- active: boolean;
20
- selected: boolean;
21
- disabled: boolean;
22
- clickable: boolean;
15
+ type ListType = 'default' | 'bordered' | 'divided';
16
+
17
+ export type ListDynamicProps = {
18
+ size?: Size;
19
+ type?: ListType;
20
+ scrollable?: boolean;
21
+ active?: boolean;
22
+ selected?: boolean;
23
+ disabled?: boolean;
24
+ clickable?: boolean;
25
+ gap?: ViewStyleSize;
26
+ padding?: ViewStyleSize;
27
+ paddingVertical?: ViewStyleSize;
28
+ paddingHorizontal?: ViewStyleSize;
29
+ margin?: ViewStyleSize;
30
+ marginVertical?: ViewStyleSize;
31
+ marginHorizontal?: ViewStyleSize;
23
32
  };
24
33
 
25
34
  /**
26
- * Create type variants for container
35
+ * List styles with type/state handling.
27
36
  */
28
- function createContainerTypeVariants(theme: Theme) {
29
- return {
30
- default: {
31
- backgroundColor: 'transparent',
32
- },
33
- bordered: {
37
+ export const listStyles = defineStyle('List', (theme: Theme) => ({
38
+ container: ({ type = 'default', scrollable = false }: ListDynamicProps) => {
39
+ const typeStyles = type === 'bordered' ? {
34
40
  backgroundColor: theme.colors.surface.primary,
35
41
  borderWidth: 1,
36
42
  borderColor: theme.colors.border.primary,
37
43
  borderRadius: 8,
38
- _web: {
39
- overflow: 'hidden',
40
- border: `1px solid ${theme.colors.border.primary}`,
41
- },
42
- },
43
- divided: {
44
+ } : {
44
45
  backgroundColor: 'transparent',
45
- },
46
- };
47
- }
48
-
46
+ };
49
47
 
50
- /**
51
- * Create compound variants for item
52
- */
53
- function createItemCompoundVariants(theme: Theme): CompoundVariants<keyof ListVariants> {
54
- return [
55
- {
56
- type: 'divided',
57
- styles: {
58
- _web: {
59
- ':last-child': {
60
- borderBottom: 'none',
61
- },
48
+ return {
49
+ display: 'flex' as const,
50
+ flexDirection: 'column' as const,
51
+ width: '100%',
52
+ ...typeStyles,
53
+ variants: {
54
+ gap: {
55
+ gap: theme.sizes.$view.padding,
62
56
  },
63
- },
64
- },
65
- {
66
- disabled: true,
67
- styles: {
68
- _web: {
69
- _hover: {
70
- backgroundColor: 'transparent',
71
- borderRadius: 0,
72
- },
57
+ padding: {
58
+ padding: theme.sizes.$view.padding,
73
59
  },
74
- },
75
- },
76
- {
77
- clickable: false,
78
- styles: {
79
- _web: {
80
- _hover: {
81
- backgroundColor: 'transparent',
82
- borderRadius: 0,
83
- },
60
+ paddingVertical: {
61
+ paddingVertical: theme.sizes.$view.padding,
62
+ },
63
+ paddingHorizontal: {
64
+ paddingHorizontal: theme.sizes.$view.padding,
65
+ },
66
+ margin: {
67
+ margin: theme.sizes.$view.padding,
68
+ },
69
+ marginVertical: {
70
+ marginVertical: theme.sizes.$view.padding,
71
+ },
72
+ marginHorizontal: {
73
+ marginHorizontal: theme.sizes.$view.padding,
84
74
  },
85
75
  },
86
- },
87
- ];
88
- }
76
+ _web: {
77
+ overflow: type === 'bordered' ? 'hidden' : (scrollable ? 'auto' : undefined),
78
+ border: type === 'bordered' ? `1px solid ${theme.colors.border.primary}` : undefined,
79
+ },
80
+ } as const;
81
+ },
89
82
 
83
+ item: ({ type = 'default', active = false, selected = false, disabled = false, clickable = true }: ListDynamicProps) => {
84
+ const baseStyles = {
85
+ display: 'flex' as const,
86
+ flexDirection: 'row' as const,
87
+ alignItems: 'center' as const,
88
+ backgroundColor: active ? theme.colors.surface.secondary : 'transparent',
89
+ textAlign: 'left' as const,
90
+ opacity: disabled ? 0.5 : 1,
91
+ };
90
92
 
91
- export const listStyles = StyleSheet.create((theme: Theme) => {
92
- return {
93
- container: {
94
- display: 'flex',
95
- flexDirection: 'column',
96
- width: '100%',
93
+ const dividerStyles = type === 'divided' ? {
94
+ borderBottomWidth: 1,
95
+ borderBottomColor: theme.colors.border.primary,
96
+ } : {};
97
+
98
+ const selectedStyles = selected ? {
99
+ backgroundColor: theme.intents.primary.light + '20',
100
+ borderLeftWidth: 3,
101
+ borderLeftColor: theme.intents.primary.primary,
102
+ } : {};
103
+
104
+ return {
105
+ ...baseStyles,
106
+ ...dividerStyles,
107
+ ...selectedStyles,
97
108
  variants: {
98
- type: createContainerTypeVariants(theme),
99
- scrollable: {
100
- true: {
101
- _web: {
102
- overflow: 'auto',
103
- },
104
- },
105
- false: {},
109
+ size: {
110
+ paddingVertical: theme.sizes.$list.paddingVertical,
111
+ paddingHorizontal: theme.sizes.$list.paddingHorizontal,
112
+ minHeight: theme.sizes.$list.minHeight,
106
113
  },
107
- // Spacing variants from ContainerStyleProps
108
- gap: buildGapVariants(theme),
109
- padding: buildPaddingVariants(theme),
110
- paddingVertical: buildPaddingVerticalVariants(theme),
111
- paddingHorizontal: buildPaddingHorizontalVariants(theme),
112
- margin: buildMarginVariants(theme),
113
- marginVertical: buildMarginVerticalVariants(theme),
114
- marginHorizontal: buildMarginHorizontalVariants(theme),
115
114
  },
116
- },
117
- item: {
118
- display: 'flex',
119
- flexDirection: 'row',
120
- alignItems: 'center',
121
- backgroundColor: 'transparent',
122
- textAlign: 'left',
123
- variants: {
124
- size: buildSizeVariants(theme, 'list', (size) => ({
125
- paddingVertical: size.paddingVertical,
126
- paddingHorizontal: size.paddingHorizontal,
127
- minHeight: size.minHeight,
128
- })),
129
- type: {
130
- default: {},
131
- bordered: {},
132
- divided: {
133
- borderBottomWidth: 1,
134
- borderBottomStyle: 'solid',
135
- borderBottomColor: theme.colors.border.primary,
136
- _web: {
137
- borderBottom: `1px solid ${theme.colors.border.primary}`,
138
- },
139
- },
140
- },
141
- active: {
142
- true: {
143
- backgroundColor: theme.colors.surface.secondary,
144
- },
145
- false: {},
146
- },
147
- selected: {
148
- true: {
149
- backgroundColor: theme.intents.primary.light + '20',
150
- borderLeftWidth: 3,
151
- borderLeftColor: theme.intents.primary.primary,
152
- _web: {
153
- borderLeft: `3px solid ${theme.intents.primary.primary}`,
154
- },
155
- },
156
- false: {},
157
- },
158
- disabled: {
159
- true: {
160
- opacity: 0.5,
161
- _web: {
162
- cursor: 'not-allowed',
163
- },
164
- },
165
- false: {},
166
- },
167
- clickable: {
168
- true: {},
169
- false: {
170
- _web: {
171
- cursor: 'default',
172
- },
173
- },
174
- },
175
- } as const,
176
- compoundVariants: createItemCompoundVariants(theme),
177
115
  _web: {
178
116
  border: 'none',
179
- cursor: 'pointer',
117
+ cursor: disabled ? 'not-allowed' : (clickable ? 'pointer' : 'default'),
180
118
  outline: 'none',
181
119
  transition: 'background-color 0.2s ease, border-color 0.2s ease',
182
- _hover: {
120
+ borderBottom: type === 'divided' ? `1px solid ${theme.colors.border.primary}` : undefined,
121
+ borderLeft: selected ? `3px solid ${theme.intents.primary.primary}` : undefined,
122
+ _hover: (disabled || !clickable) ? {} : {
183
123
  backgroundColor: theme.colors.surface.secondary,
184
124
  borderRadius: 4,
185
125
  },
186
126
  },
187
- } as const,
188
- itemContent: {
189
- display: 'flex',
190
- flexDirection: 'row',
191
- alignItems: 'center',
192
- flex: 1,
193
- gap: 8,
194
- },
195
- leading: {
196
- display: 'flex',
197
- alignItems: 'center',
198
- justifyContent: 'center',
199
- marginRight: 8,
200
- color: theme.colors.text.secondary,
201
- variants: {
202
- size: buildSizeVariants(theme, 'list', (size) => ({
203
- width: size.iconSize,
204
- height: size.iconSize,
205
- })),
206
- } as const,
207
- } as const,
208
- labelContainer: {
209
- flex: 1,
210
- display: 'flex',
211
- flexDirection: 'column',
212
- },
213
- label: {
214
- fontWeight: '500',
215
- color: theme.colors.text.primary,
216
- variants: {
217
- size: buildSizeVariants(theme, 'list', (size) => ({
218
- fontSize: size.labelFontSize,
219
- lineHeight: size.labelLineHeight,
220
- })),
221
- disabled: {
222
- true: {
223
- color: theme.colors.text.secondary,
224
- },
225
- false: {},
226
- },
227
- selected: {
228
- true: {
229
- color: theme.intents.primary.primary,
230
- fontWeight: '600',
231
- },
232
- false: {},
127
+ } as const;
128
+ },
129
+
130
+ itemContent: (_props: ListDynamicProps) => ({
131
+ display: 'flex' as const,
132
+ flexDirection: 'row' as const,
133
+ alignItems: 'center' as const,
134
+ flex: 1,
135
+ gap: 8,
136
+ }),
137
+
138
+ leading: (_props: ListDynamicProps) => ({
139
+ display: 'flex' as const,
140
+ alignItems: 'center' as const,
141
+ justifyContent: 'center' as const,
142
+ marginRight: 8,
143
+ color: theme.colors.text.secondary,
144
+ variants: {
145
+ size: {
146
+ width: theme.sizes.$list.iconSize,
147
+ height: theme.sizes.$list.iconSize,
148
+ fontSize: theme.sizes.$list.iconSize,
233
149
  },
234
150
  },
235
- },
236
- trailing: {
237
- display: 'flex',
238
- alignItems: 'center',
239
- justifyContent: 'center',
240
- marginLeft: 8,
241
- color: theme.colors.text.secondary,
242
- flexShrink: 0,
243
- },
244
- trailingIcon: {
245
- display: 'flex',
246
- alignItems: 'center',
247
- justifyContent: 'center',
248
- variants: {
249
- size: buildSizeVariants(theme, 'list', (size) => ({
250
- width: size.iconSize,
251
- height: size.iconSize,
252
- })),
151
+ }),
152
+
153
+ labelContainer: (_props: ListDynamicProps) => ({
154
+ flex: 1,
155
+ display: 'flex' as const,
156
+ flexDirection: 'column' as const,
157
+ }),
158
+
159
+ label: ({ disabled = false, selected = false }: ListDynamicProps) => ({
160
+ fontWeight: selected ? ('600' as const) : ('500' as const),
161
+ color: selected ? theme.intents.primary.primary : (disabled ? theme.colors.text.secondary : theme.colors.text.primary),
162
+ variants: {
163
+ size: {
164
+ fontSize: theme.sizes.$list.labelFontSize,
165
+ lineHeight: theme.sizes.$list.labelLineHeight,
253
166
  },
254
167
  },
255
- section: {
256
- display: 'flex',
257
- flexDirection: 'column',
258
- },
259
- sectionTitle: {
260
- fontWeight: '600',
261
- fontSize: 12,
262
- lineHeight: 16,
263
- textTransform: 'uppercase',
264
- letterSpacing: 0.5,
265
- color: theme.colors.text.secondary,
266
- padding: 8,
267
- paddingBottom: 4,
268
- },
269
- sectionContent: {
270
- display: 'flex',
271
- flexDirection: 'column',
168
+ }),
169
+
170
+ trailing: (_props: ListDynamicProps) => ({
171
+ display: 'flex' as const,
172
+ alignItems: 'center' as const,
173
+ justifyContent: 'center' as const,
174
+ marginLeft: 8,
175
+ color: theme.colors.text.secondary,
176
+ flexShrink: 0,
177
+ }),
178
+
179
+ trailingIcon: (_props: ListDynamicProps) => ({
180
+ display: 'flex' as const,
181
+ alignItems: 'center' as const,
182
+ justifyContent: 'center' as const,
183
+ variants: {
184
+ size: {
185
+ width: theme.sizes.$list.iconSize,
186
+ height: theme.sizes.$list.iconSize,
187
+ fontSize: theme.sizes.$list.iconSize,
188
+ },
272
189
  },
273
- };
274
- });
190
+ }),
191
+
192
+ section: (_props: ListDynamicProps) => ({
193
+ display: 'flex' as const,
194
+ flexDirection: 'column' as const,
195
+ }),
196
+
197
+ sectionTitle: (_props: ListDynamicProps) => ({
198
+ fontWeight: '600' as const,
199
+ fontSize: 12,
200
+ lineHeight: 16,
201
+ textTransform: 'uppercase' as const,
202
+ letterSpacing: 0.5,
203
+ color: theme.colors.text.secondary,
204
+ padding: 8,
205
+ paddingBottom: 4,
206
+ }),
207
+
208
+ sectionContent: (_props: ListDynamicProps) => ({
209
+ display: 'flex' as const,
210
+ flexDirection: 'column' as const,
211
+ }),
212
+ }));
@@ -51,15 +51,23 @@ const ListItem = forwardRef<ComponentRef<typeof View> | ComponentRef<typeof Pres
51
51
  const effectiveSize = size ?? listContext.size ?? 'md';
52
52
  const effectiveVariant = listContext.type ?? 'default';
53
53
 
54
- // Apply types
54
+ // Apply variants (for size, active, selected, disabled on label)
55
55
  listStyles.useVariants({
56
56
  size: effectiveSize,
57
57
  active,
58
58
  selected,
59
59
  disabled,
60
- clickable: isClickable,
61
60
  });
62
61
 
62
+ // Get dynamic styles - call as functions to get theme-reactive styles
63
+ const itemStyle = (listStyles.item as any)({ type: effectiveVariant, disabled, clickable: isClickable });
64
+ const labelStyle = (listStyles.label as any)({ disabled, selected });
65
+ const leadingStyle = (listStyles.leading as any)({});
66
+ const trailingStyle = (listStyles.trailing as any)({});
67
+ const trailingIconStyle = (listStyles.trailingIcon as any)({});
68
+ const labelContainerStyle = (listStyles.labelContainer as any)({});
69
+ const itemContentStyle = (listStyles.itemContent as any)({});
70
+
63
71
  // Resolve icon color - check intents first, then color palette
64
72
  const resolvedIconColor = (() => {
65
73
  if (!iconColor) return undefined;
@@ -77,7 +85,7 @@ const ListItem = forwardRef<ComponentRef<typeof View> | ComponentRef<typeof Pres
77
85
 
78
86
  // If it's a string, treat it as an icon name
79
87
  if (typeof element === 'string') {
80
- const iconStyle = styleKey === 'leading' ? listStyles.leading : listStyles.trailingIcon;
88
+ const iconStyle = styleKey === 'leading' ? leadingStyle : trailingIconStyle;
81
89
  return (
82
90
  <MaterialCommunityIcons
83
91
  name={element}
@@ -96,20 +104,20 @@ const ListItem = forwardRef<ComponentRef<typeof View> | ComponentRef<typeof Pres
96
104
  const content = (
97
105
  <>
98
106
  {leading && (
99
- <View style={listStyles.leading}>
107
+ <View style={leadingStyle}>
100
108
  {renderElement(leading, 'leading')}
101
109
  </View>
102
110
  )}
103
111
 
104
- <View style={listStyles.labelContainer}>
112
+ <View style={labelContainerStyle}>
105
113
  {label && (
106
- <Text style={listStyles.label}>{label}</Text>
114
+ <Text style={labelStyle}>{label}</Text>
107
115
  )}
108
116
  {children}
109
117
  </View>
110
118
 
111
119
  {trailing && (
112
- <View style={listStyles.trailing}>
120
+ <View style={trailingStyle}>
113
121
  {renderElement(trailing, 'trailingIcon')}
114
122
  </View>
115
123
  )}
@@ -117,7 +125,7 @@ const ListItem = forwardRef<ComponentRef<typeof View> | ComponentRef<typeof Pres
117
125
  );
118
126
 
119
127
  const indentStyle = indent > 0 ? { paddingLeft: indent * 16 } : {};
120
- const combinedStyle = [listStyles.item, indentStyle, style];
128
+ const combinedStyle = [itemStyle, indentStyle, style];
121
129
 
122
130
  if (isClickable) {
123
131
  return (
@@ -32,20 +32,27 @@ const ListItem: React.FC<ListItemProps> = ({
32
32
  const effectiveSize = size ?? listContext.size ?? 'md';
33
33
  const effectiveVariant = listContext.type ?? 'default';
34
34
 
35
- // Apply types
35
+ // Apply variants (for size, active, selected, disabled on label)
36
36
  listStyles.useVariants({
37
37
  size: effectiveSize,
38
38
  active,
39
39
  selected,
40
40
  disabled,
41
- clickable: isClickable,
42
41
  });
43
42
 
44
- const itemProps = getWebProps([listStyles.item, style]);
45
- const labelProps = getWebProps([listStyles.label]);
46
- const leadingProps = getWebProps([listStyles.leading]);
47
- const trailingProps = getWebProps([listStyles.trailing]);
48
- const trailingIconProps = getWebProps([listStyles.trailing, listStyles.trailingIcon]);
43
+ // Get dynamic styles - call as functions for theme reactivity
44
+ const itemStyle = (listStyles.item as any)({ type: effectiveVariant, disabled, clickable: isClickable });
45
+ const labelStyle = (listStyles.label as any)({ disabled, selected });
46
+ const leadingStyle = (listStyles.leading as any)({});
47
+ const trailingStyle = (listStyles.trailing as any)({});
48
+ const trailingIconStyle = (listStyles.trailingIcon as any)({});
49
+ const labelContainerStyle = (listStyles.labelContainer as any)({});
50
+
51
+ const itemProps = getWebProps([itemStyle, style]);
52
+ const labelProps = getWebProps([labelStyle]);
53
+ const leadingProps = getWebProps([leadingStyle]);
54
+ const trailingProps = getWebProps([trailingStyle]);
55
+ const trailingIconProps = getWebProps([trailingStyle, trailingIconStyle]);
49
56
 
50
57
  const handleClick = () => {
51
58
  if (!disabled && onPress) {
@@ -65,18 +72,16 @@ const ListItem: React.FC<ListItemProps> = ({
65
72
  })();
66
73
 
67
74
  // Helper to render leading/trailing icons
68
- const renderElement = (element: typeof leading | typeof trailing, props: any, isTrailing = false) => {
75
+ // IconSvg uses size="1em" by default, sized by container's fontSize from styles
76
+ const renderElement = (element: typeof leading | typeof trailing, isTrailing = false) => {
69
77
  if (!element) return null;
70
78
 
71
79
  if (isIconName(element)) {
72
80
  const iconPath = resolveIconPath(element);
73
- // Use trailingIconProps for trailing icons to apply size constraints
74
- const iconPropsToUse = isTrailing ? trailingIconProps : props;
75
81
  return (
76
82
  <IconSvg
77
83
  path={iconPath}
78
- {...iconPropsToUse}
79
- color={resolvedIconColor}
84
+ color={resolvedIconColor || 'currentColor'}
80
85
  aria-label={element}
81
86
  />
82
87
  );
@@ -87,11 +92,17 @@ const ListItem: React.FC<ListItemProps> = ({
87
92
  return null;
88
93
  };
89
94
 
95
+ const labelContainerProps = getWebProps([labelContainerStyle]);
96
+
90
97
  const content = (
91
98
  <>
92
- {leading && renderElement(leading, leadingProps)}
99
+ {leading && (
100
+ <span {...leadingProps}>
101
+ {renderElement(leading)}
102
+ </span>
103
+ )}
93
104
 
94
- <div {...getWebProps([listStyles.labelContainer])}>
105
+ <div {...labelContainerProps}>
95
106
  {label && (
96
107
  <span {...labelProps}>{label}</span>
97
108
  )}
@@ -100,7 +111,7 @@ const ListItem: React.FC<ListItemProps> = ({
100
111
 
101
112
  {trailing && (
102
113
  <div {...trailingProps}>
103
- {renderElement(trailing, trailingIconProps, true)}
114
+ {renderElement(trailing, true)}
104
115
  </div>
105
116
  )}
106
117
  </>
@@ -113,7 +113,7 @@ const Menu = forwardRef<View, MenuProps>(({
113
113
  width={menuPosition.width}
114
114
  maxHeight={300}
115
115
  style={[
116
- menuStyles.menu,
116
+ (menuStyles.menu as any)({}),
117
117
  style,
118
118
  { opacity: shouldShow ? 1 : 0 }
119
119
  ]}