@trafilea/afrodita-components 5.0.0-beta.52 → 5.0.0-beta.53

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/build/index.js CHANGED
@@ -153,6 +153,11 @@ var SignOut = function (_a) {
153
153
  return (jsxRuntime.jsx(IconWrapper, __assign$1({ width: width, height: height, viewBoxX: 21, viewBoxY: 16, title: "Sign out" }, { children: jsxRuntime.jsx("path", { d: "M16.5939 15.5L13.3949 15.5C13.1435 15.5 12.9379 15.2891 12.9379 15.0313L12.9379 14.0938C12.9379 13.8359 13.1435 13.625 13.3949 13.625L16.5939 13.625C17.6032 13.625 18.422 12.7852 18.422 11.75L18.422 4.25C18.422 3.21484 17.6032 2.375 16.5939 2.375L13.3949 2.375C13.1435 2.375 12.9379 2.16406 12.9379 1.90625L12.9379 0.96875C12.9379 0.710937 13.1435 0.499999 13.3949 0.499999L16.5939 0.499998C18.6124 0.499998 20.25 2.17969 20.25 4.25L20.25 11.75C20.25 13.8203 18.6124 15.5 16.5939 15.5ZM7.7927 14.7383L8.53915 13.9727C8.72195 13.7852 8.71814 13.4844 8.53153 13.3047L4.22422 9.01563L13.6995 9.01563C13.9509 9.01563 14.1565 8.80469 14.1565 8.54688L14.1565 7.45312C14.1565 7.19531 13.9509 6.98437 13.6995 6.98437L4.22422 6.98438L8.53153 2.69922C8.71433 2.51562 8.71814 2.21484 8.53915 2.03125L7.7927 1.26563C7.6137 1.08203 7.32427 1.08203 7.14527 1.26563L0.88425 7.67188C0.705255 7.85547 0.705255 8.15234 0.88425 8.33594L7.14527 14.7422C7.32427 14.9219 7.6137 14.9219 7.7927 14.7383Z", fill: fill }, void 0) }), void 0));
154
154
  };
155
155
 
