krl-alfred 2.17.13 → 2.17.14
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/dist/components/ReviewBlock/ReviewBlock.d.ts +1 -1
- package/dist/components/ReviewBlock/ReviewBlock.js +3 -3
- package/dist/components/ReviewBlock/ReviewBlock.styled.d.ts +1 -1
- package/dist/components/ReviewBlock/ReviewBlock.styled.js +1 -1
- package/dist/components/ReviewBlock/props.d.ts +2 -0
- package/dist/components/ReviewBlock/props.js +1 -0
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReviewBlockProps } from './props';
|
|
2
|
-
declare const ReviewBlock: ({ rating, customerName, date, comment, productReviews, maxStars, hasDropdown, hasApproveButton, hasBadge, badgeText, badgeVariant, onApproveButtonClick, onRemoveButtonClick, }: ReviewBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const ReviewBlock: ({ rating, customerName, date, comment, productReviews, maxStars, hasDropdown, hasApproveButton, hasBadge, badgeText, badgeVariant, hasShadow, onApproveButtonClick, onRemoveButtonClick, }: ReviewBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default ReviewBlock;
|
|
@@ -23,7 +23,7 @@ var react_i18next_1 = require("react-i18next");
|
|
|
23
23
|
var TextLink_1 = __importDefault(require("../TextLink"));
|
|
24
24
|
var Dropdown_1 = __importDefault(require("../Dropdown"));
|
|
25
25
|
var ReviewBlock = function (_a) {
|
|
26
|
-
var _b = _a.rating, rating = _b === void 0 ? props_1.ReviewBlockDefault.rating : _b, customerName = _a.customerName, date = _a.date, _c = _a.comment, comment = _c === void 0 ? props_1.ReviewBlockDefault.comment : _c, productReviews = _a.productReviews, _d = _a.maxStars, maxStars = _d === void 0 ? props_1.ReviewBlockDefault.maxStars : _d, _e = _a.hasDropdown, hasDropdown = _e === void 0 ? props_1.ReviewBlockDefault.hasDropdown : _e, _f = _a.hasApproveButton, hasApproveButton = _f === void 0 ? props_1.ReviewBlockDefault.hasApproveButton : _f, _g = _a.hasBadge, hasBadge = _g === void 0 ? props_1.ReviewBlockDefault.hasBadge : _g, _h = _a.badgeText, badgeText = _h === void 0 ? props_1.ReviewBlockDefault.badgeText : _h, _j = _a.badgeVariant, badgeVariant = _j === void 0 ? props_1.ReviewBlockDefault.badgeVariant : _j, onApproveButtonClick = _a.onApproveButtonClick, onRemoveButtonClick = _a.onRemoveButtonClick;
|
|
26
|
+
var _b = _a.rating, rating = _b === void 0 ? props_1.ReviewBlockDefault.rating : _b, customerName = _a.customerName, date = _a.date, _c = _a.comment, comment = _c === void 0 ? props_1.ReviewBlockDefault.comment : _c, productReviews = _a.productReviews, _d = _a.maxStars, maxStars = _d === void 0 ? props_1.ReviewBlockDefault.maxStars : _d, _e = _a.hasDropdown, hasDropdown = _e === void 0 ? props_1.ReviewBlockDefault.hasDropdown : _e, _f = _a.hasApproveButton, hasApproveButton = _f === void 0 ? props_1.ReviewBlockDefault.hasApproveButton : _f, _g = _a.hasBadge, hasBadge = _g === void 0 ? props_1.ReviewBlockDefault.hasBadge : _g, _h = _a.badgeText, badgeText = _h === void 0 ? props_1.ReviewBlockDefault.badgeText : _h, _j = _a.badgeVariant, badgeVariant = _j === void 0 ? props_1.ReviewBlockDefault.badgeVariant : _j, _k = _a.hasShadow, hasShadow = _k === void 0 ? props_1.ReviewBlockDefault.hasShadow : _k, onApproveButtonClick = _a.onApproveButtonClick, onRemoveButtonClick = _a.onRemoveButtonClick;
|
|
27
27
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
28
28
|
var percentage = (rating / maxStars) * 100;
|
|
29
29
|
var dropdownList = [
|
|
@@ -32,9 +32,9 @@ var ReviewBlock = function (_a) {
|
|
|
32
32
|
onClick: onRemoveButtonClick,
|
|
33
33
|
}
|
|
34
34
|
];
|
|
35
|
-
return ((0, jsx_runtime_1.jsxs)(ReviewBlock_styled_1.ReviewCard, { children: [(0, jsx_runtime_1.jsxs)(ReviewBlock_styled_1.Header, __assign({ "$hasDropdown": hasDropdown, "$hasApproveButton": hasApproveButton }, { children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)(ReviewBlock_styled_1.StarsWrapper, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "notFilleds" }, { children: Array.from({ length: maxStars }).map(function (_, i) { return ((0, jsx_runtime_1.jsx)(Icon_1.default, { name: "StarfullSmall", color: "var(--dark-opacity-10)" }, i)); }) })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "filleds", style: { width: "".concat(percentage, "%") } }, { children: Array.from({ length: maxStars }).map(function (_, i) { return ((0, jsx_runtime_1.jsx)(Icon_1.default, { name: "StarfullSmall", color: "var(--yellowDark)" }, i)); }) }))] }), (0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.CustomerName, { children: customerName })] }), (0, jsx_runtime_1.jsxs)("div", { children: [hasApproveButton && ((0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.TextLinkWrapper, { children: (0, jsx_runtime_1.jsx)(TextLink_1.default, __assign({ onClick: onApproveButtonClick }, { children: t("POST_COMMENTS") })) })), hasBadge && ((0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.BadgeWrapper, { children: (0, jsx_runtime_1.jsx)(Badges_1.default, { layout: "text", variant: badgeVariant, title: badgeText }) })), hasDropdown && ((0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.DropdownWrapper, { children: (0, jsx_runtime_1.jsx)(Dropdown_1.default, { size: "small", list: dropdownList, isShowTopChevron: false, Toggle: function () { return (0, jsx_runtime_1.jsxs)(ReviewBlock_styled_1.DropdownToggleButton, { children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { name: "MoreCircle" }), " "] }); }, childrenVariant: "primary", right: "0", width: "145px", top: "calc(100% + 4px)" }) })), (0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.Date, { children: date })] })] })), comment && (0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.PlatformReview, { children: comment }), productReviews === null || productReviews === void 0 ? void 0 : productReviews.map(function (product, idx) {
|
|
35
|
+
return ((0, jsx_runtime_1.jsxs)(ReviewBlock_styled_1.ReviewCard, __assign({ "$hasShadow": hasShadow }, { children: [(0, jsx_runtime_1.jsxs)(ReviewBlock_styled_1.Header, __assign({ "$hasDropdown": hasDropdown, "$hasApproveButton": hasApproveButton }, { children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)(ReviewBlock_styled_1.StarsWrapper, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: "notFilleds" }, { children: Array.from({ length: maxStars }).map(function (_, i) { return ((0, jsx_runtime_1.jsx)(Icon_1.default, { name: "StarfullSmall", color: "var(--dark-opacity-10)" }, i)); }) })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "filleds", style: { width: "".concat(percentage, "%") } }, { children: Array.from({ length: maxStars }).map(function (_, i) { return ((0, jsx_runtime_1.jsx)(Icon_1.default, { name: "StarfullSmall", color: "var(--yellowDark)" }, i)); }) }))] }), (0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.CustomerName, { children: customerName })] }), (0, jsx_runtime_1.jsxs)("div", { children: [hasApproveButton && ((0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.TextLinkWrapper, { children: (0, jsx_runtime_1.jsx)(TextLink_1.default, __assign({ onClick: onApproveButtonClick }, { children: t("POST_COMMENTS") })) })), hasBadge && ((0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.BadgeWrapper, { children: (0, jsx_runtime_1.jsx)(Badges_1.default, { layout: "text", variant: badgeVariant, title: badgeText }) })), hasDropdown && ((0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.DropdownWrapper, { children: (0, jsx_runtime_1.jsx)(Dropdown_1.default, { size: "small", list: dropdownList, isShowTopChevron: false, Toggle: function () { return (0, jsx_runtime_1.jsxs)(ReviewBlock_styled_1.DropdownToggleButton, { children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { name: "MoreCircle" }), " "] }); }, childrenVariant: "primary", right: "0", width: "145px", top: "calc(100% + 4px)" }) })), (0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.Date, { children: date })] })] })), comment && (0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.PlatformReview, { children: comment }), productReviews === null || productReviews === void 0 ? void 0 : productReviews.map(function (product, idx) {
|
|
36
36
|
var _a, _b;
|
|
37
37
|
return ((0, jsx_runtime_1.jsxs)(ReviewBlock_styled_1.ProductReviewBlock, { children: [(0, jsx_runtime_1.jsxs)(ReviewBlock_styled_1.ProductWrapper, { children: [(0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.ProductImage, { children: product === null || product === void 0 ? void 0 : product.image }), (0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.ProductReviewContent, { children: (0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.ProductName, { children: product === null || product === void 0 ? void 0 : product.name }) })] }), (product === null || product === void 0 ? void 0 : product.question) && (0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.ProductQuestion, { children: product === null || product === void 0 ? void 0 : product.question }), (0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.ProductAnswer, { children: product === null || product === void 0 ? void 0 : product.answer }), ((_a = product === null || product === void 0 ? void 0 : product.tags) === null || _a === void 0 ? void 0 : _a.length) > 0 && ((0, jsx_runtime_1.jsx)(ReviewBlock_styled_1.Tags, { children: (_b = product === null || product === void 0 ? void 0 : product.tags) === null || _b === void 0 ? void 0 : _b.map(function (tag, i) { return ((0, jsx_runtime_1.jsx)(Badges_1.default, { layout: "text", variant: "secondary", title: tag }, i)); }) }))] }, idx));
|
|
38
|
-
})] }));
|
|
38
|
+
})] })));
|
|
39
39
|
};
|
|
40
40
|
exports.default = ReviewBlock;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ReviewBlockStyledProps } from "./props";
|
|
3
|
-
export declare const ReviewCard: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
3
|
+
export declare const ReviewCard: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ReviewBlockStyledProps>> & string;
|
|
4
4
|
export declare const Header: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ReviewBlockStyledProps>> & string;
|
|
5
5
|
export declare const CustomerName: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
6
|
export declare const Date: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.DropdownToggleButton = exports.DropdownWrapper = exports.StarsWrapper = exports.BadgeWrapper = exports.TextLinkWrapper = exports.Tags = exports.ProductAnswer = exports.ProductQuestion = exports.ProductName = exports.ProductReviewContent = exports.ProductImage = exports.ProductWrapper = exports.ProductReviewBlock = exports.PlatformReview = exports.Date = exports.CustomerName = exports.Header = exports.ReviewCard = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
12
|
var devices_1 = require("../../constants/devices");
|
|
13
|
-
exports.ReviewCard = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: white;\n padding: 1.5rem;\n border-radius: 0.5rem;\n
|
|
13
|
+
exports.ReviewCard = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: white;\n padding: 1.5rem;\n border-radius: 0.5rem;\n ", "\n"], ["\n background: white;\n padding: 1.5rem;\n border-radius: 0.5rem;\n ", "\n"])), function (props) { return props.$hasShadow ? "\n box-shadow: 0px 6px 30px 0px var(--box-shadow-color);\n " : "\n border: 1px solid var(--grey-10);\n "; });
|
|
14
14
|
exports.Header = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: ", ";\n border-bottom: 1px solid var(--dark-opacity-10);\n padding-bottom: 1rem;\n margin-bottom: 1rem;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: ", ";\n border-bottom: 1px solid var(--dark-opacity-10);\n padding-bottom: 1rem;\n margin-bottom: 1rem;\n"])), function (props) { return props.$hasDropdown || props.$hasApproveButton ? "center" : "flex-end"; });
|
|
15
15
|
exports.CustomerName = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font: var(--body-semi-bold-13-16);\n color: var(--dark-opacity-50);\n margin-top: 1rem;\n"], ["\n font: var(--body-semi-bold-13-16);\n color: var(--dark-opacity-50);\n margin-top: 1rem;\n"])));
|
|
16
16
|
exports.Date = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font: var(--caption-semi-bold-12-15);\n color: var(--dark-opacity-50);\n margin-top: 1rem;\n text-align: end;\n"], ["\n font: var(--caption-semi-bold-12-15);\n color: var(--dark-opacity-50);\n margin-top: 1rem;\n text-align: end;\n"])));
|
|
@@ -20,9 +20,11 @@ export type ReviewBlockProps = {
|
|
|
20
20
|
hasBadge?: boolean;
|
|
21
21
|
badgeText?: string;
|
|
22
22
|
badgeVariant?: string;
|
|
23
|
+
hasShadow?: boolean;
|
|
23
24
|
};
|
|
24
25
|
export type ReviewBlockStyledProps = {
|
|
25
26
|
$hasApproveButton?: boolean;
|
|
26
27
|
$hasDropdown?: boolean;
|
|
28
|
+
$hasShadow?: boolean;
|
|
27
29
|
};
|
|
28
30
|
export declare const ReviewBlockDefault: ReviewBlockProps;
|