contentoh-components-library 21.4.30 → 21.4.32
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/assets/images/defaultImages/check_circle.svg +10 -0
- package/dist/components/atoms/Avatar/index.js +3 -2
- package/dist/components/atoms/Card/index.js +46 -5
- package/dist/components/atoms/Card/styles.js +3 -1
- package/dist/components/atoms/CheckBox/index.js +7 -2
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +90 -0
- package/dist/components/atoms/ImageCarousel/index.js +120 -0
- package/dist/components/atoms/ImageCarousel/styles.js +18 -0
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/atoms/PercentTag/PercentTag.stories.js +31 -0
- package/dist/components/atoms/PercentTag/index.js +23 -0
- package/dist/components/atoms/PercentTag/styles.js +22 -0
- package/dist/components/atoms/RatingStars/RatingStars.stories.js +30 -0
- package/dist/components/atoms/RatingStars/index.js +53 -0
- package/dist/components/atoms/RatingStars/styles.js +18 -0
- package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +48 -0
- package/dist/components/atoms/RetailerCatalog/index.js +69 -0
- package/dist/components/atoms/RetailerCatalog/styles.js +20 -0
- package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +33 -0
- package/dist/components/atoms/RetailerOption/index.js +62 -0
- package/dist/components/atoms/RetailerOption/styles.js +20 -0
- package/dist/components/atoms/RetailersList/RetailersList.stories.js +45 -0
- package/dist/components/atoms/RetailersList/index.js +46 -0
- package/dist/components/atoms/RetailersList/styles.js +18 -0
- package/dist/components/atoms/SliderToolTip/styles.js +1 -1
- package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +73 -0
- package/dist/components/atoms/UserCatalog/index.js +101 -0
- package/dist/components/atoms/UserCatalog/styles.js +18 -0
- package/dist/components/atoms/UserOption/UserOption.stories.js +40 -0
- package/dist/components/atoms/UserOption/index.js +130 -0
- package/dist/components/atoms/UserOption/styles.js +20 -0
- package/dist/components/atoms/UserSelector/UserSelector.stories.js +40 -0
- package/dist/components/atoms/UserSelector/index.js +98 -0
- package/dist/components/atoms/UserSelector/styles.js +32 -0
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/GridItem/GridItem.stories.js +123 -0
- package/dist/components/molecules/GridItem/index.js +152 -0
- package/dist/components/molecules/GridItem/styles.js +20 -0
- package/dist/components/molecules/HeaderItem/ColumnItem.js +23 -0
- package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +70 -0
- package/dist/components/molecules/HeaderItem/index.js +42 -0
- package/dist/components/molecules/HeaderItem/styles.js +30 -0
- package/dist/components/molecules/HeaderTop/index.js +68 -11
- package/dist/components/molecules/RowItem/ColumnItem.js +23 -0
- package/dist/components/molecules/RowItem/RowItem.stories.js +5242 -0
- package/dist/components/molecules/RowItem/index.js +58 -0
- package/dist/components/molecules/RowItem/styles.js +30 -0
- package/dist/components/molecules/StripeCardForm/StripeCardForm.stories.js +32 -0
- package/dist/components/molecules/StripeCardForm/index.js +94 -0
- package/dist/components/molecules/StripeCardForm/paymentForm.js +199 -0
- package/dist/components/molecules/StripeCardForm/styles.js +27 -0
- package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +30 -0
- package/dist/components/molecules/StripeCardSelector/index.js +125 -0
- package/dist/components/molecules/StripeCardSelector/styles.js +22 -0
- package/dist/components/molecules/StripeCardSelector/utils.js +56 -0
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +27 -8
- package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +350 -197
- package/dist/components/organisms/Chat/Footer/index.js +48 -39
- package/dist/components/organisms/Chat/index.js +49 -4
- package/dist/components/organisms/Chat/styles.js +1 -1
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/GridProducts/GridProducts.stories.js +5097 -0
- package/dist/components/organisms/GridProducts/index.js +63 -0
- package/dist/components/organisms/GridProducts/styles.js +18 -0
- package/dist/components/organisms/GridProducts/utils.js +149 -0
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/organisms/PanelLayout/PanelLayout.stories.js +87 -0
- package/dist/components/organisms/PanelLayout/index.js +29 -0
- package/dist/components/organisms/PanelLayout/styles.js +32 -0
- package/dist/components/organisms/SideModal/SideModal.stories.js +42 -0
- package/dist/components/organisms/SideModal/index.js +72 -0
- package/dist/components/organisms/SideModal/styles.js +18 -0
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +6 -4
- package/dist/components/pages/ProviderProductEdition/index.js +117 -142
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +7 -3
- package/dist/components/pages/RetailerProductEdition/index.js +276 -274
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
- package/dist/index.js +247 -52
- package/package.json +4 -1
- package/src/assets/images/defaultImages/check_circle.svg +10 -0
- package/src/components/atoms/Avatar/index.js +8 -2
- package/src/components/atoms/Card/index.js +35 -2
- package/src/components/atoms/Card/styles.js +41 -5
- package/src/components/atoms/CheckBox/index.js +4 -1
- package/src/components/atoms/CheckBox/styles.js +2 -0
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -0
- package/src/components/atoms/ImageCarousel/index.js +103 -0
- package/src/components/atoms/ImageCarousel/styles.js +79 -0
- package/src/components/atoms/InputFormatter/styles.js +2 -1
- package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
- package/src/components/atoms/PercentTag/index.js +9 -0
- package/src/components/atoms/PercentTag/styles.js +69 -0
- package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -0
- package/src/components/atoms/RatingStars/index.js +31 -0
- package/src/components/atoms/RatingStars/styles.js +28 -0
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
- package/src/components/atoms/RetailerCatalog/index.js +49 -0
- package/src/components/atoms/RetailerCatalog/styles.js +30 -0
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
- package/src/components/atoms/RetailerOption/index.js +53 -0
- package/src/components/atoms/RetailerOption/styles.js +41 -0
- package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
- package/src/components/atoms/RetailersList/index.js +20 -0
- package/src/components/atoms/RetailersList/styles.js +19 -0
- package/src/components/atoms/SliderToolTip/styles.js +1 -1
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +67 -0
- package/src/components/atoms/UserCatalog/index.js +100 -0
- package/src/components/atoms/UserCatalog/styles.js +24 -0
- package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
- package/src/components/atoms/UserOption/index.js +95 -0
- package/src/components/atoms/UserOption/styles.js +61 -0
- package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
- package/src/components/atoms/UserSelector/index.js +86 -0
- package/src/components/atoms/UserSelector/styles.js +55 -0
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
- package/src/components/molecules/GridItem/index.js +105 -0
- package/src/components/molecules/GridItem/styles.js +104 -0
- package/src/components/molecules/HeaderItem/ColumnItem.js +9 -0
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
- package/src/components/molecules/HeaderItem/index.js +26 -0
- package/src/components/molecules/HeaderItem/styles.js +27 -0
- package/src/components/molecules/HeaderTop/index.js +52 -6
- package/src/components/molecules/RowItem/ColumnItem.js +9 -0
- package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
- package/src/components/molecules/RowItem/index.js +45 -0
- package/src/components/molecules/RowItem/styles.js +40 -0
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +14 -0
- package/src/components/molecules/StripeCardForm/index.js +45 -0
- package/src/components/molecules/StripeCardForm/paymentForm.js +126 -0
- package/src/components/molecules/StripeCardForm/styles.js +84 -0
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +12 -0
- package/src/components/molecules/StripeCardSelector/index.js +59 -0
- package/src/components/molecules/StripeCardSelector/styles.js +15 -0
- package/src/components/molecules/StripeCardSelector/utils.js +17 -0
- package/src/components/molecules/TagAndInput/index.js +10 -8
- package/src/components/organisms/Chat/Chat.stories.js +27 -7
- package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
- package/src/components/organisms/Chat/ContainerItems/styles.js +14 -2
- package/src/components/organisms/Chat/ContentChat/index.js +88 -12
- package/src/components/organisms/Chat/Footer/index.js +11 -0
- package/src/components/organisms/Chat/index.js +46 -4
- package/src/components/organisms/Chat/styles.js +4 -0
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/GridProducts/GridProducts.stories.js +5485 -0
- package/src/components/organisms/GridProducts/index.js +50 -0
- package/src/components/organisms/GridProducts/styles.js +14 -0
- package/src/components/organisms/GridProducts/utils.js +111 -0
- package/src/components/organisms/Modal/styles.js +4 -1
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
- package/src/components/organisms/PanelLayout/PanelLayout.stories.js +63 -0
- package/src/components/organisms/PanelLayout/index.js +11 -0
- package/src/components/organisms/PanelLayout/styles.js +39 -0
- package/src/components/organisms/SideModal/SideModal.stories.js +23 -0
- package/src/components/organisms/SideModal/index.js +50 -0
- package/src/components/organisms/SideModal/styles.js +30 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +6 -4
- package/src/components/pages/ProviderProductEdition/index.js +97 -129
- package/src/components/pages/ProviderProductEdition/styles.js +5 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +6 -2
- package/src/components/pages/RetailerProductEdition/index.js +111 -142
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
- package/src/index.js +15 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="check_circle">
|
|
3
|
+
<mask id="mask0_204_774" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="14" height="14">
|
|
4
|
+
<rect id="Bounding box" width="14" height="14" fill="#D9D9D9"/>
|
|
5
|
+
</mask>
|
|
6
|
+
<g mask="url(#mask0_204_774)">
|
|
7
|
+
<path id="check_circle_2" d="M5.9675 10.185L10.92 5.2325L10.115 4.445L5.9675 8.5925L3.8675 6.4925L3.08 7.28L5.9675 10.185ZM7 14C6.04333 14 5.13917 13.8162 4.2875 13.4487C3.43583 13.0812 2.69208 12.5796 2.05625 11.9437C1.42042 11.3079 0.91875 10.5642 0.55125 9.7125C0.18375 8.86083 0 7.95667 0 7C0 6.03167 0.18375 5.12167 0.55125 4.27C0.91875 3.41833 1.42042 2.6775 2.05625 2.0475C2.69208 1.4175 3.43583 0.91875 4.2875 0.55125C5.13917 0.18375 6.04333 0 7 0C7.96833 0 8.87833 0.18375 9.73 0.55125C10.5817 0.91875 11.3225 1.4175 11.9525 2.0475C12.5825 2.6775 13.0812 3.41833 13.4487 4.27C13.8162 5.12167 14 6.03167 14 7C14 7.95667 13.8162 8.86083 13.4487 9.7125C13.0812 10.5642 12.5825 11.3079 11.9525 11.9437C11.3225 12.5796 10.5817 13.0812 9.73 13.4487C8.87833 13.8162 7.96833 14 7 14Z" fill="#8A6CAA"/>
|
|
8
|
+
</g>
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
|
@@ -19,12 +19,13 @@ var Avatar = function Avatar(_ref) {
|
|
|
19
19
|
var image = _ref.image,
|
|
20
20
|
altText = _ref.altText,
|
|
21
21
|
imageType = _ref.imageType,
|
|
22
|
-
onClick = _ref.onClick
|
|
22
|
+
onClick = _ref.onClick,
|
|
23
|
+
fallbackImage = _ref.fallbackImage;
|
|
23
24
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
24
25
|
className: imageType,
|
|
25
26
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactImageFallback.default, {
|
|
26
27
|
src: image,
|
|
27
|
-
fallbackImage: _defaultProfileImage.default,
|
|
28
|
+
fallbackImage: fallbackImage || _defaultProfileImage.default,
|
|
28
29
|
alt: altText,
|
|
29
30
|
onClick: onClick
|
|
30
31
|
})
|
|
@@ -1,21 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.Card = void 0;
|
|
7
9
|
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
8
12
|
var _styles = require("./styles");
|
|
9
13
|
|
|
14
|
+
var _CheckBox = require("../CheckBox");
|
|
15
|
+
|
|
16
|
+
var _reactStripeJs = require("@stripe/react-stripe-js");
|
|
17
|
+
|
|
10
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
19
|
|
|
12
20
|
var Card = function Card(_ref) {
|
|
13
|
-
var
|
|
14
|
-
|
|
21
|
+
var _ref$card = _ref.card,
|
|
22
|
+
card = _ref$card === void 0 ? {} : _ref$card,
|
|
23
|
+
selectedCard = _ref.selectedCard,
|
|
24
|
+
setSelectedCard = _ref.setSelectedCard,
|
|
25
|
+
setCard = _ref.setCard,
|
|
26
|
+
setStripe = _ref.setStripe;
|
|
27
|
+
var stripe = (0, _reactStripeJs.useStripe)();
|
|
28
|
+
|
|
29
|
+
var handleOnChange = function handleOnChange(e, cardId) {
|
|
30
|
+
if (e.target.checked) {
|
|
31
|
+
setCard && setCard((0, _objectSpread2.default)((0, _objectSpread2.default)({}, card), {}, {
|
|
32
|
+
isNew: 0
|
|
33
|
+
}));
|
|
34
|
+
setStripe && setStripe(stripe);
|
|
35
|
+
setSelectedCard && setSelectedCard(cardId);
|
|
36
|
+
} else {
|
|
37
|
+
setSelectedCard && setSelectedCard("");
|
|
38
|
+
setCard && setCard(null);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
15
42
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
16
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("
|
|
17
|
-
|
|
18
|
-
|
|
43
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
44
|
+
className: "card-details",
|
|
45
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBox.CheckBox, {
|
|
46
|
+
id: card.id,
|
|
47
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
48
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
49
|
+
className: "brand-card",
|
|
50
|
+
children: card.brand
|
|
51
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
52
|
+
children: "**** **** **** ".concat(card.last4)
|
|
53
|
+
})]
|
|
54
|
+
}),
|
|
55
|
+
checked: selectedCard === card.id,
|
|
56
|
+
onChange: function onChange(e) {
|
|
57
|
+
return handleOnChange(e, card.id);
|
|
58
|
+
}
|
|
59
|
+
})
|
|
19
60
|
})
|
|
20
61
|
});
|
|
21
62
|
};
|
|
@@ -11,8 +11,10 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
11
11
|
|
|
12
12
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
13
|
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
14
16
|
var _templateObject;
|
|
15
17
|
|
|
16
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n cursor: pointer;\n\n .card-details {\n label {\n cursor: pointer;\n height: 25px;\n p {\n margin-left: 40px;\n span {\n & + * {\n margin-left: 20px;\n }\n }\n }\n }\n & + * {\n margin-left: 20px;\n }\n }\n\n .cvc-input {\n display: flex;\n align-items: center;\n color: ", ";\n font-family: ", ";\n font-size: 13px;\n\n .card-input {\n border: 1px solid #f0f0f0 !important;\n border-radius: 5px;\n padding: 3px;\n width: 50px;\n }\n }\n\n & + * {\n margin-top: 15px;\n }\n"])), _variables.GlobalColors.s4, _variables.FontFamily.AvenirNext);
|
|
17
19
|
|
|
18
20
|
exports.Container = Container;
|
|
@@ -16,15 +16,20 @@ var CheckBox = function CheckBox(_ref) {
|
|
|
16
16
|
isFilter = _ref.isFilter,
|
|
17
17
|
defaultChecked = _ref.defaultChecked,
|
|
18
18
|
_ref$disabled = _ref.disabled,
|
|
19
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled
|
|
19
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
20
|
+
checked = _ref.checked,
|
|
21
|
+
_ref$className = _ref.className,
|
|
22
|
+
className = _ref$className === void 0 ? "" : _ref$className;
|
|
20
23
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
24
|
+
className: className,
|
|
21
25
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
22
26
|
type: "checkbox",
|
|
23
27
|
name: id,
|
|
24
28
|
id: id,
|
|
25
29
|
onChange: onChange,
|
|
26
30
|
defaultChecked: defaultChecked,
|
|
27
|
-
disabled: disabled
|
|
31
|
+
disabled: disabled,
|
|
32
|
+
checked: checked
|
|
28
33
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
29
34
|
htmlFor: id,
|
|
30
35
|
children: label && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -19,6 +19,6 @@ var _variables = require("../../../global-files/variables");
|
|
|
19
19
|
|
|
20
20
|
var _templateObject;
|
|
21
21
|
|
|
22
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n input {\n display: none;\n &:checked + label {\n &:before {\n background-color: ", ";\n background-image: url(", ");\n }\n }\n }\n\n label {\n position: relative;\n min-height: 16px;\n min-width: 16px;\n display: inline-block;\n\n p {\n display: inline;\n color: ", ";\n font-family: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 21px;\n margin-left: 20px;\n\n &.filter-text {\n color: ", ";\n font-size: 18px;\n line-height: 24px;\n margin-left: 23px;\n }\n }\n\n &:before {\n content: \"\";\n width: 16px;\n height: 16px;\n position: absolute;\n display: inline-block;\n top: 50%;\n transform: translateY(-50%);\n background-image: url(", ");\n }\n }\n"])), _variables.GlobalColors.white, _checked.default, _variables.GlobalColors.s4, _variables.FontFamily.AvenirNext, _variables.GlobalColors.magenta_s2, _unchecked.default);
|
|
22
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n input {\n display: none;\n &:checked + label {\n &:before {\n background-color: ", ";\n background-image: url(", ");\n }\n }\n }\n\n label {\n position: relative;\n min-height: 16px;\n min-width: 16px;\n display: inline-block;\n\n p {\n display: inline;\n color: ", ";\n font-family: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 21px;\n margin-left: 20px;\n\n &.filter-text {\n color: ", ";\n font-size: 18px;\n line-height: 24px;\n margin-left: 23px;\n }\n }\n\n &:before {\n content: \"\";\n width: 16px;\n height: 16px;\n position: absolute;\n display: inline-block;\n top: 50%;\n transform: translateY(-50%);\n background-image: url(", ");\n z-index: 5;\n cursor: pointer;\n }\n }\n"])), _variables.GlobalColors.white, _checked.default, _variables.GlobalColors.s4, _variables.FontFamily.AvenirNext, _variables.GlobalColors.magenta_s2, _unchecked.default);
|
|
23
23
|
|
|
24
24
|
exports.Container = Container;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.ImageCarouselDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _ = require(".");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/atoms/ImageCarousel",
|
|
18
|
+
component: _.ImageCarousel
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ImageCarousel, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var ImageCarouselDefault = Template.bind({});
|
|
27
|
+
exports.ImageCarouselDefault = ImageCarouselDefault;
|
|
28
|
+
ImageCarouselDefault.args = {
|
|
29
|
+
imageArray: [{
|
|
30
|
+
id: 35596,
|
|
31
|
+
status: null,
|
|
32
|
+
image_id: 1,
|
|
33
|
+
packing_type: "3",
|
|
34
|
+
image_type: "1",
|
|
35
|
+
article_id: "38443",
|
|
36
|
+
src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMS1kNDQ2ZjIwNy0wYTkzLTQyNzgtYWZjNi01MTY2ZjIyY2EzNDMucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
|
|
37
|
+
timestamp: "2023-05-30T03:01:12.000Z",
|
|
38
|
+
id_version: 15,
|
|
39
|
+
width: null,
|
|
40
|
+
height: null,
|
|
41
|
+
scene_type: null,
|
|
42
|
+
image_shot_type: null,
|
|
43
|
+
last_modified: "2023-06-05T23:49:49.000Z",
|
|
44
|
+
name: "Central (Frente Comercial)",
|
|
45
|
+
version: 15,
|
|
46
|
+
ext: "png",
|
|
47
|
+
uuid: "d446f207-0a93-4278-afc6-5166f22ca343",
|
|
48
|
+
srcDB: "id-38443/15/1-d446f207-0a93-4278-afc6-5166f22ca343.png"
|
|
49
|
+
}, {
|
|
50
|
+
id: 35597,
|
|
51
|
+
status: null,
|
|
52
|
+
image_id: 3,
|
|
53
|
+
packing_type: "3",
|
|
54
|
+
image_type: "1",
|
|
55
|
+
article_id: "38443",
|
|
56
|
+
src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMy0yOTZkMzU3ZC00OTUzLTRiMzktYjFjMy04YWZmZDI2NDgwMWIucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
|
|
57
|
+
timestamp: "2023-05-30T03:01:12.000Z",
|
|
58
|
+
id_version: 15,
|
|
59
|
+
width: null,
|
|
60
|
+
height: null,
|
|
61
|
+
scene_type: null,
|
|
62
|
+
image_shot_type: null,
|
|
63
|
+
last_modified: "2023-06-05T23:49:49.000Z",
|
|
64
|
+
name: "Trasera (Back)",
|
|
65
|
+
version: 15,
|
|
66
|
+
ext: "png",
|
|
67
|
+
uuid: "296d357d-4953-4b39-b1c3-8affd264801b",
|
|
68
|
+
srcDB: "id-38443/15/3-296d357d-4953-4b39-b1c3-8affd264801b.png"
|
|
69
|
+
}, {
|
|
70
|
+
id: 35598,
|
|
71
|
+
status: null,
|
|
72
|
+
image_id: 16,
|
|
73
|
+
packing_type: "3",
|
|
74
|
+
image_type: "1",
|
|
75
|
+
article_id: "38443",
|
|
76
|
+
src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMTYtOGMzNDIzM2YtZTRiMC00MjU0LWFlYzUtZjEyN2ZiYjhkYmVkLnBuZyIsImVkaXRzIjp7InJlc2l6ZSI6eyJ3aWR0aCI6MTAwMCwiaGVpZ2h0IjoxMDAwLCJmaXQiOiJjb250YWluIiwiYmFja2dyb3VuZCI6eyJyIjoyNTUsImciOjI1NSwiYiI6MjU1LCJhbHBoYSI6MX19fX0=",
|
|
77
|
+
timestamp: "2023-05-30T03:01:12.000Z",
|
|
78
|
+
id_version: 15,
|
|
79
|
+
width: null,
|
|
80
|
+
height: null,
|
|
81
|
+
scene_type: null,
|
|
82
|
+
image_shot_type: null,
|
|
83
|
+
last_modified: "2023-06-05T23:49:49.000Z",
|
|
84
|
+
name: "Detalle / Características 1",
|
|
85
|
+
version: 15,
|
|
86
|
+
ext: "png",
|
|
87
|
+
uuid: "8c34233f-e4b0-4254-aec5-f127fbb8dbed",
|
|
88
|
+
srcDB: "id-38443/15/16-8c34233f-e4b0-4254-aec5-f127fbb8dbed.png"
|
|
89
|
+
}]
|
|
90
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ImageCarousel = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
|
|
14
|
+
var _react = require("react");
|
|
15
|
+
|
|
16
|
+
var _reactImageFallback = _interopRequireDefault(require("react-image-fallback"));
|
|
17
|
+
|
|
18
|
+
var _Spinner = _interopRequireDefault(require("../../../assets/images/Icons/Spinner.gif"));
|
|
19
|
+
|
|
20
|
+
var _ArrowBackIos = _interopRequireDefault(require("@mui/icons-material/ArrowBackIos"));
|
|
21
|
+
|
|
22
|
+
var _defaultProductImage = _interopRequireDefault(require("../../../assets/images/defaultImages/defaultProductImage.png"));
|
|
23
|
+
|
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
+
|
|
26
|
+
var ImageCarousel = function ImageCarousel(_ref) {
|
|
27
|
+
var _ref$imageArray = _ref.imageArray,
|
|
28
|
+
imageArray = _ref$imageArray === void 0 ? [] : _ref$imageArray;
|
|
29
|
+
|
|
30
|
+
var _useState = (0, _react.useState)(0),
|
|
31
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
32
|
+
currentIndex = _useState2[0],
|
|
33
|
+
setCurrentIndex = _useState2[1];
|
|
34
|
+
|
|
35
|
+
var _useState3 = (0, _react.useState)(false),
|
|
36
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
37
|
+
transitioning = _useState4[0],
|
|
38
|
+
setTransitioning = _useState4[1];
|
|
39
|
+
|
|
40
|
+
var _useState5 = (0, _react.useState)(false),
|
|
41
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
42
|
+
isHover = _useState6[0],
|
|
43
|
+
setIsHover = _useState6[1];
|
|
44
|
+
|
|
45
|
+
var goToNextSlide = function goToNextSlide() {
|
|
46
|
+
if (!transitioning) {
|
|
47
|
+
setTransitioning(true);
|
|
48
|
+
setCurrentIndex(function (prevIndex) {
|
|
49
|
+
return (prevIndex + 1) % imageArray.length;
|
|
50
|
+
});
|
|
51
|
+
setTimeout(function () {
|
|
52
|
+
setTransitioning(false);
|
|
53
|
+
}, 500); // Adjust the transition duration to match your CSS
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var goToPrevSlide = function goToPrevSlide() {
|
|
58
|
+
if (!transitioning) {
|
|
59
|
+
setTransitioning(true);
|
|
60
|
+
setCurrentIndex(function (prevIndex) {
|
|
61
|
+
return (prevIndex - 1 + imageArray.length) % imageArray.length;
|
|
62
|
+
});
|
|
63
|
+
setTimeout(function () {
|
|
64
|
+
setTransitioning(false);
|
|
65
|
+
}, 500); // Adjust the transition duration to match your CSS
|
|
66
|
+
}
|
|
67
|
+
}; // useEffect(() => {
|
|
68
|
+
// const delay = 0;
|
|
69
|
+
// let repeat;
|
|
70
|
+
// setTimeout(() => {
|
|
71
|
+
// repeat = setInterval(() => {
|
|
72
|
+
// if (!isHover && imageArray.length > 1) goToNextSlide();
|
|
73
|
+
// }, 10000);
|
|
74
|
+
// }, delay);
|
|
75
|
+
// return () => {
|
|
76
|
+
// clearInterval(repeat);
|
|
77
|
+
// };
|
|
78
|
+
// }, [isHover]);
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container // onMouseEnter={() => setIsHover(true)}
|
|
82
|
+
// onMouseLeave={() => setIsHover(false)}
|
|
83
|
+
, {
|
|
84
|
+
children: [imageArray.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
85
|
+
className: "prev",
|
|
86
|
+
onClick: function onClick(e) {
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
goToPrevSlide();
|
|
89
|
+
},
|
|
90
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ArrowBackIos.default, {})
|
|
91
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
92
|
+
className: "slide-container",
|
|
93
|
+
children: imageArray.length ? imageArray.map(function (img, index) {
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
95
|
+
className: "image-container slide ".concat(index === currentIndex ? "active" : ""),
|
|
96
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactImageFallback.default, {
|
|
97
|
+
src: "https://".concat(process.env.REACT_APP_IMAGES_BUCKET, ".s3.amazonaws.com/").concat(img.src),
|
|
98
|
+
fallbackImage: _Spinner.default,
|
|
99
|
+
alt: img === null || img === void 0 ? void 0 : img.name,
|
|
100
|
+
style: {
|
|
101
|
+
transform: "translateX(-".concat(currentIndex * 100, "%)")
|
|
102
|
+
}
|
|
103
|
+
}, index)
|
|
104
|
+
}, index);
|
|
105
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
106
|
+
src: _defaultProductImage.default,
|
|
107
|
+
alt: "not image"
|
|
108
|
+
})
|
|
109
|
+
}), imageArray.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
110
|
+
className: "next",
|
|
111
|
+
onClick: function onClick(e) {
|
|
112
|
+
e.stopPropagation();
|
|
113
|
+
goToNextSlide();
|
|
114
|
+
},
|
|
115
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ArrowBackIos.default, {})
|
|
116
|
+
})]
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
exports.ImageCarousel = ImageCarousel;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _templateObject;
|
|
15
|
+
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 174px;\n height: 175px;\n border-radius: 5px 5px 0px 0px;\n position: relative;\n overflow: hidden;\n display: flex;\n background-color: #f0f0f0;\n\n .slide-container {\n display: flex;\n width: 100%;\n\n .image-container {\n width: 100%;\n height: 100%;\n\n img {\n width: 100%;\n height: 100%;\n object-fit: fill;\n }\n\n &.slide {\n flex: 0 0 100%;\n opacity: 0;\n transition: opacity 0.5s ease-in-out;\n\n &.active {\n opacity: 1;\n }\n }\n }\n\n & > img {\n width: 100%;\n }\n }\n\n button {\n position: absolute;\n top: 0;\n border: none;\n cursor: pointer;\n background-color: transparent;\n color: white;\n z-index: 1;\n height: 100%;\n width: 30px;\n\n svg {\n font-size: 24px;\n }\n\n &.prev {\n left: 0;\n\n &:hover {\n background: linear-gradient(90deg, darkgray, transparent);\n }\n }\n &.next {\n right: 0;\n\n svg {\n transform: rotate(180deg);\n }\n &:hover {\n background: linear-gradient(-90deg, darkgray, transparent);\n }\n }\n }\n\n button:focus {\n outline: none;\n }\n"])));
|
|
17
|
+
|
|
18
|
+
exports.Container = Container;
|
|
@@ -15,7 +15,7 @@ var _variables = require("../../../global-files/variables");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .quill {\n background-color: ", ";\n border: 1px solid\n ", ";\n position: relative;\n border-radius: 2px;\n\n .ql-toolbar {\n background-color: ", ";\n position: absolute;\n z-index: 10;\n border: 1px solid ", ";\n width: 45px;\n height: 45px;\n border-radius: 4px;\n visibility: ", ";\n top: ", "px;\n left: ", "px;\n }\n\n .ql-container {\n border: none;\n font-family: ", ";\n color: ", ";\n strong {\n font-family: ", ";\n }\n }\n }\n .description-limit {\n font-size: 12px;\n font-family: ", ";\n color: ", ";\n text-align: right;\n }\n"])), _variables.GlobalColors.white, function (_ref) {
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .quill {\n background-color: ", ";\n border: 1px solid\n ", ";\n position: relative;\n border-radius: 2px;\n\n .ql-toolbar {\n background-color: ", ";\n position: absolute;\n z-index: 10;\n border: 1px solid ", ";\n width: 45px;\n height: 45px;\n border-radius: 4px;\n visibility: ", ";\n top: ", "px;\n left: ", "px;\n }\n\n .ql-container {\n border: none;\n font-family: ", ";\n color: ", ";\n strong {\n font-family: ", ";\n }\n }\n }\n .description-limit {\n font-size: 12px;\n font-family: ", ";\n color: ", ";\n text-align: right;\n margin-top: 5px;\n }\n"])), _variables.GlobalColors.white, function (_ref) {
|
|
19
19
|
var focus = _ref.focus,
|
|
20
20
|
isRequired = _ref.isRequired;
|
|
21
21
|
return focus ? _variables.GlobalColors.magenta_s2 : isRequired ? "red" : _variables.GlobalColors.s3;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.PercentTagDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _ = require(".");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/atoms/PercentTag",
|
|
18
|
+
component: _.PercentTag
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.PercentTag, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var PercentTagDefault = Template.bind({});
|
|
27
|
+
exports.PercentTagDefault = PercentTagDefault;
|
|
28
|
+
PercentTagDefault.args = {
|
|
29
|
+
percent: 88,
|
|
30
|
+
progressBarType: "AA"
|
|
31
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PercentTag = void 0;
|
|
7
|
+
|
|
8
|
+
var _styles = require("./styles");
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
var PercentTag = function PercentTag(_ref) {
|
|
13
|
+
var percent = _ref.percent,
|
|
14
|
+
progressBarType = _ref.progressBarType;
|
|
15
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
16
|
+
className: "status-".concat(progressBarType),
|
|
17
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
18
|
+
children: [percent, "%"]
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.PercentTag = PercentTag;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n display: inline-block;\n padding: 0 10px;\n border-radius: 5px;\n font-family: ", ";\n font-weight: 600;\n font-size: 12px;\n line-height: 20px;\n color: ", ";\n\n &.status-CA,\n &.status-IE {\n background-color: ", ";\n }\n\n &.status-R,\n &.status-AS,\n &.status-PA {\n background-color: ", ";\n }\n\n &.status-AA,\n &.status-AP,\n &.status-ACA,\n &.status-AC {\n background-color: ", ";\n }\n\n &.status-RA,\n &.status-RC,\n &.status-RP,\n &.status-RCA {\n background-color: ", ";\n }\n\n &.status-Dat,\n &.status-Dsc,\n &.status-Imgs {\n background-color: ", ";\n }\n\n &.status-Ex {\n background-color: ", ";\n }\n\n &.status-DDI {\n background-color: ", ";\n }\n\n &.status-GLD {\n background-color: ", ";\n }\n\n &.status-TAB {\n background-color: ", ";\n }\n\n &.status-Pt {\n background-color: ", ";\n color: ", ";\n }\n"])), _variables.GlobalColors.s3, _variables.FontFamily.Lato, function (backgroundColor) {
|
|
19
|
+
return backgroundColor === "s2" || backgroundColor === "s1" ? _variables.GlobalColors.s4 : _variables.GlobalColors.white;
|
|
20
|
+
}, _variables.GlobalColors.in_progress, _variables.GlobalColors.reception, _variables.GlobalColors.finished, _variables.GlobalColors.rejected_status, _variables.GlobalColors.s4, _variables.GlobalColors.exported, _variables.GlobalColors.original_purpura, _variables.GlobalColors.in_progress, _variables.GlobalColors.deep_gray, _variables.GlobalColors.s2, _variables.GlobalColors.s4);
|
|
21
|
+
|
|
22
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.RatingStarsDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _ = require(".");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/atoms/RatingStars",
|
|
18
|
+
component: _.RatingStars
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.RatingStars, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var RatingStarsDefault = Template.bind({});
|
|
27
|
+
exports.RatingStarsDefault = RatingStarsDefault;
|
|
28
|
+
RatingStarsDefault.args = {
|
|
29
|
+
percent: 80
|
|
30
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.RatingStars = void 0;
|
|
9
|
+
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _styles = require("./styles");
|
|
15
|
+
|
|
16
|
+
var _freeRegularSvgIcons = require("@fortawesome/free-regular-svg-icons");
|
|
17
|
+
|
|
18
|
+
var _reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
19
|
+
|
|
20
|
+
var _react = require("react");
|
|
21
|
+
|
|
22
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
+
|
|
24
|
+
var RatingStars = function RatingStars(_ref) {
|
|
25
|
+
var _ref$ratingValue = _ref.ratingValue,
|
|
26
|
+
ratingValue = _ref$ratingValue === void 0 ? 0 : _ref$ratingValue;
|
|
27
|
+
|
|
28
|
+
var _useState = (0, _react.useState)(0),
|
|
29
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
30
|
+
rating = _useState2[0],
|
|
31
|
+
setRating = _useState2[1];
|
|
32
|
+
|
|
33
|
+
var handleRating = function handleRating(value) {
|
|
34
|
+
setRating(value);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
(0, _react.useEffect)(function () {
|
|
38
|
+
setRating(ratingValue);
|
|
39
|
+
}, []);
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
41
|
+
children: (0, _toConsumableArray2.default)(Array(5)).map(function (_, index) {
|
|
42
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
43
|
+
className: "star ".concat(index < rating ? "active" : ""),
|
|
44
|
+
onClick: function onClick() {
|
|
45
|
+
return handleRating(index + 1);
|
|
46
|
+
},
|
|
47
|
+
children: "\u2605"
|
|
48
|
+
}, index);
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
exports.RatingStars = RatingStars;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Container = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _templateObject;
|
|
15
|
+
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n font-size: 10px;\n display: flex;\n align-items: center;\n\n .star {\n cursor: pointer;\n font-size: 12px;\n color: #d9d9d9;\n transition: color 0.3s;\n line-height: 10px;\n\n &:hover {\n color: gold;\n }\n\n &.active {\n transform: scale(1.2);\n color: #8a6caa;\n }\n\n &:not(:first-child) {\n margin-left: 5px;\n }\n }\n"])));
|
|
17
|
+
|
|
18
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.RetailerCatalogDefault = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _ = require(".");
|
|
13
|
+
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: "Components/atoms/RetailerCatalog",
|
|
18
|
+
component: _.RetailerCatalog
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.RetailerCatalog, (0, _objectSpread2.default)({}, args));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var RetailerCatalogDefault = Template.bind({});
|
|
27
|
+
exports.RetailerCatalogDefault = RetailerCatalogDefault;
|
|
28
|
+
RetailerCatalogDefault.args = {
|
|
29
|
+
limit: 3,
|
|
30
|
+
articleId: 39474,
|
|
31
|
+
orderId: 15270,
|
|
32
|
+
retailers: [{
|
|
33
|
+
id: 58,
|
|
34
|
+
name: "The Home Depot Golden"
|
|
35
|
+
}, {
|
|
36
|
+
id: 59,
|
|
37
|
+
name: "The Home Depot Platinum"
|
|
38
|
+
}, {
|
|
39
|
+
id: 60,
|
|
40
|
+
name: "The Home Depot Resizing"
|
|
41
|
+
}, {
|
|
42
|
+
id: 61,
|
|
43
|
+
name: "Home Depot TAB"
|
|
44
|
+
}, {
|
|
45
|
+
id: 68,
|
|
46
|
+
name: "The Home Depot Dropship"
|
|
47
|
+
}]
|
|
48
|
+
};
|