@idealyst/components 1.1.6 → 1.1.7

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 (104) hide show
  1. package/package.json +8 -3
  2. package/src/Accordion/Accordion.native.tsx +15 -9
  3. package/src/Accordion/Accordion.styles.tsx +193 -168
  4. package/src/Accordion/Accordion.web.tsx +12 -7
  5. package/src/ActivityIndicator/ActivityIndicator.native.tsx +3 -2
  6. package/src/ActivityIndicator/ActivityIndicator.styles.tsx +22 -11
  7. package/src/ActivityIndicator/ActivityIndicator.web.tsx +2 -2
  8. package/src/Alert/Alert.native.tsx +11 -10
  9. package/src/Alert/Alert.styles.tsx +162 -253
  10. package/src/Alert/Alert.web.tsx +6 -10
  11. package/src/Avatar/Avatar.native.tsx +5 -2
  12. package/src/Avatar/Avatar.styles.tsx +48 -18
  13. package/src/Avatar/Avatar.web.tsx +2 -2
  14. package/src/Badge/Badge.native.tsx +2 -2
  15. package/src/Badge/Badge.styles.tsx +37 -16
  16. package/src/Badge/Badge.web.tsx +6 -6
  17. package/src/Breadcrumb/Breadcrumb.native.tsx +12 -5
  18. package/src/Breadcrumb/Breadcrumb.styles.tsx +59 -58
  19. package/src/Breadcrumb/Breadcrumb.web.tsx +13 -6
  20. package/src/Button/Button.native.tsx +39 -14
  21. package/src/Button/Button.styles.tsx +106 -208
  22. package/src/Button/Button.web.tsx +10 -8
  23. package/src/Card/Card.native.tsx +14 -6
  24. package/src/Card/Card.styles.tsx +64 -62
  25. package/src/Card/Card.web.tsx +5 -4
  26. package/src/Checkbox/Checkbox.native.tsx +7 -3
  27. package/src/Checkbox/Checkbox.styles.tsx +49 -25
  28. package/src/Checkbox/Checkbox.web.tsx +3 -3
  29. package/src/Chip/Chip.native.tsx +5 -5
  30. package/src/Chip/Chip.styles.tsx +71 -21
  31. package/src/Chip/Chip.web.tsx +5 -5
  32. package/src/Dialog/Dialog.native.tsx +10 -4
  33. package/src/Dialog/Dialog.styles.tsx +130 -90
  34. package/src/Dialog/Dialog.web.tsx +4 -4
  35. package/src/Divider/Divider.native.tsx +29 -42
  36. package/src/Divider/Divider.styles.tsx +138 -242
  37. package/src/Divider/Divider.web.tsx +17 -14
  38. package/src/Icon/Icon.native.tsx +11 -3
  39. package/src/Icon/Icon.styles.tsx +10 -4
  40. package/src/Image/Image.styles.tsx +53 -37
  41. package/src/Input/Input.native.tsx +6 -7
  42. package/src/Input/Input.styles.tsx +194 -174
  43. package/src/Input/Input.web.tsx +5 -8
  44. package/src/Link/Link.native.tsx +4 -1
  45. package/src/List/List.styles.tsx +79 -105
  46. package/src/List/ListItem.native.tsx +5 -3
  47. package/src/List/ListItem.web.tsx +4 -3
  48. package/src/Menu/Menu.native.tsx +1 -1
  49. package/src/Menu/Menu.styles.tsx +53 -37
  50. package/src/Menu/Menu.web.tsx +2 -2
  51. package/src/Menu/MenuItem.native.tsx +5 -3
  52. package/src/Menu/MenuItem.styles.tsx +68 -69
  53. package/src/Menu/MenuItem.web.tsx +16 -3
  54. package/src/Popover/Popover.native.tsx +1 -1
  55. package/src/Popover/Popover.styles.tsx +40 -29
  56. package/src/Popover/Popover.web.tsx +1 -1
  57. package/src/Pressable/Pressable.native.tsx +3 -1
  58. package/src/Pressable/Pressable.styles.tsx +20 -13
  59. package/src/Pressable/Pressable.web.tsx +1 -1
  60. package/src/Progress/Progress.native.tsx +15 -6
  61. package/src/Progress/Progress.styles.tsx +125 -85
  62. package/src/Progress/Progress.web.tsx +10 -9
  63. package/src/RadioButton/RadioButton.native.tsx +8 -3
  64. package/src/RadioButton/RadioButton.styles.tsx +44 -37
  65. package/src/RadioButton/RadioButton.web.tsx +3 -3
  66. package/src/SVGImage/SVGImage.styles.tsx +28 -16
  67. package/src/Screen/Screen.native.tsx +23 -13
  68. package/src/Screen/Screen.styles.tsx +57 -46
  69. package/src/Screen/Screen.web.tsx +1 -1
  70. package/src/Select/Select.native.tsx +11 -5
  71. package/src/Select/Select.styles.tsx +72 -52
  72. package/src/Select/Select.web.tsx +5 -5
  73. package/src/Skeleton/Skeleton.styles.tsx +26 -14
  74. package/src/Slider/Slider.native.tsx +9 -5
  75. package/src/Slider/Slider.styles.tsx +59 -48
  76. package/src/Slider/Slider.web.tsx +5 -5
  77. package/src/Switch/Switch.native.tsx +6 -2
  78. package/src/Switch/Switch.styles.tsx +46 -19
  79. package/src/Switch/Switch.web.tsx +4 -4
  80. package/src/TabBar/TabBar.native.tsx +23 -31
  81. package/src/TabBar/TabBar.styles.tsx +215 -371
  82. package/src/TabBar/TabBar.web.tsx +21 -33
  83. package/src/Table/Table.native.tsx +1 -1
  84. package/src/Table/Table.styles.tsx +11 -4
  85. package/src/Table/Table.web.tsx +1 -1
  86. package/src/Text/Text.native.tsx +3 -4
  87. package/src/Text/Text.styles.tsx +7 -1
  88. package/src/Text/Text.web.tsx +1 -1
  89. package/src/TextArea/TextArea.styles.tsx +90 -58
  90. package/src/Tooltip/Tooltip.native.tsx +2 -2
  91. package/src/Tooltip/Tooltip.styles.tsx +21 -12
  92. package/src/Tooltip/Tooltip.web.tsx +2 -2
  93. package/src/Video/Video.styles.tsx +39 -23
  94. package/src/View/View.native.tsx +4 -2
  95. package/src/View/View.styles.tsx +33 -22
  96. package/src/View/View.web.tsx +13 -2
  97. package/src/extensions/applyExtension.ts +210 -0
  98. package/src/extensions/extendComponent.ts +377 -0
  99. package/src/extensions/index.ts +102 -0
  100. package/src/extensions/types.ts +497 -0
  101. package/src/globals.ts +16 -0
  102. package/src/index.native.ts +4 -0
  103. package/src/index.ts +28 -0
  104. package/src/utils/deepMerge.ts +54 -2
