@adiraku/react-native-ui 1.2.9-canary-7 → 2.0.0-canary-2
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/lib/commonjs/components/ActionList/ActionList.component.js +8 -7
- package/lib/commonjs/components/ActionList/ActionList.component.js.map +1 -1
- package/lib/commonjs/components/ActionList/ActionList.styles.js +13 -10
- package/lib/commonjs/components/ActionList/ActionList.styles.js.map +1 -1
- package/lib/commonjs/components/Appbar/Appbar.component.js +5 -4
- package/lib/commonjs/components/Appbar/Appbar.component.js.map +1 -1
- package/lib/commonjs/components/Appbar/Appbar.style.js +15 -12
- package/lib/commonjs/components/Appbar/Appbar.style.js.map +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.component.js +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.component.js.map +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.style.js +10 -8
- package/lib/commonjs/components/BottomSheet/BottomSheet.style.js.map +1 -1
- package/lib/commonjs/components/CheckBoxInput/CheckBoxInput.component.js +16 -16
- package/lib/commonjs/components/CheckBoxInput/CheckBoxInput.component.js.map +1 -1
- package/lib/commonjs/components/CheckBoxInput/CheckBoxInput.style.js +35 -25
- package/lib/commonjs/components/CheckBoxInput/CheckBoxInput.style.js.map +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.component.js +8 -4
- package/lib/commonjs/components/Checkbox/Checkbox.component.js.map +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.style.js +16 -17
- package/lib/commonjs/components/Checkbox/Checkbox.style.js.map +1 -1
- package/lib/commonjs/components/Pagination/pagination.component.js +39 -0
- package/lib/commonjs/components/Pagination/pagination.component.js.map +1 -0
- package/lib/commonjs/components/Pagination/pagination.style.js +26 -0
- package/lib/commonjs/components/Pagination/pagination.style.js.map +1 -0
- package/lib/commonjs/components/Pagination/pagination.type.js +2 -0
- package/lib/commonjs/components/Pagination/pagination.type.js.map +1 -0
- package/lib/commonjs/components/RadioButton/RadioButton.component.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.component.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.style.js +15 -12
- package/lib/commonjs/components/RadioButton/RadioButton.style.js.map +1 -1
- package/lib/commonjs/components/RadioInput/RadioInput.component.js +17 -19
- package/lib/commonjs/components/RadioInput/RadioInput.component.js.map +1 -1
- package/lib/commonjs/components/RadioInput/RadioInput.style.js +35 -25
- package/lib/commonjs/components/RadioInput/RadioInput.style.js.map +1 -1
- package/lib/commonjs/components/StickyBar/StickyBar.component.js +67 -0
- package/lib/commonjs/components/StickyBar/StickyBar.component.js.map +1 -0
- package/lib/commonjs/components/StickyBar/StickyBar.style.js +64 -0
- package/lib/commonjs/components/StickyBar/StickyBar.style.js.map +1 -0
- package/lib/commonjs/components/StickyBar/StickyBar.type.js +6 -0
- package/lib/commonjs/components/StickyBar/StickyBar.type.js.map +1 -0
- package/lib/commonjs/components/TextInput/TextInput.component.js +9 -3
- package/lib/commonjs/components/TextInput/TextInput.component.js.map +1 -1
- package/lib/commonjs/components/TextInput/TextInput.style.js +30 -25
- package/lib/commonjs/components/TextInput/TextInput.style.js.map +1 -1
- package/lib/commonjs/components/View/View.component.js +42 -0
- package/lib/commonjs/components/View/View.component.js.map +1 -0
- package/lib/commonjs/components/View/View.type.js +6 -0
- package/lib/commonjs/components/View/View.type.js.map +1 -0
- package/lib/commonjs/components/button/button.component.js +7 -4
- package/lib/commonjs/components/button/button.component.js.map +1 -1
- package/lib/commonjs/components/button/button.styles.js +21 -17
- package/lib/commonjs/components/button/button.styles.js.map +1 -1
- package/lib/commonjs/components/calendars/calendars.component.js +37 -37
- package/lib/commonjs/components/calendars/calendars.component.js.map +1 -1
- package/lib/commonjs/components/calendars/calendars.service.js.map +1 -1
- package/lib/commonjs/components/calendars/calendars.style.js +73 -51
- package/lib/commonjs/components/calendars/calendars.style.js.map +1 -1
- package/lib/commonjs/components/index.js +21 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/typography/typography.component.js +12 -2
- package/lib/commonjs/components/typography/typography.component.js.map +1 -1
- package/lib/commonjs/components/typography/typography.style.js +21 -351
- package/lib/commonjs/components/typography/typography.style.js.map +1 -1
- package/lib/commonjs/config/index.js +50 -0
- package/lib/commonjs/config/index.js.map +1 -0
- package/lib/commonjs/config/makeStyles.js +37 -0
- package/lib/commonjs/config/makeStyles.js.map +1 -0
- package/lib/commonjs/config/theme.default.js +422 -0
- package/lib/commonjs/config/theme.default.js.map +1 -0
- package/lib/commonjs/config/theme.provider.js +48 -0
- package/lib/commonjs/config/theme.provider.js.map +1 -0
- package/lib/commonjs/config/theme.type.js +6 -0
- package/lib/commonjs/config/theme.type.js.map +1 -0
- package/lib/commonjs/index.js +11 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/themes/border.js.map +1 -1
- package/lib/commonjs/themes/colors.js +1 -1
- package/lib/commonjs/themes/shadow.js +1 -0
- package/lib/commonjs/themes/shadow.js.map +1 -1
- package/lib/module/components/ActionList/ActionList.component.js +8 -7
- package/lib/module/components/ActionList/ActionList.component.js.map +1 -1
- package/lib/module/components/ActionList/ActionList.styles.js +11 -7
- package/lib/module/components/ActionList/ActionList.styles.js.map +1 -1
- package/lib/module/components/Appbar/Appbar.component.js +4 -3
- package/lib/module/components/Appbar/Appbar.component.js.map +1 -1
- package/lib/module/components/Appbar/Appbar.style.js +10 -6
- package/lib/module/components/Appbar/Appbar.style.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.component.js +2 -2
- package/lib/module/components/BottomSheet/BottomSheet.component.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.style.js +10 -7
- package/lib/module/components/BottomSheet/BottomSheet.style.js.map +1 -1
- package/lib/module/components/CheckBoxInput/CheckBoxInput.component.js +17 -17
- package/lib/module/components/CheckBoxInput/CheckBoxInput.component.js.map +1 -1
- package/lib/module/components/CheckBoxInput/CheckBoxInput.style.js +24 -13
- package/lib/module/components/CheckBoxInput/CheckBoxInput.style.js.map +1 -1
- package/lib/module/components/Checkbox/Checkbox.component.js +9 -5
- package/lib/module/components/Checkbox/Checkbox.component.js.map +1 -1
- package/lib/module/components/Checkbox/Checkbox.style.js +14 -14
- package/lib/module/components/Checkbox/Checkbox.style.js.map +1 -1
- package/lib/module/components/Pagination/pagination.component.js +31 -0
- package/lib/module/components/Pagination/pagination.component.js.map +1 -0
- package/lib/module/components/Pagination/pagination.style.js +20 -0
- package/lib/module/components/Pagination/pagination.style.js.map +1 -0
- package/lib/module/components/Pagination/pagination.type.js +2 -0
- package/lib/module/components/Pagination/pagination.type.js.map +1 -0
- package/lib/module/components/RadioButton/RadioButton.component.js +2 -2
- package/lib/module/components/RadioButton/RadioButton.component.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButton.style.js +12 -8
- package/lib/module/components/RadioButton/RadioButton.style.js.map +1 -1
- package/lib/module/components/RadioInput/RadioInput.component.js +17 -19
- package/lib/module/components/RadioInput/RadioInput.component.js.map +1 -1
- package/lib/module/components/RadioInput/RadioInput.style.js +24 -13
- package/lib/module/components/RadioInput/RadioInput.style.js.map +1 -1
- package/lib/module/components/StickyBar/StickyBar.component.js +60 -0
- package/lib/module/components/StickyBar/StickyBar.component.js.map +1 -0
- package/lib/module/components/StickyBar/StickyBar.style.js +57 -0
- package/lib/module/components/StickyBar/StickyBar.style.js.map +1 -0
- package/lib/module/components/StickyBar/StickyBar.type.js +2 -0
- package/lib/module/components/StickyBar/StickyBar.type.js.map +1 -0
- package/lib/module/components/TextInput/TextInput.component.js +10 -4
- package/lib/module/components/TextInput/TextInput.component.js.map +1 -1
- package/lib/module/components/TextInput/TextInput.style.js +21 -15
- package/lib/module/components/TextInput/TextInput.style.js.map +1 -1
- package/lib/module/components/View/View.component.js +35 -0
- package/lib/module/components/View/View.component.js.map +1 -0
- package/lib/module/components/View/View.type.js +2 -0
- package/lib/module/components/View/View.type.js.map +1 -0
- package/lib/module/components/button/button.component.js +7 -4
- package/lib/module/components/button/button.component.js.map +1 -1
- package/lib/module/components/button/button.styles.js +14 -9
- package/lib/module/components/button/button.styles.js.map +1 -1
- package/lib/module/components/calendars/calendars.component.js +36 -36
- package/lib/module/components/calendars/calendars.component.js.map +1 -1
- package/lib/module/components/calendars/calendars.service.js.map +1 -1
- package/lib/module/components/calendars/calendars.style.js +65 -43
- package/lib/module/components/calendars/calendars.style.js.map +1 -1
- package/lib/module/components/index.js +3 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/typography/typography.component.js +13 -3
- package/lib/module/components/typography/typography.component.js.map +1 -1
- package/lib/module/components/typography/typography.style.js +21 -350
- package/lib/module/components/typography/typography.style.js.map +1 -1
- package/lib/module/config/index.js +5 -0
- package/lib/module/config/index.js.map +1 -0
- package/lib/module/config/makeStyles.js +30 -0
- package/lib/module/config/makeStyles.js.map +1 -0
- package/lib/module/config/theme.default.js +416 -0
- package/lib/module/config/theme.default.js.map +1 -0
- package/lib/module/config/theme.provider.js +35 -0
- package/lib/module/config/theme.provider.js.map +1 -0
- package/lib/module/config/theme.type.js +2 -0
- package/lib/module/config/theme.type.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/themes/border.js.map +1 -1
- package/lib/module/themes/colors.js +1 -1
- package/lib/module/themes/shadow.js +1 -0
- package/lib/module/themes/shadow.js.map +1 -1
- package/lib/typescript/components/ActionList/ActionList.component.d.ts.map +1 -1
- package/lib/typescript/components/ActionList/ActionList.styles.d.ts +3 -4
- package/lib/typescript/components/ActionList/ActionList.styles.d.ts.map +1 -1
- package/lib/typescript/components/Appbar/Appbar.component.d.ts.map +1 -1
- package/lib/typescript/components/Appbar/Appbar.style.d.ts +2 -3
- package/lib/typescript/components/Appbar/Appbar.style.d.ts.map +1 -1
- package/lib/typescript/components/BottomSheet/BottomSheet.style.d.ts +1 -1
- package/lib/typescript/components/BottomSheet/BottomSheet.style.d.ts.map +1 -1
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.component.d.ts +1 -1
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.component.d.ts.map +1 -1
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.style.d.ts +5 -4
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.style.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/Checkbox.component.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/Checkbox.style.d.ts +3 -2
- package/lib/typescript/components/Checkbox/Checkbox.style.d.ts.map +1 -1
- package/lib/typescript/components/Pagination/pagination.component.d.ts +5 -0
- package/lib/typescript/components/Pagination/pagination.component.d.ts.map +1 -0
- package/lib/typescript/components/Pagination/pagination.style.d.ts +19 -0
- package/lib/typescript/components/Pagination/pagination.style.d.ts.map +1 -0
- package/lib/typescript/components/Pagination/pagination.type.d.ts +15 -0
- package/lib/typescript/components/Pagination/pagination.type.d.ts.map +1 -0
- package/lib/typescript/components/RadioButton/RadioButton.component.d.ts +1 -1
- package/lib/typescript/components/RadioButton/RadioButton.component.d.ts.map +1 -1
- package/lib/typescript/components/RadioButton/RadioButton.style.d.ts +2 -2
- package/lib/typescript/components/RadioButton/RadioButton.style.d.ts.map +1 -1
- package/lib/typescript/components/RadioInput/RadioInput.component.d.ts.map +1 -1
- package/lib/typescript/components/RadioInput/RadioInput.style.d.ts +5 -4
- package/lib/typescript/components/RadioInput/RadioInput.style.d.ts.map +1 -1
- package/lib/typescript/components/StickyBar/StickyBar.component.d.ts +5 -0
- package/lib/typescript/components/StickyBar/StickyBar.component.d.ts.map +1 -0
- package/lib/typescript/components/StickyBar/StickyBar.style.d.ts +15 -0
- package/lib/typescript/components/StickyBar/StickyBar.style.d.ts.map +1 -0
- package/lib/typescript/components/StickyBar/StickyBar.type.d.ts +30 -0
- package/lib/typescript/components/StickyBar/StickyBar.type.d.ts.map +1 -0
- package/lib/typescript/components/TextInput/TextInput.component.d.ts.map +1 -1
- package/lib/typescript/components/TextInput/TextInput.style.d.ts +6 -4
- package/lib/typescript/components/TextInput/TextInput.style.d.ts.map +1 -1
- package/lib/typescript/components/TextInput/TextInput.type.d.ts +1 -1
- package/lib/typescript/components/TextInput/TextInput.type.d.ts.map +1 -1
- package/lib/typescript/components/View/View.component.d.ts +4 -0
- package/lib/typescript/components/View/View.component.d.ts.map +1 -0
- package/lib/typescript/components/View/View.type.d.ts +10 -0
- package/lib/typescript/components/View/View.type.d.ts.map +1 -0
- package/lib/typescript/components/button/button.component.d.ts.map +1 -1
- package/lib/typescript/components/button/button.styles.d.ts +3 -4
- package/lib/typescript/components/button/button.styles.d.ts.map +1 -1
- package/lib/typescript/components/calendars/calendars.component.d.ts.map +1 -1
- package/lib/typescript/components/calendars/calendars.service.d.ts.map +1 -1
- package/lib/typescript/components/calendars/calendars.style.d.ts +6 -4
- package/lib/typescript/components/calendars/calendars.style.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +7 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/typography/typography.component.d.ts +1 -1
- package/lib/typescript/components/typography/typography.component.d.ts.map +1 -1
- package/lib/typescript/components/typography/typography.style.d.ts +5 -60
- package/lib/typescript/components/typography/typography.style.d.ts.map +1 -1
- package/lib/typescript/components/typography/typography.type.d.ts +7 -0
- package/lib/typescript/components/typography/typography.type.d.ts.map +1 -1
- package/lib/typescript/config/index.d.ts +5 -0
- package/lib/typescript/config/index.d.ts.map +1 -0
- package/lib/typescript/config/makeStyles.d.ts +4 -0
- package/lib/typescript/config/makeStyles.d.ts.map +1 -0
- package/lib/typescript/config/theme.default.d.ts +178 -0
- package/lib/typescript/config/theme.default.d.ts.map +1 -0
- package/lib/typescript/config/theme.provider.d.ts +8 -0
- package/lib/typescript/config/theme.provider.d.ts.map +1 -0
- package/lib/typescript/config/theme.type.d.ts +12 -0
- package/lib/typescript/config/theme.type.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/themes/shadow.d.ts +2 -3
- package/lib/typescript/themes/shadow.d.ts.map +1 -1
- package/package.json +5 -1
- package/src/components/ActionList/ActionList.component.tsx +20 -17
- package/src/components/ActionList/ActionList.styles.tsx +11 -11
- package/src/components/Appbar/Appbar.component.tsx +4 -3
- package/src/components/Appbar/Appbar.style.tsx +9 -9
- package/src/components/BottomSheet/BottomSheet.component.tsx +2 -2
- package/src/components/BottomSheet/BottomSheet.style.tsx +9 -7
- package/src/components/CheckBoxInput/CheckBoxInput.component.tsx +21 -20
- package/src/components/CheckBoxInput/CheckBoxInput.style.tsx +29 -15
- package/src/components/Checkbox/Checkbox.component.tsx +13 -13
- package/src/components/Checkbox/Checkbox.style.tsx +16 -17
- package/src/components/Pagination/pagination.component.tsx +29 -0
- package/src/components/Pagination/pagination.style.tsx +20 -0
- package/src/components/Pagination/pagination.type.ts +16 -0
- package/src/components/RadioButton/RadioButton.component.tsx +3 -4
- package/src/components/RadioButton/RadioButton.style.tsx +10 -10
- package/src/components/RadioInput/RadioInput.component.tsx +14 -15
- package/src/components/RadioInput/RadioInput.style.tsx +29 -15
- package/src/components/StickyBar/StickyBar.component.tsx +74 -0
- package/src/components/StickyBar/StickyBar.style.tsx +79 -0
- package/src/components/StickyBar/StickyBar.type.ts +35 -0
- package/src/components/TextInput/TextInput.component.tsx +7 -6
- package/src/components/TextInput/TextInput.style.tsx +86 -70
- package/src/components/TextInput/TextInput.type.ts +1 -1
- package/src/components/View/View.component.tsx +42 -0
- package/src/components/View/View.type.ts +14 -0
- package/src/components/button/button.component.tsx +9 -4
- package/src/components/button/button.styles.ts +15 -15
- package/src/components/calendars/calendars.component.tsx +27 -22
- package/src/components/calendars/calendars.service.ts +7 -3
- package/src/components/calendars/calendars.style.ts +77 -49
- package/src/components/index.ts +15 -0
- package/src/components/typography/typography.component.tsx +17 -4
- package/src/components/typography/typography.style.tsx +17 -472
- package/src/components/typography/typography.type.ts +9 -0
- package/src/config/index.ts +4 -0
- package/src/config/makeStyles.ts +52 -0
- package/src/config/theme.default.ts +440 -0
- package/src/config/theme.provider.tsx +53 -0
- package/src/config/theme.type.ts +17 -0
- package/src/index.tsx +1 -0
- package/src/themes/border.ts +3 -3
- package/src/themes/colors.ts +1 -1
- package/src/themes/shadow.tsx +4 -2
|
@@ -1,480 +1,25 @@
|
|
|
1
|
-
import type { TextStyle } from 'react-native';
|
|
2
|
-
import { StyleSheet } from 'react-native';
|
|
3
|
-
import { Palettes } from '../../themes';
|
|
4
1
|
import type { TypographyProps } from './typography.type';
|
|
2
|
+
import { makeStyles } from '../../config';
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
'
|
|
9
|
-
'heading2-semibold'?: TextStyle;
|
|
10
|
-
'heading2-regular'?: TextStyle;
|
|
11
|
-
'heading3-semibold'?: TextStyle;
|
|
12
|
-
'heading3-regular'?: TextStyle;
|
|
13
|
-
'heading4-semibold'?: TextStyle;
|
|
14
|
-
'heading4-regular'?: TextStyle;
|
|
15
|
-
'heading5-bold'?: TextStyle;
|
|
16
|
-
'heading5-semibold'?: TextStyle;
|
|
17
|
-
'heading5-regular'?: TextStyle;
|
|
18
|
-
'heading6-bold'?: TextStyle;
|
|
19
|
-
'heading6-semibold'?: TextStyle;
|
|
20
|
-
'heading6-regular'?: TextStyle;
|
|
21
|
-
'subheading'?: TextStyle;
|
|
22
|
-
'subtitle1'?: TextStyle;
|
|
23
|
-
'subtitle2'?: TextStyle;
|
|
24
|
-
'subtitle2-extrabold'?: TextStyle;
|
|
25
|
-
'body1'?: TextStyle;
|
|
26
|
-
'body2'?: TextStyle;
|
|
27
|
-
'body3'?: TextStyle;
|
|
28
|
-
'button'?: TextStyle;
|
|
29
|
-
'button-small'?: TextStyle;
|
|
30
|
-
'caption'?: TextStyle;
|
|
31
|
-
'caption2'?: TextStyle;
|
|
32
|
-
'overline'?: TextStyle;
|
|
33
|
-
'overline-small'?: TextStyle;
|
|
4
|
+
export const useStyles = makeStyles((themes, props: TypographyProps) => {
|
|
5
|
+
const { Fonts, FontFamilyStyle } = themes;
|
|
6
|
+
const { variant = 'body1', fontStyle = 'normal' } = props;
|
|
34
7
|
|
|
35
|
-
|
|
36
|
-
'text-heading-h1-semibold'?: TextStyle;
|
|
37
|
-
'text-heading-h1-regular'?: TextStyle;
|
|
38
|
-
'text-heading-h2-semibold'?: TextStyle;
|
|
39
|
-
'text-heading-h2-regular'?: TextStyle;
|
|
40
|
-
'text-heading-h3-bold'?: TextStyle;
|
|
41
|
-
'text-heading-h3-regular'?: TextStyle;
|
|
42
|
-
'text-heading-h4-semibold'?: TextStyle;
|
|
43
|
-
'text-heading-h4-regular'?: TextStyle;
|
|
44
|
-
'text-heading-h5-bold'?: TextStyle;
|
|
45
|
-
'text-heading-h5-semibold'?: TextStyle;
|
|
46
|
-
'text-heading-h5-regular'?: TextStyle;
|
|
47
|
-
'text-heading-h6-bold'?: TextStyle;
|
|
48
|
-
'text-heading-h6-semibold'?: TextStyle;
|
|
49
|
-
'text-heading-h6-regular'?: TextStyle;
|
|
50
|
-
// Subheading
|
|
51
|
-
'text-sub-heading-semibold'?: TextStyle;
|
|
52
|
-
// Subtitle
|
|
53
|
-
'text-subtitle-primary-semibold'?: TextStyle;
|
|
54
|
-
'text-subtitle-secondary-bold'?: TextStyle;
|
|
55
|
-
'text-subtitle-secondary-semibold'?: TextStyle;
|
|
56
|
-
// Button
|
|
57
|
-
'text-button-default-semibold'?: TextStyle;
|
|
58
|
-
'text-button-small-semibold'?: TextStyle;
|
|
59
|
-
// Caption
|
|
60
|
-
'text-caption-semibold'?: TextStyle;
|
|
61
|
-
'text-caption-regular'?: TextStyle;
|
|
62
|
-
// Overline
|
|
63
|
-
'text-overline-semibold'?: TextStyle;
|
|
64
|
-
'text-overline-regular'?: TextStyle;
|
|
65
|
-
'text-overline-strike'?: TextStyle;
|
|
66
|
-
// Body
|
|
67
|
-
'text-body-primary-regular'?: TextStyle;
|
|
68
|
-
'text-body-secondary-regular'?: TextStyle;
|
|
69
|
-
'text-body-tertiary-regular'?: TextStyle;
|
|
70
|
-
}
|
|
8
|
+
const baseStyle = FontFamilyStyle[variant] ?? FontFamilyStyle.body1;
|
|
71
9
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
10
|
+
if (!baseStyle.fontFamily) {
|
|
11
|
+
// Apply appropriate font based on its font style
|
|
12
|
+
const fontType = baseStyle.fontType ?? 'regular';
|
|
13
|
+
const isItalic = fontStyle === 'italic' || baseStyle.fontStyle === 'italic';
|
|
14
|
+
const fontKey = (fontType +
|
|
15
|
+
(isItalic ? 'Italic' : '')) as keyof typeof Fonts;
|
|
75
16
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
fontFamily:
|
|
79
|
-
fontStyle === 'italic' ? 'Montserrat-Italic' : 'Montserrat-Regular',
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const textSemibold: TextStyle = {
|
|
83
|
-
fontFamily:
|
|
84
|
-
fontStyle === 'italic'
|
|
85
|
-
? 'Montserrat-SemiBoldItalic'
|
|
86
|
-
: 'Montserrat-SemiBold',
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const textBold: TextStyle = {
|
|
90
|
-
fontFamily:
|
|
91
|
-
fontStyle === 'italic' ? 'Montserrat-BoldItalic' : 'Montserrat-Bold',
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
computedStyle['heading1-semibold'] = {
|
|
95
|
-
...baseTextStyle,
|
|
96
|
-
...textSemibold,
|
|
97
|
-
fontSize: 92,
|
|
98
|
-
lineHeight: 144,
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
computedStyle['heading1-regular'] = {
|
|
102
|
-
...baseTextStyle,
|
|
103
|
-
fontSize: 92,
|
|
104
|
-
lineHeight: 144,
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
computedStyle['heading2-semibold'] = {
|
|
108
|
-
...baseTextStyle,
|
|
109
|
-
...textSemibold,
|
|
110
|
-
fontSize: 60,
|
|
111
|
-
lineHeight: 90,
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
computedStyle['heading2-regular'] = {
|
|
115
|
-
...baseTextStyle,
|
|
116
|
-
fontSize: 60,
|
|
117
|
-
lineHeight: 90,
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
computedStyle['heading3-semibold'] = {
|
|
121
|
-
...baseTextStyle,
|
|
122
|
-
...textSemibold,
|
|
123
|
-
fontSize: 48,
|
|
124
|
-
lineHeight: 72,
|
|
125
|
-
};
|
|
17
|
+
baseStyle.fontFamily = Fonts[fontKey];
|
|
18
|
+
}
|
|
126
19
|
|
|
127
|
-
|
|
128
|
-
...baseTextStyle,
|
|
129
|
-
fontSize: 48,
|
|
130
|
-
lineHeight: 72,
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
computedStyle['heading4-semibold'] = {
|
|
134
|
-
...baseTextStyle,
|
|
135
|
-
...textSemibold,
|
|
136
|
-
fontSize: 34,
|
|
137
|
-
lineHeight: 51,
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
computedStyle['heading4-regular'] = {
|
|
141
|
-
...baseTextStyle,
|
|
142
|
-
fontSize: 34,
|
|
143
|
-
lineHeight: 51,
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
computedStyle['heading5-bold'] = {
|
|
147
|
-
...baseTextStyle,
|
|
148
|
-
...textBold,
|
|
149
|
-
fontSize: 24,
|
|
150
|
-
lineHeight: 36,
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
computedStyle['heading5-semibold'] = {
|
|
154
|
-
...baseTextStyle,
|
|
155
|
-
...textSemibold,
|
|
156
|
-
fontSize: 24,
|
|
157
|
-
lineHeight: 36,
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
computedStyle['heading5-regular'] = {
|
|
161
|
-
...baseTextStyle,
|
|
162
|
-
fontSize: 24,
|
|
163
|
-
lineHeight: 36,
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
computedStyle['heading6-bold'] = {
|
|
167
|
-
...baseTextStyle,
|
|
168
|
-
...textBold,
|
|
169
|
-
fontSize: 20,
|
|
170
|
-
lineHeight: 30,
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
computedStyle['heading6-semibold'] = {
|
|
174
|
-
...baseTextStyle,
|
|
175
|
-
...textSemibold,
|
|
176
|
-
fontSize: 20,
|
|
177
|
-
lineHeight: 30,
|
|
178
|
-
};
|
|
20
|
+
delete baseStyle.fontType;
|
|
179
21
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
fontSize: 20,
|
|
183
|
-
lineHeight: 30,
|
|
22
|
+
return {
|
|
23
|
+
base: baseStyle,
|
|
184
24
|
};
|
|
185
|
-
|
|
186
|
-
computedStyle.subheading = {
|
|
187
|
-
...baseTextStyle,
|
|
188
|
-
...textSemibold,
|
|
189
|
-
fontSize: 18,
|
|
190
|
-
lineHeight: 27,
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
computedStyle.subtitle1 = {
|
|
194
|
-
...baseTextStyle,
|
|
195
|
-
...textSemibold,
|
|
196
|
-
fontSize: 16,
|
|
197
|
-
lineHeight: 24,
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
computedStyle.subtitle2 = {
|
|
201
|
-
...baseTextStyle,
|
|
202
|
-
...textSemibold,
|
|
203
|
-
fontSize: 14,
|
|
204
|
-
lineHeight: 21,
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
computedStyle['subtitle2-extrabold'] = {
|
|
208
|
-
...baseTextStyle,
|
|
209
|
-
...textBold,
|
|
210
|
-
fontSize: 14,
|
|
211
|
-
lineHeight: 21,
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
computedStyle.body1 = {
|
|
215
|
-
...baseTextStyle,
|
|
216
|
-
fontSize: 16,
|
|
217
|
-
lineHeight: 24,
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
computedStyle.body2 = {
|
|
221
|
-
...baseTextStyle,
|
|
222
|
-
fontSize: 14,
|
|
223
|
-
lineHeight: 21,
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
computedStyle.body3 = {
|
|
227
|
-
...baseTextStyle,
|
|
228
|
-
fontSize: 12,
|
|
229
|
-
lineHeight: 21,
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
computedStyle.button = {
|
|
233
|
-
...baseTextStyle,
|
|
234
|
-
...textSemibold,
|
|
235
|
-
fontSize: 14,
|
|
236
|
-
lineHeight: 21,
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
computedStyle['button-small'] = {
|
|
240
|
-
...baseTextStyle,
|
|
241
|
-
...textSemibold,
|
|
242
|
-
fontSize: 12,
|
|
243
|
-
lineHeight: 18,
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
computedStyle.caption = {
|
|
247
|
-
...baseTextStyle,
|
|
248
|
-
fontSize: 12,
|
|
249
|
-
lineHeight: 18,
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
computedStyle.caption2 = {
|
|
253
|
-
...baseTextStyle,
|
|
254
|
-
...textSemibold,
|
|
255
|
-
fontSize: 12,
|
|
256
|
-
lineHeight: 18,
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
computedStyle.overline = {
|
|
260
|
-
...baseTextStyle,
|
|
261
|
-
...textSemibold,
|
|
262
|
-
fontSize: 10,
|
|
263
|
-
lineHeight: 15,
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
computedStyle['overline-small'] = {
|
|
267
|
-
...baseTextStyle,
|
|
268
|
-
fontSize: 10,
|
|
269
|
-
lineHeight: 15,
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
// -===== New Token update =====-
|
|
273
|
-
const textSemiboldV2: TextStyle = {
|
|
274
|
-
fontFamily:
|
|
275
|
-
fontStyle === 'italic'
|
|
276
|
-
? 'Montserrat-SemiBoldItalic'
|
|
277
|
-
: 'Montserrat-SemiBold',
|
|
278
|
-
fontSize: 600,
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
const textBoldV2: TextStyle = {
|
|
282
|
-
fontFamily:
|
|
283
|
-
fontStyle === 'italic' ? 'Montserrat-BoldItalic' : 'Montserrat-Bold',
|
|
284
|
-
fontSize: 700,
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
// Heading
|
|
288
|
-
computedStyle['text-heading-h1-semibold'] = {
|
|
289
|
-
...baseTextStyle,
|
|
290
|
-
...textSemiboldV2,
|
|
291
|
-
fontSize: 96,
|
|
292
|
-
lineHeight: 96,
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
computedStyle['text-heading-h1-regular'] = {
|
|
296
|
-
...baseTextStyle,
|
|
297
|
-
fontSize: 96,
|
|
298
|
-
lineHeight: 96,
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
computedStyle['text-heading-h2-semibold'] = {
|
|
302
|
-
...baseTextStyle,
|
|
303
|
-
...textSemiboldV2,
|
|
304
|
-
fontSize: 60,
|
|
305
|
-
lineHeight: 60,
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
computedStyle['text-heading-h2-regular'] = {
|
|
309
|
-
...baseTextStyle,
|
|
310
|
-
fontSize: 60,
|
|
311
|
-
lineHeight: 60,
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
computedStyle['text-heading-h3-bold'] = {
|
|
315
|
-
...baseTextStyle,
|
|
316
|
-
...textBoldV2,
|
|
317
|
-
fontSize: 48,
|
|
318
|
-
lineHeight: 48,
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
computedStyle['text-heading-h3-regular'] = {
|
|
322
|
-
...baseTextStyle,
|
|
323
|
-
fontSize: 48,
|
|
324
|
-
lineHeight: 48,
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
computedStyle['text-heading-h4-semibold'] = {
|
|
328
|
-
...baseTextStyle,
|
|
329
|
-
...textSemiboldV2,
|
|
330
|
-
fontSize: 34,
|
|
331
|
-
lineHeight: 34,
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
computedStyle['text-heading-h4-regular'] = {
|
|
335
|
-
...baseTextStyle,
|
|
336
|
-
fontSize: 34,
|
|
337
|
-
lineHeight: 34,
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
computedStyle['text-heading-h5-bold'] = {
|
|
341
|
-
...baseTextStyle,
|
|
342
|
-
...textBoldV2,
|
|
343
|
-
fontSize: 24,
|
|
344
|
-
lineHeight: 24,
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
computedStyle['text-heading-h5-semibold'] = {
|
|
348
|
-
...baseTextStyle,
|
|
349
|
-
...textSemiboldV2,
|
|
350
|
-
fontSize: 24,
|
|
351
|
-
lineHeight: 24,
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
computedStyle['text-heading-h5-regular'] = {
|
|
355
|
-
...baseTextStyle,
|
|
356
|
-
fontSize: 24,
|
|
357
|
-
lineHeight: 24,
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
computedStyle['text-heading-h6-bold'] = {
|
|
361
|
-
...baseTextStyle,
|
|
362
|
-
...textBoldV2,
|
|
363
|
-
fontSize: 20,
|
|
364
|
-
lineHeight: 20,
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
computedStyle['text-heading-h6-semibold'] = {
|
|
368
|
-
...baseTextStyle,
|
|
369
|
-
...textSemiboldV2,
|
|
370
|
-
fontSize: 20,
|
|
371
|
-
lineHeight: 20,
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
computedStyle['text-heading-h6-regular'] = {
|
|
375
|
-
...baseTextStyle,
|
|
376
|
-
fontSize: 20,
|
|
377
|
-
lineHeight: 20,
|
|
378
|
-
};
|
|
379
|
-
|
|
380
|
-
// Sub Heading
|
|
381
|
-
computedStyle['text-sub-heading-semibold'] = {
|
|
382
|
-
...baseTextStyle,
|
|
383
|
-
...textSemiboldV2,
|
|
384
|
-
fontSize: 14,
|
|
385
|
-
lineHeight: 14,
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
// Subtitle
|
|
389
|
-
computedStyle['text-subtitle-primary-semibold'] = {
|
|
390
|
-
...baseTextStyle,
|
|
391
|
-
...textSemiboldV2,
|
|
392
|
-
fontSize: 16,
|
|
393
|
-
lineHeight: 16,
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
computedStyle['text-subtitle-secondary-bold'] = {
|
|
397
|
-
...baseTextStyle,
|
|
398
|
-
...textSemiboldV2,
|
|
399
|
-
fontSize: 14,
|
|
400
|
-
lineHeight: 14,
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
computedStyle['text-subtitle-secondary-semibold'] = {
|
|
404
|
-
...baseTextStyle,
|
|
405
|
-
...textSemiboldV2,
|
|
406
|
-
fontSize: 14,
|
|
407
|
-
lineHeight: 14,
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
// Button
|
|
411
|
-
computedStyle['text-button-default-semibold'] = {
|
|
412
|
-
...baseTextStyle,
|
|
413
|
-
...textSemiboldV2,
|
|
414
|
-
fontSize: 14,
|
|
415
|
-
lineHeight: 14,
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
computedStyle['text-button-small-semibold'] = {
|
|
419
|
-
...baseTextStyle,
|
|
420
|
-
...textSemiboldV2,
|
|
421
|
-
fontSize: 12,
|
|
422
|
-
lineHeight: 12,
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
// Caption
|
|
426
|
-
computedStyle['text-caption-semibold'] = {
|
|
427
|
-
...baseTextStyle,
|
|
428
|
-
...textSemiboldV2,
|
|
429
|
-
fontSize: 12,
|
|
430
|
-
lineHeight: 12,
|
|
431
|
-
};
|
|
432
|
-
|
|
433
|
-
computedStyle['text-caption-regular'] = {
|
|
434
|
-
...baseTextStyle,
|
|
435
|
-
fontSize: 12,
|
|
436
|
-
lineHeight: 12,
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
// Overline
|
|
440
|
-
computedStyle['text-overline-semibold'] = {
|
|
441
|
-
...baseTextStyle,
|
|
442
|
-
...textSemiboldV2,
|
|
443
|
-
fontSize: 10,
|
|
444
|
-
lineHeight: 10,
|
|
445
|
-
};
|
|
446
|
-
|
|
447
|
-
computedStyle['text-overline-regular'] = {
|
|
448
|
-
...baseTextStyle,
|
|
449
|
-
fontSize: 12,
|
|
450
|
-
lineHeight: 12,
|
|
451
|
-
};
|
|
452
|
-
|
|
453
|
-
computedStyle['text-overline-strike'] = {
|
|
454
|
-
...baseTextStyle,
|
|
455
|
-
textDecorationLine: 'line-through',
|
|
456
|
-
fontSize: 12,
|
|
457
|
-
lineHeight: 12,
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
// Body
|
|
461
|
-
computedStyle['text-body-primary-regular'] = {
|
|
462
|
-
...baseTextStyle,
|
|
463
|
-
fontSize: 16,
|
|
464
|
-
lineHeight: 16,
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
computedStyle['text-body-secondary-regular'] = {
|
|
468
|
-
...baseTextStyle,
|
|
469
|
-
fontSize: 14,
|
|
470
|
-
lineHeight: 14,
|
|
471
|
-
};
|
|
472
|
-
|
|
473
|
-
computedStyle['text-body-tertiary-regular'] = {
|
|
474
|
-
...baseTextStyle,
|
|
475
|
-
fontSize: 12,
|
|
476
|
-
lineHeight: 12,
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
return StyleSheet.create(computedStyle);
|
|
480
|
-
};
|
|
25
|
+
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ColorValue, TextStyle, TextProps } from 'react-native';
|
|
2
2
|
|
|
3
|
+
import { ColorTokenType } from '../../config';
|
|
4
|
+
|
|
3
5
|
export interface TypographyProps extends TextProps {
|
|
4
6
|
// children: string | null;
|
|
5
7
|
/**
|
|
@@ -74,6 +76,7 @@ export interface TypographyProps extends TextProps {
|
|
|
74
76
|
/**
|
|
75
77
|
* The color of the Text
|
|
76
78
|
* @default Palettes.Black.900 | #112639
|
|
79
|
+
* @deprecated Deprecated, please use color props instead
|
|
77
80
|
*/
|
|
78
81
|
fontColor?: ColorValue;
|
|
79
82
|
|
|
@@ -81,4 +84,10 @@ export interface TypographyProps extends TextProps {
|
|
|
81
84
|
* The style of the text, extended from TextStyle
|
|
82
85
|
*/
|
|
83
86
|
textStyles?: TextStyle;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Color of the Text component, using design token variant
|
|
90
|
+
* @default text-primary
|
|
91
|
+
*/
|
|
92
|
+
color?: Extract<keyof ColorTokenType, `text-${string}`>;
|
|
84
93
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useAppTheme } from './theme.provider';
|
|
5
|
+
import { AppThemeColor } from './theme.type';
|
|
6
|
+
|
|
7
|
+
export const makeStyles =
|
|
8
|
+
<T extends StyleSheet.NamedStyles<T> | StyleSheet.NamedStyles<any>, V>(
|
|
9
|
+
styles: T | ((theme: AppThemeColor, props: V) => T)
|
|
10
|
+
) =>
|
|
11
|
+
(props?: V): T => {
|
|
12
|
+
const {
|
|
13
|
+
colors,
|
|
14
|
+
Border,
|
|
15
|
+
FontFamilyStyle,
|
|
16
|
+
Fonts,
|
|
17
|
+
Radius,
|
|
18
|
+
Shadow,
|
|
19
|
+
Spacing,
|
|
20
|
+
colorScheme,
|
|
21
|
+
} = useAppTheme();
|
|
22
|
+
|
|
23
|
+
return useMemo(() => {
|
|
24
|
+
const theme = {
|
|
25
|
+
colors,
|
|
26
|
+
Border,
|
|
27
|
+
FontFamilyStyle,
|
|
28
|
+
Fonts,
|
|
29
|
+
Radius,
|
|
30
|
+
Shadow,
|
|
31
|
+
Spacing,
|
|
32
|
+
colorScheme,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const css =
|
|
36
|
+
typeof styles === 'function'
|
|
37
|
+
? styles(theme, props ?? ({} as any))
|
|
38
|
+
: styles;
|
|
39
|
+
|
|
40
|
+
return StyleSheet.create(css);
|
|
41
|
+
}, [
|
|
42
|
+
Border,
|
|
43
|
+
FontFamilyStyle,
|
|
44
|
+
Fonts,
|
|
45
|
+
Radius,
|
|
46
|
+
Shadow,
|
|
47
|
+
Spacing,
|
|
48
|
+
colorScheme,
|
|
49
|
+
colors,
|
|
50
|
+
props,
|
|
51
|
+
]);
|
|
52
|
+
};
|