@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 CHANGED
@@ -39111,17 +39111,17 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
39111
39111
  };
39112
39112
 
39113
39113
  var onBackground = "".concat(MATISSE_BLUE);
39114
- var disabledBackground = "".concat(IRON_GREY);
39114
+ var disabledBackground = "".concat(MANATEE_GREY);
39115
+ var disabledBackgroundLight = "".concat(ATHENS_GREY);
39115
39116
  var white = "".concat(WHITE);
39116
- var offBackground = "".concat(REGENT_GREY);
39117
39117
  var labelStyles = "\n display: flex;\n justify-content: flex-start;\n align-items: center;\n";
39118
39118
  var rightLabelStyles = "\n ".concat(labelStyles, "\n flex-direction: row;\n");
39119
39119
  var leftLabelStyles = "\n ".concat(labelStyles, "\n flex-direction: row-reverse;\n");
39120
39120
  var fallbackValues$y = {
39121
39121
  onBackground: onBackground,
39122
39122
  disabledBackground: disabledBackground,
39123
+ disabledBackgroundLight: disabledBackgroundLight,
39123
39124
  white: white,
39124
- offBackground: offBackground,
39125
39125
  rightLabelStyles: rightLabelStyles,
39126
39126
  leftLabelStyles: leftLabelStyles
39127
39127
  };
