@fountain-ui/core 3.0.0-alpha.47 → 3.0.0-alpha.49
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/Dialog/Dialog.js +1 -0
- package/build/commonjs/Dialog/Dialog.js.map +1 -1
- package/build/commonjs/Modal/Modal.js +28 -19
- package/build/commonjs/Modal/Modal.js.map +1 -1
- package/build/commonjs/Modal/ModalProps.js.map +1 -1
- package/build/commonjs/TextField/TextField.js +9 -2
- package/build/commonjs/TextField/TextField.js.map +1 -1
- package/build/commonjs/TextField/TextFieldProps.js +3 -1
- package/build/commonjs/TextField/TextFieldProps.js.map +1 -1
- package/build/commonjs/TextField/useVariantStyleMap.js +29 -9
- package/build/commonjs/TextField/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/Toolbar/BackButton/BackButton.js +2 -2
- package/build/commonjs/Toolbar/BackButton/BackButton.js.map +1 -1
- package/build/module/Dialog/Dialog.js +1 -0
- package/build/module/Dialog/Dialog.js.map +1 -1
- package/build/module/Modal/Modal.js +29 -20
- package/build/module/Modal/Modal.js.map +1 -1
- package/build/module/Modal/ModalProps.js.map +1 -1
- package/build/module/TextField/TextField.js +9 -2
- package/build/module/TextField/TextField.js.map +1 -1
- package/build/module/TextField/TextFieldProps.js +1 -0
- package/build/module/TextField/TextFieldProps.js.map +1 -1
- package/build/module/TextField/useVariantStyleMap.js +28 -9
- package/build/module/TextField/useVariantStyleMap.js.map +1 -1
- package/build/module/Toolbar/BackButton/BackButton.js +2 -2
- package/build/module/Toolbar/BackButton/BackButton.js.map +1 -1
- package/build/typescript/Modal/ModalProps.d.ts +8 -0
- package/build/typescript/TextField/TextFieldProps.d.ts +13 -0
- package/build/typescript/TextField/useVariantStyleMap.d.ts +2 -2
- package/package.json +2 -2
- package/src/Dialog/Dialog.tsx +1 -0
- package/src/Modal/Modal.tsx +11 -3
- package/src/Modal/ModalProps.ts +9 -0
- package/src/TextField/TextField.tsx +12 -1
- package/src/TextField/TextFieldProps.ts +16 -0
- package/src/TextField/useVariantStyleMap.ts +36 -11
- package/src/Toolbar/BackButton/BackButton.tsx +4 -6
|
@@ -3,7 +3,32 @@ import type { TextStyle } from 'react-native';
|
|
|
3
3
|
import type { FountainUiStyle, Theme } from '@fountain-ui/styles';
|
|
4
4
|
import { typographyOf } from '@fountain-ui/styles';
|
|
5
5
|
import { createFontStyle, useTheme } from '../styles';
|
|
6
|
-
import type { TextFieldStatus, TextFieldVariant } from './TextFieldProps';
|
|
6
|
+
import type { TextFieldInputFontSize, TextFieldStatus, TextFieldVariant } from './TextFieldProps';
|
|
7
|
+
|
|
8
|
+
const fontSizeStyleMap = {
|
|
9
|
+
large: {
|
|
10
|
+
fontSize: 18,
|
|
11
|
+
lineHeight: 27,
|
|
12
|
+
fontFamily: 'PretendardStd-SemiBold',
|
|
13
|
+
letterSpacing: 0,
|
|
14
|
+
},
|
|
15
|
+
small: {
|
|
16
|
+
fontSize: 14,
|
|
17
|
+
lineHeight: 21,
|
|
18
|
+
fontFamily: 'PretendardStd-Medium',
|
|
19
|
+
letterSpacing: 0,
|
|
20
|
+
},
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
const containerPaddingMap = {
|
|
24
|
+
large: {
|
|
25
|
+
paddingVertical: 14,
|
|
26
|
+
},
|
|
27
|
+
small: {
|
|
28
|
+
paddingTop: 18,
|
|
29
|
+
paddingBottom: 16,
|
|
30
|
+
},
|
|
31
|
+
} as const;
|
|
7
32
|
|
|
8
33
|
interface VariantStyleMap {
|
|
9
34
|
containerStyle?: FountainUiStyle;
|
|
@@ -33,7 +58,12 @@ function useStatusColor(theme: Theme, status: TextFieldStatus): { borderColor: s
|
|
|
33
58
|
}
|
|
34
59
|
}
|
|
35
60
|
|
|
36
|
-
export default function useVariantStyleMap(
|
|
61
|
+
export default function useVariantStyleMap(
|
|
62
|
+
variant: TextFieldVariant,
|
|
63
|
+
status: TextFieldStatus,
|
|
64
|
+
isFocused: boolean,
|
|
65
|
+
inputFontSize: TextFieldInputFontSize = 'large',
|
|
66
|
+
): VariantStyleMap {
|
|
37
67
|
const theme = useTheme();
|
|
38
68
|
|
|
39
69
|
const {
|
|
@@ -50,19 +80,14 @@ export default function useVariantStyleMap(variant: TextFieldVariant, status: Te
|
|
|
50
80
|
borderBottomColor: status === 'default' && isFocused ? theme.palette.border.strong : borderColor,
|
|
51
81
|
borderBottomWidth: 1,
|
|
52
82
|
gap: 16,
|
|
53
|
-
minHeight:
|
|
54
|
-
|
|
83
|
+
minHeight: 54,
|
|
84
|
+
...containerPaddingMap[inputFontSize],
|
|
55
85
|
},
|
|
56
86
|
inputStyle: {
|
|
57
87
|
padding: 0,
|
|
58
88
|
},
|
|
59
89
|
inputFontStyle: createFontStyle(theme, {
|
|
60
|
-
selector: (_) => typographyOf(
|
|
61
|
-
fontSize: 18,
|
|
62
|
-
lineHeight: 27,
|
|
63
|
-
fontFamily: 'PretendardStd-SemiBold',
|
|
64
|
-
letterSpacing: 0,
|
|
65
|
-
}),
|
|
90
|
+
selector: (_) => typographyOf(fontSizeStyleMap[inputFontSize]),
|
|
66
91
|
color: theme.palette.text.strong,
|
|
67
92
|
}),
|
|
68
93
|
hintStyle: {
|
|
@@ -98,5 +123,5 @@ export default function useVariantStyleMap(variant: TextFieldVariant, status: Te
|
|
|
98
123
|
}),
|
|
99
124
|
};
|
|
100
125
|
}
|
|
101
|
-
}, [theme, borderColor, hintColor, variant, isFocused]);
|
|
126
|
+
}, [theme, borderColor, hintColor, variant, isFocused, inputFontSize]);
|
|
102
127
|
}
|
|
@@ -33,12 +33,10 @@ export default function BackButton(props: BackButtonProps) {
|
|
|
33
33
|
style={rootStyle}
|
|
34
34
|
{...otherProps}
|
|
35
35
|
>
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/>
|
|
41
|
-
</React.Fragment>
|
|
36
|
+
<AppBarChevronLeft
|
|
37
|
+
height={24}
|
|
38
|
+
width={24}
|
|
39
|
+
/>
|
|
42
40
|
</IconButton>
|
|
43
41
|
);
|
|
44
42
|
}
|