@gympass/yoga 7.114.19 → 7.114.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.
@@ -35,7 +35,9 @@ var import_native = __toESM(require("./native"));
35
35
  var import_Details = __toESM(require("./native/Details"));
36
36
  var import_ResultButton = __toESM(require("./native/ResultButton"));
37
37
  var import_Tags = __toESM(require("./native/Tags"));
38
+ var import_Badge = __toESM(require("./native/Badge"));
38
39
  import_native.default.Details = import_Details.default;
39
40
  import_native.default.Button = import_ResultButton.default;
40
41
  import_native.default.Tags = import_Tags.default;
42
+ import_native.default.Badge = import_Badge.default;
41
43
  var index_native_default = import_native.default;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
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
+ };
37
+ var __export = (target, all) => {
38
+ for (var name in all)
39
+ __defProp(target, name, { get: all[name], enumerable: true });
40
+ };
41
+ var __copyProps = (to, from, except, desc) => {
42
+ if (from && typeof from === "object" || typeof from === "function") {
43
+ for (let key of __getOwnPropNames(from))
44
+ if (!__hasOwnProp.call(to, key) && key !== except)
45
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
+ }
47
+ return to;
48
+ };
49
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
+ // If the importer is in node compatibility mode or this is not an ESM
51
+ // file that has been converted to a CommonJS file using a Babel-
52
+ // compatible transform (i.e. "__esModule" has not been set), then set
53
+ // "default" to the CommonJS "module.exports" for node compatibility.
54
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
+ mod
56
+ ));
57
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
+ var Badge_exports = {};
59
+ __export(Badge_exports, {
60
+ default: () => Badge_default
61
+ });
62
+ module.exports = __toCommonJS(Badge_exports);
63
+ var import_jsx_runtime = require("react/jsx-runtime");
64
+ var import_react = __toESM(require("react"));
65
+ var import_prop_types = require("prop-types");
66
+ var import_Box = __toESM(require("../../Box"));
67
+ var import_Icon = __toESM(require("../../Icon"));
68
+ const BADGE_SIZE = 10.67;
69
+ const Badge = (_a) => {
70
+ var _b = _a, { icon, fill } = _b, props = __objRest(_b, ["icon", "fill"]);
71
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
72
+ import_Box.default,
73
+ __spreadProps(__spreadValues({
74
+ justifyContent: "center",
75
+ alignItems: "center",
76
+ borderRadius: "circle",
77
+ w: "small",
78
+ h: "small"
79
+ }, props), {
80
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.default, { as: icon, size: BADGE_SIZE, fill })
81
+ })
82
+ );
83
+ };
84
+ Badge.propTypes = {
85
+ icon: import_prop_types.node.isRequired,
86
+ fill: import_prop_types.string.isRequired
87
+ };
88
+ var Badge_default = Badge;
@@ -33,39 +33,11 @@ __export(Result_exports, {
33
33
  module.exports = __toCommonJS(Result_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var import_react = __toESM(require("react"));
36
- var import_styled_components = __toESM(require("styled-components"));
37
36
  var import_prop_types = require("prop-types");
38
- var import_Text = __toESM(require("../../Text"));
39
- var import_Attendances = __toESM(require("./Attendances"));
40
- var import_Box = __toESM(require("../../Box"));
41
- const StyledBox = (0, import_styled_components.default)(import_Box.default)`
42
- width: 100%;
43
- border-bottom-width: ${({ divided }) => divided ? 1 : 0}px;
44
- border-bottom-color: ${({
45
- theme: {
46
- yoga: {
47
- colors: {
48
- elements: { lineAndBorders }
49
- }
50
- }
51
- }
52
- }) => lineAndBorders};
53
- `;
54
- const Content = import_styled_components.default.View`
55
- flex: 1;
56
- ${({
57
- theme: {
58
- yoga: {
59
- spacing: { small, large }
60
- }
61
- }
62
- }) => {
63
- return `
64
- margin-left: ${small}px;
65
- margin-bottom: ${large}px;
66
- `;
67
- }}
68
- `;
37
+ var import_Text = __toESM(require("../../../Text"));
38
+ var import_Attendances = __toESM(require("../Attendances"));
39
+ var import_Badge = __toESM(require("../Badge"));
40
+ var import_styles = require("./styles");
69
41
  const Result = ({
70
42
  avatar: Avatar,
71
43
  attendances,
@@ -74,10 +46,11 @@ const Result = ({
74
46
  subTitle,
75
47
  divided,
76
48
  children,
77
- attendancesColor
78
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(StyledBox, { divided, display: "flex", flexDirection: "row", children: [
49
+ attendancesColor,
50
+ badgeIcon
51
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.StyledBox, { divided, display: "flex", flexDirection: "row", children: [
79
52
  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, {}) }),
80
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content, { children: [
53
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Content, { children: [
81
54
  !!(attendances == null ? void 0 : attendances.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
82
55
  import_Attendances.default,
83
56
  {
@@ -86,7 +59,23 @@ const Result = ({
86
59
  color: attendancesColor
87
60
  }
88
61
  ),
89
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.default.Body1, { numberOfLines: 1, bold: true, children: title }),
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.TitleAndBadgeContainer, { children: [
63
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.default.Body1, { numberOfLines: 1, bold: true, children: title }),
64
+ badgeIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
+ import_Badge.default,
66
+ {
67
+ icon: badgeIcon,
68
+ fill: "text.primary",
69
+ ml: "xxxsmall",
70
+ bg: "neon",
71
+ justifyContent: "center",
72
+ alignItems: "center",
73
+ borderRadius: "circle",
74
+ w: "small",
75
+ h: "small"
76
+ }
77
+ )
78
+ ] }),
90
79
  subTitle && subTitle !== "" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.default.Body2, { numberOfLines: 1, color: "deep", children: subTitle }),
91
80
  children
92
81
  ] })
@@ -112,7 +101,9 @@ Result.propTypes = {
112
101
  /** The chidren necessary */
113
102
  children: import_prop_types.node,
114
103
  /** The color of attendences icon and description */
115
- attendancesColor: import_prop_types.string
104
+ attendancesColor: import_prop_types.string,
105
+ /** The property that defines a whether a badge should be shown and which icon should be rendered */
106
+ badgeIcon: import_prop_types.node
116
107
  };
117
108
  Result.defaultProps = {
118
109
  rate: void 0,
@@ -120,6 +111,7 @@ Result.defaultProps = {
120
111
  subTitle: void 0,
121
112
  children: void 0,
122
113
  attendances: void 0,
123
- attendancesColor: void 0
114
+ attendancesColor: void 0,
115
+ badgeIcon: void 0
124
116
  };
125
117
  var Result_default = Result;
@@ -25,10 +25,10 @@ var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_react = __toESM(require("react"));
26
26
  var import_react_native = require("@testing-library/react-native");
27
27
  var import_yoga_icons = require("@gympass/yoga-icons");
28
- var import__ = require("../..");
29
- var import_Result = __toESM(require("./Result"));
30
- var import_Avatar = __toESM(require("../../Avatar"));
31
- var import_Text = __toESM(require("../../Text"));
28
+ var import__ = require("../../..");
29
+ var import__2 = __toESM(require("."));
30
+ var import_Avatar = __toESM(require("../../../Avatar"));
31
+ var import_Text = __toESM(require("../../../Text"));
32
32
  const attendanceList = [
33
33
  {
34
34
  description: "Attendance 01",
@@ -81,7 +81,7 @@ describe("<Result />", () => {
81
81
  it("should match snapshot", () => {
82
82
  const { toJSON } = (0, import_react_native.render)(
83
83
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
84
- import_Result.default,
84
+ import__2.default,
85
85
  {
86
86
  rate: "5.0",
87
87
  avatar: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Avatar.default.Circle, {}),
@@ -90,9 +90,9 @@ describe("<Result />", () => {
90
90
  subTitle: "Activity",
91
91
  divided: true,
92
92
  children: [
93
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Result.default.Details, { items: entranceList, dots: true, renderItem: import_Text.default.Small }),
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default.Details, { items: entranceList, dots: true, renderItem: import_Text.default.Small }),
94
94
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
- import_Result.default.Details,
95
+ import__2.default.Details,
96
96
  {
97
97
  items: activitiesList,
98
98
  dots: true,
@@ -101,8 +101,8 @@ describe("<Result />", () => {
101
101
  limitLabel: "activities"
102
102
  }
103
103
  ),
104
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Result.default.Tags, { items: tagsList }),
105
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Result.default.Button, { children: "See Details" })
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default.Tags, { items: tagsList }),
105
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default.Button, { children: "See Details" })
106
106
  ]
107
107
  }
108
108
  ) })
@@ -112,7 +112,7 @@ describe("<Result />", () => {
112
112
  it("should match snapshot without limitLabel prop", () => {
113
113
  const { toJSON } = (0, import_react_native.render)(
114
114
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
115
- import_Result.default,
115
+ import__2.default,
116
116
  {
117
117
  rate: "5.0",
118
118
  avatar: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Avatar.default.Circle, {}),
@@ -121,9 +121,9 @@ describe("<Result />", () => {
121
121
  subTitle: "Activity",
122
122
  divided: true,
123
123
  children: [
124
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Result.default.Details, { items: entranceList, dots: true, renderItem: import_Text.default.Small }),
124
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default.Details, { items: entranceList, dots: true, renderItem: import_Text.default.Small }),
125
125
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
126
- import_Result.default.Details,
126
+ import__2.default.Details,
127
127
  {
128
128
  items: activitiesList,
129
129
  dots: true,
@@ -131,8 +131,8 @@ describe("<Result />", () => {
131
131
  renderItem: import_Text.default.Small
132
132
  }
133
133
  ),
134
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Result.default.Tags, { items: tagsList }),
135
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Result.default.Button, { children: "See Details" })
134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default.Tags, { items: tagsList }),
135
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default.Button, { children: "See Details" })
136
136
  ]
137
137
  }
138
138
  ) })
@@ -141,9 +141,9 @@ describe("<Result />", () => {
141
141
  });
142
142
  it("should match snapshot without attendence", () => {
143
143
  const { toJSON } = (0, import_react_native.render)(
144
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Result.default, { avatar: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Avatar.default, {}), title: "Gym", children: [
145
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Result.default.Details, { items: entranceList, dots: true }),
146
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Result.default.Details, { items: activitiesList, dots: true })
144
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__2.default, { avatar: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Avatar.default, {}), title: "Gym", children: [
145
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default.Details, { items: entranceList, dots: true }),
146
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default.Details, { items: activitiesList, dots: true })
147
147
  ] }) })
148
148
  );
149
149
  expect(toJSON()).toMatchSnapshot();
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var styles_exports = {};
30
+ __export(styles_exports, {
31
+ Content: () => Content,
32
+ StyledBox: () => StyledBox,
33
+ TitleAndBadgeContainer: () => TitleAndBadgeContainer
34
+ });
35
+ module.exports = __toCommonJS(styles_exports);
36
+ var import_styled_components = __toESM(require("styled-components"));
37
+ var import_Box = __toESM(require("../../../Box"));
38
+ const StyledBox = (0, import_styled_components.default)(import_Box.default)`
39
+ width: 100%;
40
+ border-bottom-width: ${({ divided }) => divided ? 1 : 0}px;
41
+ border-bottom-color: ${({
42
+ theme: {
43
+ yoga: {
44
+ colors: {
45
+ elements: { lineAndBorders }
46
+ }
47
+ }
48
+ }
49
+ }) => lineAndBorders};
50
+ `;
51
+ const Content = import_styled_components.default.View`
52
+ flex: 1;
53
+ ${({
54
+ theme: {
55
+ yoga: {
56
+ spacing: { small, large }
57
+ }
58
+ }
59
+ }) => {
60
+ return `
61
+ margin-left: ${small}px;
62
+ margin-bottom: ${large}px;
63
+ `;
64
+ }}
65
+ `;
66
+ const TitleAndBadgeContainer = (0, import_styled_components.default)(import_Box.default)`
67
+ flex-direction: row;
68
+ align-items: center;
69
+ `;
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ Content,
73
+ StyledBox,
74
+ TitleAndBadgeContainer
75
+ });
@@ -2,9 +2,11 @@ import Result from "./native";
2
2
  import ResultDetails from "./native/Details";
