@instructure/ui-checkbox 8.17.1-snapshot.21 → 8.17.1-snapshot.30

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.
@@ -50,15 +50,11 @@ let CheckboxFacade = (_dec = withStyle(generateStyle, generateComponentTheme), _
50
50
  }
51
51
 
52
52
  componentDidMount() {
53
- var _this$props$makeStyle, _this$props;
54
-
55
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
53
+ this.props.makeStyles?.();
56
54
  }
57
55
 
58
56
  componentDidUpdate() {
59
- var _this$props$makeStyle2, _this$props2;
60
-
61
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
57
+ this.props.makeStyles?.();
62
58
  }
63
59
 
64
60
  renderIcon() {
@@ -82,17 +78,17 @@ let CheckboxFacade = (_dec = withStyle(generateStyle, generateComponentTheme), _
82
78
  }
83
79
 
84
80
  render() {
85
- const _this$props3 = this.props,
86
- children = _this$props3.children,
87
- styles = _this$props3.styles;
81
+ const _this$props = this.props,
82
+ children = _this$props.children,
83
+ styles = _this$props.styles;
88
84
  return jsx("span", {
89
- css: styles === null || styles === void 0 ? void 0 : styles.checkboxFacade,
85
+ css: styles?.checkboxFacade,
90
86
  ref: this.handleRef
91
87
  }, jsx("span", {
92
- css: styles === null || styles === void 0 ? void 0 : styles.facade,
88
+ css: styles?.facade,
93
89
  "aria-hidden": "true"
94
90
  }, this.renderIcon()), jsx("span", {
95
- css: styles === null || styles === void 0 ? void 0 : styles.label
91
+ css: styles?.label
96
92
  }, children));
97
93
  }
98
94
 
@@ -44,30 +44,30 @@ const generateComponentTheme = theme => {
44
44
  }
45
45
  };
