@instructure/ui-form-field 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/FormField/v1/index.js +19 -20
- package/es/FormField/v2/index.js +19 -20
- package/es/FormFieldGroup/v1/index.js +40 -37
- package/es/FormFieldGroup/v1/styles.js +6 -2
- package/es/FormFieldGroup/v1/theme.js +10 -9
- package/es/FormFieldGroup/v2/index.js +40 -37
- package/es/FormFieldGroup/v2/styles.js +3 -1
- package/es/FormFieldLabel/v1/index.js +20 -20
- package/es/FormFieldLabel/v1/styles.js +3 -1
- package/es/FormFieldLabel/v1/theme.js +10 -9
- package/es/FormFieldLabel/v2/index.js +20 -20
- package/es/FormFieldLabel/v2/styles.js +3 -1
- package/es/FormFieldLabel/v2/theme.js +10 -9
- package/es/FormFieldLayout/v1/index.js +58 -56
- package/es/FormFieldLayout/v1/styles.js +14 -10
- package/es/FormFieldLayout/v1/theme.js +14 -13
- package/es/FormFieldLayout/v2/index.js +35 -47
- package/es/FormFieldLayout/v2/styles.js +14 -10
- package/es/FormFieldMessage/v1/index.js +23 -23
- package/es/FormFieldMessage/v1/styles.js +3 -1
- package/es/FormFieldMessage/v1/theme.js +13 -12
- package/es/FormFieldMessage/v2/index.js +5 -6
- package/es/FormFieldMessage/v2/styles.js +3 -1
- package/es/FormFieldMessages/v1/index.js +19 -19
- package/es/FormFieldMessages/v1/theme.js +4 -2
- package/es/FormFieldMessages/v2/index.js +19 -19
- package/lib/FormField/v1/index.js +19 -20
- package/lib/FormField/v2/index.js +19 -20
- package/lib/FormFieldGroup/v1/index.js +40 -37
- package/lib/FormFieldGroup/v1/styles.js +6 -2
- package/lib/FormFieldGroup/v1/theme.js +10 -9
- package/lib/FormFieldGroup/v2/index.js +40 -37
- package/lib/FormFieldGroup/v2/styles.js +3 -1
- package/lib/FormFieldLabel/v1/index.js +20 -20
- package/lib/FormFieldLabel/v1/styles.js +3 -1
- package/lib/FormFieldLabel/v1/theme.js +10 -9
- package/lib/FormFieldLabel/v2/index.js +20 -20
- package/lib/FormFieldLabel/v2/styles.js +3 -1
- package/lib/FormFieldLabel/v2/theme.js +10 -9
- package/lib/FormFieldLayout/v1/index.js +58 -56
- package/lib/FormFieldLayout/v1/styles.js +14 -10
- package/lib/FormFieldLayout/v1/theme.js +14 -13
- package/lib/FormFieldLayout/v2/index.js +36 -47
- package/lib/FormFieldLayout/v2/styles.js +14 -10
- package/lib/FormFieldMessage/v1/index.js +24 -24
- package/lib/FormFieldMessage/v1/styles.js +3 -1
- package/lib/FormFieldMessage/v1/theme.js +13 -12
- package/lib/FormFieldMessage/v2/index.js +6 -6
- package/lib/FormFieldMessage/v2/styles.js +3 -1
- package/lib/FormFieldMessages/v1/index.js +19 -19
- package/lib/FormFieldMessages/v1/theme.js +4 -2
- package/lib/FormFieldMessages/v2/index.js +19 -19
- package/package.json +15 -15
- 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
|
|
package/es/FormField/v1/index.js
CHANGED
|
@@ -33,17 +33,25 @@ category: components
|
|
|
33
33
|
---
|
|
34
34
|
**/
|
|
35
35
|
class FormField extends Component {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
static displayName = "FormField";
|
|
37
|
+
static componentId = 'FormField';
|
|
38
|
+
static allowedProps = allowedProps;
|
|
39
|
+
static defaultProps = {
|
|
40
|
+
inline: false,
|
|
41
|
+
layout: 'stacked',
|
|
42
|
+
labelAlign: 'end',
|
|
43
|
+
vAlign: 'middle'
|
|
44
|
+
};
|
|
45
|
+
ref = null;
|
|
46
|
+
handleRef = el => {
|
|
47
|
+
const {
|
|
48
|
+
elementRef
|
|
49
|
+
} = this.props;
|
|
50
|
+
this.ref = el;
|
|
51
|
+
if (typeof elementRef === 'function') {
|
|
52
|
+
elementRef(el);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
47
55
|
render() {
|
|
48
56
|
return _jsx(FormFieldLayout, {
|
|
49
57
|
...omitProps(this.props, FormField.allowedProps),
|
|
@@ -61,14 +69,5 @@ class FormField extends Component {
|
|
|
61
69
|
});
|
|
62
70
|
}
|
|
63
71
|
}
|
|
64
|
-
FormField.displayName = "FormField";
|
|
65
|
-
FormField.componentId = 'FormField';
|
|
66
|
-
FormField.allowedProps = allowedProps;
|
|
67
|
-
FormField.defaultProps = {
|
|
68
|
-
inline: false,
|
|
69
|
-
layout: 'stacked',
|
|
70
|
-
labelAlign: 'end',
|
|
71
|
-
vAlign: 'middle'
|
|
72
|
-
};
|
|
73
72
|
export default FormField;
|
|
74
73
|
export { FormField };
|
package/es/FormField/v2/index.js
CHANGED
|
@@ -34,17 +34,25 @@ category: components
|
|
|
34
34
|
---
|
|
35
35
|
**/
|
|
36
36
|
class FormField extends Component {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
static displayName = "FormField";
|
|
38
|
+
static componentId = 'FormField';
|
|
39
|
+
static allowedProps = allowedProps;
|
|
40
|
+
static defaultProps = {
|
|
41
|
+
inline: false,
|
|
42
|
+
layout: 'stacked',
|
|
43
|
+
labelAlign: 'end',
|
|
44
|
+
vAlign: 'middle'
|
|
45
|
+
};
|
|
46
|
+
ref = null;
|
|
47
|
+
handleRef = el => {
|
|
48
|
+
const {
|
|
49
|
+
elementRef
|
|
50
|
+
} = this.props;
|
|
51
|
+
this.ref = el;
|
|
52
|
+
if (typeof elementRef === 'function') {
|
|
53
|
+
elementRef(el);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
48
56
|
render() {
|
|
49
57
|
return _jsx(FormFieldLayout, {
|
|
50
58
|
...omitProps(this.props, FormField.allowedProps),
|
|
@@ -65,14 +73,5 @@ class FormField extends Component {
|
|
|
65
73
|
});
|
|
66
74
|
}
|
|
67
75
|
}
|
|
68
|
-
FormField.displayName = "FormField";
|
|
69
|
-
FormField.componentId = 'FormField';
|
|
70
|
-
FormField.allowedProps = allowedProps;
|
|
71
|
-
FormField.defaultProps = {
|
|
72
|
-
inline: false,
|
|
73
|
-
layout: 'stacked',
|
|
74
|
-
labelAlign: 'end',
|
|
75
|
-
vAlign: 'middle'
|
|
76
|
-
};
|
|
77
76
|
export default FormField;
|
|
78
77
|
export { FormField };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _dec, _class, _FormFieldGroup;
|
|
1
|
+
var _dec, _class;
|
|
2
|
+
import "core-js/modules/es.array.includes.js";
|
|
4
3
|
/*
|
|
5
4
|
* The MIT License (MIT)
|
|
6
5
|
*
|
|
@@ -40,25 +39,33 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
|
40
39
|
category: components
|
|
41
40
|
---
|
|
42
41
|
**/
|
|
43
|
-
let FormFieldGroup = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
42
|
+
let FormFieldGroup = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class FormFieldGroup extends Component {
|
|
43
|
+
static displayName = "FormFieldGroup";
|
|
44
|
+
static componentId = 'FormFieldGroup';
|
|
45
|
+
static allowedProps = allowedProps;
|
|
46
|
+
static defaultProps = {
|
|
47
|
+
as: 'fieldset',
|
|
48
|
+
disabled: false,
|
|
49
|
+
rowSpacing: 'medium',
|
|
50
|
+
colSpacing: 'small',
|
|
51
|
+
vAlign: 'middle',
|
|
52
|
+
isGroup: true
|
|
53
|
+
};
|
|
54
|
+
ref = null;
|
|
55
|
+
handleRef = el => {
|
|
56
|
+
const {
|
|
57
|
+
elementRef
|
|
58
|
+
} = this.props;
|
|
59
|
+
this.ref = el;
|
|
60
|
+
if (typeof elementRef === 'function') {
|
|
61
|
+
elementRef(el);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
55
64
|
componentDidMount() {
|
|
56
|
-
|
|
57
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStylesVariables);
|
|
65
|
+
this.props.makeStyles?.(this.makeStylesVariables);
|
|
58
66
|
}
|
|
59
67
|
componentDidUpdate() {
|
|
60
|
-
|
|
61
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStylesVariables);
|
|
68
|
+
this.props.makeStyles?.(this.makeStylesVariables);
|
|
62
69
|
}
|
|
63
70
|
get makeStylesVariables() {
|
|
64
71
|
// new form errors dont need borders
|
|
@@ -77,7 +84,7 @@ let FormFieldGroup = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
77
84
|
renderColumns() {
|
|
78
85
|
return Children.map(this.props.children, (child, index) => {
|
|
79
86
|
return child ? _jsx(Grid.Col, {
|
|
80
|
-
width: child.props && child.props.width ? 'auto' :
|
|
87
|
+
width: child.props && child.props.width ? 'auto' : undefined,
|
|
81
88
|
children: child
|
|
82
89
|
}, index) : null;
|
|
83
90
|
});
|
|
@@ -94,24 +101,27 @@ let FormFieldGroup = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
94
101
|
});
|
|
95
102
|
}
|
|
96
103
|
renderFields() {
|
|
97
|
-
const
|
|
104
|
+
const {
|
|
105
|
+
styles
|
|
106
|
+
} = this.props;
|
|
98
107
|
return _jsx("span", {
|
|
99
|
-
css: styles
|
|
108
|
+
css: styles?.formFieldGroup,
|
|
100
109
|
children: this.renderChildren()
|
|
101
110
|
}, "fields");
|
|
102
111
|
}
|
|
103
112
|
render() {
|
|
104
|
-
const
|
|
105
|
-
styles
|
|
106
|
-
makeStyles
|
|
107
|
-
isGroup
|
|
108
|
-
props
|
|
113
|
+
const {
|
|
114
|
+
styles,
|
|
115
|
+
makeStyles,
|
|
116
|
+
isGroup,
|
|
117
|
+
...props
|
|
118
|
+
} = this.props;
|
|
109
119
|
// This is quite ugly, but according to ARIA spec the `aria-invalid` prop
|
|
110
120
|
// can only be used with certain roles see
|
|
111
121
|
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-invalid#associated_roles
|
|
112
122
|
// `aria-invalid` is put on in FormFieldLayout because the error message
|
|
113
123
|
// DOM part gets there its ID.
|
|
114
|
-
let ariaInvalid =
|
|
124
|
+
let ariaInvalid = undefined;
|
|
115
125
|
if (this.props.role && this.invalid && ['application', 'checkbox', 'combobox', 'gridcell', 'listbox', 'radiogroup', 'slider', 'spinbutton', 'textbox', 'tree', 'columnheader', 'rowheader', 'searchbox', 'switch', 'treegrid'].includes(this.props.role)) {
|
|
116
126
|
ariaInvalid = 'true';
|
|
117
127
|
}
|
|
@@ -121,20 +131,13 @@ let FormFieldGroup = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
121
131
|
vAlign: props.vAlign,
|
|
122
132
|
layout: props.layout === 'inline' ? 'inline' : 'stacked',
|
|
123
133
|
label: props.description,
|
|
124
|
-
"aria-disabled": props.disabled ? 'true' :
|
|
134
|
+
"aria-disabled": props.disabled ? 'true' : undefined,
|
|
125
135
|
"aria-invalid": ariaInvalid,
|
|
126
136
|
elementRef: this.handleRef,
|
|
127
137
|
isGroup: isGroup,
|
|
128
138
|
children: this.renderFields()
|
|
129
139
|
});
|
|
130
140
|
}
|
|
131
|
-
}
|
|
132
|
-
as: 'fieldset',
|
|
133
|
-
disabled: false,
|
|
134
|
-
rowSpacing: 'medium',
|
|
135
|
-
colSpacing: 'small',
|
|
136
|
-
vAlign: 'middle',
|
|
137
|
-
isGroup: true
|
|
138
|
-
}, _FormFieldGroup)) || _class);
|
|
141
|
+
}) || _class);
|
|
139
142
|
export default FormFieldGroup;
|
|
140
143
|
export { FormFieldGroup };
|
|
@@ -33,8 +33,12 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props, state) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
const {
|
|
37
|
+
disabled
|
|
38
|
+
} = props;
|
|
39
|
+
const {
|
|
40
|
+
invalid
|
|
41
|
+
} = state;
|
|
38
42
|
return {
|
|
39
43
|
formFieldGroup: {
|
|
40
44
|
label: 'formFieldGroup',
|
|
@@ -28,17 +28,18 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
colors
|
|
34
|
-
spacing
|
|
31
|
+
const {
|
|
32
|
+
borders,
|
|
33
|
+
colors,
|
|
34
|
+
spacing
|
|
35
|
+
} = theme;
|
|
35
36
|
const componentVariables = {
|
|
36
|
-
borderWidth: borders
|
|
37
|
-
borderStyle: borders
|
|
37
|
+
borderWidth: borders?.widthSmall,
|
|
38
|
+
borderStyle: borders?.style,
|
|
38
39
|
borderColor: 'transparent',
|
|
39
|
-
borderRadius: borders
|
|
40
|
-
errorBorderColor: colors
|
|
41
|
-
errorFieldsPadding: spacing
|
|
40
|
+
borderRadius: borders?.radiusMedium,
|
|
41
|
+
errorBorderColor: colors?.contrasts?.red4570,
|
|
42
|
+
errorFieldsPadding: spacing?.xSmall
|
|
42
43
|
};
|
|
43
44
|
return {
|
|
44
45
|
...componentVariables
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _dec, _class, _FormFieldGroup;
|
|
1
|
+
var _dec, _class;
|
|
2
|
+
import "core-js/modules/es.array.includes.js";
|
|
4
3
|
/*
|
|
5
4
|
* The MIT License (MIT)
|
|
6
5
|
*
|
|
@@ -39,25 +38,33 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
|
39
38
|
category: components
|
|
40
39
|
---
|
|
41
40
|
**/
|
|
42
|
-
let FormFieldGroup = (_dec = withStyle(generateStyle), _dec(_class =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
41
|
+
let FormFieldGroup = (_dec = withStyle(generateStyle), _dec(_class = class FormFieldGroup extends Component {
|
|
42
|
+
static displayName = "FormFieldGroup";
|
|
43
|
+
static componentId = 'FormFieldGroup';
|
|
44
|
+
static allowedProps = allowedProps;
|
|
45
|
+
static defaultProps = {
|
|
46
|
+
as: 'fieldset',
|
|
47
|
+
disabled: false,
|
|
48
|
+
rowSpacing: 'medium',
|
|
49
|
+
colSpacing: 'small',
|
|
50
|
+
vAlign: 'middle',
|
|
51
|
+
isGroup: true
|
|
52
|
+
};
|
|
53
|
+
ref = null;
|
|
54
|
+
handleRef = el => {
|
|
55
|
+
const {
|
|
56
|
+
elementRef
|
|
57
|
+
} = this.props;
|
|
58
|
+
this.ref = el;
|
|
59
|
+
if (typeof elementRef === 'function') {
|
|
60
|
+
elementRef(el);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
54
63
|
componentDidMount() {
|
|
55
|
-
|
|
56
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
64
|
+
this.props.makeStyles?.();
|
|
57
65
|
}
|
|
58
66
|
componentDidUpdate() {
|
|
59
|
-
|
|
60
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
67
|
+
this.props.makeStyles?.();
|
|
61
68
|
}
|
|
62
69
|
get invalid() {
|
|
63
70
|
return !!this.props.messages && this.props.messages.findIndex(message => {
|
|
@@ -67,7 +74,7 @@ let FormFieldGroup = (_dec = withStyle(generateStyle), _dec(_class = (_FormField
|
|
|
67
74
|
renderColumns() {
|
|
68
75
|
return Children.map(this.props.children, (child, index) => {
|
|
69
76
|
return child ? _jsx(Grid.Col, {
|
|
70
|
-
width: child.props && child.props.width ? 'auto' :
|
|
77
|
+
width: child.props && child.props.width ? 'auto' : undefined,
|
|
71
78
|
children: child
|
|
72
79
|
}, index) : null;
|
|
73
80
|
});
|
|
@@ -84,24 +91,27 @@ let FormFieldGroup = (_dec = withStyle(generateStyle), _dec(_class = (_FormField
|
|
|
84
91
|
});
|
|
85
92
|
}
|
|
86
93
|
renderFields() {
|
|
87
|
-
const
|
|
94
|
+
const {
|
|
95
|
+
styles
|
|
96
|
+
} = this.props;
|
|
88
97
|
return _jsx("span", {
|
|
89
|
-
css: styles
|
|
98
|
+
css: styles?.formFieldGroup,
|
|
90
99
|
children: this.renderChildren()
|
|
91
100
|
}, "fields");
|
|
92
101
|
}
|
|
93
102
|
render() {
|
|
94
|
-
const
|
|
95
|
-
styles
|
|
96
|
-
makeStyles
|
|
97
|
-
isGroup
|
|
98
|
-
props
|
|
103
|
+
const {
|
|
104
|
+
styles,
|
|
105
|
+
makeStyles,
|
|
106
|
+
isGroup,
|
|
107
|
+
...props
|
|
108
|
+
} = this.props;
|
|
99
109
|
// This is quite ugly, but according to ARIA spec the `aria-invalid` prop
|
|
100
110
|
// can only be used with certain roles see
|
|
101
111
|
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-invalid#associated_roles
|
|
102
112
|
// `aria-invalid` is put on in FormFieldLayout because the error message
|
|
103
113
|
// DOM part gets there its ID.
|
|
104
|
-
let ariaInvalid =
|
|
114
|
+
let ariaInvalid = undefined;
|
|
105
115
|
if (this.props.role && this.invalid && ['application', 'checkbox', 'combobox', 'gridcell', 'listbox', 'radiogroup', 'slider', 'spinbutton', 'textbox', 'tree', 'columnheader', 'rowheader', 'searchbox', 'switch', 'treegrid'].includes(this.props.role)) {
|
|
106
116
|
ariaInvalid = 'true';
|
|
107
117
|
}
|
|
@@ -111,20 +121,13 @@ let FormFieldGroup = (_dec = withStyle(generateStyle), _dec(_class = (_FormField
|
|
|
111
121
|
vAlign: props.vAlign,
|
|
112
122
|
layout: props.layout === 'inline' ? 'inline' : 'stacked',
|
|
113
123
|
label: props.description,
|
|
114
|
-
"aria-disabled": props.disabled ? 'true' :
|
|
124
|
+
"aria-disabled": props.disabled ? 'true' : undefined,
|
|
115
125
|
"aria-invalid": ariaInvalid,
|
|
116
126
|
elementRef: this.handleRef,
|
|
117
127
|
isGroup: isGroup,
|
|
118
128
|
children: this.renderFields()
|
|
119
129
|
});
|
|
120
130
|
}
|
|
121
|
-
}
|
|
122
|
-
as: 'fieldset',
|
|
123
|
-
disabled: false,
|
|
124
|
-
rowSpacing: 'medium',
|
|
125
|
-
colSpacing: 'small',
|
|
126
|
-
vAlign: 'middle',
|
|
127
|
-
isGroup: true
|
|
128
|
-
}, _FormFieldGroup)) || _class);
|
|
131
|
+
}) || _class);
|
|
129
132
|
export default FormFieldGroup;
|
|
130
133
|
export { FormFieldGroup };
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
* @return {Object} The final style object, which will be used in the component
|
|
33
33
|
*/
|
|
34
34
|
const generateStyle = (_componentTheme, props) => {
|
|
35
|
-
const
|
|
35
|
+
const {
|
|
36
|
+
disabled
|
|
37
|
+
} = props;
|
|
36
38
|
return {
|
|
37
39
|
formFieldGroup: {
|
|
38
40
|
label: 'formFieldGroup',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _class
|
|
1
|
+
var _dec, _class;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -48,36 +48,36 @@ type: example
|
|
|
48
48
|
@deprecated since version 10. This is an internal component that will be
|
|
49
49
|
removed in the future
|
|
50
50
|
**/
|
|
51
|
-
let FormFieldLabel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
let FormFieldLabel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class FormFieldLabel extends Component {
|
|
52
|
+
static displayName = "FormFieldLabel";
|
|
53
|
+
static componentId = 'FormFieldLabel';
|
|
54
|
+
static allowedProps = allowedProps;
|
|
55
|
+
static defaultProps = {
|
|
56
|
+
as: 'span'
|
|
57
|
+
};
|
|
58
|
+
ref = null;
|
|
59
|
+
handleRef = el => {
|
|
60
|
+
this.ref = el;
|
|
61
|
+
};
|
|
59
62
|
componentDidMount() {
|
|
60
|
-
|
|
61
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
63
|
+
this.props.makeStyles?.();
|
|
62
64
|
}
|
|
63
65
|
componentDidUpdate() {
|
|
64
|
-
|
|
65
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
66
|
+
this.props.makeStyles?.();
|
|
66
67
|
}
|
|
67
68
|
render() {
|
|
68
69
|
const ElementType = getElementType(FormFieldLabel, this.props);
|
|
69
|
-
const
|
|
70
|
-
styles
|
|
71
|
-
children
|
|
70
|
+
const {
|
|
71
|
+
styles,
|
|
72
|
+
children
|
|
73
|
+
} = this.props;
|
|
72
74
|
return _jsx(ElementType, {
|
|
73
75
|
...omitProps(this.props, FormFieldLabel.allowedProps),
|
|
74
|
-
css: styles
|
|
76
|
+
css: styles?.formFieldLabel,
|
|
75
77
|
ref: this.handleRef,
|
|
76
78
|
children: children
|
|
77
79
|
});
|
|
78
80
|
}
|
|
79
|
-
}
|
|
80
|
-
as: 'span'
|
|
81
|
-
}, _FormFieldLabel)) || _class);
|
|
81
|
+
}) || _class);
|
|
82
82
|
export default FormFieldLabel;
|
|
83
83
|
export { FormFieldLabel };
|
|
@@ -34,7 +34,9 @@ import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
|
|
|
34
34
|
* @return {Object} The final style object, which will be used in the component
|
|
35
35
|
*/
|
|
36
36
|
const generateStyle = (componentTheme, props) => {
|
|
37
|
-
const
|
|
37
|
+
const {
|
|
38
|
+
children
|
|
39
|
+
} = props;
|
|
38
40
|
const hasContent = hasVisibleChildren(children);
|
|
39
41
|
const labelStyles = {
|
|
40
42
|
all: 'initial',
|
|
@@ -28,21 +28,22 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
typography
|
|
34
|
-
themeName
|
|
31
|
+
const {
|
|
32
|
+
colors,
|
|
33
|
+
typography,
|
|
34
|
+
key: themeName
|
|
35
|
+
} = theme;
|
|
35
36
|
const themeSpecificStyle = {
|
|
36
37
|
canvas: {
|
|
37
38
|
color: theme['ic-brand-font-color-dark']
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
41
|
const componentVariables = {
|
|
41
|
-
color: colors
|
|
42
|
-
fontFamily: typography
|
|
43
|
-
fontWeight: typography
|
|
44
|
-
fontSize: typography
|
|
45
|
-
lineHeight: typography
|
|
42
|
+
color: colors?.contrasts?.grey125125,
|
|
43
|
+
fontFamily: typography?.fontFamily,
|
|
44
|
+
fontWeight: typography?.fontWeightBold,
|
|
45
|
+
fontSize: typography?.fontSizeMedium,
|
|
46
|
+
lineHeight: typography?.lineHeightFit
|
|
46
47
|
};
|
|
47
48
|
return {
|
|
48
49
|
...componentVariables,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _class
|
|
1
|
+
var _dec, _class;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -48,36 +48,36 @@ type: example
|
|
|
48
48
|
@deprecated since version 10. This is an internal component that will be
|
|
49
49
|
removed in the future
|
|
50
50
|
**/
|
|
51
|
-
let FormFieldLabel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
let FormFieldLabel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class FormFieldLabel extends Component {
|
|
52
|
+
static displayName = "FormFieldLabel";
|
|
53
|
+
static componentId = 'FormFieldLabel';
|
|
54
|
+
static allowedProps = allowedProps;
|
|
55
|
+
static defaultProps = {
|
|
56
|
+
as: 'span'
|
|
57
|
+
};
|
|
58
|
+
ref = null;
|
|
59
|
+
handleRef = el => {
|
|
60
|
+
this.ref = el;
|
|
61
|
+
};
|
|
59
62
|
componentDidMount() {
|
|
60
|
-
|
|
61
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
63
|
+
this.props.makeStyles?.();
|
|
62
64
|
}
|
|
63
65
|
componentDidUpdate() {
|
|
64
|
-
|
|
65
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
66
|
+
this.props.makeStyles?.();
|
|
66
67
|
}
|
|
67
68
|
render() {
|
|
68
69
|
const ElementType = getElementType(FormFieldLabel, this.props);
|
|
69
|
-
const
|
|
70
|
-
styles
|
|
71
|
-
children
|
|
70
|
+
const {
|
|
71
|
+
styles,
|
|
72
|
+
children
|
|
73
|
+
} = this.props;
|
|
72
74
|
return _jsx(ElementType, {
|
|
73
75
|
...omitProps(this.props, FormFieldLabel.allowedProps),
|
|
74
|
-
css: styles
|
|
76
|
+
css: styles?.formFieldLabel,
|
|
75
77
|
ref: this.handleRef,
|
|
76
78
|
children: children
|
|
77
79
|
});
|
|
78
80
|
}
|
|
79
|
-
}
|
|
80
|
-
as: 'span'
|
|
81
|
-
}, _FormFieldLabel)) || _class);
|
|
81
|
+
}) || _class);
|
|
82
82
|
export default FormFieldLabel;
|
|
83
83
|
export { FormFieldLabel };
|
|
@@ -34,7 +34,9 @@ import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
|
|
|
34
34
|
* @return {Object} The final style object, which will be used in the component
|
|
35
35
|
*/
|
|
36
36
|
const generateStyle = (componentTheme, props) => {
|
|
37
|
-
const
|
|
37
|
+
const {
|
|
38
|
+
children
|
|
39
|
+
} = props;
|
|
38
40
|
const hasContent = hasVisibleChildren(children);
|
|
39
41
|
const labelStyles = {
|
|
40
42
|
all: 'initial',
|
|
@@ -28,21 +28,22 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
typography
|
|
34
|
-
themeName
|
|
31
|
+
const {
|
|
32
|
+
colors,
|
|
33
|
+
typography,
|
|
34
|
+
key: themeName
|
|
35
|
+
} = theme;
|
|
35
36
|
const themeSpecificStyle = {
|
|
36
37
|
canvas: {
|
|
37
38
|
color: theme['ic-brand-font-color-dark']
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
41
|
const componentVariables = {
|
|
41
|
-
color: colors
|
|
42
|
-
fontFamily: typography
|
|
43
|
-
fontWeight: typography
|
|
44
|
-
fontSize: typography
|
|
45
|
-
lineHeight: typography
|
|
42
|
+
color: colors?.contrasts?.grey125125,
|
|
43
|
+
fontFamily: typography?.fontFamily,
|
|
44
|
+
fontWeight: typography?.fontWeightBold,
|
|
45
|
+
fontSize: typography?.fontSizeMedium,
|
|
46
|
+
lineHeight: typography?.lineHeightFit
|
|
46
47
|
};
|
|
47
48
|
return {
|
|
48
49
|
...componentVariables,
|