@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.
- package/package.json +8 -3
- package/src/Accordion/Accordion.native.tsx +22 -14
- package/src/Accordion/Accordion.styles.old.tsx +298 -0
- package/src/Accordion/Accordion.styles.tsx +139 -248
- package/src/Accordion/Accordion.web.tsx +12 -7
- package/src/ActivityIndicator/ActivityIndicator.native.tsx +3 -2
- package/src/ActivityIndicator/ActivityIndicator.styles.old.tsx +94 -0
- package/src/ActivityIndicator/ActivityIndicator.styles.tsx +43 -62
- package/src/ActivityIndicator/ActivityIndicator.web.tsx +2 -2
- package/src/Alert/Alert.native.tsx +26 -15
- package/src/Alert/Alert.styles.old.tsx +209 -0
- package/src/Alert/Alert.styles.tsx +108 -281
- package/src/Alert/Alert.web.tsx +6 -10
- package/src/Avatar/Avatar.native.tsx +5 -2
- package/src/Avatar/Avatar.styles.old.tsx +99 -0
- package/src/Avatar/Avatar.styles.tsx +47 -62
- package/src/Avatar/Avatar.web.tsx +2 -2
- package/src/Badge/Badge.native.tsx +2 -2
- package/src/Badge/Badge.styles.old.tsx +157 -0
- package/src/Badge/Badge.styles.tsx +69 -108
- package/src/Badge/Badge.web.tsx +6 -6
- package/src/Breadcrumb/Breadcrumb.native.tsx +12 -5
- package/src/Breadcrumb/Breadcrumb.styles.old.tsx +231 -0
- package/src/Breadcrumb/Breadcrumb.styles.tsx +93 -209
- package/src/Breadcrumb/Breadcrumb.web.tsx +39 -27
- package/src/Button/Button.native.tsx +39 -14
- package/src/Button/Button.styles.tsx +99 -253
- package/src/Button/Button.web.tsx +10 -8
- package/src/Card/Card.native.tsx +8 -4
- package/src/Card/Card.styles.old.tsx +160 -0
- package/src/Card/Card.styles.tsx +107 -142
- package/src/Card/Card.web.tsx +6 -4
- package/src/Checkbox/Checkbox.native.tsx +14 -6
- package/src/Checkbox/Checkbox.styles.old.tsx +271 -0
- package/src/Checkbox/Checkbox.styles.tsx +109 -197
- package/src/Checkbox/Checkbox.web.tsx +7 -7
- package/src/Chip/Chip.native.tsx +5 -5
- package/src/Chip/Chip.styles.old.tsx +184 -0
- package/src/Chip/Chip.styles.tsx +34 -22
- package/src/Chip/Chip.web.tsx +5 -5
- package/src/Dialog/Dialog.native.tsx +16 -7
- package/src/Dialog/Dialog.styles.old.tsx +202 -0
- package/src/Dialog/Dialog.styles.tsx +108 -132
- package/src/Dialog/Dialog.web.tsx +4 -4
- package/src/Divider/Divider.native.tsx +29 -42
- package/src/Divider/Divider.styles.old.tsx +172 -0
- package/src/Divider/Divider.styles.tsx +116 -242
- package/src/Divider/Divider.web.tsx +17 -14
- package/src/Icon/Icon.native.tsx +12 -4
- package/src/Icon/Icon.styles.old.tsx +81 -0
- package/src/Icon/Icon.styles.tsx +52 -60
- 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 +45 -43
- package/src/Input/Input.native.tsx +140 -56
- package/src/Input/Input.styles.old.tsx +289 -0
- package/src/Input/Input.styles.tsx +177 -228
- package/src/Input/Input.web.tsx +5 -8
- package/src/Link/Link.native.tsx +4 -1
- package/src/List/List.native.tsx +5 -2
- package/src/List/List.styles.old.tsx +242 -0
- package/src/List/List.styles.tsx +178 -240
- package/src/List/ListItem.native.tsx +16 -8
- package/src/List/ListItem.web.tsx +26 -15
- package/src/Menu/Menu.native.tsx +1 -1
- package/src/Menu/Menu.styles.old.tsx +197 -0
- package/src/Menu/Menu.styles.tsx +90 -156
- package/src/Menu/Menu.web.tsx +2 -2
- package/src/Menu/MenuItem.native.tsx +9 -5
- package/src/Menu/MenuItem.styles.old.tsx +114 -0
- package/src/Menu/MenuItem.styles.tsx +71 -104
- package/src/Menu/MenuItem.web.tsx +23 -5
- package/src/Popover/Popover.native.tsx +10 -4
- package/src/Popover/Popover.styles.old.tsx +135 -0
- package/src/Popover/Popover.styles.tsx +46 -96
- package/src/Popover/Popover.web.tsx +1 -1
- package/src/Pressable/Pressable.native.tsx +3 -1
- package/src/Pressable/Pressable.styles.old.tsx +27 -0
- package/src/Pressable/Pressable.styles.tsx +35 -20
- package/src/Pressable/Pressable.web.tsx +1 -1
- package/src/Progress/Progress.native.tsx +15 -6
- package/src/Progress/Progress.styles.old.tsx +200 -0
- package/src/Progress/Progress.styles.tsx +69 -118
- package/src/Progress/Progress.web.tsx +10 -9
- package/src/RadioButton/RadioButton.native.tsx +10 -4
- package/src/RadioButton/RadioButton.styles.old.tsx +175 -0
- package/src/RadioButton/RadioButton.styles.tsx +81 -145
- package/src/RadioButton/RadioButton.web.tsx +4 -4
- package/src/SVGImage/SVGImage.styles.old.tsx +86 -0
- package/src/SVGImage/SVGImage.styles.tsx +35 -66
- package/src/Screen/Screen.native.tsx +30 -27
- package/src/Screen/Screen.styles.old.tsx +87 -0
- package/src/Screen/Screen.styles.tsx +120 -71
- package/src/Screen/Screen.web.tsx +2 -2
- package/src/Select/Select.native.tsx +44 -29
- package/src/Select/Select.styles.old.tsx +353 -0
- package/src/Select/Select.styles.tsx +244 -293
- package/src/Select/Select.web.tsx +5 -5
- package/src/Skeleton/Skeleton.styles.old.tsx +67 -0
- package/src/Skeleton/Skeleton.styles.tsx +31 -43
- package/src/Slider/Slider.native.tsx +9 -5
- package/src/Slider/Slider.styles.old.tsx +259 -0
- package/src/Slider/Slider.styles.tsx +157 -227
- package/src/Slider/Slider.web.tsx +5 -5
- package/src/Switch/Switch.native.tsx +11 -5
- package/src/Switch/Switch.styles.old.tsx +203 -0
- package/src/Switch/Switch.styles.tsx +103 -149
- package/src/Switch/Switch.web.tsx +8 -8
- package/src/TabBar/TabBar.native.tsx +24 -31
- package/src/TabBar/TabBar.styles.old.tsx +343 -0
- package/src/TabBar/TabBar.styles.tsx +204 -494
- package/src/TabBar/TabBar.web.tsx +21 -33
- package/src/Table/Table.native.tsx +18 -9
- package/src/Table/Table.styles.old.tsx +311 -0
- package/src/Table/Table.styles.tsx +151 -278
- package/src/Table/Table.web.tsx +1 -1
- package/src/Text/Text.native.tsx +1 -4
- 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 -78
- 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 +101 -157
- package/src/Tooltip/Tooltip.native.tsx +2 -2
- package/src/Tooltip/Tooltip.styles.old.tsx +82 -0
- package/src/Tooltip/Tooltip.styles.tsx +38 -53
- package/src/Tooltip/Tooltip.web.tsx +2 -2
- package/src/Video/Video.styles.old.tsx +51 -0
- package/src/Video/Video.styles.tsx +32 -28
- package/src/View/View.native.tsx +12 -12
- package/src/View/View.styles.old.tsx +125 -0
- package/src/View/View.styles.tsx +84 -103
- package/src/View/View.web.tsx +14 -2
- package/src/examples/CardExamples.tsx +0 -6
- package/src/extensions/applyExtension.ts +210 -0
- package/src/extensions/extendComponent.ts +438 -0
- package/src/extensions/index.ts +102 -0
- package/src/extensions/types.ts +497 -0
- package/src/globals.ts +16 -0
- package/src/index.native.ts +4 -0
- package/src/index.ts +28 -0
- package/src/utils/deepMerge.ts +54 -2
|
@@ -1,274 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input styles using defineStyle with $iterator expansion.
|
|
3
|
+
*/
|
|
1
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
buildMarginVariants,
|
|
6
|
-
buildMarginVerticalVariants,
|
|
7
|
-
buildMarginHorizontalVariants,
|
|
8
|
-
} from '../utils/buildViewStyleVariants';
|
|
9
|
-
import { InputSize, InputType } from './types';
|
|
5
|
+
import { defineStyle, ThemeStyleWrapper } from '@idealyst/theme';
|
|
6
|
+
import type { Theme as BaseTheme } from '@idealyst/theme';
|
|
7
|
+
import { ViewStyleSize } from '../utils/viewStyleProps';
|
|
10
8
|
|
|
9
|
+
// Required: Unistyles must see StyleSheet usage in original source to process this file
|
|
10
|
+
void StyleSheet;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
type: InputType;
|
|
15
|
-
focused: boolean;
|
|
16
|
-
hasError: boolean;
|
|
17
|
-
disabled: boolean;
|
|
18
|
-
}
|
|
12
|
+
// Wrap theme for $iterator support
|
|
13
|
+
type Theme = ThemeStyleWrapper<BaseTheme>;
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
border: `1px solid ${theme.colors.border.primary}`,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
filled: {
|
|
35
|
-
backgroundColor: theme.colors.surface.secondary,
|
|
36
|
-
borderWidth: 0,
|
|
37
|
-
_web: {
|
|
38
|
-
border: 'none',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
bare: {
|
|
42
|
-
backgroundColor: 'transparent',
|
|
43
|
-
borderWidth: 0,
|
|
44
|
-
_web: {
|
|
45
|
-
border: 'none',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
} as const;
|
|
49
|
-
}
|
|
15
|
+
type InputType = 'outlined' | 'filled' | 'bare';
|
|
16
|
+
|
|
17
|
+
export type InputDynamicProps = {
|
|
18
|
+
type?: InputType;
|
|
19
|
+
focused?: boolean;
|
|
20
|
+
hasError?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
margin?: ViewStyleSize;
|
|
23
|
+
marginVertical?: ViewStyleSize;
|
|
24
|
+
marginHorizontal?: ViewStyleSize;
|
|
25
|
+
};
|
|
50
26
|
|
|
51
27
|
/**
|
|
52
|
-
*
|
|
28
|
+
* Input styles with type/state handling.
|
|
53
29
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
30
|
+
export const inputStyles = defineStyle('Input', (theme: Theme) => ({
|
|
31
|
+
container: ({ type = 'outlined', focused = false, hasError = false, disabled = false }: InputDynamicProps) => {
|
|
32
|
+
const focusColor = theme.intents.primary.primary;
|
|
33
|
+
const errorColor = theme.intents.error.primary;
|
|
58
34
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
styles: {
|
|
64
|
-
borderColor: errorColor,
|
|
65
|
-
_web: {
|
|
66
|
-
border: `1px solid ${errorColor}`,
|
|
67
|
-
boxShadow: `0 0 0 2px ${errorColor}20`,
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
});
|
|
35
|
+
// Base styles by type
|
|
36
|
+
let backgroundColor = 'transparent';
|
|
37
|
+
let borderWidth = 1;
|
|
38
|
+
let borderColor = theme.colors.border.primary;
|
|
71
39
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
_web: {
|
|
80
|
-
border: `1px solid ${focusColor}`,
|
|
81
|
-
boxShadow: `0 0 0 2px ${focusColor}20`,
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
});
|
|
40
|
+
if (type === 'filled') {
|
|
41
|
+
backgroundColor = theme.colors.surface.secondary;
|
|
42
|
+
borderWidth = 0;
|
|
43
|
+
} else if (type === 'bare') {
|
|
44
|
+
backgroundColor = 'transparent';
|
|
45
|
+
borderWidth = 0;
|
|
46
|
+
}
|
|
85
47
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
styles: {
|
|
92
|
-
borderColor: focusColor,
|
|
93
|
-
_web: {
|
|
94
|
-
border: `1px solid ${focusColor}`,
|
|
95
|
-
boxShadow: `0 0 0 2px ${focusColor}20`,
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
});
|
|
48
|
+
// Error state takes precedence
|
|
49
|
+
if (hasError) {
|
|
50
|
+
borderColor = errorColor;
|
|
51
|
+
borderWidth = 1;
|
|
52
|
+
}
|
|
99
53
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
styles: {
|
|
106
|
-
_web: {
|
|
107
|
-
boxShadow: `0 0 0 2px ${focusColor}20`,
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
});
|
|
54
|
+
// Focus state (error still takes precedence for color)
|
|
55
|
+
if (focused && !hasError) {
|
|
56
|
+
borderColor = focusColor;
|
|
57
|
+
borderWidth = 1;
|
|
58
|
+
}
|
|
111
59
|
|
|
112
|
-
|
|
113
|
-
|
|
60
|
+
// Disabled state
|
|
61
|
+
if (disabled) {
|
|
62
|
+
backgroundColor = theme.colors.surface.secondary;
|
|
63
|
+
}
|
|
114
64
|
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
65
|
+
// Web-specific border and shadow
|
|
66
|
+
let webBorder = `1px solid ${borderColor}`;
|
|
67
|
+
let webBoxShadow = 'none';
|
|
68
|
+
|
|
69
|
+
if (type === 'filled' || type === 'bare') {
|
|
70
|
+
webBorder = 'none';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (hasError) {
|
|
74
|
+
webBorder = `1px solid ${errorColor}`;
|
|
75
|
+
if (focused) {
|
|
76
|
+
webBoxShadow = `0 0 0 2px ${errorColor}20`;
|
|
77
|
+
}
|
|
78
|
+
} else if (focused) {
|
|
79
|
+
webBorder = `1px solid ${focusColor}`;
|
|
80
|
+
webBoxShadow = `0 0 0 2px ${focusColor}20`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
display: 'flex' as const,
|
|
85
|
+
flexDirection: 'row' as const,
|
|
86
|
+
alignItems: 'center' as const,
|
|
87
|
+
width: '100%',
|
|
88
|
+
minWidth: 0,
|
|
89
|
+
borderRadius: 8,
|
|
90
|
+
backgroundColor,
|
|
91
|
+
borderWidth,
|
|
92
|
+
borderColor,
|
|
93
|
+
borderStyle: 'solid' as const,
|
|
94
|
+
opacity: disabled ? 0.6 : 1,
|
|
95
|
+
variants: {
|
|
96
|
+
// $iterator expands for each input size
|
|
97
|
+
size: {
|
|
98
|
+
height: theme.sizes.$input.height,
|
|
99
|
+
paddingHorizontal: theme.sizes.$input.paddingHorizontal,
|
|
142
100
|
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
disabled: {
|
|
146
|
-
true: {
|
|
147
|
-
opacity: 0.6,
|
|
148
|
-
backgroundColor: theme.colors.surface.secondary,
|
|
149
|
-
_web: {
|
|
150
|
-
cursor: 'not-allowed',
|
|
151
|
-
},
|
|
101
|
+
margin: {
|
|
102
|
+
margin: theme.sizes.$view.padding,
|
|
152
103
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
cursor: 'text',
|
|
156
|
-
_hover: {
|
|
157
|
-
borderColor: theme.intents.primary.primary,
|
|
158
|
-
},
|
|
159
|
-
},
|
|
104
|
+
marginVertical: {
|
|
105
|
+
marginVertical: theme.sizes.$view.padding,
|
|
160
106
|
},
|
|
107
|
+
marginHorizontal: {
|
|
108
|
+
marginHorizontal: theme.sizes.$view.padding,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
_web: {
|
|
112
|
+
boxSizing: 'border-box',
|
|
113
|
+
transition: 'border-color 0.2s ease, box-shadow 0.2s ease',
|
|
114
|
+
border: webBorder,
|
|
115
|
+
boxShadow: webBoxShadow,
|
|
116
|
+
cursor: disabled ? 'not-allowed' : 'text',
|
|
117
|
+
},
|
|
118
|
+
} as const;
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
input: (_props: InputDynamicProps) => ({
|
|
122
|
+
flex: 1,
|
|
123
|
+
minWidth: 0,
|
|
124
|
+
backgroundColor: 'transparent' as const,
|
|
125
|
+
color: theme.colors.text.primary,
|
|
126
|
+
fontWeight: '400' as const,
|
|
127
|
+
variants: {
|
|
128
|
+
size: {
|
|
129
|
+
fontSize: theme.sizes.$input.fontSize,
|
|
161
130
|
},
|
|
162
|
-
// Spacing variants from FormInputStyleProps
|
|
163
|
-
margin: buildMarginVariants(theme),
|
|
164
|
-
marginVertical: buildMarginVerticalVariants(theme),
|
|
165
|
-
marginHorizontal: buildMarginHorizontalVariants(theme),
|
|
166
131
|
},
|
|
167
|
-
compoundVariants: createFocusedCompoundVariants(theme),
|
|
168
132
|
_web: {
|
|
169
|
-
|
|
170
|
-
|
|
133
|
+
border: 'none',
|
|
134
|
+
outline: 'none',
|
|
135
|
+
fontFamily: 'inherit',
|
|
171
136
|
},
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
137
|
+
}),
|
|
138
|
+
|
|
139
|
+
leftIconContainer: (_props: InputDynamicProps) => ({
|
|
140
|
+
display: 'flex' as const,
|
|
141
|
+
alignItems: 'center' as const,
|
|
142
|
+
justifyContent: 'center' as const,
|
|
177
143
|
flexShrink: 0,
|
|
178
144
|
variants: {
|
|
179
|
-
size:
|
|
180
|
-
marginRight:
|
|
181
|
-
}
|
|
145
|
+
size: {
|
|
146
|
+
marginRight: theme.sizes.$input.iconMargin,
|
|
147
|
+
},
|
|
182
148
|
},
|
|
183
|
-
},
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
149
|
+
}),
|
|
150
|
+
|
|
151
|
+
rightIconContainer: (_props: InputDynamicProps) => ({
|
|
152
|
+
display: 'flex' as const,
|
|
153
|
+
alignItems: 'center' as const,
|
|
154
|
+
justifyContent: 'center' as const,
|
|
188
155
|
flexShrink: 0,
|
|
189
156
|
variants: {
|
|
190
|
-
size:
|
|
191
|
-
marginLeft:
|
|
192
|
-
}
|
|
157
|
+
size: {
|
|
158
|
+
marginLeft: theme.sizes.$input.iconMargin,
|
|
159
|
+
},
|
|
193
160
|
},
|
|
194
|
-
},
|
|
195
|
-
|
|
161
|
+
}),
|
|
162
|
+
|
|
163
|
+
leftIcon: (_props: InputDynamicProps) => ({
|
|
196
164
|
color: theme.colors.text.secondary,
|
|
197
165
|
variants: {
|
|
198
|
-
size:
|
|
199
|
-
fontSize:
|
|
200
|
-
width:
|
|
201
|
-
height:
|
|
202
|
-
}
|
|
166
|
+
size: {
|
|
167
|
+
fontSize: theme.sizes.$input.iconSize,
|
|
168
|
+
width: theme.sizes.$input.iconSize,
|
|
169
|
+
height: theme.sizes.$input.iconSize,
|
|
170
|
+
},
|
|
203
171
|
},
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
172
|
+
}),
|
|
173
|
+
|
|
174
|
+
rightIcon: (_props: InputDynamicProps) => ({
|
|
175
|
+
display: 'flex' as const,
|
|
176
|
+
alignItems: 'center' as const,
|
|
177
|
+
justifyContent: 'center' as const,
|
|
209
178
|
flexShrink: 0,
|
|
210
179
|
color: theme.colors.text.secondary,
|
|
211
180
|
variants: {
|
|
212
|
-
size:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
181
|
+
size: {
|
|
182
|
+
fontSize: theme.sizes.$input.iconSize,
|
|
183
|
+
width: theme.sizes.$input.iconSize,
|
|
184
|
+
height: theme.sizes.$input.iconSize,
|
|
185
|
+
},
|
|
217
186
|
},
|
|
218
|
-
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
187
|
+
}),
|
|
188
|
+
|
|
189
|
+
passwordToggle: (_props: InputDynamicProps) => ({
|
|
190
|
+
display: 'flex' as const,
|
|
191
|
+
alignItems: 'center' as const,
|
|
192
|
+
justifyContent: 'center' as const,
|
|
223
193
|
flexShrink: 0,
|
|
224
194
|
padding: 0,
|
|
225
195
|
variants: {
|
|
226
|
-
size:
|
|
227
|
-
marginLeft:
|
|
228
|
-
}
|
|
196
|
+
size: {
|
|
197
|
+
marginLeft: theme.sizes.$input.iconMargin,
|
|
198
|
+
},
|
|
229
199
|
},
|
|
230
200
|
_web: {
|
|
231
201
|
background: 'transparent',
|
|
232
202
|
border: 'none',
|
|
233
203
|
cursor: 'pointer',
|
|
234
|
-
_hover: {
|
|
235
|
-
|
|
236
|
-
},
|
|
237
|
-
_active: {
|
|
238
|
-
opacity: 0.5,
|
|
239
|
-
},
|
|
204
|
+
_hover: { opacity: 0.7 },
|
|
205
|
+
_active: { opacity: 0.5 },
|
|
240
206
|
},
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
207
|
+
}),
|
|
208
|
+
|
|
209
|
+
passwordToggleIcon: (_props: InputDynamicProps) => ({
|
|
210
|
+
display: 'flex' as const,
|
|
211
|
+
alignItems: 'center' as const,
|
|
212
|
+
justifyContent: 'center' as const,
|
|
246
213
|
flexShrink: 0,
|
|
247
214
|
color: theme.colors.text.secondary,
|
|
248
215
|
variants: {
|
|
249
|
-
size:
|
|
250
|
-
fontSize:
|
|
251
|
-
width:
|
|
252
|
-
height:
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
input: {
|
|
257
|
-
flex: 1,
|
|
258
|
-
minWidth: 0,
|
|
259
|
-
backgroundColor: 'transparent',
|
|
260
|
-
color: theme.colors.text.primary,
|
|
261
|
-
fontWeight: '400',
|
|
262
|
-
variants: {
|
|
263
|
-
size: buildSizeVariants(theme, 'input', (size) => ({
|
|
264
|
-
fontSize: size.fontSize,
|
|
265
|
-
})),
|
|
266
|
-
},
|
|
267
|
-
_web: {
|
|
268
|
-
border: 'none',
|
|
269
|
-
outline: 'none',
|
|
270
|
-
fontFamily: 'inherit',
|
|
216
|
+
size: {
|
|
217
|
+
fontSize: theme.sizes.$input.iconSize,
|
|
218
|
+
width: theme.sizes.$input.iconSize,
|
|
219
|
+
height: theme.sizes.$input.iconSize,
|
|
220
|
+
},
|
|
271
221
|
},
|
|
272
|
-
},
|
|
273
|
-
|
|
274
|
-
});
|
|
222
|
+
}),
|
|
223
|
+
}));
|
package/src/Input/Input.web.tsx
CHANGED
|
@@ -111,20 +111,17 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(({
|
|
|
111
111
|
setIsPasswordVisible(!isPasswordVisible);
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
// Apply variants for
|
|
114
|
+
// Apply variants (for size and spacing)
|
|
115
115
|
inputStyles.useVariants({
|
|
116
116
|
size,
|
|
117
|
-
type,
|
|
118
|
-
focused: isFocused,
|
|
119
|
-
hasError,
|
|
120
|
-
disabled,
|
|
121
117
|
margin,
|
|
122
118
|
marginVertical,
|
|
123
119
|
marginHorizontal,
|
|
124
120
|
});
|
|
125
121
|
|
|
126
|
-
// Get web props for all styled elements
|
|
127
|
-
const
|
|
122
|
+
// Get web props for all styled elements (container uses dynamic function)
|
|
123
|
+
const dynamicContainerStyle = (inputStyles.container as any)({ type, focused: isFocused, hasError, disabled });
|
|
124
|
+
const {ref: containerStyleRef, ...containerProps} = getWebProps([dynamicContainerStyle, style]);
|
|
128
125
|
const leftIconContainerProps = getWebProps([inputStyles.leftIconContainer]);
|
|
129
126
|
const rightIconContainerProps = getWebProps([inputStyles.rightIconContainer]);
|
|
130
127
|
const leftIconProps = getWebProps([inputStyles.leftIcon]);
|
|
@@ -133,7 +130,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(({
|
|
|
133
130
|
const passwordToggleIconProps = getWebProps([inputStyles.passwordToggleIcon]);
|
|
134
131
|
|
|
135
132
|
// Get input props
|
|
136
|
-
const inputWebProps = getWebProps([inputStyles.input]);
|
|
133
|
+
const inputWebProps = getWebProps([(inputStyles.input as any)({})]);
|
|
137
134
|
|
|
138
135
|
// Generate accessibility props
|
|
139
136
|
const ariaProps = useMemo(() => {
|
package/src/Link/Link.native.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { useNavigator } from '@idealyst/navigation';
|
|
3
3
|
import { Pressable } from '../Pressable';
|
|
4
4
|
import type { LinkProps } from './types';
|
|
5
|
+
import { Text } from 'react-native';
|
|
5
6
|
|
|
6
7
|
const Link: React.FC<LinkProps> = ({
|
|
7
8
|
to,
|
|
@@ -22,6 +23,8 @@ const Link: React.FC<LinkProps> = ({
|
|
|
22
23
|
onPress?.();
|
|
23
24
|
navigator.navigate({ path: to, vars });
|
|
24
25
|
};
|
|
26
|
+
|
|
27
|
+
console.log("Rendering Link to:", to, "children:", children);
|
|
25
28
|
|
|
26
29
|
return (
|
|
27
30
|
<Pressable
|
|
@@ -33,7 +36,7 @@ const Link: React.FC<LinkProps> = ({
|
|
|
33
36
|
accessibilityLabel={accessibilityLabel}
|
|
34
37
|
accessibilityRole="link"
|
|
35
38
|
>
|
|
36
|
-
{children}
|
|
39
|
+
{typeof children === 'string' ? <Text>{children}</Text> : children}
|
|
37
40
|
</Pressable>
|
|
38
41
|
);
|
|
39
42
|
};
|
package/src/List/List.native.tsx
CHANGED
|
@@ -37,7 +37,7 @@ const List = forwardRef<View, ListProps>(({
|
|
|
37
37
|
accessibilityHidden,
|
|
38
38
|
});
|
|
39
39
|
}, [accessibilityLabel, accessibilityHint, accessibilityRole, accessibilityHidden]);
|
|
40
|
-
// Apply
|
|
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
|
-
|
|
57
|
+
containerBaseStyle,
|
|
55
58
|
maxHeight ? { maxHeight } : undefined,
|
|
56
59
|
style,
|
|
57
60
|
];
|