46
46
  const componentVariables = {
47
- color: colors === null || colors === void 0 ? void 0 : colors.textLightest,
48
- borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
49
- borderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
50
- borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
51
- background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
52
- marginRight: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
53
- padding: spacing === null || spacing === void 0 ? void 0 : spacing.xxxSmall,
54
- checkedBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundDarkest,
55
- checkedBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderDarkest,
56
- hoverBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderDarkest,
57
- focusBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
58
- focusBorderWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
59
- focusBorderStyle: borders === null || borders === void 0 ? void 0 : borders.style,
60
- labelColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
61
- checkedLabelColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
62
- labelFontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
63
- labelFontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
64
- labelLineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
47
+ color: colors?.textLightest,
48
+ borderWidth: borders?.widthSmall,
49
+ borderColor: colors?.borderMedium,
50
+ borderRadius: borders?.radiusMedium,
51
+ background: colors?.backgroundLightest,
52
+ marginRight: spacing?.xSmall,
53
+ padding: spacing?.xxxSmall,
54
+ checkedBackground: colors?.backgroundDarkest,
55
+ checkedBorderColor: colors?.borderDarkest,
56
+ hoverBorderColor: colors?.borderDarkest,
57
+ focusBorderColor: colors?.borderBrand,
58
+ focusBorderWidth: borders?.widthMedium,
59
+ focusBorderStyle: borders?.style,
60
+ labelColor: colors?.textDarkest,
61
+ checkedLabelColor: colors?.textDarkest,
62
+ labelFontFamily: typography?.fontFamily,
63
+ labelFontWeight: typography?.fontWeightNormal,
64
+ labelLineHeight: typography?.lineHeightCondensed,
65
65
  facadeSizeSmall: '1rem',
66
66
  facadeSizeMedium: '1.25rem',
67
67
  facadeSizeLarge: '1.75rem',
68
- labelFontSizeSmall: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
69
- labelFontSizeMedium: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
70
- labelFontSizeLarge: typography === null || typography === void 0 ? void 0 : typography.fontSizeLarge,
68
+ labelFontSizeSmall: typography?.fontSizeSmall,
69
+ labelFontSizeMedium: typography?.fontSizeMedium,
70
+ labelFontSizeLarge: typography?.fontSizeLarge,
71
71
  iconSizeSmall: '0.625rem',
72
72
  iconSizeMedium: '0.75rem',
73
73
  iconSizeLarge: '1rem'
@@ -49,56 +49,52 @@ let ToggleFacade = (_dec = withStyle(generateStyle, generateComponentTheme), _de
49
49
  }
50
50
 
51
51
  componentDidMount() {
52
- var _this$props$makeStyle, _this$props;
53
-
54
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
52
+ this.props.makeStyles?.();
55
53
  }
56
54
 
57
55
  componentDidUpdate() {
58
- var _this$props$makeStyle2, _this$props2;
59
-
60
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
56
+ this.props.makeStyles?.();
61
57
  }
62
58
 
63
59
  renderIcon() {
64
- const _this$props3 = this.props,
65
- styles = _this$props3.styles,
66
- checked = _this$props3.checked;
60
+ const _this$props = this.props,
61
+ styles = _this$props.styles,
62
+ checked = _this$props.checked;
67
63
 
68
64
  if (checked) {
69
65
  return jsx(IconCheckSolid, {
70
- css: styles === null || styles === void 0 ? void 0 : styles.iconSVG
66
+ css: styles?.iconSVG
71
67
  });
72
68
  } else {
73
69
  return jsx(IconXSolid, {
74
- css: styles === null || styles === void 0 ? void 0 : styles.iconSVG
70
+ css: styles?.iconSVG
75
71
  });
76
72
  }
77
73
  }
78
74
 
79
75
  renderLabel() {
80
- const _this$props4 = this.props,
81
- children = _this$props4.children,
82
- styles = _this$props4.styles;
76
+ const _this$props2 = this.props,
77
+ children = _this$props2.children,
78
+ styles = _this$props2.styles;
83
79
  return jsx("span", {
84
- css: styles === null || styles === void 0 ? void 0 : styles.label
80
+ css: styles?.label
85
81
  }, children);
86
82
  }
87
83
 
88
84
  render() {
89
- const _this$props5 = this.props,
90
- labelPlacement = _this$props5.labelPlacement,
91
- styles = _this$props5.styles;
85
+ const _this$props3 = this.props,
86
+ labelPlacement = _this$props3.labelPlacement,
87
+ styles = _this$props3.styles;
92
88
  return jsx("span", {
93
- css: styles === null || styles === void 0 ? void 0 : styles.toggleFacade,
89
+ css: styles?.toggleFacade,
94
90
  ref: this.handleRef
95
91
  }, (labelPlacement === 'top' || labelPlacement === 'start') && this.renderLabel(), jsx("span", {
96
- css: styles === null || styles === void 0 ? void 0 : styles.facade,
92
+ css: styles?.facade,
97
93
  "aria-hidden": "true"
98
94
  }, jsx("span", {
99
- css: styles === null || styles === void 0 ? void 0 : styles.icon
95
+ css: styles?.icon
100
96
  }, jsx("span", {
101
- css: styles === null || styles === void 0 ? void 0 : styles.iconToggle
97
+ css: styles?.iconToggle
102
98
  }, this.renderIcon()))), labelPlacement === 'end' && this.renderLabel());
103
99
  }
104
100
 
@@ -41,35 +41,35 @@ const generateComponentTheme = theme => {
41
41
  labelColor: theme['ic-brand-font-color-dark']
42
42
  },
43
43
  'canvas-high-contrast': {
44
- background: colors === null || colors === void 0 ? void 0 : colors.backgroundDarkest,
45
- borderColor: colors === null || colors === void 0 ? void 0 : colors.borderDarkest
44
+ background: colors?.backgroundDarkest,
45
+ borderColor: colors?.borderDarkest
46
46
  }
47
47
  };
