@gympass/yoga 7.132.2 → 7.133.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.
|
@@ -100,6 +100,7 @@ function Feedback(_a) {
|
|
|
100
100
|
"children",
|
|
101
101
|
"center"
|
|
102
102
|
]);
|
|
103
|
+
const descriptionArray = Array.isArray(description) ? description : [description];
|
|
103
104
|
const iconProps = VARIANT_ICONS[variant];
|
|
104
105
|
let primaryButton;
|
|
105
106
|
let secondaryButton;
|
|
@@ -141,7 +142,7 @@ function Feedback(_a) {
|
|
|
141
142
|
),
|
|
142
143
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_StyledFeedback.TextContainer, { children: [
|
|
143
144
|
titleElement,
|
|
144
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
145
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Box.default, { display: "flex", flexDirection: "column", gap: "large", mt: "small", children: descriptionArray.map((paragraph) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.default.Body1, { color: "deep", children: paragraph }, paragraph == null ? void 0 : paragraph.toString().slice(0, 10))) })
|
|
145
146
|
] }),
|
|
146
147
|
captionElement ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Box.default, { mt: "medium", children: captionElement }) : null,
|
|
147
148
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_StyledFeedback.Actions, { mt: "xxxlarge", children: [
|
|
@@ -155,7 +156,7 @@ function Feedback(_a) {
|
|
|
155
156
|
Feedback.propTypes = {
|
|
156
157
|
variant: (0, import_prop_types.oneOf)(Object.keys(VARIANT_ICONS)).isRequired,
|
|
157
158
|
title: import_prop_types.string,
|
|
158
|
-
description: import_prop_types.string.isRequired,
|
|
159
|
+
description: (0, import_prop_types.oneOfType)([import_prop_types.string, (0, import_prop_types.arrayOf)(import_prop_types.string)]).isRequired,
|
|
159
160
|
children: (0, import_prop_types.oneOfType)([(0, import_prop_types.arrayOf)(import_prop_types.node), import_prop_types.node]),
|
|
160
161
|
/** Center the component vertically */
|
|
161
162
|
center: import_prop_types.bool
|
|
@@ -118,4 +118,24 @@ describe("<Feedback />", () => {
|
|
|
118
118
|
);
|
|
119
119
|
expect(getByTestId("feedback-icon-delayed")).toMatchSnapshot();
|
|
120
120
|
});
|
|
121
|
+
it("should render multiple paragraphs when description is an array", () => {
|
|
122
|
+
const multiDescription = [
|
|
123
|
+
"First paragraph of the feedback description.",
|
|
124
|
+
"Second paragraph providing extra context.",
|
|
125
|
+
"Third paragraph with final details."
|
|
126
|
+
];
|
|
127
|
+
const { getByText } = renderWithTheme(
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
129
|
+
import__.Feedback,
|
|
130
|
+
{
|
|
131
|
+
variant: "success",
|
|
132
|
+
title,
|
|
133
|
+
description: multiDescription
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
);
|
|
137
|
+
multiDescription.forEach((text) => {
|
|
138
|
+
expect(getByText(text)).toBeTruthy();
|
|
139
|
+
});
|
|
140
|
+
});
|
|
121
141
|
});
|
|
@@ -77,6 +77,7 @@ function Feedback(_a) {
|
|
|
77
77
|
"children",
|
|
78
78
|
"center"
|
|
79
79
|
]);
|
|
80
|
+
const descriptionArray = Array.isArray(description) ? description : [description];
|
|
80
81
|
const iconProps = VARIANT_ICONS[variant];
|
|
81
82
|
let primaryButton;
|
|
82
83
|
let secondaryButton;
|
|
@@ -118,7 +119,7 @@ function Feedback(_a) {
|
|
|
118
119
|
),
|
|
119
120
|
/* @__PURE__ */ jsxs(TextContainer, { children: [
|
|
120
121
|
titleElement,
|
|
121
|
-
/* @__PURE__ */ jsx(
|
|
122
|
+
/* @__PURE__ */ jsx(Box, { display: "flex", flexDirection: "column", gap: "large", mt: "small", children: descriptionArray.map((paragraph) => /* @__PURE__ */ jsx(Text.Body1, { color: "deep", children: paragraph }, paragraph == null ? void 0 : paragraph.toString().slice(0, 10))) })
|
|
122
123
|
] }),
|
|
123
124
|
captionElement ? /* @__PURE__ */ jsx(Box, { mt: "medium", children: captionElement }) : null,
|
|
124
125
|
/* @__PURE__ */ jsxs(Actions, { mt: "xxxlarge", children: [
|
|
@@ -132,7 +133,7 @@ function Feedback(_a) {
|
|
|
132
133
|
Feedback.propTypes = {
|
|
133
134
|
variant: oneOf(Object.keys(VARIANT_ICONS)).isRequired,
|
|
134
135
|
title: string,
|
|
135
|
-
description: string.isRequired,
|
|
136
|
+
description: oneOfType([string, arrayOf(string)]).isRequired,
|
|
136
137
|
children: oneOfType([arrayOf(node), node]),
|
|
137
138
|
/** Center the component vertically */
|
|
138
139
|
center: bool
|
|
@@ -95,4 +95,24 @@ describe("<Feedback />", () => {
|
|
|
95
95
|
);
|
|
96
96
|
expect(getByTestId("feedback-icon-delayed")).toMatchSnapshot();
|
|
97
97
|
});
|
|
98
|
+
it("should render multiple paragraphs when description is an array", () => {
|
|
99
|
+
const multiDescription = [
|
|
100
|
+
"First paragraph of the feedback description.",
|
|
101
|
+
"Second paragraph providing extra context.",
|
|
102
|
+
"Third paragraph with final details."
|
|
103
|
+
];
|
|
104
|
+
const { getByText } = renderWithTheme(
|
|
105
|
+
/* @__PURE__ */ jsx(
|
|
106
|
+
Feedback,
|
|
107
|
+
{
|
|
108
|
+
variant: "success",
|
|
109
|
+
title,
|
|
110
|
+
description: multiDescription
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
);
|
|
114
|
+
multiDescription.forEach((text) => {
|
|
115
|
+
expect(getByText(text)).toBeTruthy();
|
|
116
|
+
});
|
|
117
|
+
});
|
|
98
118
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gympass/yoga",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.133.0",
|
|
4
4
|
"description": "Gympass component library",
|
|
5
5
|
"main": "./cjs",
|
|
6
6
|
"types": "./typings/index.d.ts",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"react-native": "0.72.3",
|
|
60
60
|
"styled-components": "^4.4.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "58a258b912e1634e16ad83644c43a0faea8a2771",
|
|
63
63
|
"module": "./esm",
|
|
64
64
|
"private": false,
|
|
65
65
|
"react-native": "./cjs/index.native.js"
|
package/typings/index.d.ts
CHANGED
|
@@ -336,7 +336,7 @@ declare namespace Feedback {
|
|
|
336
336
|
namespace propTypes {
|
|
337
337
|
export const variant: prop_types.Validator<string>;
|
|
338
338
|
export { string as title };
|
|
339
|
-
export const description: prop_types.Validator<string>;
|
|
339
|
+
export const description: prop_types.Validator<string | (string | null | undefined)[]>;
|
|
340
340
|
export const children: prop_types.Requireable<string | number | boolean | prop_types.ReactElementLike | prop_types.ReactNodeArray>;
|
|
341
341
|
export { bool as center };
|
|
342
342
|
}
|