@gympass/yoga 7.106.1 → 7.107.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.
@@ -21,7 +21,7 @@ __export(Skeleton_theme_exports, {
21
21
  default: () => Skeleton_theme_default
22
22
  });
23
23
  module.exports = __toCommonJS(Skeleton_theme_exports);
24
- const Skeleton = ({ lineHeights, radii }) => ({
24
+ const Skeleton = ({ colors, lineHeights, radii }) => ({
25
25
  border: {
26
26
  circular: radii.circle
27
27
  },
@@ -37,6 +37,10 @@ const Skeleton = ({ lineHeights, radii }) => ({
37
37
  overline: lineHeights.xsmall,
38
38
  exception: lineHeights.xxsmall
39
39
  }
40
+ },
41
+ background: {
42
+ primary: colors.elements.backgroundAndDisabled,
43
+ secondary: colors.elements.lineAndBorders
40
44
  }
41
45
  });
42
46
  var Skeleton_theme_default = Skeleton;
@@ -74,21 +74,22 @@ const StyledSkeleton = import_styled_components.default.View`
74
74
  ${import_yoga_system.heights}
75
75
 
76
76
  ${({
77
+ color,
77
78
  type,
78
79
  variant,
79
80
  theme: {
80
81
  yoga: {
81
- colors,
82
82
  components: {
83
83
  skeleton: {
84
84
  border: { [type]: borderRadius },
85
- height: { [type]: { [variant]: height } = {} }
85
+ height: { [type]: { [variant]: height } = {} },
86
+ background: { [color]: backgroundColor }
86
87
  }
87
88
  }
88
89
  }
89
90
  }
90
91
  }) => `
91
- background-color: ${colors.elements.backgroundAndDisabled};
92
+ background-color: ${backgroundColor};
92
93
  ${borderRadius ? `border-radius: ${borderRadius}px;` : ""}
93
94
  ${height ? `height: ${height}px;` : ""}
94
95
  `}
@@ -120,6 +121,11 @@ function Skeleton(_a) {
120
121
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Animated.View, { style: { opacity }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledSkeleton, __spreadValues({}, props)) });
121
122
  }
122
123
  Skeleton.propTypes = {
124
+ /**
125
+ * Determines which color will be rendered. It can be
126
+ * 'primary' or 'secondary'.
127
+ */
128
+ color: (0, import_prop_types.oneOf)(["primary", "secondary"]),
123
129
  /**
124
130
  * Determines which type will be rendered. It can be
125
131
  * 'circular', 'rectangular' or 'text'.
@@ -165,6 +171,7 @@ Skeleton.propTypes = {
165
171
  };
166
172
  Skeleton.defaultProps = {
167
173
  variant: void 0,
168
- animation: "pulse"
174
+ animation: "pulse",
175
+ color: "primary"
169
176
  };
170
177
  var Skeleton_default = Skeleton;
@@ -60,4 +60,13 @@ describe("<Skeleton />", () => {
60
60
  );
61
61
  expect(toJSON()).toMatchSnapshot();
62
62
  });
63
+ it("should render all background color variants correctly", () => {
64
+ const { toJSON } = (0, import_react_native.render)(
65
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.ThemeProvider, { children: [
66
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Skeleton, { type: "text", variant: "body1", width: "100" }),
67
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Skeleton, { type: "text", variant: "body1", width: "100", color: "secondary" })
68
+ ] })
69
+ );
70
+ expect(toJSON()).toMatchSnapshot();
71
+ });
63
72
  });
@@ -61,22 +61,23 @@ const StyledSkeleton = import_styled_components.default.div`
61
61
  ${import_yoga_system.heights}
62
62
 
63
63
  ${({
64
+ color,
64
65
  type,
65
66
  variant,
66
67
  animation = "pulse",
67
68
  theme: {
68
69
  yoga: {
69
- colors,
70
70
  components: {
71
71
  skeleton: {
72
72
  border: { [type]: borderRadius },
73
- height: { [type]: { [variant]: height } = {} }
73
+ height: { [type]: { [variant]: height } = {} },
74
+ background: { [color]: backgroundColor }
74
75
  }
75
76
  }
76
77
  }
77
78
  }
78
79
  }) => import_styled_components.css`
79
- background-color: ${colors.elements.backgroundAndDisabled};
80
+ background-color: ${backgroundColor};
80
81
  ${borderRadius ? `border-radius: ${borderRadius}px;` : ""}
81
82
  ${height ? `height: ${height}px;` : ""}
82
83
 
@@ -99,6 +100,11 @@ function Skeleton(props) {
99
100
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledSkeleton, __spreadValues({}, props));
100
101
  }
101
102
  Skeleton.propTypes = {
103
+ /**
104
+ * Determines which color will be rendered. It can be
105
+ * 'primary' or 'secondary'.
106
+ */
107
+ color: (0, import_prop_types.oneOf)(["primary", "secondary"]),
102
108
  /**
103
109
  * Determines which type will be rendered. It can be
104
110
  * 'circular', 'rectangular' or 'text'.
@@ -144,6 +150,7 @@ Skeleton.propTypes = {
144
150
  };
145
151
  Skeleton.defaultProps = {
146
152
  variant: void 0,
147
- animation: "pulse"
153
+ animation: "pulse",
154
+ color: "primary"
148
155
  };
149
156
  var Skeleton_default = Skeleton;
@@ -60,4 +60,13 @@ describe("<Skeleton />", () => {
60
60
  );
61
61
  expect(container).toMatchSnapshot();
62
62
  });
63
+ it("should render all background color variants correctly", () => {
64
+ const { container } = (0, import_react2.render)(
65
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.ThemeProvider, { children: [
66
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Skeleton, { type: "text", variant: "body1", width: "100" }),
67
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Skeleton, { type: "text", variant: "body1", width: "100", color: "secondary" })
68
+ ] })
69
+ );
70
+ expect(container).toMatchSnapshot();
71
+ });
63
72
  });
@@ -1,4 +1,4 @@
1
- const Skeleton = ({ lineHeights, radii }) => ({
1
+ const Skeleton = ({ colors, lineHeights, radii }) => ({
2
2
  border: {
3
3
  circular: radii.circle
4
4
  },
@@ -14,6 +14,10 @@ const Skeleton = ({ lineHeights, radii }) => ({
14
14
  overline: lineHeights.xsmall,
15
15
  exception: lineHeights.xxsmall
16
16
  }
17
+ },
18
+ background: {
19
+ primary: colors.elements.backgroundAndDisabled,
20
+ secondary: colors.elements.lineAndBorders
17
21
  }
18
22
  });
19
23
  var Skeleton_theme_default = Skeleton;
@@ -43,21 +43,22 @@ const StyledSkeleton = styled.View`
43
43
  ${heights}
44
44
 
45
45
  ${({
46
+ color,
46
47
  type,
47
48
  variant,
48
49
  theme: {
49
50
  yoga: {
50
- colors,
51
51
  components: {
52
52
  skeleton: {
53
53
  border: { [type]: borderRadius },
54
- height: { [type]: { [variant]: height } = {} }
54
+ height: { [type]: { [variant]: height } = {} },
55
+ background: { [color]: backgroundColor }
55
56
  }
56
57
  }
57
58
  }
58
59
  }
59
60
  }) => `
60
- background-color: ${colors.elements.backgroundAndDisabled};
61
+ background-color: ${backgroundColor};
61
62
  ${borderRadius ? `border-radius: ${borderRadius}px;` : ""}
62
63
  ${height ? `height: ${height}px;` : ""}
63
64
  `}
@@ -89,6 +90,11 @@ function Skeleton(_a) {
89
90
  return /* @__PURE__ */ jsx(Animated.View, { style: { opacity }, children: /* @__PURE__ */ jsx(StyledSkeleton, __spreadValues({}, props)) });
90
91
  }
91
92
  Skeleton.propTypes = {
93
+ /**
94
+ * Determines which color will be rendered. It can be
95
+ * 'primary' or 'secondary'.
96
+ */
97
+ color: oneOf(["primary", "secondary"]),
92
98
  /**
93
99
  * Determines which type will be rendered. It can be
94
100
  * 'circular', 'rectangular' or 'text'.
@@ -134,7 +140,8 @@ Skeleton.propTypes = {
134
140
  };
135
141
  Skeleton.defaultProps = {
136
142
  variant: void 0,
137
- animation: "pulse"
143
+ animation: "pulse",
144
+ color: "primary"
138
145
  };
139
146
  var Skeleton_default = Skeleton;
140
147
  export {
@@ -37,4 +37,13 @@ describe("<Skeleton />", () => {
37
37
  );
38
38
  expect(toJSON()).toMatchSnapshot();
39
39
  });
40
+ it("should render all background color variants correctly", () => {
41
+ const { toJSON } = render(
42
+ /* @__PURE__ */ jsxs(ThemeProvider, { children: [
43
+ /* @__PURE__ */ jsx(Skeleton, { type: "text", variant: "body1", width: "100" }),
44
+ /* @__PURE__ */ jsx(Skeleton, { type: "text", variant: "body1", width: "100", color: "secondary" })
45
+ ] })
46
+ );
47
+ expect(toJSON()).toMatchSnapshot();
48
+ });
40
49
  });
