@xaui/native 0.2.7 → 0.9.1-alpha.0
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/dist/chunk-JDS6KGCM.cjs +791 -0
- package/dist/chunk-T3ZI2PZ6.js +791 -0
- package/dist/index.cjs +32 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +32 -0
- package/dist/theme/index.cjs +32 -0
- package/dist/theme/index.d.cts +669 -0
- package/dist/theme/index.d.ts +669 -0
- package/dist/theme/index.js +32 -0
- package/package.json +26 -249
- package/README.md +0 -178
- package/dist/alert/index.cjs +0 -356
- package/dist/alert/index.d.cts +0 -90
- package/dist/alert/index.d.ts +0 -90
- package/dist/alert/index.js +0 -356
- package/dist/app-bar/index.cjs +0 -148
- package/dist/app-bar/index.d.cts +0 -59
- package/dist/app-bar/index.d.ts +0 -59
- package/dist/app-bar/index.js +0 -148
- package/dist/autocomplete/index.cjs +0 -1122
- package/dist/autocomplete/index.d.cts +0 -88
- package/dist/autocomplete/index.d.ts +0 -88
- package/dist/autocomplete/index.js +0 -1122
- package/dist/avatar/index.cjs +0 -281
- package/dist/avatar/index.d.cts +0 -123
- package/dist/avatar/index.d.ts +0 -123
- package/dist/avatar/index.js +0 -281
- package/dist/badge/index.cjs +0 -197
- package/dist/badge/index.d.cts +0 -94
- package/dist/badge/index.d.ts +0 -94
- package/dist/badge/index.js +0 -197
- package/dist/bottom-sheet/index.cjs +0 -9
- package/dist/bottom-sheet/index.d.cts +0 -84
- package/dist/bottom-sheet/index.d.ts +0 -84
- package/dist/bottom-sheet/index.js +0 -9
- package/dist/bottom-tab-bar/index.cjs +0 -497
- package/dist/bottom-tab-bar/index.d.cts +0 -211
- package/dist/bottom-tab-bar/index.d.ts +0 -211
- package/dist/bottom-tab-bar/index.js +0 -497
- package/dist/button/index.cjs +0 -392
- package/dist/button/index.d.cts +0 -174
- package/dist/button/index.d.ts +0 -174
- package/dist/button/index.js +0 -392
- package/dist/button.type-j1ZdkkSl.d.cts +0 -4
- package/dist/button.type-j1ZdkkSl.d.ts +0 -4
- package/dist/card/index.cjs +0 -338
- package/dist/card/index.d.cts +0 -191
- package/dist/card/index.d.ts +0 -191
- package/dist/card/index.js +0 -338
- package/dist/carousel/index.cjs +0 -381
- package/dist/carousel/index.d.cts +0 -147
- package/dist/carousel/index.d.ts +0 -147
- package/dist/carousel/index.js +0 -381
- package/dist/chart/index.cjs +0 -1026
- package/dist/chart/index.d.cts +0 -218
- package/dist/chart/index.d.ts +0 -218
- package/dist/chart/index.js +0 -1026
- package/dist/checkbox/index.cjs +0 -443
- package/dist/checkbox/index.d.cts +0 -73
- package/dist/checkbox/index.d.ts +0 -73
- package/dist/checkbox/index.js +0 -443
- package/dist/chip/index.cjs +0 -503
- package/dist/chip/index.d.cts +0 -195
- package/dist/chip/index.d.ts +0 -195
- package/dist/chip/index.js +0 -503
- package/dist/chunk-4JFWQ5XT.js +0 -368
- package/dist/chunk-56RPWZD2.cjs +0 -9
- package/dist/chunk-7UFBLUMV.cjs +0 -136
- package/dist/chunk-A45TVXU5.js +0 -337
- package/dist/chunk-BYWUAPC4.cjs +0 -368
- package/dist/chunk-DECMUMCI.js +0 -0
- package/dist/chunk-DHSTKO3K.cjs +0 -19
- package/dist/chunk-DJ4Q37UT.cjs +0 -75
- package/dist/chunk-EUQDGTST.cjs +0 -1
- package/dist/chunk-GBHQCAKW.js +0 -19
- package/dist/chunk-RBSA4NH4.js +0 -136
- package/dist/chunk-SHBDANQN.js +0 -9
- package/dist/chunk-UGEINZM7.cjs +0 -290
- package/dist/chunk-UU4HHBDN.js +0 -290
- package/dist/chunk-VSZEXOUN.js +0 -384
- package/dist/chunk-YIEUN3G5.cjs +0 -384
- package/dist/chunk-ZH6ZSV2Q.cjs +0 -337
- package/dist/chunk-ZY7IUTAT.js +0 -75
- package/dist/color-picker/index.cjs +0 -457
- package/dist/color-picker/index.d.cts +0 -124
- package/dist/color-picker/index.d.ts +0 -124
- package/dist/color-picker/index.js +0 -457
- package/dist/core/index.cjs +0 -24
- package/dist/core/index.d.cts +0 -28
- package/dist/core/index.d.ts +0 -28
- package/dist/core/index.js +0 -24
- package/dist/datepicker/index.cjs +0 -1625
- package/dist/datepicker/index.d.cts +0 -45
- package/dist/datepicker/index.d.ts +0 -45
- package/dist/datepicker/index.js +0 -1625
- package/dist/dialog/index.cjs +0 -372
- package/dist/dialog/index.d.cts +0 -151
- package/dist/dialog/index.d.ts +0 -151
- package/dist/dialog/index.js +0 -372
- package/dist/divider/index.cjs +0 -8
- package/dist/divider/index.d.cts +0 -30
- package/dist/divider/index.d.ts +0 -30
- package/dist/divider/index.js +0 -8
- package/dist/drawer/index.cjs +0 -237
- package/dist/drawer/index.d.cts +0 -58
- package/dist/drawer/index.d.ts +0 -58
- package/dist/drawer/index.js +0 -237
- package/dist/expansion-panel/index.cjs +0 -441
- package/dist/expansion-panel/index.d.cts +0 -153
- package/dist/expansion-panel/index.d.ts +0 -153
- package/dist/expansion-panel/index.js +0 -441
- package/dist/fab/index.cjs +0 -9
- package/dist/fab/index.d.cts +0 -10
- package/dist/fab/index.d.ts +0 -10
- package/dist/fab/index.js +0 -9
- package/dist/fab-menu/index.cjs +0 -330
- package/dist/fab-menu/index.d.cts +0 -125
- package/dist/fab-menu/index.d.ts +0 -125
- package/dist/fab-menu/index.js +0 -330
- package/dist/fab.type-CkUHmXU_.d.ts +0 -86
- package/dist/fab.type-DN0vtAh6.d.cts +0 -86
- package/dist/feature-discovery/index.cjs +0 -464
- package/dist/feature-discovery/index.d.cts +0 -82
- package/dist/feature-discovery/index.d.ts +0 -82
- package/dist/feature-discovery/index.js +0 -464
- package/dist/indicator/index.cjs +0 -8
- package/dist/indicator/index.d.cts +0 -47
- package/dist/indicator/index.d.ts +0 -47
- package/dist/indicator/index.js +0 -8
- package/dist/input/index.cjs +0 -1462
- package/dist/input/index.d.cts +0 -522
- package/dist/input/index.d.ts +0 -522
- package/dist/input/index.js +0 -1462
- package/dist/input-trigger/index.cjs +0 -197
- package/dist/input-trigger/index.d.cts +0 -11
- package/dist/input-trigger/index.d.ts +0 -11
- package/dist/input-trigger/index.js +0 -197
- package/dist/input-trigger.type-Ba4bM3Qp.d.cts +0 -180
- package/dist/input-trigger.type-Ba4bM3Qp.d.ts +0 -180
- package/dist/list/index.cjs +0 -395
- package/dist/list/index.d.cts +0 -188
- package/dist/list/index.d.ts +0 -188
- package/dist/list/index.js +0 -395
- package/dist/menu/index.cjs +0 -316
- package/dist/menu/index.d.cts +0 -115
- package/dist/menu/index.d.ts +0 -115
- package/dist/menu/index.js +0 -316
- package/dist/menubox/index.cjs +0 -297
- package/dist/menubox/index.d.cts +0 -98
- package/dist/menubox/index.d.ts +0 -98
- package/dist/menubox/index.js +0 -297
- package/dist/pager/index.cjs +0 -205
- package/dist/pager/index.d.cts +0 -93
- package/dist/pager/index.d.ts +0 -93
- package/dist/pager/index.js +0 -205
- package/dist/picker/index.cjs +0 -244
- package/dist/picker/index.d.cts +0 -121
- package/dist/picker/index.d.ts +0 -121
- package/dist/picker/index.js +0 -244
- package/dist/progress/index.cjs +0 -219
- package/dist/progress/index.d.cts +0 -47
- package/dist/progress/index.d.ts +0 -47
- package/dist/progress/index.js +0 -219
- package/dist/radio/index.cjs +0 -465
- package/dist/radio/index.d.cts +0 -145
- package/dist/radio/index.d.ts +0 -145
- package/dist/radio/index.js +0 -465
- package/dist/refresh-control/index.cjs +0 -45
- package/dist/refresh-control/index.d.cts +0 -55
- package/dist/refresh-control/index.d.ts +0 -55
- package/dist/refresh-control/index.js +0 -45
- package/dist/segment-button/index.cjs +0 -405
- package/dist/segment-button/index.d.cts +0 -141
- package/dist/segment-button/index.d.ts +0 -141
- package/dist/segment-button/index.js +0 -405
- package/dist/select/index.cjs +0 -878
- package/dist/select/index.d.cts +0 -192
- package/dist/select/index.d.ts +0 -192
- package/dist/select/index.js +0 -878
- package/dist/skeleton/index.cjs +0 -89
- package/dist/skeleton/index.d.cts +0 -45
- package/dist/skeleton/index.d.ts +0 -45
- package/dist/skeleton/index.js +0 -89
- package/dist/slider/index.cjs +0 -576
- package/dist/slider/index.d.cts +0 -171
- package/dist/slider/index.d.ts +0 -171
- package/dist/slider/index.js +0 -576
- package/dist/snackbar/index.cjs +0 -436
- package/dist/snackbar/index.d.cts +0 -174
- package/dist/snackbar/index.d.ts +0 -174
- package/dist/snackbar/index.js +0 -436
- package/dist/snippet/index.cjs +0 -314
- package/dist/snippet/index.d.cts +0 -95
- package/dist/snippet/index.d.ts +0 -95
- package/dist/snippet/index.js +0 -314
- package/dist/stepper/index.cjs +0 -550
- package/dist/stepper/index.d.cts +0 -137
- package/dist/stepper/index.d.ts +0 -137
- package/dist/stepper/index.js +0 -550
- package/dist/switch/index.cjs +0 -358
- package/dist/switch/index.d.cts +0 -28
- package/dist/switch/index.d.ts +0 -28
- package/dist/switch/index.js +0 -358
- package/dist/tabs/index.cjs +0 -440
- package/dist/tabs/index.d.cts +0 -180
- package/dist/tabs/index.d.ts +0 -180
- package/dist/tabs/index.js +0 -440
- package/dist/timepicker/index.cjs +0 -823
- package/dist/timepicker/index.d.cts +0 -215
- package/dist/timepicker/index.d.ts +0 -215
- package/dist/timepicker/index.js +0 -823
- package/dist/toolbar/index.cjs +0 -333
- package/dist/toolbar/index.d.cts +0 -100
- package/dist/toolbar/index.d.ts +0 -100
- package/dist/toolbar/index.js +0 -333
- package/dist/typography/index.cjs +0 -238
- package/dist/typography/index.d.cts +0 -113
- package/dist/typography/index.d.ts +0 -113
- package/dist/typography/index.js +0 -238
- package/dist/view/index.cjs +0 -1361
- package/dist/view/index.d.cts +0 -833
- package/dist/view/index.d.ts +0 -833
- package/dist/view/index.js +0 -1361
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { StyleProp, TextStyle } from 'react-native';
|
|
3
|
-
import { ThemeColor } from '@xaui/core/types';
|
|
4
|
-
|
|
5
|
-
type TypographyAlign = 'center' | 'justify' | 'left' | 'right';
|
|
6
|
-
type TypographyVariant = 'displayLarge' | 'displayMedium' | 'displaySmall' | 'caption' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'subtitleLarge' | 'subtitleMedium' | 'subtitleSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall';
|
|
7
|
-
type TypographyProps = {
|
|
8
|
-
/**
|
|
9
|
-
* The content to display inside the typography component.
|
|
10
|
-
*/
|
|
11
|
-
children: ReactNode;
|
|
12
|
-
/**
|
|
13
|
-
* The text alignment.
|
|
14
|
-
*/
|
|
15
|
-
align?: TypographyAlign;
|
|
16
|
-
/**
|
|
17
|
-
* The theme color for the text.
|
|
18
|
-
* @default 'default'
|
|
19
|
-
*/
|
|
20
|
-
themeColor?: ThemeColor;
|
|
21
|
-
/**
|
|
22
|
-
* The typography variant.
|
|
23
|
-
* @default 'bodyMedium'
|
|
24
|
-
*/
|
|
25
|
-
variant?: TypographyVariant;
|
|
26
|
-
/**
|
|
27
|
-
* Maximum number of lines to display.
|
|
28
|
-
*/
|
|
29
|
-
maxLines?: number;
|
|
30
|
-
/**
|
|
31
|
-
* How to handle text overflow when maxLines is set.
|
|
32
|
-
* @default 'clip'
|
|
33
|
-
*/
|
|
34
|
-
overflow?: 'clip' | 'ellipsis';
|
|
35
|
-
/**
|
|
36
|
-
* Custom styles for the text.
|
|
37
|
-
*/
|
|
38
|
-
style?: StyleProp<TextStyle>;
|
|
39
|
-
/**
|
|
40
|
-
* Custom text color override.
|
|
41
|
-
*/
|
|
42
|
-
color?: TextStyle['color'];
|
|
43
|
-
/**
|
|
44
|
-
* The spacing between characters.
|
|
45
|
-
*/
|
|
46
|
-
letterSpacing?: number;
|
|
47
|
-
/**
|
|
48
|
-
* Line height for the text.
|
|
49
|
-
*/
|
|
50
|
-
lineHeight?: TextStyle['lineHeight'];
|
|
51
|
-
/**
|
|
52
|
-
* The text weight.
|
|
53
|
-
*/
|
|
54
|
-
fontWeight?: TextStyle['fontWeight'];
|
|
55
|
-
/**
|
|
56
|
-
* The text style.
|
|
57
|
-
*/
|
|
58
|
-
fontStyle?: TextStyle['fontStyle'];
|
|
59
|
-
/**
|
|
60
|
-
* Text decoration line.
|
|
61
|
-
*/
|
|
62
|
-
textDecorationLine?: TextStyle['textDecorationLine'];
|
|
63
|
-
/**
|
|
64
|
-
* Text transform mode.
|
|
65
|
-
*/
|
|
66
|
-
textTransform?: TextStyle['textTransform'];
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
declare const Typography: React.FC<TypographyProps>;
|
|
70
|
-
|
|
71
|
-
type TextSpanAlign = TypographyAlign;
|
|
72
|
-
type TextSpanProps = {
|
|
73
|
-
/**
|
|
74
|
-
* The content to display inside the text span.
|
|
75
|
-
*/
|
|
76
|
-
children: ReactNode;
|
|
77
|
-
/**
|
|
78
|
-
* Inherited text color for nested Typography.
|
|
79
|
-
*/
|
|
80
|
-
color?: TextStyle['color'];
|
|
81
|
-
/**
|
|
82
|
-
* Inherited text weight for nested Typography.
|
|
83
|
-
*/
|
|
84
|
-
fontWeight?: TextStyle['fontWeight'];
|
|
85
|
-
/**
|
|
86
|
-
* Inherited text style for nested Typography.
|
|
87
|
-
*/
|
|
88
|
-
fontStyle?: TextStyle['fontStyle'];
|
|
89
|
-
/**
|
|
90
|
-
* Inherited text transform for nested Typography.
|
|
91
|
-
*/
|
|
92
|
-
textTransform?: TextStyle['textTransform'];
|
|
93
|
-
/**
|
|
94
|
-
* Spacing between children.
|
|
95
|
-
*/
|
|
96
|
-
spacing?: number;
|
|
97
|
-
/**
|
|
98
|
-
* Text alignment for all nested typography unless overridden.
|
|
99
|
-
*/
|
|
100
|
-
align?: TextSpanAlign;
|
|
101
|
-
/**
|
|
102
|
-
* Background color for the text span container.
|
|
103
|
-
*/
|
|
104
|
-
backgroundColor?: TextStyle['backgroundColor'];
|
|
105
|
-
/**
|
|
106
|
-
* Custom styles for the text span container.
|
|
107
|
-
*/
|
|
108
|
-
style?: StyleProp<TextStyle>;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
declare const TextSpan: React.FC<TextSpanProps>;
|
|
112
|
-
|
|
113
|
-
export { TextSpan, type TextSpanAlign, type TextSpanProps, Typography, type TypographyAlign, type TypographyProps, type TypographyVariant };
|
package/dist/typography/index.js
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import "../chunk-SHBDANQN.js";
|
|
2
|
-
import {
|
|
3
|
-
useXUITheme
|
|
4
|
-
} from "../chunk-RBSA4NH4.js";
|
|
5
|
-
|
|
6
|
-
// src/components/typography/typography.tsx
|
|
7
|
-
import React, { useMemo as useMemo2 } from "react";
|
|
8
|
-
import { Text } from "react-native";
|
|
9
|
-
|
|
10
|
-
// src/components/typography/typography.style.ts
|
|
11
|
-
import { StyleSheet } from "react-native";
|
|
12
|
-
var styles = StyleSheet.create({
|
|
13
|
-
text: {
|
|
14
|
-
includeFontPadding: false
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
// src/components/typography/text-span.context.ts
|
|
19
|
-
import { createContext, useContext } from "react";
|
|
20
|
-
var TextSpanContext = createContext({});
|
|
21
|
-
var useTextSpanInheritedStyle = () => {
|
|
22
|
-
return useContext(TextSpanContext);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// src/components/typography/typography.hook.ts
|
|
26
|
-
import { useMemo } from "react";
|
|
27
|
-
import { getSafeThemeColor } from "@xaui/core";
|
|
28
|
-
var knownVariants = {
|
|
29
|
-
displayLarge: true,
|
|
30
|
-
displayMedium: true,
|
|
31
|
-
displaySmall: true,
|
|
32
|
-
caption: true,
|
|
33
|
-
headlineLarge: true,
|
|
34
|
-
headlineMedium: true,
|
|
35
|
-
headlineSmall: true,
|
|
36
|
-
subtitleLarge: true,
|
|
37
|
-
subtitleMedium: true,
|
|
38
|
-
subtitleSmall: true,
|
|
39
|
-
bodyLarge: true,
|
|
40
|
-
bodyMedium: true,
|
|
41
|
-
bodySmall: true
|
|
42
|
-
};
|
|
43
|
-
var isKnownVariant = (variant) => {
|
|
44
|
-
return Boolean(knownVariants[variant]);
|
|
45
|
-
};
|
|
46
|
-
var useTypographyColor = (themeColor) => {
|
|
47
|
-
const theme = useXUITheme();
|
|
48
|
-
const color = useMemo(() => {
|
|
49
|
-
if (themeColor === "default") {
|
|
50
|
-
return theme.colors.foreground;
|
|
51
|
-
}
|
|
52
|
-
const safeThemeColor = getSafeThemeColor(themeColor);
|
|
53
|
-
return theme.colors[safeThemeColor].main;
|
|
54
|
-
}, [theme, themeColor]);
|
|
55
|
-
return color;
|
|
56
|
-
};
|
|
57
|
-
var useTypographyVariantStyles = (variant) => {
|
|
58
|
-
const theme = useXUITheme();
|
|
59
|
-
const variantStyles = useMemo(() => {
|
|
60
|
-
if (!isKnownVariant(variant)) {
|
|
61
|
-
return {
|
|
62
|
-
fontFamily: theme.fontFamilies.body,
|
|
63
|
-
fontSize: theme.fontSizes.md,
|
|
64
|
-
fontWeight: theme.fontWeights.normal
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
const styles2 = {
|
|
68
|
-
displayLarge: {
|
|
69
|
-
fontFamily: theme.fontFamilies.heading,
|
|
70
|
-
fontSize: 72,
|
|
71
|
-
fontWeight: theme.fontWeights.semibold
|
|
72
|
-
},
|
|
73
|
-
displayMedium: {
|
|
74
|
-
fontFamily: theme.fontFamilies.heading,
|
|
75
|
-
fontSize: 57,
|
|
76
|
-
fontWeight: theme.fontWeights.semibold
|
|
77
|
-
},
|
|
78
|
-
displaySmall: {
|
|
79
|
-
fontFamily: theme.fontFamilies.heading,
|
|
80
|
-
fontSize: 45,
|
|
81
|
-
fontWeight: theme.fontWeights.semibold
|
|
82
|
-
},
|
|
83
|
-
caption: {
|
|
84
|
-
fontFamily: theme.fontFamilies.body,
|
|
85
|
-
fontSize: theme.fontSizes.xs,
|
|
86
|
-
fontWeight: theme.fontWeights.normal
|
|
87
|
-
},
|
|
88
|
-
headlineLarge: {
|
|
89
|
-
fontFamily: theme.fontFamilies.heading,
|
|
90
|
-
fontSize: theme.fontSizes["4xl"] + 3,
|
|
91
|
-
fontWeight: theme.fontWeights.bold
|
|
92
|
-
},
|
|
93
|
-
headlineMedium: {
|
|
94
|
-
fontFamily: theme.fontFamilies.heading,
|
|
95
|
-
fontSize: theme.fontSizes["3xl"] + 3,
|
|
96
|
-
fontWeight: theme.fontWeights.bold
|
|
97
|
-
},
|
|
98
|
-
headlineSmall: {
|
|
99
|
-
fontFamily: theme.fontFamilies.heading,
|
|
100
|
-
fontSize: theme.fontSizes["2xl"] + 3,
|
|
101
|
-
fontWeight: theme.fontWeights.semibold
|
|
102
|
-
},
|
|
103
|
-
subtitleLarge: {
|
|
104
|
-
fontFamily: theme.fontFamilies.body,
|
|
105
|
-
fontSize: theme.fontSizes.md + 5,
|
|
106
|
-
fontWeight: theme.fontWeights.medium
|
|
107
|
-
},
|
|
108
|
-
subtitleMedium: {
|
|
109
|
-
fontFamily: theme.fontFamilies.body,
|
|
110
|
-
fontSize: theme.fontSizes.sm + 5,
|
|
111
|
-
fontWeight: theme.fontWeights.medium
|
|
112
|
-
},
|
|
113
|
-
subtitleSmall: {
|
|
114
|
-
fontFamily: theme.fontFamilies.body,
|
|
115
|
-
fontSize: theme.fontSizes.xs + 5,
|
|
116
|
-
fontWeight: theme.fontWeights.medium
|
|
117
|
-
},
|
|
118
|
-
bodyLarge: {
|
|
119
|
-
fontFamily: theme.fontFamilies.body,
|
|
120
|
-
fontSize: theme.fontSizes.md,
|
|
121
|
-
fontWeight: theme.fontWeights.normal
|
|
122
|
-
},
|
|
123
|
-
bodyMedium: {
|
|
124
|
-
fontFamily: theme.fontFamilies.body,
|
|
125
|
-
fontSize: theme.fontSizes.sm,
|
|
126
|
-
fontWeight: theme.fontWeights.normal
|
|
127
|
-
},
|
|
128
|
-
bodySmall: {
|
|
129
|
-
fontFamily: theme.fontFamilies.body,
|
|
130
|
-
fontSize: theme.fontSizes.xs,
|
|
131
|
-
fontWeight: theme.fontWeights.normal
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
return styles2[variant];
|
|
135
|
-
}, [theme, variant]);
|
|
136
|
-
return variantStyles;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
// src/components/typography/typography.tsx
|
|
140
|
-
var Typography = ({
|
|
141
|
-
children,
|
|
142
|
-
align,
|
|
143
|
-
themeColor = "default",
|
|
144
|
-
variant = "bodyMedium",
|
|
145
|
-
maxLines,
|
|
146
|
-
overflow = "clip",
|
|
147
|
-
color,
|
|
148
|
-
letterSpacing,
|
|
149
|
-
lineHeight,
|
|
150
|
-
fontWeight,
|
|
151
|
-
fontStyle,
|
|
152
|
-
textDecorationLine,
|
|
153
|
-
textTransform,
|
|
154
|
-
style
|
|
155
|
-
}) => {
|
|
156
|
-
const inheritedStyle = useTextSpanInheritedStyle();
|
|
157
|
-
const themeColorValue = useTypographyColor(themeColor);
|
|
158
|
-
const variantStyles = useTypographyVariantStyles(variant);
|
|
159
|
-
const resolvedAlign = align ?? inheritedStyle.align;
|
|
160
|
-
const textStyleOverrides = {
|
|
161
|
-
color: color ?? inheritedStyle.color ?? themeColorValue,
|
|
162
|
-
letterSpacing,
|
|
163
|
-
lineHeight,
|
|
164
|
-
fontWeight: fontWeight ?? inheritedStyle.fontWeight,
|
|
165
|
-
fontStyle: fontStyle ?? inheritedStyle.fontStyle,
|
|
166
|
-
textDecorationLine,
|
|
167
|
-
textTransform: textTransform ?? inheritedStyle.textTransform
|
|
168
|
-
};
|
|
169
|
-
const ellipsizeMode = useMemo2(() => {
|
|
170
|
-
if (!maxLines) return void 0;
|
|
171
|
-
if (overflow === "clip") return "clip";
|
|
172
|
-
return "tail";
|
|
173
|
-
}, [maxLines, overflow]);
|
|
174
|
-
return /* @__PURE__ */ React.createElement(
|
|
175
|
-
Text,
|
|
176
|
-
{
|
|
177
|
-
numberOfLines: maxLines,
|
|
178
|
-
ellipsizeMode,
|
|
179
|
-
style: [
|
|
180
|
-
styles.text,
|
|
181
|
-
variantStyles,
|
|
182
|
-
resolvedAlign && { textAlign: resolvedAlign },
|
|
183
|
-
textStyleOverrides,
|
|
184
|
-
inheritedStyle.spacing != null ? { marginRight: inheritedStyle.spacing } : void 0,
|
|
185
|
-
style
|
|
186
|
-
]
|
|
187
|
-
},
|
|
188
|
-
children
|
|
189
|
-
);
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
// src/components/typography/text-span.tsx
|
|
193
|
-
import React2 from "react";
|
|
194
|
-
import { Text as Text2 } from "react-native";
|
|
195
|
-
var alignToTextAlign = {
|
|
196
|
-
left: "left",
|
|
197
|
-
center: "center",
|
|
198
|
-
right: "right",
|
|
199
|
-
justify: "justify"
|
|
200
|
-
};
|
|
201
|
-
var TextSpan = ({
|
|
202
|
-
children,
|
|
203
|
-
color,
|
|
204
|
-
fontWeight,
|
|
205
|
-
fontStyle,
|
|
206
|
-
textTransform,
|
|
207
|
-
spacing,
|
|
208
|
-
align,
|
|
209
|
-
backgroundColor,
|
|
210
|
-
style
|
|
211
|
-
}) => {
|
|
212
|
-
const inheritedTextStyle = {
|
|
213
|
-
color,
|
|
214
|
-
fontWeight,
|
|
215
|
-
fontStyle,
|
|
216
|
-
textTransform,
|
|
217
|
-
align,
|
|
218
|
-
spacing
|
|
219
|
-
};
|
|
220
|
-
return /* @__PURE__ */ React2.createElement(TextSpanContext.Provider, { value: inheritedTextStyle }, /* @__PURE__ */ React2.createElement(
|
|
221
|
-
Text2,
|
|
222
|
-
{
|
|
223
|
-
style: [
|
|
224
|
-
{
|
|
225
|
-
...align ? { textAlign: alignToTextAlign[align] } : {},
|
|
226
|
-
...backgroundColor ? { backgroundColor } : {}
|
|
227
|
-
},
|
|
228
|
-
style
|
|
229
|
-
]
|
|
230
|
-
},
|
|
231
|
-
children
|
|
232
|
-
));
|
|
233
|
-
};
|
|
234
|
-
TextSpan.displayName = "TextSpan";
|
|
235
|
-
export {
|
|
236
|
-
TextSpan,
|
|
237
|
-
Typography
|
|
238
|
-
};
|