48
48
  const componentVariables = {
49
- color: colors === null || colors === void 0 ? void 0 : colors.textLightest,
50
- background: colors === null || colors === void 0 ? void 0 : colors.backgroundLight,
51
- borderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
52
- borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
49
+ color: colors?.textLightest,
50
+ background: colors?.backgroundLight,
51
+ borderColor: colors?.borderMedium,
52
+ borderWidth: borders?.widthSmall,
53
53
  borderRadius: '4rem',
54
- marginEnd: spacing === null || spacing === void 0 ? void 0 : spacing.small,
55
- marginStart: spacing === null || spacing === void 0 ? void 0 : spacing.small,
56
- marginVertical: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
57
- checkedBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundSuccess,
58
- uncheckedIconColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
59
- checkedIconColor: colors === null || colors === void 0 ? void 0 : colors.textSuccess,
60
- focusOutlineColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
61
- focusBorderWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
62
- focusBorderStyle: borders === null || borders === void 0 ? void 0 : borders.style,
63
- toggleBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
64
- toggleShadow: shadows === null || shadows === void 0 ? void 0 : shadows.depth1,
65
- toggleSize: forms === null || forms === void 0 ? void 0 : forms.inputHeightSmall,
66
- labelColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
67
- labelFontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
68
- labelFontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
69
- labelLineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
70
- labelFontSizeSmall: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
71
- labelFontSizeMedium: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
72
- labelFontSizeLarge: typography === null || typography === void 0 ? void 0 : typography.fontSizeLarge
54
+ marginEnd: spacing?.small,
55
+ marginStart: spacing?.small,
56
+ marginVertical: spacing?.xSmall,
57
+ checkedBackground: colors?.backgroundSuccess,
58
+ uncheckedIconColor: colors?.textDarkest,
59
+ checkedIconColor: colors?.textSuccess,
60
+ focusOutlineColor: colors?.borderBrand,
61
+ focusBorderWidth: borders?.widthMedium,
62
+ focusBorderStyle: borders?.style,
63
+ toggleBackground: colors?.backgroundLightest,
64
+ toggleShadow: shadows?.depth1,
65
+ toggleSize: forms?.inputHeightSmall,
66
+ labelColor: colors?.textDarkest,
67
+ labelFontFamily: typography?.fontFamily,
68
+ labelFontWeight: typography?.fontWeightNormal,
69
+ labelLineHeight: typography?.lineHeightCondensed,
70
+ labelFontSizeSmall: typography?.fontSizeSmall,
71
+ labelFontSizeMedium: typography?.fontSizeMedium,
72
+ labelFontSizeLarge: typography?.fontSizeLarge
73
73
  };
74
74
  return { ...componentVariables,
75
75
  ...themeSpecificStyle[themeName]
@@ -127,23 +127,19 @@ let Checkbox = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, n
127
127
  }
128
128
 
