@instructure/ui-form-field 10.12.1-snapshot-3 → 10.12.1-snapshot-6
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 +1 -1
- package/es/FormFieldLayout/index.js +4 -1
- package/es/FormFieldLayout/styles.js +6 -10
- package/lib/FormFieldLayout/index.js +4 -1
- package/lib/FormFieldLayout/styles.js +6 -10
- package/package.json +15 -15
- package/src/FormFieldLayout/index.tsx +5 -1
- package/src/FormFieldLayout/styles.ts +6 -9
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/FormFieldLayout/index.d.ts.map +1 -1
- package/types/FormFieldLayout/styles.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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.12.1-snapshot-
|
|
6
|
+
## [10.12.1-snapshot-6](https://github.com/instructure/instructure-ui/compare/v10.12.0...v10.12.1-snapshot-6) (2025-03-06)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
@@ -130,7 +130,10 @@ let FormFieldLayout = (_dec = withDeterministicId(), _dec2 = withStyle(generateS
|
|
|
130
130
|
}
|
|
131
131
|
// needs to be wrapped because it needs an `id`
|
|
132
132
|
return jsx("div", {
|
|
133
|
-
id: this._labelId
|
|
133
|
+
id: this._labelId,
|
|
134
|
+
style: {
|
|
135
|
+
display: 'contents'
|
|
136
|
+
}
|
|
134
137
|
}, this.props.label);
|
|
135
138
|
} else return null;
|
|
136
139
|
}
|
|
@@ -87,8 +87,8 @@ const generateStyle = (componentTheme, props, styleProps) => {
|
|
|
87
87
|
fontWeight: componentTheme.fontWeight,
|
|
88
88
|
fontSize: componentTheme.fontSize,
|
|
89
89
|
lineHeight: componentTheme.lineHeight,
|
|
90
|
-
margin: '0 0 0.75rem 0',
|
|
91
90
|
...(isInlineLayout && {
|
|
91
|
+
margin: '0',
|
|
92
92
|
// when inline add a small padding between the label and the control
|
|
93
93
|
paddingRight: componentTheme.inlinePadding,
|
|
94
94
|
// and use the horizontal alignment prop
|
|
@@ -128,6 +128,7 @@ const generateStyle = (componentTheme, props, styleProps) => {
|
|
|
128
128
|
gridTemplateAreas: generateGridLayout(false, hasNewErrorMsgAndIsGroup, hasVisibleLabel, hasMessages)
|
|
129
129
|
},
|
|
130
130
|
columnGap: '0.375rem',
|
|
131
|
+
rowGap: '0.75rem',
|
|
131
132
|
width: '100%',
|
|
132
133
|
...(inline && {
|
|
133
134
|
display: 'inline-grid',
|
|
@@ -136,12 +137,10 @@ const generateStyle = (componentTheme, props, styleProps) => {
|
|
|
136
137
|
},
|
|
137
138
|
formFieldLabel: {
|
|
138
139
|
label: 'formFieldLayout__label',
|
|
139
|
-
...
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
'&:-webkit-any(label)': labelStyles
|
|
144
|
-
})
|
|
140
|
+
...labelStyles,
|
|
141
|
+
// NOTE: needs separate groups for `:is()` and `:-webkit-any()` because of css selector group validation (see https://www.w3.org/TR/selectors-3/#grouping)
|
|
142
|
+
'&:is(label)': labelStyles,
|
|
143
|
+
'&:-webkit-any(label)': labelStyles
|
|
145
144
|
},
|
|
146
145
|
formFieldChildren: {
|
|
147
146
|
label: 'formFieldLayout__children',
|
|
@@ -150,9 +149,6 @@ const generateStyle = (componentTheme, props, styleProps) => {
|
|
|
150
149
|
...(hasMessages && hasNewErrorMsgAndIsGroup && {
|
|
151
150
|
marginTop: '0.375rem'
|
|
152
151
|
}),
|
|
153
|
-
...(hasMessages && !hasNewErrorMsgAndIsGroup && {
|
|
154
|
-
marginBottom: '0.75rem'
|
|
155
|
-
}),
|
|
156
152
|
...(isInlineLayout && inline && {
|
|
157
153
|
[`@media screen and (min-width: ${componentTheme.stackedOrInlineBreakpoint})`]: {
|
|
158
154
|
justifySelf: 'start'
|
|
@@ -137,7 +137,10 @@ let FormFieldLayout = exports.FormFieldLayout = (_dec = (0, _withDeterministicId
|
|
|
137
137
|
}
|
|
138
138
|
// needs to be wrapped because it needs an `id`
|
|
139
139
|
return (0, _emotion.jsx)("div", {
|
|
140
|
-
id: this._labelId
|
|
140
|
+
id: this._labelId,
|
|
141
|
+
style: {
|
|
142
|
+
display: 'contents'
|
|
143
|
+
}
|
|
141
144
|
}, this.props.label);
|
|
142
145
|
} else return null;
|
|
143
146
|
}
|
|
@@ -93,8 +93,8 @@ const generateStyle = (componentTheme, props, styleProps) => {
|
|
|
93
93
|
fontWeight: componentTheme.fontWeight,
|
|
94
94
|
fontSize: componentTheme.fontSize,
|
|
95
95
|
lineHeight: componentTheme.lineHeight,
|
|
96
|
-
margin: '0 0 0.75rem 0',
|
|
97
96
|
...(isInlineLayout && {
|
|
97
|
+
margin: '0',
|
|
98
98
|
// when inline add a small padding between the label and the control
|
|
99
99
|
paddingRight: componentTheme.inlinePadding,
|
|
100
100
|
// and use the horizontal alignment prop
|
|
@@ -134,6 +134,7 @@ const generateStyle = (componentTheme, props, styleProps) => {
|
|
|
134
134
|
gridTemplateAreas: generateGridLayout(false, hasNewErrorMsgAndIsGroup, hasVisibleLabel, hasMessages)
|
|
135
135
|
},
|
|
136
136
|
columnGap: '0.375rem',
|
|
137
|
+
rowGap: '0.75rem',
|
|
137
138
|
width: '100%',
|
|
138
139
|
...(inline && {
|
|
139
140
|
display: 'inline-grid',
|
|
@@ -142,12 +143,10 @@ const generateStyle = (componentTheme, props, styleProps) => {
|
|
|
142
143
|
},
|
|
143
144
|
formFieldLabel: {
|
|
144
145
|
label: 'formFieldLayout__label',
|
|
145
|
-
...
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
'&:-webkit-any(label)': labelStyles
|
|
150
|
-
})
|
|
146
|
+
...labelStyles,
|
|
147
|
+
// NOTE: needs separate groups for `:is()` and `:-webkit-any()` because of css selector group validation (see https://www.w3.org/TR/selectors-3/#grouping)
|
|
148
|
+
'&:is(label)': labelStyles,
|
|
149
|
+
'&:-webkit-any(label)': labelStyles
|
|
151
150
|
},
|
|
152
151
|
formFieldChildren: {
|
|
153
152
|
label: 'formFieldLayout__children',
|
|
@@ -156,9 +155,6 @@ const generateStyle = (componentTheme, props, styleProps) => {
|
|
|
156
155
|
...(hasMessages && hasNewErrorMsgAndIsGroup && {
|
|
157
156
|
marginTop: '0.375rem'
|
|
158
157
|
}),
|
|
159
|
-
...(hasMessages && !hasNewErrorMsgAndIsGroup && {
|
|
160
|
-
marginBottom: '0.75rem'
|
|
161
|
-
}),
|
|
162
158
|
...(isInlineLayout && inline && {
|
|
163
159
|
[`@media screen and (min-width: ${componentTheme.stackedOrInlineBreakpoint})`]: {
|
|
164
160
|
justifySelf: 'start'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-form-field",
|
|
3
|
-
"version": "10.12.1-snapshot-
|
|
3
|
+
"version": "10.12.1-snapshot-6",
|
|
4
4
|
"description": "Form layout components.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,26 +23,26 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "10.12.1-snapshot-
|
|
27
|
-
"@instructure/ui-babel-preset": "10.12.1-snapshot-
|
|
28
|
-
"@instructure/ui-test-utils": "10.12.1-snapshot-
|
|
29
|
-
"@instructure/ui-themes": "10.12.1-snapshot-
|
|
26
|
+
"@instructure/ui-axe-check": "10.12.1-snapshot-6",
|
|
27
|
+
"@instructure/ui-babel-preset": "10.12.1-snapshot-6",
|
|
28
|
+
"@instructure/ui-test-utils": "10.12.1-snapshot-6",
|
|
29
|
+
"@instructure/ui-themes": "10.12.1-snapshot-6",
|
|
30
30
|
"@testing-library/jest-dom": "^6.6.3",
|
|
31
31
|
"@testing-library/react": "^16.0.1",
|
|
32
32
|
"vitest": "^2.1.8"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/runtime": "^7.26.0",
|
|
36
|
-
"@instructure/console": "10.12.1-snapshot-
|
|
37
|
-
"@instructure/emotion": "10.12.1-snapshot-
|
|
38
|
-
"@instructure/shared-types": "10.12.1-snapshot-
|
|
39
|
-
"@instructure/ui-a11y-content": "10.12.1-snapshot-
|
|
40
|
-
"@instructure/ui-a11y-utils": "10.12.1-snapshot-
|
|
41
|
-
"@instructure/ui-grid": "10.12.1-snapshot-
|
|
42
|
-
"@instructure/ui-icons": "10.12.1-snapshot-
|
|
43
|
-
"@instructure/ui-react-utils": "10.12.1-snapshot-
|
|
44
|
-
"@instructure/ui-utils": "10.12.1-snapshot-
|
|
45
|
-
"@instructure/uid": "10.12.1-snapshot-
|
|
36
|
+
"@instructure/console": "10.12.1-snapshot-6",
|
|
37
|
+
"@instructure/emotion": "10.12.1-snapshot-6",
|
|
38
|
+
"@instructure/shared-types": "10.12.1-snapshot-6",
|
|
39
|
+
"@instructure/ui-a11y-content": "10.12.1-snapshot-6",
|
|
40
|
+
"@instructure/ui-a11y-utils": "10.12.1-snapshot-6",
|
|
41
|
+
"@instructure/ui-grid": "10.12.1-snapshot-6",
|
|
42
|
+
"@instructure/ui-icons": "10.12.1-snapshot-6",
|
|
43
|
+
"@instructure/ui-react-utils": "10.12.1-snapshot-6",
|
|
44
|
+
"@instructure/ui-utils": "10.12.1-snapshot-6",
|
|
45
|
+
"@instructure/uid": "10.12.1-snapshot-6",
|
|
46
46
|
"prop-types": "^15.8.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
@@ -154,7 +154,11 @@ class FormFieldLayout extends Component<FormFieldLayoutProps> {
|
|
|
154
154
|
)
|
|
155
155
|
}
|
|
156
156
|
// needs to be wrapped because it needs an `id`
|
|
157
|
-
return
|
|
157
|
+
return (
|
|
158
|
+
<div id={this._labelId} style={{ display: 'contents' }}>
|
|
159
|
+
{this.props.label}
|
|
160
|
+
</div>
|
|
161
|
+
)
|
|
158
162
|
} else return null
|
|
159
163
|
}
|
|
160
164
|
|
|
@@ -102,8 +102,8 @@ const generateStyle = (
|
|
|
102
102
|
fontWeight: componentTheme.fontWeight,
|
|
103
103
|
fontSize: componentTheme.fontSize,
|
|
104
104
|
lineHeight: componentTheme.lineHeight,
|
|
105
|
-
margin: '0 0 0.75rem 0',
|
|
106
105
|
...(isInlineLayout && {
|
|
106
|
+
margin: '0',
|
|
107
107
|
// when inline add a small padding between the label and the control
|
|
108
108
|
paddingRight: componentTheme.inlinePadding,
|
|
109
109
|
// and use the horizontal alignment prop
|
|
@@ -150,6 +150,7 @@ const generateStyle = (
|
|
|
150
150
|
)
|
|
151
151
|
},
|
|
152
152
|
columnGap: '0.375rem',
|
|
153
|
+
rowGap: '0.75rem',
|
|
153
154
|
width: '100%',
|
|
154
155
|
...(inline && {
|
|
155
156
|
display: 'inline-grid',
|
|
@@ -158,20 +159,16 @@ const generateStyle = (
|
|
|
158
159
|
},
|
|
159
160
|
formFieldLabel: {
|
|
160
161
|
label: 'formFieldLayout__label',
|
|
161
|
-
...
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
'&:-webkit-any(label)': labelStyles
|
|
166
|
-
})
|
|
162
|
+
...labelStyles,
|
|
163
|
+
// NOTE: needs separate groups for `:is()` and `:-webkit-any()` because of css selector group validation (see https://www.w3.org/TR/selectors-3/#grouping)
|
|
164
|
+
'&:is(label)': labelStyles,
|
|
165
|
+
'&:-webkit-any(label)': labelStyles
|
|
167
166
|
},
|
|
168
167
|
formFieldChildren: {
|
|
169
168
|
label: 'formFieldLayout__children',
|
|
170
169
|
gridArea: 'controls',
|
|
171
170
|
// add a small margin between the message and the controls
|
|
172
171
|
...(hasMessages && hasNewErrorMsgAndIsGroup && { marginTop: '0.375rem' }),
|
|
173
|
-
...(hasMessages &&
|
|
174
|
-
!hasNewErrorMsgAndIsGroup && { marginBottom: '0.75rem' }),
|
|
175
172
|
...(isInlineLayout &&
|
|
176
173
|
inline && {
|
|
177
174
|
[`@media screen and (min-width: ${componentTheme.stackedOrInlineBreakpoint})`]:
|