@instructure/ui-checkbox 10.26.1 → 11.0.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/CHANGELOG.md +23 -2
- package/es/Checkbox/CheckboxFacade/index.js +2 -2
- package/es/Checkbox/CheckboxFacade/props.js +1 -11
- package/es/Checkbox/ToggleFacade/index.js +2 -2
- package/es/Checkbox/ToggleFacade/props.js +1 -12
- package/es/Checkbox/index.js +6 -6
- package/es/Checkbox/props.js +1 -27
- package/es/CheckboxGroup/index.js +6 -6
- package/es/CheckboxGroup/props.js +1 -36
- package/lib/Checkbox/CheckboxFacade/index.js +1 -1
- package/lib/Checkbox/CheckboxFacade/props.js +1 -12
- package/lib/Checkbox/ToggleFacade/index.js +1 -1
- package/lib/Checkbox/ToggleFacade/props.js +1 -13
- package/lib/Checkbox/index.js +5 -5
- package/lib/Checkbox/props.js +1 -28
- package/lib/CheckboxGroup/index.js +5 -5
- package/lib/CheckboxGroup/props.js +1 -38
- package/package.json +19 -22
- package/src/Checkbox/CheckboxFacade/index.tsx +1 -2
- package/src/Checkbox/CheckboxFacade/props.ts +2 -18
- package/src/Checkbox/ToggleFacade/index.tsx +1 -2
- package/src/Checkbox/ToggleFacade/props.ts +2 -19
- package/src/Checkbox/index.tsx +2 -4
- package/src/Checkbox/props.ts +1 -32
- package/src/CheckboxGroup/index.tsx +2 -4
- package/src/CheckboxGroup/props.ts +2 -46
- package/tsconfig.build.json +0 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Checkbox/CheckboxFacade/index.d.ts +0 -9
- package/types/Checkbox/CheckboxFacade/index.d.ts.map +1 -1
- package/types/Checkbox/CheckboxFacade/props.d.ts +2 -3
- package/types/Checkbox/CheckboxFacade/props.d.ts.map +1 -1
- package/types/Checkbox/ToggleFacade/index.d.ts +0 -10
- package/types/Checkbox/ToggleFacade/index.d.ts.map +1 -1
- package/types/Checkbox/ToggleFacade/props.d.ts +2 -3
- package/types/Checkbox/ToggleFacade/props.d.ts.map +1 -1
- package/types/Checkbox/index.d.ts +0 -23
- package/types/Checkbox/index.d.ts.map +1 -1
- package/types/Checkbox/props.d.ts +2 -3
- package/types/Checkbox/props.d.ts.map +1 -1
- package/types/CheckboxGroup/index.d.ts +0 -13
- package/types/CheckboxGroup/index.d.ts.map +1 -1
- package/types/CheckboxGroup/props.d.ts +2 -3
- package/types/CheckboxGroup/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,30 @@
|
|
|
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
|
-
|
|
6
|
+
# [11.0.0](https://github.com/instructure/instructure-ui/compare/v10.26.0...v11.0.0) (2025-10-06)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* **many:** InstUI v11 contains the following breaking changes:
|
|
17
|
+
- React 16 and 17 are no longer supported
|
|
18
|
+
- remove `PropTypes` from all packages
|
|
19
|
+
- remove `CodeEditor` component
|
|
20
|
+
- remove `@instui/theme-registry` package
|
|
21
|
+
- remove `@testable`, `@experimental`, `@hack` decorators
|
|
22
|
+
- InstUISettingsProvider's `as` prop is removed
|
|
23
|
+
- `canvas.use()`, `canvasHighContrast.use()` functions are removed
|
|
24
|
+
- `canvasThemeLocal`, `canvasHighContrastThemeLocal` are removed
|
|
25
|
+
- `variables` field on theme objects are removed
|
|
26
|
+
- remove deprecated props from Table: Row's `isStacked`, Body's
|
|
27
|
+
`isStacked`, `hover`, and `headers`
|
|
28
|
+
- `Table`'s `caption` prop is now required
|
|
29
|
+
- `ui-dom-utils`'s `getComputedStyle` can now return `undefined`
|
|
9
30
|
|
|
10
31
|
|
|
11
32
|
|
|
@@ -29,7 +29,7 @@ import { IconCheckMarkSolid } from '@instructure/ui-icons';
|
|
|
29
29
|
import { withStyle } from '@instructure/emotion';
|
|
30
30
|
import generateStyle from './styles';
|
|
31
31
|
import generateComponentTheme from './theme';
|
|
32
|
-
import {
|
|
32
|
+
import { allowedProps } from './props';
|
|
33
33
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
34
34
|
/**
|
|
35
35
|
---
|
|
@@ -89,7 +89,7 @@ let CheckboxFacade = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
89
89
|
})]
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
}, _CheckboxFacade.displayName = "CheckboxFacade", _CheckboxFacade.componentId = 'CheckboxFacade', _CheckboxFacade.
|
|
92
|
+
}, _CheckboxFacade.displayName = "CheckboxFacade", _CheckboxFacade.componentId = 'CheckboxFacade', _CheckboxFacade.allowedProps = allowedProps, _CheckboxFacade.defaultProps = {
|
|
93
93
|
checked: false,
|
|
94
94
|
focused: false,
|
|
95
95
|
hovered: false,
|
|
@@ -22,15 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
const propTypes = {
|
|
27
|
-
children: PropTypes.node.isRequired,
|
|
28
|
-
checked: PropTypes.bool,
|
|
29
|
-
focused: PropTypes.bool,
|
|
30
|
-
hovered: PropTypes.bool,
|
|
31
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
32
|
-
indeterminate: PropTypes.bool,
|
|
33
|
-
invalid: PropTypes.bool
|
|
34
|
-
};
|
|
35
25
|
const allowedProps = ['children', 'checked', 'focused', 'hovered', 'size', 'indeterminate'];
|
|
36
|
-
export {
|
|
26
|
+
export { allowedProps };
|
|
@@ -28,7 +28,7 @@ import { IconCheckSolid, IconXSolid } from '@instructure/ui-icons';
|
|
|
28
28
|
import { withStyle } from '@instructure/emotion';
|
|
29
29
|
import generateStyle from './styles';
|
|
30
30
|
import generateComponentTheme from './theme';
|
|
31
|
-
import {
|
|
31
|
+
import { allowedProps } from './props';
|
|
32
32
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
33
33
|
/**
|
|
34
34
|
---
|
|
@@ -94,7 +94,7 @@ let ToggleFacade = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
94
94
|
}), labelPlacement === 'end' && this.renderLabel()]
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
}, _ToggleFacade.displayName = "ToggleFacade", _ToggleFacade.componentId = 'ToggleFacade', _ToggleFacade.
|
|
97
|
+
}, _ToggleFacade.displayName = "ToggleFacade", _ToggleFacade.componentId = 'ToggleFacade', _ToggleFacade.allowedProps = allowedProps, _ToggleFacade.defaultProps = {
|
|
98
98
|
checked: false,
|
|
99
99
|
focused: false,
|
|
100
100
|
size: 'medium',
|
|
@@ -22,16 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
const propTypes = {
|
|
27
|
-
children: PropTypes.node.isRequired,
|
|
28
|
-
checked: PropTypes.bool,
|
|
29
|
-
disabled: PropTypes.bool,
|
|
30
|
-
readOnly: PropTypes.bool,
|
|
31
|
-
focused: PropTypes.bool,
|
|
32
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
33
|
-
labelPlacement: PropTypes.oneOf(['top', 'start', 'end']),
|
|
34
|
-
invalid: PropTypes.bool
|
|
35
|
-
};
|
|
36
25
|
const allowedProps = ['children', 'checked', 'disabled', 'readOnly', 'focused', 'size', 'labelPlacement'];
|
|
37
|
-
export {
|
|
26
|
+
export { allowedProps };
|
package/es/Checkbox/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _dec2,
|
|
1
|
+
var _dec, _dec2, _class, _Checkbox;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -31,13 +31,12 @@ import { logError as error } from '@instructure/console';
|
|
|
31
31
|
import { isActiveElement } from '@instructure/ui-dom-utils';
|
|
32
32
|
import { omitProps, withDeterministicId } from '@instructure/ui-react-utils';
|
|
33
33
|
import { View } from '@instructure/ui-view';
|
|
34
|
-
import { testable } from '@instructure/ui-testable';
|
|
35
34
|
import { withStyle } from '@instructure/emotion';
|
|
36
35
|
import { CheckboxFacade } from './CheckboxFacade';
|
|
37
36
|
import { ToggleFacade } from './ToggleFacade';
|
|
38
37
|
import generateStyle from './styles';
|
|
39
38
|
import generateComponentTheme from './theme';
|
|
40
|
-
import {
|
|
39
|
+
import { allowedProps } from './props';
|
|
41
40
|
import { jsxs as _jsxs, jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
42
41
|
/**
|
|
43
42
|
---
|
|
@@ -45,7 +44,7 @@ category: components
|
|
|
45
44
|
tags: toggle, switch
|
|
46
45
|
---
|
|
47
46
|
**/
|
|
48
|
-
let Checkbox = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme),
|
|
47
|
+
let Checkbox = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_Checkbox = class Checkbox extends Component {
|
|
49
48
|
constructor(props) {
|
|
50
49
|
super(props);
|
|
51
50
|
this._defaultId = void 0;
|
|
@@ -236,6 +235,7 @@ let Checkbox = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, g
|
|
|
236
235
|
/* eslint-disable-next-line jsx-a11y/mouse-events-have-key-events */,
|
|
237
236
|
onMouseOut: createChainedFunction(onMouseOut, this.handleMouseOut),
|
|
238
237
|
ref: this.handleRef,
|
|
238
|
+
"data-cid": "Checkbox",
|
|
239
239
|
children: _jsxs("div", {
|
|
240
240
|
css: styles === null || styles === void 0 ? void 0 : styles.container,
|
|
241
241
|
children: [_jsx("input", {
|
|
@@ -261,7 +261,7 @@ let Checkbox = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, g
|
|
|
261
261
|
})
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
|
-
}, _Checkbox.displayName = "Checkbox", _Checkbox.componentId = 'Checkbox', _Checkbox.
|
|
264
|
+
}, _Checkbox.displayName = "Checkbox", _Checkbox.componentId = 'Checkbox', _Checkbox.allowedProps = allowedProps, _Checkbox.defaultProps = {
|
|
265
265
|
size: 'medium',
|
|
266
266
|
variant: 'simple',
|
|
267
267
|
disabled: false,
|
|
@@ -269,6 +269,6 @@ let Checkbox = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, g
|
|
|
269
269
|
indeterminate: false,
|
|
270
270
|
readOnly: false,
|
|
271
271
|
labelPlacement: 'end'
|
|
272
|
-
}, _Checkbox)) || _class) || _class)
|
|
272
|
+
}, _Checkbox)) || _class) || _class);
|
|
273
273
|
export default Checkbox;
|
|
274
274
|
export { Checkbox, CheckboxFacade, ToggleFacade };
|
package/es/Checkbox/props.js
CHANGED
|
@@ -22,31 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { FormPropTypes } from '@instructure/ui-form-field';
|
|
27
|
-
import { controllable } from '@instructure/ui-prop-types';
|
|
28
|
-
const propTypes = {
|
|
29
|
-
label: PropTypes.node.isRequired,
|
|
30
|
-
id: PropTypes.string,
|
|
31
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
32
|
-
messages: PropTypes.arrayOf(FormPropTypes.message),
|
|
33
|
-
defaultChecked: PropTypes.bool,
|
|
34
|
-
checked: controllable(PropTypes.bool, 'onChange', 'defaultChecked'),
|
|
35
|
-
onChange: PropTypes.func,
|
|
36
|
-
onKeyDown: PropTypes.func,
|
|
37
|
-
onFocus: PropTypes.func,
|
|
38
|
-
onBlur: PropTypes.func,
|
|
39
|
-
onMouseOver: PropTypes.func,
|
|
40
|
-
onMouseOut: PropTypes.func,
|
|
41
|
-
disabled: PropTypes.bool,
|
|
42
|
-
readOnly: PropTypes.bool,
|
|
43
|
-
indeterminate: PropTypes.bool,
|
|
44
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
45
|
-
variant: PropTypes.oneOf(['simple', 'toggle']),
|
|
46
|
-
inline: PropTypes.bool,
|
|
47
|
-
labelPlacement: PropTypes.oneOf(['top', 'start', 'end']),
|
|
48
|
-
isRequired: PropTypes.bool,
|
|
49
|
-
inputRef: PropTypes.func
|
|
50
|
-
};
|
|
51
25
|
const allowedProps = ['label', 'id', 'value', 'messages', 'defaultChecked', 'checked', 'onChange', 'onKeyDown', 'onFocus', 'onBlur', 'onMouseOver', 'onMouseOut', 'disabled', 'readOnly', 'indeterminate', 'size', 'variant', 'inline', 'labelPlacement', 'isRequired', 'inputRef'];
|
|
52
|
-
export {
|
|
26
|
+
export { allowedProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec,
|
|
1
|
+
var _dec, _class, _CheckboxGroup;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -26,16 +26,15 @@ var _dec, _dec2, _class, _CheckboxGroup;
|
|
|
26
26
|
import { Children, Component } from 'react';
|
|
27
27
|
import { FormFieldGroup } from '@instructure/ui-form-field';
|
|
28
28
|
import { matchComponentTypes, safeCloneElement, pickProps, omitProps, withDeterministicId } from '@instructure/ui-react-utils';
|
|
29
|
-
import { testable } from '@instructure/ui-testable';
|
|
30
29
|
import { Checkbox } from '../Checkbox';
|
|
31
|
-
import {
|
|
30
|
+
import { allowedProps } from './props';
|
|
32
31
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
33
32
|
/**
|
|
34
33
|
---
|
|
35
34
|
category: components
|
|
36
35
|
---
|
|
37
36
|
**/
|
|
38
|
-
let CheckboxGroup = (_dec = withDeterministicId(),
|
|
37
|
+
let CheckboxGroup = (_dec = withDeterministicId(), _dec(_class = (_CheckboxGroup = class CheckboxGroup extends Component {
|
|
39
38
|
constructor(props) {
|
|
40
39
|
super(props);
|
|
41
40
|
this._messagesId = void 0;
|
|
@@ -111,15 +110,16 @@ let CheckboxGroup = (_dec = withDeterministicId(), _dec2 = testable(), _dec(_cla
|
|
|
111
110
|
vAlign: "top",
|
|
112
111
|
messagesId: this._messagesId,
|
|
113
112
|
elementRef: this.handleRef,
|
|
113
|
+
"data-cid": "CheckboxGroup",
|
|
114
114
|
children: this.renderChildren()
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
}, _CheckboxGroup.displayName = "CheckboxGroup", _CheckboxGroup.componentId = 'CheckboxGroup', _CheckboxGroup.
|
|
117
|
+
}, _CheckboxGroup.displayName = "CheckboxGroup", _CheckboxGroup.componentId = 'CheckboxGroup', _CheckboxGroup.allowedProps = allowedProps, _CheckboxGroup.defaultProps = {
|
|
118
118
|
disabled: false,
|
|
119
119
|
readOnly: false,
|
|
120
120
|
size: 'medium',
|
|
121
121
|
layout: 'stacked',
|
|
122
122
|
children: null
|
|
123
|
-
}, _CheckboxGroup)) || _class)
|
|
123
|
+
}, _CheckboxGroup)) || _class);
|
|
124
124
|
export default CheckboxGroup;
|
|
125
125
|
export { CheckboxGroup };
|
|
@@ -22,40 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { FormPropTypes } from '@instructure/ui-form-field';
|
|
27
|
-
import { controllable, Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
28
|
-
import { Checkbox } from '../Checkbox';
|
|
29
|
-
const propTypes = {
|
|
30
|
-
name: PropTypes.string.isRequired,
|
|
31
|
-
description: PropTypes.node.isRequired,
|
|
32
|
-
/**
|
|
33
|
-
* value to set on initial render
|
|
34
|
-
*/
|
|
35
|
-
defaultValue: PropTypes.array,
|
|
36
|
-
/**
|
|
37
|
-
* the selected values (must be accompanied by an `onChange` prop)
|
|
38
|
-
*/
|
|
39
|
-
value: controllable(PropTypes.array),
|
|
40
|
-
/**
|
|
41
|
-
* when used with the `value` prop, the component will not control its own state
|
|
42
|
-
*/
|
|
43
|
-
onChange: PropTypes.func,
|
|
44
|
-
disabled: PropTypes.bool,
|
|
45
|
-
readOnly: PropTypes.bool,
|
|
46
|
-
/**
|
|
47
|
-
* object with shape: `{
|
|
48
|
-
text: PropTypes.node,
|
|
49
|
-
type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
50
|
-
}`
|
|
51
|
-
*/
|
|
52
|
-
messages: PropTypes.arrayOf(FormPropTypes.message),
|
|
53
|
-
/**
|
|
54
|
-
* children of type `Checkbox`
|
|
55
|
-
*/
|
|
56
|
-
children: ChildrenPropTypes.oneOf([Checkbox]),
|
|
57
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
58
|
-
layout: PropTypes.oneOf(['stacked', 'columns', 'inline'])
|
|
59
|
-
};
|
|
60
25
|
const allowedProps = ['name', 'description', 'defaultValue', 'value', 'onChange', 'disabled', 'readOnly', 'messages', 'children', 'size', 'layout'];
|
|
61
|
-
export {
|
|
26
|
+
export { allowedProps };
|
|
@@ -95,7 +95,7 @@ let CheckboxFacade = exports.CheckboxFacade = (_dec = (0, _emotion.withStyle)(_s
|
|
|
95
95
|
})]
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
}, _CheckboxFacade.displayName = "CheckboxFacade", _CheckboxFacade.componentId = 'CheckboxFacade', _CheckboxFacade.
|
|
98
|
+
}, _CheckboxFacade.displayName = "CheckboxFacade", _CheckboxFacade.componentId = 'CheckboxFacade', _CheckboxFacade.allowedProps = _props.allowedProps, _CheckboxFacade.defaultProps = {
|
|
99
99
|
checked: false,
|
|
100
100
|
focused: false,
|
|
101
101
|
hovered: false,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.allowedProps = void 0;
|
|
9
7
|
/*
|
|
10
8
|
* The MIT License (MIT)
|
|
11
9
|
*
|
|
@@ -30,13 +28,4 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
30
28
|
* SOFTWARE.
|
|
31
29
|
*/
|
|
32
30
|
|
|
33
|
-
const propTypes = exports.propTypes = {
|
|
34
|
-
children: _propTypes.default.node.isRequired,
|
|
35
|
-
checked: _propTypes.default.bool,
|
|
36
|
-
focused: _propTypes.default.bool,
|
|
37
|
-
hovered: _propTypes.default.bool,
|
|
38
|
-
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
39
|
-
indeterminate: _propTypes.default.bool,
|
|
40
|
-
invalid: _propTypes.default.bool
|
|
41
|
-
};
|
|
42
31
|
const allowedProps = exports.allowedProps = ['children', 'checked', 'focused', 'hovered', 'size', 'indeterminate'];
|
|
@@ -101,7 +101,7 @@ let ToggleFacade = exports.ToggleFacade = (_dec = (0, _emotion.withStyle)(_style
|
|
|
101
101
|
}), labelPlacement === 'end' && this.renderLabel()]
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
-
}, _ToggleFacade.displayName = "ToggleFacade", _ToggleFacade.componentId = 'ToggleFacade', _ToggleFacade.
|
|
104
|
+
}, _ToggleFacade.displayName = "ToggleFacade", _ToggleFacade.componentId = 'ToggleFacade', _ToggleFacade.allowedProps = _props.allowedProps, _ToggleFacade.defaultProps = {
|
|
105
105
|
checked: false,
|
|
106
106
|
focused: false,
|
|
107
107
|
size: 'medium',
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.allowedProps = void 0;
|
|
9
7
|
/*
|
|
10
8
|
* The MIT License (MIT)
|
|
11
9
|
*
|
|
@@ -30,14 +28,4 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
30
28
|
* SOFTWARE.
|
|
31
29
|
*/
|
|
32
30
|
|
|
33
|
-
const propTypes = exports.propTypes = {
|
|
34
|
-
children: _propTypes.default.node.isRequired,
|
|
35
|
-
checked: _propTypes.default.bool,
|
|
36
|
-
disabled: _propTypes.default.bool,
|
|
37
|
-
readOnly: _propTypes.default.bool,
|
|
38
|
-
focused: _propTypes.default.bool,
|
|
39
|
-
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
40
|
-
labelPlacement: _propTypes.default.oneOf(['top', 'start', 'end']),
|
|
41
|
-
invalid: _propTypes.default.bool
|
|
42
|
-
};
|
|
43
31
|
const allowedProps = exports.allowedProps = ['children', 'checked', 'disabled', 'readOnly', 'focused', 'size', 'labelPlacement'];
|
package/lib/Checkbox/index.js
CHANGED
|
@@ -27,7 +27,6 @@ var _isActiveElement = require("@instructure/ui-dom-utils/lib/isActiveElement.js
|
|
|
27
27
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
28
28
|
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
29
29
|
var _View = require("@instructure/ui-view/lib/View");
|
|
30
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
31
30
|
var _emotion = require("@instructure/emotion");
|
|
32
31
|
var _CheckboxFacade = require("./CheckboxFacade");
|
|
33
32
|
var _ToggleFacade = require("./ToggleFacade");
|
|
@@ -35,7 +34,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
35
34
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
36
35
|
var _props = require("./props");
|
|
37
36
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
38
|
-
var _dec, _dec2,
|
|
37
|
+
var _dec, _dec2, _class, _Checkbox;
|
|
39
38
|
/*
|
|
40
39
|
* The MIT License (MIT)
|
|
41
40
|
*
|
|
@@ -65,7 +64,7 @@ category: components
|
|
|
65
64
|
tags: toggle, switch
|
|
66
65
|
---
|
|
67
66
|
**/
|
|
68
|
-
let Checkbox = exports.Checkbox = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
67
|
+
let Checkbox = exports.Checkbox = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_Checkbox = class Checkbox extends _react.Component {
|
|
69
68
|
constructor(props) {
|
|
70
69
|
super(props);
|
|
71
70
|
this._defaultId = void 0;
|
|
@@ -256,6 +255,7 @@ let Checkbox = exports.Checkbox = (_dec = (0, _withDeterministicId.withDetermini
|
|
|
256
255
|
/* eslint-disable-next-line jsx-a11y/mouse-events-have-key-events */,
|
|
257
256
|
onMouseOut: (0, _createChainedFunction.createChainedFunction)(onMouseOut, this.handleMouseOut),
|
|
258
257
|
ref: this.handleRef,
|
|
258
|
+
"data-cid": "Checkbox",
|
|
259
259
|
children: (0, _jsxRuntime.jsxs)("div", {
|
|
260
260
|
css: styles === null || styles === void 0 ? void 0 : styles.container,
|
|
261
261
|
children: [(0, _jsxRuntime.jsx)("input", {
|
|
@@ -281,7 +281,7 @@ let Checkbox = exports.Checkbox = (_dec = (0, _withDeterministicId.withDetermini
|
|
|
281
281
|
})
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
|
-
}, _Checkbox.displayName = "Checkbox", _Checkbox.componentId = 'Checkbox', _Checkbox.
|
|
284
|
+
}, _Checkbox.displayName = "Checkbox", _Checkbox.componentId = 'Checkbox', _Checkbox.allowedProps = _props.allowedProps, _Checkbox.defaultProps = {
|
|
285
285
|
size: 'medium',
|
|
286
286
|
variant: 'simple',
|
|
287
287
|
disabled: false,
|
|
@@ -289,5 +289,5 @@ let Checkbox = exports.Checkbox = (_dec = (0, _withDeterministicId.withDetermini
|
|
|
289
289
|
indeterminate: false,
|
|
290
290
|
readOnly: false,
|
|
291
291
|
labelPlacement: 'end'
|
|
292
|
-
}, _Checkbox)) || _class) || _class)
|
|
292
|
+
}, _Checkbox)) || _class) || _class);
|
|
293
293
|
var _default = exports.default = Checkbox;
|
package/lib/Checkbox/props.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _FormPropTypes = require("@instructure/ui-form-field/lib/FormPropTypes.js");
|
|
10
|
-
var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
|
|
6
|
+
exports.allowedProps = void 0;
|
|
11
7
|
/*
|
|
12
8
|
* The MIT License (MIT)
|
|
13
9
|
*
|
|
@@ -32,27 +28,4 @@ var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
|
|
|
32
28
|
* SOFTWARE.
|
|
33
29
|
*/
|
|
34
30
|
|
|
35
|
-
const propTypes = exports.propTypes = {
|
|
36
|
-
label: _propTypes.default.node.isRequired,
|
|
37
|
-
id: _propTypes.default.string,
|
|
38
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
39
|
-
messages: _propTypes.default.arrayOf(_FormPropTypes.FormPropTypes.message),
|
|
40
|
-
defaultChecked: _propTypes.default.bool,
|
|
41
|
-
checked: (0, _controllable.controllable)(_propTypes.default.bool, 'onChange', 'defaultChecked'),
|
|
42
|
-
onChange: _propTypes.default.func,
|
|
43
|
-
onKeyDown: _propTypes.default.func,
|
|
44
|
-
onFocus: _propTypes.default.func,
|
|
45
|
-
onBlur: _propTypes.default.func,
|
|
46
|
-
onMouseOver: _propTypes.default.func,
|
|
47
|
-
onMouseOut: _propTypes.default.func,
|
|
48
|
-
disabled: _propTypes.default.bool,
|
|
49
|
-
readOnly: _propTypes.default.bool,
|
|
50
|
-
indeterminate: _propTypes.default.bool,
|
|
51
|
-
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
52
|
-
variant: _propTypes.default.oneOf(['simple', 'toggle']),
|
|
53
|
-
inline: _propTypes.default.bool,
|
|
54
|
-
labelPlacement: _propTypes.default.oneOf(['top', 'start', 'end']),
|
|
55
|
-
isRequired: _propTypes.default.bool,
|
|
56
|
-
inputRef: _propTypes.default.func
|
|
57
|
-
};
|
|
58
31
|
const allowedProps = exports.allowedProps = ['label', 'id', 'value', 'messages', 'defaultChecked', 'checked', 'onChange', 'onKeyDown', 'onFocus', 'onBlur', 'onMouseOver', 'onMouseOut', 'disabled', 'readOnly', 'indeterminate', 'size', 'variant', 'inline', 'labelPlacement', 'isRequired', 'inputRef'];
|
|
@@ -11,11 +11,10 @@ var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElemen
|
|
|
11
11
|
var _pickProps = require("@instructure/ui-react-utils/lib/pickProps.js");
|
|
12
12
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
13
13
|
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
14
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
15
14
|
var _Checkbox = require("../Checkbox");
|
|
16
15
|
var _props = require("./props");
|
|
17
16
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
18
|
-
var _dec,
|
|
17
|
+
var _dec, _class, _CheckboxGroup;
|
|
19
18
|
/*
|
|
20
19
|
* The MIT License (MIT)
|
|
21
20
|
*
|
|
@@ -44,7 +43,7 @@ var _dec, _dec2, _class, _CheckboxGroup;
|
|
|
44
43
|
category: components
|
|
45
44
|
---
|
|
46
45
|
**/
|
|
47
|
-
let CheckboxGroup = exports.CheckboxGroup = (_dec = (0, _withDeterministicId.withDeterministicId)(),
|
|
46
|
+
let CheckboxGroup = exports.CheckboxGroup = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec(_class = (_CheckboxGroup = class CheckboxGroup extends _react.Component {
|
|
48
47
|
constructor(props) {
|
|
49
48
|
super(props);
|
|
50
49
|
this._messagesId = void 0;
|
|
@@ -120,14 +119,15 @@ let CheckboxGroup = exports.CheckboxGroup = (_dec = (0, _withDeterministicId.wit
|
|
|
120
119
|
vAlign: "top",
|
|
121
120
|
messagesId: this._messagesId,
|
|
122
121
|
elementRef: this.handleRef,
|
|
122
|
+
"data-cid": "CheckboxGroup",
|
|
123
123
|
children: this.renderChildren()
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
-
}, _CheckboxGroup.displayName = "CheckboxGroup", _CheckboxGroup.componentId = 'CheckboxGroup', _CheckboxGroup.
|
|
126
|
+
}, _CheckboxGroup.displayName = "CheckboxGroup", _CheckboxGroup.componentId = 'CheckboxGroup', _CheckboxGroup.allowedProps = _props.allowedProps, _CheckboxGroup.defaultProps = {
|
|
127
127
|
disabled: false,
|
|
128
128
|
readOnly: false,
|
|
129
129
|
size: 'medium',
|
|
130
130
|
layout: 'stacked',
|
|
131
131
|
children: null
|
|
132
|
-
}, _CheckboxGroup)) || _class)
|
|
132
|
+
}, _CheckboxGroup)) || _class);
|
|
133
133
|
var _default = exports.default = CheckboxGroup;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _FormPropTypes = require("@instructure/ui-form-field/lib/FormPropTypes.js");
|
|
10
|
-
var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
|
|
11
|
-
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
12
|
-
var _Checkbox = require("../Checkbox");
|
|
6
|
+
exports.allowedProps = void 0;
|
|
13
7
|
/*
|
|
14
8
|
* The MIT License (MIT)
|
|
15
9
|
*
|
|
@@ -34,35 +28,4 @@ var _Checkbox = require("../Checkbox");
|
|
|
34
28
|
* SOFTWARE.
|
|
35
29
|
*/
|
|
36
30
|
|
|
37
|
-
const propTypes = exports.propTypes = {
|
|
38
|
-
name: _propTypes.default.string.isRequired,
|
|
39
|
-
description: _propTypes.default.node.isRequired,
|
|
40
|
-
/**
|
|
41
|
-
* value to set on initial render
|
|
42
|
-
*/
|
|
43
|
-
defaultValue: _propTypes.default.array,
|
|
44
|
-
/**
|
|
45
|
-
* the selected values (must be accompanied by an `onChange` prop)
|
|
46
|
-
*/
|
|
47
|
-
value: (0, _controllable.controllable)(_propTypes.default.array),
|
|
48
|
-
/**
|
|
49
|
-
* when used with the `value` prop, the component will not control its own state
|
|
50
|
-
*/
|
|
51
|
-
onChange: _propTypes.default.func,
|
|
52
|
-
disabled: _propTypes.default.bool,
|
|
53
|
-
readOnly: _propTypes.default.bool,
|
|
54
|
-
/**
|
|
55
|
-
* object with shape: `{
|
|
56
|
-
text: PropTypes.node,
|
|
57
|
-
type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
58
|
-
}`
|
|
59
|
-
*/
|
|
60
|
-
messages: _propTypes.default.arrayOf(_FormPropTypes.FormPropTypes.message),
|
|
61
|
-
/**
|
|
62
|
-
* children of type `Checkbox`
|
|
63
|
-
*/
|
|
64
|
-
children: _Children.Children.oneOf([_Checkbox.Checkbox]),
|
|
65
|
-
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
66
|
-
layout: _propTypes.default.oneOf(['stacked', 'columns', 'inline'])
|
|
67
|
-
};
|
|
68
31
|
const allowedProps = exports.allowedProps = ['name', 'description', 'defaultValue', 'value', 'onChange', 'disabled', 'readOnly', 'messages', 'children', 'size', 'layout'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-checkbox",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
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,34 +24,31 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.27.6",
|
|
27
|
-
"@instructure/console": "
|
|
28
|
-
"@instructure/emotion": "
|
|
29
|
-
"@instructure/shared-types": "
|
|
30
|
-
"@instructure/ui-dom-utils": "
|
|
31
|
-
"@instructure/ui-form-field": "
|
|
32
|
-
"@instructure/ui-icons": "
|
|
33
|
-
"@instructure/ui-
|
|
34
|
-
"@instructure/ui-
|
|
35
|
-
"@instructure/ui-
|
|
36
|
-
"@instructure/ui-
|
|
37
|
-
"@instructure/
|
|
38
|
-
"
|
|
39
|
-
"@instructure/uid": "10.26.1",
|
|
40
|
-
"keycode": "^2",
|
|
41
|
-
"prop-types": "^15.8.1"
|
|
27
|
+
"@instructure/console": "11.0.0",
|
|
28
|
+
"@instructure/emotion": "11.0.0",
|
|
29
|
+
"@instructure/shared-types": "11.0.0",
|
|
30
|
+
"@instructure/ui-dom-utils": "11.0.0",
|
|
31
|
+
"@instructure/ui-form-field": "11.0.0",
|
|
32
|
+
"@instructure/ui-icons": "11.0.0",
|
|
33
|
+
"@instructure/ui-react-utils": "11.0.0",
|
|
34
|
+
"@instructure/ui-svg-images": "11.0.0",
|
|
35
|
+
"@instructure/ui-utils": "11.0.0",
|
|
36
|
+
"@instructure/ui-view": "11.0.0",
|
|
37
|
+
"@instructure/uid": "11.0.0",
|
|
38
|
+
"keycode": "^2"
|
|
42
39
|
},
|
|
43
40
|
"devDependencies": {
|
|
44
|
-
"@instructure/ui-axe-check": "
|
|
45
|
-
"@instructure/ui-babel-preset": "
|
|
46
|
-
"@instructure/ui-color-utils": "
|
|
47
|
-
"@instructure/ui-themes": "
|
|
41
|
+
"@instructure/ui-axe-check": "11.0.0",
|
|
42
|
+
"@instructure/ui-babel-preset": "11.0.0",
|
|
43
|
+
"@instructure/ui-color-utils": "11.0.0",
|
|
44
|
+
"@instructure/ui-themes": "11.0.0",
|
|
48
45
|
"@testing-library/jest-dom": "^6.6.3",
|
|
49
|
-
"@testing-library/react": "
|
|
46
|
+
"@testing-library/react": "15.0.7",
|
|
50
47
|
"@testing-library/user-event": "^14.6.1",
|
|
51
48
|
"vitest": "^3.2.2"
|
|
52
49
|
},
|
|
53
50
|
"peerDependencies": {
|
|
54
|
-
"react": ">=
|
|
51
|
+
"react": ">=18 <=19"
|
|
55
52
|
},
|
|
56
53
|
"publishConfig": {
|
|
57
54
|
"access": "public"
|
|
@@ -32,7 +32,7 @@ import { withStyle } from '@instructure/emotion'
|
|
|
32
32
|
import generateStyle from './styles'
|
|
33
33
|
import generateComponentTheme from './theme'
|
|
34
34
|
|
|
35
|
-
import {
|
|
35
|
+
import { allowedProps } from './props'
|
|
36
36
|
import type { CheckboxFacadeProps } from './props'
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -44,7 +44,6 @@ parent: Checkbox
|
|
|
44
44
|
class CheckboxFacade extends Component<CheckboxFacadeProps> {
|
|
45
45
|
static readonly componentId = 'CheckboxFacade'
|
|
46
46
|
|
|
47
|
-
static propTypes = propTypes
|
|
48
47
|
static allowedProps = allowedProps
|
|
49
48
|
static defaultProps = {
|
|
50
49
|
checked: false,
|