129
129
  componentDidMount() {
130
- var _this$props$makeStyle, _this$props2;
131
-
132
130
  if (this._input) {
133
131
  this._input.indeterminate = this.props.indeterminate;
134
132
  }
135
133
 
136
- (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
134
+ this.props.makeStyles?.();
137
135
  }
138
136
 
139
137
  componentDidUpdate(prevProps) {
140
- var _this$props$makeStyle2, _this$props3;
141
-
142
138
  if (prevProps.indeterminate !== this.props.indeterminate && this._input) {
143
139
  this._input.indeterminate = this.props.indeterminate || false;
144
140
  }
145
141
 
146
- (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
142
+ this.props.makeStyles?.();
147
143
  }
148
144
 
149
145
  get id() {
@@ -163,15 +159,15 @@ let Checkbox = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, n
163
159
  }
164
160
 
165
161
  renderFacade() {
166
- const _this$props4 = this.props,
167
- size = _this$props4.size,
168
- disabled = _this$props4.disabled,
169
- variant = _this$props4.variant,
170
- label = _this$props4.label,
171
- readOnly = _this$props4.readOnly,
172
- indeterminate = _this$props4.indeterminate,
173
- labelPlacement = _this$props4.labelPlacement,
174
- themeOverride = _this$props4.themeOverride;
162
+ const _this$props2 = this.props,
163
+ size = _this$props2.size,
164
+ disabled = _this$props2.disabled,
165
+ variant = _this$props2.variant,
166
+ label = _this$props2.label,
167
+ readOnly = _this$props2.readOnly,
168
+ indeterminate = _this$props2.indeterminate,
169
+ labelPlacement = _this$props2.labelPlacement,
170
+ themeOverride = _this$props2.themeOverride;
175
171
  const _this$state = this.state,
176
172
  hovered = _this$state.hovered,
177
173
  focused = _this$state.focused;
@@ -210,24 +206,24 @@ let Checkbox = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, n
210
206
  }
211
207
 
212
208
  render() {
213
- const _this$props5 = this.props,
214
- disabled = _this$props5.disabled,
215
- readOnly = _this$props5.readOnly,
216
- value = _this$props5.value,
217
- onKeyDown = _this$props5.onKeyDown,
218
- onFocus = _this$props5.onFocus,
219
- onBlur = _this$props5.onBlur,
220
- onMouseOver = _this$props5.onMouseOver,
221
- onMouseOut = _this$props5.onMouseOut,
222
- indeterminate = _this$props5.indeterminate,
223
- variant = _this$props5.variant,
224
- styles = _this$props5.styles;
209
+ const _this$props3 = this.props,
210
+ disabled = _this$props3.disabled,
211
+ readOnly = _this$props3.readOnly,
212
+ value = _this$props3.value,
213
+ onKeyDown = _this$props3.onKeyDown,
214
+ onFocus = _this$props3.onFocus,
215
+ onBlur = _this$props3.onBlur,
216
+ onMouseOver = _this$props3.onMouseOver,
217
+ onMouseOut = _this$props3.onMouseOut,
218
+ indeterminate = _this$props3.indeterminate,
219
+ variant = _this$props3.variant,
220
+ styles = _this$props3.styles;
225
221
  const props = omitProps(this.props, Checkbox.allowedProps);
226
222
  error(!(variant === 'toggle' && indeterminate), `[Checkbox] The \`toggle\` variant does not support the \`indeterminate\` property. Use the \`simple\` variant instead.`);
227
223
  /* eslint-disable jsx-a11y/mouse-events-have-key-events */
228
224
 
229
225
  return jsx("div", {
230
- css: styles === null || styles === void 0 ? void 0 : styles.checkbox,
226
+ css: styles?.checkbox,
231
227
  onMouseOver: createChainedFunction(onMouseOver, this.handleMouseOver),
232
228
  onMouseOut: createChainedFunction(onMouseOut, this.handleMouseOut),
233
229
  ref: this.handleRef
@@ -240,7 +236,7 @@ let Checkbox = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, n
240
236
  },
241
237
  disabled: disabled || readOnly,
242
238
  "aria-checked": indeterminate ? 'mixed' : void 0,
243
- css: styles === null || styles === void 0 ? void 0 : styles.input,
239
+ css: styles?.input,
244
240
  onChange: this.handleChange,
245
241
  onKeyDown: createChainedFunction(onKeyDown, this.handleKeyDown),
246
242
  onFocus: createChainedFunction(onFocus, this.handleFocus),
@@ -248,7 +244,7 @@ let Checkbox = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, n
248
244
  checked: this.checked
249
245
  })), jsx("label", {
250
246
  htmlFor: this.id,
251
- css: styles === null || styles === void 0 ? void 0 : styles.control
247
+ css: styles?.control
252
248
  }, this.renderFacade(), this.renderMessages()));
253
249
  /* eslint-enable jsx-a11y/mouse-events-have-key-events */
254
250
  }
@@ -40,15 +40,11 @@ let CheckboxFacade = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
40
40
  }
41
41
 
42
42
  componentDidMount() {
43
- var _this$props$makeStyle, _this$props;
44
-
45
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
43
+ this.props.makeStyles?.();
46
44
  }
47
45
 
48
46
  componentDidUpdate() {
49
- var _this$props$makeStyle2, _this$props2;
50
-
51
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
47
+ this.props.makeStyles?.();
52
48
  }
53
49
 
54
50
  renderIcon() {
@@ -72,17 +68,17 @@ let CheckboxFacade = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
72
68
  }
73
69
 
74
70
  render() {
75
- const _this$props3 = this.props,
76
- children = _this$props3.children,
77
- styles = _this$props3.styles;
71
+ const _this$props = this.props,
72
+ children = _this$props.children,
73
+ styles = _this$props.styles;
78
74
  return (0, _emotion.jsx)("span", {
79
- css: styles === null || styles === void 0 ? void 0 : styles.checkboxFacade,
75
+ css: styles?.checkboxFacade,
80
76
  ref: this.handleRef
81
77
  }, (0, _emotion.jsx)("span", {
82
- css: styles === null || styles === void 0 ? void 0 : styles.facade,
78
+ css: styles?.facade,
83
79
  "aria-hidden": "true"
84
80
  }, this.renderIcon()), (0, _emotion.jsx)("span", {
85
- css: styles === null || styles === void 0 ? void 0 : styles.label
81
+ css: styles?.label
86
82
  }, children));
87
83
  }
88
84
 
@@ -51,30 +51,30 @@ const generateComponentTheme = theme => {
51
51
  }
52
52
  };
