@instructure/ui-checkbox 11.7.3-snapshot-7 → 11.7.3-snapshot-26
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 +5 -2
- package/es/Checkbox/v1/CheckboxFacade/index.js +30 -30
- package/es/Checkbox/v1/CheckboxFacade/styles.js +8 -6
- package/es/Checkbox/v1/CheckboxFacade/theme.js +29 -28
- package/es/Checkbox/v1/ToggleFacade/index.js +39 -37
- package/es/Checkbox/v1/ToggleFacade/styles.js +8 -6
- package/es/Checkbox/v1/ToggleFacade/theme.js +37 -36
- package/es/Checkbox/v1/index.js +121 -116
- package/es/Checkbox/v1/styles.js +4 -2
- package/es/Checkbox/v1/theme.js +8 -7
- package/es/Checkbox/v2/CheckboxFacade/index.js +34 -33
- package/es/Checkbox/v2/CheckboxFacade/styles.js +12 -11
- package/es/Checkbox/v2/ToggleFacade/index.js +39 -37
- package/es/Checkbox/v2/ToggleFacade/styles.js +13 -12
- package/es/Checkbox/v2/index.js +123 -119
- package/es/Checkbox/v2/styles.js +6 -5
- package/es/CheckboxGroup/v1/index.js +46 -41
- package/es/CheckboxGroup/v2/index.js +46 -41
- package/lib/Checkbox/v1/CheckboxFacade/index.js +32 -32
- package/lib/Checkbox/v1/CheckboxFacade/styles.js +8 -6
- package/lib/Checkbox/v1/CheckboxFacade/theme.js +29 -28
- package/lib/Checkbox/v1/ToggleFacade/index.js +39 -37
- package/lib/Checkbox/v1/ToggleFacade/styles.js +8 -6
- package/lib/Checkbox/v1/ToggleFacade/theme.js +37 -36
- package/lib/Checkbox/v1/index.js +121 -116
- package/lib/Checkbox/v1/styles.js +4 -2
- package/lib/Checkbox/v1/theme.js +8 -7
- package/lib/Checkbox/v2/CheckboxFacade/index.js +34 -33
- package/lib/Checkbox/v2/CheckboxFacade/styles.js +12 -11
- package/lib/Checkbox/v2/ToggleFacade/index.js +39 -37
- package/lib/Checkbox/v2/ToggleFacade/styles.js +13 -12
- package/lib/Checkbox/v2/index.js +123 -119
- package/lib/Checkbox/v2/styles.js +6 -5
- package/lib/CheckboxGroup/v1/index.js +46 -41
- package/lib/CheckboxGroup/v2/index.js +46 -41
- package/package.json +17 -17
- package/tsconfig.build.tsbuildinfo +1 -1
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
|
-
## [11.7.3-snapshot-
|
|
6
|
+
## [11.7.3-snapshot-26](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-26) (2026-05-05)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _class
|
|
1
|
+
var _dec, _class;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -36,25 +36,30 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
36
36
|
parent: Checkbox
|
|
37
37
|
---
|
|
38
38
|
**/
|
|
39
|
-
let CheckboxFacade = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
let CheckboxFacade = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class CheckboxFacade extends Component {
|
|
40
|
+
static displayName = "CheckboxFacade";
|
|
41
|
+
static componentId = 'CheckboxFacade';
|
|
42
|
+
static allowedProps = allowedProps;
|
|
43
|
+
static defaultProps = {
|
|
44
|
+
checked: false,
|
|
45
|
+
focused: false,
|
|
46
|
+
hovered: false,
|
|
47
|
+
size: 'medium',
|
|
48
|
+
indeterminate: false
|
|
49
|
+
};
|
|
50
|
+
ref = null;
|
|
51
|
+
handleRef = el => {
|
|
52
|
+
this.ref = el;
|
|
53
|
+
};
|
|
47
54
|
componentDidMount() {
|
|
48
|
-
|
|
49
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
55
|
+
this.props.makeStyles?.();
|
|
50
56
|
}
|
|
51
57
|
componentDidUpdate() {
|
|
52
|
-
|
|
53
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
58
|
+
this.props.makeStyles?.();
|
|
54
59
|
}
|
|
55
60
|
renderIcon() {
|
|
56
61
|
if (this.props.indeterminate) {
|
|
57
|
-
return
|
|
62
|
+
return _jsx(SVGIcon, {
|
|
58
63
|
viewBox: "0 0 1920 1920",
|
|
59
64
|
inline: false,
|
|
60
65
|
children: _jsx("rect", {
|
|
@@ -63,38 +68,33 @@ let CheckboxFacade = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
63
68
|
width: "1640",
|
|
64
69
|
height: "280"
|
|
65
70
|
})
|
|
66
|
-
})
|
|
71
|
+
});
|
|
67
72
|
} else if (this.props.checked) {
|
|
68
|
-
return
|
|
73
|
+
return _jsx(IconCheckMarkSolid, {
|
|
69
74
|
inline: false
|
|
70
|
-
})
|
|
75
|
+
});
|
|
71
76
|
} else {
|
|
72
77
|
return null;
|
|
73
78
|
}
|
|
74
79
|
}
|
|
75
80
|
render() {
|
|
76
|
-
const
|
|
77
|
-
children
|
|
78
|
-
styles
|
|
81
|
+
const {
|
|
82
|
+
children,
|
|
83
|
+
styles
|
|
84
|
+
} = this.props;
|
|
79
85
|
return _jsxs("span", {
|
|
80
|
-
css: styles
|
|
86
|
+
css: styles?.checkboxFacade,
|
|
81
87
|
ref: this.handleRef,
|
|
82
88
|
children: [_jsx("span", {
|
|
83
|
-
css: styles
|
|
89
|
+
css: styles?.facade,
|
|
84
90
|
"aria-hidden": "true",
|
|
85
91
|
children: this.renderIcon()
|
|
86
92
|
}), _jsx("span", {
|
|
87
|
-
css: styles
|
|
93
|
+
css: styles?.label,
|
|
88
94
|
children: children
|
|
89
95
|
})]
|
|
90
96
|
});
|
|
91
97
|
}
|
|
92
|
-
}
|
|
93
|
-
checked: false,
|
|
94
|
-
focused: false,
|
|
95
|
-
hovered: false,
|
|
96
|
-
size: 'medium',
|
|
97
|
-
indeterminate: false
|
|
98
|
-
}, _CheckboxFacade)) || _class);
|
|
98
|
+
}) || _class);
|
|
99
99
|
export default CheckboxFacade;
|
|
100
100
|
export { CheckboxFacade };
|
|
@@ -33,12 +33,14 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
const {
|
|
37
|
+
size,
|
|
38
|
+
checked,
|
|
39
|
+
focused,
|
|
40
|
+
hovered,
|
|
41
|
+
indeterminate,
|
|
42
|
+
invalid
|
|
43
|
+
} = props;
|
|
42
44
|
const isChecked = checked || indeterminate;
|
|
43
45
|
const sizeVariants = {
|
|
44
46
|
small: {
|
|
@@ -28,12 +28,13 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
borders
|
|
34
|
-
spacing
|
|
35
|
-
typography
|
|
36
|
-
themeName
|
|
31
|
+
const {
|
|
32
|
+
colors,
|
|
33
|
+
borders,
|
|
34
|
+
spacing,
|
|
35
|
+
typography,
|
|
36
|
+
key: themeName
|
|
37
|
+
} = theme;
|
|
37
38
|
const themeSpecificStyle = {
|
|
38
39
|
canvas: {
|
|
39
40
|
focusBorderColor: theme['ic-brand-primary'],
|
|
@@ -45,31 +46,31 @@ const generateComponentTheme = theme => {
|
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
const componentVariables = {
|
|
48
|
-
color: colors
|
|
49
|
-
borderWidth: borders
|
|
50
|
-
borderColor: colors
|
|
51
|
-
errorBorderColor: colors
|
|
52
|
-
borderRadius: borders
|
|
53
|
-
background: colors
|
|
54
|
-
marginRight: spacing
|
|
55
|
-
padding: spacing
|
|
56
|
-
checkedBackground: colors
|
|
57
|
-
checkedBorderColor: colors
|
|
58
|
-
hoverBorderColor: colors
|
|
59
|
-
focusBorderColor: colors
|
|
60
|
-
focusBorderWidth: borders
|
|
61
|
-
focusBorderStyle: borders
|
|
62
|
-
labelColor: colors
|
|
63
|
-
checkedLabelColor: colors
|
|
64
|
-
labelFontFamily: typography
|
|
65
|
-
labelFontWeight: typography
|
|
66
|
-
labelLineHeight: typography
|
|
49
|
+
color: colors?.contrasts?.white1010,
|
|
50
|
+
borderWidth: borders?.widthSmall,
|
|
51
|
+
borderColor: colors?.contrasts?.grey3045,
|
|
52
|
+
errorBorderColor: colors?.contrasts?.red5782,
|
|
53
|
+
borderRadius: borders?.radiusMedium,
|
|
54
|
+
background: colors?.contrasts?.white1010,
|
|
55
|
+
marginRight: spacing?.xSmall,
|
|
56
|
+
padding: spacing?.xxxSmall,
|
|
57
|
+
checkedBackground: colors?.contrasts?.grey125125,
|
|
58
|
+
checkedBorderColor: colors?.contrasts?.grey125125,
|
|
59
|
+
hoverBorderColor: colors?.contrasts?.grey125125,
|
|
60
|
+
focusBorderColor: colors?.contrasts?.blue4570,
|
|
61
|
+
focusBorderWidth: borders?.widthMedium,
|
|
62
|
+
focusBorderStyle: borders?.style,
|
|
63
|
+
labelColor: colors?.contrasts?.grey125125,
|
|
64
|
+
checkedLabelColor: colors?.contrasts?.grey125125,
|
|
65
|
+
labelFontFamily: typography?.fontFamily,
|
|
66
|
+
labelFontWeight: typography?.fontWeightNormal,
|
|
67
|
+
labelLineHeight: typography?.lineHeightCondensed,
|
|
67
68
|
facadeSizeSmall: '1rem',
|
|
68
69
|
facadeSizeMedium: '1.25rem',
|
|
69
70
|
facadeSizeLarge: '1.75rem',
|
|
70
|
-
labelFontSizeSmall: typography
|
|
71
|
-
labelFontSizeMedium: typography
|
|
72
|
-
labelFontSizeLarge: typography
|
|
71
|
+
labelFontSizeSmall: typography?.fontSizeSmall,
|
|
72
|
+
labelFontSizeMedium: typography?.fontSizeMedium,
|
|
73
|
+
labelFontSizeLarge: typography?.fontSizeLarge,
|
|
73
74
|
iconSizeSmall: '0.625rem',
|
|
74
75
|
iconSizeMedium: '0.75rem',
|
|
75
76
|
iconSizeLarge: '1rem'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _class
|
|
1
|
+
var _dec, _class;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -35,72 +35,74 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
35
35
|
parent: Checkbox
|
|
36
36
|
---
|
|
37
37
|
**/
|
|
38
|
-
let ToggleFacade = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
let ToggleFacade = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class ToggleFacade extends Component {
|
|
39
|
+
static displayName = "ToggleFacade";
|
|
40
|
+
static componentId = 'ToggleFacade';
|
|
41
|
+
static allowedProps = allowedProps;
|
|
42
|
+
static defaultProps = {
|
|
43
|
+
checked: false,
|
|
44
|
+
focused: false,
|
|
45
|
+
size: 'medium',
|
|
46
|
+
disabled: false,
|
|
47
|
+
readOnly: false,
|
|
48
|
+
labelPlacement: 'end'
|
|
49
|
+
};
|
|
50
|
+
ref = null;
|
|
51
|
+
handleRef = el => {
|
|
52
|
+
this.ref = el;
|
|
53
|
+
};
|
|
46
54
|
componentDidMount() {
|
|
47
|
-
|
|
48
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
55
|
+
this.props.makeStyles?.();
|
|
49
56
|
}
|
|
50
57
|
componentDidUpdate() {
|
|
51
|
-
|
|
52
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
58
|
+
this.props.makeStyles?.();
|
|
53
59
|
}
|
|
54
60
|
renderIcon() {
|
|
55
|
-
const
|
|
56
|
-
styles
|
|
57
|
-
checked
|
|
61
|
+
const {
|
|
62
|
+
styles,
|
|
63
|
+
checked
|
|
64
|
+
} = this.props;
|
|
58
65
|
if (checked) {
|
|
59
66
|
return _jsx(IconCheckSolid, {
|
|
60
|
-
css: styles
|
|
67
|
+
css: styles?.iconSVG
|
|
61
68
|
});
|
|
62
69
|
} else {
|
|
63
70
|
return _jsx(IconXSolid, {
|
|
64
|
-
css: styles
|
|
71
|
+
css: styles?.iconSVG
|
|
65
72
|
});
|
|
66
73
|
}
|
|
67
74
|
}
|
|
68
75
|
renderLabel() {
|
|
69
|
-
const
|
|
70
|
-
children
|
|
71
|
-
styles
|
|
76
|
+
const {
|
|
77
|
+
children,
|
|
78
|
+
styles
|
|
79
|
+
} = this.props;
|
|
72
80
|
return _jsx("span", {
|
|
73
|
-
css: styles
|
|
81
|
+
css: styles?.label,
|
|
74
82
|
children: children
|
|
75
83
|
});
|
|
76
84
|
}
|
|
77
85
|
render() {
|
|
78
|
-
const
|
|
79
|
-
labelPlacement
|
|
80
|
-
styles
|
|
86
|
+
const {
|
|
87
|
+
labelPlacement,
|
|
88
|
+
styles
|
|
89
|
+
} = this.props;
|
|
81
90
|
return _jsxs("span", {
|
|
82
|
-
css: styles
|
|
91
|
+
css: styles?.toggleFacade,
|
|
83
92
|
ref: this.handleRef,
|
|
84
93
|
children: [(labelPlacement === 'top' || labelPlacement === 'start') && this.renderLabel(), _jsx("span", {
|
|
85
|
-
css: styles
|
|
94
|
+
css: styles?.facade,
|
|
86
95
|
"aria-hidden": "true",
|
|
87
96
|
children: _jsx("span", {
|
|
88
|
-
css: styles
|
|
97
|
+
css: styles?.icon,
|
|
89
98
|
children: _jsx("span", {
|
|
90
|
-
css: styles
|
|
99
|
+
css: styles?.iconToggle,
|
|
91
100
|
children: this.renderIcon()
|
|
92
101
|
})
|
|
93
102
|
})
|
|
94
103
|
}), labelPlacement === 'end' && this.renderLabel()]
|
|
95
104
|
});
|
|
96
105
|
}
|
|
97
|
-
}
|
|
98
|
-
checked: false,
|
|
99
|
-
focused: false,
|
|
100
|
-
size: 'medium',
|
|
101
|
-
disabled: false,
|
|
102
|
-
readOnly: false,
|
|
103
|
-
labelPlacement: 'end'
|
|
104
|
-
}, _ToggleFacade)) || _class);
|
|
106
|
+
}) || _class);
|
|
105
107
|
export default ToggleFacade;
|
|
106
108
|
export { ToggleFacade };
|
|
@@ -33,12 +33,14 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
const {
|
|
37
|
+
disabled,
|
|
38
|
+
size,
|
|
39
|
+
checked,
|
|
40
|
+
focused,
|
|
41
|
+
labelPlacement,
|
|
42
|
+
invalid
|
|
43
|
+
} = props;
|
|
42
44
|
const labelPlacementVariants = {
|
|
43
45
|
start: {
|
|
44
46
|
facade: {
|
|
@@ -28,52 +28,53 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
borders
|
|
34
|
-
forms
|
|
35
|
-
shadows
|
|
36
|
-
spacing
|
|
37
|
-
typography
|
|
38
|
-
themeName
|
|
31
|
+
const {
|
|
32
|
+
colors,
|
|
33
|
+
borders,
|
|
34
|
+
forms,
|
|
35
|
+
shadows,
|
|
36
|
+
spacing,
|
|
37
|
+
typography,
|
|
38
|
+
key: themeName
|
|
39
|
+
} = theme;
|
|
39
40
|
const themeSpecificStyle = {
|
|
40
41
|
canvas: {
|
|
41
42
|
focusOutlineColor: theme['ic-brand-primary'],
|
|
42
43
|
labelColor: theme['ic-brand-font-color-dark']
|
|
43
44
|
},
|
|
44
45
|
'canvas-high-contrast': {
|
|
45
|
-
background: colors
|
|
46
|
-
borderColor: colors
|
|
46
|
+
background: colors?.contrasts?.grey125125,
|
|
47
|
+
borderColor: colors?.contrasts?.grey125125
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
50
|
const componentVariables = {
|
|
50
|
-
color: colors
|
|
51
|
-
errorBorderColor: colors
|
|
52
|
-
background: colors
|
|
53
|
-
borderColor: colors
|
|
54
|
-
borderWidth: borders
|
|
51
|
+
color: colors?.contrasts?.white1010,
|
|
52
|
+
errorBorderColor: colors?.contrasts?.red5782,
|
|
53
|
+
background: colors?.contrasts?.grey1111,
|
|
54
|
+
borderColor: colors?.contrasts?.grey3045,
|
|
55
|
+
borderWidth: borders?.widthSmall,
|
|
55
56
|
borderRadius: '4rem',
|
|
56
|
-
marginEnd: spacing
|
|
57
|
-
marginStart: spacing
|
|
58
|
-
marginVertical: spacing
|
|
59
|
-
checkedBackground: colors
|
|
60
|
-
uncheckedIconColor: colors
|
|
61
|
-
checkedIconColor: colors
|
|
62
|
-
focusOutlineColor: colors
|
|
63
|
-
focusBorderWidth: borders
|
|
64
|
-
focusBorderStyle: borders
|
|
65
|
-
toggleBackground: colors
|
|
66
|
-
toggleShadow: shadows
|
|
67
|
-
toggleSize: forms
|
|
68
|
-
labelColor: colors
|
|
69
|
-
labelFontFamily: typography
|
|
70
|
-
labelFontWeight: typography
|
|
71
|
-
labelLineHeight: typography
|
|
72
|
-
labelFontSizeSmall: typography
|
|
73
|
-
labelFontSizeMedium: typography
|
|
74
|
-
labelFontSizeLarge: typography
|
|
75
|
-
uncheckedIconBorderColor: colors
|
|
76
|
-
checkedIconBorderColor: colors
|
|
57
|
+
marginEnd: spacing?.small,
|
|
58
|
+
marginStart: spacing?.small,
|
|
59
|
+
marginVertical: spacing?.xSmall,
|
|
60
|
+
checkedBackground: colors?.contrasts?.green4570,
|
|
61
|
+
uncheckedIconColor: colors?.contrasts?.grey125125,
|
|
62
|
+
checkedIconColor: colors?.contrasts?.green5782,
|
|
63
|
+
focusOutlineColor: colors?.contrasts?.blue4570,
|
|
64
|
+
focusBorderWidth: borders?.widthMedium,
|
|
65
|
+
focusBorderStyle: borders?.style,
|
|
66
|
+
toggleBackground: colors?.contrasts?.white1010,
|
|
67
|
+
toggleShadow: shadows?.depth1,
|
|
68
|
+
toggleSize: forms?.inputHeightSmall,
|
|
69
|
+
labelColor: colors?.contrasts?.grey125125,
|
|
70
|
+
labelFontFamily: typography?.fontFamily,
|
|
71
|
+
labelFontWeight: typography?.fontWeightNormal,
|
|
72
|
+
labelLineHeight: typography?.lineHeightCondensed,
|
|
73
|
+
labelFontSizeSmall: typography?.fontSizeSmall,
|
|
74
|
+
labelFontSizeMedium: typography?.fontSizeMedium,
|
|
75
|
+
labelFontSizeLarge: typography?.fontSizeLarge,
|
|
76
|
+
uncheckedIconBorderColor: colors?.contrasts?.grey5782,
|
|
77
|
+
checkedIconBorderColor: colors?.contrasts?.green5782
|
|
77
78
|
};
|
|
78
79
|
return {
|
|
79
80
|
...componentVariables,
|