@idealyst/components 1.1.7 → 1.1.9

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 (129) hide show
  1. package/package.json +3 -3
  2. package/plugin/web.js +280 -532
  3. package/src/Accordion/Accordion.native.tsx +8 -6
  4. package/src/Accordion/Accordion.styles.old.tsx +298 -0
  5. package/src/Accordion/Accordion.styles.tsx +102 -236
  6. package/src/Accordion/Accordion.web.tsx +1 -3
  7. package/src/ActivityIndicator/ActivityIndicator.styles.old.tsx +94 -0
  8. package/src/ActivityIndicator/ActivityIndicator.styles.tsx +44 -74
  9. package/src/Alert/Alert.native.tsx +16 -6
  10. package/src/Alert/Alert.styles.old.tsx +209 -0
  11. package/src/Alert/Alert.styles.tsx +67 -149
  12. package/src/Alert/Alert.web.tsx +3 -4
  13. package/src/Avatar/Avatar.styles.old.tsx +99 -0
  14. package/src/Avatar/Avatar.styles.tsx +35 -80
  15. package/src/Badge/Badge.styles.old.tsx +157 -0
  16. package/src/Badge/Badge.styles.tsx +61 -121
  17. package/src/Badge/Badge.web.tsx +8 -15
  18. package/src/Breadcrumb/Breadcrumb.styles.old.tsx +231 -0
  19. package/src/Breadcrumb/Breadcrumb.styles.tsx +83 -200
  20. package/src/Breadcrumb/Breadcrumb.web.tsx +31 -30
  21. package/src/Button/Button.native.tsx +14 -21
  22. package/src/Button/Button.styles.tsx +103 -140
  23. package/src/Button/Button.web.tsx +9 -19
  24. package/src/Card/Card.native.tsx +7 -11
  25. package/src/Card/Card.styles.old.tsx +160 -0
  26. package/src/Card/Card.styles.tsx +105 -142
  27. package/src/Card/Card.web.tsx +5 -4
  28. package/src/Checkbox/Checkbox.native.tsx +9 -5
  29. package/src/Checkbox/Checkbox.styles.old.tsx +271 -0
  30. package/src/Checkbox/Checkbox.styles.tsx +104 -216
  31. package/src/Checkbox/Checkbox.web.tsx +7 -8
  32. package/src/Chip/Chip.styles.old.tsx +184 -0
  33. package/src/Chip/Chip.styles.tsx +34 -72
  34. package/src/Chip/Chip.web.tsx +3 -5
  35. package/src/Dialog/Dialog.native.tsx +7 -4
  36. package/src/Dialog/Dialog.styles.old.tsx +202 -0
  37. package/src/Dialog/Dialog.styles.tsx +69 -133
  38. package/src/Dialog/Dialog.web.tsx +3 -3
  39. package/src/Dialog/types.ts +1 -1
  40. package/src/Divider/Divider.styles.old.tsx +172 -0
  41. package/src/Divider/Divider.styles.tsx +62 -84
  42. package/src/Icon/Icon.native.tsx +8 -8
  43. package/src/Icon/Icon.styles.old.tsx +81 -0
  44. package/src/Icon/Icon.styles.tsx +52 -66
  45. package/src/Icon/Icon.web.tsx +62 -21
  46. package/src/Icon/IconRegistry.native.ts +41 -0
  47. package/src/Icon/IconRegistry.ts +107 -0
  48. package/src/Icon/IconSvg/IconSvg.web.tsx +28 -5
  49. package/src/Icon/icon-resolver.ts +12 -43
  50. package/src/Icon/index.native.ts +2 -1
  51. package/src/Icon/index.ts +1 -0
  52. package/src/Icon/index.web.ts +1 -0
  53. package/src/Image/Image.styles.old.tsx +69 -0
  54. package/src/Image/Image.styles.tsx +46 -60
  55. package/src/Input/Input.native.tsx +138 -53
  56. package/src/Input/Input.styles.old.tsx +289 -0
  57. package/src/Input/Input.styles.tsx +134 -232
  58. package/src/Input/Input.web.tsx +5 -8
  59. package/src/List/List.native.tsx +5 -2
  60. package/src/List/List.styles.old.tsx +242 -0
  61. package/src/List/List.styles.tsx +179 -215
  62. package/src/List/ListItem.native.tsx +16 -11
  63. package/src/List/ListItem.web.tsx +26 -16
  64. package/src/Menu/Menu.styles.old.tsx +197 -0
  65. package/src/Menu/Menu.styles.tsx +68 -150
  66. package/src/Menu/MenuItem.native.tsx +5 -3
  67. package/src/Menu/MenuItem.styles.old.tsx +114 -0
  68. package/src/Menu/MenuItem.styles.tsx +57 -89
  69. package/src/Menu/MenuItem.web.tsx +10 -7
  70. package/src/Popover/Popover.native.tsx +10 -4
  71. package/src/Popover/Popover.styles.old.tsx +135 -0
  72. package/src/Popover/Popover.styles.tsx +51 -112
  73. package/src/Pressable/Pressable.styles.old.tsx +27 -0
  74. package/src/Pressable/Pressable.styles.tsx +35 -27
  75. package/src/Progress/Progress.styles.old.tsx +200 -0
  76. package/src/Progress/Progress.styles.tsx +75 -164
  77. package/src/RadioButton/RadioButton.native.tsx +4 -3
  78. package/src/RadioButton/RadioButton.styles.old.tsx +175 -0
  79. package/src/RadioButton/RadioButton.styles.tsx +83 -154
  80. package/src/RadioButton/RadioButton.web.tsx +2 -2
  81. package/src/SVGImage/SVGImage.styles.old.tsx +86 -0
  82. package/src/SVGImage/SVGImage.styles.tsx +35 -78
  83. package/src/Screen/Screen.native.tsx +19 -26
  84. package/src/Screen/Screen.styles.old.tsx +87 -0
  85. package/src/Screen/Screen.styles.tsx +103 -68
  86. package/src/Screen/Screen.web.tsx +2 -2
  87. package/src/Select/Select.native.tsx +42 -33
  88. package/src/Select/Select.styles.old.tsx +353 -0
  89. package/src/Select/Select.styles.tsx +214 -300
  90. package/src/Select/Select.web.tsx +45 -33
  91. package/src/Skeleton/Skeleton.styles.old.tsx +67 -0
  92. package/src/Skeleton/Skeleton.styles.tsx +29 -53
  93. package/src/Slider/Slider.styles.old.tsx +259 -0
  94. package/src/Slider/Slider.styles.tsx +153 -234
  95. package/src/Slider/Slider.web.tsx +2 -4
  96. package/src/Switch/Switch.native.tsx +9 -7
  97. package/src/Switch/Switch.styles.old.tsx +203 -0
  98. package/src/Switch/Switch.styles.tsx +101 -174
  99. package/src/Switch/Switch.web.tsx +7 -8
  100. package/src/TabBar/TabBar.native.tsx +3 -2
  101. package/src/TabBar/TabBar.styles.old.tsx +343 -0
  102. package/src/TabBar/TabBar.styles.tsx +145 -279
  103. package/src/Table/Table.native.tsx +180 -68
  104. package/src/Table/Table.styles.old.tsx +311 -0
  105. package/src/Table/Table.styles.tsx +140 -281
  106. package/src/Table/Table.web.tsx +169 -70
  107. package/src/Text/Text.native.tsx +1 -3
  108. package/src/Text/Text.style.demo.tsx +16 -0
  109. package/src/Text/Text.styles.old.tsx +219 -0
  110. package/src/Text/Text.styles.tsx +94 -84
  111. package/src/Text/Text.web.tsx +3 -2
  112. package/src/Text/index.ts +1 -0
  113. package/src/TextArea/TextArea.native.tsx +21 -8
  114. package/src/TextArea/TextArea.styles.old.tsx +213 -0
  115. package/src/TextArea/TextArea.styles.tsx +87 -187
  116. package/src/TextArea/TextArea.web.tsx +17 -6
  117. package/src/Tooltip/Tooltip.styles.old.tsx +82 -0
  118. package/src/Tooltip/Tooltip.styles.tsx +32 -56
  119. package/src/Video/Video.styles.old.tsx +51 -0
  120. package/src/Video/Video.styles.tsx +32 -44
  121. package/src/View/View.native.tsx +41 -13
  122. package/src/View/View.styles.old.tsx +125 -0
  123. package/src/View/View.styles.tsx +76 -106
  124. package/src/View/View.web.tsx +5 -21
  125. package/src/View/types.ts +31 -3
  126. package/src/examples/ButtonExamples.tsx +20 -0
  127. package/src/examples/CardExamples.tsx +0 -6
  128. package/src/extensions/extendComponent.ts +61 -0
  129. package/src/index.ts +1 -1
