@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,5 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
- import { View as RNView, ScrollView as RNScrollView, SafeAreaView } from 'react-native';
2
+ import { View as RNView, ScrollView as RNScrollView } from 'react-native';
3
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
3
4
  import { ScreenProps } from './types';
4
5
  import { screenStyles } from './Screen.styles';
5
6
 
@@ -21,7 +22,9 @@ const Screen = forwardRef<RNView | RNScrollView, ScreenProps>(({
21
22
  testID,
22
23
  id,
23
24
  }, ref) => {
25
+ const insets = useSafeAreaInsets();
24
26
 
27
+ // Set active variants for this render
25
28
  screenStyles.useVariants({
26
29
  background,
27
30
  safeArea,
@@ -34,47 +37,47 @@ const Screen = forwardRef<RNView | RNScrollView, ScreenProps>(({
34
37
  marginHorizontal,
35
38
  });
36
39
 
37
- if (scrollable) {
38
- // For ScrollView, flex: 1 goes on the ScrollView style
39
- // Background and padding go on contentContainerStyle (without flex: 1)
40
- const scrollViewStyle = [{ flex: 1 }, style];
40
+ // Call styles as functions to get theme-reactive styles
41
+ const screenStyle = (screenStyles.screen as any)({});
42
+
43
+ // Calculate safe area padding
44
+ const safeAreaStyle = safeArea ? {
45
+ paddingTop: insets.top,
46
+ paddingBottom: insets.bottom,
47
+ paddingLeft: insets.left,
48
+ paddingRight: insets.right,
49
+ } : undefined;
41
50
 
42
- const contentContainerStyleArray = [
43
- screenStyles.screenContent,
44
- contentInset ? {
45
- paddingTop: contentInset.top,
46
- paddingBottom: contentInset.bottom,
47
- paddingLeft: contentInset.left,
48
- paddingRight: contentInset.right,
49
- } : undefined,
50
- ];
51
+ if (scrollable) {
52
+ // Content styles applied via View wrapper for Unistyles reactivity
53
+ // (contentContainerStyle isn't reactive, only style prop is)
54
+ const contentInsetStyle = contentInset ? {
55
+ paddingTop: (safeArea ? insets.top : 0) + (contentInset.top ?? 0),
56
+ paddingBottom: (safeArea ? insets.bottom : 0) + (contentInset.bottom ?? 0),
57
+ paddingLeft: (safeArea ? insets.left : 0) + (contentInset.left ?? 0),
58
+ paddingRight: (safeArea ? insets.right : 0) + (contentInset.right ?? 0),
59
+ } : safeAreaStyle;
51
60
 
52
61
  return (
53
62
  <RNScrollView
54
63
  ref={ref as any}
55
64
  nativeID={id}
56
- style={scrollViewStyle}
57
- contentContainerStyle={contentContainerStyleArray}
65
+ style={[screenStyle, style]}
66
+ contentContainerStyle={{ flexGrow: 1 }}
58
67
  testID={testID}
59
68
  >
60
- {children}
69
+ <RNView style={[contentInsetStyle, { flex: 1 }]}>
70
+ {children}
71
+ </RNView>
61
72
  </RNScrollView>
62
73
  );
63
74
  }
64
75
 
65
- const containerStyle = [screenStyles.screen, style];
66
-
67
- const view = (
68
- <RNView ref={ref as any} nativeID={id} style={containerStyle} testID={testID}>
76
+ return (
77
+ <RNView ref={ref as any} nativeID={id} style={[screenStyle, safeAreaStyle, style]} testID={testID}>
69
78
  {children}
70
79
  </RNView>
71
80
  );
72
-
73
- if (safeArea) {
74
- return <SafeAreaView style={{ flex: 1 }}>{view}</SafeAreaView>;
75
- }
76
-
77
- return view;
78
81
  });
79
82
 
80
83
  Screen.displayName = 'Screen';
@@ -0,0 +1,87 @@
1
+ import { StyleSheet } from 'react-native-unistyles';
2
+ import { Theme } from '@idealyst/theme';
3
+ import {
4
+ buildGapVariants,
5
+ buildPaddingVariants,
6
+ buildPaddingVerticalVariants,
7
+ buildPaddingHorizontalVariants,
8
+ buildMarginVariants,
9
+ buildMarginVerticalVariants,
10
+ buildMarginHorizontalVariants,
11
+ } from '../utils/buildViewStyleVariants';
12
+ import { applyExtensions } from '../extensions/applyExtension';
13
+
14
+ function generateBackgroundVariants(theme: Theme) {
15
+ return {
16
+ primary: { backgroundColor: theme.colors.surface.primary },
17
+ secondary: { backgroundColor: theme.colors.surface.secondary },
18
+ tertiary: { backgroundColor: theme.colors.surface.tertiary },
19
+ inverse: { backgroundColor: theme.colors.surface.inverse },
20
+ 'inverse-secondary': { backgroundColor: theme.colors.surface['inverse-secondary'] },
21
+ 'inverse-tertiary': { backgroundColor: theme.colors.surface['inverse-tertiary'] },
22
+ transparent: { backgroundColor: 'transparent' },
23
+ };
24
+ }
25
+
26
+ /**
27
+ * Create dynamic screen styles.
28
+ * Returns a function to ensure Unistyles can track theme changes.
29
+ */
30
+ function createScreenStyles(theme: Theme) {
31
+ return (_props?: {}) => ({
32
+ flex: 1,
33
+ variants: {
34
+ background: generateBackgroundVariants(theme),
35
+ safeArea: {
36
+ true: {},
37
+ false: {},
38
+ },
39
+ gap: buildGapVariants(theme),
40
+ padding: buildPaddingVariants(theme),
41
+ paddingVertical: buildPaddingVerticalVariants(theme),
42
+ paddingHorizontal: buildPaddingHorizontalVariants(theme),
43
+ margin: buildMarginVariants(theme),
44
+ marginVertical: buildMarginVerticalVariants(theme),
45
+ marginHorizontal: buildMarginHorizontalVariants(theme),
46
+ },
47
+ _web: {
48
+ overflow: 'auto',
49
+ display: 'flex',
50
+ flexDirection: 'column',
51
+ minHeight: '100%',
52
+ boxSizing: 'border-box',
53
+ },
54
+ });
55
+ }
56
+
57
+ /**
58
+ * Create dynamic screen content styles for ScrollView.
59
+ * No flex: 1 so content can grow beyond screen height.
60
+ */
61
+ function createScreenContentStyles(theme: Theme) {
62
+ return (_props?: {}) => ({
63
+ variants: {
64
+ background: generateBackgroundVariants(theme),
65
+ safeArea: {
66
+ true: {},
67
+ false: {},
68
+ },
69
+ gap: buildGapVariants(theme),
70
+ padding: buildPaddingVariants(theme),
71
+ paddingVertical: buildPaddingVerticalVariants(theme),
72
+ paddingHorizontal: buildPaddingHorizontalVariants(theme),
73
+ margin: buildMarginVariants(theme),
74
+ marginVertical: buildMarginVerticalVariants(theme),
75
+ marginHorizontal: buildMarginHorizontalVariants(theme),
76
+ },
77
+ });
78
+ }
79
+
80
+ // Styles use applyExtensions to enable theme extensions and ensure proper
81
+ // reactivity with Unistyles' native Shadow Tree updates.
82
+ export const screenStyles = StyleSheet.create((theme: Theme) => {
83
+ return applyExtensions('Screen', theme, {
84
+ screen: createScreenStyles(theme),
85
+ screenContent: createScreenContentStyles(theme),
86
+ });
87
+ });
@@ -1,76 +1,125 @@
1
+ /**
2
+ * Screen styles using defineStyle with $iterator expansion.
3
+ */
1
4
  import { StyleSheet } from 'react-native-unistyles';
2
- import { Theme } from '@idealyst/theme';
3
- import {
4
- buildGapVariants,
5
- buildPaddingVariants,
6
- buildPaddingVerticalVariants,
7
- buildPaddingHorizontalVariants,
8
- buildMarginVariants,
9
- buildMarginVerticalVariants,
10
- buildMarginHorizontalVariants,
11
- } from '../utils/buildViewStyleVariants';
5
+ import { defineStyle, ThemeStyleWrapper } from '@idealyst/theme';
6
+ import type { Theme as BaseTheme } from '@idealyst/theme';
7
+ import { ViewStyleSize } from '../utils/viewStyleProps';
12
8
 
13
- function generateBackgroundVariants(theme: Theme) {
14
- return {
15
- primary: { backgroundColor: theme.colors.surface.primary },
16
- secondary: { backgroundColor: theme.colors.surface.secondary },
17
- tertiary: { backgroundColor: theme.colors.surface.tertiary },
18
- inverse: { backgroundColor: theme.colors.surface.inverse },
19
- 'inverse-secondary': { backgroundColor: theme.colors.surface['inverse-secondary'] },
20
- 'inverse-tertiary': { backgroundColor: theme.colors.surface['inverse-tertiary'] },
21
- transparent: { backgroundColor: 'transparent' },
22
- };
23
- }
9
+ // Required: Unistyles must see StyleSheet usage in original source to process this file
10
+ void StyleSheet;
24
11
 
25
- // Styles are inlined here instead of in @idealyst/theme because Unistyles' Babel
26
- // transform on native cannot resolve function calls to extract variant structures.
27
- // @ts-ignore - TS language server needs restart to pick up theme structure changes
28
- export const screenStyles = StyleSheet.create((theme: Theme) => {
29
- return {
30
- screen: {
31
- flex: 1,
32
- backgroundColor: theme.colors.surface.primary,
33
- variants: {
34
- background: generateBackgroundVariants(theme),
35
- safeArea: {
36
- true: {},
37
- false: {},
12
+ // Wrap theme for $iterator support
13
+ type Theme = ThemeStyleWrapper<BaseTheme>;
14
+
15
+ type ScreenBackground = 'primary' | 'secondary' | 'tertiary' | 'inverse' | 'inverse-secondary' | 'inverse-tertiary' | 'transparent';
16
+
17
+ export type ScreenDynamicProps = {
18
+ background?: ScreenBackground;
19
+ safeArea?: boolean;
20
+ gap?: ViewStyleSize;
21
+ padding?: ViewStyleSize;
22
+ paddingVertical?: ViewStyleSize;
23
+ paddingHorizontal?: ViewStyleSize;
24
+ margin?: ViewStyleSize;
25
+ marginVertical?: ViewStyleSize;
26
+ marginHorizontal?: ViewStyleSize;
27
+ };
28
+
29
+ /**
30
+ * Screen styles with $iterator expansion for spacing variants.
31
+ *
32
+ * NOTE: Top-level theme access required for Unistyles reactivity.
33
+ */
34
+ export const screenStyles = defineStyle('Screen', (theme: Theme) => ({
35
+ screen: (_props: ScreenDynamicProps) => ({
36
+ flex: 1,
37
+ // Theme marker for Unistyles reactivity
38
+ backgroundColor: theme.colors.surface.primary,
39
+ variants: {
40
+ background: {
41
+ primary: { backgroundColor: theme.colors.surface.primary },
42
+ secondary: { backgroundColor: theme.colors.surface.secondary },
43
+ tertiary: { backgroundColor: theme.colors.surface.tertiary },
44
+ inverse: { backgroundColor: theme.colors.surface.inverse },
45
+ 'inverse-secondary': { backgroundColor: theme.colors.surface['inverse-secondary'] },
46
+ 'inverse-tertiary': { backgroundColor: theme.colors.surface['inverse-tertiary'] },
47
+ transparent: { backgroundColor: 'transparent' },
48
+ },
49
+ safeArea: {
50
+ true: {},
51
+ false: {},
52
+ },
53
+ // $iterator expands for each view size
54
+ gap: {
55
+ gap: theme.sizes.$view.spacing,
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,
74
+ },
38
75
  },
39
- // Spacing variants from ContainerStyleProps
40
- gap: buildGapVariants(theme),
41
- padding: buildPaddingVariants(theme),
42
- paddingVertical: buildPaddingVerticalVariants(theme),
43
- paddingHorizontal: buildPaddingHorizontalVariants(theme),
44
- margin: buildMarginVariants(theme),
45
- marginVertical: buildMarginVerticalVariants(theme),
46
- marginHorizontal: buildMarginHorizontalVariants(theme),
47
- },
48
- _web: {
49
- overflow: 'auto',
50
- display: 'flex',
51
- flexDirection: 'column',
52
- minHeight: '100%',
53
- boxSizing: 'border-box',
54
- },
55
- },
56
- // Content style for ScrollView - no flex: 1 so content can grow
57
- screenContent: {
58
- backgroundColor: theme.colors.surface.primary,
59
- variants: {
60
- background: generateBackgroundVariants(theme),
61
- safeArea: {
62
- true: {},
63
- false: {},
76
+ _web: {
77
+ overflow: 'auto',
78
+ display: 'flex',
79
+ flexDirection: 'column',
80
+ minHeight: '100%',
81
+ boxSizing: 'border-box',
82
+ },
83
+ }),
84
+
85
+ screenContent: (_props: ScreenDynamicProps) => ({
86
+ // Theme marker for Unistyles reactivity
87
+ backgroundColor: theme.colors.surface.primary,
88
+ variants: {
89
+ background: {
90
+ primary: { backgroundColor: theme.colors.surface.primary },
91
+ secondary: { backgroundColor: theme.colors.surface.secondary },
92
+ tertiary: { backgroundColor: theme.colors.surface.tertiary },
93
+ inverse: { backgroundColor: theme.colors.surface.inverse },
94
+ 'inverse-secondary': { backgroundColor: theme.colors.surface['inverse-secondary'] },
95
+ 'inverse-tertiary': { backgroundColor: theme.colors.surface['inverse-tertiary'] },
96
+ transparent: { backgroundColor: 'transparent' },
97
+ },
98
+ safeArea: {
99
+ true: {},
100
+ false: {},
101
+ },
102
+ gap: {
103
+ gap: theme.sizes.$view.spacing,
104
+ },
105
+ padding: {
106
+ padding: theme.sizes.$view.padding,
107
+ },
108
+ paddingVertical: {
109
+ paddingVertical: theme.sizes.$view.padding,
110
+ },
111
+ paddingHorizontal: {
112
+ paddingHorizontal: theme.sizes.$view.padding,
113
+ },
114
+ margin: {
115
+ margin: theme.sizes.$view.padding,
116
+ },
117
+ marginVertical: {
118
+ marginVertical: theme.sizes.$view.padding,
119
+ },
120
+ marginHorizontal: {
121
+ marginHorizontal: theme.sizes.$view.padding,
122
+ },
64
123
  },
65
- // Spacing variants from ContainerStyleProps
66
- gap: buildGapVariants(theme),
67
- padding: buildPaddingVariants(theme),
68
- paddingVertical: buildPaddingVerticalVariants(theme),
69
- paddingHorizontal: buildPaddingHorizontalVariants(theme),
70
- margin: buildMarginVariants(theme),
71
- marginVertical: buildMarginVerticalVariants(theme),
72
- marginHorizontal: buildMarginHorizontalVariants(theme),
73
- },
74
- },
75
- };
76
- });
124
+ }),
125
+ }));
@@ -32,8 +32,8 @@ const Screen = forwardRef<HTMLDivElement, ScreenProps>(({
32
32
  marginHorizontal,
33
33
  });
34
34
 
35
- // Use getWebProps to generate className and ref for web
36
- const webProps = getWebProps([screenStyles.screen, style as any]);
35
+ // Call style as function to get theme-reactive styles
36
+ const webProps = getWebProps([(screenStyles.screen as any)({}), style as any]);
37
37
 
38
38
  const mergedRef = useMergeRefs(ref, webProps.ref);
39
39
 
@@ -86,6 +86,27 @@ const Select = forwardRef<View, SelectProps>(({
86
86
  marginHorizontal,
87
87
  });
88
88
 
89
+ // Get dynamic styles - call as functions for theme reactivity
90
+ const containerStyle = (selectStyles.container as any)({});
91
+ const labelStyle = (selectStyles.label as any)({});
92
+ const triggerStyle = (selectStyles.trigger as any)({ type, intent, disabled, error, focused: isOpen });
93
+ const triggerContentStyle = (selectStyles.triggerContent as any)({});
94
+ const triggerTextStyle = (selectStyles.triggerText as any)({});
95
+ const placeholderStyle = (selectStyles.placeholder as any)({});
96
+ const iconStyle = (selectStyles.icon as any)({});
97
+ const chevronStyle = (selectStyles.chevron as any)({});
98
+ const dropdownStyle = (selectStyles.dropdown as any)({});
99
+ const searchContainerStyle = (selectStyles.searchContainer as any)({});
100
+ const searchInputStyle = (selectStyles.searchInput as any)({});
101
+ const optionsListStyle = (selectStyles.optionsList as any)({});
102
+ const optionStyle = (selectStyles.option as any)({});
103
+ const optionContentStyle = (selectStyles.optionContent as any)({});
104
+ const optionIconStyle = (selectStyles.optionIcon as any)({});
105
+ const optionTextStyle = (selectStyles.optionText as any)({});
106
+ const optionTextDisabledStyle = (selectStyles.optionTextDisabled as any)({});
107
+ const helperTextStyle = (selectStyles.helperText as any)({ error });
108
+ const overlayStyle = (selectStyles.overlay as any)({});
109
+
89
110
  const handleTriggerPress = () => {
90
111
  if (disabled) return;
91
112
 
@@ -158,10 +179,10 @@ const Select = forwardRef<View, SelectProps>(({
158
179
 
159
180
  const renderChevron = () => {
160
181
  return (
161
- <View style={selectStyles.chevron}>
182
+ <View style={chevronStyle}>
162
183
  <MaterialCommunityIcons
163
184
  name="chevron-down"
164
- style={selectStyles.chevron}
185
+ style={chevronStyle}
165
186
  />
166
187
  </View>
167
188
  );
@@ -172,7 +193,6 @@ const Select = forwardRef<View, SelectProps>(({
172
193
 
173
194
  // If it's a string, render as MaterialCommunityIcons
174
195
  if (typeof icon === 'string') {
175
- const iconStyle = selectStyles.icon;
176
196
  return (
177
197
  <View style={iconStyle}>
178
198
  <MaterialCommunityIcons
@@ -184,7 +204,7 @@ const Select = forwardRef<View, SelectProps>(({
184
204
  }
185
205
 
186
206
  // Otherwise render the React element directly
187
- return <View style={selectStyles.icon}>{icon}</View>;
207
+ return <View style={iconStyle}>{icon}</View>;
188
208
  };
189
209
 
190
210
  const renderOptionIcon = (icon: any) => {
@@ -192,11 +212,10 @@ const Select = forwardRef<View, SelectProps>(({
192
212
 
193
213
  // If it's a string, render as MaterialCommunityIcons
194
214
  if (typeof icon === 'string') {
195
- const iconStyle = selectStyles.optionIcon;
196
215
  return (
197
- <View style={iconStyle}>
216
+ <View style={optionIconStyle}>
198
217
  <MaterialCommunityIcons
199
- style={iconStyle}
218
+ style={optionIconStyle}
200
219
  name={icon}
201
220
  />
202
221
  </View>
@@ -204,7 +223,7 @@ const Select = forwardRef<View, SelectProps>(({
204
223
  }
205
224
 
206
225
  // Otherwise render the React element directly
207
- return <View style={selectStyles.optionIcon}>{icon}</View>;
226
+ return <View style={optionIconStyle}>{icon}</View>;
208
227
  };
209
228
 
210
229
  const renderDropdown = () => {
@@ -222,7 +241,7 @@ const Select = forwardRef<View, SelectProps>(({
222
241
  onRequestClose={closeDropdown}
223
242
  >
224
243
  <Pressable
225
- style={selectStyles.overlay}
244
+ style={overlayStyle}
226
245
  onPress={closeDropdown}
227
246
  >
228
247
  <BoundedModalContent
@@ -233,7 +252,7 @@ const Select = forwardRef<View, SelectProps>(({
233
252
  >
234
253
  <Animated.View
235
254
  style={[
236
- selectStyles.dropdown,
255
+ dropdownStyle,
237
256
  {
238
257
  position: 'relative', // Override absolute positioning from styles
239
258
  top: 0, // Override top: '100%' from styles
@@ -246,9 +265,9 @@ const Select = forwardRef<View, SelectProps>(({
246
265
  onLayout={handleDropdownLayout}
247
266
  >
248
267
  {searchable && (
249
- <View style={selectStyles.searchContainer}>
268
+ <View style={searchContainerStyle}>
250
269
  <TextInput
251
- style={selectStyles.searchInput}
270
+ style={searchInputStyle}
252
271
  placeholder="Search options..."
253
272
  value={searchTerm}
254
273
  onChangeText={handleSearchChange}
@@ -258,23 +277,23 @@ const Select = forwardRef<View, SelectProps>(({
258
277
  )}
259
278
 
260
279
  <ScrollView
261
- style={selectStyles.optionsList}
280
+ style={optionsListStyle}
262
281
  showsVerticalScrollIndicator={true}
263
282
  >
264
283
  {filteredOptions.map((option) => (
265
284
  <Pressable
266
285
  key={option.value}
267
- style={selectStyles.option}
286
+ style={optionStyle}
268
287
  onPress={() => handleOptionSelect(option)}
269
288
  disabled={option.disabled}
270
289
  android_ripple={{ color: 'rgba(0, 0, 0, 0.1)' }}
271
290
  >
272
- <View style={selectStyles.optionContent}>
291
+ <View style={optionContentStyle}>
273
292
  {renderOptionIcon(option.icon)}
274
293
  <Text
275
294
  style={[
276
- selectStyles.optionText,
277
- option.disabled && selectStyles.optionTextDisabled,
295
+ optionTextStyle,
296
+ option.disabled && optionTextDisabledStyle,
278
297
  ]}
279
298
  >
280
299
  {option.label}
@@ -284,8 +303,8 @@ const Select = forwardRef<View, SelectProps>(({
284
303
  ))}
285
304
 
286
305
  {filteredOptions.length === 0 && (
287
- <View style={selectStyles.option}>
288
- <Text style={selectStyles.optionText}>
306
+ <View style={optionStyle}>
307
+ <Text style={optionTextStyle}>
289
308
  No options found
290
309
  </Text>
291
310
  </View>
@@ -299,16 +318,16 @@ const Select = forwardRef<View, SelectProps>(({
299
318
  };
300
319
 
301
320
  return (
302
- <View ref={ref} nativeID={id} style={[selectStyles.container, style]} testID={testID}>
321
+ <View ref={ref} nativeID={id} style={[containerStyle, style]} testID={testID}>
303
322
  {label && (
304
- <Text style={selectStyles.label}>
323
+ <Text style={labelStyle}>
305
324
  {label}
306
325
  </Text>
307
326
  )}
308
327
 
309
328
  <Pressable
310
329
  ref={mergedTriggerRef}
311
- style={selectStyles.trigger({ type, intent })}
330
+ style={triggerStyle}
312
331
  onPress={handleTriggerPress}
313
332
  disabled={disabled}
314
333
  accessibilityLabel={accessibilityLabel || label}
@@ -319,11 +338,11 @@ const Select = forwardRef<View, SelectProps>(({
319
338
  }}
320
339
  android_ripple={{ color: 'rgba(0, 0, 0, 0.1)' }}
321
340
  >
322
- <View style={selectStyles.triggerContent}>
341
+ <View style={triggerContentStyle}>
323
342
  {renderTriggerIcon(selectedOption?.icon)}
324
343
  <Text
325
344
  style={[
326
- selectedOption ? selectStyles.triggerText : selectStyles.placeholder,
345
+ selectedOption ? triggerTextStyle : placeholderStyle,
327
346
  ]}
328
347
  numberOfLines={1}
329
348
  >
@@ -338,11 +357,7 @@ const Select = forwardRef<View, SelectProps>(({
338
357
  {!(Platform.OS === 'ios' && presentationMode === 'actionSheet') && renderDropdown()}
339
358
 
340
359
  {helperText && (
341
- <Text
342
- style={[
343
- selectStyles.helperText,
344
- ]}
345
- >
360
+ <Text style={helperTextStyle}>
346
361
  {helperText}
347
362
  </Text>
348
363
  )}