@thecb/components 10.5.4 → 10.5.5
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 +25 -52
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +25 -52
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/toggle-switch/ToggleSwitch.js +33 -61
- package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +2 -3
- package/src/components/atoms/toggle-switch/ToggleSwitch.theme.js +5 -5
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
package/dist/index.esm.js
CHANGED
|
@@ -39103,17 +39103,17 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
39103
39103
|
};
|
|
39104
39104
|
|
|
39105
39105
|
var onBackground = "".concat(MATISSE_BLUE);
|
|
39106
|
-
var disabledBackground = "".concat(
|
|
39106
|
+
var disabledBackground = "".concat(MANATEE_GREY);
|
|
39107
|
+
var disabledBackgroundLight = "".concat(ATHENS_GREY);
|
|
39107
39108
|
var white = "".concat(WHITE);
|
|
39108
|
-
var offBackground = "".concat(REGENT_GREY);
|
|
39109
39109
|
var labelStyles = "\n display: flex;\n justify-content: flex-start;\n align-items: center;\n";
|
|
39110
39110
|
var rightLabelStyles = "\n ".concat(labelStyles, "\n flex-direction: row;\n");
|
|
39111
39111
|
var leftLabelStyles = "\n ".concat(labelStyles, "\n flex-direction: row-reverse;\n");
|
|
39112
39112
|
var fallbackValues$y = {
|
|
39113
39113
|
onBackground: onBackground,
|
|
39114
39114
|
disabledBackground: disabledBackground,
|
|
39115
|
+
disabledBackgroundLight: disabledBackgroundLight,
|
|
39115
39116
|
white: white,
|
|
39116
|
-
offBackground: offBackground,
|
|
39117
39117
|
rightLabelStyles: rightLabelStyles,
|
|
39118
39118
|
leftLabelStyles: leftLabelStyles
|
|
39119
39119
|
};
|
|
@@ -39131,7 +39131,7 @@ var HiddenToggleSwitchBox = styled.input.withConfig({
|
|
|
39131
39131
|
var VisibleSwitchComponent = styled.label.withConfig({
|
|
39132
39132
|
displayName: "ToggleSwitch__VisibleSwitchComponent",
|
|
39133
39133
|
componentId: "sc-1t51u6v-1"
|
|
39134
|
-
})(["width:
|
|
39134
|
+
})(["width:44px;height:24px;border-radius:12px;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) {
|
|
39135
39135
|
var disabled = _ref3.disabled;
|
|
39136
39136
|
return disabled ? "auto" : "pointer";
|
|
39137
39137
|
}, function (_ref4) {
|
|
@@ -39141,14 +39141,10 @@ var VisibleSwitchComponent = styled.label.withConfig({
|
|
|
39141
39141
|
var isMobile = _ref5.isMobile;
|
|
39142
39142
|
return isMobile ? "transform: scale(0.75)" : "";
|
|
39143
39143
|
});
|
|
39144
|
-
var
|
|
39145
|
-
displayName: "
|
|
39144
|
+
var ToggleSwitchRingComponent = styled.div.withConfig({
|
|
39145
|
+
displayName: "ToggleSwitch__ToggleSwitchRingComponent",
|
|
39146
39146
|
componentId: "sc-1t51u6v-2"
|
|
39147
|
-
})(["position:absolute;width:
|
|
39148
|
-
var ToggleSwitchInnerRingComponent = styled.div.withConfig({
|
|
39149
|
-
displayName: "ToggleSwitch__ToggleSwitchInnerRingComponent",
|
|
39150
|
-
componentId: "sc-1t51u6v-3"
|
|
39151
|
-
})(["position:absolute;width:14px;height:14px;top:3px;left:3px;right:3px;bottom:3px;border-radius:50%;box-sizing:border-box;"]);
|
|
39147
|
+
})(["position:absolute;width:16px;height:16px;border:none;border-radius:50%;box-sizing:border-box;"]);
|
|
39152
39148
|
var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
39153
39149
|
var _ref6$isOn = _ref6.isOn,
|
|
39154
39150
|
isOn = _ref6$isOn === void 0 ? false : _ref6$isOn,
|
|
@@ -39165,50 +39161,26 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
|
39165
39161
|
themeValues = _ref6.themeValues,
|
|
39166
39162
|
isMobile = _ref6.isMobile,
|
|
39167
39163
|
dataQa = _ref6.dataQa;
|
|
39168
|
-
var
|
|
39164
|
+
var ToggleSwitchRing = posed(ToggleSwitchRingComponent)({
|
|
39169
39165
|
off: {
|
|
39170
|
-
backgroundColor: themeValues.
|
|
39171
|
-
|
|
39172
|
-
|
|
39173
|
-
|
|
39174
|
-
|
|
39175
|
-
on: {
|
|
39176
|
-
backgroundColor: themeValues.onBackground,
|
|
39177
|
-
transition: {
|
|
39178
|
-
ease: "easeIn"
|
|
39179
|
-
}
|
|
39180
|
-
},
|
|
39181
|
-
disabled: {
|
|
39182
|
-
backgroundColor: themeValues.disabledBackground
|
|
39183
|
-
}
|
|
39184
|
-
});
|
|
39185
|
-
var ToggleSwitchMiddleRing = posed(ToggleSwitchMiddleRingComponent)({
|
|
39186
|
-
off: {
|
|
39187
|
-
backgroundColor: themeValues.white,
|
|
39188
|
-
left: "2px",
|
|
39189
|
-
top: "2px",
|
|
39190
|
-
bottom: "2px",
|
|
39191
|
-
right: "24px",
|
|
39166
|
+
backgroundColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
|
|
39167
|
+
left: "4px",
|
|
39168
|
+
top: "3px",
|
|
39169
|
+
bottom: "3px",
|
|
39170
|
+
right: "20px",
|
|
39192
39171
|
transition: {
|
|
39193
39172
|
ease: "backIn"
|
|
39194
39173
|
}
|
|
39195
39174
|
},
|
|
39196
39175
|
on: {
|
|
39197
39176
|
backgroundColor: themeValues.white,
|
|
39198
|
-
right: "
|
|
39199
|
-
top: "
|
|
39200
|
-
bottom: "
|
|
39201
|
-
left: "
|
|
39177
|
+
right: "8px",
|
|
39178
|
+
top: "3px",
|
|
39179
|
+
bottom: "3px",
|
|
39180
|
+
left: "22px",
|
|
39202
39181
|
transition: {
|
|
39203
39182
|
ease: "backIn"
|
|
39204
39183
|
}
|
|
39205
|
-
},
|
|
39206
|
-
disabled: {
|
|
39207
|
-
backgroundColor: themeValues.white,
|
|
39208
|
-
left: "2px",
|
|
39209
|
-
top: "2px",
|
|
39210
|
-
bottom: "2px",
|
|
39211
|
-
right: "24px"
|
|
39212
39184
|
}
|
|
39213
39185
|
});
|
|
39214
39186
|
var VisibleSwitch = posed(VisibleSwitchComponent)({
|
|
@@ -39223,19 +39195,20 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
|
39223
39195
|
boxShadow: "0px 2px 5px 0px rgba(0,0,0,0.5)"
|
|
39224
39196
|
},
|
|
39225
39197
|
off: {
|
|
39226
|
-
|
|
39198
|
+
border: "1px solid",
|
|
39199
|
+
backgroundColor: disabled ? themeValues.disabledBackgroundLight : themeValues.white,
|
|
39200
|
+
borderColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
|
|
39227
39201
|
transition: {
|
|
39228
39202
|
ease: "easeOut"
|
|
39229
39203
|
}
|
|
39230
39204
|
},
|
|
39231
39205
|
on: {
|
|
39232
|
-
|
|
39206
|
+
border: "1px solid",
|
|
39207
|
+
backgroundColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
|
|
39208
|
+
borderColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
|
|
39233
39209
|
transition: {
|
|
39234
39210
|
ease: "easeIn"
|
|
39235
39211
|
}
|
|
39236
|
-
},
|
|
39237
|
-
disabled: {
|
|
39238
|
-
backgroundColor: themeValues.disabledBackground
|
|
39239
39212
|
}
|
|
39240
39213
|
});
|
|
39241
39214
|
var handleKeyDown = function handleKeyDown(e) {
|
|
@@ -39270,11 +39243,11 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
|
|
|
39270
39243
|
htmlFor: "#toggle-".concat(name),
|
|
39271
39244
|
onClick: disabled ? noop : onToggle,
|
|
39272
39245
|
onKeyDown: disabled ? noop : handleKeyDown,
|
|
39273
|
-
pose:
|
|
39246
|
+
pose: isOn ? "on" : "off",
|
|
39274
39247
|
tabIndex: disabled ? -1 : 0,
|
|
39275
39248
|
disabled: disabled,
|
|
39276
39249
|
isMobile: isMobile
|
|
39277
|
-
}, /*#__PURE__*/React.createElement(
|
|
39250
|
+
}, /*#__PURE__*/React.createElement(ToggleSwitchRing, null)))), label && /*#__PURE__*/React.createElement(Heading$1, {
|
|
39278
39251
|
variant: "h4",
|
|
39279
39252
|
weight: FONT_WEIGHT_SEMIBOLD,
|
|
39280
39253
|
extraStyles: "margin: 0 0.5rem; position: relative; bottom: 1px; display: inline-block;",
|