@trafilea/afrodita-components 5.0.0-beta.283 → 5.0.0-beta.285

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
@@ -2022,7 +2022,7 @@ interface CheckboxProps {
2022
2022
  backgroundColor?: string;
2023
2023
  variant: 'primary' | 'secondary' | 'color';
2024
2024
  }
2025
- declare const Checkbox: ({ disabled, onChange, size, text, checked, id, variant, blockUncheck, backgroundColor, }: CheckboxProps) => JSX.Element;
2025
+ declare const Checkbox: React.FC<CheckboxProps>;
2026
2026
 
2027
2027
  interface RadioProps$1 {
2028
2028
  name: string;
@@ -4773,29 +4773,14 @@ var Input$5 = newStyled.input(templateObject_2$12 || (templateObject_2$12 = __ma
4773
4773
  var Checkbox = function (_a) {
4774
4774
  var _b = _a.disabled, disabled = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? ComponentSize.Medium : _c, text = _a.text, _d = _a.checked, checked = _d === void 0 ? false : _d, id = _a.id, variant = _a.variant, blockUncheck = _a.blockUncheck, backgroundColor = _a.backgroundColor;
4775
4775
  var theme = useTheme();
4776
- var _e = useState(checked), isChecked = _e[0], setIsChecked = _e[1];
4777
- var mounted = useRef(false);
4778
- var handleChange = useCallback(function () {
4779
- if (disabled || (isChecked && blockUncheck)) {
4780
- return;
4781
- }
4782
- setIsChecked(function (checked) { return !checked; });
4783
- }, [blockUncheck, disabled, isChecked]);
4784
- useEffect(function () {
4785
- if (disabled || !mounted.current) {
4776
+ var handleChange = function (e) {
4777
+ if (disabled || (e.target.checked === false && blockUncheck)) {
4778
+ e.preventDefault();
4786
4779
  return;
4787
4780
  }
4788
- if (checked !== isChecked) {
4789
- onChange(isChecked);
4790
- }
4791
- }, [isChecked, onChange, disabled, checked]);
4792
- useEffect(function () {
4793
- setIsChecked(checked);
4794
- }, [checked]);
4795
- useEffect(function () {
4796
- mounted.current = true;
4797
- }, []);
4798
- return (jsxs$1(Container$13, { children: [jsx$1(Input$5, { type: "checkbox", checked: isChecked, disabled: disabled, onChange: handleChange, id: id }, void 0), jsx$1(CustomCheckbox, __assign$1({ theme: theme, size: size, disabled: disabled, isChecked: isChecked, "data-testid": "checkbox", variant: variant, backgroundColor: backgroundColor, text: text }, { children: isChecked && jsx$1(Icon.Actions.Check, { fill: "#fff" }, void 0) }), void 0), jsx$1(Label$4, __assign$1({ "data-testid": "checkbox-text", size: size, variant: isChecked ? 'demi' : 'regular', htmlFor: id, disabled: disabled }, { children: text }), void 0)] }, void 0));
4781
+ onChange(e.target.checked);
4782
+ };
4783
+ return (jsxs$1(Container$13, { children: [jsx$1(Input$5, { type: "checkbox", checked: checked, disabled: disabled, onChange: handleChange, id: id }, void 0), jsx$1(CustomCheckbox, __assign$1({ theme: theme, size: size, disabled: disabled, isChecked: checked, "data-testid": "checkbox", variant: variant, backgroundColor: backgroundColor, text: text }, { children: checked && jsx$1(Icon.Actions.Check, { fill: "#fff" }, void 0) }), void 0), jsx$1(Label$4, __assign$1({ "data-testid": "checkbox-text", size: size, variant: checked ? 'demi' : 'regular', htmlFor: id, disabled: disabled }, { children: text }), void 0)] }, void 0));
4799
4784
  };
4800
4785
  var templateObject_1$1z, templateObject_2$12;
4801
4786
 
@@ -13032,10 +13017,10 @@ var Col$1 = newStyled.div(templateObject_4$p || (templateObject_4$p = __makeTemp
13032
13017
  textAlign: ['center', 'inherit'],
13033
13018
  width: ['100%', 'inherit'],
13034
13019
  }));
13035
- var IconContainer$2 = newStyled.div(templateObject_5$g || (templateObject_5$g = __makeTemplateObject(["\n width: 1.375rem;\n height: 1.375rem;\n ", "\n"], ["\n width: 1.375rem;\n height: 1.375rem;\n ", "\n"])), mediaQueries({
13020
+ var IconContainer$2 = newStyled.div(templateObject_5$g || (templateObject_5$g = __makeTemplateObject(["\n width: 1.5rem;\n height: 1.5rem;\n ", "\n"], ["\n width: 1.5rem;\n height: 1.5rem;\n ", "\n"])), mediaQueries({
13036
13021
  marginRight: ['0', '0.438rem'],
13037
13022
  marginBottom: ['10px', '0'],
13038
- width: ['auto', '1.375rem'],
13023
+ width: ['auto', '1.5rem'],
13039
13024
  }));
13040
13025
  var SectionTitle = newStyled.h1(templateObject_6$f || (templateObject_6$f = __makeTemplateObject(["\n ", "\n ", "\n margin: 0;\n text-transform: uppercase;\n"], ["\n ", "\n ", "\n margin: 0;\n text-transform: uppercase;\n"])), mediaQueries({
13041
13026
  display: ['block', 'flex'],
@@ -13058,7 +13043,7 @@ var KeepMeUpdated = newStyled.h1(templateObject_8$7 || (templateObject_8$7 = __m
13058
13043
  var DeliveryDetails = function (_a) {
13059
13044
  var deliveryDetailsText = _a.deliveryDetailsText, arrivingBy = _a.arrivingBy, shippingTo = _a.shippingTo, instantOrderUpdate = _a.instantOrderUpdate, note = _a.note;
13060
13045
  var theme = useTheme();
13061
- return (jsxs$1("div", __assign$1({ "data-testid": "DeliveryDetails" }, { children: [jsx$1(Title$5, __assign$1({ color: theme.colors.shades[700].color }, { children: deliveryDetailsText }), void 0), jsx$1(Line, { backgroundColor: theme.colors.shades['200'].color }, void 0), note && jsx$1(Note, __assign$1({}, note), void 0), jsxs$1(Row$1, __assign$1({ "data-testid": "DD-row", theme: theme }, { children: [jsxs$1(Col$1, __assign$1({ theme: theme }, { children: [jsxs$1(SectionTitle, __assign$1({ theme: theme }, { children: [jsx$1(IconContainer$2, __assign$1({ theme: theme }, { children: jsx$1(Icon.PDP.Clock, { width: 1.375 }, void 0) }), void 0), arrivingBy.title] }), void 0), jsx$1(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: arrivingBy.details }), void 0)] }), void 0), jsxs$1(Col$1, __assign$1({ theme: theme }, { children: [jsxs$1(SectionTitle, __assign$1({ theme: theme }, { children: [jsx$1(IconContainer$2, __assign$1({ theme: theme }, { children: jsx$1(Icon.Navigation.MapMarker, { width: 1.375 }, void 0) }), void 0), shippingTo.title] }), void 0), jsx$1(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: shippingTo.details }), void 0)] }), void 0), jsxs$1(Col$1, __assign$1({ theme: theme }, { children: [jsxs$1(SectionTitle, __assign$1({ theme: theme }, { children: [jsx$1(IconContainer$2, __assign$1({ theme: theme }, { children: jsx$1(Icon.Messaging.Messenger, { width: 1.375 }, void 0) }), void 0), instantOrderUpdate.title] }), void 0), jsx$1(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: instantOrderUpdate.details }), void 0), instantOrderUpdate.keepMeUpdated && (jsxs$1(KeepMeUpdated, __assign$1({ onClick: instantOrderUpdate.keepMeUpdated.onClick, borderColor: theme.colors.shades['150'].color }, { children: [jsx$1(Icon.Messaging.Messenger, { width: 1, height: 1, fill: "#0078FF" }, void 0), instantOrderUpdate.keepMeUpdated.title] }), void 0))] }), void 0)] }), void 0)] }), void 0));
13046
+ return (jsxs$1("div", __assign$1({ "data-testid": "DeliveryDetails" }, { children: [jsx$1(Title$5, __assign$1({ color: theme.colors.shades[700].color }, { children: deliveryDetailsText }), void 0), jsx$1(Line, { backgroundColor: theme.colors.shades['200'].color }, void 0), note && jsx$1(Note, __assign$1({}, note), void 0), jsxs$1(Row$1, __assign$1({ "data-testid": "DD-row", theme: theme }, { children: [jsxs$1(Col$1, __assign$1({ theme: theme }, { children: [jsxs$1(SectionTitle, __assign$1({ theme: theme }, { children: [jsx$1(IconContainer$2, __assign$1({ theme: theme }, { children: jsx$1(Icon.PDP.Clock, { width: 1.5 }, void 0) }), void 0), arrivingBy.title] }), void 0), jsx$1(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: arrivingBy.details }), void 0)] }), void 0), jsxs$1(Col$1, __assign$1({ theme: theme }, { children: [jsxs$1(SectionTitle, __assign$1({ theme: theme }, { children: [jsx$1(IconContainer$2, __assign$1({ theme: theme }, { children: jsx$1(Icon.Navigation.MapMarker, { width: 1.5 }, void 0) }), void 0), shippingTo.title] }), void 0), jsx$1(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: shippingTo.details }), void 0)] }), void 0), jsxs$1(Col$1, __assign$1({ theme: theme }, { children: [jsxs$1(SectionTitle, __assign$1({ theme: theme }, { children: [jsx$1(IconContainer$2, __assign$1({ theme: theme }, { children: jsx$1(Icon.Messaging.Messenger, { width: 1.5 }, void 0) }), void 0), instantOrderUpdate.title] }), void 0), jsx$1(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: instantOrderUpdate.details }), void 0), instantOrderUpdate.keepMeUpdated && (jsxs$1(KeepMeUpdated, __assign$1({ onClick: instantOrderUpdate.keepMeUpdated.onClick, borderColor: theme.colors.shades['150'].color }, { children: [jsx$1(Icon.Messaging.Messenger, { width: 1, height: 1, fill: "#0078FF" }, void 0), instantOrderUpdate.keepMeUpdated.title] }), void 0))] }), void 0)] }), void 0)] }), void 0));
13062
13047
  };
13063
13048
  var templateObject_1$U, templateObject_2$D, templateObject_3$y, templateObject_4$p, templateObject_5$g, templateObject_6$f, templateObject_7$9, templateObject_8$7;
13064
13049