@gympass/yoga 7.107.1 → 7.108.1
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/cjs/Button/Button.theme.js +7 -2
- package/cjs/Button/native/Button.js +15 -3
- package/cjs/Button/native/Button.test.js +8 -0
- package/cjs/Button/web/Button.test.js +8 -0
- package/cjs/Button/web/StyledButton.js +3 -3
- package/cjs/Result/native/Attendances.js +11 -10
- package/cjs/Result/native/Details.js +3 -4
- package/cjs/Result/native/Rate.js +3 -5
- package/cjs/Result/native/Result.js +17 -19
- package/cjs/Result/native/Tags.js +17 -5
- package/cjs/Result/native/TinyTextIcon.js +16 -1
- package/cjs/Tag/Tag.theme.js +1 -6
- package/cjs/Tag/native/Informative.js +14 -13
- package/cjs/Tag/native/Tag.js +8 -10
- package/cjs/Tag/native/Tag.test.js +6 -0
- package/cjs/Tag/web/Informative.js +7 -14
- package/cjs/Tag/web/Tag.js +38 -13
- package/cjs/Tag/web/Tag.test.js +6 -0
- package/cjs/Theme/Provider/web/FontLoader.test.js +1 -1
- package/cjs/Theme/theme/v3theme.js +13 -0
- package/esm/Button/Button.theme.js +7 -2
- package/esm/Button/native/Button.js +15 -3
- package/esm/Button/native/Button.test.js +9 -1
- package/esm/Button/web/Button.test.js +9 -1
- package/esm/Button/web/StyledButton.js +3 -3
- package/esm/Result/native/Attendances.js +11 -10
- package/esm/Result/native/Details.js +3 -4
- package/esm/Result/native/Rate.js +3 -5
- package/esm/Result/native/Result.js +17 -19
- package/esm/Result/native/Tags.js +21 -9
- package/esm/Result/native/TinyTextIcon.js +16 -1
- package/esm/Tag/Tag.theme.js +1 -6
- package/esm/Tag/native/Informative.js +14 -13
- package/esm/Tag/native/Tag.js +8 -10
- package/esm/Tag/native/Tag.test.js +7 -1
- package/esm/Tag/web/Informative.js +7 -14
- package/esm/Tag/web/Tag.js +33 -13
- package/esm/Tag/web/Tag.test.js +7 -1
- package/esm/Theme/Provider/web/FontLoader.test.js +1 -1
- package/esm/Theme/theme/v3theme.js +13 -0
- package/fonts/Inter-600.ttf +0 -0
- package/package.json +3 -3
- package/typings/NavigationMenu/web/Item/styles.d.ts +7 -1
- package/typings/Theme/theme/v3theme.d.ts +39 -38
- package/typings/index.d.ts +7 -1
|
@@ -28,7 +28,8 @@ const Button = ({
|
|
|
28
28
|
borders,
|
|
29
29
|
radii,
|
|
30
30
|
colors,
|
|
31
|
-
fontWeights
|
|
31
|
+
fontWeights,
|
|
32
|
+
lineHeights
|
|
32
33
|
}) => ({
|
|
33
34
|
padding: {
|
|
34
35
|
default: {
|
|
@@ -49,7 +50,11 @@ const Button = ({
|
|
|
49
50
|
default: fontSizes.medium,
|
|
50
51
|
small: fontSizes.small
|
|
51
52
|
},
|
|
52
|
-
weight: fontWeights.medium
|
|
53
|
+
weight: fontWeights.medium,
|
|
54
|
+
lineHeight: {
|
|
55
|
+
default: lineHeights.medium,
|
|
56
|
+
small: lineHeights.xsmall
|
|
57
|
+
}
|
|
53
58
|
},
|
|
54
59
|
border: {
|
|
55
60
|
radius: radii.circle
|
|
@@ -59,16 +59,26 @@ var Button_exports = {};
|
|
|
59
59
|
__export(Button_exports, {
|
|
60
60
|
ButtonContainer: () => ButtonContainer,
|
|
61
61
|
Label: () => Label,
|
|
62
|
-
default: () =>
|
|
62
|
+
default: () => Button_default
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(Button_exports);
|
|
65
65
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
66
66
|
var import_react = __toESM(require("react"));
|
|
67
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
68
67
|
var import_prop_types = require("prop-types");
|
|
68
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
69
69
|
var import_withTouchable = __toESM(require("./withTouchable"));
|
|
70
70
|
var import_Text = __toESM(require("../../Text"));
|
|
71
|
-
const Label = (0, import_styled_components.default)(import_Text.default.
|
|
71
|
+
const Label = (0, import_styled_components.default)(import_Text.default).attrs(
|
|
72
|
+
({
|
|
73
|
+
theme: {
|
|
74
|
+
yoga: {
|
|
75
|
+
components: { button }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}) => ({
|
|
79
|
+
fontWeight: button.font.weight
|
|
80
|
+
})
|
|
81
|
+
)`
|
|
72
82
|
text-align: center;
|
|
73
83
|
${({
|
|
74
84
|
small,
|
|
@@ -80,6 +90,7 @@ const Label = (0, import_styled_components.default)(import_Text.default.Medium)`
|
|
|
80
90
|
}
|
|
81
91
|
}) => `
|
|
82
92
|
font-size: ${small ? button.font.size.small : button.font.size.default}px;
|
|
93
|
+
line-height: ${small ? button.font.lineHeight.small : button.font.lineHeight.default}px;
|
|
83
94
|
color: ${color};
|
|
84
95
|
`}
|
|
85
96
|
`;
|
|
@@ -224,6 +235,7 @@ Button.defaultProps = {
|
|
|
224
235
|
icon: void 0
|
|
225
236
|
};
|
|
226
237
|
const ButtonWithTouchable = (0, import_withTouchable.default)((0, import_styled_components.withTheme)(Button));
|
|
238
|
+
var Button_default = ButtonWithTouchable;
|
|
227
239
|
// Annotate the CommonJS export names for ESM import in node:
|
|
228
240
|
0 && (module.exports = {
|
|
229
241
|
ButtonContainer,
|
|
@@ -30,6 +30,14 @@ var import__ = __toESM(require(".."));
|
|
|
30
30
|
describe("<Button />", () => {
|
|
31
31
|
describe("Snapshots", () => {
|
|
32
32
|
describe("primary buttons", () => {
|
|
33
|
+
describe("with v3theme", () => {
|
|
34
|
+
it("should match snapshot with v3theme Button", () => {
|
|
35
|
+
const { toJSON } = (0, import_react_native.render)(
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { theme: import_Theme.v3theme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default, {}) })
|
|
37
|
+
);
|
|
38
|
+
expect(toJSON()).toMatchSnapshot();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
33
41
|
describe("Without props", () => {
|
|
34
42
|
it("should match snapshot with default Button", () => {
|
|
35
43
|
const { toJSON } = (0, import_react_native.render)(
|
|
@@ -30,6 +30,14 @@ var import__ = __toESM(require(".."));
|
|
|
30
30
|
describe("<Button />", () => {
|
|
31
31
|
describe("Snapshots", () => {
|
|
32
32
|
describe("primary buttons", () => {
|
|
33
|
+
describe("with v3theme", () => {
|
|
34
|
+
it("should match snapshot with v3theme Button", () => {
|
|
35
|
+
const { container } = (0, import_react2.render)(
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { theme: import_Theme.v3theme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default, {}) })
|
|
37
|
+
);
|
|
38
|
+
expect(container).toMatchSnapshot();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
33
41
|
describe("Without props", () => {
|
|
34
42
|
it("should match snapshot with default Button", () => {
|
|
35
43
|
const { container } = (0, import_react2.render)(
|
|
@@ -74,7 +74,7 @@ const StyledButton = import_styled_components.default.button`
|
|
|
74
74
|
font-weight: ${button.font.weight};
|
|
75
75
|
font-family: ${baseFont.family};
|
|
76
76
|
letter-spacing: normal;
|
|
77
|
-
line-height:
|
|
77
|
+
line-height: ${small ? button.font.lineHeight.small : button.font.lineHeight.default}px;
|
|
78
78
|
text-decoration: none;
|
|
79
79
|
|
|
80
80
|
svg {
|
|
@@ -103,7 +103,7 @@ const StyledButton = import_styled_components.default.button`
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
${disabled ? `
|
|
106
|
-
|
|
106
|
+
|
|
107
107
|
background-color ${button.types.contained.backgroundColor.disabled};
|
|
108
108
|
color: ${button.types.contained.font.disabled.color};
|
|
109
109
|
pointer-events: none;
|
|
@@ -113,7 +113,7 @@ const StyledButton = import_styled_components.default.button`
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
cursor: not-allowed;
|
|
116
|
-
|
|
116
|
+
|
|
117
117
|
` : ""}
|
|
118
118
|
|
|
119
119
|
${inverted ? `
|
|
@@ -39,17 +39,16 @@ var import_Box = __toESM(require("../../Box"));
|
|
|
39
39
|
var import_Text = __toESM(require("../../Text"));
|
|
40
40
|
var import_Rate = __toESM(require("./Rate"));
|
|
41
41
|
var import_TinyTextIcon = __toESM(require("./TinyTextIcon"));
|
|
42
|
-
const List = (0, import_styled_components.default)(import_Text.default.
|
|
42
|
+
const List = (0, import_styled_components.default)(import_Text.default.Caption).attrs({
|
|
43
43
|
numberOfLines: 1,
|
|
44
|
-
|
|
44
|
+
color: ({ color }) => color || "deep"
|
|
45
45
|
})`
|
|
46
46
|
flex: 1;
|
|
47
47
|
`;
|
|
48
48
|
const ItemSeparator = (0, import_styled_components.default)(import_Box.default).attrs({
|
|
49
|
-
width: "xxxsmall",
|
|
50
49
|
height: "zero"
|
|
51
50
|
})``;
|
|
52
|
-
const Attendances = ({ attendances, rate }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
51
|
+
const Attendances = ({ attendances, rate, color }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
53
52
|
import_Box.default,
|
|
54
53
|
{
|
|
55
54
|
display: "flex",
|
|
@@ -59,11 +58,11 @@ const Attendances = ({ attendances, rate }) => /* @__PURE__ */ (0, import_jsx_ru
|
|
|
59
58
|
flexDirection: "row",
|
|
60
59
|
mb: "xxxsmall",
|
|
61
60
|
children: [
|
|
62
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(List, { children: attendances.map(({ description, icon }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, { children: [
|
|
63
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TinyTextIcon.default, { as: icon, fill: "deep" }),
|
|
64
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemSeparator, {}),
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(List, { color, children: attendances.map(({ description, icon }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, { children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TinyTextIcon.default, { as: icon, marginTop: "2px", fill: color || "deep" }),
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemSeparator, { w: "xxxsmall" }),
|
|
65
64
|
description,
|
|
66
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemSeparator, {})
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemSeparator, { w: "xxsmall" })
|
|
67
66
|
] }, description)) }),
|
|
68
67
|
rate && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Rate.default, { rate })
|
|
69
68
|
]
|
|
@@ -76,9 +75,11 @@ Attendances.propTypes = {
|
|
|
76
75
|
icon: import_prop_types.func
|
|
77
76
|
})
|
|
78
77
|
).isRequired,
|
|
79
|
-
rate: import_prop_types.string
|
|
78
|
+
rate: import_prop_types.string,
|
|
79
|
+
color: import_prop_types.string
|
|
80
80
|
};
|
|
81
81
|
Attendances.defaultProps = {
|
|
82
|
-
rate: void 0
|
|
82
|
+
rate: void 0,
|
|
83
|
+
color: "deep"
|
|
83
84
|
};
|
|
84
85
|
var Attendances_default = Attendances;
|
|
@@ -64,15 +64,14 @@ var import_styled_components = __toESM(require("styled-components"));
|
|
|
64
64
|
var import_Text = __toESM(require("../../Text"));
|
|
65
65
|
var import_Box = __toESM(require("../../Box"));
|
|
66
66
|
var import_TinyTextIcon = __toESM(require("./TinyTextIcon"));
|
|
67
|
-
const Container = (0, import_styled_components.default)(import_Text.default.
|
|
67
|
+
const Container = (0, import_styled_components.default)(import_Text.default.Body2)`
|
|
68
68
|
flex: 1;
|
|
69
|
-
height: ${({ theme }) => theme.yoga.spacing.small}px;
|
|
70
69
|
`;
|
|
71
70
|
const Separator = (0, import_styled_components.default)(import_Box.default).attrs({
|
|
72
71
|
width: "xxxsmall",
|
|
73
72
|
height: "xxxsmall"
|
|
74
73
|
})``;
|
|
75
|
-
const StyledText = (0, import_styled_components.default)(import_Text.default.
|
|
74
|
+
const StyledText = (0, import_styled_components.default)(import_Text.default.Body2)`
|
|
76
75
|
${({
|
|
77
76
|
theme: {
|
|
78
77
|
yoga: {
|
|
@@ -144,6 +143,6 @@ ResultDetails.defaultProps = {
|
|
|
144
143
|
limit: void 0,
|
|
145
144
|
limitLabel: "",
|
|
146
145
|
dots: false,
|
|
147
|
-
renderItem: import_Text.default.
|
|
146
|
+
renderItem: import_Text.default.Body2
|
|
148
147
|
};
|
|
149
148
|
var Details_default = ResultDetails;
|
|
@@ -44,24 +44,22 @@ const Content = import_styled_components.default.View`
|
|
|
44
44
|
margin-left: 10px;
|
|
45
45
|
align-items: center;
|
|
46
46
|
`;
|
|
47
|
-
const RateValue = (0, import_styled_components.default)(import_Text.default.
|
|
47
|
+
const RateValue = (0, import_styled_components.default)(import_Text.default.Overline)`
|
|
48
48
|
${({
|
|
49
49
|
theme: {
|
|
50
50
|
yoga: {
|
|
51
|
-
spacing: { xxxsmall }
|
|
52
|
-
lineHeights: { xsmall }
|
|
51
|
+
spacing: { xxxsmall }
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
}) => {
|
|
56
55
|
return `
|
|
57
56
|
margin-left: ${xxxsmall}px;
|
|
58
|
-
line-height: ${xsmall}px;
|
|
59
57
|
`;
|
|
60
58
|
}}
|
|
61
59
|
`;
|
|
62
60
|
const Rate = ({ rate }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content, { children: [
|
|
63
61
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.default, { as: import_yoga_icons.StarFilled, fill: "deep", width: "xsmall", height: "xsmall" }),
|
|
64
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RateValue, { variant: "deep",
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RateValue, { variant: "deep", children: rate })
|
|
65
63
|
] });
|
|
66
64
|
Rate.propTypes = {
|
|
67
65
|
rate: import_prop_types.string.isRequired
|
|
@@ -66,19 +66,6 @@ const Content = import_styled_components.default.View`
|
|
|
66
66
|
`;
|
|
67
67
|
}}
|
|
68
68
|
`;
|
|
69
|
-
const Title = (0, import_styled_components.default)(import_Text.default.Medium)`
|
|
70
|
-
${({
|
|
71
|
-
theme: {
|
|
72
|
-
yoga: {
|
|
73
|
-
lineHeights: { medium }
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}) => {
|
|
77
|
-
return `
|
|
78
|
-
line-height: ${medium}px;
|
|
79
|
-
`;
|
|
80
|
-
}}
|
|
81
|
-
`;
|
|
82
69
|
const Result = ({
|
|
83
70
|
avatar: Avatar,
|
|
84
71
|
attendances,
|
|
@@ -86,13 +73,21 @@ const Result = ({
|
|
|
86
73
|
title,
|
|
87
74
|
subTitle,
|
|
88
75
|
divided,
|
|
89
|
-
children
|
|
76
|
+
children,
|
|
77
|
+
attendancesColor
|
|
90
78
|
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(StyledBox, { divided, display: "flex", flexDirection: "row", children: [
|
|
91
79
|
Avatar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: (0, import_react.isValidElement)(Avatar) ? Avatar : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Avatar, {}) }),
|
|
92
80
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content, { children: [
|
|
93
|
-
!!(attendances == null ? void 0 : attendances.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
-
|
|
95
|
-
|
|
81
|
+
!!(attendances == null ? void 0 : attendances.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
82
|
+
import_Attendances.default,
|
|
83
|
+
{
|
|
84
|
+
attendances,
|
|
85
|
+
rate,
|
|
86
|
+
color: attendancesColor
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.default.Body1, { numberOfLines: 1, bold: true, children: title }),
|
|
90
|
+
subTitle && subTitle !== "" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.default.Body2, { numberOfLines: 1, color: "deep", children: subTitle }),
|
|
96
91
|
children
|
|
97
92
|
] })
|
|
98
93
|
] });
|
|
@@ -115,13 +110,16 @@ Result.propTypes = {
|
|
|
115
110
|
/** If it is to show the divide in the bottom */
|
|
116
111
|
divided: import_prop_types.bool,
|
|
117
112
|
/** The chidren necessary */
|
|
118
|
-
children: import_prop_types.node
|
|
113
|
+
children: import_prop_types.node,
|
|
114
|
+
/** The color of attendences icon and description */
|
|
115
|
+
attendancesColor: import_prop_types.string
|
|
119
116
|
};
|
|
120
117
|
Result.defaultProps = {
|
|
121
118
|
rate: void 0,
|
|
122
119
|
divided: false,
|
|
123
120
|
subTitle: void 0,
|
|
124
121
|
children: void 0,
|
|
125
|
-
attendances: void 0
|
|
122
|
+
attendances: void 0,
|
|
123
|
+
attendancesColor: void 0
|
|
126
124
|
};
|
|
127
125
|
var Result_default = Result;
|
|
@@ -81,13 +81,25 @@ const Wrapper = import_styled_components.default.ScrollView`
|
|
|
81
81
|
margin-top: ${xxsmall}px;
|
|
82
82
|
`}
|
|
83
83
|
`;
|
|
84
|
-
const ResultTags = ({ items }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
const ResultTags = ({ items, disableScroll }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
|
+
Wrapper,
|
|
86
|
+
{
|
|
87
|
+
horizontal: true,
|
|
88
|
+
scrollEnabled: !disableScroll,
|
|
89
|
+
showsHorizontalScrollIndicator: false,
|
|
90
|
+
children: items.map((_a, index) => {
|
|
91
|
+
var props = __objRest(_a, []);
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TagStyled, __spreadValues({ small: true }, props), index);
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
);
|
|
88
96
|
ResultTags.displayName = "Result.Tags";
|
|
89
97
|
ResultTags.propTypes = {
|
|
90
98
|
/** Props to generate each Tag. See Tag for details */
|
|
91
|
-
items: (0, import_prop_types.arrayOf)((0, import_prop_types.shape)({})).isRequired
|
|
99
|
+
items: (0, import_prop_types.arrayOf)((0, import_prop_types.shape)({})).isRequired,
|
|
100
|
+
disableScroll: import_prop_types.bool
|
|
101
|
+
};
|
|
102
|
+
ResultTags.defaultProps = {
|
|
103
|
+
disableScroll: false
|
|
92
104
|
};
|
|
93
105
|
var Tags_default = ResultTags;
|
|
@@ -22,6 +22,18 @@ var __spreadValues = (a, b) => {
|
|
|
22
22
|
return a;
|
|
23
23
|
};
|
|
24
24
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
25
37
|
var __export = (target, all) => {
|
|
26
38
|
for (var name in all)
|
|
27
39
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -52,6 +64,9 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
52
64
|
var import_react = __toESM(require("react"));
|
|
53
65
|
var import_Box = __toESM(require("../../Box"));
|
|
54
66
|
var import_Icon = __toESM(require("../../Icon"));
|
|
55
|
-
const TinyTextIcon = (
|
|
67
|
+
const TinyTextIcon = (_a) => {
|
|
68
|
+
var _b = _a, { marginTop } = _b, props = __objRest(_b, ["marginTop"]);
|
|
69
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Box.default, { height: "xsmall", width: "xsmall", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.default, __spreadProps(__spreadValues({}, props), { size: "xsmall", mt: marginTop })) });
|
|
70
|
+
};
|
|
56
71
|
TinyTextIcon.propTypes = import_Icon.default.propTypes;
|
|
57
72
|
var TinyTextIcon_default = TinyTextIcon;
|
package/cjs/Tag/Tag.theme.js
CHANGED
|
@@ -21,7 +21,7 @@ __export(Tag_theme_exports, {
|
|
|
21
21
|
default: () => Tag_theme_default
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Tag_theme_exports);
|
|
24
|
-
const Tag = ({ spacing,
|
|
24
|
+
const Tag = ({ spacing, radii, borders }) => ({
|
|
25
25
|
icon: {
|
|
26
26
|
size: {
|
|
27
27
|
default: spacing.small,
|
|
@@ -31,11 +31,6 @@ const Tag = ({ spacing, fontSizes, fontWeights, radii, borders }) => ({
|
|
|
31
31
|
right: "xxxsmall"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
-
font: {
|
|
35
|
-
size: fontSizes.xsmall,
|
|
36
|
-
lineHeight: fontSizes.medium,
|
|
37
|
-
weight: fontWeights.medium
|
|
38
|
-
},
|
|
39
34
|
padding: {
|
|
40
35
|
default: {
|
|
41
36
|
top: spacing.xxxsmall,
|
|
@@ -96,36 +96,35 @@ const StyledTextInformative = (0, import_styled_components.default)(import_Tag.S
|
|
|
96
96
|
${({
|
|
97
97
|
theme: {
|
|
98
98
|
yoga: {
|
|
99
|
-
colors: { text }
|
|
100
|
-
components: { tag }
|
|
99
|
+
colors: { text }
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
}) => `
|
|
104
103
|
color: ${text.primary};
|
|
105
|
-
|
|
106
|
-
font-size: ${tag.font.size}px;
|
|
107
|
-
line-height: ${tag.font.lineHeight}px;
|
|
108
|
-
font-weight: ${tag.font.weight};
|
|
109
104
|
`}
|
|
110
105
|
`;
|
|
111
106
|
const TagInformative = (_a) => {
|
|
112
107
|
var _b = _a, {
|
|
113
108
|
children,
|
|
114
109
|
icon,
|
|
110
|
+
ellipsis,
|
|
115
111
|
theme: {
|
|
116
112
|
yoga: {
|
|
117
113
|
colors: { text },
|
|
118
114
|
components: { tag }
|
|
119
115
|
}
|
|
120
116
|
},
|
|
121
|
-
small
|
|
122
|
-
|
|
117
|
+
small,
|
|
118
|
+
variant
|
|
119
|
+
} = _b, rest = __objRest(_b, [
|
|
123
120
|
"children",
|
|
124
121
|
"icon",
|
|
122
|
+
"ellipsis",
|
|
125
123
|
"theme",
|
|
126
|
-
"small"
|
|
124
|
+
"small",
|
|
125
|
+
"variant"
|
|
127
126
|
]);
|
|
128
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Informative, __spreadProps(__spreadValues({ small },
|
|
127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Informative, __spreadProps(__spreadValues({ variant, small }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Wrapper, { children: [
|
|
129
128
|
icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
129
|
import_Icon.default,
|
|
131
130
|
{
|
|
@@ -135,7 +134,7 @@ const TagInformative = (_a) => {
|
|
|
135
134
|
marginRight: tag.icon.margin.right
|
|
136
135
|
}
|
|
137
136
|
),
|
|
138
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledTextInformative, { children })
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledTextInformative, { numberOfLines: ellipsis ? 1 : void 0, children })
|
|
139
138
|
] }) }));
|
|
140
139
|
};
|
|
141
140
|
TagInformative.propTypes = {
|
|
@@ -144,12 +143,14 @@ TagInformative.propTypes = {
|
|
|
144
143
|
icon: import_prop_types.func,
|
|
145
144
|
children: import_prop_types.node.isRequired,
|
|
146
145
|
/** Can send small to use this variant */
|
|
147
|
-
small: import_prop_types.bool
|
|
146
|
+
small: import_prop_types.bool,
|
|
147
|
+
ellipsis: import_prop_types.bool
|
|
148
148
|
};
|
|
149
149
|
TagInformative.defaultProps = {
|
|
150
150
|
variant: "neutral",
|
|
151
151
|
icon: void 0,
|
|
152
|
-
small: false
|
|
152
|
+
small: false,
|
|
153
|
+
ellipsis: false
|
|
153
154
|
};
|
|
154
155
|
TagInformative.displayName = "Tag.Informative";
|
|
155
156
|
var Informative_default = (0, import_styled_components.withTheme)(TagInformative);
|
package/cjs/Tag/native/Tag.js
CHANGED
|
@@ -111,7 +111,7 @@ const StyledTag = import_styled_components.default.View`
|
|
|
111
111
|
`;
|
|
112
112
|
const StyledText = (0, import_styled_components.default)((_a) => {
|
|
113
113
|
var _b = _a, { variant } = _b, rest = __objRest(_b, ["variant"]);
|
|
114
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.default.
|
|
114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.default.Overline, __spreadValues({}, rest));
|
|
115
115
|
})`
|
|
116
116
|
${({
|
|
117
117
|
variant,
|
|
@@ -120,31 +120,29 @@ const StyledText = (0, import_styled_components.default)((_a) => {
|
|
|
120
120
|
colors: {
|
|
121
121
|
text,
|
|
122
122
|
feedback: { [variant]: color = { dark: text.secondary } }
|
|
123
|
-
}
|
|
124
|
-
components: { tag }
|
|
123
|
+
}
|
|
125
124
|
}
|
|
126
125
|
}
|
|
127
126
|
}) => `
|
|
128
127
|
color: ${color.dark};
|
|
129
|
-
|
|
130
|
-
font-size: ${tag.font.size}px;
|
|
131
|
-
line-height: ${tag.font.lineHeight}px;
|
|
132
128
|
`}
|
|
133
129
|
`;
|
|
134
130
|
const Tag = (_c) => {
|
|
135
|
-
var _d = _c, { children, variant, small } = _d,
|
|
136
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledTag, __spreadProps(__spreadValues({ variant, small },
|
|
131
|
+
var _d = _c, { children, variant, small, ellipsis } = _d, rest = __objRest(_d, ["children", "variant", "small", "ellipsis"]);
|
|
132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledTag, __spreadProps(__spreadValues({ variant, small }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledText, { numberOfLines: ellipsis ? 1 : void 0, children }) }));
|
|
137
133
|
};
|
|
138
134
|
Tag.propTypes = {
|
|
139
135
|
/** style the tag following the theme (success, informative, attention) */
|
|
140
136
|
variant: (0, import_prop_types.oneOf)(["", "success", "informative", "attention"]),
|
|
141
137
|
/** Can send small to use this variant */
|
|
142
138
|
small: import_prop_types.bool,
|
|
143
|
-
children: import_prop_types.node.isRequired
|
|
139
|
+
children: import_prop_types.node.isRequired,
|
|
140
|
+
ellipsis: import_prop_types.bool
|
|
144
141
|
};
|
|
145
142
|
Tag.defaultProps = {
|
|
146
143
|
variant: "",
|
|
147
|
-
small: false
|
|
144
|
+
small: false,
|
|
145
|
+
ellipsis: false
|
|
148
146
|
};
|
|
149
147
|
var Tag_default = Tag;
|
|
150
148
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -27,6 +27,12 @@ var import_react_native = require("@testing-library/react-native");
|
|
|
27
27
|
var import_yoga_icons = require("@gympass/yoga-icons");
|
|
28
28
|
var import__ = require("../..");
|
|
29
29
|
describe("<Tag />", () => {
|
|
30
|
+
it("should match snapshot when v3Theme is settled", () => {
|
|
31
|
+
const { toJSON } = (0, import_react_native.render)(
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { theme: import__.v3theme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Tag, { children: "v3Theme" }) })
|
|
33
|
+
);
|
|
34
|
+
expect(toJSON()).toMatchSnapshot();
|
|
35
|
+
});
|
|
30
36
|
it("should match snapshot", () => {
|
|
31
37
|
const { toJSON } = (0, import_react_native.render)(
|
|
32
38
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Tag, { children: "default" }) })
|
|
@@ -64,13 +64,9 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
64
64
|
var import_react = __toESM(require("react"));
|
|
65
65
|
var import_styled_components = __toESM(require("styled-components"));
|
|
66
66
|
var import_prop_types = require("prop-types");
|
|
67
|
-
var
|
|
68
|
-
var import_Tag = __toESM(require("./Tag"));
|
|
67
|
+
var import_Tag = require("./Tag");
|
|
69
68
|
var import_Icon = __toESM(require("../../Icon"));
|
|
70
|
-
const Informative = (0, import_styled_components.default)(import_Tag.
|
|
71
|
-
justify-content: center;
|
|
72
|
-
align-items: center;
|
|
73
|
-
|
|
69
|
+
const Informative = (0, import_styled_components.default)(import_Tag.StyledTag)`
|
|
74
70
|
${({
|
|
75
71
|
variant,
|
|
76
72
|
theme: {
|
|
@@ -87,17 +83,13 @@ const Informative = (0, import_styled_components.default)(import_Tag.default)`
|
|
|
87
83
|
color: ${text.primary};
|
|
88
84
|
border-radius: ${tag.border.radius}px;
|
|
89
85
|
border-color: ${color.light};
|
|
90
|
-
|
|
91
|
-
font-size: ${tag.font.size}px;
|
|
92
|
-
font-weight: ${tag.font.weight};
|
|
93
86
|
`}
|
|
94
|
-
|
|
95
|
-
${import_yoga_system.margins}
|
|
96
87
|
`;
|
|
97
88
|
const TagInformative = (_a) => {
|
|
98
89
|
var _b = _a, {
|
|
99
90
|
children,
|
|
100
91
|
icon,
|
|
92
|
+
variant,
|
|
101
93
|
theme: {
|
|
102
94
|
yoga: {
|
|
103
95
|
colors: { text },
|
|
@@ -106,14 +98,15 @@ const TagInformative = (_a) => {
|
|
|
106
98
|
},
|
|
107
99
|
small,
|
|
108
100
|
ellipsis
|
|
109
|
-
} = _b,
|
|
101
|
+
} = _b, rest = __objRest(_b, [
|
|
110
102
|
"children",
|
|
111
103
|
"icon",
|
|
104
|
+
"variant",
|
|
112
105
|
"theme",
|
|
113
106
|
"small",
|
|
114
107
|
"ellipsis"
|
|
115
108
|
]);
|
|
116
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Informative, __spreadProps(__spreadValues({
|
|
109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Informative, __spreadProps(__spreadValues({ variant, small }, rest), { children: [
|
|
117
110
|
icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
118
111
|
import_Icon.default,
|
|
119
112
|
{
|
|
@@ -123,7 +116,7 @@ const TagInformative = (_a) => {
|
|
|
123
116
|
marginRight: tag.icon.margin.right
|
|
124
117
|
}
|
|
125
118
|
),
|
|
126
|
-
children
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Tag.StyledText, { numberOfLines: ellipsis ? 1 : void 0, children })
|
|
127
120
|
] }));
|
|
128
121
|
};
|
|
129
122
|
TagInformative.propTypes = {
|