@instructure/ui-checkbox 10.2.2-snapshot-5 → 10.2.2-snapshot-7

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/CHANGELOG.md CHANGED
@@ -3,9 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [10.2.2-snapshot-5](https://github.com/instructure/instructure-ui/compare/v10.2.1...v10.2.2-snapshot-5) (2024-09-10)
6
+ ## [10.2.2-snapshot-7](https://github.com/instructure/instructure-ui/compare/v10.2.1...v10.2.2-snapshot-7) (2024-09-10)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-checkbox
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ui-checkbox,ui-radio-input:** reduce clickable area of checkbox and radioinput ([77b2a7d](https://github.com/instructure/instructure-ui/commit/77b2a7d18da19f28328486e53a31f7ca5ec37e74))
9
12
 
10
13
 
11
14
 
@@ -199,6 +199,8 @@ let Checkbox = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, n
199
199
  onMouseOver: createChainedFunction(onMouseOver, this.handleMouseOver),
200
200
  onMouseOut: createChainedFunction(onMouseOut, this.handleMouseOut),
201
201
  ref: this.handleRef
202
+ }, jsx("div", {
203
+ css: styles === null || styles === void 0 ? void 0 : styles.container
202
204
  }, jsx("input", Object.assign({}, props, {
203
205
  id: this.id,
204
206
  value: value,
@@ -217,7 +219,7 @@ let Checkbox = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, n
217
219
  })), jsx("label", {
218
220
  htmlFor: this.id,
219
221
  css: styles === null || styles === void 0 ? void 0 : styles.control
220
- }, this.renderFacade(), this.renderMessages()));
222
+ }, this.renderFacade(), this.renderMessages())));
221
223
  }
222
224
  }, _Checkbox.displayName = "Checkbox", _Checkbox.componentId = 'Checkbox', _Checkbox.propTypes = propTypes, _Checkbox.allowedProps = allowedProps, _Checkbox.defaultProps = {
223
225
  size: 'medium',
@@ -51,6 +51,10 @@ const generateStyle = (_componentTheme, props) => {
51
51
  width: 'auto'
52
52
  })
53
53
  },
54
+ // this container is added to reduce the clickable area of the checkbox to the actual checkbox and label
55
+ container: {
56
+ width: 'fit-content'
57
+ },
54
58
  input: {
55
59
  label: 'checkbox__input',
56
60
  padding: 0,
@@ -220,6 +220,8 @@ let Checkbox = exports.Checkbox = (_dec = (0, _withDeterministicId.withDetermini
220
220
  onMouseOver: (0, _createChainedFunction.createChainedFunction)(onMouseOver, this.handleMouseOver),
221
221
  onMouseOut: (0, _createChainedFunction.createChainedFunction)(onMouseOut, this.handleMouseOut),
222
222
  ref: this.handleRef
223
+ }, (0, _emotion.jsx)("div", {
224
+ css: styles === null || styles === void 0 ? void 0 : styles.container
223
225
  }, (0, _emotion.jsx)("input", Object.assign({}, props, {
224
226
  id: this.id,
225
227
  value: value,
@@ -238,7 +240,7 @@ let Checkbox = exports.Checkbox = (_dec = (0, _withDeterministicId.withDetermini
238
240
  })), (0, _emotion.jsx)("label", {
239
241
  htmlFor: this.id,
240
242
  css: styles === null || styles === void 0 ? void 0 : styles.control
241
- }, this.renderFacade(), this.renderMessages()));
243
+ }, this.renderFacade(), this.renderMessages())));
242
244
  }
243
245
  }, _Checkbox.displayName = "Checkbox", _Checkbox.componentId = 'Checkbox', _Checkbox.propTypes = _props.propTypes, _Checkbox.allowedProps = _props.allowedProps, _Checkbox.defaultProps = {
244
246
  size: 'medium',
@@ -57,6 +57,10 @@ const generateStyle = (_componentTheme, props) => {
57
57
  width: 'auto'
58
58
  })
59
59
  },
