@gympass/yoga 7.117.3 → 7.118.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.
@@ -91,6 +91,7 @@ function Feedback(_a) {
91
91
  const iconProps = VARIANT_ICONS[variant];
92
92
  let primaryButton;
93
93
  let secondaryButton;
94
+ let captionElement;
94
95
  let titleElement = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_StyledFeedback.Title, { children: title });
95
96
  function defineCompoundComponents() {
96
97
  import_react.default.Children.forEach(children, (child) => {
@@ -100,6 +101,8 @@ function Feedback(_a) {
100
101
  secondaryButton = child;
101
102
  if (isChildFromComponent(child, import_StyledFeedback.Title))
102
103
  titleElement = child;
104
+ if (isChildFromComponent(child, import_StyledFeedback.Caption))
105
+ captionElement = child;
103
106
  });
104
107
  }
105
108
  defineCompoundComponents();
@@ -128,6 +131,7 @@ function Feedback(_a) {
128
131
  titleElement,
129
132
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.default.Body1, { mt: "small", color: "deep", children: description })
130
133
  ] }),
134
+ captionElement ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Box.default, { mt: "medium", children: captionElement }) : null,
131
135
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_StyledFeedback.Actions, { mt: "xxxlarge", children: [
132
136
  primaryButton,
133
137
  secondaryButton
@@ -30,6 +30,7 @@ function renderWithTheme(ui) {
30
30
  }
31
31
  const title = "Welcome to Yoga";
32
32
  const description = "Enjoy your membership!";
33
+ const caption = "Caption Description here.";
33
34
  describe("<Feedback />", () => {
34
35
  it("should render the title and description", () => {
35
36
  const { getByText } = renderWithTheme(
@@ -44,6 +45,12 @@ describe("<Feedback />", () => {
44
45
  );
45
46
  expect(getByRole("heading", { name: title })).toBeTruthy();
46
47
  });
48
+ it("should render caption children", () => {
49
+ const { getByText } = renderWithTheme(
50
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Feedback, { variant: "success", title, description, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Feedback.Caption, { children: caption }) })
51
+ );
52
+ expect(getByText(caption)).toBeTruthy();
53
+ });
47
54
  it("should render the buttons", () => {
48
55
  const { getByRole } = renderWithTheme(
49
56
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.Feedback, { variant: "success", title, description, children: [
@@ -54,6 +61,18 @@ describe("<Feedback />", () => {
54
61
  expect(getByRole("button", { name: "Ok" })).toBeTruthy();
55
62
  expect(getByRole("button", { name: "Cancel" })).toBeTruthy();
56
63
  });
64
+ it("should render title, description, buttons and caption", () => {
65
+ const { getByText, getByRole } = renderWithTheme(
66
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.Feedback, { variant: "success", description: "Enjoy your membership!", children: [
67
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Feedback.Caption, { children: caption }),
68
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Feedback.PrimaryButton, { children: "Ok" }),
69
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Feedback.SecondaryButton, { children: "Cancel" })
70
+ ] })
71
+ );
72
+ expect(getByText(caption)).toBeTruthy();
73
+ expect(getByRole("button", { name: "Ok" })).toBeTruthy();
74
+ expect(getByRole("button", { name: "Cancel" })).toBeTruthy();
75
+ });
57
76
  it("should render correctly when not centered vertically", () => {
58
77
  const { baseElement } = renderWithTheme(
59
78
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var StyledFeedback_exports = {};
30
30
  __export(StyledFeedback_exports, {
31
31
  Actions: () => Actions,
32
+ Caption: () => Caption,
32
33
  Content: () => Content,
33
34
  PrimaryButton: () => PrimaryButton,
34
35
  SecondaryButton: () => SecondaryButton,
@@ -120,12 +121,26 @@ const PrimaryButton = (0, import_styled_components.default)(import_Button.defaul
120
121
  const SecondaryButton = (0, import_styled_components.default)(import_Button.default.Text)`
121
122
  ${buttonsStyles}
122
123
  `;
124
+ const Caption = (0, import_styled_components.default)(import_Text.default.Body1).attrs(() => ({
125
+ as: "p",
126
+ bold: true
127
+ }))`
128
+ ${({
129
+ theme: {
130
+ yoga: { colors }
131
+ }
132
+ }) => import_styled_components.css`
133
+ color: ${colors.text.secondary};
134
+ `}}
135
+ `;
123
136
  Title.displayName = "Feedback.Title";
124
137
  PrimaryButton.displayName = "Feedback.PrimaryButton";
125
138
  SecondaryButton.displayName = "Feedback.SecondaryButton";
139
+ Caption.displayName = "Feedback.Caption";
126
140
  // Annotate the CommonJS export names for ESM import in node:
127
141
  0 && (module.exports = {
128
142
  Actions,
143
+ Caption,
129
144
  Content,
130
145
  PrimaryButton,
131
146
  SecondaryButton,
@@ -36,4 +36,5 @@ var import_StyledFeedback = require("./StyledFeedback");
36
36
  import_Feedback.default.Title = import_StyledFeedback.Title;
37
37
  import_Feedback.default.PrimaryButton = import_StyledFeedback.PrimaryButton;
38
38
  import_Feedback.default.SecondaryButton = import_StyledFeedback.SecondaryButton;
39
+ import_Feedback.default.Caption = import_StyledFeedback.Caption;
39
40
  var web_default = import_Feedback.default;
@@ -42,7 +42,8 @@ import {
42
42
  Title,
43
43
  PrimaryButton,
44
44
  SecondaryButton,
45
- TextContainer
45
+ TextContainer,
46
+ Caption
46
47
  } from "./StyledFeedback";
47
48
  const ICON_SIZE = 64;
48
49
  const VARIANT_ICONS = {
@@ -67,6 +68,7 @@ function Feedback(_a) {
67
68
  const iconProps = VARIANT_ICONS[variant];
68
69
  let primaryButton;
69
70
  let secondaryButton;
71
+ let captionElement;
70
72
  let titleElement = /* @__PURE__ */ jsx(Title, { children: title });
71
73
  function defineCompoundComponents() {
72
74
  React.Children.forEach(children, (child) => {
@@ -76,6 +78,8 @@ function Feedback(_a) {
76
78
  secondaryButton = child;
77
79
  if (isChildFromComponent(child, Title))
78
80
  titleElement = child;
81
+ if (isChildFromComponent(child, Caption))
82
+ captionElement = child;
79
83
  });
80
84
  }
81
85
  defineCompoundComponents();
@@ -104,6 +108,7 @@ function Feedback(_a) {
104
108
  titleElement,
105
109
  /* @__PURE__ */ jsx(Text.Body1, { mt: "small", color: "deep", children: description })
106
110
  ] }),
111
+ captionElement ? /* @__PURE__ */ jsx(Box, { mt: "medium", children: captionElement }) : null,
107
112
  /* @__PURE__ */ jsxs(Actions, { mt: "xxxlarge", children: [
108
113
  primaryButton,
109
114
  secondaryButton
@@ -7,6 +7,7 @@ function renderWithTheme(ui) {
7
7
  }
8
8
  const title = "Welcome to Yoga";
9
9
  const description = "Enjoy your membership!";
10
+ const caption = "Caption Description here.";
10
11
  describe("<Feedback />", () => {
11
12
  it("should render the title and description", () => {
12
13
  const { getByText } = renderWithTheme(
@@ -21,6 +22,12 @@ describe("<Feedback />", () => {
21
22
  );
22
23
  expect(getByRole("heading", { name: title })).toBeTruthy();
23
24
  });
25
+ it("should render caption children", () => {
26
+ const { getByText } = renderWithTheme(
27
+ /* @__PURE__ */ jsx(Feedback, { variant: "success", title, description, children: /* @__PURE__ */ jsx(Feedback.Caption, { children: caption }) })
28
+ );
29
+ expect(getByText(caption)).toBeTruthy();
30
+ });
24
31
  it("should render the buttons", () => {
25
32
  const { getByRole } = renderWithTheme(
26
33
  /* @__PURE__ */ jsxs(Feedback, { variant: "success", title, description, children: [
@@ -31,6 +38,18 @@ describe("<Feedback />", () => {
31
38
  expect(getByRole("button", { name: "Ok" })).toBeTruthy();
32
39
  expect(getByRole("button", { name: "Cancel" })).toBeTruthy();
33
40
  });
41
+ it("should render title, description, buttons and caption", () => {
42
+ const { getByText, getByRole } = renderWithTheme(
43
+ /* @__PURE__ */ jsxs(Feedback, { variant: "success", description: "Enjoy your membership!", children: [
44
+ /* @__PURE__ */ jsx(Feedback.Caption, { children: caption }),
45
+ /* @__PURE__ */ jsx(Feedback.PrimaryButton, { children: "Ok" }),
46
+ /* @__PURE__ */ jsx(Feedback.SecondaryButton, { children: "Cancel" })
47
+ ] })
48
+ );
49
+ expect(getByText(caption)).toBeTruthy();
50
+ expect(getByRole("button", { name: "Ok" })).toBeTruthy();
51
+ expect(getByRole("button", { name: "Cancel" })).toBeTruthy();
52
+ });
34
53
  it("should render correctly when not centered vertically", () => {
35
54
  const { baseElement } = renderWithTheme(
36
55
  /* @__PURE__ */ jsx(
@@ -82,11 +82,25 @@ const PrimaryButton = styled(Button)`
82
82
  const SecondaryButton = styled(Button.Text)`
83
83
  ${buttonsStyles}
84
84
  `;
85
+ const Caption = styled(Text.Body1).attrs(() => ({
86
+ as: "p",
87
+ bold: true
88
+ }))`
89
+ ${({
90
+ theme: {
91
+ yoga: { colors }
92
+ }
93
+ }) => css`
94
+ color: ${colors.text.secondary};
95
+ `}}
96
+ `;
85
97
  Title.displayName = "Feedback.Title";
86
98
  PrimaryButton.displayName = "Feedback.PrimaryButton";
87
99
  SecondaryButton.displayName = "Feedback.SecondaryButton";
100
+ Caption.displayName = "Feedback.Caption";
88
101
  export {
89
102
  Actions,
103
+ Caption,
90
104
  Content,
91
105
  PrimaryButton,
92
106
  SecondaryButton,
@@ -1,8 +1,14 @@
1
1
  import Feedback from "./Feedback";
2
- import { Title, PrimaryButton, SecondaryButton } from "./StyledFeedback";
2
+ import {
3
+ Title,
4
+ PrimaryButton,
5
+ SecondaryButton,
6
+ Caption
7
+ } from "./StyledFeedback";
3
8
  Feedback.Title = Title;
4
9
  Feedback.PrimaryButton = PrimaryButton;
5
10
  Feedback.SecondaryButton = SecondaryButton;
11
+ Feedback.Caption = Caption;
6
12
  var web_default = Feedback;
7
13
  export {
8
14
  web_default as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gympass/yoga",
3
- "version": "7.117.3",
3
+ "version": "7.118.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": "61cbcba7b713f568b43052529cb76fe354a6d42f",
60
+ "gitHead": "a8f23e4f87e4e60758e10a35ca6afd27c177e60c",
61
61
  "module": "./esm",
62
62
  "private": false,
63
63
  "react-native": "./cjs/index.native.js"