@@ -0,0 +1,242 @@
1
+ import { StyleSheet } from 'react-native-unistyles';
2
+ import { Theme } 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';
14
+ import { applyExtensions } from '../extensions/applyExtension';
15
+
16
+ type ListVariants = {
17
+ type: ListType;
18
+ size: ListSizeVariant;
19
+ scrollable: boolean;
20
+ active: boolean;
21
+ selected: boolean;
22
+ disabled: boolean;
23
+ clickable: boolean;
24
+ };
25
+
26
+ /**
27
+ * Create type variants for container
28
+ */
29
+ function createContainerTypeVariants(theme: Theme) {
30
+ return {
31
+ default: {
32
+ backgroundColor: 'transparent',
33
+ },
34
+ bordered: {
35
+ backgroundColor: theme.colors.surface.primary,
36
+ borderWidth: 1,
37
+ borderColor: theme.colors.border.primary,
38
+ borderRadius: 8,
39
+ _web: {
40
+ overflow: 'hidden',
41
+ border: `1px solid ${theme.colors.border.primary}`,
42
+ },
43
+ },
44
+ divided: {
45
+ backgroundColor: 'transparent',
46
+ },
47
+ };
48
+ }
49
+
50
+ type ItemDynamicProps = {
51
+ type?: ListType;
52
+ disabled?: boolean;
53
+ clickable?: boolean;
54
+ };
55
+
56
+ /**
57
+ * Get item hover styles based on disabled and clickable state
58
+ */
59
+ function getItemHoverStyles(theme: Theme, disabled: boolean, clickable: boolean) {
60
+ if (disabled || !clickable) {
61
+ return {
62
+ backgroundColor: 'transparent',
63
+ borderRadius: 0,
64
+ };
65
+ }
66
+ return {
67
+ backgroundColor: theme.colors.surface.secondary,
68
+ borderRadius: 4,
69
+ };
70
+ }
71
+
72
+ // Container style creator for extension support
73
+ function createContainerStyles(theme: Theme) {
74
+ return () => ({
75
+ display: 'flex' as const,
76
+ flexDirection: 'column' as const,
77
+ width: '100%',
78
+ variants: {
79
+ type: createContainerTypeVariants(theme),
80
+ scrollable: {
81
+ true: {
82
+ _web: {
83
+ overflow: 'auto',
84
+ },
85
+ },
86
+ false: {},
87
+ },
88
+ // Spacing variants from ContainerStyleProps
89
+ gap: buildGapVariants(theme),
90
+ padding: buildPaddingVariants(theme),
91
+ paddingVertical: buildPaddingVerticalVariants(theme),
92
+ paddingHorizontal: buildPaddingHorizontalVariants(theme),
93
+ margin: buildMarginVariants(theme),
94
+ marginVertical: buildMarginVerticalVariants(theme),
95
+ marginHorizontal: buildMarginHorizontalVariants(theme),
96
+ },
97
+ });
98
+ }
99
+
100
+ // Item style creator for extension support
101
+ function createItemStyles(theme: Theme) {
102
+ return ({ type = 'default', disabled = false, clickable = true }: ItemDynamicProps) => {
103
+ const hoverStyles = getItemHoverStyles(theme, disabled, clickable);
104
+ return {
105
+ display: 'flex',
106
+ flexDirection: 'row',
107
+ alignItems: 'center',
108
+ backgroundColor: 'transparent',
109
+ textAlign: 'left',
110
+ borderBottomWidth: type === 'divided' ? 1 : 0,
111
+ borderBottomStyle: type === 'divided' ? 'solid' as const : undefined,
112
+ borderBottomColor: type === 'divided' ? theme.colors.border.primary : undefined,
113
+ variants: {
114
+ size: buildSizeVariants(theme, 'list', (size) => ({
115
+ paddingVertical: size.paddingVertical,
116
+ paddingHorizontal: size.paddingHorizontal,
117
+ minHeight: size.minHeight,
118
+ })),
119
+ active: {
120
+ true: {
121
+ backgroundColor: theme.colors.surface.secondary,
122
+ },
123
+ false: {},
124
+ },
125
+ selected: {
126
+ true: {
127
+ backgroundColor: theme.intents.primary.light + '20',
128
+ borderLeftWidth: 3,
129
+ borderLeftColor: theme.intents.primary.primary,
130
+ _web: {
131
+ borderLeft: `3px solid ${theme.intents.primary.primary}`,
132
+ },
133
+ },
134
+ false: {},
135
+ },
136
+ } as const,
137
+ opacity: disabled ? 0.5 : 1,
138
+ _web: {
139
+ border: 'none',
140
+ cursor: disabled ? 'not-allowed' : (clickable ? 'pointer' : 'default'),
141
+ outline: 'none',
142
+ transition: 'background-color 0.2s ease, border-color 0.2s ease',
143
+ borderBottom: type === 'divided' ? `1px solid ${theme.colors.border.primary}` : undefined,
144
+ _hover: hoverStyles,
145
+ },
146
+ } as const;
147
+ };
148
+ }
149
+
150
+ export const listStyles = StyleSheet.create((theme: Theme) => {
151
+ // Apply extensions to main visual elements
152
+
153
+ return applyExtensions('List', theme, {container: createContainerStyles(theme),
154
+ item: createItemStyles(theme),
155
+ // Additional styles (merged from return)
156
+ // Minor utility styles (not extended)
157
+ itemContent: {
158
+ display: 'flex',
159
+ flexDirection: 'row',
160
+ alignItems: 'center',
161
+ flex: 1,
162
+ gap: 8,
163
+ },
164
+ leading: {
165
+ display: 'flex',
166
+ alignItems: 'center',
167
+ justifyContent: 'center',
168
+ marginRight: 8,
169
+ color: theme.colors.text.secondary,
170
+ variants: {
171
+ size: buildSizeVariants(theme, 'list', (size) => ({
172
+ width: size.iconSize,
173
+ height: size.iconSize,
174
+ })),
175
+ } as const,
176
+ } as const,
177
+ labelContainer: {
178
+ flex: 1,
179
+ display: 'flex',
180
+ flexDirection: 'column',
181
+ },
182
+ label: {
183
+ fontWeight: '500',
184
+ color: theme.colors.text.primary,
185
+ variants: {
186
+ size: buildSizeVariants(theme, 'list', (size) => ({
187
+ fontSize: size.labelFontSize,
188
+ lineHeight: size.labelLineHeight,
189
+ })),
190
+ disabled: {
191
+ true: {
192
+ color: theme.colors.text.secondary,
193
+ },
194
+ false: {},
195
+ },
196
+ selected: {
197
+ true: {
198
+ color: theme.intents.primary.primary,
199
+ fontWeight: '600',
200
+ },
201
+ false: {},
202
+ },
203
+ },
204
+ },
205
+ trailing: {
206
+ display: 'flex',
207
+ alignItems: 'center',
208
+ justifyContent: 'center',
209
+ marginLeft: 8,
210
+ color: theme.colors.text.secondary,
211
+ flexShrink: 0,
212
+ },
213
+ trailingIcon: {
214
+ display: 'flex',
215
+ alignItems: 'center',
216
+ justifyContent: 'center',
217
+ variants: {
218
+ size: buildSizeVariants(theme, 'list', (size) => ({
219
+ width: size.iconSize,
220
+ height: size.iconSize,
221
+ })),
222
+ },
223
+ },
224
+ section: {
225
+ display: 'flex',
226
+ flexDirection: 'column',
227
+ },
228
+ sectionTitle: {
229
+ fontWeight: '600',
230
+ fontSize: 12,
231
+ lineHeight: 16,
232
+ textTransform: 'uppercase',
233
+ letterSpacing: 0.5,
234
+ color: theme.colors.text.secondary,
235
+ padding: 8,
236
+ paddingBottom: 4,
237
+ },
238
+ sectionContent: {
239
+ display: 'flex',
240
+ flexDirection: 'column',
241
+ }});
242
+ });
@@ -1,248 +1,212 @@
1
- import { StyleSheet } from 'react-native-unistyles';
2
- import { Theme } 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';
14
- import { applyExtensions } from '../extensions/applyExtension';
15
-
16
- type ListVariants = {
17
- type: ListType;
18
- size: ListSizeVariant;
19
- scrollable: boolean;
20
- active: boolean;
21
- selected: boolean;
22
- disabled: boolean;
23
- clickable: boolean;
24
- };
25
-
26
1
  /**
27
- * Create type variants for container
2
+ * List styles using defineStyle with dynamic props.
28
3
  */