60
+ // this container is added to reduce the clickable area of the checkbox to the actual checkbox and label
61
+ container: {
62
+ width: 'fit-content'
63
+ },
60
64
  input: {
61
65
  label: 'checkbox__input',
62
66
  padding: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-checkbox",
3
- "version": "10.2.2-snapshot-5",
3
+ "version": "10.2.2-snapshot-7",
4
4
  "description": " styled HTML input type='checkbox' component.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -24,28 +24,28 @@
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
26
  "@babel/runtime": "^7.24.5",
27
- "@instructure/console": "10.2.2-snapshot-5",
28
- "@instructure/emotion": "10.2.2-snapshot-5",
29
- "@instructure/shared-types": "10.2.2-snapshot-5",
30
- "@instructure/ui-dom-utils": "10.2.2-snapshot-5",
31
- "@instructure/ui-form-field": "10.2.2-snapshot-5",
32
- "@instructure/ui-icons": "10.2.2-snapshot-5",
33
- "@instructure/ui-prop-types": "10.2.2-snapshot-5",
34
- "@instructure/ui-react-utils": "10.2.2-snapshot-5",
35
- "@instructure/ui-svg-images": "10.2.2-snapshot-5",
36
- "@instructure/ui-testable": "10.2.2-snapshot-5",
37
- "@instructure/ui-utils": "10.2.2-snapshot-5",
38
- "@instructure/ui-view": "10.2.2-snapshot-5",
39
- "@instructure/uid": "10.2.2-snapshot-5",
27
+ "@instructure/console": "10.2.2-snapshot-7",
28
+ "@instructure/emotion": "10.2.2-snapshot-7",
29
+ "@instructure/shared-types": "10.2.2-snapshot-7",
30
+ "@instructure/ui-dom-utils": "10.2.2-snapshot-7",
31
+ "@instructure/ui-form-field": "10.2.2-snapshot-7",
32
+ "@instructure/ui-icons": "10.2.2-snapshot-7",
33
+ "@instructure/ui-prop-types": "10.2.2-snapshot-7",
34
+ "@instructure/ui-react-utils": "10.2.2-snapshot-7",
35
+ "@instructure/ui-svg-images": "10.2.2-snapshot-7",
36
+ "@instructure/ui-testable": "10.2.2-snapshot-7",
37
+ "@instructure/ui-utils": "10.2.2-snapshot-7",
38
+ "@instructure/ui-view": "10.2.2-snapshot-7",
39
+ "@instructure/uid": "10.2.2-snapshot-7",
40
40
  "keycode": "^2",
41
41
  "prop-types": "^15.8.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@instructure/ui-axe-check": "10.2.2-snapshot-5",
45
- "@instructure/ui-babel-preset": "10.2.2-snapshot-5",
46
- "@instructure/ui-color-utils": "10.2.2-snapshot-5",
47
- "@instructure/ui-test-utils": "10.2.2-snapshot-5",
48
- "@instructure/ui-themes": "10.2.2-snapshot-5",
44
+ "@instructure/ui-axe-check": "10.2.2-snapshot-7",
45
+ "@instructure/ui-babel-preset": "10.2.2-snapshot-7",
46
+ "@instructure/ui-color-utils": "10.2.2-snapshot-7",
47
+ "@instructure/ui-test-utils": "10.2.2-snapshot-7",
48
+ "@instructure/ui-themes": "10.2.2-snapshot-7",
49
49
  "@testing-library/jest-dom": "^6.4.6",
50
50
  "@testing-library/react": "^15.0.7",
51
51
  "@testing-library/user-event": "^14.5.2",
@@ -273,27 +273,29 @@ class Checkbox extends Component<CheckboxProps, CheckboxState> {
273
273
  onMouseOut={createChainedFunction(onMouseOut, this.handleMouseOut)}
274
274
  ref={this.handleRef}
275
275
  >
276
- <input
277
- {...props}
278
- id={this.id}
279
- value={value}
280
- type="checkbox"
281
- ref={(c) => {
282
- this._input = c
283
- }}
284
- disabled={disabled || readOnly}
285
- aria-checked={indeterminate ? 'mixed' : undefined}
286
- css={styles?.input}
287
- onChange={this.handleChange}
288
- onKeyDown={createChainedFunction(onKeyDown, this.handleKeyDown)}
289
- onFocus={createChainedFunction(onFocus, this.handleFocus)}
290
- onBlur={createChainedFunction(onBlur, this.handleBlur)}
291
- checked={this.checked}
292
- />
293
- <label htmlFor={this.id} css={styles?.control}>
294
- {this.renderFacade()}
295
- {this.renderMessages()}
296
- </label>
276
+ <div css={styles?.container}>
277
+ <input
278
+ {...props}
279
+ id={this.id}
280
+ value={value}
281
+ type="checkbox"
282
+ ref={(c) => {
283
+ this._input = c
284
+ }}
285
+ disabled={disabled || readOnly}
286
+ aria-checked={indeterminate ? 'mixed' : undefined}
287
+ css={styles?.input}
288
+ onChange={this.handleChange}
289
+ onKeyDown={createChainedFunction(onKeyDown, this.handleKeyDown)}
290
+ onFocus={createChainedFunction(onFocus, this.handleFocus)}
291
+ onBlur={createChainedFunction(onBlur, this.handleBlur)}
292
+ checked={this.checked}
293
+ />
294
+ <label htmlFor={this.id} css={styles?.control}>
295
+ {this.renderFacade()}
296
+ {this.renderMessages()}
297
+ </label>
298
+ </div>
297
299
  </div>
298
300
  )
299
301
  }
@@ -87,9 +87,12 @@ type AllowedPropKeys = Readonly<Array<PropKeys>>
87
87
 
88
88
  type CheckboxProps = CheckboxOwnProps &
89
89
  WithStyleProps<CheckboxFacadeTheme | ToggleFacadeTheme, CheckboxStyle> &
90
- OtherHTMLAttributes<CheckboxOwnProps> & WithDeterministicIdProps
90
+ OtherHTMLAttributes<CheckboxOwnProps> &
91
+ WithDeterministicIdProps
91
92
 
92
- type CheckboxStyle = ComponentStyle<'checkbox' | 'input' | 'control'>
93
+ type CheckboxStyle = ComponentStyle<
94
+ 'checkbox' | 'input' | 'control' | 'container'
95
+ >
93
96
 
94
97
  const propTypes: PropValidators<PropKeys> = {
95
98
  label: PropTypes.node.isRequired,
@@ -57,6 +57,10 @@ const generateStyle = (
57
57
  width: 'auto'
58
58
  })
59
59
  },
60
+ // this container is added to reduce the clickable area of the checkbox to the actual checkbox and label
61
+ container: {
62
+ width: 'fit-content'
63
+ },
60
64
  input: {
61
65
  label: 'checkbox__input',
62
66
  padding: 0,