@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,27 @@
1
+ import { StyleSheet } from 'react-native-unistyles';
2
+ import { Theme } from '@idealyst/theme';
3
+ import {
4
+ buildPaddingVariants,
5
+ buildPaddingVerticalVariants,
6
+ buildPaddingHorizontalVariants,
7
+ } from '../utils/buildViewStyleVariants';
8
+ import { applyExtensions } from '../extensions/applyExtension';
9
+
10
+ // Style creators for extension support
11
+ function createPressableStyles(theme: Theme) {
12
+ return () => ({
13
+ variants: {
14
+ // Spacing variants from PressableSpacingStyleProps
15
+ padding: buildPaddingVariants(theme),
16
+ paddingVertical: buildPaddingVerticalVariants(theme),
17
+ paddingHorizontal: buildPaddingHorizontalVariants(theme),
18
+ },
19
+ });
20
+ }
21
+
22
+ export const pressableStyles = StyleSheet.create((theme: Theme) => {
23
+ // Apply extensions to main visual elements
24
+ return applyExtensions('Pressable', theme, {
25
+ pressable: createPressableStyles(theme),
26
+ });
27
+ });
@@ -1,31 +1,39 @@
1
+ /**
2
+ * Pressable styles using defineStyle with $iterator expansion.
3
+ */
1
4
  import { StyleSheet } from 'react-native-unistyles';
2
- import { Theme } from '@idealyst/theme';
3
- import {
4
- buildPaddingVariants,
5
- buildPaddingVerticalVariants,
6
- buildPaddingHorizontalVariants,
7
- } from '../utils/buildViewStyleVariants';
8
- import { applyExtensions } from '../extensions/applyExtension';
5
+ import { defineStyle, ThemeStyleWrapper } from '@idealyst/theme';
6
+ import type { Theme as BaseTheme } from '@idealyst/theme';
7
+ import { ViewStyleSize } from '../utils/viewStyleProps';
9
8
 
10
- // Style creators for extension support
11
- function createPressableStyles(theme: Theme) {
12
- return () => ({
13
- variants: {
14
- // Spacing variants from PressableSpacingStyleProps
15
- padding: buildPaddingVariants(theme),
16
- paddingVertical: buildPaddingVerticalVariants(theme),
17
- paddingHorizontal: buildPaddingHorizontalVariants(theme),
18
- },
19
- });
20
- }
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>;
21
14
 
