react-native-molecules 0.5.0-beta.17 → 0.5.0-beta.19
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/components/DatePicker/utils.ts +1 -0
- package/components/DatePickerInline/HeaderItem.tsx +1 -1
- package/components/Menu/Menu.tsx +3 -18
- package/components/Popover/Popover.tsx +121 -122
- package/components/Popover/PopoverRoot.tsx +74 -0
- package/components/Popover/common.ts +50 -34
- package/components/Popover/index.ts +18 -1
- package/components/Popover/{Popover.native.tsx → usePlatformMeasure.native.ts} +12 -86
- package/components/Popover/usePlatformMeasure.ts +118 -0
- package/components/Popover/utils.ts +2 -9
- package/components/TimePicker/TimeInput.tsx +87 -37
- package/components/TimePicker/TimeInputs.tsx +131 -49
- package/components/TimePicker/TimePicker.tsx +6 -1
- package/components/TimePicker/utils.ts +43 -0
- package/package.json +1 -1
|
@@ -121,6 +121,11 @@ function TimePicker({
|
|
|
121
121
|
|
|
122
122
|
if (newDisplayMode !== displayMode) setDisplayMode(newDisplayMode);
|
|
123
123
|
|
|
124
|
+
if (params.focused) {
|
|
125
|
+
const nextFocused = params.focused;
|
|
126
|
+
setTimeout(() => onFocusInput(nextFocused), 300);
|
|
127
|
+
}
|
|
128
|
+
|
|
124
129
|
onTimeChange?.({
|
|
125
130
|
time: `${`${params.hours}`.padStart(2, '0')}:${`${params.minutes}`.padStart(
|
|
126
131
|
2,
|
|
@@ -129,7 +134,7 @@ function TimePicker({
|
|
|
129
134
|
focused: params.focused,
|
|
130
135
|
});
|
|
131
136
|
},
|
|
132
|
-
[displayMode, onTimeChange],
|
|
137
|
+
[displayMode, onFocusInput, onTimeChange],
|
|
133
138
|
);
|
|
134
139
|
|
|
135
140
|
const memoizedValue = useMemo(
|
|
@@ -41,6 +41,9 @@ const timePickerStylesDefault = StyleSheet.create(theme => ({
|
|
|
41
41
|
|
|
42
42
|
const timePickerInputsStylesDefault = StyleSheet.create(theme => ({
|
|
43
43
|
spaceBetweenInputsAndSwitcher: { width: 12 },
|
|
44
|
+
wrapper: {
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
},
|
|
44
47
|
inputContainer: {
|
|
45
48
|
flexDirection: 'row',
|
|
46
49
|
alignItems: 'center',
|
|
@@ -70,6 +73,27 @@ const timePickerInputsStylesDefault = StyleSheet.create(theme => ({
|
|
|
70
73
|
betweenDot: {
|
|
71
74
|
height: 12,
|
|
72
75
|
},
|
|
76
|
+
supportingRow: {
|
|
77
|
+
flexDirection: 'row',
|
|
78
|
+
alignItems: 'flex-start',
|
|
79
|
+
width: '100%',
|
|
80
|
+
marginTop: 2,
|
|
81
|
+
},
|
|
82
|
+
supportingSlot: {
|
|
83
|
+
width: 96,
|
|
84
|
+
minHeight: theme.typescale.bodyMedium.lineHeight * 2,
|
|
85
|
+
},
|
|
86
|
+
supportingText: {
|
|
87
|
+
...theme.typescale.bodyMedium,
|
|
88
|
+
fontSize: 12,
|
|
89
|
+
lineHeight: 16,
|
|
90
|
+
color: theme.colors.onSurfaceVariant,
|
|
91
|
+
textAlign: 'left',
|
|
92
|
+
paddingHorizontal: theme.spacings['1'],
|
|
93
|
+
},
|
|
94
|
+
supportingTextError: {
|
|
95
|
+
color: theme.colors.error,
|
|
96
|
+
},
|
|
73
97
|
}));
|
|
74
98
|
|
|
75
99
|
const timePickerInputStylesDefault = StyleSheet.create(theme => ({
|
|
@@ -91,6 +115,10 @@ const timePickerInputStylesDefault = StyleSheet.create(theme => ({
|
|
|
91
115
|
color: theme.colors.onSurface,
|
|
92
116
|
borderRadius: theme.shapes.corner.small,
|
|
93
117
|
|
|
118
|
+
_web: {
|
|
119
|
+
outline: 'none',
|
|
120
|
+
},
|
|
121
|
+
|
|
94
122
|
variants: {
|
|
95
123
|
state: {
|
|
96
124
|
highlighted: {
|
|
@@ -100,6 +128,20 @@ const timePickerInputStylesDefault = StyleSheet.create(theme => ({
|
|
|
100
128
|
},
|
|
101
129
|
},
|
|
102
130
|
},
|
|
131
|
+
keyboardInput: {
|
|
132
|
+
borderWidth: 2,
|
|
133
|
+
borderColor: 'transparent',
|
|
134
|
+
},
|
|
135
|
+
keyboardInputHighlighted: {
|
|
136
|
+
borderColor: theme.colors.primary,
|
|
137
|
+
},
|
|
138
|
+
inputError: {
|
|
139
|
+
backgroundColor: theme.colors.errorContainer,
|
|
140
|
+
color: theme.colors.onErrorContainer,
|
|
141
|
+
},
|
|
142
|
+
keyboardInputError: {
|
|
143
|
+
borderColor: theme.colors.error,
|
|
144
|
+
},
|
|
103
145
|
button: {
|
|
104
146
|
overflow: 'hidden',
|
|
105
147
|
borderRadius: theme.shapes.corner.small,
|
|
@@ -253,6 +295,7 @@ const timePickerModalStylesDefault = StyleSheet.create(theme => ({
|
|
|
253
295
|
timePickerContainer: {
|
|
254
296
|
padding: theme.spacings['6'],
|
|
255
297
|
paddingTop: theme.spacings['2'],
|
|
298
|
+
paddingBottom: 0,
|
|
256
299
|
},
|
|
257
300
|
footer: {
|
|
258
301
|
flexDirection: 'row',
|