@trafilea/afrodita-components 7.1.11 → 7.1.12
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/color/MultiColorPicker.js +1 -1
- package/build/es/components/color/SingleColorPicker.js +1 -1
- package/build/es/components/color/selector/ColorSelector.js +1 -1
- package/build/es/components/color/selector/OneColorSelector.js +1 -1
- package/build/es/components/color/selector/PatternSelector.js +1 -1
- package/build/es/components/color/selector/ThreeColorSelector.js +1 -1
- package/build/es/components/color/selector/TwoColorSelector.js +1 -1
- package/build/es/utils/constants/colorsSelector.js +2 -0
- package/build/es/utils/constants/colorsSelector.js.map +1 -0
- package/build/index.d.ts +3 -1
- package/build/lib/components/color/MultiColorPicker.js +1 -1
- package/build/lib/components/color/SingleColorPicker.js +1 -1
- package/build/lib/components/color/selector/ColorSelector.js +1 -1
- package/build/lib/components/color/selector/OneColorSelector.js +1 -1
- package/build/lib/components/color/selector/PatternSelector.js +1 -1
- package/build/lib/components/color/selector/ThreeColorSelector.js +1 -1
- package/build/lib/components/color/selector/TwoColorSelector.js +1 -1
- package/build/lib/utils/constants/colorsSelector.js +2 -0
- package/build/lib/utils/constants/colorsSelector.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as o,jsx as t}from"react/jsx-runtime";import{useState as r,useEffect as n}from"react";import l
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as o,jsx as t}from"react/jsx-runtime";import{useState as r,useEffect as n}from"react";import{ColorSelector as l}from"./selector/ColorSelector.js";import{OutOfStock as a}from"./selector/OutOfStock.js";import i from"./ColorRadioGroup.js";import{PatternSelector as c}from"./selector/PatternSelector.js";var u=function(o,r){return null==r||0===r.length?t(a,{title:"out of stock color"},void 0):r.map((function(r){return t(i.Option,e({value:r},{children:r.meta.color?t(l,{color:r.meta.color,selected:o.has(r),testId:"".concat(r.label,"-selector")},void 0):r.meta.pattern?t(c,{url:r.meta.pattern.url,selected:o.has(r)},void 0):null}),r.label)}))},s=function(l){var a=l.options,c=void 0===a?[]:a,s=l.label,m=l.selectedValue,d=l.onChange,f=function(e,o){return o&&e.includes(o)?[o]:o&&e.length>0?[e[0]]:void 0}(c,m),p=r(new Set(f)),v=p[0],h=p[1];n((function(){d(v)}),[d,v]);var b=Array.from(v).map((function(e){return e.label})).join(" | ");return o(i,e({value:v,onChange:function(e){h((function(o){var t=new Set(o);return o.has(e)?t.delete(e):t.add(e),t}))}},{children:[t(i.Label,{label:s,values:b},void 0),t(i.OptionsContainer,{children:u(v,c)},void 0)]}),void 0)};export{s as default};
|
|
2
2
|
//# sourceMappingURL=MultiColorPicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsxs as e,jsx as t}from"@emotion/react/jsx-runtime";import r from"./ColorRadioGroup.js";import
|
|
1
|
+
import{__assign as o}from"tslib";import{jsxs as e,jsx as t}from"@emotion/react/jsx-runtime";import r from"./ColorRadioGroup.js";import{ColorSelector as n}from"./selector/ColorSelector.js";import{OutOfStock as i}from"./selector/OutOfStock.js";import{PatternSelector as l}from"./selector/PatternSelector.js";var a=function(e,a,s){return void 0===a&&(a=!1),0===(null==e?void 0:e.length)?t(i,{title:"out of stock color"},void 0):null==e?void 0:e.map((function(e){return t(r.Option,o({value:e},{children:function(o){var r=o.checked;return e.meta.color?t(n,{color:e.meta.color,selected:r,testId:"".concat(e.label.split(" ").join("-").toLowerCase(),"-selector"),noStock:e.noStock,showCross:a,dimension:s},void 0):e.meta.pattern?t(l,{url:e.meta.pattern.url,selected:r,noStock:e.noStock,dimension:s},void 0):null}}),e.label)}))},s=function(n){var i=n.options,l=n.selectedValue,s=n.label,c=n.onChange,d=n.inline,m=void 0!==d&&d,u=n.showCross,p=void 0!==u&&u,v=n.dimension;return e(r,o({value:l,onChange:c,css:{flexDirection:m?"row":"column",alignItems:m?"center":"start"}},{children:[t(r.Label,{label:s,values:l&&!m?l.label:void 0},void 0),t(r.OptionsContainer,o({css:{marginTop:m?"0":"0.5rem",marginLeft:m?"1.5rem":"0"},"data-testid":"radio-group-options-container"},{children:a(i,p,v)}),void 0)]}),void 0)};export{s as default,a as renderOptions};
|
|
2
2
|
//# sourceMappingURL=SingleColorPicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import r from"./OneColorSelector.js";import e from"./ThreeColorSelector.js";import t from"./TwoColorSelector.js";var s=function(s){var
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import r from"./OneColorSelector.js";import e from"./ThreeColorSelector.js";import t from"./TwoColorSelector.js";var s=function(s){var i=s.color,d=s.selected,n=s.testId,l=s.noStock,c=s.showCross,m=void 0!==c&&c,a=s.dimension,C=i[0],p=i[1],S=i[2];return S?o(e,{primaryColor:C,secondaryColor:p,tertiaryColor:S,selected:d,testId:n,noStock:l,dimension:a},void 0):p?o(t,{secondaryColor:p,primaryColor:C,selected:d,testId:n,noStock:l,dimension:a},void 0):o(r,{color:C,selected:d,testId:n,noStock:l,showCross:m,dimension:a},void 0)};export{s as ColorSelector,s as default};
|
|
2
2
|
//# sourceMappingURL=ColorSelector.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsxs as e,jsx as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsxs as e,jsx as r,Fragment as i}from"react/jsx-runtime";import{useTheme as s}from"../../../core/theme/Theme.js";import{getColorSelectorDimensions as t}from"../../../utils/constants/colorsSelector.js";var c=function(c){var l=c.color,n=c.selected,d=c.testId,x=c.noStock,h=c.showCross,m=void 0!==h&&h,y=c.dimension,a=s(),v=n?a.colors.shades[550].color:"none",w=t(y);return e("svg",o({width:w.width,height:w.height,viewBox:w.viewBox,fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":d,style:{opacity:x?m?1:.4:1}},{children:[r("circle",{cx:w.mainCircle.cx,cy:w.mainCircle.cy,r:w.mainCircle.r,fill:l,stroke:"#9E9E9E",strokeWidth:"0.5"},void 0),r("circle",{cx:w.outerCircle.cx,cy:w.outerCircle.cy,r:w.outerCircle.r,stroke:v},void 0),m&&x&&e(i,{children:[r("line",{x1:w.cross.line1.x1,y1:w.cross.line1.y1,x2:w.cross.line1.x2,y2:w.cross.line1.y2,stroke:"#9E9E9E",strokeWidth:"1"},void 0),r("line",{x1:w.cross.line2.x1,y1:w.cross.line2.y1,x2:w.cross.line2.x2,y2:w.cross.line2.y2,stroke:"#9E9E9E",strokeWidth:"1"},void 0)]},void 0)]}),void 0)};export{c as default};
|
|
2
2
|
//# sourceMappingURL=OneColorSelector.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as
|
|
1
|
+
import{__makeTemplateObject as n,__assign as r}from"tslib";import{jsx as t}from"react/jsx-runtime";import o from"@emotion/styled";import{useTheme as e}from"../../../core/theme/Theme.js";import{getColorSelectorDimensions as i}from"../../../utils/constants/colorsSelector.js";var d,s,c=o.div(d||(d=n(["\n width: ","px;\n height: ","px;\n border-radius: 50%;\n border: 0.081rem solid ",";\n box-sizing: border-box;\n padding: ","px;\n cursor: pointer;\n opacity: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n"],["\n width: ","px;\n height: ","px;\n border-radius: 50%;\n border: 0.081rem solid ",";\n box-sizing: border-box;\n padding: ","px;\n cursor: pointer;\n opacity: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n"])),(function(n){return n.width}),(function(n){return n.height}),(function(n){return n.borderColor}),(function(n){return n.padding}),(function(n){return n.noStock?"0.4":"1"})),a=o.img(s||(s=n(["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n"],["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n"]))),p=function(n){var o=n.url,d=n.selected,s=n.testId,p=n.noStock,h=n.dimension,u=e(),l=d?u.colors.shades[550].color:"transparent",m=i(h).pattern,g=m.width,b=m.height,f=m.padding;return t(c,r({"data-testid":s,borderColor:l,noStock:p,width:g,height:b,padding:f},{children:t(a,{src:o,alt:"pattern"},void 0)}),void 0)};export{p as PatternSelector};
|
|
2
2
|
//# sourceMappingURL=PatternSelector.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import{useTheme as e}from"../../../core/theme/Theme.js";import{getColorSelectorDimensions as c}from"../../../utils/constants/colorsSelector.js";var o=function(o){var a=o.primaryColor,l=o.secondaryColor,h=o.tertiaryColor,n=o.selected,s=o.testId,d=o.noStock,m=o.dimension,y=e(),x=n?y.colors.shades[550].color:"none",w=c(m),f=w.threeColor,v=f.mask,C=f.rects,g=f.radius;return i("svg",t({width:w.width,height:w.height,viewBox:w.viewBox,fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":s,style:{opacity:d?.4:1}},{children:[r("mask",t({id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:v.x,y:v.y,width:v.width,height:v.height},{children:r("circle",{cx:w.mainCircle.cx,cy:w.mainCircle.cy,r:w.mainCircle.r*g,transform:"rotate(-90 ".concat(w.mainCircle.cx," ").concat(w.mainCircle.cy,")"),fill:"black"},void 0)}),void 0),i("g",t({mask:"url(#mask0)"},{children:[r("rect",{x:C[0].x,y:C[0].y,width:C[0].width,height:C[0].height,transform:"rotate(-90 ".concat(C[0].x," ").concat(C[0].y,")"),fill:a},void 0),r("rect",{x:C[1].x,y:C[1].y,width:C[1].width,height:C[1].height,transform:"rotate(-90 ".concat(C[1].x," ").concat(C[1].y,")"),fill:l},void 0),r("rect",{x:C[2].x,y:C[2].y,width:C[2].width,height:C[2].height,transform:"rotate(-90 ".concat(C[2].x," ").concat(C[2].y,")"),fill:h},void 0)]}),void 0),r("circle",{cx:w.mainCircle.cx,cy:w.mainCircle.cy,r:w.mainCircle.r*g,stroke:"#9E9E9E",strokeWidth:"0.5"},void 0),r("circle",{cx:w.outerCircle.cx,cy:w.outerCircle.cy,r:w.outerCircle.r*g,stroke:x},void 0)]}),void 0)};export{o as default};
|
|
2
2
|
//# sourceMappingURL=ThreeColorSelector.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as i}from"tslib";import{jsxs as r,jsx as t}from"react/jsx-runtime";import{useTheme as c}from"../../../core/theme/Theme.js";import{getColorSelectorDimensions as e}from"../../../utils/constants/colorsSelector.js";var o=function(o){var a=o.primaryColor,n=o.secondaryColor,l=o.selected,s=o.testId,m=o.noStock,h=o.dimension,d=c(),y=l?d.colors.shades[550].color:"none",x=e(h),C=x.twoColor,w=C.mask,f=C.rect,v=C.radius;return r("svg",i({width:x.width,height:x.height,viewBox:x.viewBox,fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":s,style:{opacity:m?.4:1}},{children:[t("mask",i({id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:w.x,y:w.y,width:w.width,height:w.height},{children:t("circle",{cx:x.mainCircle.cx,cy:x.mainCircle.cy,r:x.mainCircle.r*v,transform:"rotate(-90 ".concat(x.mainCircle.cx," ").concat(x.mainCircle.cy,")"),fill:"black"},void 0)}),void 0),r("g",i({mask:"url(#mask0)"},{children:[t("rect",{x:w.x,y:f.y,width:f.width,height:f.height,transform:"rotate(-90 ".concat(w.x," ").concat(f.y,")"),fill:a},void 0),t("rect",{x:f.secondX,y:f.y,width:f.width,height:f.height,transform:"rotate(-90 ".concat(f.secondX," ").concat(f.y,")"),fill:n},void 0)]}),void 0),t("circle",{cx:x.mainCircle.cx,cy:x.mainCircle.cy,r:x.mainCircle.r*v,transform:"rotate(-90 ".concat(x.mainCircle.cx," ").concat(x.mainCircle.cy,")"),stroke:"#9E9E9E",strokeWidth:"0.5"},void 0),t("circle",{cx:x.outerCircle.cx,cy:x.outerCircle.cy,r:x.outerCircle.r*v,stroke:y},void 0)]}),void 0)};export{o as default};
|
|
2
2
|
//# sourceMappingURL=TwoColorSelector.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var i={MEDIUM:{width:32,height:32,viewBox:"0 0 32 32",mainCircle:{cx:16,cy:16,r:12},outerCircle:{cx:16,cy:16,r:15.5},cross:{line1:{x1:10,y1:10,x2:22,y2:22},line2:{x1:10,y1:22,x2:22,y2:10}},pattern:{width:32,height:32,padding:2.5},twoColor:{mask:{x:4,y:4,width:24,height:24},rect:{y:34,width:35,height:12,secondX:16},radius:1},threeColor:{mask:{x:4,y:4,width:24,height:24},rects:[{x:4,y:33.76,width:34.56,height:7.68},{x:11.6802,y:33.76,width:34.56,height:8.64},{x:20.3198,y:33.76,width:34.56,height:7.68}],radius:1}},SMALL:{width:18,height:18,viewBox:"0 0 18 18",mainCircle:{cx:9,cy:9,r:6},outerCircle:{cx:9,cy:9,r:7.5},cross:{line1:{x1:5,y1:5,x2:11,y2:11},line2:{x1:5,y1:11,x2:11,y2:5}},pattern:{width:18,height:18,padding:1},twoColor:{mask:{x:2.25,y:2.25,width:13.5,height:13.5},rect:{y:19.125,width:19.6875,height:6.75,secondX:9},radius:1.125},threeColor:{mask:{x:2.25,y:2.25,width:13.5,height:13.5},rects:[{x:2.25,y:18.99,width:19.44,height:4.32},{x:6.57,y:18.99,width:19.44,height:4.86},{x:11.43,y:18.99,width:19.44,height:4.32}],radius:1.125}}},h=function(h){var t;return null!==(t=i[null!=h?h:"MEDIUM"])&&void 0!==t?t:i.MEDIUM};export{i as ColorSelectorByDimension,h as getColorSelectorDimensions};
|
|
2
|
+
//# sourceMappingURL=colorsSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorsSelector.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/build/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { ComponentSize as ComponentSize$1 } from 'src/types/enums';
|
|
|
5
5
|
import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
|
|
6
6
|
import { TextProps as TextProps$1 } from 'src/components/text/Text';
|
|
7
7
|
import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
|
|
8
|
+
import { ColorSelectorDimension } from 'src/utils/constants/colorsSelector';
|
|
8
9
|
import * as _emotion_styled from '@emotion/styled';
|
|
9
10
|
import { StyledComponent } from '@emotion/styled';
|
|
10
11
|
export { default as styled } from '@emotion/styled';
|
|
@@ -3089,8 +3090,9 @@ interface ColorPickerProps {
|
|
|
3089
3090
|
onChange: (color: ColorPickerOption) => void;
|
|
3090
3091
|
inline?: boolean;
|
|
3091
3092
|
showCross?: boolean;
|
|
3093
|
+
dimension?: ColorSelectorDimension;
|
|
3092
3094
|
}
|
|
3093
|
-
declare const SingleColorPicker: ({ options, selectedValue, label, onChange, inline, showCross, }: ColorPickerProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
3095
|
+
declare const SingleColorPicker: ({ options, selectedValue, label, onChange, inline, showCross, dimension, }: ColorPickerProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
3094
3096
|
|
|
3095
3097
|
interface CrossSellCheckboxProps extends rightToLeftProps {
|
|
3096
3098
|
imageURL: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),o=require("./selector/ColorSelector.js"),n=require("./selector/OutOfStock.js"),l=require("./ColorRadioGroup.js"),a=require("./selector/PatternSelector.js"),i=function(r,i){return null==i||0===i.length?t.jsx(n.OutOfStock,{title:"out of stock color"},void 0):i.map((function(n){return t.jsx(l.Option,e.__assign({value:n},{children:n.meta.color?t.jsx(o,{color:n.meta.color,selected:r.has(n),testId:"".concat(n.label,"-selector")},void 0):n.meta.pattern?t.jsx(a.PatternSelector,{url:n.meta.pattern.url,selected:r.has(n)},void 0):null}),n.label)}))};module.exports=function(o){var n=o.options,a=void 0===n?[]:n,s=o.label,u=o.selectedValue,c=o.onChange,d=function(e,t){return t&&e.includes(t)?[t]:t&&e.length>0?[e[0]]:void 0}(a,u),v=r.useState(new Set(d)),f=v[0],j=v[1];r.useEffect((function(){c(f)}),[c,f]);var h=Array.from(f).map((function(e){return e.label})).join(" | ");return t.jsxs(l,e.__assign({value:f,onChange:function(e){j((function(t){var r=new Set(t);return t.has(e)?r.delete(e):r.add(e),r}))}},{children:[t.jsx(l.Label,{label:s,values:h},void 0),t.jsx(l.OptionsContainer,{children:i(f,a)},void 0)]}),void 0)};
|
|
1
|
+
"use strict";var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),o=require("./selector/ColorSelector.js"),n=require("./selector/OutOfStock.js"),l=require("./ColorRadioGroup.js"),a=require("./selector/PatternSelector.js"),i=function(r,i){return null==i||0===i.length?t.jsx(n.OutOfStock,{title:"out of stock color"},void 0):i.map((function(n){return t.jsx(l.Option,e.__assign({value:n},{children:n.meta.color?t.jsx(o.ColorSelector,{color:n.meta.color,selected:r.has(n),testId:"".concat(n.label,"-selector")},void 0):n.meta.pattern?t.jsx(a.PatternSelector,{url:n.meta.pattern.url,selected:r.has(n)},void 0):null}),n.label)}))};module.exports=function(o){var n=o.options,a=void 0===n?[]:n,s=o.label,u=o.selectedValue,c=o.onChange,d=function(e,t){return t&&e.includes(t)?[t]:t&&e.length>0?[e[0]]:void 0}(a,u),v=r.useState(new Set(d)),f=v[0],j=v[1];r.useEffect((function(){c(f)}),[c,f]);var h=Array.from(f).map((function(e){return e.label})).join(" | ");return t.jsxs(l,e.__assign({value:f,onChange:function(e){j((function(t){var r=new Set(t);return t.has(e)?r.delete(e):r.add(e),r}))}},{children:[t.jsx(l.Label,{label:s,values:h},void 0),t.jsx(l.OptionsContainer,{children:i(f,a)},void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=MultiColorPicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),o=require("@emotion/react/jsx-runtime"),t=require("./ColorRadioGroup.js"),r=require("./selector/ColorSelector.js"),n=require("./selector/OutOfStock.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),o=require("@emotion/react/jsx-runtime"),t=require("./ColorRadioGroup.js"),r=require("./selector/ColorSelector.js"),n=require("./selector/OutOfStock.js"),i=require("./selector/PatternSelector.js"),s=function(s,l,a){return void 0===l&&(l=!1),0===(null==s?void 0:s.length)?o.jsx(n.OutOfStock,{title:"out of stock color"},void 0):null==s?void 0:s.map((function(n){return o.jsx(t.Option,e.__assign({value:n},{children:function(e){var t=e.checked;return n.meta.color?o.jsx(r.ColorSelector,{color:n.meta.color,selected:t,testId:"".concat(n.label.split(" ").join("-").toLowerCase(),"-selector"),noStock:n.noStock,showCross:l,dimension:a},void 0):n.meta.pattern?o.jsx(i.PatternSelector,{url:n.meta.pattern.url,selected:t,noStock:n.noStock,dimension:a},void 0):null}}),n.label)}))};exports.default=function(r){var n=r.options,i=r.selectedValue,l=r.label,a=r.onChange,c=r.inline,u=void 0!==c&&c,d=r.showCross,v=void 0!==d&&d,m=r.dimension;return o.jsxs(t,e.__assign({value:i,onChange:a,css:{flexDirection:u?"row":"column",alignItems:u?"center":"start"}},{children:[o.jsx(t.Label,{label:l,values:i&&!u?i.label:void 0},void 0),o.jsx(t.OptionsContainer,e.__assign({css:{marginTop:u?"0":"0.5rem",marginLeft:u?"1.5rem":"0"},"data-testid":"radio-group-options-container"},{children:s(n,v,m)}),void 0)]}),void 0)},exports.renderOptions=s;
|
|
2
2
|
//# sourceMappingURL=SingleColorPicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("./OneColorSelector.js"),r=require("./ThreeColorSelector.js"),t=require("./TwoColorSelector.js"),s=function(s){var i=s.color,l=s.selected,d=s.testId,c=s.noStock,n=s.showCross,u=void 0!==n&&n,C=s.dimension,a=i[0],j=i[1],S=i[2];return S?e.jsx(r,{primaryColor:a,secondaryColor:j,tertiaryColor:S,selected:l,testId:d,noStock:c,dimension:C},void 0):j?e.jsx(t,{secondaryColor:j,primaryColor:a,selected:l,testId:d,noStock:c,dimension:C},void 0):e.jsx(o,{color:a,selected:l,testId:d,noStock:c,showCross:u,dimension:C},void 0)};exports.ColorSelector=s,exports.default=s;
|
|
2
2
|
//# sourceMappingURL=ColorSelector.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),s=require("react/jsx-runtime"),r=require("../../../core/theme/Theme.js");module.exports=function(o){var t=o.color,
|
|
1
|
+
"use strict";var e=require("tslib"),s=require("react/jsx-runtime"),r=require("../../../core/theme/Theme.js"),i=require("../../../utils/constants/colorsSelector.js");module.exports=function(o){var t=o.color,c=o.selected,l=o.testId,n=o.noStock,x=o.showCross,d=void 0!==x&&x,h=o.dimension,u=r.useTheme(),y=c?u.colors.shades[550].color:"none",a=i.getColorSelectorDimensions(h);return s.jsxs("svg",e.__assign({width:a.width,height:a.height,viewBox:a.viewBox,fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":l,style:{opacity:n?d?1:.4:1}},{children:[s.jsx("circle",{cx:a.mainCircle.cx,cy:a.mainCircle.cy,r:a.mainCircle.r,fill:t,stroke:"#9E9E9E",strokeWidth:"0.5"},void 0),s.jsx("circle",{cx:a.outerCircle.cx,cy:a.outerCircle.cy,r:a.outerCircle.r,stroke:y},void 0),d&&n&&s.jsxs(s.Fragment,{children:[s.jsx("line",{x1:a.cross.line1.x1,y1:a.cross.line1.y1,x2:a.cross.line1.x2,y2:a.cross.line1.y2,stroke:"#9E9E9E",strokeWidth:"1"},void 0),s.jsx("line",{x1:a.cross.line2.x1,y1:a.cross.line2.y1,x2:a.cross.line2.x2,y2:a.cross.line2.y2,stroke:"#9E9E9E",strokeWidth:"1"},void 0)]},void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=OneColorSelector.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("@emotion/styled"),r=require("../../../core/theme/Theme.js"),i=require("../../../utils/constants/colorsSelector.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d,s,a=o(t),u=a.default.div(d||(d=e.__makeTemplateObject(["\n width: ","px;\n height: ","px;\n border-radius: 50%;\n border: 0.081rem solid ",";\n box-sizing: border-box;\n padding: ","px;\n cursor: pointer;\n opacity: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n"],["\n width: ","px;\n height: ","px;\n border-radius: 50%;\n border: 0.081rem solid ",";\n box-sizing: border-box;\n padding: ","px;\n cursor: pointer;\n opacity: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n"])),(function(e){return e.width}),(function(e){return e.height}),(function(e){return e.borderColor}),(function(e){return e.padding}),(function(e){return e.noStock?"0.4":"1"})),c=a.default.img(s||(s=e.__makeTemplateObject(["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n"],["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n"])));exports.PatternSelector=function(t){var o=t.url,d=t.selected,s=t.testId,a=t.noStock,l=t.dimension,h=r.useTheme(),p=d?h.colors.shades[550].color:"transparent",b=i.getColorSelectorDimensions(l).pattern,g=b.width,f=b.height,x=b.padding;return n.jsx(u,e.__assign({"data-testid":s,borderColor:p,noStock:a,width:g,height:f,padding:x},{children:n.jsx(c,{src:o,alt:"pattern"},void 0)}),void 0)};
|
|
2
2
|
//# sourceMappingURL=PatternSelector.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),
|
|
1
|
+
"use strict";var e=require("tslib"),i=require("react/jsx-runtime"),r=require("../../../core/theme/Theme.js"),t=require("../../../utils/constants/colorsSelector.js");module.exports=function(c){var o=c.primaryColor,s=c.secondaryColor,a=c.tertiaryColor,l=c.selected,n=c.testId,h=c.noStock,d=c.dimension,x=r.useTheme(),m=l?x.colors.shades[550].color:"none",y=t.getColorSelectorDimensions(d),g=y.threeColor,u=g.mask,w=g.rects,C=g.radius;return i.jsxs("svg",e.__assign({width:y.width,height:y.height,viewBox:y.viewBox,fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":n,style:{opacity:h?.4:1}},{children:[i.jsx("mask",e.__assign({id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:u.x,y:u.y,width:u.width,height:u.height},{children:i.jsx("circle",{cx:y.mainCircle.cx,cy:y.mainCircle.cy,r:y.mainCircle.r*C,transform:"rotate(-90 ".concat(y.mainCircle.cx," ").concat(y.mainCircle.cy,")"),fill:"black"},void 0)}),void 0),i.jsxs("g",e.__assign({mask:"url(#mask0)"},{children:[i.jsx("rect",{x:w[0].x,y:w[0].y,width:w[0].width,height:w[0].height,transform:"rotate(-90 ".concat(w[0].x," ").concat(w[0].y,")"),fill:o},void 0),i.jsx("rect",{x:w[1].x,y:w[1].y,width:w[1].width,height:w[1].height,transform:"rotate(-90 ".concat(w[1].x," ").concat(w[1].y,")"),fill:s},void 0),i.jsx("rect",{x:w[2].x,y:w[2].y,width:w[2].width,height:w[2].height,transform:"rotate(-90 ".concat(w[2].x," ").concat(w[2].y,")"),fill:a},void 0)]}),void 0),i.jsx("circle",{cx:y.mainCircle.cx,cy:y.mainCircle.cy,r:y.mainCircle.r*C,stroke:"#9E9E9E",strokeWidth:"0.5"},void 0),i.jsx("circle",{cx:y.outerCircle.cx,cy:y.outerCircle.cy,r:y.outerCircle.r*C,stroke:m},void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=ThreeColorSelector.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),
|
|
1
|
+
"use strict";var e=require("tslib"),i=require("react/jsx-runtime"),r=require("../../../core/theme/Theme.js"),c=require("../../../utils/constants/colorsSelector.js");module.exports=function(t){var o=t.primaryColor,s=t.secondaryColor,a=t.selected,n=t.testId,l=t.noStock,h=t.dimension,d=r.useTheme(),m=a?d.colors.shades[550].color:"none",x=c.getColorSelectorDimensions(h),y=x.twoColor,u=y.mask,C=y.rect,g=y.radius;return i.jsxs("svg",e.__assign({width:x.width,height:x.height,viewBox:x.viewBox,fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":n,style:{opacity:l?.4:1}},{children:[i.jsx("mask",e.__assign({id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:u.x,y:u.y,width:u.width,height:u.height},{children:i.jsx("circle",{cx:x.mainCircle.cx,cy:x.mainCircle.cy,r:x.mainCircle.r*g,transform:"rotate(-90 ".concat(x.mainCircle.cx," ").concat(x.mainCircle.cy,")"),fill:"black"},void 0)}),void 0),i.jsxs("g",e.__assign({mask:"url(#mask0)"},{children:[i.jsx("rect",{x:u.x,y:C.y,width:C.width,height:C.height,transform:"rotate(-90 ".concat(u.x," ").concat(C.y,")"),fill:o},void 0),i.jsx("rect",{x:C.secondX,y:C.y,width:C.width,height:C.height,transform:"rotate(-90 ".concat(C.secondX," ").concat(C.y,")"),fill:s},void 0)]}),void 0),i.jsx("circle",{cx:x.mainCircle.cx,cy:x.mainCircle.cy,r:x.mainCircle.r*g,transform:"rotate(-90 ".concat(x.mainCircle.cx," ").concat(x.mainCircle.cy,")"),stroke:"#9E9E9E",strokeWidth:"0.5"},void 0),i.jsx("circle",{cx:x.outerCircle.cx,cy:x.outerCircle.cy,r:x.outerCircle.r*g,stroke:m},void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=TwoColorSelector.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={MEDIUM:{width:32,height:32,viewBox:"0 0 32 32",mainCircle:{cx:16,cy:16,r:12},outerCircle:{cx:16,cy:16,r:15.5},cross:{line1:{x1:10,y1:10,x2:22,y2:22},line2:{x1:10,y1:22,x2:22,y2:10}},pattern:{width:32,height:32,padding:2.5},twoColor:{mask:{x:4,y:4,width:24,height:24},rect:{y:34,width:35,height:12,secondX:16},radius:1},threeColor:{mask:{x:4,y:4,width:24,height:24},rects:[{x:4,y:33.76,width:34.56,height:7.68},{x:11.6802,y:33.76,width:34.56,height:8.64},{x:20.3198,y:33.76,width:34.56,height:7.68}],radius:1}},SMALL:{width:18,height:18,viewBox:"0 0 18 18",mainCircle:{cx:9,cy:9,r:6},outerCircle:{cx:9,cy:9,r:7.5},cross:{line1:{x1:5,y1:5,x2:11,y2:11},line2:{x1:5,y1:11,x2:11,y2:5}},pattern:{width:18,height:18,padding:1},twoColor:{mask:{x:2.25,y:2.25,width:13.5,height:13.5},rect:{y:19.125,width:19.6875,height:6.75,secondX:9},radius:1.125},threeColor:{mask:{x:2.25,y:2.25,width:13.5,height:13.5},rects:[{x:2.25,y:18.99,width:19.44,height:4.32},{x:6.57,y:18.99,width:19.44,height:4.86},{x:11.43,y:18.99,width:19.44,height:4.32}],radius:1.125}}};exports.ColorSelectorByDimension=e,exports.getColorSelectorDimensions=function(i){var t;return null!==(t=e[null!=i?i:"MEDIUM"])&&void 0!==t?t:e.MEDIUM};
|
|
2
|
+
//# sourceMappingURL=colorsSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorsSelector.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/package.json
CHANGED