@thecb/components 10.4.7-beta.1 → 10.4.8-beta.0
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/dist/index.cjs.js +65 -34
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +65 -34
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/icons/IconAdd.js +11 -4
- package/src/components/atoms/placeholder/Placeholder.js +5 -5
- package/src/components/atoms/placeholder/Placeholder.stories.js +2 -1
- package/src/components/atoms/toggle-switch/ToggleSwitch.js +61 -34
- package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +3 -2
- package/src/components/atoms/toggle-switch/ToggleSwitch.theme.js +5 -5
package/dist/index.esm.js
CHANGED
|
@@ -14123,7 +14123,9 @@ var GenericErrorIcon = function GenericErrorIcon() {
|
|
|
14123
14123
|
}));
|
|
14124
14124
|
};
|
|
14125
14125
|
|
|
14126
|
-
var IconAdd = function IconAdd() {
|
|
14126
|
+
var IconAdd = function IconAdd(_ref) {
|
|
14127
|
+
var _ref$strokeWidth = _ref.strokeWidth,
|
|
14128
|
+
strokeWidth = _ref$strokeWidth === void 0 ? 1 : _ref$strokeWidth;
|
|
14127
14129
|
return /*#__PURE__*/React.createElement("svg", {
|
|
14128
14130
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14129
14131
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
@@ -14133,12 +14135,13 @@ var IconAdd = function IconAdd() {
|
|
|
14133
14135
|
className: "icon"
|
|
14134
14136
|
}, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("path", {
|
|
14135
14137
|
id: "path-1",
|
|
14138
|
+
strokeWidth: strokeWidth,
|
|
14136
14139
|
d: "M7.91666623 4.78508747L4.78508747 4.78508747 4.78508747 7.91666623 3.74122788 7.91666623 3.74122788 4.78508747 0.609649123 4.78508747 0.609649123 3.74122788 3.74122788 3.74122788 3.74122788 0.609649123 4.78508747 0.609649123 4.78508747 3.74122788 7.91666623 3.74122788z"
|
|
14137
14140
|
})), /*#__PURE__*/React.createElement("g", {
|
|
14138
14141
|
fill: "none",
|
|
14139
14142
|
fillRule: "evenodd",
|
|
14140
14143
|
stroke: "none",
|
|
14141
|
-
strokeWidth:
|
|
14144
|
+
strokeWidth: strokeWidth
|
|
14142
14145
|
}, /*#__PURE__*/React.createElement("g", {
|
|
14143
14146
|
transform: "translate(-407 -563)"
|
|
14144
14147
|
}, /*#__PURE__*/React.createElement("g", {
|
|
@@ -14156,9 +14159,10 @@ var IconAdd = function IconAdd() {
|
|
|
14156
14159
|
xlinkHref: "#path-1"
|
|
14157
14160
|
})), /*#__PURE__*/React.createElement("circle", {
|
|
14158
14161
|
className: "stroke",
|
|
14162
|
+
strokeWidth: strokeWidth,
|
|
14159
14163
|
cx: "8.155",
|
|
14160
14164
|
cy: "8.072",
|
|
14161
|
-
r: "8"
|
|
14165
|
+
r: strokeWidth == 1 ? "8" : "7"
|
|
14162
14166
|
}))))));
|
|
14163
14167
|
};
|
|
14164
14168
|
|
|
@@ -27828,13 +27832,13 @@ var Placeholder = function Placeholder(_ref2) {
|
|
|
27828
27832
|
childGap: "0"
|
|
27829
27833
|
}, variant === "large" && /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement(Box, {
|
|
27830
27834
|
padding: "0",
|
|
27831
|
-
extraStyles: ".fill { \n fill: ".concat(variant === "large" ? CHARADE_GREY : themeValues.color, "; \n } .stroke { \n stroke: ").concat(variant === "large" ? CHARADE_GREY : themeValues.color, "; \n }")
|
|
27835
|
+
extraStyles: ".fill { \n fill: ".concat(variant === "large" ? CHARADE_GREY : themeValues.color, "; \n } .stroke { \n stroke: ").concat(variant === "large" ? CHARADE_GREY : themeValues.color, "; \n } ")
|
|
27832
27836
|
}, variant === "large" ? /*#__PURE__*/React.createElement(Center, {
|
|
27833
27837
|
intrinsic: true
|
|
27834
27838
|
}, getLargeIcon(largeIcon), /*#__PURE__*/React.createElement(Text$1, {
|
|
27835
27839
|
variant: "pS",
|
|
27836
27840
|
color: themeValues.color,
|
|
27837
|
-
weight:
|
|
27841
|
+
weight: FONT_WEIGHT_SEMIBOLD,
|
|
27838
27842
|
extraStyles: "text-align: center;"
|
|
27839
27843
|
}, text)) : /*#__PURE__*/React.createElement(Cover, {
|
|
27840
27844
|
singleChild: true,
|
|
@@ -27842,12 +27846,14 @@ var Placeholder = function Placeholder(_ref2) {
|
|
|
27842
27846
|
}, /*#__PURE__*/React.createElement(Cluster, {
|
|
27843
27847
|
justify: "center",
|
|
27844
27848
|
align: "center"
|
|
27845
|
-
}, /*#__PURE__*/React.createElement(IconAdd,
|
|
27849
|
+
}, /*#__PURE__*/React.createElement(IconAdd, {
|
|
27850
|
+
strokeWidth: "2"
|
|
27851
|
+
}), /*#__PURE__*/React.createElement(Center, {
|
|
27846
27852
|
intrinsic: true
|
|
27847
27853
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
27848
27854
|
variant: "pS",
|
|
27849
27855
|
color: themeValues.color,
|
|
27850
|
-
weight:
|
|
27856
|
+
weight: FONT_WEIGHT_SEMIBOLD,
|
|
27851
27857
|
extraStyles: "padding: 0 0 0 8px; text-align: center;"
|
|
27852
27858
|
}, text)))))))))));
|
|
27853
27859
|
};
|
|
@@ -38763,17 +38769,17 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
38763
38769
|
};
|
|
38764
38770
|
|
|
38765
38771
|
var onBackground = "".concat(MATISSE_BLUE);
|
|
38766
|
-
var disabledBackground = "".concat(
|
|
38767
|
-
var disabledBackgroundLight = "".concat(ATHENS_GREY);
|
|
38772
|
+
var disabledBackground = "".concat(IRON_GREY);
|
|
38768
38773
|
var white = "".concat(WHITE);
|
|
38774
|
+
var offBackground = "".concat(REGENT_GREY);
|
|
38769
38775
|
var labelStyles = "\n display: flex;\n justify-content: flex-start;\n align-items: center;\n";
|
|
38770
38776
|
var rightLabelStyles = "\n ".concat(labelStyles, "\n flex-direction: row;\n");
|
|
38771
38777
|
var leftLabelStyles = "\n ".concat(labelStyles, "\n flex-direction: row-reverse;\n");
|
|
38772
38778
|
var fallbackValues$y = {
|
|
38773
38779
|
onBackground: onBackground,
|
|
38774
38780
|
disabledBackground: disabledBackground,
|
|
38775
|
-
disabledBackgroundLight: disabledBackgroundLight,
|
|
38776
38781
|
white: white,
|
|
38782
|
+
offBackground: offBackground,
|
|
38777
38783
|
rightLabelStyles: rightLabelStyles,
|
|
38778
38784
|
leftLabelStyles: leftLabelStyles
|
|
38779
38785
|
};
|
|
@@ -38791,7 +38797,7 @@ var HiddenToggleSwitchBox = styled.input.withConfig({
|
|
|
38791
38797
|
var VisibleSwitchComponent = styled.label.withConfig({
|
|
38792
38798
|
displayName: "ToggleSwitch__VisibleSwitchComponent",
|
|
38793
38799
|
componentId: "sc-1t51u6v-1"
|
|
38794
|
-
})(["width:
|
|
38800
|
+
})(["width:48px;height:24px;border-radius:48px;border:none;position:relative;box-sizing:border-box;cursor:", ";display:inline-block;&:hover{box-shadow:", ";}&:focus{box-shadow:0px 2px 5px 0px rgba(0,0,0,0.5);}", ""], function (_ref3) {
|
|
38795
38801
|
var disabled = _ref3.disabled;
|
|
38796
38802
|
return disabled ? "auto" : "pointer";
|
|
38797
38803
|
}, function (_ref4) {
|
|
@@ -38801,10 +38807,14 @@ var VisibleSwitchComponent = styled.label.withConfig({
|
|
|
38801
38807
|
var isMobile = _ref5.isMobile;
|
|
38802
38808
|
return isMobile ? "transform: scale(0.75)" : "";
|
|
38803
38809
|
});
|
|
38804
|
-
var
|
|
38805
|
-
displayName: "
|
|
38810
|
+
var ToggleSwitchMiddleRingComponent = styled.div.withConfig({
|
|
38811
|
+
displayName: "ToggleSwitch__ToggleSwitchMiddleRingComponent",
|
|
38806
38812
|
componentId: "sc-1t51u6v-2"
|
|
38807
|
-
})(["position:absolute;width:
|
|
38813
|
+
})(["position:absolute;width:20px;height:20px;border:none;border-radius:50%;box-sizing:border-box;"]);
|
|
38814
|
+
var ToggleSwitchInnerRingComponent = styled.div.withConfig({
|
|
38815
|
+
displayName: "ToggleSwitch__ToggleSwitchInnerRingComponent",
|
|
38816
|
+
componentId: "sc-1t51u6v-3"
|
|
38817
|
+
})(["position:absolute;width:14px;height:14px;top:3px;left:3px;right:3px;bottom:3px;border-radius:50%;box-sizing:border-box;"]);
|
|
38808
38818
|
var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
38809
38819
|
var _ref6$isOn = _ref6.isOn,
|
|
38810
38820
|
isOn = _ref6$isOn === void 0 ? false : _ref6$isOn,
|
|
@@ -38821,30 +38831,52 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
|
38821
38831
|
themeValues = _ref6.themeValues,
|
|
38822
38832
|
isMobile = _ref6.isMobile,
|
|
38823
38833
|
dataQa = _ref6.dataQa;
|
|
38824
|
-
var
|
|
38834
|
+
var ToggleSwitchInnerRing = posed(ToggleSwitchInnerRingComponent)({
|
|
38835
|
+
off: {
|
|
38836
|
+
backgroundColor: themeValues.offBackground,
|
|
38837
|
+
transition: {
|
|
38838
|
+
ease: "easeOut"
|
|
38839
|
+
}
|
|
38840
|
+
},
|
|
38841
|
+
on: {
|
|
38842
|
+
backgroundColor: themeValues.onBackground,
|
|
38843
|
+
transition: {
|
|
38844
|
+
ease: "easeIn"
|
|
38845
|
+
}
|
|
38846
|
+
},
|
|
38847
|
+
disabled: {
|
|
38848
|
+
backgroundColor: themeValues.disabledBackground
|
|
38849
|
+
}
|
|
38850
|
+
});
|
|
38851
|
+
var ToggleSwitchMiddleRing = posed(ToggleSwitchMiddleRingComponent)({
|
|
38825
38852
|
off: {
|
|
38826
|
-
backgroundColor:
|
|
38827
|
-
left: "
|
|
38828
|
-
top: "
|
|
38829
|
-
bottom: "
|
|
38830
|
-
right: "
|
|
38853
|
+
backgroundColor: themeValues.white,
|
|
38854
|
+
left: "2px",
|
|
38855
|
+
top: "2px",
|
|
38856
|
+
bottom: "2px",
|
|
38857
|
+
right: "24px",
|
|
38831
38858
|
transition: {
|
|
38832
38859
|
ease: "backIn"
|
|
38833
38860
|
}
|
|
38834
38861
|
},
|
|
38835
38862
|
on: {
|
|
38836
38863
|
backgroundColor: themeValues.white,
|
|
38837
|
-
right: "
|
|
38838
|
-
top: "
|
|
38839
|
-
bottom: "
|
|
38840
|
-
left: "
|
|
38864
|
+
right: "1px",
|
|
38865
|
+
top: "2px",
|
|
38866
|
+
bottom: "2px",
|
|
38867
|
+
left: "25px",
|
|
38841
38868
|
transition: {
|
|
38842
38869
|
ease: "backIn"
|
|
38843
38870
|
}
|
|
38871
|
+
},
|
|
38872
|
+
disabled: {
|
|
38873
|
+
backgroundColor: themeValues.white,
|
|
38874
|
+
left: "2px",
|
|
38875
|
+
top: "2px",
|
|
38876
|
+
bottom: "2px",
|
|
38877
|
+
right: "24px"
|
|
38844
38878
|
}
|
|
38845
38879
|
});
|
|
38846
|
-
|
|
38847
|
-
// to do: for disabled, background color should not be white (should be lighter disabled background)
|
|
38848
38880
|
var VisibleSwitch = posed(VisibleSwitchComponent)({
|
|
38849
38881
|
focusable: true,
|
|
38850
38882
|
hoverable: true,
|
|
@@ -38857,20 +38889,19 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
|
38857
38889
|
boxShadow: "0px 2px 5px 0px rgba(0,0,0,0.5)"
|
|
38858
38890
|
},
|
|
38859
38891
|
off: {
|
|
38860
|
-
|
|
38861
|
-
backgroundColor: disabled ? themeValues.disabledBackgroundLight : themeValues.white,
|
|
38862
|
-
borderColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
|
|
38892
|
+
backgroundColor: themeValues.offBackground,
|
|
38863
38893
|
transition: {
|
|
38864
38894
|
ease: "easeOut"
|
|
38865
38895
|
}
|
|
38866
38896
|
},
|
|
38867
38897
|
on: {
|
|
38868
|
-
|
|
38869
|
-
backgroundColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
|
|
38870
|
-
borderColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
|
|
38898
|
+
backgroundColor: themeValues.onBackground,
|
|
38871
38899
|
transition: {
|
|
38872
38900
|
ease: "easeIn"
|
|
38873
38901
|
}
|
|
38902
|
+
},
|
|
38903
|
+
disabled: {
|
|
38904
|
+
backgroundColor: themeValues.disabledBackground
|
|
38874
38905
|
}
|
|
38875
38906
|
});
|
|
38876
38907
|
var handleKeyDown = function handleKeyDown(e) {
|
|
@@ -38905,11 +38936,11 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
|
38905
38936
|
htmlFor: "#toggle-".concat(name),
|
|
38906
38937
|
onClick: disabled ? noop : onToggle,
|
|
38907
38938
|
onKeyDown: disabled ? noop : handleKeyDown,
|
|
38908
|
-
pose: isOn ? "on" : "off",
|
|
38939
|
+
pose: disabled ? "disabled" : isOn ? "on" : "off",
|
|
38909
38940
|
tabIndex: disabled ? -1 : 0,
|
|
38910
38941
|
disabled: disabled,
|
|
38911
38942
|
isMobile: isMobile
|
|
38912
|
-
}, /*#__PURE__*/React.createElement(
|
|
38943
|
+
}, /*#__PURE__*/React.createElement(ToggleSwitchMiddleRing, null, /*#__PURE__*/React.createElement(ToggleSwitchInnerRing, null))))), label && /*#__PURE__*/React.createElement(Heading$1, {
|
|
38913
38944
|
variant: "h4",
|
|
38914
38945
|
weight: FONT_WEIGHT_SEMIBOLD,
|
|
38915
38946
|
extraStyles: "margin: 0 0.5rem; position: relative; bottom: 1px; display: inline-block;",
|