@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,339 +1,290 @@
1
+ /**
2
+ * Select styles using defineStyle with dynamic props.
3
+ */
1
4
  import { StyleSheet } from 'react-native-unistyles';
2
- import { Theme, StylesheetStyles, Intent, Size } from '@idealyst/theme';
3
- import { buildSizeVariants } from '../utils/buildSizeVariants';
4
- import {
5
- buildMarginVariants,
6
- buildMarginVerticalVariants,
7
- buildMarginHorizontalVariants,
8
- } from '../utils/buildViewStyleVariants';
9
- import { SelectIntentVariant } from './types';
5
+ import { defineStyle, ThemeStyleWrapper } from '@idealyst/theme';
6
+ import type { Theme as BaseTheme, Intent, Size } from '@idealyst/theme';
7
+ import { ViewStyleSize } from '../utils/viewStyleProps';
10
8
 
11
- // Type definitions
12
- type SelectSize = Size;
13
- type SelectType = 'outlined' | 'filled';
9
+ // Required: Unistyles must see StyleSheet usage in original source to process this file
10
+ void StyleSheet;
14
11
 
15
- type SelectTriggerVariants = {
16
- type: SelectType;
17
- size: SelectSize;
18
- intent: SelectIntentVariant;
19
- disabled: boolean;
20
- error: boolean;
21
- focused: boolean;
22
- }
12
+ // Wrap theme for $iterator support
13
+ type Theme = ThemeStyleWrapper<BaseTheme>;
23
14
 
15
+ type SelectType = 'outlined' | 'filled';
24
16
 
25
- export type ExpandedSelectTriggerStyles = StylesheetStyles<keyof SelectTriggerVariants>;
26
- export type ExpandedSelectStyles = StylesheetStyles<never>;
17
+ export type SelectDynamicProps = {
18
+ size?: Size;
19
+ intent?: Intent;
20
+ type?: SelectType;
21
+ disabled?: boolean;
22
+ error?: boolean;
23
+ focused?: boolean;
24
+ margin?: ViewStyleSize;
25
+ marginVertical?: ViewStyleSize;
26
+ marginHorizontal?: ViewStyleSize;
27
+ };
27
28
 
