@trafilea/afrodita-components 7.25.4 → 7.25.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/es/components/checkbox/Checkbox.js +1 -1
- package/build/es/components/gallery/components/ImageProductSlide/ImageProductSlide.js +1 -1
- package/build/index.d.ts +4 -2
- package/build/lib/components/checkbox/Checkbox.js +1 -1
- package/build/lib/components/gallery/components/ImageProductSlide/ImageProductSlide.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as e,__assign as o}from"tslib";import{jsxs as n,jsx as
|
|
1
|
+
import{__makeTemplateObject as e,__assign as o}from"tslib";import{jsxs as n,jsx as i}from"react/jsx-runtime";import t from"@emotion/styled";import{useTheme as r}from"../../core/theme/Theme.js";import{ComponentSize as a}from"../../types/enums.js";import{Icon as c}from"../icons/index.js";import s from"../shared/label/label.js";import{CustomCheckboxStyles as l}from"./styles.js";var d,u,h=t.div(d||(d=e(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n user-select: none;\n position: relative;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n user-select: none;\n position: relative;\n"]))),b=function(e,o){if(!e&&!o)return!1;var n=(null==e?void 0:e.toLowerCase().trim())||"",i=(null==o?void 0:o.toLowerCase().trim())||"";return n.includes("white")||"#fff"===n||"#ffffff"===n||"white"===n||"#daa070"===n||"#f1cb75"===n||n.includes("beige")||n.includes("latte")||n.includes("sand")||("white"===i||"beige"===i||"latte"===i||"sand"===i)},f=t.div(l.baseStyles,(function(e){var o,n=e.backgroundImage?"\n background-image: url(".concat(e.backgroundImage,");\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n "):"",i=e.backgroundColor?"background-color: ".concat(e.backgroundColor,";"):"",t=b(null===(o=e.backgroundColor)||void 0===o?void 0:o.toString(),e.text)?"\n svg {\n path {\n fill: var(--colors-shades-black-color);\n }\n }":"",r=e.hasHightligthBorder?"border: 0.27px var(--colors-shades-300-color) solid;":"";return[l[e.size](e.theme),l[e.variant](e.theme,e.isChecked,e.disabled),"\n ".concat(n,"\n ").concat(i,"\n ").concat(t,"\n ").concat(r)]})),g=t.input(u||(u=e(["\n position: absolute;\n height: 100%;\n width: 100%;\n margin: 0;\n opacity: 0;\n cursor: ",";\n\n &:focus-visible {\n outline: none;\n }\n\n &:focus-visible + div {\n outline: 2px solid var(--colors-shades-700-color);\n outline-offset: 2px;\n ","\n }\n"],["\n position: absolute;\n height: 100%;\n width: 100%;\n margin: 0;\n opacity: 0;\n cursor: ",";\n\n &:focus-visible {\n outline: none;\n }\n\n &:focus-visible + div {\n outline: 2px solid var(--colors-shades-700-color);\n outline-offset: 2px;\n ","\n }\n"])),(function(e){return e.disabled?"not-allowed":"pointer"}),(function(e){return e.$isColorVariant&&"border-radius: 50%;"})),m=function(e){var t=e.disabled,l=void 0!==t&&t,d=e.onChange,u=e.size,m=void 0===u?a.Medium:u,v=e.sizeLabel,p=void 0===v?a.Medium:v,k=e.colorLabel,x=e.text,C=e.checked,y=void 0!==C&&C,w=e.id,j=e.variant,z=e.blockUncheck,L=e.backgroundColor,I=e.backgroundImage,B=e.hasHightligthBorder,H=void 0!==B&&B,M=e.ariaLabel,S=r();return n(h,{children:[i(g,{type:"checkbox",checked:y,disabled:l,onChange:function(e){l||!1===e.target.checked&&z?e.preventDefault():d(e.target.checked)},id:w,"aria-label":M,$isColorVariant:"color"===j},void 0),i(f,o({theme:S,size:m,disabled:l,isChecked:y,"data-testid":"checkbox",variant:j,backgroundColor:L,backgroundImage:I,text:x,hasHightligthBorder:H},{children:y&&i(c.Actions.Check,{fill:b(L,x)?S.colors.shades.black.color:S.colors.shades.white.color},void 0)}),void 0),i(s,o({"data-testid":"checkbox-text",size:p,style:{color:k||S.colors.shades[700].color},variant:y?"demi":"regular",htmlFor:w,disabled:l},{children:x}),void 0)]},void 0)};export{m as Checkbox};
|
|
2
2
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsxs as i,Fragment as d,jsx as t}from"react/jsx-runtime";import{Icon as e}from"../../../icons/index.js";import{useZoom as l}from"../../../organisms/ModalZoom/useZoom.js";import{ZoomButtonComponent as r}from"../../../organisms/ModalZoom/ZoomButton.js";import{Video as a}from"../../../molecules/Video/Video.js";import{Container as n,InnerImageZoomStyled as v,ImageStyled as s,TopTagContainer as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsxs as i,Fragment as d,jsx as t}from"react/jsx-runtime";import{Icon as e}from"../../../icons/index.js";import{useZoom as l}from"../../../organisms/ModalZoom/useZoom.js";import{ZoomButtonComponent as r}from"../../../organisms/ModalZoom/ZoomButton.js";import{Video as a}from"../../../molecules/Video/Video.js";import{Container as n,InnerImageZoomStyled as v,ImageStyled as s,TopTagContainer as c,BottomTagContainer as m,TopRightTagWrapper as h,TopRightTagContainer as u,ButtonSecondaryOutlineWrapper as g,ChevronPrev as p,ChevronNext as z}from"./styled.js";var b=function(b){var f,y=b.content,w=b.topTag,x=b.topRightTag,C=b.bottomTag,j=b.testId,A=b.position,I=void 0===A?"vertical":A,V=b.borderRadiusVariant,M=b.ctaText,R=b.ctaAction,P=b.hideCTA,T=b.withZoom,Z=b.isRatioSquare,k=b.videoAutoplay,N=void 0!==k&&k,S=b.hideVideoControls,q=void 0!==S&&S,B=b.zoomOptions,F=b.isActive,H=void 0===F||F,L=b.zoomIconVariant,O=b.chevronsColor,U=void 0===O?"#000":O,E=b.onPrev,D=b.onNext,G=b.hasPrev,J=void 0!==G&&G,K=b.hasNext,Q=void 0!==K&&K,W=null==y?void 0:y.url,X=null!==(f=null==y?void 0:y.isVideo)&&void 0!==f&&f,Y=N||null==y?void 0:y.thumbnailUrl,$=q?{pointerEvents:"none"}:void 0,_=l((null==B?void 0:B.zoomModalId)||"zoom-modal-v1").handleZoomClick;return i(n,o({"data-testid":j,className:"stylefor".concat(I),borderRadiusVariant:V,position:I},{children:[!X&&i(d,{children:[T?i(d,{children:[t(v,{src:W,zoomSrc:(null==y?void 0:y.zoomUrl)||W,zoomType:(null==B?void 0:B.zoomModalId)?"click":"hover",imgAttributes:{alt:y.alt,style:{objectFit:"cover",objectPosition:"center"},loading:"eager",decoding:"sync",fetchpriority:"high"},width:"horizontal"==I?360:530,height:"horizontal"==I?480:720,hideHint:!0,isRatioSquare:Z,afterZoomIn:(null==B?void 0:B.zoomModalId)?_:void 0},void 0),L]},void 0):t(s,{width:"horizontal"==I?"360px":"530px",height:"auto",src:W,alt:y.alt,objectFit:"cover",loading:"eager",decoding:"sync",isRatioSquare:Z,fetchPriority:"high"},void 0),t(c,o({borderRadiusVariant:V},{children:w}),void 0),t(m,o({isCTAHidden:P},{children:C}),void 0),!!x&&t(h,{children:t(u,{children:x},void 0)},void 0)]},void 0),X&&t(a,{source:W,thumbnail:Y,autoPlay:N,muted:!0,loop:!0,withProgressBar:!q,style:$,isActive:H,lazyLoad:!1},void 0),M&&R&&t("div",o({style:{display:P?"none":"block"}},{children:t(g,{wide:!0,onClick:R,text:M},void 0)}),void 0),Boolean(null==B?void 0:B.zoomModalId)&&t(r,{modalId:(null==B?void 0:B.zoomModalId)||"zoom-modal-v1",showOnMobile:"v2"===(null==B?void 0:B.zoomVersion)},void 0),J&&E&&t(p,o({onClick:E,"aria-label":"Previous image"},{children:t(e.Arrows.ChevronLeft,{height:1.85,width:1.85,fill:U},void 0)}),void 0),Q&&D&&t(z,o({onClick:D,"aria-label":"Next image"},{children:t(e.Arrows.ChevronRight,{height:1.85,width:1.85,fill:U},void 0)}),void 0)]}),void 0)};export{b as ImageProductSlide};
|
|
2
2
|
//# sourceMappingURL=ImageProductSlide.js.map
|
package/build/index.d.ts
CHANGED
|
@@ -1364,11 +1364,12 @@ declare const AssetsProvider: FC<{
|
|
|
1364
1364
|
}>;
|
|
1365
1365
|
declare const useThemeAssets: () => ThemeAssets;
|
|
1366
1366
|
|
|
1367
|
+
declare type CheckboxSize = ComponentSize.Large | ComponentSize.Medium | ComponentSize.Small;
|
|
1367
1368
|
interface CheckboxProps {
|
|
1368
1369
|
disabled?: boolean;
|
|
1369
1370
|
onChange: (checked: boolean) => void;
|
|
1370
|
-
size?:
|
|
1371
|
-
sizeLabel?:
|
|
1371
|
+
size?: CheckboxSize;
|
|
1372
|
+
sizeLabel?: CheckboxSize;
|
|
1372
1373
|
colorLabel?: string;
|
|
1373
1374
|
text: string;
|
|
1374
1375
|
checked?: boolean;
|
|
@@ -1378,6 +1379,7 @@ interface CheckboxProps {
|
|
|
1378
1379
|
backgroundImage?: string;
|
|
1379
1380
|
variant: 'primary' | 'secondary' | 'color';
|
|
1380
1381
|
hasHightligthBorder?: boolean;
|
|
1382
|
+
ariaLabel?: string;
|
|
1381
1383
|
}
|
|
1382
1384
|
declare const Checkbox: react__default.FC<CheckboxProps>;
|
|
1383
1385
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),o=require("@emotion/styled"),t=require("../../core/theme/Theme.js"),i=require("../../types/enums.js"),r=require("../icons/index.js"),a=require("../shared/label/label.js"),s=require("./styles.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l,d,u=c(o),h=u.default.div(l||(l=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n user-select: none;\n position: relative;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n user-select: none;\n position: relative;\n"]))),b=function(e,n){if(!e&&!n)return!1;var o=(null==e?void 0:e.toLowerCase().trim())||"",t=(null==n?void 0:n.toLowerCase().trim())||"";return o.includes("white")||"#fff"===o||"#ffffff"===o||"white"===o||"#daa070"===o||"#f1cb75"===o||o.includes("beige")||o.includes("latte")||o.includes("sand")||("white"===t||"beige"===t||"latte"===t||"sand"===t)},f=u.default.div(s.CustomCheckboxStyles.baseStyles,(function(e){var n,o=e.backgroundImage?"\n background-image: url(".concat(e.backgroundImage,");\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n "):"",t=e.backgroundColor?"background-color: ".concat(e.backgroundColor,";"):"",i=b(null===(n=e.backgroundColor)||void 0===n?void 0:n.toString(),e.text)?"\n svg {\n path {\n fill: var(--colors-shades-black-color);\n }\n }":"",r=e.hasHightligthBorder?"border: 0.27px var(--colors-shades-300-color) solid;":"";return[s.CustomCheckboxStyles[e.size](e.theme),s.CustomCheckboxStyles[e.variant](e.theme,e.isChecked,e.disabled),"\n ".concat(o,"\n ").concat(t,"\n ").concat(i,"\n ").concat(r)]})),g=u.default.input(d||(d=e.__makeTemplateObject(["\n position: absolute;\n height: 100%;\n width: 100%;\n margin: 0;\n opacity: 0;\n cursor: ",";\n\n &:focus-visible {\n outline: none;\n }\n\n &:focus-visible + div {\n outline: 2px solid var(--colors-shades-700-color);\n outline-offset: 2px;\n ","\n }\n"],["\n position: absolute;\n height: 100%;\n width: 100%;\n margin: 0;\n opacity: 0;\n cursor: ",";\n\n &:focus-visible {\n outline: none;\n }\n\n &:focus-visible + div {\n outline: 2px solid var(--colors-shades-700-color);\n outline-offset: 2px;\n ","\n }\n"])),(function(e){return e.disabled?"not-allowed":"pointer"}),(function(e){return e.$isColorVariant&&"border-radius: 50%;"}));exports.Checkbox=function(o){var s=o.disabled,c=void 0!==s&&s,l=o.onChange,d=o.size,u=void 0===d?i.ComponentSize.Medium:d,v=o.sizeLabel,k=void 0===v?i.ComponentSize.Medium:v,m=o.colorLabel,p=o.text,x=o.checked,C=void 0!==x&&x,j=o.id,y=o.variant,w=o.blockUncheck,_=o.backgroundColor,q=o.backgroundImage,z=o.hasHightligthBorder,S=void 0!==z&&z,I=o.ariaLabel,L=t.useTheme(),T="color"===y;return n.jsxs(h,{children:[n.jsx(g,{type:"checkbox",checked:C,disabled:c,onChange:function(e){c||!1===e.target.checked&&w?e.preventDefault():l(e.target.checked)},id:j,"aria-label":I,$isColorVariant:T},void 0),n.jsx(f,e.__assign({theme:L,size:u,disabled:c,isChecked:C,"data-testid":"checkbox",variant:y,backgroundColor:_,backgroundImage:q,text:p,hasHightligthBorder:S},{children:C&&n.jsx(r.Icon.Actions.Check,{fill:b(_,p)?L.colors.shades.black.color:L.colors.shades.white.color},void 0)}),void 0),n.jsx(a,e.__assign({"data-testid":"checkbox-text",size:k,style:{color:m||L.colors.shades[700].color},variant:C?"demi":"regular",htmlFor:j,disabled:c},{children:p}),void 0)]},void 0)};
|
|
2
2
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("tslib"),i=require("react/jsx-runtime"),e=require("../../../icons/index.js"),t=require("../../../organisms/ModalZoom/useZoom.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("tslib"),i=require("react/jsx-runtime"),e=require("../../../icons/index.js"),t=require("../../../organisms/ModalZoom/useZoom.js"),r=require("../../../organisms/ModalZoom/ZoomButton.js"),d=require("../../../molecules/Video/Video.js"),n=require("./styled.js");exports.ImageProductSlide=function(a){var l,s=a.content,v=a.topTag,c=a.topRightTag,h=a.bottomTag,u=a.testId,m=a.position,g=void 0===m?"vertical":m,x=a.borderRadiusVariant,j=a.ctaText,p=a.ctaAction,y=a.hideCTA,z=a.withZoom,C=a.isRatioSquare,b=a.videoAutoplay,I=void 0!==b&&b,T=a.hideVideoControls,_=void 0!==T&&T,q=a.zoomOptions,w=a.isActive,P=void 0===w||w,R=a.zoomIconVariant,V=a.chevronsColor,Z=void 0===V?"#000":V,f=a.onPrev,A=a.onNext,M=a.hasPrev,S=void 0!==M&&M,k=a.hasNext,B=void 0!==k&&k,N=null==s?void 0:s.url,F=null!==(l=null==s?void 0:s.isVideo)&&void 0!==l&&l,O=I||null==s?void 0:s.thumbnailUrl,H=_?{pointerEvents:"none"}:void 0,L=t.useZoom((null==q?void 0:q.zoomModalId)||"zoom-modal-v1").handleZoomClick;return i.jsxs(n.Container,o.__assign({"data-testid":u,className:"stylefor".concat(g),borderRadiusVariant:x,position:g},{children:[!F&&i.jsxs(i.Fragment,{children:[z?i.jsxs(i.Fragment,{children:[i.jsx(n.InnerImageZoomStyled,{src:N,zoomSrc:(null==s?void 0:s.zoomUrl)||N,zoomType:(null==q?void 0:q.zoomModalId)?"click":"hover",imgAttributes:{alt:s.alt,style:{objectFit:"cover",objectPosition:"center"},loading:"eager",decoding:"sync",fetchpriority:"high"},width:"horizontal"==g?360:530,height:"horizontal"==g?480:720,hideHint:!0,isRatioSquare:C,afterZoomIn:(null==q?void 0:q.zoomModalId)?L:void 0},void 0),R]},void 0):i.jsx(n.ImageStyled,{width:"horizontal"==g?"360px":"530px",height:"auto",src:N,alt:s.alt,objectFit:"cover",loading:"eager",decoding:"sync",isRatioSquare:C,fetchPriority:"high"},void 0),i.jsx(n.TopTagContainer,o.__assign({borderRadiusVariant:x},{children:v}),void 0),i.jsx(n.BottomTagContainer,o.__assign({isCTAHidden:y},{children:h}),void 0),!!c&&i.jsx(n.TopRightTagWrapper,{children:i.jsx(n.TopRightTagContainer,{children:c},void 0)},void 0)]},void 0),F&&i.jsx(d.Video,{source:N,thumbnail:O,autoPlay:I,muted:!0,loop:!0,withProgressBar:!_,style:H,isActive:P,lazyLoad:!1},void 0),j&&p&&i.jsx("div",o.__assign({style:{display:y?"none":"block"}},{children:i.jsx(n.ButtonSecondaryOutlineWrapper,{wide:!0,onClick:p,text:j},void 0)}),void 0),Boolean(null==q?void 0:q.zoomModalId)&&i.jsx(r.ZoomButtonComponent,{modalId:(null==q?void 0:q.zoomModalId)||"zoom-modal-v1",showOnMobile:"v2"===(null==q?void 0:q.zoomVersion)},void 0),S&&f&&i.jsx(n.ChevronPrev,o.__assign({onClick:f,"aria-label":"Previous image"},{children:i.jsx(e.Icon.Arrows.ChevronLeft,{height:1.85,width:1.85,fill:Z},void 0)}),void 0),B&&A&&i.jsx(n.ChevronNext,o.__assign({onClick:A,"aria-label":"Next image"},{children:i.jsx(e.Icon.Arrows.ChevronRight,{height:1.85,width:1.85,fill:Z},void 0)}),void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=ImageProductSlide.js.map
|
package/package.json
CHANGED