Skip to content

Commit 73af976

Browse files
committed
docs(many): replace 'error' with 'newError' in the examples
INSTUI-4873
1 parent 22889e6 commit 73af976

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

packages/ui-checkbox/src/CheckboxGroup/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type: example
4545
name="sports2"
4646
layout="inline"
4747
messages={[
48-
{ text: 'Invalid name', type: 'error' }
48+
{ text: 'Invalid name', type: 'newError' }
4949
]}
5050
onChange={function (value) { console.log(value) }}
5151
defaultValue={['soccer', 'volleyball']}

packages/ui-color-picker/src/ColorPicker/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,21 +218,21 @@ type: example
218218
contrastAgainst,
219219
renderContrastErrorMessage: (contrast, minContrast) => [
220220
{
221-
type: 'error',
221+
type: 'newError',
222222
text: `Not high enough contrast. Minimum required is ${minContrast}:1, current is ${contrast}:1`
223223
}
224224
]
225225
}
226226
}
227227
renderInvalidColorMessage={(hexCode) => [
228228
{
229-
type: 'error',
229+
type: 'newError',
230230
text: `Not valid hex color. It should be either 3, 6 or 8 character long.`
231231
}
232232
]}
233233
renderIsRequiredMessage={() => [
234234
{
235-
type: 'error',
235+
type: 'newError',
236236
text: `This field is required, please enter a valid hex code`
237237
}
238238
]}
@@ -334,17 +334,17 @@ type: example
334334
{ type: "success", text: "I am a contrast success message" },
335335
],
336336
renderContrastErrorMessage: () => [
337-
{ type: "error", text: "I am a contrast warning message" },
337+
{ type: "newError", text: "I am a contrast warning message" },
338338
],
339339
}}
340340
renderMessages={() => [
341341
{ type: "hint", text: "I can display anything, at any time" },
342342
]}
343343
renderInvalidColorMessage={() => [
344-
{ type: "error", text: "I am an invalid color message" },
344+
{ type: "newError", text: "I am an invalid color message" },
345345
]}
346346
renderIsRequiredMessage={() => [
347-
{ type: "error", text: "I am a required message" },
347+
{ type: "newError", text: "I am a required message" },
348348
]}
349349
placeholderText="Enter HEX"
350350
/>

packages/ui-date-input/src/DateInput/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ class Example extends React.Component {
9292
// could not be parsed and so the date is invalid
9393
if (!selectedDate && value) {
9494
return {
95-
messages: [{ type: 'error', text: 'This date is invalid' }],
95+
messages: [{ type: 'newError', text: 'This date is invalid' }],
9696
}
9797
}
9898
// Display a message if the user has typed in a value that corresponds to a
9999
// disabledDate
100100
if (this.isDisabledDate(parseDate(selectedDate))) {
101101
return {
102-
messages: [{ type: 'error', text: 'This date is disabled' }],
102+
messages: [{ type: 'newError', text: 'This date is disabled' }],
103103
}
104104
}
105105
})

packages/ui-date-input/src/DateInput2/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ const Example = () => {
197197
// don't validate empty input
198198
if (!utcIsoDate && inputValue.length > 0) {
199199
setMessages([{
200-
type: 'error',
200+
type: 'newError',
201201
text: 'This is not a valid date'
202202
}])
203203
} else if (date < new Date('1990-01-01')) {
204204
setMessages([{
205-
type: 'error',
205+
type: 'newError',
206206
text: 'Select date after January 1, 1990'
207207
}])
208208
} else {

packages/ui-file-drop/src/FileDrop/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ type: example
104104
accept=".jpg"
105105
onDropAccepted={([file]) => { console.log(`File accepted ${file.name}`) }}
106106
onDropRejected={([file]) => { console.log(`File rejected ${file.name}`) }}
107-
messages={[{ text: 'Invalid file type', type: 'error' }]}
107+
messages={[{ text: 'Invalid file type', type: 'newError' }]}
108108
renderLabel={
109109
<Billboard
110110
size="small"

packages/ui-form-field/src/FormFieldGroup/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type: example
2020
>
2121
<TextInput renderLabel="Favorite Breakfast Eatery"
2222
messages={[
23-
{ text: 'Invalid name', type: 'error' }
23+
{ text: 'Invalid name', type: 'newError' }
2424
]}
2525
/>
2626
<TextInput renderLabel="Favorite Side Dish" />
@@ -80,7 +80,7 @@ type: example
8080
layout="stacked"
8181
rowSpacing="large"
8282
messages={[
83-
{ text: 'Complete All Fields', type: 'error' }
83+
{ text: 'Complete All Fields', type: 'newError' }
8484
]}
8585
>
8686
<RadioInputGroup

packages/ui-number-input/src/NumberInput/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ const Example = () => {
7979

8080
const invalidNumber = (value) => {
8181
setMessages([
82-
{ text: `'${value}' is not a valid number.`, type: 'error' }
82+
{ text: `'${value}' is not a valid number.`, type: 'newError' }
8383
])
8484
}
8585

8686
const required = () => {
87-
setMessages([{ text: 'This is required.', type: 'error' }])
87+
setMessages([{ text: 'This is required.', type: 'newError' }])
8888
}
8989

9090
const toggleDisabled = (event) => {

packages/ui-text-area/src/TextArea/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ A `TextArea` with errors:
3838
---
3939
type: example
4040
---
41-
<TextArea messages={[{ text: 'Invalid description', type: 'error' }]} label="Description" />
41+
<TextArea messages={[{ text: 'Invalid description', type: 'newError' }]} label="Description" />
4242
```
4343

4444
A disabled `TextArea`:

packages/ui-text-input/src/TextInput/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type: example
4848
messages: [
4949
{
5050
text: `Come on. There's no way your favorite band is really Supertramp.`,
51-
type: 'error'
51+
type: 'newError'
5252
}
5353
]
5454
})
@@ -129,7 +129,7 @@ type: example
129129
setMessages([
130130
{
131131
text: "Come on. There's no way your favorite band is really Supertramp.",
132-
type: 'error'
132+
type: 'newError'
133133
}
134134
])
135135
}

0 commit comments

Comments
 (0)