28
- function createTriggerTypeVariants(theme: Theme) {
29
- return {
30
- outlined: {
31
- backgroundColor: theme.colors.surface.primary,
32
- borderColor: theme.colors.border.primary,
33
- _web: {
34
- border: `1px solid ${theme.colors.border.primary}`,
29
+ /**
30
+ * Select styles with type/intent/error/focused handling.
31
+ */
32
+ export const selectStyles = defineStyle('Select', (theme: Theme) => ({
33
+ container: (_props: SelectDynamicProps) => ({
34
+ position: 'relative' as const,
35
+ variants: {
36
+ margin: {
37
+ margin: theme.sizes.$view.padding,
35
38
  },
36
- },
37
- filled: {
38
- backgroundColor: theme.colors.surface.secondary,
39
- borderColor: 'transparent',
40
- _web: {
41
- border: '1px solid transparent',
39
+ marginVertical: {
40
+ marginVertical: theme.sizes.$view.padding,
41
+ },
42
+ marginHorizontal: {
43
+ marginHorizontal: theme.sizes.$view.padding,
42
44
  },
43
45
  },
44
- } as const;
45
- }
46
+ }),
46
47
 
47
- function createTriggerSizeVariants(theme: Theme) {
48
- return buildSizeVariants(theme, 'select', (size) => ({
49
- paddingHorizontal: size.paddingHorizontal,
50
- minHeight: size.minHeight,
51
- }));
52
- }
48
+ label: (_props: SelectDynamicProps) => ({
49
+ fontSize: 14,
50
+ fontWeight: '500' as const,
51
+ color: theme.colors.text.primary,
52
+ marginBottom: 4,
53
+ }),
53
54
 
54
- function createIntentVariants(theme: Theme, type: SelectType, intent: SelectIntentVariant) {
55
- if (intent === 'neutral') {
56
- return {};
57
- }
55
+ trigger: ({ type = 'outlined', intent = 'neutral', disabled = false, error = false, focused = false }: SelectDynamicProps) => {
56
+ const intentValue = theme.intents[intent];
57
+ const primaryIntent = theme.intents.primary;
58
+ const errorColor = theme.intents.error.primary;
58
59
 
59
- const intentValue = (theme.intents as any)[intent];
60
+ // Background based on type
61
+ const backgroundColor = type === 'filled'
62
+ ? theme.colors.surface.secondary
63
+ : theme.colors.surface.primary;
60
64
 
61
- if (type === 'outlined') {
62
- return {
63
- borderColor: intentValue.primary,
64
- _web: {
65
- border: `1px solid ${intentValue.primary}`,
66
- },
67
- } as const;
68
- }
69
-
70
- return {} as const;
71
- }
72
-
73
- function buildDynamicTriggerStyles(theme: Theme) {
74
- return ({ type, intent }: Partial<SelectTriggerVariants>) => {
75
- const intentStyles = createIntentVariants(theme, type, intent);
65
+ // Border color based on state
66
+ let borderColor = type === 'filled' ? 'transparent' : theme.colors.border.primary;
67
+ if (error) {
68
+ borderColor = errorColor;
69
+ } else if (focused) {
70
+ borderColor = primaryIntent.primary;
71
+ } else if (intent !== 'neutral') {
72
+ borderColor = intentValue.primary;
73
+ }
76
74
 
77
75
  return {
78
- position: 'relative',
79
- flexDirection: 'row',
80
- alignItems: 'center',
81
- justifyContent: 'space-between',
76
+ position: 'relative' as const,
77
+ flexDirection: 'row' as const,
78
+ alignItems: 'center' as const,
79
+ justifyContent: 'space-between' as const,
82
80
  borderRadius: 8,
83
81
  borderWidth: 1,
84
- borderStyle: 'solid',
85
- ...intentStyles,
82
+ borderStyle: 'solid' as const,
83
+ backgroundColor,
84
+ borderColor,
85
+ opacity: disabled ? 0.6 : 1,
86
86
  variants: {
87
- type: createTriggerTypeVariants(theme),
88
- size: createTriggerSizeVariants(theme),
89
- disabled: {
90
- true: {
91
- opacity: 0.6,
92
- _web: {
93
- cursor: 'not-allowed',
94
- },
95
- },
96
- false: {
97
- _web: {
98
- cursor: 'pointer',
99
- _hover: {
100
- opacity: 0.9,
101
- },
102
- _active: {
103
- opacity: 0.8,
104
- },
105
- },
106
- },
107
- },
108
- error: {
109
- true: {
110
- borderColor: theme.intents.error.primary,
111
- _web: {
112
- border: `1px solid ${theme.intents.error.primary}`,
113
- },
114
- },
115
- false: {},
116
- },
117
- focused: {
118
- true: {
119
- borderColor: theme.intents.primary.primary,
120
- _web: {
121
- border: `1px solid ${theme.intents.primary.primary}`,
122
- boxShadow: `0 0 0 2px ${theme.intents.primary.primary}20`,
123
- outline: 'none',
124
- },
125
- },
126
- false: {},
87
+ size: {
88
+ paddingHorizontal: theme.sizes.$select.paddingHorizontal,
89
+ minHeight: theme.sizes.$select.minHeight,
127
90
  },
128
91
  },
129
92
  _web: {
130
93
  display: 'flex',
131
94
  boxSizing: 'border-box',
132
- _focus: {
133
- outline: 'none',
134
- },
95
+ cursor: disabled ? 'not-allowed' : 'pointer',
96
+ border: `1px solid ${borderColor}`,
97
+ boxShadow: focused ? `0 0 0 2px ${primaryIntent.primary}20` : 'none',
98
+ transition: 'border-color 0.2s ease, box-shadow 0.2s ease',
99
+ _hover: disabled ? {} : { opacity: 0.9 },
100
+ _active: disabled ? {} : { opacity: 0.8 },
101
+ _focus: { outline: 'none' },
135
102
  },
136
103
  } as const;
137
- }
138
- }
104
+ },
139
105
 
140
- // Styles are inlined here instead of in @idealyst/theme because Unistyles' Babel
141
- // transform on native cannot resolve function calls to extract variant structures.
142
- export const selectStyles = StyleSheet.create((theme: Theme) => {
143
- return {
144
- container: {
145
- position: 'relative',
146
- variants: {
147
- // Spacing variants from FormInputStyleProps
148
- margin: buildMarginVariants(theme),
149
- marginVertical: buildMarginVerticalVariants(theme),
150
- marginHorizontal: buildMarginHorizontalVariants(theme),
151
- },
152
- },
153
- label: {
154
- fontSize: 14,
155
- fontWeight: '500',
156
- color: theme.colors.text.primary,
157
- marginBottom: 4,
158
- },
159
- trigger: buildDynamicTriggerStyles(theme),
160
- triggerContent: {
161
- flex: 1,
162
- flexDirection: 'row',
163
- alignItems: 'center',
164
- },
165
- triggerText: {
166
- color: theme.colors.text.primary,
167
- flex: 1,
168
- variants: {
169
- size: buildSizeVariants(theme, 'select', (size: any) => ({
170
- fontSize: size.fontSize,
171
- })),
106
+ triggerContent: (_props: SelectDynamicProps) => ({
107
+ flex: 1,
108
+ flexDirection: 'row' as const,
109
+ alignItems: 'center' as const,
110
+ }),
111
+
112
+ triggerText: (_props: SelectDynamicProps) => ({
113
+ color: theme.colors.text.primary,
114
+ flex: 1,
115
+ variants: {
116
+ size: {
117
+ fontSize: theme.sizes.$select.fontSize,
172
118
  },
173
119
  },
174
- placeholder: {
175
- color: theme.colors.text.secondary,
176
- variants: {
177
- size: buildSizeVariants(theme, 'select', (size: any) => ({
178
- fontSize: size.fontSize,
179
- })),
120
+ }),
121
+
122
+ placeholder: (_props: SelectDynamicProps) => ({
123
+ color: theme.colors.text.secondary,
124
+ variants: {
125
+ size: {
126
+ fontSize: theme.sizes.$select.fontSize,
180
127
  },
181
128
  },
182
- icon: {
183
- marginLeft: 4,
184
- color: theme.colors.text.secondary,
185
- },
186
- chevron: {
187
- display: 'flex',
188
- alignItems: 'center',
189
- justifyContent: 'center',
190
- marginLeft: 4,
191
- color: theme.colors.text.secondary,
192
- variants: {
193
- size: buildSizeVariants(theme, 'select', (size: any) => ({
194
- width: size.iconSize,
195
- height: size.iconSize,
196
- })),
197
- },
198
- _web: {
199
- transition: 'transform 0.2s ease',
129
+ }),
130
+
131
+ icon: (_props: SelectDynamicProps) => ({
132
+ marginLeft: 4,
133
+ color: theme.colors.text.secondary,
134
+ }),
135
+
136
+ chevron: (_props: SelectDynamicProps) => ({
137
+ display: 'flex' as const,
138
+ alignItems: 'center' as const,
139
+ justifyContent: 'center' as const,
140
+ marginLeft: 4,
141
+ color: theme.colors.text.secondary,
142
+ variants: {
143
+ size: {
144
+ width: theme.sizes.$select.iconSize,
145
+ height: theme.sizes.$select.iconSize,
200
146
  },
201
147
  },
202
- chevronOpen: {
203
- _web: {
204
- transform: 'rotate(180deg)',
205
- }
148
+ _web: {
149
+ transition: 'transform 0.2s ease',
206
150
  },
207
- dropdown: {
208
- position: 'absolute',
209
- top: '100%',
210
- left: 0,
211
- right: 0,
212
- backgroundColor: theme.colors.surface.primary,
213
- borderRadius: 8,
214
- borderWidth: 1,
215
- borderStyle: 'solid',
216
- borderColor: theme.colors.border.primary,
217
- shadowColor: '#000',
218
- shadowOffset: { width: 0, height: 8 },
219
- shadowOpacity: 0.1,
220
- shadowRadius: 24,
221
- elevation: 8,
222
- zIndex: 9999,
223
- maxHeight: 240,
224
- minWidth: 200,
225
- overflow: 'hidden',
226
- _web: {
227
- border: `1px solid ${theme.colors.border.primary}`,
228
- boxShadow: '0 8px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06)',
229
- overflowY: 'auto',
230
- },
231
- },
232
- searchContainer: {
233
- padding: 8,
234
- borderBottomWidth: 1,
235
- borderBottomStyle: 'solid',
236
- borderBottomColor: theme.colors.border.primary,
237
- _web: {
238
- borderBottom: `1px solid ${theme.colors.border.primary}`,
239
- },
240
- },
241
- searchInput: {
242
- padding: 4,
243
- borderRadius: 4,
244
- borderWidth: 1,
245
- borderStyle: 'solid',
246
- borderColor: theme.colors.border.primary,
247
- backgroundColor: theme.colors.surface.primary,
248
- variants: {
249
- size: buildSizeVariants(theme, 'select', (size: any) => ({
250
- fontSize: size.fontSize,
251
- })),
252
- },
253
- _web: {
254
- border: `1px solid ${theme.colors.border.primary}`,
255
- outline: 'none',
256
- _focus: {
257
- borderColor: theme.intents.primary.primary,
258
- },
259
- },
151
+ }),
152
+
153
+ chevronOpen: (_props: SelectDynamicProps) => ({
154
+ _web: {
155
+ transform: 'rotate(180deg)',
260
156
  },
261
- optionsList: {
262
- paddingVertical: 4,
157
+ }),
158
+
159
+ dropdown: (_props: SelectDynamicProps) => ({
160
+ position: 'absolute' as const,
161
+ top: '100%',
162
+ left: 0,
163
+ right: 0,
164
+ backgroundColor: theme.colors.surface.primary,
165
+ borderRadius: 8,
166
+ borderWidth: 1,
167
+ borderStyle: 'solid' as const,
168
+ borderColor: theme.colors.border.primary,
169
+ shadowColor: '#000',
170
+ shadowOffset: { width: 0, height: 8 },
171
+ shadowOpacity: 0.1,
172
+ shadowRadius: 24,
173
+ elevation: 8,
174
+ zIndex: 9999,
175
+ maxHeight: 240,
176
+ minWidth: 200,
177
+ overflow: 'hidden' as const,
178
+ _web: {
179
+ border: `1px solid ${theme.colors.border.primary}`,
180
+ boxShadow: '0 8px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06)',
181
+ overflowY: 'auto',
263
182
  },
264
- option: {
265
- paddingHorizontal: 8,
266
- paddingVertical: 4,
267
- flexDirection: 'row',
268
- alignItems: 'center',
269
- minHeight: 36,
270
- _web: {
271
- display: 'flex',
272
- cursor: 'pointer',
273
- _hover: {
274
- backgroundColor: theme.colors.surface.secondary,
275
- },
276
- _active: {
277
- opacity: 0.8,
278
- },
279
- },
183
+ }),
184
+
185
+ searchContainer: (_props: SelectDynamicProps) => ({
186
+ padding: 8,
187
+ borderBottomWidth: 1,
188
+ borderBottomColor: theme.colors.border.primary,
189
+ _web: {
190
+ borderBottom: `1px solid ${theme.colors.border.primary}`,
280
191
  },
281
- optionFocused: {
282
- backgroundColor: theme.interaction.focusedBackground,
283
- _web: {
284
- outline: `1px solid ${theme.interaction.focusBorder}`,
285
- outlineOffset: -1,
192
+ }),
193
+
194
+ searchInput: (_props: SelectDynamicProps) => ({
195
+ padding: 4,
196
+ borderRadius: 4,
197
+ borderWidth: 1,
198
+ borderStyle: 'solid' as const,
199
+ borderColor: theme.colors.border.primary,
200
+ backgroundColor: theme.colors.surface.primary,
201
+ variants: {
202
+ size: {
203
+ fontSize: theme.sizes.$select.fontSize,
286
204
  },
287
205
  },
288
- optionDisabled: {
289
- opacity: theme.interaction.opacity.disabled,
290
- _web: {
291
- cursor: 'not-allowed',
206
+ _web: {
207
+ border: `1px solid ${theme.colors.border.primary}`,
208
+ outline: 'none',
209
+ _focus: {
210
+ borderColor: theme.intents.primary.primary,
292
211
  },
293
212
  },
294
- optionContent: {
295
- flexDirection: 'row',
296
- alignItems: 'center',
297
- flex: 1,
298
- },
299
- optionIcon: {
300
- marginRight: 4,
213
+ }),
214
+
215
+ optionsList: (_props: SelectDynamicProps) => ({
216
+ paddingVertical: 4,
217
+ }),
218
+
219
+ option: ({ disabled = false }: SelectDynamicProps) => ({
220
+ paddingHorizontal: 8,
221
+ paddingVertical: 4,
222
+ flexDirection: 'row' as const,
223
+ alignItems: 'center' as const,
224
+ minHeight: 36,
225
+ opacity: disabled ? theme.interaction.opacity.disabled : 1,
226
+ _web: {
227
+ display: 'flex',
228
+ cursor: disabled ? 'not-allowed' : 'pointer',
229
+ _hover: disabled ? {} : { backgroundColor: theme.colors.surface.secondary },
230
+ _active: disabled ? {} : { opacity: 0.8 },
301
231
  },
302
- optionText: {
303
- color: theme.colors.text.primary,
304
- flex: 1,
305
- variants: {
306
- size: buildSizeVariants(theme, 'select', (size: any) => ({
307
- fontSize: size.fontSize,
308
- })),
309
- },
232
+ }),
233
+
234
+ optionFocused: (_props: SelectDynamicProps) => ({
235
+ backgroundColor: theme.interaction.focusedBackground,
236
+ _web: {
237
+ outline: `1px solid ${theme.interaction.focusBorder}`,
238
+ outlineOffset: -1,
310
239
  },
311
- optionTextDisabled: {
312
- color: theme.colors.text.secondary,
240
+ }),
241
+
242
+ optionDisabled: (_props: SelectDynamicProps) => ({
243
+ opacity: theme.interaction.opacity.disabled,
244
+ _web: {
245
+ cursor: 'not-allowed',
313
246
  },
314
- helperText: {
315
- fontSize: 12,
316
- marginTop: 4,
317
- color: theme.colors.text.secondary,
318
- variants: {
319
- error: {
320
- true: {
321
- color: theme.intents.error.primary,
322
- },
323
- false: {},
324
- },
247
+ }),
248
+
249
+ optionContent: (_props: SelectDynamicProps) => ({
250
+ flexDirection: 'row' as const,
251
+ alignItems: 'center' as const,
252
+ flex: 1,
253
+ }),
254
+
255
+ optionIcon: (_props: SelectDynamicProps) => ({
256
+ marginRight: 4,
257
+ }),
258
+
259
+ optionText: (_props: SelectDynamicProps) => ({
260
+ color: theme.colors.text.primary,
261
+ flex: 1,
262
+ variants: {
263
+ size: {
264
+ fontSize: theme.sizes.$select.fontSize,
325
265
  },
326
266
  },
327
- overlay: {
328
- position: 'absolute',
329
- top: 0,
330
- left: 0,
331
- right: 0,
332
- bottom: 0,
333
- zIndex: 999,
334
- _web: {
335
- position: 'fixed',
336
- },
267
+ }),
268
+
269
+ optionTextDisabled: (_props: SelectDynamicProps) => ({
270
+ color: theme.colors.text.secondary,
271
+ }),
272
+
273
+ helperText: ({ error = false }: SelectDynamicProps) => ({
274
+ fontSize: 12,
275
+ marginTop: 4,
276
+ color: error ? theme.intents.error.primary : theme.colors.text.secondary,
277
+ }),
278
+
279
+ overlay: (_props: SelectDynamicProps) => ({
280
+ position: 'absolute' as const,
281
+ top: 0,
282
+ left: 0,
283
+ right: 0,
284
+ bottom: 0,
285
+ zIndex: 999,
286
+ _web: {
287
+ position: 'fixed',
337
288
  },
338
- } as const;
339
- });
289
+ }),
290
+ }));
@@ -176,12 +176,12 @@ const Select = forwardRef<HTMLDivElement, SelectProps>(({
176
176
  };
177
177
 
178
178
  const containerWebProps = getWebProps([
179
- selectStyles.container,
179
+ (selectStyles.container as any)({}),
180
180
  style as any
181
181
  ]);
182
182
 
183
183
  const triggerWebProps = getWebProps([
184
- selectStyles.trigger({ type, intent }),
184
+ (selectStyles.trigger as any)({ type, intent }),
185
185
  ]);
186
186
 
187
187
  const handleClose = () => {
@@ -247,7 +247,7 @@ const Select = forwardRef<HTMLDivElement, SelectProps>(({
247
247
  zIndex={1000}
248
248
  >
249
249
  <div
250
- {...getWebProps([selectStyles.dropdown])}
250
+ {...getWebProps([(selectStyles.dropdown as any)({})])}
251
251
  style={{
252
252
  maxHeight: maxHeight,
253
253
  position: 'relative',
@@ -282,7 +282,7 @@ const Select = forwardRef<HTMLDivElement, SelectProps>(({
282
282
  aria-selected={option.value === value}
283
283
  onMouseEnter={() => setFocusedIndex(index)}
284
284
  {...getWebProps([
285
- selectStyles.option,
285
+ (selectStyles.option as any)({}),
286
286
  isFocused && selectStyles.optionFocused,
287
287
  option.disabled && selectStyles.optionDisabled,
288
288
  ])}
@@ -305,7 +305,7 @@ const Select = forwardRef<HTMLDivElement, SelectProps>(({
305
305
  })}
306
306
 
307
307
  {filteredOptions.length === 0 && (
308
- <div {...getWebProps([selectStyles.option])} style={{ cursor: 'default' }}>
308
+ <div {...getWebProps([(selectStyles.option as any)({})])} style={{ cursor: 'default' }}>
309
309
  <span {...getWebProps([selectStyles.optionText])}>
310
310
  No options found
311
311
  </span>