22
- export const pressableStyles = StyleSheet.create((theme: Theme) => {
23
- // Apply extensions to main visual elements
24
- const extended = applyExtensions('Pressable', theme, {
25
- pressable: createPressableStyles(theme),
26
- });
15
+ export type PressableDynamicProps = {
16
+ padding?: ViewStyleSize;
17
+ paddingVertical?: ViewStyleSize;
18
+ paddingHorizontal?: ViewStyleSize;
19
+ };
27
20
 
28
- return {
29
- ...extended,
30
- };
31
- });
21
+ /**
22
+ * Pressable styles with spacing variants.
23
+ */
24
+ export const pressableStyles = defineStyle('Pressable', (theme: Theme) => ({
25
+ pressable: (_props: PressableDynamicProps) => ({
26
+ variants: {
27
+ // $iterator expands for each view size
28
+ padding: {
29
+ padding: theme.sizes.$view.padding,
30
+ },
31
+ paddingVertical: {
32
+ paddingVertical: theme.sizes.$view.padding,
33
+ },
34
+ paddingHorizontal: {
35
+ paddingHorizontal: theme.sizes.$view.padding,
36
+ },
37
+ },
38
+ }),
39
+ }));
@@ -0,0 +1,200 @@
1
+ import { StyleSheet } from 'react-native-unistyles';
2
+ import { Theme, Intent, Size } from '@idealyst/theme';
3
+ import { buildSizeVariants } from '../utils/buildSizeVariants';
4
+ import { applyExtensions } from '../extensions/applyExtension';
5
+
6
+ type ProgressSize = Size;
7
+ type ProgressIntent = Intent;
8
+
9
+ export type ProgressVariants = {
10
+ size: ProgressSize;
11
+ intent: ProgressIntent;
12
+ rounded: boolean;
13
+ }
14
+
15
+ type ProgressDynamicProps = {
16
+ intent?: ProgressIntent;
17
+ };
18
+
19
+ function createLinearTrackSizeVariants(theme: Theme) {
20
+ return buildSizeVariants(theme, 'progress', (size) => ({
21
+ height: size.linearHeight,
22
+ }));
23
+ }
24
+
25
+ function createCircularContainerSizeVariants(theme: Theme) {
26
+ return buildSizeVariants(theme, 'progress', (size) => ({
27
+ width: size.circularSize,
28
+ height: size.circularSize,
29
+ }));
30
+ }
31
+
32
+ function createLabelSizeVariants(theme: Theme) {
33
+ return buildSizeVariants(theme, 'progress', (size) => ({
34
+ fontSize: size.labelFontSize,
35
+ }));
36
+ }
37
+
38
+ function createCircularLabelSizeVariants(theme: Theme) {
39
+ return buildSizeVariants(theme, 'progress', (size) => ({
40
+ fontSize: size.circularLabelFontSize,
41
+ }));
42
+ }
43
+
44
+ /**
45
+ * Get bar background color based on intent
46
+ */
47
+ function getBarBackgroundColor(theme: Theme, intent: ProgressIntent): string {
48
+ return theme.intents[intent].primary;
49
+ }
50
+
51
+ /**
52
+ * Create dynamic linear bar styles
53
+ */
54
+ function createLinearBarStyles(theme: Theme) {
55
+ return ({ intent = 'primary' }: ProgressDynamicProps) => {
56
+ return {
57
+ height: '100%' as const,
58
+ backgroundColor: getBarBackgroundColor(theme, intent),
59
+ variants: {
60
+ rounded: {
61
+ true: { borderRadius: 9999 },
62
+ false: { borderRadius: 0 },
63
+ },
64
+ },
65
+ _web: {
66
+ transition: 'width 0.3s ease' as const,
67
+ },
68
+ } as const;
69
+ };
70
+ }
71
+
72
+ /**
73
+ * Create dynamic indeterminate bar styles
74
+ */
75
+ function createIndeterminateBarStyles(theme: Theme) {
76
+ return ({ intent = 'primary' }: ProgressDynamicProps) => {
77
+ return {
78
+ position: 'absolute' as const,
79
+ height: '100%' as const,
80
+ width: '40%' as const,
81
+ backgroundColor: getBarBackgroundColor(theme, intent),
82
+ variants: {
83
+ rounded: {
84
+ true: { borderRadius: 9999 },
85
+ false: { borderRadius: 0 },
86
+ },
87
+ },
88
+ } as const;
89
+ };
90
+ }
91
+
92
+ /**
93
+ * Create dynamic circular bar styles
94
+ */
95
+ function createCircularBarStyles(theme: Theme) {
96
+ return ({ intent = 'primary' }: ProgressDynamicProps) => {
97
+ return {
98
+ _web: {
99
+ stroke: getBarBackgroundColor(theme, intent),
100
+ },
101
+ } as const;
102
+ };
103
+ }
104
+
105
+ /**
106
+ * Create container styles
107
+ */
108
+ function createContainerStyles() {
109
+ return () => ({
110
+ gap: 4 as const,
111
+ });
112
+ }
113
+
114
+ /**
115
+ * Create linear track styles
116
+ */
117
+ function createLinearTrackStyles(theme: Theme) {
118
+ return () => ({
119
+ backgroundColor: theme.colors.border.secondary,
120
+ overflow: 'hidden' as const,
121
+ position: 'relative' as const,
122
+ variants: {
123
+ size: createLinearTrackSizeVariants(theme),
124
+ rounded: {
125
+ true: { borderRadius: 9999 },
126
+ false: { borderRadius: 0 },
127
+ },
128
+ },
129
+ });
130
+ }
131
+
132
+ /**
133
+ * Create circular container styles
134
+ */
135
+ function createCircularContainerStyles(theme: Theme) {
136
+ return () => ({
137
+ alignItems: 'center' as const,
138
+ justifyContent: 'center' as const,
139
+ position: 'relative' as const,
140
+ variants: {
141
+ size: createCircularContainerSizeVariants(theme),
142
+ } as const,
143
+ });
144
+ }
145
+
146
+ /**
147
+ * Create circular track styles
148
+ */
149
+ function createCircularTrackStyles(theme: Theme) {
150
+ return () => ({
151
+ _web: {
152
+ stroke: theme.colors.border.secondary,
153
+ },
154
+ });
155
+ }
156
+
157
+ /**
158
+ * Create label styles
159
+ */
160
+ function createLabelStyles(theme: Theme) {
161
+ return () => ({
162
+ color: theme.colors.text.primary,
163
+ textAlign: 'center' as const,
164
+ variants: {
165
+ size: createLabelSizeVariants(theme),
166
+ },
167
+ });
168
+ }
169
+
170
+ /**
171
+ * Create circular label styles
172
+ */
173
+ function createCircularLabelStyles(theme: Theme) {
174
+ return () => ({
175
+ position: 'absolute' as const,
176
+ fontWeight: '600' as const,
177
+ color: theme.colors.text.primary,
178
+ variants: {
179
+ size: createCircularLabelSizeVariants(theme),
180
+ },
181
+ });
182
+ }
183
+
184
+ // Styles are inlined here instead of in @idealyst/theme because Unistyles' Babel
185
+ // transform on native cannot resolve function calls to extract variant structures.
186
+ export const progressStyles = StyleSheet.create((theme: Theme) => {
187
+ // Apply extensions to main visual elements
188
+
189
+ return applyExtensions('Progress', theme, {container: createContainerStyles(),
190
+ linearTrack: createLinearTrackStyles(theme),
191
+ linearBar: createLinearBarStyles(theme),
192
+ // Additional styles (merged from return)
193
+ // Minor utility styles (not extended)
194
+ indeterminateBar: createIndeterminateBarStyles(theme),
195
+ circularContainer: createCircularContainerStyles(theme)(),
196
+ circularTrack: createCircularTrackStyles(theme)(),
197
+ circularBar: createCircularBarStyles(theme),
198
+ label: createLabelStyles(theme)(),
199
+ circularLabel: createCircularLabelStyles(theme)()});
200
+ });
@@ -1,204 +1,115 @@
1
+ /**
2
+ * Progress styles using defineStyle with $iterator expansion.
3
+ */
1
4
  import { StyleSheet } from 'react-native-unistyles';