@@ -154,7 +154,7 @@ const Popover = forwardRef<View, PopoverProps>(({
154
154
  left={popoverPosition.left}
155
155
  width={Math.min(popoverPosition.width || 200, maxPopoverWidth)}
156
156
  maxHeight={500}
157
- style={[popoverStyles.container, style]}
157
+ style={[(popoverStyles.container as any)({}), style]}
158
158
  onLayout={handlePopoverLayout}
159
159
  {...nativeA11yProps}
160
160
  >
@@ -1,5 +1,6 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
- import { Theme, StylesheetStyles} from '@idealyst/theme';
2
+ import { Theme, StylesheetStyles } from '@idealyst/theme';
3
+ import { applyExtensions } from '../extensions/applyExtension';
3
4
 
4
5
  type PopoverPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
5
6
 
@@ -81,17 +82,14 @@ function createArrowPlacementVariants(theme: Theme) {
81
82
  };
82
83
  }
83
84
 
84
- // Styles are inlined here instead of in @idealyst/theme because Unistyles' Babel
85
- // transform on native cannot resolve function calls to extract variant structures.
86
- // @ts-ignore - TS language server needs restart to pick up theme structure changes
87
- export const popoverStyles = StyleSheet.create((theme: Theme) => {
88
- return {
89
- container: {
85
+ // Style creators for extension support
86
+ function createContainerStyles(theme: Theme) {
87
+ return () => ({
90
88
  backgroundColor: theme.colors.surface.primary,
91
89
  borderRadius: 8,
92
90
  borderWidth: 1,
93
91
  borderColor: theme.colors.border.primary,
94
- borderStyle: 'solid',
92
+ borderStyle: 'solid' as const,
95
93
  shadowColor: '#000',
96
94
  shadowOffset: { width: 0, height: 4 },
97
95
  shadowOpacity: 0.1,
@@ -103,26 +101,39 @@ export const popoverStyles = StyleSheet.create((theme: Theme) => {
103
101
  transition: 'opacity 150ms ease-out, transform 150ms ease-out',
104
102
  transformOrigin: 'center center',
105
103
  },
106
- },
107
- content: {
108
- padding: 16,
109
- },
110
- arrow: {
111
- position: 'absolute',
112
- width: 12,
113
- height: 12,
114
- backgroundColor: theme.colors.surface.primary,
115
- variants: {
116
- placement: createArrowPlacementVariants(theme),
104
+ });
105
+ }
106
+
107
+ // Styles are inlined here instead of in @idealyst/theme because Unistyles' Babel
108
+ // transform on native cannot resolve function calls to extract variant structures.
109
+ export const popoverStyles = StyleSheet.create((theme: Theme) => {
110
+ // Apply extensions to main visual elements
111
+ const extended = applyExtensions('Popover', theme, {
112
+ container: createContainerStyles(theme),
113
+ });
114
+
115
+ return {
116
+ ...extended,
117
+ // Minor utility styles (not extended)
118
+ content: {
119
+ padding: 16,
117
120
  },
118
- _web: {
119
- transform: 'rotate(45deg)',
120
- boxShadow: '-2px 2px 4px rgba(0, 0, 0, 0.1)',
121
- },
122
- },
123
- backdrop: {
124
- flex: 1,
125
- backgroundColor: 'transparent',
126
- },
127
- };
121
+ arrow: {
122
+ position: 'absolute',
123
+ width: 12,
124
+ height: 12,
125
+ backgroundColor: theme.colors.surface.primary,
126
+ variants: {
127
+ placement: createArrowPlacementVariants(theme),
128
+ },
129
+ _web: {
130
+ transform: 'rotate(45deg)',
131
+ boxShadow: '-2px 2px 4px rgba(0, 0, 0, 0.1)',
132
+ },
133
+ },
134
+ backdrop: {
135
+ flex: 1,
136
+ backgroundColor: 'transparent',
137
+ },
138
+ };
128
139
  });
@@ -44,7 +44,7 @@ const Popover = forwardRef<HTMLDivElement, PopoverProps>(({
44
44
 
45
45
  popoverStyles.useVariants({});
46
46
 
47
- const containerProps = getWebProps([popoverStyles.container]);
47
+ const containerProps = getWebProps([(popoverStyles.container as any)({})]);
48
48
  const contentProps = getWebProps([popoverStyles.content]);
49
49
 
50
50
  const mergedPopoverRef = useMergeRefs(ref, popoverRef);
@@ -26,6 +26,8 @@ const Pressable = forwardRef<View, PressableProps>(({
26
26
  paddingHorizontal,
27
27
  });
28
28
 
29
+ const pressableStyle = (pressableStyles.pressable as any)({});
30
+
29
31
  return (
30
32
  <TouchableWithoutFeedback
31
33
  onPress={disabled ? undefined : onPress}
@@ -35,7 +37,7 @@ const Pressable = forwardRef<View, PressableProps>(({
35
37
  testID={testID}
36
38
  accessibilityLabel={accessibilityLabel}
37
39
  >
38
- <View ref={ref} nativeID={id} style={[pressableStyles.pressable, style]}>
40
+ <View ref={ref} nativeID={id} style={[pressableStyle, style]}>
39
41
  {children}
40
42
  </View>
41
43
  </TouchableWithoutFeedback>
@@ -5,20 +5,27 @@ import {
5
5
  buildPaddingVerticalVariants,
6
6
  buildPaddingHorizontalVariants,
7
7
  } from '../utils/buildViewStyleVariants';
8
+ import { applyExtensions } from '../extensions/applyExtension';
8
9
 
9
- const createPressableStyles = (theme: Theme) => {
10
- return {
11
- variants: {
12
- // Spacing variants from PressableSpacingStyleProps
13
- padding: buildPaddingVariants(theme),
14
- paddingVertical: buildPaddingVerticalVariants(theme),
15
- paddingHorizontal: buildPaddingHorizontalVariants(theme),
16
- },
17
- } as const;
18
- };
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
+ }
19
21
 
20
22
  export const pressableStyles = StyleSheet.create((theme: Theme) => {
21
- return {
22
- pressable: createPressableStyles(theme),
23
- };
23
+ // Apply extensions to main visual elements
24
+ const extended = applyExtensions('Pressable', theme, {
25
+ pressable: createPressableStyles(theme),
26
+ });
27
+
28
+ return {
29
+ ...extended,
30
+ };
24
31
  });
@@ -54,7 +54,7 @@ const Pressable = forwardRef<HTMLDivElement, PressableProps>(({
54
54
  paddingHorizontal,
55
55
  });
56
56
 
57
- const webProps = getWebProps([pressableStyles.pressable, style as any]);
57
+ const webProps = getWebProps([(pressableStyles.pressable as any)({}), style as any]);
58
58
 
59
59
  const baseStyle: React.CSSProperties = {
60
60
  cursor: disabled ? 'default' : 'pointer',
@@ -34,13 +34,18 @@ const Progress = forwardRef<View, ProgressProps>(({
34
34
  const percentage = Math.min(Math.max((value / max) * 100, 0), 100);
35
35
  const { theme }: { theme: Theme } = useUnistyles();
36
36
 
37
- // Apply variants
37
+ // Apply variants (for size and rounded)
38
38
  progressStyles.useVariants({
39
39
  size,
40
- intent,
41
40
  rounded,
42
41
  });
43
42
 
43
+ // Compute dynamic styles with intent
44
+ const dynamicProps = { intent };
45
+ const linearBarStyle = (progressStyles.linearBar as any)(dynamicProps);
46
+ const indeterminateBarStyle = (progressStyles.indeterminateBar as any)(dynamicProps);
47
+ const circularBarStyle = (progressStyles.circularBar as any)(dynamicProps);
48
+
44
49
  // Animation values
45
50
  const animatedValue = useSharedValue(0);
46
51
  const slideAnimation = useSharedValue(0);
@@ -157,13 +162,17 @@ const Progress = forwardRef<View, ProgressProps>(({
157
162
  };
158
163
  });
159
164
 
165
+ // Get dynamic styles for extended styles
166
+ const containerStyle = (progressStyles.container as any)({});
167
+ const linearTrackStyle = (progressStyles.linearTrack as any)({});
168
+
160
169
  return (
161
- <View ref={ref} nativeID={id} style={[progressStyles.container, style]} testID={testID} accessibilityRole="progressbar">
162
- <View style={progressStyles.linearTrack}>
170
+ <View ref={ref} nativeID={id} style={[containerStyle, style]} testID={testID} accessibilityRole="progressbar">
171
+ <View style={linearTrackStyle}>
163
172
  {indeterminate ? (
164
- <Animated.View style={[progressStyles.indeterminateBar, indeterminateAnimatedStyle]} />
173
+ <Animated.View style={[indeterminateBarStyle, indeterminateAnimatedStyle]} />
165
174
  ) : (
166
- <Animated.View style={[progressStyles.linearBar, barAnimatedStyle]} />
175
+ <Animated.View style={[linearBarStyle, barAnimatedStyle]} />
167
176
  )}
168
177
  </View>
169
178
  {showLabel && (
@@ -1,6 +1,7 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
- import { Theme, Intent, Size, CompoundVariants, StaticStyles } from '@idealyst/theme';
2
+ import { Theme, Intent, Size } from '@idealyst/theme';
3
3
  import { buildSizeVariants } from '../utils/buildSizeVariants';
4
+ import { applyExtensions } from '../extensions/applyExtension';
4
5
 
5
6
  type ProgressSize = Size;
6
7
  type ProgressIntent = Intent;
@@ -11,6 +12,10 @@ export type ProgressVariants = {
11
12
  rounded: boolean;
12
13
  }
13
14
 
15
+ type ProgressDynamicProps = {
16
+ intent?: ProgressIntent;
17
+ };
18
+
14
19
  function createLinearTrackSizeVariants(theme: Theme) {
15
20
  return buildSizeVariants(theme, 'progress', (size) => ({
16
21
  height: size.linearHeight,
@@ -36,58 +41,81 @@ function createCircularLabelSizeVariants(theme: Theme) {
36
41
  }));
37
42
  }
38
43
 
39
- function createIntentVariants(theme: Theme) {
40
- const variants: any = {};
41
- for (const intent in theme.intents) {
42
- variants[intent] = {};
43
- }
44
- return variants;
44
+ /**
45
+ * Get bar background color based on intent
46
+ */
47
+ function getBarBackgroundColor(theme: Theme, intent: ProgressIntent): string {
48
+ return theme.intents[intent].primary;
45
49
  }
46
50
 
47
- function createLinearBarCompoundVariants(theme: Theme) {
48
- const compoundVariants: CompoundVariants<keyof ProgressVariants> = [];
49
-
50
- for (const intent in theme.intents) {
51
- const intentValue = theme.intents[intent as Intent];
52
-
53
- compoundVariants.push({
54
- intent,
55
- styles: {
56
- backgroundColor: intentValue.primary,
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
+ },
57
64
  },
58
- });
59
- }
60
-
61
- return compoundVariants;
65
+ _web: {
66
+ transition: 'width 0.3s ease' as const,
67
+ },
68
+ } as const;
69
+ };
62
70
  }
63
71
 
64
- function createCircularBarCompoundVariants(theme: Theme) {
65
- const compoundVariants: CompoundVariants<keyof ProgressVariants> = [];
66
-
67
- for (const intent in theme.intents) {
68
- const intentValue = theme.intents[intent as Intent];
69
-
70
- compoundVariants.push({
71
- intent,
72
- styles: {
73
- _web: {
74
- stroke: intentValue.primary,
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 },
75
86
  },
76
87
  },
77
- });
78
- }
88
+ } as const;
89
+ };
90
+ }
79
91
 
80
- return compoundVariants;
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
+ };
81
103
  }
82
104
 
83
- // Styles are inlined here instead of in @idealyst/theme because Unistyles' Babel
84
- // transform on native cannot resolve function calls to extract variant structures.
85
- export const progressStyles = StyleSheet.create((theme: Theme) => {
86
- return {
87
- container: {
105
+ /**
106
+ * Create container styles
107
+ */
108
+ function createContainerStyles() {
109
+ return () => ({
88
110
  gap: 4 as const,
89
- },
90
- linearTrack: {
111
+ });
112
+ }
113
+
114
+ /**
115
+ * Create linear track styles
116
+ */
117
+ function createLinearTrackStyles(theme: Theme) {
118
+ return () => ({
91
119
  backgroundColor: theme.colors.border.secondary,
92
120
  overflow: 'hidden' as const,
93
121
  position: 'relative' as const,
@@ -98,67 +126,79 @@ export const progressStyles = StyleSheet.create((theme: Theme) => {
98
126
  false: { borderRadius: 0 },
99
127
  },
100
128
  },
101
- },
102
- linearBar: {
103
- height: '100%' as const,
104
- variants: {
105
- intent: createIntentVariants(theme),
106
- rounded: {
107
- true: { borderRadius: 9999 },
108
- false: { borderRadius: 0 },
109
- },
110
- },
111
- compoundVariants: createLinearBarCompoundVariants(theme),
112
- _web: {
113
- transition: 'width 0.3s ease' as const,
114
- },
115
- },
116
- indeterminateBar: {
117
- position: 'absolute' as const,
118
- height: '100%' as const,
119
- width: '40%' as const,
120
- variants: {
121
- intent: createIntentVariants(theme),
122
- rounded: {
123
- true: { borderRadius: 9999 },
124
- false: { borderRadius: 0 },
125
- },
126
- },
127
- compoundVariants: createLinearBarCompoundVariants(theme),
128
- },
129
- circularContainer: {
129
+ });
130
+ }
131
+
132
+ /**
133
+ * Create circular container styles
134
+ */
135
+ function createCircularContainerStyles(theme: Theme) {
136
+ return () => ({
130
137
  alignItems: 'center' as const,
131
138
  justifyContent: 'center' as const,
132
139
  position: 'relative' as const,
133
140
  variants: {
134
141
  size: createCircularContainerSizeVariants(theme),
135
142
  } as const,
136
- } as const,
137
- circularTrack: {
143
+ });
144
+ }
145
+
146
+ /**
147
+ * Create circular track styles
148
+ */
149
+ function createCircularTrackStyles(theme: Theme) {
150
+ return () => ({
138
151
  _web: {
139
152
  stroke: theme.colors.border.secondary,
140
- }
141
- },
142
- circularBar: {
143
- variants: {
144
- intent: createIntentVariants(theme),
145
153
  },
146
- compoundVariants: createCircularBarCompoundVariants(theme),
147
- },
148
- label: {
154
+ });
155
+ }
156
+
157
+ /**
158
+ * Create label styles
159
+ */
160
+ function createLabelStyles(theme: Theme) {
161
+ return () => ({
149
162
  color: theme.colors.text.primary,
150
163
  textAlign: 'center' as const,
151
164
  variants: {
152
165
  size: createLabelSizeVariants(theme),
153
166
  },
154
- },
155
- circularLabel: {
167
+ });
168
+ }
169
+
170
+ /**
171
+ * Create circular label styles
172
+ */
173
+ function createCircularLabelStyles(theme: Theme) {
174
+ return () => ({
156
175
  position: 'absolute' as const,
157
176
  fontWeight: '600' as const,
158
177
  color: theme.colors.text.primary,
159
178
  variants: {
160
179
  size: createCircularLabelSizeVariants(theme),
161
180
  },
162
- },
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)(),
163
203
  };
164
- });
204
+ });
@@ -19,18 +19,20 @@ const Progress: React.FC<ProgressProps> = ({
19
19
  }) => {
20
20
  const percentage = Math.min(Math.max((value / max) * 100, 0), 100);
21
21
 
22
- // Apply variants using the correct Unistyles v3 pattern
22
+ // Apply variants (for size and rounded)
23
23
  progressStyles.useVariants({
24
24
  size,
25
- intent,
26
25
  rounded,
27
26
  });
28
27
 
29
- // Linear progress
30
- const containerProps = getWebProps([progressStyles.container, style as any]);
31
- const trackProps = getWebProps([progressStyles.linearTrack]);
32
- const barProps = getWebProps([progressStyles.linearBar, { width: `${percentage}%` }]);
33
- const indeterminateProps = getWebProps([progressStyles.indeterminateBar]);
28
+ // Compute dynamic styles with intent
29
+ const dynamicProps = { intent };
30
+
31
+ // Linear progress
32
+ const containerProps = getWebProps([(progressStyles.container as any)({}), style as any]);
33
+ const trackProps = getWebProps([(progressStyles.linearTrack as any)({})]);
34
+ const barProps = getWebProps([(progressStyles.linearBar as any)(dynamicProps), { width: `${percentage}%` }]);
35
+ const indeterminateProps = getWebProps([(progressStyles.indeterminateBar as any)(dynamicProps)]);
34
36
  const labelProps = getWebProps([progressStyles.label]);
35
37
 
36
38
  const getCircularSize = () => {
@@ -53,8 +55,7 @@ const Progress: React.FC<ProgressProps> = ({
53
55
  ]);
54
56
  const labelProps = getWebProps([progressStyles.circularLabel]);
55
57
  const trackColorProps = getWebProps([progressStyles.circularTrack]);
56
- const barColorProps = getWebProps([progressStyles.circularBar]);
57
- console.log(trackColorProps)
58
+ const barColorProps = getWebProps([(progressStyles.circularBar as any)(dynamicProps)]);
58
59
 
59
60
  return (
60
61
  <div {...computedContainerProps} id={id} data-testid={testID}>
@@ -101,20 +101,25 @@ const RadioButton = forwardRef<ComponentRef<typeof Pressable>, RadioButtonProps>
101
101
  outputRange: [0, 1],
102
102
  });
103
103
 
104
+ // Get dynamic styles
105
+ const containerStyle = (radioButtonStyles.container as any)({});
106
+ const radioStyle = (radioButtonStyles.radio as any)({ intent });
107
+ const radioDotStyle = (radioButtonStyles.radioDot as any)({ intent });
108
+
104
109
  return (
105
110
  <Pressable
106
111
  ref={ref}
107
112
  nativeID={id}
108
113
  onPress={handlePress}
109
114
  disabled={disabled}
110
- style={[radioButtonStyles.container, style]}
115
+ style={[containerStyle, style]}
111
116
  testID={testID}
112
117
  {...nativeA11yProps}
113
118
  >
114
- <View style={radioButtonStyles.radio({ intent })}>
119
+ <View style={radioStyle}>
115
120
  <Animated.View
116
121
  style={[
117
- radioButtonStyles.radioDot({ intent }),
122
+ radioDotStyle,
118
123
  {
119
124
  transform: [{ scale: dotScale }],
120
125
  },
@@ -6,6 +6,7 @@ import {
6
6
  buildMarginVerticalVariants,
7
7
  buildMarginHorizontalVariants,
8
8
  } from '../utils/buildViewStyleVariants';
9
+ import { applyExtensions } from '../extensions/applyExtension';
9
10
 
10
11
  type RadioButtonSize = Size;
11
12
  type RadioButtonIntent = Intent;
@@ -117,56 +118,62 @@ function createRadioDotStyles(theme: Theme) {
117
118
  }
118
119
  }
119
120
 
120
- // Styles are inlined here instead of in @idealyst/theme because Unistyles' Babel
121
- // transform on native cannot resolve function calls to extract variant structures.
122
- export const radioButtonStyles = StyleSheet.create((theme: Theme) => {
123
- return {
124
- container: {
125
- flexDirection: 'row',
126
- alignItems: 'center',
121
+ // Container style creator for extension support
122
+ function createContainerStyles(theme: Theme) {
123
+ return () => ({
124
+ flexDirection: 'row' as const,
125
+ alignItems: 'center' as const,
127
126
  paddingVertical: 4,
128
127
  variants: {
129
128
  size: buildSizeVariants(theme, 'radioButton', (size) => ({
130
129
  gap: size.gap,
131
130
  })),
132
- // Spacing variants from FormInputStyleProps
133
131
  margin: buildMarginVariants(theme),
134
132
  marginVertical: buildMarginVerticalVariants(theme),
135
133
  marginHorizontal: buildMarginHorizontalVariants(theme),
136
134
  } as const,
137
- },
138
- radio: createRadioStyles(theme),
139
- radioDot: createRadioDotStyles(theme),
140
- label: {
141
- color: theme.colors.text.primary,
142
- variants: {
143
- size: buildSizeVariants(theme, 'radioButton', (size) => ({
144
- fontSize: size.fontSize,
145
- })),
146
- disabled: {
147
- true: {
148
- opacity: 0.5,
149
- },
150
- false: {
151
- opacity: 1,
135
+ });
136
+ }
137
+
138
+ // Styles are inlined here instead of in @idealyst/theme because Unistyles' Babel
139
+ // transform on native cannot resolve function calls to extract variant structures.
140
+ export const radioButtonStyles = StyleSheet.create((theme: Theme) => {
141
+ // Apply extensions to main visual elements
142
+ const extended = applyExtensions('RadioButton', theme, {
143
+ container: createContainerStyles(theme),
144
+ radio: createRadioStyles(theme),
145
+ radioDot: createRadioDotStyles(theme),
146
+ });
147
+
148
+ return {
149
+ ...extended,
150
+ // Minor utility styles
151
+ label: {
152
+ color: theme.colors.text.primary,
153
+ variants: {
154
+ size: buildSizeVariants(theme, 'radioButton', (size) => ({
155
+ fontSize: size.fontSize,
156
+ })),
157
+ disabled: {
158
+ true: { opacity: 0.5 },
159
+ false: { opacity: 1 },
152
160
  },
153
161
  },
154
162
  },
155
- },
156
- groupContainer: {
157
- gap: 4,
158
- variants: {
159
- orientation: {
160
- horizontal: {
161
- flexDirection: 'row',
162
- flexWrap: 'wrap',
163
- gap: 16,
164
- },
165
- vertical: {
166
- flexDirection: 'column',
163
+ groupContainer: {
164
+ gap: 4,
165
+ variants: {
166
+ orientation: {
167
+ horizontal: {
168
+ flexDirection: 'row',
169
+ flexWrap: 'wrap',
170
+ gap: 16,
171
+ },
172
+ vertical: {
173
+ flexDirection: 'column',
174
+ },
167
175
  },
168
176
  },
169
177
  },
170
- },
171
- };
178
+ };
172
179
  });