29
- function createContainerTypeVariants(theme: Theme) {
30
- return {
31
- default: {
32
- backgroundColor: 'transparent',
33
- },
34
- bordered: {
35
- backgroundColor: theme.colors.surface.primary,
36
- borderWidth: 1,
37
- borderColor: theme.colors.border.primary,
38
- borderRadius: 8,
39
- _web: {
40
- overflow: 'hidden',
41
- border: `1px solid ${theme.colors.border.primary}`,
42
- },
43
- },
44
- divided: {
45
- backgroundColor: 'transparent',
46
- },
47
- };
48
- }
4
+ import { StyleSheet } from 'react-native-unistyles';
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;
49
11
 
12
+ // Wrap theme for $iterator support
13
+ type Theme = ThemeStyleWrapper<BaseTheme>;
50
14
 
51
- type ItemDynamicProps = {
15
+ type ListType = 'default' | 'bordered' | 'divided';
16
+
17
+ export type ListDynamicProps = {
18
+ size?: Size;
52
19
  type?: ListType;
20
+ scrollable?: boolean;
21
+ active?: boolean;
22
+ selected?: boolean;
53
23
  disabled?: boolean;
54
24
  clickable?: boolean;
25
+ gap?: ViewStyleSize;
26
+ padding?: ViewStyleSize;
27
+ paddingVertical?: ViewStyleSize;
28
+ paddingHorizontal?: ViewStyleSize;
29
+ margin?: ViewStyleSize;
30
+ marginVertical?: ViewStyleSize;
31
+ marginHorizontal?: ViewStyleSize;
55
32
  };
56
33
 
57
34
  /**
58
- * Get item hover styles based on disabled and clickable state
35
+ * List styles with type/state handling.
59
36
  */
60
- function getItemHoverStyles(theme: Theme, disabled: boolean, clickable: boolean) {
61
- if (disabled || !clickable) {
62
- return {
37
+ export const listStyles = defineStyle('List', (theme: Theme) => ({
38
+ container: ({ type = 'default', scrollable = false }: ListDynamicProps) => {
39
+ const typeStyles = type === 'bordered' ? {
40
+ backgroundColor: theme.colors.surface.primary,
41
+ borderWidth: 1,
42
+ borderColor: theme.colors.border.primary,
43
+ borderRadius: 8,
44
+ } : {
63
45
  backgroundColor: 'transparent',
64
- borderRadius: 0,
65
46
  };
66
- }
67
- return {
68
- backgroundColor: theme.colors.surface.secondary,
69
- borderRadius: 4,
70
- };
71
- }
72
-
73
47
 
74
- // Container style creator for extension support
75
- function createContainerStyles(theme: Theme) {
76
- return () => ({
77
- display: 'flex' as const,
78
- flexDirection: 'column' as const,
79
- width: '100%',
80
- variants: {
81
- type: createContainerTypeVariants(theme),
82
- scrollable: {
83
- true: {
84
- _web: {
85
- overflow: 'auto',
86
- },
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,
56
+ },
57
+ padding: {
58
+ padding: theme.sizes.$view.padding,
59
+ },
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,
87
74
  },
88
- false: {},
89
75
  },
90
- // Spacing variants from ContainerStyleProps
91
- gap: buildGapVariants(theme),
92
- padding: buildPaddingVariants(theme),
93
- paddingVertical: buildPaddingVerticalVariants(theme),
94
- paddingHorizontal: buildPaddingHorizontalVariants(theme),
95
- margin: buildMarginVariants(theme),
96
- marginVertical: buildMarginVerticalVariants(theme),
97
- marginHorizontal: buildMarginHorizontalVariants(theme),
98
- },
99
- });
100
- }
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
+ },
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
+ };
92
+
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
+ } : {};
101
103
 
102
- // Item style creator for extension support
103
- function createItemStyles(theme: Theme) {
104
- return ({ type = 'default', disabled = false, clickable = true }: ItemDynamicProps) => {
105
- const hoverStyles = getItemHoverStyles(theme, disabled, clickable);
106
104
  return {
107
- display: 'flex',
108
- flexDirection: 'row',
109
- alignItems: 'center',
110
- backgroundColor: 'transparent',
111
- textAlign: 'left',
112
- borderBottomWidth: type === 'divided' ? 1 : 0,
113
- borderBottomStyle: type === 'divided' ? 'solid' as const : undefined,
114
- borderBottomColor: type === 'divided' ? theme.colors.border.primary : undefined,
105
+ ...baseStyles,
106
+ ...dividerStyles,
107
+ ...selectedStyles,
115
108
  variants: {
116
- size: buildSizeVariants(theme, 'list', (size) => ({
117
- paddingVertical: size.paddingVertical,
118
- paddingHorizontal: size.paddingHorizontal,
119
- minHeight: size.minHeight,
120
- })),
121
- active: {
122
- true: {
123
- backgroundColor: theme.colors.surface.secondary,
124
- },
125
- false: {},
109
+ size: {
110
+ paddingVertical: theme.sizes.$list.paddingVertical,
111
+ paddingHorizontal: theme.sizes.$list.paddingHorizontal,
112
+ minHeight: theme.sizes.$list.minHeight,
126
113
  },
127
- selected: {
128
- true: {
129
- backgroundColor: theme.intents.primary.light + '20',
130
- borderLeftWidth: 3,
131
- borderLeftColor: theme.intents.primary.primary,
132
- _web: {
133
- borderLeft: `3px solid ${theme.intents.primary.primary}`,
134
- },
135
- },
136
- false: {},
137
- },
138
- } as const,
139
- opacity: disabled ? 0.5 : 1,
114
+ },
140
115
  _web: {
141
116
  border: 'none',
142
117
  cursor: disabled ? 'not-allowed' : (clickable ? 'pointer' : 'default'),
143
118
  outline: 'none',
144
119
  transition: 'background-color 0.2s ease, border-color 0.2s ease',
145
120
  borderBottom: type === 'divided' ? `1px solid ${theme.colors.border.primary}` : undefined,
146
- _hover: hoverStyles,
121
+ borderLeft: selected ? `3px solid ${theme.intents.primary.primary}` : undefined,
122
+ _hover: (disabled || !clickable) ? {} : {
123
+ backgroundColor: theme.colors.surface.secondary,
124
+ borderRadius: 4,
125
+ },
147
126
  },
148
127
  } as const;
149
- };
150
- }
151
-
152
- export const listStyles = StyleSheet.create((theme: Theme) => {
153
- // Apply extensions to main visual elements
154
- const extended = applyExtensions('List', theme, {
155
- container: createContainerStyles(theme),
156
- item: createItemStyles(theme),
157
- });
158
-
159
- return {
160
- ...extended,
161
- // Minor utility styles (not extended)
162
- itemContent: {
163
- display: 'flex',
164
- flexDirection: 'row',
165
- alignItems: 'center',
166
- flex: 1,
167
- gap: 8,
168
- },
169
- leading: {
170
- display: 'flex',
171
- alignItems: 'center',
172
- justifyContent: 'center',
173
- marginRight: 8,
174
- color: theme.colors.text.secondary,
175
- variants: {
176
- size: buildSizeVariants(theme, 'list', (size) => ({
177
- width: size.iconSize,
178
- height: size.iconSize,
179
- })),
180
- } as const,
181
- } as const,
182
- labelContainer: {
183
- flex: 1,
184
- display: 'flex',
185
- flexDirection: 'column',
186
- },
187
- label: {
188
- fontWeight: '500',
189
- color: theme.colors.text.primary,
190
- variants: {
191
- size: buildSizeVariants(theme, 'list', (size) => ({
192
- fontSize: size.labelFontSize,
193
- lineHeight: size.labelLineHeight,
194
- })),
195
- disabled: {
196
- true: {
197
- color: theme.colors.text.secondary,
198
- },
199
- false: {},
200
- },
201
- selected: {
202
- true: {
203
- color: theme.intents.primary.primary,
204
- fontWeight: '600',
205
- },
206
- false: {},
207
- },
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,
208
149
  },
209
150
  },
210
- trailing: {
211
- display: 'flex',
212
- alignItems: 'center',
213
- justifyContent: 'center',
214
- marginLeft: 8,
215
- color: theme.colors.text.secondary,
216
- flexShrink: 0,
217
- },
218
- trailingIcon: {
219
- display: 'flex',
220
- alignItems: 'center',
221
- justifyContent: 'center',
222
- variants: {
223
- size: buildSizeVariants(theme, 'list', (size) => ({
224
- width: size.iconSize,
225
- height: size.iconSize,
226
- })),
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,
227
166
  },
228
167
  },
229
- section: {
230
- display: 'flex',
231
- flexDirection: 'column',
232
- },
233
- sectionTitle: {
234
- fontWeight: '600',
235
- fontSize: 12,
236
- lineHeight: 16,
237
- textTransform: 'uppercase',
238
- letterSpacing: 0.5,
239
- color: theme.colors.text.secondary,
240
- padding: 8,
241
- paddingBottom: 4,
242
- },
243
- sectionContent: {
244
- display: 'flex',
245
- 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
+ },
246
189
  },
247
- };
248
- });
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
+ }));