2
- import { Theme, Intent, Size } from '@idealyst/theme';
3
- import { buildSizeVariants } from '../utils/buildSizeVariants';
4
- import { applyExtensions } from '../extensions/applyExtension';
5
+ import { defineStyle, ThemeStyleWrapper } from '@idealyst/theme';
6
+ import type { Theme as BaseTheme, Intent, Size } from '@idealyst/theme';
5
7
 
6
- type ProgressSize = Size;
7
- type ProgressIntent = Intent;
8
+ // Required: Unistyles must see StyleSheet usage in original source to process this file
9
+ void StyleSheet;
8
10
 
9
- export type ProgressVariants = {
10
- size: ProgressSize;
11
- intent: ProgressIntent;
12
- rounded: boolean;
13
- }
11
+ // Wrap theme for $iterator support
12
+ type Theme = ThemeStyleWrapper<BaseTheme>;
14
13
 
15
- type ProgressDynamicProps = {
16
- intent?: ProgressIntent;
14
+ export type ProgressDynamicProps = {
15
+ size?: Size;
16
+ intent?: Intent;
17
+ rounded?: boolean;
17
18
  };
18
19
 
19
- function createLinearTrackSizeVariants(theme: Theme) {
20
- return buildSizeVariants(theme, 'progress', (size) => ({
21
- height: size.linearHeight,
22
- }));
23
- }
24
-
25
- function createCircularContainerSizeVariants(theme: Theme) {
26
- return buildSizeVariants(theme, 'progress', (size) => ({
27
- width: size.circularSize,
28
- height: size.circularSize,
29
- }));
30
- }
31
-
32
- function createLabelSizeVariants(theme: Theme) {
33
- return buildSizeVariants(theme, 'progress', (size) => ({
34
- fontSize: size.labelFontSize,
35
- }));
36
- }
37
-
38
- function createCircularLabelSizeVariants(theme: Theme) {
39
- return buildSizeVariants(theme, 'progress', (size) => ({
40
- fontSize: size.circularLabelFontSize,
41
- }));
42
- }
43
-
44
20
  /**
45
- * Get bar background color based on intent
21
+ * Progress styles with intent-based coloring.
46
22
  */
47
- function getBarBackgroundColor(theme: Theme, intent: ProgressIntent): string {
48
- return theme.intents[intent].primary;
49
- }
23
+ export const progressStyles = defineStyle('Progress', (theme: Theme) => ({
24
+ container: (_props: ProgressDynamicProps) => ({
25
+ gap: 4 as const,
26
+ }),
50
27
 
51
- /**
52
- * Create dynamic linear bar styles
53
- */
54
- function createLinearBarStyles(theme: Theme) {
55
- return ({ intent = 'primary' }: ProgressDynamicProps) => {
56
- return {
57
- height: '100%' as const,
58
- backgroundColor: getBarBackgroundColor(theme, intent),
59
- variants: {
60
- rounded: {
61
- true: { borderRadius: 9999 },
62
- false: { borderRadius: 0 },
63
- },
64
- },
65
- _web: {
66
- transition: 'width 0.3s ease' as const,
28
+ linearTrack: (_props: ProgressDynamicProps) => ({
29
+ backgroundColor: theme.colors.border.secondary,
30
+ overflow: 'hidden' as const,
31
+ position: 'relative' as const,
32
+ variants: {
33
+ // $iterator expands for each progress size
34
+ size: {
35
+ height: theme.sizes.$progress.linearHeight,
67
36
  },
68
- } as const;
69
- };
70
- }
71
-
72
- /**
73
- * Create dynamic indeterminate bar styles
74
- */
75
- function createIndeterminateBarStyles(theme: Theme) {
76
- return ({ intent = 'primary' }: ProgressDynamicProps) => {
77
- return {
78
- position: 'absolute' as const,
79
- height: '100%' as const,
80
- width: '40%' as const,
81
- backgroundColor: getBarBackgroundColor(theme, intent),
82
- variants: {
83
- rounded: {
84
- true: { borderRadius: 9999 },
85
- false: { borderRadius: 0 },
86
- },
37
+ rounded: {
38
+ true: { borderRadius: 9999 },
39
+ false: { borderRadius: 0 },
87
40
  },
88
- } as const;
89
- };
90
- }
41
+ },
42
+ }),
91
43
 
92
- /**
93
- * Create dynamic circular bar styles
94
- */
95
- function createCircularBarStyles(theme: Theme) {
96
- return ({ intent = 'primary' }: ProgressDynamicProps) => {
97
- return {
98
- _web: {
99
- stroke: getBarBackgroundColor(theme, intent),
44
+ linearBar: ({ intent = 'primary' }: ProgressDynamicProps) => ({
45
+ height: '100%' as const,
46
+ backgroundColor: theme.intents[intent].primary,
47
+ variants: {
48
+ rounded: {
49
+ true: { borderRadius: 9999 },
50
+ false: { borderRadius: 0 },
100
51
  },
101
- } as const;
102
- };
103
- }
104
-
105
- /**
106
- * Create container styles
107
- */
108
- function createContainerStyles() {
109
- return () => ({
110
- gap: 4 as const,
111
- });
112
- }
52
+ },
53
+ _web: {
54
+ transition: 'width 0.3s ease' as const,
55
+ },
56
+ }),
113
57
 
114
- /**
115
- * Create linear track styles
116
- */
117
- function createLinearTrackStyles(theme: Theme) {
118
- return () => ({
119
- backgroundColor: theme.colors.border.secondary,
120
- overflow: 'hidden' as const,
121
- position: 'relative' as const,
58
+ indeterminateBar: ({ intent = 'primary' }: ProgressDynamicProps) => ({
59
+ position: 'absolute' as const,
60
+ height: '100%' as const,
61
+ width: '40%' as const,
62
+ backgroundColor: theme.intents[intent].primary,
122
63
  variants: {
123
- size: createLinearTrackSizeVariants(theme),
124
64
  rounded: {
125
65
  true: { borderRadius: 9999 },
126
66
  false: { borderRadius: 0 },
127
67
  },
128
68
  },
129
- });
130
- }
69
+ }),
131
70
 
132
- /**
133
- * Create circular container styles
134
- */
135
- function createCircularContainerStyles(theme: Theme) {
136
- return () => ({
71
+ circularContainer: (_props: ProgressDynamicProps) => ({
137
72
  alignItems: 'center' as const,
138
73
  justifyContent: 'center' as const,
139
74
  position: 'relative' as const,
140
75
  variants: {
141
- size: createCircularContainerSizeVariants(theme),
142
- } as const,
143
- });
144
- }
76
+ size: {
77
+ width: theme.sizes.$progress.circularSize,
78
+ height: theme.sizes.$progress.circularSize,
79
+ },
80
+ },
81
+ }),
145
82
 
146
- /**
147
- * Create circular track styles
148
- */
149
- function createCircularTrackStyles(theme: Theme) {
150
- return () => ({
83
+ circularTrack: (_props: ProgressDynamicProps) => ({
151
84
  _web: {
152
85
  stroke: theme.colors.border.secondary,
153
86
  },
154
- });
155
- }
87
+ }),
156
88
 
157
- /**
158
- * Create label styles
159
- */
160
- function createLabelStyles(theme: Theme) {
161
- return () => ({
89
+ circularBar: ({ intent = 'primary' }: ProgressDynamicProps) => ({
90
+ _web: {
91
+ stroke: theme.intents[intent].primary,
92
+ },
93
+ }),
94
+
95
+ label: (_props: ProgressDynamicProps) => ({
162
96
  color: theme.colors.text.primary,
163
97
  textAlign: 'center' as const,
164
98
  variants: {
165
- size: createLabelSizeVariants(theme),
99
+ size: {
100
+ fontSize: theme.sizes.$progress.labelFontSize,
101
+ },
166
102
  },
167
- });
168
- }
103
+ }),
169
104
 
170
- /**
171
- * Create circular label styles
172
- */
173
- function createCircularLabelStyles(theme: Theme) {
174
- return () => ({
105
+ circularLabel: (_props: ProgressDynamicProps) => ({
175
106
  position: 'absolute' as const,
176
107
  fontWeight: '600' as const,
177
108
  color: theme.colors.text.primary,
178
109
  variants: {
179
- size: createCircularLabelSizeVariants(theme),
110
+ size: {
111
+ fontSize: theme.sizes.$progress.circularLabelFontSize,
112
+ },
180
113
  },
181
- });
182
- }
183
-
184
- // Styles are inlined here instead of in @idealyst/theme because Unistyles' Babel
185
- // transform on native cannot resolve function calls to extract variant structures.
186
- export const progressStyles = StyleSheet.create((theme: Theme) => {
187
- // Apply extensions to main visual elements
188
- const extended = applyExtensions('Progress', theme, {
189
- container: createContainerStyles(),
190
- linearTrack: createLinearTrackStyles(theme),
191
- linearBar: createLinearBarStyles(theme),
192
- });
193
-
194
- return {
195
- ...extended,
196
- // Minor utility styles (not extended)
197
- indeterminateBar: createIndeterminateBarStyles(theme),
198
- circularContainer: createCircularContainerStyles(theme)(),
199
- circularTrack: createCircularTrackStyles(theme)(),
200
- circularBar: createCircularBarStyles(theme),
201
- label: createLabelStyles(theme)(),
202
- circularLabel: createCircularLabelStyles(theme)(),
203
- };
204
- });
114
+ }),
115
+ }));
@@ -101,10 +101,11 @@ const RadioButton = forwardRef<ComponentRef<typeof Pressable>, RadioButtonProps>
101
101
  outputRange: [0, 1],
102
102
  });
103
103
 
104
- // Get dynamic styles
104
+ // Get dynamic styles - call as functions for theme reactivity
105
105
  const containerStyle = (radioButtonStyles.container as any)({});
106
- const radioStyle = (radioButtonStyles.radio as any)({ intent });
106
+ const radioStyle = (radioButtonStyles.radio as any)({ intent, checked, disabled });
107
107
  const radioDotStyle = (radioButtonStyles.radioDot as any)({ intent });
108
+ const labelStyle = (radioButtonStyles.label as any)({ disabled });
108
109
 
109
110
  return (
110
111
  <Pressable
@@ -127,7 +128,7 @@ const RadioButton = forwardRef<ComponentRef<typeof Pressable>, RadioButtonProps>
127
128
  />
128
129
  </View>
129
130
  {label && (
130
- <Text style={radioButtonStyles.label}>
131
+ <Text style={labelStyle}>
131
132
  {label}
132
133
  </Text>
133
134
  )}