53
53
  const componentVariables = {
54
- color: colors === null || colors === void 0 ? void 0 : colors.textLightest,
55
- borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
56
- borderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
57
- borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
58
- background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
59
- marginRight: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
60
- padding: spacing === null || spacing === void 0 ? void 0 : spacing.xxxSmall,
61
- checkedBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundDarkest,
62
- checkedBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderDarkest,
63
- hoverBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderDarkest,
64
- focusBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
65
- focusBorderWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
66
- focusBorderStyle: borders === null || borders === void 0 ? void 0 : borders.style,
67
- labelColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
68
- checkedLabelColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
69
- labelFontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
70
- labelFontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
71
- labelLineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
54
+ color: colors?.textLightest,
55
+ borderWidth: borders?.widthSmall,
56
+ borderColor: colors?.borderMedium,
57
+ borderRadius: borders?.radiusMedium,
58
+ background: colors?.backgroundLightest,
59
+ marginRight: spacing?.xSmall,
60
+ padding: spacing?.xxxSmall,
61
+ checkedBackground: colors?.backgroundDarkest,
62
+ checkedBorderColor: colors?.borderDarkest,
63
+ hoverBorderColor: colors?.borderDarkest,
64
+ focusBorderColor: colors?.borderBrand,
65
+ focusBorderWidth: borders?.widthMedium,
66
+ focusBorderStyle: borders?.style,
67
+ labelColor: colors?.textDarkest,
68
+ checkedLabelColor: colors?.textDarkest,
69
+ labelFontFamily: typography?.fontFamily,
70
+ labelFontWeight: typography?.fontWeightNormal,
71
+ labelLineHeight: typography?.lineHeightCondensed,
72
72
  facadeSizeSmall: '1rem',
73
73
  facadeSizeMedium: '1.25rem',
74
74
  facadeSizeLarge: '1.75rem',
75
- labelFontSizeSmall: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
76
- labelFontSizeMedium: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
77
- labelFontSizeLarge: typography === null || typography === void 0 ? void 0 : typography.fontSizeLarge,
75
+ labelFontSizeSmall: typography?.fontSizeSmall,
76
+ labelFontSizeMedium: typography?.fontSizeMedium,
77
+ labelFontSizeLarge: typography?.fontSizeLarge,
78
78
  iconSizeSmall: '0.625rem',
79
79
  iconSizeMedium: '0.75rem',
80
80
  iconSizeLarge: '1rem'
@@ -40,56 +40,52 @@ let ToggleFacade = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defau
40
40
  }
41
41
 
42
42
  componentDidMount() {
43
- var _this$props$makeStyle, _this$props;
44
-
45
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
43
+ this.props.makeStyles?.();
46
44
  }
47
45
 
48
46
  componentDidUpdate() {
49
- var _this$props$makeStyle2, _this$props2;
50
-
51
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
47
+ this.props.makeStyles?.();
52
48
  }
53
49
 
54
50
  renderIcon() {
55
- const _this$props3 = this.props,
56
- styles = _this$props3.styles,
57
- checked = _this$props3.checked;
51
+ const _this$props = this.props,
52
+ styles = _this$props.styles,
53
+ checked = _this$props.checked;
58
54
 
59
55
  if (checked) {
60
56
  return (0, _emotion.jsx)(_IconCheckSolid.IconCheckSolid, {
61
- css: styles === null || styles === void 0 ? void 0 : styles.iconSVG
57
+ css: styles?.iconSVG
62
58
  });
63
59
  } else {
64
60
  return (0, _emotion.jsx)(_IconXSolid.IconXSolid, {
65
- css: styles === null || styles === void 0 ? void 0 : styles.iconSVG
61
+ css: styles?.iconSVG
66
62
  });
67
63
  }
68
64
  }
69
65
 
70
66
  renderLabel() {
71
- const _this$props4 = this.props,
72
- children = _this$props4.children,
73
- styles = _this$props4.styles;
67
+ const _this$props2 = this.props,
68
+ children = _this$props2.children,
69
+ styles = _this$props2.styles;
74
70
  return (0, _emotion.jsx)("span", {
75
- css: styles === null || styles === void 0 ? void 0 : styles.label
71
+ css: styles?.label
76
72
  }, children);
77
73
  }
78
74
 
