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