@trafilea/afrodita-components 6.5.4 → 6.5.6

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.d.ts CHANGED
@@ -2295,8 +2295,9 @@ interface ColorPickerProps {
2295
2295
  label: string;
2296
2296
  onChange: (color: ColorPickerOption) => void;
2297
2297
  inline?: boolean;
2298
+ showCross?: boolean;
2298
2299
  }
2299
- declare const SingleColorPicker: ({ options, selectedValue, label, onChange, inline, }: ColorPickerProps) => _emotion_react_jsx_runtime.JSX.Element;
2300
+ declare const SingleColorPicker: ({ options, selectedValue, label, onChange, inline, showCross, }: ColorPickerProps) => _emotion_react_jsx_runtime.JSX.Element;
2300
2301
 
2301
2302
  interface CrossSellCheckboxProps extends rightToLeftProps {
2302
2303
  imageURL: string;
@@ -6335,10 +6335,10 @@ var Collection = {
6335
6335
  };
6336
6336
 
6337
6337
  var OneColorSelector = function (_a) {
6338
- var color = _a.color, selected = _a.selected, testId = _a.testId, noStock = _a.noStock;
6338
+ var color = _a.color, selected = _a.selected, testId = _a.testId, noStock = _a.noStock, _b = _a.showCross, showCross = _b === void 0 ? false : _b;
6339
6339
  var theme = useTheme();
6340
6340
  var outerBorder = selected ? theme.colors.shades['550'].color : 'none';
6341
- return (jsxs$1("svg", __assign$1({ width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", "data-testid": testId, style: { opacity: noStock ? 0.4 : 1 } }, { children: [jsx$1("circle", { cx: "16", cy: "16", r: "12", fill: color, stroke: "#9E9E9E", strokeWidth: "0.5" }, void 0), jsx$1("circle", { cx: "16", cy: "16", r: "15.5", stroke: outerBorder }, void 0)] }), void 0));
6341
+ return (jsxs$1("svg", __assign$1({ width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", "data-testid": testId, style: { opacity: noStock ? (showCross ? 1 : 0.4) : 1 } }, { children: [jsx$1("circle", { cx: "16", cy: "16", r: "12", fill: color, stroke: "#9E9E9E", strokeWidth: "0.5" }, void 0), jsx$1("circle", { cx: "16", cy: "16", r: "15.5", stroke: outerBorder }, void 0), showCross && noStock && (jsxs$1(Fragment$2, { children: [jsx$1("line", { x1: "10", y1: "10", x2: "22", y2: "22", stroke: "#9E9E9E", strokeWidth: "1" }, void 0), jsx$1("line", { x1: "10", y1: "22", x2: "22", y2: "10", stroke: "#9E9E9E", strokeWidth: "1" }, void 0)] }, void 0))] }), void 0));
6342
6342
  };
6343
6343
 
6344
6344
  var ThreeColorSelector = function (_a) {
@@ -6356,7 +6356,7 @@ var TwoColorSelector = function (_a) {
6356
6356
  };
6357
6357
 
6358
6358
  var ColorSelector = function (_a) {
6359
- var color = _a.color, selected = _a.selected, testId = _a.testId, noStock = _a.noStock;
6359
+ var color = _a.color, selected = _a.selected, testId = _a.testId, noStock = _a.noStock, _b = _a.showCross, showCross = _b === void 0 ? false : _b;
6360
6360
  var primaryColor = color[0], secondaryColor = color[1], tertiaryColor = color[2];
6361
6361
  if (tertiaryColor) {
6362
6362
  return (jsx$1(ThreeColorSelector, { primaryColor: primaryColor, secondaryColor: secondaryColor, tertiaryColor: tertiaryColor, selected: selected, testId: testId, noStock: noStock }, void 0));
@@ -6364,7 +6364,7 @@ var ColorSelector = function (_a) {
6364
6364
  if (secondaryColor) {
6365
6365
  return (jsx$1(TwoColorSelector, { secondaryColor: secondaryColor, primaryColor: primaryColor, selected: selected, testId: testId, noStock: noStock }, void 0));
6366
6366
  }
6367
- return (jsx$1(OneColorSelector, { color: primaryColor, selected: selected, testId: testId, noStock: noStock }, void 0));
6367
+ return (jsx$1(OneColorSelector, { color: primaryColor, selected: selected, testId: testId, noStock: noStock, showCross: showCross }, void 0));
6368
6368
  };
6369
6369
 
6370
6370
  var OutOfStock = function (_a) {
@@ -6449,14 +6449,15 @@ var MultiColorPicker = function (_a) {
6449
6449
  return (jsxs$1(ColorRadioGroup$1, __assign$1({ value: selectedColor, onChange: onChangeHandler }, { children: [jsx$1(ColorRadioGroup$1.Label, { label: label, values: valueLabels }, void 0), jsx$1(ColorRadioGroup$1.OptionsContainer, { children: renderOptions$1(selectedColor, options) }, void 0)] }), void 0));
6450
6450
  };
6451
6451
 
6452
- var renderOptions = function (options) {
6452
+ var renderOptions = function (options, showCross) {
6453
+ if (showCross === void 0) { showCross = false; }
6453
6454
  if (options.length === 0) {
6454
6455
  return jsx(OutOfStock, { title: "out of stock color" }, void 0);
6455
6456
  }
6456
6457
  return options.map(function (option) { return (jsx(ColorRadioGroup$1.Option, __assign$1({ value: option }, { children: function (_a) {
6457
6458
  var checked = _a.checked;
6458
6459
  if (option.meta.color) {
6459
- return (jsx(ColorSelector, { color: option.meta.color, selected: checked, testId: "".concat(option.label.split(' ').join('-').toLowerCase(), "-selector"), noStock: option.noStock }, void 0));
6460
+ return (jsx(ColorSelector, { color: option.meta.color, selected: checked, testId: "".concat(option.label.split(' ').join('-').toLowerCase(), "-selector"), noStock: option.noStock, showCross: showCross }, void 0));
6460
6461
  }
6461
6462
  if (option.meta.pattern) {
6462
6463
  return (jsx(PatternSelector, { url: option.meta.pattern.url, selected: checked, noStock: option.noStock }, void 0));
@@ -6465,8 +6466,8 @@ var renderOptions = function (options) {
6465
6466
  } }), option.label)); });
6466
6467
  };
6467
6468
  var SingleColorPicker = function (_a) {
6468
- var options = _a.options, selectedValue = _a.selectedValue, label = _a.label, onChange = _a.onChange, _b = _a.inline, inline = _b === void 0 ? false : _b;
6469
- return (jsxs(ColorRadioGroup$1, __assign$1({ value: selectedValue, onChange: onChange, css: { flexDirection: inline ? 'row' : 'column', alignItems: inline ? 'center' : 'start' } }, { children: [jsx(ColorRadioGroup$1.Label, { label: label, values: selectedValue && !inline ? selectedValue.label : undefined }, void 0), jsx(ColorRadioGroup$1.OptionsContainer, __assign$1({ css: { marginTop: inline ? '0' : '0.63rem', marginLeft: inline ? '1.5rem' : '0' }, "data-testid": "radio-group-options-container" }, { children: renderOptions(options) }), void 0)] }), void 0));
6469
+ var options = _a.options, selectedValue = _a.selectedValue, label = _a.label, onChange = _a.onChange, _b = _a.inline, inline = _b === void 0 ? false : _b, _c = _a.showCross, showCross = _c === void 0 ? false : _c;
6470
+ return (jsxs(ColorRadioGroup$1, __assign$1({ value: selectedValue, onChange: onChange, css: { flexDirection: inline ? 'row' : 'column', alignItems: inline ? 'center' : 'start' } }, { children: [jsx(ColorRadioGroup$1.Label, { label: label, values: selectedValue && !inline ? selectedValue.label : undefined }, void 0), jsx(ColorRadioGroup$1.OptionsContainer, __assign$1({ css: { marginTop: inline ? '0' : '0.63rem', marginLeft: inline ? '1.5rem' : '0' }, "data-testid": "radio-group-options-container" }, { children: renderOptions(options, showCross) }), void 0)] }), void 0));
6470
6471
  };
6471
6472
 
6472
6473
  var Wrapper$5 = newStyled.div(templateObject_1$17 || (templateObject_1$17 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 0.625rem 1.25rem;\n background-color: ", ";\n width: 36.875rem;\n max-width: 100%;\n border-radius: 0.5rem;\n\n img {\n margin-right: ", ";\n }\n"], ["\n display: flex;\n align-items: center;\n padding: 0.625rem 1.25rem;\n background-color: ", ";\n width: 36.875rem;\n max-width: 100%;\n border-radius: 0.5rem;\n\n img {\n margin-right: ", ";\n }\n"])), function (props) { return props.backgroundColor; }, function (props) { return (props.rightToLeft ? '0' : '1.25rem'); });