156
+ var Add = function (_a) {
157
+ var height = _a.height, width = _a.width, fill = _a.fill;
158
+ return (jsxRuntime.jsx(IconWrapper, __assign$1({ width: width, height: height, viewBoxX: 20, viewBoxY: 20, title: "add" }, { children: jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.75 0C9.05964 0 8.5 0.559644 8.5 1.25V8.5H1.25C0.559644 8.5 0 9.05964 0 9.75C0 10.4404 0.559644 11 1.25 11H8.5V18.75C8.5 19.4404 9.05964 20 9.75 20C10.4404 20 11 19.4404 11 18.75V11H18.75C19.4404 11 20 10.4404 20 9.75C20 9.05964 19.4404 8.5 18.75 8.5H11V1.25C11 0.559644 10.4404 0 9.75 0Z", fill: fill }, void 0) }), void 0));
159
+ };
160
+
156
161
  var Actions = /*#__PURE__*/Object.freeze({
157
162
  __proto__: null,
158
163
  Check: Check$1,
@@ -164,7 +169,8 @@ var Actions = /*#__PURE__*/Object.freeze({
164
169
  Trash: Trash,
165
170
  Warning: Warning,
166
171
  Edit: Edit,
167
- SignOut: SignOut
172
+ SignOut: SignOut,
173
+ Add: Add
168
174
  });
169
175
 
170
176
  var FitPredictor$1 = function (_a) {
@@ -4228,7 +4234,7 @@ var TAGS = {
4228
4234
  hero1: newStyled.h1(templateObject_1$16 || (templateObject_1$16 = __makeTemplateObject([""], [""]))),
4229
4235
  hero2: newStyled.h2(templateObject_2$I || (templateObject_2$I = __makeTemplateObject([""], [""]))),
4230
4236
  hero3: newStyled.h3(templateObject_3$v || (templateObject_3$v = __makeTemplateObject([""], [""]))),
4231
- display1: newStyled.h1(templateObject_4$m || (templateObject_4$m = __makeTemplateObject([""], [""]))),
4237
+ display1: newStyled.h1(templateObject_4$n || (templateObject_4$n = __makeTemplateObject([""], [""]))),
4232
4238
  display2: newStyled.h2(templateObject_5$d || (templateObject_5$d = __makeTemplateObject([""], [""]))),
4233
4239
  heading1: newStyled.h1(templateObject_6$8 || (templateObject_6$8 = __makeTemplateObject([""], [""]))),
4234
4240
  heading2: newStyled.h2(templateObject_7$5 || (templateObject_7$5 = __makeTemplateObject([""], [""]))),
@@ -4348,7 +4354,7 @@ var DEFAULTS = {
4348
4354
  size: 'regular',
4349
4355
  },
4350
4356
  };
4351
- var templateObject_1$16, templateObject_2$I, templateObject_3$v, templateObject_4$m, templateObject_5$d, templateObject_6$8, templateObject_7$5, templateObject_8$2, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17;
4357
+ var templateObject_1$16, templateObject_2$I, templateObject_3$v, templateObject_4$n, templateObject_5$d, templateObject_6$8, templateObject_7$5, templateObject_8$2, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17;
4352
4358
 
4353
4359
  var ButtonsContainer = newStyled.div(templateObject_1$15 || (templateObject_1$15 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n margin: ", ";\n"], ["\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n margin: ", ";\n"])), function (_a) {
4354
4360
  var inline = _a.inline;
@@ -4496,31 +4502,41 @@ var getStylesBySize$5 = function (size) {
4496
4502
  case exports.ComponentSize.Large:
4497
4503
  return {
4498
4504
  fontSize: '1.5rem',
4505
+ finalPricefontSize: '36px',
4506
+ finalPricefontSizeSmall: '18px',
4499
4507
  margin: '0 0 0 0.75rem',
4500
4508
  lineHeight: '2rem',
4501
4509
  };
4502
4510
  case exports.ComponentSize.Medium:
4503
4511
  return {
4504
4512
  fontSize: '1.125rem',
4513
+ finalPricefontSize: '32px',
4514
+ finalPricefontSizeSmall: '16px',
4505
4515
  margin: '0 0 0 0.5rem',
4506
4516
  lineHeight: '1.25rem',
4507
4517
  };
4508
4518
  case exports.ComponentSize.Small:
4509
4519
  return {
4510
4520
  fontSize: '1rem',
4521
+ finalPricefontSize: '24px',
4522
+ finalPricefontSizeSmall: '12px',
4511
4523
  margin: '0 0 0 0.5rem',
4512
4524
  lineHeight: '1.25rem',
4513
4525
  };
4514
4526
  }
4515
4527
  };
4516
4528
  var Container$E = newStyled.div(templateObject_1$11 || (templateObject_1$11 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
4517
- var Price = newStyled.h1(templateObject_2$F || (templateObject_2$F = __makeTemplateObject(["\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-decoration: ", ";\n margin: ", ";\n"], ["\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-decoration: ", ";\n margin: ", ";\n"])), function (_a) {
4529
+ var Price = newStyled.h1(templateObject_2$F || (templateObject_2$F = __makeTemplateObject(["\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-decoration: ", ";\n margin: ", ";\n margin-top: ", ";\n"], ["\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-decoration: ", ";\n margin: ", ";\n margin-top: ", ";\n"])), function (_a) {
4518
4530
  var weight = _a.weight;
4519
4531
  return (weight ? weight : '400');
4520
4532
  }, function (_a) {
4521
- var _b;
4522
- var size = _a.size;
4523
- return (_b = getStylesBySize$5(size)) === null || _b === void 0 ? void 0 : _b.fontSize;
4533
+ var _b, _c, _d;
4534
+ var size = _a.size, finalPriceStyled = _a.finalPriceStyled, finalPriceStyledSmall = _a.finalPriceStyledSmall;
4535
+ return finalPriceStyled || finalPriceStyledSmall
4536
+ ? finalPriceStyledSmall
4537
+ ? (_b = getStylesBySize$5(size)) === null || _b === void 0 ? void 0 : _b.finalPricefontSizeSmall
4538
+ : (_c = getStylesBySize$5(size)) === null || _c === void 0 ? void 0 : _c.finalPricefontSize
4539
+ : (_d = getStylesBySize$5(size)) === null || _d === void 0 ? void 0 : _d.fontSize;
4524
4540
  }, function (_a) {
4525
4541
  var _b;
4526
4542
  var size = _a.size;
@@ -4535,12 +4551,16 @@ var Price = newStyled.h1(templateObject_2$F || (templateObject_2$F = __makeTempl
4535
4551
  var _b;
4536
4552
  var margin = _a.margin, size = _a.size;
4537
4553
  return (margin ? (_b = getStylesBySize$5(size)) === null || _b === void 0 ? void 0 : _b.margin : '0');
4554
+ }, function (_a) {
4555
+ var finalPriceStyledSmall = _a.finalPriceStyledSmall, size = _a.size;
4556
+ return finalPriceStyledSmall ? (size === 'large' ? '-10px' : '-7px') : '0';
4538
4557
  });
4539
4558
  var TagContainer = newStyled.h1(templateObject_3$t || (templateObject_3$t = __makeTemplateObject(["\n margin: ", ";\n display: flex;\n align-items: center;\n"], ["\n margin: ", ";\n display: flex;\n align-items: center;\n"])), function (_a) {
4540
4559
  var _b;
4541
4560
  var size = _a.size;
4542
4561
  return (_b = getStylesBySize$5(size)) === null || _b === void 0 ? void 0 : _b.margin;
4543
4562
  });
4563
+ var FinalPriceContainer = newStyled.div(templateObject_4$m || (templateObject_4$m = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
4544
4564
  function getTestId() {
4545
4565
  var args = [];
4546
4566
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -4549,11 +4569,21 @@ function getTestId() {
4549
4569
  return args.filter(Boolean).join('-');
4550
4570
  }
4551
4571
  var PriceLabel = function (_a) {
4552
- var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, color = _a.color, testId = _a.testId, _b = _a.size, size = _b === void 0 ? exports.ComponentSize.Medium : _b;
4572
+ var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, color = _a.color, testId = _a.testId, _b = _a.finalPriceStyled, finalPriceStyled = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? exports.ComponentSize.Medium : _c;
4553
4573
  var theme = useTheme();
4554
- return (jsxRuntime.jsxs(Container$E, { children: [jsxRuntime.jsx(Price, __assign$1({ size: size, color: color || theme.colors.pallete.secondary.color, weight: 700, "data-testid": getTestId(testId, 'price') }, { children: finalPrice }), void 0), originalPrice && (jsxRuntime.jsx(Price, __assign$1({ size: size, color: theme.colors.shades['300'].color, margin: true, underlined: true, "data-testid": getTestId(testId, 'discount') }, { children: originalPrice }), void 0)), discount && (jsxRuntime.jsx(TagContainer, __assign$1({ size: size }, { children: jsxRuntime.jsx(DiscountTag, __assign$1({}, discount, { size: size }), void 0) }), void 0))] }, void 0));
4574
+ var finalPriceArray = ['', ''];
4575
+ if (typeof finalPrice === 'string' && finalPrice.includes('.') && finalPrice.includes('$'))
4576
+ finalPriceArray = finalPrice.split('$')[1].split('.');
4577
+ var availableFinalPriceStyled = finalPriceStyled && finalPriceArray[0];
4578
+ var priceCommonProps = {
4579
+ size: size,
4580
+ color: color || theme.colors.pallete.secondary.color,
4581
+ weight: 700,
4582
+ };
4583
+ var OriginalPrice = function () { return (jsxRuntime.jsx(Price, __assign$1({ size: size, color: theme.colors.shades['300'].color, margin: true, underlined: true, "data-testid": getTestId(testId, 'discount') }, { children: originalPrice }), void 0)); };
4584
+ return (jsxRuntime.jsxs(Container$E, { children: [availableFinalPriceStyled && originalPrice && jsxRuntime.jsx(OriginalPrice, {}, void 0), availableFinalPriceStyled ? (jsxRuntime.jsxs(FinalPriceContainer, __assign$1({ "data-testid": getTestId(testId, 'price') }, { children: [jsxRuntime.jsx(Price, __assign$1({ margin: true, finalPriceStyledSmall: true }, priceCommonProps, { children: "$" }), void 0), jsxRuntime.jsx(Price, __assign$1({ finalPriceStyled: true }, priceCommonProps, { children: finalPriceArray[0] }), void 0), jsxRuntime.jsx(Price, __assign$1({ finalPriceStyledSmall: true }, priceCommonProps, { children: finalPriceArray[1] }), void 0)] }), void 0)) : (jsxRuntime.jsxs(FinalPriceContainer, { children: [jsxRuntime.jsx(Price, __assign$1({ margin: true, "data-testid": getTestId(testId, 'price') }, priceCommonProps, { children: finalPrice }), void 0), originalPrice && jsxRuntime.jsx(OriginalPrice, {}, void 0)] }, void 0)), discount && (jsxRuntime.jsx(TagContainer, __assign$1({ size: size }, { children: jsxRuntime.jsx(DiscountTag, __assign$1({}, discount, { size: size }), void 0) }), void 0))] }, void 0));
4555
4585
  };
4556
- var templateObject_1$11, templateObject_2$F, templateObject_3$t;
4586
+ var templateObject_1$11, templateObject_2$F, templateObject_3$t, templateObject_4$m;
4557
4587
 
4558
4588
  var OneColorSelector = function (_a) {
4559
4589
  var color = _a.color, selected = _a.selected, testId = _a.testId;