You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However you might have noticed from the type definition that a message can be `error`and `newError` type. This is due to compatibility reasons. `error` is the older type and does not meet accessibility requirements, `newError` (hance the name) is the newer and more accessible format.
50
+
The `error` type has been updated to meet accessibility requirements with proper icons and visual styling. Previously, there was a `newError` type that provided this enhanced behavior, but it has been consolidated into the standard `error` type for consistency. `newError` has been deprecated.
52
51
53
-
We wanted to allow users to start using the new format without making it mandatory, but after the introductory period `newError` will be deprecated and `error` type will be changed to look and behave the same way.
54
-
55
-
With this update we also introduced the "required asterisk" which will display an `*` character next to field labels that are required. This update is not opt-in and will apply to **all** InstUI form components so if you were relying on a custom solution for this feature before, you need to remove that to avoid having double asterisks.
52
+
We also introduced the "required asterisk" which displays an `*` character next to field labels that are required. This update applies to **all** InstUI form components, so if you were relying on a custom solution for this feature before, you need to remove that to avoid having double asterisks.
? [{type: showNewError?'newError':'error', text: showLongError?'Long error. Lorem ipsum dolor sit amet consectetur adipisicing elit. Dignissimos voluptas, esse commodi eos facilis voluptatibus harum exercitationem. Et magni est consectetur, eveniet veniam unde! Molestiae labore libero sapiente ad ratione.':'Short error message'}]
66
+
? [{type: 'error', text: showLongError?'Long error. Lorem ipsum dolor sit amet consectetur adipisicing elit. Dignissimos voluptas, esse commodi eos facilis voluptatibus harum exercitationem. Et magni est consectetur, eveniet veniam unde! Molestiae labore libero sapiente ad ratione.':'Short error message'}]
Copy file name to clipboardExpand all lines: docs/guides/upgrade-guide.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,58 @@ The new icons automatically sync with theme changes, support all InstUI color to
51
51
-`as` prop has been removed, `Spinner` will always render as a `<div>` element.
52
52
-`elementRef` prop has been removed, use the `ref` prop instead.
53
53
54
+
### FormFieldGroup
55
+
56
+
- theme variable `errorBorderColor` is now removed
57
+
- theme variable `errorFieldsPaddin` is now removed
58
+
59
+
### FormFieldLayout
60
+
61
+
- theme variable `spacing` is now removed
62
+
- theme variable `color` has been renamed to `textColor`
63
+
- theme variable `inlinePadding` is now removed
64
+
- theme variable `asteriskColor` is now removed
65
+
66
+
### FormFieldMessage
67
+
68
+
- theme variable `colorHint` has been renamed to `hintTextColor`
69
+
- theme variable `colorError` has been renamed to `errorTextColor`
70
+
- theme variable `colorSuccess` has been renamed to `successTextColor`
71
+
- theme variable `errorIconMarginRight` is now removed
72
+
73
+
### FormFieldMessages
74
+
75
+
- theme variable `topMargin` is now removed
76
+
77
+
### TextArea
78
+
79
+
- theme variable `smallFontSize` is now renamed to `fontSizeSm`
80
+
- theme variable `mediumFontSize` is now renamed to `fontSizeMd`
81
+
- theme variable `largeFontMedium` is now renamed to `fontSizeLg`
82
+
- theme variable `requiredInvalidColor` is now removed
83
+
- theme variable `borderStyle` is now removed
84
+
- theme variable `borderTopColor` is now removed
85
+
- theme variable `borderBottomColor` is now removed
86
+
- theme variable `borderLeftColor` is now removed
87
+
- theme variable `borderRightColor` is now removed
88
+
- theme variable `color` is now renamed to `textColor`
89
+
- theme variable `background` is now renamed to `backgroundColor`
90
+
- theme variable `focusOutlineWidth` is now removed
91
+
- theme variable `focusOutlineStyle` is now removed
92
+
- theme variable `focusOutlineColor` is now removed
93
+
94
+
### NumberInput
95
+
96
+
- theme variable `requiredInvalidColor` is now removed
97
+
98
+
### RadioInputGroup
99
+
100
+
- theme variable `invalidAsteriskColor` is now removed
101
+
102
+
### TextInput
103
+
104
+
- theme variable `requiredInvalidColor` is now removed
105
+
54
106
## Codemods
55
107
56
108
To ease the upgrade, we provide codemods that will automate most of the changes. Pay close attention to its output, it cannot refactor complex code! The codemod scripts can be run via the following commands:
Copy file name to clipboardExpand all lines: packages/__docs__/buildScripts/ai-accessible-documentation/summaries-for-llms-file.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -434,7 +434,7 @@
434
434
},
435
435
{
436
436
"title": "form-errors",
437
-
"summary": "InstUI form components use a `messages` prop for error/hint/success messages. Supports both `error` (legacy) and `newError` (accessible) types. Required fields now show an asterisk automatically. Examples provided for various form components like TextInput, Checkbox, and DateTimeInput."
437
+
"summary": "InstUI form components use a `messages` prop for error/hint/success messages. Required fields now show an asterisk automatically. Examples provided for various form components like TextInput, Checkbox, and DateTimeInput."
// if the component is in error state, create an empty error message to pass down to the subcomponents (DateInput and TimeInput) so they get a red outline and red required asterisk
messages={[{type:'success', text:'This is a success message'}, {type:'newError', text:'An error message. It will wrap if the text is longer than the width of the container.'}]}>
14
+
messages={[{type:'success', text:'This is a success message'}, {type:'error', text:'An error message. It will wrap if the text is longer than the width of the container.'}]}>
messages={[{type:'success', text:'This is a success message'}, {type:'newError', text:'An error message. It will wrap if the text is longer than the width of the container.'}]}>
20
+
messages={[{type:'success', text:'This is a success message'}, {type:'error', text:'An error message. It will wrap if the text is longer than the width of the container.'}]}>
messages={[{type:'success', text:'success!'}, {type:'newError', text:'An error message. It will wrap if the text is longer than the width of the container.'}]}>
26
+
messages={[{type:'success', text:'success!'}, {type:'error', text:'An error message. It will wrap if the text is longer than the width of the container.'}]}>
messages={[{type:'success', text:'success!'}, {type:'newError', text:'An error message. It will wrap if the text is longer than the width of the container.'}]}>
32
+
messages={[{type:'success', text:'success!'}, {type:'error', text:'An error message. It will wrap if the text is longer than the width of the container.'}]}>
Copy file name to clipboardExpand all lines: packages/ui-form-field/src/FormField/props.ts
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,10 @@ type FormFieldOwnProps = {
57
57
* provides a reference to the underlying html root element
58
58
*/
59
59
elementRef?: (element: Element|null)=>void
60
+
/**
61
+
* If `true`, displays an asterisk after the label to indicate the field is required
62
+
*/
63
+
isRequired?: boolean
60
64
61
65
/**
62
66
* Margin around the component. Accepts a `Spacing` token. See token values and example usage in [this guide](https://instructure.design/#layout-spacing).
0 commit comments