Skip to content

Commit 4549eee

Browse files
committed
feat(ui-form-field): rework FormFieldGroup
INSTUI-4871
1 parent b8c1e81 commit 4549eee

File tree

6 files changed

+12
-107
lines changed

6 files changed

+12
-107
lines changed

docs/guides/upgrade-guide.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,10 @@ type: example
104104
<TextInput renderLabel="Name" placeholder="Doe, John Doe"/>
105105
</InstUISettingsProvider>
106106
```
107+
107108
### Breadcrumb
108109

109-
#### New tokens
110+
#### New tokens
110111

111112
- gapSm - Gap spacing for small size breadcrumbs
112113
- gapMd - Gap spacing for medium size breadcrumbs
@@ -145,7 +146,11 @@ type: example
145146
### FormFieldGroup
146147

147148
- theme variable `errorBorderColor` is now removed
148-
- theme variable `errorFieldsPaddin` is now removed
149+
- theme variable `errorFieldsPadding` is now removed
150+
- theme variable `borderColor` is now removed
151+
- theme variable `borderStyle` is now removed
152+
- theme variable `borderWidth` is now removed
153+
- `error` or `success` messages are no longer displayed when the component is `readOnly` or `disabled`
149154

150155
### FormFieldLayout
151156

packages/ui-form-field/src/FormFieldGroup/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ import { Component, Children, ReactElement, AriaAttributes } from 'react'
2626

2727
import { Grid } from '@instructure/ui-grid'
2828
import { pickProps, omitProps } from '@instructure/ui-react-utils'
29-
import { withStyleRework as withStyle } from '@instructure/emotion'
29+
import { withStyle } from '@instructure/emotion'
3030

3131
import {
3232
FormFieldLayout,
3333
allowedProps as formFieldLayoutAllowedProps
3434
} from '../FormFieldLayout'
3535

3636
import generateStyle from './styles'
37-
import generateComponentTheme from './theme'
3837

3938
import { allowedProps } from './props'
4039
import type { FormFieldGroupProps } from './props'
@@ -44,7 +43,7 @@ import type { FormFieldGroupProps } from './props'
4443
category: components
4544
---
4645
**/
47-
@withStyle(generateStyle, generateComponentTheme)
46+
@withStyle(generateStyle)
4847
class FormFieldGroup extends Component<FormFieldGroupProps> {
4948
static readonly componentId = 'FormFieldGroup'
5049

packages/ui-form-field/src/FormFieldGroup/styles.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,14 @@ import type { FormFieldGroupProps, FormFieldGroupStyle } from './props'
3636
* @return {Object} The final style object, which will be used in the component
3737
*/
3838
const generateStyle = (
39-
componentTheme: FormFieldGroupTheme,
39+
_componentTheme: FormFieldGroupTheme,
4040
props: FormFieldGroupProps
4141
): FormFieldGroupStyle => {
4242
const { disabled } = props
4343

4444
return {
4545
formFieldGroup: {
4646
label: 'formFieldGroup',
47-
border: `${componentTheme.borderWidth} ${componentTheme.borderStyle} ${componentTheme.borderColor}`,
48-
borderRadius: componentTheme.borderRadius,
4947
display: 'block',
5048

5149
...(disabled && {

packages/ui-form-field/src/FormFieldGroup/theme.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

packages/ui-form-field/src/FormFieldMessages/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ import { Component } from 'react'
2626

2727
import { omitProps } from '@instructure/ui-react-utils'
2828

29-
import { withStyleRework as withStyle } from '@instructure/emotion'
29+
import { withStyle } from '@instructure/emotion'
3030

3131
import { FormFieldMessage } from '../FormFieldMessage'
3232

3333
import generateStyle from './styles'
34-
import generateComponentTheme from './theme'
3534

3635
import { allowedProps } from './props'
3736
import type { FormFieldMessagesProps } from './props'
@@ -54,7 +53,7 @@ type: example
5453
]} />
5554
```
5655
**/
57-
@withStyle(generateStyle, generateComponentTheme)
56+
@withStyle(generateStyle)
5857
class FormFieldMessages extends Component<FormFieldMessagesProps> {
5958
static readonly componentId = 'FormFieldMessages'
6059

packages/ui-form-field/src/FormFieldMessages/theme.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)