@@ -30,22 +30,23 @@ const StyledSkeleton = styled.div`
30
30
  ${heights}
31
31
 
32
32
  ${({
33
+ color,
33
34
  type,
34
35
  variant,
35
36
  animation = "pulse",
36
37
  theme: {
37
38
  yoga: {
38
- colors,
39
39
  components: {
40
40
  skeleton: {
41
41
  border: { [type]: borderRadius },
42
- height: { [type]: { [variant]: height } = {} }
42
+ height: { [type]: { [variant]: height } = {} },
43
+ background: { [color]: backgroundColor }
43
44
  }
44
45
  }
45
46
  }
46
47
  }
47
48
  }) => css`
48
- background-color: ${colors.elements.backgroundAndDisabled};
49
+ background-color: ${backgroundColor};
49
50
  ${borderRadius ? `border-radius: ${borderRadius}px;` : ""}
50
51
  ${height ? `height: ${height}px;` : ""}
51
52
 
@@ -68,6 +69,11 @@ function Skeleton(props) {
68
69
  return /* @__PURE__ */ jsx(StyledSkeleton, __spreadValues({}, props));
69
70
  }
70
71
  Skeleton.propTypes = {
72
+ /**
73
+ * Determines which color will be rendered. It can be
74
+ * 'primary' or 'secondary'.
75
+ */
76
+ color: oneOf(["primary", "secondary"]),
71
77
  /**
72
78
  * Determines which type will be rendered. It can be
73
79
  * 'circular', 'rectangular' or 'text'.
@@ -113,7 +119,8 @@ Skeleton.propTypes = {
113
119
  };
114
120
  Skeleton.defaultProps = {
115
121
  variant: void 0,
116
- animation: "pulse"
122
+ animation: "pulse",
123
+ color: "primary"
117
124
  };
118
125
  var Skeleton_default = Skeleton;
119
126
  export {
@@ -37,4 +37,13 @@ describe("<Skeleton />", () => {
37
37
  );
38
38
  expect(container).toMatchSnapshot();
39
39
  });
40
+ it("should render all background color variants correctly", () => {
41
+ const { container } = render(
42
+ /* @__PURE__ */ jsxs(ThemeProvider, { children: [
43
+ /* @__PURE__ */ jsx(Skeleton, { type: "text", variant: "body1", width: "100" }),
44
+ /* @__PURE__ */ jsx(Skeleton, { type: "text", variant: "body1", width: "100", color: "secondary" })
45
+ ] })
46
+ );
47
+ expect(container).toMatchSnapshot();
48
+ });
40
49
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gympass/yoga",
3
- "version": "7.106.1",
3
+ "version": "7.107.0",
4
4
  "description": "Gympass component library",