3
3
  import ResultButton from "./native/ResultButton";
4
4
  import ResultTags from "./native/Tags";
5
+ import Badge from "./native/Badge";
5
6
  Result.Details = ResultDetails;
6
7
  Result.Button = ResultButton;
7
8
  Result.Tags = ResultTags;
9
+ Result.Badge = Badge;
8
10
  var index_native_default = Result;
9
11
  export {
10
12
  index_native_default as default
@@ -0,0 +1,60 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import { jsx } from "react/jsx-runtime";
33
+ import React from "react";
34
+ import { string, node } from "prop-types";
35
+ import Box from "../../Box";
36
+ import Icon from "../../Icon";
37
+ const BADGE_SIZE = 10.67;
38
+ const Badge = (_a) => {
39
+ var _b = _a, { icon, fill } = _b, props = __objRest(_b, ["icon", "fill"]);
40
+ return /* @__PURE__ */ jsx(
41
+ Box,
42
+ __spreadProps(__spreadValues({
43
+ justifyContent: "center",
44
+ alignItems: "center",
45
+ borderRadius: "circle",
46
+ w: "small",
47
+ h: "small"
48
+ }, props), {
49
+ children: /* @__PURE__ */ jsx(Icon, { as: icon, size: BADGE_SIZE, fill })
50
+ })
51
+ );
52
+ };
53
+ Badge.propTypes = {
54
+ icon: node.isRequired,
55
+ fill: string.isRequired
56
+ };
57
+ var Badge_default = Badge;
58
+ export {
59
+ Badge_default as default
60
+ };
@@ -1,38 +1,10 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import React, { isValidElement } from "react";
3
- import styled from "styled-components";
4
3
  import { arrayOf, string, shape, func, bool, node } from "prop-types";
5
- import Text from "../../Text";
6
- import Attendances from "./Attendances";
7
- import Box from "../../Box";
8
- const StyledBox = styled(Box)`
9
- width: 100%;
10
- border-bottom-width: ${({ divided }) => divided ? 1 : 0}px;
11
- border-bottom-color: ${({
12
- theme: {
13
- yoga: {
14
- colors: {
15
- elements: { lineAndBorders }
16
- }
17
- }
18
- }
19
- }) => lineAndBorders};
20
- `;
21
- const Content = styled.View`
22
- flex: 1;
23
- ${({
24
- theme: {
25
- yoga: {
26
- spacing: { small, large }
27
- }
28
- }
29
- }) => {
30
- return `
31
- margin-left: ${small}px;
32
- margin-bottom: ${large}px;
33
- `;
34
- }}
35
- `;
4
+ import Text from "../../../Text";
5
+ import Attendances from "../Attendances";
6
+ import Badge from "../Badge";
7
+ import { Content, StyledBox, TitleAndBadgeContainer } from "./styles";
36
8
  const Result = ({
37
9
  avatar: Avatar,
38
10
  attendances,
@@ -41,7 +13,8 @@ const Result = ({
41
13
  subTitle,
42
14
  divided,
43
15
  children,
44
- attendancesColor
16
+ attendancesColor,
17
+ badgeIcon
45
18
  }) => /* @__PURE__ */ jsxs(StyledBox, { divided, display: "flex", flexDirection: "row", children: [
46
19
  Avatar && /* @__PURE__ */ jsx(Fragment, { children: isValidElement(Avatar) ? Avatar : /* @__PURE__ */ jsx(Avatar, {}) }),
47
20
  /* @__PURE__ */ jsxs(Content, { children: [
@@ -53,7 +26,23 @@ const Result = ({
53
26
  color: attendancesColor
54
27
  }
55
28
  ),
56
- /* @__PURE__ */ jsx(Text.Body1, { numberOfLines: 1, bold: true, children: title }),
29
+ /* @__PURE__ */ jsxs(TitleAndBadgeContainer, { children: [
30
+ /* @__PURE__ */ jsx(Text.Body1, { numberOfLines: 1, bold: true, children: title }),
31
+ badgeIcon && /* @__PURE__ */ jsx(
32
+ Badge,
33
+ {
34
+ icon: badgeIcon,
35
+ fill: "text.primary",
36
+ ml: "xxxsmall",
37
+ bg: "neon",
38
+ justifyContent: "center",
39
+ alignItems: "center",
40
+ borderRadius: "circle",
41
+ w: "small",
42
+ h: "small"
43
+ }
44
+ )
45
+ ] }),
57
46
  subTitle && subTitle !== "" && /* @__PURE__ */ jsx(Text.Body2, { numberOfLines: 1, color: "deep", children: subTitle }),
58
47
  children
59
48
  ] })
@@ -79,7 +68,9 @@ Result.propTypes = {
79
68
  /** The chidren necessary */
80
69
  children: node,
81
70
  /** The color of attendences icon and description */
82
- attendancesColor: string
71
+ attendancesColor: string,
72
+ /** The property that defines a whether a badge should be shown and which icon should be rendered */
73
+ badgeIcon: node
83
74
  };
84
75
  Result.defaultProps = {
85
76
  rate: void 0,
@@ -87,7 +78,8 @@ Result.defaultProps = {
87
78
  subTitle: void 0,
88
79
  children: void 0,
89
80
  attendances: void 0,
90
- attendancesColor: void 0
81
+ attendancesColor: void 0,
82
+ badgeIcon: void 0
91
83
  };
92
84
  var Result_default = Result;
93
85
  export {
@@ -2,10 +2,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { render } from "@testing-library/react-native";
4
4
  import { BuildingFilled } from "@gympass/yoga-icons";
5
- import { ThemeProvider } from "../..";
6
- import Result from "./Result";
7
- import Avatar from "../../Avatar";
8
- import Text from "../../Text";
5
+ import { ThemeProvider } from "../../..";
6
+ import Result from ".";
7
+ import Avatar from "../../../Avatar";
8
+ import Text from "../../../Text";
9
9
  const attendanceList = [
10
10
  {
11
11
  description: "Attendance 01",
@@ -0,0 +1,39 @@
1
+ import styled from "styled-components";
2
+ import Box from "../../../Box";
3
+ const StyledBox = styled(Box)`
4
+ width: 100%;
5
+ border-bottom-width: ${({ divided }) => divided ? 1 : 0}px;
6
+ border-bottom-color: ${({
7
+ theme: {
8
+ yoga: {
9
+ colors: {
10
+ elements: { lineAndBorders }
11
+ }
12
+ }
13
+ }
14
+ }) => lineAndBorders};
15
+ `;
16
+ const Content = styled.View`
17
+ flex: 1;
18
+ ${({
19
+ theme: {
20
+ yoga: {
21
+ spacing: { small, large }
22
+ }
23
+ }
24
+ }) => {
25
+ return `
26
+ margin-left: ${small}px;
27
+ margin-bottom: ${large}px;
28
+ `;
29
+ }}
30
+ `;
31
+ const TitleAndBadgeContainer = styled(Box)`
32
+ flex-direction: row;
33
+ align-items: center;
34
+ `;
35
+ export {
36
+ Content,
37
+ StyledBox,
38
+ TitleAndBadgeContainer
39
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gympass/yoga",
3
- "version": "7.114.19",
3
+ "version": "7.114.20",
4
4
  "description": "Gympass component library",
5
5
  "main": "./cjs",
6
6
  "types": "./typings/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@gympass/yoga-common": "^1.3.1",
30
30
  "@gympass/yoga-helpers": "^1.1.0",
31
- "@gympass/yoga-icons": "^1.23.0",
31
+ "@gympass/yoga-icons": "^1.23.1",
32
32
  "@gympass/yoga-illustrations": "^0.7.1",
33
33
  "@gympass/yoga-system": "^0.13.0",
34
34
  "@gympass/yoga-tokens": "^3.6.0",
@@ -57,7 +57,7 @@
57
57
  "react-native": "0.72.3",
58
58
  "styled-components": "^4.4.0"
59
59
  },
60
- "gitHead": "0a44444eaa2e90a6e833cec6ba1d0187f613b409",
60
+ "gitHead": "1c02bec60fa8eea0f21462b68bf3b9d1f868c3ea",
61
61
  "module": "./esm",
62
62
  "private": false,
63
63
  "react-native": "./cjs/index.native.js"
@@ -9,46 +9,46 @@ declare const v3theme: {
9
9
  length: number;
10
10
  toString(): string;
11
11
  toLocaleString(): string;
12
- pop(): 0 | 2 | 1 | undefined;
13
- push(...items: (0 | 2 | 1)[]): number;
14
- concat(...items: ConcatArray<0 | 2 | 1>[]): (0 | 2 | 1)[];
15
- concat(...items: (0 | 2 | 1 | ConcatArray<0 | 2 | 1>)[]): (0 | 2 | 1)[];
12
+ pop(): 0 | 1 | 2 | undefined;
13
+ push(...items: (0 | 1 | 2)[]): number;
14
+ concat(...items: ConcatArray<0 | 1 | 2>[]): (0 | 1 | 2)[];
15
+ concat(...items: (0 | 1 | 2 | ConcatArray<0 | 1 | 2>)[]): (0 | 1 | 2)[];
16
16
  join(separator?: string | undefined): string;
17
- reverse(): (0 | 2 | 1)[];
18
- shift(): 0 | 2 | 1 | undefined;
19
- slice(start?: number | undefined, end?: number | undefined): (0 | 2 | 1)[];
20
- sort(compareFn?: ((a: 0 | 2 | 1, b: 0 | 2 | 1) => number) | undefined): (0 | 2 | 1)[];
21
- splice(start: number, deleteCount?: number | undefined): (0 | 2 | 1)[];
22
- splice(start: number, deleteCount: number, ...items: (0 | 2 | 1)[]): (0 | 2 | 1)[];
23
- unshift(...items: (0 | 2 | 1)[]): number;
24
- indexOf(searchElement: 0 | 2 | 1, fromIndex?: number | undefined): number;
25
- lastIndexOf(searchElement: 0 | 2 | 1, fromIndex?: number | undefined): number;
26
- every<S extends 0 | 2 | 1>(predicate: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => value is S, thisArg?: any): this is S[];
27
- every(predicate: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => unknown, thisArg?: any): boolean;
28
- some(predicate: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => unknown, thisArg?: any): boolean;
29
- forEach(callbackfn: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => void, thisArg?: any): void;
30
- map<U>(callbackfn: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => U, thisArg?: any): U[];
31
- filter<S_1 extends 0 | 2 | 1>(predicate: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => value is S_1, thisArg?: any): S_1[];
32
- filter(predicate: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => unknown, thisArg?: any): (0 | 2 | 1)[];
33
- reduce(callbackfn: (previousValue: 0 | 2 | 1, currentValue: 0 | 2 | 1, currentIndex: number, array: (0 | 2 | 1)[]) => 0 | 2 | 1): 0 | 2 | 1;
34
- reduce(callbackfn: (previousValue: 0 | 2 | 1, currentValue: 0 | 2 | 1, currentIndex: number, array: (0 | 2 | 1)[]) => 0 | 2 | 1, initialValue: 0 | 2 | 1): 0 | 2 | 1;
35
- reduce<U_1>(callbackfn: (previousValue: U_1, currentValue: 0 | 2 | 1, currentIndex: number, array: (0 | 2 | 1)[]) => U_1, initialValue: U_1): U_1;
36
- reduceRight(callbackfn: (previousValue: 0 | 2 | 1, currentValue: 0 | 2 | 1, currentIndex: number, array: (0 | 2 | 1)[]) => 0 | 2 | 1): 0 | 2 | 1;
37
- reduceRight(callbackfn: (previousValue: 0 | 2 | 1, currentValue: 0 | 2 | 1, currentIndex: number, array: (0 | 2 | 1)[]) => 0 | 2 | 1, initialValue: 0 | 2 | 1): 0 | 2 | 1;
38
- reduceRight<U_2>(callbackfn: (previousValue: U_2, currentValue: 0 | 2 | 1, currentIndex: number, array: (0 | 2 | 1)[]) => U_2, initialValue: U_2): U_2;
39
- find<S_2 extends 0 | 2 | 1>(predicate: (this: void, value: 0 | 2 | 1, index: number, obj: (0 | 2 | 1)[]) => value is S_2, thisArg?: any): S_2 | undefined;
40
- find(predicate: (value: 0 | 2 | 1, index: number, obj: (0 | 2 | 1)[]) => unknown, thisArg?: any): 0 | 2 | 1 | undefined;
41
- findIndex(predicate: (value: 0 | 2 | 1, index: number, obj: (0 | 2 | 1)[]) => unknown, thisArg?: any): number;
42
- fill(value: 0 | 2 | 1, start?: number | undefined, end?: number | undefined): (0 | 2 | 1)[];
43
- copyWithin(target: number, start: number, end?: number | undefined): (0 | 2 | 1)[];
44
- entries(): IterableIterator<[number, 0 | 2 | 1]>;
17
+ reverse(): (0 | 1 | 2)[];
18
+ shift(): 0 | 1 | 2 | undefined;
19
+ slice(start?: number | undefined, end?: number | undefined): (0 | 1 | 2)[];
20
+ sort(compareFn?: ((a: 0 | 1 | 2, b: 0 | 1 | 2) => number) | undefined): (0 | 1 | 2)[];
21
+ splice(start: number, deleteCount?: number | undefined): (0 | 1 | 2)[];
22
+ splice(start: number, deleteCount: number, ...items: (0 | 1 | 2)[]): (0 | 1 | 2)[];
23
+ unshift(...items: (0 | 1 | 2)[]): number;
24
+ indexOf(searchElement: 0 | 1 | 2, fromIndex?: number | undefined): number;
25
+ lastIndexOf(searchElement: 0 | 1 | 2, fromIndex?: number | undefined): number;
26
+ every<S extends 0 | 1 | 2>(predicate: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => value is S, thisArg?: any): this is S[];
27
+ every(predicate: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => unknown, thisArg?: any): boolean;
28
+ some(predicate: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => unknown, thisArg?: any): boolean;
29
+ forEach(callbackfn: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => void, thisArg?: any): void;
30
+ map<U>(callbackfn: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => U, thisArg?: any): U[];
31
+ filter<S_1 extends 0 | 1 | 2>(predicate: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => value is S_1, thisArg?: any): S_1[];
32
+ filter(predicate: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => unknown, thisArg?: any): (0 | 1 | 2)[];
33
+ reduce(callbackfn: (previousValue: 0 | 1 | 2, currentValue: 0 | 1 | 2, currentIndex: number, array: (0 | 1 | 2)[]) => 0 | 1 | 2): 0 | 1 | 2;
34
+ reduce(callbackfn: (previousValue: 0 | 1 | 2, currentValue: 0 | 1 | 2, currentIndex: number, array: (0 | 1 | 2)[]) => 0 | 1 | 2, initialValue: 0 | 1 | 2): 0 | 1 | 2;
35
+ reduce<U_1>(callbackfn: (previousValue: U_1, currentValue: 0 | 1 | 2, currentIndex: number, array: (0 | 1 | 2)[]) => U_1, initialValue: U_1): U_1;
36
+ reduceRight(callbackfn: (previousValue: 0 | 1 | 2, currentValue: 0 | 1 | 2, currentIndex: number, array: (0 | 1 | 2)[]) => 0 | 1 | 2): 0 | 1 | 2;
37
+ reduceRight(callbackfn: (previousValue: 0 | 1 | 2, currentValue: 0 | 1 | 2, currentIndex: number, array: (0 | 1 | 2)[]) => 0 | 1 | 2, initialValue: 0 | 1 | 2): 0 | 1 | 2;
38
+ reduceRight<U_2>(callbackfn: (previousValue: U_2, currentValue: 0 | 1 | 2, currentIndex: number, array: (0 | 1 | 2)[]) => U_2, initialValue: U_2): U_2;
39
+ find<S_2 extends 0 | 1 | 2>(predicate: (this: void, value: 0 | 1 | 2, index: number, obj: (0 | 1 | 2)[]) => value is S_2, thisArg?: any): S_2 | undefined;
40
+ find(predicate: (value: 0 | 1 | 2, index: number, obj: (0 | 1 | 2)[]) => unknown, thisArg?: any): 0 | 1 | 2 | undefined;
41
+ findIndex(predicate: (value: 0 | 1 | 2, index: number, obj: (0 | 1 | 2)[]) => unknown, thisArg?: any): number;
42
+ fill(value: 0 | 1 | 2, start?: number | undefined, end?: number | undefined): (0 | 1 | 2)[];
43
+ copyWithin(target: number, start: number, end?: number | undefined): (0 | 1 | 2)[];
44
+ entries(): IterableIterator<[number, 0 | 1 | 2]>;
45
45
  keys(): IterableIterator<number>;
46
- values(): IterableIterator<0 | 2 | 1>;
47
- includes(searchElement: 0 | 2 | 1, fromIndex?: number | undefined): boolean;
48
- flatMap<U_3, This = undefined>(callback: (this: This, value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[];
46
+ values(): IterableIterator<0 | 1 | 2>;
47
+ includes(searchElement: 0 | 1 | 2, fromIndex?: number | undefined): boolean;
48
+ flatMap<U_3, This = undefined>(callback: (this: This, value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[];
49
49
  flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
50
- at(index: number): 0 | 2 | 1 | undefined;
51
- [Symbol.iterator](): IterableIterator<0 | 2 | 1>;
50
+ at(index: number): 0 | 1 | 2 | undefined;
51
+ [Symbol.iterator](): IterableIterator<0 | 1 | 2>;
52
52
  [Symbol.unscopables](): {
53
53
  copyWithin: boolean;
54
54
  entries: boolean;