@jobber/components-native 0.71.0 → 0.71.2-JOB-97858-02b49de.20
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/package.json +2 -2
- package/dist/src/Glimmer/Glimmer.js +3 -3
- package/dist/src/Glimmer/Glimmer.style.js +1 -1
- package/dist/src/Text/Text.js +2 -2
- package/dist/src/Typography/Typography.js +6 -1
- package/dist/src/Typography/Typography.style.js +3 -0
- package/dist/src/utils/meta/meta.json +10 -10
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/Text/Text.d.ts +7 -1
- package/dist/types/src/Typography/Typography.d.ts +7 -1
- package/package.json +2 -2
- package/src/Glimmer/Glimmer.style.ts +1 -1
- package/src/Glimmer/Glimmer.tsx +9 -3
- package/src/Text/Text.test.tsx +6 -0
- package/src/Text/Text.tsx +9 -0
- package/src/Text/__snapshots__/Text.test.tsx.snap +41 -0
- package/src/Typography/Typography.style.ts +5 -0
- package/src/Typography/Typography.test.tsx +13 -0
- package/src/Typography/Typography.tsx +15 -0
- package/src/Typography/__snapshots__/Typography.test.tsx.snap +160 -0
- package/src/utils/meta/meta.json +10 -10
- package/src/utils/meta/meta.test.tsx +1 -0
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.2-JOB-97858-02b49de.20+02b49def",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"react-native-safe-area-context": "^4.5.2",
|
|
83
83
|
"react-native-svg": ">=12.0.0"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "02b49def1c8632c8bb70d3a03ded43f34660ddd3"
|
|
86
86
|
}
|
|
@@ -32,9 +32,9 @@ export function Glimmer({ width, shape = "rectangle", size = "base", timing = "b
|
|
|
32
32
|
React.createElement(Svg, null,
|
|
33
33
|
React.createElement(Defs, null,
|
|
34
34
|
React.createElement(LinearGradient, { id: "gradientShine", x1: 0, y1: 0.5, x2: 1, y2: 0.5 },
|
|
35
|
-
React.createElement(Stop, { offset: "0%", stopColor:
|
|
36
|
-
React.createElement(Stop, { offset: "50%", stopColor:
|
|
37
|
-
React.createElement(Stop, { offset: "100%", stopColor:
|
|
35
|
+
React.createElement(Stop, { offset: "0%", stopColor: "rgba(255,255,255,0)", stopOpacity: "0" }),
|
|
36
|
+
React.createElement(Stop, { offset: "50%", stopColor: "rgba(255,255,255,1)", stopOpacity: "1" }),
|
|
37
|
+
React.createElement(Stop, { offset: "100%", stopColor: "rgba(255,255,255,0)", stopOpacity: "0" }))),
|
|
38
38
|
React.createElement(Rect, { fill: "url(#gradientShine)", height: "100%", width: "100%" })))));
|
|
39
39
|
function getWidth(event) {
|
|
40
40
|
setParentWidth(event.nativeEvent.layout.width);
|
|
@@ -3,7 +3,7 @@ import { tokens } from "../utils/design";
|
|
|
3
3
|
export const shineWidth = tokens["space-largest"];
|
|
4
4
|
export const styles = StyleSheet.create({
|
|
5
5
|
container: {
|
|
6
|
-
backgroundColor:
|
|
6
|
+
backgroundColor: "rgba(0, 0, 0, 0.05)",
|
|
7
7
|
overflow: "hidden",
|
|
8
8
|
position: "relative",
|
|
9
9
|
width: "100%",
|
package/dist/src/Text/Text.js
CHANGED
|
@@ -16,9 +16,9 @@ export const TEXT_MAX_SCALED_FONT_SIZES = {
|
|
|
16
16
|
text: MAX_TEXT_FONT_SIZE_SCALE,
|
|
17
17
|
textSupporting: tokens["typography--fontSize-base"],
|
|
18
18
|
};
|
|
19
|
-
export function Text({ level = "text", variation = "base", emphasis, allowFontScaling = true, adjustsFontSizeToFit = false, maxLines = "unlimited", align, children, reverseTheme = false, strikeThrough = false, italic = false, hideFromScreenReader = false, maxFontScaleSize, selectable, }) {
|
|
19
|
+
export function Text({ level = "text", variation = "base", emphasis, allowFontScaling = true, adjustsFontSizeToFit = false, maxLines = "unlimited", align, children, reverseTheme = false, strikeThrough = false, italic = false, hideFromScreenReader = false, maxFontScaleSize, underline, selectable, }) {
|
|
20
20
|
const accessibilityRole = "text";
|
|
21
|
-
return (React.createElement(Typography, Object.assign({ color: variation, fontFamily: "base", fontStyle: italic ? "italic" : "regular", fontWeight: getFontWeight({ level, emphasis }), maxFontScaleSize: maxFontScaleSize || TEXT_MAX_SCALED_FONT_SIZES[level], selectable: selectable }, Object.assign(Object.assign({}, levelStyles[level]), { allowFontScaling,
|
|
21
|
+
return (React.createElement(Typography, Object.assign({ color: variation, fontFamily: "base", fontStyle: italic ? "italic" : "regular", fontWeight: getFontWeight({ level, emphasis }), maxFontScaleSize: maxFontScaleSize || TEXT_MAX_SCALED_FONT_SIZES[level], selectable: selectable, underline: underline }, Object.assign(Object.assign({}, levelStyles[level]), { allowFontScaling,
|
|
22
22
|
align,
|
|
23
23
|
adjustsFontSizeToFit,
|
|
24
24
|
accessibilityRole,
|
|
@@ -15,7 +15,8 @@ const maxNumberOfLines = {
|
|
|
15
15
|
unlimited: undefined,
|
|
16
16
|
};
|
|
17
17
|
export const Typography = React.memo(InternalTypography);
|
|
18
|
-
|
|
18
|
+
// eslint-disable-next-line max-statements
|
|
19
|
+
function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, color, align, size = "default", children, maxLines = "unlimited", allowFontScaling = true, maxFontScaleSize, adjustsFontSizeToFit = false, lineHeight, letterSpacing, reverseTheme = false, hideFromScreenReader = false, accessibilityRole = "text", strikeThrough = false, underline, selectable = true, }) {
|
|
19
20
|
const sizeAndHeight = getSizeAndHeightStyle(size, lineHeight);
|
|
20
21
|
const style = [
|
|
21
22
|
getFontStyle(fontFamily, fontStyle, fontWeight),
|
|
@@ -30,6 +31,10 @@ function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, colo
|
|
|
30
31
|
if (fontStyle === "italic") {
|
|
31
32
|
style.push(styles.italic);
|
|
32
33
|
}
|
|
34
|
+
if (underline) {
|
|
35
|
+
const underlineTextStyle = { textDecorationStyle: underline };
|
|
36
|
+
style.push(underlineTextStyle, styles.underline);
|
|
37
|
+
}
|
|
33
38
|
const numberOfLinesForNativeText = maxNumberOfLines[maxLines];
|
|
34
39
|
const text = getTransformedText(children, transform);
|
|
35
40
|
const accessibilityProps = hideFromScreenReader
|
|
@@ -65,6 +65,9 @@ const fonts = Platform.select({
|
|
|
65
65
|
*/
|
|
66
66
|
export const typographyTokens = Object.assign(Object.assign({}, fonts), { italic: {
|
|
67
67
|
fontStyle: "italic",
|
|
68
|
+
}, underline: {
|
|
69
|
+
textDecorationColor: tokens["color-text--secondary"],
|
|
70
|
+
textDecorationLine: "underline",
|
|
68
71
|
}, startAlign: {
|
|
69
72
|
textAlign: "left",
|
|
70
73
|
}, endAlign: {
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
"ActionItemGroup",
|
|
5
5
|
"ActionLabel",
|
|
6
6
|
"ActivityIndicator",
|
|
7
|
-
"AtlantisContext.Provider",
|
|
8
7
|
"AtlantisContext.Consumer",
|
|
8
|
+
"AtlantisContext.Provider",
|
|
9
|
+
"AtlantisFormContext.Consumer",
|
|
10
|
+
"AtlantisFormContext.Provider",
|
|
9
11
|
"AutoLink",
|
|
10
12
|
"Banner",
|
|
11
13
|
"BottomSheet",
|
|
@@ -23,21 +25,23 @@
|
|
|
23
25
|
"Disclosure",
|
|
24
26
|
"Divider",
|
|
25
27
|
"EmptyState",
|
|
26
|
-
"ErrorMessageContext.Provider",
|
|
27
28
|
"ErrorMessageContext.Consumer",
|
|
29
|
+
"ErrorMessageContext.Provider",
|
|
28
30
|
"ErrorMessageProvider",
|
|
29
31
|
"ErrorMessageWrapper",
|
|
32
|
+
"FilterButton",
|
|
30
33
|
"Flex",
|
|
31
34
|
"Form",
|
|
35
|
+
"FormField",
|
|
32
36
|
"FormMessage",
|
|
33
|
-
"AtlantisFormContext.Provider",
|
|
34
|
-
"AtlantisFormContext.Consumer",
|
|
35
37
|
"FormatFile",
|
|
36
|
-
"FormField",
|
|
37
38
|
"Glimmer",
|
|
38
39
|
"Heading",
|
|
39
40
|
"Icon",
|
|
40
41
|
"IconButton",
|
|
42
|
+
"InputAccessoriesContext.Consumer",
|
|
43
|
+
"InputAccessoriesContext.Provider",
|
|
44
|
+
"InputAccessoriesProvider",
|
|
41
45
|
"InputCurrency",
|
|
42
46
|
"InputDate",
|
|
43
47
|
"InputEmail",
|
|
@@ -45,16 +49,12 @@
|
|
|
45
49
|
"InputNumber",
|
|
46
50
|
"InputPassword",
|
|
47
51
|
"InputPressable",
|
|
48
|
-
"FilterButton",
|
|
49
52
|
"InputSearch",
|
|
50
53
|
"InputText",
|
|
51
|
-
"InputAccessoriesContext.Provider",
|
|
52
|
-
"InputAccessoriesContext.Consumer",
|
|
53
|
-
"InputAccessoriesProvider",
|
|
54
54
|
"InputTime",
|
|
55
55
|
"Menu",
|
|
56
|
-
"ProgressBar",
|
|
57
56
|
"Option",
|
|
57
|
+
"ProgressBar",
|
|
58
58
|
"Select",
|
|
59
59
|
"StatusLabel",
|
|
60
60
|
"Switch",
|