@@ -39139,7 +39139,7 @@ var HiddenToggleSwitchBox = styled__default.input.withConfig({
39139
39139
  var VisibleSwitchComponent = styled__default.label.withConfig({
39140
39140
  displayName: "ToggleSwitch__VisibleSwitchComponent",
39141
39141
  componentId: "sc-1t51u6v-1"
39142
- })(["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) {
39142
+ })(["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) {
39143
39143
  var disabled = _ref3.disabled;
39144
39144
  return disabled ? "auto" : "pointer";
39145
39145
  }, function (_ref4) {
@@ -39149,14 +39149,10 @@ var VisibleSwitchComponent = styled__default.label.withConfig({
39149
39149
  var isMobile = _ref5.isMobile;
39150
39150
  return isMobile ? "transform: scale(0.75)" : "";
39151
39151
  });
39152
- var ToggleSwitchMiddleRingComponent = styled__default.div.withConfig({
39153
- displayName: "ToggleSwitch__ToggleSwitchMiddleRingComponent",
39152
+ var ToggleSwitchRingComponent = styled__default.div.withConfig({
39153
+ displayName: "ToggleSwitch__ToggleSwitchRingComponent",
39154
39154
  componentId: "sc-1t51u6v-2"
39155
- })(["position:absolute;width:20px;height:20px;border:none;border-radius:50%;box-sizing:border-box;"]);
39156
- var ToggleSwitchInnerRingComponent = styled__default.div.withConfig({
39157
- displayName: "ToggleSwitch__ToggleSwitchInnerRingComponent",
39158
- componentId: "sc-1t51u6v-3"
39159
- })(["position:absolute;width:14px;height:14px;top:3px;left:3px;right:3px;bottom:3px;border-radius:50%;box-sizing:border-box;"]);
39155
+ })(["position:absolute;width:16px;height:16px;border:none;border-radius:50%;box-sizing:border-box;"]);
39160
39156
  var ToggleSwitch = function ToggleSwitch(_ref6) {
39161
39157
  var _ref6$isOn = _ref6.isOn,
39162
39158
  isOn = _ref6$isOn === void 0 ? false : _ref6$isOn,
@@ -39173,50 +39169,26 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
39173
39169
  themeValues = _ref6.themeValues,
39174
39170
  isMobile = _ref6.isMobile,
39175
39171
  dataQa = _ref6.dataQa;
39176
- var ToggleSwitchInnerRing = posed(ToggleSwitchInnerRingComponent)({
39172
+ var ToggleSwitchRing = posed(ToggleSwitchRingComponent)({
39177
39173
  off: {
39178
- backgroundColor: themeValues.offBackground,
39179
- transition: {
39180
- ease: "easeOut"
39181
- }
39182
- },
39183
- on: {
39184
- backgroundColor: themeValues.onBackground,
39185
- transition: {
39186
- ease: "easeIn"
39187
- }
39188
- },
39189
- disabled: {
39190
- backgroundColor: themeValues.disabledBackground
39191
- }
39192
- });
39193
- var ToggleSwitchMiddleRing = posed(ToggleSwitchMiddleRingComponent)({
39194
- off: {
39195
- backgroundColor: themeValues.white,
39196
- left: "2px",
39197
- top: "2px",
39198
- bottom: "2px",
39199
- right: "24px",
39174
+ backgroundColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
39175
+ left: "4px",
39176
+ top: "3px",
39177
+ bottom: "3px",
39178
+ right: "20px",
39200
39179
  transition: {
39201
39180
  ease: "backIn"
39202
39181
  }
39203
39182
  },
39204
39183
  on: {
39205
39184
  backgroundColor: themeValues.white,
39206
- right: "1px",
39207
- top: "2px",
39208
- bottom: "2px",
39209
- left: "25px",
39185
+ right: "8px",
39186
+ top: "3px",
39187
+ bottom: "3px",
39188
+ left: "22px",
39210
39189
  transition: {
39211
39190
  ease: "backIn"
39212
39191
  }
39213
- },
39214
- disabled: {
39215
- backgroundColor: themeValues.white,
39216
- left: "2px",
39217
- top: "2px",
39218
- bottom: "2px",
39219
- right: "24px"
39220
39192
  }
39221
39193
  });
39222
39194
  var VisibleSwitch = posed(VisibleSwitchComponent)({
@@ -39231,19 +39203,20 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
39231
39203
  boxShadow: "0px 2px 5px 0px rgba(0,0,0,0.5)"
39232
39204
  },
39233
39205
  off: {
39234
- backgroundColor: themeValues.offBackground,
39206
+ border: "1px solid",
39207
+ backgroundColor: disabled ? themeValues.disabledBackgroundLight : themeValues.white,
39208
+ borderColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
39235
39209
  transition: {
39236
39210
  ease: "easeOut"
39237
39211
  }
39238
39212
  },
39239
39213
  on: {
39240
- backgroundColor: themeValues.onBackground,
39214
+ border: "1px solid",
39215
+ backgroundColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
39216
+ borderColor: disabled ? themeValues.disabledBackground : themeValues.onBackground,
39241
39217
  transition: {
39242
39218
  ease: "easeIn"
39243
39219
  }
39244
- },
39245
- disabled: {
39246
- backgroundColor: themeValues.disabledBackground
39247
39220
  }
39248
39221
  });
39249
39222
  var handleKeyDown = function handleKeyDown(e) {
@@ -39278,11 +39251,11 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
39278
39251
  htmlFor: "#toggle-".concat(name),
39279
39252
  onClick: disabled ? noop : onToggle,
39280
39253
  onKeyDown: disabled ? noop : handleKeyDown,
39281
- pose: disabled ? "disabled" : isOn ? "on" : "off",
39254
+ pose: isOn ? "on" : "off",
39282
39255
  tabIndex: disabled ? -1 : 0,
39283
39256
  disabled: disabled,
39284
39257
  isMobile: isMobile
39285
- }, /*#__PURE__*/React__default.createElement(ToggleSwitchMiddleRing, null, /*#__PURE__*/React__default.createElement(ToggleSwitchInnerRing, null))))), label && /*#__PURE__*/React__default.createElement(Heading$1, {
39258
+ }, /*#__PURE__*/React__default.createElement(ToggleSwitchRing, null)))), label && /*#__PURE__*/React__default.createElement(Heading$1, {
39286
39259
  variant: "h4",
39287
39260
  weight: FONT_WEIGHT_SEMIBOLD,
39288
39261
  extraStyles: "margin: 0 0.5rem; position: relative; bottom: 1px; display: inline-block;",