5
5
  "main": "./cjs",
6
6
  "types": "./typings/index.d.ts",
@@ -57,7 +57,7 @@
57
57
  "react-native": "0.72.3",
58
58
  "styled-components": "^4.4.0"
59
59
  },
60
- "gitHead": "a4f1326b3f40785426df1532d0f098832dedc594",
60
+ "gitHead": "34c447405c217d56ee520b64a1c60150c60aa43d",
61
61
  "module": "./esm",
62
62
  "private": false,
63
63
  "react-native": "./cjs/index.native.js"
@@ -486,6 +486,7 @@ declare const Drawer: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
486
486
  declare function Skeleton(props: any): JSX.Element;
487
487
  declare namespace Skeleton {
488
488
  namespace propTypes {
489
+ const color: prop_types.Requireable<string>;
489
490
  const type: prop_types.Validator<string>;
490
491
  function variant(props: any, propName: any, componentName: any): void | Error | null;
491
492
  const animation: prop_types.Requireable<string | boolean>;
@@ -495,6 +496,8 @@ declare namespace Skeleton {
495
496
  export { variant_1 as variant };
496
497
  const animation_1: string;
497
498
  export { animation_1 as animation };
499
+ const color_1: string;
500
+ export { color_1 as color };
498
501
  }
499
502
  }
500
503