@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.
- package/package.json +3 -3
- package/src/Accordion/Accordion.native.tsx +8 -6
- package/src/Accordion/Accordion.styles.old.tsx +298 -0
- package/src/Accordion/Accordion.styles.tsx +102 -236
- package/src/ActivityIndicator/ActivityIndicator.styles.old.tsx +94 -0
- package/src/ActivityIndicator/ActivityIndicator.styles.tsx +44 -74
- package/src/Alert/Alert.native.tsx +16 -6
- package/src/Alert/Alert.styles.old.tsx +209 -0
- package/src/Alert/Alert.styles.tsx +67 -149
- package/src/Avatar/Avatar.styles.old.tsx +99 -0
- package/src/Avatar/Avatar.styles.tsx +35 -80
- package/src/Badge/Badge.styles.old.tsx +157 -0
- package/src/Badge/Badge.styles.tsx +61 -121
- package/src/Breadcrumb/Breadcrumb.styles.old.tsx +231 -0
- package/src/Breadcrumb/Breadcrumb.styles.tsx +83 -200
- package/src/Breadcrumb/Breadcrumb.web.tsx +28 -23
- package/src/Button/Button.styles.tsx +89 -141
- package/src/Card/Card.native.tsx +7 -11
- package/src/Card/Card.styles.old.tsx +160 -0
- package/src/Card/Card.styles.tsx +105 -142
- package/src/Card/Card.web.tsx +5 -4
- package/src/Checkbox/Checkbox.native.tsx +9 -5
- package/src/Checkbox/Checkbox.styles.old.tsx +271 -0
- package/src/Checkbox/Checkbox.styles.tsx +104 -216
- package/src/Checkbox/Checkbox.web.tsx +6 -6
- package/src/Chip/Chip.styles.old.tsx +184 -0
- package/src/Chip/Chip.styles.tsx +34 -72
- package/src/Dialog/Dialog.native.tsx +7 -4
- package/src/Dialog/Dialog.styles.old.tsx +202 -0
- package/src/Dialog/Dialog.styles.tsx +69 -133
- package/src/Divider/Divider.styles.old.tsx +172 -0
- package/src/Divider/Divider.styles.tsx +62 -84
- package/src/Icon/Icon.native.tsx +8 -8
- package/src/Icon/Icon.styles.old.tsx +81 -0
- package/src/Icon/Icon.styles.tsx +52 -66
- package/src/Icon/Icon.web.tsx +43 -7
- package/src/Icon/IconSvg/IconSvg.web.tsx +2 -0
- package/src/Image/Image.styles.old.tsx +69 -0
- package/src/Image/Image.styles.tsx +46 -60
- package/src/Input/Input.native.tsx +138 -53
- package/src/Input/Input.styles.old.tsx +289 -0
- package/src/Input/Input.styles.tsx +127 -198
- package/src/List/List.native.tsx +5 -2
- package/src/List/List.styles.old.tsx +242 -0
- package/src/List/List.styles.tsx +179 -215
- package/src/List/ListItem.native.tsx +12 -6
- package/src/List/ListItem.web.tsx +23 -13
- package/src/Menu/Menu.styles.old.tsx +197 -0
- package/src/Menu/Menu.styles.tsx +68 -150
- package/src/Menu/MenuItem.native.tsx +5 -3
- package/src/Menu/MenuItem.styles.old.tsx +114 -0
- package/src/Menu/MenuItem.styles.tsx +57 -89
- package/src/Menu/MenuItem.web.tsx +8 -3
- package/src/Popover/Popover.native.tsx +10 -4
- package/src/Popover/Popover.styles.old.tsx +135 -0
- package/src/Popover/Popover.styles.tsx +51 -112
- package/src/Pressable/Pressable.styles.old.tsx +27 -0
- package/src/Pressable/Pressable.styles.tsx +35 -27
- package/src/Progress/Progress.styles.old.tsx +200 -0
- package/src/Progress/Progress.styles.tsx +75 -164
- package/src/RadioButton/RadioButton.native.tsx +4 -3
- package/src/RadioButton/RadioButton.styles.old.tsx +175 -0
- package/src/RadioButton/RadioButton.styles.tsx +83 -154
- package/src/RadioButton/RadioButton.web.tsx +2 -2
- package/src/SVGImage/SVGImage.styles.old.tsx +86 -0
- package/src/SVGImage/SVGImage.styles.tsx +35 -78
- package/src/Screen/Screen.native.tsx +18 -25
- package/src/Screen/Screen.styles.old.tsx +87 -0
- package/src/Screen/Screen.styles.tsx +105 -67
- package/src/Screen/Screen.web.tsx +1 -1
- package/src/Select/Select.native.tsx +42 -33
- package/src/Select/Select.styles.old.tsx +353 -0
- package/src/Select/Select.styles.tsx +223 -292
- package/src/Skeleton/Skeleton.styles.old.tsx +67 -0
- package/src/Skeleton/Skeleton.styles.tsx +29 -53
- package/src/Slider/Slider.styles.old.tsx +259 -0
- package/src/Slider/Slider.styles.tsx +153 -234
- package/src/Switch/Switch.native.tsx +7 -5
- package/src/Switch/Switch.styles.old.tsx +203 -0
- package/src/Switch/Switch.styles.tsx +101 -174
- package/src/Switch/Switch.web.tsx +5 -5
- package/src/TabBar/TabBar.native.tsx +3 -2
- package/src/TabBar/TabBar.styles.old.tsx +343 -0
- package/src/TabBar/TabBar.styles.tsx +145 -279
- package/src/Table/Table.native.tsx +18 -9
- package/src/Table/Table.styles.old.tsx +311 -0
- package/src/Table/Table.styles.tsx +152 -286
- package/src/Text/Text.native.tsx +1 -3
- package/src/Text/Text.style.demo.tsx +16 -0
- package/src/Text/Text.styles.old.tsx +219 -0
- package/src/Text/Text.styles.tsx +94 -84
- package/src/Text/Text.web.tsx +2 -2
- package/src/Text/index.ts +1 -0
- package/src/TextArea/TextArea.styles.old.tsx +213 -0
- package/src/TextArea/TextArea.styles.tsx +93 -181
- package/src/Tooltip/Tooltip.styles.old.tsx +82 -0
- package/src/Tooltip/Tooltip.styles.tsx +32 -56
- package/src/Video/Video.styles.old.tsx +51 -0
- package/src/Video/Video.styles.tsx +32 -44
- package/src/View/View.native.tsx +12 -14
- package/src/View/View.styles.old.tsx +125 -0
- package/src/View/View.styles.tsx +76 -106
- package/src/View/View.web.tsx +1 -0
- package/src/examples/CardExamples.tsx +0 -6
- package/src/extensions/extendComponent.ts +61 -0
|
@@ -1,317 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table styles using defineStyle with dynamic props.
|
|
3
|
+
*/
|
|
1
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
type
|
|
5
|
+
import { defineStyle, ThemeStyleWrapper } from '@idealyst/theme';
|
|
6
|
+
import type { Theme as BaseTheme, Size } from '@idealyst/theme';
|
|
7
|
+
import { ViewStyleSize } from '../utils/viewStyleProps';
|
|
8
|
+
|
|
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>;
|
|
14
|
+
|
|
15
|
+
type TableType = 'standard' | 'bordered' | 'striped';
|
|
16
|
+
type CellAlign = 'left' | 'center' | 'right';
|
|
17
|
+
|
|
18
|
+
export type TableDynamicProps = {
|
|
19
|
+
size?: Size;
|
|
20
|
+
type?: TableType;
|
|
21
|
+
clickable?: boolean;
|
|
22
|
+
sticky?: boolean;
|
|
23
|
+
align?: CellAlign;
|
|
24
|
+
gap?: ViewStyleSize;
|
|
25
|
+
padding?: ViewStyleSize;
|
|
26
|
+
paddingVertical?: ViewStyleSize;
|
|
27
|
+
paddingHorizontal?: ViewStyleSize;
|
|
28
|
+
margin?: ViewStyleSize;
|
|
29
|
+
marginVertical?: ViewStyleSize;
|
|
30
|
+
marginHorizontal?: ViewStyleSize;
|
|
31
|
+
};
|
|
16
32
|
|
|
17
|
-
type TableRowVariants = {
|
|
18
|
-
type: TableType;
|
|
19
|
-
clickable: boolean;
|
|
20
|
-
}
|
|
21
33
|
/**
|
|
22
|
-
*
|
|
34
|
+
* Table styles with type/size handling.
|
|
23
35
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
export const tableStyles = defineStyle('Table', (theme: Theme) => ({
|
|
37
|
+
container: ({ type = 'standard' }: TableDynamicProps) => ({
|
|
38
|
+
width: '100%',
|
|
39
|
+
borderWidth: 1,
|
|
40
|
+
borderStyle: 'solid' as const,
|
|
41
|
+
borderColor: theme.colors.border.primary,
|
|
42
|
+
borderRadius: 8,
|
|
43
|
+
overflow: 'hidden' as const,
|
|
44
|
+
variants: {
|
|
45
|
+
gap: {
|
|
46
|
+
gap: theme.sizes.$view.padding,
|
|
34
47
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
borderWidth: 1,
|
|
38
|
-
borderStyle: 'solid',
|
|
39
|
-
borderColor: theme.colors.border.primary,
|
|
40
|
-
borderRadius: 8,
|
|
41
|
-
overflow: 'hidden',
|
|
42
|
-
_web: {
|
|
43
|
-
border: `1px solid ${theme.colors.border.primary}`,
|
|
48
|
+
padding: {
|
|
49
|
+
padding: theme.sizes.$view.padding,
|
|
44
50
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
borderWidth: 1,
|
|
48
|
-
borderStyle: 'solid',
|
|
49
|
-
borderColor: theme.colors.border.primary,
|
|
50
|
-
borderRadius: 8,
|
|
51
|
-
overflow: 'hidden',
|
|
52
|
-
_web: {
|
|
53
|
-
border: `1px solid ${theme.colors.border.primary}`,
|
|
51
|
+
paddingVertical: {
|
|
52
|
+
paddingVertical: theme.sizes.$view.padding,
|
|
54
53
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Create type variants for row
|
|
61
|
-
*/
|
|
62
|
-
function createRowTypeVariants(theme: Theme) {
|
|
63
|
-
return {
|
|
64
|
-
standard: {},
|
|
65
|
-
bordered: {
|
|
66
|
-
borderBottomWidth: 1,
|
|
67
|
-
borderBottomStyle: 'solid',
|
|
68
|
-
borderBottomColor: theme.colors.border.primary,
|
|
69
|
-
_web: {
|
|
70
|
-
borderBottom: `1px solid ${theme.colors.border.primary}`,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
striped: {
|
|
74
|
-
borderBottomWidth: 1,
|
|
75
|
-
borderBottomStyle: 'solid',
|
|
76
|
-
borderBottomColor: theme.colors.border.primary,
|
|
77
|
-
_web: {
|
|
78
|
-
borderBottom: `1px solid ${theme.colors.border.primary}`,
|
|
79
|
-
':nth-child(even)': {
|
|
80
|
-
backgroundColor: theme.colors.surface.secondary,
|
|
81
|
-
},
|
|
54
|
+
paddingHorizontal: {
|
|
55
|
+
paddingHorizontal: theme.sizes.$view.padding,
|
|
82
56
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Create compound variants for row
|
|
89
|
-
*/
|
|
90
|
-
function createRowCompoundVariants(theme: Theme): CompoundVariants<keyof TableRowVariants> {
|
|
91
|
-
return [
|
|
92
|
-
{
|
|
93
|
-
type: 'striped',
|
|
94
|
-
clickable: true,
|
|
95
|
-
styles: {
|
|
96
|
-
_web: {
|
|
97
|
-
_hover: {
|
|
98
|
-
backgroundColor: theme.colors.surface.tertiary,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
57
|
+
margin: {
|
|
58
|
+
margin: theme.sizes.$view.padding,
|
|
101
59
|
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Create size variants for header cell
|
|
108
|
-
*/
|
|
109
|
-
function createHeaderCellSizeVariants(theme: Theme) {
|
|
110
|
-
return buildSizeVariants(theme, 'table', (size) => ({
|
|
111
|
-
padding: size.padding,
|
|
112
|
-
fontSize: size.fontSize,
|
|
113
|
-
lineHeight: size.lineHeight,
|
|
114
|
-
}));
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Create type variants for header cell
|
|
119
|
-
*/
|
|
120
|
-
function createHeaderCellTypeVariants(theme: Theme) {
|
|
121
|
-
return {
|
|
122
|
-
standard: {},
|
|
123
|
-
bordered: {
|
|
124
|
-
borderRightWidth: 1,
|
|
125
|
-
borderRightStyle: 'solid',
|
|
126
|
-
borderRightColor: theme.colors.border.primary,
|
|
127
|
-
_web: {
|
|
128
|
-
borderRight: `1px solid ${theme.colors.border.primary}`,
|
|
129
|
-
':last-child': {
|
|
130
|
-
borderRight: 'none',
|
|
131
|
-
},
|
|
60
|
+
marginVertical: {
|
|
61
|
+
marginVertical: theme.sizes.$view.padding,
|
|
132
62
|
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
} as const;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Create size variants for cell
|
|
140
|
-
*/
|
|
141
|
-
function createCellSizeVariants(theme: Theme) {
|
|
142
|
-
return buildSizeVariants(theme, 'table', (size) => ({
|
|
143
|
-
padding: size.padding,
|
|
144
|
-
fontSize: size.fontSize,
|
|
145
|
-
lineHeight: size.lineHeight,
|
|
146
|
-
}));
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Create type variants for cell
|
|
151
|
-
*/
|
|
152
|
-
function createCellTypeVariants(theme: Theme) {
|
|
153
|
-
return {
|
|
154
|
-
standard: {},
|
|
155
|
-
bordered: {
|
|
156
|
-
borderRightWidth: 1,
|
|
157
|
-
borderRightStyle: 'solid',
|
|
158
|
-
borderRightColor: theme.colors.border.primary,
|
|
159
|
-
_web: {
|
|
160
|
-
borderRight: `1px solid ${theme.colors.border.primary}`,
|
|
161
|
-
':last-child': {
|
|
162
|
-
borderRight: 'none',
|
|
163
|
-
},
|
|
63
|
+
marginHorizontal: {
|
|
64
|
+
marginHorizontal: theme.sizes.$view.padding,
|
|
164
65
|
},
|
|
165
66
|
},
|
|
166
|
-
striped: {},
|
|
167
|
-
} as const;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function createContainerStyles(theme: Theme) {
|
|
171
|
-
return () => ({
|
|
172
|
-
width: '100%',
|
|
173
67
|
_web: {
|
|
174
68
|
overflow: 'auto',
|
|
69
|
+
border: `1px solid ${theme.colors.border.primary}`,
|
|
175
70
|
},
|
|
176
|
-
|
|
177
|
-
type: createContainerTypeVariants(theme),
|
|
178
|
-
// Spacing variants from ContainerStyleProps
|
|
179
|
-
gap: buildGapVariants(theme),
|
|
180
|
-
padding: buildPaddingVariants(theme),
|
|
181
|
-
paddingVertical: buildPaddingVerticalVariants(theme),
|
|
182
|
-
paddingHorizontal: buildPaddingHorizontalVariants(theme),
|
|
183
|
-
margin: buildMarginVariants(theme),
|
|
184
|
-
marginVertical: buildMarginVerticalVariants(theme),
|
|
185
|
-
marginHorizontal: buildMarginHorizontalVariants(theme),
|
|
186
|
-
},
|
|
187
|
-
});
|
|
188
|
-
}
|
|
71
|
+
}),
|
|
189
72
|
|
|
190
|
-
|
|
191
|
-
return {
|
|
73
|
+
table: (_props: TableDynamicProps) => ({
|
|
192
74
|
width: '100%',
|
|
193
75
|
_web: {
|
|
194
76
|
borderCollapse: 'collapse',
|
|
195
77
|
},
|
|
196
|
-
}
|
|
197
|
-
}
|
|
78
|
+
}),
|
|
198
79
|
|
|
199
|
-
|
|
200
|
-
return {
|
|
80
|
+
thead: ({ sticky = false }: TableDynamicProps) => ({
|
|
201
81
|
backgroundColor: theme.colors.surface.secondary,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
zIndex: 10,
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
false: {},
|
|
212
|
-
},
|
|
213
|
-
},
|
|
214
|
-
} as const;
|
|
215
|
-
}
|
|
82
|
+
_web: sticky ? {
|
|
83
|
+
position: 'sticky' as const,
|
|
84
|
+
top: 0,
|
|
85
|
+
zIndex: 10,
|
|
86
|
+
} : {},
|
|
87
|
+
}),
|
|
216
88
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
89
|
+
tbody: (_props: TableDynamicProps) => ({}),
|
|
90
|
+
|
|
91
|
+
row: ({ type = 'standard', clickable = false }: TableDynamicProps) => {
|
|
92
|
+
const typeStyles = type === 'bordered' || type === 'striped' ? {
|
|
93
|
+
borderBottomWidth: 1,
|
|
94
|
+
borderBottomColor: theme.colors.border.primary,
|
|
95
|
+
} : {};
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
...typeStyles,
|
|
99
|
+
_web: {
|
|
100
|
+
transition: 'background-color 0.2s ease',
|
|
101
|
+
borderBottom: (type === 'bordered' || type === 'striped')
|
|
102
|
+
? `1px solid ${theme.colors.border.primary}`
|
|
103
|
+
: undefined,
|
|
104
|
+
cursor: clickable ? 'pointer' : undefined,
|
|
105
|
+
_hover: clickable ? { backgroundColor: theme.colors.surface.secondary } : {},
|
|
106
|
+
// Striped rows handled via CSS pseudo-selector
|
|
107
|
+
...(type === 'striped' ? {
|
|
108
|
+
':nth-child(even)': {
|
|
109
|
+
backgroundColor: theme.colors.surface.secondary,
|
|
228
110
|
},
|
|
229
|
-
},
|
|
230
|
-
false: {},
|
|
111
|
+
} : {}),
|
|
231
112
|
},
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
_web: {
|
|
235
|
-
transition: 'background-color 0.2s ease',
|
|
236
|
-
},
|
|
237
|
-
} as const;
|
|
238
|
-
}
|
|
113
|
+
} as const;
|
|
114
|
+
},
|
|
239
115
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
color: theme.colors.text.primary,
|
|
247
|
-
borderBottomWidth: 2,
|
|
248
|
-
borderBottomStyle: 'solid',
|
|
249
|
-
borderBottomColor: theme.colors.border.primary,
|
|
250
|
-
_web: {
|
|
251
|
-
borderBottom: `2px solid ${theme.colors.border.primary}`,
|
|
252
|
-
},
|
|
253
|
-
variants: {
|
|
254
|
-
size: createHeaderCellSizeVariants(theme),
|
|
255
|
-
align: {
|
|
256
|
-
left: {
|
|
257
|
-
textAlign: 'left',
|
|
258
|
-
justifyContent: 'flex-start',
|
|
259
|
-
},
|
|
260
|
-
center: {
|
|
261
|
-
textAlign: 'center',
|
|
262
|
-
justifyContent: 'center',
|
|
263
|
-
},
|
|
264
|
-
right: {
|
|
265
|
-
textAlign: 'right',
|
|
266
|
-
justifyContent: 'flex-end',
|
|
267
|
-
},
|
|
268
|
-
},
|
|
269
|
-
type: createHeaderCellTypeVariants(theme),
|
|
270
|
-
},
|
|
271
|
-
} as const;
|
|
272
|
-
}
|
|
116
|
+
headerCell: ({ type = 'standard', align = 'left' }: TableDynamicProps) => {
|
|
117
|
+
const alignStyles = {
|
|
118
|
+
left: { textAlign: 'left' as const, justifyContent: 'flex-start' as const },
|
|
119
|
+
center: { textAlign: 'center' as const, justifyContent: 'center' as const },
|
|
120
|
+
right: { textAlign: 'right' as const, justifyContent: 'flex-end' as const },
|
|
121
|
+
}[align];
|
|
273
122
|
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
justifyContent: 'flex-end',
|
|
123
|
+
const borderStyles = type === 'bordered' ? {
|
|
124
|
+
borderRightWidth: 1,
|
|
125
|
+
borderRightColor: theme.colors.border.primary,
|
|
126
|
+
} : {};
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
flexDirection: 'row' as const,
|
|
130
|
+
alignItems: 'center' as const,
|
|
131
|
+
fontWeight: '600' as const,
|
|
132
|
+
color: theme.colors.text.primary,
|
|
133
|
+
borderBottomWidth: 2,
|
|
134
|
+
borderBottomColor: theme.colors.border.primary,
|
|
135
|
+
...alignStyles,
|
|
136
|
+
...borderStyles,
|
|
137
|
+
variants: {
|
|
138
|
+
size: {
|
|
139
|
+
padding: theme.sizes.$table.padding,
|
|
140
|
+
fontSize: theme.sizes.$table.fontSize,
|
|
141
|
+
lineHeight: theme.sizes.$table.lineHeight,
|
|
294
142
|
},
|
|
295
143
|
},
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
144
|
+
_web: {
|
|
145
|
+
borderBottom: `2px solid ${theme.colors.border.primary}`,
|
|
146
|
+
borderRight: type === 'bordered' ? `1px solid ${theme.colors.border.primary}` : undefined,
|
|
147
|
+
':last-child': type === 'bordered' ? { borderRight: 'none' } : {},
|
|
148
|
+
},
|
|
149
|
+
} as const;
|
|
150
|
+
},
|
|
300
151
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
152
|
+
cell: ({ type = 'standard', align = 'left' }: TableDynamicProps) => {
|
|
153
|
+
const alignStyles = {
|
|
154
|
+
left: { textAlign: 'left' as const, justifyContent: 'flex-start' as const },
|
|
155
|
+
center: { textAlign: 'center' as const, justifyContent: 'center' as const },
|
|
156
|
+
right: { textAlign: 'right' as const, justifyContent: 'flex-end' as const },
|
|
157
|
+
}[align];
|
|
306
158
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
159
|
+
const borderStyles = type === 'bordered' ? {
|
|
160
|
+
borderRightWidth: 1,
|
|
161
|
+
borderRightColor: theme.colors.border.primary,
|
|
162
|
+
} : {};
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
flexDirection: 'row' as const,
|
|
166
|
+
alignItems: 'center' as const,
|
|
167
|
+
color: theme.colors.text.primary,
|
|
168
|
+
...alignStyles,
|
|
169
|
+
...borderStyles,
|
|
170
|
+
variants: {
|
|
171
|
+
size: {
|
|
172
|
+
padding: theme.sizes.$table.padding,
|
|
173
|
+
fontSize: theme.sizes.$table.fontSize,
|
|
174
|
+
lineHeight: theme.sizes.$table.lineHeight,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
_web: {
|
|
178
|
+
borderRight: type === 'bordered' ? `1px solid ${theme.colors.border.primary}` : undefined,
|
|
179
|
+
':last-child': type === 'bordered' ? { borderRight: 'none' } : {},
|
|
180
|
+
},
|
|
181
|
+
} as const;
|
|
182
|
+
},
|
|
183
|
+
}));
|
package/src/Text/Text.native.tsx
CHANGED
|
@@ -28,13 +28,11 @@ const Text = forwardRef<RNText, TextProps>(({
|
|
|
28
28
|
paddingHorizontal,
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
const textStyle = (textStyles.text as any)({ color });
|
|
32
|
-
|
|
33
31
|
return (
|
|
34
32
|
<RNText
|
|
35
33
|
ref={ref}
|
|
36
34
|
nativeID={id}
|
|
37
|
-
style={[
|
|
35
|
+
style={[textStyles.text({ color, typography, weight, align }), style]}
|
|
38
36
|
testID={testID}
|
|
39
37
|
>
|
|
40
38
|
{children}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ThemeStyleWrapper } from '@idealyst/theme';
|
|
2
|
+
import type { Theme as BaseTheme } from '@idealyst/theme';
|
|
3
|
+
|
|
4
|
+
type Theme = ThemeStyleWrapper<BaseTheme>;
|
|
5
|
+
|
|
6
|
+
const defineStyle = {} as any
|
|
7
|
+
defineStyle('Text', (theme: Theme) => ({
|
|
8
|
+
text: {
|
|
9
|
+
margin: 0,
|
|
10
|
+
padding: 0,
|
|
11
|
+
color: theme.colors.text.primary,
|
|
12
|
+
variants: {
|
|
13
|
+
// Typography variants
|
|
14
|
+
|
|
15
|
+
}}
|
|
16
|
+
}))
|