@trafilea/afrodita-components 5.0.0-beta.210 → 5.0.0-beta.212

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
@@ -1857,8 +1857,9 @@ interface RadioGroupInputProps {
1857
1857
  onChange: (value: RadioGroupOption) => void;
1858
1858
  size?: ComponentSize.Small | ComponentSize.Medium | ComponentSize.Large;
1859
1859
  disabled?: boolean;
1860
+ style?: React.CSSProperties;
1860
1861
  }
1861
- declare const RadioGroupInput: ({ name, options, value, onChange, size, disabled, }: RadioGroupInputProps) => JSX.Element;
1862
+ declare const RadioGroupInput: ({ style, name, options, value, onChange, size, disabled, }: RadioGroupInputProps) => JSX.Element;
1862
1863
 
1863
1864
  interface SimpleProps {
1864
1865
  title: string;
@@ -2076,8 +2077,9 @@ declare const OrderBar: ({ message, color }: OrderBarProps) => JSX.Element;
2076
2077
  interface TableProps$1 {
2077
2078
  headers: string[];
2078
2079
  data: string[][];
2080
+ className?: string;
2079
2081
  }
2080
- declare const SizeTable: ({ headers, data }: TableProps$1) => JSX.Element;
2082
+ declare const SizeTable: ({ headers, data, className }: TableProps$1) => JSX.Element;
2081
2083
 
2082
2084
  interface TableProps {
2083
2085
  headers: string[];
@@ -2448,8 +2450,9 @@ interface RadioProps {
2448
2450
  checked?: boolean;
2449
2451
  disabled?: boolean;
2450
2452
  onChange: (option: RadioGroupOption) => void;
2453
+ style?: React.CSSProperties;
2451
2454
  }
2452
- declare const RadioInput: ({ name, value, id, label, checked, disabled, onChange, size, }: RadioProps) => JSX.Element;
2455
+ declare const RadioInput: ({ style, name, value, id, label, checked, disabled, onChange, size, }: RadioProps) => JSX.Element;
2453
2456
 
2454
2457
  declare type PortalProps = {
2455
2458
  id: string;
@@ -5150,7 +5150,7 @@ var H3$2 = newStyled.h3(templateObject_2$S || (templateObject_2$S = __makeTempla
5150
5150
  var DiscountTag = function (_a) {
5151
5151
  var discount = _a.discount, offText = _a.offText, disabled = _a.disabled, _b = _a.backgroundColor, backgroundColor = _b === void 0 ? '#fff' : _b, _c = _a.borderColor, borderColor = _c === void 0 ? 'transparent' : _c, _d = _a.textColor, textColor = _d === void 0 ? '#fff' : _d, _e = _a.size, size = _e === void 0 ? ComponentSize.Medium : _e, style = _a.style;
5152
5152
  var theme = useTheme();
5153
- return (jsx$1(Container$V, __assign$1({ backgroundColor: disabled ? theme.colors.shades['50'].color : backgroundColor, borderColor: disabled ? theme.colors.shades['50'].color : borderColor, size: size, "data-testid": "discount-container" }, { children: jsxs$1(H3$2, __assign$1({ textColor: disabled ? theme.colors.shades['250'].color : textColor, size: size, style: style }, { children: [discount, "% ", offText] }), void 0) }), void 0));
5153
+ return (jsx$1(Container$V, __assign$1({ backgroundColor: disabled ? theme.colors.shades['50'].color : backgroundColor, borderColor: disabled ? theme.colors.shades['50'].color : borderColor, size: size, "data-testid": "discount-container", style: style }, { children: jsxs$1(H3$2, __assign$1({ textColor: disabled ? theme.colors.shades['250'].color : textColor, size: size, style: style }, { children: [discount, offText] }), void 0) }), void 0));
5154
5154
  };
5155
5155
  var templateObject_1$1k, templateObject_2$S;
5156
5156
 
@@ -12104,25 +12104,25 @@ var StyledLabel$1 = newStyled(Label$4)(templateObject_3$B || (templateObject_3$B
12104
12104
  return theme.component.radio.lineHeight;
12105
12105
  });
12106
12106
  var RadioInput = function (_a) {
12107
- var name = _a.name, value = _a.value, id = _a.id, label = _a.label, _b = _a.checked, checked = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, onChange = _a.onChange, _d = _a.size, size = _d === void 0 ? ComponentSize.Medium : _d;
12107
+ var style = _a.style, name = _a.name, value = _a.value, id = _a.id, label = _a.label, _b = _a.checked, checked = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, onChange = _a.onChange, _d = _a.size, size = _d === void 0 ? ComponentSize.Medium : _d;
12108
12108
  var theme = useTheme();
12109
12109
  var handleChange = function (event, label) {
12110
12110
  var value = event.currentTarget.value;
12111
12111
  onChange({ value: value, label: label });
12112
12112
  };
12113
- return (jsxs$1(Wrapper$4, { children: [jsxs$1(Container$K, __assign$1({ theme: theme, size: size, "data-testid": "container" }, { children: [jsx$1(Input$2, { id: "".concat(name, "-").concat(id), type: "radio", name: name, value: value, checked: checked, onChange: function (e) { return (disabled ? null : handleChange(e, label)); }, disabled: disabled }, void 0), jsx$1(CustomRadio, { size: size, isChecked: checked, disabled: disabled, theme: theme, "data-testid": "custom-radio" }, void 0)] }), void 0), jsx$1(StyledLabel$1, __assign$1({ htmlFor: "".concat(name, "-").concat(id), "data-testid": "label", variant: "regular", size: size, disabled: disabled }, { children: label }), void 0)] }, void 0));
12113
+ return (jsxs$1(Wrapper$4, { children: [jsxs$1(Container$K, __assign$1({ theme: theme, size: size, style: style, "data-testid": "container" }, { children: [jsx$1(Input$2, { id: "".concat(name, "-").concat(id), type: "radio", name: name, value: value, checked: checked, onChange: function (e) { return (disabled ? null : handleChange(e, label)); }, disabled: disabled, style: style }, void 0), jsx$1(CustomRadio, { size: size, isChecked: checked, disabled: disabled, theme: theme, "data-testid": "custom-radio", style: style }, void 0)] }), void 0), jsx$1(StyledLabel$1, __assign$1({ htmlFor: "".concat(name, "-").concat(id), "data-testid": "label", variant: "regular", size: size, disabled: disabled }, { children: label }), void 0)] }, void 0));
12114
12114
  };
12115
12115
  var templateObject_1$13, templateObject_2$K, templateObject_3$B;
12116
12116
 
12117
12117
  var RadioGroupInput = function (_a) {
12118
- var name = _a.name, _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? ComponentSize.Medium : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d;
12118
+ var style = _a.style, name = _a.name, _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? ComponentSize.Medium : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d;
12119
12119
  var _e = useState(value), selectedInput = _e[0], setSelectedInput = _e[1];
12120
12120
  var handleChange = function (selected) {
12121
12121
  setSelectedInput(selected);
12122
12122
  onChange(selected);
12123
12123
  };
12124
12124
  return (jsx$1("div", __assign$1({ "data-testid": "group-container" }, { children: options.map(function (option, index) {
12125
- return (jsx$1(RadioInput, { id: "".concat(index), name: name, value: option.value, label: option.label, onChange: function (option) { return handleChange(option); }, checked: option.value === (selectedInput === null || selectedInput === void 0 ? void 0 : selectedInput.value), size: size, disabled: disabled, "data-testid": "input" }, index));
12125
+ return (jsx$1(RadioInput, { id: "".concat(index), name: name, value: option.value, label: option.label, onChange: function (option) { return handleChange(option); }, checked: option.value === (selectedInput === null || selectedInput === void 0 ? void 0 : selectedInput.value), size: size, disabled: disabled, "data-testid": "input", style: style }, index));
12126
12126
  }) }), void 0));
12127
12127
  };
12128
12128
 
@@ -12648,9 +12648,9 @@ var TableCell$1 = newStyled.td(templateObject_2$w || (templateObject_2$w = __mak
12648
12648
  var TableHead$1 = newStyled.th(templateObject_3$t || (templateObject_3$t = __makeTemplateObject(["\n border-bottom: 0.063rem solid ", ";\n border-right: 0.063rem solid ", ";\n font-weight: 700;\n\n &:last-child {\n border-right: none;\n }\n"], ["\n border-bottom: 0.063rem solid ", ";\n border-right: 0.063rem solid ", ";\n font-weight: 700;\n\n &:last-child {\n border-right: none;\n }\n"])), function (props) { return props.borderColor; }, function (props) { return props.borderColor; });
12649
12649
  var TableRow$1 = newStyled.tr(templateObject_4$k || (templateObject_4$k = __makeTemplateObject(["\n &:last-child {\n td {\n border-bottom: none;\n }\n }\n\n &.background {\n background-color: ", ";\n }\n"], ["\n &:last-child {\n td {\n border-bottom: none;\n }\n }\n\n &.background {\n background-color: ", ";\n }\n"])), function (props) { return props.backgroundColor; });
12650
12650
  var SizeTable = function (_a) {
12651
- var headers = _a.headers, data = _a.data;
12651
+ var headers = _a.headers, data = _a.data, className = _a.className;
12652
12652
  var theme = useTheme();
12653
- return (jsxs$1(TableElement$1, __assign$1({ color: theme.colors.shades['700'].color, borderColor: theme.colors.shades['100'].color }, { children: [jsx$1("thead", { children: jsx$1(TableRow$1, __assign$1({ backgroundColor: theme.colors.shades['10'].color }, { children: headers.map(function (header, index) { return (jsx$1(TableHead$1, __assign$1({ borderColor: theme.colors.shades['100'].color }, { children: header }), index)); }) }), void 0) }, void 0), jsx$1("tbody", { children: data.map(function (row, index) { return (jsx$1(TableRow$1, __assign$1({ className: index % 2 !== 0 ? '' : 'background', backgroundColor: theme.colors.shades['10'].color }, { children: row.map(function (cell, index) { return (jsx$1(TableCell$1, __assign$1({ borderColor: theme.colors.shades['100'].color }, { children: cell }), index)); }) }), index)); }) }, void 0)] }), void 0));
12653
+ return (jsxs$1(TableElement$1, __assign$1({ color: theme.colors.shades['700'].color, borderColor: theme.colors.shades['100'].color, className: className }, { children: [jsx$1("thead", { children: jsx$1(TableRow$1, __assign$1({ backgroundColor: theme.colors.shades['10'].color }, { children: headers.map(function (header, index) { return (jsx$1(TableHead$1, __assign$1({ borderColor: theme.colors.shades['100'].color }, { children: header }), index)); }) }), void 0) }, void 0), jsx$1("tbody", { children: data.map(function (row, index) { return (jsx$1(TableRow$1, __assign$1({ className: index % 2 !== 0 ? '' : 'background', backgroundColor: theme.colors.shades['10'].color }, { children: row.map(function (cell, index) { return (jsx$1(TableCell$1, __assign$1({ borderColor: theme.colors.shades['100'].color }, { children: cell }), index)); }) }), index)); }) }, void 0)] }), void 0));
12654
12654
  };
12655
12655
  var templateObject_1$N, templateObject_2$w, templateObject_3$t, templateObject_4$k;
12656
12656
 
package/build/index.js CHANGED
@@ -5176,7 +5176,7 @@ var H3$2 = newStyled.h3(templateObject_2$S || (templateObject_2$S = __makeTempla
5176
5176
  var DiscountTag = function (_a) {
5177
5177
  var discount = _a.discount, offText = _a.offText, disabled = _a.disabled, _b = _a.backgroundColor, backgroundColor = _b === void 0 ? '#fff' : _b, _c = _a.borderColor, borderColor = _c === void 0 ? 'transparent' : _c, _d = _a.textColor, textColor = _d === void 0 ? '#fff' : _d, _e = _a.size, size = _e === void 0 ? exports.ComponentSize.Medium : _e, style = _a.style;
5178
5178
  var theme = useTheme();
5179
- return (jsxRuntime.jsx(Container$V, __assign$1({ backgroundColor: disabled ? theme.colors.shades['50'].color : backgroundColor, borderColor: disabled ? theme.colors.shades['50'].color : borderColor, size: size, "data-testid": "discount-container" }, { children: jsxRuntime.jsxs(H3$2, __assign$1({ textColor: disabled ? theme.colors.shades['250'].color : textColor, size: size, style: style }, { children: [discount, "% ", offText] }), void 0) }), void 0));
5179
+ return (jsxRuntime.jsx(Container$V, __assign$1({ backgroundColor: disabled ? theme.colors.shades['50'].color : backgroundColor, borderColor: disabled ? theme.colors.shades['50'].color : borderColor, size: size, "data-testid": "discount-container", style: style }, { children: jsxRuntime.jsxs(H3$2, __assign$1({ textColor: disabled ? theme.colors.shades['250'].color : textColor, size: size, style: style }, { children: [discount, offText] }), void 0) }), void 0));
5180
5180
  };
5181
5181
  var templateObject_1$1k, templateObject_2$S;
5182
5182
 
@@ -12130,25 +12130,25 @@ var StyledLabel$1 = newStyled(Label$4)(templateObject_3$B || (templateObject_3$B
12130
12130
  return theme.component.radio.lineHeight;
12131
12131
  });
12132
12132
  var RadioInput = function (_a) {
12133
- var name = _a.name, value = _a.value, id = _a.id, label = _a.label, _b = _a.checked, checked = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, onChange = _a.onChange, _d = _a.size, size = _d === void 0 ? exports.ComponentSize.Medium : _d;
12133
+ var style = _a.style, name = _a.name, value = _a.value, id = _a.id, label = _a.label, _b = _a.checked, checked = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, onChange = _a.onChange, _d = _a.size, size = _d === void 0 ? exports.ComponentSize.Medium : _d;
12134
12134
  var theme = useTheme();
12135
12135
  var handleChange = function (event, label) {
12136
12136
  var value = event.currentTarget.value;
12137
12137
  onChange({ value: value, label: label });
12138
12138
  };
12139
- return (jsxRuntime.jsxs(Wrapper$4, { children: [jsxRuntime.jsxs(Container$K, __assign$1({ theme: theme, size: size, "data-testid": "container" }, { children: [jsxRuntime.jsx(Input$2, { id: "".concat(name, "-").concat(id), type: "radio", name: name, value: value, checked: checked, onChange: function (e) { return (disabled ? null : handleChange(e, label)); }, disabled: disabled }, void 0), jsxRuntime.jsx(CustomRadio, { size: size, isChecked: checked, disabled: disabled, theme: theme, "data-testid": "custom-radio" }, void 0)] }), void 0), jsxRuntime.jsx(StyledLabel$1, __assign$1({ htmlFor: "".concat(name, "-").concat(id), "data-testid": "label", variant: "regular", size: size, disabled: disabled }, { children: label }), void 0)] }, void 0));
12139
+ return (jsxRuntime.jsxs(Wrapper$4, { children: [jsxRuntime.jsxs(Container$K, __assign$1({ theme: theme, size: size, style: style, "data-testid": "container" }, { children: [jsxRuntime.jsx(Input$2, { id: "".concat(name, "-").concat(id), type: "radio", name: name, value: value, checked: checked, onChange: function (e) { return (disabled ? null : handleChange(e, label)); }, disabled: disabled, style: style }, void 0), jsxRuntime.jsx(CustomRadio, { size: size, isChecked: checked, disabled: disabled, theme: theme, "data-testid": "custom-radio", style: style }, void 0)] }), void 0), jsxRuntime.jsx(StyledLabel$1, __assign$1({ htmlFor: "".concat(name, "-").concat(id), "data-testid": "label", variant: "regular", size: size, disabled: disabled }, { children: label }), void 0)] }, void 0));
12140
12140
  };
12141
12141
  var templateObject_1$13, templateObject_2$K, templateObject_3$B;
12142
12142
 
12143
12143
  var RadioGroupInput = function (_a) {
12144
- var name = _a.name, _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? exports.ComponentSize.Medium : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d;
12144
+ var style = _a.style, name = _a.name, _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? exports.ComponentSize.Medium : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d;
12145
12145
  var _e = React$2.useState(value), selectedInput = _e[0], setSelectedInput = _e[1];
12146
12146
  var handleChange = function (selected) {
12147
12147
  setSelectedInput(selected);
12148
12148
  onChange(selected);
12149
12149
  };
12150
12150
  return (jsxRuntime.jsx("div", __assign$1({ "data-testid": "group-container" }, { children: options.map(function (option, index) {
12151
- return (jsxRuntime.jsx(RadioInput, { id: "".concat(index), name: name, value: option.value, label: option.label, onChange: function (option) { return handleChange(option); }, checked: option.value === (selectedInput === null || selectedInput === void 0 ? void 0 : selectedInput.value), size: size, disabled: disabled, "data-testid": "input" }, index));
12151
+ return (jsxRuntime.jsx(RadioInput, { id: "".concat(index), name: name, value: option.value, label: option.label, onChange: function (option) { return handleChange(option); }, checked: option.value === (selectedInput === null || selectedInput === void 0 ? void 0 : selectedInput.value), size: size, disabled: disabled, "data-testid": "input", style: style }, index));
12152
12152
  }) }), void 0));
12153
12153
  };
12154
12154
 
@@ -12674,9 +12674,9 @@ var TableCell$1 = newStyled.td(templateObject_2$w || (templateObject_2$w = __mak
12674
12674
  var TableHead$1 = newStyled.th(templateObject_3$t || (templateObject_3$t = __makeTemplateObject(["\n border-bottom: 0.063rem solid ", ";\n border-right: 0.063rem solid ", ";\n font-weight: 700;\n\n &:last-child {\n border-right: none;\n }\n"], ["\n border-bottom: 0.063rem solid ", ";\n border-right: 0.063rem solid ", ";\n font-weight: 700;\n\n &:last-child {\n border-right: none;\n }\n"])), function (props) { return props.borderColor; }, function (props) { return props.borderColor; });
12675
12675
  var TableRow$1 = newStyled.tr(templateObject_4$k || (templateObject_4$k = __makeTemplateObject(["\n &:last-child {\n td {\n border-bottom: none;\n }\n }\n\n &.background {\n background-color: ", ";\n }\n"], ["\n &:last-child {\n td {\n border-bottom: none;\n }\n }\n\n &.background {\n background-color: ", ";\n }\n"])), function (props) { return props.backgroundColor; });
12676
12676
  var SizeTable = function (_a) {
12677
- var headers = _a.headers, data = _a.data;
12677
+ var headers = _a.headers, data = _a.data, className = _a.className;
12678
12678
  var theme = useTheme();
12679
- return (jsxRuntime.jsxs(TableElement$1, __assign$1({ color: theme.colors.shades['700'].color, borderColor: theme.colors.shades['100'].color }, { children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsx(TableRow$1, __assign$1({ backgroundColor: theme.colors.shades['10'].color }, { children: headers.map(function (header, index) { return (jsxRuntime.jsx(TableHead$1, __assign$1({ borderColor: theme.colors.shades['100'].color }, { children: header }), index)); }) }), void 0) }, void 0), jsxRuntime.jsx("tbody", { children: data.map(function (row, index) { return (jsxRuntime.jsx(TableRow$1, __assign$1({ className: index % 2 !== 0 ? '' : 'background', backgroundColor: theme.colors.shades['10'].color }, { children: row.map(function (cell, index) { return (jsxRuntime.jsx(TableCell$1, __assign$1({ borderColor: theme.colors.shades['100'].color }, { children: cell }), index)); }) }), index)); }) }, void 0)] }), void 0));
12679
+ return (jsxRuntime.jsxs(TableElement$1, __assign$1({ color: theme.colors.shades['700'].color, borderColor: theme.colors.shades['100'].color, className: className }, { children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsx(TableRow$1, __assign$1({ backgroundColor: theme.colors.shades['10'].color }, { children: headers.map(function (header, index) { return (jsxRuntime.jsx(TableHead$1, __assign$1({ borderColor: theme.colors.shades['100'].color }, { children: header }), index)); }) }), void 0) }, void 0), jsxRuntime.jsx("tbody", { children: data.map(function (row, index) { return (jsxRuntime.jsx(TableRow$1, __assign$1({ className: index % 2 !== 0 ? '' : 'background', backgroundColor: theme.colors.shades['10'].color }, { children: row.map(function (cell, index) { return (jsxRuntime.jsx(TableCell$1, __assign$1({ borderColor: theme.colors.shades['100'].color }, { children: cell }), index)); }) }), index)); }) }, void 0)] }), void 0));
12680
12680
  };
12681
12681
  var templateObject_1$N, templateObject_2$w, templateObject_3$t, templateObject_4$k;
12682
12682
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Trafilea's Design System",
4
4
  "author": "Trafilea",
5
5
  "repository": "https://github.com/trafilea/afrodita-components",
6
- "version": "5.0.0-beta.210",
6
+ "version": "5.0.0-beta.212",
7
7
  "private": false,
8
8
  "main": "build/index.js",
9
9
  "style": "build/index.css",