79
75
  render() {
80
- const _this$props5 = this.props,
81
- labelPlacement = _this$props5.labelPlacement,
82
- styles = _this$props5.styles;
76
+ const _this$props3 = this.props,
77
+ labelPlacement = _this$props3.labelPlacement,
78
+ styles = _this$props3.styles;
83
79
  return (0, _emotion.jsx)("span", {
84
- css: styles === null || styles === void 0 ? void 0 : styles.toggleFacade,
80
+ css: styles?.toggleFacade,
85
81
  ref: this.handleRef
86
82
  }, (labelPlacement === 'top' || labelPlacement === 'start') && this.renderLabel(), (0, _emotion.jsx)("span", {
87
- css: styles === null || styles === void 0 ? void 0 : styles.facade,
83
+ css: styles?.facade,
88
84
  "aria-hidden": "true"
89
85
  }, (0, _emotion.jsx)("span", {
90
- css: styles === null || styles === void 0 ? void 0 : styles.icon
86
+ css: styles?.icon
91
87
  }, (0, _emotion.jsx)("span", {
92
- css: styles === null || styles === void 0 ? void 0 : styles.iconToggle
88
+ css: styles?.iconToggle
93
89
  }, this.renderIcon()))), labelPlacement === 'end' && this.renderLabel());
94
90
  }
95
91
 
@@ -48,35 +48,35 @@ const generateComponentTheme = theme => {
48
48
  labelColor: theme['ic-brand-font-color-dark']
49
49
  },
50
50
  'canvas-high-contrast': {
51
- background: colors === null || colors === void 0 ? void 0 : colors.backgroundDarkest,
52
- borderColor: colors === null || colors === void 0 ? void 0 : colors.borderDarkest
51
+ background: colors?.backgroundDarkest,
52
+ borderColor: colors?.borderDarkest
53
53
  }
54
54
  };
55
55
  const componentVariables = {
56
- color: colors === null || colors === void 0 ? void 0 : colors.textLightest,
57
- background: colors === null || colors === void 0 ? void 0 : colors.backgroundLight,
58
- borderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
59
- borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
56
+ color: colors?.textLightest,
57
+ background: colors?.backgroundLight,
58
+ borderColor: colors?.borderMedium,
59
+ borderWidth: borders?.widthSmall,
60
60
  borderRadius: '4rem',
61
- marginEnd: spacing === null || spacing === void 0 ? void 0 : spacing.small,
62
- marginStart: spacing === null || spacing === void 0 ? void 0 : spacing.small,
63
- marginVertical: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
64
- checkedBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundSuccess,
65
- uncheckedIconColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
66
- checkedIconColor: colors === null || colors === void 0 ? void 0 : colors.textSuccess,
67
- focusOutlineColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
68
- focusBorderWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
69
- focusBorderStyle: borders === null || borders === void 0 ? void 0 : borders.style,
70
- toggleBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
71
- toggleShadow: shadows === null || shadows === void 0 ? void 0 : shadows.depth1,
72
- toggleSize: forms === null || forms === void 0 ? void 0 : forms.inputHeightSmall,
73
- labelColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
74
- labelFontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
75
- labelFontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
76
- labelLineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
77
- labelFontSizeSmall: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
78
- labelFontSizeMedium: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
79
- labelFontSizeLarge: typography === null || typography === void 0 ? void 0 : typography.fontSizeLarge
61
+ marginEnd: spacing?.small,
62
+ marginStart: spacing?.small,
63
+ marginVertical: spacing?.xSmall,
64
+ checkedBackground: colors?.backgroundSuccess,
65
+ uncheckedIconColor: colors?.textDarkest,
66
+ checkedIconColor: colors?.textSuccess,
67
+ focusOutlineColor: colors?.borderBrand,
68
+ focusBorderWidth: borders?.widthMedium,
69
+ focusBorderStyle: borders?.style,
70
+ toggleBackground: colors?.backgroundLightest,
71
+ toggleShadow: shadows?.depth1,
72
+ toggleSize: forms?.inputHeightSmall,
73
+ labelColor: colors?.textDarkest,
74
+ labelFontFamily: typography?.fontFamily,
75
+ labelFontWeight: typography?.fontWeightNormal,
76
+ labelLineHeight: typography?.lineHeightCondensed,
77
+ labelFontSizeSmall: typography?.fontSizeSmall,
78
+ labelFontSizeMedium: typography?.fontSizeMedium,
79
+ labelFontSizeLarge: typography?.fontSizeLarge
80
80
  };
81
81
  return { ...componentVariables,
82
82
  ...themeSpecificStyle[themeName]