@fountain-ui/core 3.0.0-alpha.21 → 3.0.0-alpha.22
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/build/commonjs/Accordion/Accordion.js +8 -4
- package/build/commonjs/Accordion/Accordion.js.map +1 -1
- package/build/commonjs/Accordion/AccordionProps.js.map +1 -1
- package/build/commonjs/AppBar/AppBar.js +1 -1
- package/build/commonjs/AppBar/AppBar.js.map +1 -1
- package/build/commonjs/ButtonBase/ButtonBase.js +1 -1
- package/build/commonjs/ButtonBase/ButtonBase.js.map +1 -1
- package/build/commonjs/Image/Image.js +1 -1
- package/build/commonjs/Image/Image.js.map +1 -1
- package/build/commonjs/Pagination/NumberPagination.js +3 -1
- package/build/commonjs/Pagination/NumberPagination.js.map +1 -1
- package/build/commonjs/Tab/useVariantStyleMap.js +1 -1
- package/build/commonjs/Tab/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/Tabs/Tabs.js +7 -4
- package/build/commonjs/Tabs/Tabs.js.map +1 -1
- package/build/commonjs/Tabs/useTabsStyle.js +51 -26
- package/build/commonjs/Tabs/useTabsStyle.js.map +1 -1
- package/build/commonjs/TextField/TextField.js +26 -7
- package/build/commonjs/TextField/TextField.js.map +1 -1
- package/build/commonjs/TextField/useVariantStyleMap.js +6 -9
- package/build/commonjs/TextField/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/hooks/useCollapsibleAppBar.js +2 -9
- package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/commonjs/hooks/useFadeInAppBar.js +1 -1
- package/build/commonjs/hooks/useFadeInAppBar.js.map +1 -1
- package/build/commonjs/internal/icons/Clear.js +3 -3
- package/build/commonjs/internal/icons/Clear.js.map +1 -1
- package/build/commonjs/internal/icons/Search.js +2 -2
- package/build/commonjs/internal/icons/Search.js.map +1 -1
- package/build/module/Accordion/Accordion.js +8 -4
- package/build/module/Accordion/Accordion.js.map +1 -1
- package/build/module/Accordion/AccordionProps.js.map +1 -1
- package/build/module/AppBar/AppBar.js +1 -1
- package/build/module/AppBar/AppBar.js.map +1 -1
- package/build/module/ButtonBase/ButtonBase.js +1 -1
- package/build/module/ButtonBase/ButtonBase.js.map +1 -1
- package/build/module/Image/Image.js +1 -1
- package/build/module/Image/Image.js.map +1 -1
- package/build/module/Pagination/NumberPagination.js +3 -1
- package/build/module/Pagination/NumberPagination.js.map +1 -1
- package/build/module/Tab/useVariantStyleMap.js +1 -1
- package/build/module/Tab/useVariantStyleMap.js.map +1 -1
- package/build/module/Tabs/Tabs.js +7 -4
- package/build/module/Tabs/Tabs.js.map +1 -1
- package/build/module/Tabs/useTabsStyle.js +51 -26
- package/build/module/Tabs/useTabsStyle.js.map +1 -1
- package/build/module/TextField/TextField.js +26 -7
- package/build/module/TextField/TextField.js.map +1 -1
- package/build/module/TextField/useVariantStyleMap.js +6 -9
- package/build/module/TextField/useVariantStyleMap.js.map +1 -1
- package/build/module/hooks/useCollapsibleAppBar.js +3 -9
- package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/module/hooks/useFadeInAppBar.js +1 -1
- package/build/module/hooks/useFadeInAppBar.js.map +1 -1
- package/build/module/internal/icons/Clear.js +3 -3
- package/build/module/internal/icons/Clear.js.map +1 -1
- package/build/module/internal/icons/Search.js +2 -2
- package/build/module/internal/icons/Search.js.map +1 -1
- package/build/typescript/Accordion/AccordionProps.d.ts +4 -1
- package/build/typescript/Tabs/useTabsStyle.d.ts +2 -1
- package/build/typescript/hooks/useCollapsibleAppBar.d.ts +0 -1
- package/package.json +2 -2
- package/src/Accordion/Accordion.tsx +7 -1
- package/src/Accordion/AccordionProps.ts +4 -2
- package/src/AppBar/AppBar.tsx +1 -1
- package/src/ButtonBase/ButtonBase.tsx +1 -1
- package/src/Image/Image.tsx +1 -1
- package/src/Pagination/NumberPagination.tsx +6 -1
- package/src/Tab/useVariantStyleMap.ts +1 -1
- package/src/Tabs/Tabs.tsx +12 -2
- package/src/Tabs/useTabsStyle.ts +36 -10
- package/src/TextField/TextField.tsx +28 -11
- package/src/TextField/useVariantStyleMap.ts +4 -6
- package/src/hooks/useCollapsibleAppBar.ts +3 -22
- package/src/hooks/useFadeInAppBar.ts +1 -1
- package/src/internal/icons/Clear.tsx +3 -3
- package/src/internal/icons/Search.tsx +2 -2
|
@@ -23,6 +23,20 @@ const styles = StyleSheet.create({
|
|
|
23
23
|
alignItems: 'flex-end',
|
|
24
24
|
padding: 0,
|
|
25
25
|
},
|
|
26
|
+
searchIconContainer: {
|
|
27
|
+
left: 12,
|
|
28
|
+
position: 'absolute',
|
|
29
|
+
},
|
|
30
|
+
loadingSinner: {
|
|
31
|
+
height: 19,
|
|
32
|
+
width: 19,
|
|
33
|
+
},
|
|
34
|
+
clearButton: {
|
|
35
|
+
height: 36,
|
|
36
|
+
position: 'absolute',
|
|
37
|
+
right: 2,
|
|
38
|
+
width: 32,
|
|
39
|
+
},
|
|
26
40
|
});
|
|
27
41
|
|
|
28
42
|
const TextField = React.forwardRef<TextInput, TextFieldProps>(function TextField(props, ref) {
|
|
@@ -113,15 +127,17 @@ const TextField = React.forwardRef<TextInput, TextFieldProps>(function TextField
|
|
|
113
127
|
|
|
114
128
|
<Row style={containerStyle}>
|
|
115
129
|
{isSearch ? (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
<View style={styles.searchIconContainer}>
|
|
131
|
+
{isLoading ? (
|
|
132
|
+
<LoadingSpinner style={styles.loadingSinner}/>
|
|
133
|
+
) : (
|
|
134
|
+
<Search
|
|
135
|
+
color={'base'}
|
|
136
|
+
height={19}
|
|
137
|
+
width={19}
|
|
138
|
+
/>
|
|
139
|
+
)}
|
|
140
|
+
</View>
|
|
125
141
|
) : null}
|
|
126
142
|
|
|
127
143
|
<TextInput
|
|
@@ -143,11 +159,12 @@ const TextField = React.forwardRef<TextInput, TextFieldProps>(function TextField
|
|
|
143
159
|
color={'base'}
|
|
144
160
|
children={
|
|
145
161
|
<Clear
|
|
146
|
-
height={
|
|
147
|
-
width={15}
|
|
162
|
+
height={17.31}
|
|
163
|
+
width={15.9}
|
|
148
164
|
/>
|
|
149
165
|
}
|
|
150
166
|
onPress={handleClear}
|
|
167
|
+
style={styles.clearButton}
|
|
151
168
|
/>
|
|
152
169
|
) : null}
|
|
153
170
|
|
|
@@ -47,6 +47,7 @@ export default function useVariantStyleMap(variant: TextFieldVariant, status: Te
|
|
|
47
47
|
containerStyle: {
|
|
48
48
|
borderBottomColor: status === 'default' && isFocused ? theme.palette.border.strong : borderColor,
|
|
49
49
|
borderBottomWidth: 1,
|
|
50
|
+
minHeight: 60,
|
|
50
51
|
},
|
|
51
52
|
inputStyle: {
|
|
52
53
|
paddingLeft: 0,
|
|
@@ -77,14 +78,11 @@ export default function useVariantStyleMap(variant: TextFieldVariant, status: Te
|
|
|
77
78
|
borderColor: theme.palette.border.base,
|
|
78
79
|
borderRadius: theme.shape.radius.md,
|
|
79
80
|
borderWidth: 0.5,
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
paddingBottom: 12,
|
|
82
|
+
paddingHorizontal: 39,
|
|
83
|
+
paddingTop: 11,
|
|
82
84
|
},
|
|
83
85
|
inputStyle: {
|
|
84
|
-
paddingBottom: theme.spacing(2.5),
|
|
85
|
-
paddingLeft: theme.spacing(2),
|
|
86
|
-
paddingRight: theme.spacing(1),
|
|
87
|
-
paddingTop: theme.spacing(2.25),
|
|
88
86
|
...createFontStyle(theme, {
|
|
89
87
|
selector: (_) => typographyOf({
|
|
90
88
|
fontSize: 16,
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { useCallback, useRef, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Falsy,
|
|
4
|
-
Keyboard,
|
|
5
|
-
Platform,
|
|
6
|
-
RegisteredStyle,
|
|
7
|
-
ScrollViewProps,
|
|
8
|
-
StyleSheet,
|
|
9
|
-
ViewProps,
|
|
10
|
-
ViewStyle,
|
|
11
|
-
} from 'react-native';
|
|
2
|
+
import { Falsy, Keyboard, Platform, RegisteredStyle, ScrollViewProps, ViewProps, ViewStyle } from 'react-native';
|
|
12
3
|
import type { WithTimingConfig } from 'react-native-reanimated';
|
|
13
4
|
import {
|
|
14
5
|
runOnJS,
|
|
@@ -19,7 +10,6 @@ import {
|
|
|
19
10
|
withTiming,
|
|
20
11
|
} from 'react-native-reanimated';
|
|
21
12
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
22
|
-
import { useTheme } from '@fountain-ui/styles';
|
|
23
13
|
import { useHeight } from '../internal/hooks';
|
|
24
14
|
import useAppbarStyles from './useAppbarStyles';
|
|
25
15
|
|
|
@@ -40,7 +30,6 @@ export interface ContentInsets {
|
|
|
40
30
|
|
|
41
31
|
export interface Options {
|
|
42
32
|
keyboardDismissMode?: 'none' | 'on-drag';
|
|
43
|
-
dividerExposureMode?: 'always' | 'overlapped';
|
|
44
33
|
supportsReverseScroll?: boolean;
|
|
45
34
|
}
|
|
46
35
|
|
|
@@ -56,7 +45,6 @@ export interface CollapsibleAppBar {
|
|
|
56
45
|
|
|
57
46
|
const defaultOptions: Required<Options> = {
|
|
58
47
|
keyboardDismissMode: 'none',
|
|
59
|
-
dividerExposureMode: 'overlapped',
|
|
60
48
|
supportsReverseScroll: true,
|
|
61
49
|
};
|
|
62
50
|
|
|
@@ -67,7 +55,7 @@ const SUPPORTS_DRAG_DETECTION = Platform.OS !== 'web';
|
|
|
67
55
|
const dismissKeyboard = () => Keyboard.dismiss();
|
|
68
56
|
|
|
69
57
|
export default function useCollapsibleAppBar(userOptions: Options = defaultOptions): CollapsibleAppBar {
|
|
70
|
-
const { keyboardDismissMode,
|
|
58
|
+
const { keyboardDismissMode, supportsReverseScroll }: Required<Options> = {
|
|
71
59
|
...defaultOptions,
|
|
72
60
|
...userOptions,
|
|
73
61
|
};
|
|
@@ -88,20 +76,13 @@ export default function useCollapsibleAppBar(userOptions: Options = defaultOptio
|
|
|
88
76
|
|
|
89
77
|
const [isScrolled, setIsScrolled] = useState<boolean>(false);
|
|
90
78
|
|
|
91
|
-
const theme = useTheme();
|
|
92
|
-
|
|
93
79
|
const animatedStyle = useAnimatedStyle(() => {
|
|
94
80
|
const transform = [{ translateY: translateY.value }];
|
|
95
81
|
|
|
96
82
|
return {
|
|
97
83
|
transform,
|
|
98
|
-
borderColor: dividerExposureMode === 'always' || overlapped.value ? theme.palette.divider : TRANSPARENT,
|
|
99
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
100
84
|
};
|
|
101
|
-
}, [
|
|
102
|
-
theme,
|
|
103
|
-
dividerExposureMode,
|
|
104
|
-
]);
|
|
85
|
+
}, []);
|
|
105
86
|
|
|
106
87
|
const indexRef = useRef<number>(0);
|
|
107
88
|
const offsetsRef = useRef<Array<number>>([]);
|
|
@@ -76,7 +76,7 @@ export default function useFadeInAppBar(userOptions: Options = defaultOptions):
|
|
|
76
76
|
const lastOffsetY = useSharedValue<number>(0);
|
|
77
77
|
const normalized = useSharedValue<number>(0);
|
|
78
78
|
|
|
79
|
-
const originalBackgroundColor = theme.palette.background.
|
|
79
|
+
const originalBackgroundColor = theme.palette.background.base;
|
|
80
80
|
const rgbValues = useMemo(() => rgb(originalBackgroundColor), [originalBackgroundColor]);
|
|
81
81
|
|
|
82
82
|
const animatedAppBarStyle = useAnimatedStyle(() => {
|
|
@@ -7,14 +7,14 @@ export default createSvgIcon(
|
|
|
7
7
|
<Path
|
|
8
8
|
fillRule="evenodd"
|
|
9
9
|
clipRule="evenodd"
|
|
10
|
-
d="
|
|
10
|
+
d="M5.32076 6.32681C5.603 6.04521 6.06061 6.04521 6.34285 6.32681L7.99999 7.98019L9.65712 6.32681C9.93937 6.04521 10.397 6.04521 10.6792 6.32681C10.9615 6.60842 10.9615 7.06498 10.6792 7.34659L9.02208 8.99997L10.6792 10.6533C10.9615 10.9349 10.9615 11.3915 10.6792 11.6731C10.397 11.9547 9.93937 11.9547 9.65712 11.6731L7.99999 10.0197L6.34285 11.6731C6.06061 11.9547 5.603 11.9547 5.32076 11.6731C5.03852 11.3915 5.03852 10.9349 5.32076 10.6533L6.9779 8.99997L5.32076 7.34659C5.03852 7.06498 5.03852 6.60842 5.32076 6.32681Z"
|
|
11
11
|
/>
|
|
12
12
|
<Path
|
|
13
13
|
fillRule="evenodd"
|
|
14
14
|
clipRule="evenodd"
|
|
15
|
-
d="M7 2.
|
|
15
|
+
d="M7.99999 2.51017C4.40763 2.51017 1.49544 5.41575 1.49544 8.99997C1.49544 12.5842 4.40763 15.4898 7.99999 15.4898C11.5923 15.4898 14.5045 12.5842 14.5045 8.99997C14.5045 5.41575 11.5923 2.51017 7.99999 2.51017ZM0.0499878 8.99997C0.0499878 4.61926 3.60932 1.06799 7.99999 1.06799C12.3907 1.06799 15.95 4.61926 15.95 8.99997C15.95 13.3807 12.3907 16.9319 7.99999 16.9319C3.60932 16.9319 0.0499878 13.3807 0.0499878 8.99997Z"
|
|
16
16
|
/>
|
|
17
17
|
</React.Fragment>,
|
|
18
18
|
'Clear',
|
|
19
|
-
'0 0
|
|
19
|
+
'0 0 16 18',
|
|
20
20
|
);
|
|
@@ -7,9 +7,9 @@ export default createSvgIcon(
|
|
|
7
7
|
<Path
|
|
8
8
|
fillRule="evenodd"
|
|
9
9
|
clipRule="evenodd"
|
|
10
|
-
d="M8.
|
|
10
|
+
d="M8.70834 3.16665C5.64776 3.16665 3.16667 5.64774 3.16667 8.70831C3.16667 11.7689 5.64776 14.25 8.70834 14.25C10.2024 14.25 11.5585 13.6587 12.5551 12.6973C12.5755 12.6711 12.5977 12.6458 12.6218 12.6217C12.6459 12.5977 12.6711 12.5754 12.6974 12.5551C13.6587 11.5584 14.25 10.2024 14.25 8.70831C14.25 5.64774 11.7689 3.16665 8.70834 3.16665ZM14.2753 13.1556C15.2503 11.9367 15.8333 10.3906 15.8333 8.70831C15.8333 4.77328 12.6434 1.58331 8.70834 1.58331C4.77331 1.58331 1.58334 4.77328 1.58334 8.70831C1.58334 12.6433 4.77331 15.8333 8.70834 15.8333C10.3906 15.8333 11.9368 15.2503 13.1557 14.2752L16.0655 17.1851C16.3747 17.4942 16.8759 17.4942 17.1851 17.1851C17.4943 16.8759 17.4943 16.3747 17.1851 16.0655L14.2753 13.1556Z"
|
|
11
11
|
/>
|
|
12
12
|
</React.Fragment>,
|
|
13
13
|
'Search',
|
|
14
|
-
'0 0
|
|
14
|
+
'0 0 19 19',
|
|
15
15
|
);
|